ocx 2.0.3 → 2.0.5

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 (2) hide show
  1. package/dist/index.js +175 -132
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -1,68 +1,107 @@
1
1
  #!/usr/bin/env -S bun --no-env-file
2
2
  // @bun
3
- var t$=Object.create;var{getPrototypeOf:e$,defineProperty:o8,getOwnPropertyNames:D_}=Object;var F_=Object.prototype.hasOwnProperty;var f3=(D,F,B)=>{B=D!=null?t$(e$(D)):{};let $=F||!D||!D.__esModule?o8(B,"default",{value:D,enumerable:!0}):B;for(let _ of D_(D))if(!F_.call($,_))o8($,_,{get:()=>D[_],enumerable:!0});return $};var d0=(D,F)=>()=>(F||D((F={exports:{}}).exports,F),F.exports);var j2=(D,F)=>{for(var B in F)o8(D,B,{get:F[B],enumerable:!0,configurable:!0,set:($)=>F[B]=()=>$})};var V=(D,F)=>()=>(D&&(F=D(D=0)),F);var WF=import.meta.require;function _3(D,F=!1){let B=D.length,$=0,_="",Q=0,Y=16,q=0,H=0,J=0,X=0,z=0;function M(N,x){let O=0,b=0;while(O<N||!x){let L=D.charCodeAt($);if(L>=48&&L<=57)b=b*16+L-48;else if(L>=65&&L<=70)b=b*16+L-65+10;else if(L>=97&&L<=102)b=b*16+L-97+10;else break;$++,O++}if(O<N)b=-1;return b}function A(N){$=N,_="",Q=0,Y=16,z=0}function K(){let N=$;if(D.charCodeAt($)===48)$++;else{$++;while($<D.length&&zF(D.charCodeAt($)))$++}if($<D.length&&D.charCodeAt($)===46)if($++,$<D.length&&zF(D.charCodeAt($))){$++;while($<D.length&&zF(D.charCodeAt($)))$++}else return z=3,D.substring(N,$);let x=$;if($<D.length&&(D.charCodeAt($)===69||D.charCodeAt($)===101)){if($++,$<D.length&&D.charCodeAt($)===43||D.charCodeAt($)===45)$++;if($<D.length&&zF(D.charCodeAt($))){$++;while($<D.length&&zF(D.charCodeAt($)))$++;x=$}else z=3}return D.substring(N,x)}function j(){let N="",x=$;while(!0){if($>=B){N+=D.substring(x,$),z=2;break}let O=D.charCodeAt($);if(O===34){N+=D.substring(x,$),$++;break}if(O===92){if(N+=D.substring(x,$),$++,$>=B){z=2;break}switch(D.charCodeAt($++)){case 34:N+='"';break;case 92:N+="\\";break;case 47:N+="/";break;case 98:N+="\b";break;case 102:N+="\f";break;case 110:N+=`
4
- `;break;case 114:N+="\r";break;case 116:N+="\t";break;case 117:let L=M(4,!0);if(L>=0)N+=String.fromCharCode(L);else z=4;break;default:z=5}x=$;continue}if(O>=0&&O<=31)if($3(O)){N+=D.substring(x,$),z=2;break}else z=6;$++}return N}function S(){if(_="",z=0,Q=$,H=q,X=J,$>=B)return Q=B,Y=17;let N=D.charCodeAt($);if(r8(N)){do $++,_+=String.fromCharCode(N),N=D.charCodeAt($);while(r8(N));return Y=15}if($3(N)){if($++,_+=String.fromCharCode(N),N===13&&D.charCodeAt($)===10)$++,_+=`
5
- `;return q++,J=$,Y=14}switch(N){case 123:return $++,Y=1;case 125:return $++,Y=2;case 91:return $++,Y=3;case 93:return $++,Y=4;case 58:return $++,Y=6;case 44:return $++,Y=5;case 34:return $++,_=j(),Y=10;case 47:let x=$-1;if(D.charCodeAt($+1)===47){$+=2;while($<B){if($3(D.charCodeAt($)))break;$++}return _=D.substring(x,$),Y=12}if(D.charCodeAt($+1)===42){$+=2;let O=B-1,b=!1;while($<O){let L=D.charCodeAt($);if(L===42&&D.charCodeAt($+1)===47){$+=2,b=!0;break}if($++,$3(L)){if(L===13&&D.charCodeAt($)===10)$++;q++,J=$}}if(!b)$++,z=1;return _=D.substring(x,$),Y=13}return _+=String.fromCharCode(N),$++,Y=16;case 45:if(_+=String.fromCharCode(N),$++,$===B||!zF(D.charCodeAt($)))return Y=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return _+=K(),Y=11;default:while($<B&&Z(N))$++,N=D.charCodeAt($);if(Q!==$){switch(_=D.substring(Q,$),_){case"true":return Y=8;case"false":return Y=9;case"null":return Y=7}return Y=16}return _+=String.fromCharCode(N),$++,Y=16}}function Z(N){if(r8(N)||$3(N))return!1;switch(N){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function s(){let N;do N=S();while(N>=12&&N<=15);return N}return{setPosition:A,getPosition:()=>$,scan:F?s:S,getToken:()=>Y,getTokenValue:()=>_,getTokenOffset:()=>Q,getTokenLength:()=>$-Q,getTokenStartLine:()=>H,getTokenStartCharacter:()=>Q-X,getTokenError:()=>z}}function r8(D){return D===32||D===9}function $3(D){return D===10||D===13}function zF(D){return D>=48&&D<=57}var r6;var h3=V(()=>{(function(D){D[D.lineFeed=10]="lineFeed",D[D.carriageReturn=13]="carriageReturn",D[D.space=32]="space",D[D._0=48]="_0",D[D._1=49]="_1",D[D._2=50]="_2",D[D._3=51]="_3",D[D._4=52]="_4",D[D._5=53]="_5",D[D._6=54]="_6",D[D._7=55]="_7",D[D._8=56]="_8",D[D._9=57]="_9",D[D.a=97]="a",D[D.b=98]="b",D[D.c=99]="c",D[D.d=100]="d",D[D.e=101]="e",D[D.f=102]="f",D[D.g=103]="g",D[D.h=104]="h",D[D.i=105]="i",D[D.j=106]="j",D[D.k=107]="k",D[D.l=108]="l",D[D.m=109]="m",D[D.n=110]="n",D[D.o=111]="o",D[D.p=112]="p",D[D.q=113]="q",D[D.r=114]="r",D[D.s=115]="s",D[D.t=116]="t",D[D.u=117]="u",D[D.v=118]="v",D[D.w=119]="w",D[D.x=120]="x",D[D.y=121]="y",D[D.z=122]="z",D[D.A=65]="A",D[D.B=66]="B",D[D.C=67]="C",D[D.D=68]="D",D[D.E=69]="E",D[D.F=70]="F",D[D.G=71]="G",D[D.H=72]="H",D[D.I=73]="I",D[D.J=74]="J",D[D.K=75]="K",D[D.L=76]="L",D[D.M=77]="M",D[D.N=78]="N",D[D.O=79]="O",D[D.P=80]="P",D[D.Q=81]="Q",D[D.R=82]="R",D[D.S=83]="S",D[D.T=84]="T",D[D.U=85]="U",D[D.V=86]="V",D[D.W=87]="W",D[D.X=88]="X",D[D.Y=89]="Y",D[D.Z=90]="Z",D[D.asterisk=42]="asterisk",D[D.backslash=92]="backslash",D[D.closeBrace=125]="closeBrace",D[D.closeBracket=93]="closeBracket",D[D.colon=58]="colon",D[D.comma=44]="comma",D[D.dot=46]="dot",D[D.doubleQuote=34]="doubleQuote",D[D.minus=45]="minus",D[D.openBrace=123]="openBrace",D[D.openBracket=91]="openBracket",D[D.plus=43]="plus",D[D.slash=47]="slash",D[D.formFeed=12]="formFeed",D[D.tab=9]="tab"})(r6||(r6={}))});var q0,t8,t6;var e6=V(()=>{q0=Array(20).fill(0).map((D,F)=>{return" ".repeat(F)}),t8={" ":{"\n":Array(200).fill(0).map((D,F)=>{return`
6
- `+" ".repeat(F)}),"\r":Array(200).fill(0).map((D,F)=>{return"\r"+" ".repeat(F)}),"\r\n":Array(200).fill(0).map((D,F)=>{return`\r
7
- `+" ".repeat(F)})},"\t":{"\n":Array(200).fill(0).map((D,F)=>{return`
8
- `+"\t".repeat(F)}),"\r":Array(200).fill(0).map((D,F)=>{return"\r"+"\t".repeat(F)}),"\r\n":Array(200).fill(0).map((D,F)=>{return`\r
9
- `+"\t".repeat(F)})}},t6=[`
3
+ var hW=Object.create;var{getPrototypeOf:cW,defineProperty:o8,getOwnPropertyNames:lW}=Object;var dW=Object.prototype.hasOwnProperty;var tY=($,_,U)=>{U=$!=null?hW(cW($)):{};let Q=_||!$||!$.__esModule?o8(U,"default",{value:$,enumerable:!0}):U;for(let v of lW($))if(!dW.call(Q,v))o8(Q,v,{get:()=>$[v],enumerable:!0});return Q};var N6=($,_)=>()=>(_||$((_={exports:{}}).exports,_),_.exports);var s$=($,_)=>{for(var U in _)o8($,U,{get:_[U],enumerable:!0,configurable:!0,set:(Q)=>_[U]=()=>Q})};var b=($,_)=>()=>($&&(_=$($=0)),_);var P1=import.meta.require;function l0($,_=!1){let U=$.length,Q=0,v="",J=0,Y=16,z=0,I=0,X=0,q=0,G=0;function j(A,u){let k=0,O=0;while(k<A||!u){let w=$.charCodeAt(Q);if(w>=48&&w<=57)O=O*16+w-48;else if(w>=65&&w<=70)O=O*16+w-65+10;else if(w>=97&&w<=102)O=O*16+w-97+10;else break;Q++,k++}if(k<A)O=-1;return O}function H(A){Q=A,v="",J=0,Y=16,G=0}function Z(){let A=Q;if($.charCodeAt(Q)===48)Q++;else{Q++;while(Q<$.length&&x1($.charCodeAt(Q)))Q++}if(Q<$.length&&$.charCodeAt(Q)===46)if(Q++,Q<$.length&&x1($.charCodeAt(Q))){Q++;while(Q<$.length&&x1($.charCodeAt(Q)))Q++}else return G=3,$.substring(A,Q);let u=Q;if(Q<$.length&&($.charCodeAt(Q)===69||$.charCodeAt(Q)===101)){if(Q++,Q<$.length&&$.charCodeAt(Q)===43||$.charCodeAt(Q)===45)Q++;if(Q<$.length&&x1($.charCodeAt(Q))){Q++;while(Q<$.length&&x1($.charCodeAt(Q)))Q++;u=Q}else G=3}return $.substring(A,u)}function V(){let A="",u=Q;while(!0){if(Q>=U){A+=$.substring(u,Q),G=2;break}let k=$.charCodeAt(Q);if(k===34){A+=$.substring(u,Q),Q++;break}if(k===92){if(A+=$.substring(u,Q),Q++,Q>=U){G=2;break}switch($.charCodeAt(Q++)){case 34:A+='"';break;case 92:A+="\\";break;case 47:A+="/";break;case 98:A+="\b";break;case 102:A+="\f";break;case 110:A+=`
4
+ `;break;case 114:A+="\r";break;case 116:A+="\t";break;case 117:let w=j(4,!0);if(w>=0)A+=String.fromCharCode(w);else G=4;break;default:G=5}u=Q;continue}if(k>=0&&k<=31)if(c0(k)){A+=$.substring(u,Q),G=2;break}else G=6;Q++}return A}function S(){if(v="",G=0,J=Q,I=z,q=X,Q>=U)return J=U,Y=17;let A=$.charCodeAt(Q);if(t8(A)){do Q++,v+=String.fromCharCode(A),A=$.charCodeAt(Q);while(t8(A));return Y=15}if(c0(A)){if(Q++,v+=String.fromCharCode(A),A===13&&$.charCodeAt(Q)===10)Q++,v+=`
5
+ `;return z++,X=Q,Y=14}switch(A){case 123:return Q++,Y=1;case 125:return Q++,Y=2;case 91:return Q++,Y=3;case 93:return Q++,Y=4;case 58:return Q++,Y=6;case 44:return Q++,Y=5;case 34:return Q++,v=V(),Y=10;case 47:let u=Q-1;if($.charCodeAt(Q+1)===47){Q+=2;while(Q<U){if(c0($.charCodeAt(Q)))break;Q++}return v=$.substring(u,Q),Y=12}if($.charCodeAt(Q+1)===42){Q+=2;let k=U-1,O=!1;while(Q<k){let w=$.charCodeAt(Q);if(w===42&&$.charCodeAt(Q+1)===47){Q+=2,O=!0;break}if(Q++,c0(w)){if(w===13&&$.charCodeAt(Q)===10)Q++;z++,X=Q}}if(!O)Q++,G=1;return v=$.substring(u,Q),Y=13}return v+=String.fromCharCode(A),Q++,Y=16;case 45:if(v+=String.fromCharCode(A),Q++,Q===U||!x1($.charCodeAt(Q)))return Y=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return v+=Z(),Y=11;default:while(Q<U&&T(A))Q++,A=$.charCodeAt(Q);if(J!==Q){switch(v=$.substring(J,Q),v){case"true":return Y=8;case"false":return Y=9;case"null":return Y=7}return Y=16}return v+=String.fromCharCode(A),Q++,Y=16}}function T(A){if(t8(A)||c0(A))return!1;switch(A){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function r(){let A;do A=S();while(A>=12&&A<=15);return A}return{setPosition:H,getPosition:()=>Q,scan:_?r:S,getToken:()=>Y,getTokenValue:()=>v,getTokenOffset:()=>J,getTokenLength:()=>Q-J,getTokenStartLine:()=>I,getTokenStartCharacter:()=>J-q,getTokenError:()=>G}}function t8($){return $===32||$===9}function c0($){return $===10||$===13}function x1($){return $>=48&&$<=57}var aY;var vv=b(()=>{(function($){$[$.lineFeed=10]="lineFeed",$[$.carriageReturn=13]="carriageReturn",$[$.space=32]="space",$[$._0=48]="_0",$[$._1=49]="_1",$[$._2=50]="_2",$[$._3=51]="_3",$[$._4=52]="_4",$[$._5=53]="_5",$[$._6=54]="_6",$[$._7=55]="_7",$[$._8=56]="_8",$[$._9=57]="_9",$[$.a=97]="a",$[$.b=98]="b",$[$.c=99]="c",$[$.d=100]="d",$[$.e=101]="e",$[$.f=102]="f",$[$.g=103]="g",$[$.h=104]="h",$[$.i=105]="i",$[$.j=106]="j",$[$.k=107]="k",$[$.l=108]="l",$[$.m=109]="m",$[$.n=110]="n",$[$.o=111]="o",$[$.p=112]="p",$[$.q=113]="q",$[$.r=114]="r",$[$.s=115]="s",$[$.t=116]="t",$[$.u=117]="u",$[$.v=118]="v",$[$.w=119]="w",$[$.x=120]="x",$[$.y=121]="y",$[$.z=122]="z",$[$.A=65]="A",$[$.B=66]="B",$[$.C=67]="C",$[$.D=68]="D",$[$.E=69]="E",$[$.F=70]="F",$[$.G=71]="G",$[$.H=72]="H",$[$.I=73]="I",$[$.J=74]="J",$[$.K=75]="K",$[$.L=76]="L",$[$.M=77]="M",$[$.N=78]="N",$[$.O=79]="O",$[$.P=80]="P",$[$.Q=81]="Q",$[$.R=82]="R",$[$.S=83]="S",$[$.T=84]="T",$[$.U=85]="U",$[$.V=86]="V",$[$.W=87]="W",$[$.X=88]="X",$[$.Y=89]="Y",$[$.Z=90]="Z",$[$.asterisk=42]="asterisk",$[$.backslash=92]="backslash",$[$.closeBrace=125]="closeBrace",$[$.closeBracket=93]="closeBracket",$[$.colon=58]="colon",$[$.comma=44]="comma",$[$.dot=46]="dot",$[$.doubleQuote=34]="doubleQuote",$[$.minus=45]="minus",$[$.openBrace=123]="openBrace",$[$.openBracket=91]="openBracket",$[$.plus=43]="plus",$[$.slash=47]="slash",$[$.formFeed=12]="formFeed",$[$.tab=9]="tab"})(aY||(aY={}))});var M4,a8,sY;var eY=b(()=>{M4=Array(20).fill(0).map(($,_)=>{return" ".repeat(_)}),a8={" ":{"\n":Array(200).fill(0).map(($,_)=>{return`
6
+ `+" ".repeat(_)}),"\r":Array(200).fill(0).map(($,_)=>{return"\r"+" ".repeat(_)}),"\r\n":Array(200).fill(0).map(($,_)=>{return`\r
7
+ `+" ".repeat(_)})},"\t":{"\n":Array(200).fill(0).map(($,_)=>{return`
8
+ `+"\t".repeat(_)}),"\r":Array(200).fill(0).map(($,_)=>{return"\r"+"\t".repeat(_)}),"\r\n":Array(200).fill(0).map(($,_)=>{return`\r
9
+ `+"\t".repeat(_)})}},sY=[`
10
10
  `,"\r",`\r
11
- `]});function e8(D,F,B){let $,_,Q,Y,q;if(F){Y=F.offset,q=Y+F.length,Q=Y;while(Q>0&&!Q3(D,Q-1))Q--;let O=q;while(O<D.length&&!Q3(D,O))O++;_=D.substring(Q,O),$=$_(_,B)}else _=D,$=0,Q=0,Y=0,q=D.length;let H=__(B,D),J=t6.includes(H),X=0,z=0,M;if(B.insertSpaces)M=q0[B.tabSize||4]??MF(q0[1],B.tabSize||4);else M="\t";let A=M==="\t"?"\t":" ",K=_3(_,!1),j=!1;function S(){if(X>1)return MF(H,X)+MF(M,$+z);let O=M.length*($+z);if(!J||O>t8[A][H].length)return H+MF(M,$+z);if(O<=0)return H;return t8[A][H][O]}function Z(){let O=K.scan();X=0;while(O===15||O===14){if(O===14&&B.keepLines)X+=1;else if(O===14)X=1;O=K.scan()}return j=O===16||K.getTokenError()!==0,O}let s=[];function N(O,b,L){if(!j&&(!F||b<q&&L>Y)&&D.substring(b,L)!==O)s.push({offset:b,length:L-b,content:O})}let x=Z();if(B.keepLines&&X>0)N(MF(H,X),0,0);if(x!==17){let O=K.getTokenOffset()+Q,b=M.length*$<20&&B.insertSpaces?q0[M.length*$]:MF(M,$);N(b,Q,O)}while(x!==17){let O=K.getTokenOffset()+K.getTokenLength()+Q,b=Z(),L="",e=!1;while(X===0&&(b===12||b===13)){let FD=K.getTokenOffset()+Q;N(q0[1],O,FD),O=K.getTokenOffset()+K.getTokenLength()+Q,e=b===12,L=e?S():"",b=Z()}if(b===2){if(x!==1)z--;if(B.keepLines&&X>0||!B.keepLines&&x!==1)L=S();else if(B.keepLines)L=q0[1]}else if(b===4){if(x!==3)z--;if(B.keepLines&&X>0||!B.keepLines&&x!==3)L=S();else if(B.keepLines)L=q0[1]}else{switch(x){case 3:case 1:if(z++,B.keepLines&&X>0||!B.keepLines)L=S();else L=q0[1];break;case 5:if(B.keepLines&&X>0||!B.keepLines)L=S();else L=q0[1];break;case 12:L=S();break;case 13:if(X>0)L=S();else if(!e)L=q0[1];break;case 6:if(B.keepLines&&X>0)L=S();else if(!e)L=q0[1];break;case 10:if(B.keepLines&&X>0)L=S();else if(b===6&&!e)L="";break;case 7:case 8:case 9:case 11:case 2:case 4:if(B.keepLines&&X>0)L=S();else if((b===12||b===13)&&!e)L=q0[1];else if(b!==5&&b!==17)j=!0;break;case 16:j=!0;break}if(X>0&&(b===12||b===13))L=S()}if(b===17)if(B.keepLines&&X>0)L=S();else L=B.insertFinalNewline?H:"";let p=K.getTokenOffset()+Q;N(L,O,p),x=b}return s}function MF(D,F){let B="";for(let $=0;$<F;$++)B+=D;return B}function $_(D,F){let B=0,$=0,_=F.tabSize||4;while(B<D.length){let Q=D.charAt(B);if(Q===q0[1])$++;else if(Q==="\t")$+=_;else break;B++}return Math.floor($/_)}function __(D,F){for(let B=0;B<F.length;B++){let $=F.charAt(B);if($==="\r"){if(B+1<F.length&&F.charAt(B+1)===`
11
+ `]});function s8($,_,U){let Q,v,J,Y,z;if(_){Y=_.offset,z=Y+_.length,J=Y;while(J>0&&!d0($,J-1))J--;let k=z;while(k<$.length&&!d0($,k))k++;v=$.substring(J,k),Q=iW(v,U)}else v=$,Q=0,J=0,Y=0,z=$.length;let I=nW(U,$),X=sY.includes(I),q=0,G=0,j;if(U.insertSpaces)j=M4[U.tabSize||4]??u1(M4[1],U.tabSize||4);else j="\t";let H=j==="\t"?"\t":" ",Z=l0(v,!1),V=!1;function S(){if(q>1)return u1(I,q)+u1(j,Q+G);let k=j.length*(Q+G);if(!X||k>a8[H][I].length)return I+u1(j,Q+G);if(k<=0)return I;return a8[H][I][k]}function T(){let k=Z.scan();q=0;while(k===15||k===14){if(k===14&&U.keepLines)q+=1;else if(k===14)q=1;k=Z.scan()}return V=k===16||Z.getTokenError()!==0,k}let r=[];function A(k,O,w){if(!V&&(!_||O<z&&w>Y)&&$.substring(O,w)!==k)r.push({offset:O,length:w-O,content:k})}let u=T();if(U.keepLines&&q>0)A(u1(I,q),0,0);if(u!==17){let k=Z.getTokenOffset()+J,O=j.length*Q<20&&U.insertSpaces?M4[j.length*Q]:u1(j,Q);A(O,J,k)}while(u!==17){let k=Z.getTokenOffset()+Z.getTokenLength()+J,O=T(),w="",v$=!1;while(q===0&&(O===12||O===13)){let Q$=Z.getTokenOffset()+J;A(M4[1],k,Q$),k=Z.getTokenOffset()+Z.getTokenLength()+J,v$=O===12,w=v$?S():"",O=T()}if(O===2){if(u!==1)G--;if(U.keepLines&&q>0||!U.keepLines&&u!==1)w=S();else if(U.keepLines)w=M4[1]}else if(O===4){if(u!==3)G--;if(U.keepLines&&q>0||!U.keepLines&&u!==3)w=S();else if(U.keepLines)w=M4[1]}else{switch(u){case 3:case 1:if(G++,U.keepLines&&q>0||!U.keepLines)w=S();else w=M4[1];break;case 5:if(U.keepLines&&q>0||!U.keepLines)w=S();else w=M4[1];break;case 12:w=S();break;case 13:if(q>0)w=S();else if(!v$)w=M4[1];break;case 6:if(U.keepLines&&q>0)w=S();else if(!v$)w=M4[1];break;case 10:if(U.keepLines&&q>0)w=S();else if(O===6&&!v$)w="";break;case 7:case 8:case 9:case 11:case 2:case 4:if(U.keepLines&&q>0)w=S();else if((O===12||O===13)&&!v$)w=M4[1];else if(O!==5&&O!==17)V=!0;break;case 16:V=!0;break}if(q>0&&(O===12||O===13))w=S()}if(O===17)if(U.keepLines&&q>0)w=S();else w=U.insertFinalNewline?I:"";let o=Z.getTokenOffset()+J;A(w,k,o),u=O}return r}function u1($,_){let U="";for(let Q=0;Q<_;Q++)U+=$;return U}function iW($,_){let U=0,Q=0,v=_.tabSize||4;while(U<$.length){let J=$.charAt(U);if(J===M4[1])Q++;else if(J==="\t")Q+=v;else break;U++}return Math.floor(Q/v)}function nW($,_){for(let U=0;U<_.length;U++){let Q=_.charAt(U);if(Q==="\r"){if(U+1<_.length&&_.charAt(U+1)===`
12
12
  `)return`\r
13
- `;return"\r"}else if($===`
13
+ `;return"\r"}else if(Q===`
14
14
  `)return`
15
- `}return D&&D.eol||`
16
- `}function Q3(D,F){return`\r
17
- `.indexOf(D.charAt(F))!==-1}var D1=V(()=>{h3();e6()});function D7(D,F=[],B=Y3.DEFAULT){let $=null,_=[],Q=[];function Y(H){if(Array.isArray(_))_.push(H);else if($!==null)_[$]=H}return B1(D,{onObjectBegin:()=>{let H={};Y(H),Q.push(_),_=H,$=null},onObjectProperty:(H)=>{$=H},onObjectEnd:()=>{_=Q.pop()},onArrayBegin:()=>{let H=[];Y(H),Q.push(_),_=H,$=null},onArrayEnd:()=>{_=Q.pop()},onLiteralValue:Y,onError:(H,J,X)=>{F.push({error:H,offset:J,length:X})}},B),_[0]}function F1(D,F=[],B=Y3.DEFAULT){let $={type:"array",offset:-1,length:-1,children:[],parent:void 0};function _(H){if($.type==="property")$.length=H-$.offset,$=$.parent}function Q(H){return $.children.push(H),H}B1(D,{onObjectBegin:(H)=>{$=Q({type:"object",offset:H,length:-1,parent:$,children:[]})},onObjectProperty:(H,J,X)=>{$=Q({type:"property",offset:J,length:-1,parent:$,children:[]}),$.children.push({type:"string",value:H,offset:J,length:X,parent:$})},onObjectEnd:(H,J)=>{_(H+J),$.length=H+J-$.offset,$=$.parent,_(H+J)},onArrayBegin:(H,J)=>{$=Q({type:"array",offset:H,length:-1,parent:$,children:[]})},onArrayEnd:(H,J)=>{$.length=H+J-$.offset,$=$.parent,_(H+J)},onLiteralValue:(H,J,X)=>{Q({type:Y_(H),offset:J,length:X,parent:$,value:H}),_(J+X)},onSeparator:(H,J,X)=>{if($.type==="property"){if(H===":")$.colonOffset=J;else if(H===",")_(J)}},onError:(H,J,X)=>{F.push({error:H,offset:J,length:X})}},B);let q=$.children[0];if(q)delete q.parent;return q}function m3(D,F){if(!D)return;let B=D;for(let $ of F)if(typeof $==="string"){if(B.type!=="object"||!Array.isArray(B.children))return;let _=!1;for(let Q of B.children)if(Array.isArray(Q.children)&&Q.children[0].value===$&&Q.children.length===2){B=Q.children[1],_=!0;break}if(!_)return}else{let _=$;if(B.type!=="array"||_<0||!Array.isArray(B.children)||_>=B.children.length)return;B=B.children[_]}return B}function B1(D,F,B=Y3.DEFAULT){let $=_3(D,!1),_=[],Q=0;function Y(v){return v?()=>Q===0&&v($.getTokenOffset(),$.getTokenLength(),$.getTokenStartLine(),$.getTokenStartCharacter()):()=>!0}function q(v){return v?(f)=>Q===0&&v(f,$.getTokenOffset(),$.getTokenLength(),$.getTokenStartLine(),$.getTokenStartCharacter()):()=>!0}function H(v){return v?(f)=>Q===0&&v(f,$.getTokenOffset(),$.getTokenLength(),$.getTokenStartLine(),$.getTokenStartCharacter(),()=>_.slice()):()=>!0}function J(v){return v?()=>{if(Q>0)Q++;else if(v($.getTokenOffset(),$.getTokenLength(),$.getTokenStartLine(),$.getTokenStartCharacter(),()=>_.slice())===!1)Q=1}:()=>!0}function X(v){return v?()=>{if(Q>0)Q--;if(Q===0)v($.getTokenOffset(),$.getTokenLength(),$.getTokenStartLine(),$.getTokenStartCharacter())}:()=>!0}let z=J(F.onObjectBegin),M=H(F.onObjectProperty),A=X(F.onObjectEnd),K=J(F.onArrayBegin),j=X(F.onArrayEnd),S=H(F.onLiteralValue),Z=q(F.onSeparator),s=Y(F.onComment),N=q(F.onError),x=B&&B.disallowComments,O=B&&B.allowTrailingComma;function b(){while(!0){let v=$.scan();switch($.getTokenError()){case 4:L(14);break;case 5:L(15);break;case 3:L(13);break;case 1:if(!x)L(11);break;case 2:L(12);break;case 6:L(16);break}switch(v){case 12:case 13:if(x)L(10);else s();break;case 16:L(1);break;case 15:case 14:break;default:return v}}}function L(v,f=[],_D=[]){if(N(v),f.length+_D.length>0){let r=$.getToken();while(r!==17){if(f.indexOf(r)!==-1){b();break}else if(_D.indexOf(r)!==-1)break;r=b()}}}function e(v){let f=$.getTokenValue();if(v)S(f);else M(f),_.push(f);return b(),!0}function p(){switch($.getToken()){case 11:let v=$.getTokenValue(),f=Number(v);if(isNaN(f))L(2),f=0;S(f);break;case 7:S(null);break;case 8:S(!0);break;case 9:S(!1);break;default:return!1}return b(),!0}function FD(){if($.getToken()!==10)return L(3,[],[2,5]),!1;if(e(!1),$.getToken()===6){if(Z(":"),b(),!i())L(4,[],[2,5])}else L(5,[],[2,5]);return _.pop(),!0}function KD(){z(),b();let v=!1;while($.getToken()!==2&&$.getToken()!==17){if($.getToken()===5){if(!v)L(4,[],[]);if(Z(","),b(),$.getToken()===2&&O)break}else if(v)L(6,[],[]);if(!FD())L(4,[],[2,5]);v=!0}if(A(),$.getToken()!==2)L(7,[2],[]);else b();return!0}function k(){K(),b();let v=!0,f=!1;while($.getToken()!==4&&$.getToken()!==17){if($.getToken()===5){if(!f)L(4,[],[]);if(Z(","),b(),$.getToken()===4&&O)break}else if(f)L(6,[],[]);if(v)_.push(0),v=!1;else _[_.length-1]++;if(!i())L(4,[],[4,5]);f=!0}if(j(),!v)_.pop();if($.getToken()!==4)L(8,[4],[]);else b();return!0}function i(){switch($.getToken()){case 3:return k();case 1:return KD();case 10:return e(!0);default:return p()}}if(b(),$.getToken()===17){if(B.allowEmptyContent)return!0;return L(4,[],[]),!1}if(!i())return L(4,[],[]),!1;if($.getToken()!==17)L(9,[],[]);return!0}function Y_(D){switch(typeof D){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(!D)return"null";else if(Array.isArray(D))return"array";return"object"}default:return"null"}}var Y3;var $1=V(()=>{h3();(function(D){D.DEFAULT={allowTrailingComma:!1}})(Y3||(Y3={}))});function F7(D,F,B,$){let _=F.slice(),Y=F1(D,[]),q=void 0,H=void 0;while(_.length>0)if(H=_.pop(),q=m3(Y,_),q===void 0&&B!==void 0)if(typeof H==="string")B={[H]:B};else B=[B];else break;if(!q){if(B===void 0)throw Error("Can not delete in empty document");return P2(D,{offset:Y?Y.offset:0,length:Y?Y.length:0,content:JSON.stringify(B)},$)}else if(q.type==="object"&&typeof H==="string"&&Array.isArray(q.children)){let J=m3(q,[H]);if(J!==void 0)if(B===void 0){if(!J.parent)throw Error("Malformed AST");let X=q.children.indexOf(J.parent),z,M=J.parent.offset+J.parent.length;if(X>0){let A=q.children[X-1];z=A.offset+A.length}else if(z=q.offset+1,q.children.length>1)M=q.children[1].offset;return P2(D,{offset:z,length:M-z,content:""},$)}else return P2(D,{offset:J.offset,length:J.length,content:JSON.stringify(B)},$);else{if(B===void 0)return[];let X=`${JSON.stringify(H)}: ${JSON.stringify(B)}`,z=$.getInsertionIndex?$.getInsertionIndex(q.children.map((A)=>A.children[0].value)):q.children.length,M;if(z>0){let A=q.children[z-1];M={offset:A.offset+A.length,length:0,content:","+X}}else if(q.children.length===0)M={offset:q.offset+1,length:0,content:X};else M={offset:q.offset+1,length:0,content:X+","};return P2(D,M,$)}}else if(q.type==="array"&&typeof H==="number"&&Array.isArray(q.children)){let J=H;if(J===-1){let X=`${JSON.stringify(B)}`,z;if(q.children.length===0)z={offset:q.offset+1,length:0,content:X};else{let M=q.children[q.children.length-1];z={offset:M.offset+M.length,length:0,content:","+X}}return P2(D,z,$)}else if(B===void 0&&q.children.length>=0){let X=H,z=q.children[X],M;if(q.children.length===1)M={offset:q.offset+1,length:q.length-2,content:""};else if(q.children.length-1===X){let A=q.children[X-1],K=A.offset+A.length,j=q.offset+q.length;M={offset:K,length:j-2-K,content:""}}else M={offset:z.offset,length:q.children[X+1].offset-z.offset,content:""};return P2(D,M,$)}else if(B!==void 0){let X,z=`${JSON.stringify(B)}`;if(!$.isArrayInsertion&&q.children.length>H){let M=q.children[H];X={offset:M.offset,length:M.length,content:z}}else if(q.children.length===0||H===0)X={offset:q.offset+1,length:0,content:q.children.length===0?z:z+","};else{let M=H>q.children.length?q.children.length:H,A=q.children[M-1];X={offset:A.offset+A.length,length:0,content:","+z}}return P2(D,X,$)}else throw Error(`Can not ${B===void 0?"remove":$.isArrayInsertion?"insert":"modify"} Array index ${J} as length is not sufficient`)}else throw Error(`Can not add ${typeof H!=="number"?"index":"property"} to parent of type ${q.type}`)}function P2(D,F,B){if(!B.formattingOptions)return[F];let $=g3(D,F),_=F.offset,Q=F.offset+F.content.length;if(F.length===0||F.content.length===0){while(_>0&&!Q3($,_-1))_--;while(Q<$.length&&!Q3($,Q))Q++}let Y=e8($,{offset:_,length:Q-_},{...B.formattingOptions,keepLines:!1});for(let H=Y.length-1;H>=0;H--){let J=Y[H];$=g3($,J),_=Math.min(_,J.offset),Q=Math.max(Q,J.offset+J.length),Q+=J.content.length-J.length}let q=D.length-($.length-Q)-_;return[{offset:_,length:q,content:$.substring(_,Q)}]}function g3(D,F){return D.substring(0,F.offset)+F.content+D.substring(F.offset+F.length)}var B7=V(()=>{D1();$1()});function K2(D){switch(D){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return"<unknown ParseErrorCode>"}function AF(D,F,B,$){return F7(D,F,B,$)}function jF(D,F){let B=F.slice(0).sort((_,Q)=>{let Y=_.offset-Q.offset;if(Y===0)return _.length-Q.length;return Y}),$=D.length;for(let _=B.length-1;_>=0;_--){let Q=B[_];if(Q.offset+Q.length<=$)D=g3(D,Q);else throw Error("Overlapping edit");$=Q.offset}return D}var $7,_7,ND,Q7;var b0=V(()=>{D1();B7();h3();$1();(function(D){D[D.None=0]="None",D[D.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",D[D.UnexpectedEndOfString=2]="UnexpectedEndOfString",D[D.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",D[D.InvalidUnicode=4]="InvalidUnicode",D[D.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",D[D.InvalidCharacter=6]="InvalidCharacter"})($7||($7={}));(function(D){D[D.OpenBraceToken=1]="OpenBraceToken",D[D.CloseBraceToken=2]="CloseBraceToken",D[D.OpenBracketToken=3]="OpenBracketToken",D[D.CloseBracketToken=4]="CloseBracketToken",D[D.CommaToken=5]="CommaToken",D[D.ColonToken=6]="ColonToken",D[D.NullKeyword=7]="NullKeyword",D[D.TrueKeyword=8]="TrueKeyword",D[D.FalseKeyword=9]="FalseKeyword",D[D.StringLiteral=10]="StringLiteral",D[D.NumericLiteral=11]="NumericLiteral",D[D.LineCommentTrivia=12]="LineCommentTrivia",D[D.BlockCommentTrivia=13]="BlockCommentTrivia",D[D.LineBreakTrivia=14]="LineBreakTrivia",D[D.Trivia=15]="Trivia",D[D.Unknown=16]="Unknown",D[D.EOF=17]="EOF"})(_7||(_7={}));ND=D7;(function(D){D[D.InvalidSymbol=1]="InvalidSymbol",D[D.InvalidNumberFormat=2]="InvalidNumberFormat",D[D.PropertyNameExpected=3]="PropertyNameExpected",D[D.ValueExpected=4]="ValueExpected",D[D.ColonExpected=5]="ColonExpected",D[D.CommaExpected=6]="CommaExpected",D[D.CloseBraceExpected=7]="CloseBraceExpected",D[D.CloseBracketExpected=8]="CloseBracketExpected",D[D.EndOfFileExpected=9]="EndOfFileExpected",D[D.InvalidCommentToken=10]="InvalidCommentToken",D[D.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",D[D.UnexpectedEndOfString=12]="UnexpectedEndOfString",D[D.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",D[D.InvalidUnicode=14]="InvalidUnicode",D[D.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",D[D.InvalidCharacter=16]="InvalidCharacter"})(Q7||(Q7={}))});var QD,_1,I,c0=(D)=>{switch(typeof D){case"undefined":return I.undefined;case"string":return I.string;case"number":return Number.isNaN(D)?I.nan:I.number;case"boolean":return I.boolean;case"function":return I.function;case"bigint":return I.bigint;case"symbol":return I.symbol;case"object":if(Array.isArray(D))return I.array;if(D===null)return I.null;if(D.then&&typeof D.then==="function"&&D.catch&&typeof D.catch==="function")return I.promise;if(typeof Map<"u"&&D instanceof Map)return I.map;if(typeof Set<"u"&&D instanceof Set)return I.set;if(typeof Date<"u"&&D instanceof Date)return I.date;return I.object;default:return I.unknown}};var q3=V(()=>{(function(D){D.assertEqual=(_)=>{};function F(_){}D.assertIs=F;function B(_){throw Error()}D.assertNever=B,D.arrayToEnum=(_)=>{let Q={};for(let Y of _)Q[Y]=Y;return Q},D.getValidEnumValues=(_)=>{let Q=D.objectKeys(_).filter((q)=>typeof _[_[q]]!=="number"),Y={};for(let q of Q)Y[q]=_[q];return D.objectValues(Y)},D.objectValues=(_)=>{return D.objectKeys(_).map(function(Q){return _[Q]})},D.objectKeys=typeof Object.keys==="function"?(_)=>Object.keys(_):(_)=>{let Q=[];for(let Y in _)if(Object.prototype.hasOwnProperty.call(_,Y))Q.push(Y);return Q},D.find=(_,Q)=>{for(let Y of _)if(Q(Y))return Y;return},D.isInteger=typeof Number.isInteger==="function"?(_)=>Number.isInteger(_):(_)=>typeof _==="number"&&Number.isFinite(_)&&Math.floor(_)===_;function $(_,Q=" | "){return _.map((Y)=>typeof Y==="string"?`'${Y}'`:Y).join(Q)}D.joinValues=$,D.jsonStringifyReplacer=(_,Q)=>{if(typeof Q==="bigint")return Q.toString();return Q}})(QD||(QD={}));(function(D){D.mergeShapes=(F,B)=>{return{...F,...B}}})(_1||(_1={}));I=QD.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var R,J_=(D)=>{return JSON.stringify(D,null,2).replace(/"([^"]+)":/g,"$1:")},cD;var d3=V(()=>{q3();R=QD.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);cD=class cD extends Error{get errors(){return this.issues}constructor(D){super();this.issues=[],this.addIssue=(B)=>{this.issues=[...this.issues,B]},this.addIssues=(B=[])=>{this.issues=[...this.issues,...B]};let F=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,F);else this.__proto__=F;this.name="ZodError",this.issues=D}format(D){let F=D||function(_){return _.message},B={_errors:[]},$=(_)=>{for(let Q of _.issues)if(Q.code==="invalid_union")Q.unionErrors.map($);else if(Q.code==="invalid_return_type")$(Q.returnTypeError);else if(Q.code==="invalid_arguments")$(Q.argumentsError);else if(Q.path.length===0)B._errors.push(F(Q));else{let Y=B,q=0;while(q<Q.path.length){let H=Q.path[q];if(q!==Q.path.length-1)Y[H]=Y[H]||{_errors:[]};else Y[H]=Y[H]||{_errors:[]},Y[H]._errors.push(F(Q));Y=Y[H],q++}}};return $(this),B}static assert(D){if(!(D instanceof cD))throw Error(`Not a ZodError: ${D}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,QD.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(D=(F)=>F.message){let F={},B=[];for(let $ of this.issues)if($.path.length>0){let _=$.path[0];F[_]=F[_]||[],F[_].push(D($))}else B.push(D($));return{formErrors:B,fieldErrors:F}}get formErrors(){return this.flatten()}};cD.create=(D)=>{return new cD(D)}});var X_=(D,F)=>{let B;switch(D.code){case R.invalid_type:if(D.received===I.undefined)B="Required";else B=`Expected ${D.expected}, received ${D.received}`;break;case R.invalid_literal:B=`Invalid literal value, expected ${JSON.stringify(D.expected,QD.jsonStringifyReplacer)}`;break;case R.unrecognized_keys:B=`Unrecognized key(s) in object: ${QD.joinValues(D.keys,", ")}`;break;case R.invalid_union:B="Invalid input";break;case R.invalid_union_discriminator:B=`Invalid discriminator value. Expected ${QD.joinValues(D.options)}`;break;case R.invalid_enum_value:B=`Invalid enum value. Expected ${QD.joinValues(D.options)}, received '${D.received}'`;break;case R.invalid_arguments:B="Invalid function arguments";break;case R.invalid_return_type:B="Invalid function return type";break;case R.invalid_date:B="Invalid date";break;case R.invalid_string:if(typeof D.validation==="object")if("includes"in D.validation){if(B=`Invalid input: must include "${D.validation.includes}"`,typeof D.validation.position==="number")B=`${B} at one or more positions greater than or equal to ${D.validation.position}`}else if("startsWith"in D.validation)B=`Invalid input: must start with "${D.validation.startsWith}"`;else if("endsWith"in D.validation)B=`Invalid input: must end with "${D.validation.endsWith}"`;else QD.assertNever(D.validation);else if(D.validation!=="regex")B=`Invalid ${D.validation}`;else B="Invalid";break;case R.too_small:if(D.type==="array")B=`Array must contain ${D.exact?"exactly":D.inclusive?"at least":"more than"} ${D.minimum} element(s)`;else if(D.type==="string")B=`String must contain ${D.exact?"exactly":D.inclusive?"at least":"over"} ${D.minimum} character(s)`;else if(D.type==="number")B=`Number must be ${D.exact?"exactly equal to ":D.inclusive?"greater than or equal to ":"greater than "}${D.minimum}`;else if(D.type==="bigint")B=`Number must be ${D.exact?"exactly equal to ":D.inclusive?"greater than or equal to ":"greater than "}${D.minimum}`;else if(D.type==="date")B=`Date must be ${D.exact?"exactly equal to ":D.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(D.minimum))}`;else B="Invalid input";break;case R.too_big:if(D.type==="array")B=`Array must contain ${D.exact?"exactly":D.inclusive?"at most":"less than"} ${D.maximum} element(s)`;else if(D.type==="string")B=`String must contain ${D.exact?"exactly":D.inclusive?"at most":"under"} ${D.maximum} character(s)`;else if(D.type==="number")B=`Number must be ${D.exact?"exactly":D.inclusive?"less than or equal to":"less than"} ${D.maximum}`;else if(D.type==="bigint")B=`BigInt must be ${D.exact?"exactly":D.inclusive?"less than or equal to":"less than"} ${D.maximum}`;else if(D.type==="date")B=`Date must be ${D.exact?"exactly":D.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(D.maximum))}`;else B="Invalid input";break;case R.custom:B="Invalid input";break;case R.invalid_intersection_types:B="Intersection results could not be merged";break;case R.not_multiple_of:B=`Number must be a multiple of ${D.multipleOf}`;break;case R.not_finite:B="Number must be finite";break;default:B=F.defaultError,QD.assertNever(D)}return{message:B}},F2;var Q1=V(()=>{d3();q3();F2=X_});function G_(D){Y7=D}function KF(){return Y7}var Y7;var c3=V(()=>{Q1();Y7=F2});function T(D,F){let B=KF(),$=H3({issueData:F,data:D.data,path:D.path,errorMaps:[D.common.contextualErrorMap,D.schemaErrorMap,B,B===F2?void 0:F2].filter((_)=>!!_)});D.common.issues.push($)}class lD{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(D,F){let B=[];for(let $ of F){if($.status==="aborted")return l;if($.status==="dirty")D.dirty();B.push($.value)}return{status:D.value,value:B}}static async mergeObjectAsync(D,F){let B=[];for(let $ of F){let _=await $.key,Q=await $.value;B.push({key:_,value:Q})}return lD.mergeObjectSync(D,B)}static mergeObjectSync(D,F){let B={};for(let $ of F){let{key:_,value:Q}=$;if(_.status==="aborted")return l;if(Q.status==="aborted")return l;if(_.status==="dirty")D.dirty();if(Q.status==="dirty")D.dirty();if(_.value!=="__proto__"&&(typeof Q.value<"u"||$.alwaysSet))B[_.value]=Q.value}return{status:D.value,value:B}}}var H3=(D)=>{let{data:F,path:B,errorMaps:$,issueData:_}=D,Q=[...B,..._.path||[]],Y={..._,path:Q};if(_.message!==void 0)return{..._,path:Q,message:_.message};let q="",H=$.filter((J)=>!!J).slice().reverse();for(let J of H)q=J(Y,{data:F,defaultError:q}).message;return{..._,path:Q,message:q}},W_,l,x2=(D)=>({status:"dirty",value:D}),sD=(D)=>({status:"valid",value:D}),l3=(D)=>D.status==="aborted",p3=(D)=>D.status==="dirty",U2=(D)=>D.status==="valid",UF=(D)=>typeof Promise<"u"&&D instanceof Promise;var Y1=V(()=>{c3();Q1();W_=[];l=Object.freeze({status:"aborted"})});var q7=()=>{};var y;var H7=V(()=>{(function(D){D.errToObj=(F)=>typeof F==="string"?{message:F}:F||{},D.toString=(F)=>typeof F==="string"?F:F?.message})(y||(y={}))});class S0{constructor(D,F,B,$){this._cachedPath=[],this.parent=D,this.data=F,this._path=B,this._key=$}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}function DD(D){if(!D)return{};let{errorMap:F,invalid_type_error:B,required_error:$,description:_}=D;if(F&&(B||$))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(F)return{errorMap:F,description:_};return{errorMap:(Y,q)=>{let{message:H}=D;if(Y.code==="invalid_enum_value")return{message:H??q.defaultError};if(typeof q.data>"u")return{message:H??$??q.defaultError};if(Y.code!=="invalid_type")return{message:q.defaultError};return{message:H??B??q.defaultError}},description:_}}class BD{get description(){return this._def.description}_getType(D){return c0(D.data)}_getOrReturnCtx(D,F){return F||{common:D.parent.common,data:D.data,parsedType:c0(D.data),schemaErrorMap:this._def.errorMap,path:D.path,parent:D.parent}}_processInputParams(D){return{status:new lD,ctx:{common:D.parent.common,data:D.data,parsedType:c0(D.data),schemaErrorMap:this._def.errorMap,path:D.path,parent:D.parent}}}_parseSync(D){let F=this._parse(D);if(UF(F))throw Error("Synchronous parse encountered promise.");return F}_parseAsync(D){let F=this._parse(D);return Promise.resolve(F)}parse(D,F){let B=this.safeParse(D,F);if(B.success)return B.data;throw B.error}safeParse(D,F){let B={common:{issues:[],async:F?.async??!1,contextualErrorMap:F?.errorMap},path:F?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:D,parsedType:c0(D)},$=this._parseSync({data:D,path:B.path,parent:B});return J7(B,$)}"~validate"(D){let F={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:D,parsedType:c0(D)};if(!this["~standard"].async)try{let B=this._parseSync({data:D,path:[],parent:F});return U2(B)?{value:B.value}:{issues:F.common.issues}}catch(B){if(B?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;F.common={issues:[],async:!0}}return this._parseAsync({data:D,path:[],parent:F}).then((B)=>U2(B)?{value:B.value}:{issues:F.common.issues})}async parseAsync(D,F){let B=await this.safeParseAsync(D,F);if(B.success)return B.data;throw B.error}async safeParseAsync(D,F){let B={common:{issues:[],contextualErrorMap:F?.errorMap,async:!0},path:F?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:D,parsedType:c0(D)},$=this._parse({data:D,path:B.path,parent:B}),_=await(UF($)?$:Promise.resolve($));return J7(B,_)}refine(D,F){let B=($)=>{if(typeof F==="string"||typeof F>"u")return{message:F};else if(typeof F==="function")return F($);else return F};return this._refinement(($,_)=>{let Q=D($),Y=()=>_.addIssue({code:R.custom,...B($)});if(typeof Promise<"u"&&Q instanceof Promise)return Q.then((q)=>{if(!q)return Y(),!1;else return!0});if(!Q)return Y(),!1;else return!0})}refinement(D,F){return this._refinement((B,$)=>{if(!D(B))return $.addIssue(typeof F==="function"?F(B,$):F),!1;else return!0})}_refinement(D){return new k0({schema:this,typeName:n.ZodEffects,effect:{type:"refinement",refinement:D}})}superRefine(D){return this._refinement(D)}constructor(D){this.spa=this.safeParseAsync,this._def=D,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(F)=>this["~validate"](F)}}optional(){return N0.create(this,this._def)}nullable(){return $2.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Z0.create(this)}promise(){return m2.create(this,this._def)}or(D){return bF.create([this,D],this._def)}and(D){return RF.create(this,D,this._def)}transform(D){return new k0({...DD(this._def),schema:this,typeName:n.ZodEffects,effect:{type:"transform",transform:D}})}default(D){let F=typeof D==="function"?D:()=>D;return new kF({...DD(this._def),innerType:this,defaultValue:F,typeName:n.ZodDefault})}brand(){return new n3({typeName:n.ZodBranded,type:this,...DD(this._def)})}catch(D){let F=typeof D==="function"?D:()=>D;return new IF({...DD(this._def),innerType:this,catchValue:F,typeName:n.ZodCatch})}describe(D){return new this.constructor({...this._def,description:D})}pipe(D){return M3.create(this,D)}readonly(){return TF.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function W7(D){let F="[0-5]\\d";if(D.precision)F=`${F}\\.\\d{${D.precision}}`;else if(D.precision==null)F=`${F}(\\.\\d+)?`;let B=D.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${F})${B}`}function k_(D){return new RegExp(`^${W7(D)}$`)}function z7(D){let F=`${G7}T${W7(D)}`,B=[];if(B.push(D.local?"Z?":"Z"),D.offset)B.push("([+-]\\d{2}:?\\d{2})");return F=`${F}(${B.join("|")})`,new RegExp(`^${F}$`)}function I_(D,F){if((F==="v4"||!F)&&w_.test(D))return!0;if((F==="v6"||!F)&&b_.test(D))return!0;return!1}function T_(D,F){if(!U_.test(D))return!1;try{let[B]=D.split(".");if(!B)return!1;let $=B.replace(/-/g,"+").replace(/_/g,"/").padEnd(B.length+(4-B.length%4)%4,"="),_=JSON.parse(atob($));if(typeof _!=="object"||_===null)return!1;if("typ"in _&&_?.typ!=="JWT")return!1;if(!_.alg)return!1;if(F&&_.alg!==F)return!1;return!0}catch{return!1}}function v_(D,F){if((F==="v4"||!F)&&O_.test(D))return!0;if((F==="v6"||!F)&&R_.test(D))return!0;return!1}function C_(D,F){let B=(D.toString().split(".")[1]||"").length,$=(F.toString().split(".")[1]||"").length,_=B>$?B:$,Q=Number.parseInt(D.toFixed(_).replace(".","")),Y=Number.parseInt(F.toFixed(_).replace(".",""));return Q%Y/10**_}function VF(D){if(D instanceof ID){let F={};for(let B in D.shape){let $=D.shape[B];F[B]=N0.create(VF($))}return new ID({...D._def,shape:()=>F})}else if(D instanceof Z0)return new Z0({...D._def,type:VF(D.element)});else if(D instanceof N0)return N0.create(VF(D.unwrap()));else if(D instanceof $2)return $2.create(VF(D.unwrap()));else if(D instanceof p0)return p0.create(D.items.map((F)=>VF(F)));else return D}function H1(D,F){let B=c0(D),$=c0(F);if(D===F)return{valid:!0,data:D};else if(B===I.object&&$===I.object){let _=QD.objectKeys(F),Q=QD.objectKeys(D).filter((q)=>_.indexOf(q)!==-1),Y={...D,...F};for(let q of Q){let H=H1(D[q],F[q]);if(!H.valid)return{valid:!1};Y[q]=H.data}return{valid:!0,data:Y}}else if(B===I.array&&$===I.array){if(D.length!==F.length)return{valid:!1};let _=[];for(let Q=0;Q<D.length;Q++){let Y=D[Q],q=F[Q],H=H1(Y,q);if(!H.valid)return{valid:!1};_.push(H.data)}return{valid:!0,data:_}}else if(B===I.date&&$===I.date&&+D===+F)return{valid:!0,data:D};else return{valid:!1}}function M7(D,F){return new w2({values:D,typeName:n.ZodEnum,...DD(F)})}function X7(D,F){let B=typeof D==="function"?D(F):typeof D==="string"?{message:D}:D;return typeof B==="string"?{message:B}:B}function A7(D,F={},B){if(D)return f2.create().superRefine(($,_)=>{let Q=D($);if(Q instanceof Promise)return Q.then((Y)=>{if(!Y){let q=X7(F,$),H=q.fatal??B??!0;_.addIssue({code:"custom",...q,fatal:H})}});if(!Q){let Y=X7(F,$),q=Y.fatal??B??!0;_.addIssue({code:"custom",...Y,fatal:q})}return});return f2.create()}var J7=(D,F)=>{if(U2(F))return{success:!0,data:F.value};else{if(!D.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let B=new cD(D.common.issues);return this._error=B,this._error}}}},z_,M_,A_,j_,K_,U_,V_,E_,L_="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",q1,w_,O_,b_,R_,Z_,N_,G7="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",S_,R0,E2,L2,LF,y2,J3,wF,OF,f2,V2,l0,X3,Z0,ID,bF,B2=(D)=>{if(D instanceof ZF)return B2(D.schema);else if(D instanceof k0)return B2(D.innerType());else if(D instanceof NF)return[D.value];else if(D instanceof w2)return D.options;else if(D instanceof SF)return QD.objectValues(D.enum);else if(D instanceof kF)return B2(D._def.innerType);else if(D instanceof wF)return[void 0];else if(D instanceof OF)return[null];else if(D instanceof N0)return[void 0,...B2(D.unwrap())];else if(D instanceof $2)return[null,...B2(D.unwrap())];else if(D instanceof n3)return B2(D.unwrap());else if(D instanceof TF)return B2(D.unwrap());else if(D instanceof IF)return B2(D._def.innerType);else return[]},i3,RF,p0,G3,W3,h2,EF,ZF,NF,w2,SF,m2,k0,N0,$2,kF,IF,z3,u_,n3,M3,TF,P_,n,x_=(D,F={message:`Input not instance of ${D.name}`})=>A7((B)=>B instanceof D,F),j7,K7,y_,f_,U7,h_,m_,g_,d_,c_,l_,p_,i_,n_,s_,a_,o_,r_,t_,e_,DQ,FQ,BQ,$Q,_Q,QQ,YQ,qQ,HQ,JQ,XQ,GQ,WQ,zQ,MQ=()=>j7().optional(),AQ=()=>K7().optional(),jQ=()=>U7().optional(),KQ,UQ;var V7=V(()=>{d3();c3();H7();Y1();q3();z_=/^c[^\s-]{8,}$/i,M_=/^[0-9a-z]+$/,A_=/^[0-9A-HJKMNP-TV-Z]{26}$/i,j_=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,K_=/^[a-z0-9_-]{21}$/i,U_=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,V_=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,E_=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,w_=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,O_=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,b_=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,R_=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Z_=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,N_=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,S_=new RegExp(`^${G7}$`);R0=class R0 extends BD{_parse(D){if(this._def.coerce)D.data=String(D.data);if(this._getType(D)!==I.string){let _=this._getOrReturnCtx(D);return T(_,{code:R.invalid_type,expected:I.string,received:_.parsedType}),l}let B=new lD,$=void 0;for(let _ of this._def.checks)if(_.kind==="min"){if(D.data.length<_.value)$=this._getOrReturnCtx(D,$),T($,{code:R.too_small,minimum:_.value,type:"string",inclusive:!0,exact:!1,message:_.message}),B.dirty()}else if(_.kind==="max"){if(D.data.length>_.value)$=this._getOrReturnCtx(D,$),T($,{code:R.too_big,maximum:_.value,type:"string",inclusive:!0,exact:!1,message:_.message}),B.dirty()}else if(_.kind==="length"){let Q=D.data.length>_.value,Y=D.data.length<_.value;if(Q||Y){if($=this._getOrReturnCtx(D,$),Q)T($,{code:R.too_big,maximum:_.value,type:"string",inclusive:!0,exact:!0,message:_.message});else if(Y)T($,{code:R.too_small,minimum:_.value,type:"string",inclusive:!0,exact:!0,message:_.message});B.dirty()}}else if(_.kind==="email"){if(!E_.test(D.data))$=this._getOrReturnCtx(D,$),T($,{validation:"email",code:R.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="emoji"){if(!q1)q1=new RegExp(L_,"u");if(!q1.test(D.data))$=this._getOrReturnCtx(D,$),T($,{validation:"emoji",code:R.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="uuid"){if(!j_.test(D.data))$=this._getOrReturnCtx(D,$),T($,{validation:"uuid",code:R.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="nanoid"){if(!K_.test(D.data))$=this._getOrReturnCtx(D,$),T($,{validation:"nanoid",code:R.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="cuid"){if(!z_.test(D.data))$=this._getOrReturnCtx(D,$),T($,{validation:"cuid",code:R.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="cuid2"){if(!M_.test(D.data))$=this._getOrReturnCtx(D,$),T($,{validation:"cuid2",code:R.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="ulid"){if(!A_.test(D.data))$=this._getOrReturnCtx(D,$),T($,{validation:"ulid",code:R.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="url")try{new URL(D.data)}catch{$=this._getOrReturnCtx(D,$),T($,{validation:"url",code:R.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="regex"){if(_.regex.lastIndex=0,!_.regex.test(D.data))$=this._getOrReturnCtx(D,$),T($,{validation:"regex",code:R.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="trim")D.data=D.data.trim();else if(_.kind==="includes"){if(!D.data.includes(_.value,_.position))$=this._getOrReturnCtx(D,$),T($,{code:R.invalid_string,validation:{includes:_.value,position:_.position},message:_.message}),B.dirty()}else if(_.kind==="toLowerCase")D.data=D.data.toLowerCase();else if(_.kind==="toUpperCase")D.data=D.data.toUpperCase();else if(_.kind==="startsWith"){if(!D.data.startsWith(_.value))$=this._getOrReturnCtx(D,$),T($,{code:R.invalid_string,validation:{startsWith:_.value},message:_.message}),B.dirty()}else if(_.kind==="endsWith"){if(!D.data.endsWith(_.value))$=this._getOrReturnCtx(D,$),T($,{code:R.invalid_string,validation:{endsWith:_.value},message:_.message}),B.dirty()}else if(_.kind==="datetime"){if(!z7(_).test(D.data))$=this._getOrReturnCtx(D,$),T($,{code:R.invalid_string,validation:"datetime",message:_.message}),B.dirty()}else if(_.kind==="date"){if(!S_.test(D.data))$=this._getOrReturnCtx(D,$),T($,{code:R.invalid_string,validation:"date",message:_.message}),B.dirty()}else if(_.kind==="time"){if(!k_(_).test(D.data))$=this._getOrReturnCtx(D,$),T($,{code:R.invalid_string,validation:"time",message:_.message}),B.dirty()}else if(_.kind==="duration"){if(!V_.test(D.data))$=this._getOrReturnCtx(D,$),T($,{validation:"duration",code:R.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="ip"){if(!I_(D.data,_.version))$=this._getOrReturnCtx(D,$),T($,{validation:"ip",code:R.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="jwt"){if(!T_(D.data,_.alg))$=this._getOrReturnCtx(D,$),T($,{validation:"jwt",code:R.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="cidr"){if(!v_(D.data,_.version))$=this._getOrReturnCtx(D,$),T($,{validation:"cidr",code:R.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="base64"){if(!Z_.test(D.data))$=this._getOrReturnCtx(D,$),T($,{validation:"base64",code:R.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="base64url"){if(!N_.test(D.data))$=this._getOrReturnCtx(D,$),T($,{validation:"base64url",code:R.invalid_string,message:_.message}),B.dirty()}else QD.assertNever(_);return{status:B.value,value:D.data}}_regex(D,F,B){return this.refinement(($)=>D.test($),{validation:F,code:R.invalid_string,...y.errToObj(B)})}_addCheck(D){return new R0({...this._def,checks:[...this._def.checks,D]})}email(D){return this._addCheck({kind:"email",...y.errToObj(D)})}url(D){return this._addCheck({kind:"url",...y.errToObj(D)})}emoji(D){return this._addCheck({kind:"emoji",...y.errToObj(D)})}uuid(D){return this._addCheck({kind:"uuid",...y.errToObj(D)})}nanoid(D){return this._addCheck({kind:"nanoid",...y.errToObj(D)})}cuid(D){return this._addCheck({kind:"cuid",...y.errToObj(D)})}cuid2(D){return this._addCheck({kind:"cuid2",...y.errToObj(D)})}ulid(D){return this._addCheck({kind:"ulid",...y.errToObj(D)})}base64(D){return this._addCheck({kind:"base64",...y.errToObj(D)})}base64url(D){return this._addCheck({kind:"base64url",...y.errToObj(D)})}jwt(D){return this._addCheck({kind:"jwt",...y.errToObj(D)})}ip(D){return this._addCheck({kind:"ip",...y.errToObj(D)})}cidr(D){return this._addCheck({kind:"cidr",...y.errToObj(D)})}datetime(D){if(typeof D==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:D});return this._addCheck({kind:"datetime",precision:typeof D?.precision>"u"?null:D?.precision,offset:D?.offset??!1,local:D?.local??!1,...y.errToObj(D?.message)})}date(D){return this._addCheck({kind:"date",message:D})}time(D){if(typeof D==="string")return this._addCheck({kind:"time",precision:null,message:D});return this._addCheck({kind:"time",precision:typeof D?.precision>"u"?null:D?.precision,...y.errToObj(D?.message)})}duration(D){return this._addCheck({kind:"duration",...y.errToObj(D)})}regex(D,F){return this._addCheck({kind:"regex",regex:D,...y.errToObj(F)})}includes(D,F){return this._addCheck({kind:"includes",value:D,position:F?.position,...y.errToObj(F?.message)})}startsWith(D,F){return this._addCheck({kind:"startsWith",value:D,...y.errToObj(F)})}endsWith(D,F){return this._addCheck({kind:"endsWith",value:D,...y.errToObj(F)})}min(D,F){return this._addCheck({kind:"min",value:D,...y.errToObj(F)})}max(D,F){return this._addCheck({kind:"max",value:D,...y.errToObj(F)})}length(D,F){return this._addCheck({kind:"length",value:D,...y.errToObj(F)})}nonempty(D){return this.min(1,y.errToObj(D))}trim(){return new R0({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new R0({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new R0({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((D)=>D.kind==="datetime")}get isDate(){return!!this._def.checks.find((D)=>D.kind==="date")}get isTime(){return!!this._def.checks.find((D)=>D.kind==="time")}get isDuration(){return!!this._def.checks.find((D)=>D.kind==="duration")}get isEmail(){return!!this._def.checks.find((D)=>D.kind==="email")}get isURL(){return!!this._def.checks.find((D)=>D.kind==="url")}get isEmoji(){return!!this._def.checks.find((D)=>D.kind==="emoji")}get isUUID(){return!!this._def.checks.find((D)=>D.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((D)=>D.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((D)=>D.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((D)=>D.kind==="cuid2")}get isULID(){return!!this._def.checks.find((D)=>D.kind==="ulid")}get isIP(){return!!this._def.checks.find((D)=>D.kind==="ip")}get isCIDR(){return!!this._def.checks.find((D)=>D.kind==="cidr")}get isBase64(){return!!this._def.checks.find((D)=>D.kind==="base64")}get isBase64url(){return!!this._def.checks.find((D)=>D.kind==="base64url")}get minLength(){let D=null;for(let F of this._def.checks)if(F.kind==="min"){if(D===null||F.value>D)D=F.value}return D}get maxLength(){let D=null;for(let F of this._def.checks)if(F.kind==="max"){if(D===null||F.value<D)D=F.value}return D}};R0.create=(D)=>{return new R0({checks:[],typeName:n.ZodString,coerce:D?.coerce??!1,...DD(D)})};E2=class E2 extends BD{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(D){if(this._def.coerce)D.data=Number(D.data);if(this._getType(D)!==I.number){let _=this._getOrReturnCtx(D);return T(_,{code:R.invalid_type,expected:I.number,received:_.parsedType}),l}let B=void 0,$=new lD;for(let _ of this._def.checks)if(_.kind==="int"){if(!QD.isInteger(D.data))B=this._getOrReturnCtx(D,B),T(B,{code:R.invalid_type,expected:"integer",received:"float",message:_.message}),$.dirty()}else if(_.kind==="min"){if(_.inclusive?D.data<_.value:D.data<=_.value)B=this._getOrReturnCtx(D,B),T(B,{code:R.too_small,minimum:_.value,type:"number",inclusive:_.inclusive,exact:!1,message:_.message}),$.dirty()}else if(_.kind==="max"){if(_.inclusive?D.data>_.value:D.data>=_.value)B=this._getOrReturnCtx(D,B),T(B,{code:R.too_big,maximum:_.value,type:"number",inclusive:_.inclusive,exact:!1,message:_.message}),$.dirty()}else if(_.kind==="multipleOf"){if(C_(D.data,_.value)!==0)B=this._getOrReturnCtx(D,B),T(B,{code:R.not_multiple_of,multipleOf:_.value,message:_.message}),$.dirty()}else if(_.kind==="finite"){if(!Number.isFinite(D.data))B=this._getOrReturnCtx(D,B),T(B,{code:R.not_finite,message:_.message}),$.dirty()}else QD.assertNever(_);return{status:$.value,value:D.data}}gte(D,F){return this.setLimit("min",D,!0,y.toString(F))}gt(D,F){return this.setLimit("min",D,!1,y.toString(F))}lte(D,F){return this.setLimit("max",D,!0,y.toString(F))}lt(D,F){return this.setLimit("max",D,!1,y.toString(F))}setLimit(D,F,B,$){return new E2({...this._def,checks:[...this._def.checks,{kind:D,value:F,inclusive:B,message:y.toString($)}]})}_addCheck(D){return new E2({...this._def,checks:[...this._def.checks,D]})}int(D){return this._addCheck({kind:"int",message:y.toString(D)})}positive(D){return this._addCheck({kind:"min",value:0,inclusive:!1,message:y.toString(D)})}negative(D){return this._addCheck({kind:"max",value:0,inclusive:!1,message:y.toString(D)})}nonpositive(D){return this._addCheck({kind:"max",value:0,inclusive:!0,message:y.toString(D)})}nonnegative(D){return this._addCheck({kind:"min",value:0,inclusive:!0,message:y.toString(D)})}multipleOf(D,F){return this._addCheck({kind:"multipleOf",value:D,message:y.toString(F)})}finite(D){return this._addCheck({kind:"finite",message:y.toString(D)})}safe(D){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:y.toString(D)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:y.toString(D)})}get minValue(){let D=null;for(let F of this._def.checks)if(F.kind==="min"){if(D===null||F.value>D)D=F.value}return D}get maxValue(){let D=null;for(let F of this._def.checks)if(F.kind==="max"){if(D===null||F.value<D)D=F.value}return D}get isInt(){return!!this._def.checks.find((D)=>D.kind==="int"||D.kind==="multipleOf"&&QD.isInteger(D.value))}get isFinite(){let D=null,F=null;for(let B of this._def.checks)if(B.kind==="finite"||B.kind==="int"||B.kind==="multipleOf")return!0;else if(B.kind==="min"){if(F===null||B.value>F)F=B.value}else if(B.kind==="max"){if(D===null||B.value<D)D=B.value}return Number.isFinite(F)&&Number.isFinite(D)}};E2.create=(D)=>{return new E2({checks:[],typeName:n.ZodNumber,coerce:D?.coerce||!1,...DD(D)})};L2=class L2 extends BD{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(D){if(this._def.coerce)try{D.data=BigInt(D.data)}catch{return this._getInvalidInput(D)}if(this._getType(D)!==I.bigint)return this._getInvalidInput(D);let B=void 0,$=new lD;for(let _ of this._def.checks)if(_.kind==="min"){if(_.inclusive?D.data<_.value:D.data<=_.value)B=this._getOrReturnCtx(D,B),T(B,{code:R.too_small,type:"bigint",minimum:_.value,inclusive:_.inclusive,message:_.message}),$.dirty()}else if(_.kind==="max"){if(_.inclusive?D.data>_.value:D.data>=_.value)B=this._getOrReturnCtx(D,B),T(B,{code:R.too_big,type:"bigint",maximum:_.value,inclusive:_.inclusive,message:_.message}),$.dirty()}else if(_.kind==="multipleOf"){if(D.data%_.value!==BigInt(0))B=this._getOrReturnCtx(D,B),T(B,{code:R.not_multiple_of,multipleOf:_.value,message:_.message}),$.dirty()}else QD.assertNever(_);return{status:$.value,value:D.data}}_getInvalidInput(D){let F=this._getOrReturnCtx(D);return T(F,{code:R.invalid_type,expected:I.bigint,received:F.parsedType}),l}gte(D,F){return this.setLimit("min",D,!0,y.toString(F))}gt(D,F){return this.setLimit("min",D,!1,y.toString(F))}lte(D,F){return this.setLimit("max",D,!0,y.toString(F))}lt(D,F){return this.setLimit("max",D,!1,y.toString(F))}setLimit(D,F,B,$){return new L2({...this._def,checks:[...this._def.checks,{kind:D,value:F,inclusive:B,message:y.toString($)}]})}_addCheck(D){return new L2({...this._def,checks:[...this._def.checks,D]})}positive(D){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:y.toString(D)})}negative(D){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:y.toString(D)})}nonpositive(D){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:y.toString(D)})}nonnegative(D){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:y.toString(D)})}multipleOf(D,F){return this._addCheck({kind:"multipleOf",value:D,message:y.toString(F)})}get minValue(){let D=null;for(let F of this._def.checks)if(F.kind==="min"){if(D===null||F.value>D)D=F.value}return D}get maxValue(){let D=null;for(let F of this._def.checks)if(F.kind==="max"){if(D===null||F.value<D)D=F.value}return D}};L2.create=(D)=>{return new L2({checks:[],typeName:n.ZodBigInt,coerce:D?.coerce??!1,...DD(D)})};LF=class LF extends BD{_parse(D){if(this._def.coerce)D.data=Boolean(D.data);if(this._getType(D)!==I.boolean){let B=this._getOrReturnCtx(D);return T(B,{code:R.invalid_type,expected:I.boolean,received:B.parsedType}),l}return sD(D.data)}};LF.create=(D)=>{return new LF({typeName:n.ZodBoolean,coerce:D?.coerce||!1,...DD(D)})};y2=class y2 extends BD{_parse(D){if(this._def.coerce)D.data=new Date(D.data);if(this._getType(D)!==I.date){let _=this._getOrReturnCtx(D);return T(_,{code:R.invalid_type,expected:I.date,received:_.parsedType}),l}if(Number.isNaN(D.data.getTime())){let _=this._getOrReturnCtx(D);return T(_,{code:R.invalid_date}),l}let B=new lD,$=void 0;for(let _ of this._def.checks)if(_.kind==="min"){if(D.data.getTime()<_.value)$=this._getOrReturnCtx(D,$),T($,{code:R.too_small,message:_.message,inclusive:!0,exact:!1,minimum:_.value,type:"date"}),B.dirty()}else if(_.kind==="max"){if(D.data.getTime()>_.value)$=this._getOrReturnCtx(D,$),T($,{code:R.too_big,message:_.message,inclusive:!0,exact:!1,maximum:_.value,type:"date"}),B.dirty()}else QD.assertNever(_);return{status:B.value,value:new Date(D.data.getTime())}}_addCheck(D){return new y2({...this._def,checks:[...this._def.checks,D]})}min(D,F){return this._addCheck({kind:"min",value:D.getTime(),message:y.toString(F)})}max(D,F){return this._addCheck({kind:"max",value:D.getTime(),message:y.toString(F)})}get minDate(){let D=null;for(let F of this._def.checks)if(F.kind==="min"){if(D===null||F.value>D)D=F.value}return D!=null?new Date(D):null}get maxDate(){let D=null;for(let F of this._def.checks)if(F.kind==="max"){if(D===null||F.value<D)D=F.value}return D!=null?new Date(D):null}};y2.create=(D)=>{return new y2({checks:[],coerce:D?.coerce||!1,typeName:n.ZodDate,...DD(D)})};J3=class J3 extends BD{_parse(D){if(this._getType(D)!==I.symbol){let B=this._getOrReturnCtx(D);return T(B,{code:R.invalid_type,expected:I.symbol,received:B.parsedType}),l}return sD(D.data)}};J3.create=(D)=>{return new J3({typeName:n.ZodSymbol,...DD(D)})};wF=class wF extends BD{_parse(D){if(this._getType(D)!==I.undefined){let B=this._getOrReturnCtx(D);return T(B,{code:R.invalid_type,expected:I.undefined,received:B.parsedType}),l}return sD(D.data)}};wF.create=(D)=>{return new wF({typeName:n.ZodUndefined,...DD(D)})};OF=class OF extends BD{_parse(D){if(this._getType(D)!==I.null){let B=this._getOrReturnCtx(D);return T(B,{code:R.invalid_type,expected:I.null,received:B.parsedType}),l}return sD(D.data)}};OF.create=(D)=>{return new OF({typeName:n.ZodNull,...DD(D)})};f2=class f2 extends BD{constructor(){super(...arguments);this._any=!0}_parse(D){return sD(D.data)}};f2.create=(D)=>{return new f2({typeName:n.ZodAny,...DD(D)})};V2=class V2 extends BD{constructor(){super(...arguments);this._unknown=!0}_parse(D){return sD(D.data)}};V2.create=(D)=>{return new V2({typeName:n.ZodUnknown,...DD(D)})};l0=class l0 extends BD{_parse(D){let F=this._getOrReturnCtx(D);return T(F,{code:R.invalid_type,expected:I.never,received:F.parsedType}),l}};l0.create=(D)=>{return new l0({typeName:n.ZodNever,...DD(D)})};X3=class X3 extends BD{_parse(D){if(this._getType(D)!==I.undefined){let B=this._getOrReturnCtx(D);return T(B,{code:R.invalid_type,expected:I.void,received:B.parsedType}),l}return sD(D.data)}};X3.create=(D)=>{return new X3({typeName:n.ZodVoid,...DD(D)})};Z0=class Z0 extends BD{_parse(D){let{ctx:F,status:B}=this._processInputParams(D),$=this._def;if(F.parsedType!==I.array)return T(F,{code:R.invalid_type,expected:I.array,received:F.parsedType}),l;if($.exactLength!==null){let Q=F.data.length>$.exactLength.value,Y=F.data.length<$.exactLength.value;if(Q||Y)T(F,{code:Q?R.too_big:R.too_small,minimum:Y?$.exactLength.value:void 0,maximum:Q?$.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:$.exactLength.message}),B.dirty()}if($.minLength!==null){if(F.data.length<$.minLength.value)T(F,{code:R.too_small,minimum:$.minLength.value,type:"array",inclusive:!0,exact:!1,message:$.minLength.message}),B.dirty()}if($.maxLength!==null){if(F.data.length>$.maxLength.value)T(F,{code:R.too_big,maximum:$.maxLength.value,type:"array",inclusive:!0,exact:!1,message:$.maxLength.message}),B.dirty()}if(F.common.async)return Promise.all([...F.data].map((Q,Y)=>{return $.type._parseAsync(new S0(F,Q,F.path,Y))})).then((Q)=>{return lD.mergeArray(B,Q)});let _=[...F.data].map((Q,Y)=>{return $.type._parseSync(new S0(F,Q,F.path,Y))});return lD.mergeArray(B,_)}get element(){return this._def.type}min(D,F){return new Z0({...this._def,minLength:{value:D,message:y.toString(F)}})}max(D,F){return new Z0({...this._def,maxLength:{value:D,message:y.toString(F)}})}length(D,F){return new Z0({...this._def,exactLength:{value:D,message:y.toString(F)}})}nonempty(D){return this.min(1,D)}};Z0.create=(D,F)=>{return new Z0({type:D,minLength:null,maxLength:null,exactLength:null,typeName:n.ZodArray,...DD(F)})};ID=class ID extends BD{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let D=this._def.shape(),F=QD.objectKeys(D);return this._cached={shape:D,keys:F},this._cached}_parse(D){if(this._getType(D)!==I.object){let H=this._getOrReturnCtx(D);return T(H,{code:R.invalid_type,expected:I.object,received:H.parsedType}),l}let{status:B,ctx:$}=this._processInputParams(D),{shape:_,keys:Q}=this._getCached(),Y=[];if(!(this._def.catchall instanceof l0&&this._def.unknownKeys==="strip")){for(let H in $.data)if(!Q.includes(H))Y.push(H)}let q=[];for(let H of Q){let J=_[H],X=$.data[H];q.push({key:{status:"valid",value:H},value:J._parse(new S0($,X,$.path,H)),alwaysSet:H in $.data})}if(this._def.catchall instanceof l0){let H=this._def.unknownKeys;if(H==="passthrough")for(let J of Y)q.push({key:{status:"valid",value:J},value:{status:"valid",value:$.data[J]}});else if(H==="strict"){if(Y.length>0)T($,{code:R.unrecognized_keys,keys:Y}),B.dirty()}else if(H==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let H=this._def.catchall;for(let J of Y){let X=$.data[J];q.push({key:{status:"valid",value:J},value:H._parse(new S0($,X,$.path,J)),alwaysSet:J in $.data})}}if($.common.async)return Promise.resolve().then(async()=>{let H=[];for(let J of q){let X=await J.key,z=await J.value;H.push({key:X,value:z,alwaysSet:J.alwaysSet})}return H}).then((H)=>{return lD.mergeObjectSync(B,H)});else return lD.mergeObjectSync(B,q)}get shape(){return this._def.shape()}strict(D){return y.errToObj,new ID({...this._def,unknownKeys:"strict",...D!==void 0?{errorMap:(F,B)=>{let $=this._def.errorMap?.(F,B).message??B.defaultError;if(F.code==="unrecognized_keys")return{message:y.errToObj(D).message??$};return{message:$}}}:{}})}strip(){return new ID({...this._def,unknownKeys:"strip"})}passthrough(){return new ID({...this._def,unknownKeys:"passthrough"})}extend(D){return new ID({...this._def,shape:()=>({...this._def.shape(),...D})})}merge(D){return new ID({unknownKeys:D._def.unknownKeys,catchall:D._def.catchall,shape:()=>({...this._def.shape(),...D._def.shape()}),typeName:n.ZodObject})}setKey(D,F){return this.augment({[D]:F})}catchall(D){return new ID({...this._def,catchall:D})}pick(D){let F={};for(let B of QD.objectKeys(D))if(D[B]&&this.shape[B])F[B]=this.shape[B];return new ID({...this._def,shape:()=>F})}omit(D){let F={};for(let B of QD.objectKeys(this.shape))if(!D[B])F[B]=this.shape[B];return new ID({...this._def,shape:()=>F})}deepPartial(){return VF(this)}partial(D){let F={};for(let B of QD.objectKeys(this.shape)){let $=this.shape[B];if(D&&!D[B])F[B]=$;else F[B]=$.optional()}return new ID({...this._def,shape:()=>F})}required(D){let F={};for(let B of QD.objectKeys(this.shape))if(D&&!D[B])F[B]=this.shape[B];else{let _=this.shape[B];while(_ instanceof N0)_=_._def.innerType;F[B]=_}return new ID({...this._def,shape:()=>F})}keyof(){return M7(QD.objectKeys(this.shape))}};ID.create=(D,F)=>{return new ID({shape:()=>D,unknownKeys:"strip",catchall:l0.create(),typeName:n.ZodObject,...DD(F)})};ID.strictCreate=(D,F)=>{return new ID({shape:()=>D,unknownKeys:"strict",catchall:l0.create(),typeName:n.ZodObject,...DD(F)})};ID.lazycreate=(D,F)=>{return new ID({shape:D,unknownKeys:"strip",catchall:l0.create(),typeName:n.ZodObject,...DD(F)})};bF=class bF extends BD{_parse(D){let{ctx:F}=this._processInputParams(D),B=this._def.options;function $(_){for(let Y of _)if(Y.result.status==="valid")return Y.result;for(let Y of _)if(Y.result.status==="dirty")return F.common.issues.push(...Y.ctx.common.issues),Y.result;let Q=_.map((Y)=>new cD(Y.ctx.common.issues));return T(F,{code:R.invalid_union,unionErrors:Q}),l}if(F.common.async)return Promise.all(B.map(async(_)=>{let Q={...F,common:{...F.common,issues:[]},parent:null};return{result:await _._parseAsync({data:F.data,path:F.path,parent:Q}),ctx:Q}})).then($);else{let _=void 0,Q=[];for(let q of B){let H={...F,common:{...F.common,issues:[]},parent:null},J=q._parseSync({data:F.data,path:F.path,parent:H});if(J.status==="valid")return J;else if(J.status==="dirty"&&!_)_={result:J,ctx:H};if(H.common.issues.length)Q.push(H.common.issues)}if(_)return F.common.issues.push(..._.ctx.common.issues),_.result;let Y=Q.map((q)=>new cD(q));return T(F,{code:R.invalid_union,unionErrors:Y}),l}}get options(){return this._def.options}};bF.create=(D,F)=>{return new bF({options:D,typeName:n.ZodUnion,...DD(F)})};i3=class i3 extends BD{_parse(D){let{ctx:F}=this._processInputParams(D);if(F.parsedType!==I.object)return T(F,{code:R.invalid_type,expected:I.object,received:F.parsedType}),l;let B=this.discriminator,$=F.data[B],_=this.optionsMap.get($);if(!_)return T(F,{code:R.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[B]}),l;if(F.common.async)return _._parseAsync({data:F.data,path:F.path,parent:F});else return _._parseSync({data:F.data,path:F.path,parent:F})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(D,F,B){let $=new Map;for(let _ of F){let Q=B2(_.shape[D]);if(!Q.length)throw Error(`A discriminator value for key \`${D}\` could not be extracted from all schema options`);for(let Y of Q){if($.has(Y))throw Error(`Discriminator property ${String(D)} has duplicate value ${String(Y)}`);$.set(Y,_)}}return new i3({typeName:n.ZodDiscriminatedUnion,discriminator:D,options:F,optionsMap:$,...DD(B)})}};RF=class RF extends BD{_parse(D){let{status:F,ctx:B}=this._processInputParams(D),$=(_,Q)=>{if(l3(_)||l3(Q))return l;let Y=H1(_.value,Q.value);if(!Y.valid)return T(B,{code:R.invalid_intersection_types}),l;if(p3(_)||p3(Q))F.dirty();return{status:F.value,value:Y.data}};if(B.common.async)return Promise.all([this._def.left._parseAsync({data:B.data,path:B.path,parent:B}),this._def.right._parseAsync({data:B.data,path:B.path,parent:B})]).then(([_,Q])=>$(_,Q));else return $(this._def.left._parseSync({data:B.data,path:B.path,parent:B}),this._def.right._parseSync({data:B.data,path:B.path,parent:B}))}};RF.create=(D,F,B)=>{return new RF({left:D,right:F,typeName:n.ZodIntersection,...DD(B)})};p0=class p0 extends BD{_parse(D){let{status:F,ctx:B}=this._processInputParams(D);if(B.parsedType!==I.array)return T(B,{code:R.invalid_type,expected:I.array,received:B.parsedType}),l;if(B.data.length<this._def.items.length)return T(B,{code:R.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),l;if(!this._def.rest&&B.data.length>this._def.items.length)T(B,{code:R.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),F.dirty();let _=[...B.data].map((Q,Y)=>{let q=this._def.items[Y]||this._def.rest;if(!q)return null;return q._parse(new S0(B,Q,B.path,Y))}).filter((Q)=>!!Q);if(B.common.async)return Promise.all(_).then((Q)=>{return lD.mergeArray(F,Q)});else return lD.mergeArray(F,_)}get items(){return this._def.items}rest(D){return new p0({...this._def,rest:D})}};p0.create=(D,F)=>{if(!Array.isArray(D))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new p0({items:D,typeName:n.ZodTuple,rest:null,...DD(F)})};G3=class G3 extends BD{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(D){let{status:F,ctx:B}=this._processInputParams(D);if(B.parsedType!==I.object)return T(B,{code:R.invalid_type,expected:I.object,received:B.parsedType}),l;let $=[],_=this._def.keyType,Q=this._def.valueType;for(let Y in B.data)$.push({key:_._parse(new S0(B,Y,B.path,Y)),value:Q._parse(new S0(B,B.data[Y],B.path,Y)),alwaysSet:Y in B.data});if(B.common.async)return lD.mergeObjectAsync(F,$);else return lD.mergeObjectSync(F,$)}get element(){return this._def.valueType}static create(D,F,B){if(F instanceof BD)return new G3({keyType:D,valueType:F,typeName:n.ZodRecord,...DD(B)});return new G3({keyType:R0.create(),valueType:D,typeName:n.ZodRecord,...DD(F)})}};W3=class W3 extends BD{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(D){let{status:F,ctx:B}=this._processInputParams(D);if(B.parsedType!==I.map)return T(B,{code:R.invalid_type,expected:I.map,received:B.parsedType}),l;let $=this._def.keyType,_=this._def.valueType,Q=[...B.data.entries()].map(([Y,q],H)=>{return{key:$._parse(new S0(B,Y,B.path,[H,"key"])),value:_._parse(new S0(B,q,B.path,[H,"value"]))}});if(B.common.async){let Y=new Map;return Promise.resolve().then(async()=>{for(let q of Q){let H=await q.key,J=await q.value;if(H.status==="aborted"||J.status==="aborted")return l;if(H.status==="dirty"||J.status==="dirty")F.dirty();Y.set(H.value,J.value)}return{status:F.value,value:Y}})}else{let Y=new Map;for(let q of Q){let{key:H,value:J}=q;if(H.status==="aborted"||J.status==="aborted")return l;if(H.status==="dirty"||J.status==="dirty")F.dirty();Y.set(H.value,J.value)}return{status:F.value,value:Y}}}};W3.create=(D,F,B)=>{return new W3({valueType:F,keyType:D,typeName:n.ZodMap,...DD(B)})};h2=class h2 extends BD{_parse(D){let{status:F,ctx:B}=this._processInputParams(D);if(B.parsedType!==I.set)return T(B,{code:R.invalid_type,expected:I.set,received:B.parsedType}),l;let $=this._def;if($.minSize!==null){if(B.data.size<$.minSize.value)T(B,{code:R.too_small,minimum:$.minSize.value,type:"set",inclusive:!0,exact:!1,message:$.minSize.message}),F.dirty()}if($.maxSize!==null){if(B.data.size>$.maxSize.value)T(B,{code:R.too_big,maximum:$.maxSize.value,type:"set",inclusive:!0,exact:!1,message:$.maxSize.message}),F.dirty()}let _=this._def.valueType;function Q(q){let H=new Set;for(let J of q){if(J.status==="aborted")return l;if(J.status==="dirty")F.dirty();H.add(J.value)}return{status:F.value,value:H}}let Y=[...B.data.values()].map((q,H)=>_._parse(new S0(B,q,B.path,H)));if(B.common.async)return Promise.all(Y).then((q)=>Q(q));else return Q(Y)}min(D,F){return new h2({...this._def,minSize:{value:D,message:y.toString(F)}})}max(D,F){return new h2({...this._def,maxSize:{value:D,message:y.toString(F)}})}size(D,F){return this.min(D,F).max(D,F)}nonempty(D){return this.min(1,D)}};h2.create=(D,F)=>{return new h2({valueType:D,minSize:null,maxSize:null,typeName:n.ZodSet,...DD(F)})};EF=class EF extends BD{constructor(){super(...arguments);this.validate=this.implement}_parse(D){let{ctx:F}=this._processInputParams(D);if(F.parsedType!==I.function)return T(F,{code:R.invalid_type,expected:I.function,received:F.parsedType}),l;function B(Y,q){return H3({data:Y,path:F.path,errorMaps:[F.common.contextualErrorMap,F.schemaErrorMap,KF(),F2].filter((H)=>!!H),issueData:{code:R.invalid_arguments,argumentsError:q}})}function $(Y,q){return H3({data:Y,path:F.path,errorMaps:[F.common.contextualErrorMap,F.schemaErrorMap,KF(),F2].filter((H)=>!!H),issueData:{code:R.invalid_return_type,returnTypeError:q}})}let _={errorMap:F.common.contextualErrorMap},Q=F.data;if(this._def.returns instanceof m2){let Y=this;return sD(async function(...q){let H=new cD([]),J=await Y._def.args.parseAsync(q,_).catch((M)=>{throw H.addIssue(B(q,M)),H}),X=await Reflect.apply(Q,this,J);return await Y._def.returns._def.type.parseAsync(X,_).catch((M)=>{throw H.addIssue($(X,M)),H})})}else{let Y=this;return sD(function(...q){let H=Y._def.args.safeParse(q,_);if(!H.success)throw new cD([B(q,H.error)]);let J=Reflect.apply(Q,this,H.data),X=Y._def.returns.safeParse(J,_);if(!X.success)throw new cD([$(J,X.error)]);return X.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...D){return new EF({...this._def,args:p0.create(D).rest(V2.create())})}returns(D){return new EF({...this._def,returns:D})}implement(D){return this.parse(D)}strictImplement(D){return this.parse(D)}static create(D,F,B){return new EF({args:D?D:p0.create([]).rest(V2.create()),returns:F||V2.create(),typeName:n.ZodFunction,...DD(B)})}};ZF=class ZF extends BD{get schema(){return this._def.getter()}_parse(D){let{ctx:F}=this._processInputParams(D);return this._def.getter()._parse({data:F.data,path:F.path,parent:F})}};ZF.create=(D,F)=>{return new ZF({getter:D,typeName:n.ZodLazy,...DD(F)})};NF=class NF extends BD{_parse(D){if(D.data!==this._def.value){let F=this._getOrReturnCtx(D);return T(F,{received:F.data,code:R.invalid_literal,expected:this._def.value}),l}return{status:"valid",value:D.data}}get value(){return this._def.value}};NF.create=(D,F)=>{return new NF({value:D,typeName:n.ZodLiteral,...DD(F)})};w2=class w2 extends BD{_parse(D){if(typeof D.data!=="string"){let F=this._getOrReturnCtx(D),B=this._def.values;return T(F,{expected:QD.joinValues(B),received:F.parsedType,code:R.invalid_type}),l}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(D.data)){let F=this._getOrReturnCtx(D),B=this._def.values;return T(F,{received:F.data,code:R.invalid_enum_value,options:B}),l}return sD(D.data)}get options(){return this._def.values}get enum(){let D={};for(let F of this._def.values)D[F]=F;return D}get Values(){let D={};for(let F of this._def.values)D[F]=F;return D}get Enum(){let D={};for(let F of this._def.values)D[F]=F;return D}extract(D,F=this._def){return w2.create(D,{...this._def,...F})}exclude(D,F=this._def){return w2.create(this.options.filter((B)=>!D.includes(B)),{...this._def,...F})}};w2.create=M7;SF=class SF extends BD{_parse(D){let F=QD.getValidEnumValues(this._def.values),B=this._getOrReturnCtx(D);if(B.parsedType!==I.string&&B.parsedType!==I.number){let $=QD.objectValues(F);return T(B,{expected:QD.joinValues($),received:B.parsedType,code:R.invalid_type}),l}if(!this._cache)this._cache=new Set(QD.getValidEnumValues(this._def.values));if(!this._cache.has(D.data)){let $=QD.objectValues(F);return T(B,{received:B.data,code:R.invalid_enum_value,options:$}),l}return sD(D.data)}get enum(){return this._def.values}};SF.create=(D,F)=>{return new SF({values:D,typeName:n.ZodNativeEnum,...DD(F)})};m2=class m2 extends BD{unwrap(){return this._def.type}_parse(D){let{ctx:F}=this._processInputParams(D);if(F.parsedType!==I.promise&&F.common.async===!1)return T(F,{code:R.invalid_type,expected:I.promise,received:F.parsedType}),l;let B=F.parsedType===I.promise?F.data:Promise.resolve(F.data);return sD(B.then(($)=>{return this._def.type.parseAsync($,{path:F.path,errorMap:F.common.contextualErrorMap})}))}};m2.create=(D,F)=>{return new m2({type:D,typeName:n.ZodPromise,...DD(F)})};k0=class k0 extends BD{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===n.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(D){let{status:F,ctx:B}=this._processInputParams(D),$=this._def.effect||null,_={addIssue:(Q)=>{if(T(B,Q),Q.fatal)F.abort();else F.dirty()},get path(){return B.path}};if(_.addIssue=_.addIssue.bind(_),$.type==="preprocess"){let Q=$.transform(B.data,_);if(B.common.async)return Promise.resolve(Q).then(async(Y)=>{if(F.value==="aborted")return l;let q=await this._def.schema._parseAsync({data:Y,path:B.path,parent:B});if(q.status==="aborted")return l;if(q.status==="dirty")return x2(q.value);if(F.value==="dirty")return x2(q.value);return q});else{if(F.value==="aborted")return l;let Y=this._def.schema._parseSync({data:Q,path:B.path,parent:B});if(Y.status==="aborted")return l;if(Y.status==="dirty")return x2(Y.value);if(F.value==="dirty")return x2(Y.value);return Y}}if($.type==="refinement"){let Q=(Y)=>{let q=$.refinement(Y,_);if(B.common.async)return Promise.resolve(q);if(q instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return Y};if(B.common.async===!1){let Y=this._def.schema._parseSync({data:B.data,path:B.path,parent:B});if(Y.status==="aborted")return l;if(Y.status==="dirty")F.dirty();return Q(Y.value),{status:F.value,value:Y.value}}else return this._def.schema._parseAsync({data:B.data,path:B.path,parent:B}).then((Y)=>{if(Y.status==="aborted")return l;if(Y.status==="dirty")F.dirty();return Q(Y.value).then(()=>{return{status:F.value,value:Y.value}})})}if($.type==="transform")if(B.common.async===!1){let Q=this._def.schema._parseSync({data:B.data,path:B.path,parent:B});if(!U2(Q))return l;let Y=$.transform(Q.value,_);if(Y instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:F.value,value:Y}}else return this._def.schema._parseAsync({data:B.data,path:B.path,parent:B}).then((Q)=>{if(!U2(Q))return l;return Promise.resolve($.transform(Q.value,_)).then((Y)=>({status:F.value,value:Y}))});QD.assertNever($)}};k0.create=(D,F,B)=>{return new k0({schema:D,typeName:n.ZodEffects,effect:F,...DD(B)})};k0.createWithPreprocess=(D,F,B)=>{return new k0({schema:F,effect:{type:"preprocess",transform:D},typeName:n.ZodEffects,...DD(B)})};N0=class N0 extends BD{_parse(D){if(this._getType(D)===I.undefined)return sD(void 0);return this._def.innerType._parse(D)}unwrap(){return this._def.innerType}};N0.create=(D,F)=>{return new N0({innerType:D,typeName:n.ZodOptional,...DD(F)})};$2=class $2 extends BD{_parse(D){if(this._getType(D)===I.null)return sD(null);return this._def.innerType._parse(D)}unwrap(){return this._def.innerType}};$2.create=(D,F)=>{return new $2({innerType:D,typeName:n.ZodNullable,...DD(F)})};kF=class kF extends BD{_parse(D){let{ctx:F}=this._processInputParams(D),B=F.data;if(F.parsedType===I.undefined)B=this._def.defaultValue();return this._def.innerType._parse({data:B,path:F.path,parent:F})}removeDefault(){return this._def.innerType}};kF.create=(D,F)=>{return new kF({innerType:D,typeName:n.ZodDefault,defaultValue:typeof F.default==="function"?F.default:()=>F.default,...DD(F)})};IF=class IF extends BD{_parse(D){let{ctx:F}=this._processInputParams(D),B={...F,common:{...F.common,issues:[]}},$=this._def.innerType._parse({data:B.data,path:B.path,parent:{...B}});if(UF($))return $.then((_)=>{return{status:"valid",value:_.status==="valid"?_.value:this._def.catchValue({get error(){return new cD(B.common.issues)},input:B.data})}});else return{status:"valid",value:$.status==="valid"?$.value:this._def.catchValue({get error(){return new cD(B.common.issues)},input:B.data})}}removeCatch(){return this._def.innerType}};IF.create=(D,F)=>{return new IF({innerType:D,typeName:n.ZodCatch,catchValue:typeof F.catch==="function"?F.catch:()=>F.catch,...DD(F)})};z3=class z3 extends BD{_parse(D){if(this._getType(D)!==I.nan){let B=this._getOrReturnCtx(D);return T(B,{code:R.invalid_type,expected:I.nan,received:B.parsedType}),l}return{status:"valid",value:D.data}}};z3.create=(D)=>{return new z3({typeName:n.ZodNaN,...DD(D)})};u_=Symbol("zod_brand");n3=class n3 extends BD{_parse(D){let{ctx:F}=this._processInputParams(D),B=F.data;return this._def.type._parse({data:B,path:F.path,parent:F})}unwrap(){return this._def.type}};M3=class M3 extends BD{_parse(D){let{status:F,ctx:B}=this._processInputParams(D);if(B.common.async)return(async()=>{let _=await this._def.in._parseAsync({data:B.data,path:B.path,parent:B});if(_.status==="aborted")return l;if(_.status==="dirty")return F.dirty(),x2(_.value);else return this._def.out._parseAsync({data:_.value,path:B.path,parent:B})})();else{let $=this._def.in._parseSync({data:B.data,path:B.path,parent:B});if($.status==="aborted")return l;if($.status==="dirty")return F.dirty(),{status:"dirty",value:$.value};else return this._def.out._parseSync({data:$.value,path:B.path,parent:B})}}static create(D,F){return new M3({in:D,out:F,typeName:n.ZodPipeline})}};TF=class TF extends BD{_parse(D){let F=this._def.innerType._parse(D),B=($)=>{if(U2($))$.value=Object.freeze($.value);return $};return UF(F)?F.then(($)=>B($)):B(F)}unwrap(){return this._def.innerType}};TF.create=(D,F)=>{return new TF({innerType:D,typeName:n.ZodReadonly,...DD(F)})};P_={object:ID.lazycreate};(function(D){D.ZodString="ZodString",D.ZodNumber="ZodNumber",D.ZodNaN="ZodNaN",D.ZodBigInt="ZodBigInt",D.ZodBoolean="ZodBoolean",D.ZodDate="ZodDate",D.ZodSymbol="ZodSymbol",D.ZodUndefined="ZodUndefined",D.ZodNull="ZodNull",D.ZodAny="ZodAny",D.ZodUnknown="ZodUnknown",D.ZodNever="ZodNever",D.ZodVoid="ZodVoid",D.ZodArray="ZodArray",D.ZodObject="ZodObject",D.ZodUnion="ZodUnion",D.ZodDiscriminatedUnion="ZodDiscriminatedUnion",D.ZodIntersection="ZodIntersection",D.ZodTuple="ZodTuple",D.ZodRecord="ZodRecord",D.ZodMap="ZodMap",D.ZodSet="ZodSet",D.ZodFunction="ZodFunction",D.ZodLazy="ZodLazy",D.ZodLiteral="ZodLiteral",D.ZodEnum="ZodEnum",D.ZodEffects="ZodEffects",D.ZodNativeEnum="ZodNativeEnum",D.ZodOptional="ZodOptional",D.ZodNullable="ZodNullable",D.ZodDefault="ZodDefault",D.ZodCatch="ZodCatch",D.ZodPromise="ZodPromise",D.ZodBranded="ZodBranded",D.ZodPipeline="ZodPipeline",D.ZodReadonly="ZodReadonly"})(n||(n={}));j7=R0.create,K7=E2.create,y_=z3.create,f_=L2.create,U7=LF.create,h_=y2.create,m_=J3.create,g_=wF.create,d_=OF.create,c_=f2.create,l_=V2.create,p_=l0.create,i_=X3.create,n_=Z0.create,s_=ID.create,a_=ID.strictCreate,o_=bF.create,r_=i3.create,t_=RF.create,e_=p0.create,DQ=G3.create,FQ=W3.create,BQ=h2.create,$Q=EF.create,_Q=ZF.create,QQ=NF.create,YQ=w2.create,qQ=SF.create,HQ=m2.create,JQ=k0.create,XQ=N0.create,GQ=$2.create,WQ=k0.createWithPreprocess,zQ=M3.create,KQ={string:(D)=>R0.create({...D,coerce:!0}),number:(D)=>E2.create({...D,coerce:!0}),boolean:(D)=>LF.create({...D,coerce:!0}),bigint:(D)=>L2.create({...D,coerce:!0}),date:(D)=>y2.create({...D,coerce:!0})},UQ=l});var W={};j2(W,{void:()=>i_,util:()=>QD,unknown:()=>l_,union:()=>o_,undefined:()=>g_,tuple:()=>e_,transformer:()=>JQ,symbol:()=>m_,string:()=>j7,strictObject:()=>a_,setErrorMap:()=>G_,set:()=>BQ,record:()=>DQ,quotelessJson:()=>J_,promise:()=>HQ,preprocess:()=>WQ,pipeline:()=>zQ,ostring:()=>MQ,optional:()=>XQ,onumber:()=>AQ,oboolean:()=>jQ,objectUtil:()=>_1,object:()=>s_,number:()=>K7,nullable:()=>GQ,null:()=>d_,never:()=>p_,nativeEnum:()=>qQ,nan:()=>y_,map:()=>FQ,makeIssue:()=>H3,literal:()=>QQ,lazy:()=>_Q,late:()=>P_,isValid:()=>U2,isDirty:()=>p3,isAsync:()=>UF,isAborted:()=>l3,intersection:()=>t_,instanceof:()=>x_,getParsedType:()=>c0,getErrorMap:()=>KF,function:()=>$Q,enum:()=>YQ,effect:()=>JQ,discriminatedUnion:()=>r_,defaultErrorMap:()=>F2,datetimeRegex:()=>z7,date:()=>h_,custom:()=>A7,coerce:()=>KQ,boolean:()=>U7,bigint:()=>f_,array:()=>n_,any:()=>c_,addIssueToContext:()=>T,ZodVoid:()=>X3,ZodUnknown:()=>V2,ZodUnion:()=>bF,ZodUndefined:()=>wF,ZodType:()=>BD,ZodTuple:()=>p0,ZodTransformer:()=>k0,ZodSymbol:()=>J3,ZodString:()=>R0,ZodSet:()=>h2,ZodSchema:()=>BD,ZodRecord:()=>G3,ZodReadonly:()=>TF,ZodPromise:()=>m2,ZodPipeline:()=>M3,ZodParsedType:()=>I,ZodOptional:()=>N0,ZodObject:()=>ID,ZodNumber:()=>E2,ZodNullable:()=>$2,ZodNull:()=>OF,ZodNever:()=>l0,ZodNativeEnum:()=>SF,ZodNaN:()=>z3,ZodMap:()=>W3,ZodLiteral:()=>NF,ZodLazy:()=>ZF,ZodIssueCode:()=>R,ZodIntersection:()=>RF,ZodFunction:()=>EF,ZodFirstPartyTypeKind:()=>n,ZodError:()=>cD,ZodEnum:()=>w2,ZodEffects:()=>k0,ZodDiscriminatedUnion:()=>i3,ZodDefault:()=>kF,ZodDate:()=>y2,ZodCatch:()=>IF,ZodBranded:()=>n3,ZodBoolean:()=>LF,ZodBigInt:()=>L2,ZodArray:()=>Z0,ZodAny:()=>f2,Schema:()=>BD,ParseStatus:()=>lD,OK:()=>sD,NEVER:()=>UQ,INVALID:()=>l,EMPTY_PATH:()=>W_,DIRTY:()=>x2,BRAND:()=>u_});var J1=V(()=>{c3();Y1();q7();q3();V7();d3()});var _2=V(()=>{J1();J1()});var L7;var E7=V(()=>{L7={name:"ocx",version:"2.0.3",description:"OCX CLI - ShadCN-style registry for OpenCode extensions. Install agents, plugins, skills, and MCP servers.",author:"kdcokenny",license:"MIT",type:"module",main:"./dist/index.js",bin:{ocx:"./dist/index.js"},files:["dist/index.js"],publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/kdcokenny/ocx.git"},homepage:"https://github.com/kdcokenny/ocx#readme",bugs:{url:"https://github.com/kdcokenny/ocx/issues"},keywords:["opencode","cli","extensions","agents","plugins","mcp","shadcn","registry"],engines:{node:">=18"},scripts:{build:"bun run scripts/build.ts","build:binary":"bun run scripts/build-binary.ts",check:"bun check:biome && bun check:types","check:biome":"biome check .","check:types":"tsc --noEmit",dev:"bun run src/index.ts",prepublishOnly:"bun run build",test:"bun test"},dependencies:{commander:"^14.0.0",fuzzysort:"^3.1.0","jsonc-parser":"3.3.1",kleur:"^4.1.5",ora:"^8.2.0",remeda:"^2.33.0",zod:"^3.24.0"},devDependencies:{"@types/bun":"latest"}}});function EQ(D){return`https://${A3}/schemas/v${D}/registry.json`}var A3="ocx.kdco.dev",w7="kdcokenny/ocx",X1,G1,I0=2,T0,O7;var s3=V(()=>{E7();X1=`https://${A3}/schemas/ocx.json`,G1=`https://${A3}/schemas/registry.json`;T0=EQ(I0),O7=L7.version});var XD,zD,MD,RD,c,U,g2,gD,d2,vD,v0,CD,O2,vF,C0,CF,W1;var $D=V(()=>{XD={SUCCESS:0,GENERAL:1,NOT_FOUND:66,NETWORK:69,CONFIG:78,INTEGRITY:65,CONFLICT:6};zD=class zD extends Error{code;exitCode;constructor(D,F,B=XD.GENERAL){super(D);this.code=F;this.exitCode=B;this.name="OCXError"}};MD=class MD extends zD{constructor(D){super(D,"NOT_FOUND",XD.NOT_FOUND);this.name="NotFoundError"}};RD=class RD extends zD{url;status;statusText;phase;qualifiedName;registryContext;registryName;constructor(D,F){super(D,"NETWORK_ERROR",XD.NETWORK);this.name="NetworkError",this.url=F?.url,this.status=F?.status,this.statusText=F?.statusText,this.phase=F?.phase,this.qualifiedName=F?.qualifiedName,this.registryContext=F?.registryContext,this.registryName=F?.registryName}};c=class c extends zD{constructor(D){super(D,"CONFIG_ERROR",XD.CONFIG);this.name="ConfigError"}};U=class U extends zD{constructor(D){super(D,"VALIDATION_ERROR",XD.GENERAL);this.name="ValidationError"}};g2=class g2 extends zD{details;constructor(D){super("Registry validation failed","VALIDATION_FAILED",XD.CONFIG);this.details=D;this.name="ValidationFailedError"}};gD=class gD extends zD{constructor(D){super(D,"CONFLICT",XD.CONFLICT);this.name="ConflictError"}};d2=class d2 extends zD{component;expected;found;constructor(D,F,B){let $=`Integrity verification failed for "${D}"
18
- Expected: ${F}
19
- Found: ${B}
15
+ `}return $&&$.eol||`
16
+ `}function d0($,_){return`\r
17
+ `.indexOf($.charAt(_))!==-1}var e8=b(()=>{vv();eY()});function $z($,_=[],U=p0.DEFAULT){let Q=null,v=[],J=[];function Y(I){if(Array.isArray(v))v.push(I);else if(Q!==null)v[Q]=I}return _9($,{onObjectBegin:()=>{let I={};Y(I),J.push(v),v=I,Q=null},onObjectProperty:(I)=>{Q=I},onObjectEnd:()=>{v=J.pop()},onArrayBegin:()=>{let I=[];Y(I),J.push(v),v=I,Q=null},onArrayEnd:()=>{v=J.pop()},onLiteralValue:Y,onError:(I,X,q)=>{_.push({error:I,offset:X,length:q})}},U),v[0]}function $9($,_=[],U=p0.DEFAULT){let Q={type:"array",offset:-1,length:-1,children:[],parent:void 0};function v(I){if(Q.type==="property")Q.length=I-Q.offset,Q=Q.parent}function J(I){return Q.children.push(I),I}_9($,{onObjectBegin:(I)=>{Q=J({type:"object",offset:I,length:-1,parent:Q,children:[]})},onObjectProperty:(I,X,q)=>{Q=J({type:"property",offset:X,length:-1,parent:Q,children:[]}),Q.children.push({type:"string",value:I,offset:X,length:q,parent:Q})},onObjectEnd:(I,X)=>{v(I+X),Q.length=I+X-Q.offset,Q=Q.parent,v(I+X)},onArrayBegin:(I,X)=>{Q=J({type:"array",offset:I,length:-1,parent:Q,children:[]})},onArrayEnd:(I,X)=>{Q.length=I+X-Q.offset,Q=Q.parent,v(I+X)},onLiteralValue:(I,X,q)=>{J({type:oW(I),offset:X,length:q,parent:Q,value:I}),v(X+q)},onSeparator:(I,X,q)=>{if(Q.type==="property"){if(I===":")Q.colonOffset=X;else if(I===",")v(X)}},onError:(I,X,q)=>{_.push({error:I,offset:X,length:q})}},U);let z=Q.children[0];if(z)delete z.parent;return z}function Uv($,_){if(!$)return;let U=$;for(let Q of _)if(typeof Q==="string"){if(U.type!=="object"||!Array.isArray(U.children))return;let v=!1;for(let J of U.children)if(Array.isArray(J.children)&&J.children[0].value===Q&&J.children.length===2){U=J.children[1],v=!0;break}if(!v)return}else{let v=Q;if(U.type!=="array"||v<0||!Array.isArray(U.children)||v>=U.children.length)return;U=U.children[v]}return U}function _9($,_,U=p0.DEFAULT){let Q=l0($,!1),v=[],J=0;function Y(C){return C?()=>J===0&&C(Q.getTokenOffset(),Q.getTokenLength(),Q.getTokenStartLine(),Q.getTokenStartCharacter()):()=>!0}function z(C){return C?(h)=>J===0&&C(h,Q.getTokenOffset(),Q.getTokenLength(),Q.getTokenStartLine(),Q.getTokenStartCharacter()):()=>!0}function I(C){return C?(h)=>J===0&&C(h,Q.getTokenOffset(),Q.getTokenLength(),Q.getTokenStartLine(),Q.getTokenStartCharacter(),()=>v.slice()):()=>!0}function X(C){return C?()=>{if(J>0)J++;else if(C(Q.getTokenOffset(),Q.getTokenLength(),Q.getTokenStartLine(),Q.getTokenStartCharacter(),()=>v.slice())===!1)J=1}:()=>!0}function q(C){return C?()=>{if(J>0)J--;if(J===0)C(Q.getTokenOffset(),Q.getTokenLength(),Q.getTokenStartLine(),Q.getTokenStartCharacter())}:()=>!0}let G=X(_.onObjectBegin),j=I(_.onObjectProperty),H=q(_.onObjectEnd),Z=X(_.onArrayBegin),V=q(_.onArrayEnd),S=I(_.onLiteralValue),T=z(_.onSeparator),r=Y(_.onComment),A=z(_.onError),u=U&&U.disallowComments,k=U&&U.allowTrailingComma;function O(){while(!0){let C=Q.scan();switch(Q.getTokenError()){case 4:w(14);break;case 5:w(15);break;case 3:w(13);break;case 1:if(!u)w(11);break;case 2:w(12);break;case 6:w(16);break}switch(C){case 12:case 13:if(u)w(10);else r();break;case 16:w(1);break;case 15:case 14:break;default:return C}}}function w(C,h=[],I$=[]){if(A(C),h.length+I$.length>0){let $$=Q.getToken();while($$!==17){if(h.indexOf($$)!==-1){O();break}else if(I$.indexOf($$)!==-1)break;$$=O()}}}function v$(C){let h=Q.getTokenValue();if(C)S(h);else j(h),v.push(h);return O(),!0}function o(){switch(Q.getToken()){case 11:let C=Q.getTokenValue(),h=Number(C);if(isNaN(h))w(2),h=0;S(h);break;case 7:S(null);break;case 8:S(!0);break;case 9:S(!1);break;default:return!1}return O(),!0}function Q$(){if(Q.getToken()!==10)return w(3,[],[2,5]),!1;if(v$(!1),Q.getToken()===6){if(T(":"),O(),!t())w(4,[],[2,5])}else w(5,[],[2,5]);return v.pop(),!0}function D$(){G(),O();let C=!1;while(Q.getToken()!==2&&Q.getToken()!==17){if(Q.getToken()===5){if(!C)w(4,[],[]);if(T(","),O(),Q.getToken()===2&&k)break}else if(C)w(6,[],[]);if(!Q$())w(4,[],[2,5]);C=!0}if(H(),Q.getToken()!==2)w(7,[2],[]);else O();return!0}function x(){Z(),O();let C=!0,h=!1;while(Q.getToken()!==4&&Q.getToken()!==17){if(Q.getToken()===5){if(!h)w(4,[],[]);if(T(","),O(),Q.getToken()===4&&k)break}else if(h)w(6,[],[]);if(C)v.push(0),C=!1;else v[v.length-1]++;if(!t())w(4,[],[4,5]);h=!0}if(V(),!C)v.pop();if(Q.getToken()!==4)w(8,[4],[]);else O();return!0}function t(){switch(Q.getToken()){case 3:return x();case 1:return D$();case 10:return v$(!0);default:return o()}}if(O(),Q.getToken()===17){if(U.allowEmptyContent)return!0;return w(4,[],[]),!1}if(!t())return w(4,[],[]),!1;if(Q.getToken()!==17)w(9,[],[]);return!0}function oW($){switch(typeof $){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(!$)return"null";else if(Array.isArray($))return"array";return"object"}default:return"null"}}var p0;var v9=b(()=>{vv();(function($){$.DEFAULT={allowTrailingComma:!1}})(p0||(p0={}))});function _z($,_,U,Q){let v=_.slice(),Y=$9($,[]),z=void 0,I=void 0;while(v.length>0)if(I=v.pop(),z=Uv(Y,v),z===void 0&&U!==void 0)if(typeof I==="string")U={[I]:U};else U=[U];else break;if(!z){if(U===void 0)throw Error("Can not delete in empty document");return a6($,{offset:Y?Y.offset:0,length:Y?Y.length:0,content:JSON.stringify(U)},Q)}else if(z.type==="object"&&typeof I==="string"&&Array.isArray(z.children)){let X=Uv(z,[I]);if(X!==void 0)if(U===void 0){if(!X.parent)throw Error("Malformed AST");let q=z.children.indexOf(X.parent),G,j=X.parent.offset+X.parent.length;if(q>0){let H=z.children[q-1];G=H.offset+H.length}else if(G=z.offset+1,z.children.length>1)j=z.children[1].offset;return a6($,{offset:G,length:j-G,content:""},Q)}else return a6($,{offset:X.offset,length:X.length,content:JSON.stringify(U)},Q);else{if(U===void 0)return[];let q=`${JSON.stringify(I)}: ${JSON.stringify(U)}`,G=Q.getInsertionIndex?Q.getInsertionIndex(z.children.map((H)=>H.children[0].value)):z.children.length,j;if(G>0){let H=z.children[G-1];j={offset:H.offset+H.length,length:0,content:","+q}}else if(z.children.length===0)j={offset:z.offset+1,length:0,content:q};else j={offset:z.offset+1,length:0,content:q+","};return a6($,j,Q)}}else if(z.type==="array"&&typeof I==="number"&&Array.isArray(z.children)){let X=I;if(X===-1){let q=`${JSON.stringify(U)}`,G;if(z.children.length===0)G={offset:z.offset+1,length:0,content:q};else{let j=z.children[z.children.length-1];G={offset:j.offset+j.length,length:0,content:","+q}}return a6($,G,Q)}else if(U===void 0&&z.children.length>=0){let q=I,G=z.children[q],j;if(z.children.length===1)j={offset:z.offset+1,length:z.length-2,content:""};else if(z.children.length-1===q){let H=z.children[q-1],Z=H.offset+H.length,V=z.offset+z.length;j={offset:Z,length:V-2-Z,content:""}}else j={offset:G.offset,length:z.children[q+1].offset-G.offset,content:""};return a6($,j,Q)}else if(U!==void 0){let q,G=`${JSON.stringify(U)}`;if(!Q.isArrayInsertion&&z.children.length>I){let j=z.children[I];q={offset:j.offset,length:j.length,content:G}}else if(z.children.length===0||I===0)q={offset:z.offset+1,length:0,content:z.children.length===0?G:G+","};else{let j=I>z.children.length?z.children.length:I,H=z.children[j-1];q={offset:H.offset+H.length,length:0,content:","+G}}return a6($,q,Q)}else throw Error(`Can not ${U===void 0?"remove":Q.isArrayInsertion?"insert":"modify"} Array index ${X} as length is not sufficient`)}else throw Error(`Can not add ${typeof I!=="number"?"index":"property"} to parent of type ${z.type}`)}function a6($,_,U){if(!U.formattingOptions)return[_];let Q=Qv($,_),v=_.offset,J=_.offset+_.content.length;if(_.length===0||_.content.length===0){while(v>0&&!d0(Q,v-1))v--;while(J<Q.length&&!d0(Q,J))J++}let Y=s8(Q,{offset:v,length:J-v},{...U.formattingOptions,keepLines:!1});for(let I=Y.length-1;I>=0;I--){let X=Y[I];Q=Qv(Q,X),v=Math.min(v,X.offset),J=Math.max(J,X.offset+X.length),J+=X.content.length-X.length}let z=$.length-(Q.length-J)-v;return[{offset:v,length:z,content:Q.substring(v,J)}]}function Qv($,_){return $.substring(0,_.offset)+_.content+$.substring(_.offset+_.length)}var vz=b(()=>{e8();v9()});function S6($){switch($){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return"<unknown ParseErrorCode>"}function y1($,_,U,Q){return _z($,_,U,Q)}function C1($,_){let U=_.slice(0).sort((v,J)=>{let Y=v.offset-J.offset;if(Y===0)return v.length-J.length;return Y}),Q=$.length;for(let v=U.length-1;v>=0;v--){let J=U[v];if(J.offset+J.length<=Q)$=Qv($,J);else throw Error("Overlapping edit");Q=J.offset}return $}var Uz,Qz,x$,Jz;var c4=b(()=>{e8();vz();vv();v9();(function($){$[$.None=0]="None",$[$.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",$[$.UnexpectedEndOfString=2]="UnexpectedEndOfString",$[$.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",$[$.InvalidUnicode=4]="InvalidUnicode",$[$.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",$[$.InvalidCharacter=6]="InvalidCharacter"})(Uz||(Uz={}));(function($){$[$.OpenBraceToken=1]="OpenBraceToken",$[$.CloseBraceToken=2]="CloseBraceToken",$[$.OpenBracketToken=3]="OpenBracketToken",$[$.CloseBracketToken=4]="CloseBracketToken",$[$.CommaToken=5]="CommaToken",$[$.ColonToken=6]="ColonToken",$[$.NullKeyword=7]="NullKeyword",$[$.TrueKeyword=8]="TrueKeyword",$[$.FalseKeyword=9]="FalseKeyword",$[$.StringLiteral=10]="StringLiteral",$[$.NumericLiteral=11]="NumericLiteral",$[$.LineCommentTrivia=12]="LineCommentTrivia",$[$.BlockCommentTrivia=13]="BlockCommentTrivia",$[$.LineBreakTrivia=14]="LineBreakTrivia",$[$.Trivia=15]="Trivia",$[$.Unknown=16]="Unknown",$[$.EOF=17]="EOF"})(Qz||(Qz={}));x$=$z;(function($){$[$.InvalidSymbol=1]="InvalidSymbol",$[$.InvalidNumberFormat=2]="InvalidNumberFormat",$[$.PropertyNameExpected=3]="PropertyNameExpected",$[$.ValueExpected=4]="ValueExpected",$[$.ColonExpected=5]="ColonExpected",$[$.CommaExpected=6]="CommaExpected",$[$.CloseBraceExpected=7]="CloseBraceExpected",$[$.CloseBracketExpected=8]="CloseBracketExpected",$[$.EndOfFileExpected=9]="EndOfFileExpected",$[$.InvalidCommentToken=10]="InvalidCommentToken",$[$.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",$[$.UnexpectedEndOfString=12]="UnexpectedEndOfString",$[$.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",$[$.InvalidUnicode=14]="InvalidUnicode",$[$.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",$[$.InvalidCharacter=16]="InvalidCharacter"})(Jz||(Jz={}))});function B($,_,U){function Q(z,I){if(!z._zod)Object.defineProperty(z,"_zod",{value:{def:I,constr:Y,traits:new Set},enumerable:!1});if(z._zod.traits.has($))return;z._zod.traits.add($),_(z,I);let X=Y.prototype,q=Object.keys(X);for(let G=0;G<q.length;G++){let j=q[G];if(!(j in z))z[j]=X[j].bind(z)}}let v=U?.Parent??Object;class J extends v{}Object.defineProperty(J,"name",{value:$});function Y(z){var I;let X=U?.Parent?new J:this;Q(X,z),(I=X._zod).deferred??(I.deferred=[]);for(let q of X._zod.deferred)q();return X}return Object.defineProperty(Y,"init",{value:Q}),Object.defineProperty(Y,Symbol.hasInstance,{value:(z)=>{if(U?.Parent&&z instanceof U.Parent)return!0;return z?._zod?.traits?.has($)}}),Object.defineProperty(Y,"name",{value:$}),Y}function l$($){if($)Object.assign(i0,$);return i0}var U9,Q9,_6,s6,i0;var f1=b(()=>{U9=Object.freeze({status:"aborted"});Q9=Symbol("zod_brand");_6=class _6 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};s6=class s6 extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}};i0={}});var E={};s$(E,{unwrapMessage:()=>n0,uint8ArrayToHex:()=>wb,uint8ArrayToBase64url:()=>Db,uint8ArrayToBase64:()=>Iz,stringifyPrimitive:()=>N,slugify:()=>z9,shallowClone:()=>X9,safeExtend:()=>Hb,required:()=>Bb,randomString:()=>zb,propertyKeyTypes:()=>t0,promiseAllObject:()=>Yb,primitiveTypes:()=>q9,prefixIssues:()=>w4,pick:()=>Gb,partial:()=>bb,parsedType:()=>R,optionalKeys:()=>G9,omit:()=>jb,objectClone:()=>Ub,numKeys:()=>Ib,nullish:()=>T6,normalizeParams:()=>P,mergeDefs:()=>H6,merge:()=>Wb,jsonStringifyReplacer:()=>m1,joinValues:()=>D,issue:()=>h1,isPlainObject:()=>E6,isObject:()=>e6,hexToUint8Array:()=>Mb,getSizableOrigin:()=>a0,getParsedType:()=>Xb,getLengthableOrigin:()=>s0,getEnumValues:()=>r0,getElementAtPath:()=>Jb,floatSafeRemainder:()=>Y9,finalizeIssue:()=>H4,extend:()=>Kb,escapeRegex:()=>R4,esc:()=>Jv,defineLazy:()=>Y$,createTransparentProxy:()=>qb,cloneDef:()=>Qb,clone:()=>Y4,cleanRegex:()=>o0,cleanEnum:()=>Zb,captureStackTrace:()=>Yv,cached:()=>g1,base64urlToUint8Array:()=>Vb,base64ToUint8Array:()=>zz,assignProp:()=>R6,assertNotEqual:()=>eW,assertNever:()=>_b,assertIs:()=>$b,assertEqual:()=>sW,assert:()=>vb,allowsEval:()=>I9,aborted:()=>P6,NUMBER_FORMAT_RANGES:()=>j9,Class:()=>Xz,BIGINT_FORMAT_RANGES:()=>K9});function sW($){return $}function eW($){return $}function $b($){}function _b($){throw Error("Unexpected value in exhaustive check")}function vb($){}function r0($){let _=Object.values($).filter((Q)=>typeof Q==="number");return Object.entries($).filter(([Q,v])=>_.indexOf(+Q)===-1).map(([Q,v])=>v)}function D($,_="|"){return $.map((U)=>N(U)).join(_)}function m1($,_){if(typeof _==="bigint")return _.toString();return _}function g1($){return{get value(){{let U=$();return Object.defineProperty(this,"value",{value:U}),U}throw Error("cached value already set")}}}function T6($){return $===null||$===void 0}function o0($){let _=$.startsWith("^")?1:0,U=$.endsWith("$")?$.length-1:$.length;return $.slice(_,U)}function Y9($,_){let U=($.toString().split(".")[1]||"").length,Q=_.toString(),v=(Q.split(".")[1]||"").length;if(v===0&&/\d?e-\d?/.test(Q)){let I=Q.match(/\d?e-(\d?)/);if(I?.[1])v=Number.parseInt(I[1])}let J=U>v?U:v,Y=Number.parseInt($.toFixed(J).replace(".","")),z=Number.parseInt(_.toFixed(J).replace(".",""));return Y%z/10**J}function Y$($,_,U){let Q=void 0;Object.defineProperty($,_,{get(){if(Q===Yz)return;if(Q===void 0)Q=Yz,Q=U();return Q},set(v){Object.defineProperty($,_,{value:v})},configurable:!0})}function Ub($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function R6($,_,U){Object.defineProperty($,_,{value:U,writable:!0,enumerable:!0,configurable:!0})}function H6(...$){let _={};for(let U of $){let Q=Object.getOwnPropertyDescriptors(U);Object.assign(_,Q)}return Object.defineProperties({},_)}function Qb($){return H6($._zod.def)}function Jb($,_){if(!_)return $;return _.reduce((U,Q)=>U?.[Q],$)}function Yb($){let _=Object.keys($),U=_.map((Q)=>$[Q]);return Promise.all(U).then((Q)=>{let v={};for(let J=0;J<_.length;J++)v[_[J]]=Q[J];return v})}function zb($=10){let U="";for(let Q=0;Q<$;Q++)U+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return U}function Jv($){return JSON.stringify($)}function z9($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function e6($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function E6($){if(e6($)===!1)return!1;let _=$.constructor;if(_===void 0)return!0;if(typeof _!=="function")return!0;let U=_.prototype;if(e6(U)===!1)return!1;if(Object.prototype.hasOwnProperty.call(U,"isPrototypeOf")===!1)return!1;return!0}function X9($){if(E6($))return{...$};if(Array.isArray($))return[...$];return $}function Ib($){let _=0;for(let U in $)if(Object.prototype.hasOwnProperty.call($,U))_++;return _}function R4($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Y4($,_,U){let Q=new $._zod.constr(_??$._zod.def);if(!_||U?.parent)Q._zod.parent=$;return Q}function P($){let _=$;if(!_)return{};if(typeof _==="string")return{error:()=>_};if(_?.message!==void 0){if(_?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");_.error=_.message}if(delete _.message,typeof _.error==="string")return{..._,error:()=>_.error};return _}function qb($){let _;return new Proxy({},{get(U,Q,v){return _??(_=$()),Reflect.get(_,Q,v)},set(U,Q,v,J){return _??(_=$()),Reflect.set(_,Q,v,J)},has(U,Q){return _??(_=$()),Reflect.has(_,Q)},deleteProperty(U,Q){return _??(_=$()),Reflect.deleteProperty(_,Q)},ownKeys(U){return _??(_=$()),Reflect.ownKeys(_)},getOwnPropertyDescriptor(U,Q){return _??(_=$()),Reflect.getOwnPropertyDescriptor(_,Q)},defineProperty(U,Q,v){return _??(_=$()),Reflect.defineProperty(_,Q,v)}})}function N($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function G9($){return Object.keys($).filter((_)=>{return $[_]._zod.optin==="optional"&&$[_]._zod.optout==="optional"})}function Gb($,_){let U=$._zod.def,Q=U.checks;if(Q&&Q.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let J=H6($._zod.def,{get shape(){let Y={};for(let z in _){if(!(z in U.shape))throw Error(`Unrecognized key: "${z}"`);if(!_[z])continue;Y[z]=U.shape[z]}return R6(this,"shape",Y),Y},checks:[]});return Y4($,J)}function jb($,_){let U=$._zod.def,Q=U.checks;if(Q&&Q.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let J=H6($._zod.def,{get shape(){let Y={...$._zod.def.shape};for(let z in _){if(!(z in U.shape))throw Error(`Unrecognized key: "${z}"`);if(!_[z])continue;delete Y[z]}return R6(this,"shape",Y),Y},checks:[]});return Y4($,J)}function Kb($,_){if(!E6(_))throw Error("Invalid input to extend: expected a plain object");let U=$._zod.def.checks;if(U&&U.length>0){let J=$._zod.def.shape;for(let Y in _)if(Object.getOwnPropertyDescriptor(J,Y)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let v=H6($._zod.def,{get shape(){let J={...$._zod.def.shape,..._};return R6(this,"shape",J),J}});return Y4($,v)}function Hb($,_){if(!E6(_))throw Error("Invalid input to safeExtend: expected a plain object");let U=H6($._zod.def,{get shape(){let Q={...$._zod.def.shape,..._};return R6(this,"shape",Q),Q}});return Y4($,U)}function Wb($,_){let U=H6($._zod.def,{get shape(){let Q={...$._zod.def.shape,..._._zod.def.shape};return R6(this,"shape",Q),Q},get catchall(){return _._zod.def.catchall},checks:[]});return Y4($,U)}function bb($,_,U){let v=_._zod.def.checks;if(v&&v.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let Y=H6(_._zod.def,{get shape(){let z=_._zod.def.shape,I={...z};if(U)for(let X in U){if(!(X in z))throw Error(`Unrecognized key: "${X}"`);if(!U[X])continue;I[X]=$?new $({type:"optional",innerType:z[X]}):z[X]}else for(let X in z)I[X]=$?new $({type:"optional",innerType:z[X]}):z[X];return R6(this,"shape",I),I},checks:[]});return Y4(_,Y)}function Bb($,_,U){let Q=H6(_._zod.def,{get shape(){let v=_._zod.def.shape,J={...v};if(U)for(let Y in U){if(!(Y in J))throw Error(`Unrecognized key: "${Y}"`);if(!U[Y])continue;J[Y]=new $({type:"nonoptional",innerType:v[Y]})}else for(let Y in v)J[Y]=new $({type:"nonoptional",innerType:v[Y]});return R6(this,"shape",J),J}});return Y4(_,Q)}function P6($,_=0){if($.aborted===!0)return!0;for(let U=_;U<$.issues.length;U++)if($.issues[U]?.continue!==!0)return!0;return!1}function w4($,_){return _.map((U)=>{var Q;return(Q=U).path??(Q.path=[]),U.path.unshift($),U})}function n0($){return typeof $==="string"?$:$?.message}function H4($,_,U){let Q={...$,path:$.path??[]};if(!$.message){let v=n0($.inst?._zod.def?.error?.($))??n0(_?.error?.($))??n0(U.customError?.($))??n0(U.localeError?.($))??"Invalid input";Q.message=v}if(delete Q.inst,delete Q.continue,!_?.reportInput)delete Q.input;return Q}function a0($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function s0($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function R($){let _=typeof $;switch(_){case"number":return Number.isNaN($)?"nan":"number";case"object":{if($===null)return"null";if(Array.isArray($))return"array";let U=$;if(U&&Object.getPrototypeOf(U)!==Object.prototype&&"constructor"in U&&U.constructor)return U.constructor.name}}return _}function h1(...$){let[_,U,Q]=$;if(typeof _==="string")return{message:_,code:"custom",input:U,inst:Q};return{..._}}function Zb($){return Object.entries($).filter(([_,U])=>{return Number.isNaN(Number.parseInt(_,10))}).map((_)=>_[1])}function zz($){let _=atob($),U=new Uint8Array(_.length);for(let Q=0;Q<_.length;Q++)U[Q]=_.charCodeAt(Q);return U}function Iz($){let _="";for(let U=0;U<$.length;U++)_+=String.fromCharCode($[U]);return btoa(_)}function Vb($){let _=$.replace(/-/g,"+").replace(/_/g,"/"),U="=".repeat((4-_.length%4)%4);return zz(_+U)}function Db($){return Iz($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Mb($){let _=$.replace(/^0x/,"");if(_.length%2!==0)throw Error("Invalid hex string length");let U=new Uint8Array(_.length/2);for(let Q=0;Q<_.length;Q+=2)U[Q/2]=Number.parseInt(_.slice(Q,Q+2),16);return U}function wb($){return Array.from($).map((_)=>_.toString(16).padStart(2,"0")).join("")}class Xz{constructor(...$){}}var Yz,Yv,I9,Xb=($)=>{let _=typeof $;switch(_){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map<"u"&&$ instanceof Map)return"map";if(typeof Set<"u"&&$ instanceof Set)return"set";if(typeof Date<"u"&&$ instanceof Date)return"date";if(typeof File<"u"&&$ instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${_}`)}},t0,q9,j9,K9;var l=b(()=>{Yz=Symbol("evaluating");Yv="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};I9=g1(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});t0=new Set(["string","number","symbol"]),q9=new Set(["string","number","bigint","boolean","symbol","undefined"]);j9={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},K9={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]}});function $_($,_=(U)=>U.message){let U={},Q=[];for(let v of $.issues)if(v.path.length>0)U[v.path[0]]=U[v.path[0]]||[],U[v.path[0]].push(_(v));else Q.push(_(v));return{formErrors:Q,fieldErrors:U}}function __($,_=(U)=>U.message){let U={_errors:[]},Q=(v)=>{for(let J of v.issues)if(J.code==="invalid_union"&&J.errors.length)J.errors.map((Y)=>Q({issues:Y}));else if(J.code==="invalid_key")Q({issues:J.issues});else if(J.code==="invalid_element")Q({issues:J.issues});else if(J.path.length===0)U._errors.push(_(J));else{let Y=U,z=0;while(z<J.path.length){let I=J.path[z];if(z!==J.path.length-1)Y[I]=Y[I]||{_errors:[]};else Y[I]=Y[I]||{_errors:[]},Y[I]._errors.push(_(J));Y=Y[I],z++}}};return Q($),U}function H9($,_=(U)=>U.message){let U={errors:[]},Q=(v,J=[])=>{var Y,z;for(let I of v.issues)if(I.code==="invalid_union"&&I.errors.length)I.errors.map((X)=>Q({issues:X},I.path));else if(I.code==="invalid_key")Q({issues:I.issues},I.path);else if(I.code==="invalid_element")Q({issues:I.issues},I.path);else{let X=[...J,...I.path];if(X.length===0){U.errors.push(_(I));continue}let q=U,G=0;while(G<X.length){let j=X[G],H=G===X.length-1;if(typeof j==="string")q.properties??(q.properties={}),(Y=q.properties)[j]??(Y[j]={errors:[]}),q=q.properties[j];else q.items??(q.items=[]),(z=q.items)[j]??(z[j]={errors:[]}),q=q.items[j];if(H)q.errors.push(_(I));G++}}};return Q($),U}function Gz($){let _=[],U=$.map((Q)=>typeof Q==="object"?Q.key:Q);for(let Q of U)if(typeof Q==="number")_.push(`[${Q}]`);else if(typeof Q==="symbol")_.push(`[${JSON.stringify(String(Q))}]`);else if(/[^\w$]/.test(Q))_.push(`[${JSON.stringify(Q)}]`);else{if(_.length)_.push(".");_.push(Q)}return _.join("")}function W9($){let _=[],U=[...$.issues].sort((Q,v)=>(Q.path??[]).length-(v.path??[]).length);for(let Q of U)if(_.push(`\u2716 ${Q.message}`),Q.path?.length)_.push(` \u2192 at ${Gz(Q.path)}`);return _.join(`
18
+ `)}var qz=($,_)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:_,enumerable:!1}),$.message=JSON.stringify(_,m1,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},e0,W4;var b9=b(()=>{f1();l();e0=B("$ZodError",qz),W4=B("$ZodError",qz,{Parent:Error})});var c1=($)=>(_,U,Q,v)=>{let J=Q?Object.assign(Q,{async:!1}):{async:!1},Y=_._zod.run({value:U,issues:[]},J);if(Y instanceof Promise)throw new _6;if(Y.issues.length){let z=new(v?.Err??$)(Y.issues.map((I)=>H4(I,J,l$())));throw Yv(z,v?.callee),z}return Y.value},zv,l1=($)=>async(_,U,Q,v)=>{let J=Q?Object.assign(Q,{async:!0}):{async:!0},Y=_._zod.run({value:U,issues:[]},J);if(Y instanceof Promise)Y=await Y;if(Y.issues.length){let z=new(v?.Err??$)(Y.issues.map((I)=>H4(I,J,l$())));throw Yv(z,v?.callee),z}return Y.value},Iv,d1=($)=>(_,U,Q)=>{let v=Q?{...Q,async:!1}:{async:!1},J=_._zod.run({value:U,issues:[]},v);if(J instanceof Promise)throw new _6;return J.issues.length?{success:!1,error:new($??e0)(J.issues.map((Y)=>H4(Y,v,l$())))}:{success:!0,data:J.value}},B9,p1=($)=>async(_,U,Q)=>{let v=Q?Object.assign(Q,{async:!0}):{async:!0},J=_._zod.run({value:U,issues:[]},v);if(J instanceof Promise)J=await J;return J.issues.length?{success:!1,error:new $(J.issues.map((Y)=>H4(Y,v,l$())))}:{success:!0,data:J.value}},Z9,Xv=($)=>(_,U,Q)=>{let v=Q?Object.assign(Q,{direction:"backward"}):{direction:"backward"};return c1($)(_,U,v)},kb,qv=($)=>(_,U,Q)=>{return c1($)(_,U,Q)},Ab,Gv=($)=>async(_,U,Q)=>{let v=Q?Object.assign(Q,{direction:"backward"}):{direction:"backward"};return l1($)(_,U,v)},Fb,jv=($)=>async(_,U,Q)=>{return l1($)(_,U,Q)},Ob,Kv=($)=>(_,U,Q)=>{let v=Q?Object.assign(Q,{direction:"backward"}):{direction:"backward"};return d1($)(_,U,v)},Nb,Hv=($)=>(_,U,Q)=>{return d1($)(_,U,Q)},Sb,Wv=($)=>async(_,U,Q)=>{let v=Q?Object.assign(Q,{direction:"backward"}):{direction:"backward"};return p1($)(_,U,v)},Tb,bv=($)=>async(_,U,Q)=>{return p1($)(_,U,Q)},Rb;var V9=b(()=>{f1();b9();l();zv=c1(W4),Iv=l1(W4),B9=d1(W4),Z9=p1(W4),kb=Xv(W4),Ab=qv(W4),Fb=Gv(W4),Ob=jv(W4),Nb=Kv(W4),Sb=Hv(W4),Tb=Wv(W4),Rb=bv(W4)});var E4={};s$(E4,{xid:()=>L9,uuid7:()=>ub,uuid6:()=>xb,uuid4:()=>Pb,uuid:()=>$1,uppercase:()=>n9,unicodeEmail:()=>jz,undefined:()=>p9,ulid:()=>w9,time:()=>f9,string:()=>g9,sha512_hex:()=>vB,sha512_base64url:()=>QB,sha512_base64:()=>UB,sha384_hex:()=>eb,sha384_base64url:()=>_B,sha384_base64:()=>$B,sha256_hex:()=>tb,sha256_base64url:()=>sb,sha256_base64:()=>ab,sha1_hex:()=>nb,sha1_base64url:()=>ob,sha1_base64:()=>rb,rfc5322Email:()=>Cb,number:()=>v_,null:()=>d9,nanoid:()=>A9,md5_hex:()=>db,md5_base64url:()=>ib,md5_base64:()=>pb,mac:()=>E9,lowercase:()=>i9,ksuid:()=>k9,ipv6:()=>R9,ipv4:()=>T9,integer:()=>c9,idnEmail:()=>fb,html5Email:()=>yb,hostname:()=>hb,hex:()=>lb,guid:()=>O9,extendedDuration:()=>Eb,emoji:()=>S9,email:()=>N9,e164:()=>y9,duration:()=>F9,domain:()=>cb,datetime:()=>m9,date:()=>C9,cuid2:()=>M9,cuid:()=>D9,cidrv6:()=>x9,cidrv4:()=>P9,browserEmail:()=>mb,boolean:()=>l9,bigint:()=>h9,base64url:()=>Bv,base64:()=>u9});function S9(){return new RegExp(gb,"u")}function Hz($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function f9($){return new RegExp(`^${Hz($)}$`)}function m9($){let _=Hz({precision:$.precision}),U=["Z"];if($.local)U.push("");if($.offset)U.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let Q=`${_}(?:${U.join("|")})`;return new RegExp(`^${Kz}T(?:${Q})$`)}function U_($,_){return new RegExp(`^[A-Za-z0-9+/]{${$}}${_}$`)}function Q_($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var D9,M9,w9,L9,k9,A9,F9,Eb,O9,$1=($)=>{if(!$)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},Pb,xb,ub,N9,yb,Cb,jz,fb,mb,gb="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",T9,R9,E9=($)=>{let _=R4($??":");return new RegExp(`^(?:[0-9A-F]{2}${_}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${_}){5}[0-9a-f]{2}$`)},P9,x9,u9,Bv,hb,cb,y9,Kz="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",C9,g9=($)=>{let _=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${_}$`)},h9,c9,v_,l9,d9,p9,i9,n9,lb,db,pb,ib,nb,rb,ob,tb,ab,sb,eb,$B,_B,vB,UB,QB;var Zv=b(()=>{l();D9=/^[cC][^\s-]{8,}$/,M9=/^[0-9a-z]+$/,w9=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,L9=/^[0-9a-vA-V]{20}$/,k9=/^[A-Za-z0-9]{27}$/,A9=/^[a-zA-Z0-9_-]{21}$/,F9=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Eb=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,O9=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Pb=$1(4),xb=$1(6),ub=$1(7),N9=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,yb=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Cb=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,jz=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,fb=jz,mb=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;T9=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,R9=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,P9=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,x9=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,u9=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Bv=/^[A-Za-z0-9_-]*$/,hb=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,cb=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,y9=/^\+[1-9]\d{6,14}$/,C9=new RegExp(`^${Kz}$`);h9=/^-?\d+n?$/,c9=/^-?\d+$/,v_=/^-?\d+(?:\.\d+)?$/,l9=/^(?:true|false)$/i,d9=/^null$/i,p9=/^undefined$/i,i9=/^[^A-Z]*$/,n9=/^[^a-z]*$/,lb=/^[0-9a-fA-F]*$/;db=/^[0-9a-fA-F]{32}$/,pb=U_(22,"=="),ib=Q_(22),nb=/^[0-9a-fA-F]{40}$/,rb=U_(27,"="),ob=Q_(27),tb=/^[0-9a-fA-F]{64}$/,ab=U_(43,"="),sb=Q_(43),eb=/^[0-9a-fA-F]{96}$/,$B=U_(64,""),_B=Q_(64),vB=/^[0-9a-fA-F]{128}$/,UB=U_(86,"=="),QB=Q_(86)});function Wz($,_,U){if($.issues.length)_.issues.push(...w4(U,$.issues))}var T$,bz,Vv,Dv,r9,o9,t9,a9,s9,e9,$3,_3,v3,i1,U3,Q3,J3,Y3,z3,I3,X3,q3,G3;var Mv=b(()=>{f1();Zv();l();T$=B("$ZodCheck",($,_)=>{var U;$._zod??($._zod={}),$._zod.def=_,(U=$._zod).onattach??(U.onattach=[])}),bz={number:"number",bigint:"bigint",object:"date"},Vv=B("$ZodCheckLessThan",($,_)=>{T$.init($,_);let U=bz[typeof _.value];$._zod.onattach.push((Q)=>{let v=Q._zod.bag,J=(_.inclusive?v.maximum:v.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(_.value<J)if(_.inclusive)v.maximum=_.value;else v.exclusiveMaximum=_.value}),$._zod.check=(Q)=>{if(_.inclusive?Q.value<=_.value:Q.value<_.value)return;Q.issues.push({origin:U,code:"too_big",maximum:typeof _.value==="object"?_.value.getTime():_.value,input:Q.value,inclusive:_.inclusive,inst:$,continue:!_.abort})}}),Dv=B("$ZodCheckGreaterThan",($,_)=>{T$.init($,_);let U=bz[typeof _.value];$._zod.onattach.push((Q)=>{let v=Q._zod.bag,J=(_.inclusive?v.minimum:v.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(_.value>J)if(_.inclusive)v.minimum=_.value;else v.exclusiveMinimum=_.value}),$._zod.check=(Q)=>{if(_.inclusive?Q.value>=_.value:Q.value>_.value)return;Q.issues.push({origin:U,code:"too_small",minimum:typeof _.value==="object"?_.value.getTime():_.value,input:Q.value,inclusive:_.inclusive,inst:$,continue:!_.abort})}}),r9=B("$ZodCheckMultipleOf",($,_)=>{T$.init($,_),$._zod.onattach.push((U)=>{var Q;(Q=U._zod.bag).multipleOf??(Q.multipleOf=_.value)}),$._zod.check=(U)=>{if(typeof U.value!==typeof _.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof U.value==="bigint"?U.value%_.value===BigInt(0):Y9(U.value,_.value)===0)return;U.issues.push({origin:typeof U.value,code:"not_multiple_of",divisor:_.value,input:U.value,inst:$,continue:!_.abort})}}),o9=B("$ZodCheckNumberFormat",($,_)=>{T$.init($,_),_.format=_.format||"float64";let U=_.format?.includes("int"),Q=U?"int":"number",[v,J]=j9[_.format];$._zod.onattach.push((Y)=>{let z=Y._zod.bag;if(z.format=_.format,z.minimum=v,z.maximum=J,U)z.pattern=c9}),$._zod.check=(Y)=>{let z=Y.value;if(U){if(!Number.isInteger(z)){Y.issues.push({expected:Q,format:_.format,code:"invalid_type",continue:!1,input:z,inst:$});return}if(!Number.isSafeInteger(z)){if(z>0)Y.issues.push({input:z,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:Q,inclusive:!0,continue:!_.abort});else Y.issues.push({input:z,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:Q,inclusive:!0,continue:!_.abort});return}}if(z<v)Y.issues.push({origin:"number",input:z,code:"too_small",minimum:v,inclusive:!0,inst:$,continue:!_.abort});if(z>J)Y.issues.push({origin:"number",input:z,code:"too_big",maximum:J,inclusive:!0,inst:$,continue:!_.abort})}}),t9=B("$ZodCheckBigIntFormat",($,_)=>{T$.init($,_);let[U,Q]=K9[_.format];$._zod.onattach.push((v)=>{let J=v._zod.bag;J.format=_.format,J.minimum=U,J.maximum=Q}),$._zod.check=(v)=>{let J=v.value;if(J<U)v.issues.push({origin:"bigint",input:J,code:"too_small",minimum:U,inclusive:!0,inst:$,continue:!_.abort});if(J>Q)v.issues.push({origin:"bigint",input:J,code:"too_big",maximum:Q,inclusive:!0,inst:$,continue:!_.abort})}}),a9=B("$ZodCheckMaxSize",($,_)=>{var U;T$.init($,_),(U=$._zod.def).when??(U.when=(Q)=>{let v=Q.value;return!T6(v)&&v.size!==void 0}),$._zod.onattach.push((Q)=>{let v=Q._zod.bag.maximum??Number.POSITIVE_INFINITY;if(_.maximum<v)Q._zod.bag.maximum=_.maximum}),$._zod.check=(Q)=>{let v=Q.value;if(v.size<=_.maximum)return;Q.issues.push({origin:a0(v),code:"too_big",maximum:_.maximum,inclusive:!0,input:v,inst:$,continue:!_.abort})}}),s9=B("$ZodCheckMinSize",($,_)=>{var U;T$.init($,_),(U=$._zod.def).when??(U.when=(Q)=>{let v=Q.value;return!T6(v)&&v.size!==void 0}),$._zod.onattach.push((Q)=>{let v=Q._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(_.minimum>v)Q._zod.bag.minimum=_.minimum}),$._zod.check=(Q)=>{let v=Q.value;if(v.size>=_.minimum)return;Q.issues.push({origin:a0(v),code:"too_small",minimum:_.minimum,inclusive:!0,input:v,inst:$,continue:!_.abort})}}),e9=B("$ZodCheckSizeEquals",($,_)=>{var U;T$.init($,_),(U=$._zod.def).when??(U.when=(Q)=>{let v=Q.value;return!T6(v)&&v.size!==void 0}),$._zod.onattach.push((Q)=>{let v=Q._zod.bag;v.minimum=_.size,v.maximum=_.size,v.size=_.size}),$._zod.check=(Q)=>{let v=Q.value,J=v.size;if(J===_.size)return;let Y=J>_.size;Q.issues.push({origin:a0(v),...Y?{code:"too_big",maximum:_.size}:{code:"too_small",minimum:_.size},inclusive:!0,exact:!0,input:Q.value,inst:$,continue:!_.abort})}}),$3=B("$ZodCheckMaxLength",($,_)=>{var U;T$.init($,_),(U=$._zod.def).when??(U.when=(Q)=>{let v=Q.value;return!T6(v)&&v.length!==void 0}),$._zod.onattach.push((Q)=>{let v=Q._zod.bag.maximum??Number.POSITIVE_INFINITY;if(_.maximum<v)Q._zod.bag.maximum=_.maximum}),$._zod.check=(Q)=>{let v=Q.value;if(v.length<=_.maximum)return;let Y=s0(v);Q.issues.push({origin:Y,code:"too_big",maximum:_.maximum,inclusive:!0,input:v,inst:$,continue:!_.abort})}}),_3=B("$ZodCheckMinLength",($,_)=>{var U;T$.init($,_),(U=$._zod.def).when??(U.when=(Q)=>{let v=Q.value;return!T6(v)&&v.length!==void 0}),$._zod.onattach.push((Q)=>{let v=Q._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(_.minimum>v)Q._zod.bag.minimum=_.minimum}),$._zod.check=(Q)=>{let v=Q.value;if(v.length>=_.minimum)return;let Y=s0(v);Q.issues.push({origin:Y,code:"too_small",minimum:_.minimum,inclusive:!0,input:v,inst:$,continue:!_.abort})}}),v3=B("$ZodCheckLengthEquals",($,_)=>{var U;T$.init($,_),(U=$._zod.def).when??(U.when=(Q)=>{let v=Q.value;return!T6(v)&&v.length!==void 0}),$._zod.onattach.push((Q)=>{let v=Q._zod.bag;v.minimum=_.length,v.maximum=_.length,v.length=_.length}),$._zod.check=(Q)=>{let v=Q.value,J=v.length;if(J===_.length)return;let Y=s0(v),z=J>_.length;Q.issues.push({origin:Y,...z?{code:"too_big",maximum:_.length}:{code:"too_small",minimum:_.length},inclusive:!0,exact:!0,input:Q.value,inst:$,continue:!_.abort})}}),i1=B("$ZodCheckStringFormat",($,_)=>{var U,Q;if(T$.init($,_),$._zod.onattach.push((v)=>{let J=v._zod.bag;if(J.format=_.format,_.pattern)J.patterns??(J.patterns=new Set),J.patterns.add(_.pattern)}),_.pattern)(U=$._zod).check??(U.check=(v)=>{if(_.pattern.lastIndex=0,_.pattern.test(v.value))return;v.issues.push({origin:"string",code:"invalid_format",format:_.format,input:v.value,..._.pattern?{pattern:_.pattern.toString()}:{},inst:$,continue:!_.abort})});else(Q=$._zod).check??(Q.check=()=>{})}),U3=B("$ZodCheckRegex",($,_)=>{i1.init($,_),$._zod.check=(U)=>{if(_.pattern.lastIndex=0,_.pattern.test(U.value))return;U.issues.push({origin:"string",code:"invalid_format",format:"regex",input:U.value,pattern:_.pattern.toString(),inst:$,continue:!_.abort})}}),Q3=B("$ZodCheckLowerCase",($,_)=>{_.pattern??(_.pattern=i9),i1.init($,_)}),J3=B("$ZodCheckUpperCase",($,_)=>{_.pattern??(_.pattern=n9),i1.init($,_)}),Y3=B("$ZodCheckIncludes",($,_)=>{T$.init($,_);let U=R4(_.includes),Q=new RegExp(typeof _.position==="number"?`^.{${_.position}}${U}`:U);_.pattern=Q,$._zod.onattach.push((v)=>{let J=v._zod.bag;J.patterns??(J.patterns=new Set),J.patterns.add(Q)}),$._zod.check=(v)=>{if(v.value.includes(_.includes,_.position))return;v.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:_.includes,input:v.value,inst:$,continue:!_.abort})}}),z3=B("$ZodCheckStartsWith",($,_)=>{T$.init($,_);let U=new RegExp(`^${R4(_.prefix)}.*`);_.pattern??(_.pattern=U),$._zod.onattach.push((Q)=>{let v=Q._zod.bag;v.patterns??(v.patterns=new Set),v.patterns.add(U)}),$._zod.check=(Q)=>{if(Q.value.startsWith(_.prefix))return;Q.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:_.prefix,input:Q.value,inst:$,continue:!_.abort})}}),I3=B("$ZodCheckEndsWith",($,_)=>{T$.init($,_);let U=new RegExp(`.*${R4(_.suffix)}$`);_.pattern??(_.pattern=U),$._zod.onattach.push((Q)=>{let v=Q._zod.bag;v.patterns??(v.patterns=new Set),v.patterns.add(U)}),$._zod.check=(Q)=>{if(Q.value.endsWith(_.suffix))return;Q.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:_.suffix,input:Q.value,inst:$,continue:!_.abort})}});X3=B("$ZodCheckProperty",($,_)=>{T$.init($,_),$._zod.check=(U)=>{let Q=_.schema._zod.run({value:U.value[_.property],issues:[]},{});if(Q instanceof Promise)return Q.then((v)=>Wz(v,U,_.property));Wz(Q,U,_.property);return}}),q3=B("$ZodCheckMimeType",($,_)=>{T$.init($,_);let U=new Set(_.mime);$._zod.onattach.push((Q)=>{Q._zod.bag.mime=_.mime}),$._zod.check=(Q)=>{if(U.has(Q.value.type))return;Q.issues.push({code:"invalid_value",values:_.mime,input:Q.value.type,inst:$,continue:!_.abort})}}),G3=B("$ZodCheckOverwrite",($,_)=>{T$.init($,_),$._zod.check=(U)=>{U.value=_.tx(U.value)}})});class wv{constructor($=[]){if(this.content=[],this.indent=0,this)this.args=$}indented($){this.indent+=1,$(this),this.indent-=1}write($){if(typeof $==="function"){$(this,{execution:"sync"}),$(this,{execution:"async"});return}let U=$.split(`
19
+ `).filter((J)=>J),Q=Math.min(...U.map((J)=>J.length-J.trimStart().length)),v=U.map((J)=>J.slice(Q)).map((J)=>" ".repeat(this.indent*2)+J);for(let J of v)this.content.push(J)}compile(){let $=Function,_=this?.args,Q=[...(this?.content??[""]).map((v)=>` ${v}`)];return new $(..._,Q.join(`
20
+ `))}}var j3;var K3=b(()=>{j3={major:4,minor:3,patch:6}});function u3($){if($==="")return!0;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}function Sz($){if(!Bv.test($))return!1;let _=$.replace(/[-_]/g,(Q)=>Q==="-"?"+":"/"),U=_.padEnd(Math.ceil(_.length/4)*4,"=");return u3(U)}function Tz($,_=null){try{let U=$.split(".");if(U.length!==3)return!1;let[Q]=U;if(!Q)return!1;let v=JSON.parse(atob(Q));if("typ"in v&&v?.typ!=="JWT")return!1;if(!v.alg)return!1;if(_&&(!("alg"in v)||v.alg!==_))return!1;return!0}catch{return!1}}function Zz($,_,U){if($.issues.length)_.issues.push(...w4(U,$.issues));_.value[U]=$.value}function Ov($,_,U,Q,v){if($.issues.length){if(v&&!(U in Q))return;_.issues.push(...w4(U,$.issues))}if($.value===void 0){if(U in Q)_.value[U]=void 0}else _.value[U]=$.value}function Rz($){let _=Object.keys($.shape);for(let Q of _)if(!$.shape?.[Q]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${Q}": expected a Zod schema`);let U=G9($.shape);return{...$,keys:_,keySet:new Set(_),numKeys:_.length,optionalKeys:new Set(U)}}function Ez($,_,U,Q,v,J){let Y=[],z=v.keySet,I=v.catchall._zod,X=I.def.type,q=I.optout==="optional";for(let G in _){if(z.has(G))continue;if(X==="never"){Y.push(G);continue}let j=I.run({value:_[G],issues:[]},Q);if(j instanceof Promise)$.push(j.then((H)=>Ov(H,U,G,_,q)));else Ov(j,U,G,_,q)}if(Y.length)U.issues.push({code:"unrecognized_keys",keys:Y,input:_,inst:J});if(!$.length)return U;return Promise.all($).then(()=>{return U})}function Vz($,_,U,Q){for(let J of $)if(J.issues.length===0)return _.value=J.value,_;let v=$.filter((J)=>!P6(J));if(v.length===1)return _.value=v[0].value,v[0];return _.issues.push({code:"invalid_union",input:_.value,inst:U,errors:$.map((J)=>J.issues.map((Y)=>H4(Y,Q,l$())))}),_}function Dz($,_,U,Q){let v=$.filter((J)=>J.issues.length===0);if(v.length===1)return _.value=v[0].value,_;if(v.length===0)_.issues.push({code:"invalid_union",input:_.value,inst:U,errors:$.map((J)=>J.issues.map((Y)=>H4(Y,Q,l$())))});else _.issues.push({code:"invalid_union",input:_.value,inst:U,errors:[],inclusive:!1});return _}function H3($,_){if($===_)return{valid:!0,data:$};if($ instanceof Date&&_ instanceof Date&&+$===+_)return{valid:!0,data:$};if(E6($)&&E6(_)){let U=Object.keys(_),Q=Object.keys($).filter((J)=>U.indexOf(J)!==-1),v={...$,..._};for(let J of Q){let Y=H3($[J],_[J]);if(!Y.valid)return{valid:!1,mergeErrorPath:[J,...Y.mergeErrorPath]};v[J]=Y.data}return{valid:!0,data:v}}if(Array.isArray($)&&Array.isArray(_)){if($.length!==_.length)return{valid:!1,mergeErrorPath:[]};let U=[];for(let Q=0;Q<$.length;Q++){let v=$[Q],J=_[Q],Y=H3(v,J);if(!Y.valid)return{valid:!1,mergeErrorPath:[Q,...Y.mergeErrorPath]};U.push(Y.data)}return{valid:!0,data:U}}return{valid:!1,mergeErrorPath:[]}}function Mz($,_,U){let Q=new Map,v;for(let z of _.issues)if(z.code==="unrecognized_keys"){v??(v=z);for(let I of z.keys){if(!Q.has(I))Q.set(I,{});Q.get(I).l=!0}}else $.issues.push(z);for(let z of U.issues)if(z.code==="unrecognized_keys")for(let I of z.keys){if(!Q.has(I))Q.set(I,{});Q.get(I).r=!0}else $.issues.push(z);let J=[...Q].filter(([,z])=>z.l&&z.r).map(([z])=>z);if(J.length&&v)$.issues.push({...v,keys:J});if(P6($))return $;let Y=H3(_.value,U.value);if(!Y.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(Y.mergeErrorPath)}`);return $.value=Y.data,$}function Lv($,_,U){if($.issues.length)_.issues.push(...w4(U,$.issues));_.value[U]=$.value}function wz($,_,U,Q,v,J,Y){if($.issues.length)if(t0.has(typeof Q))U.issues.push(...w4(Q,$.issues));else U.issues.push({code:"invalid_key",origin:"map",input:v,inst:J,issues:$.issues.map((z)=>H4(z,Y,l$()))});if(_.issues.length)if(t0.has(typeof Q))U.issues.push(...w4(Q,_.issues));else U.issues.push({origin:"map",code:"invalid_element",input:v,inst:J,key:Q,issues:_.issues.map((z)=>H4(z,Y,l$()))});U.value.set($.value,_.value)}function Lz($,_){if($.issues.length)_.issues.push(...$.issues);_.value.add($.value)}function kz($,_){if($.issues.length&&_===void 0)return{issues:[],value:void 0};return $}function Az($,_){if($.value===void 0)$.value=_.defaultValue;return $}function Fz($,_){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:_});return $}function kv($,_,U){if($.issues.length)return $.aborted=!0,$;return _._zod.run({value:$.value,issues:$.issues},U)}function Av($,_,U){if($.issues.length)return $.aborted=!0,$;if((U.direction||"forward")==="forward"){let v=_.transform($.value,$);if(v instanceof Promise)return v.then((J)=>Fv($,J,_.out,U));return Fv($,v,_.out,U)}else{let v=_.reverseTransform($.value,$);if(v instanceof Promise)return v.then((J)=>Fv($,J,_.in,U));return Fv($,v,_.in,U)}}function Fv($,_,U,Q){if($.issues.length)return $.aborted=!0,$;return U._zod.run({value:_,issues:$.issues},Q)}function Oz($){return $.value=Object.freeze($.value),$}function Nz($,_,U,Q){if(!$){let v={code:"custom",input:U,inst:Q,path:[...Q._zod.def.path??[]],continue:!Q._zod.def.abort};if(Q._zod.def.params)v.params=Q._zod.def.params;_.issues.push(h1(v))}}var e,_1,A$,W3,b3,B3,Z3,V3,D3,M3,w3,L3,k3,A3,F3,O3,N3,S3,T3,R3,E3,P3,x3,y3,C3,f3,m3,g3,Nv,h3,J_,Sv,c3,l3,d3,p3,i3,n3,r3,o3,t3,a3,Pz,s3,Y_,e3,$7,_7,Tv,v7,U7,Q7,J7,Y7,z7,I7,Rv,X7,q7,G7,j7,K7,H7,W7,b7,B7,z_,Z7,V7,D7,M7,w7,L7;var k7=b(()=>{Mv();f1();V9();Zv();l();K3();l();e=B("$ZodType",($,_)=>{var U;$??($={}),$._zod.def=_,$._zod.bag=$._zod.bag||{},$._zod.version=j3;let Q=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))Q.unshift($);for(let v of Q)for(let J of v._zod.onattach)J($);if(Q.length===0)(U=$._zod).deferred??(U.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let v=(Y,z,I)=>{let X=P6(Y),q;for(let G of z){if(G._zod.def.when){if(!G._zod.def.when(Y))continue}else if(X)continue;let j=Y.issues.length,H=G._zod.check(Y);if(H instanceof Promise&&I?.async===!1)throw new _6;if(q||H instanceof Promise)q=(q??Promise.resolve()).then(async()=>{if(await H,Y.issues.length===j)return;if(!X)X=P6(Y,j)});else{if(Y.issues.length===j)continue;if(!X)X=P6(Y,j)}}if(q)return q.then(()=>{return Y});return Y},J=(Y,z,I)=>{if(P6(Y))return Y.aborted=!0,Y;let X=v(z,Q,I);if(X instanceof Promise){if(I.async===!1)throw new _6;return X.then((q)=>$._zod.parse(q,I))}return $._zod.parse(X,I)};$._zod.run=(Y,z)=>{if(z.skipChecks)return $._zod.parse(Y,z);if(z.direction==="backward"){let X=$._zod.parse({value:Y.value,issues:[]},{...z,skipChecks:!0});if(X instanceof Promise)return X.then((q)=>{return J(q,Y,z)});return J(X,Y,z)}let I=$._zod.parse(Y,z);if(I instanceof Promise){if(z.async===!1)throw new _6;return I.then((X)=>v(X,Q,z))}return v(I,Q,z)}}Y$($,"~standard",()=>({validate:(v)=>{try{let J=B9($,v);return J.success?{value:J.data}:{issues:J.error?.issues}}catch(J){return Z9($,v).then((Y)=>Y.success?{value:Y.data}:{issues:Y.error?.issues})}},vendor:"zod",version:1}))}),_1=B("$ZodString",($,_)=>{e.init($,_),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??g9($._zod.bag),$._zod.parse=(U,Q)=>{if(_.coerce)try{U.value=String(U.value)}catch(v){}if(typeof U.value==="string")return U;return U.issues.push({expected:"string",code:"invalid_type",input:U.value,inst:$}),U}}),A$=B("$ZodStringFormat",($,_)=>{i1.init($,_),_1.init($,_)}),W3=B("$ZodGUID",($,_)=>{_.pattern??(_.pattern=O9),A$.init($,_)}),b3=B("$ZodUUID",($,_)=>{if(_.version){let Q={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[_.version];if(Q===void 0)throw Error(`Invalid UUID version: "${_.version}"`);_.pattern??(_.pattern=$1(Q))}else _.pattern??(_.pattern=$1());A$.init($,_)}),B3=B("$ZodEmail",($,_)=>{_.pattern??(_.pattern=N9),A$.init($,_)}),Z3=B("$ZodURL",($,_)=>{A$.init($,_),$._zod.check=(U)=>{try{let Q=U.value.trim(),v=new URL(Q);if(_.hostname){if(_.hostname.lastIndex=0,!_.hostname.test(v.hostname))U.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:_.hostname.source,input:U.value,inst:$,continue:!_.abort})}if(_.protocol){if(_.protocol.lastIndex=0,!_.protocol.test(v.protocol.endsWith(":")?v.protocol.slice(0,-1):v.protocol))U.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:_.protocol.source,input:U.value,inst:$,continue:!_.abort})}if(_.normalize)U.value=v.href;else U.value=Q;return}catch(Q){U.issues.push({code:"invalid_format",format:"url",input:U.value,inst:$,continue:!_.abort})}}}),V3=B("$ZodEmoji",($,_)=>{_.pattern??(_.pattern=S9()),A$.init($,_)}),D3=B("$ZodNanoID",($,_)=>{_.pattern??(_.pattern=A9),A$.init($,_)}),M3=B("$ZodCUID",($,_)=>{_.pattern??(_.pattern=D9),A$.init($,_)}),w3=B("$ZodCUID2",($,_)=>{_.pattern??(_.pattern=M9),A$.init($,_)}),L3=B("$ZodULID",($,_)=>{_.pattern??(_.pattern=w9),A$.init($,_)}),k3=B("$ZodXID",($,_)=>{_.pattern??(_.pattern=L9),A$.init($,_)}),A3=B("$ZodKSUID",($,_)=>{_.pattern??(_.pattern=k9),A$.init($,_)}),F3=B("$ZodISODateTime",($,_)=>{_.pattern??(_.pattern=m9(_)),A$.init($,_)}),O3=B("$ZodISODate",($,_)=>{_.pattern??(_.pattern=C9),A$.init($,_)}),N3=B("$ZodISOTime",($,_)=>{_.pattern??(_.pattern=f9(_)),A$.init($,_)}),S3=B("$ZodISODuration",($,_)=>{_.pattern??(_.pattern=F9),A$.init($,_)}),T3=B("$ZodIPv4",($,_)=>{_.pattern??(_.pattern=T9),A$.init($,_),$._zod.bag.format="ipv4"}),R3=B("$ZodIPv6",($,_)=>{_.pattern??(_.pattern=R9),A$.init($,_),$._zod.bag.format="ipv6",$._zod.check=(U)=>{try{new URL(`http://[${U.value}]`)}catch{U.issues.push({code:"invalid_format",format:"ipv6",input:U.value,inst:$,continue:!_.abort})}}}),E3=B("$ZodMAC",($,_)=>{_.pattern??(_.pattern=E9(_.delimiter)),A$.init($,_),$._zod.bag.format="mac"}),P3=B("$ZodCIDRv4",($,_)=>{_.pattern??(_.pattern=P9),A$.init($,_)}),x3=B("$ZodCIDRv6",($,_)=>{_.pattern??(_.pattern=x9),A$.init($,_),$._zod.check=(U)=>{let Q=U.value.split("/");try{if(Q.length!==2)throw Error();let[v,J]=Q;if(!J)throw Error();let Y=Number(J);if(`${Y}`!==J)throw Error();if(Y<0||Y>128)throw Error();new URL(`http://[${v}]`)}catch{U.issues.push({code:"invalid_format",format:"cidrv6",input:U.value,inst:$,continue:!_.abort})}}});y3=B("$ZodBase64",($,_)=>{_.pattern??(_.pattern=u9),A$.init($,_),$._zod.bag.contentEncoding="base64",$._zod.check=(U)=>{if(u3(U.value))return;U.issues.push({code:"invalid_format",format:"base64",input:U.value,inst:$,continue:!_.abort})}});C3=B("$ZodBase64URL",($,_)=>{_.pattern??(_.pattern=Bv),A$.init($,_),$._zod.bag.contentEncoding="base64url",$._zod.check=(U)=>{if(Sz(U.value))return;U.issues.push({code:"invalid_format",format:"base64url",input:U.value,inst:$,continue:!_.abort})}}),f3=B("$ZodE164",($,_)=>{_.pattern??(_.pattern=y9),A$.init($,_)});m3=B("$ZodJWT",($,_)=>{A$.init($,_),$._zod.check=(U)=>{if(Tz(U.value,_.alg))return;U.issues.push({code:"invalid_format",format:"jwt",input:U.value,inst:$,continue:!_.abort})}}),g3=B("$ZodCustomStringFormat",($,_)=>{A$.init($,_),$._zod.check=(U)=>{if(_.fn(U.value))return;U.issues.push({code:"invalid_format",format:_.format,input:U.value,inst:$,continue:!_.abort})}}),Nv=B("$ZodNumber",($,_)=>{e.init($,_),$._zod.pattern=$._zod.bag.pattern??v_,$._zod.parse=(U,Q)=>{if(_.coerce)try{U.value=Number(U.value)}catch(Y){}let v=U.value;if(typeof v==="number"&&!Number.isNaN(v)&&Number.isFinite(v))return U;let J=typeof v==="number"?Number.isNaN(v)?"NaN":!Number.isFinite(v)?"Infinity":void 0:void 0;return U.issues.push({expected:"number",code:"invalid_type",input:v,inst:$,...J?{received:J}:{}}),U}}),h3=B("$ZodNumberFormat",($,_)=>{o9.init($,_),Nv.init($,_)}),J_=B("$ZodBoolean",($,_)=>{e.init($,_),$._zod.pattern=l9,$._zod.parse=(U,Q)=>{if(_.coerce)try{U.value=Boolean(U.value)}catch(J){}let v=U.value;if(typeof v==="boolean")return U;return U.issues.push({expected:"boolean",code:"invalid_type",input:v,inst:$}),U}}),Sv=B("$ZodBigInt",($,_)=>{e.init($,_),$._zod.pattern=h9,$._zod.parse=(U,Q)=>{if(_.coerce)try{U.value=BigInt(U.value)}catch(v){}if(typeof U.value==="bigint")return U;return U.issues.push({expected:"bigint",code:"invalid_type",input:U.value,inst:$}),U}}),c3=B("$ZodBigIntFormat",($,_)=>{t9.init($,_),Sv.init($,_)}),l3=B("$ZodSymbol",($,_)=>{e.init($,_),$._zod.parse=(U,Q)=>{let v=U.value;if(typeof v==="symbol")return U;return U.issues.push({expected:"symbol",code:"invalid_type",input:v,inst:$}),U}}),d3=B("$ZodUndefined",($,_)=>{e.init($,_),$._zod.pattern=p9,$._zod.values=new Set([void 0]),$._zod.optin="optional",$._zod.optout="optional",$._zod.parse=(U,Q)=>{let v=U.value;if(typeof v>"u")return U;return U.issues.push({expected:"undefined",code:"invalid_type",input:v,inst:$}),U}}),p3=B("$ZodNull",($,_)=>{e.init($,_),$._zod.pattern=d9,$._zod.values=new Set([null]),$._zod.parse=(U,Q)=>{let v=U.value;if(v===null)return U;return U.issues.push({expected:"null",code:"invalid_type",input:v,inst:$}),U}}),i3=B("$ZodAny",($,_)=>{e.init($,_),$._zod.parse=(U)=>U}),n3=B("$ZodUnknown",($,_)=>{e.init($,_),$._zod.parse=(U)=>U}),r3=B("$ZodNever",($,_)=>{e.init($,_),$._zod.parse=(U,Q)=>{return U.issues.push({expected:"never",code:"invalid_type",input:U.value,inst:$}),U}}),o3=B("$ZodVoid",($,_)=>{e.init($,_),$._zod.parse=(U,Q)=>{let v=U.value;if(typeof v>"u")return U;return U.issues.push({expected:"void",code:"invalid_type",input:v,inst:$}),U}}),t3=B("$ZodDate",($,_)=>{e.init($,_),$._zod.parse=(U,Q)=>{if(_.coerce)try{U.value=new Date(U.value)}catch(z){}let v=U.value,J=v instanceof Date;if(J&&!Number.isNaN(v.getTime()))return U;return U.issues.push({expected:"date",code:"invalid_type",input:v,...J?{received:"Invalid Date"}:{},inst:$}),U}});a3=B("$ZodArray",($,_)=>{e.init($,_),$._zod.parse=(U,Q)=>{let v=U.value;if(!Array.isArray(v))return U.issues.push({expected:"array",code:"invalid_type",input:v,inst:$}),U;U.value=Array(v.length);let J=[];for(let Y=0;Y<v.length;Y++){let z=v[Y],I=_.element._zod.run({value:z,issues:[]},Q);if(I instanceof Promise)J.push(I.then((X)=>Zz(X,U,Y)));else Zz(I,U,Y)}if(J.length)return Promise.all(J).then(()=>U);return U}});Pz=B("$ZodObject",($,_)=>{if(e.init($,_),!Object.getOwnPropertyDescriptor(_,"shape")?.get){let z=_.shape;Object.defineProperty(_,"shape",{get:()=>{let I={...z};return Object.defineProperty(_,"shape",{value:I}),I}})}let Q=g1(()=>Rz(_));Y$($._zod,"propValues",()=>{let z=_.shape,I={};for(let X in z){let q=z[X]._zod;if(q.values){I[X]??(I[X]=new Set);for(let G of q.values)I[X].add(G)}}return I});let v=e6,J=_.catchall,Y;$._zod.parse=(z,I)=>{Y??(Y=Q.value);let X=z.value;if(!v(X))return z.issues.push({expected:"object",code:"invalid_type",input:X,inst:$}),z;z.value={};let q=[],G=Y.shape;for(let j of Y.keys){let H=G[j],Z=H._zod.optout==="optional",V=H._zod.run({value:X[j],issues:[]},I);if(V instanceof Promise)q.push(V.then((S)=>Ov(S,z,j,X,Z)));else Ov(V,z,j,X,Z)}if(!J)return q.length?Promise.all(q).then(()=>z):z;return Ez(q,X,z,I,Q.value,$)}}),s3=B("$ZodObjectJIT",($,_)=>{Pz.init($,_);let U=$._zod.parse,Q=g1(()=>Rz(_)),v=(j)=>{let H=new wv(["shape","payload","ctx"]),Z=Q.value,V=(A)=>{let u=Jv(A);return`shape[${u}]._zod.run({ value: input[${u}], issues: [] }, ctx)`};H.write("const input = payload.value;");let S=Object.create(null),T=0;for(let A of Z.keys)S[A]=`key_${T++}`;H.write("const newResult = {};");for(let A of Z.keys){let u=S[A],k=Jv(A),w=j[A]?._zod?.optout==="optional";if(H.write(`const ${u} = ${V(A)};`),w)H.write(`
21
+ if (${u}.issues.length) {
22
+ if (${k} in input) {
23
+ payload.issues = payload.issues.concat(${u}.issues.map(iss => ({
24
+ ...iss,
25
+ path: iss.path ? [${k}, ...iss.path] : [${k}]
26
+ })));
27
+ }
28
+ }
29
+
30
+ if (${u}.value === undefined) {
31
+ if (${k} in input) {
32
+ newResult[${k}] = undefined;
33
+ }
34
+ } else {
35
+ newResult[${k}] = ${u}.value;
36
+ }
37
+
38
+ `);else H.write(`
39
+ if (${u}.issues.length) {
40
+ payload.issues = payload.issues.concat(${u}.issues.map(iss => ({
41
+ ...iss,
42
+ path: iss.path ? [${k}, ...iss.path] : [${k}]
43
+ })));
44
+ }
45
+
46
+ if (${u}.value === undefined) {
47
+ if (${k} in input) {
48
+ newResult[${k}] = undefined;
49
+ }
50
+ } else {
51
+ newResult[${k}] = ${u}.value;
52
+ }
53
+
54
+ `)}H.write("payload.value = newResult;"),H.write("return payload;");let r=H.compile();return(A,u)=>r(j,A,u)},J,Y=e6,z=!i0.jitless,X=z&&I9.value,q=_.catchall,G;$._zod.parse=(j,H)=>{G??(G=Q.value);let Z=j.value;if(!Y(Z))return j.issues.push({expected:"object",code:"invalid_type",input:Z,inst:$}),j;if(z&&X&&H?.async===!1&&H.jitless!==!0){if(!J)J=v(_.shape);if(j=J(j,H),!q)return j;return Ez([],Z,j,H,G,$)}return U(j,H)}});Y_=B("$ZodUnion",($,_)=>{e.init($,_),Y$($._zod,"optin",()=>_.options.some((v)=>v._zod.optin==="optional")?"optional":void 0),Y$($._zod,"optout",()=>_.options.some((v)=>v._zod.optout==="optional")?"optional":void 0),Y$($._zod,"values",()=>{if(_.options.every((v)=>v._zod.values))return new Set(_.options.flatMap((v)=>Array.from(v._zod.values)));return}),Y$($._zod,"pattern",()=>{if(_.options.every((v)=>v._zod.pattern)){let v=_.options.map((J)=>J._zod.pattern);return new RegExp(`^(${v.map((J)=>o0(J.source)).join("|")})$`)}return});let U=_.options.length===1,Q=_.options[0]._zod.run;$._zod.parse=(v,J)=>{if(U)return Q(v,J);let Y=!1,z=[];for(let I of _.options){let X=I._zod.run({value:v.value,issues:[]},J);if(X instanceof Promise)z.push(X),Y=!0;else{if(X.issues.length===0)return X;z.push(X)}}if(!Y)return Vz(z,v,$,J);return Promise.all(z).then((I)=>{return Vz(I,v,$,J)})}});e3=B("$ZodXor",($,_)=>{Y_.init($,_),_.inclusive=!1;let U=_.options.length===1,Q=_.options[0]._zod.run;$._zod.parse=(v,J)=>{if(U)return Q(v,J);let Y=!1,z=[];for(let I of _.options){let X=I._zod.run({value:v.value,issues:[]},J);if(X instanceof Promise)z.push(X),Y=!0;else z.push(X)}if(!Y)return Dz(z,v,$,J);return Promise.all(z).then((I)=>{return Dz(I,v,$,J)})}}),$7=B("$ZodDiscriminatedUnion",($,_)=>{_.inclusive=!1,Y_.init($,_);let U=$._zod.parse;Y$($._zod,"propValues",()=>{let v={};for(let J of _.options){let Y=J._zod.propValues;if(!Y||Object.keys(Y).length===0)throw Error(`Invalid discriminated union option at index "${_.options.indexOf(J)}"`);for(let[z,I]of Object.entries(Y)){if(!v[z])v[z]=new Set;for(let X of I)v[z].add(X)}}return v});let Q=g1(()=>{let v=_.options,J=new Map;for(let Y of v){let z=Y._zod.propValues?.[_.discriminator];if(!z||z.size===0)throw Error(`Invalid discriminated union option at index "${_.options.indexOf(Y)}"`);for(let I of z){if(J.has(I))throw Error(`Duplicate discriminator value "${String(I)}"`);J.set(I,Y)}}return J});$._zod.parse=(v,J)=>{let Y=v.value;if(!e6(Y))return v.issues.push({code:"invalid_type",expected:"object",input:Y,inst:$}),v;let z=Q.value.get(Y?.[_.discriminator]);if(z)return z._zod.run(v,J);if(_.unionFallback)return U(v,J);return v.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:_.discriminator,input:Y,path:[_.discriminator],inst:$}),v}}),_7=B("$ZodIntersection",($,_)=>{e.init($,_),$._zod.parse=(U,Q)=>{let v=U.value,J=_.left._zod.run({value:v,issues:[]},Q),Y=_.right._zod.run({value:v,issues:[]},Q);if(J instanceof Promise||Y instanceof Promise)return Promise.all([J,Y]).then(([I,X])=>{return Mz(U,I,X)});return Mz(U,J,Y)}});Tv=B("$ZodTuple",($,_)=>{e.init($,_);let U=_.items;$._zod.parse=(Q,v)=>{let J=Q.value;if(!Array.isArray(J))return Q.issues.push({input:J,inst:$,expected:"tuple",code:"invalid_type"}),Q;Q.value=[];let Y=[],z=[...U].reverse().findIndex((q)=>q._zod.optin!=="optional"),I=z===-1?0:U.length-z;if(!_.rest){let q=J.length>U.length,G=J.length<I-1;if(q||G)return Q.issues.push({...q?{code:"too_big",maximum:U.length,inclusive:!0}:{code:"too_small",minimum:U.length},input:J,inst:$,origin:"array"}),Q}let X=-1;for(let q of U){if(X++,X>=J.length){if(X>=I)continue}let G=q._zod.run({value:J[X],issues:[]},v);if(G instanceof Promise)Y.push(G.then((j)=>Lv(j,Q,X)));else Lv(G,Q,X)}if(_.rest){let q=J.slice(U.length);for(let G of q){X++;let j=_.rest._zod.run({value:G,issues:[]},v);if(j instanceof Promise)Y.push(j.then((H)=>Lv(H,Q,X)));else Lv(j,Q,X)}}if(Y.length)return Promise.all(Y).then(()=>Q);return Q}});v7=B("$ZodRecord",($,_)=>{e.init($,_),$._zod.parse=(U,Q)=>{let v=U.value;if(!E6(v))return U.issues.push({expected:"record",code:"invalid_type",input:v,inst:$}),U;let J=[],Y=_.keyType._zod.values;if(Y){U.value={};let z=new Set;for(let X of Y)if(typeof X==="string"||typeof X==="number"||typeof X==="symbol"){z.add(typeof X==="number"?X.toString():X);let q=_.valueType._zod.run({value:v[X],issues:[]},Q);if(q instanceof Promise)J.push(q.then((G)=>{if(G.issues.length)U.issues.push(...w4(X,G.issues));U.value[X]=G.value}));else{if(q.issues.length)U.issues.push(...w4(X,q.issues));U.value[X]=q.value}}let I;for(let X in v)if(!z.has(X))I=I??[],I.push(X);if(I&&I.length>0)U.issues.push({code:"unrecognized_keys",input:v,inst:$,keys:I})}else{U.value={};for(let z of Reflect.ownKeys(v)){if(z==="__proto__")continue;let I=_.keyType._zod.run({value:z,issues:[]},Q);if(I instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof z==="string"&&v_.test(z)&&I.issues.length){let G=_.keyType._zod.run({value:Number(z),issues:[]},Q);if(G instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(G.issues.length===0)I=G}if(I.issues.length){if(_.mode==="loose")U.value[z]=v[z];else U.issues.push({code:"invalid_key",origin:"record",issues:I.issues.map((G)=>H4(G,Q,l$())),input:z,path:[z],inst:$});continue}let q=_.valueType._zod.run({value:v[z],issues:[]},Q);if(q instanceof Promise)J.push(q.then((G)=>{if(G.issues.length)U.issues.push(...w4(z,G.issues));U.value[I.value]=G.value}));else{if(q.issues.length)U.issues.push(...w4(z,q.issues));U.value[I.value]=q.value}}}if(J.length)return Promise.all(J).then(()=>U);return U}}),U7=B("$ZodMap",($,_)=>{e.init($,_),$._zod.parse=(U,Q)=>{let v=U.value;if(!(v instanceof Map))return U.issues.push({expected:"map",code:"invalid_type",input:v,inst:$}),U;let J=[];U.value=new Map;for(let[Y,z]of v){let I=_.keyType._zod.run({value:Y,issues:[]},Q),X=_.valueType._zod.run({value:z,issues:[]},Q);if(I instanceof Promise||X instanceof Promise)J.push(Promise.all([I,X]).then(([q,G])=>{wz(q,G,U,Y,v,$,Q)}));else wz(I,X,U,Y,v,$,Q)}if(J.length)return Promise.all(J).then(()=>U);return U}});Q7=B("$ZodSet",($,_)=>{e.init($,_),$._zod.parse=(U,Q)=>{let v=U.value;if(!(v instanceof Set))return U.issues.push({input:v,inst:$,expected:"set",code:"invalid_type"}),U;let J=[];U.value=new Set;for(let Y of v){let z=_.valueType._zod.run({value:Y,issues:[]},Q);if(z instanceof Promise)J.push(z.then((I)=>Lz(I,U)));else Lz(z,U)}if(J.length)return Promise.all(J).then(()=>U);return U}});J7=B("$ZodEnum",($,_)=>{e.init($,_);let U=r0(_.entries),Q=new Set(U);$._zod.values=Q,$._zod.pattern=new RegExp(`^(${U.filter((v)=>t0.has(typeof v)).map((v)=>typeof v==="string"?R4(v):v.toString()).join("|")})$`),$._zod.parse=(v,J)=>{let Y=v.value;if(Q.has(Y))return v;return v.issues.push({code:"invalid_value",values:U,input:Y,inst:$}),v}}),Y7=B("$ZodLiteral",($,_)=>{if(e.init($,_),_.values.length===0)throw Error("Cannot create literal schema with no valid values");let U=new Set(_.values);$._zod.values=U,$._zod.pattern=new RegExp(`^(${_.values.map((Q)=>typeof Q==="string"?R4(Q):Q?R4(Q.toString()):String(Q)).join("|")})$`),$._zod.parse=(Q,v)=>{let J=Q.value;if(U.has(J))return Q;return Q.issues.push({code:"invalid_value",values:_.values,input:J,inst:$}),Q}}),z7=B("$ZodFile",($,_)=>{e.init($,_),$._zod.parse=(U,Q)=>{let v=U.value;if(v instanceof File)return U;return U.issues.push({expected:"file",code:"invalid_type",input:v,inst:$}),U}}),I7=B("$ZodTransform",($,_)=>{e.init($,_),$._zod.parse=(U,Q)=>{if(Q.direction==="backward")throw new s6($.constructor.name);let v=_.transform(U.value,U);if(Q.async)return(v instanceof Promise?v:Promise.resolve(v)).then((Y)=>{return U.value=Y,U});if(v instanceof Promise)throw new _6;return U.value=v,U}});Rv=B("$ZodOptional",($,_)=>{e.init($,_),$._zod.optin="optional",$._zod.optout="optional",Y$($._zod,"values",()=>{return _.innerType._zod.values?new Set([..._.innerType._zod.values,void 0]):void 0}),Y$($._zod,"pattern",()=>{let U=_.innerType._zod.pattern;return U?new RegExp(`^(${o0(U.source)})?$`):void 0}),$._zod.parse=(U,Q)=>{if(_.innerType._zod.optin==="optional"){let v=_.innerType._zod.run(U,Q);if(v instanceof Promise)return v.then((J)=>kz(J,U.value));return kz(v,U.value)}if(U.value===void 0)return U;return _.innerType._zod.run(U,Q)}}),X7=B("$ZodExactOptional",($,_)=>{Rv.init($,_),Y$($._zod,"values",()=>_.innerType._zod.values),Y$($._zod,"pattern",()=>_.innerType._zod.pattern),$._zod.parse=(U,Q)=>{return _.innerType._zod.run(U,Q)}}),q7=B("$ZodNullable",($,_)=>{e.init($,_),Y$($._zod,"optin",()=>_.innerType._zod.optin),Y$($._zod,"optout",()=>_.innerType._zod.optout),Y$($._zod,"pattern",()=>{let U=_.innerType._zod.pattern;return U?new RegExp(`^(${o0(U.source)}|null)$`):void 0}),Y$($._zod,"values",()=>{return _.innerType._zod.values?new Set([..._.innerType._zod.values,null]):void 0}),$._zod.parse=(U,Q)=>{if(U.value===null)return U;return _.innerType._zod.run(U,Q)}}),G7=B("$ZodDefault",($,_)=>{e.init($,_),$._zod.optin="optional",Y$($._zod,"values",()=>_.innerType._zod.values),$._zod.parse=(U,Q)=>{if(Q.direction==="backward")return _.innerType._zod.run(U,Q);if(U.value===void 0)return U.value=_.defaultValue,U;let v=_.innerType._zod.run(U,Q);if(v instanceof Promise)return v.then((J)=>Az(J,_));return Az(v,_)}});j7=B("$ZodPrefault",($,_)=>{e.init($,_),$._zod.optin="optional",Y$($._zod,"values",()=>_.innerType._zod.values),$._zod.parse=(U,Q)=>{if(Q.direction==="backward")return _.innerType._zod.run(U,Q);if(U.value===void 0)U.value=_.defaultValue;return _.innerType._zod.run(U,Q)}}),K7=B("$ZodNonOptional",($,_)=>{e.init($,_),Y$($._zod,"values",()=>{let U=_.innerType._zod.values;return U?new Set([...U].filter((Q)=>Q!==void 0)):void 0}),$._zod.parse=(U,Q)=>{let v=_.innerType._zod.run(U,Q);if(v instanceof Promise)return v.then((J)=>Fz(J,$));return Fz(v,$)}});H7=B("$ZodSuccess",($,_)=>{e.init($,_),$._zod.parse=(U,Q)=>{if(Q.direction==="backward")throw new s6("ZodSuccess");let v=_.innerType._zod.run(U,Q);if(v instanceof Promise)return v.then((J)=>{return U.value=J.issues.length===0,U});return U.value=v.issues.length===0,U}}),W7=B("$ZodCatch",($,_)=>{e.init($,_),Y$($._zod,"optin",()=>_.innerType._zod.optin),Y$($._zod,"optout",()=>_.innerType._zod.optout),Y$($._zod,"values",()=>_.innerType._zod.values),$._zod.parse=(U,Q)=>{if(Q.direction==="backward")return _.innerType._zod.run(U,Q);let v=_.innerType._zod.run(U,Q);if(v instanceof Promise)return v.then((J)=>{if(U.value=J.value,J.issues.length)U.value=_.catchValue({...U,error:{issues:J.issues.map((Y)=>H4(Y,Q,l$()))},input:U.value}),U.issues=[];return U});if(U.value=v.value,v.issues.length)U.value=_.catchValue({...U,error:{issues:v.issues.map((J)=>H4(J,Q,l$()))},input:U.value}),U.issues=[];return U}}),b7=B("$ZodNaN",($,_)=>{e.init($,_),$._zod.parse=(U,Q)=>{if(typeof U.value!=="number"||!Number.isNaN(U.value))return U.issues.push({input:U.value,inst:$,expected:"nan",code:"invalid_type"}),U;return U}}),B7=B("$ZodPipe",($,_)=>{e.init($,_),Y$($._zod,"values",()=>_.in._zod.values),Y$($._zod,"optin",()=>_.in._zod.optin),Y$($._zod,"optout",()=>_.out._zod.optout),Y$($._zod,"propValues",()=>_.in._zod.propValues),$._zod.parse=(U,Q)=>{if(Q.direction==="backward"){let J=_.out._zod.run(U,Q);if(J instanceof Promise)return J.then((Y)=>kv(Y,_.in,Q));return kv(J,_.in,Q)}let v=_.in._zod.run(U,Q);if(v instanceof Promise)return v.then((J)=>kv(J,_.out,Q));return kv(v,_.out,Q)}});z_=B("$ZodCodec",($,_)=>{e.init($,_),Y$($._zod,"values",()=>_.in._zod.values),Y$($._zod,"optin",()=>_.in._zod.optin),Y$($._zod,"optout",()=>_.out._zod.optout),Y$($._zod,"propValues",()=>_.in._zod.propValues),$._zod.parse=(U,Q)=>{if((Q.direction||"forward")==="forward"){let J=_.in._zod.run(U,Q);if(J instanceof Promise)return J.then((Y)=>Av(Y,_,Q));return Av(J,_,Q)}else{let J=_.out._zod.run(U,Q);if(J instanceof Promise)return J.then((Y)=>Av(Y,_,Q));return Av(J,_,Q)}}});Z7=B("$ZodReadonly",($,_)=>{e.init($,_),Y$($._zod,"propValues",()=>_.innerType._zod.propValues),Y$($._zod,"values",()=>_.innerType._zod.values),Y$($._zod,"optin",()=>_.innerType?._zod?.optin),Y$($._zod,"optout",()=>_.innerType?._zod?.optout),$._zod.parse=(U,Q)=>{if(Q.direction==="backward")return _.innerType._zod.run(U,Q);let v=_.innerType._zod.run(U,Q);if(v instanceof Promise)return v.then(Oz);return Oz(v)}});V7=B("$ZodTemplateLiteral",($,_)=>{e.init($,_);let U=[];for(let Q of _.parts)if(typeof Q==="object"&&Q!==null){if(!Q._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...Q._zod.traits].shift()}`);let v=Q._zod.pattern instanceof RegExp?Q._zod.pattern.source:Q._zod.pattern;if(!v)throw Error(`Invalid template literal part: ${Q._zod.traits}`);let J=v.startsWith("^")?1:0,Y=v.endsWith("$")?v.length-1:v.length;U.push(v.slice(J,Y))}else if(Q===null||q9.has(typeof Q))U.push(R4(`${Q}`));else throw Error(`Invalid template literal part: ${Q}`);$._zod.pattern=new RegExp(`^${U.join("")}$`),$._zod.parse=(Q,v)=>{if(typeof Q.value!=="string")return Q.issues.push({input:Q.value,inst:$,expected:"string",code:"invalid_type"}),Q;if($._zod.pattern.lastIndex=0,!$._zod.pattern.test(Q.value))return Q.issues.push({input:Q.value,inst:$,code:"invalid_format",format:_.format??"template_literal",pattern:$._zod.pattern.source}),Q;return Q}}),D7=B("$ZodFunction",($,_)=>{return e.init($,_),$._def=_,$._zod.def=_,$.implement=(U)=>{if(typeof U!=="function")throw Error("implement() must be called with a function");return function(...Q){let v=$._def.input?zv($._def.input,Q):Q,J=Reflect.apply(U,this,v);if($._def.output)return zv($._def.output,J);return J}},$.implementAsync=(U)=>{if(typeof U!=="function")throw Error("implementAsync() must be called with a function");return async function(...Q){let v=$._def.input?await Iv($._def.input,Q):Q,J=await Reflect.apply(U,this,v);if($._def.output)return await Iv($._def.output,J);return J}},$._zod.parse=(U,Q)=>{if(typeof U.value!=="function")return U.issues.push({code:"invalid_type",expected:"function",input:U.value,inst:$}),U;if($._def.output&&$._def.output._zod.def.type==="promise")U.value=$.implementAsync(U.value);else U.value=$.implement(U.value);return U},$.input=(...U)=>{let Q=$.constructor;if(Array.isArray(U[0]))return new Q({type:"function",input:new Tv({type:"tuple",items:U[0],rest:U[1]}),output:$._def.output});return new Q({type:"function",input:U[0],output:$._def.output})},$.output=(U)=>{return new $.constructor({type:"function",input:$._def.input,output:U})},$}),M7=B("$ZodPromise",($,_)=>{e.init($,_),$._zod.parse=(U,Q)=>{return Promise.resolve(U.value).then((v)=>_.innerType._zod.run({value:v,issues:[]},Q))}}),w7=B("$ZodLazy",($,_)=>{e.init($,_),Y$($._zod,"innerType",()=>_.getter()),Y$($._zod,"pattern",()=>$._zod.innerType?._zod?.pattern),Y$($._zod,"propValues",()=>$._zod.innerType?._zod?.propValues),Y$($._zod,"optin",()=>$._zod.innerType?._zod?.optin??void 0),Y$($._zod,"optout",()=>$._zod.innerType?._zod?.optout??void 0),$._zod.parse=(U,Q)=>{return $._zod.innerType._zod.run(U,Q)}}),L7=B("$ZodCustom",($,_)=>{T$.init($,_),e.init($,_),$._zod.parse=(U,Q)=>{return U},$._zod.check=(U)=>{let Q=U.value,v=_.fn(Q);if(v instanceof Promise)return v.then((J)=>Nz(J,U,Q,$));Nz(v,U,Q,$);return}})});function A7(){return{localeError:YB()}}var YB=()=>{let $={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function _(v){return $[v]??null}let U={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},Q={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${v.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${z}`;return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${J}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${z}`}case"invalid_value":if(v.values.length===1)return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${N(v.values[0])}`;return`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${v.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${J} ${v.maximum.toString()} ${Y.unit??"\u0639\u0646\u0635\u0631"}`;return`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${v.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${J} ${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${v.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${J} ${v.minimum.toString()} ${Y.unit}`;return`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${v.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${J} ${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${v.prefix}"`;if(J.format==="ends_with")return`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${J.suffix}"`;if(J.format==="includes")return`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${J.includes}"`;if(J.format==="regex")return`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${J.pattern}`;return`${U[J.format]??v.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${v.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${v.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${v.keys.length>1?"\u0629":""}: ${D(v.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${v.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${v.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};var xz=b(()=>{l()});function F7(){return{localeError:zB()}}var zB=()=>{let $={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function _(v){return $[v]??null}let U={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},Q={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${v.expected}, daxil olan ${z}`;return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${J}, daxil olan ${z}`}case"invalid_value":if(v.values.length===1)return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${N(v.values[0])}`;return`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${v.origin??"d\u0259y\u0259r"} ${J}${v.maximum.toString()} ${Y.unit??"element"}`;return`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${v.origin??"d\u0259y\u0259r"} ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${v.origin} ${J}${v.minimum.toString()} ${Y.unit}`;return`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${v.origin} ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Yanl\u0131\u015F m\u0259tn: "${J.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`;if(J.format==="ends_with")return`Yanl\u0131\u015F m\u0259tn: "${J.suffix}" il\u0259 bitm\u0259lidir`;if(J.format==="includes")return`Yanl\u0131\u015F m\u0259tn: "${J.includes}" daxil olmal\u0131d\u0131r`;if(J.format==="regex")return`Yanl\u0131\u015F m\u0259tn: ${J.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`;return`Yanl\u0131\u015F ${U[J.format]??v.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${v.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${v.keys.length>1?"lar":""}: ${D(v.keys,", ")}`;case"invalid_key":return`${v.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${v.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};var uz=b(()=>{l()});function yz($,_,U,Q){let v=Math.abs($),J=v%10,Y=v%100;if(Y>=11&&Y<=19)return Q;if(J===1)return _;if(J>=2&&J<=4)return U;return Q}function O7(){return{localeError:IB()}}var IB=()=>{let $={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function _(v){return $[v]??null}let U={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},Q={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${v.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${z}`;return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${J}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${z}`}case"invalid_value":if(v.values.length===1)return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${N(v.values[0])}`;return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y){let z=Number(v.maximum),I=yz(z,Y.unit.one,Y.unit.few,Y.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${v.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${Y.verb} ${J}${v.maximum.toString()} ${I}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${v.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y){let z=Number(v.minimum),I=yz(z,Y.unit.one,Y.unit.few,Y.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${v.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${Y.verb} ${J}${v.minimum.toString()} ${I}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${v.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${J.prefix}"`;if(J.format==="ends_with")return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${J.suffix}"`;if(J.format==="includes")return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${J.includes}"`;if(J.format==="regex")return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${J.pattern}`;return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${U[J.format]??v.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${v.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${v.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${D(v.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${v.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${v.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};var Cz=b(()=>{l()});function N7(){return{localeError:XB()}}var XB=()=>{let $={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function _(v){return $[v]??null}let U={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},Q={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${v.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${z}`;return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${J}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${z}`}case"invalid_value":if(v.values.length===1)return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${N(v.values[0])}`;return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${v.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${J}${v.maximum.toString()} ${Y.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`;return`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${v.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${v.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${J}${v.minimum.toString()} ${Y.unit}`;return`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${v.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${J.prefix}"`;if(J.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${J.suffix}"`;if(J.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${J.includes}"`;if(J.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${J.pattern}`;let Y="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";if(J.format==="emoji")Y="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E";if(J.format==="datetime")Y="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E";if(J.format==="date")Y="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430";if(J.format==="time")Y="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E";if(J.format==="duration")Y="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430";return`${Y} ${U[J.format]??v.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${v.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${v.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${v.keys.length>1?"\u043E\u0432\u0435":""}: ${D(v.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${v.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${v.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};var fz=b(()=>{l()});function S7(){return{localeError:qB()}}var qB=()=>{let $={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function _(v){return $[v]??null}let U={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},Q={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Tipus inv\xE0lid: s'esperava instanceof ${v.expected}, s'ha rebut ${z}`;return`Tipus inv\xE0lid: s'esperava ${J}, s'ha rebut ${z}`}case"invalid_value":if(v.values.length===1)return`Valor inv\xE0lid: s'esperava ${N(v.values[0])}`;return`Opci\xF3 inv\xE0lida: s'esperava una de ${D(v.values," o ")}`;case"too_big":{let J=v.inclusive?"com a m\xE0xim":"menys de",Y=_(v.origin);if(Y)return`Massa gran: s'esperava que ${v.origin??"el valor"} contingu\xE9s ${J} ${v.maximum.toString()} ${Y.unit??"elements"}`;return`Massa gran: s'esperava que ${v.origin??"el valor"} fos ${J} ${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?"com a m\xEDnim":"m\xE9s de",Y=_(v.origin);if(Y)return`Massa petit: s'esperava que ${v.origin} contingu\xE9s ${J} ${v.minimum.toString()} ${Y.unit}`;return`Massa petit: s'esperava que ${v.origin} fos ${J} ${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Format inv\xE0lid: ha de comen\xE7ar amb "${J.prefix}"`;if(J.format==="ends_with")return`Format inv\xE0lid: ha d'acabar amb "${J.suffix}"`;if(J.format==="includes")return`Format inv\xE0lid: ha d'incloure "${J.includes}"`;if(J.format==="regex")return`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${J.pattern}`;return`Format inv\xE0lid per a ${U[J.format]??v.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${v.divisor}`;case"unrecognized_keys":return`Clau${v.keys.length>1?"s":""} no reconeguda${v.keys.length>1?"s":""}: ${D(v.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${v.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${v.origin}`;default:return"Entrada inv\xE0lida"}}};var mz=b(()=>{l()});function T7(){return{localeError:GB()}}var GB=()=>{let $={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function _(v){return $[v]??null}let U={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},Q={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${v.expected}, obdr\u017Eeno ${z}`;return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${J}, obdr\u017Eeno ${z}`}case"invalid_value":if(v.values.length===1)return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${N(v.values[0])}`;return`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${v.origin??"hodnota"} mus\xED m\xEDt ${J}${v.maximum.toString()} ${Y.unit??"prvk\u016F"}`;return`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${v.origin??"hodnota"} mus\xED b\xFDt ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${v.origin??"hodnota"} mus\xED m\xEDt ${J}${v.minimum.toString()} ${Y.unit??"prvk\u016F"}`;return`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${v.origin??"hodnota"} mus\xED b\xFDt ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${J.prefix}"`;if(J.format==="ends_with")return`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${J.suffix}"`;if(J.format==="includes")return`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${J.includes}"`;if(J.format==="regex")return`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${J.pattern}`;return`Neplatn\xFD form\xE1t ${U[J.format]??v.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${v.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${D(v.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${v.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${v.origin}`;default:return"Neplatn\xFD vstup"}}};var gz=b(()=>{l()});function R7(){return{localeError:jB()}}var jB=()=>{let $={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function _(v){return $[v]??null}let U={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},Q={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Ugyldigt input: forventede instanceof ${v.expected}, fik ${z}`;return`Ugyldigt input: forventede ${J}, fik ${z}`}case"invalid_value":if(v.values.length===1)return`Ugyldig v\xE6rdi: forventede ${N(v.values[0])}`;return`Ugyldigt valg: forventede en af f\xF8lgende ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin),z=Q[v.origin]??v.origin;if(Y)return`For stor: forventede ${z??"value"} ${Y.verb} ${J} ${v.maximum.toString()} ${Y.unit??"elementer"}`;return`For stor: forventede ${z??"value"} havde ${J} ${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin),z=Q[v.origin]??v.origin;if(Y)return`For lille: forventede ${z} ${Y.verb} ${J} ${v.minimum.toString()} ${Y.unit}`;return`For lille: forventede ${z} havde ${J} ${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Ugyldig streng: skal starte med "${J.prefix}"`;if(J.format==="ends_with")return`Ugyldig streng: skal ende med "${J.suffix}"`;if(J.format==="includes")return`Ugyldig streng: skal indeholde "${J.includes}"`;if(J.format==="regex")return`Ugyldig streng: skal matche m\xF8nsteret ${J.pattern}`;return`Ugyldig ${U[J.format]??v.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${v.divisor}`;case"unrecognized_keys":return`${v.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${D(v.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${v.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${v.origin}`;default:return"Ugyldigt input"}}};var hz=b(()=>{l()});function E7(){return{localeError:KB()}}var KB=()=>{let $={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function _(v){return $[v]??null}let U={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},Q={nan:"NaN",number:"Zahl",array:"Array"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Ung\xFCltige Eingabe: erwartet instanceof ${v.expected}, erhalten ${z}`;return`Ung\xFCltige Eingabe: erwartet ${J}, erhalten ${z}`}case"invalid_value":if(v.values.length===1)return`Ung\xFCltige Eingabe: erwartet ${N(v.values[0])}`;return`Ung\xFCltige Option: erwartet eine von ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`Zu gro\xDF: erwartet, dass ${v.origin??"Wert"} ${J}${v.maximum.toString()} ${Y.unit??"Elemente"} hat`;return`Zu gro\xDF: erwartet, dass ${v.origin??"Wert"} ${J}${v.maximum.toString()} ist`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`Zu klein: erwartet, dass ${v.origin} ${J}${v.minimum.toString()} ${Y.unit} hat`;return`Zu klein: erwartet, dass ${v.origin} ${J}${v.minimum.toString()} ist`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Ung\xFCltiger String: muss mit "${J.prefix}" beginnen`;if(J.format==="ends_with")return`Ung\xFCltiger String: muss mit "${J.suffix}" enden`;if(J.format==="includes")return`Ung\xFCltiger String: muss "${J.includes}" enthalten`;if(J.format==="regex")return`Ung\xFCltiger String: muss dem Muster ${J.pattern} entsprechen`;return`Ung\xFCltig: ${U[J.format]??v.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${v.divisor} sein`;case"unrecognized_keys":return`${v.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${D(v.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${v.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${v.origin}`;default:return"Ung\xFCltige Eingabe"}}};var cz=b(()=>{l()});function I_(){return{localeError:HB()}}var HB=()=>{let $={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function _(v){return $[v]??null}let U={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},Q={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;return`Invalid input: expected ${J}, received ${z}`}case"invalid_value":if(v.values.length===1)return`Invalid input: expected ${N(v.values[0])}`;return`Invalid option: expected one of ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`Too big: expected ${v.origin??"value"} to have ${J}${v.maximum.toString()} ${Y.unit??"elements"}`;return`Too big: expected ${v.origin??"value"} to be ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`Too small: expected ${v.origin} to have ${J}${v.minimum.toString()} ${Y.unit}`;return`Too small: expected ${v.origin} to be ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Invalid string: must start with "${J.prefix}"`;if(J.format==="ends_with")return`Invalid string: must end with "${J.suffix}"`;if(J.format==="includes")return`Invalid string: must include "${J.includes}"`;if(J.format==="regex")return`Invalid string: must match pattern ${J.pattern}`;return`Invalid ${U[J.format]??v.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${v.divisor}`;case"unrecognized_keys":return`Unrecognized key${v.keys.length>1?"s":""}: ${D(v.keys,", ")}`;case"invalid_key":return`Invalid key in ${v.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${v.origin}`;default:return"Invalid input"}}};var P7=b(()=>{l()});function x7(){return{localeError:WB()}}var WB=()=>{let $={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function _(v){return $[v]??null}let U={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},Q={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Nevalida enigo: atendi\u011Dis instanceof ${v.expected}, ricevi\u011Dis ${z}`;return`Nevalida enigo: atendi\u011Dis ${J}, ricevi\u011Dis ${z}`}case"invalid_value":if(v.values.length===1)return`Nevalida enigo: atendi\u011Dis ${N(v.values[0])}`;return`Nevalida opcio: atendi\u011Dis unu el ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`Tro granda: atendi\u011Dis ke ${v.origin??"valoro"} havu ${J}${v.maximum.toString()} ${Y.unit??"elementojn"}`;return`Tro granda: atendi\u011Dis ke ${v.origin??"valoro"} havu ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`Tro malgranda: atendi\u011Dis ke ${v.origin} havu ${J}${v.minimum.toString()} ${Y.unit}`;return`Tro malgranda: atendi\u011Dis ke ${v.origin} estu ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Nevalida karaktraro: devas komenci\u011Di per "${J.prefix}"`;if(J.format==="ends_with")return`Nevalida karaktraro: devas fini\u011Di per "${J.suffix}"`;if(J.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${J.includes}"`;if(J.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${J.pattern}`;return`Nevalida ${U[J.format]??v.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${v.divisor}`;case"unrecognized_keys":return`Nekonata${v.keys.length>1?"j":""} \u015Dlosilo${v.keys.length>1?"j":""}: ${D(v.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${v.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${v.origin}`;default:return"Nevalida enigo"}}};var lz=b(()=>{l()});function u7(){return{localeError:bB()}}var bB=()=>{let $={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function _(v){return $[v]??null}let U={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},Q={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Entrada inv\xE1lida: se esperaba instanceof ${v.expected}, recibido ${z}`;return`Entrada inv\xE1lida: se esperaba ${J}, recibido ${z}`}case"invalid_value":if(v.values.length===1)return`Entrada inv\xE1lida: se esperaba ${N(v.values[0])}`;return`Opci\xF3n inv\xE1lida: se esperaba una de ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin),z=Q[v.origin]??v.origin;if(Y)return`Demasiado grande: se esperaba que ${z??"valor"} tuviera ${J}${v.maximum.toString()} ${Y.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${z??"valor"} fuera ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin),z=Q[v.origin]??v.origin;if(Y)return`Demasiado peque\xF1o: se esperaba que ${z} tuviera ${J}${v.minimum.toString()} ${Y.unit}`;return`Demasiado peque\xF1o: se esperaba que ${z} fuera ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Cadena inv\xE1lida: debe comenzar con "${J.prefix}"`;if(J.format==="ends_with")return`Cadena inv\xE1lida: debe terminar en "${J.suffix}"`;if(J.format==="includes")return`Cadena inv\xE1lida: debe incluir "${J.includes}"`;if(J.format==="regex")return`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${J.pattern}`;return`Inv\xE1lido ${U[J.format]??v.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${v.divisor}`;case"unrecognized_keys":return`Llave${v.keys.length>1?"s":""} desconocida${v.keys.length>1?"s":""}: ${D(v.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${Q[v.origin]??v.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${Q[v.origin]??v.origin}`;default:return"Entrada inv\xE1lida"}}};var dz=b(()=>{l()});function y7(){return{localeError:BB()}}var BB=()=>{let $={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function _(v){return $[v]??null}let U={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},Q={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${v.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${z} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${J} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${z} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":if(v.values.length===1)return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${N(v.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`;return`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${D(v.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${v.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${J}${v.maximum.toString()} ${Y.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`;return`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${v.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${J}${v.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${v.origin} \u0628\u0627\u06CC\u062F ${J}${v.minimum.toString()} ${Y.unit} \u0628\u0627\u0634\u062F`;return`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${v.origin} \u0628\u0627\u06CC\u062F ${J}${v.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${J.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`;if(J.format==="ends_with")return`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${J.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`;if(J.format==="includes")return`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${J.includes}" \u0628\u0627\u0634\u062F`;if(J.format==="regex")return`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${J.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`;return`${U[J.format]??v.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${v.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${v.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${D(v.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${v.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${v.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};var pz=b(()=>{l()});function C7(){return{localeError:ZB()}}var ZB=()=>{let $={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function _(v){return $[v]??null}let U={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},Q={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Virheellinen tyyppi: odotettiin instanceof ${v.expected}, oli ${z}`;return`Virheellinen tyyppi: odotettiin ${J}, oli ${z}`}case"invalid_value":if(v.values.length===1)return`Virheellinen sy\xF6te: t\xE4ytyy olla ${N(v.values[0])}`;return`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`Liian suuri: ${Y.subject} t\xE4ytyy olla ${J}${v.maximum.toString()} ${Y.unit}`.trim();return`Liian suuri: arvon t\xE4ytyy olla ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`Liian pieni: ${Y.subject} t\xE4ytyy olla ${J}${v.minimum.toString()} ${Y.unit}`.trim();return`Liian pieni: arvon t\xE4ytyy olla ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${J.prefix}"`;if(J.format==="ends_with")return`Virheellinen sy\xF6te: t\xE4ytyy loppua "${J.suffix}"`;if(J.format==="includes")return`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${J.includes}"`;if(J.format==="regex")return`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${J.pattern}`;return`Virheellinen ${U[J.format]??v.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${v.divisor} monikerta`;case"unrecognized_keys":return`${v.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${D(v.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}};var iz=b(()=>{l()});function f7(){return{localeError:VB()}}var VB=()=>{let $={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function _(v){return $[v]??null}let U={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},Q={nan:"NaN",number:"nombre",array:"tableau"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Entr\xE9e invalide : instanceof ${v.expected} attendu, ${z} re\xE7u`;return`Entr\xE9e invalide : ${J} attendu, ${z} re\xE7u`}case"invalid_value":if(v.values.length===1)return`Entr\xE9e invalide : ${N(v.values[0])} attendu`;return`Option invalide : une valeur parmi ${D(v.values,"|")} attendue`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`Trop grand : ${v.origin??"valeur"} doit ${Y.verb} ${J}${v.maximum.toString()} ${Y.unit??"\xE9l\xE9ment(s)"}`;return`Trop grand : ${v.origin??"valeur"} doit \xEAtre ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`Trop petit : ${v.origin} doit ${Y.verb} ${J}${v.minimum.toString()} ${Y.unit}`;return`Trop petit : ${v.origin} doit \xEAtre ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Cha\xEEne invalide : doit commencer par "${J.prefix}"`;if(J.format==="ends_with")return`Cha\xEEne invalide : doit se terminer par "${J.suffix}"`;if(J.format==="includes")return`Cha\xEEne invalide : doit inclure "${J.includes}"`;if(J.format==="regex")return`Cha\xEEne invalide : doit correspondre au mod\xE8le ${J.pattern}`;return`${U[J.format]??v.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${v.divisor}`;case"unrecognized_keys":return`Cl\xE9${v.keys.length>1?"s":""} non reconnue${v.keys.length>1?"s":""} : ${D(v.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${v.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${v.origin}`;default:return"Entr\xE9e invalide"}}};var nz=b(()=>{l()});function m7(){return{localeError:DB()}}var DB=()=>{let $={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function _(v){return $[v]??null}let U={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},Q={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Entr\xE9e invalide : attendu instanceof ${v.expected}, re\xE7u ${z}`;return`Entr\xE9e invalide : attendu ${J}, re\xE7u ${z}`}case"invalid_value":if(v.values.length===1)return`Entr\xE9e invalide : attendu ${N(v.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"\u2264":"<",Y=_(v.origin);if(Y)return`Trop grand : attendu que ${v.origin??"la valeur"} ait ${J}${v.maximum.toString()} ${Y.unit}`;return`Trop grand : attendu que ${v.origin??"la valeur"} soit ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?"\u2265":">",Y=_(v.origin);if(Y)return`Trop petit : attendu que ${v.origin} ait ${J}${v.minimum.toString()} ${Y.unit}`;return`Trop petit : attendu que ${v.origin} soit ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Cha\xEEne invalide : doit commencer par "${J.prefix}"`;if(J.format==="ends_with")return`Cha\xEEne invalide : doit se terminer par "${J.suffix}"`;if(J.format==="includes")return`Cha\xEEne invalide : doit inclure "${J.includes}"`;if(J.format==="regex")return`Cha\xEEne invalide : doit correspondre au motif ${J.pattern}`;return`${U[J.format]??v.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${v.divisor}`;case"unrecognized_keys":return`Cl\xE9${v.keys.length>1?"s":""} non reconnue${v.keys.length>1?"s":""} : ${D(v.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${v.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${v.origin}`;default:return"Entr\xE9e invalide"}}};var rz=b(()=>{l()});function g7(){return{localeError:MB()}}var MB=()=>{let $={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},_={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},U=(X)=>X?$[X]:void 0,Q=(X)=>{let q=U(X);if(q)return q.label;return X??$.unknown.label},v=(X)=>`\u05D4${Q(X)}`,J=(X)=>{return(U(X)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA"},Y=(X)=>{if(!X)return null;return _[X]??null},z={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},I={nan:"NaN"};return(X)=>{switch(X.code){case"invalid_type":{let q=X.expected,G=I[q??""]??Q(q),j=R(X.input),H=I[j]??$[j]?.label??j;if(/^[A-Z]/.test(X.expected))return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${X.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${H}`;return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${G}, \u05D4\u05EA\u05E7\u05D1\u05DC ${H}`}case"invalid_value":{if(X.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${N(X.values[0])}`;let q=X.values.map((H)=>N(H));if(X.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${q[0]} \u05D0\u05D5 ${q[1]}`;let G=q[q.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${q.slice(0,-1).join(", ")} \u05D0\u05D5 ${G}`}case"too_big":{let q=Y(X.origin),G=v(X.origin??"value");if(X.origin==="string")return`${q?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${G} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${X.maximum.toString()} ${q?.unit??""} ${X.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(X.origin==="number"){let Z=X.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${X.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${X.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${G} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${Z}`}if(X.origin==="array"||X.origin==="set"){let Z=X.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",V=X.inclusive?`${X.maximum} ${q?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${X.maximum} ${q?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${G} ${Z} \u05DC\u05D4\u05DB\u05D9\u05DC ${V}`.trim()}let j=X.inclusive?"<=":"<",H=J(X.origin??"value");if(q?.unit)return`${q.longLabel} \u05DE\u05D3\u05D9: ${G} ${H} ${j}${X.maximum.toString()} ${q.unit}`;return`${q?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${G} ${H} ${j}${X.maximum.toString()}`}case"too_small":{let q=Y(X.origin),G=v(X.origin??"value");if(X.origin==="string")return`${q?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${G} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${X.minimum.toString()} ${q?.unit??""} ${X.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(X.origin==="number"){let Z=X.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${X.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${X.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${G} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${Z}`}if(X.origin==="array"||X.origin==="set"){let Z=X.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(X.minimum===1&&X.inclusive){let S=X.origin==="set"?"\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3":"\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3";return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${G} ${Z} \u05DC\u05D4\u05DB\u05D9\u05DC ${S}`}let V=X.inclusive?`${X.minimum} ${q?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${X.minimum} ${q?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${G} ${Z} \u05DC\u05D4\u05DB\u05D9\u05DC ${V}`.trim()}let j=X.inclusive?">=":">",H=J(X.origin??"value");if(q?.unit)return`${q.shortLabel} \u05DE\u05D3\u05D9: ${G} ${H} ${j}${X.minimum.toString()} ${q.unit}`;return`${q?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${G} ${H} ${j}${X.minimum.toString()}`}case"invalid_format":{let q=X;if(q.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${q.prefix}"`;if(q.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${q.suffix}"`;if(q.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${q.includes}"`;if(q.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${q.pattern}`;let G=z[q.format],j=G?.label??q.format,Z=(G?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${j} \u05DC\u05D0 ${Z}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${X.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${X.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${X.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${D(X.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${v(X.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};var oz=b(()=>{l()});function h7(){return{localeError:wB()}}var wB=()=>{let $={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function _(v){return $[v]??null}let U={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},Q={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${v.expected}, a kapott \xE9rt\xE9k ${z}`;return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${J}, a kapott \xE9rt\xE9k ${z}`}case"invalid_value":if(v.values.length===1)return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${N(v.values[0])}`;return`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`T\xFAl nagy: ${v.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${J}${v.maximum.toString()} ${Y.unit??"elem"}`;return`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${v.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${v.origin} m\xE9rete t\xFAl kicsi ${J}${v.minimum.toString()} ${Y.unit}`;return`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${v.origin} t\xFAl kicsi ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\xC9rv\xE9nytelen string: "${J.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`;if(J.format==="ends_with")return`\xC9rv\xE9nytelen string: "${J.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`;if(J.format==="includes")return`\xC9rv\xE9nytelen string: "${J.includes}" \xE9rt\xE9ket kell tartalmaznia`;if(J.format==="regex")return`\xC9rv\xE9nytelen string: ${J.pattern} mint\xE1nak kell megfelelnie`;return`\xC9rv\xE9nytelen ${U[J.format]??v.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${v.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${v.keys.length>1?"s":""}: ${D(v.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${v.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${v.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};var tz=b(()=>{l()});function az($,_,U){return Math.abs($)===1?_:U}function n1($){if(!$)return"";let _=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],U=$[$.length-1];return $+(_.includes(U)?"\u0576":"\u0568")}function c7(){return{localeError:LB()}}var LB=()=>{let $={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function _(v){return $[v]??null}let U={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},Q={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${v.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${z}`;return`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${J}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${z}`}case"invalid_value":if(v.values.length===1)return`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${N(v.values[1])}`;return`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y){let z=Number(v.maximum),I=az(z,Y.unit.one,Y.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${n1(v.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${J}${v.maximum.toString()} ${I}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${n1(v.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y){let z=Number(v.minimum),I=az(z,Y.unit.one,Y.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${n1(v.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${J}${v.minimum.toString()} ${I}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${n1(v.origin)} \u056C\u056B\u0576\u056B ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${J.prefix}"-\u0578\u057E`;if(J.format==="ends_with")return`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${J.suffix}"-\u0578\u057E`;if(J.format==="includes")return`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${J.includes}"`;if(J.format==="regex")return`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${J.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`;return`\u054D\u056D\u0561\u056C ${U[J.format]??v.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${v.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${v.keys.length>1?"\u0576\u0565\u0580":""}. ${D(v.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${n1(v.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${n1(v.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};var sz=b(()=>{l()});function l7(){return{localeError:kB()}}var kB=()=>{let $={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function _(v){return $[v]??null}let U={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},Q={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Input tidak valid: diharapkan instanceof ${v.expected}, diterima ${z}`;return`Input tidak valid: diharapkan ${J}, diterima ${z}`}case"invalid_value":if(v.values.length===1)return`Input tidak valid: diharapkan ${N(v.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`Terlalu besar: diharapkan ${v.origin??"value"} memiliki ${J}${v.maximum.toString()} ${Y.unit??"elemen"}`;return`Terlalu besar: diharapkan ${v.origin??"value"} menjadi ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`Terlalu kecil: diharapkan ${v.origin} memiliki ${J}${v.minimum.toString()} ${Y.unit}`;return`Terlalu kecil: diharapkan ${v.origin} menjadi ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`String tidak valid: harus dimulai dengan "${J.prefix}"`;if(J.format==="ends_with")return`String tidak valid: harus berakhir dengan "${J.suffix}"`;if(J.format==="includes")return`String tidak valid: harus menyertakan "${J.includes}"`;if(J.format==="regex")return`String tidak valid: harus sesuai pola ${J.pattern}`;return`${U[J.format]??v.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${v.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${v.keys.length>1?"s":""}: ${D(v.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${v.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${v.origin}`;default:return"Input tidak valid"}}};var ez=b(()=>{l()});function d7(){return{localeError:AB()}}var AB=()=>{let $={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function _(v){return $[v]??null}let U={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},Q={nan:"NaN",number:"n\xFAmer",array:"fylki"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Rangt gildi: \xDE\xFA sl\xF3st inn ${z} \xFEar sem \xE1 a\xF0 vera instanceof ${v.expected}`;return`Rangt gildi: \xDE\xFA sl\xF3st inn ${z} \xFEar sem \xE1 a\xF0 vera ${J}`}case"invalid_value":if(v.values.length===1)return`Rangt gildi: gert r\xE1\xF0 fyrir ${N(v.values[0])}`;return`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${v.origin??"gildi"} hafi ${J}${v.maximum.toString()} ${Y.unit??"hluti"}`;return`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${v.origin??"gildi"} s\xE9 ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${v.origin} hafi ${J}${v.minimum.toString()} ${Y.unit}`;return`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${v.origin} s\xE9 ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${J.prefix}"`;if(J.format==="ends_with")return`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${J.suffix}"`;if(J.format==="includes")return`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${J.includes}"`;if(J.format==="regex")return`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${J.pattern}`;return`Rangt ${U[J.format]??v.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${v.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${v.keys.length>1?"ir lyklar":"ur lykill"}: ${D(v.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${v.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${v.origin}`;default:return"Rangt gildi"}}};var $I=b(()=>{l()});function p7(){return{localeError:FB()}}var FB=()=>{let $={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function _(v){return $[v]??null}let U={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},Q={nan:"NaN",number:"numero",array:"vettore"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Input non valido: atteso instanceof ${v.expected}, ricevuto ${z}`;return`Input non valido: atteso ${J}, ricevuto ${z}`}case"invalid_value":if(v.values.length===1)return`Input non valido: atteso ${N(v.values[0])}`;return`Opzione non valida: atteso uno tra ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`Troppo grande: ${v.origin??"valore"} deve avere ${J}${v.maximum.toString()} ${Y.unit??"elementi"}`;return`Troppo grande: ${v.origin??"valore"} deve essere ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`Troppo piccolo: ${v.origin} deve avere ${J}${v.minimum.toString()} ${Y.unit}`;return`Troppo piccolo: ${v.origin} deve essere ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Stringa non valida: deve iniziare con "${J.prefix}"`;if(J.format==="ends_with")return`Stringa non valida: deve terminare con "${J.suffix}"`;if(J.format==="includes")return`Stringa non valida: deve includere "${J.includes}"`;if(J.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${J.pattern}`;return`Invalid ${U[J.format]??v.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${v.divisor}`;case"unrecognized_keys":return`Chiav${v.keys.length>1?"i":"e"} non riconosciut${v.keys.length>1?"e":"a"}: ${D(v.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${v.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${v.origin}`;default:return"Input non valido"}}};var _I=b(()=>{l()});function i7(){return{localeError:OB()}}var OB=()=>{let $={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function _(v){return $[v]??null}let U={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},Q={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\u7121\u52B9\u306A\u5165\u529B: instanceof ${v.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${z}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;return`\u7121\u52B9\u306A\u5165\u529B: ${J}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${z}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":if(v.values.length===1)return`\u7121\u52B9\u306A\u5165\u529B: ${N(v.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`;return`\u7121\u52B9\u306A\u9078\u629E: ${D(v.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let J=v.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",Y=_(v.origin);if(Y)return`\u5927\u304D\u3059\u304E\u308B\u5024: ${v.origin??"\u5024"}\u306F${v.maximum.toString()}${Y.unit??"\u8981\u7D20"}${J}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;return`\u5927\u304D\u3059\u304E\u308B\u5024: ${v.origin??"\u5024"}\u306F${v.maximum.toString()}${J}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let J=v.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",Y=_(v.origin);if(Y)return`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${v.origin}\u306F${v.minimum.toString()}${Y.unit}${J}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;return`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${v.origin}\u306F${v.minimum.toString()}${J}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${J.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;if(J.format==="ends_with")return`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${J.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;if(J.format==="includes")return`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${J.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;if(J.format==="regex")return`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${J.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;return`\u7121\u52B9\u306A${U[J.format]??v.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${v.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${v.keys.length>1?"\u7FA4":""}: ${D(v.keys,"\u3001")}`;case"invalid_key":return`${v.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${v.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};var vI=b(()=>{l()});function n7(){return{localeError:NB()}}var NB=()=>{let $={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function _(v){return $[v]??null}let U={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",json_string:"JSON \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},Q={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${v.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${z}`;return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${J}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${z}`}case"invalid_value":if(v.values.length===1)return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${N(v.values[0])}`;return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${D(v.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${v.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${Y.verb} ${J}${v.maximum.toString()} ${Y.unit}`;return`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${v.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${v.origin} ${Y.verb} ${J}${v.minimum.toString()} ${Y.unit}`;return`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${v.origin} \u10D8\u10E7\u10DD\u10E1 ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${J.prefix}"-\u10D8\u10D7`;if(J.format==="ends_with")return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${J.suffix}"-\u10D8\u10D7`;if(J.format==="includes")return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${J.includes}"-\u10E1`;if(J.format==="regex")return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${J.pattern}`;return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${U[J.format]??v.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${v.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${v.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${D(v.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${v.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${v.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};var UI=b(()=>{l()});function X_(){return{localeError:SB()}}var SB=()=>{let $={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function _(v){return $[v]??null}let U={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},Q={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${v.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${z}`;return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${J} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${z}`}case"invalid_value":if(v.values.length===1)return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${N(v.values[0])}`;return`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${v.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${J} ${v.maximum.toString()} ${Y.unit??"\u1792\u17B6\u178F\u17BB"}`;return`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${v.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${J} ${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${v.origin} ${J} ${v.minimum.toString()} ${Y.unit}`;return`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${v.origin} ${J} ${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${J.prefix}"`;if(J.format==="ends_with")return`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${J.suffix}"`;if(J.format==="includes")return`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${J.includes}"`;if(J.format==="regex")return`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${J.pattern}`;return`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${U[J.format]??v.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${v.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${D(v.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${v.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${v.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};var r7=b(()=>{l()});function o7(){return X_()}var QI=b(()=>{r7()});function t7(){return{localeError:TB()}}var TB=()=>{let $={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function _(v){return $[v]??null}let U={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},Q={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${v.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${z}\uC785\uB2C8\uB2E4`;return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${J}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${z}\uC785\uB2C8\uB2E4`}case"invalid_value":if(v.values.length===1)return`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${N(v.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`;return`\uC798\uBABB\uB41C \uC635\uC158: ${D(v.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let J=v.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",Y=J==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",z=_(v.origin),I=z?.unit??"\uC694\uC18C";if(z)return`${v.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${v.maximum.toString()}${I} ${J}${Y}`;return`${v.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${v.maximum.toString()} ${J}${Y}`}case"too_small":{let J=v.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",Y=J==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",z=_(v.origin),I=z?.unit??"\uC694\uC18C";if(z)return`${v.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${v.minimum.toString()}${I} ${J}${Y}`;return`${v.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${v.minimum.toString()} ${J}${Y}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${J.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`;if(J.format==="ends_with")return`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${J.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`;if(J.format==="includes")return`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${J.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`;if(J.format==="regex")return`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${J.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`;return`\uC798\uBABB\uB41C ${U[J.format]??v.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${v.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${D(v.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${v.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${v.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};var JI=b(()=>{l()});function YI($){let _=Math.abs($),U=_%10,Q=_%100;if(Q>=11&&Q<=19||U===0)return"many";if(U===1)return"one";return"few"}function a7(){return{localeError:RB()}}var q_=($)=>{return $.charAt(0).toUpperCase()+$.slice(1)},RB=()=>{let $={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function _(v,J,Y,z){let I=$[v]??null;if(I===null)return I;return{unit:I.unit[J],verb:I.verb[z][Y?"inclusive":"notInclusive"]}}let U={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},Q={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Gautas tipas ${z}, o tik\u0117tasi - instanceof ${v.expected}`;return`Gautas tipas ${z}, o tik\u0117tasi - ${J}`}case"invalid_value":if(v.values.length===1)return`Privalo b\u016Bti ${N(v.values[0])}`;return`Privalo b\u016Bti vienas i\u0161 ${D(v.values,"|")} pasirinkim\u0173`;case"too_big":{let J=Q[v.origin]??v.origin,Y=_(v.origin,YI(Number(v.maximum)),v.inclusive??!1,"smaller");if(Y?.verb)return`${q_(J??v.origin??"reik\u0161m\u0117")} ${Y.verb} ${v.maximum.toString()} ${Y.unit??"element\u0173"}`;let z=v.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${q_(J??v.origin??"reik\u0161m\u0117")} turi b\u016Bti ${z} ${v.maximum.toString()} ${Y?.unit}`}case"too_small":{let J=Q[v.origin]??v.origin,Y=_(v.origin,YI(Number(v.minimum)),v.inclusive??!1,"bigger");if(Y?.verb)return`${q_(J??v.origin??"reik\u0161m\u0117")} ${Y.verb} ${v.minimum.toString()} ${Y.unit??"element\u0173"}`;let z=v.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${q_(J??v.origin??"reik\u0161m\u0117")} turi b\u016Bti ${z} ${v.minimum.toString()} ${Y?.unit}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Eilut\u0117 privalo prasid\u0117ti "${J.prefix}"`;if(J.format==="ends_with")return`Eilut\u0117 privalo pasibaigti "${J.suffix}"`;if(J.format==="includes")return`Eilut\u0117 privalo \u012Ftraukti "${J.includes}"`;if(J.format==="regex")return`Eilut\u0117 privalo atitikti ${J.pattern}`;return`Neteisingas ${U[J.format]??v.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${v.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${v.keys.length>1?"i":"as"} rakt${v.keys.length>1?"ai":"as"}: ${D(v.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let J=Q[v.origin]??v.origin;return`${q_(J??v.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};var zI=b(()=>{l()});function s7(){return{localeError:EB()}}var EB=()=>{let $={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function _(v){return $[v]??null}let U={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},Q={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${v.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${z}`;return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${J}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${z}`}case"invalid_value":if(v.values.length===1)return`Invalid input: expected ${N(v.values[0])}`;return`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${v.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${J}${v.maximum.toString()} ${Y.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`;return`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${v.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${v.origin} \u0434\u0430 \u0438\u043C\u0430 ${J}${v.minimum.toString()} ${Y.unit}`;return`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${v.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${J.prefix}"`;if(J.format==="ends_with")return`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${J.suffix}"`;if(J.format==="includes")return`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${J.includes}"`;if(J.format==="regex")return`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${J.pattern}`;return`Invalid ${U[J.format]??v.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${v.divisor}`;case"unrecognized_keys":return`${v.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${D(v.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${v.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${v.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};var II=b(()=>{l()});function e7(){return{localeError:PB()}}var PB=()=>{let $={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function _(v){return $[v]??null}let U={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},Q={nan:"NaN",number:"nombor"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Input tidak sah: dijangka instanceof ${v.expected}, diterima ${z}`;return`Input tidak sah: dijangka ${J}, diterima ${z}`}case"invalid_value":if(v.values.length===1)return`Input tidak sah: dijangka ${N(v.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`Terlalu besar: dijangka ${v.origin??"nilai"} ${Y.verb} ${J}${v.maximum.toString()} ${Y.unit??"elemen"}`;return`Terlalu besar: dijangka ${v.origin??"nilai"} adalah ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`Terlalu kecil: dijangka ${v.origin} ${Y.verb} ${J}${v.minimum.toString()} ${Y.unit}`;return`Terlalu kecil: dijangka ${v.origin} adalah ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`String tidak sah: mesti bermula dengan "${J.prefix}"`;if(J.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${J.suffix}"`;if(J.format==="includes")return`String tidak sah: mesti mengandungi "${J.includes}"`;if(J.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${J.pattern}`;return`${U[J.format]??v.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${v.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${D(v.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${v.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${v.origin}`;default:return"Input tidak sah"}}};var XI=b(()=>{l()});function $5(){return{localeError:xB()}}var xB=()=>{let $={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function _(v){return $[v]??null}let U={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},Q={nan:"NaN",number:"getal"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Ongeldige invoer: verwacht instanceof ${v.expected}, ontving ${z}`;return`Ongeldige invoer: verwacht ${J}, ontving ${z}`}case"invalid_value":if(v.values.length===1)return`Ongeldige invoer: verwacht ${N(v.values[0])}`;return`Ongeldige optie: verwacht \xE9\xE9n van ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin),z=v.origin==="date"?"laat":v.origin==="string"?"lang":"groot";if(Y)return`Te ${z}: verwacht dat ${v.origin??"waarde"} ${J}${v.maximum.toString()} ${Y.unit??"elementen"} ${Y.verb}`;return`Te ${z}: verwacht dat ${v.origin??"waarde"} ${J}${v.maximum.toString()} is`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin),z=v.origin==="date"?"vroeg":v.origin==="string"?"kort":"klein";if(Y)return`Te ${z}: verwacht dat ${v.origin} ${J}${v.minimum.toString()} ${Y.unit} ${Y.verb}`;return`Te ${z}: verwacht dat ${v.origin} ${J}${v.minimum.toString()} is`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Ongeldige tekst: moet met "${J.prefix}" beginnen`;if(J.format==="ends_with")return`Ongeldige tekst: moet op "${J.suffix}" eindigen`;if(J.format==="includes")return`Ongeldige tekst: moet "${J.includes}" bevatten`;if(J.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${J.pattern}`;return`Ongeldig: ${U[J.format]??v.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${v.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${v.keys.length>1?"s":""}: ${D(v.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${v.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${v.origin}`;default:return"Ongeldige invoer"}}};var qI=b(()=>{l()});function _5(){return{localeError:uB()}}var uB=()=>{let $={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function _(v){return $[v]??null}let U={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},Q={nan:"NaN",number:"tall",array:"liste"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Ugyldig input: forventet instanceof ${v.expected}, fikk ${z}`;return`Ugyldig input: forventet ${J}, fikk ${z}`}case"invalid_value":if(v.values.length===1)return`Ugyldig verdi: forventet ${N(v.values[0])}`;return`Ugyldig valg: forventet en av ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`For stor(t): forventet ${v.origin??"value"} til \xE5 ha ${J}${v.maximum.toString()} ${Y.unit??"elementer"}`;return`For stor(t): forventet ${v.origin??"value"} til \xE5 ha ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`For lite(n): forventet ${v.origin} til \xE5 ha ${J}${v.minimum.toString()} ${Y.unit}`;return`For lite(n): forventet ${v.origin} til \xE5 ha ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Ugyldig streng: m\xE5 starte med "${J.prefix}"`;if(J.format==="ends_with")return`Ugyldig streng: m\xE5 ende med "${J.suffix}"`;if(J.format==="includes")return`Ugyldig streng: m\xE5 inneholde "${J.includes}"`;if(J.format==="regex")return`Ugyldig streng: m\xE5 matche m\xF8nsteret ${J.pattern}`;return`Ugyldig ${U[J.format]??v.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${v.divisor}`;case"unrecognized_keys":return`${v.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${D(v.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${v.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${v.origin}`;default:return"Ugyldig input"}}};var GI=b(()=>{l()});function v5(){return{localeError:yB()}}var yB=()=>{let $={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function _(v){return $[v]??null}let U={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},Q={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`F\xE2sit giren: umulan instanceof ${v.expected}, al\u0131nan ${z}`;return`F\xE2sit giren: umulan ${J}, al\u0131nan ${z}`}case"invalid_value":if(v.values.length===1)return`F\xE2sit giren: umulan ${N(v.values[0])}`;return`F\xE2sit tercih: m\xFBteberler ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`Fazla b\xFCy\xFCk: ${v.origin??"value"}, ${J}${v.maximum.toString()} ${Y.unit??"elements"} sahip olmal\u0131yd\u0131.`;return`Fazla b\xFCy\xFCk: ${v.origin??"value"}, ${J}${v.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`Fazla k\xFC\xE7\xFCk: ${v.origin}, ${J}${v.minimum.toString()} ${Y.unit} sahip olmal\u0131yd\u0131.`;return`Fazla k\xFC\xE7\xFCk: ${v.origin}, ${J}${v.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`F\xE2sit metin: "${J.prefix}" ile ba\u015Flamal\u0131.`;if(J.format==="ends_with")return`F\xE2sit metin: "${J.suffix}" ile bitmeli.`;if(J.format==="includes")return`F\xE2sit metin: "${J.includes}" ihtiv\xE2 etmeli.`;if(J.format==="regex")return`F\xE2sit metin: ${J.pattern} nak\u015F\u0131na uymal\u0131.`;return`F\xE2sit ${U[J.format]??v.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${v.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${v.keys.length>1?"s":""}: ${D(v.keys,", ")}`;case"invalid_key":return`${v.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${v.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};var jI=b(()=>{l()});function U5(){return{localeError:CB()}}var CB=()=>{let $={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function _(v){return $[v]??null}let U={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},Q={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${v.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${z} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`;return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${J} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${z} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":if(v.values.length===1)return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${N(v.values[0])} \u0648\u0627\u06CC`;return`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${D(v.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${v.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${J}${v.maximum.toString()} ${Y.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`;return`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${v.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${J}${v.maximum.toString()} \u0648\u064A`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${v.origin} \u0628\u0627\u06CC\u062F ${J}${v.minimum.toString()} ${Y.unit} \u0648\u0644\u0631\u064A`;return`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${v.origin} \u0628\u0627\u06CC\u062F ${J}${v.minimum.toString()} \u0648\u064A`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${J.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`;if(J.format==="ends_with")return`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${J.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`;if(J.format==="includes")return`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${J.includes}" \u0648\u0644\u0631\u064A`;if(J.format==="regex")return`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${J.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`;return`${U[J.format]??v.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${v.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${v.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${D(v.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${v.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${v.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};var KI=b(()=>{l()});function Q5(){return{localeError:fB()}}var fB=()=>{let $={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function _(v){return $[v]??null}let U={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},Q={nan:"NaN",number:"liczba",array:"tablica"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${v.expected}, otrzymano ${z}`;return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${J}, otrzymano ${z}`}case"invalid_value":if(v.values.length===1)return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${N(v.values[0])}`;return`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${v.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${J}${v.maximum.toString()} ${Y.unit??"element\xF3w"}`;return`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${v.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${v.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${J}${v.minimum.toString()} ${Y.unit??"element\xF3w"}`;return`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${v.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${J.prefix}"`;if(J.format==="ends_with")return`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${J.suffix}"`;if(J.format==="includes")return`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${J.includes}"`;if(J.format==="regex")return`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${J.pattern}`;return`Nieprawid\u0142ow(y/a/e) ${U[J.format]??v.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${v.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${v.keys.length>1?"s":""}: ${D(v.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${v.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${v.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};var HI=b(()=>{l()});function J5(){return{localeError:mB()}}var mB=()=>{let $={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function _(v){return $[v]??null}let U={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},Q={nan:"NaN",number:"n\xFAmero",null:"nulo"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Tipo inv\xE1lido: esperado instanceof ${v.expected}, recebido ${z}`;return`Tipo inv\xE1lido: esperado ${J}, recebido ${z}`}case"invalid_value":if(v.values.length===1)return`Entrada inv\xE1lida: esperado ${N(v.values[0])}`;return`Op\xE7\xE3o inv\xE1lida: esperada uma das ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`Muito grande: esperado que ${v.origin??"valor"} tivesse ${J}${v.maximum.toString()} ${Y.unit??"elementos"}`;return`Muito grande: esperado que ${v.origin??"valor"} fosse ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`Muito pequeno: esperado que ${v.origin} tivesse ${J}${v.minimum.toString()} ${Y.unit}`;return`Muito pequeno: esperado que ${v.origin} fosse ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Texto inv\xE1lido: deve come\xE7ar com "${J.prefix}"`;if(J.format==="ends_with")return`Texto inv\xE1lido: deve terminar com "${J.suffix}"`;if(J.format==="includes")return`Texto inv\xE1lido: deve incluir "${J.includes}"`;if(J.format==="regex")return`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${J.pattern}`;return`${U[J.format]??v.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${v.divisor}`;case"unrecognized_keys":return`Chave${v.keys.length>1?"s":""} desconhecida${v.keys.length>1?"s":""}: ${D(v.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${v.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${v.origin}`;default:return"Campo inv\xE1lido"}}};var WI=b(()=>{l()});function bI($,_,U,Q){let v=Math.abs($),J=v%10,Y=v%100;if(Y>=11&&Y<=19)return Q;if(J===1)return _;if(J>=2&&J<=4)return U;return Q}function Y5(){return{localeError:gB()}}var gB=()=>{let $={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function _(v){return $[v]??null}let U={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},Q={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${v.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${z}`;return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${J}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${z}`}case"invalid_value":if(v.values.length===1)return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${N(v.values[0])}`;return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y){let z=Number(v.maximum),I=bI(z,Y.unit.one,Y.unit.few,Y.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${v.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${J}${v.maximum.toString()} ${I}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${v.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y){let z=Number(v.minimum),I=bI(z,Y.unit.one,Y.unit.few,Y.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${v.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${J}${v.minimum.toString()} ${I}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${v.origin} \u0431\u0443\u0434\u0435\u0442 ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${J.prefix}"`;if(J.format==="ends_with")return`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${J.suffix}"`;if(J.format==="includes")return`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${J.includes}"`;if(J.format==="regex")return`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${J.pattern}`;return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${U[J.format]??v.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${v.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${v.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${v.keys.length>1?"\u0438":""}: ${D(v.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${v.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${v.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};var BI=b(()=>{l()});function z5(){return{localeError:hB()}}var hB=()=>{let $={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function _(v){return $[v]??null}let U={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},Q={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Neveljaven vnos: pri\u010Dakovano instanceof ${v.expected}, prejeto ${z}`;return`Neveljaven vnos: pri\u010Dakovano ${J}, prejeto ${z}`}case"invalid_value":if(v.values.length===1)return`Neveljaven vnos: pri\u010Dakovano ${N(v.values[0])}`;return`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`Preveliko: pri\u010Dakovano, da bo ${v.origin??"vrednost"} imelo ${J}${v.maximum.toString()} ${Y.unit??"elementov"}`;return`Preveliko: pri\u010Dakovano, da bo ${v.origin??"vrednost"} ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`Premajhno: pri\u010Dakovano, da bo ${v.origin} imelo ${J}${v.minimum.toString()} ${Y.unit}`;return`Premajhno: pri\u010Dakovano, da bo ${v.origin} ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Neveljaven niz: mora se za\u010Deti z "${J.prefix}"`;if(J.format==="ends_with")return`Neveljaven niz: mora se kon\u010Dati z "${J.suffix}"`;if(J.format==="includes")return`Neveljaven niz: mora vsebovati "${J.includes}"`;if(J.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${J.pattern}`;return`Neveljaven ${U[J.format]??v.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${v.divisor}`;case"unrecognized_keys":return`Neprepoznan${v.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${D(v.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${v.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${v.origin}`;default:return"Neveljaven vnos"}}};var ZI=b(()=>{l()});function I5(){return{localeError:cB()}}var cB=()=>{let $={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function _(v){return $[v]??null}let U={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},Q={nan:"NaN",number:"antal",array:"lista"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${v.expected}, fick ${z}`;return`Ogiltig inmatning: f\xF6rv\xE4ntat ${J}, fick ${z}`}case"invalid_value":if(v.values.length===1)return`Ogiltig inmatning: f\xF6rv\xE4ntat ${N(v.values[0])}`;return`Ogiltigt val: f\xF6rv\xE4ntade en av ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`F\xF6r stor(t): f\xF6rv\xE4ntade ${v.origin??"v\xE4rdet"} att ha ${J}${v.maximum.toString()} ${Y.unit??"element"}`;return`F\xF6r stor(t): f\xF6rv\xE4ntat ${v.origin??"v\xE4rdet"} att ha ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`F\xF6r lite(t): f\xF6rv\xE4ntade ${v.origin??"v\xE4rdet"} att ha ${J}${v.minimum.toString()} ${Y.unit}`;return`F\xF6r lite(t): f\xF6rv\xE4ntade ${v.origin??"v\xE4rdet"} att ha ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${J.prefix}"`;if(J.format==="ends_with")return`Ogiltig str\xE4ng: m\xE5ste sluta med "${J.suffix}"`;if(J.format==="includes")return`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${J.includes}"`;if(J.format==="regex")return`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${J.pattern}"`;return`Ogiltig(t) ${U[J.format]??v.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${v.divisor}`;case"unrecognized_keys":return`${v.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${D(v.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${v.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${v.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};var VI=b(()=>{l()});function X5(){return{localeError:lB()}}var lB=()=>{let $={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function _(v){return $[v]??null}let U={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},Q={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${v.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${z}`;return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${J}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${z}`}case"invalid_value":if(v.values.length===1)return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${N(v.values[0])}`;return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${D(v.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${v.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${J}${v.maximum.toString()} ${Y.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;return`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${v.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${J}${v.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${v.origin} ${J}${v.minimum.toString()} ${Y.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;return`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${v.origin} ${J}${v.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${J.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;if(J.format==="ends_with")return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${J.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;if(J.format==="includes")return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${J.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;if(J.format==="regex")return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${J.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${U[J.format]??v.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${v.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${v.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${D(v.keys,", ")}`;case"invalid_key":return`${v.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${v.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};var DI=b(()=>{l()});function q5(){return{localeError:dB()}}var dB=()=>{let $={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function _(v){return $[v]??null}let U={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},Q={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${v.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${z}`;return`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${J} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${z}`}case"invalid_value":if(v.values.length===1)return`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${N(v.values[0])}`;return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",Y=_(v.origin);if(Y)return`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${v.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${J} ${v.maximum.toString()} ${Y.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`;return`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${v.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${J} ${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",Y=_(v.origin);if(Y)return`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${v.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${J} ${v.minimum.toString()} ${Y.unit}`;return`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${v.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${J} ${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${J.prefix}"`;if(J.format==="ends_with")return`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${J.suffix}"`;if(J.format==="includes")return`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${J.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`;if(J.format==="regex")return`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${J.pattern}`;return`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${U[J.format]??v.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${v.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${D(v.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${v.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${v.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};var MI=b(()=>{l()});function G5(){return{localeError:pB()}}var pB=()=>{let $={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function _(v){return $[v]??null}let U={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},Q={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${v.expected}, al\u0131nan ${z}`;return`Ge\xE7ersiz de\u011Fer: beklenen ${J}, al\u0131nan ${z}`}case"invalid_value":if(v.values.length===1)return`Ge\xE7ersiz de\u011Fer: beklenen ${N(v.values[0])}`;return`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`\xC7ok b\xFCy\xFCk: beklenen ${v.origin??"de\u011Fer"} ${J}${v.maximum.toString()} ${Y.unit??"\xF6\u011Fe"}`;return`\xC7ok b\xFCy\xFCk: beklenen ${v.origin??"de\u011Fer"} ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`\xC7ok k\xFC\xE7\xFCk: beklenen ${v.origin} ${J}${v.minimum.toString()} ${Y.unit}`;return`\xC7ok k\xFC\xE7\xFCk: beklenen ${v.origin} ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Ge\xE7ersiz metin: "${J.prefix}" ile ba\u015Flamal\u0131`;if(J.format==="ends_with")return`Ge\xE7ersiz metin: "${J.suffix}" ile bitmeli`;if(J.format==="includes")return`Ge\xE7ersiz metin: "${J.includes}" i\xE7ermeli`;if(J.format==="regex")return`Ge\xE7ersiz metin: ${J.pattern} desenine uymal\u0131`;return`Ge\xE7ersiz ${U[J.format]??v.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${v.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${v.keys.length>1?"lar":""}: ${D(v.keys,", ")}`;case"invalid_key":return`${v.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${v.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};var wI=b(()=>{l()});function G_(){return{localeError:iB()}}var iB=()=>{let $={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function _(v){return $[v]??null}let U={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},Q={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${v.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${z}`;return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${J}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${z}`}case"invalid_value":if(v.values.length===1)return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${N(v.values[0])}`;return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${v.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${Y.verb} ${J}${v.maximum.toString()} ${Y.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`;return`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${v.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${v.origin} ${Y.verb} ${J}${v.minimum.toString()} ${Y.unit}`;return`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${v.origin} \u0431\u0443\u0434\u0435 ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${J.prefix}"`;if(J.format==="ends_with")return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${J.suffix}"`;if(J.format==="includes")return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${J.includes}"`;if(J.format==="regex")return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${J.pattern}`;return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${U[J.format]??v.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${v.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${v.keys.length>1?"\u0456":""}: ${D(v.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${v.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${v.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};var j5=b(()=>{l()});function K5(){return G_()}var LI=b(()=>{j5()});function H5(){return{localeError:nB()}}var nB=()=>{let $={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function _(v){return $[v]??null}let U={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},Q={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${v.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${z} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${J} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${z} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":if(v.values.length===1)return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${N(v.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;return`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${D(v.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`\u0628\u06C1\u062A \u0628\u0691\u0627: ${v.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${J}${v.maximum.toString()} ${Y.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`;return`\u0628\u06C1\u062A \u0628\u0691\u0627: ${v.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${J}${v.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${v.origin} \u06A9\u06D2 ${J}${v.minimum.toString()} ${Y.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`;return`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${v.origin} \u06A9\u0627 ${J}${v.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${J.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;if(J.format==="ends_with")return`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${J.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;if(J.format==="includes")return`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${J.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;if(J.format==="regex")return`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${J.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;return`\u063A\u0644\u0637 ${U[J.format]??v.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${v.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${v.keys.length>1?"\u0632":""}: ${D(v.keys,"\u060C ")}`;case"invalid_key":return`${v.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${v.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};var kI=b(()=>{l()});function W5(){return{localeError:rB()}}var rB=()=>{let $={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"}};function _(v){return $[v]??null}let U={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},Q={nan:"NaN",number:"raqam",array:"massiv"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${v.expected}, qabul qilingan ${z}`;return`Noto\u2018g\u2018ri kirish: kutilgan ${J}, qabul qilingan ${z}`}case"invalid_value":if(v.values.length===1)return`Noto\u2018g\u2018ri kirish: kutilgan ${N(v.values[0])}`;return`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`Juda katta: kutilgan ${v.origin??"qiymat"} ${J}${v.maximum.toString()} ${Y.unit} ${Y.verb}`;return`Juda katta: kutilgan ${v.origin??"qiymat"} ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`Juda kichik: kutilgan ${v.origin} ${J}${v.minimum.toString()} ${Y.unit} ${Y.verb}`;return`Juda kichik: kutilgan ${v.origin} ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Noto\u2018g\u2018ri satr: "${J.prefix}" bilan boshlanishi kerak`;if(J.format==="ends_with")return`Noto\u2018g\u2018ri satr: "${J.suffix}" bilan tugashi kerak`;if(J.format==="includes")return`Noto\u2018g\u2018ri satr: "${J.includes}" ni o\u2018z ichiga olishi kerak`;if(J.format==="regex")return`Noto\u2018g\u2018ri satr: ${J.pattern} shabloniga mos kelishi kerak`;return`Noto\u2018g\u2018ri ${U[J.format]??v.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${v.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${v.keys.length>1?"lar":""}: ${D(v.keys,", ")}`;case"invalid_key":return`${v.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${v.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};var AI=b(()=>{l()});function b5(){return{localeError:oB()}}var oB=()=>{let $={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function _(v){return $[v]??null}let U={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},Q={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${v.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${z}`;return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${J}, nh\u1EADn \u0111\u01B0\u1EE3c ${z}`}case"invalid_value":if(v.values.length===1)return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${N(v.values[0])}`;return`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${v.origin??"gi\xE1 tr\u1ECB"} ${Y.verb} ${J}${v.maximum.toString()} ${Y.unit??"ph\u1EA7n t\u1EED"}`;return`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${v.origin??"gi\xE1 tr\u1ECB"} ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${v.origin} ${Y.verb} ${J}${v.minimum.toString()} ${Y.unit}`;return`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${v.origin} ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${J.prefix}"`;if(J.format==="ends_with")return`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${J.suffix}"`;if(J.format==="includes")return`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${J.includes}"`;if(J.format==="regex")return`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${J.pattern}`;return`${U[J.format]??v.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${v.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${D(v.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${v.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${v.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};var FI=b(()=>{l()});function B5(){return{localeError:tB()}}var tB=()=>{let $={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function _(v){return $[v]??null}let U={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},Q={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${v.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${z}`;return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${J}\uFF0C\u5B9E\u9645\u63A5\u6536 ${z}`}case"invalid_value":if(v.values.length===1)return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${N(v.values[0])}`;return`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${v.origin??"\u503C"} ${J}${v.maximum.toString()} ${Y.unit??"\u4E2A\u5143\u7D20"}`;return`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${v.origin??"\u503C"} ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${v.origin} ${J}${v.minimum.toString()} ${Y.unit}`;return`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${v.origin} ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${J.prefix}" \u5F00\u5934`;if(J.format==="ends_with")return`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${J.suffix}" \u7ED3\u5C3E`;if(J.format==="includes")return`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${J.includes}"`;if(J.format==="regex")return`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${J.pattern}`;return`\u65E0\u6548${U[J.format]??v.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${v.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${D(v.keys,", ")}`;case"invalid_key":return`${v.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${v.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};var OI=b(()=>{l()});function Z5(){return{localeError:aB()}}var aB=()=>{let $={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function _(v){return $[v]??null}let U={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},Q={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${v.expected}\uFF0C\u4F46\u6536\u5230 ${z}`;return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${J}\uFF0C\u4F46\u6536\u5230 ${z}`}case"invalid_value":if(v.values.length===1)return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${N(v.values[0])}`;return`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${v.origin??"\u503C"} \u61C9\u70BA ${J}${v.maximum.toString()} ${Y.unit??"\u500B\u5143\u7D20"}`;return`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${v.origin??"\u503C"} \u61C9\u70BA ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${v.origin} \u61C9\u70BA ${J}${v.minimum.toString()} ${Y.unit}`;return`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${v.origin} \u61C9\u70BA ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${J.prefix}" \u958B\u982D`;if(J.format==="ends_with")return`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${J.suffix}" \u7D50\u5C3E`;if(J.format==="includes")return`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${J.includes}"`;if(J.format==="regex")return`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${J.pattern}`;return`\u7121\u6548\u7684 ${U[J.format]??v.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${v.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${v.keys.length>1?"\u5011":""}\uFF1A${D(v.keys,"\u3001")}`;case"invalid_key":return`${v.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${v.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};var NI=b(()=>{l()});function V5(){return{localeError:sB()}}var sB=()=>{let $={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function _(v){return $[v]??null}let U={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},Q={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${v.expected}, \xE0m\u1ECD\u0300 a r\xED ${z}`;return`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${J}, \xE0m\u1ECD\u0300 a r\xED ${z}`}case"invalid_value":if(v.values.length===1)return`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${N(v.values[0])}`;return`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${v.origin??"iye"} ${Y.verb} ${J}${v.maximum} ${Y.unit}`;return`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${J}${v.maximum}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${v.origin} ${Y.verb} ${J}${v.minimum} ${Y.unit}`;return`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${J}${v.minimum}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${J.prefix}"`;if(J.format==="ends_with")return`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${J.suffix}"`;if(J.format==="includes")return`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${J.includes}"`;if(J.format==="regex")return`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${J.pattern}`;return`A\u1E63\xEC\u1E63e: ${U[J.format]??v.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${v.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${D(v.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${v.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${v.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};var SI=b(()=>{l()});var j_={};s$(j_,{zhTW:()=>Z5,zhCN:()=>B5,yo:()=>V5,vi:()=>b5,uz:()=>W5,ur:()=>H5,uk:()=>G_,ua:()=>K5,tr:()=>G5,th:()=>q5,ta:()=>X5,sv:()=>I5,sl:()=>z5,ru:()=>Y5,pt:()=>J5,ps:()=>U5,pl:()=>Q5,ota:()=>v5,no:()=>_5,nl:()=>$5,ms:()=>e7,mk:()=>s7,lt:()=>a7,ko:()=>t7,km:()=>X_,kh:()=>o7,ka:()=>n7,ja:()=>i7,it:()=>p7,is:()=>d7,id:()=>l7,hy:()=>c7,hu:()=>h7,he:()=>g7,frCA:()=>m7,fr:()=>f7,fi:()=>C7,fa:()=>y7,es:()=>u7,eo:()=>x7,en:()=>I_,de:()=>E7,da:()=>R7,cs:()=>T7,ca:()=>S7,bg:()=>N7,be:()=>O7,az:()=>F7,ar:()=>A7});var D5=b(()=>{xz();uz();Cz();fz();mz();gz();hz();cz();P7();lz();dz();pz();iz();nz();rz();oz();tz();sz();ez();$I();_I();vI();UI();QI();r7();JI();zI();II();XI();qI();GI();jI();KI();HI();WI();BI();ZI();VI();DI();MI();wI();LI();j5();kI();AI();FI();OI();NI();SI()});class L5{constructor(){this._map=new WeakMap,this._idmap=new Map}add($,..._){let U=_[0];if(this._map.set($,U),U&&typeof U==="object"&&"id"in U)this._idmap.set(U.id,$);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove($){let _=this._map.get($);if(_&&typeof _==="object"&&"id"in _)this._idmap.delete(_.id);return this._map.delete($),this}get($){let _=$._zod.parent;if(_){let U={...this.get(_)??{}};delete U.id;let Q={...U,...this._map.get($)};return Object.keys(Q).length?Q:void 0}return this._map.get($)}has($){return this._map.has($)}}function Ev(){return new L5}var TI,M5,w5,e$;var K_=b(()=>{M5=Symbol("ZodOutput"),w5=Symbol("ZodInput");(TI=globalThis).__zod_globalRegistry??(TI.__zod_globalRegistry=Ev());e$=globalThis.__zod_globalRegistry});function k5($,_){return new $({type:"string",...P(_)})}function A5($,_){return new $({type:"string",coerce:!0,...P(_)})}function Pv($,_){return new $({type:"string",format:"email",check:"string_format",abort:!1,...P(_)})}function H_($,_){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...P(_)})}function xv($,_){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...P(_)})}function uv($,_){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...P(_)})}function yv($,_){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...P(_)})}function Cv($,_){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...P(_)})}function W_($,_){return new $({type:"string",format:"url",check:"string_format",abort:!1,...P(_)})}function fv($,_){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...P(_)})}function mv($,_){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...P(_)})}function gv($,_){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...P(_)})}function hv($,_){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...P(_)})}function cv($,_){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...P(_)})}function lv($,_){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...P(_)})}function dv($,_){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...P(_)})}function pv($,_){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...P(_)})}function iv($,_){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...P(_)})}function F5($,_){return new $({type:"string",format:"mac",check:"string_format",abort:!1,...P(_)})}function nv($,_){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...P(_)})}function rv($,_){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...P(_)})}function ov($,_){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...P(_)})}function tv($,_){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...P(_)})}function av($,_){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...P(_)})}function sv($,_){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...P(_)})}function N5($,_){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...P(_)})}function S5($,_){return new $({type:"string",format:"date",check:"string_format",...P(_)})}function T5($,_){return new $({type:"string",format:"time",check:"string_format",precision:null,...P(_)})}function R5($,_){return new $({type:"string",format:"duration",check:"string_format",...P(_)})}function E5($,_){return new $({type:"number",checks:[],...P(_)})}function P5($,_){return new $({type:"number",coerce:!0,checks:[],...P(_)})}function x5($,_){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...P(_)})}function u5($,_){return new $({type:"number",check:"number_format",abort:!1,format:"float32",...P(_)})}function y5($,_){return new $({type:"number",check:"number_format",abort:!1,format:"float64",...P(_)})}function C5($,_){return new $({type:"number",check:"number_format",abort:!1,format:"int32",...P(_)})}function f5($,_){return new $({type:"number",check:"number_format",abort:!1,format:"uint32",...P(_)})}function m5($,_){return new $({type:"boolean",...P(_)})}function g5($,_){return new $({type:"boolean",coerce:!0,...P(_)})}function h5($,_){return new $({type:"bigint",...P(_)})}function c5($,_){return new $({type:"bigint",coerce:!0,...P(_)})}function l5($,_){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...P(_)})}function d5($,_){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...P(_)})}function p5($,_){return new $({type:"symbol",...P(_)})}function i5($,_){return new $({type:"undefined",...P(_)})}function n5($,_){return new $({type:"null",...P(_)})}function r5($){return new $({type:"any"})}function o5($){return new $({type:"unknown"})}function t5($,_){return new $({type:"never",...P(_)})}function a5($,_){return new $({type:"void",...P(_)})}function s5($,_){return new $({type:"date",...P(_)})}function e5($,_){return new $({type:"date",coerce:!0,...P(_)})}function $U($,_){return new $({type:"nan",...P(_)})}function v6($,_){return new Vv({check:"less_than",...P(_),value:$,inclusive:!1})}function L4($,_){return new Vv({check:"less_than",...P(_),value:$,inclusive:!0})}function U6($,_){return new Dv({check:"greater_than",...P(_),value:$,inclusive:!1})}function z4($,_){return new Dv({check:"greater_than",...P(_),value:$,inclusive:!0})}function ev($){return U6(0,$)}function $2($){return v6(0,$)}function _2($){return L4(0,$)}function v2($){return z4(0,$)}function x6($,_){return new r9({check:"multiple_of",...P(_),value:$})}function u6($,_){return new a9({check:"max_size",...P(_),maximum:$})}function Q6($,_){return new s9({check:"min_size",...P(_),minimum:$})}function v1($,_){return new e9({check:"size_equals",...P(_),size:$})}function U1($,_){return new $3({check:"max_length",...P(_),maximum:$})}function W6($,_){return new _3({check:"min_length",...P(_),minimum:$})}function Q1($,_){return new v3({check:"length_equals",...P(_),length:$})}function r1($,_){return new U3({check:"string_format",format:"regex",...P(_),pattern:$})}function o1($){return new Q3({check:"string_format",format:"lowercase",...P($)})}function t1($){return new J3({check:"string_format",format:"uppercase",...P($)})}function a1($,_){return new Y3({check:"string_format",format:"includes",...P(_),includes:$})}function s1($,_){return new z3({check:"string_format",format:"starts_with",...P(_),prefix:$})}function e1($,_){return new I3({check:"string_format",format:"ends_with",...P(_),suffix:$})}function U2($,_,U){return new X3({check:"property",property:$,schema:_,...P(U)})}function $0($,_){return new q3({check:"mime_type",mime:$,...P(_)})}function l4($){return new G3({check:"overwrite",tx:$})}function _0($){return l4((_)=>_.normalize($))}function v0(){return l4(($)=>$.trim())}function U0(){return l4(($)=>$.toLowerCase())}function Q0(){return l4(($)=>$.toUpperCase())}function J0(){return l4(($)=>z9($))}function _U($,_,U){return new $({type:"array",element:_,...P(U)})}function $Z($,_,U){return new $({type:"union",options:_,...P(U)})}function _Z($,_,U){return new $({type:"union",options:_,inclusive:!1,...P(U)})}function vZ($,_,U,Q){return new $({type:"union",options:U,discriminator:_,...P(Q)})}function UZ($,_,U){return new $({type:"intersection",left:_,right:U})}function QZ($,_,U,Q){let v=U instanceof e;return new $({type:"tuple",items:_,rest:v?U:null,...P(v?Q:U)})}function JZ($,_,U,Q){return new $({type:"record",keyType:_,valueType:U,...P(Q)})}function YZ($,_,U,Q){return new $({type:"map",keyType:_,valueType:U,...P(Q)})}function zZ($,_,U){return new $({type:"set",valueType:_,...P(U)})}function IZ($,_,U){let Q=Array.isArray(_)?Object.fromEntries(_.map((v)=>[v,v])):_;return new $({type:"enum",entries:Q,...P(U)})}function XZ($,_,U){return new $({type:"enum",entries:_,...P(U)})}function qZ($,_,U){return new $({type:"literal",values:Array.isArray(_)?_:[_],...P(U)})}function vU($,_){return new $({type:"file",...P(_)})}function GZ($,_){return new $({type:"transform",transform:_})}function jZ($,_){return new $({type:"optional",innerType:_})}function KZ($,_){return new $({type:"nullable",innerType:_})}function HZ($,_,U){return new $({type:"default",innerType:_,get defaultValue(){return typeof U==="function"?U():X9(U)}})}function WZ($,_,U){return new $({type:"nonoptional",innerType:_,...P(U)})}function bZ($,_){return new $({type:"success",innerType:_})}function BZ($,_,U){return new $({type:"catch",innerType:_,catchValue:typeof U==="function"?U:()=>U})}function ZZ($,_,U){return new $({type:"pipe",in:_,out:U})}function VZ($,_){return new $({type:"readonly",innerType:_})}function DZ($,_,U){return new $({type:"template_literal",parts:_,...P(U)})}function MZ($,_){return new $({type:"lazy",getter:_})}function wZ($,_){return new $({type:"promise",innerType:_})}function UU($,_,U){let Q=P(U);return Q.abort??(Q.abort=!0),new $({type:"custom",check:"custom",fn:_,...Q})}function QU($,_,U){return new $({type:"custom",check:"custom",fn:_,...P(U)})}function JU($){let _=RI((U)=>{return U.addIssue=(Q)=>{if(typeof Q==="string")U.issues.push(h1(Q,U.value,_._zod.def));else{let v=Q;if(v.fatal)v.continue=!1;v.code??(v.code="custom"),v.input??(v.input=U.value),v.inst??(v.inst=_),v.continue??(v.continue=!_._zod.def.abort),U.issues.push(h1(v))}},$(U.value,U)});return _}function RI($,_){let U=new T$({check:"custom",...P(_)});return U._zod.check=$,U}function YU($){let _=new T$({check:"describe"});return _._zod.onattach=[(U)=>{let Q=e$.get(U)??{};e$.add(U,{...Q,description:$})}],_._zod.check=()=>{},_}function zU($){let _=new T$({check:"meta"});return _._zod.onattach=[(U)=>{let Q=e$.get(U)??{};e$.add(U,{...Q,...$})}],_._zod.check=()=>{},_}function IU($,_){let U=P(_),Q=U.truthy??["true","1","yes","on","y","enabled"],v=U.falsy??["false","0","no","off","n","disabled"];if(U.case!=="sensitive")Q=Q.map((H)=>typeof H==="string"?H.toLowerCase():H),v=v.map((H)=>typeof H==="string"?H.toLowerCase():H);let J=new Set(Q),Y=new Set(v),z=$.Codec??z_,I=$.Boolean??J_,q=new($.String??_1)({type:"string",error:U.error}),G=new I({type:"boolean",error:U.error}),j=new z({type:"pipe",in:q,out:G,transform:(H,Z)=>{let V=H;if(U.case!=="sensitive")V=V.toLowerCase();if(J.has(V))return!0;else if(Y.has(V))return!1;else return Z.issues.push({code:"invalid_value",expected:"stringbool",values:[...J,...Y],input:Z.value,inst:j,continue:!1}),{}},reverseTransform:(H,Z)=>{if(H===!0)return Q[0]||"true";else return v[0]||"false"},error:U.error});return j}function Y0($,_,U,Q={}){let v=P(Q),J={...P(Q),check:"string_format",type:"string",format:_,fn:typeof U==="function"?U:(z)=>U.test(z),...v};if(U instanceof RegExp)J.pattern=U;return new $(J)}var O5;var EI=b(()=>{Mv();K_();k7();l();O5={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function y6($){let _=$?.target??"draft-2020-12";if(_==="draft-4")_="draft-04";if(_==="draft-7")_="draft-07";return{processors:$.processors??{},metadataRegistry:$?.metadata??e$,target:_,unrepresentable:$?.unrepresentable??"throw",override:$?.override??(()=>{}),io:$?.io??"output",counter:0,seen:new Map,cycles:$?.cycles??"ref",reused:$?.reused??"inline",external:$?.external??void 0}}function M$($,_,U={path:[],schemaPath:[]}){var Q;let v=$._zod.def,J=_.seen.get($);if(J){if(J.count++,U.schemaPath.includes($))J.cycle=U.path;return J.schema}let Y={schema:{},count:1,cycle:void 0,path:U.path};_.seen.set($,Y);let z=$._zod.toJSONSchema?.();if(z)Y.schema=z;else{let q={...U,schemaPath:[...U.schemaPath,$],path:U.path};if($._zod.processJSONSchema)$._zod.processJSONSchema(_,Y.schema,q);else{let j=Y.schema,H=_.processors[v.type];if(!H)throw Error(`[toJSONSchema]: Non-representable type encountered: ${v.type}`);H($,_,j,q)}let G=$._zod.parent;if(G){if(!Y.ref)Y.ref=G;M$(G,_,q),_.seen.get(G).isParent=!0}}let I=_.metadataRegistry.get($);if(I)Object.assign(Y.schema,I);if(_.io==="input"&&I4($))delete Y.schema.examples,delete Y.schema.default;if(_.io==="input"&&Y.schema._prefault)(Q=Y.schema).default??(Q.default=Y.schema._prefault);return delete Y.schema._prefault,_.seen.get($).schema}function C6($,_){let U=$.seen.get(_);if(!U)throw Error("Unprocessed schema. This is a bug in Zod.");let Q=new Map;for(let Y of $.seen.entries()){let z=$.metadataRegistry.get(Y[0])?.id;if(z){let I=Q.get(z);if(I&&I!==Y[0])throw Error(`Duplicate schema id "${z}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);Q.set(z,Y[0])}}let v=(Y)=>{let z=$.target==="draft-2020-12"?"$defs":"definitions";if($.external){let G=$.external.registry.get(Y[0])?.id,j=$.external.uri??((Z)=>Z);if(G)return{ref:j(G)};let H=Y[1].defId??Y[1].schema.id??`schema${$.counter++}`;return Y[1].defId=H,{defId:H,ref:`${j("__shared")}#/${z}/${H}`}}if(Y[1]===U)return{ref:"#"};let X=`${"#"}/${z}/`,q=Y[1].schema.id??`__schema${$.counter++}`;return{defId:q,ref:X+q}},J=(Y)=>{if(Y[1].schema.$ref)return;let z=Y[1],{ref:I,defId:X}=v(Y);if(z.def={...z.schema},X)z.defId=X;let q=z.schema;for(let G in q)delete q[G];q.$ref=I};if($.cycles==="throw")for(let Y of $.seen.entries()){let z=Y[1];if(z.cycle)throw Error(`Cycle detected: #/${z.cycle?.join("/")}/<root>
55
+
56
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let Y of $.seen.entries()){let z=Y[1];if(_===Y[0]){J(Y);continue}if($.external){let X=$.external.registry.get(Y[0])?.id;if(_!==Y[0]&&X){J(Y);continue}}if($.metadataRegistry.get(Y[0])?.id){J(Y);continue}if(z.cycle){J(Y);continue}if(z.count>1){if($.reused==="ref"){J(Y);continue}}}}function f6($,_){let U=$.seen.get(_);if(!U)throw Error("Unprocessed schema. This is a bug in Zod.");let Q=(Y)=>{let z=$.seen.get(Y);if(z.ref===null)return;let I=z.def??z.schema,X={...I},q=z.ref;if(z.ref=null,q){Q(q);let j=$.seen.get(q),H=j.schema;if(H.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))I.allOf=I.allOf??[],I.allOf.push(H);else Object.assign(I,H);if(Object.assign(I,X),Y._zod.parent===q)for(let V in I){if(V==="$ref"||V==="allOf")continue;if(!(V in X))delete I[V]}if(H.$ref&&j.def)for(let V in I){if(V==="$ref"||V==="allOf")continue;if(V in j.def&&JSON.stringify(I[V])===JSON.stringify(j.def[V]))delete I[V]}}let G=Y._zod.parent;if(G&&G!==q){Q(G);let j=$.seen.get(G);if(j?.schema.$ref){if(I.$ref=j.schema.$ref,j.def)for(let H in I){if(H==="$ref"||H==="allOf")continue;if(H in j.def&&JSON.stringify(I[H])===JSON.stringify(j.def[H]))delete I[H]}}}$.override({zodSchema:Y,jsonSchema:I,path:z.path??[]})};for(let Y of[...$.seen.entries()].reverse())Q(Y[0]);let v={};if($.target==="draft-2020-12")v.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")v.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")v.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let Y=$.external.registry.get(_)?.id;if(!Y)throw Error("Schema is missing an `id` property");v.$id=$.external.uri(Y)}Object.assign(v,U.def??U.schema);let J=$.external?.defs??{};for(let Y of $.seen.entries()){let z=Y[1];if(z.def&&z.defId)J[z.defId]=z.def}if($.external);else if(Object.keys(J).length>0)if($.target==="draft-2020-12")v.$defs=J;else v.definitions=J;try{let Y=JSON.parse(JSON.stringify(v));return Object.defineProperty(Y,"~standard",{value:{..._["~standard"],jsonSchema:{input:z0(_,"input",$.processors),output:z0(_,"output",$.processors)}},enumerable:!1,writable:!1}),Y}catch(Y){throw Error("Error converting schema to JSON.")}}function I4($,_){let U=_??{seen:new Set};if(U.seen.has($))return!1;U.seen.add($);let Q=$._zod.def;if(Q.type==="transform")return!0;if(Q.type==="array")return I4(Q.element,U);if(Q.type==="set")return I4(Q.valueType,U);if(Q.type==="lazy")return I4(Q.getter(),U);if(Q.type==="promise"||Q.type==="optional"||Q.type==="nonoptional"||Q.type==="nullable"||Q.type==="readonly"||Q.type==="default"||Q.type==="prefault")return I4(Q.innerType,U);if(Q.type==="intersection")return I4(Q.left,U)||I4(Q.right,U);if(Q.type==="record"||Q.type==="map")return I4(Q.keyType,U)||I4(Q.valueType,U);if(Q.type==="pipe")return I4(Q.in,U)||I4(Q.out,U);if(Q.type==="object"){for(let v in Q.shape)if(I4(Q.shape[v],U))return!0;return!1}if(Q.type==="union"){for(let v of Q.options)if(I4(v,U))return!0;return!1}if(Q.type==="tuple"){for(let v of Q.items)if(I4(v,U))return!0;if(Q.rest&&I4(Q.rest,U))return!0;return!1}return!1}var XU=($,_={})=>(U)=>{let Q=y6({...U,processors:_});return M$($,Q),C6(Q,$),f6(Q,$)},z0=($,_,U={})=>(Q)=>{let{libraryOptions:v,target:J}=Q??{},Y=y6({...v??{},target:J,io:_,processors:U});return M$($,Y),C6(Y,$),f6(Y,$)};var b_=b(()=>{K_()});function z2($,_){if("_idmap"in $){let Q=$,v=y6({..._,processors:Q2}),J={};for(let I of Q._idmap.entries()){let[X,q]=I;M$(q,v)}let Y={},z={registry:Q,uri:_?.uri,defs:J};v.external=z;for(let I of Q._idmap.entries()){let[X,q]=I;C6(v,q),Y[X]=f6(v,q)}if(Object.keys(J).length>0){let I=v.target==="draft-2020-12"?"$defs":"definitions";Y.__shared={[I]:J}}return{schemas:Y}}let U=y6({..._,processors:Q2});return M$($,U),C6(U,$),f6(U,$)}var LZ,qU=($,_,U,Q)=>{let v=U;v.type="string";let{minimum:J,maximum:Y,format:z,patterns:I,contentEncoding:X}=$._zod.bag;if(typeof J==="number")v.minLength=J;if(typeof Y==="number")v.maxLength=Y;if(z){if(v.format=LZ[z]??z,v.format==="")delete v.format;if(z==="time")delete v.format}if(X)v.contentEncoding=X;if(I&&I.size>0){let q=[...I];if(q.length===1)v.pattern=q[0].source;else if(q.length>1)v.allOf=[...q.map((G)=>({..._.target==="draft-07"||_.target==="draft-04"||_.target==="openapi-3.0"?{type:"string"}:{},pattern:G.source}))]}},GU=($,_,U,Q)=>{let v=U,{minimum:J,maximum:Y,format:z,multipleOf:I,exclusiveMaximum:X,exclusiveMinimum:q}=$._zod.bag;if(typeof z==="string"&&z.includes("int"))v.type="integer";else v.type="number";if(typeof q==="number")if(_.target==="draft-04"||_.target==="openapi-3.0")v.minimum=q,v.exclusiveMinimum=!0;else v.exclusiveMinimum=q;if(typeof J==="number"){if(v.minimum=J,typeof q==="number"&&_.target!=="draft-04")if(q>=J)delete v.minimum;else delete v.exclusiveMinimum}if(typeof X==="number")if(_.target==="draft-04"||_.target==="openapi-3.0")v.maximum=X,v.exclusiveMaximum=!0;else v.exclusiveMaximum=X;if(typeof Y==="number"){if(v.maximum=Y,typeof X==="number"&&_.target!=="draft-04")if(X<=Y)delete v.maximum;else delete v.exclusiveMaximum}if(typeof I==="number")v.multipleOf=I},jU=($,_,U,Q)=>{U.type="boolean"},KU=($,_,U,Q)=>{if(_.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},HU=($,_,U,Q)=>{if(_.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},WU=($,_,U,Q)=>{if(_.target==="openapi-3.0")U.type="string",U.nullable=!0,U.enum=[null];else U.type="null"},bU=($,_,U,Q)=>{if(_.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},BU=($,_,U,Q)=>{if(_.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},ZU=($,_,U,Q)=>{U.not={}},VU=($,_,U,Q)=>{},DU=($,_,U,Q)=>{},MU=($,_,U,Q)=>{if(_.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},wU=($,_,U,Q)=>{let v=$._zod.def,J=r0(v.entries);if(J.every((Y)=>typeof Y==="number"))U.type="number";if(J.every((Y)=>typeof Y==="string"))U.type="string";U.enum=J},LU=($,_,U,Q)=>{let v=$._zod.def,J=[];for(let Y of v.values)if(Y===void 0){if(_.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof Y==="bigint")if(_.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else J.push(Number(Y));else J.push(Y);if(J.length===0);else if(J.length===1){let Y=J[0];if(U.type=Y===null?"null":typeof Y,_.target==="draft-04"||_.target==="openapi-3.0")U.enum=[Y];else U.const=Y}else{if(J.every((Y)=>typeof Y==="number"))U.type="number";if(J.every((Y)=>typeof Y==="string"))U.type="string";if(J.every((Y)=>typeof Y==="boolean"))U.type="boolean";if(J.every((Y)=>Y===null))U.type="null";U.enum=J}},kU=($,_,U,Q)=>{if(_.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},AU=($,_,U,Q)=>{let v=U,J=$._zod.pattern;if(!J)throw Error("Pattern not found in template literal");v.type="string",v.pattern=J.source},FU=($,_,U,Q)=>{let v=U,J={type:"string",format:"binary",contentEncoding:"binary"},{minimum:Y,maximum:z,mime:I}=$._zod.bag;if(Y!==void 0)J.minLength=Y;if(z!==void 0)J.maxLength=z;if(I)if(I.length===1)J.contentMediaType=I[0],Object.assign(v,J);else Object.assign(v,J),v.anyOf=I.map((X)=>({contentMediaType:X}));else Object.assign(v,J)},OU=($,_,U,Q)=>{U.type="boolean"},NU=($,_,U,Q)=>{if(_.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},SU=($,_,U,Q)=>{if(_.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},TU=($,_,U,Q)=>{if(_.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},RU=($,_,U,Q)=>{if(_.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},EU=($,_,U,Q)=>{if(_.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},PU=($,_,U,Q)=>{let v=U,J=$._zod.def,{minimum:Y,maximum:z}=$._zod.bag;if(typeof Y==="number")v.minItems=Y;if(typeof z==="number")v.maxItems=z;v.type="array",v.items=M$(J.element,_,{...Q,path:[...Q.path,"items"]})},xU=($,_,U,Q)=>{let v=U,J=$._zod.def;v.type="object",v.properties={};let Y=J.shape;for(let X in Y)v.properties[X]=M$(Y[X],_,{...Q,path:[...Q.path,"properties",X]});let z=new Set(Object.keys(Y)),I=new Set([...z].filter((X)=>{let q=J.shape[X]._zod;if(_.io==="input")return q.optin===void 0;else return q.optout===void 0}));if(I.size>0)v.required=Array.from(I);if(J.catchall?._zod.def.type==="never")v.additionalProperties=!1;else if(!J.catchall){if(_.io==="output")v.additionalProperties=!1}else if(J.catchall)v.additionalProperties=M$(J.catchall,_,{...Q,path:[...Q.path,"additionalProperties"]})},J2=($,_,U,Q)=>{let v=$._zod.def,J=v.inclusive===!1,Y=v.options.map((z,I)=>M$(z,_,{...Q,path:[...Q.path,J?"oneOf":"anyOf",I]}));if(J)U.oneOf=Y;else U.anyOf=Y},uU=($,_,U,Q)=>{let v=$._zod.def,J=M$(v.left,_,{...Q,path:[...Q.path,"allOf",0]}),Y=M$(v.right,_,{...Q,path:[...Q.path,"allOf",1]}),z=(X)=>("allOf"in X)&&Object.keys(X).length===1,I=[...z(J)?J.allOf:[J],...z(Y)?Y.allOf:[Y]];U.allOf=I},yU=($,_,U,Q)=>{let v=U,J=$._zod.def;v.type="array";let Y=_.target==="draft-2020-12"?"prefixItems":"items",z=_.target==="draft-2020-12"?"items":_.target==="openapi-3.0"?"items":"additionalItems",I=J.items.map((j,H)=>M$(j,_,{...Q,path:[...Q.path,Y,H]})),X=J.rest?M$(J.rest,_,{...Q,path:[...Q.path,z,..._.target==="openapi-3.0"?[J.items.length]:[]]}):null;if(_.target==="draft-2020-12"){if(v.prefixItems=I,X)v.items=X}else if(_.target==="openapi-3.0"){if(v.items={anyOf:I},X)v.items.anyOf.push(X);if(v.minItems=I.length,!X)v.maxItems=I.length}else if(v.items=I,X)v.additionalItems=X;let{minimum:q,maximum:G}=$._zod.bag;if(typeof q==="number")v.minItems=q;if(typeof G==="number")v.maxItems=G},CU=($,_,U,Q)=>{let v=U,J=$._zod.def;v.type="object";let Y=J.keyType,I=Y._zod.bag?.patterns;if(J.mode==="loose"&&I&&I.size>0){let q=M$(J.valueType,_,{...Q,path:[...Q.path,"patternProperties","*"]});v.patternProperties={};for(let G of I)v.patternProperties[G.source]=q}else{if(_.target==="draft-07"||_.target==="draft-2020-12")v.propertyNames=M$(J.keyType,_,{...Q,path:[...Q.path,"propertyNames"]});v.additionalProperties=M$(J.valueType,_,{...Q,path:[...Q.path,"additionalProperties"]})}let X=Y._zod.values;if(X){let q=[...X].filter((G)=>typeof G==="string"||typeof G==="number");if(q.length>0)v.required=q}},fU=($,_,U,Q)=>{let v=$._zod.def,J=M$(v.innerType,_,Q),Y=_.seen.get($);if(_.target==="openapi-3.0")Y.ref=v.innerType,U.nullable=!0;else U.anyOf=[J,{type:"null"}]},mU=($,_,U,Q)=>{let v=$._zod.def;M$(v.innerType,_,Q);let J=_.seen.get($);J.ref=v.innerType},gU=($,_,U,Q)=>{let v=$._zod.def;M$(v.innerType,_,Q);let J=_.seen.get($);J.ref=v.innerType,U.default=JSON.parse(JSON.stringify(v.defaultValue))},hU=($,_,U,Q)=>{let v=$._zod.def;M$(v.innerType,_,Q);let J=_.seen.get($);if(J.ref=v.innerType,_.io==="input")U._prefault=JSON.parse(JSON.stringify(v.defaultValue))},cU=($,_,U,Q)=>{let v=$._zod.def;M$(v.innerType,_,Q);let J=_.seen.get($);J.ref=v.innerType;let Y;try{Y=v.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}U.default=Y},lU=($,_,U,Q)=>{let v=$._zod.def,J=_.io==="input"?v.in._zod.def.type==="transform"?v.out:v.in:v.out;M$(J,_,Q);let Y=_.seen.get($);Y.ref=J},dU=($,_,U,Q)=>{let v=$._zod.def;M$(v.innerType,_,Q);let J=_.seen.get($);J.ref=v.innerType,U.readOnly=!0},pU=($,_,U,Q)=>{let v=$._zod.def;M$(v.innerType,_,Q);let J=_.seen.get($);J.ref=v.innerType},Y2=($,_,U,Q)=>{let v=$._zod.def;M$(v.innerType,_,Q);let J=_.seen.get($);J.ref=v.innerType},iU=($,_,U,Q)=>{let v=$._zod.innerType;M$(v,_,Q);let J=_.seen.get($);J.ref=v},Q2;var B_=b(()=>{b_();l();LZ={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Q2={string:qU,number:GU,boolean:jU,bigint:KU,symbol:HU,null:WU,undefined:bU,void:BU,never:ZU,any:VU,unknown:DU,date:MU,enum:wU,literal:LU,nan:kU,template_literal:AU,file:FU,success:OU,custom:NU,function:SU,transform:TU,map:RU,set:EU,array:PU,object:xU,union:J2,intersection:uU,tuple:yU,record:CU,nullable:fU,nonoptional:mU,default:gU,prefault:hU,catch:cU,pipe:lU,readonly:dU,promise:pU,optional:Y2,lazy:iU}});class nU{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter($){this.ctx.counter=$}get seen(){return this.ctx.seen}constructor($){let _=$?.target??"draft-2020-12";if(_==="draft-4")_="draft-04";if(_==="draft-7")_="draft-07";this.ctx=y6({processors:Q2,target:_,...$?.metadata&&{metadata:$.metadata},...$?.unrepresentable&&{unrepresentable:$.unrepresentable},...$?.override&&{override:$.override},...$?.io&&{io:$.io}})}process($,_={path:[],schemaPath:[]}){return M$($,this.ctx,_)}emit($,_){if(_){if(_.cycles)this.ctx.cycles=_.cycles;if(_.reused)this.ctx.reused=_.reused;if(_.external)this.ctx.external=_.external}C6(this.ctx,$);let U=f6(this.ctx,$),{"~standard":Q,...v}=U;return v}}var PI=b(()=>{B_();b_()});var xI={};var uI=()=>{};var b6={};s$(b6,{version:()=>j3,util:()=>E,treeifyError:()=>H9,toJSONSchema:()=>z2,toDotPath:()=>Gz,safeParseAsync:()=>Z9,safeParse:()=>B9,safeEncodeAsync:()=>Tb,safeEncode:()=>Nb,safeDecodeAsync:()=>Rb,safeDecode:()=>Sb,registry:()=>Ev,regexes:()=>E4,process:()=>M$,prettifyError:()=>W9,parseAsync:()=>Iv,parse:()=>zv,meta:()=>zU,locales:()=>j_,isValidJWT:()=>Tz,isValidBase64URL:()=>Sz,isValidBase64:()=>u3,initializeContext:()=>y6,globalRegistry:()=>e$,globalConfig:()=>i0,formatError:()=>__,flattenError:()=>$_,finalize:()=>f6,extractDefs:()=>C6,encodeAsync:()=>Fb,encode:()=>kb,describe:()=>YU,decodeAsync:()=>Ob,decode:()=>Ab,createToJSONSchemaMethod:()=>XU,createStandardJSONSchemaMethod:()=>z0,config:()=>l$,clone:()=>Y4,_xor:()=>_Z,_xid:()=>lv,_void:()=>a5,_uuidv7:()=>Cv,_uuidv6:()=>yv,_uuidv4:()=>uv,_uuid:()=>xv,_url:()=>W_,_uppercase:()=>t1,_unknown:()=>o5,_union:()=>$Z,_undefined:()=>i5,_ulid:()=>cv,_uint64:()=>d5,_uint32:()=>f5,_tuple:()=>QZ,_trim:()=>v0,_transform:()=>GZ,_toUpperCase:()=>Q0,_toLowerCase:()=>U0,_templateLiteral:()=>DZ,_symbol:()=>p5,_superRefine:()=>JU,_success:()=>bZ,_stringbool:()=>IU,_stringFormat:()=>Y0,_string:()=>k5,_startsWith:()=>s1,_slugify:()=>J0,_size:()=>v1,_set:()=>zZ,_safeParseAsync:()=>p1,_safeParse:()=>d1,_safeEncodeAsync:()=>Wv,_safeEncode:()=>Kv,_safeDecodeAsync:()=>bv,_safeDecode:()=>Hv,_regex:()=>r1,_refine:()=>QU,_record:()=>JZ,_readonly:()=>VZ,_property:()=>U2,_promise:()=>wZ,_positive:()=>ev,_pipe:()=>ZZ,_parseAsync:()=>l1,_parse:()=>c1,_overwrite:()=>l4,_optional:()=>jZ,_number:()=>E5,_nullable:()=>KZ,_null:()=>n5,_normalize:()=>_0,_nonpositive:()=>_2,_nonoptional:()=>WZ,_nonnegative:()=>v2,_never:()=>t5,_negative:()=>$2,_nativeEnum:()=>XZ,_nanoid:()=>mv,_nan:()=>$U,_multipleOf:()=>x6,_minSize:()=>Q6,_minLength:()=>W6,_min:()=>z4,_mime:()=>$0,_maxSize:()=>u6,_maxLength:()=>U1,_max:()=>L4,_map:()=>YZ,_mac:()=>F5,_lte:()=>L4,_lt:()=>v6,_lowercase:()=>o1,_literal:()=>qZ,_length:()=>Q1,_lazy:()=>MZ,_ksuid:()=>dv,_jwt:()=>sv,_isoTime:()=>T5,_isoDuration:()=>R5,_isoDateTime:()=>N5,_isoDate:()=>S5,_ipv6:()=>iv,_ipv4:()=>pv,_intersection:()=>UZ,_int64:()=>l5,_int32:()=>C5,_int:()=>x5,_includes:()=>a1,_guid:()=>H_,_gte:()=>z4,_gt:()=>U6,_float64:()=>y5,_float32:()=>u5,_file:()=>vU,_enum:()=>IZ,_endsWith:()=>e1,_encodeAsync:()=>Gv,_encode:()=>Xv,_emoji:()=>fv,_email:()=>Pv,_e164:()=>av,_discriminatedUnion:()=>vZ,_default:()=>HZ,_decodeAsync:()=>jv,_decode:()=>qv,_date:()=>s5,_custom:()=>UU,_cuid2:()=>hv,_cuid:()=>gv,_coercedString:()=>A5,_coercedNumber:()=>P5,_coercedDate:()=>e5,_coercedBoolean:()=>g5,_coercedBigint:()=>c5,_cidrv6:()=>rv,_cidrv4:()=>nv,_check:()=>RI,_catch:()=>BZ,_boolean:()=>m5,_bigint:()=>h5,_base64url:()=>tv,_base64:()=>ov,_array:()=>_U,_any:()=>r5,TimePrecision:()=>O5,NEVER:()=>U9,JSONSchemaGenerator:()=>nU,JSONSchema:()=>xI,Doc:()=>wv,$output:()=>M5,$input:()=>w5,$constructor:()=>B,$brand:()=>Q9,$ZodXor:()=>e3,$ZodXID:()=>k3,$ZodVoid:()=>o3,$ZodUnknown:()=>n3,$ZodUnion:()=>Y_,$ZodUndefined:()=>d3,$ZodUUID:()=>b3,$ZodURL:()=>Z3,$ZodULID:()=>L3,$ZodType:()=>e,$ZodTuple:()=>Tv,$ZodTransform:()=>I7,$ZodTemplateLiteral:()=>V7,$ZodSymbol:()=>l3,$ZodSuccess:()=>H7,$ZodStringFormat:()=>A$,$ZodString:()=>_1,$ZodSet:()=>Q7,$ZodRegistry:()=>L5,$ZodRecord:()=>v7,$ZodRealError:()=>W4,$ZodReadonly:()=>Z7,$ZodPromise:()=>M7,$ZodPrefault:()=>j7,$ZodPipe:()=>B7,$ZodOptional:()=>Rv,$ZodObjectJIT:()=>s3,$ZodObject:()=>Pz,$ZodNumberFormat:()=>h3,$ZodNumber:()=>Nv,$ZodNullable:()=>q7,$ZodNull:()=>p3,$ZodNonOptional:()=>K7,$ZodNever:()=>r3,$ZodNanoID:()=>D3,$ZodNaN:()=>b7,$ZodMap:()=>U7,$ZodMAC:()=>E3,$ZodLiteral:()=>Y7,$ZodLazy:()=>w7,$ZodKSUID:()=>A3,$ZodJWT:()=>m3,$ZodIntersection:()=>_7,$ZodISOTime:()=>N3,$ZodISODuration:()=>S3,$ZodISODateTime:()=>F3,$ZodISODate:()=>O3,$ZodIPv6:()=>R3,$ZodIPv4:()=>T3,$ZodGUID:()=>W3,$ZodFunction:()=>D7,$ZodFile:()=>z7,$ZodExactOptional:()=>X7,$ZodError:()=>e0,$ZodEnum:()=>J7,$ZodEncodeError:()=>s6,$ZodEmoji:()=>V3,$ZodEmail:()=>B3,$ZodE164:()=>f3,$ZodDiscriminatedUnion:()=>$7,$ZodDefault:()=>G7,$ZodDate:()=>t3,$ZodCustomStringFormat:()=>g3,$ZodCustom:()=>L7,$ZodCodec:()=>z_,$ZodCheckUpperCase:()=>J3,$ZodCheckStringFormat:()=>i1,$ZodCheckStartsWith:()=>z3,$ZodCheckSizeEquals:()=>e9,$ZodCheckRegex:()=>U3,$ZodCheckProperty:()=>X3,$ZodCheckOverwrite:()=>G3,$ZodCheckNumberFormat:()=>o9,$ZodCheckMultipleOf:()=>r9,$ZodCheckMinSize:()=>s9,$ZodCheckMinLength:()=>_3,$ZodCheckMimeType:()=>q3,$ZodCheckMaxSize:()=>a9,$ZodCheckMaxLength:()=>$3,$ZodCheckLowerCase:()=>Q3,$ZodCheckLessThan:()=>Vv,$ZodCheckLengthEquals:()=>v3,$ZodCheckIncludes:()=>Y3,$ZodCheckGreaterThan:()=>Dv,$ZodCheckEndsWith:()=>I3,$ZodCheckBigIntFormat:()=>t9,$ZodCheck:()=>T$,$ZodCatch:()=>W7,$ZodCUID2:()=>w3,$ZodCUID:()=>M3,$ZodCIDRv6:()=>x3,$ZodCIDRv4:()=>P3,$ZodBoolean:()=>J_,$ZodBigIntFormat:()=>c3,$ZodBigInt:()=>Sv,$ZodBase64URL:()=>C3,$ZodBase64:()=>y3,$ZodAsyncError:()=>_6,$ZodArray:()=>a3,$ZodAny:()=>i3});var k4=b(()=>{l();Zv();D5();B_();PI();uI();f1();V9();b9();k7();Mv();K3();K_();EI();b_()});var I2={};s$(I2,{uppercase:()=>t1,trim:()=>v0,toUpperCase:()=>Q0,toLowerCase:()=>U0,startsWith:()=>s1,slugify:()=>J0,size:()=>v1,regex:()=>r1,property:()=>U2,positive:()=>ev,overwrite:()=>l4,normalize:()=>_0,nonpositive:()=>_2,nonnegative:()=>v2,negative:()=>$2,multipleOf:()=>x6,minSize:()=>Q6,minLength:()=>W6,mime:()=>$0,maxSize:()=>u6,maxLength:()=>U1,lte:()=>L4,lt:()=>v6,lowercase:()=>o1,length:()=>Q1,includes:()=>a1,gte:()=>z4,gt:()=>U6,endsWith:()=>e1});var X2=b(()=>{k4()});var I0={};s$(I0,{time:()=>tU,duration:()=>aU,datetime:()=>rU,date:()=>oU,ZodISOTime:()=>j2,ZodISODuration:()=>K2,ZodISODateTime:()=>q2,ZodISODate:()=>G2});function rU($){return N5(q2,$)}function oU($){return S5(G2,$)}function tU($){return T5(j2,$)}function aU($){return R5(K2,$)}var q2,G2,j2,K2;var Z_=b(()=>{k4();D_();q2=B("ZodISODateTime",($,_)=>{F3.init($,_),F$.init($,_)});G2=B("ZodISODate",($,_)=>{O3.init($,_),F$.init($,_)});j2=B("ZodISOTime",($,_)=>{N3.init($,_),F$.init($,_)});K2=B("ZodISODuration",($,_)=>{S3.init($,_),F$.init($,_)})});var yI=($,_)=>{e0.init($,_),$.name="ZodError",Object.defineProperties($,{format:{value:(U)=>__($,U)},flatten:{value:(U)=>$_($,U)},addIssue:{value:(U)=>{$.issues.push(U),$.message=JSON.stringify($.issues,m1,2)}},addIssues:{value:(U)=>{$.issues.push(...U),$.message=JSON.stringify($.issues,m1,2)}},isEmpty:{get(){return $.issues.length===0}}})},H2,b4;var sU=b(()=>{k4();k4();l();H2=B("ZodError",yI),b4=B("ZodError",yI,{Parent:Error})});var eU,$Q,_Q,vQ,UQ,QQ,JQ,YQ,zQ,IQ,XQ,qQ;var GQ=b(()=>{k4();sU();eU=c1(b4),$Q=l1(b4),_Q=d1(b4),vQ=p1(b4),UQ=Xv(b4),QQ=qv(b4),JQ=Gv(b4),YQ=jv(b4),zQ=Kv(b4),IQ=Hv(b4),XQ=Wv(b4),qQ=bv(b4)});var V_={};s$(V_,{xor:()=>OX,xid:()=>tI,void:()=>MX,uuidv7:()=>cI,uuidv6:()=>hI,uuidv4:()=>gI,uuid:()=>mI,url:()=>lI,unknown:()=>J1,union:()=>y2,undefined:()=>VX,ulid:()=>oI,uint64:()=>BX,uint32:()=>HX,tuple:()=>SQ,transform:()=>f2,templateLiteral:()=>gX,symbol:()=>ZX,superRefine:()=>vJ,success:()=>CX,stringbool:()=>rX,stringFormat:()=>zX,string:()=>W2,strictObject:()=>AX,set:()=>EX,refine:()=>_J,record:()=>TQ,readonly:()=>oQ,promise:()=>hX,preprocess:()=>tX,prefault:()=>cQ,pipe:()=>k_,partialRecord:()=>SX,optional:()=>w_,object:()=>kX,number:()=>KQ,nullish:()=>yX,nullable:()=>L_,null:()=>ZQ,nonoptional:()=>lQ,never:()=>u2,nativeEnum:()=>PX,nanoid:()=>iI,nan:()=>fX,meta:()=>iX,map:()=>RX,mac:()=>eI,looseRecord:()=>TX,looseObject:()=>FX,literal:()=>xX,lazy:()=>sQ,ksuid:()=>aI,keyof:()=>LX,jwt:()=>YX,json:()=>oX,ipv6:()=>$X,ipv4:()=>sI,intersection:()=>OQ,int64:()=>bX,int32:()=>KX,int:()=>b2,instanceof:()=>nX,httpUrl:()=>dI,hostname:()=>IX,hex:()=>XX,hash:()=>qX,guid:()=>fI,function:()=>cX,float64:()=>jX,float32:()=>GX,file:()=>uX,exactOptional:()=>CQ,enum:()=>C2,emoji:()=>pI,email:()=>CI,e164:()=>JX,discriminatedUnion:()=>NX,describe:()=>pX,date:()=>wX,custom:()=>dX,cuid2:()=>rI,cuid:()=>nI,codec:()=>mX,cidrv6:()=>vX,cidrv4:()=>_X,check:()=>lX,catch:()=>iQ,boolean:()=>HQ,bigint:()=>WX,base64url:()=>QX,base64:()=>UX,array:()=>O_,any:()=>DX,_function:()=>cX,_default:()=>gQ,_ZodString:()=>B2,ZodXor:()=>kQ,ZodXID:()=>k2,ZodVoid:()=>wQ,ZodUnknown:()=>DQ,ZodUnion:()=>S_,ZodUndefined:()=>bQ,ZodUUID:()=>J6,ZodURL:()=>A_,ZodULID:()=>L2,ZodType:()=>U$,ZodTuple:()=>NQ,ZodTransform:()=>uQ,ZodTemplateLiteral:()=>tQ,ZodSymbol:()=>WQ,ZodSuccess:()=>dQ,ZodStringFormat:()=>F$,ZodString:()=>q0,ZodSet:()=>EQ,ZodRecord:()=>T_,ZodReadonly:()=>rQ,ZodPromise:()=>eQ,ZodPrefault:()=>hQ,ZodPipe:()=>h2,ZodOptional:()=>m2,ZodObject:()=>N_,ZodNumberFormat:()=>Y1,ZodNumber:()=>j0,ZodNullable:()=>fQ,ZodNull:()=>BQ,ZodNonOptional:()=>g2,ZodNever:()=>MQ,ZodNanoID:()=>D2,ZodNaN:()=>nQ,ZodMap:()=>RQ,ZodMAC:()=>jQ,ZodLiteral:()=>PQ,ZodLazy:()=>aQ,ZodKSUID:()=>A2,ZodJWT:()=>P2,ZodIntersection:()=>FQ,ZodIPv6:()=>O2,ZodIPv4:()=>F2,ZodGUID:()=>M_,ZodFunction:()=>$J,ZodFile:()=>xQ,ZodExactOptional:()=>yQ,ZodEnum:()=>X0,ZodEmoji:()=>V2,ZodEmail:()=>Z2,ZodE164:()=>E2,ZodDiscriminatedUnion:()=>AQ,ZodDefault:()=>mQ,ZodDate:()=>F_,ZodCustomStringFormat:()=>G0,ZodCustom:()=>R_,ZodCodec:()=>c2,ZodCatch:()=>pQ,ZodCUID2:()=>w2,ZodCUID:()=>M2,ZodCIDRv6:()=>S2,ZodCIDRv4:()=>N2,ZodBoolean:()=>K0,ZodBigIntFormat:()=>x2,ZodBigInt:()=>H0,ZodBase64URL:()=>R2,ZodBase64:()=>T2,ZodArray:()=>LQ,ZodAny:()=>VQ});function W2($){return k5(q0,$)}function CI($){return Pv(Z2,$)}function fI($){return H_(M_,$)}function mI($){return xv(J6,$)}function gI($){return uv(J6,$)}function hI($){return yv(J6,$)}function cI($){return Cv(J6,$)}function lI($){return W_(A_,$)}function dI($){return W_(A_,{protocol:/^https?$/,hostname:E4.domain,...E.normalizeParams($)})}function pI($){return fv(V2,$)}function iI($){return mv(D2,$)}function nI($){return gv(M2,$)}function rI($){return hv(w2,$)}function oI($){return cv(L2,$)}function tI($){return lv(k2,$)}function aI($){return dv(A2,$)}function sI($){return pv(F2,$)}function eI($){return F5(jQ,$)}function $X($){return iv(O2,$)}function _X($){return nv(N2,$)}function vX($){return rv(S2,$)}function UX($){return ov(T2,$)}function QX($){return tv(R2,$)}function JX($){return av(E2,$)}function YX($){return sv(P2,$)}function zX($,_,U={}){return Y0(G0,$,_,U)}function IX($){return Y0(G0,"hostname",E4.hostname,$)}function XX($){return Y0(G0,"hex",E4.hex,$)}function qX($,_){let U=_?.enc??"hex",Q=`${$}_${U}`,v=E4[Q];if(!v)throw Error(`Unrecognized hash format: ${Q}`);return Y0(G0,Q,v,_)}function KQ($){return E5(j0,$)}function b2($){return x5(Y1,$)}function GX($){return u5(Y1,$)}function jX($){return y5(Y1,$)}function KX($){return C5(Y1,$)}function HX($){return f5(Y1,$)}function HQ($){return m5(K0,$)}function WX($){return h5(H0,$)}function bX($){return l5(x2,$)}function BX($){return d5(x2,$)}function ZX($){return p5(WQ,$)}function VX($){return i5(bQ,$)}function ZQ($){return n5(BQ,$)}function DX(){return r5(VQ)}function J1(){return o5(DQ)}function u2($){return t5(MQ,$)}function MX($){return a5(wQ,$)}function wX($){return s5(F_,$)}function O_($,_){return _U(LQ,$,_)}function LX($){let _=$._zod.def.shape;return C2(Object.keys(_))}function kX($,_){let U={type:"object",shape:$??{},...E.normalizeParams(_)};return new N_(U)}function AX($,_){return new N_({type:"object",shape:$,catchall:u2(),...E.normalizeParams(_)})}function FX($,_){return new N_({type:"object",shape:$,catchall:J1(),...E.normalizeParams(_)})}function y2($,_){return new S_({type:"union",options:$,...E.normalizeParams(_)})}function OX($,_){return new kQ({type:"union",options:$,inclusive:!1,...E.normalizeParams(_)})}function NX($,_,U){return new AQ({type:"union",options:_,discriminator:$,...E.normalizeParams(U)})}function OQ($,_){return new FQ({type:"intersection",left:$,right:_})}function SQ($,_,U){let Q=_ instanceof e,v=Q?U:_;return new NQ({type:"tuple",items:$,rest:Q?_:null,...E.normalizeParams(v)})}function TQ($,_,U){return new T_({type:"record",keyType:$,valueType:_,...E.normalizeParams(U)})}function SX($,_,U){let Q=Y4($);return Q._zod.values=void 0,new T_({type:"record",keyType:Q,valueType:_,...E.normalizeParams(U)})}function TX($,_,U){return new T_({type:"record",keyType:$,valueType:_,mode:"loose",...E.normalizeParams(U)})}function RX($,_,U){return new RQ({type:"map",keyType:$,valueType:_,...E.normalizeParams(U)})}function EX($,_){return new EQ({type:"set",valueType:$,...E.normalizeParams(_)})}function C2($,_){let U=Array.isArray($)?Object.fromEntries($.map((Q)=>[Q,Q])):$;return new X0({type:"enum",entries:U,...E.normalizeParams(_)})}function PX($,_){return new X0({type:"enum",entries:$,...E.normalizeParams(_)})}function xX($,_){return new PQ({type:"literal",values:Array.isArray($)?$:[$],...E.normalizeParams(_)})}function uX($){return vU(xQ,$)}function f2($){return new uQ({type:"transform",transform:$})}function w_($){return new m2({type:"optional",innerType:$})}function CQ($){return new yQ({type:"optional",innerType:$})}function L_($){return new fQ({type:"nullable",innerType:$})}function yX($){return w_(L_($))}function gQ($,_){return new mQ({type:"default",innerType:$,get defaultValue(){return typeof _==="function"?_():E.shallowClone(_)}})}function cQ($,_){return new hQ({type:"prefault",innerType:$,get defaultValue(){return typeof _==="function"?_():E.shallowClone(_)}})}function lQ($,_){return new g2({type:"nonoptional",innerType:$,...E.normalizeParams(_)})}function CX($){return new dQ({type:"success",innerType:$})}function iQ($,_){return new pQ({type:"catch",innerType:$,catchValue:typeof _==="function"?_:()=>_})}function fX($){return $U(nQ,$)}function k_($,_){return new h2({type:"pipe",in:$,out:_})}function mX($,_,U){return new c2({type:"pipe",in:$,out:_,transform:U.decode,reverseTransform:U.encode})}function oQ($){return new rQ({type:"readonly",innerType:$})}function gX($,_){return new tQ({type:"template_literal",parts:$,...E.normalizeParams(_)})}function sQ($){return new aQ({type:"lazy",getter:$})}function hX($){return new eQ({type:"promise",innerType:$})}function cX($){return new $J({type:"function",input:Array.isArray($?.input)?SQ($?.input):$?.input??O_(J1()),output:$?.output??J1()})}function lX($){let _=new T$({check:"custom"});return _._zod.check=$,_}function dX($,_){return UU(R_,$??(()=>!0),_)}function _J($,_={}){return QU(R_,$,_)}function vJ($){return JU($)}function nX($,_={}){let U=new R_({type:"custom",check:"custom",fn:(Q)=>Q instanceof $,abort:!0,...E.normalizeParams(_)});return U._zod.bag.Class=$,U._zod.check=(Q)=>{if(!(Q.value instanceof $))Q.issues.push({code:"invalid_type",expected:$.name,input:Q.value,inst:U,path:[...U._zod.def.path??[]]})},U}function oX($){let _=sQ(()=>{return y2([W2($),KQ(),HQ(),ZQ(),O_(_),TQ(W2(),_)])});return _}function tX($,_){return k_(f2($),_)}var U$,B2,q0,F$,Z2,M_,J6,A_,V2,D2,M2,w2,L2,k2,A2,F2,jQ,O2,N2,S2,T2,R2,E2,P2,G0,j0,Y1,K0,H0,x2,WQ,bQ,BQ,VQ,DQ,MQ,wQ,F_,LQ,N_,S_,kQ,AQ,FQ,NQ,T_,RQ,EQ,X0,PQ,xQ,uQ,m2,yQ,fQ,mQ,hQ,g2,dQ,pQ,nQ,h2,c2,rQ,tQ,aQ,eQ,$J,R_,pX,iX,rX=(...$)=>IU({Codec:c2,Boolean:K0,String:q0},...$);var D_=b(()=>{k4();k4();B_();b_();X2();Z_();GQ();U$=B("ZodType",($,_)=>{return e.init($,_),Object.assign($["~standard"],{jsonSchema:{input:z0($,"input"),output:z0($,"output")}}),$.toJSONSchema=XU($,{}),$.def=_,$.type=_.type,Object.defineProperty($,"_def",{value:_}),$.check=(...U)=>{return $.clone(E.mergeDefs(_,{checks:[..._.checks??[],...U.map((Q)=>typeof Q==="function"?{_zod:{check:Q,def:{check:"custom"},onattach:[]}}:Q)]}),{parent:!0})},$.with=$.check,$.clone=(U,Q)=>Y4($,U,Q),$.brand=()=>$,$.register=(U,Q)=>{return U.add($,Q),$},$.parse=(U,Q)=>eU($,U,Q,{callee:$.parse}),$.safeParse=(U,Q)=>_Q($,U,Q),$.parseAsync=async(U,Q)=>$Q($,U,Q,{callee:$.parseAsync}),$.safeParseAsync=async(U,Q)=>vQ($,U,Q),$.spa=$.safeParseAsync,$.encode=(U,Q)=>UQ($,U,Q),$.decode=(U,Q)=>QQ($,U,Q),$.encodeAsync=async(U,Q)=>JQ($,U,Q),$.decodeAsync=async(U,Q)=>YQ($,U,Q),$.safeEncode=(U,Q)=>zQ($,U,Q),$.safeDecode=(U,Q)=>IQ($,U,Q),$.safeEncodeAsync=async(U,Q)=>XQ($,U,Q),$.safeDecodeAsync=async(U,Q)=>qQ($,U,Q),$.refine=(U,Q)=>$.check(_J(U,Q)),$.superRefine=(U)=>$.check(vJ(U)),$.overwrite=(U)=>$.check(l4(U)),$.optional=()=>w_($),$.exactOptional=()=>CQ($),$.nullable=()=>L_($),$.nullish=()=>w_(L_($)),$.nonoptional=(U)=>lQ($,U),$.array=()=>O_($),$.or=(U)=>y2([$,U]),$.and=(U)=>OQ($,U),$.transform=(U)=>k_($,f2(U)),$.default=(U)=>gQ($,U),$.prefault=(U)=>cQ($,U),$.catch=(U)=>iQ($,U),$.pipe=(U)=>k_($,U),$.readonly=()=>oQ($),$.describe=(U)=>{let Q=$.clone();return e$.add(Q,{description:U}),Q},Object.defineProperty($,"description",{get(){return e$.get($)?.description},configurable:!0}),$.meta=(...U)=>{if(U.length===0)return e$.get($);let Q=$.clone();return e$.add(Q,U[0]),Q},$.isOptional=()=>$.safeParse(void 0).success,$.isNullable=()=>$.safeParse(null).success,$.apply=(U)=>U($),$}),B2=B("_ZodString",($,_)=>{_1.init($,_),U$.init($,_),$._zod.processJSONSchema=(Q,v,J)=>qU($,Q,v,J);let U=$._zod.bag;$.format=U.format??null,$.minLength=U.minimum??null,$.maxLength=U.maximum??null,$.regex=(...Q)=>$.check(r1(...Q)),$.includes=(...Q)=>$.check(a1(...Q)),$.startsWith=(...Q)=>$.check(s1(...Q)),$.endsWith=(...Q)=>$.check(e1(...Q)),$.min=(...Q)=>$.check(W6(...Q)),$.max=(...Q)=>$.check(U1(...Q)),$.length=(...Q)=>$.check(Q1(...Q)),$.nonempty=(...Q)=>$.check(W6(1,...Q)),$.lowercase=(Q)=>$.check(o1(Q)),$.uppercase=(Q)=>$.check(t1(Q)),$.trim=()=>$.check(v0()),$.normalize=(...Q)=>$.check(_0(...Q)),$.toLowerCase=()=>$.check(U0()),$.toUpperCase=()=>$.check(Q0()),$.slugify=()=>$.check(J0())}),q0=B("ZodString",($,_)=>{_1.init($,_),B2.init($,_),$.email=(U)=>$.check(Pv(Z2,U)),$.url=(U)=>$.check(W_(A_,U)),$.jwt=(U)=>$.check(sv(P2,U)),$.emoji=(U)=>$.check(fv(V2,U)),$.guid=(U)=>$.check(H_(M_,U)),$.uuid=(U)=>$.check(xv(J6,U)),$.uuidv4=(U)=>$.check(uv(J6,U)),$.uuidv6=(U)=>$.check(yv(J6,U)),$.uuidv7=(U)=>$.check(Cv(J6,U)),$.nanoid=(U)=>$.check(mv(D2,U)),$.guid=(U)=>$.check(H_(M_,U)),$.cuid=(U)=>$.check(gv(M2,U)),$.cuid2=(U)=>$.check(hv(w2,U)),$.ulid=(U)=>$.check(cv(L2,U)),$.base64=(U)=>$.check(ov(T2,U)),$.base64url=(U)=>$.check(tv(R2,U)),$.xid=(U)=>$.check(lv(k2,U)),$.ksuid=(U)=>$.check(dv(A2,U)),$.ipv4=(U)=>$.check(pv(F2,U)),$.ipv6=(U)=>$.check(iv(O2,U)),$.cidrv4=(U)=>$.check(nv(N2,U)),$.cidrv6=(U)=>$.check(rv(S2,U)),$.e164=(U)=>$.check(av(E2,U)),$.datetime=(U)=>$.check(rU(U)),$.date=(U)=>$.check(oU(U)),$.time=(U)=>$.check(tU(U)),$.duration=(U)=>$.check(aU(U))});F$=B("ZodStringFormat",($,_)=>{A$.init($,_),B2.init($,_)}),Z2=B("ZodEmail",($,_)=>{B3.init($,_),F$.init($,_)});M_=B("ZodGUID",($,_)=>{W3.init($,_),F$.init($,_)});J6=B("ZodUUID",($,_)=>{b3.init($,_),F$.init($,_)});A_=B("ZodURL",($,_)=>{Z3.init($,_),F$.init($,_)});V2=B("ZodEmoji",($,_)=>{V3.init($,_),F$.init($,_)});D2=B("ZodNanoID",($,_)=>{D3.init($,_),F$.init($,_)});M2=B("ZodCUID",($,_)=>{M3.init($,_),F$.init($,_)});w2=B("ZodCUID2",($,_)=>{w3.init($,_),F$.init($,_)});L2=B("ZodULID",($,_)=>{L3.init($,_),F$.init($,_)});k2=B("ZodXID",($,_)=>{k3.init($,_),F$.init($,_)});A2=B("ZodKSUID",($,_)=>{A3.init($,_),F$.init($,_)});F2=B("ZodIPv4",($,_)=>{T3.init($,_),F$.init($,_)});jQ=B("ZodMAC",($,_)=>{E3.init($,_),F$.init($,_)});O2=B("ZodIPv6",($,_)=>{R3.init($,_),F$.init($,_)});N2=B("ZodCIDRv4",($,_)=>{P3.init($,_),F$.init($,_)});S2=B("ZodCIDRv6",($,_)=>{x3.init($,_),F$.init($,_)});T2=B("ZodBase64",($,_)=>{y3.init($,_),F$.init($,_)});R2=B("ZodBase64URL",($,_)=>{C3.init($,_),F$.init($,_)});E2=B("ZodE164",($,_)=>{f3.init($,_),F$.init($,_)});P2=B("ZodJWT",($,_)=>{m3.init($,_),F$.init($,_)});G0=B("ZodCustomStringFormat",($,_)=>{g3.init($,_),F$.init($,_)});j0=B("ZodNumber",($,_)=>{Nv.init($,_),U$.init($,_),$._zod.processJSONSchema=(Q,v,J)=>GU($,Q,v,J),$.gt=(Q,v)=>$.check(U6(Q,v)),$.gte=(Q,v)=>$.check(z4(Q,v)),$.min=(Q,v)=>$.check(z4(Q,v)),$.lt=(Q,v)=>$.check(v6(Q,v)),$.lte=(Q,v)=>$.check(L4(Q,v)),$.max=(Q,v)=>$.check(L4(Q,v)),$.int=(Q)=>$.check(b2(Q)),$.safe=(Q)=>$.check(b2(Q)),$.positive=(Q)=>$.check(U6(0,Q)),$.nonnegative=(Q)=>$.check(z4(0,Q)),$.negative=(Q)=>$.check(v6(0,Q)),$.nonpositive=(Q)=>$.check(L4(0,Q)),$.multipleOf=(Q,v)=>$.check(x6(Q,v)),$.step=(Q,v)=>$.check(x6(Q,v)),$.finite=()=>$;let U=$._zod.bag;$.minValue=Math.max(U.minimum??Number.NEGATIVE_INFINITY,U.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,$.maxValue=Math.min(U.maximum??Number.POSITIVE_INFINITY,U.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,$.isInt=(U.format??"").includes("int")||Number.isSafeInteger(U.multipleOf??0.5),$.isFinite=!0,$.format=U.format??null});Y1=B("ZodNumberFormat",($,_)=>{h3.init($,_),j0.init($,_)});K0=B("ZodBoolean",($,_)=>{J_.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>jU($,U,Q,v)});H0=B("ZodBigInt",($,_)=>{Sv.init($,_),U$.init($,_),$._zod.processJSONSchema=(Q,v,J)=>KU($,Q,v,J),$.gte=(Q,v)=>$.check(z4(Q,v)),$.min=(Q,v)=>$.check(z4(Q,v)),$.gt=(Q,v)=>$.check(U6(Q,v)),$.gte=(Q,v)=>$.check(z4(Q,v)),$.min=(Q,v)=>$.check(z4(Q,v)),$.lt=(Q,v)=>$.check(v6(Q,v)),$.lte=(Q,v)=>$.check(L4(Q,v)),$.max=(Q,v)=>$.check(L4(Q,v)),$.positive=(Q)=>$.check(U6(BigInt(0),Q)),$.negative=(Q)=>$.check(v6(BigInt(0),Q)),$.nonpositive=(Q)=>$.check(L4(BigInt(0),Q)),$.nonnegative=(Q)=>$.check(z4(BigInt(0),Q)),$.multipleOf=(Q,v)=>$.check(x6(Q,v));let U=$._zod.bag;$.minValue=U.minimum??null,$.maxValue=U.maximum??null,$.format=U.format??null});x2=B("ZodBigIntFormat",($,_)=>{c3.init($,_),H0.init($,_)});WQ=B("ZodSymbol",($,_)=>{l3.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>HU($,U,Q,v)});bQ=B("ZodUndefined",($,_)=>{d3.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>bU($,U,Q,v)});BQ=B("ZodNull",($,_)=>{p3.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>WU($,U,Q,v)});VQ=B("ZodAny",($,_)=>{i3.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>VU($,U,Q,v)});DQ=B("ZodUnknown",($,_)=>{n3.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>DU($,U,Q,v)});MQ=B("ZodNever",($,_)=>{r3.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>ZU($,U,Q,v)});wQ=B("ZodVoid",($,_)=>{o3.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>BU($,U,Q,v)});F_=B("ZodDate",($,_)=>{t3.init($,_),U$.init($,_),$._zod.processJSONSchema=(Q,v,J)=>MU($,Q,v,J),$.min=(Q,v)=>$.check(z4(Q,v)),$.max=(Q,v)=>$.check(L4(Q,v));let U=$._zod.bag;$.minDate=U.minimum?new Date(U.minimum):null,$.maxDate=U.maximum?new Date(U.maximum):null});LQ=B("ZodArray",($,_)=>{a3.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>PU($,U,Q,v),$.element=_.element,$.min=(U,Q)=>$.check(W6(U,Q)),$.nonempty=(U)=>$.check(W6(1,U)),$.max=(U,Q)=>$.check(U1(U,Q)),$.length=(U,Q)=>$.check(Q1(U,Q)),$.unwrap=()=>$.element});N_=B("ZodObject",($,_)=>{s3.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>xU($,U,Q,v),E.defineLazy($,"shape",()=>{return _.shape}),$.keyof=()=>C2(Object.keys($._zod.def.shape)),$.catchall=(U)=>$.clone({...$._zod.def,catchall:U}),$.passthrough=()=>$.clone({...$._zod.def,catchall:J1()}),$.loose=()=>$.clone({...$._zod.def,catchall:J1()}),$.strict=()=>$.clone({...$._zod.def,catchall:u2()}),$.strip=()=>$.clone({...$._zod.def,catchall:void 0}),$.extend=(U)=>{return E.extend($,U)},$.safeExtend=(U)=>{return E.safeExtend($,U)},$.merge=(U)=>E.merge($,U),$.pick=(U)=>E.pick($,U),$.omit=(U)=>E.omit($,U),$.partial=(...U)=>E.partial(m2,$,U[0]),$.required=(...U)=>E.required(g2,$,U[0])});S_=B("ZodUnion",($,_)=>{Y_.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>J2($,U,Q,v),$.options=_.options});kQ=B("ZodXor",($,_)=>{S_.init($,_),e3.init($,_),$._zod.processJSONSchema=(U,Q,v)=>J2($,U,Q,v),$.options=_.options});AQ=B("ZodDiscriminatedUnion",($,_)=>{S_.init($,_),$7.init($,_)});FQ=B("ZodIntersection",($,_)=>{_7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>uU($,U,Q,v)});NQ=B("ZodTuple",($,_)=>{Tv.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>yU($,U,Q,v),$.rest=(U)=>$.clone({...$._zod.def,rest:U})});T_=B("ZodRecord",($,_)=>{v7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>CU($,U,Q,v),$.keyType=_.keyType,$.valueType=_.valueType});RQ=B("ZodMap",($,_)=>{U7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>RU($,U,Q,v),$.keyType=_.keyType,$.valueType=_.valueType,$.min=(...U)=>$.check(Q6(...U)),$.nonempty=(U)=>$.check(Q6(1,U)),$.max=(...U)=>$.check(u6(...U)),$.size=(...U)=>$.check(v1(...U))});EQ=B("ZodSet",($,_)=>{Q7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>EU($,U,Q,v),$.min=(...U)=>$.check(Q6(...U)),$.nonempty=(U)=>$.check(Q6(1,U)),$.max=(...U)=>$.check(u6(...U)),$.size=(...U)=>$.check(v1(...U))});X0=B("ZodEnum",($,_)=>{J7.init($,_),U$.init($,_),$._zod.processJSONSchema=(Q,v,J)=>wU($,Q,v,J),$.enum=_.entries,$.options=Object.values(_.entries);let U=new Set(Object.keys(_.entries));$.extract=(Q,v)=>{let J={};for(let Y of Q)if(U.has(Y))J[Y]=_.entries[Y];else throw Error(`Key ${Y} not found in enum`);return new X0({..._,checks:[],...E.normalizeParams(v),entries:J})},$.exclude=(Q,v)=>{let J={..._.entries};for(let Y of Q)if(U.has(Y))delete J[Y];else throw Error(`Key ${Y} not found in enum`);return new X0({..._,checks:[],...E.normalizeParams(v),entries:J})}});PQ=B("ZodLiteral",($,_)=>{Y7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>LU($,U,Q,v),$.values=new Set(_.values),Object.defineProperty($,"value",{get(){if(_.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return _.values[0]}})});xQ=B("ZodFile",($,_)=>{z7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>FU($,U,Q,v),$.min=(U,Q)=>$.check(Q6(U,Q)),$.max=(U,Q)=>$.check(u6(U,Q)),$.mime=(U,Q)=>$.check($0(Array.isArray(U)?U:[U],Q))});uQ=B("ZodTransform",($,_)=>{I7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>TU($,U,Q,v),$._zod.parse=(U,Q)=>{if(Q.direction==="backward")throw new s6($.constructor.name);U.addIssue=(J)=>{if(typeof J==="string")U.issues.push(E.issue(J,U.value,_));else{let Y=J;if(Y.fatal)Y.continue=!1;Y.code??(Y.code="custom"),Y.input??(Y.input=U.value),Y.inst??(Y.inst=$),U.issues.push(E.issue(Y))}};let v=_.transform(U.value,U);if(v instanceof Promise)return v.then((J)=>{return U.value=J,U});return U.value=v,U}});m2=B("ZodOptional",($,_)=>{Rv.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>Y2($,U,Q,v),$.unwrap=()=>$._zod.def.innerType});yQ=B("ZodExactOptional",($,_)=>{X7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>Y2($,U,Q,v),$.unwrap=()=>$._zod.def.innerType});fQ=B("ZodNullable",($,_)=>{q7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>fU($,U,Q,v),$.unwrap=()=>$._zod.def.innerType});mQ=B("ZodDefault",($,_)=>{G7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>gU($,U,Q,v),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});hQ=B("ZodPrefault",($,_)=>{j7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>hU($,U,Q,v),$.unwrap=()=>$._zod.def.innerType});g2=B("ZodNonOptional",($,_)=>{K7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>mU($,U,Q,v),$.unwrap=()=>$._zod.def.innerType});dQ=B("ZodSuccess",($,_)=>{H7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>OU($,U,Q,v),$.unwrap=()=>$._zod.def.innerType});pQ=B("ZodCatch",($,_)=>{W7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>cU($,U,Q,v),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});nQ=B("ZodNaN",($,_)=>{b7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>kU($,U,Q,v)});h2=B("ZodPipe",($,_)=>{B7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>lU($,U,Q,v),$.in=_.in,$.out=_.out});c2=B("ZodCodec",($,_)=>{h2.init($,_),z_.init($,_)});rQ=B("ZodReadonly",($,_)=>{Z7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>dU($,U,Q,v),$.unwrap=()=>$._zod.def.innerType});tQ=B("ZodTemplateLiteral",($,_)=>{V7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>AU($,U,Q,v)});aQ=B("ZodLazy",($,_)=>{w7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>iU($,U,Q,v),$.unwrap=()=>$._zod.def.getter()});eQ=B("ZodPromise",($,_)=>{M7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>pU($,U,Q,v),$.unwrap=()=>$._zod.def.innerType});$J=B("ZodFunction",($,_)=>{D7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>SU($,U,Q,v)});R_=B("ZodCustom",($,_)=>{L7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>NU($,U,Q,v)});pX=YU,iX=zU});function OZ($){l$({customError:$})}function NZ(){return l$().customError}var FZ,UJ;var aX=b(()=>{k4();FZ={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};(function($){})(UJ||(UJ={}))});function TZ($,_){let U=$.$schema;if(U==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(U==="http://json-schema.org/draft-07/schema#")return"draft-7";if(U==="http://json-schema.org/draft-04/schema#")return"draft-4";return _??"draft-2020-12"}function RZ($,_){if(!$.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let U=$.slice(1).split("/").filter(Boolean);if(U.length===0)return _.rootSchema;let Q=_.version==="draft-2020-12"?"$defs":"definitions";if(U[0]===Q){let v=U[1];if(!v||!_.defs[v])throw Error(`Reference not found: ${$}`);return _.defs[v]}throw Error(`Reference not found: ${$}`)}function sX($,_){if($.not!==void 0){if(typeof $.not==="object"&&Object.keys($.not).length===0)return y.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if($.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if($.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if($.if!==void 0||$.then!==void 0||$.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if($.dependentSchemas!==void 0||$.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if($.$ref){let v=$.$ref;if(_.refs.has(v))return _.refs.get(v);if(_.processing.has(v))return y.lazy(()=>{if(!_.refs.has(v))throw Error(`Circular reference not resolved: ${v}`);return _.refs.get(v)});_.processing.add(v);let J=RZ(v,_),Y=v4(J,_);return _.refs.set(v,Y),_.processing.delete(v),Y}if($.enum!==void 0){let v=$.enum;if(_.version==="openapi-3.0"&&$.nullable===!0&&v.length===1&&v[0]===null)return y.null();if(v.length===0)return y.never();if(v.length===1)return y.literal(v[0]);if(v.every((Y)=>typeof Y==="string"))return y.enum(v);let J=v.map((Y)=>y.literal(Y));if(J.length<2)return J[0];return y.union([J[0],J[1],...J.slice(2)])}if($.const!==void 0)return y.literal($.const);let U=$.type;if(Array.isArray(U)){let v=U.map((J)=>{let Y={...$,type:J};return sX(Y,_)});if(v.length===0)return y.never();if(v.length===1)return v[0];return y.union(v)}if(!U)return y.any();let Q;switch(U){case"string":{let v=y.string();if($.format){let J=$.format;if(J==="email")v=v.check(y.email());else if(J==="uri"||J==="uri-reference")v=v.check(y.url());else if(J==="uuid"||J==="guid")v=v.check(y.uuid());else if(J==="date-time")v=v.check(y.iso.datetime());else if(J==="date")v=v.check(y.iso.date());else if(J==="time")v=v.check(y.iso.time());else if(J==="duration")v=v.check(y.iso.duration());else if(J==="ipv4")v=v.check(y.ipv4());else if(J==="ipv6")v=v.check(y.ipv6());else if(J==="mac")v=v.check(y.mac());else if(J==="cidr")v=v.check(y.cidrv4());else if(J==="cidr-v6")v=v.check(y.cidrv6());else if(J==="base64")v=v.check(y.base64());else if(J==="base64url")v=v.check(y.base64url());else if(J==="e164")v=v.check(y.e164());else if(J==="jwt")v=v.check(y.jwt());else if(J==="emoji")v=v.check(y.emoji());else if(J==="nanoid")v=v.check(y.nanoid());else if(J==="cuid")v=v.check(y.cuid());else if(J==="cuid2")v=v.check(y.cuid2());else if(J==="ulid")v=v.check(y.ulid());else if(J==="xid")v=v.check(y.xid());else if(J==="ksuid")v=v.check(y.ksuid())}if(typeof $.minLength==="number")v=v.min($.minLength);if(typeof $.maxLength==="number")v=v.max($.maxLength);if($.pattern)v=v.regex(new RegExp($.pattern));Q=v;break}case"number":case"integer":{let v=U==="integer"?y.number().int():y.number();if(typeof $.minimum==="number")v=v.min($.minimum);if(typeof $.maximum==="number")v=v.max($.maximum);if(typeof $.exclusiveMinimum==="number")v=v.gt($.exclusiveMinimum);else if($.exclusiveMinimum===!0&&typeof $.minimum==="number")v=v.gt($.minimum);if(typeof $.exclusiveMaximum==="number")v=v.lt($.exclusiveMaximum);else if($.exclusiveMaximum===!0&&typeof $.maximum==="number")v=v.lt($.maximum);if(typeof $.multipleOf==="number")v=v.multipleOf($.multipleOf);Q=v;break}case"boolean":{Q=y.boolean();break}case"null":{Q=y.null();break}case"object":{let v={},J=$.properties||{},Y=new Set($.required||[]);for(let[I,X]of Object.entries(J)){let q=v4(X,_);v[I]=Y.has(I)?q:q.optional()}if($.propertyNames){let I=v4($.propertyNames,_),X=$.additionalProperties&&typeof $.additionalProperties==="object"?v4($.additionalProperties,_):y.any();if(Object.keys(v).length===0){Q=y.record(I,X);break}let q=y.object(v).passthrough(),G=y.looseRecord(I,X);Q=y.intersection(q,G);break}if($.patternProperties){let I=$.patternProperties,X=Object.keys(I),q=[];for(let j of X){let H=v4(I[j],_),Z=y.string().regex(new RegExp(j));q.push(y.looseRecord(Z,H))}let G=[];if(Object.keys(v).length>0)G.push(y.object(v).passthrough());if(G.push(...q),G.length===0)Q=y.object({}).passthrough();else if(G.length===1)Q=G[0];else{let j=y.intersection(G[0],G[1]);for(let H=2;H<G.length;H++)j=y.intersection(j,G[H]);Q=j}break}let z=y.object(v);if($.additionalProperties===!1)Q=z.strict();else if(typeof $.additionalProperties==="object")Q=z.catchall(v4($.additionalProperties,_));else Q=z.passthrough();break}case"array":{let{prefixItems:v,items:J}=$;if(v&&Array.isArray(v)){let Y=v.map((I)=>v4(I,_)),z=J&&typeof J==="object"&&!Array.isArray(J)?v4(J,_):void 0;if(z)Q=y.tuple(Y).rest(z);else Q=y.tuple(Y);if(typeof $.minItems==="number")Q=Q.check(y.minLength($.minItems));if(typeof $.maxItems==="number")Q=Q.check(y.maxLength($.maxItems))}else if(Array.isArray(J)){let Y=J.map((I)=>v4(I,_)),z=$.additionalItems&&typeof $.additionalItems==="object"?v4($.additionalItems,_):void 0;if(z)Q=y.tuple(Y).rest(z);else Q=y.tuple(Y);if(typeof $.minItems==="number")Q=Q.check(y.minLength($.minItems));if(typeof $.maxItems==="number")Q=Q.check(y.maxLength($.maxItems))}else if(J!==void 0){let Y=v4(J,_),z=y.array(Y);if(typeof $.minItems==="number")z=z.min($.minItems);if(typeof $.maxItems==="number")z=z.max($.maxItems);Q=z}else Q=y.array(y.any());break}default:throw Error(`Unsupported type: ${U}`)}if($.description)Q=Q.describe($.description);if($.default!==void 0)Q=Q.default($.default);return Q}function v4($,_){if(typeof $==="boolean")return $?y.any():y.never();let U=sX($,_),Q=$.type||$.enum!==void 0||$.const!==void 0;if($.anyOf&&Array.isArray($.anyOf)){let z=$.anyOf.map((X)=>v4(X,_)),I=y.union(z);U=Q?y.intersection(U,I):I}if($.oneOf&&Array.isArray($.oneOf)){let z=$.oneOf.map((X)=>v4(X,_)),I=y.xor(z);U=Q?y.intersection(U,I):I}if($.allOf&&Array.isArray($.allOf))if($.allOf.length===0)U=Q?U:y.any();else{let z=Q?U:v4($.allOf[0],_),I=Q?0:1;for(let X=I;X<$.allOf.length;X++)z=y.intersection(z,v4($.allOf[X],_));U=z}if($.nullable===!0&&_.version==="openapi-3.0")U=y.nullable(U);if($.readOnly===!0)U=y.readonly(U);let v={},J=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let z of J)if(z in $)v[z]=$[z];let Y=["contentEncoding","contentMediaType","contentSchema"];for(let z of Y)if(z in $)v[z]=$[z];for(let z of Object.keys($))if(!SZ.has(z))v[z]=$[z];if(Object.keys(v).length>0)_.registry.add(U,v);return U}function eX($,_){if(typeof $==="boolean")return $?y.any():y.never();let U=TZ($,_?.defaultTarget),Q=$.$defs||$.definitions||{},v={version:U,defs:Q,refs:new Map,processing:new Set,rootSchema:$,registry:_?.registry??e$};return v4($,v)}var y,SZ;var $q=b(()=>{K_();X2();Z_();D_();y={...V_,...I2,iso:I0},SZ=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"])});var QJ={};s$(QJ,{string:()=>EZ,number:()=>PZ,date:()=>yZ,boolean:()=>xZ,bigint:()=>uZ});function EZ($){return A5(q0,$)}function PZ($){return P5(j0,$)}function xZ($){return g5(K0,$)}function uZ($){return c5(H0,$)}function yZ($){return e5(F_,$)}var _q=b(()=>{k4();D_()});var K={};s$(K,{xor:()=>OX,xid:()=>tI,void:()=>MX,uuidv7:()=>cI,uuidv6:()=>hI,uuidv4:()=>gI,uuid:()=>mI,util:()=>E,url:()=>lI,uppercase:()=>t1,unknown:()=>J1,union:()=>y2,undefined:()=>VX,ulid:()=>oI,uint64:()=>BX,uint32:()=>HX,tuple:()=>SQ,trim:()=>v0,treeifyError:()=>H9,transform:()=>f2,toUpperCase:()=>Q0,toLowerCase:()=>U0,toJSONSchema:()=>z2,templateLiteral:()=>gX,symbol:()=>ZX,superRefine:()=>vJ,success:()=>CX,stringbool:()=>rX,stringFormat:()=>zX,string:()=>W2,strictObject:()=>AX,startsWith:()=>s1,slugify:()=>J0,size:()=>v1,setErrorMap:()=>OZ,set:()=>EX,safeParseAsync:()=>vQ,safeParse:()=>_Q,safeEncodeAsync:()=>XQ,safeEncode:()=>zQ,safeDecodeAsync:()=>qQ,safeDecode:()=>IQ,registry:()=>Ev,regexes:()=>E4,regex:()=>r1,refine:()=>_J,record:()=>TQ,readonly:()=>oQ,property:()=>U2,promise:()=>hX,prettifyError:()=>W9,preprocess:()=>tX,prefault:()=>cQ,positive:()=>ev,pipe:()=>k_,partialRecord:()=>SX,parseAsync:()=>$Q,parse:()=>eU,overwrite:()=>l4,optional:()=>w_,object:()=>kX,number:()=>KQ,nullish:()=>yX,nullable:()=>L_,null:()=>ZQ,normalize:()=>_0,nonpositive:()=>_2,nonoptional:()=>lQ,nonnegative:()=>v2,never:()=>u2,negative:()=>$2,nativeEnum:()=>PX,nanoid:()=>iI,nan:()=>fX,multipleOf:()=>x6,minSize:()=>Q6,minLength:()=>W6,mime:()=>$0,meta:()=>iX,maxSize:()=>u6,maxLength:()=>U1,map:()=>RX,mac:()=>eI,lte:()=>L4,lt:()=>v6,lowercase:()=>o1,looseRecord:()=>TX,looseObject:()=>FX,locales:()=>j_,literal:()=>xX,length:()=>Q1,lazy:()=>sQ,ksuid:()=>aI,keyof:()=>LX,jwt:()=>YX,json:()=>oX,iso:()=>I0,ipv6:()=>$X,ipv4:()=>sI,intersection:()=>OQ,int64:()=>bX,int32:()=>KX,int:()=>b2,instanceof:()=>nX,includes:()=>a1,httpUrl:()=>dI,hostname:()=>IX,hex:()=>XX,hash:()=>qX,guid:()=>fI,gte:()=>z4,gt:()=>U6,globalRegistry:()=>e$,getErrorMap:()=>NZ,function:()=>cX,fromJSONSchema:()=>eX,formatError:()=>__,float64:()=>jX,float32:()=>GX,flattenError:()=>$_,file:()=>uX,exactOptional:()=>CQ,enum:()=>C2,endsWith:()=>e1,encodeAsync:()=>JQ,encode:()=>UQ,emoji:()=>pI,email:()=>CI,e164:()=>JX,discriminatedUnion:()=>NX,describe:()=>pX,decodeAsync:()=>YQ,decode:()=>QQ,date:()=>wX,custom:()=>dX,cuid2:()=>rI,cuid:()=>nI,core:()=>b6,config:()=>l$,coerce:()=>QJ,codec:()=>mX,clone:()=>Y4,cidrv6:()=>vX,cidrv4:()=>_X,check:()=>lX,catch:()=>iQ,boolean:()=>HQ,bigint:()=>WX,base64url:()=>QX,base64:()=>UX,array:()=>O_,any:()=>DX,_function:()=>cX,_default:()=>gQ,_ZodString:()=>B2,ZodXor:()=>kQ,ZodXID:()=>k2,ZodVoid:()=>wQ,ZodUnknown:()=>DQ,ZodUnion:()=>S_,ZodUndefined:()=>bQ,ZodUUID:()=>J6,ZodURL:()=>A_,ZodULID:()=>L2,ZodType:()=>U$,ZodTuple:()=>NQ,ZodTransform:()=>uQ,ZodTemplateLiteral:()=>tQ,ZodSymbol:()=>WQ,ZodSuccess:()=>dQ,ZodStringFormat:()=>F$,ZodString:()=>q0,ZodSet:()=>EQ,ZodRecord:()=>T_,ZodRealError:()=>b4,ZodReadonly:()=>rQ,ZodPromise:()=>eQ,ZodPrefault:()=>hQ,ZodPipe:()=>h2,ZodOptional:()=>m2,ZodObject:()=>N_,ZodNumberFormat:()=>Y1,ZodNumber:()=>j0,ZodNullable:()=>fQ,ZodNull:()=>BQ,ZodNonOptional:()=>g2,ZodNever:()=>MQ,ZodNanoID:()=>D2,ZodNaN:()=>nQ,ZodMap:()=>RQ,ZodMAC:()=>jQ,ZodLiteral:()=>PQ,ZodLazy:()=>aQ,ZodKSUID:()=>A2,ZodJWT:()=>P2,ZodIssueCode:()=>FZ,ZodIntersection:()=>FQ,ZodISOTime:()=>j2,ZodISODuration:()=>K2,ZodISODateTime:()=>q2,ZodISODate:()=>G2,ZodIPv6:()=>O2,ZodIPv4:()=>F2,ZodGUID:()=>M_,ZodFunction:()=>$J,ZodFirstPartyTypeKind:()=>UJ,ZodFile:()=>xQ,ZodExactOptional:()=>yQ,ZodError:()=>H2,ZodEnum:()=>X0,ZodEmoji:()=>V2,ZodEmail:()=>Z2,ZodE164:()=>E2,ZodDiscriminatedUnion:()=>AQ,ZodDefault:()=>mQ,ZodDate:()=>F_,ZodCustomStringFormat:()=>G0,ZodCustom:()=>R_,ZodCodec:()=>c2,ZodCatch:()=>pQ,ZodCUID2:()=>w2,ZodCUID:()=>M2,ZodCIDRv6:()=>S2,ZodCIDRv4:()=>N2,ZodBoolean:()=>K0,ZodBigIntFormat:()=>x2,ZodBigInt:()=>H0,ZodBase64URL:()=>R2,ZodBase64:()=>T2,ZodArray:()=>LQ,ZodAny:()=>VQ,TimePrecision:()=>O5,NEVER:()=>U9,$output:()=>M5,$input:()=>w5,$brand:()=>Q9});var JJ=b(()=>{k4();k4();P7();k4();B_();$q();D5();Z_();Z_();_q();D_();X2();sU();GQ();aX();l$(I_())});var B6=b(()=>{JJ();JJ()});var Uq;var vq=b(()=>{Uq={name:"ocx",version:"2.0.5",description:"OCX CLI - OpenCode extension manager with portable, isolated profiles. Your setup, anywhere.",author:"kdcokenny",license:"MIT",type:"module",main:"./dist/index.js",bin:{ocx:"./dist/index.js"},files:["dist/index.js"],publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/kdcokenny/ocx.git"},homepage:"https://github.com/kdcokenny/ocx#readme",bugs:{url:"https://github.com/kdcokenny/ocx/issues"},keywords:["opencode","cli","extensions","agents","plugins","mcp","shadcn","registry"],engines:{node:">=18"},scripts:{build:"bun run scripts/build.ts","build:binary":"bun run scripts/build-binary.ts",check:"bun check:biome && bun check:types","check:biome":"biome check .","check:types":"tsc --noEmit",dev:"bun run src/index.ts",prepublishOnly:"bun run build",test:"bun test"},dependencies:{commander:"^14.0.3",fuzzysort:"^3.1.0","jsonc-parser":"3.3.1",kleur:"^4.1.5",ora:"^9.3.0",remeda:"^2.33.7",zod:"^4.3.6"},devDependencies:{"@types/bun":"^1.3.11"}}});function fZ($){return`https://${E_}/schemas/v${$}/registry.json`}var E_="ocx.kdco.dev",Qq="kdcokenny/ocx",YJ,zJ,d4=2,p4,Jq;var l2=b(()=>{vq();YJ=`https://${E_}/schemas/ocx.json`,zJ=`https://${E_}/schemas/registry.json`;p4=fZ(d4),Jq=Uq.version});var K$,b$,B$,E$,n,M,z1,t$,I1,f$,i4,m$,m6,W0,n4,b0,IJ;var z$=b(()=>{K$={SUCCESS:0,GENERAL:1,NOT_FOUND:66,NETWORK:69,CONFIG:78,INTEGRITY:65,CONFLICT:6};b$=class b$ extends Error{code;exitCode;constructor($,_,U=K$.GENERAL){super($);this.code=_;this.exitCode=U;this.name="OCXError"}};B$=class B$ extends b${constructor($){super($,"NOT_FOUND",K$.NOT_FOUND);this.name="NotFoundError"}};E$=class E$ extends b${url;status;statusText;phase;qualifiedName;registryContext;registryName;constructor($,_){super($,"NETWORK_ERROR",K$.NETWORK);this.name="NetworkError",this.url=_?.url,this.status=_?.status,this.statusText=_?.statusText,this.phase=_?.phase,this.qualifiedName=_?.qualifiedName,this.registryContext=_?.registryContext,this.registryName=_?.registryName}};n=class n extends b${constructor($){super($,"CONFIG_ERROR",K$.CONFIG);this.name="ConfigError"}};M=class M extends b${constructor($){super($,"VALIDATION_ERROR",K$.GENERAL);this.name="ValidationError"}};z1=class z1 extends b${details;constructor($){super("Registry validation failed","VALIDATION_FAILED",K$.CONFIG);this.details=$;this.name="ValidationFailedError"}};t$=class t$ extends b${constructor($){super($,"CONFLICT",K$.CONFLICT);this.name="ConflictError"}};I1=class I1 extends b${component;expected;found;constructor($,_,U){let Q=`Integrity verification failed for "${$}"
57
+ Expected: ${_}
58
+ Found: ${U}
20
59
 
21
60
  The registry content has changed since this component was locked.
22
- Use 'ocx update ${D}' to intentionally update this component.`;super($,"INTEGRITY_ERROR",XD.INTEGRITY);this.component=D;this.expected=F;this.found=B;this.name="IntegrityError"}};vD=class vD extends zD{constructor(D){super(D,"UPDATE_ERROR",XD.GENERAL);this.name="SelfUpdateError"}};v0=class v0 extends zD{url;issue;remediation;schemaUrl;supportedMajor;detectedMajor;constructor(D,F){super(D,"REGISTRY_COMPAT_ERROR",XD.CONFIG);this.name="RegistryCompatibilityError",this.url=F.url,this.issue=F.issue,this.remediation=F.remediation,this.schemaUrl=F.schemaUrl,this.supportedMajor=F.supportedMajor,this.detectedMajor=F.detectedMajor}};CD=class CD extends zD{profile;constructor(D,F){let B=F??`Profile "${D}" not found`;super(B,"NOT_FOUND",XD.NOT_FOUND);this.profile=D;this.name="ProfileNotFoundError"}};O2=class O2 extends zD{profile;constructor(D,F){let B=F?`Profile "${D}" already exists. ${F}`:`Profile "${D}" already exists.`;super(B,"CONFLICT",XD.CONFLICT);this.profile=D;this.name="ProfileExistsError"}};vF=class vF extends zD{registryName;existingUrl;newUrl;targetLabel;existingName;conflictType;constructor(D,F,B,$,_){let Q=$?` in ${$}`:"",Y=_!==void 0&&_!==D,q=Y?`Registry URL already registered under name "${_}"${Q}.
23
- URL: ${F}
24
- Existing name: ${_}
25
- Requested name: ${D}
61
+ Use 'ocx update ${$}' to intentionally update this component.`;super(Q,"INTEGRITY_ERROR",K$.INTEGRITY);this.component=$;this.expected=_;this.found=U;this.name="IntegrityError"}};f$=class f$ extends b${constructor($){super($,"UPDATE_ERROR",K$.GENERAL);this.name="SelfUpdateError"}};i4=class i4 extends b${url;issue;remediation;schemaUrl;supportedMajor;detectedMajor;constructor($,_){super($,"REGISTRY_COMPAT_ERROR",K$.CONFIG);this.name="RegistryCompatibilityError",this.url=_.url,this.issue=_.issue,this.remediation=_.remediation,this.schemaUrl=_.schemaUrl,this.supportedMajor=_.supportedMajor,this.detectedMajor=_.detectedMajor}};m$=class m$ extends b${profile;constructor($,_){let U=_??`Profile "${$}" not found`;super(U,"NOT_FOUND",K$.NOT_FOUND);this.profile=$;this.name="ProfileNotFoundError"}};m6=class m6 extends b${profile;constructor($,_){let U=_?`Profile "${$}" already exists. ${_}`:`Profile "${$}" already exists.`;super(U,"CONFLICT",K$.CONFLICT);this.profile=$;this.name="ProfileExistsError"}};W0=class W0 extends b${registryName;existingUrl;newUrl;targetLabel;existingName;conflictType;constructor($,_,U,Q,v){let J=Q?` in ${Q}`:"",Y=v!==void 0&&v!==$,z=Y?`Registry URL already registered under name "${v}"${J}.
62
+ URL: ${_}
63
+ Existing name: ${v}
64
+ Requested name: ${$}
26
65
 
27
- Run 'ocx registry remove ${_}' first, then re-add with the new name.`:`Registry "${D}" already exists${Q}.
28
- Current: ${F}
29
- New: ${B}
66
+ Run 'ocx registry remove ${v}' first, then re-add with the new name.`:`Registry "${$}" already exists${J}.
67
+ Current: ${_}
68
+ New: ${U}
30
69
 
31
- Run 'ocx registry remove ${D}' first, then re-add with the new URL.`;super(q,"CONFLICT",XD.CONFLICT);this.registryName=D;this.existingUrl=F;this.newUrl=B;this.targetLabel=$;this.existingName=_;this.name="RegistryExistsError",this.conflictType=Y?"url":"name"}};C0=class C0 extends zD{profile;reason;constructor(D,F){super(`Invalid profile name "${D}": ${F}`,"VALIDATION_ERROR",XD.GENERAL);this.profile=D;this.reason=F;this.name="InvalidProfileNameError"}};CF=class CF extends zD{constructor(){super("Profiles not initialized. Run 'ocx init --global' first.","NOT_FOUND",XD.NOT_FOUND);this.name="ProfilesNotInitializedError"}};W1=class W1 extends zD{profile;localDir;constructor(D,F){super(`Local profile directory unsupported: "${F}"
70
+ Run 'ocx registry remove ${$}' first, then re-add with the new URL.`;super(z,"CONFLICT",K$.CONFLICT);this.registryName=$;this.existingUrl=_;this.newUrl=U;this.targetLabel=Q;this.existingName=v;this.name="RegistryExistsError",this.conflictType=Y?"url":"name"}};n4=class n4 extends b${profile;reason;constructor($,_){super(`Invalid profile name "${$}": ${_}`,"VALIDATION_ERROR",K$.GENERAL);this.profile=$;this.reason=_;this.name="InvalidProfileNameError"}};b0=class b0 extends b${constructor(){super("Profiles not initialized. Run 'ocx init --global' first.","NOT_FOUND",K$.NOT_FOUND);this.name="ProfilesNotInitializedError"}};IJ=class IJ extends b${profile;localDir;constructor($,_){super(`Local profile directory unsupported: "${_}"
32
71
 
33
72
  Local profiles are not supported. Profiles must be global only.
34
73
  Remove the local profile directory and use global profiles instead:
35
- rm -rf "${F}"
36
- ocx profile show ${D} --global`,"CONFIG_ERROR",XD.CONFIG);this.profile=D;this.localDir=F;this.name="LocalProfileUnsupportedError"}}});import*as j0 from"path";function H0(D,F){if(F.includes("\x00"))throw new aD("Path contains null bytes",F,"null_byte");if(j0.isAbsolute(F)||j0.win32.isAbsolute(F))throw new aD("Path must be relative",F,"absolute_path");if(/^[a-zA-Z]:/.test(F)||F.startsWith("\\\\"))throw new aD("Path contains Windows absolute",F,"windows_absolute");let B=j0.basename(F).toUpperCase().split(".")[0]??"";if(LQ.has(B))throw new aD("Path uses Windows reserved name",F,"windows_reserved");let _=F.normalize("NFC").replace(/\\/g,"/"),Q=j0.resolve(D),Y=j0.resolve(Q,_),q=j0.relative(Q,Y);if(q.startsWith("../")||q.startsWith("..\\")||q===".."||j0.isAbsolute(q))throw new aD("Path escapes base directory",F,"path_traversal");return Y}var aD,LQ;var c2=V(()=>{aD=class aD extends Error{attemptedPath;reason;constructor(D,F,B){super(D);this.attemptedPath=F;this.reason=B;this.name="PathValidationError"}};LQ=new Set(["CON","PRN","AUX","NUL","COM1","COM2","COM3","COM4","COM5","COM6","COM7","COM8","COM9","LPT1","LPT2","LPT3","LPT4","LPT5","LPT6","LPT7","LPT8","LPT9"])});import{isAbsolute as wQ,normalize as R7}from"path";function u0(D){if(!D.includes("/"))throw Error(`Invalid component reference: "${D}". Use format: alias/component`);let F=D.split("/");if(F.length>2)throw Error(`Invalid component reference: "${D}". Too many "/" separators. Use format: alias/component`);let[B,$]=F;if(!B||!$)throw Error(`Invalid component reference: "${D}". Both alias and component are required.`);return{namespace:B,component:$}}function A1(D,F){return`${D}/${F}`}function z1(D){if(wQ(D))throw new U(`Invalid path: "${D}" - absolute paths not allowed`);if(D.startsWith("~"))throw new U(`Invalid path: "${D}" - home directory paths not allowed`);if(R7(D).startsWith(".."))throw new U(`Invalid path: "${D}" - path traversal not allowed`)}function P7(D){return D}function b7(D,F){if(OQ.has(D))throw new U(`Target "${D}" is reserved for installer use`);try{H0("/dummy/base",D)}catch($){if($ instanceof aD)throw new U(`Invalid target "${D}": ${$.message}`);throw $}if(F!=="profile"){let $=R7(D);if(N7.some((Q)=>$===Q||$.startsWith(Q)))throw new U(`Target path '${D}' is protected and cannot be overwritten by registry components`)}}function b2(D,F){if(typeof D==="string"){z1(D);let B=P7(D);return b7(B,F),{path:D,target:B}}return z1(D.path),z1(D.target),b7(D.target,F),D}function x7(D){if(typeof D==="string")return{type:"remote",url:D,enabled:!0};return D}function p2(D){let F;if(D.opencode){let{mcp:B,...$}=D.opencode;F={...$,...B&&{mcp:Object.fromEntries(Object.entries(B).map(([_,Q])=>[_,x7(Q)]))}}}return{...D,files:D.files.map((B)=>b2(B,D.type)),opencode:F}}function PF(D){if(D===null||D===void 0||typeof D!=="object")return null;let F=D;if(!Object.hasOwn(F,"$schema"))return{issue:"legacy-schema-v1",remediation:`This registry uses legacy schema v1 (missing $schema). Set "$schema" to "${T0}".`,supportedMajor:I0};let $=F.$schema;if(typeof $!=="string")return{issue:"invalid-schema-url",remediation:`Registry $schema must be a canonical URL like "${T0}".`,schemaUrl:String($),supportedMajor:I0};if(!$)return{issue:"invalid-schema-url",remediation:`Registry $schema must be a canonical URL like "${T0}".`,schemaUrl:$,supportedMajor:I0};if($===G1)return{issue:"legacy-schema-v1",remediation:`Schema URL "${G1}" is legacy v1. Use "${T0}" instead.`,schemaUrl:$,supportedMajor:I0};let _=$.match(uQ);if(!_)return{issue:"invalid-schema-url",remediation:`Registry $schema must be a canonical URL like "${T0}".`,schemaUrl:$,supportedMajor:I0};let Q=_[1];if(!Q)return{issue:"invalid-schema-url",remediation:`Registry $schema must be a canonical URL like "${T0}".`,schemaUrl:$,supportedMajor:I0};let Y=Number.parseInt(Q,10);if(Y!==I0)return{issue:"unsupported-schema-version",remediation:`Schema major v${Y} is unsupported. Use "${T0}" (v${I0}).`,schemaUrl:$,supportedMajor:I0,detectedMajor:Y};return null}var Ez,a3,M1,Z7,uF,OQ,N7,bQ,RQ,S7,k7,I7,T7,ZQ,NQ,SQ,kQ,IQ,TQ,vQ,CQ,v7,C7,u7,l2,uQ,j3,i2,K3,j1;var P0=V(()=>{_2();s3();$D();c2();Ez=W.string().refine((D)=>D.startsWith("npm:"),{message:'npm specifier must start with "npm:" prefix'}).refine((D)=>{let F=D.slice(4);if(!F)return!1;if(F.includes("..")||F.includes("/./"))return!1;return!0},{message:"Invalid npm specifier format"}),a3=W.string().min(1,"Name cannot be empty").max(64,"Name cannot exceed 64 characters").regex(/^[a-z0-9]+(-[a-z0-9]+)*$/,{message:"Must be lowercase alphanumeric with single hyphen separators (e.g., 'my-component', 'my-plugin'). Cannot start/end with hyphen or have consecutive hyphens."}),M1=W.string().regex(/^[a-z0-9]+(-[a-z0-9]+)*\/[a-z0-9]+(-[a-z0-9]+)*$/,{message:'Must be in format "alias/component" (e.g., "kdco/researcher"). Both parts must be lowercase alphanumeric with hyphens.'});Z7=W.string().refine((D)=>{let F=/^[a-z0-9]+(-[a-z0-9]+)*$/,B=/^[a-z0-9]+(-[a-z0-9]+)*\/[a-z0-9]+(-[a-z0-9]+)*$/;return F.test(D)||B.test(D)},{message:'Dependency must be either a bare name (e.g., "utils") or qualified (e.g., "acme/utils")'}),uF=W.enum(["agent","skill","plugin","command","tool","bundle","profile"]),OQ=new Set([".ocx","ocx.lock"]),N7=[".ocx/","ocx.jsonc","package.json",".git/",".env","node_modules/"],bQ=W.string().min(1,"Target path cannot be empty").refine((D)=>{if(D.startsWith("/")||/^[a-zA-Z]:/.test(D))return!1;if(D.includes("\x00"))return!1;return!0},{message:"Target path must be relative and safe (no absolute paths or null bytes)"}).refine((D)=>{return!N7.some((F)=>D===F||D.startsWith(F))},{message:"Target path is protected and cannot be overwritten by registry components"}),RQ=W.object({clientId:W.string().optional(),scopes:W.array(W.string()).optional(),authUrl:W.string().optional(),tokenUrl:W.string().optional()}),S7=W.object({type:W.enum(["remote","local"]),url:W.string().optional(),command:W.union([W.string(),W.array(W.string())]).optional(),environment:W.record(W.string()).optional(),headers:W.record(W.string()).optional(),oauth:W.union([W.boolean(),RQ]).optional(),enabled:W.boolean().default(!0)}).refine((D)=>{if(D.type==="remote"&&!D.url)return!1;if(D.type==="local"&&!D.command)return!1;return!0},{message:"Remote MCP servers require 'url', local servers require 'command'"}),k7=W.union([W.string(),S7]),I7=W.object({path:W.string().min(1,"File path cannot be empty"),target:W.string().min(1,"Target path cannot be empty")}),T7=W.union([W.string().min(1,"File path cannot be empty"),I7]),ZQ=W.object({api:W.string().optional(),headers:W.record(W.string()).optional(),env:W.record(W.string()).optional(),enabled:W.boolean().optional()}).passthrough(),NQ=W.object({command:W.union([W.string(),W.array(W.string())]).optional(),enabled:W.boolean().optional()}).passthrough(),SQ=W.object({command:W.union([W.string(),W.array(W.string())]).optional(),glob:W.string().optional()}).passthrough(),kQ=W.object({description:W.string().optional(),run:W.string().optional()}).passthrough(),IQ=W.object({disabled:W.boolean().optional()}).passthrough(),TQ=W.object({host:W.string().optional(),port:W.number().optional()}).passthrough(),vQ=W.record(W.string()),CQ=W.object({include:W.array(W.string()).optional(),exclude:W.array(W.string()).optional()}).passthrough(),v7=W.object({model:W.string().optional(),description:W.string().optional(),steps:W.number().int().positive().optional(),maxSteps:W.number().int().positive().optional(),mode:W.enum(["primary","subagent","all"]).optional(),tools:W.record(W.boolean()).optional(),temperature:W.number().optional(),top_p:W.number().optional(),prompt:W.string().optional(),permission:W.record(W.union([W.enum(["ask","allow","deny"]),W.record(W.enum(["ask","allow","deny"]))])).optional(),color:W.string().optional(),disable:W.boolean().optional(),options:W.record(W.any()).optional()}),C7=W.object({bash:W.union([W.enum(["ask","allow","deny"]),W.record(W.enum(["ask","allow","deny"]))]).optional(),edit:W.union([W.enum(["ask","allow","deny"]),W.record(W.enum(["ask","allow","deny"]))]).optional(),mcp:W.record(W.enum(["ask","allow","deny"])).optional()}).catchall(W.union([W.enum(["ask","allow","deny"]),W.record(W.enum(["ask","allow","deny"]))])),u7=W.object({$schema:W.string().optional(),theme:W.string().optional(),logLevel:W.string().optional(),username:W.string().optional(),model:W.string().optional(),small_model:W.string().optional(),default_agent:W.string().optional(),mcp:W.record(k7).optional(),plugin:W.array(W.string()).optional(),tools:W.record(W.boolean()).optional(),agent:W.record(v7).optional(),instructions:W.array(W.string()).optional(),permission:C7.optional(),provider:W.record(ZQ).optional(),lsp:W.record(NQ).optional(),formatter:W.record(SQ).optional(),command:W.record(kQ).optional(),tui:IQ.optional(),server:TQ.optional(),keybind:vQ.optional(),watcher:CQ.optional(),auto_update:W.boolean().optional(),auto_compact:W.boolean().optional(),share:W.union([W.boolean(),W.string()]).optional()}),l2=W.object({name:a3,type:uF,description:W.string().min(1).max(1024),files:W.array(T7).default([]),dependencies:W.array(Z7).default([]),npmDependencies:W.array(W.string()).optional(),npmDevDependencies:W.array(W.string()).optional(),opencode:u7.optional()});uQ=new RegExp(`^https://${A3.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}/schemas/v([1-9]\\d*)/registry\\.json$`);j3=/^\d+\.\d+\.\d+(-[a-zA-Z0-9.-]+)?(\+[a-zA-Z0-9.-]+)?$/,i2=W.object({$schema:W.string().optional(),name:W.string().min(1,"Registry name cannot be empty"),version:W.string().regex(j3,{message:"Version must be valid semver"}),author:W.string().min(1,"Author cannot be empty"),opencode:W.string().regex(j3,{message:"OpenCode version must be valid semver"}).optional(),ocx:W.string().regex(j3,{message:"OCX version must be valid semver"}).optional(),components:W.array(l2)}).refine((D)=>{let F=new Set(D.components.map((B)=>B.name));for(let B of D.components)for(let $ of B.dependencies)if(!$.includes("/")&&!F.has($))return!1;return!0},{message:"Bare dependencies must reference components that exist in the registry. Use qualified references (e.g., 'other-registry/component') for cross-registry dependencies."}),K3=W.object({name:a3,"dist-tags":W.object({latest:W.string()}),versions:W.record(l2)}),j1=W.object({$schema:W.string().optional(),author:W.string(),opencode:W.string().regex(j3,{message:"OpenCode version must be valid semver"}).optional(),ocx:W.string().regex(j3,{message:"OCX version must be valid semver"}).optional(),components:W.array(W.object({name:a3,type:uF,description:W.string()}))})});import{mkdir as K1}from"fs/promises";import{dirname as PQ,join as i0}from"path";async function U3(D){let{source:F,out:B}=D,$=Bun.file(i0(F,"registry.jsonc")),_=Bun.file(i0(F,"registry.json")),Q=await $.exists(),Y=await _.exists();if(!Q&&!Y)throw new n0("No registry.jsonc or registry.json found in source directory");let H=await(Q?$:_).text(),J=ND(H,[],{allowTrailingComma:!0}),X=PF(J);if(X)throw new n0(`Registry schema compatibility failed (${X.issue})`,[X.remediation,...X.schemaUrl!==void 0?[`Invalid $schema: ${X.schemaUrl}`]:[]]);let z=i2.safeParse(J);if(!z.success){let N=z.error.errors.map((x)=>`${x.path.join(".")}: ${x.message}`);throw new n0("Registry validation failed",N)}let M=z.data,A=[];if(D.dryRun){let N=[];for(let O of M.components){N.push({action:"create",target:`file:components/${O.name}.json`,details:{type:"packument"}});for(let b of O.files){let L=b2(b,O.type),e=i0(F,"files",L.path);if(!await Bun.file(e).exists()){A.push(`${O.name}: Source file not found at ${e}`);continue}N.push({action:"create",target:`file:components/${O.name}/${L.path}`,details:{source:e}})}}N.push({action:"create",target:"file:index.json",details:{type:"registry index"}}),N.push({action:"create",target:"file:.well-known/ocx.json",details:{type:"discovery file"}});let x=N.filter((O)=>O.action==="create").length;return{dryRun:!0,command:"build",wouldPerform:N,validation:{passed:A.length===0,errors:A.length>0?A:void 0},summary:`Would build ${M.components.length} components, ${x} files to ${B}`}}let K=i0(B,"components");await K1(K,{recursive:!0});let j="1.0.0";for(let N of M.components){let x={name:N.name,versions:{[j]:N},"dist-tags":{latest:j}},O=i0(K,`${N.name}.json`);await Bun.write(O,JSON.stringify(x,null,2));for(let b of N.files){let L=b2(b,N.type),e=i0(F,"files",L.path),p=i0(K,N.name,L.path),FD=PQ(p);if(!await Bun.file(e).exists()){A.push(`${N.name}: Source file not found at ${e}`);continue}await K1(FD,{recursive:!0});let KD=Bun.file(e);await Bun.write(p,KD)}}if(A.length>0)throw new n0(`Build failed with ${A.length} errors`,A);let S={$schema:M.$schema,name:M.name,version:M.version,author:M.author,...M.opencode&&{opencode:M.opencode},...M.ocx&&{ocx:M.ocx},components:M.components.map((N)=>({name:N.name,type:N.type,description:N.description}))};await Bun.write(i0(B,"index.json"),JSON.stringify(S,null,2));let Z=i0(B,".well-known");await K1(Z,{recursive:!0});let s={registry:"/index.json"};return await Bun.write(i0(Z,"ocx.json"),JSON.stringify(s,null,2)),{componentsCount:M.components.length,outputPath:B}}var n0;var o3=V(()=>{b0();P0();n0=class n0 extends Error{errors;constructor(D,F=[]){super(D);this.errors=F;this.name="BuildRegistryError"}}});import y7 from"path";function f7(D){return y7.posix.isAbsolute(D)||y7.win32.isAbsolute(D)}var h7=()=>{};var U1;var V1=V(()=>{_2();h7();U1=W.string().refine((D)=>!D.includes("\x00"),"Path cannot contain null bytes").refine((D)=>!D.split(/[/\\]/).some((F)=>F===".."),"Path cannot contain '..'").refine((D)=>!f7(D),"Path must be relative, not absolute")});function xD(D){return D.trim().replace(/\/+$/,"")}import{existsSync as xF}from"fs";import{mkdir as g7}from"fs/promises";import Q2 from"path";function E3(D,F,B,$){return`${xD(D)}::${F}/${B}@${$}`}function Z2(D){if(!D.includes("::"))throw Error(`Invalid canonical ID: "${D}". Expected format: registryUrl::registryName/component@revision`);let[F,B]=D.split("::");if(!B||!F)throw Error(`Invalid canonical ID: "${D}". Expected format: registryUrl::registryName/component@revision`);if(!B.includes("@"))throw Error(`Invalid canonical ID: "${D}". Expected format: registryUrl::registryName/component@revision`);let $=B.indexOf("@");if($===-1)throw Error(`Invalid canonical ID: missing revision in ${D}`);let _=B.slice(0,$),Q=B.slice($+1);if(!_||!Q)throw Error(`Invalid canonical ID: "${D}". Expected format: registryUrl::registryName/component@revision`);if(!_.includes("/"))throw Error(`Invalid canonical ID: "${D}". Component must be qualified (registryName/component)`);let[Y,q]=_.split("/");if(!Y||!q)throw Error(`Invalid canonical ID: "${D}". Both registry name and component name are required`);return{registryUrl:xD(F),registryName:Y,name:q,revision:Q}}function N2(D){let F=Q2.join(D,d7,c7);return{path:F,exists:xF(F)}}async function J0(D){let{path:F,exists:B}=N2(D);if(!B)return null;let _=await Bun.file(F).text(),Q=ND(_,[],{allowTrailingComma:!0});return p7.parse(Q)}async function K0(D,F){let B=Q2.join(D,d7,c7);await g7(Q2.dirname(B),{recursive:!0});let $=JSON.stringify(F,null,2);await Bun.write(B,$)}function S2(D){let F=Q2.join(D,E1,V3),B=Q2.join(D,V3),$=xF(F),_=xF(B);if($&&_)throw Error(`Found ${V3} in both .opencode/ and project root. Please consolidate to one location (recommended: .opencode/${V3})`);if($)return{path:F,exists:!0};if(_)return{path:B,exists:!0};return{path:F,exists:!1}}function yF(D,F){let B=Q2.join(D,E1,m7),$=Q2.join(D,m7);if(F?.isFlattened){if(xF($))return{path:$,exists:!0};return{path:$,exists:!1}}if(xF(B))return{path:B,exists:!0};if(xF($))return{path:$,exists:!0};return{path:B,exists:!1}}async function U0(D,F={}){let{path:B,exists:$}=S2(D);if(!$)return null;let Q=await Bun.file(B).text();try{let Y=ND(Q,[],{allowTrailingComma:!0});return R2.parse(Y)}catch(Y){if(F.emitParseDiagnostics??!0)console.error(`Error parsing ${B}:`,Y);throw Y}}async function e3(D,F,B){let $=B??Q2.join(D,E1,V3);await g7(Q2.dirname($),{recursive:!0});let _=JSON.stringify(F,null,2);await Bun.write($,_)}async function L3(D,F){let{path:B,exists:$}=yF(D,F);if(!$)return null;let Q=await Bun.file(B).text(),Y=ND(Q,[],{allowTrailingComma:!0});return t3.parse(Y)}var r3,R2,d7=".ocx",c7="receipt.jsonc",l7,p7,xQ,yQ,t3,V3="ocx.jsonc",m7="ocx.lock",E1=".opencode";var tD=V(()=>{b0();_2();P0();r3=W.object({url:W.string().url("Registry URL must be a valid URL"),headers:W.record(W.string()).optional()}),R2=W.object({$schema:W.string().optional(),profile:W.string().optional(),registries:W.record(r3).default({}),lockRegistries:W.boolean().default(!1),skipCompatCheck:W.boolean().default(!1)}),l7=W.object({registryUrl:W.string(),registryName:W.string(),name:W.string(),revision:W.string(),hash:W.string(),files:W.array(W.object({path:W.string(),hash:W.string()})),installedAt:W.string(),updatedAt:W.string().optional(),owner:W.object({type:W.enum(["user","profile","system"]),id:W.string().optional()}).optional(),opencode:W.record(W.unknown()).optional()}),p7=W.object({version:W.literal(1),root:W.string().optional(),installed:W.record(W.string(),l7).default({})}),xQ=W.object({registry:W.string(),version:W.string(),hash:W.string(),files:W.array(W.string()),installedAt:W.string(),updatedAt:W.string().optional()}),yQ=W.object({registry:W.string(),component:W.string(),version:W.string().optional(),hash:W.string(),installedAt:W.string()}),t3=W.object({lockVersion:W.literal(1),installedFrom:yQ.optional(),installed:W.record(M1,xQ).default({})})});var{Glob:fQ}=globalThis.Bun;var i7,Y2;var fF=V(()=>{_2();V1();tD();i7=W.string().refine((D)=>{try{return new fQ(D),!0}catch{return!1}},{message:"Invalid glob pattern"}),Y2=W.object({$schema:W.string().optional(),bin:W.string().optional(),registries:W.record(r3).default({}),componentPath:U1.optional(),renameWindow:W.boolean().default(!0).describe("Set terminal/tmux window name when launching OpenCode"),exclude:W.array(i7).default(["**/CLAUDE.md","**/CONTEXT.md","**/.opencode/**","**/opencode.jsonc","**/opencode.json"]).describe("Glob patterns for project files to exclude from OpenCode discovery"),include:W.array(i7).default([]).describe("Glob patterns for project files to include (overrides exclude)")})});var L1=V(()=>{V1();tD();fF();P0()});var w3=d0((hQ)=>{class w1 extends Error{constructor(D,F,B){super(B);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=F,this.exitCode=D,this.nestedError=void 0}}class n7 extends w1{constructor(D){super(1,"commander.invalidArgument",D);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}hQ.CommanderError=w1;hQ.InvalidArgumentError=n7});var D8=d0((lQ)=>{var{InvalidArgumentError:dQ}=w3();class s7{constructor(D,F){switch(this.description=F||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,D[0]){case"<":this.required=!0,this._name=D.slice(1,-1);break;case"[":this.required=!1,this._name=D.slice(1,-1);break;default:this.required=!0,this._name=D;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue(D,F){if(F===this.defaultValue||!Array.isArray(F))return[D];return F.push(D),F}default(D,F){return this.defaultValue=D,this.defaultValueDescription=F,this}argParser(D){return this.parseArg=D,this}choices(D){return this.argChoices=D.slice(),this.parseArg=(F,B)=>{if(!this.argChoices.includes(F))throw new dQ(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(F,B);return F},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function cQ(D){let F=D.name()+(D.variadic===!0?"...":"");return D.required?"<"+F+">":"["+F+"]"}lQ.Argument=s7;lQ.humanReadableArgName=cQ});var O1=d0((sQ)=>{var{humanReadableArgName:nQ}=D8();class a7{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(D){this.helpWidth=this.helpWidth??D.helpWidth??80}visibleCommands(D){let F=D.commands.filter(($)=>!$._hidden),B=D._getHelpCommand();if(B&&!B._hidden)F.push(B);if(this.sortSubcommands)F.sort(($,_)=>{return $.name().localeCompare(_.name())});return F}compareOptions(D,F){let B=($)=>{return $.short?$.short.replace(/^-/,""):$.long.replace(/^--/,"")};return B(D).localeCompare(B(F))}visibleOptions(D){let F=D.options.filter(($)=>!$.hidden),B=D._getHelpOption();if(B&&!B.hidden){let $=B.short&&D._findOption(B.short),_=B.long&&D._findOption(B.long);if(!$&&!_)F.push(B);else if(B.long&&!_)F.push(D.createOption(B.long,B.description));else if(B.short&&!$)F.push(D.createOption(B.short,B.description))}if(this.sortOptions)F.sort(this.compareOptions);return F}visibleGlobalOptions(D){if(!this.showGlobalOptions)return[];let F=[];for(let B=D.parent;B;B=B.parent){let $=B.options.filter((_)=>!_.hidden);F.push(...$)}if(this.sortOptions)F.sort(this.compareOptions);return F}visibleArguments(D){if(D._argsDescription)D.registeredArguments.forEach((F)=>{F.description=F.description||D._argsDescription[F.name()]||""});if(D.registeredArguments.find((F)=>F.description))return D.registeredArguments;return[]}subcommandTerm(D){let F=D.registeredArguments.map((B)=>nQ(B)).join(" ");return D._name+(D._aliases[0]?"|"+D._aliases[0]:"")+(D.options.length?" [options]":"")+(F?" "+F:"")}optionTerm(D){return D.flags}argumentTerm(D){return D.name()}longestSubcommandTermLength(D,F){return F.visibleCommands(D).reduce((B,$)=>{return Math.max(B,this.displayWidth(F.styleSubcommandTerm(F.subcommandTerm($))))},0)}longestOptionTermLength(D,F){return F.visibleOptions(D).reduce((B,$)=>{return Math.max(B,this.displayWidth(F.styleOptionTerm(F.optionTerm($))))},0)}longestGlobalOptionTermLength(D,F){return F.visibleGlobalOptions(D).reduce((B,$)=>{return Math.max(B,this.displayWidth(F.styleOptionTerm(F.optionTerm($))))},0)}longestArgumentTermLength(D,F){return F.visibleArguments(D).reduce((B,$)=>{return Math.max(B,this.displayWidth(F.styleArgumentTerm(F.argumentTerm($))))},0)}commandUsage(D){let F=D._name;if(D._aliases[0])F=F+"|"+D._aliases[0];let B="";for(let $=D.parent;$;$=$.parent)B=$.name()+" "+B;return B+F+" "+D.usage()}commandDescription(D){return D.description()}subcommandDescription(D){return D.summary()||D.description()}optionDescription(D){let F=[];if(D.argChoices)F.push(`choices: ${D.argChoices.map((B)=>JSON.stringify(B)).join(", ")}`);if(D.defaultValue!==void 0){if(D.required||D.optional||D.isBoolean()&&typeof D.defaultValue==="boolean")F.push(`default: ${D.defaultValueDescription||JSON.stringify(D.defaultValue)}`)}if(D.presetArg!==void 0&&D.optional)F.push(`preset: ${JSON.stringify(D.presetArg)}`);if(D.envVar!==void 0)F.push(`env: ${D.envVar}`);if(F.length>0){let B=`(${F.join(", ")})`;if(D.description)return`${D.description} ${B}`;return B}return D.description}argumentDescription(D){let F=[];if(D.argChoices)F.push(`choices: ${D.argChoices.map((B)=>JSON.stringify(B)).join(", ")}`);if(D.defaultValue!==void 0)F.push(`default: ${D.defaultValueDescription||JSON.stringify(D.defaultValue)}`);if(F.length>0){let B=`(${F.join(", ")})`;if(D.description)return`${D.description} ${B}`;return B}return D.description}formatItemList(D,F,B){if(F.length===0)return[];return[B.styleTitle(D),...F,""]}groupItems(D,F,B){let $=new Map;return D.forEach((_)=>{let Q=B(_);if(!$.has(Q))$.set(Q,[])}),F.forEach((_)=>{let Q=B(_);if(!$.has(Q))$.set(Q,[]);$.get(Q).push(_)}),$}formatHelp(D,F){let B=F.padWidth(D,F),$=F.helpWidth??80;function _(X,z){return F.formatItem(X,B,z,F)}let Q=[`${F.styleTitle("Usage:")} ${F.styleUsage(F.commandUsage(D))}`,""],Y=F.commandDescription(D);if(Y.length>0)Q=Q.concat([F.boxWrap(F.styleCommandDescription(Y),$),""]);let q=F.visibleArguments(D).map((X)=>{return _(F.styleArgumentTerm(F.argumentTerm(X)),F.styleArgumentDescription(F.argumentDescription(X)))});if(Q=Q.concat(this.formatItemList("Arguments:",q,F)),this.groupItems(D.options,F.visibleOptions(D),(X)=>X.helpGroupHeading??"Options:").forEach((X,z)=>{let M=X.map((A)=>{return _(F.styleOptionTerm(F.optionTerm(A)),F.styleOptionDescription(F.optionDescription(A)))});Q=Q.concat(this.formatItemList(z,M,F))}),F.showGlobalOptions){let X=F.visibleGlobalOptions(D).map((z)=>{return _(F.styleOptionTerm(F.optionTerm(z)),F.styleOptionDescription(F.optionDescription(z)))});Q=Q.concat(this.formatItemList("Global Options:",X,F))}return this.groupItems(D.commands,F.visibleCommands(D),(X)=>X.helpGroup()||"Commands:").forEach((X,z)=>{let M=X.map((A)=>{return _(F.styleSubcommandTerm(F.subcommandTerm(A)),F.styleSubcommandDescription(F.subcommandDescription(A)))});Q=Q.concat(this.formatItemList(z,M,F))}),Q.join(`
37
- `)}displayWidth(D){return o7(D).length}styleTitle(D){return D}styleUsage(D){return D.split(" ").map((F)=>{if(F==="[options]")return this.styleOptionText(F);if(F==="[command]")return this.styleSubcommandText(F);if(F[0]==="["||F[0]==="<")return this.styleArgumentText(F);return this.styleCommandText(F)}).join(" ")}styleCommandDescription(D){return this.styleDescriptionText(D)}styleOptionDescription(D){return this.styleDescriptionText(D)}styleSubcommandDescription(D){return this.styleDescriptionText(D)}styleArgumentDescription(D){return this.styleDescriptionText(D)}styleDescriptionText(D){return D}styleOptionTerm(D){return this.styleOptionText(D)}styleSubcommandTerm(D){return D.split(" ").map((F)=>{if(F==="[options]")return this.styleOptionText(F);if(F[0]==="["||F[0]==="<")return this.styleArgumentText(F);return this.styleSubcommandText(F)}).join(" ")}styleArgumentTerm(D){return this.styleArgumentText(D)}styleOptionText(D){return D}styleArgumentText(D){return D}styleSubcommandText(D){return D}styleCommandText(D){return D}padWidth(D,F){return Math.max(F.longestOptionTermLength(D,F),F.longestGlobalOptionTermLength(D,F),F.longestSubcommandTermLength(D,F),F.longestArgumentTermLength(D,F))}preformatted(D){return/\n[^\S\r\n]/.test(D)}formatItem(D,F,B,$){let Q=" ".repeat(2);if(!B)return Q+D;let Y=D.padEnd(F+D.length-$.displayWidth(D)),q=2,J=(this.helpWidth??80)-F-q-2,X;if(J<this.minWidthToWrap||$.preformatted(B))X=B;else X=$.boxWrap(B,J).replace(/\n/g,`
38
- `+" ".repeat(F+q));return Q+Y+" ".repeat(q)+X.replace(/\n/g,`
39
- ${Q}`)}boxWrap(D,F){if(F<this.minWidthToWrap)return D;let B=D.split(/\r\n|\n/),$=/[\s]*[^\s]+/g,_=[];return B.forEach((Q)=>{let Y=Q.match($);if(Y===null){_.push("");return}let q=[Y.shift()],H=this.displayWidth(q[0]);Y.forEach((J)=>{let X=this.displayWidth(J);if(H+X<=F){q.push(J),H+=X;return}_.push(q.join(""));let z=J.trimStart();q=[z],H=this.displayWidth(z)}),_.push(q.join(""))}),_.join(`
40
- `)}}function o7(D){let F=/\x1b\[\d*(;\d*)*m/g;return D.replace(F,"")}sQ.Help=a7;sQ.stripColor=o7});var b1=d0((eQ)=>{var{InvalidArgumentError:rQ}=w3();class t7{constructor(D,F){this.flags=D,this.description=F||"",this.required=D.includes("<"),this.optional=D.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(D),this.mandatory=!1;let B=tQ(D);if(this.short=B.shortFlag,this.long=B.longFlag,this.negate=!1,this.long)this.negate=this.long.startsWith("--no-");this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(D,F){return this.defaultValue=D,this.defaultValueDescription=F,this}preset(D){return this.presetArg=D,this}conflicts(D){return this.conflictsWith=this.conflictsWith.concat(D),this}implies(D){let F=D;if(typeof D==="string")F={[D]:!0};return this.implied=Object.assign(this.implied||{},F),this}env(D){return this.envVar=D,this}argParser(D){return this.parseArg=D,this}makeOptionMandatory(D=!0){return this.mandatory=!!D,this}hideHelp(D=!0){return this.hidden=!!D,this}_collectValue(D,F){if(F===this.defaultValue||!Array.isArray(F))return[D];return F.push(D),F}choices(D){return this.argChoices=D.slice(),this.parseArg=(F,B)=>{if(!this.argChoices.includes(F))throw new rQ(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(F,B);return F},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return r7(this.name().replace(/^no-/,""));return r7(this.name())}helpGroup(D){return this.helpGroupHeading=D,this}is(D){return this.short===D||this.long===D}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class e7{constructor(D){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,D.forEach((F)=>{if(F.negate)this.negativeOptions.set(F.attributeName(),F);else this.positiveOptions.set(F.attributeName(),F)}),this.negativeOptions.forEach((F,B)=>{if(this.positiveOptions.has(B))this.dualOptions.add(B)})}valueFromOption(D,F){let B=F.attributeName();if(!this.dualOptions.has(B))return!0;let $=this.negativeOptions.get(B).presetArg,_=$!==void 0?$:!1;return F.negate===(_===D)}}function r7(D){return D.split("-").reduce((F,B)=>{return F+B[0].toUpperCase()+B.slice(1)})}function tQ(D){let F,B,$=/^-[^-]$/,_=/^--[^-]/,Q=D.split(/[ |,]+/).concat("guard");if($.test(Q[0]))F=Q.shift();if(_.test(Q[0]))B=Q.shift();if(!F&&$.test(Q[0]))F=Q.shift();if(!F&&_.test(Q[0]))F=B,B=Q.shift();if(Q[0].startsWith("-")){let Y=Q[0],q=`option creation failed due to '${Y}' in option flags '${D}'`;if(/^-[^-][^-]/.test(Y))throw Error(`${q}
74
+ rm -rf "${_}"
75
+ ocx profile show ${$} --global`,"CONFIG_ERROR",K$.CONFIG);this.profile=$;this.localDir=_;this.name="LocalProfileUnsupportedError"}}});import*as P4 from"path";function A4($,_){if(_.includes("\x00"))throw new U4("Path contains null bytes",_,"null_byte");if(P4.isAbsolute(_)||P4.win32.isAbsolute(_))throw new U4("Path must be relative",_,"absolute_path");if(/^[a-zA-Z]:/.test(_)||_.startsWith("\\\\"))throw new U4("Path contains Windows absolute",_,"windows_absolute");let U=P4.basename(_).toUpperCase().split(".")[0]??"";if(mZ.has(U))throw new U4("Path uses Windows reserved name",_,"windows_reserved");let v=_.normalize("NFC").replace(/\\/g,"/"),J=P4.resolve($),Y=P4.resolve(J,v),z=P4.relative(J,Y);if(z.startsWith("../")||z.startsWith("..\\")||z===".."||P4.isAbsolute(z))throw new U4("Path escapes base directory",_,"path_traversal");return Y}var U4,mZ;var X1=b(()=>{U4=class U4 extends Error{attemptedPath;reason;constructor($,_,U){super($);this.attemptedPath=_;this.reason=U;this.name="PathValidationError"}};mZ=new Set(["CON","PRN","AUX","NUL","COM1","COM2","COM3","COM4","COM5","COM6","COM7","COM8","COM9","LPT1","LPT2","LPT3","LPT4","LPT5","LPT6","LPT7","LPT8","LPT9"])});import{isAbsolute as gZ,normalize as zq}from"path";function r4($){if(!$.includes("/"))throw Error(`Invalid component reference: "${$}". Use format: alias/component`);let _=$.split("/");if(_.length>2)throw Error(`Invalid component reference: "${$}". Too many "/" separators. Use format: alias/component`);let[U,Q]=_;if(!U||!Q)throw Error(`Invalid component reference: "${$}". Both alias and component are required.`);return{namespace:U,component:Q}}function GJ($,_){return`${$}/${_}`}function XJ($){if(gZ($))throw new M(`Invalid path: "${$}" - absolute paths not allowed`);if($.startsWith("~"))throw new M(`Invalid path: "${$}" - home directory paths not allowed`);if(zq($).startsWith(".."))throw new M(`Invalid path: "${$}" - path traversal not allowed`)}function Bq($){return $}function Yq($,_){if(hZ.has($))throw new M(`Target "${$}" is reserved for installer use`);try{A4("/dummy/base",$)}catch(Q){if(Q instanceof U4)throw new M(`Invalid target "${$}": ${Q.message}`);throw Q}if(_!=="profile"){let Q=zq($);if(Xq.some((J)=>Q===J||Q.startsWith(J)))throw new M(`Target path '${$}' is protected and cannot be overwritten by registry components`)}}function g6($,_){if(typeof $==="string"){XJ($);let U=Bq($);return Yq(U,_),{path:$,target:U}}return XJ($.path),XJ($.target),Yq($.target,_),$}function Zq($){if(typeof $==="string")return{type:"remote",url:$,enabled:!0};return $}function G1($){let _;if($.opencode){let{mcp:U,...Q}=$.opencode;_={...Q,...U&&{mcp:Object.fromEntries(Object.entries(U).map(([v,J])=>[v,Zq(J)]))}}}return{...$,files:$.files.map((U)=>g6(U,$.type)),opencode:_}}function Z0($){if($===null||$===void 0||typeof $!=="object")return null;let _=$;if(!Object.hasOwn(_,"$schema"))return{issue:"legacy-schema-v1",remediation:`This registry uses legacy schema v1 (missing $schema). Set "$schema" to "${p4}".`,supportedMajor:d4};let Q=_.$schema;if(typeof Q!=="string")return{issue:"invalid-schema-url",remediation:`Registry $schema must be a canonical URL like "${p4}".`,schemaUrl:String(Q),supportedMajor:d4};if(!Q)return{issue:"invalid-schema-url",remediation:`Registry $schema must be a canonical URL like "${p4}".`,schemaUrl:Q,supportedMajor:d4};if(Q===zJ)return{issue:"legacy-schema-v1",remediation:`Schema URL "${zJ}" is legacy v1. Use "${p4}" instead.`,schemaUrl:Q,supportedMajor:d4};let v=Q.match(sZ);if(!v)return{issue:"invalid-schema-url",remediation:`Registry $schema must be a canonical URL like "${p4}".`,schemaUrl:Q,supportedMajor:d4};let J=v[1];if(!J)return{issue:"invalid-schema-url",remediation:`Registry $schema must be a canonical URL like "${p4}".`,schemaUrl:Q,supportedMajor:d4};let Y=Number.parseInt(J,10);if(Y!==d4)return{issue:"unsupported-schema-version",remediation:`Schema major v${Y} is unsupported. Use "${p4}" (v${d4}).`,schemaUrl:Q,supportedMajor:d4,detectedMajor:Y};return null}var OS,d2,qJ,Iq,B0,hZ,Xq,cZ,lZ,qq,Gq,jq,Kq,dZ,pZ,iZ,nZ,rZ,oZ,tZ,aZ,Hq,Wq,bq,q1,sZ,P_,j1,x_,jJ;var o4=b(()=>{B6();l2();z$();X1();OS=K.string().refine(($)=>$.startsWith("npm:"),{message:'npm specifier must start with "npm:" prefix'}).refine(($)=>{let _=$.slice(4);if(!_)return!1;if(_.includes("..")||_.includes("/./"))return!1;return!0},{message:"Invalid npm specifier format"}),d2=K.string().min(1,"Name cannot be empty").max(64,"Name cannot exceed 64 characters").regex(/^[a-z0-9]+(-[a-z0-9]+)*$/,{message:"Must be lowercase alphanumeric with single hyphen separators (e.g., 'my-component', 'my-plugin'). Cannot start/end with hyphen or have consecutive hyphens."}),qJ=K.string().regex(/^[a-z0-9]+(-[a-z0-9]+)*\/[a-z0-9]+(-[a-z0-9]+)*$/,{message:'Must be in format "alias/component" (e.g., "kdco/researcher"). Both parts must be lowercase alphanumeric with hyphens.'});Iq=K.string().refine(($)=>{let _=/^[a-z0-9]+(-[a-z0-9]+)*$/,U=/^[a-z0-9]+(-[a-z0-9]+)*\/[a-z0-9]+(-[a-z0-9]+)*$/;return _.test($)||U.test($)},{message:'Dependency must be either a bare name (e.g., "utils") or qualified (e.g., "acme/utils")'}),B0=K.enum(["agent","skill","plugin","command","tool","bundle","profile"]),hZ=new Set([".ocx","ocx.lock"]),Xq=[".ocx/","ocx.jsonc","package.json",".git/",".env","node_modules/"],cZ=K.string().min(1,"Target path cannot be empty").refine(($)=>{if($.startsWith("/")||/^[a-zA-Z]:/.test($))return!1;if($.includes("\x00"))return!1;return!0},{message:"Target path must be relative and safe (no absolute paths or null bytes)"}).refine(($)=>{return!Xq.some((_)=>$===_||$.startsWith(_))},{message:"Target path is protected and cannot be overwritten by registry components"}),lZ=K.object({clientId:K.string().optional(),scopes:K.array(K.string()).optional(),authUrl:K.string().optional(),tokenUrl:K.string().optional()}),qq=K.object({type:K.enum(["remote","local"]),url:K.string().optional(),command:K.union([K.string(),K.array(K.string())]).optional(),environment:K.record(K.string(),K.string()).optional(),headers:K.record(K.string(),K.string()).optional(),oauth:K.union([K.boolean(),lZ]).optional(),enabled:K.boolean().default(!0)}).refine(($)=>{if($.type==="remote"&&!$.url)return!1;if($.type==="local"&&!$.command)return!1;return!0},{message:"Remote MCP servers require 'url', local servers require 'command'"}),Gq=K.union([K.string(),qq]),jq=K.object({path:K.string().min(1,"File path cannot be empty"),target:K.string().min(1,"Target path cannot be empty")}),Kq=K.union([K.string().min(1,"File path cannot be empty"),jq]),dZ=K.object({api:K.string().optional(),headers:K.record(K.string(),K.string()).optional(),env:K.record(K.string(),K.string()).optional(),enabled:K.boolean().optional()}).passthrough(),pZ=K.object({command:K.union([K.string(),K.array(K.string())]).optional(),enabled:K.boolean().optional()}).passthrough(),iZ=K.object({command:K.union([K.string(),K.array(K.string())]).optional(),glob:K.string().optional()}).passthrough(),nZ=K.object({description:K.string().optional(),run:K.string().optional()}).passthrough(),rZ=K.object({disabled:K.boolean().optional()}).passthrough(),oZ=K.object({host:K.string().optional(),port:K.number().optional()}).passthrough(),tZ=K.record(K.string(),K.string()),aZ=K.object({include:K.array(K.string()).optional(),exclude:K.array(K.string()).optional()}).passthrough(),Hq=K.object({model:K.string().optional(),description:K.string().optional(),steps:K.number().int().positive().optional(),maxSteps:K.number().int().positive().optional(),mode:K.enum(["primary","subagent","all"]).optional(),tools:K.record(K.string(),K.boolean()).optional(),temperature:K.number().optional(),top_p:K.number().optional(),prompt:K.string().optional(),permission:K.record(K.string(),K.union([K.enum(["ask","allow","deny"]),K.record(K.string(),K.enum(["ask","allow","deny"]))])).optional(),color:K.string().optional(),disable:K.boolean().optional(),options:K.record(K.string(),K.any()).optional()}),Wq=K.object({bash:K.union([K.enum(["ask","allow","deny"]),K.record(K.string(),K.enum(["ask","allow","deny"]))]).optional(),edit:K.union([K.enum(["ask","allow","deny"]),K.record(K.string(),K.enum(["ask","allow","deny"]))]).optional(),mcp:K.record(K.string(),K.enum(["ask","allow","deny"])).optional()}).catchall(K.union([K.enum(["ask","allow","deny"]),K.record(K.string(),K.enum(["ask","allow","deny"]))])),bq=K.object({$schema:K.string().optional(),theme:K.string().optional(),logLevel:K.string().optional(),username:K.string().optional(),model:K.string().optional(),small_model:K.string().optional(),default_agent:K.string().optional(),mcp:K.record(K.string(),Gq).optional(),plugin:K.array(K.string()).optional(),tools:K.record(K.string(),K.boolean()).optional(),agent:K.record(K.string(),Hq).optional(),instructions:K.array(K.string()).optional(),permission:Wq.optional(),provider:K.record(K.string(),dZ).optional(),lsp:K.record(K.string(),pZ).optional(),formatter:K.record(K.string(),iZ).optional(),command:K.record(K.string(),nZ).optional(),tui:rZ.optional(),server:oZ.optional(),keybind:tZ.optional(),watcher:aZ.optional(),auto_update:K.boolean().optional(),auto_compact:K.boolean().optional(),share:K.union([K.boolean(),K.string()]).optional()}),q1=K.object({name:d2,type:B0,description:K.string().min(1).max(1024),files:K.array(Kq).default([]),dependencies:K.array(Iq).default([]),npmDependencies:K.array(K.string()).optional(),npmDevDependencies:K.array(K.string()).optional(),opencode:bq.optional()});sZ=new RegExp(`^https://${E_.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}/schemas/v([1-9]\\d*)/registry\\.json$`);P_=/^\d+\.\d+\.\d+(-[a-zA-Z0-9.-]+)?(\+[a-zA-Z0-9.-]+)?$/,j1=K.object({$schema:K.string().optional(),name:K.string().min(1,"Registry name cannot be empty"),version:K.string().regex(P_,{message:"Version must be valid semver"}),author:K.string().min(1,"Author cannot be empty"),opencode:K.string().regex(P_,{message:"OpenCode version must be valid semver"}).optional(),ocx:K.string().regex(P_,{message:"OCX version must be valid semver"}).optional(),components:K.array(q1)}).refine(($)=>{let _=new Set($.components.map((U)=>U.name));for(let U of $.components)for(let Q of U.dependencies)if(!Q.includes("/")&&!_.has(Q))return!1;return!0},{message:"Bare dependencies must reference components that exist in the registry. Use qualified references (e.g., 'other-registry/component') for cross-registry dependencies."}),x_=K.object({name:d2,"dist-tags":K.object({latest:K.string()}),versions:K.record(K.string(),q1)}),jJ=K.object({$schema:K.string().optional(),author:K.string(),opencode:K.string().regex(P_,{message:"OpenCode version must be valid semver"}).optional(),ocx:K.string().regex(P_,{message:"OCX version must be valid semver"}).optional(),components:K.array(K.object({name:d2,type:B0,description:K.string()}))})});import{mkdir as KJ}from"fs/promises";import{dirname as eZ,join as Y6}from"path";async function u_($){let{source:_,out:U}=$,Q=Bun.file(Y6(_,"registry.jsonc")),v=Bun.file(Y6(_,"registry.json")),J=await Q.exists(),Y=await v.exists();if(!J&&!Y)throw new z6("No registry.jsonc or registry.json found in source directory");let I=await(J?Q:v).text(),X=x$(I,[],{allowTrailingComma:!0}),q=Z0(X);if(q)throw new z6(`Registry schema compatibility failed (${q.issue})`,[q.remediation,...q.schemaUrl!==void 0?[`Invalid $schema: ${q.schemaUrl}`]:[]]);let G=j1.safeParse(X);if(!G.success){let A=G.error.issues.map((u)=>`${u.path.join(".")}: ${u.message}`);throw new z6("Registry validation failed",A)}let j=G.data,H=[];if($.dryRun){let A=[];for(let k of j.components){A.push({action:"create",target:`file:components/${k.name}.json`,details:{type:"packument"}});for(let O of k.files){let w=g6(O,k.type),v$=Y6(_,"files",w.path);if(!await Bun.file(v$).exists()){H.push(`${k.name}: Source file not found at ${v$}`);continue}A.push({action:"create",target:`file:components/${k.name}/${w.path}`,details:{source:v$}})}}A.push({action:"create",target:"file:index.json",details:{type:"registry index"}}),A.push({action:"create",target:"file:.well-known/ocx.json",details:{type:"discovery file"}});let u=A.filter((k)=>k.action==="create").length;return{dryRun:!0,command:"build",wouldPerform:A,validation:{passed:H.length===0,errors:H.length>0?H:void 0},summary:`Would build ${j.components.length} components, ${u} files to ${U}`}}let Z=Y6(U,"components");await KJ(Z,{recursive:!0});let V="1.0.0";for(let A of j.components){let u={name:A.name,versions:{[V]:A},"dist-tags":{latest:V}},k=Y6(Z,`${A.name}.json`);await Bun.write(k,JSON.stringify(u,null,2));for(let O of A.files){let w=g6(O,A.type),v$=Y6(_,"files",w.path),o=Y6(Z,A.name,w.path),Q$=eZ(o);if(!await Bun.file(v$).exists()){H.push(`${A.name}: Source file not found at ${v$}`);continue}await KJ(Q$,{recursive:!0});let D$=Bun.file(v$);await Bun.write(o,D$)}}if(H.length>0)throw new z6(`Build failed with ${H.length} errors`,H);let S={$schema:j.$schema,name:j.name,version:j.version,author:j.author,...j.opencode&&{opencode:j.opencode},...j.ocx&&{ocx:j.ocx},components:j.components.map((A)=>({name:A.name,type:A.type,description:A.description}))};await Bun.write(Y6(U,"index.json"),JSON.stringify(S,null,2));let T=Y6(U,".well-known");await KJ(T,{recursive:!0});let r={registry:"/index.json"};return await Bun.write(Y6(T,"ocx.json"),JSON.stringify(r,null,2)),{componentsCount:j.components.length,outputPath:U}}var z6;var p2=b(()=>{c4();o4();z6=class z6 extends Error{errors;constructor($,_=[]){super($);this.errors=_;this.name="BuildRegistryError"}}});import Vq from"path";function Dq($){return Vq.posix.isAbsolute($)||Vq.win32.isAbsolute($)}var Mq=()=>{};var HJ;var WJ=b(()=>{B6();Mq();HJ=K.string().refine(($)=>!$.includes("\x00"),"Path cannot contain null bytes").refine(($)=>!$.split(/[/\\]/).some((_)=>_===".."),"Path cannot contain '..'").refine(($)=>!Dq($),"Path must be relative, not absolute")});function d$($){return $.trim().replace(/\/+$/,"")}import{existsSync as V0}from"fs";import{mkdir as Lq}from"fs/promises";import Z6 from"path";function C_($,_,U,Q){return`${d$($)}::${_}/${U}@${Q}`}function c6($){if(!$.includes("::"))throw Error(`Invalid canonical ID: "${$}". Expected format: registryUrl::registryName/component@revision`);let[_,U]=$.split("::");if(!U||!_)throw Error(`Invalid canonical ID: "${$}". Expected format: registryUrl::registryName/component@revision`);if(!U.includes("@"))throw Error(`Invalid canonical ID: "${$}". Expected format: registryUrl::registryName/component@revision`);let Q=U.indexOf("@");if(Q===-1)throw Error(`Invalid canonical ID: missing revision in ${$}`);let v=U.slice(0,Q),J=U.slice(Q+1);if(!v||!J)throw Error(`Invalid canonical ID: "${$}". Expected format: registryUrl::registryName/component@revision`);if(!v.includes("/"))throw Error(`Invalid canonical ID: "${$}". Component must be qualified (registryName/component)`);let[Y,z]=v.split("/");if(!Y||!z)throw Error(`Invalid canonical ID: "${$}". Both registry name and component name are required`);return{registryUrl:d$(_),registryName:Y,name:z,revision:J}}function l6($){let _=Z6.join($,kq,Aq);return{path:_,exists:V0(_)}}async function F4($){let{path:_,exists:U}=l6($);if(!U)return null;let v=await Bun.file(_).text(),J=x$(v,[],{allowTrailingComma:!0});return Oq.parse(J)}async function x4($,_){let U=Z6.join($,kq,Aq);await Lq(Z6.dirname(U),{recursive:!0});let Q=JSON.stringify(_,null,2);await Bun.write(U,Q)}function d6($){let _=Z6.join($,bJ,y_),U=Z6.join($,y_),Q=V0(_),v=V0(U);if(Q&&v)throw Error(`Found ${y_} in both .opencode/ and project root. Please consolidate to one location (recommended: .opencode/${y_})`);if(Q)return{path:_,exists:!0};if(v)return{path:U,exists:!0};return{path:_,exists:!1}}function D0($,_){let U=Z6.join($,bJ,wq),Q=Z6.join($,wq);if(_?.isFlattened){if(V0(Q))return{path:Q,exists:!0};return{path:Q,exists:!1}}if(V0(U))return{path:U,exists:!0};if(V0(Q))return{path:Q,exists:!0};return{path:U,exists:!1}}async function u4($,_={}){let{path:U,exists:Q}=d6($);if(!Q)return null;let J=await Bun.file(U).text();try{let Y=x$(J,[],{allowTrailingComma:!0});return h6.parse(Y)}catch(Y){if(_.emitParseDiagnostics??!0)console.error(`Error parsing ${U}:`,Y);throw Y}}async function r2($,_,U){let Q=U??Z6.join($,bJ,y_);await Lq(Z6.dirname(Q),{recursive:!0});let v=JSON.stringify(_,null,2);await Bun.write(Q,v)}async function f_($,_){let{path:U,exists:Q}=D0($,_);if(!Q)return null;let J=await Bun.file(U).text(),Y=x$(J,[],{allowTrailingComma:!0});return n2.parse(Y)}var i2,h6,kq=".ocx",Aq="receipt.jsonc",Fq,Oq,$V,_V,n2,y_="ocx.jsonc",wq="ocx.lock",bJ=".opencode";var X4=b(()=>{c4();B6();o4();i2=K.object({url:K.string().url("Registry URL must be a valid URL"),headers:K.record(K.string(),K.string()).optional()}),h6=K.object({$schema:K.string().optional(),profile:K.string().optional(),registries:K.record(K.string(),i2).default({}),lockRegistries:K.boolean().default(!1),skipCompatCheck:K.boolean().default(!1)}),Fq=K.object({registryUrl:K.string(),registryName:K.string(),name:K.string(),revision:K.string(),hash:K.string(),files:K.array(K.object({path:K.string(),hash:K.string()})),installedAt:K.string(),updatedAt:K.string().optional(),owner:K.object({type:K.enum(["user","profile","system"]),id:K.string().optional()}).optional(),opencode:K.record(K.string(),K.unknown()).optional()}),Oq=K.object({version:K.literal(1),root:K.string().optional(),installed:K.record(K.string(),Fq).default({})}),$V=K.object({registry:K.string(),version:K.string(),hash:K.string(),files:K.array(K.string()),installedAt:K.string(),updatedAt:K.string().optional()}),_V=K.object({registry:K.string(),component:K.string(),version:K.string().optional(),hash:K.string(),installedAt:K.string()}),n2=K.object({lockVersion:K.literal(1),installedFrom:_V.optional(),installed:K.record(qJ,$V).default({})})});var{Glob:vV}=globalThis.Bun;var Nq,V6;var M0=b(()=>{B6();WJ();X4();Nq=K.string().refine(($)=>{try{return new vV($),!0}catch{return!1}},{message:"Invalid glob pattern"}),V6=K.object({$schema:K.string().optional(),bin:K.string().optional(),registries:K.record(K.string(),i2).default({}),componentPath:HJ.optional(),renameWindow:K.boolean().default(!0).describe("Set terminal/tmux window name when launching OpenCode"),exclude:K.array(Nq).default(["**/CLAUDE.md","**/CONTEXT.md","**/.opencode/**","**/opencode.jsonc","**/opencode.json"]).describe("Glob patterns for project files to exclude from OpenCode discovery"),include:K.array(Nq).default([]).describe("Glob patterns for project files to include (overrides exclude)")})});var BJ=b(()=>{WJ();X4();M0();o4()});var m_=N6((UV)=>{class ZJ extends Error{constructor($,_,U){super(U);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=_,this.exitCode=$,this.nestedError=void 0}}class Sq extends ZJ{constructor($){super(1,"commander.invalidArgument",$);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}UV.CommanderError=ZJ;UV.InvalidArgumentError=Sq});var o2=N6((IV)=>{var{InvalidArgumentError:YV}=m_();class Tq{constructor($,_){switch(this.description=_||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,$[0]){case"<":this.required=!0,this._name=$.slice(1,-1);break;case"[":this.required=!1,this._name=$.slice(1,-1);break;default:this.required=!0,this._name=$;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue($,_){if(_===this.defaultValue||!Array.isArray(_))return[$];return _.push($),_}default($,_){return this.defaultValue=$,this.defaultValueDescription=_,this}argParser($){return this.parseArg=$,this}choices($){return this.argChoices=$.slice(),this.parseArg=(_,U)=>{if(!this.argChoices.includes(_))throw new YV(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(_,U);return _},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function zV($){let _=$.name()+($.variadic===!0?"...":"");return $.required?"<"+_+">":"["+_+"]"}IV.Argument=Tq;IV.humanReadableArgName=zV});var VJ=N6((jV)=>{var{humanReadableArgName:GV}=o2();class Rq{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext($){this.helpWidth=this.helpWidth??$.helpWidth??80}visibleCommands($){let _=$.commands.filter((Q)=>!Q._hidden),U=$._getHelpCommand();if(U&&!U._hidden)_.push(U);if(this.sortSubcommands)_.sort((Q,v)=>{return Q.name().localeCompare(v.name())});return _}compareOptions($,_){let U=(Q)=>{return Q.short?Q.short.replace(/^-/,""):Q.long.replace(/^--/,"")};return U($).localeCompare(U(_))}visibleOptions($){let _=$.options.filter((Q)=>!Q.hidden),U=$._getHelpOption();if(U&&!U.hidden){let Q=U.short&&$._findOption(U.short),v=U.long&&$._findOption(U.long);if(!Q&&!v)_.push(U);else if(U.long&&!v)_.push($.createOption(U.long,U.description));else if(U.short&&!Q)_.push($.createOption(U.short,U.description))}if(this.sortOptions)_.sort(this.compareOptions);return _}visibleGlobalOptions($){if(!this.showGlobalOptions)return[];let _=[];for(let U=$.parent;U;U=U.parent){let Q=U.options.filter((v)=>!v.hidden);_.push(...Q)}if(this.sortOptions)_.sort(this.compareOptions);return _}visibleArguments($){if($._argsDescription)$.registeredArguments.forEach((_)=>{_.description=_.description||$._argsDescription[_.name()]||""});if($.registeredArguments.find((_)=>_.description))return $.registeredArguments;return[]}subcommandTerm($){let _=$.registeredArguments.map((U)=>GV(U)).join(" ");return $._name+($._aliases[0]?"|"+$._aliases[0]:"")+($.options.length?" [options]":"")+(_?" "+_:"")}optionTerm($){return $.flags}argumentTerm($){return $.name()}longestSubcommandTermLength($,_){return _.visibleCommands($).reduce((U,Q)=>{return Math.max(U,this.displayWidth(_.styleSubcommandTerm(_.subcommandTerm(Q))))},0)}longestOptionTermLength($,_){return _.visibleOptions($).reduce((U,Q)=>{return Math.max(U,this.displayWidth(_.styleOptionTerm(_.optionTerm(Q))))},0)}longestGlobalOptionTermLength($,_){return _.visibleGlobalOptions($).reduce((U,Q)=>{return Math.max(U,this.displayWidth(_.styleOptionTerm(_.optionTerm(Q))))},0)}longestArgumentTermLength($,_){return _.visibleArguments($).reduce((U,Q)=>{return Math.max(U,this.displayWidth(_.styleArgumentTerm(_.argumentTerm(Q))))},0)}commandUsage($){let _=$._name;if($._aliases[0])_=_+"|"+$._aliases[0];let U="";for(let Q=$.parent;Q;Q=Q.parent)U=Q.name()+" "+U;return U+_+" "+$.usage()}commandDescription($){return $.description()}subcommandDescription($){return $.summary()||$.description()}optionDescription($){let _=[];if($.argChoices)_.push(`choices: ${$.argChoices.map((U)=>JSON.stringify(U)).join(", ")}`);if($.defaultValue!==void 0){if($.required||$.optional||$.isBoolean()&&typeof $.defaultValue==="boolean")_.push(`default: ${$.defaultValueDescription||JSON.stringify($.defaultValue)}`)}if($.presetArg!==void 0&&$.optional)_.push(`preset: ${JSON.stringify($.presetArg)}`);if($.envVar!==void 0)_.push(`env: ${$.envVar}`);if(_.length>0){let U=`(${_.join(", ")})`;if($.description)return`${$.description} ${U}`;return U}return $.description}argumentDescription($){let _=[];if($.argChoices)_.push(`choices: ${$.argChoices.map((U)=>JSON.stringify(U)).join(", ")}`);if($.defaultValue!==void 0)_.push(`default: ${$.defaultValueDescription||JSON.stringify($.defaultValue)}`);if(_.length>0){let U=`(${_.join(", ")})`;if($.description)return`${$.description} ${U}`;return U}return $.description}formatItemList($,_,U){if(_.length===0)return[];return[U.styleTitle($),..._,""]}groupItems($,_,U){let Q=new Map;return $.forEach((v)=>{let J=U(v);if(!Q.has(J))Q.set(J,[])}),_.forEach((v)=>{let J=U(v);if(!Q.has(J))Q.set(J,[]);Q.get(J).push(v)}),Q}formatHelp($,_){let U=_.padWidth($,_),Q=_.helpWidth??80;function v(q,G){return _.formatItem(q,U,G,_)}let J=[`${_.styleTitle("Usage:")} ${_.styleUsage(_.commandUsage($))}`,""],Y=_.commandDescription($);if(Y.length>0)J=J.concat([_.boxWrap(_.styleCommandDescription(Y),Q),""]);let z=_.visibleArguments($).map((q)=>{return v(_.styleArgumentTerm(_.argumentTerm(q)),_.styleArgumentDescription(_.argumentDescription(q)))});if(J=J.concat(this.formatItemList("Arguments:",z,_)),this.groupItems($.options,_.visibleOptions($),(q)=>q.helpGroupHeading??"Options:").forEach((q,G)=>{let j=q.map((H)=>{return v(_.styleOptionTerm(_.optionTerm(H)),_.styleOptionDescription(_.optionDescription(H)))});J=J.concat(this.formatItemList(G,j,_))}),_.showGlobalOptions){let q=_.visibleGlobalOptions($).map((G)=>{return v(_.styleOptionTerm(_.optionTerm(G)),_.styleOptionDescription(_.optionDescription(G)))});J=J.concat(this.formatItemList("Global Options:",q,_))}return this.groupItems($.commands,_.visibleCommands($),(q)=>q.helpGroup()||"Commands:").forEach((q,G)=>{let j=q.map((H)=>{return v(_.styleSubcommandTerm(_.subcommandTerm(H)),_.styleSubcommandDescription(_.subcommandDescription(H)))});J=J.concat(this.formatItemList(G,j,_))}),J.join(`
76
+ `)}displayWidth($){return Eq($).length}styleTitle($){return $}styleUsage($){return $.split(" ").map((_)=>{if(_==="[options]")return this.styleOptionText(_);if(_==="[command]")return this.styleSubcommandText(_);if(_[0]==="["||_[0]==="<")return this.styleArgumentText(_);return this.styleCommandText(_)}).join(" ")}styleCommandDescription($){return this.styleDescriptionText($)}styleOptionDescription($){return this.styleDescriptionText($)}styleSubcommandDescription($){return this.styleDescriptionText($)}styleArgumentDescription($){return this.styleDescriptionText($)}styleDescriptionText($){return $}styleOptionTerm($){return this.styleOptionText($)}styleSubcommandTerm($){return $.split(" ").map((_)=>{if(_==="[options]")return this.styleOptionText(_);if(_[0]==="["||_[0]==="<")return this.styleArgumentText(_);return this.styleSubcommandText(_)}).join(" ")}styleArgumentTerm($){return this.styleArgumentText($)}styleOptionText($){return $}styleArgumentText($){return $}styleSubcommandText($){return $}styleCommandText($){return $}padWidth($,_){return Math.max(_.longestOptionTermLength($,_),_.longestGlobalOptionTermLength($,_),_.longestSubcommandTermLength($,_),_.longestArgumentTermLength($,_))}preformatted($){return/\n[^\S\r\n]/.test($)}formatItem($,_,U,Q){let J=" ".repeat(2);if(!U)return J+$;let Y=$.padEnd(_+$.length-Q.displayWidth($)),z=2,X=(this.helpWidth??80)-_-z-2,q;if(X<this.minWidthToWrap||Q.preformatted(U))q=U;else q=Q.boxWrap(U,X).replace(/\n/g,`
77
+ `+" ".repeat(_+z));return J+Y+" ".repeat(z)+q.replace(/\n/g,`
78
+ ${J}`)}boxWrap($,_){if(_<this.minWidthToWrap)return $;let U=$.split(/\r\n|\n/),Q=/[\s]*[^\s]+/g,v=[];return U.forEach((J)=>{let Y=J.match(Q);if(Y===null){v.push("");return}let z=[Y.shift()],I=this.displayWidth(z[0]);Y.forEach((X)=>{let q=this.displayWidth(X);if(I+q<=_){z.push(X),I+=q;return}v.push(z.join(""));let G=X.trimStart();z=[G],I=this.displayWidth(G)}),v.push(z.join(""))}),v.join(`
79
+ `)}}function Eq($){let _=/\x1b\[\d*(;\d*)*m/g;return $.replace(_,"")}jV.Help=Rq;jV.stripColor=Eq});var DJ=N6((BV)=>{var{InvalidArgumentError:WV}=m_();class xq{constructor($,_){this.flags=$,this.description=_||"",this.required=$.includes("<"),this.optional=$.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test($),this.mandatory=!1;let U=bV($);if(this.short=U.shortFlag,this.long=U.longFlag,this.negate=!1,this.long)this.negate=this.long.startsWith("--no-");this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default($,_){return this.defaultValue=$,this.defaultValueDescription=_,this}preset($){return this.presetArg=$,this}conflicts($){return this.conflictsWith=this.conflictsWith.concat($),this}implies($){let _=$;if(typeof $==="string")_={[$]:!0};return this.implied=Object.assign(this.implied||{},_),this}env($){return this.envVar=$,this}argParser($){return this.parseArg=$,this}makeOptionMandatory($=!0){return this.mandatory=!!$,this}hideHelp($=!0){return this.hidden=!!$,this}_collectValue($,_){if(_===this.defaultValue||!Array.isArray(_))return[$];return _.push($),_}choices($){return this.argChoices=$.slice(),this.parseArg=(_,U)=>{if(!this.argChoices.includes(_))throw new WV(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(_,U);return _},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return Pq(this.name().replace(/^no-/,""));return Pq(this.name())}helpGroup($){return this.helpGroupHeading=$,this}is($){return this.short===$||this.long===$}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class uq{constructor($){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,$.forEach((_)=>{if(_.negate)this.negativeOptions.set(_.attributeName(),_);else this.positiveOptions.set(_.attributeName(),_)}),this.negativeOptions.forEach((_,U)=>{if(this.positiveOptions.has(U))this.dualOptions.add(U)})}valueFromOption($,_){let U=_.attributeName();if(!this.dualOptions.has(U))return!0;let Q=this.negativeOptions.get(U).presetArg,v=Q!==void 0?Q:!1;return _.negate===(v===$)}}function Pq($){return $.split("-").reduce((_,U)=>{return _+U[0].toUpperCase()+U.slice(1)})}function bV($){let _,U,Q=/^-[^-]$/,v=/^--[^-]/,J=$.split(/[ |,]+/).concat("guard");if(Q.test(J[0]))_=J.shift();if(v.test(J[0]))U=J.shift();if(!_&&Q.test(J[0]))_=J.shift();if(!_&&v.test(J[0]))_=U,U=J.shift();if(J[0].startsWith("-")){let Y=J[0],z=`option creation failed due to '${Y}' in option flags '${$}'`;if(/^-[^-][^-]/.test(Y))throw Error(`${z}
41
80
  - a short flag is a single dash and a single character
42
81
  - either use a single dash and a single character (for a short flag)
43
- - or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if($.test(Y))throw Error(`${q}
44
- - too many short flags`);if(_.test(Y))throw Error(`${q}
45
- - too many long flags`);throw Error(`${q}
46
- - unrecognised flag format`)}if(F===void 0&&B===void 0)throw Error(`option creation failed due to no flags found in '${D}'.`);return{shortFlag:F,longFlag:B}}eQ.Option=t7;eQ.DualOptions=e7});var D9=d0((_Y)=>{function BY(D,F){if(Math.abs(D.length-F.length)>3)return Math.max(D.length,F.length);let B=[];for(let $=0;$<=D.length;$++)B[$]=[$];for(let $=0;$<=F.length;$++)B[0][$]=$;for(let $=1;$<=F.length;$++)for(let _=1;_<=D.length;_++){let Q=1;if(D[_-1]===F[$-1])Q=0;else Q=1;if(B[_][$]=Math.min(B[_-1][$]+1,B[_][$-1]+1,B[_-1][$-1]+Q),_>1&&$>1&&D[_-1]===F[$-2]&&D[_-2]===F[$-1])B[_][$]=Math.min(B[_][$],B[_-2][$-2]+1)}return B[D.length][F.length]}function $Y(D,F){if(!F||F.length===0)return"";F=Array.from(new Set(F));let B=D.startsWith("--");if(B)D=D.slice(2),F=F.map((Y)=>Y.slice(2));let $=[],_=3,Q=0.4;if(F.forEach((Y)=>{if(Y.length<=1)return;let q=BY(D,Y),H=Math.max(D.length,Y.length);if((H-q)/H>Q){if(q<_)_=q,$=[Y];else if(q===_)$.push(Y)}}),$.sort((Y,q)=>Y.localeCompare(q)),B)$=$.map((Y)=>`--${Y}`);if($.length>1)return`
47
- (Did you mean one of ${$.join(", ")}?)`;if($.length===1)return`
48
- (Did you mean ${$[0]}?)`;return""}_Y.suggestSimilar=$Y});var _9=d0((WY)=>{var YY=WF("events").EventEmitter,R1=WF("child_process"),q2=WF("path"),F8=WF("fs"),AD=WF("process"),{Argument:qY,humanReadableArgName:HY}=D8(),{CommanderError:Z1}=w3(),{Help:JY,stripColor:XY}=O1(),{Option:F9,DualOptions:GY}=b1(),{suggestSimilar:B9}=D9();class S1 extends YY{constructor(D){super();this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=D||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:(F)=>AD.stdout.write(F),writeErr:(F)=>AD.stderr.write(F),outputError:(F,B)=>B(F),getOutHelpWidth:()=>AD.stdout.isTTY?AD.stdout.columns:void 0,getErrHelpWidth:()=>AD.stderr.isTTY?AD.stderr.columns:void 0,getOutHasColors:()=>N1()??(AD.stdout.isTTY&&AD.stdout.hasColors?.()),getErrHasColors:()=>N1()??(AD.stderr.isTTY&&AD.stderr.hasColors?.()),stripColor:(F)=>XY(F)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(D){return this._outputConfiguration=D._outputConfiguration,this._helpOption=D._helpOption,this._helpCommand=D._helpCommand,this._helpConfiguration=D._helpConfiguration,this._exitCallback=D._exitCallback,this._storeOptionsAsProperties=D._storeOptionsAsProperties,this._combineFlagAndOptionalValue=D._combineFlagAndOptionalValue,this._allowExcessArguments=D._allowExcessArguments,this._enablePositionalOptions=D._enablePositionalOptions,this._showHelpAfterError=D._showHelpAfterError,this._showSuggestionAfterError=D._showSuggestionAfterError,this}_getCommandAndAncestors(){let D=[];for(let F=this;F;F=F.parent)D.push(F);return D}command(D,F,B){let $=F,_=B;if(typeof $==="object"&&$!==null)_=$,$=null;_=_||{};let[,Q,Y]=D.match(/([^ ]+) *(.*)/),q=this.createCommand(Q);if($)q.description($),q._executableHandler=!0;if(_.isDefault)this._defaultCommandName=q._name;if(q._hidden=!!(_.noHelp||_.hidden),q._executableFile=_.executableFile||null,Y)q.arguments(Y);if(this._registerCommand(q),q.parent=this,q.copyInheritedSettings(this),$)return this;return q}createCommand(D){return new S1(D)}createHelp(){return Object.assign(new JY,this.configureHelp())}configureHelp(D){if(D===void 0)return this._helpConfiguration;return this._helpConfiguration=D,this}configureOutput(D){if(D===void 0)return this._outputConfiguration;return this._outputConfiguration={...this._outputConfiguration,...D},this}showHelpAfterError(D=!0){if(typeof D!=="string")D=!!D;return this._showHelpAfterError=D,this}showSuggestionAfterError(D=!0){return this._showSuggestionAfterError=!!D,this}addCommand(D,F){if(!D._name)throw Error(`Command passed to .addCommand() must have a name
49
- - specify the name in Command constructor or using .name()`);if(F=F||{},F.isDefault)this._defaultCommandName=D._name;if(F.noHelp||F.hidden)D._hidden=!0;return this._registerCommand(D),D.parent=this,D._checkForBrokenPassThrough(),this}createArgument(D,F){return new qY(D,F)}argument(D,F,B,$){let _=this.createArgument(D,F);if(typeof B==="function")_.default($).argParser(B);else _.default(B);return this.addArgument(_),this}arguments(D){return D.trim().split(/ +/).forEach((F)=>{this.argument(F)}),this}addArgument(D){let F=this.registeredArguments.slice(-1)[0];if(F?.variadic)throw Error(`only the last argument can be variadic '${F.name()}'`);if(D.required&&D.defaultValue!==void 0&&D.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${D.name()}'`);return this.registeredArguments.push(D),this}helpCommand(D,F){if(typeof D==="boolean"){if(this._addImplicitHelpCommand=D,D&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let B=D??"help [command]",[,$,_]=B.match(/([^ ]+) *(.*)/),Q=F??"display help for command",Y=this.createCommand($);if(Y.helpOption(!1),_)Y.arguments(_);if(Q)Y.description(Q);if(this._addImplicitHelpCommand=!0,this._helpCommand=Y,D||F)this._initCommandGroup(Y);return this}addHelpCommand(D,F){if(typeof D!=="object")return this.helpCommand(D,F),this;return this._addImplicitHelpCommand=!0,this._helpCommand=D,this._initCommandGroup(D),this}_getHelpCommand(){if(this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))){if(this._helpCommand===void 0)this.helpCommand(void 0,void 0);return this._helpCommand}return null}hook(D,F){let B=["preSubcommand","preAction","postAction"];if(!B.includes(D))throw Error(`Unexpected value for event passed to hook : '${D}'.
50
- Expecting one of '${B.join("', '")}'`);if(this._lifeCycleHooks[D])this._lifeCycleHooks[D].push(F);else this._lifeCycleHooks[D]=[F];return this}exitOverride(D){if(D)this._exitCallback=D;else this._exitCallback=(F)=>{if(F.code!=="commander.executeSubCommandAsync")throw F};return this}_exit(D,F,B){if(this._exitCallback)this._exitCallback(new Z1(D,F,B));AD.exit(D)}action(D){let F=(B)=>{let $=this.registeredArguments.length,_=B.slice(0,$);if(this._storeOptionsAsProperties)_[$]=this;else _[$]=this.opts();return _.push(this),D.apply(this,_)};return this._actionHandler=F,this}createOption(D,F){return new F9(D,F)}_callParseArg(D,F,B,$){try{return D.parseArg(F,B)}catch(_){if(_.code==="commander.invalidArgument"){let Q=`${$} ${_.message}`;this.error(Q,{exitCode:_.exitCode,code:_.code})}throw _}}_registerOption(D){let F=D.short&&this._findOption(D.short)||D.long&&this._findOption(D.long);if(F){let B=D.long&&this._findOption(D.long)?D.long:D.short;throw Error(`Cannot add option '${D.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${B}'
51
- - already used by option '${F.flags}'`)}this._initOptionGroup(D),this.options.push(D)}_registerCommand(D){let F=($)=>{return[$.name()].concat($.aliases())},B=F(D).find(($)=>this._findCommand($));if(B){let $=F(this._findCommand(B)).join("|"),_=F(D).join("|");throw Error(`cannot add command '${_}' as already have command '${$}'`)}this._initCommandGroup(D),this.commands.push(D)}addOption(D){this._registerOption(D);let F=D.name(),B=D.attributeName();if(D.negate){let _=D.long.replace(/^--no-/,"--");if(!this._findOption(_))this.setOptionValueWithSource(B,D.defaultValue===void 0?!0:D.defaultValue,"default")}else if(D.defaultValue!==void 0)this.setOptionValueWithSource(B,D.defaultValue,"default");let $=(_,Q,Y)=>{if(_==null&&D.presetArg!==void 0)_=D.presetArg;let q=this.getOptionValue(B);if(_!==null&&D.parseArg)_=this._callParseArg(D,_,q,Q);else if(_!==null&&D.variadic)_=D._collectValue(_,q);if(_==null)if(D.negate)_=!1;else if(D.isBoolean()||D.optional)_=!0;else _="";this.setOptionValueWithSource(B,_,Y)};if(this.on("option:"+F,(_)=>{let Q=`error: option '${D.flags}' argument '${_}' is invalid.`;$(_,Q,"cli")}),D.envVar)this.on("optionEnv:"+F,(_)=>{let Q=`error: option '${D.flags}' value '${_}' from env '${D.envVar}' is invalid.`;$(_,Q,"env")});return this}_optionEx(D,F,B,$,_){if(typeof F==="object"&&F instanceof F9)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let Q=this.createOption(F,B);if(Q.makeOptionMandatory(!!D.mandatory),typeof $==="function")Q.default(_).argParser($);else if($ instanceof RegExp){let Y=$;$=(q,H)=>{let J=Y.exec(q);return J?J[0]:H},Q.default(_).argParser($)}else Q.default($);return this.addOption(Q)}option(D,F,B,$){return this._optionEx({},D,F,B,$)}requiredOption(D,F,B,$){return this._optionEx({mandatory:!0},D,F,B,$)}combineFlagAndOptionalValue(D=!0){return this._combineFlagAndOptionalValue=!!D,this}allowUnknownOption(D=!0){return this._allowUnknownOption=!!D,this}allowExcessArguments(D=!0){return this._allowExcessArguments=!!D,this}enablePositionalOptions(D=!0){return this._enablePositionalOptions=!!D,this}passThroughOptions(D=!0){return this._passThroughOptions=!!D,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(D=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!D,this}getOptionValue(D){if(this._storeOptionsAsProperties)return this[D];return this._optionValues[D]}setOptionValue(D,F){return this.setOptionValueWithSource(D,F,void 0)}setOptionValueWithSource(D,F,B){if(this._storeOptionsAsProperties)this[D]=F;else this._optionValues[D]=F;return this._optionValueSources[D]=B,this}getOptionValueSource(D){return this._optionValueSources[D]}getOptionValueSourceWithGlobals(D){let F;return this._getCommandAndAncestors().forEach((B)=>{if(B.getOptionValueSource(D)!==void 0)F=B.getOptionValueSource(D)}),F}_prepareUserArgs(D,F){if(D!==void 0&&!Array.isArray(D))throw Error("first parameter to parse must be array or undefined");if(F=F||{},D===void 0&&F.from===void 0){if(AD.versions?.electron)F.from="electron";let $=AD.execArgv??[];if($.includes("-e")||$.includes("--eval")||$.includes("-p")||$.includes("--print"))F.from="eval"}if(D===void 0)D=AD.argv;this.rawArgs=D.slice();let B;switch(F.from){case void 0:case"node":this._scriptPath=D[1],B=D.slice(2);break;case"electron":if(AD.defaultApp)this._scriptPath=D[1],B=D.slice(2);else B=D.slice(1);break;case"user":B=D.slice(0);break;case"eval":B=D.slice(1);break;default:throw Error(`unexpected parse option { from: '${F.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",B}parse(D,F){this._prepareForParse();let B=this._prepareUserArgs(D,F);return this._parseCommand([],B),this}async parseAsync(D,F){this._prepareForParse();let B=this._prepareUserArgs(D,F);return await this._parseCommand([],B),this}_prepareForParse(){if(this._savedState===null)this.saveStateBeforeParse();else this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
52
- - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(D,F,B){if(F8.existsSync(D))return;let $=F?`searched for local subcommand relative to directory '${F}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",_=`'${D}' does not exist
53
- - if '${B}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
82
+ - or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(Q.test(Y))throw Error(`${z}
83
+ - too many short flags`);if(v.test(Y))throw Error(`${z}
84
+ - too many long flags`);throw Error(`${z}
85
+ - unrecognised flag format`)}if(_===void 0&&U===void 0)throw Error(`option creation failed due to no flags found in '${$}'.`);return{shortFlag:_,longFlag:U}}BV.Option=xq;BV.DualOptions=uq});var yq=N6((wV)=>{function DV($,_){if(Math.abs($.length-_.length)>3)return Math.max($.length,_.length);let U=[];for(let Q=0;Q<=$.length;Q++)U[Q]=[Q];for(let Q=0;Q<=_.length;Q++)U[0][Q]=Q;for(let Q=1;Q<=_.length;Q++)for(let v=1;v<=$.length;v++){let J=1;if($[v-1]===_[Q-1])J=0;else J=1;if(U[v][Q]=Math.min(U[v-1][Q]+1,U[v][Q-1]+1,U[v-1][Q-1]+J),v>1&&Q>1&&$[v-1]===_[Q-2]&&$[v-2]===_[Q-1])U[v][Q]=Math.min(U[v][Q],U[v-2][Q-2]+1)}return U[$.length][_.length]}function MV($,_){if(!_||_.length===0)return"";_=Array.from(new Set(_));let U=$.startsWith("--");if(U)$=$.slice(2),_=_.map((Y)=>Y.slice(2));let Q=[],v=3,J=0.4;if(_.forEach((Y)=>{if(Y.length<=1)return;let z=DV($,Y),I=Math.max($.length,Y.length);if((I-z)/I>J){if(z<v)v=z,Q=[Y];else if(z===v)Q.push(Y)}}),Q.sort((Y,z)=>Y.localeCompare(z)),U)Q=Q.map((Y)=>`--${Y}`);if(Q.length>1)return`
86
+ (Did you mean one of ${Q.join(", ")}?)`;if(Q.length===1)return`
87
+ (Did you mean ${Q[0]}?)`;return""}wV.suggestSimilar=MV});var gq=N6((TV)=>{var kV=P1("events").EventEmitter,MJ=P1("child_process"),D6=P1("path"),t2=P1("fs"),Z$=P1("process"),{Argument:AV,humanReadableArgName:FV}=o2(),{CommanderError:wJ}=m_(),{Help:OV,stripColor:NV}=VJ(),{Option:Cq,DualOptions:SV}=DJ(),{suggestSimilar:fq}=yq();class kJ extends kV{constructor($){super();this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=$||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:(_)=>Z$.stdout.write(_),writeErr:(_)=>Z$.stderr.write(_),outputError:(_,U)=>U(_),getOutHelpWidth:()=>Z$.stdout.isTTY?Z$.stdout.columns:void 0,getErrHelpWidth:()=>Z$.stderr.isTTY?Z$.stderr.columns:void 0,getOutHasColors:()=>LJ()??(Z$.stdout.isTTY&&Z$.stdout.hasColors?.()),getErrHasColors:()=>LJ()??(Z$.stderr.isTTY&&Z$.stderr.hasColors?.()),stripColor:(_)=>NV(_)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings($){return this._outputConfiguration=$._outputConfiguration,this._helpOption=$._helpOption,this._helpCommand=$._helpCommand,this._helpConfiguration=$._helpConfiguration,this._exitCallback=$._exitCallback,this._storeOptionsAsProperties=$._storeOptionsAsProperties,this._combineFlagAndOptionalValue=$._combineFlagAndOptionalValue,this._allowExcessArguments=$._allowExcessArguments,this._enablePositionalOptions=$._enablePositionalOptions,this._showHelpAfterError=$._showHelpAfterError,this._showSuggestionAfterError=$._showSuggestionAfterError,this}_getCommandAndAncestors(){let $=[];for(let _=this;_;_=_.parent)$.push(_);return $}command($,_,U){let Q=_,v=U;if(typeof Q==="object"&&Q!==null)v=Q,Q=null;v=v||{};let[,J,Y]=$.match(/([^ ]+) *(.*)/),z=this.createCommand(J);if(Q)z.description(Q),z._executableHandler=!0;if(v.isDefault)this._defaultCommandName=z._name;if(z._hidden=!!(v.noHelp||v.hidden),z._executableFile=v.executableFile||null,Y)z.arguments(Y);if(this._registerCommand(z),z.parent=this,z.copyInheritedSettings(this),Q)return this;return z}createCommand($){return new kJ($)}createHelp(){return Object.assign(new OV,this.configureHelp())}configureHelp($){if($===void 0)return this._helpConfiguration;return this._helpConfiguration=$,this}configureOutput($){if($===void 0)return this._outputConfiguration;return this._outputConfiguration={...this._outputConfiguration,...$},this}showHelpAfterError($=!0){if(typeof $!=="string")$=!!$;return this._showHelpAfterError=$,this}showSuggestionAfterError($=!0){return this._showSuggestionAfterError=!!$,this}addCommand($,_){if(!$._name)throw Error(`Command passed to .addCommand() must have a name
88
+ - specify the name in Command constructor or using .name()`);if(_=_||{},_.isDefault)this._defaultCommandName=$._name;if(_.noHelp||_.hidden)$._hidden=!0;return this._registerCommand($),$.parent=this,$._checkForBrokenPassThrough(),this}createArgument($,_){return new AV($,_)}argument($,_,U,Q){let v=this.createArgument($,_);if(typeof U==="function")v.default(Q).argParser(U);else v.default(U);return this.addArgument(v),this}arguments($){return $.trim().split(/ +/).forEach((_)=>{this.argument(_)}),this}addArgument($){let _=this.registeredArguments.slice(-1)[0];if(_?.variadic)throw Error(`only the last argument can be variadic '${_.name()}'`);if($.required&&$.defaultValue!==void 0&&$.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${$.name()}'`);return this.registeredArguments.push($),this}helpCommand($,_){if(typeof $==="boolean"){if(this._addImplicitHelpCommand=$,$&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let U=$??"help [command]",[,Q,v]=U.match(/([^ ]+) *(.*)/),J=_??"display help for command",Y=this.createCommand(Q);if(Y.helpOption(!1),v)Y.arguments(v);if(J)Y.description(J);if(this._addImplicitHelpCommand=!0,this._helpCommand=Y,$||_)this._initCommandGroup(Y);return this}addHelpCommand($,_){if(typeof $!=="object")return this.helpCommand($,_),this;return this._addImplicitHelpCommand=!0,this._helpCommand=$,this._initCommandGroup($),this}_getHelpCommand(){if(this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))){if(this._helpCommand===void 0)this.helpCommand(void 0,void 0);return this._helpCommand}return null}hook($,_){let U=["preSubcommand","preAction","postAction"];if(!U.includes($))throw Error(`Unexpected value for event passed to hook : '${$}'.
89
+ Expecting one of '${U.join("', '")}'`);if(this._lifeCycleHooks[$])this._lifeCycleHooks[$].push(_);else this._lifeCycleHooks[$]=[_];return this}exitOverride($){if($)this._exitCallback=$;else this._exitCallback=(_)=>{if(_.code!=="commander.executeSubCommandAsync")throw _};return this}_exit($,_,U){if(this._exitCallback)this._exitCallback(new wJ($,_,U));Z$.exit($)}action($){let _=(U)=>{let Q=this.registeredArguments.length,v=U.slice(0,Q);if(this._storeOptionsAsProperties)v[Q]=this;else v[Q]=this.opts();return v.push(this),$.apply(this,v)};return this._actionHandler=_,this}createOption($,_){return new Cq($,_)}_callParseArg($,_,U,Q){try{return $.parseArg(_,U)}catch(v){if(v.code==="commander.invalidArgument"){let J=`${Q} ${v.message}`;this.error(J,{exitCode:v.exitCode,code:v.code})}throw v}}_registerOption($){let _=$.short&&this._findOption($.short)||$.long&&this._findOption($.long);if(_){let U=$.long&&this._findOption($.long)?$.long:$.short;throw Error(`Cannot add option '${$.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${U}'
90
+ - already used by option '${_.flags}'`)}this._initOptionGroup($),this.options.push($)}_registerCommand($){let _=(Q)=>{return[Q.name()].concat(Q.aliases())},U=_($).find((Q)=>this._findCommand(Q));if(U){let Q=_(this._findCommand(U)).join("|"),v=_($).join("|");throw Error(`cannot add command '${v}' as already have command '${Q}'`)}this._initCommandGroup($),this.commands.push($)}addOption($){this._registerOption($);let _=$.name(),U=$.attributeName();if($.negate){let v=$.long.replace(/^--no-/,"--");if(!this._findOption(v))this.setOptionValueWithSource(U,$.defaultValue===void 0?!0:$.defaultValue,"default")}else if($.defaultValue!==void 0)this.setOptionValueWithSource(U,$.defaultValue,"default");let Q=(v,J,Y)=>{if(v==null&&$.presetArg!==void 0)v=$.presetArg;let z=this.getOptionValue(U);if(v!==null&&$.parseArg)v=this._callParseArg($,v,z,J);else if(v!==null&&$.variadic)v=$._collectValue(v,z);if(v==null)if($.negate)v=!1;else if($.isBoolean()||$.optional)v=!0;else v="";this.setOptionValueWithSource(U,v,Y)};if(this.on("option:"+_,(v)=>{let J=`error: option '${$.flags}' argument '${v}' is invalid.`;Q(v,J,"cli")}),$.envVar)this.on("optionEnv:"+_,(v)=>{let J=`error: option '${$.flags}' value '${v}' from env '${$.envVar}' is invalid.`;Q(v,J,"env")});return this}_optionEx($,_,U,Q,v){if(typeof _==="object"&&_ instanceof Cq)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let J=this.createOption(_,U);if(J.makeOptionMandatory(!!$.mandatory),typeof Q==="function")J.default(v).argParser(Q);else if(Q instanceof RegExp){let Y=Q;Q=(z,I)=>{let X=Y.exec(z);return X?X[0]:I},J.default(v).argParser(Q)}else J.default(Q);return this.addOption(J)}option($,_,U,Q){return this._optionEx({},$,_,U,Q)}requiredOption($,_,U,Q){return this._optionEx({mandatory:!0},$,_,U,Q)}combineFlagAndOptionalValue($=!0){return this._combineFlagAndOptionalValue=!!$,this}allowUnknownOption($=!0){return this._allowUnknownOption=!!$,this}allowExcessArguments($=!0){return this._allowExcessArguments=!!$,this}enablePositionalOptions($=!0){return this._enablePositionalOptions=!!$,this}passThroughOptions($=!0){return this._passThroughOptions=!!$,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties($=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!$,this}getOptionValue($){if(this._storeOptionsAsProperties)return this[$];return this._optionValues[$]}setOptionValue($,_){return this.setOptionValueWithSource($,_,void 0)}setOptionValueWithSource($,_,U){if(this._storeOptionsAsProperties)this[$]=_;else this._optionValues[$]=_;return this._optionValueSources[$]=U,this}getOptionValueSource($){return this._optionValueSources[$]}getOptionValueSourceWithGlobals($){let _;return this._getCommandAndAncestors().forEach((U)=>{if(U.getOptionValueSource($)!==void 0)_=U.getOptionValueSource($)}),_}_prepareUserArgs($,_){if($!==void 0&&!Array.isArray($))throw Error("first parameter to parse must be array or undefined");if(_=_||{},$===void 0&&_.from===void 0){if(Z$.versions?.electron)_.from="electron";let Q=Z$.execArgv??[];if(Q.includes("-e")||Q.includes("--eval")||Q.includes("-p")||Q.includes("--print"))_.from="eval"}if($===void 0)$=Z$.argv;this.rawArgs=$.slice();let U;switch(_.from){case void 0:case"node":this._scriptPath=$[1],U=$.slice(2);break;case"electron":if(Z$.defaultApp)this._scriptPath=$[1],U=$.slice(2);else U=$.slice(1);break;case"user":U=$.slice(0);break;case"eval":U=$.slice(1);break;default:throw Error(`unexpected parse option { from: '${_.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",U}parse($,_){this._prepareForParse();let U=this._prepareUserArgs($,_);return this._parseCommand([],U),this}async parseAsync($,_){this._prepareForParse();let U=this._prepareUserArgs($,_);return await this._parseCommand([],U),this}_prepareForParse(){if(this._savedState===null)this.saveStateBeforeParse();else this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
91
+ - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable($,_,U){if(t2.existsSync($))return;let Q=_?`searched for local subcommand relative to directory '${_}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",v=`'${$}' does not exist
92
+ - if '${U}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
54
93
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
55
- - ${$}`;throw Error(_)}_executeSubCommand(D,F){F=F.slice();let B=!1,$=[".js",".ts",".tsx",".mjs",".cjs"];function _(J,X){let z=q2.resolve(J,X);if(F8.existsSync(z))return z;if($.includes(q2.extname(X)))return;let M=$.find((A)=>F8.existsSync(`${z}${A}`));if(M)return`${z}${M}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let Q=D._executableFile||`${this._name}-${D._name}`,Y=this._executableDir||"";if(this._scriptPath){let J;try{J=F8.realpathSync(this._scriptPath)}catch{J=this._scriptPath}Y=q2.resolve(q2.dirname(J),Y)}if(Y){let J=_(Y,Q);if(!J&&!D._executableFile&&this._scriptPath){let X=q2.basename(this._scriptPath,q2.extname(this._scriptPath));if(X!==this._name)J=_(Y,`${X}-${D._name}`)}Q=J||Q}B=$.includes(q2.extname(Q));let q;if(AD.platform!=="win32")if(B)F.unshift(Q),F=$9(AD.execArgv).concat(F),q=R1.spawn(AD.argv[0],F,{stdio:"inherit"});else q=R1.spawn(Q,F,{stdio:"inherit"});else this._checkForMissingExecutable(Q,Y,D._name),F.unshift(Q),F=$9(AD.execArgv).concat(F),q=R1.spawn(AD.execPath,F,{stdio:"inherit"});if(!q.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((X)=>{AD.on(X,()=>{if(q.killed===!1&&q.exitCode===null)q.kill(X)})});let H=this._exitCallback;q.on("close",(J)=>{if(J=J??1,!H)AD.exit(J);else H(new Z1(J,"commander.executeSubCommandAsync","(close)"))}),q.on("error",(J)=>{if(J.code==="ENOENT")this._checkForMissingExecutable(Q,Y,D._name);else if(J.code==="EACCES")throw Error(`'${Q}' not executable`);if(!H)AD.exit(1);else{let X=new Z1(1,"commander.executeSubCommandAsync","(error)");X.nestedError=J,H(X)}}),this.runningCommand=q}_dispatchSubcommand(D,F,B){let $=this._findCommand(D);if(!$)this.help({error:!0});$._prepareForParse();let _;return _=this._chainOrCallSubCommandHook(_,$,"preSubcommand"),_=this._chainOrCall(_,()=>{if($._executableHandler)this._executeSubCommand($,F.concat(B));else return $._parseCommand(F,B)}),_}_dispatchHelpCommand(D){if(!D)this.help();let F=this._findCommand(D);if(F&&!F._executableHandler)F.help();return this._dispatchSubcommand(D,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((D,F)=>{if(D.required&&this.args[F]==null)this.missingArgument(D.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)return;if(this.args.length>this.registeredArguments.length)this._excessArguments(this.args)}_processArguments(){let D=(B,$,_)=>{let Q=$;if($!==null&&B.parseArg){let Y=`error: command-argument value '${$}' is invalid for argument '${B.name()}'.`;Q=this._callParseArg(B,$,_,Y)}return Q};this._checkNumberOfArguments();let F=[];this.registeredArguments.forEach((B,$)=>{let _=B.defaultValue;if(B.variadic){if($<this.args.length){if(_=this.args.slice($),B.parseArg)_=_.reduce((Q,Y)=>{return D(B,Y,Q)},B.defaultValue)}else if(_===void 0)_=[]}else if($<this.args.length){if(_=this.args[$],B.parseArg)_=D(B,_,B.defaultValue)}F[$]=_}),this.processedArgs=F}_chainOrCall(D,F){if(D?.then&&typeof D.then==="function")return D.then(()=>F());return F()}_chainOrCallHooks(D,F){let B=D,$=[];if(this._getCommandAndAncestors().reverse().filter((_)=>_._lifeCycleHooks[F]!==void 0).forEach((_)=>{_._lifeCycleHooks[F].forEach((Q)=>{$.push({hookedCommand:_,callback:Q})})}),F==="postAction")$.reverse();return $.forEach((_)=>{B=this._chainOrCall(B,()=>{return _.callback(_.hookedCommand,this)})}),B}_chainOrCallSubCommandHook(D,F,B){let $=D;if(this._lifeCycleHooks[B]!==void 0)this._lifeCycleHooks[B].forEach((_)=>{$=this._chainOrCall($,()=>{return _(this,F)})});return $}_parseCommand(D,F){let B=this.parseOptions(F);if(this._parseOptionsEnv(),this._parseOptionsImplied(),D=D.concat(B.operands),F=B.unknown,this.args=D.concat(F),D&&this._findCommand(D[0]))return this._dispatchSubcommand(D[0],D.slice(1),F);if(this._getHelpCommand()&&D[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(D[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(F),this._dispatchSubcommand(this._defaultCommandName,D,F);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(B.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let $=()=>{if(B.unknown.length>0)this.unknownOption(B.unknown[0])},_=`command:${this.name()}`;if(this._actionHandler){$(),this._processArguments();let Q;if(Q=this._chainOrCallHooks(Q,"preAction"),Q=this._chainOrCall(Q,()=>this._actionHandler(this.processedArgs)),this.parent)Q=this._chainOrCall(Q,()=>{this.parent.emit(_,D,F)});return Q=this._chainOrCallHooks(Q,"postAction"),Q}if(this.parent?.listenerCount(_))$(),this._processArguments(),this.parent.emit(_,D,F);else if(D.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",D,F);if(this.listenerCount("command:*"))this.emit("command:*",D,F);else if(this.commands.length)this.unknownCommand();else $(),this._processArguments()}else if(this.commands.length)$(),this.help({error:!0});else $(),this._processArguments()}_findCommand(D){if(!D)return;return this.commands.find((F)=>F._name===D||F._aliases.includes(D))}_findOption(D){return this.options.find((F)=>F.is(D))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((D)=>{D.options.forEach((F)=>{if(F.mandatory&&D.getOptionValue(F.attributeName())===void 0)D.missingMandatoryOptionValue(F)})})}_checkForConflictingLocalOptions(){let D=this.options.filter((B)=>{let $=B.attributeName();if(this.getOptionValue($)===void 0)return!1;return this.getOptionValueSource($)!=="default"});D.filter((B)=>B.conflictsWith.length>0).forEach((B)=>{let $=D.find((_)=>B.conflictsWith.includes(_.attributeName()));if($)this._conflictingOption(B,$)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((D)=>{D._checkForConflictingLocalOptions()})}parseOptions(D){let F=[],B=[],$=F;function _(J){return J.length>1&&J[0]==="-"}let Q=(J)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(J))return!1;return!this._getCommandAndAncestors().some((X)=>X.options.map((z)=>z.short).some((z)=>/^-\d$/.test(z)))},Y=null,q=null,H=0;while(H<D.length||q){let J=q??D[H++];if(q=null,J==="--"){if($===B)$.push(J);$.push(...D.slice(H));break}if(Y&&(!_(J)||Q(J))){this.emit(`option:${Y.name()}`,J);continue}if(Y=null,_(J)){let X=this._findOption(J);if(X){if(X.required){let z=D[H++];if(z===void 0)this.optionMissingArgument(X);this.emit(`option:${X.name()}`,z)}else if(X.optional){let z=null;if(H<D.length&&(!_(D[H])||Q(D[H])))z=D[H++];this.emit(`option:${X.name()}`,z)}else this.emit(`option:${X.name()}`);Y=X.variadic?X:null;continue}}if(J.length>2&&J[0]==="-"&&J[1]!=="-"){let X=this._findOption(`-${J[1]}`);if(X){if(X.required||X.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${X.name()}`,J.slice(2));else this.emit(`option:${X.name()}`),q=`-${J.slice(2)}`;continue}}if(/^--[^=]+=/.test(J)){let X=J.indexOf("="),z=this._findOption(J.slice(0,X));if(z&&(z.required||z.optional)){this.emit(`option:${z.name()}`,J.slice(X+1));continue}}if($===F&&_(J)&&!(this.commands.length===0&&Q(J)))$=B;if((this._enablePositionalOptions||this._passThroughOptions)&&F.length===0&&B.length===0){if(this._findCommand(J)){F.push(J),B.push(...D.slice(H));break}else if(this._getHelpCommand()&&J===this._getHelpCommand().name()){F.push(J,...D.slice(H));break}else if(this._defaultCommandName){B.push(J,...D.slice(H));break}}if(this._passThroughOptions){$.push(J,...D.slice(H));break}$.push(J)}return{operands:F,unknown:B}}opts(){if(this._storeOptionsAsProperties){let D={},F=this.options.length;for(let B=0;B<F;B++){let $=this.options[B].attributeName();D[$]=$===this._versionOptionName?this._version:this[$]}return D}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((D,F)=>Object.assign(D,F.opts()),{})}error(D,F){if(this._outputConfiguration.outputError(`${D}
94
+ - ${Q}`;throw Error(v)}_executeSubCommand($,_){_=_.slice();let U=!1,Q=[".js",".ts",".tsx",".mjs",".cjs"];function v(X,q){let G=D6.resolve(X,q);if(t2.existsSync(G))return G;if(Q.includes(D6.extname(q)))return;let j=Q.find((H)=>t2.existsSync(`${G}${H}`));if(j)return`${G}${j}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let J=$._executableFile||`${this._name}-${$._name}`,Y=this._executableDir||"";if(this._scriptPath){let X;try{X=t2.realpathSync(this._scriptPath)}catch{X=this._scriptPath}Y=D6.resolve(D6.dirname(X),Y)}if(Y){let X=v(Y,J);if(!X&&!$._executableFile&&this._scriptPath){let q=D6.basename(this._scriptPath,D6.extname(this._scriptPath));if(q!==this._name)X=v(Y,`${q}-${$._name}`)}J=X||J}U=Q.includes(D6.extname(J));let z;if(Z$.platform!=="win32")if(U)_.unshift(J),_=mq(Z$.execArgv).concat(_),z=MJ.spawn(Z$.argv[0],_,{stdio:"inherit"});else z=MJ.spawn(J,_,{stdio:"inherit"});else this._checkForMissingExecutable(J,Y,$._name),_.unshift(J),_=mq(Z$.execArgv).concat(_),z=MJ.spawn(Z$.execPath,_,{stdio:"inherit"});if(!z.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((q)=>{Z$.on(q,()=>{if(z.killed===!1&&z.exitCode===null)z.kill(q)})});let I=this._exitCallback;z.on("close",(X)=>{if(X=X??1,!I)Z$.exit(X);else I(new wJ(X,"commander.executeSubCommandAsync","(close)"))}),z.on("error",(X)=>{if(X.code==="ENOENT")this._checkForMissingExecutable(J,Y,$._name);else if(X.code==="EACCES")throw Error(`'${J}' not executable`);if(!I)Z$.exit(1);else{let q=new wJ(1,"commander.executeSubCommandAsync","(error)");q.nestedError=X,I(q)}}),this.runningCommand=z}_dispatchSubcommand($,_,U){let Q=this._findCommand($);if(!Q)this.help({error:!0});Q._prepareForParse();let v;return v=this._chainOrCallSubCommandHook(v,Q,"preSubcommand"),v=this._chainOrCall(v,()=>{if(Q._executableHandler)this._executeSubCommand(Q,_.concat(U));else return Q._parseCommand(_,U)}),v}_dispatchHelpCommand($){if(!$)this.help();let _=this._findCommand($);if(_&&!_._executableHandler)_.help();return this._dispatchSubcommand($,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach(($,_)=>{if($.required&&this.args[_]==null)this.missingArgument($.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)return;if(this.args.length>this.registeredArguments.length)this._excessArguments(this.args)}_processArguments(){let $=(U,Q,v)=>{let J=Q;if(Q!==null&&U.parseArg){let Y=`error: command-argument value '${Q}' is invalid for argument '${U.name()}'.`;J=this._callParseArg(U,Q,v,Y)}return J};this._checkNumberOfArguments();let _=[];this.registeredArguments.forEach((U,Q)=>{let v=U.defaultValue;if(U.variadic){if(Q<this.args.length){if(v=this.args.slice(Q),U.parseArg)v=v.reduce((J,Y)=>{return $(U,Y,J)},U.defaultValue)}else if(v===void 0)v=[]}else if(Q<this.args.length){if(v=this.args[Q],U.parseArg)v=$(U,v,U.defaultValue)}_[Q]=v}),this.processedArgs=_}_chainOrCall($,_){if($?.then&&typeof $.then==="function")return $.then(()=>_());return _()}_chainOrCallHooks($,_){let U=$,Q=[];if(this._getCommandAndAncestors().reverse().filter((v)=>v._lifeCycleHooks[_]!==void 0).forEach((v)=>{v._lifeCycleHooks[_].forEach((J)=>{Q.push({hookedCommand:v,callback:J})})}),_==="postAction")Q.reverse();return Q.forEach((v)=>{U=this._chainOrCall(U,()=>{return v.callback(v.hookedCommand,this)})}),U}_chainOrCallSubCommandHook($,_,U){let Q=$;if(this._lifeCycleHooks[U]!==void 0)this._lifeCycleHooks[U].forEach((v)=>{Q=this._chainOrCall(Q,()=>{return v(this,_)})});return Q}_parseCommand($,_){let U=this.parseOptions(_);if(this._parseOptionsEnv(),this._parseOptionsImplied(),$=$.concat(U.operands),_=U.unknown,this.args=$.concat(_),$&&this._findCommand($[0]))return this._dispatchSubcommand($[0],$.slice(1),_);if(this._getHelpCommand()&&$[0]===this._getHelpCommand().name())return this._dispatchHelpCommand($[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(_),this._dispatchSubcommand(this._defaultCommandName,$,_);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(U.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let Q=()=>{if(U.unknown.length>0)this.unknownOption(U.unknown[0])},v=`command:${this.name()}`;if(this._actionHandler){Q(),this._processArguments();let J;if(J=this._chainOrCallHooks(J,"preAction"),J=this._chainOrCall(J,()=>this._actionHandler(this.processedArgs)),this.parent)J=this._chainOrCall(J,()=>{this.parent.emit(v,$,_)});return J=this._chainOrCallHooks(J,"postAction"),J}if(this.parent?.listenerCount(v))Q(),this._processArguments(),this.parent.emit(v,$,_);else if($.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",$,_);if(this.listenerCount("command:*"))this.emit("command:*",$,_);else if(this.commands.length)this.unknownCommand();else Q(),this._processArguments()}else if(this.commands.length)Q(),this.help({error:!0});else Q(),this._processArguments()}_findCommand($){if(!$)return;return this.commands.find((_)=>_._name===$||_._aliases.includes($))}_findOption($){return this.options.find((_)=>_.is($))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(($)=>{$.options.forEach((_)=>{if(_.mandatory&&$.getOptionValue(_.attributeName())===void 0)$.missingMandatoryOptionValue(_)})})}_checkForConflictingLocalOptions(){let $=this.options.filter((U)=>{let Q=U.attributeName();if(this.getOptionValue(Q)===void 0)return!1;return this.getOptionValueSource(Q)!=="default"});$.filter((U)=>U.conflictsWith.length>0).forEach((U)=>{let Q=$.find((v)=>U.conflictsWith.includes(v.attributeName()));if(Q)this._conflictingOption(U,Q)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(($)=>{$._checkForConflictingLocalOptions()})}parseOptions($){let _=[],U=[],Q=_;function v(X){return X.length>1&&X[0]==="-"}let J=(X)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(X))return!1;return!this._getCommandAndAncestors().some((q)=>q.options.map((G)=>G.short).some((G)=>/^-\d$/.test(G)))},Y=null,z=null,I=0;while(I<$.length||z){let X=z??$[I++];if(z=null,X==="--"){if(Q===U)Q.push(X);Q.push(...$.slice(I));break}if(Y&&(!v(X)||J(X))){this.emit(`option:${Y.name()}`,X);continue}if(Y=null,v(X)){let q=this._findOption(X);if(q){if(q.required){let G=$[I++];if(G===void 0)this.optionMissingArgument(q);this.emit(`option:${q.name()}`,G)}else if(q.optional){let G=null;if(I<$.length&&(!v($[I])||J($[I])))G=$[I++];this.emit(`option:${q.name()}`,G)}else this.emit(`option:${q.name()}`);Y=q.variadic?q:null;continue}}if(X.length>2&&X[0]==="-"&&X[1]!=="-"){let q=this._findOption(`-${X[1]}`);if(q){if(q.required||q.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${q.name()}`,X.slice(2));else this.emit(`option:${q.name()}`),z=`-${X.slice(2)}`;continue}}if(/^--[^=]+=/.test(X)){let q=X.indexOf("="),G=this._findOption(X.slice(0,q));if(G&&(G.required||G.optional)){this.emit(`option:${G.name()}`,X.slice(q+1));continue}}if(Q===_&&v(X)&&!(this.commands.length===0&&J(X)))Q=U;if((this._enablePositionalOptions||this._passThroughOptions)&&_.length===0&&U.length===0){if(this._findCommand(X)){_.push(X),U.push(...$.slice(I));break}else if(this._getHelpCommand()&&X===this._getHelpCommand().name()){_.push(X,...$.slice(I));break}else if(this._defaultCommandName){U.push(X,...$.slice(I));break}}if(this._passThroughOptions){Q.push(X,...$.slice(I));break}Q.push(X)}return{operands:_,unknown:U}}opts(){if(this._storeOptionsAsProperties){let $={},_=this.options.length;for(let U=0;U<_;U++){let Q=this.options[U].attributeName();$[Q]=Q===this._versionOptionName?this._version:this[Q]}return $}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce(($,_)=>Object.assign($,_.opts()),{})}error($,_){if(this._outputConfiguration.outputError(`${$}
56
95
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==="string")this._outputConfiguration.writeErr(`${this._showHelpAfterError}
57
96
  `);else if(this._showHelpAfterError)this._outputConfiguration.writeErr(`
58
- `),this.outputHelp({error:!0});let B=F||{},$=B.exitCode||1,_=B.code||"commander.error";this._exit($,_,D)}_parseOptionsEnv(){this.options.forEach((D)=>{if(D.envVar&&D.envVar in AD.env){let F=D.attributeName();if(this.getOptionValue(F)===void 0||["default","config","env"].includes(this.getOptionValueSource(F)))if(D.required||D.optional)this.emit(`optionEnv:${D.name()}`,AD.env[D.envVar]);else this.emit(`optionEnv:${D.name()}`)}})}_parseOptionsImplied(){let D=new GY(this.options),F=(B)=>{return this.getOptionValue(B)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(B))};this.options.filter((B)=>B.implied!==void 0&&F(B.attributeName())&&D.valueFromOption(this.getOptionValue(B.attributeName()),B)).forEach((B)=>{Object.keys(B.implied).filter(($)=>!F($)).forEach(($)=>{this.setOptionValueWithSource($,B.implied[$],"implied")})})}missingArgument(D){let F=`error: missing required argument '${D}'`;this.error(F,{code:"commander.missingArgument"})}optionMissingArgument(D){let F=`error: option '${D.flags}' argument missing`;this.error(F,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(D){let F=`error: required option '${D.flags}' not specified`;this.error(F,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(D,F){let B=(Q)=>{let Y=Q.attributeName(),q=this.getOptionValue(Y),H=this.options.find((X)=>X.negate&&Y===X.attributeName()),J=this.options.find((X)=>!X.negate&&Y===X.attributeName());if(H&&(H.presetArg===void 0&&q===!1||H.presetArg!==void 0&&q===H.presetArg))return H;return J||Q},$=(Q)=>{let Y=B(Q),q=Y.attributeName();if(this.getOptionValueSource(q)==="env")return`environment variable '${Y.envVar}'`;return`option '${Y.flags}'`},_=`error: ${$(D)} cannot be used with ${$(F)}`;this.error(_,{code:"commander.conflictingOption"})}unknownOption(D){if(this._allowUnknownOption)return;let F="";if(D.startsWith("--")&&this._showSuggestionAfterError){let $=[],_=this;do{let Q=_.createHelp().visibleOptions(_).filter((Y)=>Y.long).map((Y)=>Y.long);$=$.concat(Q),_=_.parent}while(_&&!_._enablePositionalOptions);F=B9(D,$)}let B=`error: unknown option '${D}'${F}`;this.error(B,{code:"commander.unknownOption"})}_excessArguments(D){if(this._allowExcessArguments)return;let F=this.registeredArguments.length,B=F===1?"":"s",_=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${F} argument${B} but got ${D.length}.`;this.error(_,{code:"commander.excessArguments"})}unknownCommand(){let D=this.args[0],F="";if(this._showSuggestionAfterError){let $=[];this.createHelp().visibleCommands(this).forEach((_)=>{if($.push(_.name()),_.alias())$.push(_.alias())}),F=B9(D,$)}let B=`error: unknown command '${D}'${F}`;this.error(B,{code:"commander.unknownCommand"})}version(D,F,B){if(D===void 0)return this._version;this._version=D,F=F||"-V, --version",B=B||"output the version number";let $=this.createOption(F,B);return this._versionOptionName=$.attributeName(),this._registerOption($),this.on("option:"+$.name(),()=>{this._outputConfiguration.writeOut(`${D}
59
- `),this._exit(0,"commander.version",D)}),this}description(D,F){if(D===void 0&&F===void 0)return this._description;if(this._description=D,F)this._argsDescription=F;return this}summary(D){if(D===void 0)return this._summary;return this._summary=D,this}alias(D){if(D===void 0)return this._aliases[0];let F=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)F=this.commands[this.commands.length-1];if(D===F._name)throw Error("Command alias can't be the same as its name");let B=this.parent?._findCommand(D);if(B){let $=[B.name()].concat(B.aliases()).join("|");throw Error(`cannot add alias '${D}' to command '${this.name()}' as already have command '${$}'`)}return F._aliases.push(D),this}aliases(D){if(D===void 0)return this._aliases;return D.forEach((F)=>this.alias(F)),this}usage(D){if(D===void 0){if(this._usage)return this._usage;let F=this.registeredArguments.map((B)=>{return HY(B)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?F:[]).join(" ")}return this._usage=D,this}name(D){if(D===void 0)return this._name;return this._name=D,this}helpGroup(D){if(D===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=D,this}commandsGroup(D){if(D===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=D,this}optionsGroup(D){if(D===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=D,this}_initOptionGroup(D){if(this._defaultOptionGroup&&!D.helpGroupHeading)D.helpGroup(this._defaultOptionGroup)}_initCommandGroup(D){if(this._defaultCommandGroup&&!D.helpGroup())D.helpGroup(this._defaultCommandGroup)}nameFromFilename(D){return this._name=q2.basename(D,q2.extname(D)),this}executableDir(D){if(D===void 0)return this._executableDir;return this._executableDir=D,this}helpInformation(D){let F=this.createHelp(),B=this._getOutputContext(D);F.prepareContext({error:B.error,helpWidth:B.helpWidth,outputHasColors:B.hasColors});let $=F.formatHelp(this,F);if(B.hasColors)return $;return this._outputConfiguration.stripColor($)}_getOutputContext(D){D=D||{};let F=!!D.error,B,$,_;if(F)B=(Y)=>this._outputConfiguration.writeErr(Y),$=this._outputConfiguration.getErrHasColors(),_=this._outputConfiguration.getErrHelpWidth();else B=(Y)=>this._outputConfiguration.writeOut(Y),$=this._outputConfiguration.getOutHasColors(),_=this._outputConfiguration.getOutHelpWidth();return{error:F,write:(Y)=>{if(!$)Y=this._outputConfiguration.stripColor(Y);return B(Y)},hasColors:$,helpWidth:_}}outputHelp(D){let F;if(typeof D==="function")F=D,D=void 0;let B=this._getOutputContext(D),$={error:B.error,write:B.write,command:this};this._getCommandAndAncestors().reverse().forEach((Q)=>Q.emit("beforeAllHelp",$)),this.emit("beforeHelp",$);let _=this.helpInformation({error:B.error});if(F){if(_=F(_),typeof _!=="string"&&!Buffer.isBuffer(_))throw Error("outputHelp callback must return a string or a Buffer")}if(B.write(_),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",$),this._getCommandAndAncestors().forEach((Q)=>Q.emit("afterAllHelp",$))}helpOption(D,F){if(typeof D==="boolean"){if(D){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption(D??"-h, --help",F??"display help for command"),D||F)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(D){return this._helpOption=D,this._initOptionGroup(D),this}help(D){this.outputHelp(D);let F=Number(AD.exitCode??0);if(F===0&&D&&typeof D!=="function"&&D.error)F=1;this._exit(F,"commander.help","(outputHelp)")}addHelpText(D,F){let B=["beforeAll","before","after","afterAll"];if(!B.includes(D))throw Error(`Unexpected value for position to addHelpText.
60
- Expecting one of '${B.join("', '")}'`);let $=`${D}Help`;return this.on($,(_)=>{let Q;if(typeof F==="function")Q=F({error:_.error,command:_.command});else Q=F;if(Q)_.write(`${Q}
61
- `)}),this}_outputHelpIfRequested(D){let F=this._getHelpOption();if(F&&D.find(($)=>F.is($)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function $9(D){return D.map((F)=>{if(!F.startsWith("--inspect"))return F;let B,$="127.0.0.1",_="9229",Q;if((Q=F.match(/^(--inspect(-brk)?)$/))!==null)B=Q[1];else if((Q=F.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(B=Q[1],/^\d+$/.test(Q[3]))_=Q[3];else $=Q[3];else if((Q=F.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)B=Q[1],$=Q[3],_=Q[4];if(B&&_!=="0")return`${B}=${$}:${parseInt(_)+1}`;return F})}function N1(){if(AD.env.NO_COLOR||AD.env.FORCE_COLOR==="0"||AD.env.FORCE_COLOR==="false")return!1;if(AD.env.FORCE_COLOR||AD.env.CLICOLOR_FORCE!==void 0)return!0;return}WY.Command=S1;WY.useColor=N1});var H9=d0((KY)=>{var{Argument:Q9}=D8(),{Command:k1}=_9(),{CommanderError:AY,InvalidArgumentError:Y9}=w3(),{Help:jY}=O1(),{Option:q9}=b1();KY.program=new k1;KY.createCommand=(D)=>new k1(D);KY.createOption=(D,F)=>new q9(D,F);KY.createArgument=(D,F)=>new Q9(D,F);KY.Command=k1;KY.Option=q9;KY.Argument=Q9;KY.Help=jY;KY.CommanderError=AY;KY.InvalidArgumentError=Y9;KY.InvalidOptionArgumentError=Y9});var J9,WM,zM,MM,AM,jM,X9,KM,G9,UM,H2,VM;var B8=V(()=>{J9=f3(H9(),1),{program:WM,createCommand:zM,createArgument:MM,createOption:AM,CommanderError:jM,InvalidArgumentError:X9,InvalidOptionArgumentError:KM,Command:G9,Argument:UM,Option:H2,Help:VM}=J9.default});import{existsSync as z9,statSync as kY}from"fs";import{join as M9}from"path";function W9(D,F){let B=M9(D,F);if(!z9(B))return"missing";if(!kY(B).isDirectory())throw new U(`Component root "${F}" exists at "${B}" but is not a directory.`);return"directory"}function vY(D,F){let B=W9(D,F.singular),$=W9(D,F.plural);if(B==="directory"&&$==="directory")return F.plural;if(B==="directory")return F.singular;if($==="directory")return F.plural;return F.plural}function CY(D,F,B,$,_){if(!_)return;let Y=`${B===$.plural?$.singular:$.plural}/${_}`,q=M9(D,Y);if(!z9(q))return;throw new gD(`Cross-root logical collision for "${F}": selected root "${B}" but "${Y}" already exists.`)}function hF(D,F){let[B,...$]=D.split("/");if(!B)return D;let _=TY.get(B);if(!_)return D;let Q=vY(F,_),Y=$.join("/");if(CY(F,D,Q,_,Y),!Y)return Q;return`${Q}/${Y}`}var IY,TY;var I1=V(()=>{$D();IY={agent:"agents",command:"commands",plugin:"plugins",skill:"skills",tool:"tools",bundle:"bundles",profile:"profiles"},TY=new Map(Object.entries(IY).flatMap(([D,F])=>{let B={singular:D,plural:F};return[[D,B],[F,B]]}))});import{stat as uY}from"fs/promises";import{homedir as PY}from"os";import{isAbsolute as xY,join as A9,relative as yY,resolve as j9}from"path";function fY(D){let F=D.replace(/\\/g,"/");if(F===$8)return".";if(F.startsWith(T1))return F.slice(T1.length);return D}function X0(){let D=process.env.XDG_CONFIG_HOME,F=D&&xY(D)?D:A9(PY(),".config");return A9(F,"opencode")}async function K9(){try{return(await uY(X0())).isDirectory()}catch{return!1}}function n2(D,F,B){if(F){if(!B)return D;return hF(D,B)}let $=fY(D),_=B?j9(B):process.cwd(),Q=j9(_,$8),Y;try{Y=H0(Q,$)}catch(J){if(J instanceof aD)throw new U(`Invalid local target "${D}": ${J.message}`);throw J}let q=yY(Q,Y).replace(/\\/g,"/");if(q==="."||q==="")return $8;let H=B?hF(q,Q):q;return`${T1}${H}`}var $8=".opencode",T1;var k2=V(()=>{I1();$D();c2();T1=`${$8}/`});class V0{cwd;config;constructor(D,F){this.cwd=D,this.config=F}static async requireInitialized(D){let F=await U0(D);if(!F)throw new c("No ocx.jsonc found in .opencode/ or project root. Run 'ocx init' first.");return new V0(D,F)}getRegistries(){return this.config.registries}getComponentPath(){return".opencode"}}class mF{cwd;config;constructor(D,F){this.cwd=D,this.config=F}static async requireInitialized(){let D=X0();if(!await K9())throw new c("Global config not found. Run 'ocx init --global' first.");let F=await U0(D);if(!F)throw new c("Global config not found. Run 'ocx init --global' first.");return new mF(D,F)}getRegistries(){return this.config?.registries??{}}getComponentPath(){return""}}var gF=V(()=>{tD();$D();k2()});import{rename as U9,symlink as yM,unlink as V9}from"fs/promises";async function dF(D,F){let B=`${D}.tmp.${process.pid}`;try{await Bun.write(B,JSON.stringify(F,null,"\t"),{mode:384}),await U9(B,D)}catch($){try{await V9(B)}catch{}throw $}}async function E9(D,F){let B=`${F}.tmp.${process.pid}`;try{let _=await Bun.file(D).arrayBuffer();await Bun.write(B,_,{mode:384}),await U9(B,F)}catch($){try{await V9(B)}catch{}throw $}}var _8=()=>{};import{existsSync as L9,statSync as hY}from"fs";import{homedir as w9}from"os";import _0 from"path";function X2(){let D=process.env.XDG_CONFIG_HOME||_0.join(w9(),".config");return _0.join(D,"opencode","profiles")}function mY(D=process.cwd()){let F=o2(D);if(F)return _0.join(F,"profiles");return _0.join(D,s2,"profiles")}function yD(D){return _0.join(X2(),D)}function O9(D,F=process.cwd()){return _0.join(mY(F),D)}function Q0(D){return _0.join(yD(D),"ocx.jsonc")}function G2(D){return _0.join(yD(D),"opencode.jsonc")}function a2(D){return _0.join(yD(D),"AGENTS.md")}function o2(D){let F=D;while(!0){let B=_0.join(F,s2);if(L9(B)&&hY(B).isDirectory())return B;let $=_0.join(F,".git");if(L9($))return null;let _=_0.dirname(F);if(_===F)return null;F=_}}function I2(){let D=process.env.XDG_CONFIG_HOME||_0.join(w9(),".config");return _0.join(D,"opencode","ocx.jsonc")}var J2="ocx.jsonc",v1="opencode.jsonc",s2=".opencode";var G0=()=>{};var s0,pM;var Q8=V(()=>{_2();fF();s0=W.string().min(1,"Profile name is required").max(32,"Profile name must be 32 characters or less").regex(/^[a-zA-Z][a-zA-Z0-9._-]*$/,"Profile name must start with a letter and contain only alphanumeric characters, dots, underscores, or hyphens"),pM=W.object({name:s0,ocx:Y2,opencode:W.record(W.unknown()).optional(),hasAgents:W.boolean()})});import{mkdir as b9,readdir as gY,rename as dY,rm as cY,stat as C1}from"fs/promises";function pY(D){if(D.length===0)return"Unknown parse error";let F=D[0];if(!F)return"Unknown parse error";return`${K2(F.error)} at offset ${F.offset}`}function R9(D,F){let B=[],$=ND(D,B,{allowTrailingComma:!0});if(B.length>0){let _=pY(B);throw new c(`Invalid JSONC in ${F}: ${_}`)}return $}function iY(D,F,B){let $=Y2.safeParse(D);if(!$.success){let _=$.error.issues[0],Q=_?.path.length?_.path.join("."):"root",Y=_?.message??"Invalid profile OCX configuration";throw new c(`Invalid profile "${B}" ocx.jsonc at ${F}: ${Q} ${Y}`)}return $.data}function nY(D,F,B){if(!D||typeof D!=="object"||Array.isArray(D))throw new c(`Invalid profile "${B}" opencode.jsonc at ${F}: root must be an object`);return D}function Z9(D,F){if(D.trim().length===0)throw new c(`Invalid profile from ${F}: value cannot be empty or whitespace`);return D}class uD{cwd;constructor(D=process.cwd()){this.cwd=D}get profilesDir(){return X2()}static create(D){return new uD(D??process.cwd())}static async requireInitialized(){let D=uD.create();if(!await D.isInitialized())throw new CF;return D}async isInitialized(){try{return(await C1(this.profilesDir)).isDirectory()}catch{return!1}}async ensureInitialized(){if(!await this.isInitialized())throw new CF}async list(){return await this.ensureInitialized(),(await gY(this.profilesDir,{withFileTypes:!0,encoding:"utf8"})).filter((F)=>F.isDirectory()&&!F.name.startsWith(".")).map((F)=>F.name).sort()}async exists(D){let F=yD(D);try{return(await C1(F)).isDirectory()}catch{return!1}}async get(D){if(!await this.exists(D))throw new CD(D);let F=Q0(D),B=Bun.file(F);if(!await B.exists())throw new c(`Profile "${D}" is missing ocx.jsonc. Expected at: ${F}`);let $=await B.text(),_=R9($,F),Q=iY(_,F,D),Y=G2(D),q=Bun.file(Y),H;if(await q.exists()){let M=await q.text(),A=R9(M,Y);H=nY(A,Y,D)}let J=a2(D),z=await Bun.file(J).exists();return{name:D,ocx:Q,opencode:H,hasAgents:z}}async getLayered(D,F){let B=O9(D,F),$=!1;try{$=(await C1(B)).isDirectory()}catch{$=!1}if($)throw new W1(D,B);return this.get(D)}async add(D){let F=s0.safeParse(D);if(!F.success)throw new C0(D,F.error.errors[0]?.message??"Invalid name");if(await this.exists(D))throw new O2(D);let B=yD(D);await b9(B,{recursive:!0,mode:448});let $=Q0(D);if(!await Bun.file($).exists())await Bun.write($,lY,{mode:384});let Q=G2(D);if(!await Bun.file(Q).exists())await dF(Q,{});let q=a2(D);if(!await Bun.file(q).exists()){let J=`# Profile Instructions
97
+ `),this.outputHelp({error:!0});let U=_||{},Q=U.exitCode||1,v=U.code||"commander.error";this._exit(Q,v,$)}_parseOptionsEnv(){this.options.forEach(($)=>{if($.envVar&&$.envVar in Z$.env){let _=$.attributeName();if(this.getOptionValue(_)===void 0||["default","config","env"].includes(this.getOptionValueSource(_)))if($.required||$.optional)this.emit(`optionEnv:${$.name()}`,Z$.env[$.envVar]);else this.emit(`optionEnv:${$.name()}`)}})}_parseOptionsImplied(){let $=new SV(this.options),_=(U)=>{return this.getOptionValue(U)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(U))};this.options.filter((U)=>U.implied!==void 0&&_(U.attributeName())&&$.valueFromOption(this.getOptionValue(U.attributeName()),U)).forEach((U)=>{Object.keys(U.implied).filter((Q)=>!_(Q)).forEach((Q)=>{this.setOptionValueWithSource(Q,U.implied[Q],"implied")})})}missingArgument($){let _=`error: missing required argument '${$}'`;this.error(_,{code:"commander.missingArgument"})}optionMissingArgument($){let _=`error: option '${$.flags}' argument missing`;this.error(_,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue($){let _=`error: required option '${$.flags}' not specified`;this.error(_,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption($,_){let U=(J)=>{let Y=J.attributeName(),z=this.getOptionValue(Y),I=this.options.find((q)=>q.negate&&Y===q.attributeName()),X=this.options.find((q)=>!q.negate&&Y===q.attributeName());if(I&&(I.presetArg===void 0&&z===!1||I.presetArg!==void 0&&z===I.presetArg))return I;return X||J},Q=(J)=>{let Y=U(J),z=Y.attributeName();if(this.getOptionValueSource(z)==="env")return`environment variable '${Y.envVar}'`;return`option '${Y.flags}'`},v=`error: ${Q($)} cannot be used with ${Q(_)}`;this.error(v,{code:"commander.conflictingOption"})}unknownOption($){if(this._allowUnknownOption)return;let _="";if($.startsWith("--")&&this._showSuggestionAfterError){let Q=[],v=this;do{let J=v.createHelp().visibleOptions(v).filter((Y)=>Y.long).map((Y)=>Y.long);Q=Q.concat(J),v=v.parent}while(v&&!v._enablePositionalOptions);_=fq($,Q)}let U=`error: unknown option '${$}'${_}`;this.error(U,{code:"commander.unknownOption"})}_excessArguments($){if(this._allowExcessArguments)return;let _=this.registeredArguments.length,U=_===1?"":"s",v=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${_} argument${U} but got ${$.length}.`;this.error(v,{code:"commander.excessArguments"})}unknownCommand(){let $=this.args[0],_="";if(this._showSuggestionAfterError){let Q=[];this.createHelp().visibleCommands(this).forEach((v)=>{if(Q.push(v.name()),v.alias())Q.push(v.alias())}),_=fq($,Q)}let U=`error: unknown command '${$}'${_}`;this.error(U,{code:"commander.unknownCommand"})}version($,_,U){if($===void 0)return this._version;this._version=$,_=_||"-V, --version",U=U||"output the version number";let Q=this.createOption(_,U);return this._versionOptionName=Q.attributeName(),this._registerOption(Q),this.on("option:"+Q.name(),()=>{this._outputConfiguration.writeOut(`${$}
98
+ `),this._exit(0,"commander.version",$)}),this}description($,_){if($===void 0&&_===void 0)return this._description;if(this._description=$,_)this._argsDescription=_;return this}summary($){if($===void 0)return this._summary;return this._summary=$,this}alias($){if($===void 0)return this._aliases[0];let _=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)_=this.commands[this.commands.length-1];if($===_._name)throw Error("Command alias can't be the same as its name");let U=this.parent?._findCommand($);if(U){let Q=[U.name()].concat(U.aliases()).join("|");throw Error(`cannot add alias '${$}' to command '${this.name()}' as already have command '${Q}'`)}return _._aliases.push($),this}aliases($){if($===void 0)return this._aliases;return $.forEach((_)=>this.alias(_)),this}usage($){if($===void 0){if(this._usage)return this._usage;let _=this.registeredArguments.map((U)=>{return FV(U)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?_:[]).join(" ")}return this._usage=$,this}name($){if($===void 0)return this._name;return this._name=$,this}helpGroup($){if($===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=$,this}commandsGroup($){if($===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=$,this}optionsGroup($){if($===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=$,this}_initOptionGroup($){if(this._defaultOptionGroup&&!$.helpGroupHeading)$.helpGroup(this._defaultOptionGroup)}_initCommandGroup($){if(this._defaultCommandGroup&&!$.helpGroup())$.helpGroup(this._defaultCommandGroup)}nameFromFilename($){return this._name=D6.basename($,D6.extname($)),this}executableDir($){if($===void 0)return this._executableDir;return this._executableDir=$,this}helpInformation($){let _=this.createHelp(),U=this._getOutputContext($);_.prepareContext({error:U.error,helpWidth:U.helpWidth,outputHasColors:U.hasColors});let Q=_.formatHelp(this,_);if(U.hasColors)return Q;return this._outputConfiguration.stripColor(Q)}_getOutputContext($){$=$||{};let _=!!$.error,U,Q,v;if(_)U=(Y)=>this._outputConfiguration.writeErr(Y),Q=this._outputConfiguration.getErrHasColors(),v=this._outputConfiguration.getErrHelpWidth();else U=(Y)=>this._outputConfiguration.writeOut(Y),Q=this._outputConfiguration.getOutHasColors(),v=this._outputConfiguration.getOutHelpWidth();return{error:_,write:(Y)=>{if(!Q)Y=this._outputConfiguration.stripColor(Y);return U(Y)},hasColors:Q,helpWidth:v}}outputHelp($){let _;if(typeof $==="function")_=$,$=void 0;let U=this._getOutputContext($),Q={error:U.error,write:U.write,command:this};this._getCommandAndAncestors().reverse().forEach((J)=>J.emit("beforeAllHelp",Q)),this.emit("beforeHelp",Q);let v=this.helpInformation({error:U.error});if(_){if(v=_(v),typeof v!=="string"&&!Buffer.isBuffer(v))throw Error("outputHelp callback must return a string or a Buffer")}if(U.write(v),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",Q),this._getCommandAndAncestors().forEach((J)=>J.emit("afterAllHelp",Q))}helpOption($,_){if(typeof $==="boolean"){if($){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption($??"-h, --help",_??"display help for command"),$||_)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption($){return this._helpOption=$,this._initOptionGroup($),this}help($){this.outputHelp($);let _=Number(Z$.exitCode??0);if(_===0&&$&&typeof $!=="function"&&$.error)_=1;this._exit(_,"commander.help","(outputHelp)")}addHelpText($,_){let U=["beforeAll","before","after","afterAll"];if(!U.includes($))throw Error(`Unexpected value for position to addHelpText.
99
+ Expecting one of '${U.join("', '")}'`);let Q=`${$}Help`;return this.on(Q,(v)=>{let J;if(typeof _==="function")J=_({error:v.error,command:v.command});else J=_;if(J)v.write(`${J}
100
+ `)}),this}_outputHelpIfRequested($){let _=this._getHelpOption();if(_&&$.find((Q)=>_.is(Q)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function mq($){return $.map((_)=>{if(!_.startsWith("--inspect"))return _;let U,Q="127.0.0.1",v="9229",J;if((J=_.match(/^(--inspect(-brk)?)$/))!==null)U=J[1];else if((J=_.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(U=J[1],/^\d+$/.test(J[3]))v=J[3];else Q=J[3];else if((J=_.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)U=J[1],Q=J[3],v=J[4];if(U&&v!=="0")return`${U}=${Q}:${parseInt(v)+1}`;return _})}function LJ(){if(Z$.env.NO_COLOR||Z$.env.FORCE_COLOR==="0"||Z$.env.FORCE_COLOR==="false")return!1;if(Z$.env.FORCE_COLOR||Z$.env.CLICOLOR_FORCE!==void 0)return!0;return}TV.Command=kJ;TV.useColor=LJ});var dq=N6((uV)=>{var{Argument:hq}=o2(),{Command:AJ}=gq(),{CommanderError:PV,InvalidArgumentError:cq}=m_(),{Help:xV}=VJ(),{Option:lq}=DJ();uV.program=new AJ;uV.createCommand=($)=>new AJ($);uV.createOption=($,_)=>new lq($,_);uV.createArgument=($,_)=>new hq($,_);uV.Command=AJ;uV.Option=lq;uV.Argument=hq;uV.Help=xV;uV.CommanderError=PV;uV.InvalidArgumentError=cq;uV.InvalidOptionArgumentError=cq});var pq,VT,DT,MT,wT,LT,iq,kT,nq,AT,M6,FT;var a2=b(()=>{pq=tY(dq(),1),{program:VT,createCommand:DT,createArgument:MT,createOption:wT,CommanderError:LT,InvalidArgumentError:iq,InvalidOptionArgumentError:kT,Command:nq,Argument:AT,Option:M6,Help:FT}=pq.default});import{existsSync as oq,statSync as nV}from"fs";import{join as tq}from"path";function rq($,_){let U=tq($,_);if(!oq(U))return"missing";if(!nV(U).isDirectory())throw new M(`Component root "${_}" exists at "${U}" but is not a directory.`);return"directory"}function tV($,_){let U=rq($,_.singular),Q=rq($,_.plural);if(U==="directory"&&Q==="directory")return _.plural;if(U==="directory")return _.singular;if(Q==="directory")return _.plural;return _.plural}function aV($,_,U,Q,v){if(!v)return;let Y=`${U===Q.plural?Q.singular:Q.plural}/${v}`,z=tq($,Y);if(!oq(z))return;throw new t$(`Cross-root logical collision for "${_}": selected root "${U}" but "${Y}" already exists.`)}function w0($,_){let[U,...Q]=$.split("/");if(!U)return $;let v=oV.get(U);if(!v)return $;let J=tV(_,v),Y=Q.join("/");if(aV(_,$,J,v,Y),!Y)return J;return`${J}/${Y}`}var rV,oV;var FJ=b(()=>{z$();rV={agent:"agents",command:"commands",plugin:"plugins",skill:"skills",tool:"tools",bundle:"bundles",profile:"profiles"},oV=new Map(Object.entries(rV).flatMap(([$,_])=>{let U={singular:$,plural:_};return[[$,U],[_,U]]}))});import{stat as sV}from"fs/promises";import{homedir as eV}from"os";import{isAbsolute as $D,join as aq,relative as _D,resolve as sq}from"path";function vD($){let _=$.replace(/\\/g,"/");if(_===s2)return".";if(_.startsWith(OJ))return _.slice(OJ.length);return $}function O4(){let $=process.env.XDG_CONFIG_HOME,_=$&&$D($)?$:aq(eV(),".config");return aq(_,"opencode")}async function eq(){try{return(await sV(O4())).isDirectory()}catch{return!1}}function K1($,_,U){if(_){if(!U)return $;return w0($,U)}let Q=vD($),v=U?sq(U):process.cwd(),J=sq(v,s2),Y;try{Y=A4(J,Q)}catch(X){if(X instanceof U4)throw new M(`Invalid local target "${$}": ${X.message}`);throw X}let z=_D(J,Y).replace(/\\/g,"/");if(z==="."||z==="")return s2;let I=U?w0(z,J):z;return`${OJ}${I}`}var s2=".opencode",OJ;var p6=b(()=>{FJ();z$();X1();OJ=`${s2}/`});class y4{cwd;config;constructor($,_){this.cwd=$,this.config=_}static async requireInitialized($){let _=await u4($);if(!_)throw new n("No ocx.jsonc found in .opencode/ or project root. Run 'ocx init' first.");return new y4($,_)}getRegistries(){return this.config.registries}getComponentPath(){return".opencode"}}class L0{cwd;config;constructor($,_){this.cwd=$,this.config=_}static async requireInitialized(){let $=O4();if(!await eq())throw new n("Global config not found. Run 'ocx init --global' first.");let _=await u4($);if(!_)throw new n("Global config not found. Run 'ocx init --global' first.");return new L0($,_)}getRegistries(){return this.config?.registries??{}}getComponentPath(){return""}}var k0=b(()=>{X4();z$();p6()});import{rename as $G,symlink as dT,unlink as _G}from"fs/promises";async function A0($,_){let U=`${$}.tmp.${process.pid}`;try{await Bun.write(U,JSON.stringify(_,null,"\t"),{mode:384}),await $G(U,$)}catch(Q){try{await _G(U)}catch{}throw Q}}async function vG($,_){let U=`${_}.tmp.${process.pid}`;try{let v=await Bun.file($).arrayBuffer();await Bun.write(U,v,{mode:384}),await $G(U,_)}catch(Q){try{await _G(U)}catch{}throw Q}}var e2=()=>{};import{existsSync as UG,statSync as UD}from"fs";import{readFile as QD,stat as JD}from"fs/promises";import{homedir as YD}from"os";import g$ from"path";function zD($={}){let _=$.xdgConfigHome??process.env.XDG_CONFIG_HOME;if(_&&_.trim().length>0)return g$.resolve(_);let U=$.homeDir??YD();return g$.resolve(U,".config")}function QG($,_){let U=g$.resolve($),Q=g$.resolve(_),v=g$.relative(U,Q);if(v==="")return!0;if(v==="..")return!1;if(v.startsWith(`..${g$.sep}`))return!1;return!g$.isAbsolute(v)}function $8($={}){return g$.join(zD($),"opencode")}function SJ($,_={}){let U=$8(_);if(!QG(U,$))return"local-project";let Q=g$.join(U,"profiles");if(QG(Q,$))return"global-profile-root";return"global-root"}function w6($={}){return g$.join($8($),"profiles")}function ID($=process.cwd()){let _=b1($);if(_)return g$.join(_,"profiles");return g$.join($,H1,"profiles")}function p$($){return g$.join(w6(),$)}function JG($,_=process.cwd()){return g$.join(ID(_),$)}function B4($){return g$.join(p$($),"ocx.jsonc")}function L6($){return g$.join(p$($),"opencode.jsonc")}function W1($){return g$.join(p$($),"AGENTS.md")}function b1($){let _=$;while(!0){let U=g$.join(_,H1);if(UG(U)&&UD(U).isDirectory())return U;let Q=g$.join(_,".git");if(UG(Q))return null;let v=g$.dirname(_);if(v===_)return null;_=v}}function F0(){return g$.join($8(),t4)}async function YG($={}){let _=g$.join($8($),t4),U;try{U=await JD(_)}catch(Q){let v=Q.code;if(v==="ENOENT"||v==="ENOTDIR")throw new i6("missing",_);throw new i6("read-failed",_,Q instanceof Error?Q.message:String(Q))}if(!U.isFile())throw new i6("not-file",_);try{let Q=await QD(_,"utf8");return{path:_,content:Q}}catch(Q){throw new i6("read-failed",_,Q instanceof Error?Q.message:String(Q))}}var t4="ocx.jsonc",NJ="opencode.jsonc",H1=".opencode",i6;var Z4=b(()=>{i6=class i6 extends Error{reason;configPath;constructor($,_,U){let Q=$==="missing"?`Required global config is missing at "${_}".`:$==="not-file"?`Required global config target is not a file: "${_}".`:`Failed to read required global config at "${_}": ${U??"Unknown read error"}`;super(Q);this.reason=$;this.configPath=_;this.name="RequiredGlobalConfigReadError"}}});var I6,eT;var _8=b(()=>{B6();M0();I6=K.string().min(1,"Profile name is required").max(32,"Profile name must be 32 characters or less").regex(/^[a-zA-Z][a-zA-Z0-9._-]*$/,"Profile name must start with a letter and contain only alphanumeric characters, dots, underscores, or hyphens"),eT=K.object({name:I6,ocx:V6,opencode:K.record(K.string(),K.unknown()).optional(),hasAgents:K.boolean()})});import{mkdir as zG,readdir as XD,rename as qD,rm as GD,stat as TJ}from"fs/promises";function KD($){if($.length===0)return"Unknown parse error";let _=$[0];if(!_)return"Unknown parse error";return`${S6(_.error)} at offset ${_.offset}`}function IG($,_){let U=[],Q=x$($,U,{allowTrailingComma:!0});if(U.length>0){let v=KD(U);throw new n(`Invalid JSONC in ${_}: ${v}`)}return Q}function HD($,_,U){let Q=V6.safeParse($);if(!Q.success){let v=Q.error.issues[0],J=v?.path.length?v.path.join("."):"root",Y=v?.message??"Invalid profile OCX configuration";throw new n(`Invalid profile "${U}" ocx.jsonc at ${_}: ${J} ${Y}`)}return Q.data}function WD($,_,U){if(!$||typeof $!=="object"||Array.isArray($))throw new n(`Invalid profile "${U}" opencode.jsonc at ${_}: root must be an object`);return $}function XG($,_){if($.trim().length===0)throw new n(`Invalid profile from ${_}: value cannot be empty or whitespace`);return $}class h${cwd;constructor($=process.cwd()){this.cwd=$}get profilesDir(){return w6()}static create($){return new h$($??process.cwd())}static async requireInitialized(){let $=h$.create();if(!await $.isInitialized())throw new b0;return $}async isInitialized(){try{return(await TJ(this.profilesDir)).isDirectory()}catch{return!1}}async ensureInitialized(){if(!await this.isInitialized())throw new b0}async list(){return await this.ensureInitialized(),(await XD(this.profilesDir,{withFileTypes:!0,encoding:"utf8"})).filter((_)=>_.isDirectory()&&!_.name.startsWith(".")).map((_)=>_.name).sort()}async exists($){let _=p$($);try{return(await TJ(_)).isDirectory()}catch{return!1}}async get($){if(!await this.exists($))throw new m$($);let _=B4($),U=Bun.file(_);if(!await U.exists())throw new n(`Profile "${$}" is missing ocx.jsonc. Expected at: ${_}`);let Q=await U.text(),v=IG(Q,_),J=HD(v,_,$),Y=L6($),z=Bun.file(Y),I;if(await z.exists()){let j=await z.text(),H=IG(j,Y);I=WD(H,Y,$)}let X=W1($),G=await Bun.file(X).exists();return{name:$,ocx:J,opencode:I,hasAgents:G}}async getLayered($,_){let U=JG($,_),Q=!1;try{Q=(await TJ(U)).isDirectory()}catch{Q=!1}if(Q)throw new IJ($,U);return this.get($)}async add($){let _=I6.safeParse($);if(!_.success)throw new n4($,_.error.issues[0]?.message??"Invalid name");if(await this.exists($))throw new m6($);let U=p$($);await zG(U,{recursive:!0,mode:448});let Q=B4($);if(!await Bun.file(Q).exists())await Bun.write(Q,jD,{mode:384});let J=L6($);if(!await Bun.file(J).exists())await A0(J,{});let z=W1($);if(!await Bun.file(z).exists()){let X=`# Profile Instructions
62
101
 
63
102
  <!-- Add your custom instructions for this profile here -->
64
- <!-- These will be included when running \`ocx opencode -p ${D}\` -->
65
- `;await Bun.write(q,J,{mode:384})}}async remove(D){if(!await this.exists(D))throw new CD(D);if((await this.list()).length<=1)throw Error("Cannot delete the last profile. At least one profile must exist.");let B=yD(D);await cY(B,{recursive:!0})}async move(D,F){let B=s0.safeParse(D);if(!B.success)throw new C0(D,B.error.errors[0]?.message??"Invalid name");let $=s0.safeParse(F);if(!$.success)throw new C0(F,$.error.errors[0]?.message??"Invalid name");if(await this.ensureInitialized(),!await this.exists(D))throw new CD(D);if(D===F)return{warnActiveProfile:!1};if(await this.exists(F))throw new gD(`Cannot move: profile "${F}" already exists. Remove it first with 'ocx profile rm ${F} --global'.`);let _=process.env.OCX_PROFILE===D,Q=yD(D),Y=yD(F);try{await dY(Q,Y)}catch(q){if(q instanceof Error&&"code"in q){let H=q.code;if(H==="EEXIST"||H==="ENOTEMPTY")throw new gD(`Cannot move: profile "${F}" already exists. Remove it first with 'ocx profile rm ${F} --global'.`);if(H==="ENOENT")throw new CD(D)}throw q}return{warnActiveProfile:_}}async resolveProfile(D){if(D!==void 0){let $=Z9(D,"CLI option --profile");if(!await this.exists($))throw new CD($);return $}let F=process.env.OCX_PROFILE;if(F!==void 0){let $=Z9(F,"environment variable OCX_PROFILE");if(!await this.exists($))throw new CD($);return $}let B="default";if(!await this.exists(B))throw new CD(B);return B}async initialize(){await b9(this.profilesDir,{recursive:!0,mode:448}),await this.add("default")}}var N9,lY=`{
103
+ <!-- These will be included when running \`ocx opencode -p ${$}\` -->
104
+ `;await Bun.write(z,X,{mode:384})}}async remove($){if(!await this.exists($))throw new m$($);if((await this.list()).length<=1)throw Error("Cannot delete the last profile. At least one profile must exist.");let U=p$($);await GD(U,{recursive:!0})}async move($,_){let U=I6.safeParse($);if(!U.success)throw new n4($,U.error.issues[0]?.message??"Invalid name");let Q=I6.safeParse(_);if(!Q.success)throw new n4(_,Q.error.issues[0]?.message??"Invalid name");if(await this.ensureInitialized(),!await this.exists($))throw new m$($);if($===_)return{warnActiveProfile:!1};if(await this.exists(_))throw new t$(`Cannot move: profile "${_}" already exists. Remove it first with 'ocx profile rm ${_} --global'.`);let v=process.env.OCX_PROFILE===$,J=p$($),Y=p$(_);try{await qD(J,Y)}catch(z){if(z instanceof Error&&"code"in z){let I=z.code;if(I==="EEXIST"||I==="ENOTEMPTY")throw new t$(`Cannot move: profile "${_}" already exists. Remove it first with 'ocx profile rm ${_} --global'.`);if(I==="ENOENT")throw new m$($)}throw z}return{warnActiveProfile:v}}async resolveProfile($){if($!==void 0){let Q=XG($,"CLI option --profile");if(!await this.exists(Q))throw new m$(Q);return Q}let _=process.env.OCX_PROFILE;if(_!==void 0){let Q=XG(_,"environment variable OCX_PROFILE");if(!await this.exists(Q))throw new m$(Q);return Q}let U="default";if(!await this.exists(U))throw new m$(U);return U}async initialize(){await zG(this.profilesDir,{recursive:!0,mode:448}),await this.add("default")}}var qG,jD=`{
66
105
  "$schema": "https://ocx.kdco.dev/schemas/profile.json",
67
106
  "registries": {},
68
107
  "renameWindow": true,
@@ -76,157 +115,161 @@ Expecting one of '${B.join("', '")}'`);let $=`${D}Help`;return this.on($,(_)=>{l
76
115
  ],
77
116
  "include": []
78
117
  }
79
- `;var a0=V(()=>{b0();fF();$D();_8();G0();Q8();N9={$schema:"https://ocx.kdco.dev/schemas/profile.json",registries:{},renameWindow:!0,exclude:["**/CLAUDE.md","**/CONTEXT.md","**/.opencode/**","**/opencode.jsonc","**/opencode.json"],include:[]}});function S9(D,F,B){let $=(_)=>D(_,...F);return B===void 0?$:Object.assign($,{lazy:B,lazyArgs:F})}var k9=()=>{};function I9(D,F,B){let $=D.length-F.length;if($===0)return D(...F);if($===1)return S9(D,F,B);throw Error("Wrong number of arguments")}var T9=V(()=>{k9()});function u1(D){if(typeof D!="object"||!D)return!1;let F=Object.getPrototypeOf(D);return F===null||F===Object.prototype}var v9=()=>{};function P1(...D){return I9(C9,D)}function C9(D,F){let B={...D,...F};for(let $ in F){if(!($ in D))continue;let{[$]:_}=D;if(!u1(_))continue;let{[$]:Q}=F;u1(Q)&&(B[$]=C9(_,Q))}return B}var u9=V(()=>{T9();v9()});var P9=V(()=>{u9()});function x9(D){let F=D.startsWith("npm:"),B=F?D.slice(4):D;if(!B)return D;if(B.startsWith("@")){let Q=B.indexOf("/");if(Q===-1)return D;let q=B.slice(Q+1).indexOf("@");if(q===-1)return D;let H=B.slice(0,Q+1+q);return F?`npm:${H}`:H}let $=B.indexOf("@");if($===-1)return D;let _=B.slice(0,$);return F?`npm:${_}`:_}function sY(D){let F=new Map;for(let $=D.length-1;$>=0;$--){let _=D[$],Q=x9(_);if(!F.has(Q))F.set(Q,$)}let B=[];for(let[$,_]of D.entries()){let Q=x9(_);if(F.get(Q)===$)B.push(_)}return B}function Y8(D,F){let B=P1(D,F);if(Array.isArray(D.plugin)&&Array.isArray(F.plugin))B.plugin=sY([...D.plugin,...F.plugin]);else if(Array.isArray(D.plugin))B.plugin=D.plugin;else if(Array.isArray(F.plugin))B.plugin=F.plugin;if(Array.isArray(D.instructions)&&Array.isArray(F.instructions))B.instructions=Array.from(new Set([...D.instructions,...F.instructions]));else if(Array.isArray(D.instructions))B.instructions=D.instructions;else if(Array.isArray(F.instructions))B.instructions=F.instructions;return B}var x1=V(()=>{P9()});import{existsSync as aY,readFileSync as oY}from"fs";import{dirname as rY,isAbsolute as MA,resolve as y1}from"path";function tY(D){let F=y1(D);while(!0){let B=y1(F,".git");if(aY(B))try{let _=WF("fs").statSync(B);if(_.isDirectory())return F;if(_.isFile()){if(oY(B,"utf8").match(/^gitdir:\s*(.+)$/m)?.[1])return F}}catch{}let $=rY(F);if($===F)return null;F=$}}function f1(D){let F=y1(D);return tY(F)??F}var y9=()=>{};import{existsSync as eY}from"fs";import*as r2 from"path";var{Glob:Dq}=globalThis.Bun;function f9(D){return D.startsWith("http://")||D.startsWith("https://")}function Fq(D,F){if(f9(D))return;if(r2.isAbsolute(D)||r2.win32.isAbsolute(D))throw new U(`Absolute path not allowed in registry instructions: "${D}" (from ${F})`);if(D.startsWith("~"))throw new U(`Home directory path not allowed in registry instructions: "${D}" (from ${F})`);if(D.split(/[/\\]/).some(($)=>$===".."))throw new U(`Path traversal (..) not allowed in registry instructions: "${D}" (from ${F})`)}function Bq(D,F,B){if(f9(D))return[D];if(Fq(D,B),D.includes("*")||D.includes("?")||D.includes("[")){let Q=new Dq(D),Y=[];for(let q of Q.scanSync(F)){let H=r2.join(F,q);Y.push(H)}return Y}let _=r2.join(F,D);if(!eY(_))throw new U(`Registry instruction file not found: "${D}" (from ${B})
80
- Expected at: ${_}`);return[_]}function h9(D,F,B){let $=[],_=new Set;for(let Q of D){let Y=Bq(Q,F,B);for(let q of Y)if(!_.has(q))_.add(q),$.push(q)}return $}var m9=V(()=>{$D()});import{existsSync as t2,readFileSync as d9,statSync as $q}from"fs";import{homedir as _q}from"os";import{join as E0,relative as c9}from"path";var{Glob:q8}=globalThis.Bun;function Qq(D){return D==="local-config"||D==="cli"||D==="env"}function h1(D,F){if(D.trim().length===0)throw new c(`Invalid profile from ${F}: value cannot be empty or whitespace`);return D}function l9(D){if(D.length===0)return"Unknown parse error";let F=D[0];if(!F)return"Unknown parse error";return`${K2(F.error)} at offset ${F.offset}`}function g9(D){let F;try{F=d9(D,"utf8")}catch(Q){let Y=Q instanceof Error?Q.message:"Unknown read error";throw new c(`Failed to read local config at ${D}: ${Y}`)}let B=[],$=ND(F,B,{allowTrailingComma:!0});if(B.length>0){let Q=l9(B);throw new c(`Invalid JSONC in local config at ${D}: ${Q}`)}let _=R2.safeParse($);if(!_.success){let Q=_.error.issues[0],Y=Q?.path.length?Q.path.join("."):"root",q=Q?.message??"Invalid OCX config";throw new c(`Invalid local config at ${D}: ${Y} ${q}`)}return _.data}function Yq(D){let F;try{F=d9(D,"utf8")}catch(_){let Q=_ instanceof Error?_.message:"Unknown read error";throw new c(`Failed to read local OpenCode config at ${D}: ${Q}`)}let B=[],$=ND(F,B,{allowTrailingComma:!0});if(B.length>0){let _=l9(B);throw new c(`Invalid JSONC in local OpenCode config at ${D}: ${_}`)}if(!$||typeof $!=="object"||Array.isArray($))throw new c(`Invalid local OpenCode config at ${D}: root must be an object`);return $}function Hq(D,F,B){let $=[],_=F;while(!0){let Q=E0(_,D);if(t2(Q)&&$q(Q).isFile()){let q=c9(B,Q);$.push(q)}if(_===B)break;let Y=E0(_,"..");if(Y===_)break;_=Y}return $}function Jq(D,F){for(let B of qq){let $=Hq(B,D,F);if($.length>0)return $}return[]}function H8(D){return D.startsWith("./")?D.slice(2):D}function Xq(D,F,B){return D.filter(($)=>{for(let _ of B)if(new q8(H8(_)).match($))return!0;for(let _ of F)if(new q8(H8(_)).match($))return!1;return!0})}async function Gq(D){let F=await J0(D);if(!F||Object.keys(F.installed).length===0)return[];let B=[];for(let[$,_]of Object.entries(F.installed)){if(!_.opencode?.instructions)continue;let Q=_.opencode.instructions;if(!Array.isArray(Q))continue;let Y=`${_.registryName}/${_.name} (${$})`,q=h9(Q,D,Y);B.push(...q)}return Array.from(new Set(B))}class o0{cwd;profileName;profile;localConfigDir;registryInstructions;cachedConfig=null;constructor(D,F,B,$,_){this.cwd=D,this.profileName=F,this.profile=B,this.localConfigDir=$,this.registryInstructions=_}static async create(D,F){let B=uD.create(D),$=null,_="none",Q=o2(D);if(Q){let X=E0(Q,J2);if(t2(X)){let z=g9(X);if(z.profile!==void 0)$=h1(z.profile,`local config at ${X}`),_="local-config"}}if($===null){if(F?.profile!==void 0)$=h1(F.profile,"CLI option --profile"),_="cli";else if(process.env.OCX_PROFILE!==void 0)$=h1(process.env.OCX_PROFILE,"environment variable OCX_PROFILE"),_="env"}let Y=await B.isInitialized();if(Qq(_)&&!Y)throw new CF;let q=null;if(Y)if($!==null)q=await B.getLayered($,D);else try{$=await B.resolveProfile(),q=await B.getLayered($,D),_="default"}catch(X){if(!(X instanceof CD)||X.profile!=="default")throw X;$=null,q=null,_="none"}let H;if(q)H=yD($);else if(Q)H=E0(Q,"..");else H=X0();let J=await Gq(H);return new o0(D,$,q,Q,J)}resolve(){if(this.cachedConfig)return this.cachedConfig;let D={},F=s2,B={};if(this.profile){if(D={...D,...this.profile.ocx.registries},this.profile.ocx.componentPath)F=this.profile.ocx.componentPath;if(this.profile.opencode)B=this.mergeOpencode(B,this.profile.opencode)}let $=this.shouldLoadLocalConfig();if(!this.profile&&$&&this.localConfigDir){let Q=this.loadLocalOcxConfig();if(Q)D=Q.registries}if(this.localConfigDir){let Q=this.loadLocalOpencodeConfig();if(Q)B=this.mergeOpencode(B,Q)}let _=this.discoverInstructions();return this.cachedConfig={registries:D,componentPath:F,opencode:B,instructions:_,profileName:this.profileName},this.cachedConfig}resolveWithOrigin(){let D=new Map,F={},B=s2,$={};if(D.set("componentPath",{path:"",source:"default"}),this.profile){let Y=`~/.config/opencode/profiles/${this.profileName}/ocx.jsonc`;for(let[q,H]of Object.entries(this.profile.ocx.registries))F[q]=H,D.set(`registries.${q}`,{path:Y,source:"global-profile"});if(this.profile.ocx.componentPath)B=this.profile.ocx.componentPath,D.set("componentPath",{path:Y,source:"global-profile"});if(this.profile.opencode){$=this.mergeOpencode($,this.profile.opencode);let q=`~/.config/opencode/profiles/${this.profileName}/opencode.jsonc`;for(let H of Object.keys(this.profile.opencode))D.set(`opencode.${H}`,{path:q,source:"global-profile"})}}let _=this.shouldLoadLocalConfig();if(!this.profile&&_&&this.localConfigDir){let Y=this.loadLocalOcxConfig();if(Y){let q=E0(this.localConfigDir,J2);for(let[H,J]of Object.entries(Y.registries))F[H]=J,D.set(`registries.${H}`,{path:q,source:"local-config"})}}if(this.localConfigDir){let Y=this.loadLocalOpencodeConfig();if(Y){$=this.mergeOpencode($,Y);let q=E0(this.localConfigDir,v1);for(let H of Object.keys(Y))D.set(`opencode.${H}`,{path:q,source:"local-opencode"})}}let Q=this.discoverInstructions();return{registries:F,componentPath:B,opencode:$,instructions:Q,profileName:this.profileName,origins:D}}shouldLoadLocalConfig(){if(!this.profile?.ocx.exclude)return!0;if(!this.localConfigDir)return!0;let F=f1(this.cwd),B=c9(F,this.localConfigDir),$=this.profile.ocx.exclude??[],_=this.profile.ocx.include??[];for(let Q of _){let Y=new q8(H8(Q));if(Y.match(`${B}/`)||Y.match(B))return!0}for(let Q of $){let Y=new q8(H8(Q));if(Y.match(`${B}/`)||Y.match(`${B}/**`))return!1}return!0}loadLocalOcxConfig(){if(!this.localConfigDir)return null;let D=E0(this.localConfigDir,J2);if(!t2(D))return null;return{registries:g9(D).registries}}loadLocalOpencodeConfig(){if(!this.localConfigDir)return null;let D=E0(this.localConfigDir,v1);if(!t2(D))return null;return Yq(D)}discoverInstructions(){let D=[],F=X0(),B=E0(F,"AGENTS.md");if(t2(B))D.push(B);else if(!process.env.OPENCODE_DISABLE_CLAUDE_CODE_PROMPT){let X=E0(_q(),".claude","CLAUDE.md");if(t2(X))D.push(X)}if(this.profile&&this.profileName){let X=E0(yD(this.profileName),"AGENTS.md");if(t2(X))D.push(X)}let $=this.loadRegistryInstructions();D.push(...$);let _=f1(this.cwd),Q=Jq(this.cwd,_),Y=this.profile?.ocx.exclude??[],q=this.profile?.ocx.include??[],J=Xq(Q,Y,q).map((X)=>E0(_,X));return D.push(...J),D}loadRegistryInstructions(){return this.registryInstructions}mergeOpencode(D,F){return Y8(D,F)}getRegistries(){return this.resolve().registries}getComponentPath(){return this.resolve().componentPath}getProfileName(){return this.profileName}getCwd(){return this.cwd}getProfile(){return this.profile}}var qq;var O3=V(()=>{b0();a0();G0();x1();tD();$D();y9();m9();k2();qq=["AGENTS.md","CLAUDE.md","CONTEXT.md"]});function eD(D){return typeof D==="object"&&D!==null&&!Array.isArray(D)&&Object.getPrototypeOf(D)===Object.prototype}var r9={};j2(r9,{fetchRegistryIndex:()=>T2,fetchFileContent:()=>e2,fetchComponentVersion:()=>W8,fetchComponent:()=>R3,classifyRegistryIndexIssue:()=>o9,_clearFetcherCacheForTests:()=>Lq});import{posix as Wq}from"path";function Aq(D,F){return new v0(`Registry at ${D} uses an incompatible format (${F.issue}). ${F.remediation}`,{url:D,issue:F.issue,remediation:F.remediation,...F.schemaUrl!==void 0&&{schemaUrl:F.schemaUrl},...F.supportedMajor!==void 0&&{supportedMajor:F.supportedMajor},...F.detectedMajor!==void 0&&{detectedMajor:F.detectedMajor}})}function i9(D,F){if(typeof D!=="string")throw new U(`Invalid ${F}: expected string, got ${typeof D}`);let B=G8[D]??D,$=uF.safeParse(B);if(!$.success)throw new U(`Unsupported component type "${D}" in ${F}. Expected one of: ${uF.options.join(", ")}`);return $.data}function n9(D){return typeof D==="string"&&Object.hasOwn(G8,D)}function X8(D){return D.startsWith(".opencode/")||D.startsWith(".opencode\\")}function s9(D){if(!eD(D)||!Array.isArray(D.files))return[];let F=[];for(let[B,$]of D.files.entries()){if(typeof $==="string"){if(!X8($))continue;F.push({path:`files[${B}]`,target:$});continue}if(!eD($)||typeof $.target!=="string")continue;if(!X8($.target))continue;F.push({path:`files[${B}].target`,target:$.target})}return F}function jq(D){if(!eD(D))return[];let F=D.components;if(!Array.isArray(F))return[];let B=[];for(let[$,_]of F.entries()){if(!eD(_))continue;let Q=_.type;if(!n9(Q))continue;B.push({path:`components[${$}].type`,type:Q})}return B}function Kq(D){if(!eD(D))return!1;if(typeof D.type==="string"&&D.type.startsWith("ocx:"))return!0;return s9(D).length>0}async function Uq(D){let F=xD(D),B=b3.get(F);if(B)return B;try{await T2(F)}catch(_){if(_ instanceof RD||_ instanceof MD)return null;throw _}if(!b3.has(F))return null;let $=b3.get(F);if(!$)throw Error(`Missing registry schema mode cache entry for ${F}`);return $}function p9(D,F){if(D.includes("\x00"))throw new U(`Unsafe target "${D}" in ${F}: null bytes are not allowed`);if(D.includes("%"))throw new U(`Unsafe target "${D}" in ${F}: encoded paths are not allowed`);if(D.includes("\\"))throw new U(`Unsafe target "${D}" in ${F}: Windows separators are not allowed`);if(D.startsWith("/")||D.startsWith("//")||/^[a-zA-Z]:/.test(D))throw new U(`Unsafe target "${D}" in ${F}: absolute paths are not allowed`);let B=D.startsWith(".opencode/")?D.slice(10):D;if(!B)throw new U(`Unsafe target "${D}" in ${F}: missing path after .opencode/`);let $=B.split("/");if($.some((J)=>J.length===0))throw new U(`Unsafe target "${D}" in ${F}: empty path segments are not allowed`);if($.some((J)=>J==="."||J===".."))throw new U(`Unsafe target "${D}" in ${F}: traversal segments are not allowed`);let[_,...Q]=$;if(!_)throw new U(`Unsafe target "${D}" in ${F}: missing path root segment`);let q=[zq[_]??_,...Q].join("/"),H=Wq.normalize(q);if(H!==q)throw new U(`Unsafe target "${D}" in ${F}: path normalization is ambiguous`);if(H==="."||H===".."||H.startsWith("../"))throw new U(`Unsafe target "${D}" in ${F}: target escapes project root`);return H}function Vq(D,F){if(!eD(D))return D;let B={...D};if(Object.hasOwn(B,"type"))B.type=i9(B.type,`${F}.type`);if(Array.isArray(B.files))B.files=B.files.map(($,_)=>{if(typeof $==="string"){if(!X8($))return $;return p9($,`${F}.files[${_}]`)}if(!eD($))return $;let Q=$.target;if(typeof Q!=="string")return $;if(!X8(Q))return $;return{...$,target:p9(Q,`${F}.files[${_}].target`)}});return B}function Eq(D,F){if(!eD(D))throw new v0(`Registry at ${F} uses legacy schema v1 but does not expose an object index payload.`,{url:F,issue:"legacy-schema-v1",remediation:"Publish an object index with author/components fields, or upgrade to schema v2."});let B=D.components;if(!Array.isArray(B))throw new v0(`Registry at ${F} uses legacy schema v1 but the components field is missing or invalid.`,{url:F,issue:"legacy-schema-v1",remediation:"Ensure the legacy index has a components array, or upgrade to schema v2."});let $=B.map((_,Q)=>{if(!eD(_))throw new U(`Invalid index component at components[${Q}]: expected object, got ${typeof _}`);let{name:Y,description:q}=_;if(typeof Y!=="string")throw new U(`Invalid index component name at components[${Q}].name`);if(typeof q!=="string")throw new U(`Invalid index component description at components[${Q}].description`);return{name:Y,type:i9(_.type,`components[${Q}].type`),description:q}});return{...D,components:$}}async function a9(D,F,B={}){let $=J8.get(D);if($)return $;let _=B.requestUrl??D,Q=(async()=>{let Y={url:_,phase:B.phase},q;try{q=await fetch(_)}catch(J){throw new RD(`Network request failed for ${_}: ${J instanceof Error?J.message:String(J)}`,Y)}if(!q.ok){if(q.status===404)throw new MD(`Not found: ${_}`);throw new RD(`Failed to fetch ${_}: ${q.status} ${q.statusText}`,{...Y,status:q.status,statusText:q.statusText})}let H;try{H=await q.json()}catch(J){throw new RD(`Invalid JSON response from ${_}: ${J instanceof Error?J.message:String(J)}`,Y)}return await F(H)})();return J8.set(D,Q),Q.catch(()=>J8.delete(D)),Q}function o9(D){let F=PF(D);if(!F)return null;return{issue:F.issue,remediation:F.remediation,schemaUrl:F.schemaUrl,supportedMajor:F.supportedMajor,detectedMajor:F.detectedMajor}}async function T2(D){let F=xD(D),B=`${F}/index.json`;return a9(B,($)=>{let _=o9($);if(_&&_.issue!=="legacy-schema-v1")throw Aq(B,_);let Q=$,Y="v2";if(_?.issue==="legacy-schema-v1"){Y="legacy-v1";try{Q=Eq($,B)}catch(H){if(H instanceof v0)throw H;let J=H instanceof Error?H.message:String(H);throw new v0(`Registry at ${B} uses legacy schema v1 but cannot be adapted safely. ${J}`,{url:B,issue:"invalid-format",remediation:"Fix the legacy payload shape (types/descriptions/components) or upgrade the registry to v2."})}}else{let H=jq(Q);if(H.length>0){let J=H[0];if(!J)throw Error("Unexpected missing legacy type issue");let X=G8[J.type];throw new v0(`Registry at ${B} uses legacy component type "${J.type}" in ${J.path}. Use "${X}" for v2 registries.`,{url:B,issue:"invalid-format",remediation:`Replace legacy type "${J.type}" with canonical "${X}" in v2 manifests.`})}}let q=j1.safeParse(Q);if(!q.success)throw new v0(`Registry at ${B} returned an unrecognized index format. Ensure it follows the OCX registry specification. Schema error: ${q.error.message}`,{url:B,issue:"invalid-format",remediation:`Ensure the registry index follows the OCX registry specification. Schema error: ${q.error.message}`});return b3.set(F,Y),q.data},{phase:"registry-index-fetch"})}async function R3(D,F){return(await W8(D,F)).manifest}async function W8(D,F,B){let $=`${xD(D)}/components/${F}.json`;return a9(`${$}#v=${B??"latest"}`,async(_)=>{let Q=Mq.safeParse(_);if(!Q.success)throw new U(`Invalid packument format for "${F}": ${Q.error.message}`);let Y=Q.data,q=B??Y["dist-tags"].latest,H=Y.versions[q];if(!H){if(B){let M=Object.keys(Y.versions).join(", ");throw new U(`Component "${F}" has no version "${B}". Available: ${M}`)}throw new U(`Component "${F}" has no manifest for latest version ${q}`)}let J=`component "${F}@${q}"`,X=H;if(Kq(H))if(await Uq(D)!=="v2")X=Vq(H,J);else{let K=s9(H)[0];if(K)throw new U(`Invalid component manifest for "${F}@${q}": target "${K.target}" at ${K.path} uses a legacy .opencode/ prefix. For v2 registries, use canonical root-relative targets like "plugins/...", "profiles/...", "agents/...", "skills/...", or "commands/..." (without .opencode/).`);if(eD(H)&&n9(H.type)){let j=G8[H.type];throw new U(`Invalid component manifest for "${F}@${q}": type "${H.type}" is a legacy v1 alias. Use "${j}" for v2 registries.`)}}let z=l2.safeParse(X);if(!z.success)throw new U(`Invalid component manifest for "${F}@${q}": ${z.error.message}`);return{manifest:z.data,version:q}},{phase:"packument-fetch",requestUrl:$})}async function e2(D,F,B){let $=`${xD(D)}/components/${F}/${B}`,_={url:$,phase:"file-content-fetch",qualifiedName:F},Q;try{Q=await fetch($)}catch(Y){throw new RD(`Network request failed for ${$}: ${Y instanceof Error?Y.message:String(Y)}`,_)}if(!Q.ok)throw new RD(`Failed to fetch file ${B} for ${F} from ${$}: ${Q.status} ${Q.statusText}`,{..._,status:Q.status,statusText:Q.statusText});return Q.text()}function Lq(){J8.clear(),b3.clear()}var J8,b3,G8,zq,Mq;var DF=V(()=>{_2();P0();$D();J8=new Map,b3=new Map,G8={"ocx:agent":"agent","ocx:skill":"skill","ocx:plugin":"plugin","ocx:command":"command","ocx:tool":"tool","ocx:bundle":"bundle","ocx:profile":"profile"},zq={agent:"agents",skill:"skills",plugin:"plugins",command:"commands",tool:"tools",bundle:"bundles",profile:"profiles",philosophy:"tools"},Mq=K3.extend({versions:W.record(W.unknown())})});function t9(D,F){if(D.includes("/"))return u0(D);if(F)return{namespace:F,component:D};throw new U(`Component '${D}' must include a registry alias (e.g., 'kdco/${D}')`)}async function e9(D,F){let B=new Map,$=new Set,_=new Set,Q=new Set,Y={};async function q(X,z,M=[]){let A=A1(X,z);if(B.has(A))return;if($.has(A)){let Z=[...M,A].join(" \u2192 ");throw new U(`Circular dependency detected: ${Z}`)}$.add(A);let K=D[X];if(!K)throw new MD(`Registry alias '${X}' not found. Add it with 'ocx registry add <url> --name ${X}'.`);let j;try{j=await R3(K.url,z)}catch(Z){if(Z instanceof RD)throw Z;if(Z instanceof MD)throw new MD(`Component '${z}' not found in registry '${X}'.`);if(Z instanceof zD)throw Z;throw new RD(`Failed to fetch component '${z}' from registry '${X}': ${Z instanceof Error?Z.message:String(Z)}`,{url:K.url})}for(let Z of j.dependencies){let s=t9(Z,X);await q(s.namespace,s.component,[...M,A])}let S=p2(j);if(B.set(A,{...S,registryName:X,baseUrl:K.url,qualifiedName:A}),$.delete(A),j.npmDependencies)for(let Z of j.npmDependencies)_.add(Z);if(j.npmDevDependencies)for(let Z of j.npmDevDependencies)Q.add(Z);if(S.opencode)Y=Y8(Y,S.opencode)}for(let X of F){let z=t9(X);await q(z.namespace,z.component)}let H=Array.from(B.values()),J=Array.from(B.keys());return{components:H,installOrder:J,npmDependencies:Array.from(_),npmDevDependencies:Array.from(Q),opencode:Y}}var D4=V(()=>{P0();$D();DF();x1()});import{existsSync as cF}from"fs";import{mkdir as F4}from"fs/promises";import{homedir as wq}from"os";import D0 from"path";function B4(D){let F=process.env.XDG_CONFIG_HOME||D0.join(wq(),".config"),B=D0.resolve(F,"opencode"),$=D0.resolve(D);if($===B)return!0;let _=D0.relative(B,$);return _!==""&&!_.startsWith("..")&&!D0.isAbsolute(_)}function z8(D){if(B4(D)){let Q=D0.join(D,"opencode.jsonc"),Y=D0.join(D,"opencode.json");if(cF(Q))return{path:Q,exists:!0};if(cF(Y))return{path:Y,exists:!0};return{path:Q,exists:!1}}let F=D0.join(D,g1,"opencode.jsonc"),B=D0.join(D,g1,"opencode.json");if(cF(F))return{path:F,exists:!0};if(cF(B))return{path:B,exists:!0};let $=D0.join(D,"opencode.jsonc"),_=D0.join(D,"opencode.json");if(cF($))return{path:$,exists:!0};if(cF(_))return{path:_,exists:!0};return{path:F,exists:!1}}async function $4(D){let{path:F,exists:B}=z8(D);if(B)return{path:F,created:!1};return await F4(D0.dirname(F),{recursive:!0}),await Bun.write(F,Oq),{path:F,created:!0}}async function d1(D){let{path:F,exists:B}=z8(D);if(!B)return null;let _=await Bun.file(F).text();return{config:ND(_,[],{allowTrailingComma:!0}),content:_,path:F}}async function bq(D,F){await Bun.write(D,F)}function Rq(D,F){let $=ND(D,[],{allowTrailingComma:!0});for(let _ of F){if($===null||$===void 0)return;if(typeof $!=="object")return;$=$[_]}return $}function _4(D,F,B){if(B===null||B===void 0)return D;if(eD(B)){let _=Rq(D,F);if(_!==void 0&&(_===null||typeof _!=="object")){let Y=AF(D,F,B,m1);return jF(D,Y)}let Q=D;for(let[Y,q]of Object.entries(B))Q=_4(Q,[...F,Y],q);return Q}if(Array.isArray(B)){let _=AF(D,F,B,m1);return jF(D,_)}let $=AF(D,F,B,m1);return jF(D,$)}async function c1(D,F){let B=await d1(D),$,_,Q=!1;if(B)$=B.content,_=B.path;else $=JSON.stringify({$schema:"https://opencode.ai/config.json"},null,"\t"),_=B4(D)?D0.join(D,"opencode.jsonc"):D0.join(D,g1,"opencode.jsonc"),await F4(D0.dirname(_),{recursive:!0}),Q=!0;let Y=$;$=_4($,[],F);let q=$!==Y;if(q)await bq(_,$);return{path:_,created:Q,changed:q}}var g1=".opencode",m1,Oq=`{
118
+ `;var X6=b(()=>{c4();M0();z$();e2();Z4();_8();qG={$schema:"https://ocx.kdco.dev/schemas/profile.json",registries:{},renameWindow:!0,exclude:["**/CLAUDE.md","**/CONTEXT.md","**/.opencode/**","**/opencode.jsonc","**/opencode.json"],include:[]}});function GG($,_,U){let Q=(v)=>$(v,..._);return U===void 0?Q:Object.assign(Q,{lazy:U,lazyArgs:_})}var jG=()=>{};function KG($,_,U){let Q=$.length-_.length;if(Q===0)return $(..._);if(Q===1)return GG($,_,U);throw Error("Wrong number of arguments")}var HG=b(()=>{jG()});function RJ($){if(typeof $!="object"||!$)return!1;let _=Object.getPrototypeOf($);return _===null||_===Object.prototype}var WG=()=>{};function EJ(...$){return KG(bG,$)}function bG($,_){let U={...$,..._};for(let Q in _){if(!(Q in $))continue;let{[Q]:v}=$;if(!RJ(v))continue;let{[Q]:J}=_;RJ(J)&&(U[Q]=bG(v,J))}return U}var BG=b(()=>{HG();WG()});var ZG=b(()=>{BG()});function VG($){let _=$.startsWith("npm:"),U=_?$.slice(4):$;if(!U)return $;if(U.startsWith("@")){let J=U.indexOf("/");if(J===-1)return $;let z=U.slice(J+1).indexOf("@");if(z===-1)return $;let I=U.slice(0,J+1+z);return _?`npm:${I}`:I}let Q=U.indexOf("@");if(Q===-1)return $;let v=U.slice(0,Q);return _?`npm:${v}`:v}function bD($){let _=new Map;for(let Q=$.length-1;Q>=0;Q--){let v=$[Q],J=VG(v);if(!_.has(J))_.set(J,Q)}let U=[];for(let[Q,v]of $.entries()){let J=VG(v);if(_.get(J)===Q)U.push(v)}return U}function v8($,_){let U=EJ($,_);if(Array.isArray($.plugin)&&Array.isArray(_.plugin))U.plugin=bD([...$.plugin,..._.plugin]);else if(Array.isArray($.plugin))U.plugin=$.plugin;else if(Array.isArray(_.plugin))U.plugin=_.plugin;if(Array.isArray($.instructions)&&Array.isArray(_.instructions))U.instructions=Array.from(new Set([...$.instructions,..._.instructions]));else if(Array.isArray($.instructions))U.instructions=$.instructions;else if(Array.isArray(_.instructions))U.instructions=_.instructions;return U}var PJ=b(()=>{ZG()});import{existsSync as BD,readFileSync as ZD}from"fs";import{dirname as VD,isAbsolute as wR,resolve as xJ}from"path";function DD($){let _=xJ($);while(!0){let U=xJ(_,".git");if(BD(U))try{let v=P1("fs").statSync(U);if(v.isDirectory())return _;if(v.isFile()){if(ZD(U,"utf8").match(/^gitdir:\s*(.+)$/m)?.[1])return _}}catch{}let Q=VD(_);if(Q===_)return null;_=Q}}function uJ($){let _=xJ($);return DD(_)??_}var DG=()=>{};import{existsSync as MD}from"fs";import*as B1 from"path";var{Glob:wD}=globalThis.Bun;function MG($){return $.startsWith("http://")||$.startsWith("https://")}function LD($,_){if(MG($))return;if(B1.isAbsolute($)||B1.win32.isAbsolute($))throw new M(`Absolute path not allowed in registry instructions: "${$}" (from ${_})`);if($.startsWith("~"))throw new M(`Home directory path not allowed in registry instructions: "${$}" (from ${_})`);if($.split(/[/\\]/).some((Q)=>Q===".."))throw new M(`Path traversal (..) not allowed in registry instructions: "${$}" (from ${_})`)}function kD($,_,U){if(MG($))return[$];if(LD($,U),$.includes("*")||$.includes("?")||$.includes("[")){let J=new wD($),Y=[];for(let z of J.scanSync(_)){let I=B1.join(_,z);Y.push(I)}return Y}let v=B1.join(_,$);if(!MD(v))throw new M(`Registry instruction file not found: "${$}" (from ${U})
119
+ Expected at: ${v}`);return[v]}function wG($,_,U){let Q=[],v=new Set;for(let J of $){let Y=kD(J,_,U);for(let z of Y)if(!v.has(z))v.add(z),Q.push(z)}return Q}var LG=b(()=>{z$()});import{existsSync as Z1,readFileSync as AG,statSync as AD}from"fs";import{homedir as FD}from"os";import{join as C4,relative as FG}from"path";var{Glob:U8}=globalThis.Bun;function OD($){return $==="local-config"||$==="cli"||$==="env"}function yJ($,_){if($.trim().length===0)throw new n(`Invalid profile from ${_}: value cannot be empty or whitespace`);return $}function OG($){if($.length===0)return"Unknown parse error";let _=$[0];if(!_)return"Unknown parse error";return`${S6(_.error)} at offset ${_.offset}`}function kG($){let _;try{_=AG($,"utf8")}catch(J){let Y=J instanceof Error?J.message:"Unknown read error";throw new n(`Failed to read local config at ${$}: ${Y}`)}let U=[],Q=x$(_,U,{allowTrailingComma:!0});if(U.length>0){let J=OG(U);throw new n(`Invalid JSONC in local config at ${$}: ${J}`)}let v=h6.safeParse(Q);if(!v.success){let J=v.error.issues[0],Y=J?.path.length?J.path.join("."):"root",z=J?.message??"Invalid OCX config";throw new n(`Invalid local config at ${$}: ${Y} ${z}`)}return v.data}function ND($){let _;try{_=AG($,"utf8")}catch(v){let J=v instanceof Error?v.message:"Unknown read error";throw new n(`Failed to read local OpenCode config at ${$}: ${J}`)}let U=[],Q=x$(_,U,{allowTrailingComma:!0});if(U.length>0){let v=OG(U);throw new n(`Invalid JSONC in local OpenCode config at ${$}: ${v}`)}if(!Q||typeof Q!=="object"||Array.isArray(Q))throw new n(`Invalid local OpenCode config at ${$}: root must be an object`);return Q}function TD($,_,U){let Q=[],v=_;while(!0){let J=C4(v,$);if(Z1(J)&&AD(J).isFile()){let z=FG(U,J);Q.push(z)}if(v===U)break;let Y=C4(v,"..");if(Y===v)break;v=Y}return Q}function RD($,_){for(let U of SD){let Q=TD(U,$,_);if(Q.length>0)return Q}return[]}function Q8($){return $.startsWith("./")?$.slice(2):$}function ED($,_,U){return $.filter((Q)=>{for(let v of U)if(new U8(Q8(v)).match(Q))return!0;for(let v of _)if(new U8(Q8(v)).match(Q))return!1;return!0})}async function PD($){let _=await F4($);if(!_||Object.keys(_.installed).length===0)return[];let U=[];for(let[Q,v]of Object.entries(_.installed)){if(!v.opencode?.instructions)continue;let J=v.opencode.instructions;if(!Array.isArray(J))continue;let Y=`${v.registryName}/${v.name} (${Q})`,z=wG(J,$,Y);U.push(...z)}return Array.from(new Set(U))}class q6{cwd;profileName;profile;localConfigDir;registryInstructions;cachedConfig=null;constructor($,_,U,Q,v){this.cwd=$,this.profileName=_,this.profile=U,this.localConfigDir=Q,this.registryInstructions=v}static async create($,_){let U=h$.create($),Q=null,v="none",J=b1($);if(J){let q=C4(J,t4);if(Z1(q)){let G=kG(q);if(G.profile!==void 0)Q=yJ(G.profile,`local config at ${q}`),v="local-config"}}if(Q===null){if(_?.profile!==void 0)Q=yJ(_.profile,"CLI option --profile"),v="cli";else if(process.env.OCX_PROFILE!==void 0)Q=yJ(process.env.OCX_PROFILE,"environment variable OCX_PROFILE"),v="env"}let Y=await U.isInitialized();if(OD(v)&&!Y)throw new b0;let z=null;if(Y)if(Q!==null)z=await U.getLayered(Q,$);else try{Q=await U.resolveProfile(),z=await U.getLayered(Q,$),v="default"}catch(q){if(!(q instanceof m$)||q.profile!=="default")throw q;Q=null,z=null,v="none"}let I;if(z)I=p$(Q);else if(J)I=C4(J,"..");else I=O4();let X=await PD(I);return new q6($,Q,z,J,X)}resolve(){if(this.cachedConfig)return this.cachedConfig;let $={},_=H1,U={};if(this.profile){if($={...$,...this.profile.ocx.registries},this.profile.ocx.componentPath)_=this.profile.ocx.componentPath;if(this.profile.opencode)U=this.mergeOpencode(U,this.profile.opencode)}let Q=this.shouldLoadLocalConfig();if(!this.profile&&Q&&this.localConfigDir){let J=this.loadLocalOcxConfig();if(J)$=J.registries}if(this.localConfigDir){let J=this.loadLocalOpencodeConfig();if(J)U=this.mergeOpencode(U,J)}let v=this.discoverInstructions();return this.cachedConfig={registries:$,componentPath:_,opencode:U,instructions:v,profileName:this.profileName},this.cachedConfig}resolveWithOrigin(){let $=new Map,_={},U=H1,Q={};if($.set("componentPath",{path:"",source:"default"}),this.profile){let Y=`~/.config/opencode/profiles/${this.profileName}/ocx.jsonc`;for(let[z,I]of Object.entries(this.profile.ocx.registries))_[z]=I,$.set(`registries.${z}`,{path:Y,source:"global-profile"});if(this.profile.ocx.componentPath)U=this.profile.ocx.componentPath,$.set("componentPath",{path:Y,source:"global-profile"});if(this.profile.opencode){Q=this.mergeOpencode(Q,this.profile.opencode);let z=`~/.config/opencode/profiles/${this.profileName}/opencode.jsonc`;for(let I of Object.keys(this.profile.opencode))$.set(`opencode.${I}`,{path:z,source:"global-profile"})}}let v=this.shouldLoadLocalConfig();if(!this.profile&&v&&this.localConfigDir){let Y=this.loadLocalOcxConfig();if(Y){let z=C4(this.localConfigDir,t4);for(let[I,X]of Object.entries(Y.registries))_[I]=X,$.set(`registries.${I}`,{path:z,source:"local-config"})}}if(this.localConfigDir){let Y=this.loadLocalOpencodeConfig();if(Y){Q=this.mergeOpencode(Q,Y);let z=C4(this.localConfigDir,NJ);for(let I of Object.keys(Y))$.set(`opencode.${I}`,{path:z,source:"local-opencode"})}}let J=this.discoverInstructions();return{registries:_,componentPath:U,opencode:Q,instructions:J,profileName:this.profileName,origins:$}}shouldLoadLocalConfig(){if(!this.profile?.ocx.exclude)return!0;if(!this.localConfigDir)return!0;let _=uJ(this.cwd),U=FG(_,this.localConfigDir),Q=this.profile.ocx.exclude??[],v=this.profile.ocx.include??[];for(let J of v){let Y=new U8(Q8(J));if(Y.match(`${U}/`)||Y.match(U))return!0}for(let J of Q){let Y=new U8(Q8(J));if(Y.match(`${U}/`)||Y.match(`${U}/**`))return!1}return!0}loadLocalOcxConfig(){if(!this.localConfigDir)return null;let $=C4(this.localConfigDir,t4);if(!Z1($))return null;return{registries:kG($).registries}}loadLocalOpencodeConfig(){if(!this.localConfigDir)return null;let $=C4(this.localConfigDir,NJ);if(!Z1($))return null;return ND($)}discoverInstructions(){let $=[],_=O4(),U=C4(_,"AGENTS.md");if(Z1(U))$.push(U);else if(!process.env.OPENCODE_DISABLE_CLAUDE_CODE_PROMPT){let q=C4(FD(),".claude","CLAUDE.md");if(Z1(q))$.push(q)}if(this.profile&&this.profileName){let q=C4(p$(this.profileName),"AGENTS.md");if(Z1(q))$.push(q)}let Q=this.loadRegistryInstructions();$.push(...Q);let v=uJ(this.cwd),J=RD(this.cwd,v),Y=this.profile?.ocx.exclude??[],z=this.profile?.ocx.include??[],X=ED(J,Y,z).map((q)=>C4(v,q));return $.push(...X),$}loadRegistryInstructions(){return this.registryInstructions}mergeOpencode($,_){return v8($,_)}getRegistries(){return this.resolve().registries}getComponentPath(){return this.resolve().componentPath}getProfileName(){return this.profileName}getCwd(){return this.cwd}getProfile(){return this.profile}}var SD;var g_=b(()=>{c4();X6();Z4();PJ();X4();z$();DG();LG();p6();SD=["AGENTS.md","CLAUDE.md","CONTEXT.md"]});function q4($){return typeof $==="object"&&$!==null&&!Array.isArray($)&&Object.getPrototypeOf($)===Object.prototype}var xG={};s$(xG,{fetchRegistryIndex:()=>n6,fetchFileContent:()=>V1,fetchComponentVersion:()=>I8,fetchComponent:()=>c_,classifyRegistryIndexIssue:()=>PG,_clearFetcherCacheForTests:()=>lD});import{posix as xD}from"path";function CD($,_){return new i4(`Registry at ${$} uses an incompatible format (${_.issue}). ${_.remediation}`,{url:$,issue:_.issue,remediation:_.remediation,..._.schemaUrl!==void 0&&{schemaUrl:_.schemaUrl},..._.supportedMajor!==void 0&&{supportedMajor:_.supportedMajor},..._.detectedMajor!==void 0&&{detectedMajor:_.detectedMajor}})}function SG($,_){if(typeof $!=="string")throw new M(`Invalid ${_}: expected string, got ${typeof $}`);let U=z8[$]??$,Q=B0.safeParse(U);if(!Q.success)throw new M(`Unsupported component type "${$}" in ${_}. Expected one of: ${B0.options.join(", ")}`);return Q.data}function TG($){return typeof $==="string"&&Object.hasOwn(z8,$)}function Y8($){return $.startsWith(".opencode/")||$.startsWith(".opencode\\")}function RG($){if(!q4($)||!Array.isArray($.files))return[];let _=[];for(let[U,Q]of $.files.entries()){if(typeof Q==="string"){if(!Y8(Q))continue;_.push({path:`files[${U}]`,target:Q});continue}if(!q4(Q)||typeof Q.target!=="string")continue;if(!Y8(Q.target))continue;_.push({path:`files[${U}].target`,target:Q.target})}return _}function fD($){if(!q4($))return[];let _=$.components;if(!Array.isArray(_))return[];let U=[];for(let[Q,v]of _.entries()){if(!q4(v))continue;let J=v.type;if(!TG(J))continue;U.push({path:`components[${Q}].type`,type:J})}return U}function mD($){if(!q4($))return!1;if(typeof $.type==="string"&&$.type.startsWith("ocx:"))return!0;return RG($).length>0}async function gD($){let _=d$($),U=h_.get(_);if(U)return U;try{await n6(_)}catch(v){if(v instanceof E$||v instanceof B$)return null;throw v}if(!h_.has(_))return null;let Q=h_.get(_);if(!Q)throw Error(`Missing registry schema mode cache entry for ${_}`);return Q}function NG($,_){if($.includes("\x00"))throw new M(`Unsafe target "${$}" in ${_}: null bytes are not allowed`);if($.includes("%"))throw new M(`Unsafe target "${$}" in ${_}: encoded paths are not allowed`);if($.includes("\\"))throw new M(`Unsafe target "${$}" in ${_}: Windows separators are not allowed`);if($.startsWith("/")||$.startsWith("//")||/^[a-zA-Z]:/.test($))throw new M(`Unsafe target "${$}" in ${_}: absolute paths are not allowed`);let U=$.startsWith(".opencode/")?$.slice(10):$;if(!U)throw new M(`Unsafe target "${$}" in ${_}: missing path after .opencode/`);let Q=U.split("/");if(Q.some((X)=>X.length===0))throw new M(`Unsafe target "${$}" in ${_}: empty path segments are not allowed`);if(Q.some((X)=>X==="."||X===".."))throw new M(`Unsafe target "${$}" in ${_}: traversal segments are not allowed`);let[v,...J]=Q;if(!v)throw new M(`Unsafe target "${$}" in ${_}: missing path root segment`);let z=[uD[v]??v,...J].join("/"),I=xD.normalize(z);if(I!==z)throw new M(`Unsafe target "${$}" in ${_}: path normalization is ambiguous`);if(I==="."||I===".."||I.startsWith("../"))throw new M(`Unsafe target "${$}" in ${_}: target escapes project root`);return I}function hD($,_){if(!q4($))return $;let U={...$};if(Object.hasOwn(U,"type"))U.type=SG(U.type,`${_}.type`);if(Array.isArray(U.files))U.files=U.files.map((Q,v)=>{if(typeof Q==="string"){if(!Y8(Q))return Q;return NG(Q,`${_}.files[${v}]`)}if(!q4(Q))return Q;let J=Q.target;if(typeof J!=="string")return Q;if(!Y8(J))return Q;return{...Q,target:NG(J,`${_}.files[${v}].target`)}});return U}function cD($,_){if(!q4($))throw new i4(`Registry at ${_} uses legacy schema v1 but does not expose an object index payload.`,{url:_,issue:"legacy-schema-v1",remediation:"Publish an object index with author/components fields, or upgrade to schema v2."});let U=$.components;if(!Array.isArray(U))throw new i4(`Registry at ${_} uses legacy schema v1 but the components field is missing or invalid.`,{url:_,issue:"legacy-schema-v1",remediation:"Ensure the legacy index has a components array, or upgrade to schema v2."});let Q=U.map((v,J)=>{if(!q4(v))throw new M(`Invalid index component at components[${J}]: expected object, got ${typeof v}`);let{name:Y,description:z}=v;if(typeof Y!=="string")throw new M(`Invalid index component name at components[${J}].name`);if(typeof z!=="string")throw new M(`Invalid index component description at components[${J}].description`);return{name:Y,type:SG(v.type,`components[${J}].type`),description:z}});return{...$,components:Q}}async function EG($,_,U={}){let Q=J8.get($);if(Q)return Q;let v=U.requestUrl??$,J=(async()=>{let Y={url:v,phase:U.phase},z;try{z=await fetch(v)}catch(X){throw new E$(`Network request failed for ${v}: ${X instanceof Error?X.message:String(X)}`,Y)}if(!z.ok){if(z.status===404)throw new B$(`Not found: ${v}`);throw new E$(`Failed to fetch ${v}: ${z.status} ${z.statusText}`,{...Y,status:z.status,statusText:z.statusText})}let I;try{I=await z.json()}catch(X){throw new E$(`Invalid JSON response from ${v}: ${X instanceof Error?X.message:String(X)}`,Y)}return await _(I)})();return J8.set($,J),J.catch(()=>J8.delete($)),J}function PG($){let _=Z0($);if(!_)return null;return{issue:_.issue,remediation:_.remediation,schemaUrl:_.schemaUrl,supportedMajor:_.supportedMajor,detectedMajor:_.detectedMajor}}async function n6($){let _=d$($),U=`${_}/index.json`;return EG(U,(Q)=>{let v=PG(Q);if(v&&v.issue!=="legacy-schema-v1")throw CD(U,v);let J=Q,Y="v2";if(v?.issue==="legacy-schema-v1"){Y="legacy-v1";try{J=cD(Q,U)}catch(I){if(I instanceof i4)throw I;let X=I instanceof Error?I.message:String(I);throw new i4(`Registry at ${U} uses legacy schema v1 but cannot be adapted safely. ${X}`,{url:U,issue:"invalid-format",remediation:"Fix the legacy payload shape (types/descriptions/components) or upgrade the registry to v2."})}}else{let I=fD(J);if(I.length>0){let X=I[0];if(!X)throw Error("Unexpected missing legacy type issue");let q=z8[X.type];throw new i4(`Registry at ${U} uses legacy component type "${X.type}" in ${X.path}. Use "${q}" for v2 registries.`,{url:U,issue:"invalid-format",remediation:`Replace legacy type "${X.type}" with canonical "${q}" in v2 manifests.`})}}let z=jJ.safeParse(J);if(!z.success)throw new i4(`Registry at ${U} returned an unrecognized index format. Ensure it follows the OCX registry specification. Schema error: ${z.error.message}`,{url:U,issue:"invalid-format",remediation:`Ensure the registry index follows the OCX registry specification. Schema error: ${z.error.message}`});return h_.set(_,Y),z.data},{phase:"registry-index-fetch"})}async function c_($,_){return(await I8($,_)).manifest}async function I8($,_,U){let Q=`${d$($)}/components/${_}.json`;return EG(`${Q}#v=${U??"latest"}`,async(v)=>{let J=yD.safeParse(v);if(!J.success)throw new M(`Invalid packument format for "${_}": ${J.error.message}`);let Y=J.data,z=U??Y["dist-tags"].latest,I=Y.versions[z];if(!I){if(U){let j=Object.keys(Y.versions).join(", ");throw new M(`Component "${_}" has no version "${U}". Available: ${j}`)}throw new M(`Component "${_}" has no manifest for latest version ${z}`)}let X=`component "${_}@${z}"`,q=I;if(mD(I))if(await gD($)!=="v2")q=hD(I,X);else{let Z=RG(I)[0];if(Z)throw new M(`Invalid component manifest for "${_}@${z}": target "${Z.target}" at ${Z.path} uses a legacy .opencode/ prefix. For v2 registries, use canonical root-relative targets like "plugins/...", "profiles/...", "agents/...", "skills/...", or "commands/..." (without .opencode/).`);if(q4(I)&&TG(I.type)){let V=z8[I.type];throw new M(`Invalid component manifest for "${_}@${z}": type "${I.type}" is a legacy v1 alias. Use "${V}" for v2 registries.`)}}let G=q1.safeParse(q);if(!G.success)throw new M(`Invalid component manifest for "${_}@${z}": ${G.error.message}`);return{manifest:G.data,version:z}},{phase:"packument-fetch",requestUrl:Q})}async function V1($,_,U){let Q=`${d$($)}/components/${_}/${U}`,v={url:Q,phase:"file-content-fetch",qualifiedName:_},J;try{J=await fetch(Q)}catch(Y){throw new E$(`Network request failed for ${Q}: ${Y instanceof Error?Y.message:String(Y)}`,v)}if(!J.ok)throw new E$(`Failed to fetch file ${U} for ${_} from ${Q}: ${J.status} ${J.statusText}`,{...v,status:J.status,statusText:J.statusText});return J.text()}function lD(){J8.clear(),h_.clear()}var J8,h_,z8,uD,yD;var D1=b(()=>{B6();o4();z$();J8=new Map,h_=new Map,z8={"ocx:agent":"agent","ocx:skill":"skill","ocx:plugin":"plugin","ocx:command":"command","ocx:tool":"tool","ocx:bundle":"bundle","ocx:profile":"profile"},uD={agent:"agents",skill:"skills",plugin:"plugins",command:"commands",tool:"tools",bundle:"bundles",profile:"profiles",philosophy:"tools"},yD=x_.extend({versions:K.record(K.string(),K.unknown())})});function uG($,_){if($.includes("/"))return r4($);if(_)return{namespace:_,component:$};throw new M(`Component '${$}' must include a registry alias (e.g., 'kdco/${$}')`)}async function yG($,_){let U=new Map,Q=new Set,v=new Set,J=new Set,Y={};async function z(q,G,j=[]){let H=GJ(q,G);if(U.has(H))return;if(Q.has(H)){let T=[...j,H].join(" \u2192 ");throw new M(`Circular dependency detected: ${T}`)}Q.add(H);let Z=$[q];if(!Z)throw new B$(`Registry alias '${q}' not found. Add it with 'ocx registry add <url> --name ${q}'.`);let V;try{V=await c_(Z.url,G)}catch(T){if(T instanceof E$)throw T;if(T instanceof B$)throw new B$(`Component '${G}' not found in registry '${q}'.`);if(T instanceof b$)throw T;throw new E$(`Failed to fetch component '${G}' from registry '${q}': ${T instanceof Error?T.message:String(T)}`,{url:Z.url})}for(let T of V.dependencies){let r=uG(T,q);await z(r.namespace,r.component,[...j,H])}let S=G1(V);if(U.set(H,{...S,registryName:q,baseUrl:Z.url,qualifiedName:H}),Q.delete(H),V.npmDependencies)for(let T of V.npmDependencies)v.add(T);if(V.npmDevDependencies)for(let T of V.npmDevDependencies)J.add(T);if(S.opencode)Y=v8(Y,S.opencode)}for(let q of _){let G=uG(q);await z(G.namespace,G.component)}let I=Array.from(U.values()),X=Array.from(U.keys());return{components:I,installOrder:X,npmDependencies:Array.from(v),npmDevDependencies:Array.from(J),opencode:Y}}var CG=b(()=>{o4();z$();D1();PJ()});import{statSync as dD}from"fs";import{mkdir as fG}from"fs/promises";import V4 from"path";function O0($){try{return dD($).isFile()}catch{return!1}}function X8($){let _=V4.resolve($);if(SJ(_)!=="local-project"){let I=V4.join(_,"opencode.jsonc"),X=V4.join(_,"opencode.json");if(O0(I))return{path:I,exists:!0};if(O0(X))return{path:X,exists:!0};return{path:I,exists:!1}}let v=V4.join(_,fJ,"opencode.jsonc"),J=V4.join(_,fJ,"opencode.json");if(O0(v))return{path:v,exists:!0};if(O0(J))return{path:J,exists:!0};let Y=V4.join(_,"opencode.jsonc"),z=V4.join(_,"opencode.json");if(O0(Y))return{path:Y,exists:!0};if(O0(z))return{path:z,exists:!0};return{path:v,exists:!1}}async function mG($){let{path:_,exists:U}=X8($);if(U)return{path:_,created:!1};return await fG(V4.dirname(_),{recursive:!0}),await Bun.write(_,pD),{path:_,created:!0}}async function mJ($){let{path:_,exists:U}=X8($);if(!U)return null;let v=await Bun.file(_).text();return{config:x$(v,[],{allowTrailingComma:!0}),content:v,path:_}}async function iD($,_){await Bun.write($,_)}function nD($,_){let Q=x$($,[],{allowTrailingComma:!0});for(let v of _){if(Q===null||Q===void 0)return;if(typeof Q!=="object")return;Q=Q[v]}return Q}function gG($,_,U){if(U===null||U===void 0)return $;if(q4(U)){let v=nD($,_);if(v!==void 0&&(v===null||typeof v!=="object")){let Y=y1($,_,U,CJ);return C1($,Y)}let J=$;for(let[Y,z]of Object.entries(U))J=gG(J,[..._,Y],z);return J}if(Array.isArray(U)){let v=y1($,_,U,CJ);return C1($,v)}let Q=y1($,_,U,CJ);return C1($,Q)}async function gJ($,_){let U=await mJ($),Q,v,J=!1;if(U)Q=U.content,v=U.path;else{Q=JSON.stringify({$schema:"https://opencode.ai/config.json"},null,"\t");let X=V4.resolve($);v=SJ(X)!=="local-project"?V4.join(X,"opencode.jsonc"):V4.join(X,fJ,"opencode.jsonc"),await fG(V4.dirname(v),{recursive:!0}),J=!0}let Y=Q;Q=gG(Q,[],_);let z=Q!==Y;if(z)await iD(v,Q);return{path:v,created:J,changed:z}}var fJ=".opencode",CJ,pD=`{
81
120
  "$schema": "https://opencode.ai/config.json"
82
121
  // Add MCP servers, tools, plugins here
83
122
  }
84
- `;var l1=V(()=>{b0();m1={formattingOptions:{tabSize:2,insertSpaces:!1,eol:`
85
- `}}});function Q4(D){return D.replace(/\r\n/g,`
86
- `).trim()}function p1(D,F){return Q4(D)===Q4(F)}import{existsSync as Zq,lstatSync as Nq}from"fs";import{rm as Sq,unlink as kq}from"fs/promises";import{join as H4}from"path";function J4(D,F){let B=[];for(let[$,_]of Object.entries(F)){let Q=D[$]??null;if(Q!==_)B.push({name:$,from:Q,to:_})}return{changed:B.length>0,entries:B}}function X4(D,F){let B=H4(D,"node_modules"),$=F.map((_)=>_.name).join(", ");return{action:"delete",target:B,details:{reason:`dependency declarations changed (${$}); invalidating to force reinstall`,path:B}}}function q4(D){if(D&&typeof D==="object"&&"code"in D)return String(D.code);return"UNKNOWN"}function i1(D){if(D instanceof Error)return D.message;return String(D)}function vq(D){return new Promise((F)=>setTimeout(F,D))}async function G4(D,F){let B=H4(D,"node_modules"),$=F?.rmImpl??((_,Q)=>Sq(_,Q));if(!Zq(B))return{success:!0,action:"none"};try{if(Nq(B).isSymbolicLink())return await kq(B),{success:!0,action:"unlinked"}}catch(_){let Q=q4(_);if(Q==="ENOENT")return{success:!0,action:"none"};return{success:!1,action:"failed",error:{code:Q,message:i1(_)}}}for(let _=0;_<=Y4;_++)try{return await $(B,{recursive:!0,force:!0}),{success:!0,action:"removed"}}catch(Q){let Y=q4(Q);if(Y==="ENOENT")return{success:!0,action:"none"};if(!Iq.has(Y))return{success:!1,action:"failed",error:{code:Y,message:i1(Q)}};if(_<Y4)await vq(Tq*2**_);else return{success:!1,action:"failed",error:{code:Y,message:i1(Q)}}}return{success:!1,action:"failed",error:{code:"UNKNOWN",message:"exhausted retries"}}}var Iq,Y4=3,Tq=100;var W4=V(()=>{Iq=new Set(["EBUSY","ENOTEMPTY"])});function z4(D,F){let B=0,$,_="",Q="";for(;B<D.length;B++)if($=D[B],_+=$.open,Q+=$.close,~F.indexOf($.close))F=F.replace($.rgx,$.close+$.open);return _+F+Q}function Cq(D,F){let B={has:D,keys:F};return B.reset=ED.reset.bind(B),B.bold=ED.bold.bind(B),B.dim=ED.dim.bind(B),B.italic=ED.italic.bind(B),B.underline=ED.underline.bind(B),B.inverse=ED.inverse.bind(B),B.hidden=ED.hidden.bind(B),B.strikethrough=ED.strikethrough.bind(B),B.black=ED.black.bind(B),B.red=ED.red.bind(B),B.green=ED.green.bind(B),B.yellow=ED.yellow.bind(B),B.blue=ED.blue.bind(B),B.magenta=ED.magenta.bind(B),B.cyan=ED.cyan.bind(B),B.white=ED.white.bind(B),B.gray=ED.gray.bind(B),B.grey=ED.grey.bind(B),B.bgBlack=ED.bgBlack.bind(B),B.bgRed=ED.bgRed.bind(B),B.bgGreen=ED.bgGreen.bind(B),B.bgYellow=ED.bgYellow.bind(B),B.bgBlue=ED.bgBlue.bind(B),B.bgMagenta=ED.bgMagenta.bind(B),B.bgCyan=ED.bgCyan.bind(B),B.bgWhite=ED.bgWhite.bind(B),B}function ZD(D,F){let B={open:`\x1B[${D}m`,close:`\x1B[${F}m`,rgx:new RegExp(`\\x1b\\[${F}m`,"g")};return function($){if(this!==void 0&&this.has!==void 0)return!!~this.has.indexOf(D)||(this.has.push(D),this.keys.push(B)),$===void 0?this:ED.enabled?z4(this.keys,$+""):$+"";return $===void 0?Cq([D],[B]):ED.enabled?z4([B],$+""):$+""}}var n1,M4,A4,j4,K4=!0,ED,P;var W2=V(()=>{if(typeof process<"u")({FORCE_COLOR:n1,NODE_DISABLE_COLORS:M4,NO_COLOR:A4,TERM:j4}=process.env||{}),K4=process.stdout&&process.stdout.isTTY;ED={enabled:!M4&&A4==null&&j4!=="dumb"&&(n1!=null&&n1!=="0"||K4),reset:ZD(0,0),bold:ZD(1,22),dim:ZD(2,22),italic:ZD(3,23),underline:ZD(4,24),inverse:ZD(7,27),hidden:ZD(8,28),strikethrough:ZD(9,29),black:ZD(30,39),red:ZD(31,39),green:ZD(32,39),yellow:ZD(33,39),blue:ZD(34,39),magenta:ZD(35,39),cyan:ZD(36,39),white:ZD(37,39),gray:ZD(90,39),grey:ZD(90,39),bgBlack:ZD(40,49),bgRed:ZD(41,49),bgGreen:ZD(42,49),bgYellow:ZD(43,49),bgBlue:ZD(44,49),bgMagenta:ZD(45,49),bgCyan:ZD(46,49),bgWhite:ZD(47,49)};P=ED});function V4(D,F){if(D==null||D==="")return F;let B=D.trim().toLowerCase();if(B==="true"||B==="1"||B==="yes"||B==="on")return!0;if(B==="false"||B==="0"||B==="no"||B==="off")return!1;return F}var uq,FF,U4;var Z3=V(()=>{uq=Boolean(process.env.CI||process.env.GITHUB_ACTIONS||process.env.GITLAB_CI||process.env.CIRCLECI||process.env.JENKINS_URL||process.env.BUILDKITE),FF=Boolean(process.stdout.isTTY&&!uq),U4=Boolean(FF&&process.env.FORCE_COLOR!=="0"&&process.env.NO_COLOR===void 0)});var lF,G,W0;var fD=V(()=>{W2();Z3();if(!U4)P.enabled=!1;lF={},G={info(...D){if(lF.quiet)return;console.log(P.blue("info"),...D)},success(...D){if(lF.quiet)return;console.log(P.green("\u2713"),...D)},warn(...D){if(lF.quiet)return;console.warn(P.yellow("warn"),...D)},error(...D){console.error(P.red("error"),...D)},debug(...D){if(!lF.verbose)return;console.log(P.gray("debug"),...D)},log(...D){if(lF.quiet)return;console.log(...D)},break(){if(lF.quiet)return;console.log("")}},W0={component:(D)=>P.cyan(D),path:(D)=>P.green(D),command:(D)=>P.yellow(D),url:(D)=>P.blue().underline(D),error:(D)=>P.red(D),dim:(D)=>P.gray(D),bold:(D)=>P.bold(D)}});function z0(D,F={}){if(F.json){console.log(JSON.stringify(D,null,2));return}if(F.quiet)return;if(G.info(W0.dim("\uD83D\uDD0D DRY RUN: No changes will be made")),G.break(),D.wouldPerform.length===0)G.info("No actions would be performed.");else{let $=Pq(D.wouldPerform);for(let[_,Q]of Object.entries($)){let Y=xq(_);G.info(`Would ${Y} ${Q.length} item(s):`);for(let q of Q){let H=yq(q.details);G.info(` \u2022 ${W0.component(q.target)}${H}`)}G.break()}}if(D.summary)G.info(D.summary),G.break();if(D.validation.errors&&D.validation.errors.length>0){G.error("Would fail with errors:");for(let $ of D.validation.errors)G.error(` \u2022 ${$}`);G.break()}if(D.validation.warnings&&D.validation.warnings.length>0){G.warn("Warnings:");for(let $ of D.validation.warnings)G.warn(` \u2022 ${$}`);G.break()}if(F.hints&&F.hints.length>0){for(let $ of F.hints)G.info(W0.dim($));G.break()}G.info(W0.dim("Run without --dry-run to apply changes."))}function Pq(D){let F={};for(let B of D){if(!F[B.action])F[B.action]=[];F[B.action]?.push(B)}return F}function xq(D){return{add:"add",remove:"remove",delete:"delete",update:"update",create:"create",modify:"modify"}[D]??D}function yq(D){if(!D||Object.keys(D).length===0)return"";let F=[];for(let[B,$]of Object.entries(D??{}))if($!==void 0&&$!==null)F.push(`${B}: ${W0.dim(String($))}`);return F.length>0?` (${F.join(", ")})`:""}var BF=V(()=>{fD()});var E4={};j2(E4,{wrapAction:()=>fq,handleError:()=>t});function t(D,F={}){if(F.json){let B=hq(D);console.log(JSON.stringify(B,null,2)),process.exit(B.exitCode)}if(D instanceof zD)G.error(D.message),process.exit(D.exitCode);if(D instanceof cD){G.error("Validation failed:");for(let B of D.issues){let $=B.path.join(".");G.error(` ${$}: ${B.message}`)}process.exit(XD.CONFIG)}if(D instanceof Error){if(G.error(D.message),process.env.DEBUG)console.error(D.stack)}else G.error("An unknown error occurred");process.exit(XD.GENERAL)}function fq(D){return async(...F)=>{try{await D(...F)}catch(B){t(B)}}}function hq(D){if(D instanceof vF)return{success:!1,error:{code:D.code,message:D.message,details:{conflictType:D.conflictType,registryName:D.registryName,existingUrl:D.existingUrl,newUrl:D.newUrl,...D.targetLabel&&{targetLabel:D.targetLabel},...D.existingName&&{existingName:D.existingName}}},exitCode:D.exitCode,meta:{timestamp:new Date().toISOString()}};if(D instanceof d2)return{success:!1,error:{code:D.code,message:D.message,details:{component:D.component,expected:D.expected,found:D.found}},exitCode:D.exitCode,meta:{timestamp:new Date().toISOString()}};if(D instanceof RD){let F={};if(D.url)F.url=D.url;if(D.status!==void 0)F.status=D.status;if(D.statusText)F.statusText=D.statusText;if(D.phase)F.phase=D.phase;if(D.qualifiedName)F.qualifiedName=D.qualifiedName;if(D.registryContext)F.registryContext=D.registryContext;if(D.registryName)F.registryName=D.registryName;return{success:!1,error:{code:D.code,message:D.message,...Object.keys(F).length>0&&{details:F}},exitCode:D.exitCode,meta:{timestamp:new Date().toISOString()}}}if(D instanceof CD)return{success:!1,error:{code:D.code,message:D.message,details:{profile:D.profile}},exitCode:D.exitCode,meta:{timestamp:new Date().toISOString()}};if(D instanceof O2)return{success:!1,error:{code:D.code,message:D.message,details:{profile:D.profile}},exitCode:D.exitCode,meta:{timestamp:new Date().toISOString()}};if(D instanceof C0)return{success:!1,error:{code:D.code,message:D.message,details:{profile:D.profile,reason:D.reason}},exitCode:D.exitCode,meta:{timestamp:new Date().toISOString()}};if(D instanceof n0)return{success:!1,error:{code:"BUILD_ERROR",message:D.message,details:{errors:D.errors}},exitCode:XD.GENERAL,meta:{timestamp:new Date().toISOString()}};if(D instanceof v0){let F={url:D.url,issue:D.issue,remediation:D.remediation};if(D.schemaUrl!==void 0)F.schemaUrl=D.schemaUrl;if(D.supportedMajor!==void 0)F.supportedMajor=D.supportedMajor;if(D.detectedMajor!==void 0)F.detectedMajor=D.detectedMajor;return{success:!1,error:{code:D.code,message:D.message,details:F},exitCode:D.exitCode,meta:{timestamp:new Date().toISOString()}}}if(D instanceof g2)return{success:!1,error:{code:D.code,message:D.message,details:D.details},exitCode:D.exitCode,meta:{timestamp:new Date().toISOString()}};if(D instanceof zD)return{success:!1,error:{code:D.code,message:D.message},exitCode:D.exitCode,meta:{timestamp:new Date().toISOString()}};if(D instanceof cD)return{success:!1,error:{code:"VALIDATION_ERROR",message:D.issues.map((F)=>`${F.path.join(".")}: ${F.message}`).join("; "),details:{issues:D.issues.map((F)=>({path:F.path.join("."),message:F.message,code:F.code}))}},exitCode:XD.CONFIG,meta:{timestamp:new Date().toISOString()}};return{success:!1,error:{code:"UNKNOWN_ERROR",message:D instanceof Error?D.message:"An unknown error occurred"},exitCode:XD.GENERAL,meta:{timestamp:new Date().toISOString()}}}var PD=V(()=>{_2();o3();$D();fD()});function LD(D){console.log(JSON.stringify(D,null,2))}function w4(D){if(!D)throw new U("npm package name cannot be empty");if(D.length>L4)throw new U(`npm package name exceeds maximum length of ${L4} characters: \`${D}\``);if(D.includes("..")||D.includes("/./")||D.startsWith("./"))throw new U(`Invalid npm package name - path traversal detected: \`${D}\``);if(!dq.test(D))throw new U(`Invalid npm package name: \`${D}\`. Must be lowercase, start with alphanumeric, and contain only letters, numbers, hyphens, dots, or underscores.`)}function O4(D){if(!D?.trim())throw new U("npm specifier cannot be empty");let F=D.trim();if(!F.startsWith("npm:"))throw new U(`Invalid npm specifier: \`${D}\`. Must start with \`npm:\` prefix.`);let B=F.slice(4);if(!B)throw new U(`Invalid npm specifier: \`${D}\`. Package name is required.`);let $=B.lastIndexOf("@"),_,Q;if($>0){let Y=B.slice(0,$),q=B.slice($+1);if(Y.includes("/")||!Y.startsWith("@"))_=Y,Q=q||void 0;else throw new U(`Invalid npm specifier: \`${D}\`. Scoped packages must have format @scope/pkg.`)}else _=B;return w4(_),{type:"npm",name:_,version:Q}}function b4(D){return D.trim().startsWith("npm:")}async function s1(D,F){w4(D);let B=D.startsWith("@")?`@${encodeURIComponent(D.slice(1))}`:encodeURIComponent(D),$=`${mq}/${B}`;try{let _=F??AbortSignal.timeout(gq),Q=await fetch($,{signal:_,headers:{Accept:"application/json"}});if(Q.status===404)throw new MD(`npm package \`${D}\` not found on registry`);if(!Q.ok)throw new RD(`Failed to fetch npm package \`${D}\`: HTTP ${Q.status} ${Q.statusText}`);return await Q.json()}catch(_){if(_ instanceof MD||_ instanceof RD)throw _;if(_ instanceof Error&&(_.name==="AbortError"||_.name==="TimeoutError"))throw new RD(`Request to npm registry timed out for package \`${D}\``);let Q=_ instanceof Error?_.message:String(_);throw new RD(`Failed to fetch npm package \`${D}\`: ${Q}`)}}function pF(D,F){return F?`${D}@${F}`:D}function R4(D){let F=[];if(D.type!=="module")throw new U(`Package \`${D.name}\` is not an ESM module (missing "type": "module" in package.json)`);let B=Boolean(D.main),$=D.exports!==void 0;if(!B&&!$)throw new U(`Package \`${D.name}\` has no entry point (missing "main" or "exports")`);if(!D.name.includes("opencode"))F.push(`Package name \`${D.name}\` doesn't contain "opencode" - this may not be an OpenCode plugin`);return{valid:!0,warnings:F}}async function M8(D,F,B){let $=await s1(D,B),_=F??$["dist-tags"].latest,Q=$.versions[_];if(!Q)throw new MD(`Version \`${_}\` not found for npm package \`${D}\``);return Q}function Z4(D){let F=D.trim(),B=F.lastIndexOf("@");if(B<=0)return F;let $=F.slice(0,B);if($.includes("/")||!$.startsWith("@"))return $;return F}var mq="https://registry.npmjs.org",gq=30000,dq,L4=214;var a1=V(()=>{$D();dq=/^(?:@[a-z0-9][\w.-]*\/)?[a-z0-9][\w.-]*$/});function $F(D,F){let B=D.get(F.absolutePath);if(!B){D.set(F.absolutePath,F);return}let $=B.content.equals(F.content)?"identical content":"different content";throw new gD(`Intra-batch target collision at "${F.relativePath}". Both "${B.source}" and "${F.source}" resolve to this path with ${$}. Rename one manifest target so each component writes to a unique path.`)}var A8=V(()=>{$D()});import{createHash as cq}from"crypto";import{existsSync as lq}from"fs";import{join as pq}from"path";function _F(D){return cq("sha256").update(D).digest("hex")}async function j8(D){let F=[...D].sort(($,_)=>$.path.localeCompare(_.path)),B=[];for(let $ of F){let _=_F($.content);B.push(`${$.path}:${_}`)}return _F(B.join(`
87
- `))}async function N3(D,F){let B=[],$=[],_=[];for(let Q of F.files){let Y=pq(D,Q.path);if(!lq(Y)){$.push(Q.path),_.push({path:Q.path,status:"missing"});continue}let q=await Bun.file(Y).text();if(_F(q)!==Q.hash)B.push(Q.path),_.push({path:Q.path,status:"modified"});else _.push({path:Q.path,status:"intact"})}return{intact:B.length===0&&$.length===0,modified:B,missing:$,details:_}}var iF=V(()=>{tD()});function oD(D){return D.addOption(L0.cwd()).addOption(L0.quiet()).addOption(L0.json())}function w0(D){return D.addOption(L0.verbose())}function r0(D){return D.addOption(L0.global)}function K8(D){return D.addOption(L0.profile())}function N4(D){if(!D||D.length===0)throw new C0(D,"cannot be empty");if(D.length>32)throw new C0(D,"must be 32 characters or less");if(!/^[a-zA-Z][a-zA-Z0-9._-]*$/.test(D))throw new C0(D,"must start with a letter and contain only alphanumeric characters, dots, underscores, or hyphens")}var L0;var x0=V(()=>{B8();$D();L0={cwd:()=>new H2("--cwd <path>","Working directory").default(process.cwd()),quiet:()=>new H2("-q, --quiet","Suppress output"),json:()=>new H2("--json","Output as JSON"),profile:()=>new H2("-p, --profile <name>","Target a specific profile's config"),verbose:()=>new H2("-v, --verbose","Verbose output"),global:new H2("-g, --global","Install to global OpenCode config (~/.config/opencode)")}});function sq(){let D=new Map;for(let[F,B]of Object.entries(SD)){for(let[$,_]of Object.entries(B))SD[$]={open:`\x1B[${_[0]}m`,close:`\x1B[${_[1]}m`},B[$]=SD[$],D.set(_[0],_[1]);Object.defineProperty(SD,F,{value:B,enumerable:!1})}return Object.defineProperty(SD,"codes",{value:D,enumerable:!1}),SD.color.close="\x1B[39m",SD.bgColor.close="\x1B[49m",SD.color.ansi=S4(),SD.color.ansi256=k4(),SD.color.ansi16m=I4(),SD.bgColor.ansi=S4(10),SD.bgColor.ansi256=k4(10),SD.bgColor.ansi16m=I4(10),Object.defineProperties(SD,{rgbToAnsi256:{value(F,B,$){if(F===B&&B===$){if(F<8)return 16;if(F>248)return 231;return Math.round((F-8)/247*24)+232}return 16+36*Math.round(F/255*5)+6*Math.round(B/255*5)+Math.round($/255*5)},enumerable:!1},hexToRgb:{value(F){let B=/[a-f\d]{6}|[a-f\d]{3}/i.exec(F.toString(16));if(!B)return[0,0,0];let[$]=B;if($.length===3)$=[...$].map((Q)=>Q+Q).join("");let _=Number.parseInt($,16);return[_>>16&255,_>>8&255,_&255]},enumerable:!1},hexToAnsi256:{value:(F)=>SD.rgbToAnsi256(...SD.hexToRgb(F)),enumerable:!1},ansi256ToAnsi:{value(F){if(F<8)return 30+F;if(F<16)return 90+(F-8);let B,$,_;if(F>=232)B=((F-232)*10+8)/255,$=B,_=B;else{F-=16;let q=F%36;B=Math.floor(F/36)/5,$=Math.floor(q/6)/5,_=q%6/5}let Q=Math.max(B,$,_)*2;if(Q===0)return 30;let Y=30+(Math.round(_)<<2|Math.round($)<<1|Math.round(B));if(Q===2)Y+=60;return Y},enumerable:!1},rgbToAnsi:{value:(F,B,$)=>SD.ansi256ToAnsi(SD.rgbToAnsi256(F,B,$)),enumerable:!1},hexToAnsi:{value:(F)=>SD.ansi256ToAnsi(SD.hexToAnsi256(F)),enumerable:!1}}),SD}var S4=(D=0)=>(F)=>`\x1B[${F+D}m`,k4=(D=0)=>(F)=>`\x1B[${38+D};5;${F}m`,I4=(D=0)=>(F,B,$)=>`\x1B[${38+D};2;${F};${B};${$}m`,SD,Sj,iq,nq,kj,aq,y0;var T4=V(()=>{SD={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},Sj=Object.keys(SD.modifier),iq=Object.keys(SD.color),nq=Object.keys(SD.bgColor),kj=[...iq,...nq];aq=sq(),y0=aq});import o1 from"process";import oq from"os";import v4 from"tty";function O0(D,F=globalThis.Deno?globalThis.Deno.args:o1.argv){let B=D.startsWith("-")?"":D.length===1?"-":"--",$=F.indexOf(B+D),_=F.indexOf("--");return $!==-1&&(_===-1||$<_)}function rq(){if("FORCE_COLOR"in kD){if(kD.FORCE_COLOR==="true")return 1;if(kD.FORCE_COLOR==="false")return 0;return kD.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(kD.FORCE_COLOR,10),3)}}function tq(D){if(D===0)return!1;return{level:D,hasBasic:!0,has256:D>=2,has16m:D>=3}}function eq(D,{streamIsTTY:F,sniffFlags:B=!0}={}){let $=rq();if($!==void 0)U8=$;let _=B?U8:$;if(_===0)return 0;if(B){if(O0("color=16m")||O0("color=full")||O0("color=truecolor"))return 3;if(O0("color=256"))return 2}if("TF_BUILD"in kD&&"AGENT_NAME"in kD)return 1;if(D&&!F&&_===void 0)return 0;let Q=_||0;if(kD.TERM==="dumb")return Q;if(o1.platform==="win32"){let Y=oq.release().split(".");if(Number(Y[0])>=10&&Number(Y[2])>=10586)return Number(Y[2])>=14931?3:2;return 1}if("CI"in kD){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((Y)=>(Y in kD)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((Y)=>(Y in kD))||kD.CI_NAME==="codeship")return 1;return Q}if("TEAMCITY_VERSION"in kD)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(kD.TEAMCITY_VERSION)?1:0;if(kD.COLORTERM==="truecolor")return 3;if(kD.TERM==="xterm-kitty")return 3;if(kD.TERM==="xterm-ghostty")return 3;if(kD.TERM==="wezterm")return 3;if("TERM_PROGRAM"in kD){let Y=Number.parseInt((kD.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(kD.TERM_PROGRAM){case"iTerm.app":return Y>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(kD.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(kD.TERM))return 1;if("COLORTERM"in kD)return 1;return Q}function C4(D,F={}){let B=eq(D,{streamIsTTY:D&&D.isTTY,...F});return tq(B)}var kD,U8,DH,u4;var P4=V(()=>{({env:kD}=o1);if(O0("no-color")||O0("no-colors")||O0("color=false")||O0("color=never"))U8=0;else if(O0("color")||O0("colors")||O0("color=true")||O0("color=always"))U8=1;DH={stdout:C4({isTTY:v4.isatty(1)}),stderr:C4({isTTY:v4.isatty(2)})},u4=DH});function x4(D,F,B){let $=D.indexOf(F);if($===-1)return D;let _=F.length,Q=0,Y="";do Y+=D.slice(Q,$)+F+B,Q=$+_,$=D.indexOf(F,Q);while($!==-1);return Y+=D.slice(Q),Y}function y4(D,F,B,$){let _=0,Q="";do{let Y=D[$-1]==="\r";Q+=D.slice(_,Y?$-1:$)+F+(Y?`\r
123
+ `;var hJ=b(()=>{c4();Z4();CJ={formattingOptions:{tabSize:2,insertSpaces:!1,eol:`
124
+ `}}});function hG($){return $.replace(/\r\n/g,`
125
+ `).trim()}function cJ($,_){return hG($)===hG(_)}import{existsSync as rD,lstatSync as oD}from"fs";import{rm as tD,unlink as aD}from"fs/promises";import{join as dG}from"path";function pG($,_){let U=[];for(let[Q,v]of Object.entries(_)){let J=$[Q]??null;if(J!==v)U.push({name:Q,from:J,to:v})}return{changed:U.length>0,entries:U}}function iG($,_){let U=dG($,"node_modules"),Q=_.map((v)=>v.name).join(", ");return{action:"delete",target:U,details:{reason:`dependency declarations changed (${Q}); invalidating to force reinstall`,path:U}}}function lG($){if($&&typeof $==="object"&&"code"in $)return String($.code);return"UNKNOWN"}function lJ($){if($ instanceof Error)return $.message;return String($)}function $M($){return new Promise((_)=>setTimeout(_,$))}async function nG($,_){let U=dG($,"node_modules"),Q=_?.rmImpl??((v,J)=>tD(v,J));if(!rD(U))return{success:!0,action:"none"};try{if(oD(U).isSymbolicLink())return await aD(U),{success:!0,action:"unlinked"}}catch(v){let J=lG(v);if(J==="ENOENT")return{success:!0,action:"none"};return{success:!1,action:"failed",error:{code:J,message:lJ(v)}}}for(let v=0;v<=cG;v++)try{return await Q(U,{recursive:!0,force:!0}),{success:!0,action:"removed"}}catch(J){let Y=lG(J);if(Y==="ENOENT")return{success:!0,action:"none"};if(!sD.has(Y))return{success:!1,action:"failed",error:{code:Y,message:lJ(J)}};if(v<cG)await $M(eD*2**v);else return{success:!1,action:"failed",error:{code:Y,message:lJ(J)}}}return{success:!1,action:"failed",error:{code:"UNKNOWN",message:"exhausted retries"}}}var sD,cG=3,eD=100;var rG=b(()=>{sD=new Set(["EBUSY","ENOTEMPTY"])});function oG($,_){let U=0,Q,v="",J="";for(;U<$.length;U++)if(Q=$[U],v+=Q.open,J+=Q.close,~_.indexOf(Q.close))_=_.replace(Q.rgx,Q.close+Q.open);return v+_+J}function _M($,_){let U={has:$,keys:_};return U.reset=k$.reset.bind(U),U.bold=k$.bold.bind(U),U.dim=k$.dim.bind(U),U.italic=k$.italic.bind(U),U.underline=k$.underline.bind(U),U.inverse=k$.inverse.bind(U),U.hidden=k$.hidden.bind(U),U.strikethrough=k$.strikethrough.bind(U),U.black=k$.black.bind(U),U.red=k$.red.bind(U),U.green=k$.green.bind(U),U.yellow=k$.yellow.bind(U),U.blue=k$.blue.bind(U),U.magenta=k$.magenta.bind(U),U.cyan=k$.cyan.bind(U),U.white=k$.white.bind(U),U.gray=k$.gray.bind(U),U.grey=k$.grey.bind(U),U.bgBlack=k$.bgBlack.bind(U),U.bgRed=k$.bgRed.bind(U),U.bgGreen=k$.bgGreen.bind(U),U.bgYellow=k$.bgYellow.bind(U),U.bgBlue=k$.bgBlue.bind(U),U.bgMagenta=k$.bgMagenta.bind(U),U.bgCyan=k$.bgCyan.bind(U),U.bgWhite=k$.bgWhite.bind(U),U}function P$($,_){let U={open:`\x1B[${$}m`,close:`\x1B[${_}m`,rgx:new RegExp(`\\x1b\\[${_}m`,"g")};return function(Q){if(this!==void 0&&this.has!==void 0)return!!~this.has.indexOf($)||(this.has.push($),this.keys.push(U)),Q===void 0?this:k$.enabled?oG(this.keys,Q+""):Q+"";return Q===void 0?_M([$],[U]):k$.enabled?oG([U],Q+""):Q+""}}var dJ,tG,aG,sG,eG=!0,k$,g;var k6=b(()=>{if(typeof process<"u")({FORCE_COLOR:dJ,NODE_DISABLE_COLORS:tG,NO_COLOR:aG,TERM:sG}=process.env||{}),eG=process.stdout&&process.stdout.isTTY;k$={enabled:!tG&&aG==null&&sG!=="dumb"&&(dJ!=null&&dJ!=="0"||eG),reset:P$(0,0),bold:P$(1,22),dim:P$(2,22),italic:P$(3,23),underline:P$(4,24),inverse:P$(7,27),hidden:P$(8,28),strikethrough:P$(9,29),black:P$(30,39),red:P$(31,39),green:P$(32,39),yellow:P$(33,39),blue:P$(34,39),magenta:P$(35,39),cyan:P$(36,39),white:P$(37,39),gray:P$(90,39),grey:P$(90,39),bgBlack:P$(40,49),bgRed:P$(41,49),bgGreen:P$(42,49),bgYellow:P$(43,49),bgBlue:P$(44,49),bgMagenta:P$(45,49),bgCyan:P$(46,49),bgWhite:P$(47,49)};g=k$});function _j($,_){if($==null||$==="")return _;let U=$.trim().toLowerCase();if(U==="true"||U==="1"||U==="yes"||U==="on")return!0;if(U==="false"||U==="0"||U==="no"||U==="off")return!1;return _}var vM,M1,$j;var l_=b(()=>{vM=Boolean(process.env.CI||process.env.GITHUB_ACTIONS||process.env.GITLAB_CI||process.env.CIRCLECI||process.env.JENKINS_URL||process.env.BUILDKITE),M1=Boolean(process.stdout.isTTY&&!vM),$j=Boolean(M1&&process.env.FORCE_COLOR!=="0"&&process.env.NO_COLOR===void 0)});var N0,W,N4;var i$=b(()=>{k6();l_();if(!$j)g.enabled=!1;N0={},W={info(...$){if(N0.quiet)return;console.log(g.blue("info"),...$)},success(...$){if(N0.quiet)return;console.log(g.green("\u2713"),...$)},warn(...$){if(N0.quiet)return;console.warn(g.yellow("warn"),...$)},error(...$){console.error(g.red("error"),...$)},debug(...$){if(!N0.verbose)return;console.log(g.gray("debug"),...$)},log(...$){if(N0.quiet)return;console.log(...$)},break(){if(N0.quiet)return;console.log("")}},N4={component:($)=>g.cyan($),path:($)=>g.green($),command:($)=>g.yellow($),url:($)=>g.blue().underline($),error:($)=>g.red($),dim:($)=>g.gray($),bold:($)=>g.bold($)}});function S4($,_={}){if(_.json){console.log(JSON.stringify($,null,2));return}if(_.quiet)return;if(W.info(N4.dim("\uD83D\uDD0D DRY RUN: No changes will be made")),W.break(),$.wouldPerform.length===0)W.info("No actions would be performed.");else{let Q=UM($.wouldPerform);for(let[v,J]of Object.entries(Q)){let Y=QM(v);W.info(`Would ${Y} ${J.length} item(s):`);for(let z of J){let I=JM(z.details);W.info(` \u2022 ${N4.component(z.target)}${I}`)}W.break()}}if($.summary)W.info($.summary),W.break();if($.validation.errors&&$.validation.errors.length>0){W.error("Would fail with errors:");for(let Q of $.validation.errors)W.error(` \u2022 ${Q}`);W.break()}if($.validation.warnings&&$.validation.warnings.length>0){W.warn("Warnings:");for(let Q of $.validation.warnings)W.warn(` \u2022 ${Q}`);W.break()}if(_.hints&&_.hints.length>0){for(let Q of _.hints)W.info(N4.dim(Q));W.break()}W.info(N4.dim("Run without --dry-run to apply changes."))}function UM($){let _={};for(let U of $){if(!_[U.action])_[U.action]=[];_[U.action]?.push(U)}return _}function QM($){return{add:"add",remove:"remove",delete:"delete",update:"update",create:"create",modify:"modify"}[$]??$}function JM($){if(!$||Object.keys($).length===0)return"";let _=[];for(let[U,Q]of Object.entries($??{}))if(Q!==void 0&&Q!==null)_.push(`${U}: ${N4.dim(String(Q))}`);return _.length>0?` (${_.join(", ")})`:""}var w1=b(()=>{i$()});var vj={};s$(vj,{wrapAction:()=>YM,handleError:()=>_$});function _$($,_={}){if(_.json){let U=zM($);console.log(JSON.stringify(U,null,2)),process.exit(U.exitCode)}if($ instanceof b$)W.error($.message),process.exit($.exitCode);if($ instanceof H2){W.error("Validation failed:");for(let U of $.issues){let Q=U.path.join(".");W.error(` ${Q}: ${U.message}`)}process.exit(K$.CONFIG)}if($ instanceof Error){if(W.error($.message),process.env.DEBUG)console.error($.stack)}else W.error("An unknown error occurred");process.exit(K$.GENERAL)}function YM($){return async(..._)=>{try{await $(..._)}catch(U){_$(U)}}}function zM($){if($ instanceof W0)return{success:!1,error:{code:$.code,message:$.message,details:{conflictType:$.conflictType,registryName:$.registryName,existingUrl:$.existingUrl,newUrl:$.newUrl,...$.targetLabel&&{targetLabel:$.targetLabel},...$.existingName&&{existingName:$.existingName}}},exitCode:$.exitCode,meta:{timestamp:new Date().toISOString()}};if($ instanceof I1)return{success:!1,error:{code:$.code,message:$.message,details:{component:$.component,expected:$.expected,found:$.found}},exitCode:$.exitCode,meta:{timestamp:new Date().toISOString()}};if($ instanceof E$){let _={};if($.url)_.url=$.url;if($.status!==void 0)_.status=$.status;if($.statusText)_.statusText=$.statusText;if($.phase)_.phase=$.phase;if($.qualifiedName)_.qualifiedName=$.qualifiedName;if($.registryContext)_.registryContext=$.registryContext;if($.registryName)_.registryName=$.registryName;return{success:!1,error:{code:$.code,message:$.message,...Object.keys(_).length>0&&{details:_}},exitCode:$.exitCode,meta:{timestamp:new Date().toISOString()}}}if($ instanceof m$)return{success:!1,error:{code:$.code,message:$.message,details:{profile:$.profile}},exitCode:$.exitCode,meta:{timestamp:new Date().toISOString()}};if($ instanceof m6)return{success:!1,error:{code:$.code,message:$.message,details:{profile:$.profile}},exitCode:$.exitCode,meta:{timestamp:new Date().toISOString()}};if($ instanceof n4)return{success:!1,error:{code:$.code,message:$.message,details:{profile:$.profile,reason:$.reason}},exitCode:$.exitCode,meta:{timestamp:new Date().toISOString()}};if($ instanceof z6)return{success:!1,error:{code:"BUILD_ERROR",message:$.message,details:{errors:$.errors}},exitCode:K$.GENERAL,meta:{timestamp:new Date().toISOString()}};if($ instanceof i4){let _={url:$.url,issue:$.issue,remediation:$.remediation};if($.schemaUrl!==void 0)_.schemaUrl=$.schemaUrl;if($.supportedMajor!==void 0)_.supportedMajor=$.supportedMajor;if($.detectedMajor!==void 0)_.detectedMajor=$.detectedMajor;return{success:!1,error:{code:$.code,message:$.message,details:_},exitCode:$.exitCode,meta:{timestamp:new Date().toISOString()}}}if($ instanceof z1)return{success:!1,error:{code:$.code,message:$.message,details:$.details},exitCode:$.exitCode,meta:{timestamp:new Date().toISOString()}};if($ instanceof b$)return{success:!1,error:{code:$.code,message:$.message},exitCode:$.exitCode,meta:{timestamp:new Date().toISOString()}};if($ instanceof H2)return{success:!1,error:{code:"VALIDATION_ERROR",message:$.issues.map((_)=>`${_.path.join(".")}: ${_.message}`).join("; "),details:{issues:$.issues.map((_)=>({path:_.path.join("."),message:_.message,code:_.code}))}},exitCode:K$.CONFIG,meta:{timestamp:new Date().toISOString()}};return{success:!1,error:{code:"UNKNOWN_ERROR",message:$ instanceof Error?$.message:"An unknown error occurred"},exitCode:K$.GENERAL,meta:{timestamp:new Date().toISOString()}}}var c$=b(()=>{B6();p2();z$();i$()});function O$($){console.log(JSON.stringify($,null,2))}function Qj($){if(!$)throw new M("npm package name cannot be empty");if($.length>Uj)throw new M(`npm package name exceeds maximum length of ${Uj} characters: \`${$}\``);if($.includes("..")||$.includes("/./")||$.startsWith("./"))throw new M(`Invalid npm package name - path traversal detected: \`${$}\``);if(!qM.test($))throw new M(`Invalid npm package name: \`${$}\`. Must be lowercase, start with alphanumeric, and contain only letters, numbers, hyphens, dots, or underscores.`)}function Jj($){if(!$?.trim())throw new M("npm specifier cannot be empty");let _=$.trim();if(!_.startsWith("npm:"))throw new M(`Invalid npm specifier: \`${$}\`. Must start with \`npm:\` prefix.`);let U=_.slice(4);if(!U)throw new M(`Invalid npm specifier: \`${$}\`. Package name is required.`);let Q=U.lastIndexOf("@"),v,J;if(Q>0){let Y=U.slice(0,Q),z=U.slice(Q+1);if(Y.includes("/")||!Y.startsWith("@"))v=Y,J=z||void 0;else throw new M(`Invalid npm specifier: \`${$}\`. Scoped packages must have format @scope/pkg.`)}else v=U;return Qj(v),{type:"npm",name:v,version:J}}function Yj($){return $.trim().startsWith("npm:")}async function pJ($,_){Qj($);let U=$.startsWith("@")?`@${encodeURIComponent($.slice(1))}`:encodeURIComponent($),Q=`${IM}/${U}`;try{let v=_??AbortSignal.timeout(XM),J=await fetch(Q,{signal:v,headers:{Accept:"application/json"}});if(J.status===404)throw new B$(`npm package \`${$}\` not found on registry`);if(!J.ok)throw new E$(`Failed to fetch npm package \`${$}\`: HTTP ${J.status} ${J.statusText}`);return await J.json()}catch(v){if(v instanceof B$||v instanceof E$)throw v;if(v instanceof Error&&(v.name==="AbortError"||v.name==="TimeoutError"))throw new E$(`Request to npm registry timed out for package \`${$}\``);let J=v instanceof Error?v.message:String(v);throw new E$(`Failed to fetch npm package \`${$}\`: ${J}`)}}function S0($,_){return _?`${$}@${_}`:$}function zj($){let _=[];if($.type!=="module")throw new M(`Package \`${$.name}\` is not an ESM module (missing "type": "module" in package.json)`);let U=Boolean($.main),Q=$.exports!==void 0;if(!U&&!Q)throw new M(`Package \`${$.name}\` has no entry point (missing "main" or "exports")`);if(!$.name.includes("opencode"))_.push(`Package name \`${$.name}\` doesn't contain "opencode" - this may not be an OpenCode plugin`);return{valid:!0,warnings:_}}async function q8($,_,U){let Q=await pJ($,U),v=_??Q["dist-tags"].latest,J=Q.versions[v];if(!J)throw new B$(`Version \`${v}\` not found for npm package \`${$}\``);return J}function Ij($){let _=$.trim(),U=_.lastIndexOf("@");if(U<=0)return _;let Q=_.slice(0,U);if(Q.includes("/")||!Q.startsWith("@"))return Q;return _}var IM="https://registry.npmjs.org",XM=30000,qM,Uj=214;var iJ=b(()=>{z$();qM=/^(?:@[a-z0-9][\w.-]*\/)?[a-z0-9][\w.-]*$/});function L1($,_){let U=$.get(_.absolutePath);if(!U){$.set(_.absolutePath,_);return}let Q=U.content.equals(_.content)?"identical content":"different content";throw new t$(`Intra-batch target collision at "${_.relativePath}". Both "${U.source}" and "${_.source}" resolve to this path with ${Q}. Rename one manifest target so each component writes to a unique path.`)}var G8=b(()=>{z$()});import{createHash as GM}from"crypto";import{existsSync as jM}from"fs";import{join as KM}from"path";function k1($){return GM("sha256").update($).digest("hex")}async function j8($){let _=[...$].sort((Q,v)=>Q.path.localeCompare(v.path)),U=[];for(let Q of _){let v=k1(Q.content);U.push(`${Q.path}:${v}`)}return k1(U.join(`
126
+ `))}async function d_($,_){let U=[],Q=[],v=[];for(let J of _.files){let Y=KM($,J.path);if(!jM(Y)){Q.push(J.path),v.push({path:J.path,status:"missing"});continue}let z=await Bun.file(Y).text();if(k1(z)!==J.hash)U.push(J.path),v.push({path:J.path,status:"modified"});else v.push({path:J.path,status:"intact"})}return{intact:U.length===0&&Q.length===0,modified:U,missing:Q,details:v}}var T0=b(()=>{X4()});function Q4($){return $.addOption(f4.cwd()).addOption(f4.quiet()).addOption(f4.json())}function m4($){return $.addOption(f4.verbose())}function G6($){return $.addOption(f4.global)}function K8($){return $.addOption(f4.profile())}function Xj($){if(!$||$.length===0)throw new n4($,"cannot be empty");if($.length>32)throw new n4($,"must be 32 characters or less");if(!/^[a-zA-Z][a-zA-Z0-9._-]*$/.test($))throw new n4($,"must start with a letter and contain only alphanumeric characters, dots, underscores, or hyphens")}var f4;var a4=b(()=>{a2();z$();f4={cwd:()=>new M6("--cwd <path>","Working directory").default(process.cwd()),quiet:()=>new M6("-q, --quiet","Suppress output"),json:()=>new M6("--json","Output as JSON"),profile:()=>new M6("-p, --profile <name>","Target a specific profile's config"),verbose:()=>new M6("-v, --verbose","Verbose output"),global:new M6("-g, --global","Install to global OpenCode config (~/.config/opencode)")}});function bM(){let $=new Map;for(let[_,U]of Object.entries(u$)){for(let[Q,v]of Object.entries(U))u$[Q]={open:`\x1B[${v[0]}m`,close:`\x1B[${v[1]}m`},U[Q]=u$[Q],$.set(v[0],v[1]);Object.defineProperty(u$,_,{value:U,enumerable:!1})}return Object.defineProperty(u$,"codes",{value:$,enumerable:!1}),u$.color.close="\x1B[39m",u$.bgColor.close="\x1B[49m",u$.color.ansi=qj(),u$.color.ansi256=Gj(),u$.color.ansi16m=jj(),u$.bgColor.ansi=qj(10),u$.bgColor.ansi256=Gj(10),u$.bgColor.ansi16m=jj(10),Object.defineProperties(u$,{rgbToAnsi256:{value(_,U,Q){if(_===U&&U===Q){if(_<8)return 16;if(_>248)return 231;return Math.round((_-8)/247*24)+232}return 16+36*Math.round(_/255*5)+6*Math.round(U/255*5)+Math.round(Q/255*5)},enumerable:!1},hexToRgb:{value(_){let U=/[a-f\d]{6}|[a-f\d]{3}/i.exec(_.toString(16));if(!U)return[0,0,0];let[Q]=U;if(Q.length===3)Q=[...Q].map((J)=>J+J).join("");let v=Number.parseInt(Q,16);return[v>>16&255,v>>8&255,v&255]},enumerable:!1},hexToAnsi256:{value:(_)=>u$.rgbToAnsi256(...u$.hexToRgb(_)),enumerable:!1},ansi256ToAnsi:{value(_){if(_<8)return 30+_;if(_<16)return 90+(_-8);let U,Q,v;if(_>=232)U=((_-232)*10+8)/255,Q=U,v=U;else{_-=16;let z=_%36;U=Math.floor(_/36)/5,Q=Math.floor(z/6)/5,v=z%6/5}let J=Math.max(U,Q,v)*2;if(J===0)return 30;let Y=30+(Math.round(v)<<2|Math.round(Q)<<1|Math.round(U));if(J===2)Y+=60;return Y},enumerable:!1},rgbToAnsi:{value:(_,U,Q)=>u$.ansi256ToAnsi(u$.rgbToAnsi256(_,U,Q)),enumerable:!1},hexToAnsi:{value:(_)=>u$.ansi256ToAnsi(u$.hexToAnsi256(_)),enumerable:!1}}),u$}var qj=($=0)=>(_)=>`\x1B[${_+$}m`,Gj=($=0)=>(_)=>`\x1B[${38+$};5;${_}m`,jj=($=0)=>(_,U,Q)=>`\x1B[${38+$};2;${_};${U};${Q}m`,u$,yE,HM,WM,CE,BM,s4;var Kj=b(()=>{u$={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},yE=Object.keys(u$.modifier),HM=Object.keys(u$.color),WM=Object.keys(u$.bgColor),CE=[...HM,...WM];BM=bM(),s4=BM});import nJ from"process";import ZM from"os";import Hj from"tty";function g4($,_=globalThis.Deno?globalThis.Deno.args:nJ.argv){let U=$.startsWith("-")?"":$.length===1?"-":"--",Q=_.indexOf(U+$),v=_.indexOf("--");return Q!==-1&&(v===-1||Q<v)}function VM(){if("FORCE_COLOR"in y$){if(y$.FORCE_COLOR==="true")return 1;if(y$.FORCE_COLOR==="false")return 0;return y$.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(y$.FORCE_COLOR,10),3)}}function DM($){if($===0)return!1;return{level:$,hasBasic:!0,has256:$>=2,has16m:$>=3}}function MM($,{streamIsTTY:_,sniffFlags:U=!0}={}){let Q=VM();if(Q!==void 0)H8=Q;let v=U?H8:Q;if(v===0)return 0;if(U){if(g4("color=16m")||g4("color=full")||g4("color=truecolor"))return 3;if(g4("color=256"))return 2}if("TF_BUILD"in y$&&"AGENT_NAME"in y$)return 1;if($&&!_&&v===void 0)return 0;let J=v||0;if(y$.TERM==="dumb")return J;if(nJ.platform==="win32"){let Y=ZM.release().split(".");if(Number(Y[0])>=10&&Number(Y[2])>=10586)return Number(Y[2])>=14931?3:2;return 1}if("CI"in y$){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((Y)=>(Y in y$)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((Y)=>(Y in y$))||y$.CI_NAME==="codeship")return 1;return J}if("TEAMCITY_VERSION"in y$)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(y$.TEAMCITY_VERSION)?1:0;if(y$.COLORTERM==="truecolor")return 3;if(y$.TERM==="xterm-kitty")return 3;if(y$.TERM==="xterm-ghostty")return 3;if(y$.TERM==="wezterm")return 3;if("TERM_PROGRAM"in y$){let Y=Number.parseInt((y$.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(y$.TERM_PROGRAM){case"iTerm.app":return Y>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(y$.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(y$.TERM))return 1;if("COLORTERM"in y$)return 1;return J}function Wj($,_={}){let U=MM($,{streamIsTTY:$&&$.isTTY,..._});return DM(U)}var y$,H8,wM,bj;var Bj=b(()=>{({env:y$}=nJ);if(g4("no-color")||g4("no-colors")||g4("color=false")||g4("color=never"))H8=0;else if(g4("color")||g4("colors")||g4("color=true")||g4("color=always"))H8=1;wM={stdout:Wj({isTTY:Hj.isatty(1)}),stderr:Wj({isTTY:Hj.isatty(2)})},bj=wM});function Zj($,_,U){let Q=$.indexOf(_);if(Q===-1)return $;let v=_.length,J=0,Y="";do Y+=$.slice(J,Q)+_+U,J=Q+v,Q=$.indexOf(_,J);while(Q!==-1);return Y+=$.slice(J),Y}function Vj($,_,U,Q){let v=0,J="";do{let Y=$[Q-1]==="\r";J+=$.slice(v,Y?Q-1:Q)+_+(Y?`\r
88
127
  `:`
89
- `)+B,_=$+1,$=D.indexOf(`
90
- `,_)}while($!==-1);return Q+=D.slice(_),Q}function k3(D){return BH(D)}var f4,h4,r1,nF,S3,m4,sF,FH=(D,F={})=>{if(F.level&&!(Number.isInteger(F.level)&&F.level>=0&&F.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let B=f4?f4.level:0;D.level=F.level===void 0?B:F.level},BH=(D)=>{let F=(...B)=>B.join(" ");return FH(F,D),Object.setPrototypeOf(F,k3.prototype),F},t1=(D,F,B,...$)=>{if(D==="rgb"){if(F==="ansi16m")return y0[B].ansi16m(...$);if(F==="ansi256")return y0[B].ansi256(y0.rgbToAnsi256(...$));return y0[B].ansi(y0.rgbToAnsi(...$))}if(D==="hex")return t1("rgb",F,B,...y0.hexToRgb(...$));return y0[B][D](...$)},$H,_H,e1=(D,F,B)=>{let $,_;if(B===void 0)$=D,_=F;else $=B.openAll+D,_=F+B.closeAll;return{open:D,close:F,openAll:$,closeAll:_,parent:B}},V8=(D,F,B)=>{let $=(..._)=>QH($,_.length===1?""+_[0]:_.join(" "));return Object.setPrototypeOf($,_H),$[r1]=D,$[nF]=F,$[S3]=B,$},QH=(D,F)=>{if(D.level<=0||!F)return D[S3]?"":F;let B=D[nF];if(B===void 0)return F;let{openAll:$,closeAll:_}=B;if(F.includes("\x1B"))while(B!==void 0)F=x4(F,B.close,B.open),B=B.parent;let Q=F.indexOf(`
91
- `);if(Q!==-1)F=y4(F,_,$,Q);return $+F+_},YH,hj,f0;var D6=V(()=>{T4();P4();({stdout:f4,stderr:h4}=u4),r1=Symbol("GENERATOR"),nF=Symbol("STYLER"),S3=Symbol("IS_EMPTY"),m4=["ansi","ansi","ansi256","ansi16m"],sF=Object.create(null);Object.setPrototypeOf(k3.prototype,Function.prototype);for(let[D,F]of Object.entries(y0))sF[D]={get(){let B=V8(this,e1(F.open,F.close,this[nF]),this[S3]);return Object.defineProperty(this,D,{value:B}),B}};sF.visible={get(){let D=V8(this,this[nF],!0);return Object.defineProperty(this,"visible",{value:D}),D}};$H=["rgb","hex","ansi256"];for(let D of $H){sF[D]={get(){let{level:B}=this;return function(...$){let _=e1(t1(D,m4[B],"color",...$),y0.color.close,this[nF]);return V8(this,_,this[S3])}}};let F="bg"+D[0].toUpperCase()+D.slice(1);sF[F]={get(){let{level:B}=this;return function(...$){let _=e1(t1(D,m4[B],"bgColor",...$),y0.bgColor.close,this[nF]);return V8(this,_,this[S3])}}}}_H=Object.defineProperties(()=>{},{...sF,level:{enumerable:!0,get(){return this[r1].level},set(D){this[r1].level=D}}});Object.defineProperties(k3.prototype,sF);YH=k3(),hj=k3({level:h4?h4.level:0}),f0=YH});function F6(D,F,{ignoreNonConfigurable:B=!1}={}){let{name:$}=D;for(let _ of Reflect.ownKeys(F))qH(D,F,_,B);return JH(D,F),zH(D,F,$),D}var qH=(D,F,B,$)=>{if(B==="length"||B==="prototype")return;if(B==="arguments"||B==="caller")return;let _=Object.getOwnPropertyDescriptor(D,B),Q=Object.getOwnPropertyDescriptor(F,B);if(!HH(_,Q)&&$)return;Object.defineProperty(D,B,Q)},HH=function(D,F){return D===void 0||D.configurable||D.writable===F.writable&&D.enumerable===F.enumerable&&D.configurable===F.configurable&&(D.writable||D.value===F.value)},JH=(D,F)=>{let B=Object.getPrototypeOf(F);if(B===Object.getPrototypeOf(D))return;Object.setPrototypeOf(D,B)},XH=(D,F)=>`/* Wrapped ${D}*/
92
- ${F}`,GH,WH,zH=(D,F,B)=>{let $=B===""?"":`with ${B.trim()}() `,_=XH.bind(null,$,F.toString());Object.defineProperty(_,"name",WH);let{writable:Q,enumerable:Y,configurable:q}=GH;Object.defineProperty(D,"toString",{value:_,writable:Q,enumerable:Y,configurable:q})};var g4=V(()=>{GH=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),WH=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name")});var E8,d4=(D,F={})=>{if(typeof D!=="function")throw TypeError("Expected a function");let B,$=0,_=D.displayName||D.name||"<anonymous>",Q=function(...Y){if(E8.set(Q,++$),$===1)B=D.apply(this,Y),D=void 0;else if(F.throw===!0)throw Error(`Function \`${_}\` can only be called once`);return B};return F6(Q,D),E8.set(Q,$),Q},c4;var l4=V(()=>{g4();E8=new WeakMap;d4.callCount=(D)=>{if(!E8.has(D))throw Error(`The given function \`${D.name}\` is not wrapped by the \`onetime\` package`);return E8.get(D)};c4=d4});var QF;var p4=V(()=>{QF=[];QF.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")QF.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")QF.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});class i4{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if($6[B6])return $6[B6];MH($6,B6,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(D,F){this.listeners[D].push(F)}removeListener(D,F){let B=this.listeners[D],$=B.indexOf(F);if($===-1)return;if($===0&&B.length===1)B.length=0;else B.splice($,1)}emit(D,F,B){if(this.emitted[D])return!1;this.emitted[D]=!0;let $=!1;for(let _ of this.listeners[D])$=_(F,B)===!0||$;if(D==="exit")$=this.emit("afterExit",F,B)||$;return $}}class Q6{}var L8=(D)=>!!D&&typeof D==="object"&&typeof D.removeListener==="function"&&typeof D.emit==="function"&&typeof D.reallyExit==="function"&&typeof D.listeners==="function"&&typeof D.kill==="function"&&typeof D.pid==="number"&&typeof D.on==="function",B6,$6,MH,AH=(D)=>{return{onExit(F,B){return D.onExit(F,B)},load(){return D.load()},unload(){return D.unload()}}},n4,s4,_6,a4,ij,nj;var o4=V(()=>{p4();B6=Symbol.for("signal-exit emitter"),$6=globalThis,MH=Object.defineProperty.bind(Object);n4=class n4 extends Q6{onExit(){return()=>{}}load(){}unload(){}};s4=class s4 extends Q6{#Y=_6.platform==="win32"?"SIGINT":"SIGHUP";#B=new i4;#D;#_;#W;#F={};#Q=!1;constructor(D){super();this.#D=D,this.#F={};for(let F of QF)this.#F[F]=()=>{let B=this.#D.listeners(F),{count:$}=this.#B,_=D;if(typeof _.__signal_exit_emitter__==="object"&&typeof _.__signal_exit_emitter__.count==="number")$+=_.__signal_exit_emitter__.count;if(B.length===$){this.unload();let Q=this.#B.emit("exit",null,F),Y=F==="SIGHUP"?this.#Y:F;if(!Q)D.kill(D.pid,Y)}};this.#W=D.reallyExit,this.#_=D.emit}onExit(D,F){if(!L8(this.#D))return()=>{};if(this.#Q===!1)this.load();let B=F?.alwaysLast?"afterExit":"exit";return this.#B.on(B,D),()=>{if(this.#B.removeListener(B,D),this.#B.listeners.exit.length===0&&this.#B.listeners.afterExit.length===0)this.unload()}}load(){if(this.#Q)return;this.#Q=!0,this.#B.count+=1;for(let D of QF)try{let F=this.#F[D];if(F)this.#D.on(D,F)}catch(F){}this.#D.emit=(D,...F)=>{return this.#z(D,...F)},this.#D.reallyExit=(D)=>{return this.#$(D)}}unload(){if(!this.#Q)return;this.#Q=!1,QF.forEach((D)=>{let F=this.#F[D];if(!F)throw Error("Listener not defined for signal: "+D);try{this.#D.removeListener(D,F)}catch(B){}}),this.#D.emit=this.#_,this.#D.reallyExit=this.#W,this.#B.count-=1}#$(D){if(!L8(this.#D))return 0;return this.#D.exitCode=D||0,this.#B.emit("exit",this.#D.exitCode,null),this.#W.call(this.#D,this.#D.exitCode)}#z(D,...F){let B=this.#_;if(D==="exit"&&L8(this.#D)){if(typeof F[0]==="number")this.#D.exitCode=F[0];let $=B.call(this.#D,D,...F);return this.#B.emit("exit",this.#D.exitCode,null),$}else return B.call(this.#D,D,...F)}};_6=globalThis.process,{onExit:a4,load:ij,unload:nj}=AH(L8(_6)?new s4(_6):new n4)});import w8 from"process";var r4,jH,t4;var e4=V(()=>{l4();o4();r4=w8.stderr.isTTY?w8.stderr:w8.stdout.isTTY?w8.stdout:void 0,jH=r4?c4(()=>{a4(()=>{r4.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},t4=jH});import DB from"process";var O8=!1,aF,Y6;var FB=V(()=>{e4();aF={};aF.show=(D=DB.stderr)=>{if(!D.isTTY)return;O8=!1,D.write("\x1B[?25h")};aF.hide=(D=DB.stderr)=>{if(!D.isTTY)return;t4(),O8=!0,D.write("\x1B[?25l")};aF.toggle=(D,F)=>{if(D!==void 0)O8=D;if(O8)aF.show(F);else aF.hide(F)};Y6=aF});var BB=d0((BK,KH)=>{KH.exports={dots:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]},dots2:{interval:80,frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"]},dots3:{interval:80,frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"]},dots4:{interval:80,frames:["\u2804","\u2806","\u2807","\u280B","\u2819","\u2838","\u2830","\u2820","\u2830","\u2838","\u2819","\u280B","\u2807","\u2806"]},dots5:{interval:80,frames:["\u280B","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B"]},dots6:{interval:80,frames:["\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2834","\u2832","\u2812","\u2802","\u2802","\u2812","\u281A","\u2819","\u2809","\u2801"]},dots7:{interval:80,frames:["\u2808","\u2809","\u280B","\u2813","\u2812","\u2810","\u2810","\u2812","\u2816","\u2826","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808"]},dots8:{interval:80,frames:["\u2801","\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808","\u2808"]},dots9:{interval:80,frames:["\u28B9","\u28BA","\u28BC","\u28F8","\u28C7","\u2867","\u2857","\u284F"]},dots10:{interval:80,frames:["\u2884","\u2882","\u2881","\u2841","\u2848","\u2850","\u2860"]},dots11:{interval:100,frames:["\u2801","\u2802","\u2804","\u2840","\u2880","\u2820","\u2810","\u2808"]},dots12:{interval:80,frames:["\u2880\u2800","\u2840\u2800","\u2804\u2800","\u2882\u2800","\u2842\u2800","\u2805\u2800","\u2883\u2800","\u2843\u2800","\u280D\u2800","\u288B\u2800","\u284B\u2800","\u280D\u2801","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2888\u2829","\u2840\u2899","\u2804\u2859","\u2882\u2829","\u2842\u2898","\u2805\u2858","\u2883\u2828","\u2843\u2890","\u280D\u2850","\u288B\u2820","\u284B\u2880","\u280D\u2841","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2808\u2829","\u2800\u2899","\u2800\u2859","\u2800\u2829","\u2800\u2898","\u2800\u2858","\u2800\u2828","\u2800\u2890","\u2800\u2850","\u2800\u2820","\u2800\u2880","\u2800\u2840"]},dots13:{interval:80,frames:["\u28FC","\u28F9","\u28BB","\u283F","\u285F","\u28CF","\u28E7","\u28F6"]},dots8Bit:{interval:80,frames:["\u2800","\u2801","\u2802","\u2803","\u2804","\u2805","\u2806","\u2807","\u2840","\u2841","\u2842","\u2843","\u2844","\u2845","\u2846","\u2847","\u2808","\u2809","\u280A","\u280B","\u280C","\u280D","\u280E","\u280F","\u2848","\u2849","\u284A","\u284B","\u284C","\u284D","\u284E","\u284F","\u2810","\u2811","\u2812","\u2813","\u2814","\u2815","\u2816","\u2817","\u2850","\u2851","\u2852","\u2853","\u2854","\u2855","\u2856","\u2857","\u2818","\u2819","\u281A","\u281B","\u281C","\u281D","\u281E","\u281F","\u2858","\u2859","\u285A","\u285B","\u285C","\u285D","\u285E","\u285F","\u2820","\u2821","\u2822","\u2823","\u2824","\u2825","\u2826","\u2827","\u2860","\u2861","\u2862","\u2863","\u2864","\u2865","\u2866","\u2867","\u2828","\u2829","\u282A","\u282B","\u282C","\u282D","\u282E","\u282F","\u2868","\u2869","\u286A","\u286B","\u286C","\u286D","\u286E","\u286F","\u2830","\u2831","\u2832","\u2833","\u2834","\u2835","\u2836","\u2837","\u2870","\u2871","\u2872","\u2873","\u2874","\u2875","\u2876","\u2877","\u2838","\u2839","\u283A","\u283B","\u283C","\u283D","\u283E","\u283F","\u2878","\u2879","\u287A","\u287B","\u287C","\u287D","\u287E","\u287F","\u2880","\u2881","\u2882","\u2883","\u2884","\u2885","\u2886","\u2887","\u28C0","\u28C1","\u28C2","\u28C3","\u28C4","\u28C5","\u28C6","\u28C7","\u2888","\u2889","\u288A","\u288B","\u288C","\u288D","\u288E","\u288F","\u28C8","\u28C9","\u28CA","\u28CB","\u28CC","\u28CD","\u28CE","\u28CF","\u2890","\u2891","\u2892","\u2893","\u2894","\u2895","\u2896","\u2897","\u28D0","\u28D1","\u28D2","\u28D3","\u28D4","\u28D5","\u28D6","\u28D7","\u2898","\u2899","\u289A","\u289B","\u289C","\u289D","\u289E","\u289F","\u28D8","\u28D9","\u28DA","\u28DB","\u28DC","\u28DD","\u28DE","\u28DF","\u28A0","\u28A1","\u28A2","\u28A3","\u28A4","\u28A5","\u28A6","\u28A7","\u28E0","\u28E1","\u28E2","\u28E3","\u28E4","\u28E5","\u28E6","\u28E7","\u28A8","\u28A9","\u28AA","\u28AB","\u28AC","\u28AD","\u28AE","\u28AF","\u28E8","\u28E9","\u28EA","\u28EB","\u28EC","\u28ED","\u28EE","\u28EF","\u28B0","\u28B1","\u28B2","\u28B3","\u28B4","\u28B5","\u28B6","\u28B7","\u28F0","\u28F1","\u28F2","\u28F3","\u28F4","\u28F5","\u28F6","\u28F7","\u28B8","\u28B9","\u28BA","\u28BB","\u28BC","\u28BD","\u28BE","\u28BF","\u28F8","\u28F9","\u28FA","\u28FB","\u28FC","\u28FD","\u28FE","\u28FF"]},sand:{interval:80,frames:["\u2801","\u2802","\u2804","\u2840","\u2848","\u2850","\u2860","\u28C0","\u28C1","\u28C2","\u28C4","\u28CC","\u28D4","\u28E4","\u28E5","\u28E6","\u28EE","\u28F6","\u28F7","\u28FF","\u287F","\u283F","\u289F","\u281F","\u285B","\u281B","\u282B","\u288B","\u280B","\u280D","\u2849","\u2809","\u2811","\u2821","\u2881"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["\u2802","-","\u2013","\u2014","\u2013","-"]},pipe:{interval:100,frames:["\u2524","\u2518","\u2534","\u2514","\u251C","\u250C","\u252C","\u2510"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["\u2736","\u2738","\u2739","\u273A","\u2739","\u2737"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","\xB4","-","_","_","_"]},hamburger:{interval:100,frames:["\u2631","\u2632","\u2634"]},growVertical:{interval:120,frames:["\u2581","\u2583","\u2584","\u2585","\u2586","\u2587","\u2586","\u2585","\u2584","\u2583"]},growHorizontal:{interval:120,frames:["\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u258A","\u258B","\u258C","\u258D","\u258E"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","\xB0","O","o","."]},noise:{interval:100,frames:["\u2593","\u2592","\u2591"]},bounce:{interval:120,frames:["\u2801","\u2802","\u2804","\u2802"]},boxBounce:{interval:120,frames:["\u2596","\u2598","\u259D","\u2597"]},boxBounce2:{interval:100,frames:["\u258C","\u2580","\u2590","\u2584"]},triangle:{interval:50,frames:["\u25E2","\u25E3","\u25E4","\u25E5"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["\u25DC","\u25E0","\u25DD","\u25DE","\u25E1","\u25DF"]},circle:{interval:120,frames:["\u25E1","\u2299","\u25E0"]},squareCorners:{interval:180,frames:["\u25F0","\u25F3","\u25F2","\u25F1"]},circleQuarters:{interval:120,frames:["\u25F4","\u25F7","\u25F6","\u25F5"]},circleHalves:{interval:50,frames:["\u25D0","\u25D3","\u25D1","\u25D2"]},squish:{interval:100,frames:["\u256B","\u256A"]},toggle:{interval:250,frames:["\u22B6","\u22B7"]},toggle2:{interval:80,frames:["\u25AB","\u25AA"]},toggle3:{interval:120,frames:["\u25A1","\u25A0"]},toggle4:{interval:100,frames:["\u25A0","\u25A1","\u25AA","\u25AB"]},toggle5:{interval:100,frames:["\u25AE","\u25AF"]},toggle6:{interval:300,frames:["\u101D","\u1040"]},toggle7:{interval:80,frames:["\u29BE","\u29BF"]},toggle8:{interval:100,frames:["\u25CD","\u25CC"]},toggle9:{interval:100,frames:["\u25C9","\u25CE"]},toggle10:{interval:100,frames:["\u3282","\u3280","\u3281"]},toggle11:{interval:50,frames:["\u29C7","\u29C6"]},toggle12:{interval:120,frames:["\u2617","\u2616"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["\u2190","\u2196","\u2191","\u2197","\u2192","\u2198","\u2193","\u2199"]},arrow2:{interval:80,frames:["\u2B06\uFE0F ","\u2197\uFE0F ","\u27A1\uFE0F ","\u2198\uFE0F ","\u2B07\uFE0F ","\u2199\uFE0F ","\u2B05\uFE0F ","\u2196\uFE0F "]},arrow3:{interval:120,frames:["\u25B9\u25B9\u25B9\u25B9\u25B9","\u25B8\u25B9\u25B9\u25B9\u25B9","\u25B9\u25B8\u25B9\u25B9\u25B9","\u25B9\u25B9\u25B8\u25B9\u25B9","\u25B9\u25B9\u25B9\u25B8\u25B9","\u25B9\u25B9\u25B9\u25B9\u25B8"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF)","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","(\u25CF )"]},smiley:{interval:200,frames:["\uD83D\uDE04 ","\uD83D\uDE1D "]},monkey:{interval:300,frames:["\uD83D\uDE48 ","\uD83D\uDE48 ","\uD83D\uDE49 ","\uD83D\uDE4A "]},hearts:{interval:100,frames:["\uD83D\uDC9B ","\uD83D\uDC99 ","\uD83D\uDC9C ","\uD83D\uDC9A ","\u2764\uFE0F "]},clock:{interval:100,frames:["\uD83D\uDD5B ","\uD83D\uDD50 ","\uD83D\uDD51 ","\uD83D\uDD52 ","\uD83D\uDD53 ","\uD83D\uDD54 ","\uD83D\uDD55 ","\uD83D\uDD56 ","\uD83D\uDD57 ","\uD83D\uDD58 ","\uD83D\uDD59 ","\uD83D\uDD5A "]},earth:{interval:180,frames:["\uD83C\uDF0D ","\uD83C\uDF0E ","\uD83C\uDF0F "]},material:{interval:17,frames:["\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581"]},moon:{interval:80,frames:["\uD83C\uDF11 ","\uD83C\uDF12 ","\uD83C\uDF13 ","\uD83C\uDF14 ","\uD83C\uDF15 ","\uD83C\uDF16 ","\uD83C\uDF17 ","\uD83C\uDF18 "]},runner:{interval:140,frames:["\uD83D\uDEB6 ","\uD83C\uDFC3 "]},pong:{interval:80,frames:["\u2590\u2802 \u258C","\u2590\u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802\u258C","\u2590 \u2820\u258C","\u2590 \u2840\u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590\u2820 \u258C"]},shark:{interval:120,frames:["\u2590|\\____________\u258C","\u2590_|\\___________\u258C","\u2590__|\\__________\u258C","\u2590___|\\_________\u258C","\u2590____|\\________\u258C","\u2590_____|\\_______\u258C","\u2590______|\\______\u258C","\u2590_______|\\_____\u258C","\u2590________|\\____\u258C","\u2590_________|\\___\u258C","\u2590__________|\\__\u258C","\u2590___________|\\_\u258C","\u2590____________|\\\u258C","\u2590____________/|\u258C","\u2590___________/|_\u258C","\u2590__________/|__\u258C","\u2590_________/|___\u258C","\u2590________/|____\u258C","\u2590_______/|_____\u258C","\u2590______/|______\u258C","\u2590_____/|_______\u258C","\u2590____/|________\u258C","\u2590___/|_________\u258C","\u2590__/|__________\u258C","\u2590_/|___________\u258C","\u2590/|____________\u258C"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["\u2600\uFE0F ","\u2600\uFE0F ","\u2600\uFE0F ","\uD83C\uDF24 ","\u26C5\uFE0F ","\uD83C\uDF25 ","\u2601\uFE0F ","\uD83C\uDF27 ","\uD83C\uDF28 ","\uD83C\uDF27 ","\uD83C\uDF28 ","\uD83C\uDF27 ","\uD83C\uDF28 ","\u26C8 ","\uD83C\uDF28 ","\uD83C\uDF27 ","\uD83C\uDF28 ","\u2601\uFE0F ","\uD83C\uDF25 ","\u26C5\uFE0F ","\uD83C\uDF24 ","\u2600\uFE0F ","\u2600\uFE0F "]},christmas:{interval:400,frames:["\uD83C\uDF32","\uD83C\uDF84"]},grenade:{interval:80,frames:["\u060C ","\u2032 "," \xB4 "," \u203E "," \u2E0C"," \u2E0A"," |"," \u204E"," \u2055"," \u0DF4 "," \u2053"," "," "," "]},point:{interval:125,frames:["\u2219\u2219\u2219","\u25CF\u2219\u2219","\u2219\u25CF\u2219","\u2219\u2219\u25CF","\u2219\u2219\u2219"]},layer:{interval:150,frames:["-","=","\u2261"]},betaWave:{interval:80,frames:["\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1"]},fingerDance:{interval:160,frames:["\uD83E\uDD18 ","\uD83E\uDD1F ","\uD83D\uDD96 ","\u270B ","\uD83E\uDD1A ","\uD83D\uDC46 "]},fistBump:{interval:80,frames:["\uD83E\uDD1C\u3000\u3000\u3000\u3000\uD83E\uDD1B ","\uD83E\uDD1C\u3000\u3000\u3000\u3000\uD83E\uDD1B ","\uD83E\uDD1C\u3000\u3000\u3000\u3000\uD83E\uDD1B ","\u3000\uD83E\uDD1C\u3000\u3000\uD83E\uDD1B\u3000 ","\u3000\u3000\uD83E\uDD1C\uD83E\uDD1B\u3000\u3000 ","\u3000\uD83E\uDD1C\u2728\uD83E\uDD1B\u3000\u3000 ","\uD83E\uDD1C\u3000\u2728\u3000\uD83E\uDD1B\u3000 "]},soccerHeader:{interval:80,frames:[" \uD83E\uDDD1\u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F\uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 "]},mindblown:{interval:160,frames:["\uD83D\uDE10 ","\uD83D\uDE10 ","\uD83D\uDE2E ","\uD83D\uDE2E ","\uD83D\uDE26 ","\uD83D\uDE26 ","\uD83D\uDE27 ","\uD83D\uDE27 ","\uD83E\uDD2F ","\uD83D\uDCA5 ","\u2728 ","\u3000 ","\u3000 ","\u3000 "]},speaker:{interval:160,frames:["\uD83D\uDD08 ","\uD83D\uDD09 ","\uD83D\uDD0A ","\uD83D\uDD09 "]},orangePulse:{interval:100,frames:["\uD83D\uDD38 ","\uD83D\uDD36 ","\uD83D\uDFE0 ","\uD83D\uDFE0 ","\uD83D\uDD36 "]},bluePulse:{interval:100,frames:["\uD83D\uDD39 ","\uD83D\uDD37 ","\uD83D\uDD35 ","\uD83D\uDD35 ","\uD83D\uDD37 "]},orangeBluePulse:{interval:100,frames:["\uD83D\uDD38 ","\uD83D\uDD36 ","\uD83D\uDFE0 ","\uD83D\uDFE0 ","\uD83D\uDD36 ","\uD83D\uDD39 ","\uD83D\uDD37 ","\uD83D\uDD35 ","\uD83D\uDD35 ","\uD83D\uDD37 "]},timeTravel:{interval:100,frames:["\uD83D\uDD5B ","\uD83D\uDD5A ","\uD83D\uDD59 ","\uD83D\uDD58 ","\uD83D\uDD57 ","\uD83D\uDD56 ","\uD83D\uDD55 ","\uD83D\uDD54 ","\uD83D\uDD53 ","\uD83D\uDD52 ","\uD83D\uDD51 ","\uD83D\uDD50 "]},aesthetic:{interval:80,frames:["\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0","\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1"]},dwarfFortress:{interval:80,frames:[" \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A \u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A \xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A \xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\u2593\xA3 "," \u263A\u2593\xA3 "," \u263A\u2592\xA3 "," \u263A\u2592\xA3 "," \u263A\u2591\xA3 "," \u263A\u2591\xA3 "," \u263A \xA3 "," \u263A\xA3 "," \u263A\xA3 "," \u263A\u2593 "," \u263A\u2593 "," \u263A\u2592 "," \u263A\u2592 "," \u263A\u2591 "," \u263A\u2591 "," \u263A "," \u263A &"," \u263A \u263C&"," \u263A \u263C &"," \u263A\u263C &"," \u263A\u263C & "," \u203C & "," \u263A & "," \u203C & "," \u263A & "," \u203C & "," \u263A & ","\u203C & "," & "," & "," & \u2591 "," & \u2592 "," & \u2593 "," & \xA3 "," & \u2591\xA3 "," & \u2592\xA3 "," & \u2593\xA3 "," & \xA3\xA3 "," & \u2591\xA3\xA3 "," & \u2592\xA3\xA3 ","& \u2593\xA3\xA3 ","& \xA3\xA3\xA3 "," \u2591\xA3\xA3\xA3 "," \u2592\xA3\xA3\xA3 "," \u2593\xA3\xA3\xA3 "," \u2588\xA3\xA3\xA3 "," \u2591\u2588\xA3\xA3\xA3 "," \u2592\u2588\xA3\xA3\xA3 "," \u2593\u2588\xA3\xA3\xA3 "," \u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "]}}});var q6=d0(($K,_B)=>{var b8=Object.assign({},BB()),$B=Object.keys(b8);Object.defineProperty(b8,"random",{get(){let D=Math.floor(Math.random()*$B.length),F=$B[D];return b8[F]}});_B.exports=b8});import h0 from"process";function H6(){if(h0.platform!=="win32")return h0.env.TERM!=="linux";return Boolean(h0.env.CI)||Boolean(h0.env.WT_SESSION)||Boolean(h0.env.TERMINUS_SUBLIME)||h0.env.ConEmuTask==="{cmd::Cmder}"||h0.env.TERM_PROGRAM==="Terminus-Sublime"||h0.env.TERM_PROGRAM==="vscode"||h0.env.TERM==="xterm-256color"||h0.env.TERM==="alacritty"||h0.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var QB=()=>{};var UH,VH,EH,I3;var YB=V(()=>{D6();QB();UH={info:f0.blue("\u2139"),success:f0.green("\u2714"),warning:f0.yellow("\u26A0"),error:f0.red("\u2716")},VH={info:f0.blue("i"),success:f0.green("\u221A"),warning:f0.yellow("\u203C"),error:f0.red("\xD7")},EH=H6()?UH:VH,I3=EH});function J6({onlyFirst:D=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",D?void 0:"g")}function T3(D){if(typeof D!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(LH,"")}var LH;var X6=V(()=>{LH=J6()});function qB(D){return D===161||D===164||D===167||D===168||D===170||D===173||D===174||D>=176&&D<=180||D>=182&&D<=186||D>=188&&D<=191||D===198||D===208||D===215||D===216||D>=222&&D<=225||D===230||D>=232&&D<=234||D===236||D===237||D===240||D===242||D===243||D>=247&&D<=250||D===252||D===254||D===257||D===273||D===275||D===283||D===294||D===295||D===299||D>=305&&D<=307||D===312||D>=319&&D<=322||D===324||D>=328&&D<=331||D===333||D===338||D===339||D===358||D===359||D===363||D===462||D===464||D===466||D===468||D===470||D===472||D===474||D===476||D===593||D===609||D===708||D===711||D>=713&&D<=715||D===717||D===720||D>=728&&D<=731||D===733||D===735||D>=768&&D<=879||D>=913&&D<=929||D>=931&&D<=937||D>=945&&D<=961||D>=963&&D<=969||D===1025||D>=1040&&D<=1103||D===1105||D===8208||D>=8211&&D<=8214||D===8216||D===8217||D===8220||D===8221||D>=8224&&D<=8226||D>=8228&&D<=8231||D===8240||D===8242||D===8243||D===8245||D===8251||D===8254||D===8308||D===8319||D>=8321&&D<=8324||D===8364||D===8451||D===8453||D===8457||D===8467||D===8470||D===8481||D===8482||D===8486||D===8491||D===8531||D===8532||D>=8539&&D<=8542||D>=8544&&D<=8555||D>=8560&&D<=8569||D===8585||D>=8592&&D<=8601||D===8632||D===8633||D===8658||D===8660||D===8679||D===8704||D===8706||D===8707||D===8711||D===8712||D===8715||D===8719||D===8721||D===8725||D===8730||D>=8733&&D<=8736||D===8739||D===8741||D>=8743&&D<=8748||D===8750||D>=8756&&D<=8759||D===8764||D===8765||D===8776||D===8780||D===8786||D===8800||D===8801||D>=8804&&D<=8807||D===8810||D===8811||D===8814||D===8815||D===8834||D===8835||D===8838||D===8839||D===8853||D===8857||D===8869||D===8895||D===8978||D>=9312&&D<=9449||D>=9451&&D<=9547||D>=9552&&D<=9587||D>=9600&&D<=9615||D>=9618&&D<=9621||D===9632||D===9633||D>=9635&&D<=9641||D===9650||D===9651||D===9654||D===9655||D===9660||D===9661||D===9664||D===9665||D>=9670&&D<=9672||D===9675||D>=9678&&D<=9681||D>=9698&&D<=9701||D===9711||D===9733||D===9734||D===9737||D===9742||D===9743||D===9756||D===9758||D===9792||D===9794||D===9824||D===9825||D>=9827&&D<=9829||D>=9831&&D<=9834||D===9836||D===9837||D===9839||D===9886||D===9887||D===9919||D>=9926&&D<=9933||D>=9935&&D<=9939||D>=9941&&D<=9953||D===9955||D===9960||D===9961||D>=9963&&D<=9969||D===9972||D>=9974&&D<=9977||D===9979||D===9980||D===9982||D===9983||D===10045||D>=10102&&D<=10111||D>=11094&&D<=11097||D>=12872&&D<=12879||D>=57344&&D<=63743||D>=65024&&D<=65039||D===65533||D>=127232&&D<=127242||D>=127248&&D<=127277||D>=127280&&D<=127337||D>=127344&&D<=127373||D===127375||D===127376||D>=127387&&D<=127404||D>=917760&&D<=917999||D>=983040&&D<=1048573||D>=1048576&&D<=1114109}function HB(D){return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510}function JB(D){return D>=4352&&D<=4447||D===8986||D===8987||D===9001||D===9002||D>=9193&&D<=9196||D===9200||D===9203||D===9725||D===9726||D===9748||D===9749||D>=9776&&D<=9783||D>=9800&&D<=9811||D===9855||D>=9866&&D<=9871||D===9875||D===9889||D===9898||D===9899||D===9917||D===9918||D===9924||D===9925||D===9934||D===9940||D===9962||D===9970||D===9971||D===9973||D===9978||D===9981||D===9989||D===9994||D===9995||D===10024||D===10060||D===10062||D>=10067&&D<=10069||D===10071||D>=10133&&D<=10135||D===10160||D===10175||D===11035||D===11036||D===11088||D===11093||D>=11904&&D<=11929||D>=11931&&D<=12019||D>=12032&&D<=12245||D>=12272&&D<=12287||D>=12289&&D<=12350||D>=12353&&D<=12438||D>=12441&&D<=12543||D>=12549&&D<=12591||D>=12593&&D<=12686||D>=12688&&D<=12773||D>=12783&&D<=12830||D>=12832&&D<=12871||D>=12880&&D<=42124||D>=42128&&D<=42182||D>=43360&&D<=43388||D>=44032&&D<=55203||D>=63744&&D<=64255||D>=65040&&D<=65049||D>=65072&&D<=65106||D>=65108&&D<=65126||D>=65128&&D<=65131||D>=94176&&D<=94180||D>=94192&&D<=94198||D>=94208&&D<=101589||D>=101631&&D<=101662||D>=101760&&D<=101874||D>=110576&&D<=110579||D>=110581&&D<=110587||D===110589||D===110590||D>=110592&&D<=110882||D===110898||D>=110928&&D<=110930||D===110933||D>=110948&&D<=110951||D>=110960&&D<=111355||D>=119552&&D<=119638||D>=119648&&D<=119670||D===126980||D===127183||D===127374||D>=127377&&D<=127386||D>=127488&&D<=127490||D>=127504&&D<=127547||D>=127552&&D<=127560||D===127568||D===127569||D>=127584&&D<=127589||D>=127744&&D<=127776||D>=127789&&D<=127797||D>=127799&&D<=127868||D>=127870&&D<=127891||D>=127904&&D<=127946||D>=127951&&D<=127955||D>=127968&&D<=127984||D===127988||D>=127992&&D<=128062||D===128064||D>=128066&&D<=128252||D>=128255&&D<=128317||D>=128331&&D<=128334||D>=128336&&D<=128359||D===128378||D===128405||D===128406||D===128420||D>=128507&&D<=128591||D>=128640&&D<=128709||D===128716||D>=128720&&D<=128722||D>=128725&&D<=128728||D>=128732&&D<=128735||D===128747||D===128748||D>=128756&&D<=128764||D>=128992&&D<=129003||D===129008||D>=129292&&D<=129338||D>=129340&&D<=129349||D>=129351&&D<=129535||D>=129648&&D<=129660||D>=129664&&D<=129674||D>=129678&&D<=129734||D===129736||D>=129741&&D<=129756||D>=129759&&D<=129770||D>=129775&&D<=129784||D>=131072&&D<=196605||D>=196608&&D<=262141}var XB=()=>{};function wH(D){if(!Number.isSafeInteger(D))throw TypeError(`Expected a code point, got \`${typeof D}\`.`)}function GB(D,{ambiguousAsWide:F=!1}={}){if(wH(D),HB(D)||JB(D)||F&&qB(D))return 2;return 1}var WB=V(()=>{XB()});var zB=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g};function G6(D,F={}){if(typeof D!=="string"||D.length===0)return 0;let{ambiguousIsNarrow:B=!0,countAnsiEscapeCodes:$=!1}=F;if(!$)D=T3(D);if(D.length===0)return 0;let _=0,Q={ambiguousAsWide:!B};for(let{segment:Y}of OH.segment(D)){let q=Y.codePointAt(0);if(q<=31||q>=127&&q<=159)continue;if(q>=8203&&q<=8207||q===65279)continue;if(q>=768&&q<=879||q>=6832&&q<=6911||q>=7616&&q<=7679||q>=8400&&q<=8447||q>=65056&&q<=65071)continue;if(q>=55296&&q<=57343)continue;if(q>=65024&&q<=65039)continue;if(bH.test(Y))continue;if(zB().test(Y)){_+=2;continue}_+=GB(q,Q)}return _}var OH,bH;var MB=V(()=>{X6();WB();OH=new Intl.Segmenter,bH=/^\p{Default_Ignorable_Code_Point}$/u});function W6({stream:D=process.stdout}={}){return Boolean(D&&D.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}import AB from"process";function z6(){let{env:D}=AB,{TERM:F,TERM_PROGRAM:B}=D;if(AB.platform!=="win32")return F!=="linux";return Boolean(D.WT_SESSION)||Boolean(D.TERMINUS_SUBLIME)||D.ConEmuTask==="{cmd::Cmder}"||B==="Terminus-Sublime"||B==="vscode"||F==="xterm-256color"||F==="alacritty"||F==="rxvt-unicode"||F==="rxvt-unicode-256color"||D.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var jB=()=>{};import t0 from"process";class KB{#Y=0;start(){if(this.#Y++,this.#Y===1)this.#B()}stop(){if(this.#Y<=0)throw Error("`stop` called more times than `start`");if(this.#Y--,this.#Y===0)this.#D()}#B(){if(t0.platform==="win32"||!t0.stdin.isTTY)return;t0.stdin.setRawMode(!0),t0.stdin.on("data",this.#_),t0.stdin.resume()}#D(){if(!t0.stdin.isTTY)return;t0.stdin.off("data",this.#_),t0.stdin.pause(),t0.stdin.setRawMode(!1)}#_(D){if(D[0]===RH)t0.emit("SIGINT")}}var RH=3,ZH,M6;var UB=V(()=>{ZH=new KB,M6=ZH});import R8 from"process";class VB{#Y=0;#B=!1;#D=0;#_=-1;#W=0;#F;#Q;#$;#z;#A;#J;#X;#G;#j;#q;#H;color;constructor(D){if(typeof D==="string")D={text:D};if(this.#F={color:"cyan",stream:R8.stderr,discardStdin:!0,hideCursor:!0,...D},this.color=this.#F.color,this.spinner=this.#F.spinner,this.#A=this.#F.interval,this.#$=this.#F.stream,this.#J=typeof this.#F.isEnabled==="boolean"?this.#F.isEnabled:W6({stream:this.#$}),this.#X=typeof this.#F.isSilent==="boolean"?this.#F.isSilent:!1,this.text=this.#F.text,this.prefixText=this.#F.prefixText,this.suffixText=this.#F.suffixText,this.indent=this.#F.indent,R8.env.NODE_ENV==="test")this._stream=this.#$,this._isEnabled=this.#J,Object.defineProperty(this,"_linesToClear",{get(){return this.#Y},set(F){this.#Y=F}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#_}}),Object.defineProperty(this,"_lineCount",{get(){return this.#D}})}get indent(){return this.#G}set indent(D=0){if(!(D>=0&&Number.isInteger(D)))throw Error("The `indent` option must be an integer from 0 and up");this.#G=D,this.#M()}get interval(){return this.#A??this.#Q.interval??100}get spinner(){return this.#Q}set spinner(D){if(this.#_=-1,this.#A=void 0,typeof D==="object"){if(D.frames===void 0)throw Error("The given spinner must have a `frames` property");this.#Q=D}else if(!z6())this.#Q=v3.default.line;else if(D===void 0)this.#Q=v3.default.dots;else if(D!=="default"&&v3.default[D])this.#Q=v3.default[D];else throw Error(`There is no built-in spinner named '${D}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#j}set text(D=""){this.#j=D,this.#M()}get prefixText(){return this.#q}set prefixText(D=""){this.#q=D,this.#M()}get suffixText(){return this.#H}set suffixText(D=""){this.#H=D,this.#M()}get isSpinning(){return this.#z!==void 0}#K(D=this.#q,F=" "){if(typeof D==="string"&&D!=="")return D+F;if(typeof D==="function")return D()+F;return""}#U(D=this.#H,F=" "){if(typeof D==="string"&&D!=="")return F+D;if(typeof D==="function")return F+D();return""}#M(){let D=this.#$.columns??80,F=this.#K(this.#q,"-"),B=this.#U(this.#H,"-"),$=" ".repeat(this.#G)+F+"--"+this.#j+"--"+B;this.#D=0;for(let _ of T3($).split(`
93
- `))this.#D+=Math.max(1,Math.ceil(G6(_,{countAnsiEscapeCodes:!0})/D))}get isEnabled(){return this.#J&&!this.#X}set isEnabled(D){if(typeof D!=="boolean")throw TypeError("The `isEnabled` option must be a boolean");this.#J=D}get isSilent(){return this.#X}set isSilent(D){if(typeof D!=="boolean")throw TypeError("The `isSilent` option must be a boolean");this.#X=D}frame(){let D=Date.now();if(this.#_===-1||D-this.#W>=this.interval)this.#_=++this.#_%this.#Q.frames.length,this.#W=D;let{frames:F}=this.#Q,B=F[this.#_];if(this.color)B=f0[this.color](B);let $=typeof this.#q==="string"&&this.#q!==""?this.#q+" ":"",_=typeof this.text==="string"?" "+this.text:"",Q=typeof this.#H==="string"&&this.#H!==""?" "+this.#H:"";return $+B+_+Q}clear(){if(!this.#J||!this.#$.isTTY)return this;this.#$.cursorTo(0);for(let D=0;D<this.#Y;D++){if(D>0)this.#$.moveCursor(0,-1);this.#$.clearLine(1)}if(this.#G||this.lastIndent!==this.#G)this.#$.cursorTo(this.#G);return this.lastIndent=this.#G,this.#Y=0,this}render(){if(this.#X)return this;return this.clear(),this.#$.write(this.frame()),this.#Y=this.#D,this}start(D){if(D)this.text=D;if(this.#X)return this;if(!this.#J){if(this.text)this.#$.write(`- ${this.text}
94
- `);return this}if(this.isSpinning)return this;if(this.#F.hideCursor)Y6.hide(this.#$);if(this.#F.discardStdin&&R8.stdin.isTTY)this.#B=!0,M6.start();return this.render(),this.#z=setInterval(this.render.bind(this),this.interval),this}stop(){if(!this.#J)return this;if(clearInterval(this.#z),this.#z=void 0,this.#_=0,this.clear(),this.#F.hideCursor)Y6.show(this.#$);if(this.#F.discardStdin&&R8.stdin.isTTY&&this.#B)M6.stop(),this.#B=!1;return this}succeed(D){return this.stopAndPersist({symbol:I3.success,text:D})}fail(D){return this.stopAndPersist({symbol:I3.error,text:D})}warn(D){return this.stopAndPersist({symbol:I3.warning,text:D})}info(D){return this.stopAndPersist({symbol:I3.info,text:D})}stopAndPersist(D={}){if(this.#X)return this;let F=D.prefixText??this.#q,B=this.#K(F," "),$=D.symbol??" ",_=D.text??this.text,Y=typeof _==="string"?($?" ":"")+_:"",q=D.suffixText??this.#H,H=this.#U(q," "),J=B+$+Y+H+`
95
- `;return this.stop(),this.#$.write(J),this}}function A6(D){return new VB(D)}var v3,NH;var EB=V(()=>{D6();FB();YB();X6();MB();jB();UB();v3=f3(q6(),1),NH=f3(q6(),1)});function jD(D){let F=FF&&!D.quiet;return A6({text:D.text,isSilent:!F})}var m0=V(()=>{EB();Z3()});function LB(D){let[F=""]=D.split("-"),B=F.split("."),$=parseInt(B[0]??"",10),_=parseInt(B[1]??"",10),Q=parseInt(B[2]??"",10);if(Number.isNaN($)||Number.isNaN(_)||Number.isNaN(Q))return null;return{major:$,minor:_,patch:Q}}function SH(D,F){let B=LB(D),$=LB(F);if(!B||!$)return null;if(B.major!==$.major)return B.major-$.major;if(B.minor!==$.minor)return B.minor-$.minor;return B.patch-$.patch}function wB(D,F,B){if(!D)return{compatible:!0};let $=SH(F,D);if($===null)return{compatible:!0};if($>=0)return{compatible:!0};return{compatible:!1,required:D,installed:F,type:B}}function kH(D,F){let B=F.type==="opencode"?"OpenCode":"OCX CLI",$=F.type==="opencode"?"Update OpenCode to the latest version":"bun update -g ocx";return`
96
- ${P.yellow().bold("\u26A0 WARN")} ${P.yellow("Version compatibility notice")}
97
-
98
- Registry ${P.cyan(`"${D}"`)} requires ${B} ${P.green(F.required)}
99
- You are running ${B} ${P.red(F.installed)}
128
+ `)+U,v=Q+1,Q=$.indexOf(`
129
+ `,v)}while(Q!==-1);return J+=$.slice(v),J}function i_($){return kM($)}var Dj,Mj,rJ,R0,p_,wj,E0,LM=($,_={})=>{if(_.level&&!(Number.isInteger(_.level)&&_.level>=0&&_.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let U=Dj?Dj.level:0;$.level=_.level===void 0?U:_.level},kM=($)=>{let _=(...U)=>U.join(" ");return LM(_,$),Object.setPrototypeOf(_,i_.prototype),_},oJ=($,_,U,...Q)=>{if($==="rgb"){if(_==="ansi16m")return s4[U].ansi16m(...Q);if(_==="ansi256")return s4[U].ansi256(s4.rgbToAnsi256(...Q));return s4[U].ansi(s4.rgbToAnsi(...Q))}if($==="hex")return oJ("rgb",_,U,...s4.hexToRgb(...Q));return s4[U][$](...Q)},AM,FM,tJ=($,_,U)=>{let Q,v;if(U===void 0)Q=$,v=_;else Q=U.openAll+$,v=_+U.closeAll;return{open:$,close:_,openAll:Q,closeAll:v,parent:U}},W8=($,_,U)=>{let Q=(...v)=>OM(Q,v.length===1?""+v[0]:v.join(" "));return Object.setPrototypeOf(Q,FM),Q[rJ]=$,Q[R0]=_,Q[p_]=U,Q},OM=($,_)=>{if($.level<=0||!_)return $[p_]?"":_;let U=$[R0];if(U===void 0)return _;let{openAll:Q,closeAll:v}=U;if(_.includes("\x1B"))while(U!==void 0)_=Zj(_,U.close,U.open),U=U.parent;let J=_.indexOf(`
130
+ `);if(J!==-1)_=Vj(_,v,Q,J);return Q+_+v},NM,nE,Lj;var kj=b(()=>{Kj();Bj();({stdout:Dj,stderr:Mj}=bj),rJ=Symbol("GENERATOR"),R0=Symbol("STYLER"),p_=Symbol("IS_EMPTY"),wj=["ansi","ansi","ansi256","ansi16m"],E0=Object.create(null);Object.setPrototypeOf(i_.prototype,Function.prototype);for(let[$,_]of Object.entries(s4))E0[$]={get(){let U=W8(this,tJ(_.open,_.close,this[R0]),this[p_]);return Object.defineProperty(this,$,{value:U}),U}};E0.visible={get(){let $=W8(this,this[R0],!0);return Object.defineProperty(this,"visible",{value:$}),$}};AM=["rgb","hex","ansi256"];for(let $ of AM){E0[$]={get(){let{level:U}=this;return function(...Q){let v=tJ(oJ($,wj[U],"color",...Q),s4.color.close,this[R0]);return W8(this,v,this[p_])}}};let _="bg"+$[0].toUpperCase()+$.slice(1);E0[_]={get(){let{level:U}=this;return function(...Q){let v=tJ(oJ($,wj[U],"bgColor",...Q),s4.bgColor.close,this[R0]);return W8(this,v,this[p_])}}}}FM=Object.defineProperties(()=>{},{...E0,level:{enumerable:!0,get(){return this[rJ].level},set($){this[rJ].level=$}}});Object.defineProperties(i_.prototype,E0);NM=i_(),nE=i_({level:Mj?Mj.level:0}),Lj=NM});function aJ($,_,{ignoreNonConfigurable:U=!1}={}){let{name:Q}=$;for(let v of Reflect.ownKeys(_))SM($,_,v,U);return RM($,_),uM($,_,Q),$}var SM=($,_,U,Q)=>{if(U==="length"||U==="prototype")return;if(U==="arguments"||U==="caller")return;let v=Object.getOwnPropertyDescriptor($,U),J=Object.getOwnPropertyDescriptor(_,U);if(!TM(v,J)&&Q)return;Object.defineProperty($,U,J)},TM=function($,_){return $===void 0||$.configurable||$.writable===_.writable&&$.enumerable===_.enumerable&&$.configurable===_.configurable&&($.writable||$.value===_.value)},RM=($,_)=>{let U=Object.getPrototypeOf(_);if(U===Object.getPrototypeOf($))return;Object.setPrototypeOf($,U)},EM=($,_)=>`/* Wrapped ${$}*/
131
+ ${_}`,PM,xM,uM=($,_,U)=>{let Q=U===""?"":`with ${U.trim()}() `,v=EM.bind(null,Q,_.toString());Object.defineProperty(v,"name",xM);let{writable:J,enumerable:Y,configurable:z}=PM;Object.defineProperty($,"toString",{value:v,writable:J,enumerable:Y,configurable:z})};var Aj=b(()=>{PM=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),xM=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name")});var b8,Fj=($,_={})=>{if(typeof $!=="function")throw TypeError("Expected a function");let U,Q=0,v=$.displayName||$.name||"<anonymous>",J=function(...Y){if(b8.set(J,++Q),Q===1)U=$.apply(this,Y),$=void 0;else if(_.throw===!0)throw Error(`Function \`${v}\` can only be called once`);return U};return aJ(J,$),b8.set(J,Q),J},Oj;var Nj=b(()=>{Aj();b8=new WeakMap;Fj.callCount=($)=>{if(!b8.has($))throw Error(`The given function \`${$.name}\` is not wrapped by the \`onetime\` package`);return b8.get($)};Oj=Fj});var A1;var Sj=b(()=>{A1=[];A1.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")A1.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")A1.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});class Tj{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(eJ[sJ])return eJ[sJ];yM(eJ,sJ,{value:this,writable:!1,enumerable:!1,configurable:!1})}on($,_){this.listeners[$].push(_)}removeListener($,_){let U=this.listeners[$],Q=U.indexOf(_);if(Q===-1)return;if(Q===0&&U.length===1)U.length=0;else U.splice(Q,1)}emit($,_,U){if(this.emitted[$])return!1;this.emitted[$]=!0;let Q=!1;for(let v of this.listeners[$])Q=v(_,U)===!0||Q;if($==="exit")Q=this.emit("afterExit",_,U)||Q;return Q}}class _Y{}var B8=($)=>!!$&&typeof $==="object"&&typeof $.removeListener==="function"&&typeof $.emit==="function"&&typeof $.reallyExit==="function"&&typeof $.listeners==="function"&&typeof $.kill==="function"&&typeof $.pid==="number"&&typeof $.on==="function",sJ,eJ,yM,CM=($)=>{return{onExit(_,U){return $.onExit(_,U)},load(){return $.load()},unload(){return $.unload()}}},Rj,Ej,$Y,Pj,$P,_P;var xj=b(()=>{Sj();sJ=Symbol.for("signal-exit emitter"),eJ=globalThis,yM=Object.defineProperty.bind(Object);Rj=class Rj extends _Y{onExit(){return()=>{}}load(){}unload(){}};Ej=class Ej extends _Y{#J=$Y.platform==="win32"?"SIGINT":"SIGHUP";#U=new Tj;#v;#$;#Q;#_={};#Y=!1;constructor($){super();this.#v=$,this.#_={};for(let _ of A1)this.#_[_]=()=>{let U=this.#v.listeners(_),{count:Q}=this.#U,v=$;if(typeof v.__signal_exit_emitter__==="object"&&typeof v.__signal_exit_emitter__.count==="number")Q+=v.__signal_exit_emitter__.count;if(U.length===Q){this.unload();let J=this.#U.emit("exit",null,_),Y=_==="SIGHUP"?this.#J:_;if(!J)$.kill($.pid,Y)}};this.#Q=$.reallyExit,this.#$=$.emit}onExit($,_){if(!B8(this.#v))return()=>{};if(this.#Y===!1)this.load();let U=_?.alwaysLast?"afterExit":"exit";return this.#U.on(U,$),()=>{if(this.#U.removeListener(U,$),this.#U.listeners.exit.length===0&&this.#U.listeners.afterExit.length===0)this.unload()}}load(){if(this.#Y)return;this.#Y=!0,this.#U.count+=1;for(let $ of A1)try{let _=this.#_[$];if(_)this.#v.on($,_)}catch(_){}this.#v.emit=($,..._)=>{return this.#G($,..._)},this.#v.reallyExit=($)=>{return this.#I($)}}unload(){if(!this.#Y)return;this.#Y=!1,A1.forEach(($)=>{let _=this.#_[$];if(!_)throw Error("Listener not defined for signal: "+$);try{this.#v.removeListener($,_)}catch(U){}}),this.#v.emit=this.#$,this.#v.reallyExit=this.#Q,this.#U.count-=1}#I($){if(!B8(this.#v))return 0;return this.#v.exitCode=$||0,this.#U.emit("exit",this.#v.exitCode,null),this.#Q.call(this.#v,this.#v.exitCode)}#G($,..._){let U=this.#$;if($==="exit"&&B8(this.#v)){if(typeof _[0]==="number")this.#v.exitCode=_[0];let Q=U.call(this.#v,$,..._);return this.#U.emit("exit",this.#v.exitCode,null),Q}else return U.call(this.#v,$,..._)}};$Y=globalThis.process,{onExit:Pj,load:$P,unload:_P}=CM(B8($Y)?new Ej($Y):new Rj)});import Z8 from"process";var uj,fM,yj;var Cj=b(()=>{Nj();xj();uj=Z8.stderr.isTTY?Z8.stderr:Z8.stdout.isTTY?Z8.stdout:void 0,fM=uj?Oj(()=>{Pj(()=>{uj.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},yj=fM});import fj from"process";var V8=!1,P0,vY;var mj=b(()=>{Cj();P0={};P0.show=($=fj.stderr)=>{if(!$.isTTY)return;V8=!1,$.write("\x1B[?25h")};P0.hide=($=fj.stderr)=>{if(!$.isTTY)return;yj(),V8=!0,$.write("\x1B[?25l")};P0.toggle=($,_)=>{if($!==void 0)V8=$;if(V8)P0.show(_);else P0.hide(_)};vY=P0});var UY;var gj=b(()=>{UY={dots:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]},dots2:{interval:80,frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"]},dots3:{interval:80,frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"]},dots4:{interval:80,frames:["\u2804","\u2806","\u2807","\u280B","\u2819","\u2838","\u2830","\u2820","\u2830","\u2838","\u2819","\u280B","\u2807","\u2806"]},dots5:{interval:80,frames:["\u280B","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B"]},dots6:{interval:80,frames:["\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2834","\u2832","\u2812","\u2802","\u2802","\u2812","\u281A","\u2819","\u2809","\u2801"]},dots7:{interval:80,frames:["\u2808","\u2809","\u280B","\u2813","\u2812","\u2810","\u2810","\u2812","\u2816","\u2826","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808"]},dots8:{interval:80,frames:["\u2801","\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808","\u2808"]},dots9:{interval:80,frames:["\u28B9","\u28BA","\u28BC","\u28F8","\u28C7","\u2867","\u2857","\u284F"]},dots10:{interval:80,frames:["\u2884","\u2882","\u2881","\u2841","\u2848","\u2850","\u2860"]},dots11:{interval:100,frames:["\u2801","\u2802","\u2804","\u2840","\u2880","\u2820","\u2810","\u2808"]},dots12:{interval:80,frames:["\u2880\u2800","\u2840\u2800","\u2804\u2800","\u2882\u2800","\u2842\u2800","\u2805\u2800","\u2883\u2800","\u2843\u2800","\u280D\u2800","\u288B\u2800","\u284B\u2800","\u280D\u2801","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2888\u2829","\u2840\u2899","\u2804\u2859","\u2882\u2829","\u2842\u2898","\u2805\u2858","\u2883\u2828","\u2843\u2890","\u280D\u2850","\u288B\u2820","\u284B\u2880","\u280D\u2841","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2808\u2829","\u2800\u2899","\u2800\u2859","\u2800\u2829","\u2800\u2898","\u2800\u2858","\u2800\u2828","\u2800\u2890","\u2800\u2850","\u2800\u2820","\u2800\u2880","\u2800\u2840"]},dots13:{interval:80,frames:["\u28FC","\u28F9","\u28BB","\u283F","\u285F","\u28CF","\u28E7","\u28F6"]},dots14:{interval:80,frames:["\u2809\u2809","\u2808\u2819","\u2800\u2839","\u2800\u28B8","\u2800\u28F0","\u2880\u28E0","\u28C0\u28C0","\u28C4\u2840","\u28C6\u2800","\u2847\u2800","\u280F\u2800","\u280B\u2801"]},dots8Bit:{interval:80,frames:["\u2800","\u2801","\u2802","\u2803","\u2804","\u2805","\u2806","\u2807","\u2840","\u2841","\u2842","\u2843","\u2844","\u2845","\u2846","\u2847","\u2808","\u2809","\u280A","\u280B","\u280C","\u280D","\u280E","\u280F","\u2848","\u2849","\u284A","\u284B","\u284C","\u284D","\u284E","\u284F","\u2810","\u2811","\u2812","\u2813","\u2814","\u2815","\u2816","\u2817","\u2850","\u2851","\u2852","\u2853","\u2854","\u2855","\u2856","\u2857","\u2818","\u2819","\u281A","\u281B","\u281C","\u281D","\u281E","\u281F","\u2858","\u2859","\u285A","\u285B","\u285C","\u285D","\u285E","\u285F","\u2820","\u2821","\u2822","\u2823","\u2824","\u2825","\u2826","\u2827","\u2860","\u2861","\u2862","\u2863","\u2864","\u2865","\u2866","\u2867","\u2828","\u2829","\u282A","\u282B","\u282C","\u282D","\u282E","\u282F","\u2868","\u2869","\u286A","\u286B","\u286C","\u286D","\u286E","\u286F","\u2830","\u2831","\u2832","\u2833","\u2834","\u2835","\u2836","\u2837","\u2870","\u2871","\u2872","\u2873","\u2874","\u2875","\u2876","\u2877","\u2838","\u2839","\u283A","\u283B","\u283C","\u283D","\u283E","\u283F","\u2878","\u2879","\u287A","\u287B","\u287C","\u287D","\u287E","\u287F","\u2880","\u2881","\u2882","\u2883","\u2884","\u2885","\u2886","\u2887","\u28C0","\u28C1","\u28C2","\u28C3","\u28C4","\u28C5","\u28C6","\u28C7","\u2888","\u2889","\u288A","\u288B","\u288C","\u288D","\u288E","\u288F","\u28C8","\u28C9","\u28CA","\u28CB","\u28CC","\u28CD","\u28CE","\u28CF","\u2890","\u2891","\u2892","\u2893","\u2894","\u2895","\u2896","\u2897","\u28D0","\u28D1","\u28D2","\u28D3","\u28D4","\u28D5","\u28D6","\u28D7","\u2898","\u2899","\u289A","\u289B","\u289C","\u289D","\u289E","\u289F","\u28D8","\u28D9","\u28DA","\u28DB","\u28DC","\u28DD","\u28DE","\u28DF","\u28A0","\u28A1","\u28A2","\u28A3","\u28A4","\u28A5","\u28A6","\u28A7","\u28E0","\u28E1","\u28E2","\u28E3","\u28E4","\u28E5","\u28E6","\u28E7","\u28A8","\u28A9","\u28AA","\u28AB","\u28AC","\u28AD","\u28AE","\u28AF","\u28E8","\u28E9","\u28EA","\u28EB","\u28EC","\u28ED","\u28EE","\u28EF","\u28B0","\u28B1","\u28B2","\u28B3","\u28B4","\u28B5","\u28B6","\u28B7","\u28F0","\u28F1","\u28F2","\u28F3","\u28F4","\u28F5","\u28F6","\u28F7","\u28B8","\u28B9","\u28BA","\u28BB","\u28BC","\u28BD","\u28BE","\u28BF","\u28F8","\u28F9","\u28FA","\u28FB","\u28FC","\u28FD","\u28FE","\u28FF"]},dotsCircle:{interval:80,frames:["\u288E ","\u280E\u2801","\u280A\u2811","\u2808\u2831"," \u2871","\u2880\u2870","\u2884\u2860","\u2886\u2840"]},sand:{interval:80,frames:["\u2801","\u2802","\u2804","\u2840","\u2848","\u2850","\u2860","\u28C0","\u28C1","\u28C2","\u28C4","\u28CC","\u28D4","\u28E4","\u28E5","\u28E6","\u28EE","\u28F6","\u28F7","\u28FF","\u287F","\u283F","\u289F","\u281F","\u285B","\u281B","\u282B","\u288B","\u280B","\u280D","\u2849","\u2809","\u2811","\u2821","\u2881"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["\u2802","-","\u2013","\u2014","\u2013","-"]},rollingLine:{interval:80,frames:["/ "," - "," \\ "," |"," |"," \\ "," - ","/ "]},pipe:{interval:100,frames:["\u2524","\u2518","\u2534","\u2514","\u251C","\u250C","\u252C","\u2510"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["\u2736","\u2738","\u2739","\u273A","\u2739","\u2737"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","\xB4","-","_","_","_"]},hamburger:{interval:100,frames:["\u2631","\u2632","\u2634"]},growVertical:{interval:120,frames:["\u2581","\u2583","\u2584","\u2585","\u2586","\u2587","\u2586","\u2585","\u2584","\u2583"]},growHorizontal:{interval:120,frames:["\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u258A","\u258B","\u258C","\u258D","\u258E"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","\xB0","O","o","."]},noise:{interval:100,frames:["\u2593","\u2592","\u2591"]},bounce:{interval:120,frames:["\u2801","\u2802","\u2804","\u2802"]},boxBounce:{interval:120,frames:["\u2596","\u2598","\u259D","\u2597"]},boxBounce2:{interval:100,frames:["\u258C","\u2580","\u2590","\u2584"]},triangle:{interval:50,frames:["\u25E2","\u25E3","\u25E4","\u25E5"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["\u25DC","\u25E0","\u25DD","\u25DE","\u25E1","\u25DF"]},circle:{interval:120,frames:["\u25E1","\u2299","\u25E0"]},squareCorners:{interval:180,frames:["\u25F0","\u25F3","\u25F2","\u25F1"]},circleQuarters:{interval:120,frames:["\u25F4","\u25F7","\u25F6","\u25F5"]},circleHalves:{interval:50,frames:["\u25D0","\u25D3","\u25D1","\u25D2"]},squish:{interval:100,frames:["\u256B","\u256A"]},toggle:{interval:250,frames:["\u22B6","\u22B7"]},toggle2:{interval:80,frames:["\u25AB","\u25AA"]},toggle3:{interval:120,frames:["\u25A1","\u25A0"]},toggle4:{interval:100,frames:["\u25A0","\u25A1","\u25AA","\u25AB"]},toggle5:{interval:100,frames:["\u25AE","\u25AF"]},toggle6:{interval:300,frames:["\u101D","\u1040"]},toggle7:{interval:80,frames:["\u29BE","\u29BF"]},toggle8:{interval:100,frames:["\u25CD","\u25CC"]},toggle9:{interval:100,frames:["\u25C9","\u25CE"]},toggle10:{interval:100,frames:["\u3282","\u3280","\u3281"]},toggle11:{interval:50,frames:["\u29C7","\u29C6"]},toggle12:{interval:120,frames:["\u2617","\u2616"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["\u2190","\u2196","\u2191","\u2197","\u2192","\u2198","\u2193","\u2199"]},arrow2:{interval:80,frames:["\u2B06\uFE0F ","\u2197\uFE0F ","\u27A1\uFE0F ","\u2198\uFE0F ","\u2B07\uFE0F ","\u2199\uFE0F ","\u2B05\uFE0F ","\u2196\uFE0F "]},arrow3:{interval:120,frames:["\u25B9\u25B9\u25B9\u25B9\u25B9","\u25B8\u25B9\u25B9\u25B9\u25B9","\u25B9\u25B8\u25B9\u25B9\u25B9","\u25B9\u25B9\u25B8\u25B9\u25B9","\u25B9\u25B9\u25B9\u25B8\u25B9","\u25B9\u25B9\u25B9\u25B9\u25B8"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF)","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","(\u25CF )"]},smiley:{interval:200,frames:["\uD83D\uDE04 ","\uD83D\uDE1D "]},monkey:{interval:300,frames:["\uD83D\uDE48 ","\uD83D\uDE48 ","\uD83D\uDE49 ","\uD83D\uDE4A "]},hearts:{interval:100,frames:["\uD83D\uDC9B ","\uD83D\uDC99 ","\uD83D\uDC9C ","\uD83D\uDC9A ","\uD83D\uDC97 "]},clock:{interval:100,frames:["\uD83D\uDD5B ","\uD83D\uDD50 ","\uD83D\uDD51 ","\uD83D\uDD52 ","\uD83D\uDD53 ","\uD83D\uDD54 ","\uD83D\uDD55 ","\uD83D\uDD56 ","\uD83D\uDD57 ","\uD83D\uDD58 ","\uD83D\uDD59 ","\uD83D\uDD5A "]},earth:{interval:180,frames:["\uD83C\uDF0D ","\uD83C\uDF0E ","\uD83C\uDF0F "]},material:{interval:17,frames:["\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581"]},moon:{interval:80,frames:["\uD83C\uDF11 ","\uD83C\uDF12 ","\uD83C\uDF13 ","\uD83C\uDF14 ","\uD83C\uDF15 ","\uD83C\uDF16 ","\uD83C\uDF17 ","\uD83C\uDF18 "]},runner:{interval:140,frames:["\uD83D\uDEB6 ","\uD83C\uDFC3 "]},pong:{interval:80,frames:["\u2590\u2802 \u258C","\u2590\u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802\u258C","\u2590 \u2820\u258C","\u2590 \u2840\u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590\u2820 \u258C"]},shark:{interval:120,frames:["\u2590|\\____________\u258C","\u2590_|\\___________\u258C","\u2590__|\\__________\u258C","\u2590___|\\_________\u258C","\u2590____|\\________\u258C","\u2590_____|\\_______\u258C","\u2590______|\\______\u258C","\u2590_______|\\_____\u258C","\u2590________|\\____\u258C","\u2590_________|\\___\u258C","\u2590__________|\\__\u258C","\u2590___________|\\_\u258C","\u2590____________|\\\u258C","\u2590____________/|\u258C","\u2590___________/|_\u258C","\u2590__________/|__\u258C","\u2590_________/|___\u258C","\u2590________/|____\u258C","\u2590_______/|_____\u258C","\u2590______/|______\u258C","\u2590_____/|_______\u258C","\u2590____/|________\u258C","\u2590___/|_________\u258C","\u2590__/|__________\u258C","\u2590_/|___________\u258C","\u2590/|____________\u258C"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["\u2600\uFE0F ","\u2600\uFE0F ","\u2600\uFE0F ","\uD83C\uDF24 ","\u26C5\uFE0F ","\uD83C\uDF25 ","\u2601\uFE0F ","\uD83C\uDF27 ","\uD83C\uDF28 ","\uD83C\uDF27 ","\uD83C\uDF28 ","\uD83C\uDF27 ","\uD83C\uDF28 ","\u26C8 ","\uD83C\uDF28 ","\uD83C\uDF27 ","\uD83C\uDF28 ","\u2601\uFE0F ","\uD83C\uDF25 ","\u26C5\uFE0F ","\uD83C\uDF24 ","\u2600\uFE0F ","\u2600\uFE0F "]},christmas:{interval:400,frames:["\uD83C\uDF32","\uD83C\uDF84"]},grenade:{interval:80,frames:["\u060C ","\u2032 "," \xB4 "," \u203E "," \u2E0C"," \u2E0A"," |"," \u204E"," \u2055"," \u0DF4 "," \u2053"," "," "," "]},point:{interval:125,frames:["\u2219\u2219\u2219","\u25CF\u2219\u2219","\u2219\u25CF\u2219","\u2219\u2219\u25CF","\u2219\u2219\u2219"]},layer:{interval:150,frames:["-","=","\u2261"]},betaWave:{interval:80,frames:["\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1"]},fingerDance:{interval:160,frames:["\uD83E\uDD18 ","\uD83E\uDD1F ","\uD83D\uDD96 ","\u270B ","\uD83E\uDD1A ","\uD83D\uDC46 "]},fistBump:{interval:80,frames:["\uD83E\uDD1C\u3000\u3000\u3000\u3000\uD83E\uDD1B ","\uD83E\uDD1C\u3000\u3000\u3000\u3000\uD83E\uDD1B ","\uD83E\uDD1C\u3000\u3000\u3000\u3000\uD83E\uDD1B ","\u3000\uD83E\uDD1C\u3000\u3000\uD83E\uDD1B\u3000 ","\u3000\u3000\uD83E\uDD1C\uD83E\uDD1B\u3000\u3000 ","\u3000\uD83E\uDD1C\u2728\uD83E\uDD1B\u3000\u3000 ","\uD83E\uDD1C\u3000\u2728\u3000\uD83E\uDD1B\u3000 "]},soccerHeader:{interval:80,frames:[" \uD83E\uDDD1\u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F\uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 "]},mindblown:{interval:160,frames:["\uD83D\uDE10 ","\uD83D\uDE10 ","\uD83D\uDE2E ","\uD83D\uDE2E ","\uD83D\uDE26 ","\uD83D\uDE26 ","\uD83D\uDE27 ","\uD83D\uDE27 ","\uD83E\uDD2F ","\uD83D\uDCA5 ","\u2728 ","\u3000 ","\u3000 ","\u3000 "]},speaker:{interval:160,frames:["\uD83D\uDD08 ","\uD83D\uDD09 ","\uD83D\uDD0A ","\uD83D\uDD09 "]},orangePulse:{interval:100,frames:["\uD83D\uDD38 ","\uD83D\uDD36 ","\uD83D\uDFE0 ","\uD83D\uDFE0 ","\uD83D\uDD36 "]},bluePulse:{interval:100,frames:["\uD83D\uDD39 ","\uD83D\uDD37 ","\uD83D\uDD35 ","\uD83D\uDD35 ","\uD83D\uDD37 "]},orangeBluePulse:{interval:100,frames:["\uD83D\uDD38 ","\uD83D\uDD36 ","\uD83D\uDFE0 ","\uD83D\uDFE0 ","\uD83D\uDD36 ","\uD83D\uDD39 ","\uD83D\uDD37 ","\uD83D\uDD35 ","\uD83D\uDD35 ","\uD83D\uDD37 "]},timeTravel:{interval:100,frames:["\uD83D\uDD5B ","\uD83D\uDD5A ","\uD83D\uDD59 ","\uD83D\uDD58 ","\uD83D\uDD57 ","\uD83D\uDD56 ","\uD83D\uDD55 ","\uD83D\uDD54 ","\uD83D\uDD53 ","\uD83D\uDD52 ","\uD83D\uDD51 ","\uD83D\uDD50 "]},aesthetic:{interval:80,frames:["\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0","\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1"]},dwarfFortress:{interval:80,frames:[" \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A \u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A \xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A \xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\u2593\xA3 "," \u263A\u2593\xA3 "," \u263A\u2592\xA3 "," \u263A\u2592\xA3 "," \u263A\u2591\xA3 "," \u263A\u2591\xA3 "," \u263A \xA3 "," \u263A\xA3 "," \u263A\xA3 "," \u263A\u2593 "," \u263A\u2593 "," \u263A\u2592 "," \u263A\u2592 "," \u263A\u2591 "," \u263A\u2591 "," \u263A "," \u263A &"," \u263A \u263C&"," \u263A \u263C &"," \u263A\u263C &"," \u263A\u263C & "," \u203C & "," \u263A & "," \u203C & "," \u263A & "," \u203C & "," \u263A & ","\u203C & "," & "," & "," & \u2591 "," & \u2592 "," & \u2593 "," & \xA3 "," & \u2591\xA3 "," & \u2592\xA3 "," & \u2593\xA3 "," & \xA3\xA3 "," & \u2591\xA3\xA3 "," & \u2592\xA3\xA3 ","& \u2593\xA3\xA3 ","& \xA3\xA3\xA3 "," \u2591\xA3\xA3\xA3 "," \u2592\xA3\xA3\xA3 "," \u2593\xA3\xA3\xA3 "," \u2588\xA3\xA3\xA3 "," \u2591\u2588\xA3\xA3\xA3 "," \u2592\u2588\xA3\xA3\xA3 "," \u2593\u2588\xA3\xA3\xA3 "," \u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "]},fish:{interval:80,frames:["~~~~~~~~~~~~~~~~~~~~","> ~~~~~~~~~~~~~~~~~~","\xBA> ~~~~~~~~~~~~~~~~~","(\xBA> ~~~~~~~~~~~~~~~~","((\xBA> ~~~~~~~~~~~~~~~","<((\xBA> ~~~~~~~~~~~~~~","><((\xBA> ~~~~~~~~~~~~~"," ><((\xBA> ~~~~~~~~~~~~","~ ><((\xBA> ~~~~~~~~~~~","~~ <>((\xBA> ~~~~~~~~~~","~~~ ><((\xBA> ~~~~~~~~~","~~~~ <>((\xBA> ~~~~~~~~","~~~~~ ><((\xBA> ~~~~~~~","~~~~~~ <>((\xBA> ~~~~~~","~~~~~~~ ><((\xBA> ~~~~~","~~~~~~~~ <>((\xBA> ~~~~","~~~~~~~~~ ><((\xBA> ~~~","~~~~~~~~~~ <>((\xBA> ~~","~~~~~~~~~~~ ><((\xBA> ~","~~~~~~~~~~~~ <>((\xBA> ","~~~~~~~~~~~~~ ><((\xBA>","~~~~~~~~~~~~~~ <>((\xBA","~~~~~~~~~~~~~~~ ><((","~~~~~~~~~~~~~~~~ <>(","~~~~~~~~~~~~~~~~~ ><","~~~~~~~~~~~~~~~~~~ <","~~~~~~~~~~~~~~~~~~~~"]}}});var n_,jP;var hj=b(()=>{gj();n_=UY,jP=Object.keys(UY)});import gM from"tty";var hM,J$=($,_)=>{if(!hM)return(v)=>v;let U=`\x1B[${$}m`,Q=`\x1B[${_}m`;return(v)=>{let J=v+"",Y=J.indexOf(Q);if(Y===-1)return U+J+Q;let z=U,I=0,q=(_===22?Q:"")+U;while(Y!==-1)z+=J.slice(I,Y)+q,I=Y+Q.length,Y=J.indexOf(Q,I);return z+=J.slice(I)+Q,z}},WP,bP,BP,ZP,VP,DP,MP,wP,LP,kP,cj,lj,dj,pj,AP,FP,OP,NP,SP,TP,RP,EP,PP,xP,uP,yP,CP,fP,mP,gP,hP,cP,lP,dP,pP,iP,nP,rP,oP,tP,aP;var QY=b(()=>{hM=gM?.WriteStream?.prototype?.hasColors?.()??!1,WP=J$(0,0),bP=J$(1,22),BP=J$(2,22),ZP=J$(3,23),VP=J$(4,24),DP=J$(53,55),MP=J$(7,27),wP=J$(8,28),LP=J$(9,29),kP=J$(30,39),cj=J$(31,39),lj=J$(32,39),dj=J$(33,39),pj=J$(34,39),AP=J$(35,39),FP=J$(36,39),OP=J$(37,39),NP=J$(90,39),SP=J$(40,49),TP=J$(41,49),RP=J$(42,49),EP=J$(43,49),PP=J$(44,49),xP=J$(45,49),uP=J$(46,49),yP=J$(47,49),CP=J$(100,49),fP=J$(91,39),mP=J$(92,39),gP=J$(93,39),hP=J$(94,39),cP=J$(95,39),lP=J$(96,39),dP=J$(97,39),pP=J$(101,49),iP=J$(102,49),nP=J$(103,49),rP=J$(104,49),oP=J$(105,49),tP=J$(106,49),aP=J$(107,49)});var ij=b(()=>{QY();QY()});import nj from"process";function r_(){let{env:$}=nj,{TERM:_,TERM_PROGRAM:U}=$;if(nj.platform!=="win32")return _!=="linux";return Boolean($.WT_SESSION)||Boolean($.TERMINUS_SUBLIME)||$.ConEmuTask==="{cmd::Cmder}"||U==="Terminus-Sublime"||U==="vscode"||_==="xterm-256color"||_==="alacritty"||_==="rxvt-unicode"||_==="rxvt-unicode-256color"||$.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var JY=()=>{};var F1={};s$(F1,{warning:()=>pM,success:()=>dM,info:()=>lM,error:()=>iM});var D8,lM,dM,pM,iM;var rj=b(()=>{ij();JY();D8=r_(),lM=pj(D8?"\u2139":"i"),dM=lj(D8?"\u2714":"\u221A"),pM=dj(D8?"\u26A0":"\u203C"),iM=cj(D8?"\u2716":"\xD7")});var oj=b(()=>{rj()});function YY({onlyFirst:$=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",$?void 0:"g")}function zY($){if(typeof $!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof $}\``);return $.replace(nM,"")}var nM;var tj=b(()=>{nM=YY()});var M8,w8,IY,XY,o_;var aj=b(()=>{M8=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],w8=[12288,12288,65281,65376,65504,65510],IY=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],XY=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],o_=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141]});var L8=($,_)=>{let U=0,Q=Math.floor($.length/2)-1;while(U<=Q){let v=Math.floor((U+Q)/2),J=v*2;if(_<$[J])Q=v-1;else if(_>$[J+1])U=v+1;else return!0}return!1};function vw($){let _=$[0],U=$[1];for(let Q=0;Q<$.length;Q+=2){let v=$[Q],J=$[Q+1];if(sj>=v&&sj<=J)return[v,J];if(J-v>U-_)_=v,U=J}return[_,U]}var rM,oM,tM,aM,jx,Kx,Hx,Wx,sM,eM,sj=19968,$w,_w,ej=($)=>{if($<rM||$>oM)return!1;return L8(M8,$)},$K=($)=>{if($<tM||$>aM)return!1;return L8(w8,$)},_K=($)=>{if($>=$w&&$<=_w)return!0;if($<sM||$>eM)return!1;return L8(o_,$)};var vK=b(()=>{aj();rM=M8[0],oM=M8.at(-1),tM=w8[0],aM=w8.at(-1),jx=IY[0],Kx=IY.at(-1),Hx=XY[0],Wx=XY.at(-1),sM=o_[0],eM=o_.at(-1),[$w,_w]=vw(o_)});function Uw($){if(!Number.isSafeInteger($))throw TypeError(`Expected a code point, got \`${typeof $}\`.`)}function qY($,{ambiguousAsWide:_=!1}={}){if(Uw($),$K($)||_K($)||_&&ej($))return 2;return 1}var UK=b(()=>{vK()});function qw($){if($.length>50)return!1;if(Iw.test($))return!0;if($.includes("\u200D")){let _=$.match(Xw);return _!==null&&_.length>=2}return!1}function Gw($){return $.replace(Yw,"")}function jw($){return Jw.test($)}function Kw($,_){let U=0;if($.length>1){for(let Q of $.slice(1))if(Q>="\uFF00"&&Q<="\uFFEF")U+=qY(Q.codePointAt(0),_)}return U}function GY($,_={}){if(typeof $!=="string"||$.length===0)return 0;let{ambiguousIsNarrow:U=!0,countAnsiEscapeCodes:Q=!1}=_,v=$;if(!Q&&(v.includes("\x1B")||v.includes("\x9B")))v=zY(v);if(v.length===0)return 0;if(/^[\u0020-\u007E]*$/.test(v))return v.length;let J=0,Y={ambiguousAsWide:!U};for(let{segment:z}of Qw.segment(v)){if(jw(z))continue;if(zw.test(z)||qw(z)){J+=2;continue}let I=Gw(z).codePointAt(0);J+=qY(I,Y),J+=Kw(z,Y)}return J}var Qw,Jw,Yw,zw,Iw,Xw;var QK=b(()=>{tj();UK();Qw=new Intl.Segmenter,Jw=/^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Format}|\p{Mark}|\p{Surrogate})+$/v,Yw=/^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Mark}\p{Surrogate}]+/v,zw=/^\p{RGI_Emoji}$/v,Iw=/^[\d#*]\u20E3$/,Xw=/\p{Extended_Pictographic}/gu});function jY({stream:$=process.stdout}={}){return Boolean($&&$.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}import x0 from"process";class JK{#J=0;#U;#v=!1;#$=!1;#Q=($)=>{if(!$?.length)return;if((typeof $==="string"?$.codePointAt(0):$[0])===Hw)if(x0.listenerCount("SIGINT")>0)x0.emit("SIGINT");else x0.kill(x0.pid,"SIGINT")};start(){if(this.#J++,this.#J===1)this.#_()}stop(){if(this.#J===0)return;if(--this.#J===0)this.#Y()}#_(){let{stdin:$}=x0;if(x0.platform==="win32"||!$?.isTTY||typeof $.setRawMode!=="function"){this.#U=void 0;return}if(this.#U=$,this.#v=$.isPaused(),this.#$=Boolean($.isRaw),$.setRawMode(!0),$.prependListener("data",this.#Q),this.#v)$.resume()}#Y(){if(!this.#U)return;let $=this.#U;if($.off("data",this.#Q),$.isTTY)$.setRawMode?.(this.#$);if(this.#v)$.pause();this.#U=void 0,this.#v=!1,this.#$=!1}}var Hw=3,Ww,KY;var YK=b(()=>{Ww=new JK,KY=Object.freeze(Ww)});import t_ from"process";import{stripVTControlCharacters as bw}from"util";class zK{#J=0;#U=-1;#v=0;#$;#Q;#_;#Y;#I=new Map;#G=!1;#X;#z;#j=!1;color;#q($){this.#G=!0;try{return $()}finally{this.#G=!1}}#H(){if(this.isSpinning)this.render()}#D($,_){if($===void 0||$===null)return"";if(typeof $==="string")return $;if(Buffer.isBuffer($)||ArrayBuffer.isView($)){let U=typeof _==="string"&&_&&_!=="buffer"?_:"utf8";return Buffer.from($).toString(U)}return String($)}#M($){if(!$)return!1;let _=$.at(-1);return _===`
132
+ `||_==="\r"}#w(){if(this.#z)return;if(this.#z=setTimeout(()=>{if(this.#z=void 0,this.isSpinning)this.#H()},Bw),typeof this.#z?.unref==="function")this.#z.unref()}#W(){if(this.#z)clearTimeout(this.#z),this.#z=void 0}#b($,_,U,Q){let v=this.#Z(U," "),Y=typeof _==="string"?($?" ":"")+_:"",z=this.#V(Q," ");return v+$+Y+z}constructor($){if(typeof $==="string")$={text:$};if(this.#$={color:"cyan",stream:t_.stderr,discardStdin:!0,hideCursor:!0,...$},this.color=this.#$.color,this.#_=this.#$.stream,typeof this.#$.isEnabled!=="boolean")this.#$.isEnabled=jY({stream:this.#_});if(typeof this.#$.isSilent!=="boolean")this.#$.isSilent=!1;let _=this.#$.interval;if(this.spinner=this.#$.spinner,this.#$.interval=_,this.text=this.#$.text,this.prefixText=this.#$.prefixText,this.suffixText=this.#$.suffixText,this.indent=this.#$.indent,t_.env.NODE_ENV==="test")this._stream=this.#_,this._isEnabled=this.#$.isEnabled,Object.defineProperty(this,"_linesToClear",{get(){return this.#J},set(U){this.#J=U}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#U}}),Object.defineProperty(this,"_lineCount",{get(){let U=this.#_.columns??80,Q=typeof this.#$.prefixText==="function"?"":this.#$.prefixText,v=typeof this.#$.suffixText==="function"?"":this.#$.suffixText,J=typeof Q==="string"&&Q!==""?Q+" ":"",Y=typeof v==="string"&&v!==""?" "+v:"",z="-",I=" ".repeat(this.#$.indent)+J+"-"+(typeof this.#$.text==="string"?" "+this.#$.text:"")+Y;return this.#K(I,U)}})}get indent(){return this.#$.indent}set indent($=0){if(!($>=0&&Number.isInteger($)))throw Error("The `indent` option must be an integer from 0 and up");this.#$.indent=$}get interval(){return this.#$.interval??this.#Q.interval??100}get spinner(){return this.#Q}set spinner($){if(this.#U=-1,this.#$.interval=void 0,typeof $==="object"){if(!Array.isArray($.frames)||$.frames.length===0||$.frames.some((_)=>typeof _!=="string"))throw Error("The given spinner must have a non-empty `frames` array of strings");if($.interval!==void 0&&!(Number.isInteger($.interval)&&$.interval>0))throw Error("`spinner.interval` must be a positive integer if provided");this.#Q=$}else if(!r_())this.#Q=n_.line;else if($===void 0)this.#Q=n_.dots;else if($!=="default"&&n_[$])this.#Q=n_[$];else throw Error(`There is no built-in spinner named '${$}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#$.text}set text($=""){this.#$.text=$}get prefixText(){return this.#$.prefixText}set prefixText($=""){this.#$.prefixText=$}get suffixText(){return this.#$.suffixText}set suffixText($=""){this.#$.suffixText=$}get isSpinning(){return this.#Y!==void 0}#B($,_,U=!1){let Q=typeof $==="function"?$():$;if(typeof Q==="string"&&Q!=="")return U?_+Q:Q+_;return""}#Z($=this.#$.prefixText,_=" "){return this.#B($,_,!1)}#V($=this.#$.suffixText,_=" "){return this.#B($,_,!0)}#K($,_){let U=0;for(let Q of bw($).split(`
133
+ `))U+=Math.max(1,Math.ceil(GY(Q)/_));return U}get isEnabled(){return this.#$.isEnabled&&!this.#$.isSilent}set isEnabled($){if(typeof $!=="boolean")throw TypeError("The `isEnabled` option must be a boolean");this.#$.isEnabled=$}get isSilent(){return this.#$.isSilent}set isSilent($){if(typeof $!=="boolean")throw TypeError("The `isSilent` option must be a boolean");this.#$.isSilent=$}frame(){let $=Date.now();if(this.#U===-1||$-this.#v>=this.interval)this.#U=(this.#U+1)%this.#Q.frames.length,this.#v=$;let{frames:_}=this.#Q,U=_[this.#U];if(this.color)U=Lj[this.color](U);let Q=this.#Z(this.#$.prefixText," "),v=typeof this.text==="string"?" "+this.text:"",J=this.#V(this.#$.suffixText," ");return Q+U+v+J}clear(){if(!this.isEnabled||!this.#_.isTTY)return this;return this.#q(()=>{this.#_.cursorTo(0);for(let $=0;$<this.#J;$++){if($>0)this.#_.moveCursor(0,-1);this.#_.clearLine(1)}if(this.#$.indent)this.#_.cursorTo(this.#$.indent)}),this.#J=0,this}#L($){if(!$||this.#I.has($)||!$.isTTY||typeof $.write!=="function")return;if(k8.has($))console.warn("[ora] Multiple concurrent spinners detected. This may cause visual corruption. Use one spinner at a time.");let _=$.write;this.#I.set($,_),k8.set($,this),$.write=(U,Q,v)=>this.#F($,_,U,Q,v)}#k(){if(!this.isEnabled||this.#I.size>0)return;let $=new Set([this.#_,t_.stdout,t_.stderr]);for(let _ of $)this.#L(_)}#A(){for(let[$,_]of this.#I)if($.write=_,k8.get($)===this)k8.delete($);this.#I.clear()}#F($,_,U,Q,v){if(typeof Q==="function")v=Q,Q=void 0;if(this.#G)return _.call($,U,Q,v);this.clear();let J=this.#D(U,Q),Y=this.#M(J),z=_.call($,U,Q,v);if(Y)this.#W();else if(J.length>0)this.#w();if(this.isSpinning&&!this.#z)this.render();return z}render(){if(!this.isEnabled||this.#X||this.#z)return this;let $=this.#_.isTTY,_=!1;try{if($)this.#q(()=>this.#_.write(Zw)),_=!0;this.clear();let U=this.frame(),Q=this.#_.columns??80,v=this.#K(U,Q),J=this.#_.rows;if(J&&J>1&&v>J){let z=U.split(`
134
+ `),I=J-1;U=[...z.slice(0,I),"... (content truncated to fit terminal)"].join(`
135
+ `)}if(this.#q(()=>this.#_.write(U))===!1&&this.#_.isTTY)this.#X=()=>{this.#X=void 0,this.#H()},this.#_.once("drain",this.#X);this.#J=this.#K(U,Q)}finally{if(_)this.#q(()=>this.#_.write(Vw))}return this}start($){if($)this.text=$;if(this.isSilent)return this;if(!this.isEnabled){let _=this.text?"-":"",U=" ".repeat(this.#$.indent)+this.#b(_,this.text,this.#$.prefixText,this.#$.suffixText);if(U.trim()!=="")this.#q(()=>this.#_.write(U+`
136
+ `));return this}if(this.isSpinning)return this;if(this.#$.hideCursor)vY.hide(this.#_);if(this.#$.discardStdin&&t_.stdin.isTTY)KY.start(),this.#j=!0;return this.#k(),this.render(),this.#Y=setInterval(this.render.bind(this),this.interval),this}stop(){if(clearInterval(this.#Y),this.#Y=void 0,this.#U=-1,this.#v=0,this.#W(),this.#A(),this.#X)this.#_.removeListener("drain",this.#X),this.#X=void 0;if(this.isEnabled){if(this.clear(),this.#$.hideCursor)vY.show(this.#_)}if(this.#j)this.#j=!1,KY.stop();return this}succeed($){return this.stopAndPersist({symbol:F1.success,text:$})}fail($){return this.stopAndPersist({symbol:F1.error,text:$})}warn($){return this.stopAndPersist({symbol:F1.warning,text:$})}info($){return this.stopAndPersist({symbol:F1.info,text:$})}stopAndPersist($={}){if(this.isSilent)return this;let _=$.symbol??" ",U=$.text??this.text,Q=$.prefixText??this.#$.prefixText,v=$.suffixText??this.#$.suffixText,J=this.#b(_,U,Q,v)+`
137
+ `;return this.stop(),this.#q(()=>this.#_.write(J)),this}}function HY($){return new zK($)}var Bw=200,Zw="\x1B[?2026h",Vw="\x1B[?2026l",k8;var IK=b(()=>{kj();mj();hj();oj();QK();JY();YK();k8=new Map});function V$($){let _=M1&&!$.quiet;return HY({text:$.text,isSilent:!_})}var e4=b(()=>{IK();l_()});function XK($){let[_=""]=$.split("-"),U=_.split("."),Q=parseInt(U[0]??"",10),v=parseInt(U[1]??"",10),J=parseInt(U[2]??"",10);if(Number.isNaN(Q)||Number.isNaN(v)||Number.isNaN(J))return null;return{major:Q,minor:v,patch:J}}function Dw($,_){let U=XK($),Q=XK(_);if(!U||!Q)return null;if(U.major!==Q.major)return U.major-Q.major;if(U.minor!==Q.minor)return U.minor-Q.minor;return U.patch-Q.patch}function qK($,_,U){if(!$)return{compatible:!0};let Q=Dw(_,$);if(Q===null)return{compatible:!0};if(Q>=0)return{compatible:!0};return{compatible:!1,required:$,installed:_,type:U}}function Mw($,_){let U=_.type==="opencode"?"OpenCode":"OCX CLI",Q=_.type==="opencode"?"Update OpenCode to the latest version":"bun update -g ocx";return`
138
+ ${g.yellow().bold("\u26A0 WARN")} ${g.yellow("Version compatibility notice")}
139
+
140
+ Registry ${g.cyan(`"${$}"`)} requires ${U} ${g.green(_.required)}
141
+ You are running ${U} ${g.red(_.installed)}
100
142
 
101
143
  This may work fine, but if you encounter issues,
102
- consider updating: ${P.dim($)}
144
+ consider updating: ${g.dim(Q)}
103
145
 
104
- To silence: ${P.dim("--skip-compat-check")} or set ${P.dim('"skipCompatCheck": true')} in ocx.jsonc
105
- `}function OB(D){let{registry:F,ocxVersion:B,opencodeVersion:$}=D,_=[],Q=wB(F.ocx,B,"ocx");if(!Q.compatible)_.push(Q);if($){let Y=wB(F.opencode,$,"opencode");if(!Y.compatible)_.push(Y)}return _}function bB(D,F){for(let B of F)G.log(kH(D,B))}var RB=V(()=>{W2();fD()});import{randomUUID as ZB}from"crypto";import{existsSync as M0}from"fs";import{lstat as IH,mkdir as U6,rename as j6,rm as oF,stat as TH,writeFile as vH}from"fs/promises";import{dirname as Z8,isAbsolute as CH,join as F0,relative as uH,resolve as NB}from"path";function PH(D,F){if(!D?.installed)return null;for(let[B,$]of Object.entries(D.installed))if($.files?.some((_)=>_.path===F))return B;return null}function SB(D){let F=D.split("::")[1];if(!F)return D;return F.split("@")[0]||D}function xH(D){if(!D?.trim())throw new U("Component name cannot be empty");let F=D.trim();if(b4(F)){let B=O4(F);return{type:"npm",name:B.name,version:B.version}}if(F.includes("/")){let{namespace:B,component:$}=u0(F);return{type:"registry",namespace:B,component:$}}return{type:"registry",namespace:"",component:F}}function IB(D){let F=D.command("add").description(`Add components or npm plugins to your project.
146
+ To silence: ${g.dim("--skip-compat-check")} or set ${g.dim('"skipCompatCheck": true')} in ocx.jsonc
147
+ `}function GK($){let{registry:_,ocxVersion:U,opencodeVersion:Q}=$,v=[],J=qK(_.ocx,U,"ocx");if(!J.compatible)v.push(J);if(Q){let Y=qK(_.opencode,Q,"opencode");if(!Y.compatible)v.push(Y)}return v}function jK($,_){for(let U of _)W.log(Mw($,U))}var KK=b(()=>{k6();i$()});import{randomUUID as HK}from"crypto";import{existsSync as h4}from"fs";import{lstat as ww,mkdir as BY,rename as WY,rm as u0,stat as ZK,writeFile as Lw}from"fs/promises";import{dirname as A8,isAbsolute as kw,join as G4,relative as Aw,resolve as WK}from"path";function Fw($,_){if(!$?.installed)return null;for(let[U,Q]of Object.entries($.installed))if(Q.files?.some((v)=>v.path===_))return U;return null}function bK($){let _=$.split("::")[1];if(!_)return $;return _.split("@")[0]||$}function Ow($){if(!$?.trim())throw new M("Component name cannot be empty");let _=$.trim();if(Yj(_)){let U=Jj(_);return{type:"npm",name:U.name,version:U.version}}if(_.includes("/")){let{namespace:U,component:Q}=r4(_);return{type:"registry",namespace:U,component:Q}}return{type:"registry",namespace:"",component:_}}function VK($){let _=$.command("add").description(`Add components or npm plugins to your project.
106
148
 
107
149
  Registry components: ocx add alias/component
108
- npm plugins: ocx add npm:package-name[@version]`).argument("<components...>","Components to install (alias/component or npm:package[@version])").option("--dry-run","Show what would be installed without making changes").option("--skip-compat-check","Skip version compatibility checks").option("--trust","Skip npm plugin validation (for packages that don't follow conventions)").option("-p, --profile <name>","Use specific profile").option("--from <url>","Use ephemeral registry (does not persist)");oD(F),w0(F),r0(F),F.action(async(B,$)=>{try{let _=$.json?{...$,quiet:!0,verbose:!1}:$,Q;if(_.profile){let Y=await o0.create(_.cwd??process.cwd(),{profile:_.profile});Q={cwd:yD(_.profile),getRegistries:()=>Y.getRegistries(),getComponentPath:()=>Y.getComponentPath()}}else if(_.global)Q=await mF.requireInitialized();else Q=await V0.requireInitialized(_.cwd??process.cwd());await V6(B,_,Q)}catch(_){t(_,{json:$.json})}})}async function V6(D,F,B){let $=B.cwd,_=D.map(xH),Q=_.filter((z)=>z.type==="npm"),Y=_.filter((z)=>z.type==="registry"),q=Boolean(F.json&&Q.length>0&&Y.length>0),H=q?{...F,json:!1,quiet:!0,verbose:!1}:F,J,X;if(Q.length>0)J=await yH(Q,H,$,!q);if(Y.length>0){let z=Y.map((M)=>M.namespace?`${M.namespace}/${M.component}`:M.component);X=await fH(z,H,B,!q)}if(q)LD({success:!0,plugins:J?.plugins??[],installed:X?.installed??[],opencode:X?.opencode??!1,dryRun:Boolean(J?.dryRun||X?.dryRun)})}async function yH(D,F,B,$=!0){let _=F.quiet?null:jD({text:"Validating npm packages..."});_?.start();try{let Q=[];for(let A of D)if(await s1(A.name),!F.trust)try{let K=await M8(A.name,A.version),j=R4(K);Q.push(...j.warnings)}catch(K){if(K instanceof U)throw _?.fail("Plugin validation failed"),new U(`${K.message}
150
+ npm plugins: ocx add npm:package-name[@version]`).argument("<components...>","Components to install (alias/component or npm:package[@version])").option("--dry-run","Show what would be installed without making changes").option("--skip-compat-check","Skip version compatibility checks").option("--trust","Skip npm plugin validation (for packages that don't follow conventions)").option("-p, --profile <name>","Use specific profile").option("--from <url>","Use ephemeral registry (does not persist)");Q4(_),m4(_),G6(_),_.action(async(U,Q)=>{try{let v=Q.json?{...Q,quiet:!0,verbose:!1}:Q,J;if(v.profile){let Y=await q6.create(v.cwd??process.cwd(),{profile:v.profile});J={cwd:p$(v.profile),getRegistries:()=>Y.getRegistries(),getComponentPath:()=>Y.getComponentPath()}}else if(v.global)J=await L0.requireInitialized();else J=await y4.requireInitialized(v.cwd??process.cwd());await ZY(U,v,J)}catch(v){_$(v,{json:Q.json})}})}async function ZY($,_,U){let Q=U.cwd,v=$.map(Ow),J=v.filter((G)=>G.type==="npm"),Y=v.filter((G)=>G.type==="registry"),z=Boolean(_.json&&J.length>0&&Y.length>0),I=z?{..._,json:!1,quiet:!0,verbose:!1}:_,X,q;if(J.length>0)X=await Nw(J,I,Q,!z);if(Y.length>0){let G=Y.map((j)=>j.namespace?`${j.namespace}/${j.component}`:j.component);q=await Sw(G,I,U,!z)}if(z)O$({success:!0,plugins:X?.plugins??[],installed:q?.installed??[],opencode:q?.opencode??!1,dryRun:Boolean(X?.dryRun||q?.dryRun)})}async function Nw($,_,U,Q=!0){let v=_.quiet?null:V$({text:"Validating npm packages..."});v?.start();try{let J=[];for(let H of $)if(await pJ(H.name),!_.trust)try{let Z=await q8(H.name,H.version),V=zj(Z);J.push(...V.warnings)}catch(Z){if(Z instanceof M)throw v?.fail("Plugin validation failed"),new M(`${Z.message}
109
151
  hint OpenCode plugins must be ESM modules with an entry point
110
- hint Use \`--trust\` to add anyway`);throw K}if(_?.succeed(`Validated ${D.length} npm package(s)`),Q.length>0&&!F.quiet){G.info("");for(let A of Q)G.warn(A)}let q=(await d1(B))?.config.plugin??[],H=new Map;for(let A of q){let K=Z4(A);H.set(K,A)}let J=[],X=[];for(let A of D)if(H.get(A.name))X.push(A.name);else J.push(pF(A.name,A.version));if(X.length>0)throw new gD(`Plugin(s) already exist in opencode.json: ${X.join(", ")}.
111
- Remove the existing entry manually or use 'ocx update' if it's an installed component.`);let z=[...H.values(),...J];if(F.dryRun){let K={dryRun:!0,command:"add",wouldPerform:D.map((j)=>({action:"add",target:pF(j.name,j.version),details:{type:"npm plugin"}})),validation:{passed:!0},summary:`Would add ${D.length} npm plugin(s)`};if($||!F.json)z0(K,{json:F.json,quiet:F.quiet});return{plugins:D.map((j)=>pF(j.name,j.version)),dryRun:!0}}if(await c1(B,{plugin:z}),!F.quiet){G.info(""),G.success(`Added ${D.length} npm plugin(s) to opencode.json`);for(let A of D)G.info(` \u2713 ${pF(A.name,A.version)}`)}let M=D.map((A)=>pF(A.name,A.version));if(F.json&&$)LD({success:!0,plugins:M});return{plugins:M,dryRun:!1}}catch(Q){throw _?.fail("Failed to add npm plugins"),Q}}async function fH(D,F,B,$=!0){let _=Boolean(F.quiet||F.json),Q=B.cwd,Y=!!(F.global||F.profile),q=B.getRegistries(),H=q;if(F.from){let K=F.from.trim();if(!K)throw new U("--from URL cannot be empty");try{new URL(K)}catch{throw new U(`Invalid --from URL: ${K}`)}let j=new Set;for(let Z of D){let{namespace:s}=u0(Z);j.add(s)}if(j.size>1){let Z=Array.from(j).join(", ");throw new U(`Mixed registry prefixes in --from call: ${Z}.
112
- When using --from, all components must use the same prefix.`)}let S=Array.from(j)[0];if(!S)throw new U("No valid component references provided");await T2(K),H={...q,[S]:{url:K}}}let J={version:1,root:Q,installed:{}},X=await J0(Q);if(X)J=X;let z=_?null:jD({text:"Resolving dependencies..."});z?.start();let M=null,A=null;try{let K=new Set;for(let k of D){let{namespace:i}=u0(k);K.add(i)}for(let k of K){let i=H[k];if(i)await T2(i.url)}let j=await e9(H,D);if(F.verbose){G.info("Install order:");for(let k of j.installOrder)G.info(` - ${k}`)}let S=new Map,Z=new Map;for(let k of j.components)if(!Z.has(k.registryName))Z.set(k.registryName,k.baseUrl);for(let[k,i]of Z){let v=await T2(i);S.set(k,v)}if(z?.succeed(`Resolved ${j.components.length} components from ${S.size} registries`),!F.skipCompatCheck&&!_)for(let[k,i]of S){let v=OB({registry:{opencode:i.opencode,ocx:i.ocx},ocxVersion:O7});bB(k,v)}if(F.dryRun){let k=j.components.map((v)=>({action:"add",target:`${v.registryName}/${v.name}`,details:{type:v.type}}));if(j.npmDependencies.length>0||j.npmDevDependencies.length>0){let v=F.global||F.profile?Q:F0(Q,".opencode"),_D=[...j.npmDependencies,...j.npmDevDependencies].map((r)=>{let bD=r.lastIndexOf("@"),YD=bD>0?r.slice(0,bD):r,B0=bD>0?r.slice(bD+1):"*";return{name:YD,from:null,to:B0}});k.push(X4(v,_D))}let i={dryRun:!0,command:"add",wouldPerform:k,validation:{passed:!0},summary:`Would add ${j.components.length} component(s)`};if($||!F.json)z0(i,{json:F.json,quiet:F.quiet});return{installed:j.installOrder,opencode:Boolean(j.opencode),dryRun:!0}}let N=_?null:jD({text:"Fetching components..."});N?.start();let x=[];for(let k of j.components){let i=[];for(let r of k.files){let bD=await e2(k.baseUrl,k.name,r.path);i.push({path:r.path,content:Buffer.from(bD)})}let v=await j8(i);for(let r of k.files){let bD=n2(r.target,Y,Q),YD=F0(Q,bD);try{H0(Q,bD)}catch(B0){if(B0 instanceof aD)throw new U(`Invalid path "${YD}": ${B0.message}`);throw B0}}let f=Object.entries(J.installed).filter(([r,bD])=>xD(bD.registryUrl)===xD(k.baseUrl)&&bD.registryName===k.registryName&&bD.name===k.name);if(f.length>0){let r=f[0];if(r){let[bD,YD]=r;if(YD.hash!==v)throw N?.fail("Integrity check failed"),new d2(bD,YD.hash,v)}}let _D=E3(k.baseUrl,k.registryName,k.name,`sha256:${v}`);x.push({component:k,files:i,computedHash:v,canonicalId:_D})}N?.succeed(`Fetched ${j.components.length} components`);let O=new Map;for(let{component:k,files:i}of x)for(let v of i){let f=k.files.find((bD)=>bD.path===v.path);if(!f)continue;let _D=n2(f.target,Y,Q),r=F0(Q,_D);$F(O,{absolutePath:r,relativePath:_D,content:v.content,source:`${k.registryName}/${k.name}:${f.path}`})}let b=[];for(let k of O.values()){if(!M0(k.absolutePath))continue;let i=await Bun.file(k.absolutePath).text(),v=k.content.toString("utf-8");if(!p1(i,v)){let f=PH(J,k.relativePath);b.push({path:k.relativePath,owningComponent:f})}}if(b.length>0){let k=b.filter((f)=>f.owningComponent!==null),i=b.filter((f)=>f.owningComponent===null);if(!_){if(G.error(""),G.error("File conflicts detected:"),k.length>0){G.error(""),G.error("Files from installed components (use 'ocx update' or 'ocx remove'):");for(let f of k)if(f.owningComponent){let _D=SB(f.owningComponent);G.error(` \u2717 ${f.path} (from ${_D})`)}}if(i.length>0){G.error(""),G.error("Files not managed by OCX (resolve manually):");for(let f of i)G.error(` \u2717 ${f.path}`)}G.error("")}let v=`${b.length} file(s) have conflicts.
113
- `;if(k.length>0){let f=new Set(k.filter((_D)=>_D.owningComponent!==null).map((_D)=>SB(_D.owningComponent)));v+=`For OCX-managed files, use 'ocx update ${Array.from(f).join(" ")}' or 'ocx remove ${Array.from(f).join(" ")}'.
114
- `}if(i.length>0)v+="For unmanaged files, resolve conflicts manually by renaming or removing them.";throw new gD(v.trim())}let L=_?null:jD({text:"Installing components..."});L?.start(),A=await cH({cwd:Q,isFlattened:Y,trackOpencodeConfig:Boolean(j.opencode&&Object.keys(j.opencode).length>0),trackNpmManifests:j.npmDependencies.length>0||j.npmDevDependencies.length>0,quiet:F.quiet});let e=lH({quiet:F.quiet});M=e;for(let{component:k,files:i,computedHash:v,canonicalId:f}of x){let _D=await pH(k,i,Q,Y,e,{verbose:F.verbose});if(F.verbose){for(let YD of _D.skipped)G.info(` \u25CB Skipped ${YD} (unchanged)`);for(let YD of _D.overwritten)G.info(` \u2713 Overwrote ${YD}`);for(let YD of _D.written)G.info(` \u2713 Wrote ${YD}`)}if(!S.get(k.registryName))throw new U(`Registry index not found for "${k.registryName}". This is an internal error - please report it at https://github.com/${w7}/issues`);let bD=[];for(let YD of i){let B0=k.files.find((GF)=>GF.path===YD.path);if(!B0)throw Error(`File ${YD.path} not found in component manifest`);let s8=n2(B0.target,Y,Q);bD.push({path:s8,hash:_F(YD.content)})}J.installed[f]={registryUrl:k.baseUrl,registryName:k.registryName,name:k.name,revision:`sha256:${v}`,hash:v,files:bD,installedAt:new Date().toISOString(),...k.opencode&&{opencode:k.opencode}}}if(L?.succeed(`Installed ${j.components.length} components`),j.opencode&&Object.keys(j.opencode).length>0){let k=await c1(Q,j.opencode);if(!F.quiet&&k.changed)if(k.created)G.info(`Created ${k.path}`);else G.info(`Updated ${k.path}`)}let p=j.npmDependencies.length>0,FD=j.npmDevDependencies.length>0,KD=F.global||F.profile?F0(Q,"package.json"):F0(Q,".opencode/package.json");if(p||FD){let k=_?null:jD({text:`Updating ${KD}...`});k?.start();try{let i=!!(F.global||F.profile),v=await rH(Q,j.npmDependencies,j.npmDevDependencies,{isFlattened:i}),f=j.npmDependencies.length+j.npmDevDependencies.length;if(k?.succeed(`Added ${f} dependencies to ${KD}`),v.changed){let _D=await G4(v.packageDir);if(_D.success&&_D.action!=="none"){if(!_)G.info(`Invalidated ${F0(v.packageDir,"node_modules")} to force reinstall`)}else if(!_D.success){let r=F0(v.packageDir,"node_modules");G.warn(`Could not invalidate ${r}: ${_D.error?.message??"unknown error"}. Run \`rm -rf "${r}"\` manually to force reinstall.`)}}}catch(i){throw k?.fail(`Failed to update ${KD}`),i}}if(await K0(Q,J),!M)throw Error("Internal error: missing add write transaction after install phase.");if(await M.commit(),M=null,A?.commit(),A=null,F.json&&$)LD({success:!0,installed:j.installOrder,opencode:!!j.opencode});else if(!F.quiet)G.info(""),G.success(`Done! Installed ${j.components.length} components.`);return{installed:j.installOrder,opencode:!!j.opencode,dryRun:!1}}catch(K){if(M)await M.rollback(),M=null;if(A)await A.rollback(),A=null;if(z&&!z.isSpinning);else z?.fail("Failed to add components");throw K}}function K6(D,F,B){let $=B instanceof Error?B.message:String(B);return`${D} "${F}" (${$})`}function hH(D,F){let B=uH(F,D);return B!==""&&!B.startsWith("..")&&!CH(B)}async function mH(D,F){let B=NB(D),$=NB(F);while(hH(B,$)){let _=!0;try{if(!(await IH(B)).isDirectory())break}catch(Y){if(Y.code==="ENOENT")_=!1;else throw Y}try{if(_)await oF(B,{recursive:!1})}catch(Y){let q=Y.code;if(q==="ENOENT");else if(q==="ENOTEMPTY"||q==="EEXIST"||q==="EBUSY")break;else if(q==="ENOTDIR")break;else throw Y}let Q=Z8(B);if(Q===B)break;B=Q}}async function gH(D){if(!M0(D))return{path:D,existed:!1,content:""};return{path:D,existed:!0,content:await Bun.file(D).text()}}async function dH(D,F){if(D.existed){await U6(Z8(D.path),{recursive:!0}),await Bun.write(D.path,D.content);return}if(M0(D.path))await oF(D.path,{force:!0,recursive:!0});await mH(Z8(D.path),F)}async function cH(D){let F=[],B=new Set,$=!1,_=async(q)=>{if(B.has(q))return;B.add(q),F.push(await gH(q))};if(D.trackOpencodeConfig){let q=z8(D.cwd).path;await _(q)}if(D.trackNpmManifests){let q=D.isFlattened?D.cwd:F0(D.cwd,".opencode");if(await _(F0(q,"package.json")),!D.isFlattened)await _(F0(q,".gitignore"))}return await _(N2(D.cwd).path),{rollback:async()=>{if($)return;$=!0;let q=[];for(let H of[...F].reverse())try{await dH(H,D.cwd)}catch(J){q.push(K6("Add rollback cleanup warning: failed to restore",H.path,J))}if(!D.quiet)for(let H of q)G.warn(H)},commit:()=>{$=!0}}}function lH(D){let F=[],B=new Set,$=!1;return{writeFileAtomically:async({targetPath:q,resolvedTarget:H,content:J})=>{let X=Z8(q);if(!M0(X))await U6(X,{recursive:!0});if(M0(q)){if((await TH(q)).isDirectory())throw new U(`Cannot install "${H}": target path is a directory.`)}let z=`${q}.ocx-add-tmp-${ZB()}`;await vH(z,J),B.add(z);let M=null;if(M0(q))M=`${q}.ocx-add-backup-${ZB()}`,await j6(q,M),F.push({targetPath:q,backupPath:M});if(await j6(z,q),B.delete(z),!M)F.push({targetPath:q,backupPath:null})},rollback:async()=>{if($)return;$=!0;let q=[];for(let H of B)try{await oF(H,{force:!0})}catch(J){q.push(K6("Add rollback cleanup warning: failed to remove temp file",H,J))}for(let H of[...F].reverse())try{if(H.backupPath){if(M0(H.targetPath))await oF(H.targetPath,{force:!0,recursive:!0});if(M0(H.backupPath))await j6(H.backupPath,H.targetPath)}else if(M0(H.targetPath))await oF(H.targetPath,{force:!0,recursive:!0})}catch(J){q.push(K6("Add rollback cleanup warning: failed to restore target",H.targetPath,J))}if(!D.quiet)for(let H of q)G.warn(H)},commit:async()=>{if($)return;$=!0;for(let q of F){if(!q.backupPath||!M0(q.backupPath))continue;try{await oF(q.backupPath,{force:!0})}catch(H){if(!D.quiet){let J=H instanceof Error?H.message:String(H);G.warn(`Post-add cleanup warning: failed to remove backup "${q.backupPath}" (${J})`)}}}}}}async function pH(D,F,B,$,_,Q){let Y={written:[],skipped:[],overwritten:[]};for(let q of F){let H=D.files.find((z)=>z.path===q.path);if(!H)continue;let J=n2(H.target,$,B),X=F0(B,J);if(M0(X)){let z=await Bun.file(X).text(),M=q.content.toString("utf-8");if(p1(z,M)){Y.skipped.push(J);continue}Y.overwritten.push(J)}else Y.written.push(J);await _.writeFileAtomically({targetPath:X,resolvedTarget:J,content:q.content})}return Y}function kB(D){if(!D?.trim())throw new U(`Invalid npm dependency: expected non-empty string, got "${D}"`);let F=D.trim(),B=F.lastIndexOf("@");if(B>0){let $=F.slice(0,B),_=F.slice(B+1);if(!_)throw new U(`Invalid npm dependency: missing version after @ in "${D}"`);return{name:$,version:_}}return{name:F,version:"*"}}function nH(D,F){let B={...D.dependencies};for(let $ of F)B[$.name]=$.version;return{...D,dependencies:B}}function sH(D,F){let B={...D.devDependencies};for(let $ of F)B[$.name]=$.version;return{...D,devDependencies:B}}async function aH(D){let F=F0(D,"package.json");if(!M0(F))return{...iH};try{let B=await Bun.file(F).text();return JSON.parse(B)}catch(B){let $=B instanceof Error?B.message:String(B);throw new c(`Invalid ${F}: ${$}`)}}async function oH(D){let F=F0(D,".gitignore"),B=new Set(["package.json","bun.lock"]),$=["node_modules"],_=[];if(M0(F))_=(await Bun.file(F).text()).split(`
115
- `).map((Y)=>Y.trim()).filter(Boolean);_=_.filter((Q)=>!B.has(Q));for(let Q of $)if(!_.includes(Q))_.push(Q);await Bun.write(F,`${_.join(`
152
+ hint Use \`--trust\` to add anyway`);throw Z}if(v?.succeed(`Validated ${$.length} npm package(s)`),J.length>0&&!_.quiet){W.info("");for(let H of J)W.warn(H)}let z=(await mJ(U))?.config.plugin??[],I=new Map;for(let H of z){let Z=Ij(H);I.set(Z,H)}let X=[],q=[];for(let H of $)if(I.get(H.name))q.push(H.name);else X.push(S0(H.name,H.version));if(q.length>0)throw new t$(`Plugin(s) already exist in opencode.json: ${q.join(", ")}.
153
+ Remove the existing entry manually or use 'ocx update' if it's an installed component.`);let G=[...I.values(),...X];if(_.dryRun){let Z={dryRun:!0,command:"add",wouldPerform:$.map((V)=>({action:"add",target:S0(V.name,V.version),details:{type:"npm plugin"}})),validation:{passed:!0},summary:`Would add ${$.length} npm plugin(s)`};if(Q||!_.json)S4(Z,{json:_.json,quiet:_.quiet});return{plugins:$.map((V)=>S0(V.name,V.version)),dryRun:!0}}if(await gJ(U,{plugin:G}),!_.quiet){W.info(""),W.success(`Added ${$.length} npm plugin(s) to opencode.json`);for(let H of $)W.info(` \u2713 ${S0(H.name,H.version)}`)}let j=$.map((H)=>S0(H.name,H.version));if(_.json&&Q)O$({success:!0,plugins:j});return{plugins:j,dryRun:!1}}catch(J){throw v?.fail("Failed to add npm plugins"),J}}async function Sw($,_,U,Q=!0){let v=Boolean(_.quiet||_.json),J=U.cwd,Y=!!(_.global||_.profile),z=U.getRegistries(),I=z;if(_.from){let Z=_.from.trim();if(!Z)throw new M("--from URL cannot be empty");try{new URL(Z)}catch{throw new M(`Invalid --from URL: ${Z}`)}let V=new Set;for(let T of $){let{namespace:r}=r4(T);V.add(r)}if(V.size>1){let T=Array.from(V).join(", ");throw new M(`Mixed registry prefixes in --from call: ${T}.
154
+ When using --from, all components must use the same prefix.`)}let S=Array.from(V)[0];if(!S)throw new M("No valid component references provided");await n6(Z),I={...z,[S]:{url:Z}}}let X={version:1,root:J,installed:{}},q=await F4(J);if(q)X=q;let G=v?null:V$({text:"Resolving dependencies..."});G?.start();let j=null,H=null;try{let Z=new Set;for(let x of $){let{namespace:t}=r4(x);Z.add(t)}for(let x of Z){let t=I[x];if(t)await n6(t.url)}let V=await yG(I,$);if(_.verbose){W.info("Install order:");for(let x of V.installOrder)W.info(` - ${x}`)}let S=new Map,T=new Map;for(let x of V.components)if(!T.has(x.registryName))T.set(x.registryName,x.baseUrl);for(let[x,t]of T){let C=await n6(t);S.set(x,C)}if(G?.succeed(`Resolved ${V.components.length} components from ${S.size} registries`),!_.skipCompatCheck&&!v)for(let[x,t]of S){let C=GK({registry:{opencode:t.opencode,ocx:t.ocx},ocxVersion:Jq});jK(x,C)}if(_.dryRun){let x=V.components.map((C)=>({action:"add",target:`${C.registryName}/${C.name}`,details:{type:C.type}}));if(V.npmDependencies.length>0||V.npmDevDependencies.length>0){let C=_.global||_.profile?J:G4(J,".opencode"),I$=[...V.npmDependencies,...V.npmDevDependencies].map(($$)=>{let R$=$$.lastIndexOf("@"),X$=R$>0?$$.slice(0,R$):$$,j4=R$>0?$$.slice(R$+1):"*";return{name:X$,from:null,to:j4}});x.push(iG(C,I$))}let t={dryRun:!0,command:"add",wouldPerform:x,validation:{passed:!0},summary:`Would add ${V.components.length} component(s)`};if(Q||!_.json)S4(t,{json:_.json,quiet:_.quiet});return{installed:V.installOrder,opencode:Boolean(V.opencode),dryRun:!0}}let A=v?null:V$({text:"Fetching components..."});A?.start();let u=[];for(let x of V.components){let t=[];for(let $$ of x.files){let R$=await V1(x.baseUrl,x.name,$$.path);t.push({path:$$.path,content:Buffer.from(R$)})}let C=await j8(t);for(let $$ of x.files){let R$=K1($$.target,Y,J),X$=G4(J,R$);try{A4(J,R$)}catch(j4){if(j4 instanceof U4)throw new M(`Invalid path "${X$}": ${j4.message}`);throw j4}}let h=Object.entries(X.installed).filter(([$$,R$])=>d$(R$.registryUrl)===d$(x.baseUrl)&&R$.registryName===x.registryName&&R$.name===x.name);if(h.length>0){let $$=h[0];if($$){let[R$,X$]=$$;if(X$.hash!==C)throw A?.fail("Integrity check failed"),new I1(R$,X$.hash,C)}}let I$=C_(x.baseUrl,x.registryName,x.name,`sha256:${C}`);u.push({component:x,files:t,computedHash:C,canonicalId:I$})}A?.succeed(`Fetched ${V.components.length} components`);let k=new Map;for(let{component:x,files:t}of u)for(let C of t){let h=x.files.find((R$)=>R$.path===C.path);if(!h)continue;let I$=K1(h.target,Y,J),$$=G4(J,I$);L1(k,{absolutePath:$$,relativePath:I$,content:C.content,source:`${x.registryName}/${x.name}:${h.path}`})}let O=[];for(let x of k.values()){if(!h4(x.absolutePath))continue;let t=await Bun.file(x.absolutePath).text(),C=x.content.toString("utf-8");if(!cJ(t,C)){let h=Fw(X,x.relativePath);O.push({path:x.relativePath,owningComponent:h})}}if(O.length>0){let x=O.filter((h)=>h.owningComponent!==null),t=O.filter((h)=>h.owningComponent===null);if(!v){if(W.error(""),W.error("File conflicts detected:"),x.length>0){W.error(""),W.error("Files from installed components (use 'ocx update' or 'ocx remove'):");for(let h of x)if(h.owningComponent){let I$=bK(h.owningComponent);W.error(` \u2717 ${h.path} (from ${I$})`)}}if(t.length>0){W.error(""),W.error("Files not managed by OCX (resolve manually):");for(let h of t)W.error(` \u2717 ${h.path}`)}W.error("")}let C=`${O.length} file(s) have conflicts.
155
+ `;if(x.length>0){let h=new Set(x.filter((I$)=>I$.owningComponent!==null).map((I$)=>bK(I$.owningComponent)));C+=`For OCX-managed files, use 'ocx update ${Array.from(h).join(" ")}' or 'ocx remove ${Array.from(h).join(" ")}'.
156
+ `}if(t.length>0)C+="For unmanaged files, resolve conflicts manually by renaming or removing them.";throw new t$(C.trim())}let w=v?null:V$({text:"Installing components..."});w?.start(),H=await xw({cwd:J,isFlattened:Y,trackOpencodeConfig:Boolean(V.opencode&&Object.keys(V.opencode).length>0),trackNpmManifests:V.npmDependencies.length>0||V.npmDevDependencies.length>0,quiet:_.quiet});let v$=uw({quiet:_.quiet});j=v$;for(let{component:x,files:t,computedHash:C,canonicalId:h}of u){let I$=await yw(x,t,J,Y,v$,{verbose:_.verbose});if(_.verbose){for(let X$ of I$.skipped)W.info(` \u25CB Skipped ${X$} (unchanged)`);for(let X$ of I$.overwritten)W.info(` \u2713 Overwrote ${X$}`);for(let X$ of I$.written)W.info(` \u2713 Wrote ${X$}`)}if(!S.get(x.registryName))throw new M(`Registry index not found for "${x.registryName}". This is an internal error - please report it at https://github.com/${Qq}/issues`);let R$=[];for(let X$ of t){let j4=x.files.find((E1)=>E1.path===X$.path);if(!j4)throw Error(`File ${X$.path} not found in component manifest`);let n8=K1(j4.target,Y,J);R$.push({path:n8,hash:k1(X$.content)})}X.installed[h]={registryUrl:x.baseUrl,registryName:x.registryName,name:x.name,revision:`sha256:${C}`,hash:C,files:R$,installedAt:new Date().toISOString(),...x.opencode&&{opencode:x.opencode}}}if(w?.succeed(`Installed ${V.components.length} components`),V.opencode&&Object.keys(V.opencode).length>0){let x=await gJ(J,V.opencode);if(!_.quiet&&x.changed)if(x.created)W.info(`Created ${x.path}`);else W.info(`Updated ${x.path}`)}let o=V.npmDependencies.length>0,Q$=V.npmDevDependencies.length>0,D$=_.global||_.profile?G4(J,"package.json"):G4(J,".opencode/package.json");if(o||Q$){let x=v?null:V$({text:`Updating ${D$}...`});x?.start();try{let t=!!(_.global||_.profile),C=await cw(J,V.npmDependencies,V.npmDevDependencies,{isFlattened:t}),h=V.npmDependencies.length+V.npmDevDependencies.length;if(x?.succeed(`Added ${h} dependencies to ${D$}`),C.changed){let I$=await nG(C.packageDir);if(I$.success&&I$.action!=="none"){if(!v)W.info(`Invalidated ${G4(C.packageDir,"node_modules")} to force reinstall`)}else if(!I$.success){let $$=G4(C.packageDir,"node_modules");W.warn(`Could not invalidate ${$$}: ${I$.error?.message??"unknown error"}. Run \`rm -rf "${$$}"\` manually to force reinstall.`)}}}catch(t){throw x?.fail(`Failed to update ${D$}`),t}}if(await x4(J,X),!j)throw Error("Internal error: missing add write transaction after install phase.");if(await j.commit(),j=null,H?.commit(),H=null,_.json&&Q)O$({success:!0,installed:V.installOrder,opencode:!!V.opencode});else if(!_.quiet)W.info(""),W.success(`Done! Installed ${V.components.length} components.`);return{installed:V.installOrder,opencode:!!V.opencode,dryRun:!1}}catch(Z){if(j)await j.rollback(),j=null;if(H)await H.rollback(),H=null;if(G&&!G.isSpinning);else G?.fail("Failed to add components");throw Z}}function bY($,_,U){let Q=U instanceof Error?U.message:String(U);return`${$} "${_}" (${Q})`}function Tw($,_){let U=Aw(_,$);return U!==""&&!U.startsWith("..")&&!kw(U)}async function Rw($,_){let U=WK($),Q=WK(_);while(Tw(U,Q)){let v=!0;try{if(!(await ww(U)).isDirectory())break}catch(Y){if(Y.code==="ENOENT")v=!1;else throw Y}try{if(v)await u0(U,{recursive:!1})}catch(Y){let z=Y.code;if(z==="ENOENT");else if(z==="ENOTEMPTY"||z==="EEXIST"||z==="EBUSY")break;else if(z==="ENOTDIR")break;else throw Y}let J=A8(U);if(J===U)break;U=J}}async function Ew($){let _;try{_=await ZK($)}catch(U){let Q=U.code;if(Q==="ENOENT"||Q==="ENOTDIR")return{path:$,state:"missing",content:""};throw U}if(!_.isFile())return{path:$,state:"non-file",content:""};return{path:$,state:"file",content:await Bun.file($).text()}}async function Pw($,_){if($.state==="file"){await BY(A8($.path),{recursive:!0}),await Bun.write($.path,$.content);return}if($.state==="non-file")return;if(h4($.path))await u0($.path,{force:!0,recursive:!0});await Rw(A8($.path),_)}async function xw($){let _=[],U=new Set,Q=!1,v=async(z)=>{if(U.has(z))return;U.add(z),_.push(await Ew(z))};if($.trackOpencodeConfig){let z=X8($.cwd).path;await v(z)}if($.trackNpmManifests){let z=$.isFlattened?$.cwd:G4($.cwd,".opencode");if(await v(G4(z,"package.json")),!$.isFlattened)await v(G4(z,".gitignore"))}return await v(l6($.cwd).path),{rollback:async()=>{if(Q)return;Q=!0;let z=[];for(let I of[..._].reverse())try{await Pw(I,$.cwd)}catch(X){z.push(bY("Add rollback cleanup warning: failed to restore",I.path,X))}if(!$.quiet)for(let I of z)W.warn(I)},commit:()=>{Q=!0}}}function uw($){let _=[],U=new Set,Q=!1;return{writeFileAtomically:async({targetPath:z,resolvedTarget:I,content:X})=>{let q=A8(z);if(!h4(q))await BY(q,{recursive:!0});if(h4(z)){if((await ZK(z)).isDirectory())throw new M(`Cannot install "${I}": target path is a directory.`)}let G=`${z}.ocx-add-tmp-${HK()}`;await Lw(G,X),U.add(G);let j=null;if(h4(z))j=`${z}.ocx-add-backup-${HK()}`,await WY(z,j),_.push({targetPath:z,backupPath:j});if(await WY(G,z),U.delete(G),!j)_.push({targetPath:z,backupPath:null})},rollback:async()=>{if(Q)return;Q=!0;let z=[];for(let I of U)try{await u0(I,{force:!0})}catch(X){z.push(bY("Add rollback cleanup warning: failed to remove temp file",I,X))}for(let I of[..._].reverse())try{if(I.backupPath){if(h4(I.targetPath))await u0(I.targetPath,{force:!0,recursive:!0});if(h4(I.backupPath))await WY(I.backupPath,I.targetPath)}else if(h4(I.targetPath))await u0(I.targetPath,{force:!0,recursive:!0})}catch(X){z.push(bY("Add rollback cleanup warning: failed to restore target",I.targetPath,X))}if(!$.quiet)for(let I of z)W.warn(I)},commit:async()=>{if(Q)return;Q=!0;for(let z of _){if(!z.backupPath||!h4(z.backupPath))continue;try{await u0(z.backupPath,{force:!0})}catch(I){if(!$.quiet){let X=I instanceof Error?I.message:String(I);W.warn(`Post-add cleanup warning: failed to remove backup "${z.backupPath}" (${X})`)}}}}}}async function yw($,_,U,Q,v,J){let Y={written:[],skipped:[],overwritten:[]};for(let z of _){let I=$.files.find((G)=>G.path===z.path);if(!I)continue;let X=K1(I.target,Q,U),q=G4(U,X);if(h4(q)){let G=await Bun.file(q).text(),j=z.content.toString("utf-8");if(cJ(G,j)){Y.skipped.push(X);continue}Y.overwritten.push(X)}else Y.written.push(X);await v.writeFileAtomically({targetPath:q,resolvedTarget:X,content:z.content})}return Y}function BK($){if(!$?.trim())throw new M(`Invalid npm dependency: expected non-empty string, got "${$}"`);let _=$.trim(),U=_.lastIndexOf("@");if(U>0){let Q=_.slice(0,U),v=_.slice(U+1);if(!v)throw new M(`Invalid npm dependency: missing version after @ in "${$}"`);return{name:Q,version:v}}return{name:_,version:"*"}}function fw($,_){let U={...$.dependencies};for(let Q of _)U[Q.name]=Q.version;return{...$,dependencies:U}}function mw($,_){let U={...$.devDependencies};for(let Q of _)U[Q.name]=Q.version;return{...$,devDependencies:U}}async function gw($){let _=G4($,"package.json");if(!h4(_))return{...Cw};try{let U=await Bun.file(_).text();return JSON.parse(U)}catch(U){let Q=U instanceof Error?U.message:String(U);throw new n(`Invalid ${_}: ${Q}`)}}async function hw($){let _=G4($,".gitignore"),U=new Set(["package.json","bun.lock"]),Q=["node_modules"],v=[];if(h4(_))v=(await Bun.file(_).text()).split(`
157
+ `).map((Y)=>Y.trim()).filter(Boolean);v=v.filter((J)=>!U.has(J));for(let J of Q)if(!v.includes(J))v.push(J);await Bun.write(_,`${v.join(`
116
158
  `)}
117
- `)}async function rH(D,F,B,$={}){let _=$.isFlattened?D:F0(D,".opencode");if(F.length===0&&B.length===0)return{changed:!1,packageDir:_,delta:[]};await U6(_,{recursive:!0});let Q=F.map(kB),Y=B.map(kB),q=new Set(Q.map((K)=>K.name)),H=Y.filter((K)=>q.has(K.name));if(H.length>0)throw new gD(`Package(s) appear in both dependencies and devDependencies: ${H.map((K)=>K.name).join(", ")}.
118
- A package cannot be in both fields. Remove from one list manually before adding.`);let J=await aH(_),X={...J.dependencies,...J.devDependencies},z=J;z=nH(z,Q),z=sH(z,Y),await Bun.write(F0(_,"package.json"),`${JSON.stringify(z,null,2)}
119
- `);let M={...z.dependencies,...z.devDependencies},A=J4(X,M);if(!$.isFlattened)await oH(_);return{changed:A.changed,packageDir:_,delta:A.entries}}var iH;var E6=V(()=>{gF();O3();s3();G0();DF();D4();tD();P0();l1();W4();BF();$D();PD();fD();a1();c2();k2();A8();iF();x0();m0();RB();iH={name:"opencode-plugins",private:!0,type:"module"}});import{join as tH,posix as eH}from"path";function DJ(D){if(D.length===0)return"Unknown parse error";let F=D[0];if(!F)return"Unknown parse error";return`${K2(F.error)} at offset ${F.offset}`}async function TB(D){let F=Bun.file(`${D}/registry.jsonc`),B=Bun.file(`${D}/registry.json`),$=await F.exists(),_=await B.exists();if(!$&&!_)return{success:!1,error:"No registry.jsonc or registry.json found in source directory",errorKind:"not_found"};let Q=$?F:B,Y=$?"registry.jsonc":"registry.json",q=await Q.text(),H=[],J=ND(q,H,{allowTrailingComma:!0});if(H.length>0){let X=DJ(H);return{success:!1,error:`Invalid JSONC in ${Y}: ${X}`,errorKind:"parse_error"}}return{success:!0,data:J}}function vB(D,F){let B=PF(D);if(B)return{valid:!1,errors:[`Schema compatibility issue: ${B.issue} - ${B.remediation}`]};return FJ(D,F)}function FJ(D,F){let B=i2.safeParse(D);if(!B.success)return{valid:!1,errors:B.error.errors.map((_)=>`${_.path.join(".")}: ${_.message}`)};return{valid:!0,errors:[],data:B.data}}async function BJ(D,F){let B=[];for(let $ of D.components)for(let _ of $.files){let Q=b2(_,$.type),Y=tH(F,"files",Q.path);if(!await Bun.file(Y).exists())B.push(`${$.name}: Source file not found at ${Q.path}`)}return{valid:B.length===0,errors:B}}function $J(D){let F=[],B=new Map(D.components.map((Q)=>[Q.name,Q]));function $(Q,Y,q,H){if(Y.has(Q))return[...H,Q].join(" -> ");if(q.has(Q))return null;let J=B.get(Q);if(!J)return null;Y.add(Q),H.push(Q);for(let X of J.dependencies){if(X.includes("/"))continue;let z=$(X,Y,q,H);if(z)return z}return Y.delete(Q),q.add(Q),H.pop(),null}let _=new Set;for(let Q of D.components){if(_.has(Q.name))continue;let Y=$(Q.name,new Set,_,[]);if(Y){F.push(`Circular dependency detected: ${Y}`);break}}return{valid:F.length===0,errors:F}}function _J(D){let F=[],B=new Map,$=(_)=>{let Y=_.normalize("NFC").replace(/\\/g,"/");return eH.normalize(Y).replace(/^\.\//,"")};for(let _ of D.components)for(let Q of _.files){let Y=b2(Q,_.type),q=$(Y.target),H=B.get(q);if(H)F.push(`Duplicate target "${q}" in components "${H.componentName}" and "${_.name}"`);else B.set(q,{componentName:_.name})}return{valid:F.length===0,errors:F}}async function*CB(D,F,B={}){let $=await BJ(D,F);for(let Q of $.errors)yield Q;let _=$J(D);for(let Q of _.errors)yield Q;if(!B.skipDuplicateTargets){let Q=_J(D);for(let Y of Q.errors)yield Y}}var uB=V(()=>{b0();P0()});async function N8(D,F={}){let B=await TB(D);if(!B.success)return{success:!1,errors:[B.error||"Failed to load registry"],failureType:"load",loadErrorKind:B.errorKind};let $=vB(B.data,D);if(!$.valid)return{success:!1,errors:$.errors,failureType:"schema"};let _=$.data;if(!_)throw Error("Registry validation succeeded but returned no parsed data");let Q=[];for await(let Y of CB(_,D,F))Q.push(Y);if(Q.length>0)return{success:!1,errors:Q,failureType:"rules"};return{success:!0,errors:[],registry:_}}var L6=V(()=>{uB()});function w6(D){return{file:D.filter((F)=>F.includes("Source file not found")),circular:D.filter((F)=>F.includes("Circular dependency")),duplicate:D.filter((F)=>F.includes("Duplicate target"))}}function C3(D,F={}){let B=w6(D),$=F.schemaErrors??0,_=D.length,Q=Math.max(0,_-$-B.file.length-B.circular.length-B.duplicate.length);return{valid:_===0,totalErrors:_,schemaErrors:$,sourceFileErrors:B.file.length,circularDependencyErrors:B.circular.length,duplicateTargetErrors:B.duplicate.length,otherErrors:Q}}import{relative as QJ,resolve as PB}from"path";function YJ(D,F){if(F==="not_found")return new MD(D);if(F==="parse_error")return new zD(D,"CONFIG_ERROR",XD.CONFIG);return new zD(D,"CONFIG_ERROR",XD.CONFIG)}function qJ(D,F){let B=C3(D,{schemaErrors:F==="schema"?D.length:0}),$={valid:!1,errors:D,summary:{valid:!1,totalErrors:B.totalErrors,schemaErrors:B.schemaErrors,sourceFileErrors:B.sourceFileErrors,circularDependencyErrors:B.circularDependencyErrors,duplicateTargetErrors:B.duplicateTargetErrors,otherErrors:B.otherErrors}};return new g2($)}function HJ(D,F){if(F==="schema"){G.error("\u2717 Registry schema");for(let $ of D)console.log(P.red(` ${$}`));return}let B=w6(D);if(B.file.length>0){G.error("\u2717 Source files");for(let $ of B.file)console.log(P.red(` ${$}`))}if(B.circular.length>0){G.error("\u2717 Circular dependencies");for(let $ of B.circular)console.log(P.red(` ${$}`))}if(B.duplicate.length>0){G.error("\u2717 Duplicate targets");for(let $ of B.duplicate)console.log(P.red(` ${$}`))}}function xB(D){D.command("build").description("Build a registry from source (for registry authors)").argument("[path]","Registry source directory",".").option("--out <dir>","Output directory","./dist").option("--cwd <path>","Working directory",process.cwd()).option("--json","Output as JSON",!1).option("-q, --quiet","Suppress output",!1).option("--dry-run","Validate and show what would be built").option("--show-validation","Display validation results before building",!1).action(async(F,B)=>{try{let $=PB(B.cwd,F),_=PB(B.cwd,B.out);if(B.showValidation){let H=!B.json&&!B.quiet;if(H)G.info("Running validation checks...");let J=await N8($,{skipDuplicateTargets:!1});if(!J.success){let[X="Registry validation failed"]=J.errors;if(J.failureType==="load")throw YJ(X,J.loadErrorKind);let z=J.failureType==="schema"?"schema":"rules",M=qJ(J.errors,z);if(B.json)throw M;if(!B.quiet)HJ(J.errors,z);process.exit(M.exitCode)}if(H)G.success("\u2713 Schema compatibility and structure"),G.success("\u2713 Source files"),G.success("\u2713 No circular dependencies"),G.success("\u2713 No duplicate targets"),console.log("")}let Q=jD({text:"Building registry...",quiet:B.quiet||B.json});if(!B.json)Q.start();let Y=await U3({source:$,out:_,dryRun:B.dryRun});if("dryRun"in Y&&Y.dryRun){if(!B.json)Q.stop();z0(Y,{json:B.json,quiet:B.quiet});return}let q=Y;if(!B.json){let H=`Built ${q.componentsCount} components to ${QJ(B.cwd,_)}`;if(Q.succeed(H),!process.stdout.isTTY)G.success(`Built ${q.componentsCount} components`)}if(B.json)LD({success:!0,data:{components:q.componentsCount,output:q.outputPath}})}catch($){if($ instanceof n0){if(B.json)t($,{json:!0});if(!B.quiet){G.error($.message);for(let _ of $.errors)console.log(P.red(` ${_}`))}process.exit(1)}t($,{json:B.json})}})}var yB=V(()=>{W2();o3();L6();BF();$D();PD();fD();m0()});import{existsSync as fB}from"fs";import{mkdir as JJ}from"fs/promises";import{join as O6}from"path";function hB(D){D.command("edit").description("Open configuration file in editor").option("-g, --global","Edit global ocx.jsonc").option("-p, --profile <name>","Edit specific profile's config").action(async(F)=>{try{await XJ(F)}catch(B){t(B)}})}async function XJ(D){if(D.global&&D.profile)throw new U("Cannot use both --global and --profile flags");let F;if(D.profile){let Q=s0.safeParse(D.profile);if(!Q.success)throw new U(`Invalid profile name "${D.profile}": ${Q.error.errors[0]?.message??"Invalid name"}`);if(await uD.requireInitialized(),!await uD.create().exists(D.profile))throw new CD(D.profile);F=Q0(D.profile)}else if(D.global){if(F=I2(),!fB(F))throw new c(`Global config not found at ${F}.
120
- Run 'ocx init --global' first.`)}else{let Q=o2(process.cwd());if(Q)F=O6(Q,J2);else{let Y=O6(process.cwd(),s2);if(await JJ(Y,{recursive:!0}),F=O6(Y,J2),!fB(F)){let q={$schema:"https://ocx.kdco.dev/schemas/ocx.json",registries:{}};await Bun.write(F,JSON.stringify(q,null,2)),G.info(`Created ${F}`)}}}let B=process.env.EDITOR||process.env.VISUAL||"vi",_=await Bun.spawn([B,F],{stdin:"inherit",stdout:"inherit",stderr:"inherit"}).exited;if(_!==0)throw Error(`Editor exited with code ${_}`)}var mB=V(()=>{a0();G0();Q8();$D();PD();fD()});function gB(D){D.command("show").description("Display resolved configuration for current directory").addOption(L0.json()).option("--origin","Show where each setting came from").option("-p, --profile <name>","Use specific profile").action(async(F)=>{try{await GJ(F)}catch(B){t(B,{json:F.json})}})}async function GJ(D){let F=await o0.create(process.cwd(),{profile:D.profile});if(D.origin){let $=F.resolveWithOrigin();if(D.json){let Q={};for(let[Y,q]of $.origins)Q[Y]=q;console.log(JSON.stringify({...$,origins:Q},null,2));return}if(console.log(P.bold("Resolved Configuration")),console.log(),$.profileName){let Q=$.origins.get("profileName");if(console.log(`${P.cyan("Profile:")} ${$.profileName}`),Q)console.log(` ${P.dim(`\u2190 ${Q.source}`)}`)}console.log(),console.log(P.cyan("Component Path:"),$.componentPath);let _=$.origins.get("componentPath");if(_)console.log(` ${P.dim(`\u2190 ${_.source} (${_.path})`)}`);console.log(),console.log(P.cyan("Registries:"));for(let[Q,Y]of Object.entries($.registries)){console.log(` ${P.green(Q)}: ${Y.url}`);let q=$.origins.get(`registries.${Q}`);if(q)console.log(` ${P.dim(`\u2190 ${q.source} (${q.path})`)}`)}if($.instructions.length>0){console.log(),console.log(P.cyan("Instructions:"));for(let Q of $.instructions)console.log(` ${Q}`)}if(Object.keys($.opencode).length>0){console.log(),console.log(P.cyan("OpenCode Config:"));for(let Q of Object.keys($.opencode)){let Y=$.origins.get(`opencode.${Q}`);if(console.log(` ${Q}:`,JSON.stringify($.opencode[Q])),Y)console.log(` ${P.dim(`\u2190 ${Y.source} (${Y.path})`)}`)}}return}let B=F.resolve();if(D.json){console.log(JSON.stringify(B,null,2));return}if(console.log(P.bold("Resolved Configuration")),console.log(),B.profileName)console.log(`${P.cyan("Profile:")} ${B.profileName}`);if(console.log(`${P.cyan("Component Path:")} ${B.componentPath}`),console.log(),console.log(P.cyan("Registries:")),Object.keys(B.registries).length===0)console.log(" (none)");else for(let[$,_]of Object.entries(B.registries))console.log(` ${P.green($)}: ${_.url}`);if(B.instructions.length>0){console.log(),console.log(P.cyan("Instructions:"));for(let $ of B.instructions)console.log(` ${$}`)}}var dB=V(()=>{W2();O3();PD();x0()});function cB(D){let F=D.command("config").description("View and edit configuration");gB(F),hB(F)}var lB=V(()=>{mB();dB()});import{existsSync as YF}from"fs";import{cp as WJ,mkdir as rF,readdir as pB,readFile as zJ,rm as MJ,writeFile as b6}from"fs/promises";import{dirname as iB,join as S8}from"path";function nB(D){let F=D.command("init").description("Initialize OCX configuration in your project");oD(F),w0(F),r0(F),F.option("--registry <path>","Scaffold a new OCX registry project at path").option("--namespace <name>","Registry namespace (e.g., my-org)").option("--author <name>","Author name for the registry").option("--canary","Use canary (main branch) instead of latest release").option("--local <path>","Use local template directory instead of fetching").action(async(B)=>{try{if(B.registry)await VJ(B.registry,B);else if(B.global)await UJ(B);else await KJ(B)}catch($){t($,{json:B.json})}})}async function KJ(D){let F=D.cwd??process.cwd(),{path:B,exists:$}=S2(F);if($)throw new gD(`ocx.jsonc already exists at ${B}
159
+ `)}async function cw($,_,U,Q={}){let v=Q.isFlattened?$:G4($,".opencode");if(_.length===0&&U.length===0)return{changed:!1,packageDir:v,delta:[]};await BY(v,{recursive:!0});let J=_.map(BK),Y=U.map(BK),z=new Set(J.map((Z)=>Z.name)),I=Y.filter((Z)=>z.has(Z.name));if(I.length>0)throw new t$(`Package(s) appear in both dependencies and devDependencies: ${I.map((Z)=>Z.name).join(", ")}.
160
+ A package cannot be in both fields. Remove from one list manually before adding.`);let X=await gw(v),q={...X.dependencies,...X.devDependencies},G=X;G=fw(G,J),G=mw(G,Y),await Bun.write(G4(v,"package.json"),`${JSON.stringify(G,null,2)}
161
+ `);let j={...G.dependencies,...G.devDependencies},H=pG(q,j);if(!Q.isFlattened)await hw(v);return{changed:H.changed,packageDir:v,delta:H.entries}}var Cw;var VY=b(()=>{k0();g_();l2();Z4();D1();CG();X4();o4();hJ();rG();w1();z$();c$();i$();iJ();X1();p6();G8();T0();a4();e4();KK();Cw={name:"opencode-plugins",private:!0,type:"module"}});import{join as lw,posix as dw}from"path";function pw($){if($.length===0)return"Unknown parse error";let _=$[0];if(!_)return"Unknown parse error";return`${S6(_.error)} at offset ${_.offset}`}async function DK($){let _=Bun.file(`${$}/registry.jsonc`),U=Bun.file(`${$}/registry.json`),Q=await _.exists(),v=await U.exists();if(!Q&&!v)return{success:!1,error:"No registry.jsonc or registry.json found in source directory",errorKind:"not_found"};let J=Q?_:U,Y=Q?"registry.jsonc":"registry.json",z=await J.text(),I=[],X=x$(z,I,{allowTrailingComma:!0});if(I.length>0){let q=pw(I);return{success:!1,error:`Invalid JSONC in ${Y}: ${q}`,errorKind:"parse_error"}}return{success:!0,data:X}}function MK($,_){let U=Z0($);if(U)return{valid:!1,errors:[`Schema compatibility issue: ${U.issue} - ${U.remediation}`]};return iw($,_)}function iw($,_){let U=j1.safeParse($);if(!U.success)return{valid:!1,errors:U.error.issues.map((v)=>`${v.path.join(".")}: ${v.message}`)};return{valid:!0,errors:[],data:U.data}}async function nw($,_){let U=[];for(let Q of $.components)for(let v of Q.files){let J=g6(v,Q.type),Y=lw(_,"files",J.path);if(!await Bun.file(Y).exists())U.push(`${Q.name}: Source file not found at ${J.path}`)}return{valid:U.length===0,errors:U}}function rw($){let _=[],U=new Map($.components.map((J)=>[J.name,J]));function Q(J,Y,z,I){if(Y.has(J))return[...I,J].join(" -> ");if(z.has(J))return null;let X=U.get(J);if(!X)return null;Y.add(J),I.push(J);for(let q of X.dependencies){if(q.includes("/"))continue;let G=Q(q,Y,z,I);if(G)return G}return Y.delete(J),z.add(J),I.pop(),null}let v=new Set;for(let J of $.components){if(v.has(J.name))continue;let Y=Q(J.name,new Set,v,[]);if(Y){_.push(`Circular dependency detected: ${Y}`);break}}return{valid:_.length===0,errors:_}}function ow($){let _=[],U=new Map,Q=(v)=>{let Y=v.normalize("NFC").replace(/\\/g,"/");return dw.normalize(Y).replace(/^\.\//,"")};for(let v of $.components)for(let J of v.files){let Y=g6(J,v.type),z=Q(Y.target),I=U.get(z);if(I)_.push(`Duplicate target "${z}" in components "${I.componentName}" and "${v.name}"`);else U.set(z,{componentName:v.name})}return{valid:_.length===0,errors:_}}async function*wK($,_,U={}){let Q=await nw($,_);for(let J of Q.errors)yield J;let v=rw($);for(let J of v.errors)yield J;if(!U.skipDuplicateTargets){let J=ow($);for(let Y of J.errors)yield Y}}var LK=b(()=>{c4();o4()});async function F8($,_={}){let U=await DK($);if(!U.success)return{success:!1,errors:[U.error||"Failed to load registry"],failureType:"load",loadErrorKind:U.errorKind};let Q=MK(U.data,$);if(!Q.valid)return{success:!1,errors:Q.errors,failureType:"schema"};let v=Q.data;if(!v)throw Error("Registry validation succeeded but returned no parsed data");let J=[];for await(let Y of wK(v,$,_))J.push(Y);if(J.length>0)return{success:!1,errors:J,failureType:"rules"};return{success:!0,errors:[],registry:v}}var DY=b(()=>{LK()});function MY($){return{file:$.filter((_)=>_.includes("Source file not found")),circular:$.filter((_)=>_.includes("Circular dependency")),duplicate:$.filter((_)=>_.includes("Duplicate target"))}}function a_($,_={}){let U=MY($),Q=_.schemaErrors??0,v=$.length,J=Math.max(0,v-Q-U.file.length-U.circular.length-U.duplicate.length);return{valid:v===0,totalErrors:v,schemaErrors:Q,sourceFileErrors:U.file.length,circularDependencyErrors:U.circular.length,duplicateTargetErrors:U.duplicate.length,otherErrors:J}}import{relative as tw,resolve as kK}from"path";function aw($,_){if(_==="not_found")return new B$($);if(_==="parse_error")return new b$($,"CONFIG_ERROR",K$.CONFIG);return new b$($,"CONFIG_ERROR",K$.CONFIG)}function sw($,_){let U=a_($,{schemaErrors:_==="schema"?$.length:0}),Q={valid:!1,errors:$,summary:{valid:!1,totalErrors:U.totalErrors,schemaErrors:U.schemaErrors,sourceFileErrors:U.sourceFileErrors,circularDependencyErrors:U.circularDependencyErrors,duplicateTargetErrors:U.duplicateTargetErrors,otherErrors:U.otherErrors}};return new z1(Q)}function ew($,_){if(_==="schema"){W.error("\u2717 Registry schema");for(let Q of $)console.log(g.red(` ${Q}`));return}let U=MY($);if(U.file.length>0){W.error("\u2717 Source files");for(let Q of U.file)console.log(g.red(` ${Q}`))}if(U.circular.length>0){W.error("\u2717 Circular dependencies");for(let Q of U.circular)console.log(g.red(` ${Q}`))}if(U.duplicate.length>0){W.error("\u2717 Duplicate targets");for(let Q of U.duplicate)console.log(g.red(` ${Q}`))}}function AK($){$.command("build").description("Build a registry from source (for registry authors)").argument("[path]","Registry source directory",".").option("--out <dir>","Output directory","./dist").option("--cwd <path>","Working directory",process.cwd()).option("--json","Output as JSON",!1).option("-q, --quiet","Suppress output",!1).option("--dry-run","Validate and show what would be built").option("--show-validation","Display validation results before building",!1).action(async(_,U)=>{try{let Q=kK(U.cwd,_),v=kK(U.cwd,U.out);if(U.showValidation){let I=!U.json&&!U.quiet;if(I)W.info("Running validation checks...");let X=await F8(Q,{skipDuplicateTargets:!1});if(!X.success){let[q="Registry validation failed"]=X.errors;if(X.failureType==="load")throw aw(q,X.loadErrorKind);let G=X.failureType==="schema"?"schema":"rules",j=sw(X.errors,G);if(U.json)throw j;if(!U.quiet)ew(X.errors,G);process.exit(j.exitCode)}if(I)W.success("\u2713 Schema compatibility and structure"),W.success("\u2713 Source files"),W.success("\u2713 No circular dependencies"),W.success("\u2713 No duplicate targets"),console.log("")}let J=V$({text:"Building registry...",quiet:U.quiet||U.json});if(!U.json)J.start();let Y=await u_({source:Q,out:v,dryRun:U.dryRun});if("dryRun"in Y&&Y.dryRun){if(!U.json)J.stop();S4(Y,{json:U.json,quiet:U.quiet});return}let z=Y;if(!U.json){let I=`Built ${z.componentsCount} components to ${tw(U.cwd,v)}`;if(J.succeed(I),!process.stdout.isTTY)W.success(`Built ${z.componentsCount} components`)}if(U.json)O$({success:!0,data:{components:z.componentsCount,output:z.outputPath}})}catch(Q){if(Q instanceof z6){if(U.json)_$(Q,{json:!0});if(!U.quiet){W.error(Q.message);for(let v of Q.errors)console.log(g.red(` ${v}`))}process.exit(1)}_$(Q,{json:U.json})}})}var FK=b(()=>{k6();p2();DY();w1();z$();c$();i$();e4()});import{existsSync as OK}from"fs";import{mkdir as $L}from"fs/promises";import{join as wY}from"path";function NK($){$.command("edit").description("Open configuration file in editor").option("-g, --global","Edit global ocx.jsonc").option("-p, --profile <name>","Edit specific profile's config").action(async(_)=>{try{await _L(_)}catch(U){_$(U)}})}async function _L($){if($.global&&$.profile)throw new M("Cannot use both --global and --profile flags");let _;if($.profile){let J=I6.safeParse($.profile);if(!J.success)throw new M(`Invalid profile name "${$.profile}": ${J.error.issues[0]?.message??"Invalid name"}`);if(await h$.requireInitialized(),!await h$.create().exists($.profile))throw new m$($.profile);_=B4($.profile)}else if($.global){if(_=F0(),!OK(_))throw new n(`Global config not found at ${_}.
162
+ Run 'ocx init --global' first.`)}else{let J=b1(process.cwd());if(J)_=wY(J,t4);else{let Y=wY(process.cwd(),H1);if(await $L(Y,{recursive:!0}),_=wY(Y,t4),!OK(_)){let z={$schema:"https://ocx.kdco.dev/schemas/ocx.json",registries:{}};await Bun.write(_,JSON.stringify(z,null,2)),W.info(`Created ${_}`)}}}let U=process.env.EDITOR||process.env.VISUAL||"vi",v=await Bun.spawn([U,_],{stdin:"inherit",stdout:"inherit",stderr:"inherit"}).exited;if(v!==0)throw Error(`Editor exited with code ${v}`)}var SK=b(()=>{X6();Z4();_8();z$();c$();i$()});function TK($){$.command("show").description("Display resolved configuration for current directory").addOption(f4.json()).option("--origin","Show where each setting came from").option("-p, --profile <name>","Use specific profile").action(async(_)=>{try{await vL(_)}catch(U){_$(U,{json:_.json})}})}async function vL($){let _=await q6.create(process.cwd(),{profile:$.profile});if($.origin){let Q=_.resolveWithOrigin();if($.json){let J={};for(let[Y,z]of Q.origins)J[Y]=z;console.log(JSON.stringify({...Q,origins:J},null,2));return}if(console.log(g.bold("Resolved Configuration")),console.log(),Q.profileName){let J=Q.origins.get("profileName");if(console.log(`${g.cyan("Profile:")} ${Q.profileName}`),J)console.log(` ${g.dim(`\u2190 ${J.source}`)}`)}console.log(),console.log(g.cyan("Component Path:"),Q.componentPath);let v=Q.origins.get("componentPath");if(v)console.log(` ${g.dim(`\u2190 ${v.source} (${v.path})`)}`);console.log(),console.log(g.cyan("Registries:"));for(let[J,Y]of Object.entries(Q.registries)){console.log(` ${g.green(J)}: ${Y.url}`);let z=Q.origins.get(`registries.${J}`);if(z)console.log(` ${g.dim(`\u2190 ${z.source} (${z.path})`)}`)}if(Q.instructions.length>0){console.log(),console.log(g.cyan("Instructions:"));for(let J of Q.instructions)console.log(` ${J}`)}if(Object.keys(Q.opencode).length>0){console.log(),console.log(g.cyan("OpenCode Config:"));for(let J of Object.keys(Q.opencode)){let Y=Q.origins.get(`opencode.${J}`);if(console.log(` ${J}:`,JSON.stringify(Q.opencode[J])),Y)console.log(` ${g.dim(`\u2190 ${Y.source} (${Y.path})`)}`)}}return}let U=_.resolve();if($.json){console.log(JSON.stringify(U,null,2));return}if(console.log(g.bold("Resolved Configuration")),console.log(),U.profileName)console.log(`${g.cyan("Profile:")} ${U.profileName}`);if(console.log(`${g.cyan("Component Path:")} ${U.componentPath}`),console.log(),console.log(g.cyan("Registries:")),Object.keys(U.registries).length===0)console.log(" (none)");else for(let[Q,v]of Object.entries(U.registries))console.log(` ${g.green(Q)}: ${v.url}`);if(U.instructions.length>0){console.log(),console.log(g.cyan("Instructions:"));for(let Q of U.instructions)console.log(` ${Q}`)}}var RK=b(()=>{k6();g_();c$();a4()});function EK($){let _=$.command("config").description("View and edit configuration");TK(_),NK(_)}var PK=b(()=>{SK();RK()});import{existsSync as O1}from"fs";import{cp as UL,mkdir as y0,readdir as xK,readFile as QL,rm as JL,writeFile as LY}from"fs/promises";import{dirname as uK,join as O8}from"path";function yK($){let _=$.command("init").description("Initialize OCX configuration in your project");Q4(_),m4(_),G6(_),_.option("--registry <path>","Scaffold a new OCX registry project at path").option("--namespace <name>","Registry namespace (e.g., my-org)").option("--author <name>","Author name for the registry").option("--canary","Use canary (main branch) instead of latest release").option("--local <path>","Use local template directory instead of fetching").action(async(U)=>{try{if(U.registry)await qL(U.registry,U);else if(U.global)await XL(U);else await IL(U)}catch(Q){_$(Q,{json:U.json})}})}async function IL($){let _=$.cwd??process.cwd(),{path:U,exists:Q}=d6(_);if(Q)throw new t$(`ocx.jsonc already exists at ${U}
121
163
 
122
164
  To reset, delete the config and run init again:
123
- rm ${B} && ocx init`);let _=D.quiet?null:jD({text:"Initializing OCX..."});_?.start();try{let Q={$schema:X1,registries:{}},Y=R2.parse(Q);await rF(iB(B),{recursive:!0});let q=JSON.stringify(Y,null,2);await b6(B,q,"utf-8");let H=await $4(F);if(_?.succeed("Initialized OCX configuration"),D.json)console.log(JSON.stringify({success:!0,path:B,opencodePath:H.path,opencodeCreated:H.created}));else if(!D.quiet){if(G.info(`Created ${B}`),H.created)G.info(`Created ${H.path}`);G.info(""),G.info("Next steps:"),G.info(" 1. Add a registry: ocx registry add <url>"),G.info(" 2. Install components: ocx add <component>")}}catch(Q){throw _?.fail("Failed to initialize"),Q}}async function UJ(D){let F=D.quiet?null:jD({text:"Initializing global profiles..."});F?.start();try{let B=[],$=[],_=I2();if(YF(_))$.push("globalConfig");else await rF(iB(_),{recursive:!0,mode:448}),await dF(_,{$schema:X1,registries:{}}),B.push("globalConfig");let Q=X2();if(!YF(Q))await rF(Q,{recursive:!0,mode:448});let Y=yD("default");if(!YF(Y))await rF(Y,{recursive:!0,mode:448});let q=Q0("default");if(YF(q))$.push("profileOcx");else await dF(q,N9),B.push("profileOcx");let H=G2("default");if(YF(H))$.push("profileOpencode");else await dF(H,{}),B.push("profileOpencode");let J=a2("default");if(YF(J))$.push("profileAgents");else await Bun.write(J,`# Profile Instructions
165
+ rm ${U} && ocx init`);let v=$.quiet?null:V$({text:"Initializing OCX..."});v?.start();try{let J={$schema:YJ,registries:{}},Y=h6.parse(J);await y0(uK(U),{recursive:!0});let z=JSON.stringify(Y,null,2);await LY(U,z,"utf-8");let I=await mG(_);if(v?.succeed("Initialized OCX configuration"),$.json)console.log(JSON.stringify({success:!0,path:U,opencodePath:I.path,opencodeCreated:I.created}));else if(!$.quiet){if(W.info(`Created ${U}`),I.created)W.info(`Created ${I.path}`);W.info(""),W.info("Next steps:"),W.info(" 1. Add a registry: ocx registry add <url>"),W.info(" 2. Install components: ocx add <component>")}}catch(J){throw v?.fail("Failed to initialize"),J}}async function XL($){let _=$.quiet?null:V$({text:"Initializing global profiles..."});_?.start();try{let U=[],Q=[],v=F0();if(O1(v))Q.push("globalConfig");else await y0(uK(v),{recursive:!0,mode:448}),await A0(v,{$schema:YJ,registries:{}}),U.push("globalConfig");let J=w6();if(!O1(J))await y0(J,{recursive:!0,mode:448});let Y=p$("default");if(!O1(Y))await y0(Y,{recursive:!0,mode:448});let z=B4("default");if(O1(z))Q.push("profileOcx");else await A0(z,qG),U.push("profileOcx");let I=L6("default");if(O1(I))Q.push("profileOpencode");else await A0(I,{}),U.push("profileOpencode");let X=W1("default");if(O1(X))Q.push("profileAgents");else await Bun.write(X,`# Profile Instructions
124
166
 
125
167
  <!-- Add your custom instructions for this profile here -->
126
168
  <!-- These will be included when running \`ocx opencode -p default\` -->
127
- `,{mode:384}),B.push("profileAgents");if(F?.succeed("Initialized global profiles"),D.json)console.log(JSON.stringify({success:!0,files:{globalConfig:_,profileOcx:q,profileOpencode:H,profileAgents:J},created:B,existed:$}));else if(!D.quiet)if(B.length>0){for(let X of B){if(X==="globalConfig")G.info(`Created global config: ${_}`);if(X==="profileOcx")G.info(`Created profile config: ${q}`);if(X==="profileOpencode")G.info(`Created profile opencode config: ${H}`);if(X==="profileAgents")G.info(`Created profile instructions: ${J}`)}G.info(""),G.info("Next steps:"),G.info(" 1. Edit your profile config: ocx config edit -p default"),G.info(" 2. Add registries: ocx registry add <url> --name <name> --global"),G.info(" 3. Launch OpenCode: ocx opencode"),G.info(" 4. Create more profiles: ocx profile add <name> --global")}else G.info("Global profiles already initialized (all files exist)")}catch(B){throw F?.fail("Failed to initialize"),B}}async function VJ(D,F){let B=D,$=F.namespace??"my-registry",_=F.author??"Your Name";if(!/^[a-z0-9]+(-[a-z0-9]+)*$/.test($))throw new U("Invalid namespace format: must start with letter/number, use hyphens only between segments (e.g., 'my-registry')");if((await pB(B).catch(()=>[])).some((H)=>!H.startsWith(".")))throw new gD("Directory is not empty. Remove existing files or choose a different directory.");let q=F.quiet?null:jD({text:"Scaffolding registry..."});q?.start();try{if(q)q.text=F.local?"Copying template...":"Fetching template...";if(F.local)await rF(B,{recursive:!0}),await sB(F.local,B);else{let H=F.canary?"main":EJ();await wJ(B,H,F.verbose)}if(q)q.text="Configuring project...";if(await bJ(B,{namespace:$,author:_}),q?.succeed(`Created registry: ${$}`),F.json)console.log(JSON.stringify({success:!0,namespace:$,path:B}));else if(!F.quiet)G.info(""),G.info("Next steps:"),G.info(" 1. bun install"),G.info(" 2. Edit registry.jsonc with your components"),G.info(" 3. bun run build"),G.info(""),G.info("Deploy to:"),G.info(" Cloudflare: bunx wrangler deploy"),G.info(" Vercel: vercel"),G.info(" Netlify: netlify deploy")}catch(H){throw q?.fail("Failed to scaffold registry"),H}}async function sB(D,F){await WJ(D,F,{recursive:!0})}function EJ(){return"v2.0.3"}function LJ(D){let F=D==="main"?"heads/main":`tags/${D}`;return`https://github.com/${AJ}/archive/refs/${F}.tar.gz`}async function wJ(D,F,B){let $=LJ(F);if(B)G.info(`Fetching ${$}`);let _=await fetch($);if(!_.ok||!_.body)throw new RD(`Failed to fetch template from ${$}: ${_.statusText}`);let Q=S8(D,".ocx-temp");await rF(Q,{recursive:!0});try{let Y=S8(Q,"template.tar.gz"),q=await _.arrayBuffer();await b6(Y,Buffer.from(q));let H=Bun.spawn(["tar","-xzf",Y,"-C",Q],{stdout:"ignore",stderr:"pipe"});if(await H.exited!==0){let A=await new Response(H.stderr).text();throw Error(`Failed to extract template: ${A}`)}let z=(await pB(Q)).find((A)=>A.startsWith("ocx-"));if(!z)throw Error("Failed to find extracted template directory");let M=S8(Q,z,jJ);await sB(M,D)}finally{await MJ(Q,{recursive:!0,force:!0})}}function OJ(D){return D.split(/[-_\s]+/).map((F)=>F.charAt(0).toUpperCase()+F.slice(1).toLowerCase()).join(" ")}async function bJ(D,F){let B=["registry.jsonc","package.json","wrangler.jsonc","README.md","AGENTS.md"];for(let $ of B){let _=S8(D,$);if(!YF(_))continue;let Q=await zJ(_).then((Y)=>Y.toString());if(Q=Q.replace(/my-registry/g,F.namespace),Q=Q.replace(/My Registry/g,OJ(F.namespace)),Q=Q.replace(/Your Name/g,F.author),$==="registry.jsonc")if(/"\$schema"\s*:/.test(Q))Q=Q.replace(/("\$schema"\s*:\s*")[^"]*(")/,`$1${T0}$2`);else Q=Q.replace(/{/,`{
128
- "$schema": "${T0}",`);await b6(_,Q)}}var AJ="kdcokenny/ocx",jJ="examples/registry-starter";var aB=V(()=>{s3();_8();a0();G0();tD();l1();$D();PD();fD();x0();m0()});function RJ(D,F,B){let $=D.indexOf("/");if($===-1)throw Error(`Invalid legacy key: "${D}". Expected format: alias/component`);let _=D.slice(0,$),Q=D.slice($+1);if(!_||!Q)throw Error(`Invalid legacy key: "${D}". Both alias and component are required.`);let Y=E3(B,_,Q,F.version),q={registryUrl:B,registryName:_,name:Q,revision:F.version,hash:F.hash,files:F.files.map((H)=>({path:H,hash:""})),installedAt:F.installedAt,...F.updatedAt&&{updatedAt:F.updatedAt},owner:{type:"user"}};return[Y,q]}function k8(D,F,B){let $={},_=[],Q=Object.keys(D.installed).sort();for(let q of Q){let H=D.installed[q];if(!H)continue;let J=F.registries[H.registry];if(!J)throw new c(`Registry "${H.registry}" referenced in lock key "${q}" is not configured in ocx.jsonc. Add it before migrating.`);let[X,z]=RJ(q,H,J.url);$[X]=z,_.push({legacyKey:q,canonicalId:X,name:z.name,registryName:z.registryName})}return{receipt:{version:1,...B&&{root:B},installed:$},components:_}}function oB(D){let F=D.registries;if(!F||typeof F!=="object"||Array.isArray(F))return[];let B=[],$=F;for(let _ of Object.keys($).sort()){let Q=$[_];if(!Q||typeof Q!=="object"||Array.isArray(Q))continue;let Y=Q;for(let q of ZJ)if(q in Y)B.push({registry:_,field:q,action:"remove_deprecated"})}return B}var ZJ;var rB=V(()=>{tD();$D();ZJ=["version"]});import{existsSync as R6,readdirSync as NJ,readFileSync as F5,statSync as SJ}from"fs";import{rename as I8,writeFile as kJ}from"fs/promises";import{join as tB}from"path";function B5(D){D.command("migrate").description("Migrate legacy ocx.lock to receipt format (.ocx/receipt.jsonc)").option("--global","Migrate global config scope (includes profiles)").option("--apply","Apply migration (default is dry-run preview)").option("--json","Output as JSON").option("-q, --quiet","Suppress output").option("--cwd <path>","Working directory").action(async(F)=>{try{await TJ(F)}catch(B){t(B,{json:F.json})}})}async function TJ(D){if(D.global){await vJ(D);return}await lJ(D,"local",sJ(D),!1)}async function vJ(D){let F=D.cwd??X0(),B=CJ(F);if(!D.apply){let Y=[],q=new Set;for(let{label:X,path:z}of B){let M=N2(z),A=yF(z,{isFlattened:!0});if(M.exists&&A.exists)q.add(X);try{let K=await uJ(z,!0,{emitWarnings:!D.json&&!D.quiet});Y.push({...K,target:X})}catch(K){let j=D5(X,K);if(Y.push(j),!D.json&&!D.quiet)G.error(`[global:${X}] Preview failed: ${j.error}`)}}let H=eB(Y,"global",!1),J=xJ(H);if(D.json){if(tF(H,!1),J)process.exit(1);return}if(!D.quiet)pJ(Y,H,q);if(J)process.exit(1);return}let $=[],_=!1;for(let{label:Y,path:q}of B)try{let H=await PJ(q,!0);$.push({...H,target:Y})}catch(H){_=!0;let J=D5(Y,H);if($.push(J),!D.json&&!D.quiet)G.error(`[global:${Y}] Migration failed: ${J.error}`)}let Q=eB($,"global",!0);if(D.json){if(tF(Q,!0),_)process.exit(1);return}if(!D.quiet)iJ($,_);if(_)process.exit(1)}function CJ(D){let F=[];F.push({label:"root",path:D});let B=tB(D,"profiles");if(R6(B)&&SJ(B).isDirectory()){let _=NJ(B,{withFileTypes:!0}).filter((Q)=>Q.isDirectory()&&!Q.name.startsWith(".")).map((Q)=>Q.name).sort();for(let Q of _)F.push({label:`profile:${Q}`,path:tB(B,Q)})}return F}async function uJ(D,F,B){let $=B?.emitWarnings??!0,_=Z6(D),Q=N2(D),Y=yF(D,{isFlattened:F}),q=Q.exists&&Y.exists;if(Q.exists&&_.length===0&&!q)return{status:"already_v2",count:0,components:[],configActions:[]};if(!Y.exists&&!Q.exists&&_.length===0)return{status:"nothing_to_migrate",count:0,components:[],configActions:[]};let H=[];if(Y.exists&&!Q.exists)try{let J=await L3(D,{isFlattened:F}),X=await U0(D,{emitParseDiagnostics:$});if(J&&X)H=k8(J,X,D).components}catch{if($)G.warn(`[preview] Could not parse lock/config at "${D}"; component count may be incomplete.`)}return{status:"preview",count:H.length,components:H,configActions:_}}async function PJ(D,F){let B=Z6(D),$=N2(D),_=yF(D,{isFlattened:F}),Q=$.exists&&_.exists;if($.exists&&B.length===0&&!Q)return{status:"already_v2",count:0,components:[],configActions:[]};if(!_.exists&&!$.exists&&B.length===0)return{status:"nothing_to_migrate",count:0,components:[],configActions:[]};let Y=null;if(_.exists&&!$.exists){let X=await L3(D,{isFlattened:F});if(!X)throw new U("Failed to parse ocx.lock. The lock file exists but could not be read or contains invalid data.");let z=await U0(D);if(!z)throw new c("No ocx.jsonc found. The config is required to resolve registry URLs during migration.");let{receipt:M,components:A}=k8(X,z,D);Y={newReceipt:M,components:A}}let q=Y?.components??[],H=q.length;if(Y){await K0(D,Y.newReceipt);let X=T8(_.path);await I8(_.path,X)}if(Q){let X=T8(_.path);await I8(_.path,X)}if(B.length>0)await $5(D,B);return{status:Y!==null||Q||B.length>0?"migrated":"already_v2",count:H,components:q,configActions:B}}function eB(D,F,B){let $=D.some((X)=>X.status==="error"),_=D.some((X)=>X.status==="migrated"||X.status==="preview"),Q=D.every((X)=>X.status==="already_v2"||X.status==="nothing_to_migrate"),Y=D.reduce((X,z)=>X+z.count,0),q=D.flatMap((X)=>X.components),H=D.flatMap((X)=>X.configActions),J;if($)J=B?"partial_failure":"preview_with_errors";else if(Q)J=D.every((z)=>z.status==="nothing_to_migrate")?"nothing_to_migrate":"already_v2";else if(B)J=_?"migrated":"already_v2";else J=_?"preview":"already_v2";return{success:!$,status:J,scope:F,count:Y,components:q,configActions:H,targets:D}}function xJ(D){return D.status==="preview_with_errors"}function tF(D,F){let B=yJ(D,F);console.log(JSON.stringify(B,null,2))}function yJ(D,F){let B=fJ(D),$=B.flatMap((_)=>_.blockers??[]);return{...D,lifecycle_status:gJ(D.status,F),schema_version:IJ,blockers:$,targets:B}}function fJ(D){return(D.targets&&D.targets.length>0?D.targets:[hJ(D)]).map((B)=>mJ(B))}function hJ(D){return{target:D.scope,status:D.status,count:D.count,components:D.components,configActions:D.configActions,blockers:D.blockers??[]}}function mJ(D){let F=D.blockers??(D.status==="error"?[{code:"MIGRATE_BLOCKER",message:D.error??"Migration blocked",path:D.target}]:[]);return{...D,scope:D.scope??D.target,result:D.result??D.status,blockers:F}}function gJ(D,F){if(F)return D==="partial_failure"?"apply_failed":"apply_ok";return D==="preview_with_errors"?"preview_blocked":"preview_ok"}function D5(D,F){let B=dJ(F,D);return{target:D,status:"error",count:0,components:[],configActions:[],error:B.message,blockers:[B]}}function dJ(D,F){let B=D instanceof Error?D.message:String(D);return{code:cJ(D,B),message:B,path:F}}function cJ(D,F){if(typeof D==="object"&&D!==null&&"code"in D){let $=D.code;if(typeof $==="string"&&$.length>0)return $}let B=F.toLowerCase();if(B.includes("ocx.jsonc")||B.includes("registry"))return"CONFIG_ERROR";if(B.includes("parse")||B.includes("invalid"))return"VALIDATION_ERROR";return"MIGRATE_BLOCKER"}async function lJ(D,F,B,$){let _=Z6(B),Q=N2(B),Y=yF(B,{isFlattened:$}),q=Q.exists&&Y.exists;if(Q.exists&&_.length===0&&!q){let A={success:!0,status:"already_v2",scope:F,count:0,components:[],configActions:[]};if(D.json){tF(A,Boolean(D.apply));return}if(!D.quiet)G.success(`[${F}] Already migrated to receipt format (.ocx/receipt.jsonc).`);return}if(!Y.exists&&!Q.exists&&_.length===0){let A={success:!0,status:"nothing_to_migrate",scope:F,count:0,components:[],configActions:[]};if(D.json){tF(A,Boolean(D.apply));return}if(!D.quiet)G.info(`[${F}] Nothing to migrate. No legacy ocx.lock found.`);return}let H=null;if(Y.exists&&!Q.exists){let A=await L3(B,{isFlattened:$});if(!A)throw new U("Failed to parse ocx.lock. The lock file exists but could not be read or contains invalid data.");let K=await U0(B);if(!K)throw new c("No ocx.jsonc found. The config is required to resolve registry URLs during migration.");let{receipt:j,components:S}=k8(A,K,B);H={newReceipt:j,components:S}}let J=H?.components??[],X=J.length;if(!D.apply){let A={success:!0,status:"preview",scope:F,count:X,components:J,configActions:_};if(D.json){tF(A,!1);return}if(!D.quiet){if(X>0){G.info(`[${F}] Migration preview: ${X} component(s) would be migrated.`),G.break();for(let K of J)G.info(` ${K.legacyKey} \u2192 ${K.canonicalId}`);G.break()}if(q)G.info(`[${F}] Legacy ocx.lock would be backed up and removed (receipt already exists).`),G.break();if(_.length>0){G.info(`[${F}] Config normalization: ${_.length} deprecated field(s) would be removed.`);for(let K of _)G.info(` registries.${K.registry}.${K.field} \u2192 remove`);G.break()}if(X===0&&_.length===0&&!q)G.info(`[${F}] Nothing to migrate.`);else G.info("No changes made. Run with --apply to perform migration.")}return}if(H){await K0(B,H.newReceipt);let A=T8(Y.path);if(await I8(Y.path,A),!D.json&&!D.quiet){G.success(`[${F}] Migrated ${X} component(s) to receipt format (.ocx/receipt.jsonc).`),G.break();for(let K of J)G.success(` \u2713 ${K.legacyKey} \u2192 ${K.canonicalId}`);G.break(),G.info(`Legacy lock backed up to: ${A}`)}}if(q){let A=T8(Y.path);if(await I8(Y.path,A),!D.json&&!D.quiet)G.success(`[${F}] Removed stale legacy lock (receipt already exists).`),G.info(`Legacy lock backed up to: ${A}`)}if(_.length>0){if(await $5(B,_),!D.json&&!D.quiet){if(H)G.break();G.success(`[${F}] Normalized ${_.length} deprecated config field(s).`);for(let A of _)G.success(` \u2713 registries.${A.registry}.${A.field} removed`)}}let M={success:!0,status:H!==null||q||_.length>0?"migrated":"already_v2",scope:F,count:X,components:J,configActions:_};if(D.json){tF(M,!0);return}if(!H&&_.length>0&&!D.quiet)G.break(),G.success(`[${F}] Config normalization complete.`)}function pJ(D,F,B){if(F.status==="nothing_to_migrate"){G.info("[global] Nothing to migrate across all targets.");return}if(F.status==="already_v2"){G.success("[global] All targets already migrated.");return}G.info(`[global] Migration preview across ${D.length} target(s):`),G.break();for(let $ of D){let _=B.has($.target),Q=nJ($,_);G.info(` ${$.target}: ${Q}`)}if(G.break(),F.status==="preview_with_errors")G.warn("[global] Preview completed with errors on some targets. See above for details."),G.info("No changes made. Run with --apply to perform migration.");else G.info("No changes made. Run with --apply to perform migration.")}function iJ(D,F){G.break();let B=D.filter((Q)=>Q.status==="migrated"),$=D.filter((Q)=>Q.status==="already_v2"||Q.status==="nothing_to_migrate"),_=D.filter((Q)=>Q.status==="error");if(B.length>0){G.success(`[global] Migrated ${B.length} target(s):`);for(let Q of B)G.success(` \u2713 ${Q.target}`)}if($.length>0)G.info(`[global] ${$.length} target(s) already up to date.`);if(_.length>0){G.error(`[global] ${_.length} target(s) failed:`);for(let Q of _)G.error(` \u2717 ${Q.target}: ${Q.error}`)}if(F)G.break(),G.error("[global] Migration completed with errors. See above for details.")}function nJ(D,F){if(D.status==="error")return"error";if(D.status==="already_v2")return"already migrated";if(D.status==="nothing_to_migrate")return"nothing to migrate";let B=[];if(D.count>0)B.push(`${D.count} component(s) to migrate`);if(D.configActions.length>0)B.push(`${D.configActions.length} config field(s) to normalize`);if(F)B.push("legacy lock cleanup pending");if(B.length===0)return"nothing to migrate";return B.join(", ")}function sJ(D){if(D.global)return D.cwd??X0();return D.cwd??process.cwd()}function T8(D){let F=`${D}.bak`;if(!R6(F))return F;for(let B=1;B<=100;B++){let $=`${F}.${B}`;if(!R6($))return $}return`${F}.${Date.now()}`}function Z6(D){let F=S2(D);if(!F.exists)return[];try{let B=F5(F.path,"utf-8"),$=ND(B,[],{allowTrailingComma:!0});if(!$||typeof $!=="object"||Array.isArray($))return[];return oB($)}catch{return[]}}async function $5(D,F){if(F.length===0)return;let B=S2(D);if(!B.exists)return;let $=F5(B.path,"utf-8");for(let _ of F){let Q=AF($,["registries",_.registry,_.field],void 0,aJ);$=jF($,Q)}await kJ(B.path,$)}var IJ=1,aJ;var _5=V(()=>{b0();tD();$D();PD();fD();k2();rB();aJ={formattingOptions:{tabSize:2,insertSpaces:!0,eol:`
129
- `}}});import{basename as oJ,resolve as TV}from"path";function v8(){let{GIT_DIR:D,GIT_WORK_TREE:F,...B}=process.env;return B}async function rJ(D){let F=Bun.spawn(["git","symbolic-ref","--short","HEAD"],{cwd:D,env:v8(),stdout:"pipe",stderr:"pipe"});if(await F.exited===0){let H=(await new Response(F.stdout).text()).trim();if(H)return H}let $=Bun.spawn(["git","describe","--tags","--exact-match","HEAD"],{cwd:D,env:v8(),stdout:"pipe",stderr:"pipe"});if(await $.exited===0){let H=(await new Response($.stdout).text()).trim();if(H)return H}let Q=Bun.spawn(["git","rev-parse","--short","HEAD"],{cwd:D,env:v8(),stdout:"pipe",stderr:"pipe"});if(await Q.exited===0){let H=(await new Response(Q.stdout).text()).trim();if(H)return H}return null}async function tJ(D){let F=Bun.spawn(["git","rev-parse","--show-toplevel"],{cwd:D,env:v8(),stdout:"pipe",stderr:"pipe"});if(await F.exited!==0)return null;let _=(await new Response(F.stdout).text()).trim();if(!_)return null;return oJ(_)}async function Q5(D){let[F,B]=await Promise.all([tJ(D),rJ(D)]);return{repoName:F,branch:B}}var Y5=()=>{};import eJ from"path";function H5(){return Boolean(process.env.TMUX)}function DX(D){if(!H5())return;Bun.spawnSync(["tmux","rename-window",D]),Bun.spawnSync(["tmux","set-window-option","automatic-rename","off"])}function FX(D){if(!FF)return;process.stdout.write(`\x1B]0;${D}\x07`)}function J5(D){DX(D),FX(D)}function X5(){if(C8||!FF)return;process.stdout.write("\x1B[22;2t"),C8=!0}function N6(){if(!C8)return;if(H5())Bun.spawnSync(["tmux","set-window-option","automatic-rename","on"]);if(FF)process.stdout.write("\x1B[23;2t");C8=!1}function G5(D,F,B){let $=B.repoName??eJ.basename(D);if(!B.branch)return`ocx[${F}]:${$}`;let _=B.branch.length>q5?`${B.branch.slice(0,q5-3)}...`:B.branch;return`ocx[${F}]:${$}/${_}`}var q5=20,C8=!1;var W5=V(()=>{Z3()});import{randomUUID as BX}from"crypto";import{copyFile as $X,cp as _X,lstat as C2,mkdir as QX,mkdtemp as YX,readdir as A5,readFile as qX,realpath as D3,rename as HX,rm as JX,unlink as XX}from"fs/promises";import{tmpdir as GX}from"os";import{basename as WX,dirname as I6,isAbsolute as j5,join as z2,relative as T6}from"path";var{Glob:S6}=globalThis.Bun;function a(D,F){return new c(`ocx oc ${D} error: ${F}`)}function TD(D){if(D instanceof Error)return D.message;return String(D)}function jX(D){if(D.length===0)return"Unknown parse error";let F=D[0];if(!F)return"Unknown parse error";return`${K2(F.error)} at offset ${F.offset}`}function P8(D){return D.replaceAll("\\","/")}function k6(D){return D.startsWith("./")?D.slice(2):D}function v6(D,F){let B=T6(D,F);if(B.length===0)return!0;return!B.startsWith("..")&&!j5(B)}function KX(D){if(D.isFile())return"file";if(D.isDirectory())return"directory";if(D.isSymbolicLink())return"symlink";return"other"}function u3(D){return{entryType:KX(D),device:String(D.dev),inode:String(D.ino),mode:String(D.mode),size:String(D.size),mtimeMs:String(D.mtimeMs)}}function UX(D,F){return D.entryType===F.entryType&&D.device===F.device&&D.inode===F.inode&&D.mode===F.mode}function VX(D,F){return D.size===F.size&&D.mtimeMs===F.mtimeMs}async function eF(D){let F;try{F=await C2(D.absolutePath)}catch{throw a("validate",`Overlay path changed during ${D.phase}: ${D.overlayRelativePath}. ${v2}`)}if(D.mustRemainDirectory&&!F.isDirectory())throw a("validate",`Overlay path changed during ${D.phase}: ${D.overlayRelativePath}. ${v2}`);if(D.mustRemainFile&&!F.isFile())throw a("validate",`Overlay path changed during ${D.phase}: ${D.overlayRelativePath}. ${v2}`);let B=u3(F),$=UX(D.expectedSnapshot,B),Q=!(D.compareContent??!0)?!0:VX(D.expectedSnapshot,B);if(!$||!Q)throw a("validate",`Overlay path changed during ${D.phase}: ${D.overlayRelativePath}. ${v2}`)}async function u8(D,F,B){let _=P8(T6(D,F)).split("/").filter((Y)=>Y.length>0),Q=D;for(let Y of _){Q=z2(Q,Y);let q;try{q=await C2(Q)}catch(H){if(H.code==="ENOENT")return;throw a("validate",`Failed to inspect overlay destination path (${B}): ${TD(H)}`)}if(q.isSymbolicLink())throw a("validate",`Overlay destination path contains existing symlink (${B})`)}}function z5(D,F,B){for(let $ of B)try{new S6(k6($))}catch{throw a("validate",`Invalid project overlay policy at ${D}: ${F} contains invalid glob pattern "${$}"`)}}async function LX(D){if(!D)return{include:[],exclude:[]};let F=z2(D,J2),B=await wX(D,F);if(!B)return{include:[],exclude:[]};let $;try{$=await qX(B,"utf8")}catch(J){throw a("read",`Failed to read project overlay policy at ${F}: ${TD(J)}`)}let _=[],Q=ND($,_,{allowTrailingComma:!0});if(_.length>0)throw a("parse",`Failed to parse project overlay policy at ${F}: ${jX(_)}`);if(!Q||typeof Q!=="object"||Array.isArray(Q))throw a("validate",`Invalid project overlay policy at ${F}: root must be an object`);let Y=EX.safeParse(Q);if(!Y.success){let J=Y.error.issues[0],X=J?.path.length?J.path.join("."):"root",z=J?.message??"Invalid project overlay policy";throw a("validate",`Invalid project overlay policy at ${F}: ${X} ${z}`)}let q=Y.data.include??[],H=Y.data.exclude??[];return z5(F,"include",q),z5(F,"exclude",H),{include:q,exclude:H}}async function wX(D,F){let B;try{B=await C2(F)}catch(Q){let Y=Q.code;if(Y==="ENOENT"||Y==="ENOTDIR")return null;throw a("read",`Failed to inspect project overlay policy at ${F}: ${TD(Q)}`)}if(!B.isSymbolicLink())return F;let $;try{$=await D3(D)}catch(Q){throw a("validate",`Unable to resolve project config directory ${D}: ${TD(Q)}`)}let _;try{_=await D3(F)}catch(Q){let Y=Q.code;if(Y==="ENOENT"||Y==="ENOTDIR")throw a("validate",`Broken symlink in project overlay policy: ${F}`);throw a("read",`Failed to inspect project overlay policy symlink at ${F}: ${TD(Q)}`)}if(!v6($,_))throw a("validate",`Symlink escapes project overlay policy scope: ${F}`);return _}function OX(D,F){for(let B of F.include)if(new S6(k6(B)).match(D))return!0;for(let B of F.exclude)if(new S6(k6(B)).match(D))return!1;return!0}function bX(D,F){return D.filter((B)=>OX(B.overlayRelativePath,F)).map((B)=>({sourcePath:B.sourcePath,destinationRelativePath:B.overlayRelativePath,sourceSnapshot:B.sourceSnapshot}))}async function K5(D,F,B){let $;try{$=await D3(F)}catch(_){let Q=_.code;if(Q==="ENOENT"||Q==="ENOTDIR")throw a("validate",`Broken symlink in project overlay scope: ${B}`);throw a("read",`Failed to inspect symlink at ${B}: ${TD(_)}`)}if(!v6(D,$))throw a("validate",`Symlink escapes project overlay scope: ${B}`);throw a("validate",`Symlink entries are not supported in project overlay scope: ${B}`)}async function U5(D,F,B,$,_){let Q;try{Q=await C2(F)}catch(q){throw a("read",`Failed to inspect project overlay path ${B}: ${TD(q)}`)}if(Q.isSymbolicLink())await K5(D,F,B);let Y=u3(Q);if(Q.isDirectory()){await _.beforeDirectoryRead?.({absolutePath:F,overlayRelativePath:B});let q;try{q=await A5(F)}catch(H){throw a("read",`Failed to read project overlay directory ${B}: ${TD(H)}`)}q.sort((H,J)=>H.localeCompare(J));for(let H of q){let J=z2(F,H),X=P8(z2(B,H));await U5(D,J,X,$,_)}await eF({absolutePath:F,overlayRelativePath:B,expectedSnapshot:Y,phase:"overlay discovery",mustRemainDirectory:!0});return}if(!Q.isFile())return;$.push({sourcePath:F,overlayRelativePath:P8(B),sourceSnapshot:Y})}async function RX(D,F={}){let B;try{B=await D3(D)}catch(Y){throw a("validate",`Unable to resolve project config directory ${D}: ${TD(Y)}`)}let $;try{$=await C2(D)}catch(Y){throw a("validate",`Unable to inspect project overlay root ${D}: ${TD(Y)}`)}if(!$.isDirectory())throw a("validate",`Project overlay root changed before discovery: ${D}. ${v2}`);let _=u3($),Q=[];for(let Y of zX){let q=z2(D,Y);await F.beforeScopeInspect?.({scope:Y,scopeAbsolutePath:q,projectConfigDir:D}),await eF({absolutePath:D,overlayRelativePath:".opencode",expectedSnapshot:_,phase:"overlay discovery",mustRemainDirectory:!0});let H;try{H=await C2(q)}catch(J){let X=J.code;if(X==="ENOENT"||X==="ENOTDIR")continue;throw a("read",`Failed to inspect project overlay scope ${Y}: ${TD(J)}`)}if(H.isSymbolicLink())await K5(B,q,Y);await U5(B,q,Y,Q,F)}return Q.sort((Y,q)=>Y.overlayRelativePath.localeCompare(q.overlayRelativePath)),Q}function ZX(D){let F=I6(D),B=WX(D),$=`${process.pid}-${BX()}`;return z2(F,`.${B}.ocx-tmp-${$}`)}async function NX(D,F){let B=ZX(F);try{await $X(D,B),await HX(B,F)}catch($){try{await XX(B)}catch{}throw $}}async function SX(D,F,B={}){let $=B.publishAtomically??NX,_;try{_=await C2(F)}catch(Y){throw a("validate",`Unable to inspect merged overlay root ${F}: ${TD(Y)}`)}if(!_.isDirectory())throw a("validate",`Merged overlay root is not a directory: ${F}`);let Q=u3(_);for(let Y of D){if(await B.beforeSourceVerification?.(Y),Y.sourceSnapshot)await eF({absolutePath:Y.sourcePath,overlayRelativePath:Y.destinationRelativePath,expectedSnapshot:Y.sourceSnapshot,phase:"overlay source verification",mustRemainFile:!0});await eF({absolutePath:F,overlayRelativePath:".merged",expectedSnapshot:Q,phase:"overlay destination verification",mustRemainDirectory:!0,compareContent:!1});let q;try{q=H0(F,Y.destinationRelativePath)}catch(z){throw a("validate",`Overlay destination path is invalid (${Y.destinationRelativePath}): ${TD(z)}`)}await u8(F,q,Y.destinationRelativePath);let H=I6(q);await B.beforeDestinationParentCreate?.({operation:Y,destinationPath:q,destinationParentPath:H}),await u8(F,q,Y.destinationRelativePath);try{await QX(H,{recursive:!0})}catch(z){throw a("copy",`Failed to copy overlay file ${Y.destinationRelativePath}: ${TD(z)}`)}await u8(F,q,Y.destinationRelativePath);let J;try{J=await C2(H)}catch(z){throw a("validate",`Failed to inspect overlay destination parent (${Y.destinationRelativePath}): ${TD(z)}`)}if(!J.isDirectory())throw a("validate",`Overlay destination parent changed before publish (${Y.destinationRelativePath}). ${v2}`);let X=u3(J);await B.beforeDestinationPublish?.({operation:Y,destinationPath:q,destinationParentPath:H}),await eF({absolutePath:F,overlayRelativePath:".merged",expectedSnapshot:Q,phase:"overlay destination publish",mustRemainDirectory:!0,compareContent:!1}),await eF({absolutePath:H,overlayRelativePath:Y.destinationRelativePath,expectedSnapshot:X,phase:"overlay destination publish",mustRemainDirectory:!0,compareContent:!1}),await u8(F,q,Y.destinationRelativePath);try{await $(Y.sourcePath,q)}catch(z){if(z instanceof c)throw z;throw a("copy",`Failed to copy overlay file ${Y.destinationRelativePath}: ${TD(z)}`)}}}async function kX(D,F){let B;try{B=await A5(D)}catch($){throw a("copy",`Failed to read profile directory ${D}: ${TD($)}`)}for(let $ of B){let _=z2(D,$),Q=z2(F,$);try{await _X(_,Q,{recursive:!0,force:!0,errorOnExist:!1})}catch(Y){throw a("copy",`Failed to copy profile base file ${$}: ${TD(Y)}`)}}}async function M5(D){try{await JX(D,{recursive:!0,force:!0})}catch(F){throw a("cleanup",`Failed to remove temporary merged config directory ${D}: ${TD(F)}`)}}function IX(D,F){let B=P8(T6(D,F));if(!B||B===".")throw a("validate",`Overlay source path failed relative parsing: ${F}`);if(B===".."||B.startsWith("../")||j5(B))throw a("validate",`Overlay source path escapes project overlay scope: ${F}`);return B}function TX(D,F){let B=F.map(($)=>{if(!$.sourceSnapshot)throw a("validate",`Overlay source snapshot missing for ${$.destinationRelativePath}. ${v2}`);return{sourceRelativePath:IX(D,$.sourcePath),destinationRelativePath:$.destinationRelativePath,sourceSnapshot:$.sourceSnapshot}});return{version:AX,projectConfigDir:D,operations:B}}function vX(){return null}async function CX(D){let F=D.manifest.operations.map((B)=>({sourcePath:H0(D.manifest.projectConfigDir,B.sourceRelativePath),destinationRelativePath:B.destinationRelativePath,sourceSnapshot:B.sourceSnapshot}));await SX(F,D.mergedConfigDir,D.copySeams)}async function uX(D){if(D.manifest.operations.length===0)return"best-effort-js";let F=D.nativeHelper??vX();if(F)return await F.applyManifest(D.manifest,D.mergedConfigDir),"native-fd";if(D.hardeningMode==="native-fd-required")throw a("validate",`Native fd helper required for overlay merge, but none is available in this Bun/Node runtime. ${v2}`);return await CX({manifest:D.manifest,mergedConfigDir:D.mergedConfigDir,copySeams:D.copySeams}),"best-effort-js"}async function PX(D){let F=I6(D),B;try{B=await D3(F)}catch(_){throw a("validate",`Unable to resolve project directory ${F}: ${TD(_)}`)}let $;try{$=await D3(D)}catch(_){throw a("validate",`Unable to resolve project config directory ${D}: ${TD(_)}`)}if(!v6(B,$))throw a("validate",`Project .opencode root resolves outside project directory: ${D}`);return $}function xX(D){if(D instanceof c)return D;return a("copy",`Failed to prepare temporary merged config directory: ${TD(D)}`)}async function V5(D){let F=o2(D.projectDir),B=D.hardeningMode??"best-effort-js",$=null;try{$=await YX(z2(GX(),MX)),await kX(D.profileDir,$);let _="best-effort-js";if(F){let Y=await PX(F),q=await LX(Y),H=await RX(Y,D.seams?.collection),J=bX(H,q),X=TX(Y,J);_=await uX({manifest:X,mergedConfigDir:$,hardeningMode:B,copySeams:D.seams?.copy,nativeHelper:D.seams?.nativeHelper})}let Q=$;return{path:Q,cleanup:()=>M5(Q),hardeningLevel:_}}catch(_){let Q=xX(_);if($)try{await M5($)}catch(Y){Q.message=`${Q.message}
130
- Cleanup warning: ${TD(Y)}`}throw Q}}var zX,MX="ocx-oc-merged-",AX=1,v2="Full TOCTOU/symlink-swap hardening requires an fd-based native helper transaction.",EX;var E5=V(()=>{b0();_2();G0();$D();c2();zX=["agent","agents","skill","skills"];EX=W.object({include:W.array(W.string()).optional(),exclude:W.array(W.string()).optional()}).passthrough()});import*as e0 from"path";function yX(D){let F=new Set,B=[];for(let $=D.length-1;$>=0;$--){let _=D[$];if(!F.has(_))F.add(_),B.unshift(_)}return B}function fX(D){return D.configBin??D.envBin??"opencode"}function L5(D){return D.includes("/")||D.includes("\\")}function hX(D){let{configuredBin:F,cwd:B}=D,$=D.resolveExecutable??((Q)=>Bun.which(Q));if(!F.trim())throw Error("OpenCode launcher is empty and cannot be resolved to a stable path");if(L5(F))return e0.isAbsolute(F)?F:e0.resolve(B,F);let _=$(F);if(!_)throw Error(`OpenCode launcher "${F}" is not available in PATH and cannot be used as OPENCODE_BIN`);return e0.isAbsolute(_)?_:e0.resolve(B,_)}function mX(D){let F=D.resolveExecutable??((J)=>Bun.which(J)),B=D.argv??process.argv,$=D.execPath??process.execPath,_=D.isCompiledBinary??(typeof Bun<"u"&&typeof Bun.main==="string"&&Bun.main.startsWith("/$bunfs/")),Q=D.inheritedOcxBin?.trim(),Y=_?$:B[1],q=Q&&Q.length>0?Q:Y;if(!q?.trim())throw Error("OCX executable path is empty and cannot be resolved from the current process");if(L5(q))return e0.isAbsolute(q)?q:e0.resolve(D.cwd,q);let H=F(q);if(!H)throw Error(`OCX executable "${q}" is not available in PATH and cannot be persisted as OCX_BIN`);return e0.isAbsolute(H)?H:e0.resolve(D.cwd,H)}function gX(D){let F=Boolean(D.profileName),{OPENCODE_DISABLE_PROJECT_CONFIG:B,OPENCODE_BIN:$,OCX_CONTEXT:_,OCX_BIN:Q,OCX_PROFILE:Y,...q}=D.baseEnv;return{...q,...D.opencodeBin!==void 0&&{OPENCODE_BIN:D.opencodeBin},...F&&{OPENCODE_DISABLE_PROJECT_CONFIG:"true"},OPENCODE_CONFIG_DIR:D.configDir??(F?yD(D.profileName):X0()),...D.configContent&&{OPENCODE_CONFIG_CONTENT:D.configContent},...F&&{OCX_CONTEXT:"1"},...F&&D.ocxBin&&{OCX_BIN:D.ocxBin},...D.profileName&&{OCX_PROFILE:D.profileName}}}function w5(D){D.command("oc").alias("opencode").description("Launch OpenCode with resolved configuration").option("-p, --profile <name>","Use specific profile").option("--no-rename","Disable terminal/tmux window renaming").allowUnknownOption().allowExcessArguments(!0).action(async(F,B)=>{try{await dX(B.args,F)}catch($){t($)}})}async function dX(D,F){let B=process.cwd(),$=await o0.create(B,{profile:F.profile}),_=$.resolve(),Q=$.getProfile();if(_.profileName)G.info(`Using profile: ${_.profileName}`);let Y=Q?.ocx,q=F.rename!==!1&&Y?.renameWindow!==!1;if(_.profileName){let x=G2(_.profileName);if(!await Bun.file(x).exists())G.warn(`No opencode.jsonc found at ${x}. Create one to customize OpenCode settings.`)}let H=Array.isArray(_.opencode.instructions)?_.opencode.instructions:[],J=[..._.instructions,...H],X=yX(J),z=X.length>0||Object.keys(_.opencode).length>0?{..._.opencode,instructions:X.length>0?X:void 0}:void 0,M=null,A=null,K=null,j=null,S=null,Z=()=>{if(M)M.kill("SIGINT");else S=130},s=()=>{if(M)M.kill("SIGTERM");else S=143},N=()=>{if(q)N6()};try{if(process.on("SIGINT",Z),process.on("SIGTERM",s),process.on("exit",N),S!==null){j=S;return}if(_.profileName)A=await V5({projectDir:B,profileDir:yD(_.profileName)});if(S!==null){j=S;return}if(q){X5();let p=await Q5(B);if(S!==null){j=S;return}J5(G5(B,_.profileName??"default",p))}if(S!==null){j=S;return}let x=fX({configBin:Y?.bin,envBin:process.env.OPENCODE_BIN}),O=Boolean(_.profileName),b=O?hX({configuredBin:x,cwd:B}):x,L=O?mX({cwd:B,inheritedOcxBin:process.env.OCX_BIN}):void 0,e=z?JSON.stringify(z):void 0;try{M=Bun.spawn({cmd:[b,...D],cwd:B,env:gX({baseEnv:process.env,profileName:_.profileName??void 0,ocxBin:L,opencodeBin:b,configDir:A?.path,configContent:e}),stdin:"inherit",stdout:"inherit",stderr:"inherit"})}catch(p){throw a("spawn",`Failed to launch OpenCode binary "${x}": ${p instanceof Error?p.message:String(p)}`)}j=await M.exited}catch(x){K=x instanceof Error?x:a("spawn",`OpenCode process failed: ${String(x)}`)}finally{if(process.off("SIGINT",Z),process.off("SIGTERM",s),process.off("exit",N),q)N6();if(A)try{await A.cleanup()}catch(x){if(K!==null||S!==null||j!==null&&j!==0)G.warn(`Cleanup warning: ${x instanceof Error?x.message:String(x)}`);else K=x instanceof Error?x:a("cleanup",`Failed to remove temporary merged config directory: ${String(x)}`)}}if(K)throw K;if(j!==null)process.exit(j)}var O5=V(()=>{O3();G0();Y5();PD();fD();k2();W5();E5()});import{existsSync as F3}from"fs";import{mkdir as C6,mkdtemp as cX,rename as lX,rm as b5,writeFile as pX}from"fs/promises";import{dirname as R5,join as x8,relative as iX}from"path";function Z5(D,F,B){let $=B instanceof Error?B.message:String(B);return`${D} "${F}" (${$})`}function I5(D,F){let[B,$]=F.split("/");if(!B||!$)return;return`${xD(D)}/components/${$}.json`}function N5(D){if(!D)return null;let[F,B,...$]=D.split("/");if(!F||!B||$.length>0)return null;return{registryName:F,componentName:B}}function nX(D,F){if(!D)return{};let B;try{let Y=new URL(D),q=Y.pathname.match(/(?:^|\/)components\/([^/]+)\.json$/);if(q?.[1])B=decodeURIComponent(q[1]);else{let H=Y.pathname.match(/(?:^|\/)components\/([^/]+)\/.+$/);if(H?.[1])B=decodeURIComponent(H[1])}}catch{}let $=xD(D),_,Q=-1;for(let[Y,q]of Object.entries(F)){let H=xD(q.url);if(!($===H||$.startsWith(`${H}/`))||H.length<=Q)continue;_=Y,Q=H.length}return{registryName:_,componentName:B}}function sX(D){let F=D.depRefs[0]??`${D.namespace}/${D.component}`,B={...D.profileRegistries,...D.profileRegistries[D.namespace]?{}:{[D.namespace]:{url:D.registryUrl}}},$=D.error.registryName,_=D.error.qualifiedName,Q=N5(_);if(!$&&Q)$=Q.registryName;let Y=Q?.componentName,q=_&&!Q&&!_.includes("/")?_:void 0,H=nX(D.error.url,B);if(!$&&H.registryName)$=H.registryName;let J=Y??q??H.componentName;if((!_||!Q)&&$&&J)_=`${$}/${J}`;if(!_)_=F;if(!$)$=N5(_)?.registryName??D.namespace;let X=B[$]?.url||($===D.namespace?D.registryUrl:void 0);return{registryName:$,qualifiedName:_,fallbackUrl:D.error.url||(X?I5(X,_):void 0)}}function S5(D,F){let B=D.phase??F.fallbackPhase,$=D.url??F.fallbackUrl,_=[`phase: ${B}`,`qualifiedName: ${F.qualifiedName}`,`registryContext: ${F.registryContext}`,`registryName: ${F.registryName}`,...$?[`url: ${$}`]:[]];return new RD(`${D.message} (${_.join(", ")})`,{url:$,status:D.status,statusText:D.statusText,phase:B,qualifiedName:F.qualifiedName,registryContext:F.registryContext,registryName:F.registryName})}function k5(D,F){if(!D.startsWith(".opencode/"))throw new U(`Invalid embedded target "${D}": expected .opencode/ prefix for embedded profile files.`);let B=D.slice(10);if(!B)throw new U(`Invalid embedded target "${D}": missing path after .opencode/ prefix.`);let $;try{$=H0(F,B)}catch(Q){if(Q instanceof aD)throw new U(`Invalid embedded target "${D}": ${Q.message}`);throw Q}let _=iX(F,$).replace(/\\/g,"/");if(_==="."||_==="")throw new U(`Invalid embedded target "${D}": target must resolve to a file path.`);return _}async function u6(D){let{namespace:F,component:B,profileName:$,registryUrl:_,quiet:Q}=D;if(!s0.safeParse($).success)throw new U(`Invalid profile name: "${$}". Profile names must start with a letter and contain only alphanumeric characters, dots, underscores, or hyphens.`);let q;if(F)q=F;else throw new U(`Registry name is required for URL-based profile installs.
169
+ `,{mode:384}),U.push("profileAgents");if(_?.succeed("Initialized global profiles"),$.json)console.log(JSON.stringify({success:!0,files:{globalConfig:v,profileOcx:z,profileOpencode:I,profileAgents:X},created:U,existed:Q}));else if(!$.quiet)if(U.length>0){for(let q of U){if(q==="globalConfig")W.info(`Created global config: ${v}`);if(q==="profileOcx")W.info(`Created profile config: ${z}`);if(q==="profileOpencode")W.info(`Created profile opencode config: ${I}`);if(q==="profileAgents")W.info(`Created profile instructions: ${X}`)}W.info(""),W.info("Next steps:"),W.info(" 1. Edit your profile config: ocx config edit -p default"),W.info(" 2. Add registries: ocx registry add <url> --name <name> --global"),W.info(" 3. Launch OpenCode: ocx opencode"),W.info(" 4. Create more profiles: ocx profile add <name> --global")}else W.info("Global profiles already initialized (all files exist)")}catch(U){throw _?.fail("Failed to initialize"),U}}async function qL($,_){let U=$,Q=_.namespace??"my-registry",v=_.author??"Your Name";if(!/^[a-z0-9]+(-[a-z0-9]+)*$/.test(Q))throw new M("Invalid namespace format: must start with letter/number, use hyphens only between segments (e.g., 'my-registry')");if((await xK(U).catch(()=>[])).some((I)=>!I.startsWith(".")))throw new t$("Directory is not empty. Remove existing files or choose a different directory.");let z=_.quiet?null:V$({text:"Scaffolding registry..."});z?.start();try{if(z)z.text=_.local?"Copying template...":"Fetching template...";if(_.local)await y0(U,{recursive:!0}),await CK(_.local,U);else{let I=_.canary?"main":GL();await KL(U,I,_.verbose)}if(z)z.text="Configuring project...";if(await WL(U,{namespace:Q,author:v}),z?.succeed(`Created registry: ${Q}`),_.json)console.log(JSON.stringify({success:!0,namespace:Q,path:U}));else if(!_.quiet)W.info(""),W.info("Next steps:"),W.info(" 1. bun install"),W.info(" 2. Edit registry.jsonc with your components"),W.info(" 3. bun run build"),W.info(""),W.info("Deploy to:"),W.info(" Cloudflare: bunx wrangler deploy"),W.info(" Vercel: vercel"),W.info(" Netlify: netlify deploy")}catch(I){throw z?.fail("Failed to scaffold registry"),I}}async function CK($,_){await UL($,_,{recursive:!0})}function GL(){return"v2.0.5"}function jL($){let _=$==="main"?"heads/main":`tags/${$}`;return`https://github.com/${YL}/archive/refs/${_}.tar.gz`}async function KL($,_,U){let Q=jL(_);if(U)W.info(`Fetching ${Q}`);let v=await fetch(Q);if(!v.ok||!v.body)throw new E$(`Failed to fetch template from ${Q}: ${v.statusText}`);let J=O8($,".ocx-temp");await y0(J,{recursive:!0});try{let Y=O8(J,"template.tar.gz"),z=await v.arrayBuffer();await LY(Y,Buffer.from(z));let I=Bun.spawn(["tar","-xzf",Y,"-C",J],{stdout:"ignore",stderr:"pipe"});if(await I.exited!==0){let H=await new Response(I.stderr).text();throw Error(`Failed to extract template: ${H}`)}let G=(await xK(J)).find((H)=>H.startsWith("ocx-"));if(!G)throw Error("Failed to find extracted template directory");let j=O8(J,G,zL);await CK(j,$)}finally{await JL(J,{recursive:!0,force:!0})}}function HL($){return $.split(/[-_\s]+/).map((_)=>_.charAt(0).toUpperCase()+_.slice(1).toLowerCase()).join(" ")}async function WL($,_){let U=["registry.jsonc","package.json","wrangler.jsonc","README.md","AGENTS.md"];for(let Q of U){let v=O8($,Q);if(!O1(v))continue;let J=await QL(v).then((Y)=>Y.toString());if(J=J.replace(/my-registry/g,_.namespace),J=J.replace(/My Registry/g,HL(_.namespace)),J=J.replace(/Your Name/g,_.author),Q==="registry.jsonc")if(/"\$schema"\s*:/.test(J))J=J.replace(/("\$schema"\s*:\s*")[^"]*(")/,`$1${p4}$2`);else J=J.replace(/{/,`{
170
+ "$schema": "${p4}",`);await LY(v,J)}}var YL="kdcokenny/ocx",zL="examples/registry-starter";var fK=b(()=>{l2();e2();X6();Z4();X4();hJ();z$();c$();i$();a4();e4()});function bL($,_,U){let Q=$.indexOf("/");if(Q===-1)throw Error(`Invalid legacy key: "${$}". Expected format: alias/component`);let v=$.slice(0,Q),J=$.slice(Q+1);if(!v||!J)throw Error(`Invalid legacy key: "${$}". Both alias and component are required.`);let Y=C_(U,v,J,_.version),z={registryUrl:U,registryName:v,name:J,revision:_.version,hash:_.hash,files:_.files.map((I)=>({path:I,hash:""})),installedAt:_.installedAt,..._.updatedAt&&{updatedAt:_.updatedAt},owner:{type:"user"}};return[Y,z]}function N8($,_,U){let Q={},v=[],J=Object.keys($.installed).sort();for(let z of J){let I=$.installed[z];if(!I)continue;let X=_.registries[I.registry];if(!X)throw new n(`Registry "${I.registry}" referenced in lock key "${z}" is not configured in ocx.jsonc. Add it before migrating.`);let[q,G]=bL(z,I,X.url);Q[q]=G,v.push({legacyKey:z,canonicalId:q,name:G.name,registryName:G.registryName})}return{receipt:{version:1,...U&&{root:U},installed:Q},components:v}}function mK($){let _=$.registries;if(!_||typeof _!=="object"||Array.isArray(_))return[];let U=[],Q=_;for(let v of Object.keys(Q).sort()){let J=Q[v];if(!J||typeof J!=="object"||Array.isArray(J))continue;let Y=J;for(let z of BL)if(z in Y)U.push({registry:v,field:z,action:"remove_deprecated"})}return U}var BL;var gK=b(()=>{X4();z$();BL=["version"]});import{existsSync as kY,readdirSync as ZL,readFileSync as dK,statSync as VL}from"fs";import{rename as S8,writeFile as DL}from"fs/promises";import{join as hK}from"path";function pK($){$.command("migrate").description("Migrate legacy ocx.lock to receipt format (.ocx/receipt.jsonc)").option("--global","Migrate global config scope (includes profiles)").option("--apply","Apply migration (default is dry-run preview)").option("--json","Output as JSON").option("-q, --quiet","Suppress output").option("--cwd <path>","Working directory").action(async(_)=>{try{await wL(_)}catch(U){_$(U,{json:_.json})}})}async function wL($){if($.global){await LL($);return}await uL($,"local",mL($),!1)}async function LL($){let _=$.cwd??O4(),U=kL(_);if(!$.apply){let Y=[],z=new Set;for(let{label:q,path:G}of U){let j=l6(G),H=D0(G,{isFlattened:!0});if(j.exists&&H.exists)z.add(q);try{let Z=await AL(G,!0,{emitWarnings:!$.json&&!$.quiet});Y.push({...Z,target:q})}catch(Z){let V=lK(q,Z);if(Y.push(V),!$.json&&!$.quiet)W.error(`[global:${q}] Preview failed: ${V.error}`)}}let I=cK(Y,"global",!1),X=OL(I);if($.json){if(C0(I,!1),X)process.exit(1);return}if(!$.quiet)yL(Y,I,z);if(X)process.exit(1);return}let Q=[],v=!1;for(let{label:Y,path:z}of U)try{let I=await FL(z,!0);Q.push({...I,target:Y})}catch(I){v=!0;let X=lK(Y,I);if(Q.push(X),!$.json&&!$.quiet)W.error(`[global:${Y}] Migration failed: ${X.error}`)}let J=cK(Q,"global",!0);if($.json){if(C0(J,!0),v)process.exit(1);return}if(!$.quiet)CL(Q,v);if(v)process.exit(1)}function kL($){let _=[];_.push({label:"root",path:$});let U=hK($,"profiles");if(kY(U)&&VL(U).isDirectory()){let v=ZL(U,{withFileTypes:!0}).filter((J)=>J.isDirectory()&&!J.name.startsWith(".")).map((J)=>J.name).sort();for(let J of v)_.push({label:`profile:${J}`,path:hK(U,J)})}return _}async function AL($,_,U){let Q=U?.emitWarnings??!0,v=AY($),J=l6($),Y=D0($,{isFlattened:_}),z=J.exists&&Y.exists;if(J.exists&&v.length===0&&!z)return{status:"already_v2",count:0,components:[],configActions:[]};if(!Y.exists&&!J.exists&&v.length===0)return{status:"nothing_to_migrate",count:0,components:[],configActions:[]};let I=[];if(Y.exists&&!J.exists)try{let X=await f_($,{isFlattened:_}),q=await u4($,{emitParseDiagnostics:Q});if(X&&q)I=N8(X,q,$).components}catch{if(Q)W.warn(`[preview] Could not parse lock/config at "${$}"; component count may be incomplete.`)}return{status:"preview",count:I.length,components:I,configActions:v}}async function FL($,_){let U=AY($),Q=l6($),v=D0($,{isFlattened:_}),J=Q.exists&&v.exists;if(Q.exists&&U.length===0&&!J)return{status:"already_v2",count:0,components:[],configActions:[]};if(!v.exists&&!Q.exists&&U.length===0)return{status:"nothing_to_migrate",count:0,components:[],configActions:[]};let Y=null;if(v.exists&&!Q.exists){let q=await f_($,{isFlattened:_});if(!q)throw new M("Failed to parse ocx.lock. The lock file exists but could not be read or contains invalid data.");let G=await u4($);if(!G)throw new n("No ocx.jsonc found. The config is required to resolve registry URLs during migration.");let{receipt:j,components:H}=N8(q,G,$);Y={newReceipt:j,components:H}}let z=Y?.components??[],I=z.length;if(Y){await x4($,Y.newReceipt);let q=T8(v.path);await S8(v.path,q)}if(J){let q=T8(v.path);await S8(v.path,q)}if(U.length>0)await iK($,U);return{status:Y!==null||J||U.length>0?"migrated":"already_v2",count:I,components:z,configActions:U}}function cK($,_,U){let Q=$.some((q)=>q.status==="error"),v=$.some((q)=>q.status==="migrated"||q.status==="preview"),J=$.every((q)=>q.status==="already_v2"||q.status==="nothing_to_migrate"),Y=$.reduce((q,G)=>q+G.count,0),z=$.flatMap((q)=>q.components),I=$.flatMap((q)=>q.configActions),X;if(Q)X=U?"partial_failure":"preview_with_errors";else if(J)X=$.every((G)=>G.status==="nothing_to_migrate")?"nothing_to_migrate":"already_v2";else if(U)X=v?"migrated":"already_v2";else X=v?"preview":"already_v2";return{success:!Q,status:X,scope:_,count:Y,components:z,configActions:I,targets:$}}function OL($){return $.status==="preview_with_errors"}function C0($,_){let U=NL($,_);console.log(JSON.stringify(U,null,2))}function NL($,_){let U=SL($),Q=U.flatMap((v)=>v.blockers??[]);return{...$,lifecycle_status:EL($.status,_),schema_version:ML,blockers:Q,targets:U}}function SL($){return($.targets&&$.targets.length>0?$.targets:[TL($)]).map((U)=>RL(U))}function TL($){return{target:$.scope,status:$.status,count:$.count,components:$.components,configActions:$.configActions,blockers:$.blockers??[]}}function RL($){let _=$.blockers??($.status==="error"?[{code:"MIGRATE_BLOCKER",message:$.error??"Migration blocked",path:$.target}]:[]);return{...$,scope:$.scope??$.target,result:$.result??$.status,blockers:_}}function EL($,_){if(_)return $==="partial_failure"?"apply_failed":"apply_ok";return $==="preview_with_errors"?"preview_blocked":"preview_ok"}function lK($,_){let U=PL(_,$);return{target:$,status:"error",count:0,components:[],configActions:[],error:U.message,blockers:[U]}}function PL($,_){let U=$ instanceof Error?$.message:String($);return{code:xL($,U),message:U,path:_}}function xL($,_){if(typeof $==="object"&&$!==null&&"code"in $){let Q=$.code;if(typeof Q==="string"&&Q.length>0)return Q}let U=_.toLowerCase();if(U.includes("ocx.jsonc")||U.includes("registry"))return"CONFIG_ERROR";if(U.includes("parse")||U.includes("invalid"))return"VALIDATION_ERROR";return"MIGRATE_BLOCKER"}async function uL($,_,U,Q){let v=AY(U),J=l6(U),Y=D0(U,{isFlattened:Q}),z=J.exists&&Y.exists;if(J.exists&&v.length===0&&!z){let H={success:!0,status:"already_v2",scope:_,count:0,components:[],configActions:[]};if($.json){C0(H,Boolean($.apply));return}if(!$.quiet)W.success(`[${_}] Already migrated to receipt format (.ocx/receipt.jsonc).`);return}if(!Y.exists&&!J.exists&&v.length===0){let H={success:!0,status:"nothing_to_migrate",scope:_,count:0,components:[],configActions:[]};if($.json){C0(H,Boolean($.apply));return}if(!$.quiet)W.info(`[${_}] Nothing to migrate. No legacy ocx.lock found.`);return}let I=null;if(Y.exists&&!J.exists){let H=await f_(U,{isFlattened:Q});if(!H)throw new M("Failed to parse ocx.lock. The lock file exists but could not be read or contains invalid data.");let Z=await u4(U);if(!Z)throw new n("No ocx.jsonc found. The config is required to resolve registry URLs during migration.");let{receipt:V,components:S}=N8(H,Z,U);I={newReceipt:V,components:S}}let X=I?.components??[],q=X.length;if(!$.apply){let H={success:!0,status:"preview",scope:_,count:q,components:X,configActions:v};if($.json){C0(H,!1);return}if(!$.quiet){if(q>0){W.info(`[${_}] Migration preview: ${q} component(s) would be migrated.`),W.break();for(let Z of X)W.info(` ${Z.legacyKey} \u2192 ${Z.canonicalId}`);W.break()}if(z)W.info(`[${_}] Legacy ocx.lock would be backed up and removed (receipt already exists).`),W.break();if(v.length>0){W.info(`[${_}] Config normalization: ${v.length} deprecated field(s) would be removed.`);for(let Z of v)W.info(` registries.${Z.registry}.${Z.field} \u2192 remove`);W.break()}if(q===0&&v.length===0&&!z)W.info(`[${_}] Nothing to migrate.`);else W.info("No changes made. Run with --apply to perform migration.")}return}if(I){await x4(U,I.newReceipt);let H=T8(Y.path);if(await S8(Y.path,H),!$.json&&!$.quiet){W.success(`[${_}] Migrated ${q} component(s) to receipt format (.ocx/receipt.jsonc).`),W.break();for(let Z of X)W.success(` \u2713 ${Z.legacyKey} \u2192 ${Z.canonicalId}`);W.break(),W.info(`Legacy lock backed up to: ${H}`)}}if(z){let H=T8(Y.path);if(await S8(Y.path,H),!$.json&&!$.quiet)W.success(`[${_}] Removed stale legacy lock (receipt already exists).`),W.info(`Legacy lock backed up to: ${H}`)}if(v.length>0){if(await iK(U,v),!$.json&&!$.quiet){if(I)W.break();W.success(`[${_}] Normalized ${v.length} deprecated config field(s).`);for(let H of v)W.success(` \u2713 registries.${H.registry}.${H.field} removed`)}}let j={success:!0,status:I!==null||z||v.length>0?"migrated":"already_v2",scope:_,count:q,components:X,configActions:v};if($.json){C0(j,!0);return}if(!I&&v.length>0&&!$.quiet)W.break(),W.success(`[${_}] Config normalization complete.`)}function yL($,_,U){if(_.status==="nothing_to_migrate"){W.info("[global] Nothing to migrate across all targets.");return}if(_.status==="already_v2"){W.success("[global] All targets already migrated.");return}W.info(`[global] Migration preview across ${$.length} target(s):`),W.break();for(let Q of $){let v=U.has(Q.target),J=fL(Q,v);W.info(` ${Q.target}: ${J}`)}if(W.break(),_.status==="preview_with_errors")W.warn("[global] Preview completed with errors on some targets. See above for details."),W.info("No changes made. Run with --apply to perform migration.");else W.info("No changes made. Run with --apply to perform migration.")}function CL($,_){W.break();let U=$.filter((J)=>J.status==="migrated"),Q=$.filter((J)=>J.status==="already_v2"||J.status==="nothing_to_migrate"),v=$.filter((J)=>J.status==="error");if(U.length>0){W.success(`[global] Migrated ${U.length} target(s):`);for(let J of U)W.success(` \u2713 ${J.target}`)}if(Q.length>0)W.info(`[global] ${Q.length} target(s) already up to date.`);if(v.length>0){W.error(`[global] ${v.length} target(s) failed:`);for(let J of v)W.error(` \u2717 ${J.target}: ${J.error}`)}if(_)W.break(),W.error("[global] Migration completed with errors. See above for details.")}function fL($,_){if($.status==="error")return"error";if($.status==="already_v2")return"already migrated";if($.status==="nothing_to_migrate")return"nothing to migrate";let U=[];if($.count>0)U.push(`${$.count} component(s) to migrate`);if($.configActions.length>0)U.push(`${$.configActions.length} config field(s) to normalize`);if(_)U.push("legacy lock cleanup pending");if(U.length===0)return"nothing to migrate";return U.join(", ")}function mL($){if($.global)return $.cwd??O4();return $.cwd??process.cwd()}function T8($){let _=`${$}.bak`;if(!kY(_))return _;for(let U=1;U<=100;U++){let Q=`${_}.${U}`;if(!kY(Q))return Q}return`${_}.${Date.now()}`}function AY($){let _=d6($);if(!_.exists)return[];try{let U=dK(_.path,"utf-8"),Q=x$(U,[],{allowTrailingComma:!0});if(!Q||typeof Q!=="object"||Array.isArray(Q))return[];return mK(Q)}catch{return[]}}async function iK($,_){if(_.length===0)return;let U=d6($);if(!U.exists)return;let Q=dK(U.path,"utf-8");for(let v of _){let J=y1(Q,["registries",v.registry,v.field],void 0,gL);Q=C1(Q,J)}await DL(U.path,Q)}var ML=1,gL;var nK=b(()=>{c4();X4();z$();c$();i$();p6();gK();gL={formattingOptions:{tabSize:2,insertSpaces:!0,eol:`
171
+ `}}});import{basename as hL,resolve as Ey}from"path";function R8(){let{GIT_DIR:$,GIT_WORK_TREE:_,...U}=process.env;return U}async function cL($){let _=Bun.spawn(["git","symbolic-ref","--short","HEAD"],{cwd:$,env:R8(),stdout:"pipe",stderr:"pipe"});if(await _.exited===0){let I=(await new Response(_.stdout).text()).trim();if(I)return I}let Q=Bun.spawn(["git","describe","--tags","--exact-match","HEAD"],{cwd:$,env:R8(),stdout:"pipe",stderr:"pipe"});if(await Q.exited===0){let I=(await new Response(Q.stdout).text()).trim();if(I)return I}let J=Bun.spawn(["git","rev-parse","--short","HEAD"],{cwd:$,env:R8(),stdout:"pipe",stderr:"pipe"});if(await J.exited===0){let I=(await new Response(J.stdout).text()).trim();if(I)return I}return null}async function lL($){let _=Bun.spawn(["git","rev-parse","--show-toplevel"],{cwd:$,env:R8(),stdout:"pipe",stderr:"pipe"});if(await _.exited!==0)return null;let v=(await new Response(_.stdout).text()).trim();if(!v)return null;return hL(v)}async function rK($){let[_,U]=await Promise.all([lL($),cL($)]);return{repoName:_,branch:U}}var oK=()=>{};import dL from"path";function aK(){return Boolean(process.env.TMUX)}function pL($){if(!aK())return;Bun.spawnSync(["tmux","rename-window",$]),Bun.spawnSync(["tmux","set-window-option","automatic-rename","off"])}function iL($){if(!M1)return;process.stdout.write(`\x1B]0;${$}\x07`)}function sK($){pL($),iL($)}function eK(){if(E8||!M1)return;process.stdout.write("\x1B[22;2t"),E8=!0}function FY(){if(!E8)return;if(aK())Bun.spawnSync(["tmux","set-window-option","automatic-rename","on"]);if(M1)process.stdout.write("\x1B[23;2t");E8=!1}function $H($,_,U){let Q=U.repoName??dL.basename($);if(!U.branch)return`ocx[${_}]:${Q}`;let v=U.branch.length>tK?`${U.branch.slice(0,tK-3)}...`:U.branch;return`ocx[${_}]:${Q}/${v}`}var tK=20,E8=!1;var _H=b(()=>{l_()});import{randomUUID as nL}from"crypto";import{copyFile as rL,cp as oL,lstat as o6,mkdir as tL,mkdtemp as aL,readdir as QH,readFile as sL,realpath as m0,rename as eL,rm as $k,unlink as _k}from"fs/promises";import{tmpdir as vk}from"os";import{basename as Uk,dirname as SY,isAbsolute as JH,join as A6,relative as TY}from"path";var{Glob:OY}=globalThis.Bun;function a($,_){return new n(`ocx oc ${$} error: ${_}`)}function C$($){if($ instanceof Error)return $.message;return String($)}function zk($){if($.length===0)return"Unknown parse error";let _=$[0];if(!_)return"Unknown parse error";return`${S6(_.error)} at offset ${_.offset}`}function x8($){return $.replaceAll("\\","/")}function NY($){return $.startsWith("./")?$.slice(2):$}function RY($,_){let U=TY($,_);if(U.length===0)return!0;return!U.startsWith("..")&&!JH(U)}function Ik($){if($.isFile())return"file";if($.isDirectory())return"directory";if($.isSymbolicLink())return"symlink";return"other"}function s_($){return{entryType:Ik($),device:String($.dev),inode:String($.ino),mode:String($.mode),size:String($.size),mtimeMs:String($.mtimeMs)}}function Xk($,_){return $.entryType===_.entryType&&$.device===_.device&&$.inode===_.inode&&$.mode===_.mode}function qk($,_){return $.size===_.size&&$.mtimeMs===_.mtimeMs}async function f0($){let _;try{_=await o6($.absolutePath)}catch{throw a("validate",`Overlay path changed during ${$.phase}: ${$.overlayRelativePath}. ${r6}`)}if($.mustRemainDirectory&&!_.isDirectory())throw a("validate",`Overlay path changed during ${$.phase}: ${$.overlayRelativePath}. ${r6}`);if($.mustRemainFile&&!_.isFile())throw a("validate",`Overlay path changed during ${$.phase}: ${$.overlayRelativePath}. ${r6}`);let U=s_(_),Q=Xk($.expectedSnapshot,U),J=!($.compareContent??!0)?!0:qk($.expectedSnapshot,U);if(!Q||!J)throw a("validate",`Overlay path changed during ${$.phase}: ${$.overlayRelativePath}. ${r6}`)}async function P8($,_,U){let v=x8(TY($,_)).split("/").filter((Y)=>Y.length>0),J=$;for(let Y of v){J=A6(J,Y);let z;try{z=await o6(J)}catch(I){if(I.code==="ENOENT")return;throw a("validate",`Failed to inspect overlay destination path (${U}): ${C$(I)}`)}if(z.isSymbolicLink())throw a("validate",`Overlay destination path contains existing symlink (${U})`)}}function vH($,_,U){for(let Q of U)try{new OY(NY(Q))}catch{throw a("validate",`Invalid project overlay policy at ${$}: ${_} contains invalid glob pattern "${Q}"`)}}async function jk($){if(!$)return{include:[],exclude:[]};let _=A6($,t4),U=await Kk($,_);if(!U)return{include:[],exclude:[]};let Q;try{Q=await sL(U,"utf8")}catch(X){throw a("read",`Failed to read project overlay policy at ${_}: ${C$(X)}`)}let v=[],J=x$(Q,v,{allowTrailingComma:!0});if(v.length>0)throw a("parse",`Failed to parse project overlay policy at ${_}: ${zk(v)}`);if(!J||typeof J!=="object"||Array.isArray(J))throw a("validate",`Invalid project overlay policy at ${_}: root must be an object`);let Y=Gk.safeParse(J);if(!Y.success){let X=Y.error.issues[0],q=X?.path.length?X.path.join("."):"root",G=X?.message??"Invalid project overlay policy";throw a("validate",`Invalid project overlay policy at ${_}: ${q} ${G}`)}let z=Y.data.include??[],I=Y.data.exclude??[];return vH(_,"include",z),vH(_,"exclude",I),{include:z,exclude:I}}async function Kk($,_){let U;try{U=await o6(_)}catch(J){let Y=J.code;if(Y==="ENOENT"||Y==="ENOTDIR")return null;throw a("read",`Failed to inspect project overlay policy at ${_}: ${C$(J)}`)}if(!U.isSymbolicLink())return _;let Q;try{Q=await m0($)}catch(J){throw a("validate",`Unable to resolve project config directory ${$}: ${C$(J)}`)}let v;try{v=await m0(_)}catch(J){let Y=J.code;if(Y==="ENOENT"||Y==="ENOTDIR")throw a("validate",`Broken symlink in project overlay policy: ${_}`);throw a("read",`Failed to inspect project overlay policy symlink at ${_}: ${C$(J)}`)}if(!RY(Q,v))throw a("validate",`Symlink escapes project overlay policy scope: ${_}`);return v}function Hk($,_){for(let U of _.include)if(new OY(NY(U)).match($))return!0;for(let U of _.exclude)if(new OY(NY(U)).match($))return!1;return!0}function Wk($,_){return $.filter((U)=>Hk(U.overlayRelativePath,_)).map((U)=>({sourcePath:U.sourcePath,destinationRelativePath:U.overlayRelativePath,sourceSnapshot:U.sourceSnapshot}))}async function YH($,_,U){let Q;try{Q=await m0(_)}catch(v){let J=v.code;if(J==="ENOENT"||J==="ENOTDIR")throw a("validate",`Broken symlink in project overlay scope: ${U}`);throw a("read",`Failed to inspect symlink at ${U}: ${C$(v)}`)}if(!RY($,Q))throw a("validate",`Symlink escapes project overlay scope: ${U}`);throw a("validate",`Symlink entries are not supported in project overlay scope: ${U}`)}async function zH($,_,U,Q,v){let J;try{J=await o6(_)}catch(z){throw a("read",`Failed to inspect project overlay path ${U}: ${C$(z)}`)}if(J.isSymbolicLink())await YH($,_,U);let Y=s_(J);if(J.isDirectory()){await v.beforeDirectoryRead?.({absolutePath:_,overlayRelativePath:U});let z;try{z=await QH(_)}catch(I){throw a("read",`Failed to read project overlay directory ${U}: ${C$(I)}`)}z.sort((I,X)=>I.localeCompare(X));for(let I of z){let X=A6(_,I),q=x8(A6(U,I));await zH($,X,q,Q,v)}await f0({absolutePath:_,overlayRelativePath:U,expectedSnapshot:Y,phase:"overlay discovery",mustRemainDirectory:!0});return}if(!J.isFile())return;Q.push({sourcePath:_,overlayRelativePath:x8(U),sourceSnapshot:Y})}async function bk($,_={}){let U;try{U=await m0($)}catch(Y){throw a("validate",`Unable to resolve project config directory ${$}: ${C$(Y)}`)}let Q;try{Q=await o6($)}catch(Y){throw a("validate",`Unable to inspect project overlay root ${$}: ${C$(Y)}`)}if(!Q.isDirectory())throw a("validate",`Project overlay root changed before discovery: ${$}. ${r6}`);let v=s_(Q),J=[];for(let Y of Qk){let z=A6($,Y);await _.beforeScopeInspect?.({scope:Y,scopeAbsolutePath:z,projectConfigDir:$}),await f0({absolutePath:$,overlayRelativePath:".opencode",expectedSnapshot:v,phase:"overlay discovery",mustRemainDirectory:!0});let I;try{I=await o6(z)}catch(X){let q=X.code;if(q==="ENOENT"||q==="ENOTDIR")continue;throw a("read",`Failed to inspect project overlay scope ${Y}: ${C$(X)}`)}if(I.isSymbolicLink())await YH(U,z,Y);await zH(U,z,Y,J,_)}return J.sort((Y,z)=>Y.overlayRelativePath.localeCompare(z.overlayRelativePath)),J}function Bk($){let _=SY($),U=Uk($),Q=`${process.pid}-${nL()}`;return A6(_,`.${U}.ocx-tmp-${Q}`)}async function Zk($,_){let U=Bk(_);try{await rL($,U),await eL(U,_)}catch(Q){try{await _k(U)}catch{}throw Q}}async function Vk($,_,U={}){let Q=U.publishAtomically??Zk,v;try{v=await o6(_)}catch(Y){throw a("validate",`Unable to inspect merged overlay root ${_}: ${C$(Y)}`)}if(!v.isDirectory())throw a("validate",`Merged overlay root is not a directory: ${_}`);let J=s_(v);for(let Y of $){if(await U.beforeSourceVerification?.(Y),Y.sourceSnapshot)await f0({absolutePath:Y.sourcePath,overlayRelativePath:Y.destinationRelativePath,expectedSnapshot:Y.sourceSnapshot,phase:"overlay source verification",mustRemainFile:!0});await f0({absolutePath:_,overlayRelativePath:".merged",expectedSnapshot:J,phase:"overlay destination verification",mustRemainDirectory:!0,compareContent:!1});let z;try{z=A4(_,Y.destinationRelativePath)}catch(G){throw a("validate",`Overlay destination path is invalid (${Y.destinationRelativePath}): ${C$(G)}`)}await P8(_,z,Y.destinationRelativePath);let I=SY(z);await U.beforeDestinationParentCreate?.({operation:Y,destinationPath:z,destinationParentPath:I}),await P8(_,z,Y.destinationRelativePath);try{await tL(I,{recursive:!0})}catch(G){throw a("copy",`Failed to copy overlay file ${Y.destinationRelativePath}: ${C$(G)}`)}await P8(_,z,Y.destinationRelativePath);let X;try{X=await o6(I)}catch(G){throw a("validate",`Failed to inspect overlay destination parent (${Y.destinationRelativePath}): ${C$(G)}`)}if(!X.isDirectory())throw a("validate",`Overlay destination parent changed before publish (${Y.destinationRelativePath}). ${r6}`);let q=s_(X);await U.beforeDestinationPublish?.({operation:Y,destinationPath:z,destinationParentPath:I}),await f0({absolutePath:_,overlayRelativePath:".merged",expectedSnapshot:J,phase:"overlay destination publish",mustRemainDirectory:!0,compareContent:!1}),await f0({absolutePath:I,overlayRelativePath:Y.destinationRelativePath,expectedSnapshot:q,phase:"overlay destination publish",mustRemainDirectory:!0,compareContent:!1}),await P8(_,z,Y.destinationRelativePath);try{await Q(Y.sourcePath,z)}catch(G){if(G instanceof n)throw G;throw a("copy",`Failed to copy overlay file ${Y.destinationRelativePath}: ${C$(G)}`)}}}async function Dk($,_){let U;try{U=await QH($)}catch(Q){throw a("copy",`Failed to read profile directory ${$}: ${C$(Q)}`)}for(let Q of U){let v=A6($,Q),J=A6(_,Q);try{await oL(v,J,{recursive:!0,force:!0,errorOnExist:!1})}catch(Y){throw a("copy",`Failed to copy profile base file ${Q}: ${C$(Y)}`)}}}async function UH($){try{await $k($,{recursive:!0,force:!0})}catch(_){throw a("cleanup",`Failed to remove temporary merged config directory ${$}: ${C$(_)}`)}}function Mk($,_){let U=x8(TY($,_));if(!U||U===".")throw a("validate",`Overlay source path failed relative parsing: ${_}`);if(U===".."||U.startsWith("../")||JH(U))throw a("validate",`Overlay source path escapes project overlay scope: ${_}`);return U}function wk($,_){let U=_.map((Q)=>{if(!Q.sourceSnapshot)throw a("validate",`Overlay source snapshot missing for ${Q.destinationRelativePath}. ${r6}`);return{sourceRelativePath:Mk($,Q.sourcePath),destinationRelativePath:Q.destinationRelativePath,sourceSnapshot:Q.sourceSnapshot}});return{version:Yk,projectConfigDir:$,operations:U}}function Lk(){return null}async function kk($){let _=$.manifest.operations.map((U)=>({sourcePath:A4($.manifest.projectConfigDir,U.sourceRelativePath),destinationRelativePath:U.destinationRelativePath,sourceSnapshot:U.sourceSnapshot}));await Vk(_,$.mergedConfigDir,$.copySeams)}async function Ak($){if($.manifest.operations.length===0)return"best-effort-js";let _=$.nativeHelper??Lk();if(_)return await _.applyManifest($.manifest,$.mergedConfigDir),"native-fd";if($.hardeningMode==="native-fd-required")throw a("validate",`Native fd helper required for overlay merge, but none is available in this Bun/Node runtime. ${r6}`);return await kk({manifest:$.manifest,mergedConfigDir:$.mergedConfigDir,copySeams:$.copySeams}),"best-effort-js"}async function Fk($){let _=SY($),U;try{U=await m0(_)}catch(v){throw a("validate",`Unable to resolve project directory ${_}: ${C$(v)}`)}let Q;try{Q=await m0($)}catch(v){throw a("validate",`Unable to resolve project config directory ${$}: ${C$(v)}`)}if(!RY(U,Q))throw a("validate",`Project .opencode root resolves outside project directory: ${$}`);return Q}function Ok($){if($ instanceof n)return $;return a("copy",`Failed to prepare temporary merged config directory: ${C$($)}`)}async function IH($){let _=b1($.projectDir),U=$.hardeningMode??"best-effort-js",Q=null;try{Q=await aL(A6(vk(),Jk)),await Dk($.profileDir,Q);let v="best-effort-js";if(_){let Y=await Fk(_),z=await jk(Y),I=await bk(Y,$.seams?.collection),X=Wk(I,z),q=wk(Y,X);v=await Ak({manifest:q,mergedConfigDir:Q,hardeningMode:U,copySeams:$.seams?.copy,nativeHelper:$.seams?.nativeHelper})}let J=Q;return{path:J,cleanup:()=>UH(J),hardeningLevel:v}}catch(v){let J=Ok(v);if(Q)try{await UH(Q)}catch(Y){J.message=`${J.message}
172
+ Cleanup warning: ${C$(Y)}`}throw J}}var Qk,Jk="ocx-oc-merged-",Yk=1,r6="Full TOCTOU/symlink-swap hardening requires an fd-based native helper transaction.",Gk;var XH=b(()=>{c4();B6();Z4();z$();X1();Qk=["agent","agents","skill","skills"];Gk=K.object({include:K.array(K.string()).optional(),exclude:K.array(K.string()).optional()}).passthrough()});import*as j6 from"path";function Nk($){let _=new Set,U=[];for(let Q=$.length-1;Q>=0;Q--){let v=$[Q];if(!_.has(v))_.add(v),U.unshift(v)}return U}function Sk($){return $.configBin??$.envBin??"opencode"}function qH($){return $.includes("/")||$.includes("\\")}function Tk($){let{configuredBin:_,cwd:U}=$,Q=$.resolveExecutable??((J)=>Bun.which(J));if(!_.trim())throw Error("OpenCode launcher is empty and cannot be resolved to a stable path");if(qH(_))return j6.isAbsolute(_)?_:j6.resolve(U,_);let v=Q(_);if(!v)throw Error(`OpenCode launcher "${_}" is not available in PATH and cannot be used as OPENCODE_BIN`);return j6.isAbsolute(v)?v:j6.resolve(U,v)}function Rk($){let _=$.resolveExecutable??((X)=>Bun.which(X)),U=$.argv??process.argv,Q=$.execPath??process.execPath,v=$.isCompiledBinary??(typeof Bun<"u"&&typeof Bun.main==="string"&&Bun.main.startsWith("/$bunfs/")),J=$.inheritedOcxBin?.trim(),Y=v?Q:U[1],z=J&&J.length>0?J:Y;if(!z?.trim())throw Error("OCX executable path is empty and cannot be resolved from the current process");if(qH(z))return j6.isAbsolute(z)?z:j6.resolve($.cwd,z);let I=_(z);if(!I)throw Error(`OCX executable "${z}" is not available in PATH and cannot be persisted as OCX_BIN`);return j6.isAbsolute(I)?I:j6.resolve($.cwd,I)}function Ek($){let _=Boolean($.profileName),{OPENCODE_DISABLE_PROJECT_CONFIG:U,OPENCODE_BIN:Q,OCX_CONTEXT:v,OCX_BIN:J,OCX_PROFILE:Y,...z}=$.baseEnv;return{...z,...$.opencodeBin!==void 0&&{OPENCODE_BIN:$.opencodeBin},..._&&{OPENCODE_DISABLE_PROJECT_CONFIG:"true"},OPENCODE_CONFIG_DIR:$.configDir??(_?p$($.profileName):O4()),...$.configContent&&{OPENCODE_CONFIG_CONTENT:$.configContent},..._&&{OCX_CONTEXT:"1"},..._&&$.ocxBin&&{OCX_BIN:$.ocxBin},...$.profileName&&{OCX_PROFILE:$.profileName}}}function GH($){$.command("oc").alias("opencode").description("Launch OpenCode with resolved configuration").option("-p, --profile <name>","Use specific profile").option("--no-rename","Disable terminal/tmux window renaming").allowUnknownOption().allowExcessArguments(!0).action(async(_,U)=>{try{await Pk(U.args,_)}catch(Q){_$(Q)}})}async function Pk($,_){let U=process.cwd(),Q=await q6.create(U,{profile:_.profile}),v=Q.resolve(),J=Q.getProfile();if(v.profileName)W.info(`Using profile: ${v.profileName}`);let Y=J?.ocx,z=_.rename!==!1&&Y?.renameWindow!==!1;if(v.profileName){let u=L6(v.profileName);if(!await Bun.file(u).exists())W.warn(`No opencode.jsonc found at ${u}. Create one to customize OpenCode settings.`)}let I=Array.isArray(v.opencode.instructions)?v.opencode.instructions:[],X=[...v.instructions,...I],q=Nk(X),G=q.length>0||Object.keys(v.opencode).length>0?{...v.opencode,instructions:q.length>0?q:void 0}:void 0,j=null,H=null,Z=null,V=null,S=null,T=()=>{if(j)j.kill("SIGINT");else S=130},r=()=>{if(j)j.kill("SIGTERM");else S=143},A=()=>{if(z)FY()};try{if(process.on("SIGINT",T),process.on("SIGTERM",r),process.on("exit",A),S!==null){V=S;return}if(v.profileName)H=await IH({projectDir:U,profileDir:p$(v.profileName)});if(S!==null){V=S;return}if(z){eK();let o=await rK(U);if(S!==null){V=S;return}sK($H(U,v.profileName??"default",o))}if(S!==null){V=S;return}let u=Sk({configBin:Y?.bin,envBin:process.env.OPENCODE_BIN}),k=Boolean(v.profileName),O=k?Tk({configuredBin:u,cwd:U}):u,w=k?Rk({cwd:U,inheritedOcxBin:process.env.OCX_BIN}):void 0,v$=G?JSON.stringify(G):void 0;try{j=Bun.spawn({cmd:[O,...$],cwd:U,env:Ek({baseEnv:process.env,profileName:v.profileName??void 0,ocxBin:w,opencodeBin:O,configDir:H?.path,configContent:v$}),stdin:"inherit",stdout:"inherit",stderr:"inherit"})}catch(o){throw a("spawn",`Failed to launch OpenCode binary "${u}": ${o instanceof Error?o.message:String(o)}`)}V=await j.exited}catch(u){Z=u instanceof Error?u:a("spawn",`OpenCode process failed: ${String(u)}`)}finally{if(process.off("SIGINT",T),process.off("SIGTERM",r),process.off("exit",A),z)FY();if(H)try{await H.cleanup()}catch(u){if(Z!==null||S!==null||V!==null&&V!==0)W.warn(`Cleanup warning: ${u instanceof Error?u.message:String(u)}`);else Z=u instanceof Error?u:a("cleanup",`Failed to remove temporary merged config directory: ${String(u)}`)}}if(Z)throw Z;if(V!==null)process.exit(V)}var jH=b(()=>{g_();Z4();oK();c$();i$();p6();_H();XH()});import{existsSync as g0}from"fs";import{mkdir as EY,mkdtemp as xk,rename as uk,rm as KH,writeFile as yk}from"fs/promises";import{dirname as HH,join as u8,relative as Ck}from"path";function WH($,_,U){let Q=U instanceof Error?U.message:String(U);return`${$} "${_}" (${Q})`}function VH($,_){let[U,Q]=_.split("/");if(!U||!Q)return;return`${d$($)}/components/${Q}.json`}function bH($){if(!$)return null;let[_,U,...Q]=$.split("/");if(!_||!U||Q.length>0)return null;return{registryName:_,componentName:U}}function fk($,_){if(!$)return{};let U;try{let Y=new URL($),z=Y.pathname.match(/(?:^|\/)components\/([^/]+)\.json$/);if(z?.[1])U=decodeURIComponent(z[1]);else{let I=Y.pathname.match(/(?:^|\/)components\/([^/]+)\/.+$/);if(I?.[1])U=decodeURIComponent(I[1])}}catch{}let Q=d$($),v,J=-1;for(let[Y,z]of Object.entries(_)){let I=d$(z.url);if(!(Q===I||Q.startsWith(`${I}/`))||I.length<=J)continue;v=Y,J=I.length}return{registryName:v,componentName:U}}function mk($){let _=$.depRefs[0]??`${$.namespace}/${$.component}`,U={...$.profileRegistries,...$.profileRegistries[$.namespace]?{}:{[$.namespace]:{url:$.registryUrl}}},Q=$.error.registryName,v=$.error.qualifiedName,J=bH(v);if(!Q&&J)Q=J.registryName;let Y=J?.componentName,z=v&&!J&&!v.includes("/")?v:void 0,I=fk($.error.url,U);if(!Q&&I.registryName)Q=I.registryName;let X=Y??z??I.componentName;if((!v||!J)&&Q&&X)v=`${Q}/${X}`;if(!v)v=_;if(!Q)Q=bH(v)?.registryName??$.namespace;let q=U[Q]?.url||(Q===$.namespace?$.registryUrl:void 0);return{registryName:Q,qualifiedName:v,fallbackUrl:$.error.url||(q?VH(q,v):void 0)}}function BH($,_){let U=$.phase??_.fallbackPhase,Q=$.url??_.fallbackUrl,v=[`phase: ${U}`,`qualifiedName: ${_.qualifiedName}`,`registryContext: ${_.registryContext}`,`registryName: ${_.registryName}`,...Q?[`url: ${Q}`]:[]];return new E$(`${$.message} (${v.join(", ")})`,{url:Q,status:$.status,statusText:$.statusText,phase:U,qualifiedName:_.qualifiedName,registryContext:_.registryContext,registryName:_.registryName})}function ZH($,_){if(!$.startsWith(".opencode/"))throw new M(`Invalid embedded target "${$}": expected .opencode/ prefix for embedded profile files.`);let U=$.slice(10);if(!U)throw new M(`Invalid embedded target "${$}": missing path after .opencode/ prefix.`);let Q;try{Q=A4(_,U)}catch(J){if(J instanceof U4)throw new M(`Invalid embedded target "${$}": ${J.message}`);throw J}let v=Ck(_,Q).replace(/\\/g,"/");if(v==="."||v==="")throw new M(`Invalid embedded target "${$}": target must resolve to a file path.`);return v}async function PY($){let{namespace:_,component:U,profileName:Q,registryUrl:v,quiet:J}=$;if(!I6.safeParse(Q).success)throw new M(`Invalid profile name: "${Q}". Profile names must start with a letter and contain only alphanumeric characters, dots, underscores, or hyphens.`);let z;if(_)z=_;else throw new M(`Registry name is required for URL-based profile installs.
131
173
 
132
- Use a qualified component reference (e.g., 'my-registry/${B}') or specify --name to provide a registry alias.`);let H=yD($),J=`${q}/${B}`;if(F3(H))throw new gD(`Profile "${$}" already exists. Remove it first with 'ocx profile rm ${$} --global'.`);let z=Q?null:jD({text:`Fetching ${J}...`});z?.start();let M;try{M=await R3(_,B)}catch(O){if(z?.fail(`Failed to fetch ${J}`),O instanceof RD)throw S5(O,{registryContext:"source",registryName:q,qualifiedName:J,fallbackPhase:"packument-fetch",fallbackUrl:I5(_,J)});if(O instanceof MD)throw new MD(`Profile component "${J}" not found in registry.
174
+ Use a qualified component reference (e.g., 'my-registry/${U}') or specify --name to provide a registry alias.`);let I=p$(Q),X=`${z}/${U}`;if(g0(I))throw new t$(`Profile "${Q}" already exists. Remove it first with 'ocx profile rm ${Q} --global'.`);let G=J?null:V$({text:`Fetching ${X}...`});G?.start();let j;try{j=await c_(v,U)}catch(k){if(G?.fail(`Failed to fetch ${X}`),k instanceof E$)throw BH(k,{registryContext:"source",registryName:z,qualifiedName:X,fallbackPhase:"packument-fetch",fallbackUrl:VH(v,X)});if(k instanceof B$)throw new B$(`Profile component "${X}" not found in registry.
133
175
 
134
- Check the component name and ensure the registry is configured.`);throw O}if(M.type!=="profile")throw z?.fail("Invalid component type"),new U(`Component "${J}" is type "${M.type}", not "profile".
176
+ Check the component name and ensure the registry is configured.`);throw k}if(j.type!=="profile")throw G?.fail("Invalid component type"),new M(`Component "${X}" is type "${j.type}", not "profile".
135
177
 
136
- Only profile components can be installed with 'ocx profile add --source <ns/comp> --global'.`);let A=p2(M);z?.succeed(`Fetched ${J}`);let K=Q?null:jD({text:"Downloading profile files..."});K?.start();let j=[],S=[];for(let O of A.files){let b=await e2(_,B,O.path),L={path:O.path,target:O.target,content:Buffer.from(b)};if(O.target.startsWith(".opencode/"))S.push(L);else j.push(L)}K?.succeed(`Downloaded ${A.files.length} files`);let Z=X2();await C6(Z,{recursive:!0,mode:448});let s=await cX(x8(Z,".staging-")),N=!1,x=!1;try{let O=Q?null:jD({text:"Writing profile files..."});O?.start();let b=new Map;for(let p of j){let FD=hF(p.target,s),KD=x8(s,FD);$F(b,{absolutePath:KD,relativePath:FD,content:p.content,source:`${B}:${p.path}`})}for(let p of S){let FD=k5(p.target,s),KD=hF(FD,s),k=x8(s,KD);$F(b,{absolutePath:k,relativePath:KD,content:p.content,source:`${B}:${p.path}`})}for(let p of b.values()){let FD=p.absolutePath,KD=R5(FD);if(!F3(KD))await C6(KD,{recursive:!0});await pX(FD,p.content)}O?.succeed(`Wrote ${b.size} profile files`),await K0(s,{version:1,root:H,installed:{}});let L=Q?null:jD({text:"Moving to profile directory..."});L?.start();let e=R5(H);if(!F3(e))await C6(e,{recursive:!0,mode:448});if(await lX(s,H),N=!0,L?.succeed("Profile installed"),M.dependencies.length>0){let p=Q?null:jD({text:"Installing dependencies..."});p?.start();let FD=M.dependencies.map((k)=>k.includes("/")?k:`${q}/${k}`),KD={};try{let k=x8(H,"ocx.jsonc");if(F3(k)){let f=await Bun.file(k).text(),_D=ND(f),r=Y2.safeParse(_D);if(r.success)KD=r.data.registries??{};else if(eD(_D)&&"registries"in _D)throw new c(`Invalid registries in profile "${$}": ${r.error.message}`)}await V6(FD,{profile:$,quiet:Q},{cwd:H,getRegistries:()=>KD,getComponentPath:()=>""}),p?.succeed(`Installed ${M.dependencies.length} dependencies`)}catch(k){if(p?.fail("Failed to install dependencies"),k instanceof RD){let i=sX({error:k,depRefs:FD,namespace:q,component:B,registryUrl:_,profileRegistries:KD});throw S5(k,{registryContext:"dependency",registryName:i.registryName,qualifiedName:i.qualifiedName,fallbackPhase:"packument-fetch",fallbackUrl:i.fallbackUrl})}throw k}}if(x=!0,!Q){G.info(""),G.success(`Installed profile "${$}" from ${J}`),G.info(""),G.info("Profile contents:");for(let p of j)G.info(` ${p.target}`);for(let p of S){let FD=k5(p.target,H);G.info(` ${FD}`)}}}catch(O){let b=[];try{if(F3(s))await b5(s,{recursive:!0})}catch(L){b.push(Z5("Profile add rollback cleanup warning: failed to remove staging directory",s,L))}if(N&&!x)try{if(F3(H))await b5(H,{recursive:!0,force:!0})}catch(L){b.push(Z5("Profile add rollback cleanup warning: failed to remove promoted profile",H,L))}if(!Q)for(let L of b)G.warn(L);throw O}}var T5=V(()=>{b0();G0();Q8();DF();tD();fF();P0();I1();$D();fD();c2();A8();m0();E6()});function aX(D){if(!D?.trim())throw new U("--source value cannot be empty");let F=D.trim();if((F.match(/\//g)||[]).length!==1)throw new U(`Invalid --source format: "${D}". Expected: namespace/component`);let[$,_]=F.split("/").map((Q)=>Q.trim());if(!$||!_)throw new U(`Invalid --source format: "${D}". Expected: namespace/component`);return{namespace:$,component:_}}async function oX(){let D=I2(),F=Bun.file(D);if(!await F.exists())return null;try{let B=await F.text(),$=ND(B,[],{allowTrailingComma:!0});return Y2.parse($)}catch(B){if(B instanceof Error)throw new c(`Failed to parse global config at "${D}": ${B.message}
178
+ Only profile components can be installed with 'ocx profile add --source <ns/comp> --global'.`);let H=G1(j);G?.succeed(`Fetched ${X}`);let Z=J?null:V$({text:"Downloading profile files..."});Z?.start();let V=[],S=[];for(let k of H.files){let O=await V1(v,U,k.path),w={path:k.path,target:k.target,content:Buffer.from(O)};if(k.target.startsWith(".opencode/"))S.push(w);else V.push(w)}Z?.succeed(`Downloaded ${H.files.length} files`);let T=w6();await EY(T,{recursive:!0,mode:448});let r=await xk(u8(T,".staging-")),A=!1,u=!1;try{let k=J?null:V$({text:"Writing profile files..."});k?.start();let O=new Map;for(let o of V){let Q$=w0(o.target,r),D$=u8(r,Q$);L1(O,{absolutePath:D$,relativePath:Q$,content:o.content,source:`${U}:${o.path}`})}for(let o of S){let Q$=ZH(o.target,r),D$=w0(Q$,r),x=u8(r,D$);L1(O,{absolutePath:x,relativePath:D$,content:o.content,source:`${U}:${o.path}`})}for(let o of O.values()){let Q$=o.absolutePath,D$=HH(Q$);if(!g0(D$))await EY(D$,{recursive:!0});await yk(Q$,o.content)}k?.succeed(`Wrote ${O.size} profile files`),await x4(r,{version:1,root:I,installed:{}});let w=J?null:V$({text:"Moving to profile directory..."});w?.start();let v$=HH(I);if(!g0(v$))await EY(v$,{recursive:!0,mode:448});if(await uk(r,I),A=!0,w?.succeed("Profile installed"),j.dependencies.length>0){let o=J?null:V$({text:"Installing dependencies..."});o?.start();let Q$=j.dependencies.map((x)=>x.includes("/")?x:`${z}/${x}`),D$={};try{let x=u8(I,"ocx.jsonc");if(g0(x)){let h=await Bun.file(x).text(),I$=x$(h),$$=V6.safeParse(I$);if($$.success)D$=$$.data.registries??{};else if(q4(I$)&&"registries"in I$)throw new n(`Invalid registries in profile "${Q}": ${$$.error.message}`)}await ZY(Q$,{profile:Q,quiet:J},{cwd:I,getRegistries:()=>D$,getComponentPath:()=>""}),o?.succeed(`Installed ${j.dependencies.length} dependencies`)}catch(x){if(o?.fail("Failed to install dependencies"),x instanceof E$){let t=mk({error:x,depRefs:Q$,namespace:z,component:U,registryUrl:v,profileRegistries:D$});throw BH(x,{registryContext:"dependency",registryName:t.registryName,qualifiedName:t.qualifiedName,fallbackPhase:"packument-fetch",fallbackUrl:t.fallbackUrl})}throw x}}if(u=!0,!J){W.info(""),W.success(`Installed profile "${Q}" from ${X}`),W.info(""),W.info("Profile contents:");for(let o of V)W.info(` ${o.target}`);for(let o of S){let Q$=ZH(o.target,I);W.info(` ${Q$}`)}}}catch(k){let O=[];try{if(g0(r))await KH(r,{recursive:!0})}catch(w){O.push(WH("Profile add rollback cleanup warning: failed to remove staging directory",r,w))}if(A&&!u)try{if(g0(I))await KH(I,{recursive:!0,force:!0})}catch(w){O.push(WH("Profile add rollback cleanup warning: failed to remove promoted profile",I,w))}if(!J)for(let w of O)W.warn(w);throw k}}var DH=b(()=>{c4();Z4();_8();D1();X4();M0();o4();FJ();z$();i$();X1();G8();e4();VY()});function gk($){if(!$?.trim())throw new M("--source value cannot be empty");let _=$.trim();if((_.match(/\//g)||[]).length!==1)throw new M(`Invalid --source format: "${$}". Expected: namespace/component`);let[Q,v]=_.split("/").map((J)=>J.trim());if(!Q||!v)throw new M(`Invalid --source format: "${$}". Expected: namespace/component`);return{namespace:Q,component:v}}async function hk(){let $="global ocx config";try{let _=await YG();$=_.path;let U=_.content,Q=x$(U,[],{allowTrailingComma:!0});return V6.parse(Q)}catch(_){if(_ instanceof i6)throw _;if(_ instanceof Error)throw new n(`Failed to parse global config at "${$}": ${_.message}
137
179
 
138
- Check the file for syntax errors or run: ocx config edit --global`);throw B}}async function rX(D){let F=await oX();if(!F)throw new c(`Registry "${D}" is not configured globally.
180
+ Check the file for syntax errors or run: ocx config edit --global`);throw _}}async function ck($){let _;try{_=await hk()}catch(Q){if(Q instanceof i6)throw new n(`Registry "${$}" is not configured globally.
139
181
 
140
182
  Profile installation requires global registry configuration.
141
- Run: ocx registry add <url> --name ${D} --global`);let B=F.registries[D];if(!B)throw new c(`Registry "${D}" is not configured globally.
183
+ ${Q.message}
184
+ Run: ocx registry add <url> --name ${$} --global`);throw Q}let U=_.registries[$];if(!U)throw new n(`Registry "${$}" is not configured globally.
142
185
 
143
186
  Profile installation requires global registry configuration.
144
- Run: ocx registry add <url> --name ${D} --global`);return{config:F,registryUrl:B.url}}function v5(D){D.command("add <name>").description("Create a new profile (--global required), clone from existing, or install from registry").option("--clone <profile>","Clone from existing global profile").option("--source <namespace/component>","Install from registry (requires --global)").option("--from <url>","Ephemeral registry URL for --source (does not persist)").option("-g, --global","Create global profile (required \u2014 local profiles are unsupported)").option("--json","Output as JSON").addHelpText("after",`
187
+ Run: ocx registry add <url> --name ${$} --global`);return{config:_,registryUrl:U.url}}function MH($){$.command("add <name>").description("Create a new profile (--global required), clone from existing, or install from registry").option("--clone <profile>","Clone from existing global profile").option("--source <namespace/component>","Install from registry (requires --global)").option("--from <url>","Ephemeral registry URL for --source (does not persist)").option("-g, --global","Create global profile (required \u2014 local profiles are unsupported)").option("--json","Output as JSON").addHelpText("after",`
145
188
  Examples:
146
189
  $ ocx profile add work --global # Create global profile (~/.config/opencode/profiles/work/)
147
190
  $ ocx profile add work --clone dev --global # Clone from existing global profile
148
191
  $ ocx profile add work --source kdco/minimal --global # Install from configured registry
149
192
  $ ocx profile add work --source kdco/minimal --from http://r.com --global # Install from ephemeral registry
150
- `).action(async(F,B)=>{try{let $=await tX(F,B);if(B.json)LD({success:!0,data:$})}catch($){t($,{json:B.json})}})}async function tX(D,F){let B=F.json===!0;if(F.clone&&(F.source||F.from))throw new U(`--clone cannot be used with --source or --from.
193
+ `).action(async(_,U)=>{try{let Q=await lk(_,U);if(U.json)O$({success:!0,data:Q})}catch(Q){_$(Q,{json:U.json})}})}async function lk($,_){let U=_.json===!0;if(_.clone&&(_.source||_.from))throw new M(`--clone cannot be used with --source or --from.
151
194
 
152
195
  Use one of:
153
196
  ocx profile add <name> --clone <profile> --global # Clone existing profile
154
- ocx profile add <name> --source <ns/comp> --global # Install from registry`);if(F.from&&!F.source){let Q=F.from.trim(),Y=Q.startsWith("http://")||Q.startsWith("https://");if((Q.match(/\//g)||[]).length===1&&!Y)throw new U(`Invalid option: --from requires --source.
197
+ ocx profile add <name> --source <ns/comp> --global # Install from registry`);if(_.from&&!_.source){let J=_.from.trim(),Y=J.startsWith("http://")||J.startsWith("https://");if((J.match(/\//g)||[]).length===1&&!Y)throw new M(`Invalid option: --from requires --source.
155
198
 
156
199
  Migration: The --from option now only accepts registry URLs.
157
200
  Use --source for namespace/component references:
158
201
 
159
- ocx profile add ${D} --source ${Q} --global`);if(Y){let H;try{let J=new URL(Q),X=J.pathname.split("/").filter(Boolean);if(X.length>=2){let z=X.slice(-2).join("/");J.pathname=X.slice(0,-2).join("/")||"/";let M=J.toString().replace(/\/$/,"");H=`Migration: Separate the registry URL and component:
202
+ ocx profile add ${$} --source ${J} --global`);if(Y){let I;try{let X=new URL(J),q=X.pathname.split("/").filter(Boolean);if(q.length>=2){let G=q.slice(-2).join("/");X.pathname=q.slice(0,-2).join("/")||"/";let j=X.toString().replace(/\/$/,"");I=`Migration: Separate the registry URL and component:
160
203
 
161
- ocx profile add ${D} --source ${z} --from ${M} --global`}else H=`Migration: Separate the registry URL and component:
204
+ ocx profile add ${$} --source ${G} --from ${j} --global`}else I=`Migration: Separate the registry URL and component:
162
205
 
163
- ocx profile add ${D} --source <namespace/component> --from <registry-url> --global`}catch{H=`Migration: Separate the registry URL and component:
206
+ ocx profile add ${$} --source <namespace/component> --from <registry-url> --global`}catch{I=`Migration: Separate the registry URL and component:
164
207
 
165
- ocx profile add ${D} --source <namespace/component> --from <registry-url> --global`}throw new U(`Invalid option: --from requires --source.
208
+ ocx profile add ${$} --source <namespace/component> --from <registry-url> --global`}throw new M(`Invalid option: --from requires --source.
166
209
 
167
- ${H}`)}throw new U(`Invalid option: --from requires --source.
210
+ ${I}`)}throw new M(`Invalid option: --from requires --source.
168
211
 
169
212
  Did you mean to clone a profile?
170
213
 
171
- ocx profile add ${D} --clone ${Q} --global`)}if(F.source&&!F.global)throw new U(`--source requires --global flag.
214
+ ocx profile add ${$} --clone ${J} --global`)}if(_.source&&!_.global)throw new M(`--source requires --global flag.
172
215
 
173
216
  Profile installation from registries is only supported for global profiles:
174
217
 
175
- ocx profile add ${D} --source ${F.source} --global`);if(F.from){let Q=F.from.trim();try{let Y=new URL(Q);if(Y.protocol!=="http:"&&Y.protocol!=="https:")throw new U(`Invalid --from value: "${F.from}".
218
+ ocx profile add ${$} --source ${_.source} --global`);if(_.from){let J=_.from.trim();try{let Y=new URL(J);if(Y.protocol!=="http:"&&Y.protocol!=="https:")throw new M(`Invalid --from value: "${_.from}".
176
219
 
177
220
  --from must be a registry URL with http:// or https:// protocol.
178
- For profile cloning, use --clone instead.`);if(!Y.hostname)throw new U(`Invalid --from value: "${F.from}".
221
+ For profile cloning, use --clone instead.`);if(!Y.hostname)throw new M(`Invalid --from value: "${_.from}".
179
222
 
180
223
  --from must be a valid registry URL with a hostname.
181
- Example: --from https://registry.example.com`)}catch(Y){if(Y instanceof U)throw Y;throw new U(`Invalid --from value: "${F.from}".
224
+ Example: --from https://registry.example.com`)}catch(Y){if(Y instanceof M)throw Y;throw new M(`Invalid --from value: "${_.from}".
182
225
 
183
226
  --from must be a valid registry URL (http:// or https://).
184
- Example: --from https://registry.example.com`)}}if(!F.global)throw new c(`Local profiles are unsupported. Use --global to create a global profile.
227
+ Example: --from https://registry.example.com`)}}if(!_.global)throw new n(`Local profiles are unsupported. Use --global to create a global profile.
185
228
 
186
- ocx profile add ${D} --global`);let $="global",_=await uD.requireInitialized();if(F.clone)return await DG(_,D,F.clone,B),{name:D,scope:$,mode:"clone",cloneFrom:F.clone};if(F.source){let{namespace:Q,component:Y}=aX(F.source),q;if(F.from)q=xD(F.from.trim()),await u6({namespace:Q,component:Y,profileName:D,registryUrl:q,quiet:B});else q=(await rX(Q)).registryUrl,await u6({namespace:Q,component:Y,profileName:D,registryUrl:q,quiet:B});return{name:D,scope:$,mode:"registry",registry:{namespace:Q,component:Y,url:q,ephemeral:Boolean(F.from)}}}return await eX(_,D,B),{name:D,scope:$,mode:"empty"}}async function eX(D,F,B){if(await D.exists(F))throw new O2(F,`Remove it first with 'ocx profile rm ${F} --global'.`);if(await D.add(F),!B)G.success(`Created global profile "${F}"`)}async function DG(D,F,B,$){if(await D.exists(F))throw new O2(F,`Remove it first with 'ocx profile rm ${F} --global'.`);try{await D.get(B)}catch(q){if(q instanceof CD)throw new CD(B,`Profile '${B}' not found in global scope.`);if(q instanceof zD)throw q;throw new U(`Failed to load profile '${B}': ${q instanceof Error?q.message:String(q)}`)}await D.add(F);let Q=Q0(B),Y=Q0(F);if(await E9(Q,Y),!$)G.success(`Created global profile "${F}" (cloned from "${B}")`)}var C5=V(()=>{b0();_8();a0();G0();fF();$D();PD();fD();T5()});function u5(D){D.command("list").alias("ls").description("List profiles (use --global; local profiles are unsupported)").option("-g, --global","List global profiles (required \u2014 local profiles are unsupported)").addOption(L0.json()).action(async(F)=>{try{await FG(F)}catch(B){t(B,{json:F.json})}})}async function FG(D){if(!D.global)throw new c(`Local profiles are unsupported. Use --global to list global profiles.
229
+ ocx profile add ${$} --global`);let Q="global",v=await h$.requireInitialized();if(_.clone)return await pk(v,$,_.clone,U),{name:$,scope:Q,mode:"clone",cloneFrom:_.clone};if(_.source){let{namespace:J,component:Y}=gk(_.source),z;if(_.from)z=d$(_.from.trim()),await PY({namespace:J,component:Y,profileName:$,registryUrl:z,quiet:U});else z=(await ck(J)).registryUrl,await PY({namespace:J,component:Y,profileName:$,registryUrl:z,quiet:U});return{name:$,scope:Q,mode:"registry",registry:{namespace:J,component:Y,url:z,ephemeral:Boolean(_.from)}}}return await dk(v,$,U),{name:$,scope:Q,mode:"empty"}}async function dk($,_,U){if(await $.exists(_))throw new m6(_,`Remove it first with 'ocx profile rm ${_} --global'.`);if(await $.add(_),!U)W.success(`Created global profile "${_}"`)}async function pk($,_,U,Q){if(await $.exists(_))throw new m6(_,`Remove it first with 'ocx profile rm ${_} --global'.`);try{await $.get(U)}catch(z){if(z instanceof m$)throw new m$(U,`Profile '${U}' not found in global scope.`);if(z instanceof b$)throw z;throw new M(`Failed to load profile '${U}': ${z instanceof Error?z.message:String(z)}`)}await $.add(_);let J=B4(U),Y=B4(_);if(await vG(J,Y),!Q)W.success(`Created global profile "${_}" (cloned from "${U}")`)}var wH=b(()=>{c4();e2();X6();Z4();M0();z$();c$();i$();DH()});function LH($){$.command("list").alias("ls").description("List profiles (use --global; local profiles are unsupported)").option("-g, --global","List global profiles (required \u2014 local profiles are unsupported)").addOption(f4.json()).action(async(_)=>{try{await ik(_)}catch(U){_$(U,{json:_.json})}})}async function ik($){if(!$.global)throw new n(`Local profiles are unsupported. Use --global to list global profiles.
187
230
 
188
- ocx profile list --global`);let B=await(await uD.requireInitialized()).list();if(D.json){console.log(JSON.stringify({profiles:B,initialized:!0},null,2));return}let $="Global profiles:",_="No global profiles found. Run 'ocx profile add <name> --global' to create one.";if(B.length===0){console.log(_);return}console.log($);for(let Q of B)console.log(` ${Q}`)}var P5=V(()=>{a0();$D();PD();x0()});function x5(D){D.command("move <old-name> <new-name>").alias("mv").description("Move (rename) a profile (use --global; local profiles are unsupported)").option("-g, --global","Move global profile (required \u2014 local profiles are unsupported)").option("--json","Output as JSON").action(async(F,B,$)=>{try{let _=await BG(F,B,$);if($.json)LD({success:!0,data:_})}catch(_){t(_,{json:$.json})}})}async function BG(D,F,B){if(!B.global)throw new c(`Local profiles are unsupported. Use --global to move a global profile.
231
+ ocx profile list --global`);let U=await(await h$.requireInitialized()).list();if($.json){console.log(JSON.stringify({profiles:U,initialized:!0},null,2));return}let Q="Global profiles:",v="No global profiles found. Run 'ocx profile add <name> --global' to create one.";if(U.length===0){console.log(v);return}console.log(Q);for(let J of U)console.log(` ${J}`)}var kH=b(()=>{X6();z$();c$();a4()});function AH($){$.command("move <old-name> <new-name>").alias("mv").description("Move (rename) a profile (use --global; local profiles are unsupported)").option("-g, --global","Move global profile (required \u2014 local profiles are unsupported)").option("--json","Output as JSON").action(async(_,U,Q)=>{try{let v=await nk(_,U,Q);if(Q.json)O$({success:!0,data:v})}catch(v){_$(v,{json:Q.json})}})}async function nk($,_,U){if(!U.global)throw new n(`Local profiles are unsupported. Use --global to move a global profile.
189
232
 
190
- ocx profile move ${D} ${F} --global`);let $=await uD.requireInitialized(),{warnActiveProfile:_}=await $.move(D,F);if(_&&!B.json)G.warn(`Moving active profile. Update OCX_PROFILE env var to "${F}".`);if(!B.json)G.success(`Moved global profile "${D}" \u2192 "${F}"`);return{from:D,to:F,scope:"global",warnActiveProfile:_}}var y5=V(()=>{a0();$D();PD();fD()});function f5(D){D.command("remove <name>").alias("rm").description("Delete a profile (use --global; local profiles are unsupported)").option("-g, --global","Remove global profile (required \u2014 local profiles are unsupported)").option("--json","Output as JSON").action(async(F,B)=>{try{let $=await $G(F,B);if(B.json)LD({success:!0,data:$})}catch($){t($,{json:B.json})}})}async function $G(D,F){if(!F.global)throw new c(`Local profiles are unsupported. Use --global to remove a global profile.
233
+ ocx profile move ${$} ${_} --global`);let Q=await h$.requireInitialized(),{warnActiveProfile:v}=await Q.move($,_);if(v&&!U.json)W.warn(`Moving active profile. Update OCX_PROFILE env var to "${_}".`);if(!U.json)W.success(`Moved global profile "${$}" \u2192 "${_}"`);return{from:$,to:_,scope:"global",warnActiveProfile:v}}var FH=b(()=>{X6();z$();c$();i$()});function OH($){$.command("remove <name>").alias("rm").description("Delete a profile (use --global; local profiles are unsupported)").option("-g, --global","Remove global profile (required \u2014 local profiles are unsupported)").option("--json","Output as JSON").action(async(_,U)=>{try{let Q=await rk(_,U);if(U.json)O$({success:!0,data:Q})}catch(Q){_$(Q,{json:U.json})}})}async function rk($,_){if(!_.global)throw new n(`Local profiles are unsupported. Use --global to remove a global profile.
191
234
 
192
- ocx profile remove <name> --global`);let B=await uD.requireInitialized();if(!await B.exists(D))throw new CD(D);if(await B.remove(D),!F.json)G.success(`Deleted global profile "${D}"`);return{name:D,scope:"global"}}var h5=V(()=>{a0();$D();PD();fD()});function m5(D){D.command("show [name]").description("Display profile contents (use --global; local profiles are unsupported)").option("-g, --global","Show global profile (required \u2014 local profiles are unsupported)").addOption(L0.json()).action(async(F,B)=>{try{await _G(F,B)}catch($){t($,{json:B.json})}})}async function _G(D,F){if(!F.global)throw new c(`Local profiles are unsupported. Use --global to show a global profile.
235
+ ocx profile remove <name> --global`);let U=await h$.requireInitialized();if(!await U.exists($))throw new m$($);if(await U.remove($),!_.json)W.success(`Deleted global profile "${$}"`);return{name:$,scope:"global"}}var NH=b(()=>{X6();z$();c$();i$()});function SH($){$.command("show [name]").description("Display profile contents (use --global; local profiles are unsupported)").option("-g, --global","Show global profile (required \u2014 local profiles are unsupported)").addOption(f4.json()).action(async(_,U)=>{try{await ok(_,U)}catch(Q){_$(Q,{json:U.json})}})}async function ok($,_){if(!_.global)throw new n(`Local profiles are unsupported. Use --global to show a global profile.
193
236
 
194
- ocx profile show [name] --global`);let B=await uD.requireInitialized(),$=D??await B.resolveProfile(),_=await B.get($);if(F.json){console.log(JSON.stringify(_,null,2));return}if(console.log(`Profile: ${_.name}`),console.log(`
195
- Files:`),console.log(` ocx.jsonc: ${Q0($)}`),_.opencode)console.log(` opencode.jsonc: ${G2($)}`);if(_.hasAgents)console.log(` AGENTS.md: ${a2($)}`);console.log(`
196
- OCX Config:`),console.log(JSON.stringify(_.ocx,null,2))}var g5=V(()=>{a0();G0();$D();PD();x0()});function d5(D){let F=D.command("profile").alias("p").description("Manage profiles (global only)");u5(F),v5(F),f5(F),x5(F),m5(F)}var c5=V(()=>{C5();P5();y5();h5();g5()});import{existsSync as QG}from"fs";import{dirname as l5,join as p5}from"path";async function YG(D,F,B){if(B.isLocked?.())throw Error("Registries are locked. Cannot add.");let $=D.trim();if(!$)throw new U("Registry URL is required");try{let K=new URL($);if(!["http:","https:"].includes(K.protocol))throw new U(`Invalid registry URL: ${$} (must use http or https)`)}catch(K){if(K instanceof U)throw K;throw new U(`Invalid registry URL: ${$}`)}let _=xD($),Q=F.name,Y=B.getRegistries(),q=Y[Q],H=qG(Y,_),{fetchRegistryIndex:J}=await Promise.resolve().then(() => (DF(),r9));await J(_);let X=q!==void 0,z=H!==null,M=X&&xD(q.url)===_,A=z&&H.name!==Q;if(F.dryRun){let K=[];if(X&&!M)K.push(`Registry '${Q}' already exists with a different URL (${q.url}). Run 'ocx registry remove ${Q}' first, then re-add.`);else if(A)K.push(`URL '${_}' is already registered under name '${H.name}'. Run 'ocx registry remove ${H.name}' first, then re-add.`);let j=X&&!M||A,S=X&&M,Z=B.targetLabel||"config";return{dryRun:!0,command:"registry add",wouldPerform:S?[]:[{action:"add",target:`registry:${Q}`,details:{url:_}}],validation:{passed:!j,warnings:K.length>0?K:void 0},summary:j?`Would fail: conflict detected for registry '${Q}'`:S?`Registry '${Q}' already configured with same URL (no-op)`:`Would add registry '${Q}' to ${Z}`}}if(X&&!M)throw new vF(Q,q.url,_,B.targetLabel);if(A)throw new vF(Q,_,_,B.targetLabel,H.name);if(X&&M)return{name:Q,url:_,updated:!1,alreadyConfigured:!0};return await B.setRegistry(Q,{url:_}),{name:Q,url:_,updated:!1,alreadyConfigured:!1}}function qG(D,F){for(let[B,$]of Object.entries(D))if(xD($.url)===F)return{name:B,config:$};return null}async function HG(D,F){if(F.isLocked?.())throw Error("Registries are locked. Cannot remove.");let B=F.getRegistries();if(!(D in B))throw Error(`Registry '${D}' not found.`);return await F.removeRegistry(D),{removed:D}}function JG(D){let F=D.getRegistries(),B=D.isLocked?.()??!1;return{registries:Object.entries(F).map(([_,Q])=>({name:_,url:Q.url})),locked:B}}async function P6(D,F,B){let $=F.getOptionValueSource("cwd")==="cli";if(D.global&&D.profile)throw new U("Cannot use both --global and --profile flags");if($&&D.profile)throw new U("Cannot use both --cwd and --profile flags");if(D.global&&$)throw new U("Cannot use both --global and --cwd flags");if(D.profile){if(N4(D.profile),!await(await uD.requireInitialized()).exists(D.profile))throw new CD(D.profile);let Y=Q0(D.profile);if(!QG(Y))throw new c(`Profile '${D.profile}' has no ocx.jsonc. Run 'ocx profile config ${D.profile}' to create it.`);return{scope:"profile",configPath:Y,configDir:l5(Y),targetLabel:`profile '${D.profile}' config`}}if(D.global){let Q=X0();return{scope:"global",configPath:p5(Q,"ocx.jsonc"),configDir:Q,targetLabel:"global config"}}let _=S2(B);return{scope:"local",configPath:_.path,configDir:_.exists?l5(_.path):p5(B,".opencode"),targetLabel:"local config"}}function i5(D){let F=D.command("registry").description("Manage registries"),B=F.command("add").description("Add a registry").argument("<url>","Registry URL").requiredOption("--name <name>","Registry alias (required, used as lookup key for alias/component refs)").option("--dry-run","Validate registry without adding to config");r0(B),K8(B),oD(B),B.action(async(Q,Y,q)=>{let H;try{let J=Y.cwd??process.cwd();H=await P6(Y,q,J);let{configDir:X,configPath:z}=H,M=await U0(X);if(!M){let j=H.scope==="global"?"Run 'ocx init --global' first.":H.scope==="profile"?`Run 'ocx profile config ${Y.profile}' to create it.`:"Run 'ocx init' first.";G.error(`${H.targetLabel} not found. ${j}`),process.exit(1)}let A=await YG(Q,Y,{getRegistries:()=>M.registries,isLocked:()=>M.lockRegistries??!1,setRegistry:async(j,S)=>{M.registries[j]=S,await e3(X,M,z)},targetLabel:H.targetLabel});if("dryRun"in A&&A.dryRun){z0(A,{json:Y.json,quiet:Y.quiet});return}let K=A;if(Y.json)LD({success:!0,data:K});else if(!Y.quiet)if(K.alreadyConfigured)G.info(`Registry already configured (no changes): ${K.name}`);else if(K.updated)G.success(`Updated registry in ${H.targetLabel}: ${K.name} -> ${K.url}`);else G.success(`Added registry to ${H.targetLabel}: ${K.name} -> ${K.url}`)}catch(J){t(J,{json:Y.json})}});let $=F.command("remove").description("Remove a registry").argument("<name>","Registry name");r0($),K8($),oD($),$.action(async(Q,Y,q)=>{try{let H=Y.cwd??process.cwd(),J=await P6(Y,q,H),X=await U0(J.configDir);if(!X){let M=J.scope==="global"?"Run 'ocx init --global' first.":J.scope==="profile"?`Run 'ocx profile config ${Y.profile}' to create it.`:"Run 'ocx init' first.";G.error(`${J.targetLabel} not found. ${M}`),process.exit(1)}let z=await HG(Q,{getRegistries:()=>X.registries,isLocked:()=>X.lockRegistries??!1,removeRegistry:async(M)=>{delete X.registries[M],await e3(J.configDir,X,J.configPath)}});if(Y.json)LD({success:!0,data:z});else if(!Y.quiet)G.success(`Removed registry from ${J.targetLabel}: ${z.removed}`)}catch(H){t(H,{json:Y.json})}});let _=F.command("list").description("List configured registries");r0(_),K8(_),oD(_),_.action(async(Q,Y)=>{try{let q=Q.cwd??process.cwd(),H=await P6(Q,Y,q),J=await U0(H.configDir);if(!J){let z=H.scope==="global"?"Run 'ocx init --global' first.":H.scope==="profile"?`Run 'ocx profile config ${Q.profile}' to create it.`:"Run 'ocx init' first.";G.warn(`${H.targetLabel} not found. ${z}`);return}let X=JG({getRegistries:()=>J.registries,isLocked:()=>J.lockRegistries??!1});if(Q.json)LD({success:!0,data:X});else if(!Q.quiet)if(X.registries.length===0)G.info("No registries configured.");else{let z=H.scope==="global"?" (global)":H.scope==="profile"?` (profile '${Q.profile}')`:"";G.info(`Configured registries${z}${X.locked?P.yellow(" (locked)"):""}:`);for(let M of X.registries)console.log(` ${P.cyan(M.name)}: ${M.url}`)}}catch(q){t(q,{json:Q.json})}})}var n5=V(()=>{W2();a0();G0();tD();BF();$D();PD();fD();k2();x0()});function XG(D){return D.includes("/")&&!D.includes("::")}function GG(D){try{let{namespace:F,component:B}=u0(D);return{registryName:F,componentName:B}}catch(F){throw new U(F instanceof Error?F.message:`Invalid component ref: '${D}'`)}}function WG(D,F){return`Ambiguous component reference '${D}'. Found ${F.length} installed matches:
197
- `+F.map((B)=>` - ${B}`).join(`
237
+ ocx profile show [name] --global`);let U=await h$.requireInitialized(),Q=$??await U.resolveProfile(),v=await U.get(Q);if(_.json){console.log(JSON.stringify(v,null,2));return}if(console.log(`Profile: ${v.name}`),console.log(`
238
+ Files:`),console.log(` ocx.jsonc: ${B4(Q)}`),v.opencode)console.log(` opencode.jsonc: ${L6(Q)}`);if(v.hasAgents)console.log(` AGENTS.md: ${W1(Q)}`);console.log(`
239
+ OCX Config:`),console.log(JSON.stringify(v.ocx,null,2))}var TH=b(()=>{X6();Z4();z$();c$();a4()});function RH($){let _=$.command("profile").alias("p").description("Manage profiles (global only)");LH(_),MH(_),OH(_),AH(_),SH(_)}var EH=b(()=>{wH();kH();FH();NH();TH()});import{existsSync as tk}from"fs";import{dirname as PH,join as xH}from"path";async function ak($,_,U){if(U.isLocked?.())throw Error("Registries are locked. Cannot add.");let Q=$.trim();if(!Q)throw new M("Registry URL is required");try{let Z=new URL(Q);if(!["http:","https:"].includes(Z.protocol))throw new M(`Invalid registry URL: ${Q} (must use http or https)`)}catch(Z){if(Z instanceof M)throw Z;throw new M(`Invalid registry URL: ${Q}`)}let v=d$(Q),J=_.name,Y=U.getRegistries(),z=Y[J],I=sk(Y,v),{fetchRegistryIndex:X}=await Promise.resolve().then(() => (D1(),xG));await X(v);let q=z!==void 0,G=I!==null,j=q&&d$(z.url)===v,H=G&&I.name!==J;if(_.dryRun){let Z=[];if(q&&!j)Z.push(`Registry '${J}' already exists with a different URL (${z.url}). Run 'ocx registry remove ${J}' first, then re-add.`);else if(H)Z.push(`URL '${v}' is already registered under name '${I.name}'. Run 'ocx registry remove ${I.name}' first, then re-add.`);let V=q&&!j||H,S=q&&j,T=U.targetLabel||"config";return{dryRun:!0,command:"registry add",wouldPerform:S?[]:[{action:"add",target:`registry:${J}`,details:{url:v}}],validation:{passed:!V,warnings:Z.length>0?Z:void 0},summary:V?`Would fail: conflict detected for registry '${J}'`:S?`Registry '${J}' already configured with same URL (no-op)`:`Would add registry '${J}' to ${T}`}}if(q&&!j)throw new W0(J,z.url,v,U.targetLabel);if(H)throw new W0(J,v,v,U.targetLabel,I.name);if(q&&j)return{name:J,url:v,updated:!1,alreadyConfigured:!0};return await U.setRegistry(J,{url:v}),{name:J,url:v,updated:!1,alreadyConfigured:!1}}function sk($,_){for(let[U,Q]of Object.entries($))if(d$(Q.url)===_)return{name:U,config:Q};return null}async function ek($,_){if(_.isLocked?.())throw Error("Registries are locked. Cannot remove.");let U=_.getRegistries();if(!($ in U))throw Error(`Registry '${$}' not found.`);return await _.removeRegistry($),{removed:$}}function $A($){let _=$.getRegistries(),U=$.isLocked?.()??!1;return{registries:Object.entries(_).map(([v,J])=>({name:v,url:J.url})),locked:U}}async function xY($,_,U){let Q=_.getOptionValueSource("cwd")==="cli";if($.global&&$.profile)throw new M("Cannot use both --global and --profile flags");if(Q&&$.profile)throw new M("Cannot use both --cwd and --profile flags");if($.global&&Q)throw new M("Cannot use both --global and --cwd flags");if($.profile){if(Xj($.profile),!await(await h$.requireInitialized()).exists($.profile))throw new m$($.profile);let Y=B4($.profile);if(!tk(Y))throw new n(`Profile '${$.profile}' has no ocx.jsonc. Run 'ocx profile config ${$.profile}' to create it.`);return{scope:"profile",configPath:Y,configDir:PH(Y),targetLabel:`profile '${$.profile}' config`}}if($.global){let J=O4();return{scope:"global",configPath:xH(J,"ocx.jsonc"),configDir:J,targetLabel:"global config"}}let v=d6(U);return{scope:"local",configPath:v.path,configDir:v.exists?PH(v.path):xH(U,".opencode"),targetLabel:"local config"}}function uH($){let _=$.command("registry").description("Manage registries"),U=_.command("add").description("Add a registry").argument("<url>","Registry URL").requiredOption("--name <name>","Registry alias (required, used as lookup key for alias/component refs)").option("--dry-run","Validate registry without adding to config");G6(U),K8(U),Q4(U),U.action(async(J,Y,z)=>{let I;try{let X=Y.cwd??process.cwd();I=await xY(Y,z,X);let{configDir:q,configPath:G}=I,j=await u4(q);if(!j){let V=I.scope==="global"?"Run 'ocx init --global' first.":I.scope==="profile"?`Run 'ocx profile config ${Y.profile}' to create it.`:"Run 'ocx init' first.";W.error(`${I.targetLabel} not found. ${V}`),process.exit(1)}let H=await ak(J,Y,{getRegistries:()=>j.registries,isLocked:()=>j.lockRegistries??!1,setRegistry:async(V,S)=>{j.registries[V]=S,await r2(q,j,G)},targetLabel:I.targetLabel});if("dryRun"in H&&H.dryRun){S4(H,{json:Y.json,quiet:Y.quiet});return}let Z=H;if(Y.json)O$({success:!0,data:Z});else if(!Y.quiet)if(Z.alreadyConfigured)W.info(`Registry already configured (no changes): ${Z.name}`);else if(Z.updated)W.success(`Updated registry in ${I.targetLabel}: ${Z.name} -> ${Z.url}`);else W.success(`Added registry to ${I.targetLabel}: ${Z.name} -> ${Z.url}`)}catch(X){_$(X,{json:Y.json})}});let Q=_.command("remove").description("Remove a registry").argument("<name>","Registry name");G6(Q),K8(Q),Q4(Q),Q.action(async(J,Y,z)=>{try{let I=Y.cwd??process.cwd(),X=await xY(Y,z,I),q=await u4(X.configDir);if(!q){let j=X.scope==="global"?"Run 'ocx init --global' first.":X.scope==="profile"?`Run 'ocx profile config ${Y.profile}' to create it.`:"Run 'ocx init' first.";W.error(`${X.targetLabel} not found. ${j}`),process.exit(1)}let G=await ek(J,{getRegistries:()=>q.registries,isLocked:()=>q.lockRegistries??!1,removeRegistry:async(j)=>{delete q.registries[j],await r2(X.configDir,q,X.configPath)}});if(Y.json)O$({success:!0,data:G});else if(!Y.quiet)W.success(`Removed registry from ${X.targetLabel}: ${G.removed}`)}catch(I){_$(I,{json:Y.json})}});let v=_.command("list").description("List configured registries");G6(v),K8(v),Q4(v),v.action(async(J,Y)=>{try{let z=J.cwd??process.cwd(),I=await xY(J,Y,z),X=await u4(I.configDir);if(!X){let G=I.scope==="global"?"Run 'ocx init --global' first.":I.scope==="profile"?`Run 'ocx profile config ${J.profile}' to create it.`:"Run 'ocx init' first.";W.warn(`${I.targetLabel} not found. ${G}`);return}let q=$A({getRegistries:()=>X.registries,isLocked:()=>X.lockRegistries??!1});if(J.json)O$({success:!0,data:q});else if(!J.quiet)if(q.registries.length===0)W.info("No registries configured.");else{let G=I.scope==="global"?" (global)":I.scope==="profile"?` (profile '${J.profile}')`:"";W.info(`Configured registries${G}${q.locked?g.yellow(" (locked)"):""}:`);for(let j of q.registries)console.log(` ${g.cyan(j.name)}: ${j.url}`)}}catch(z){_$(z,{json:J.json})}})}var yH=b(()=>{k6();X6();Z4();X4();w1();z$();c$();i$();p6();a4()});function _A($){return $.includes("/")&&!$.includes("::")}function vA($){try{let{namespace:_,component:U}=r4($);return{registryName:_,componentName:U}}catch(_){throw new M(_ instanceof Error?_.message:`Invalid component ref: '${$}'`)}}function UA($,_){return`Ambiguous component reference '${$}'. Found ${_.length} installed matches:
240
+ `+_.map((U)=>` - ${U}`).join(`
198
241
  `)+`
199
242
 
200
- Use one of the canonical IDs above.`}function zG(D){return`Component '${D}' is not installed.
201
- Run 'ocx search --installed' to see installed components.`}function MG(D,F){let B=Object.keys(F.installed);if(F.installed[D])return D;if(XG(D)){let{registryName:$,componentName:_}=GG(D),Q=B.filter((Y)=>{let q=Z2(Y);return q.registryName===$&&q.name===_}).sort();if(Q.length===1){let[Y]=Q;if(!Y)throw Error("Unexpected empty canonical ID result");return Y}if(Q.length>1)throw new U(WG(D,Q))}throw new MD(zG(D))}function y8(D,F){return D.map((B)=>MG(B,F))}var x6=V(()=>{P0();$D();iF()});import{realpathSync as s5}from"fs";import{rm as AG}from"fs/promises";import{sep as jG}from"path";function a5(D,F,B){let $=H0(D,B),_;try{_=s5($)}catch(Q){let Y=Q.code;if(Y==="ENOENT"||Y==="ENOTDIR")return{path:B,targetReal:null};if(Y==="ELOOP")throw new U(`Security violation: symlink loop detected at ${B}`);if(Y==="EACCES"||Y==="EPERM")throw new U(`Security violation: cannot verify path ${B}`);throw Q}if(_===F)throw new U(`Security violation: cannot delete project root directory (${B})`);if(!_.startsWith(F+jG))throw new U("Security violation: path escapes project directory");return{path:B,targetReal:_}}function KG(D,F,B){let $=a5(D,F,B.path);if(!B.targetReal){if($.targetReal)throw new U(`Security violation: missing target reappeared during removal (${B.path})`);return null}if(!$.targetReal)return null;if($.targetReal!==B.targetReal)throw new U(`Security violation: target changed during removal (${B.path})`);return $.targetReal}function UG(D){let F=new Set,B=[];for(let $ of D){if(F.has($))continue;F.add($),B.push($)}return B}function o5(D){let F=D.command("remove").description("Remove installed components").argument("<components...>","Component refs to remove (canonical ID or alias/component)");oD(F),F.option("-f, --force","Force removal even if files have been modified"),w0(F),F.option("--dry-run","Show what would be removed without making changes").action(async(B,$)=>{try{await VG(B,$)}catch(_){t(_,{json:$.json})}})}async function VG(D,F){let B=F.cwd??process.cwd(),$=await V0.requireInitialized(B);if(D.length===0)throw new U("No components specified. Specify at least one component ID.");let _=await J0($.cwd);if(!_||Object.keys(_.installed).length===0)throw new MD("No components installed.");let Q=UG(y8(D,_)),Y=F.quiet?null:jD({text:"Removing components..."});Y?.start();let q=[],H=[],J=[],X=[],z=!1,M;try{M=s5($.cwd)}catch(A){throw new U("Cannot resolve project directory")}try{for(let A of Q){let K=_.installed[A];if(!K)throw Error(`Resolved component '${A}' was not found in receipt.`);let j=[];for(let Z of K.files){if(!Z.path||Z.path===".")throw new U(`Invalid file path in receipt for '${A}': path cannot be empty or "."`);try{j.push(a5($.cwd,M,Z.path))}catch(s){if(s instanceof aD)throw new U(`Security violation in receipt for '${A}': ${s.message}`);throw s}}let S=await N3($.cwd,K);if(!S.intact){z=!0;let Z=S.modified.map((s)=>` - ${s}`).join(`
202
- `);if(F.force)X.push(`Component '${A}' has been modified but will be force-removed:
203
- ${Z}`);else X.push(`Component '${A}' has been modified. Use --force to remove anyway:
204
- ${Z}`)}J.push({canonicalId:A,files:j})}if(F.dryRun){Y?.stop();let A={dryRun:!0,command:"remove",wouldPerform:J.flatMap(({canonicalId:K,files:j})=>j.map((S)=>({action:"delete",target:S.path,details:{component:K}}))),validation:{passed:!z||Boolean(F.force),warnings:X.length>0?X:void 0},summary:`${J.length} component(s), ${J.reduce((K,j)=>K+j.files.length,0)} file(s) would be removed`};z0(A,{json:F.json,quiet:F.quiet,hints:z&&!F.force?["Add --force to remove modified files"]:void 0});return}if(z&&!F.force){Y?.fail("File integrity check failed");let A;for(let K of J){let j=_.installed[K.canonicalId];if(!j)continue;try{let S=await N3($.cwd,j);if(!S.intact){A={canonicalId:K.canonicalId,integrity:S};break}}catch(S){throw new U(`Failed to check integrity for '${K.canonicalId}': ${S instanceof Error?S.message:String(S)}`)}}if(A){let K=A.integrity.modified.length>0?`Modified files:
205
- ${A.integrity.modified.map((Z)=>` - ${Z}`).join(`
206
- `)}`:"",j=A.integrity.missing.length>0?`Missing files:
207
- ${A.integrity.missing.map((Z)=>` - ${Z}`).join(`
208
- `)}`:"",S=[K,j].filter(Boolean).join(`
209
- `);throw new U(`Component '${A.canonicalId}' has been modified. Use --force to remove anyway.
210
- ${S}`)}}for(let{canonicalId:A,files:K}of J){for(let j of K){let S=KG($.cwd,M,j);if(!S){if(F.verbose)G.info(` \u2298 Skipped ${j.path} (not found)`);continue}if(await AG(S,{force:!0}),F.verbose)G.info(` \u2713 Removed ${j.path}`)}delete _.installed[A],q.push(A)}if(await K0($.cwd,_),Y?.succeed(`Removed ${q.length} component(s)`),F.json)console.log(JSON.stringify({success:!0,removed:q,notFound:H},null,2));else if(!F.quiet){G.info("");for(let A of q){let K=Z2(A);G.success(`\u2713 Removed ${K.registryName}/${K.name}@${K.revision}`)}G.info(""),G.success(`Done! Removed ${q.length} component(s).`)}}catch(A){throw Y?.fail("Failed to remove components"),A}}var r5=V(()=>{gF();tD();x6();BF();$D();PD();fD();c2();iF();x0();m0()});var e5=d0((t5,f8)=>{((D,F)=>{if(typeof define==="function"&&define.amd)define([],F);else if(typeof f8==="object"&&f8.exports)f8.exports=F();else D.fuzzysort=F()})(t5,(D)=>{var F=(w,E)=>{if(!w||!E)return YD;var u=A(w);if(!f(E))E=M(E);var m=u.bitflags;if((m&E._bitflags)!==m)return YD;return j(u,E)},B=(w,E,u)=>{if(!w)return u?.all?K(E,u):bD;var m=A(w),g=m.bitflags,h=m.containsSpace,C=X(u?.threshold||0),o=u?.limit||_D,d=0,GD=0,HD=E.length;function $0(u2){if(d<o)GF.add(u2),++d;else if(++GD,u2._score>GF.peek()._score)GF.replaceTop(u2)}if(u?.key){var iD=u.key;for(var WD=0;WD<HD;++WD){var rD=E[WD],UD=v(rD,iD);if(!UD)continue;if(!f(UD))UD=M(UD);if((g&UD._bitflags)!==g)continue;var wD=j(m,UD);if(wD===YD)continue;if(wD._score<C)continue;wD.obj=rD,$0(wD)}}else if(u?.keys){var M2=u.keys,A0=M2.length;D:for(var WD=0;WD<HD;++WD){var rD=E[WD];{var nD=0;for(var JD=0;JD<A0;++JD){var iD=M2[JD],UD=v(rD,iD);if(!UD){k[JD]=B0;continue}if(!f(UD))UD=M(UD);k[JD]=UD,nD|=UD._bitflags}if((g&nD)!==g)continue}if(h)for(let VD=0;VD<m.spaceSearches.length;VD++)FD[VD]=r;for(var JD=0;JD<A0;++JD){if(UD=k[JD],UD===B0){i[JD]=B0;continue}if(i[JD]=j(m,UD,!1,h),i[JD]===YD){i[JD]=B0;continue}if(h)for(let OD=0;OD<m.spaceSearches.length;OD++){if(KD[OD]>-1000){if(FD[OD]>r){var dD=(FD[OD]+KD[OD])/4;if(dD>FD[OD])FD[OD]=dD}}if(KD[OD]>FD[OD])FD[OD]=KD[OD]}}if(h){for(let VD=0;VD<m.spaceSearches.length;VD++)if(FD[VD]===r)continue D}else{var qD=!1;for(let VD=0;VD<A0;VD++)if(i[VD]._score!==r){qD=!0;break}if(!qD)continue}var Y0=new q(A0);for(let VD=0;VD<A0;VD++)Y0[VD]=i[VD];if(h){var mD=0;for(let VD=0;VD<m.spaceSearches.length;VD++)mD+=FD[VD]}else{var mD=r;for(let OD=0;OD<A0;OD++){var wD=Y0[OD];if(wD._score>-1000){if(mD>r){var dD=(mD+wD._score)/4;if(dD>mD)mD=dD}}if(wD._score>mD)mD=wD._score}}if(Y0.obj=rD,Y0._score=mD,u?.scoreFn){if(mD=u.scoreFn(Y0),!mD)continue;mD=X(mD),Y0._score=mD}if(mD<C)continue;$0(Y0)}}else for(var WD=0;WD<HD;++WD){var UD=E[WD];if(!UD)continue;if(!f(UD))UD=M(UD);if((g&UD._bitflags)!==g)continue;var wD=j(m,UD);if(wD===YD)continue;if(wD._score<C)continue;$0(wD)}if(d===0)return bD;var A2=Array(d);for(var WD=d-1;WD>=0;--WD)A2[WD]=GF.poll();return A2.total=d+GD,A2},$=(w,E="<b>",u="</b>")=>{var m=typeof E==="function"?E:void 0,g=w.target,h=g.length,C=w.indexes,o="",d=0,GD=0,HD=!1,$0=[];for(var iD=0;iD<h;++iD){var WD=g[iD];if(C[GD]===iD){if(++GD,!HD)if(HD=!0,m)$0.push(o),o="";else o+=E;if(GD===C.length){if(m)o+=WD,$0.push(m(o,d++)),o="",$0.push(g.substr(iD+1));else o+=WD+u+g.substr(iD+1);break}}else if(HD)if(HD=!1,m)$0.push(m(o,d++)),o="";else o+=u;o+=WD}return m?$0:o},_=(w)=>{if(typeof w==="number")w=""+w;else if(typeof w!=="string")w="";var E=s(w);return H(w,{_targetLower:E._lower,_targetLowerCodes:E.lowerCodes,_bitflags:E.bitflags})},Q=()=>{O.clear(),b.clear()};class Y{get["indexes"](){return this._indexes.slice(0,this._indexes.len).sort((w,E)=>w-E)}set["indexes"](w){return this._indexes=w}["highlight"](w,E){return $(this,w,E)}get["score"](){return J(this._score)}set["score"](w){this._score=X(w)}}class q extends Array{get["score"](){return J(this._score)}set["score"](w){this._score=X(w)}}var H=(w,E)=>{let u=new Y;return u.target=w,u.obj=E.obj??YD,u._score=E._score??r,u._indexes=E._indexes??[],u._targetLower=E._targetLower??"",u._targetLowerCodes=E._targetLowerCodes??YD,u._nextBeginningIndexes=E._nextBeginningIndexes??YD,u._bitflags=E._bitflags??0,u},J=(w)=>{if(w===r)return 0;if(w>1)return w;return Math.E**(((-w+1)**0.04307-1)*-2)},X=(w)=>{if(w===0)return r;if(w>1)return w;return 1-Math.pow(Math.log(w)/-2+1,23.218017181332716)},z=(w)=>{if(typeof w==="number")w=""+w;else if(typeof w!=="string")w="";w=w.trim();var E=s(w),u=[];if(E.containsSpace){var m=w.split(/\s+/);m=[...new Set(m)];for(var g=0;g<m.length;g++){if(m[g]==="")continue;var h=s(m[g]);u.push({lowerCodes:h.lowerCodes,_lower:m[g].toLowerCase(),containsSpace:!1})}}return{lowerCodes:E.lowerCodes,_lower:E._lower,containsSpace:E.containsSpace,bitflags:E.bitflags,spaceSearches:u}},M=(w)=>{if(w.length>999)return _(w);var E=O.get(w);if(E!==void 0)return E;return E=_(w),O.set(w,E),E},A=(w)=>{if(w.length>999)return z(w);var E=b.get(w);if(E!==void 0)return E;return E=z(w),b.set(w,E),E},K=(w,E)=>{var u=[];u.total=w.length;var m=E?.limit||_D;if(E?.key)for(var g=0;g<w.length;g++){var h=w[g],C=v(h,E.key);if(C==YD)continue;if(!f(C))C=M(C);var o=H(C.target,{_score:C._score,obj:h});if(u.push(o),u.length>=m)return u}else if(E?.keys)for(var g=0;g<w.length;g++){var h=w[g],d=new q(E.keys.length);for(var GD=E.keys.length-1;GD>=0;--GD){var C=v(h,E.keys[GD]);if(!C){d[GD]=B0;continue}if(!f(C))C=M(C);C._score=r,C._indexes.len=0,d[GD]=C}if(d.obj=h,d._score=r,u.push(d),u.length>=m)return u}else for(var g=0;g<w.length;g++){var C=w[g];if(C==YD)continue;if(!f(C))C=M(C);if(C._score=r,C._indexes.len=0,u.push(C),u.length>=m)return u}return u},j=(w,E,u=!1,m=!1)=>{if(u===!1&&w.containsSpace)return S(w,E,m);var{_lower:g,lowerCodes:h}=w,C=h[0],o=E._targetLowerCodes,d=h.length,GD=o.length,WD=0,HD=0,$0=0;for(;;){var iD=C===o[HD];if(iD){if(L[$0++]=HD,++WD,WD===d)break;C=h[WD]}if(++HD,HD>=GD)return YD}var WD=0,rD=!1,UD=0,wD=E._nextBeginningIndexes;if(wD===YD)wD=E._nextBeginningIndexes=x(E.target);HD=L[0]===0?0:wD[L[0]-1];var M2=0;if(HD!==GD)for(;;)if(HD>=GD){if(WD<=0)break;if(++M2,M2>200)break;--WD;var A0=e[--UD];HD=wD[A0]}else{var iD=h[WD]===o[HD];if(iD){if(e[UD++]=HD,++WD,WD===d){rD=!0;break}++HD}else HD=wD[HD]}var nD=d<=1?-1:E._targetLower.indexOf(g,L[0]),JD=!!~nD,dD=!JD?!1:nD===0||E._nextBeginningIndexes[nD-1]===nD;if(JD&&!dD)for(var qD=0;qD<wD.length;qD=wD[qD]){if(qD<=nD)continue;for(var Y0=0;Y0<d;Y0++)if(h[Y0]!==E._targetLowerCodes[qD+Y0])break;if(Y0===d){nD=qD,dD=!0;break}}var mD=(VD)=>{var OD=0,o6=0;for(var D2=1;D2<d;++D2)if(VD[D2]-VD[D2-1]!==1)OD-=VD[D2],++o6;var r$=VD[d-1]-VD[0]-(d-1);if(OD-=(12+r$)*o6,VD[0]!==0)OD-=VD[0]*VD[0]*0.2;if(!rD)OD*=1000;else{var a8=1;for(var D2=wD[0];D2<GD;D2=wD[D2])++a8;if(a8>24)OD*=(a8-24)*10}if(OD-=(GD-d)/2,JD)OD/=1+d*d*1;if(dD)OD/=1+d*d*1;return OD-=(GD-d)/2,OD};if(!rD){if(JD)for(var qD=0;qD<d;++qD)L[qD]=nD+qD;var A2=L,u2=mD(A2)}else if(dD){for(var qD=0;qD<d;++qD)L[qD]=nD+qD;var A2=L,u2=mD(L)}else var A2=e,u2=mD(e);E._score=u2;for(var qD=0;qD<d;++qD)E._indexes[qD]=A2[qD];E._indexes.len=d;let y3=new Y;return y3.target=E.target,y3._score=E._score,y3._indexes=E._indexes,y3},S=(w,E,u)=>{var m=new Set,g=0,h=YD,C=0,o=w.spaceSearches,d=o.length,GD=0,HD=()=>{for(let dD=GD-1;dD>=0;dD--)E._nextBeginningIndexes[p[dD*2+0]]=p[dD*2+1]},$0=!1;for(var JD=0;JD<d;++JD){KD[JD]=r;var iD=o[JD];if(h=j(iD,E),u){if(h===YD)continue;$0=!0}else if(h===YD)return HD(),YD;var WD=JD===d-1;if(!WD){var rD=h._indexes,UD=!0;for(let qD=0;qD<rD.len-1;qD++)if(rD[qD+1]-rD[qD]!==1){UD=!1;break}if(UD){var wD=rD[rD.len-1]+1,M2=E._nextBeginningIndexes[wD-1];for(let qD=wD-1;qD>=0;qD--){if(M2!==E._nextBeginningIndexes[qD])break;E._nextBeginningIndexes[qD]=wD,p[GD*2+0]=qD,p[GD*2+1]=M2,GD++}}}if(g+=h._score/d,KD[JD]=h._score/d,h._indexes[0]<C)g-=(C-h._indexes[0])*2;C=h._indexes[0];for(var A0=0;A0<h._indexes.len;++A0)m.add(h._indexes[A0])}if(u&&!$0)return YD;HD();var nD=j(w,E,!0);if(nD!==YD&&nD._score>g){if(u)for(var JD=0;JD<d;++JD)KD[JD]=nD._score/d;return nD}if(u)h=E;h._score=g;var JD=0;for(let dD of m)h._indexes[JD++]=dD;return h._indexes.len=JD,h},Z=(w)=>w.replace(/\p{Script=Latin}+/gu,(E)=>E.normalize("NFD")).replace(/[\u0300-\u036f]/g,""),s=(w)=>{w=Z(w);var E=w.length,u=w.toLowerCase(),m=[],g=0,h=!1;for(var C=0;C<E;++C){var o=m[C]=u.charCodeAt(C);if(o===32){h=!0;continue}var d=o>=97&&o<=122?o-97:o>=48&&o<=57?26:o<=127?30:31;g|=1<<d}return{lowerCodes:m,bitflags:g,containsSpace:h,_lower:u}},N=(w)=>{var E=w.length,u=[],m=0,g=!1,h=!1;for(var C=0;C<E;++C){var o=w.charCodeAt(C),d=o>=65&&o<=90,GD=d||o>=97&&o<=122||o>=48&&o<=57,HD=d&&!g||!h||!GD;if(g=d,h=GD,HD)u[m++]=C}return u},x=(w)=>{w=Z(w);var E=w.length,u=N(w),m=[],g=u[0],h=0;for(var C=0;C<E;++C)if(g>C)m[C]=g;else g=u[++h],m[C]=g===void 0?E:g;return m},O=new Map,b=new Map,L=[],e=[],p=[],FD=[],KD=[],k=[],i=[],v=(w,E)=>{var u=w[E];if(u!==void 0)return u;if(typeof E==="function")return E(w);var m=E;if(!Array.isArray(E))m=E.split(".");var g=m.length,h=-1;while(w&&++h<g)w=w[m[h]];return w},f=(w)=>{return typeof w==="object"&&typeof w._bitflags==="number"},_D=1/0,r=-_D,bD=[];bD.total=0;var YD=null,B0=_(""),s8=(w)=>{var E=[],u=0,m={},g=(h)=>{for(var C=0,o=E[C],d=1;d<u;){var GD=d+1;C=d,GD<u&&E[GD]._score<E[d]._score&&(C=GD),E[C-1>>1]=E[C],d=1+(C<<1)}for(var HD=C-1>>1;C>0&&o._score<E[HD]._score;HD=(C=HD)-1>>1)E[C]=E[HD];E[C]=o};return m.add=(h)=>{var C=u;E[u++]=h;for(var o=C-1>>1;C>0&&h._score<E[o]._score;o=(C=o)-1>>1)E[C]=E[o];E[C]=h},m.poll=(h)=>{if(u!==0){var C=E[0];return E[0]=E[--u],g(),C}},m.peek=(h)=>{if(u!==0)return E[0]},m.replaceTop=(h)=>{E[0]=h,g()},m},GF=s8();return{single:F,go:B,prepare:_,cleanup:Q}})});var F$={};j2(F$,{runSearchCore:()=>D$,runSearchCommandAction:()=>EG});async function EG(D,F){if(F.installed){let $=await J0(F.cwd);if(!$||Object.keys($.installed).length===0){if(F.json)LD({success:!0,data:{components:[]}});else G.info("No components installed.");return}let _=Object.entries($.installed).map(([Q,Y])=>({name:`${Y.registryName}/${Y.name}`,registry:Y.registryUrl,version:Y.revision,installedAt:void 0}));if(F.json)LD({success:!0,data:{components:_}});else{G.info(`Installed components (${_.length}):`);for(let Q of _)console.log(` ${P.cyan(Q.name)} ${P.dim(`v${Q.version}`)} from ${Q.registry}`)}return}let B;if(F.profile){let $=await o0.create(F.cwd,{profile:F.profile});B={cwd:$.getCwd(),getRegistries:()=>$.getRegistries(),getComponentPath:()=>$.getComponentPath()}}else B=await V0.requireInitialized(F.cwd);await D$(D,F,B)}async function D$(D,F,B){let $=B.getRegistries();if(F.verbose)G.info(`Searching in ${Object.keys($).length} registries...`);let _=[],Q=jD({text:"Searching registries...",quiet:F.quiet||F.verbose});if(!F.json&&!F.verbose)Q.start();for(let[q,H]of Object.entries($))try{if(F.verbose)G.info(`Fetching index from ${q} (${H.url})...`);let J=await T2(H.url);if(F.verbose)G.info(`Found ${J.components.length} components in ${q}`);for(let X of J.components)_.push({name:`${q}/${X.name}`,description:X.description,type:X.type,registry:q})}catch(J){if(F.verbose)G.warn(`Failed to fetch registry ${q}: ${J instanceof Error?J.message:String(J)}`)}if(!F.json&&!F.verbose)Q.stop();let Y=_;if(D)Y=y6.default.go(D,_,{keys:["name","description"],limit:F.limit}).map((H)=>H.obj);else Y=Y.slice(0,F.limit);if(F.json){LD({success:!0,data:{components:Y}});return}if(Y.length===0){G.info("No components found.");return}G.info(`Found ${Y.length} components:`);for(let q of Y)console.log(` ${P.cyan(q.name)} ${P.dim(`(${q.type})`)} - ${q.description}`)}var y6;var B$=V(()=>{W2();gF();O3();DF();L1();fD();m0();y6=f3(e5(),1)});function LG(D){let F=parseInt(D,10);if(Number.isNaN(F)||F<=0)throw new X9("Must be a positive integer");return F}function $$(D){let F=D.command("search").alias("list").description("Search for components across registries or list installed").argument("[query]","Search query").option("--installed","List installed components only",!1).option("-p, --profile <name>","Use specific profile").addOption(new H2("--limit <n>","Limit results").default(20).argParser(LG));oD(F),w0(F),F.action(async(B,$)=>{try{let{runSearchCommandAction:_}=await Promise.resolve().then(() => (B$(),F$));await _(B,$)}catch(_){t(_,{json:$.json})}})}var _$=V(()=>{B8();PD();x0()});function Q$(D){let F=["curl","npm","yarn","pnpm","bun"],B=F.find(($)=>$===D);if(!B)throw new vD(`Invalid install method: "${D}"
211
- Valid methods: ${F.join(", ")}`);return B}function B3(){if(wG())return"curl";let D=process.argv[1]??"";if(OG(D))return"unknown";if(bG(D))return"yarn";if(RG(D))return"pnpm";if(ZG(D))return"bun";if(NG(D))return"npm";let F=process.env.npm_config_user_agent??"";if(F.includes("yarn"))return"yarn";if(F.includes("pnpm"))return"pnpm";if(F.includes("bun"))return"bun";if(F.includes("npm"))return"npm";return"unknown"}function h8(){if(typeof Bun<"u"&&Bun.main.startsWith("/$bunfs/"))return process.execPath;return process.argv[1]??process.execPath}var wG=()=>Bun.main.startsWith("/$bunfs/"),OG=(D)=>D.includes("/_npx/")||D.includes("/.cache/bunx/")||D.includes("/.pnpm/_temp/"),bG=(D)=>D.includes("/.yarn/global")||D.includes("/.config/yarn/global"),RG=(D)=>D.includes("/.pnpm/")||D.includes("/pnpm/global"),ZG=(D)=>D.includes("/.bun/bin")||D.includes("/.bun/install/global"),NG=(D)=>D.includes("/.npm/")||D.includes("/node_modules/");var m8=V(()=>{$D()});import{existsSync as h6,lstatSync as H$,readdirSync as SG,realpathSync as Y$,rmSync as kG,unlinkSync as J$}from"fs";import{homedir as X$}from"os";import g0 from"path";function f6(D,F=0){LD({success:!0,data:D}),process.exit(F)}function qF(D,F,B,$){let _={success:!1,error:{code:D,message:F,...$&&{details:$}},exitCode:B,meta:{timestamp:new Date().toISOString()}};LD(_),process.exit(B)}function m6(D){return D instanceof Error&&"code"in D}function P3(D){let F=X$();if(!F)return D;if(D===F)return"~";if(D.startsWith(F+g0.sep))return`~${D.slice(F.length)}`;return D}function d8(D,F){let B=g0.normalize(D),$=g0.normalize(F),_=g0.relative(B,$);if(_.startsWith("..")||g0.isAbsolute(_))return null;return _}function IG(D,F){return d8(D,F)!==null}function TG(D,F){if(!h6(F))return{contained:!0};try{let B=Y$(D),$=Y$(F);return{contained:d8(B,$)!==null}}catch(B){if(m6(B)&&(B.code==="EACCES"||B.code==="EPERM"))return{contained:!1,error:"permission"};return{contained:!1,error:"io"}}}function G$(D){try{let F=H$(D);if(F.isSymbolicLink())return{valid:!1,reason:"symlink"};if(!F.isDirectory())return{valid:!1,reason:"not-directory"};return{valid:!0}}catch(F){if(m6(F)){if(F.code==="ENOENT")return{valid:!1,reason:"not-found"};if(F.code==="EACCES"||F.code==="EPERM")return{valid:!1,reason:"permission"}}return{valid:!1,reason:"permission"}}}function x3(D){if(!h6(D))return"missing";try{let F=H$(D);if(F.isSymbolicLink())return"symlink";if(F.isDirectory())return"directory";return"file"}catch{return"missing"}}function vG(D){if(!h6(D))return!0;try{return SG(D).length===0}catch{return!1}}function q$(D){if(D.kind==="missing")return"safe";if(D.kind==="symlink")return IG(D.rootPath,D.absolutePath)?"safe":"forbidden";let F=TG(D.rootPath,D.absolutePath);if(F.error)return"error";return F.contained?"safe":"forbidden"}function HF(D){return D==="npm"||D==="pnpm"||D==="bun"||D==="yarn"}function c8(D){switch(D){case"npm":return"npm uninstall -g ocx";case"pnpm":return"pnpm remove -g ocx";case"bun":return"bun remove -g ocx";case"yarn":return"yarn global remove ocx";default:return"npm uninstall -g ocx"}}function g6(){let D=process.env.XDG_CONFIG_HOME||g0.join(X$(),".config");return g0.join(D,"opencode")}function W$(){let D=g6(),F=[],B=X2(),$=d8(D,B);if($){let q=x3(B);F.push({rootPath:D,relativePath:$,absolutePath:B,displayPath:P3(B),kind:q,deleteIfEmpty:!1,safetyStatus:q$({rootPath:D,absolutePath:B,kind:q})})}let _=I2(),Q=d8(D,_);if(Q){let q=x3(_);F.push({rootPath:D,relativePath:Q,absolutePath:_,displayPath:P3(_),kind:q,deleteIfEmpty:!1,safetyStatus:q$({rootPath:D,absolutePath:_,kind:q})})}let Y=x3(D);return F.push({rootPath:D,relativePath:".",absolutePath:D,displayPath:P3(D),kind:Y,deleteIfEmpty:!0,safetyStatus:Y==="missing"?"safe":"safe"}),F}function z$(){let D=B3();if(HF(D))return null;if(D==="curl"){let F=h8(),B=x3(F);return{rootPath:g0.dirname(F),relativePath:g0.basename(F),absolutePath:F,displayPath:P3(F),kind:B,deleteIfEmpty:!1,safetyStatus:B==="missing"?"safe":"safe"}}return null}function CG(D){if(D.kind==="missing")return{target:D,success:!0,skipped:!0,reason:"not found"};if(D.safetyStatus==="forbidden")return{target:D,success:!1,skipped:!0,reason:"containment violation",error:Error("Target escapes containment boundary")};if(D.deleteIfEmpty&&D.kind==="directory"){if(!vG(D.absolutePath))return{target:D,success:!0,skipped:!0,reason:"not empty"}}try{if(D.kind==="directory")kG(D.absolutePath,{recursive:!0,force:!0});else J$(D.absolutePath);return{target:D,success:!0,skipped:!1}}catch(F){let B=F instanceof Error?F:Error(String(F)),$=m6(F)&&(F.code==="EACCES"||F.code==="EPERM")?"permission denied":void 0;return{target:D,success:!1,skipped:!1,reason:$,error:B}}}function M$(D){return D.map(CG)}function A$(D,F={}){let B={rootPath:g0.dirname(D),relativePath:g0.basename(D),absolutePath:D,displayPath:P3(D),kind:x3(D),deleteIfEmpty:!1,safetyStatus:"safe"};if(B.kind==="missing")return{target:B,success:!0,skipped:!0,reason:"not found"};if(process.platform==="win32"){if(!F.suppressOutput)G.info(`To complete uninstall, manually delete: ${B.displayPath}`);return{target:B,success:!0,skipped:!0}}try{return J$(D),{target:B,success:!0,skipped:!1}}catch($){let _=$ instanceof Error?$:Error(String($));return{target:B,success:!1,skipped:!1,reason:"permission denied",error:_}}}function uG(D,F,B){let{dryRunResult:$,hints:_}=j$(D,F,B);z0($,{hints:_})}function j$(D,F,B){let $=D.filter((q)=>q.kind!=="missing"),_=[];for(let q of $)_.push({action:"delete",target:q.displayPath,details:{kind:q.kind,...q.deleteIfEmpty&&{deleteIfEmpty:!0}}});if(F&&F.kind!=="missing")_.push({action:"delete",target:F.displayPath,details:{kind:"binary"}});let Q=[];if(HF(B))Q.push(`Binary is managed by ${B}. Run: ${c8(B)}`);return{dryRunResult:{dryRun:!0,command:"self uninstall",wouldPerform:_,validation:{passed:!0},summary:_.length>0?`Would remove ${_.length} item(s)`:"Nothing to remove"},hints:Q}}function PG(D,F){if(D.filter(($)=>$.kind!=="missing").length>0||F&&F.kind!=="missing")G.info("Removing OCX files...")}function xG(D,F,B){G.break();for(let $ of D){if($.skipped){if($.reason==="not found")continue;if($.reason==="not empty"){G.info(`Kept ${W0.path($.target.displayPath)} (not empty)`);continue}if($.reason==="permission denied"){G.warn(`Skipped ${W0.path($.target.displayPath)} (permission denied)`);continue}if($.reason==="containment violation"){G.warn(`Skipped ${W0.path($.target.displayPath)} (containment violation)`);continue}}if($.success)G.success(`Removed ${W0.path($.target.displayPath)}`);else G.error(`Failed to remove ${$.target.displayPath}: ${$.error?.message}`)}if(F){if(F.skipped&&F.reason==="not found");else if(F.success&&!F.skipped)G.success(`Removed binary ${W0.path(F.target.displayPath)}`);else if(!F.success)G.error(`Failed to remove binary ${F.target.displayPath}: ${F.error?.message}`)}if(HF(B))G.break(),G.info(`Binary is managed by ${B}. To complete uninstall, run:`),G.log(` ${W0.command(c8(B))}`)}function yG(){G.info("Nothing to remove. OCX is not installed globally.")}function g8(D){return{path:D.target.displayPath,kind:D.target.kind,success:D.success,skipped:D.skipped,...D.reason&&{reason:D.reason},...D.error&&{error:D.error.message}}}async function fG(D){let F=g6(),B=G$(F);if(!B.valid)switch(B.reason){case"not-found":break;case"symlink":return qF("VALIDATION_ERROR","Safety error: Global config root is a symlink. Aborting.",hD.SAFETY_ERROR);case"not-directory":return qF("VALIDATION_ERROR","Safety error: Global config root is not a directory. Aborting.",hD.SAFETY_ERROR);case"permission":return qF("PERMISSION_ERROR","Error: Cannot access global config root (permission denied).",hD.ERROR)}let $=W$(),_=$.filter((Z)=>Z.safetyStatus==="forbidden");if(_.length>0)return qF("VALIDATION_ERROR","Safety error: Target escapes containment boundary.",hD.SAFETY_ERROR,{targets:_.map((Z)=>Z.displayPath)});let Q=$.filter((Z)=>Z.safetyStatus==="error");if(Q.length>0)return qF("PERMISSION_ERROR","Error: Cannot verify containment for targets (permission/IO error).",hD.ERROR,{targets:Q.map((Z)=>Z.displayPath)});let Y=B3(),q=z$(),H=$.filter((Z)=>Z.kind!=="missing"),J=Boolean(q&&q.kind!=="missing"),X=HF(Y);if(H.length===0&&!J&&!X)return f6({message:"Nothing to remove. OCX is not installed globally.",removed:[],skipped:[]},hD.SUCCESS);if(D.dryRun){let{dryRunResult:Z,hints:s}=j$($,q,Y);return f6({...Z,...s.length>0&&{hints:s}},hD.SUCCESS)}let z=M$($),M=null;if(q)M=A$(q.absolutePath,{suppressOutput:!0});let A=z.some((Z)=>!Z.success&&!Z.skipped),K=Boolean(M&&!M.success&&!M.skipped);if(A||K)return qF("PERMISSION_ERROR","Failed to remove one or more uninstall targets.",hD.ERROR,{configResults:z.map(g8),...M&&{binaryResult:g8(M)}});if(HF(Y))return qF("UPDATE_ERROR",`Binary is managed by ${Y}. Run: ${c8(Y)}`,hD.ERROR,{installMethod:Y,command:c8(Y),configResults:z.map(g8),...M&&{binaryResult:g8(M)}});let j=z.filter((Z)=>Z.success&&!Z.skipped).map((Z)=>Z.target.displayPath),S=z.filter((Z)=>Z.skipped).map((Z)=>({path:Z.target.displayPath,reason:Z.reason??"skipped"}));if(M){if(M.success&&!M.skipped)j.push(M.target.displayPath);else if(M.skipped)S.push({path:M.target.displayPath,reason:M.reason??"skipped"})}return f6({removed:j,skipped:S,installMethod:Y},hD.SUCCESS)}async function hG(D){if(D.json){await fG(D);return}let F=g6(),B=G$(F);if(!B.valid)switch(B.reason){case"not-found":break;case"symlink":G.error("Safety error: Global config root is a symlink. Aborting."),process.exit(hD.SAFETY_ERROR);break;case"not-directory":G.error("Safety error: Global config root is not a directory. Aborting."),process.exit(hD.SAFETY_ERROR);break;case"permission":G.error("Error: Cannot access global config root (permission denied)."),process.exit(hD.ERROR);break}let $=W$(),_=$.filter((j)=>j.safetyStatus==="forbidden");if(_.length>0){G.error("Safety error: Target escapes containment boundary:");for(let j of _)G.error(` ${j.displayPath}`);process.exit(hD.SAFETY_ERROR)}let Q=$.filter((j)=>j.safetyStatus==="error");if(Q.length>0){G.error("Error: Cannot verify containment for targets (permission/IO error):");for(let j of Q)G.error(` ${j.displayPath}`);process.exit(hD.ERROR)}let Y=B3(),q=z$(),H=$.filter((j)=>j.kind!=="missing"),J=q&&q.kind!=="missing",X=HF(Y);if(H.length===0&&!J&&!X)yG(),process.exit(hD.SUCCESS);if(D.dryRun)uG($,q,Y),process.exit(hD.SUCCESS);PG($,q);let z=M$($),M=null;if(q)M=A$(q.absolutePath);xG(z,M,Y);let A=z.some((j)=>!j.success&&!j.skipped),K=M&&!M.success&&!M.skipped;if(A||K)process.exit(hD.ERROR);if(HF(Y))process.exit(hD.ERROR);process.exit(hD.SUCCESS)}function K$(D){D.command("uninstall").description("Remove OCX global configuration and binary").option("--dry-run","Preview what would be removed").option("--json","Output as JSON").action(async(F)=>{try{await hG(F)}catch(B){t(B,{json:F.json})}})}var hD;var U$=V(()=>{G0();m8();BF();PD();fD();hD={SUCCESS:0,ERROR:1,SAFETY_ERROR:2}});class V${version="2.0.3"}var E$;var L$=V(()=>{E$=new V$});var O$={};j2(O$,{checkForUpdate:()=>c6,EXPLICIT_UPDATE_TIMEOUT_MS:()=>d6});function w$(D){let[F=""]=D.split("-"),B=F.split("."),$=parseInt(B[0]??"",10),_=parseInt(B[1]??"",10),Q=parseInt(B[2]??"",10);if(Number.isNaN($)||Number.isNaN(_)||Number.isNaN(Q))return null;return{major:$,minor:_,patch:Q}}function dG(D,F){let B=w$(D),$=w$(F);if(!B||!$)return null;if(B.major!==$.major)return B.major-$.major;if(B.minor!==$.minor)return B.minor-$.minor;return B.patch-$.patch}async function c6(D,F=mG){let $=(D??E$).version||"0.0.0-dev";if($==="0.0.0-dev")return{ok:!1,reason:"dev-version"};try{let Q=(await M8(gG,void 0,AbortSignal.timeout(F))).version,Y=dG(Q,$);if(Y===null)return{ok:!1,reason:"invalid-response"};return{ok:!0,current:$,latest:Q,updateAvailable:Y>0}}catch(_){if(_ instanceof Error){if(_.name==="AbortError"||_.name==="TimeoutError")return{ok:!1,reason:"timeout"};if(_ instanceof RD||_.name==="NetworkError")return{ok:!1,reason:"network-error"}}return{ok:!1,reason:"invalid-response"}}}var mG=200,d6=1e4,gG="ocx";var l6=V(()=>{$D();a1();L$()});import{chmodSync as cG,existsSync as JF,renameSync as p6,unlinkSync as l8}from"fs";function iG(){let D=process.env.OCX_DOWNLOAD_URL;if(D)return D.replace(/\/+$/,"");return pG}function i6(D){let F=`${process.arch}-${process.platform}`,B=b$[F];if(!B){let _=Object.keys(b$).join(", ");throw new vD(`Unsupported platform: ${F}
212
- Supported platforms: ${_}`)}return`${iG()}/v${D}/${B}`}async function nG(D,F,B={}){let $=B.quiet?null:jD({text:"Downloading update..."});$?.start();let _;try{_=await fetch(D,{redirect:"follow"})}catch(J){throw $?.fail("Download failed"),new vD(`Network error: ${J instanceof Error?J.message:String(J)}`)}if(!_.ok)throw $?.fail("Download failed"),new vD(`Failed to download: HTTP ${_.status} ${_.statusText}`);if(!_.body)throw $?.fail("Download failed"),new vD("Download failed: Empty response body");let Q=_.body.getReader(),Y=Bun.file(F).writer(),q=Number(_.headers.get("content-length")||0),H=0;try{while(!0){let{done:J,value:X}=await Q.read();if(J)break;if(await Y.write(X),H+=X.length,q>0&&$){let z=Math.round(H/q*100);$.text=`Downloading... ${z}%`}}await Y.end(),$?.succeed("Download complete")}catch(J){throw $?.fail("Download failed"),await Y.end(),new vD(`Download interrupted: ${J instanceof Error?J.message:String(J)}`)}}async function R$(D,F={}){let B=h8(),$=`${B}.new.${Date.now()}`,_=i6(D);await nG(_,$,F);try{cG($,493)}catch(Q){if(JF($))l8($);throw new vD(`Failed to set permissions: ${Q instanceof Error?Q.message:String(Q)}`)}return{tempPath:$,execPath:B}}function Z$(D,F){let B=`${F}.backup`;try{if(JF(F))p6(F,B);if(p6(D,F),JF(B))l8(B)}catch($){if(JF(B)&&!JF(F))try{p6(B,F)}catch{}if(JF(D))try{l8(D)}catch{}throw new vD(`Update failed: ${$ instanceof Error?$.message:String($)}`)}}function N$(D){if(JF(D))try{l8(D)}catch{}}var lG="kdcokenny/ocx",pG,b$;var S$=V(()=>{$D();m0();m8();pG=`https://github.com/${lG}/releases/download`,b$={"arm64-darwin":"ocx-darwin-arm64","x64-darwin":"ocx-darwin-x64","arm64-linux":"ocx-linux-arm64","x64-linux":"ocx-linux-x64","x64-win32":"ocx-windows-x64.exe"}});var k$={};j2(k$,{notifyUpdated:()=>p8,notifyUpdate:()=>sG,notifyUpToDate:()=>n6});function sG(D,F){if(!process.stdout.isTTY)return;console.error(`${P.cyan("info")}: update available - ${P.green(F)} (current: ${P.dim(D)})`),console.error(` run ${P.cyan("`ocx self update`")} to upgrade`)}function n6(D){console.error(`${P.cyan("info")}: ocx unchanged - ${P.dim(D)}`)}function p8(D,F){console.error(` ${P.green("ocx updated")} - ${F} (from ${D})`)}var s6=V(()=>{W2()});import{createHash as aG}from"crypto";function rG(D){let F=new Map;for(let B of D.split(`
213
- `)){let $=B.match(/^([a-fA-F0-9]{64})\s+\*?(.+)$/);if($?.[1]&&$[2])F.set($[2].trim(),$[1].toLowerCase())}return F}function tG(D){return aG("sha256").update(D).digest("hex")}async function I$(D){let F=`https://github.com/${oG}/releases/download/v${D}/SHA256SUMS.txt`,B=await fetch(F);if(!B.ok)throw new vD(`Failed to fetch checksums: ${B.status}`);let $=await B.text();return rG($)}async function T$(D,F,B){let _=await Bun.file(D).arrayBuffer(),Q=tG(Buffer.from(_));if(Q!==F)throw new d2(B,F,Q)}var oG="kdcokenny/ocx";var v$=V(()=>{$D()});var C$={};j2(C$,{runSelfUpdateCommand:()=>FW});async function FW(D){let F=D.method?Q$(D.method):B3(),B=D.json===!0,$=await c6(void 0,d6);if(!$.ok)throw new vD(DW[$.reason]);let{current:_,latest:Q,updateAvailable:Y}=$;if(!Y&&!D.force){if(B)LD({success:!0,data:{current:_,latest:Q,method:F,updated:!1}});else n6(_);return}let q=Q;switch(F){case"curl":{await BW(_,q,B);break}case"npm":case"pnpm":case"bun":case"yarn":case"unknown":{await $W(F,_,q,B);break}}if(B)LD({success:!0,data:{current:_,latest:q,method:F,updated:!0}})}async function BW(D,F,B){let _=i6(F).split("/").pop();if(!_)throw new vD("Failed to determine binary filename from download URL");let Y=(await I$(F)).get(_);if(!Y)throw new vD(`Security error: No checksum found for ${_}. Update aborted.`);let{tempPath:q,execPath:H}=await R$(F,{quiet:B});try{await T$(q,Y,_)}catch(J){throw N$(q),J}if(Z$(q,H),!B)p8(D,F)}async function i8(D){let F=Bun.spawn(D,{stdout:"pipe",stderr:"pipe"});if(await F.exited!==0){let $=await new Response(F.stderr).text();throw new vD(`Package manager command failed: ${$.trim()}`)}}async function $W(D,F,B,$){if(!eG.test(B))throw new vD(`Invalid version format: ${B}`);let _=$?null:jD({text:`Updating via ${D}...`});_?.start();try{switch(D){case"npm":{await i8(["npm","install","-g",`ocx@${B}`]);break}case"yarn":{await i8(["yarn","global","add",`ocx@${B}`]);break}case"pnpm":{await i8(["pnpm","install","-g",`ocx@${B}`]);break}case"bun":{await i8(["bun","install","-g",`ocx@${B}`]);break}case"unknown":throw new vD(`Could not detect install method. Update manually with one of:
243
+ Use one of the canonical IDs above.`}function QA($){return`Component '${$}' is not installed.
244
+ Run 'ocx search --installed' to see installed components.`}function JA($,_){let U=Object.keys(_.installed);if(_.installed[$])return $;if(_A($)){let{registryName:Q,componentName:v}=vA($),J=U.filter((Y)=>{let z=c6(Y);return z.registryName===Q&&z.name===v}).sort();if(J.length===1){let[Y]=J;if(!Y)throw Error("Unexpected empty canonical ID result");return Y}if(J.length>1)throw new M(UA($,J))}throw new B$(QA($))}function y8($,_){return $.map((U)=>JA(U,_))}var uY=b(()=>{o4();z$();T0()});import{realpathSync as CH}from"fs";import{rm as YA}from"fs/promises";import{sep as zA}from"path";function fH($,_,U){let Q=A4($,U),v;try{v=CH(Q)}catch(J){let Y=J.code;if(Y==="ENOENT"||Y==="ENOTDIR")return{path:U,targetReal:null};if(Y==="ELOOP")throw new M(`Security violation: symlink loop detected at ${U}`);if(Y==="EACCES"||Y==="EPERM")throw new M(`Security violation: cannot verify path ${U}`);throw J}if(v===_)throw new M(`Security violation: cannot delete project root directory (${U})`);if(!v.startsWith(_+zA))throw new M("Security violation: path escapes project directory");return{path:U,targetReal:v}}function IA($,_,U){let Q=fH($,_,U.path);if(!U.targetReal){if(Q.targetReal)throw new M(`Security violation: missing target reappeared during removal (${U.path})`);return null}if(!Q.targetReal)return null;if(Q.targetReal!==U.targetReal)throw new M(`Security violation: target changed during removal (${U.path})`);return Q.targetReal}function XA($){let _=new Set,U=[];for(let Q of $){if(_.has(Q))continue;_.add(Q),U.push(Q)}return U}function mH($){let _=$.command("remove").description("Remove installed components").argument("<components...>","Component refs to remove (canonical ID or alias/component)");Q4(_),_.option("-f, --force","Force removal even if files have been modified"),m4(_),_.option("--dry-run","Show what would be removed without making changes").action(async(U,Q)=>{try{await qA(U,Q)}catch(v){_$(v,{json:Q.json})}})}async function qA($,_){let U=_.cwd??process.cwd(),Q=await y4.requireInitialized(U);if($.length===0)throw new M("No components specified. Specify at least one component ID.");let v=await F4(Q.cwd);if(!v||Object.keys(v.installed).length===0)throw new B$("No components installed.");let J=XA(y8($,v)),Y=_.quiet?null:V$({text:"Removing components..."});Y?.start();let z=[],I=[],X=[],q=[],G=!1,j;try{j=CH(Q.cwd)}catch(H){throw new M("Cannot resolve project directory")}try{for(let H of J){let Z=v.installed[H];if(!Z)throw Error(`Resolved component '${H}' was not found in receipt.`);let V=[];for(let T of Z.files){if(!T.path||T.path===".")throw new M(`Invalid file path in receipt for '${H}': path cannot be empty or "."`);try{V.push(fH(Q.cwd,j,T.path))}catch(r){if(r instanceof U4)throw new M(`Security violation in receipt for '${H}': ${r.message}`);throw r}}let S=await d_(Q.cwd,Z);if(!S.intact){G=!0;let T=S.modified.map((r)=>` - ${r}`).join(`
245
+ `);if(_.force)q.push(`Component '${H}' has been modified but will be force-removed:
246
+ ${T}`);else q.push(`Component '${H}' has been modified. Use --force to remove anyway:
247
+ ${T}`)}X.push({canonicalId:H,files:V})}if(_.dryRun){Y?.stop();let H={dryRun:!0,command:"remove",wouldPerform:X.flatMap(({canonicalId:Z,files:V})=>V.map((S)=>({action:"delete",target:S.path,details:{component:Z}}))),validation:{passed:!G||Boolean(_.force),warnings:q.length>0?q:void 0},summary:`${X.length} component(s), ${X.reduce((Z,V)=>Z+V.files.length,0)} file(s) would be removed`};S4(H,{json:_.json,quiet:_.quiet,hints:G&&!_.force?["Add --force to remove modified files"]:void 0});return}if(G&&!_.force){Y?.fail("File integrity check failed");let H;for(let Z of X){let V=v.installed[Z.canonicalId];if(!V)continue;try{let S=await d_(Q.cwd,V);if(!S.intact){H={canonicalId:Z.canonicalId,integrity:S};break}}catch(S){throw new M(`Failed to check integrity for '${Z.canonicalId}': ${S instanceof Error?S.message:String(S)}`)}}if(H){let Z=H.integrity.modified.length>0?`Modified files:
248
+ ${H.integrity.modified.map((T)=>` - ${T}`).join(`
249
+ `)}`:"",V=H.integrity.missing.length>0?`Missing files:
250
+ ${H.integrity.missing.map((T)=>` - ${T}`).join(`
251
+ `)}`:"",S=[Z,V].filter(Boolean).join(`
252
+ `);throw new M(`Component '${H.canonicalId}' has been modified. Use --force to remove anyway.
253
+ ${S}`)}}for(let{canonicalId:H,files:Z}of X){for(let V of Z){let S=IA(Q.cwd,j,V);if(!S){if(_.verbose)W.info(` \u2298 Skipped ${V.path} (not found)`);continue}if(await YA(S,{force:!0}),_.verbose)W.info(` \u2713 Removed ${V.path}`)}delete v.installed[H],z.push(H)}if(await x4(Q.cwd,v),Y?.succeed(`Removed ${z.length} component(s)`),_.json)console.log(JSON.stringify({success:!0,removed:z,notFound:I},null,2));else if(!_.quiet){W.info("");for(let H of z){let Z=c6(H);W.success(`\u2713 Removed ${Z.registryName}/${Z.name}@${Z.revision}`)}W.info(""),W.success(`Done! Removed ${z.length} component(s).`)}}catch(H){throw Y?.fail("Failed to remove components"),H}}var gH=b(()=>{k0();X4();uY();w1();z$();c$();i$();X1();T0();a4();e4()});var cH=N6((hH,C8)=>{(($,_)=>{if(typeof define==="function"&&define.amd)define([],_);else if(typeof C8==="object"&&C8.exports)C8.exports=_();else $.fuzzysort=_()})(hH,($)=>{var _=(F,L)=>{if(!F||!L)return X$;var m=H(F);if(!h(L))L=j(L);var d=m.bitflags;if((d&L._bitflags)!==d)return X$;return V(m,L)},U=(F,L,m)=>{if(!F)return m?.all?Z(L,m):R$;var d=H(F),p=d.bitflags,c=d.containsSpace,f=q(m?.threshold||0),s=m?.limit||I$,i=0,H$=0,G$=L.length;function K4(t6){if(i<s)E1.add(t6),++i;else if(++H$,t6._score>E1.peek()._score)E1.replaceTop(t6)}if(m?.key){var $4=m.key;for(var W$=0;W$<G$;++W$){var J4=L[W$],w$=C(J4,$4);if(!w$)continue;if(!h(w$))w$=j(w$);if((p&w$._bitflags)!==p)continue;var N$=V(d,w$);if(N$===X$)continue;if(N$._score<f)continue;N$.obj=J4,K4(N$)}}else if(m?.keys){var F6=m.keys,T4=F6.length;$:for(var W$=0;W$<G$;++W$){var J4=L[W$];{var _4=0;for(var j$=0;j$<T4;++j$){var $4=F6[j$],w$=C(J4,$4);if(!w$){x[j$]=j4;continue}if(!h(w$))w$=j(w$);x[j$]=w$,_4|=w$._bitflags}if((p&_4)!==p)continue}if(c)for(let L$=0;L$<d.spaceSearches.length;L$++)Q$[L$]=$$;for(var j$=0;j$<T4;++j$){if(w$=x[j$],w$===j4){t[j$]=j4;continue}if(t[j$]=V(d,w$,!1,c),t[j$]===X$){t[j$]=j4;continue}if(c)for(let S$=0;S$<d.spaceSearches.length;S$++){if(D$[S$]>-1000){if(Q$[S$]>$$){var a$=(Q$[S$]+D$[S$])/4;if(a$>Q$[S$])Q$[S$]=a$}}if(D$[S$]>Q$[S$])Q$[S$]=D$[S$]}}if(c){for(let L$=0;L$<d.spaceSearches.length;L$++)if(Q$[L$]===$$)continue $}else{var q$=!1;for(let L$=0;L$<T4;L$++)if(t[L$]._score!==$$){q$=!0;break}if(!q$)continue}var D4=new z(T4);for(let L$=0;L$<T4;L$++)D4[L$]=t[L$];if(c){var r$=0;for(let L$=0;L$<d.spaceSearches.length;L$++)r$+=Q$[L$]}else{var r$=$$;for(let S$=0;S$<T4;S$++){var N$=D4[S$];if(N$._score>-1000){if(r$>$$){var a$=(r$+N$._score)/4;if(a$>r$)r$=a$}}if(N$._score>r$)r$=N$._score}}if(D4.obj=J4,D4._score=r$,m?.scoreFn){if(r$=m.scoreFn(D4),!r$)continue;r$=q(r$),D4._score=r$}if(r$<f)continue;K4(D4)}}else for(var W$=0;W$<G$;++W$){var w$=L[W$];if(!w$)continue;if(!h(w$))w$=j(w$);if((p&w$._bitflags)!==p)continue;var N$=V(d,w$);if(N$===X$)continue;if(N$._score<f)continue;K4(N$)}if(i===0)return R$;var O6=Array(i);for(var W$=i-1;W$>=0;--W$)O6[W$]=E1.poll();return O6.total=i+H$,O6},Q=(F,L="<b>",m="</b>")=>{var d=typeof L==="function"?L:void 0,p=F.target,c=p.length,f=F.indexes,s="",i=0,H$=0,G$=!1,K4=[];for(var $4=0;$4<c;++$4){var W$=p[$4];if(f[H$]===$4){if(++H$,!G$)if(G$=!0,d)K4.push(s),s="";else s+=L;if(H$===f.length){if(d)s+=W$,K4.push(d(s,i++)),s="",K4.push(p.substr($4+1));else s+=W$+m+p.substr($4+1);break}}else if(G$)if(G$=!1,d)K4.push(d(s,i++)),s="";else s+=m;s+=W$}return d?K4:s},v=(F)=>{if(typeof F==="number")F=""+F;else if(typeof F!=="string")F="";var L=r(F);return I(F,{_targetLower:L._lower,_targetLowerCodes:L.lowerCodes,_bitflags:L.bitflags})},J=()=>{k.clear(),O.clear()};class Y{get["indexes"](){return this._indexes.slice(0,this._indexes.len).sort((F,L)=>F-L)}set["indexes"](F){return this._indexes=F}["highlight"](F,L){return Q(this,F,L)}get["score"](){return X(this._score)}set["score"](F){this._score=q(F)}}class z extends Array{get["score"](){return X(this._score)}set["score"](F){this._score=q(F)}}var I=(F,L)=>{let m=new Y;return m.target=F,m.obj=L.obj??X$,m._score=L._score??$$,m._indexes=L._indexes??[],m._targetLower=L._targetLower??"",m._targetLowerCodes=L._targetLowerCodes??X$,m._nextBeginningIndexes=L._nextBeginningIndexes??X$,m._bitflags=L._bitflags??0,m},X=(F)=>{if(F===$$)return 0;if(F>1)return F;return Math.E**(((-F+1)**0.04307-1)*-2)},q=(F)=>{if(F===0)return $$;if(F>1)return F;return 1-Math.pow(Math.log(F)/-2+1,23.218017181332716)},G=(F)=>{if(typeof F==="number")F=""+F;else if(typeof F!=="string")F="";F=F.trim();var L=r(F),m=[];if(L.containsSpace){var d=F.split(/\s+/);d=[...new Set(d)];for(var p=0;p<d.length;p++){if(d[p]==="")continue;var c=r(d[p]);m.push({lowerCodes:c.lowerCodes,_lower:d[p].toLowerCase(),containsSpace:!1})}}return{lowerCodes:L.lowerCodes,_lower:L._lower,containsSpace:L.containsSpace,bitflags:L.bitflags,spaceSearches:m}},j=(F)=>{if(F.length>999)return v(F);var L=k.get(F);if(L!==void 0)return L;return L=v(F),k.set(F,L),L},H=(F)=>{if(F.length>999)return G(F);var L=O.get(F);if(L!==void 0)return L;return L=G(F),O.set(F,L),L},Z=(F,L)=>{var m=[];m.total=F.length;var d=L?.limit||I$;if(L?.key)for(var p=0;p<F.length;p++){var c=F[p],f=C(c,L.key);if(f==X$)continue;if(!h(f))f=j(f);var s=I(f.target,{_score:f._score,obj:c});if(m.push(s),m.length>=d)return m}else if(L?.keys)for(var p=0;p<F.length;p++){var c=F[p],i=new z(L.keys.length);for(var H$=L.keys.length-1;H$>=0;--H$){var f=C(c,L.keys[H$]);if(!f){i[H$]=j4;continue}if(!h(f))f=j(f);f._score=$$,f._indexes.len=0,i[H$]=f}if(i.obj=c,i._score=$$,m.push(i),m.length>=d)return m}else for(var p=0;p<F.length;p++){var f=F[p];if(f==X$)continue;if(!h(f))f=j(f);if(f._score=$$,f._indexes.len=0,m.push(f),m.length>=d)return m}return m},V=(F,L,m=!1,d=!1)=>{if(m===!1&&F.containsSpace)return S(F,L,d);var{_lower:p,lowerCodes:c}=F,f=c[0],s=L._targetLowerCodes,i=c.length,H$=s.length,W$=0,G$=0,K4=0;for(;;){var $4=f===s[G$];if($4){if(w[K4++]=G$,++W$,W$===i)break;f=c[W$]}if(++G$,G$>=H$)return X$}var W$=0,J4=!1,w$=0,N$=L._nextBeginningIndexes;if(N$===X$)N$=L._nextBeginningIndexes=u(L.target);G$=w[0]===0?0:N$[w[0]-1];var F6=0;if(G$!==H$)for(;;)if(G$>=H$){if(W$<=0)break;if(++F6,F6>200)break;--W$;var T4=v$[--w$];G$=N$[T4]}else{var $4=c[W$]===s[G$];if($4){if(v$[w$++]=G$,++W$,W$===i){J4=!0;break}++G$}else G$=N$[G$]}var _4=i<=1?-1:L._targetLower.indexOf(p,w[0]),j$=!!~_4,a$=!j$?!1:_4===0||L._nextBeginningIndexes[_4-1]===_4;if(j$&&!a$)for(var q$=0;q$<N$.length;q$=N$[q$]){if(q$<=_4)continue;for(var D4=0;D4<i;D4++)if(c[D4]!==L._targetLowerCodes[q$+D4])break;if(D4===i){_4=q$,a$=!0;break}}var r$=(L$)=>{var S$=0,oY=0;for(var K6=1;K6<i;++K6)if(L$[K6]-L$[K6-1]!==1)S$-=L$[K6],++oY;var gW=L$[i-1]-L$[0]-(i-1);if(S$-=(12+gW)*oY,L$[0]!==0)S$-=L$[0]*L$[0]*0.2;if(!J4)S$*=1000;else{var r8=1;for(var K6=N$[0];K6<H$;K6=N$[K6])++r8;if(r8>24)S$*=(r8-24)*10}if(S$-=(H$-i)/2,j$)S$/=1+i*i*1;if(a$)S$/=1+i*i*1;return S$-=(H$-i)/2,S$};if(!J4){if(j$)for(var q$=0;q$<i;++q$)w[q$]=_4+q$;var O6=w,t6=r$(O6)}else if(a$){for(var q$=0;q$<i;++q$)w[q$]=_4+q$;var O6=w,t6=r$(w)}else var O6=v$,t6=r$(v$);L._score=t6;for(var q$=0;q$<i;++q$)L._indexes[q$]=O6[q$];L._indexes.len=i;let _v=new Y;return _v.target=L.target,_v._score=L._score,_v._indexes=L._indexes,_v},S=(F,L,m)=>{var d=new Set,p=0,c=X$,f=0,s=F.spaceSearches,i=s.length,H$=0,G$=()=>{for(let a$=H$-1;a$>=0;a$--)L._nextBeginningIndexes[o[a$*2+0]]=o[a$*2+1]},K4=!1;for(var j$=0;j$<i;++j$){D$[j$]=$$;var $4=s[j$];if(c=V($4,L),m){if(c===X$)continue;K4=!0}else if(c===X$)return G$(),X$;var W$=j$===i-1;if(!W$){var J4=c._indexes,w$=!0;for(let q$=0;q$<J4.len-1;q$++)if(J4[q$+1]-J4[q$]!==1){w$=!1;break}if(w$){var N$=J4[J4.len-1]+1,F6=L._nextBeginningIndexes[N$-1];for(let q$=N$-1;q$>=0;q$--){if(F6!==L._nextBeginningIndexes[q$])break;L._nextBeginningIndexes[q$]=N$,o[H$*2+0]=q$,o[H$*2+1]=F6,H$++}}}if(p+=c._score/i,D$[j$]=c._score/i,c._indexes[0]<f)p-=(f-c._indexes[0])*2;f=c._indexes[0];for(var T4=0;T4<c._indexes.len;++T4)d.add(c._indexes[T4])}if(m&&!K4)return X$;G$();var _4=V(F,L,!0);if(_4!==X$&&_4._score>p){if(m)for(var j$=0;j$<i;++j$)D$[j$]=_4._score/i;return _4}if(m)c=L;c._score=p;var j$=0;for(let a$ of d)c._indexes[j$++]=a$;return c._indexes.len=j$,c},T=(F)=>F.replace(/\p{Script=Latin}+/gu,(L)=>L.normalize("NFD")).replace(/[\u0300-\u036f]/g,""),r=(F)=>{F=T(F);var L=F.length,m=F.toLowerCase(),d=[],p=0,c=!1;for(var f=0;f<L;++f){var s=d[f]=m.charCodeAt(f);if(s===32){c=!0;continue}var i=s>=97&&s<=122?s-97:s>=48&&s<=57?26:s<=127?30:31;p|=1<<i}return{lowerCodes:d,bitflags:p,containsSpace:c,_lower:m}},A=(F)=>{var L=F.length,m=[],d=0,p=!1,c=!1;for(var f=0;f<L;++f){var s=F.charCodeAt(f),i=s>=65&&s<=90,H$=i||s>=97&&s<=122||s>=48&&s<=57,G$=i&&!p||!c||!H$;if(p=i,c=H$,G$)m[d++]=f}return m},u=(F)=>{F=T(F);var L=F.length,m=A(F),d=[],p=m[0],c=0;for(var f=0;f<L;++f)if(p>f)d[f]=p;else p=m[++c],d[f]=p===void 0?L:p;return d},k=new Map,O=new Map,w=[],v$=[],o=[],Q$=[],D$=[],x=[],t=[],C=(F,L)=>{var m=F[L];if(m!==void 0)return m;if(typeof L==="function")return L(F);var d=L;if(!Array.isArray(L))d=L.split(".");var p=d.length,c=-1;while(F&&++c<p)F=F[d[c]];return F},h=(F)=>{return typeof F==="object"&&typeof F._bitflags==="number"},I$=1/0,$$=-I$,R$=[];R$.total=0;var X$=null,j4=v(""),n8=(F)=>{var L=[],m=0,d={},p=(c)=>{for(var f=0,s=L[f],i=1;i<m;){var H$=i+1;f=i,H$<m&&L[H$]._score<L[i]._score&&(f=H$),L[f-1>>1]=L[f],i=1+(f<<1)}for(var G$=f-1>>1;f>0&&s._score<L[G$]._score;G$=(f=G$)-1>>1)L[f]=L[G$];L[f]=s};return d.add=(c)=>{var f=m;L[m++]=c;for(var s=f-1>>1;f>0&&c._score<L[s]._score;s=(f=s)-1>>1)L[f]=L[s];L[f]=c},d.poll=(c)=>{if(m!==0){var f=L[0];return L[0]=L[--m],p(),f}},d.peek=(c)=>{if(m!==0)return L[0]},d.replaceTop=(c)=>{L[0]=c,p()},d},E1=n8();return{single:_,go:U,prepare:v,cleanup:J}})});var dH={};s$(dH,{runSearchCore:()=>lH,runSearchCommandAction:()=>GA});async function GA($,_){if(_.installed){let Q=await F4(_.cwd);if(!Q||Object.keys(Q.installed).length===0){if(_.json)O$({success:!0,data:{components:[]}});else W.info("No components installed.");return}let v=Object.entries(Q.installed).map(([J,Y])=>({name:`${Y.registryName}/${Y.name}`,registry:Y.registryUrl,version:Y.revision,installedAt:void 0}));if(_.json)O$({success:!0,data:{components:v}});else{W.info(`Installed components (${v.length}):`);for(let J of v)console.log(` ${g.cyan(J.name)} ${g.dim(`v${J.version}`)} from ${J.registry}`)}return}let U;if(_.profile){let Q=await q6.create(_.cwd,{profile:_.profile});U={cwd:Q.getCwd(),getRegistries:()=>Q.getRegistries(),getComponentPath:()=>Q.getComponentPath()}}else U=await y4.requireInitialized(_.cwd);await lH($,_,U)}async function lH($,_,U){let Q=U.getRegistries();if(_.verbose)W.info(`Searching in ${Object.keys(Q).length} registries...`);let v=[],J=V$({text:"Searching registries...",quiet:_.quiet||_.verbose});if(!_.json&&!_.verbose)J.start();for(let[z,I]of Object.entries(Q))try{if(_.verbose)W.info(`Fetching index from ${z} (${I.url})...`);let X=await n6(I.url);if(_.verbose)W.info(`Found ${X.components.length} components in ${z}`);for(let q of X.components)v.push({name:`${z}/${q.name}`,description:q.description,type:q.type,registry:z})}catch(X){if(_.verbose)W.warn(`Failed to fetch registry ${z}: ${X instanceof Error?X.message:String(X)}`)}if(!_.json&&!_.verbose)J.stop();let Y=v;if($)Y=yY.default.go($,v,{keys:["name","description"],limit:_.limit}).map((I)=>I.obj);else Y=Y.slice(0,_.limit);if(_.json){O$({success:!0,data:{components:Y}});return}if(Y.length===0){W.info("No components found.");return}W.info(`Found ${Y.length} components:`);for(let z of Y)console.log(` ${g.cyan(z.name)} ${g.dim(`(${z.type})`)} - ${z.description}`)}var yY;var pH=b(()=>{k6();k0();g_();D1();BJ();i$();e4();yY=tY(cH(),1)});function jA($){let _=parseInt($,10);if(Number.isNaN(_)||_<=0)throw new iq("Must be a positive integer");return _}function iH($){let _=$.command("search").alias("list").description("Search for components across registries or list installed").argument("[query]","Search query").option("--installed","List installed components only",!1).option("-p, --profile <name>","Use specific profile").addOption(new M6("--limit <n>","Limit results").default(20).argParser(jA));Q4(_),m4(_),_.action(async(U,Q)=>{try{let{runSearchCommandAction:v}=await Promise.resolve().then(() => (pH(),dH));await v(U,Q)}catch(v){_$(v,{json:Q.json})}})}var nH=b(()=>{a2();c$();a4()});function rH($){let _=["curl","npm","yarn","pnpm","bun"],U=_.find((Q)=>Q===$);if(!U)throw new f$(`Invalid install method: "${$}"
254
+ Valid methods: ${_.join(", ")}`);return U}function h0(){if(KA())return"curl";let $=process.argv[1]??"";if(HA($))return"unknown";if(WA($))return"yarn";if(bA($))return"pnpm";if(BA($))return"bun";if(ZA($))return"npm";let _=process.env.npm_config_user_agent??"";if(_.includes("yarn"))return"yarn";if(_.includes("pnpm"))return"pnpm";if(_.includes("bun"))return"bun";if(_.includes("npm"))return"npm";return"unknown"}function f8(){if(typeof Bun<"u"&&Bun.main.startsWith("/$bunfs/"))return process.execPath;return process.argv[1]??process.execPath}var KA=()=>Bun.main.startsWith("/$bunfs/"),HA=($)=>$.includes("/_npx/")||$.includes("/.cache/bunx/")||$.includes("/.pnpm/_temp/"),WA=($)=>$.includes("/.yarn/global")||$.includes("/.config/yarn/global"),bA=($)=>$.includes("/.pnpm/")||$.includes("/pnpm/global"),BA=($)=>$.includes("/.bun/bin")||$.includes("/.bun/install/global"),ZA=($)=>$.includes("/.npm/")||$.includes("/node_modules/");var m8=b(()=>{z$()});import{existsSync as fY,lstatSync as aH,readdirSync as VA,realpathSync as oH,rmSync as DA,unlinkSync as sH}from"fs";import{homedir as eH}from"os";import $6 from"path";function CY($,_=0){O$({success:!0,data:$}),process.exit(_)}function N1($,_,U,Q){let v={success:!1,error:{code:$,message:_,...Q&&{details:Q}},exitCode:U,meta:{timestamp:new Date().toISOString()}};O$(v),process.exit(U)}function mY($){return $ instanceof Error&&"code"in $}function e_($){let _=eH();if(!_)return $;if($===_)return"~";if($.startsWith(_+$6.sep))return`~${$.slice(_.length)}`;return $}function h8($,_){let U=$6.normalize($),Q=$6.normalize(_),v=$6.relative(U,Q);if(v.startsWith("..")||$6.isAbsolute(v))return null;return v}function MA($,_){return h8($,_)!==null}function wA($,_){if(!fY(_))return{contained:!0};try{let U=oH($),Q=oH(_);return{contained:h8(U,Q)!==null}}catch(U){if(mY(U)&&(U.code==="EACCES"||U.code==="EPERM"))return{contained:!1,error:"permission"};return{contained:!1,error:"io"}}}function $W($){try{let _=aH($);if(_.isSymbolicLink())return{valid:!1,reason:"symlink"};if(!_.isDirectory())return{valid:!1,reason:"not-directory"};return{valid:!0}}catch(_){if(mY(_)){if(_.code==="ENOENT")return{valid:!1,reason:"not-found"};if(_.code==="EACCES"||_.code==="EPERM")return{valid:!1,reason:"permission"}}return{valid:!1,reason:"permission"}}}function $v($){if(!fY($))return"missing";try{let _=aH($);if(_.isSymbolicLink())return"symlink";if(_.isDirectory())return"directory";return"file"}catch{return"missing"}}function LA($){if(!fY($))return!0;try{return VA($).length===0}catch{return!1}}function tH($){if($.kind==="missing")return"safe";if($.kind==="symlink")return MA($.rootPath,$.absolutePath)?"safe":"forbidden";let _=wA($.rootPath,$.absolutePath);if(_.error)return"error";return _.contained?"safe":"forbidden"}function S1($){return $==="npm"||$==="pnpm"||$==="bun"||$==="yarn"}function c8($){switch($){case"npm":return"npm uninstall -g ocx";case"pnpm":return"pnpm remove -g ocx";case"bun":return"bun remove -g ocx";case"yarn":return"yarn global remove ocx";default:return"npm uninstall -g ocx"}}function gY(){let $=process.env.XDG_CONFIG_HOME||$6.join(eH(),".config");return $6.join($,"opencode")}function _W(){let $=gY(),_=[],U=w6(),Q=h8($,U);if(Q){let z=$v(U);_.push({rootPath:$,relativePath:Q,absolutePath:U,displayPath:e_(U),kind:z,deleteIfEmpty:!1,safetyStatus:tH({rootPath:$,absolutePath:U,kind:z})})}let v=F0(),J=h8($,v);if(J){let z=$v(v);_.push({rootPath:$,relativePath:J,absolutePath:v,displayPath:e_(v),kind:z,deleteIfEmpty:!1,safetyStatus:tH({rootPath:$,absolutePath:v,kind:z})})}let Y=$v($);return _.push({rootPath:$,relativePath:".",absolutePath:$,displayPath:e_($),kind:Y,deleteIfEmpty:!0,safetyStatus:Y==="missing"?"safe":"safe"}),_}function vW(){let $=h0();if(S1($))return null;if($==="curl"){let _=f8(),U=$v(_);return{rootPath:$6.dirname(_),relativePath:$6.basename(_),absolutePath:_,displayPath:e_(_),kind:U,deleteIfEmpty:!1,safetyStatus:U==="missing"?"safe":"safe"}}return null}function kA($){if($.kind==="missing")return{target:$,success:!0,skipped:!0,reason:"not found"};if($.safetyStatus==="forbidden")return{target:$,success:!1,skipped:!0,reason:"containment violation",error:Error("Target escapes containment boundary")};if($.deleteIfEmpty&&$.kind==="directory"){if(!LA($.absolutePath))return{target:$,success:!0,skipped:!0,reason:"not empty"}}try{if($.kind==="directory")DA($.absolutePath,{recursive:!0,force:!0});else sH($.absolutePath);return{target:$,success:!0,skipped:!1}}catch(_){let U=_ instanceof Error?_:Error(String(_)),Q=mY(_)&&(_.code==="EACCES"||_.code==="EPERM")?"permission denied":void 0;return{target:$,success:!1,skipped:!1,reason:Q,error:U}}}function UW($){return $.map(kA)}function QW($,_={}){let U={rootPath:$6.dirname($),relativePath:$6.basename($),absolutePath:$,displayPath:e_($),kind:$v($),deleteIfEmpty:!1,safetyStatus:"safe"};if(U.kind==="missing")return{target:U,success:!0,skipped:!0,reason:"not found"};if(process.platform==="win32"){if(!_.suppressOutput)W.info(`To complete uninstall, manually delete: ${U.displayPath}`);return{target:U,success:!0,skipped:!0}}try{return sH($),{target:U,success:!0,skipped:!1}}catch(Q){let v=Q instanceof Error?Q:Error(String(Q));return{target:U,success:!1,skipped:!1,reason:"permission denied",error:v}}}function AA($,_,U){let{dryRunResult:Q,hints:v}=JW($,_,U);S4(Q,{hints:v})}function JW($,_,U){let Q=$.filter((z)=>z.kind!=="missing"),v=[];for(let z of Q)v.push({action:"delete",target:z.displayPath,details:{kind:z.kind,...z.deleteIfEmpty&&{deleteIfEmpty:!0}}});if(_&&_.kind!=="missing")v.push({action:"delete",target:_.displayPath,details:{kind:"binary"}});let J=[];if(S1(U))J.push(`Binary is managed by ${U}. Run: ${c8(U)}`);return{dryRunResult:{dryRun:!0,command:"self uninstall",wouldPerform:v,validation:{passed:!0},summary:v.length>0?`Would remove ${v.length} item(s)`:"Nothing to remove"},hints:J}}function FA($,_){if($.filter((Q)=>Q.kind!=="missing").length>0||_&&_.kind!=="missing")W.info("Removing OCX files...")}function OA($,_,U){W.break();for(let Q of $){if(Q.skipped){if(Q.reason==="not found")continue;if(Q.reason==="not empty"){W.info(`Kept ${N4.path(Q.target.displayPath)} (not empty)`);continue}if(Q.reason==="permission denied"){W.warn(`Skipped ${N4.path(Q.target.displayPath)} (permission denied)`);continue}if(Q.reason==="containment violation"){W.warn(`Skipped ${N4.path(Q.target.displayPath)} (containment violation)`);continue}}if(Q.success)W.success(`Removed ${N4.path(Q.target.displayPath)}`);else W.error(`Failed to remove ${Q.target.displayPath}: ${Q.error?.message}`)}if(_){if(_.skipped&&_.reason==="not found");else if(_.success&&!_.skipped)W.success(`Removed binary ${N4.path(_.target.displayPath)}`);else if(!_.success)W.error(`Failed to remove binary ${_.target.displayPath}: ${_.error?.message}`)}if(S1(U))W.break(),W.info(`Binary is managed by ${U}. To complete uninstall, run:`),W.log(` ${N4.command(c8(U))}`)}function NA(){W.info("Nothing to remove. OCX is not installed globally.")}function g8($){return{path:$.target.displayPath,kind:$.target.kind,success:$.success,skipped:$.skipped,...$.reason&&{reason:$.reason},...$.error&&{error:$.error.message}}}async function SA($){let _=gY(),U=$W(_);if(!U.valid)switch(U.reason){case"not-found":break;case"symlink":return N1("VALIDATION_ERROR","Safety error: Global config root is a symlink. Aborting.",n$.SAFETY_ERROR);case"not-directory":return N1("VALIDATION_ERROR","Safety error: Global config root is not a directory. Aborting.",n$.SAFETY_ERROR);case"permission":return N1("PERMISSION_ERROR","Error: Cannot access global config root (permission denied).",n$.ERROR)}let Q=_W(),v=Q.filter((T)=>T.safetyStatus==="forbidden");if(v.length>0)return N1("VALIDATION_ERROR","Safety error: Target escapes containment boundary.",n$.SAFETY_ERROR,{targets:v.map((T)=>T.displayPath)});let J=Q.filter((T)=>T.safetyStatus==="error");if(J.length>0)return N1("PERMISSION_ERROR","Error: Cannot verify containment for targets (permission/IO error).",n$.ERROR,{targets:J.map((T)=>T.displayPath)});let Y=h0(),z=vW(),I=Q.filter((T)=>T.kind!=="missing"),X=Boolean(z&&z.kind!=="missing"),q=S1(Y);if(I.length===0&&!X&&!q)return CY({message:"Nothing to remove. OCX is not installed globally.",removed:[],skipped:[]},n$.SUCCESS);if($.dryRun){let{dryRunResult:T,hints:r}=JW(Q,z,Y);return CY({...T,...r.length>0&&{hints:r}},n$.SUCCESS)}let G=UW(Q),j=null;if(z)j=QW(z.absolutePath,{suppressOutput:!0});let H=G.some((T)=>!T.success&&!T.skipped),Z=Boolean(j&&!j.success&&!j.skipped);if(H||Z)return N1("PERMISSION_ERROR","Failed to remove one or more uninstall targets.",n$.ERROR,{configResults:G.map(g8),...j&&{binaryResult:g8(j)}});if(S1(Y))return N1("UPDATE_ERROR",`Binary is managed by ${Y}. Run: ${c8(Y)}`,n$.ERROR,{installMethod:Y,command:c8(Y),configResults:G.map(g8),...j&&{binaryResult:g8(j)}});let V=G.filter((T)=>T.success&&!T.skipped).map((T)=>T.target.displayPath),S=G.filter((T)=>T.skipped).map((T)=>({path:T.target.displayPath,reason:T.reason??"skipped"}));if(j){if(j.success&&!j.skipped)V.push(j.target.displayPath);else if(j.skipped)S.push({path:j.target.displayPath,reason:j.reason??"skipped"})}return CY({removed:V,skipped:S,installMethod:Y},n$.SUCCESS)}async function TA($){if($.json){await SA($);return}let _=gY(),U=$W(_);if(!U.valid)switch(U.reason){case"not-found":break;case"symlink":W.error("Safety error: Global config root is a symlink. Aborting."),process.exit(n$.SAFETY_ERROR);break;case"not-directory":W.error("Safety error: Global config root is not a directory. Aborting."),process.exit(n$.SAFETY_ERROR);break;case"permission":W.error("Error: Cannot access global config root (permission denied)."),process.exit(n$.ERROR);break}let Q=_W(),v=Q.filter((V)=>V.safetyStatus==="forbidden");if(v.length>0){W.error("Safety error: Target escapes containment boundary:");for(let V of v)W.error(` ${V.displayPath}`);process.exit(n$.SAFETY_ERROR)}let J=Q.filter((V)=>V.safetyStatus==="error");if(J.length>0){W.error("Error: Cannot verify containment for targets (permission/IO error):");for(let V of J)W.error(` ${V.displayPath}`);process.exit(n$.ERROR)}let Y=h0(),z=vW(),I=Q.filter((V)=>V.kind!=="missing"),X=z&&z.kind!=="missing",q=S1(Y);if(I.length===0&&!X&&!q)NA(),process.exit(n$.SUCCESS);if($.dryRun)AA(Q,z,Y),process.exit(n$.SUCCESS);FA(Q,z);let G=UW(Q),j=null;if(z)j=QW(z.absolutePath);OA(G,j,Y);let H=G.some((V)=>!V.success&&!V.skipped),Z=j&&!j.success&&!j.skipped;if(H||Z)process.exit(n$.ERROR);if(S1(Y))process.exit(n$.ERROR);process.exit(n$.SUCCESS)}function YW($){$.command("uninstall").description("Remove OCX global configuration and binary").option("--dry-run","Preview what would be removed").option("--json","Output as JSON").action(async(_)=>{try{await TA(_)}catch(U){_$(U,{json:_.json})}})}var n$;var zW=b(()=>{Z4();m8();w1();c$();i$();n$={SUCCESS:0,ERROR:1,SAFETY_ERROR:2}});class IW{version="2.0.5"}var XW;var qW=b(()=>{XW=new IW});var jW={};s$(jW,{checkForUpdate:()=>cY,EXPLICIT_UPDATE_TIMEOUT_MS:()=>hY});function GW($){let[_=""]=$.split("-"),U=_.split("."),Q=parseInt(U[0]??"",10),v=parseInt(U[1]??"",10),J=parseInt(U[2]??"",10);if(Number.isNaN(Q)||Number.isNaN(v)||Number.isNaN(J))return null;return{major:Q,minor:v,patch:J}}function PA($,_){let U=GW($),Q=GW(_);if(!U||!Q)return null;if(U.major!==Q.major)return U.major-Q.major;if(U.minor!==Q.minor)return U.minor-Q.minor;return U.patch-Q.patch}async function cY($,_=RA){let Q=($??XW).version||"0.0.0-dev";if(Q==="0.0.0-dev")return{ok:!1,reason:"dev-version"};try{let J=(await q8(EA,void 0,AbortSignal.timeout(_))).version,Y=PA(J,Q);if(Y===null)return{ok:!1,reason:"invalid-response"};return{ok:!0,current:Q,latest:J,updateAvailable:Y>0}}catch(v){if(v instanceof Error){if(v.name==="AbortError"||v.name==="TimeoutError")return{ok:!1,reason:"timeout"};if(v instanceof E$||v.name==="NetworkError")return{ok:!1,reason:"network-error"}}return{ok:!1,reason:"invalid-response"}}}var RA=200,hY=1e4,EA="ocx";var lY=b(()=>{z$();iJ();qW()});import{chmodSync as xA,existsSync as T1,renameSync as dY,unlinkSync as l8}from"fs";function CA(){let $=process.env.OCX_DOWNLOAD_URL;if($)return $.replace(/\/+$/,"");return yA}function pY($){let _=`${process.arch}-${process.platform}`,U=KW[_];if(!U){let v=Object.keys(KW).join(", ");throw new f$(`Unsupported platform: ${_}
255
+ Supported platforms: ${v}`)}return`${CA()}/v${$}/${U}`}async function fA($,_,U={}){let Q=U.quiet?null:V$({text:"Downloading update..."});Q?.start();let v;try{v=await fetch($,{redirect:"follow"})}catch(X){throw Q?.fail("Download failed"),new f$(`Network error: ${X instanceof Error?X.message:String(X)}`)}if(!v.ok)throw Q?.fail("Download failed"),new f$(`Failed to download: HTTP ${v.status} ${v.statusText}`);if(!v.body)throw Q?.fail("Download failed"),new f$("Download failed: Empty response body");let J=v.body.getReader(),Y=Bun.file(_).writer(),z=Number(v.headers.get("content-length")||0),I=0;try{while(!0){let{done:X,value:q}=await J.read();if(X)break;if(await Y.write(q),I+=q.length,z>0&&Q){let G=Math.round(I/z*100);Q.text=`Downloading... ${G}%`}}await Y.end(),Q?.succeed("Download complete")}catch(X){throw Q?.fail("Download failed"),await Y.end(),new f$(`Download interrupted: ${X instanceof Error?X.message:String(X)}`)}}async function HW($,_={}){let U=f8(),Q=`${U}.new.${Date.now()}`,v=pY($);await fA(v,Q,_);try{xA(Q,493)}catch(J){if(T1(Q))l8(Q);throw new f$(`Failed to set permissions: ${J instanceof Error?J.message:String(J)}`)}return{tempPath:Q,execPath:U}}function WW($,_){let U=`${_}.backup`;try{if(T1(_))dY(_,U);if(dY($,_),T1(U))l8(U)}catch(Q){if(T1(U)&&!T1(_))try{dY(U,_)}catch{}if(T1($))try{l8($)}catch{}throw new f$(`Update failed: ${Q instanceof Error?Q.message:String(Q)}`)}}function bW($){if(T1($))try{l8($)}catch{}}var uA="kdcokenny/ocx",yA,KW;var BW=b(()=>{z$();e4();m8();yA=`https://github.com/${uA}/releases/download`,KW={"arm64-darwin":"ocx-darwin-arm64","x64-darwin":"ocx-darwin-x64","arm64-linux":"ocx-linux-arm64","x64-linux":"ocx-linux-x64","x64-win32":"ocx-windows-x64.exe"}});var ZW={};s$(ZW,{notifyUpdated:()=>d8,notifyUpdate:()=>mA,notifyUpToDate:()=>iY});function mA($,_){if(!process.stdout.isTTY)return;console.error(`${g.cyan("info")}: update available - ${g.green(_)} (current: ${g.dim($)})`),console.error(` run ${g.cyan("`ocx self update`")} to upgrade`)}function iY($){console.error(`${g.cyan("info")}: ocx unchanged - ${g.dim($)}`)}function d8($,_){console.error(` ${g.green("ocx updated")} - ${_} (from ${$})`)}var nY=b(()=>{k6()});import{createHash as gA}from"crypto";function cA($){let _=new Map;for(let U of $.split(`
256
+ `)){let Q=U.match(/^([a-fA-F0-9]{64})\s+\*?(.+)$/);if(Q?.[1]&&Q[2])_.set(Q[2].trim(),Q[1].toLowerCase())}return _}function lA($){return gA("sha256").update($).digest("hex")}async function VW($){let _=`https://github.com/${hA}/releases/download/v${$}/SHA256SUMS.txt`,U=await fetch(_);if(!U.ok)throw new f$(`Failed to fetch checksums: ${U.status}`);let Q=await U.text();return cA(Q)}async function DW($,_,U){let v=await Bun.file($).arrayBuffer(),J=lA(Buffer.from(v));if(J!==_)throw new I1(U,_,J)}var hA="kdcokenny/ocx";var MW=b(()=>{z$()});var wW={};s$(wW,{runSelfUpdateCommand:()=>iA});async function iA($){let _=$.method?rH($.method):h0(),U=$.json===!0,Q=await cY(void 0,hY);if(!Q.ok)throw new f$(pA[Q.reason]);let{current:v,latest:J,updateAvailable:Y}=Q;if(!Y&&!$.force){if(U)O$({success:!0,data:{current:v,latest:J,method:_,updated:!1}});else iY(v);return}let z=J;switch(_){case"curl":{await nA(v,z,U);break}case"npm":case"pnpm":case"bun":case"yarn":case"unknown":{await rA(_,v,z,U);break}}if(U)O$({success:!0,data:{current:v,latest:z,method:_,updated:!0}})}async function nA($,_,U){let v=pY(_).split("/").pop();if(!v)throw new f$("Failed to determine binary filename from download URL");let Y=(await VW(_)).get(v);if(!Y)throw new f$(`Security error: No checksum found for ${v}. Update aborted.`);let{tempPath:z,execPath:I}=await HW(_,{quiet:U});try{await DW(z,Y,v)}catch(X){throw bW(z),X}if(WW(z,I),!U)d8($,_)}async function p8($){let _=Bun.spawn($,{stdout:"pipe",stderr:"pipe"});if(await _.exited!==0){let Q=await new Response(_.stderr).text();throw new f$(`Package manager command failed: ${Q.trim()}`)}}async function rA($,_,U,Q){if(!dA.test(U))throw new f$(`Invalid version format: ${U}`);let v=Q?null:V$({text:`Updating via ${$}...`});v?.start();try{switch($){case"npm":{await p8(["npm","install","-g",`ocx@${U}`]);break}case"yarn":{await p8(["yarn","global","add",`ocx@${U}`]);break}case"pnpm":{await p8(["pnpm","install","-g",`ocx@${U}`]);break}case"bun":{await p8(["bun","install","-g",`ocx@${U}`]);break}case"unknown":throw new f$(`Could not detect install method. Update manually with one of:
214
257
  npm install -g ocx@latest
215
258
  pnpm install -g ocx@latest
216
- bun install -g ocx@latest`)}if(_?.succeed(`Updated via ${D}`),!$)p8(F,B)}catch(Q){if(Q instanceof vD)throw _?.fail("Update failed"),Q;throw _?.fail("Update failed"),new vD(`Failed to run ${D}: ${Q instanceof Error?Q.message:String(Q)}`)}}var eG,DW;var u$=V(()=>{l6();m8();S$();s6();v$();$D();m0();eG=/^\d+\.\d+\.\d+(-[\w.]+)?$/,DW={"dev-version":"Cannot check for updates in development mode. Install via npm for update support.",timeout:"Update check timed out after 10s. Try again or check your network.","network-error":"Cannot reach npm registry. Verify your internet connection.","invalid-response":"Received invalid response from npm registry. Try again later."}});function P$(D){D.command("update").description("Update OCX to the latest version").option("-f, --force","Reinstall even if already up to date").option("--method <method>","Override install method detection (curl|npm|pnpm|bun)").option("--json","Output as JSON").action(async(F)=>{try{let{runSelfUpdateCommand:B}=await Promise.resolve().then(() => (u$(),C$));await B(F)}catch(B){t(B,{json:F.json})}})}var x$=V(()=>{PD()});function y$(D){let F=D.command("self").description("Manage the OCX CLI");K$(F),P$(F)}var f$=V(()=>{U$();x$()});import{randomUUID as h$}from"crypto";import{existsSync as XF}from"fs";import{mkdir as _W,rename as QW,rm as n8,stat as YW,writeFile as qW}from"fs/promises";import{dirname as HW,join as JW}from"path";function a6(D,F){return`ocx add${F.global?" --global":""} ${D}`}function m$(D){return D==="apply"?"Failed to update components":"Failed to check for updates"}function g$(D){let F=D.command("update [components...]").description("Update installed components");oD(F),w0(F),r0(F),F.option("--all","Update all installed components").option("--registry <name>","Update all components from a specific registry").option("--dry-run","Preview changes without applying").action(async(B,$)=>{try{await XW(B,$)}catch(_){t(_,{json:$.json})}})}async function XW(D,F){let B=F.cwd??process.cwd(),$=F.global?await mF.requireInitialized():await V0.requireInitialized(B);await GW(D,F,$)}async function GW(D,F,B,$){let _=B.getRegistries(),Q=B.getComponentPath(),Y=Q===""||Q===".",q=D.map(zW),H=await J0(B.cwd);if(!H||Object.keys(H.installed).length===0){if(D.length>0){let N=D[0];if(!N)throw Error("Unexpected: component name missing despite non-empty componentNames");throw new MD(`Component '${N}' is not installed. Run '${a6(N,F)}' first.`)}throw new MD(`No components installed. Run '${a6("<component>",F)}' first.`)}let J=D.length>0,X=F.all===!0,z=F.registry!==void 0;if(!J&&!X&&!z)throw new U(`Specify components, use --all, or use --registry <name>.
259
+ bun install -g ocx@latest`)}if(v?.succeed(`Updated via ${$}`),!Q)d8(_,U)}catch(J){if(J instanceof f$)throw v?.fail("Update failed"),J;throw v?.fail("Update failed"),new f$(`Failed to run ${$}: ${J instanceof Error?J.message:String(J)}`)}}var dA,pA;var LW=b(()=>{lY();m8();BW();nY();MW();z$();e4();dA=/^\d+\.\d+\.\d+(-[\w.]+)?$/,pA={"dev-version":"Cannot check for updates in development mode. Install via npm for update support.",timeout:"Update check timed out after 10s. Try again or check your network.","network-error":"Cannot reach npm registry. Verify your internet connection.","invalid-response":"Received invalid response from npm registry. Try again later."}});function kW($){$.command("update").description("Update OCX to the latest version").option("-f, --force","Reinstall even if already up to date").option("--method <method>","Override install method detection (curl|npm|pnpm|bun)").option("--json","Output as JSON").action(async(_)=>{try{let{runSelfUpdateCommand:U}=await Promise.resolve().then(() => (LW(),wW));await U(_)}catch(U){_$(U,{json:_.json})}})}var AW=b(()=>{c$()});function FW($){let _=$.command("self").description("Manage the OCX CLI");YW(_),kW(_)}var OW=b(()=>{zW();AW()});import{randomUUID as NW}from"crypto";import{existsSync as R1}from"fs";import{mkdir as oA,rename as tA,rm as i8,stat as aA,writeFile as sA}from"fs/promises";import{dirname as eA,join as $F}from"path";function rY($,_){return`ocx add${_.global?" --global":""} ${$}`}function SW($){return $==="apply"?"Failed to update components":"Failed to check for updates"}function TW($){let _=$.command("update [components...]").description("Update installed components");Q4(_),m4(_),G6(_),_.option("--all","Update all installed components").option("--registry <name>","Update all components from a specific registry").option("--dry-run","Preview changes without applying").action(async(U,Q)=>{try{await _F(U,Q)}catch(v){_$(v,{json:Q.json})}})}async function _F($,_){let U=_.cwd??process.cwd(),Q=_.global?await L0.requireInitialized():await y4.requireInitialized(U);await vF($,_,Q)}async function vF($,_,U,Q){let v=U.getRegistries(),J=U.getComponentPath(),Y=J===""||J===".",z=$.map(QF),I=await F4(U.cwd);if(!I||Object.keys(I.installed).length===0){if($.length>0){let A=$[0];if(!A)throw Error("Unexpected: component name missing despite non-empty componentNames");throw new B$(`Component '${A}' is not installed. Run '${rY(A,_)}' first.`)}throw new B$(`No components installed. Run '${rY("<component>",_)}' first.`)}let X=$.length>0,q=_.all===!0,G=_.registry!==void 0;if(!X&&!q&&!G)throw new M(`Specify components, use --all, or use --registry <name>.
217
260
 
218
261
  Examples:
219
262
  ocx update alias/component # Update specific component
220
263
  ocx update --all # Update all installed components
221
- ocx update --registry my-alias # Update all from a registry`);if(X&&J)throw new U(`Cannot specify components with --all.
222
- Use either 'ocx update --all' or 'ocx update <components>'.`);if(z&&J)throw new U(`Cannot specify components with --registry.
223
- Use either 'ocx update --registry <name>' or 'ocx update <components>'.`);if(X&&z)throw new U(`Cannot use --all with --registry.
224
- Use either 'ocx update --all' or 'ocx update --registry <name>'.`);let M=MW(H,q,F);if(M.length===0){if(z)throw new MD(`No installed components from registry '${F.registry}'.`);throw new MD("No matching components found to update.")}let A=F.quiet?null:jD({text:"Checking for updates..."});A?.start();let K=null,j="check",S=null,Z=[],s=[];try{for(let O of M){let b=O.component,L=H.installed[b];if(!L)throw new MD(`Component '${b}' not found in receipt.`);let{registryName:e,name:p}=L,FD=_[e];if(!FD)throw new c(`Registry alias '${e}' not configured. Component '${b}' cannot be updated.`);let k=(await W8(FD.url,p,void 0)).manifest,i=p2(k),v=[];for(let r of i.files){let bD=await e2(FD.url,p,r.path);v.push({path:r.path,content:Buffer.from(bD)})}let f=await j8(v),_D=`sha256:${f}`;if(f===L.hash)Z.push({qualifiedName:b,oldVersion:L.revision,newVersion:_D,status:"up-to-date"});else if(F.dryRun)Z.push({qualifiedName:b,oldVersion:L.revision,newVersion:_D,status:"would-update"});else Z.push({qualifiedName:b,oldVersion:L.revision,newVersion:_D,status:"updated"}),s.push({canonicalId:b,component:i,files:v,newHash:f,newVersion:_D,baseUrl:FD.url,registryName:e,name:p})}if(A?.succeed(`Checked ${M.length} component(s)`),F.dryRun){AW(Z,F);return}if(s.length===0){if(!F.quiet&&!F.json)G.info(""),G.success("All components are up to date.");if(F.json)console.log(JSON.stringify({success:!0,updated:[],upToDate:Z},null,2));return}j="apply",K=F.quiet?null:jD({text:"Updating components..."}),K?.start();let N=new Map,x=[];for(let O of s){let b=[];for(let L of O.files){let e=O.component.files.find((KD)=>KD.path===L.path);if(!e)throw new U(`File "${L.path}" not found in component manifest for "${O.registryName}/${O.name}".`);let p=n2(e.target,Y,B.cwd),FD=JW(B.cwd,p);$F(N,{absolutePath:FD,relativePath:p,content:L.content,source:`${O.registryName}/${O.name}:${e.path}`}),b.push({resolvedTarget:p,targetPath:FD,content:L.content})}x.push({update:O,preparedFiles:b})}S=await WW(x,{verbose:F.verbose,quiet:F.quiet,fileOps:$});for(let O of x){let{update:b,preparedFiles:L}=O,e=H.installed[b.canonicalId];if(!e)throw new MD(`Component '${b.canonicalId}' not found in receipt.`);let p=[];for(let FD of L)p.push({path:FD.resolvedTarget,hash:_F(FD.content)});H.installed[b.canonicalId]={registryUrl:e.registryUrl,registryName:e.registryName,name:e.name,revision:b.newVersion,hash:b.newHash,files:p,installedAt:e.installedAt,updatedAt:new Date().toISOString(),...b.component.opencode&&{opencode:b.component.opencode}}}if(await K0(B.cwd,H),!S)throw Error("Internal error: missing applied write transaction after update apply phase.");if(await S.commit(),S=null,K?.succeed(`Updated ${s.length} component(s)`),F.json)console.log(JSON.stringify({success:!0,updated:Z.filter((O)=>O.status==="updated"),upToDate:Z.filter((O)=>O.status==="up-to-date")},null,2));else if(!F.quiet){G.info("");for(let O of Z)if(O.status==="updated")G.info(` \u2713 ${O.qualifiedName} (${O.oldVersion} \u2192 ${O.newVersion})`);else if(O.status==="up-to-date"&&F.verbose)G.info(` \u25CB ${O.qualifiedName} (already up to date)`);G.info(""),G.success(`Done! Updated ${s.length} component(s).`)}}catch(N){if(j==="apply"){if(S)await S.rollback(),S=null;K?.fail(m$("apply"))}else A?.fail(m$("check"));throw N}}async function WW(D,F){let B=[],$=new Set,_=!1,Q=F.fileOps?.rename??QW,Y=async()=>{if(_)return;_=!0;for(let H of $)try{await n8(H,{force:!0})}catch{}for(let H of[...B].reverse())try{if(H.backupPath){if(XF(H.targetPath))await n8(H.targetPath,{force:!0,recursive:!0});if(XF(H.backupPath))await Q(H.backupPath,H.targetPath)}else if(XF(H.targetPath))await n8(H.targetPath,{force:!0,recursive:!0})}catch{}},q=async()=>{if(_)return;_=!0;for(let H of B){if(!H.backupPath)continue;if(XF(H.backupPath))try{await n8(H.backupPath,{force:!0})}catch(J){if(!F.quiet){let X=J instanceof Error?J.message:String(J);G.warn(`Post-update cleanup warning: failed to remove backup "${H.backupPath}" (${X})`)}}}};try{for(let H of D)for(let J of H.preparedFiles){let X=HW(J.targetPath);if(!XF(X))await _W(X,{recursive:!0});if(XF(J.targetPath)){if((await YW(J.targetPath)).isDirectory())throw new U(`Cannot update "${J.resolvedTarget}": target path is a directory.`)}let z=`${J.targetPath}.ocx-update-tmp-${h$()}`;await qW(z,J.content),$.add(z);let M=null;if(XF(J.targetPath))M=`${J.targetPath}.ocx-update-backup-${h$()}`,await Q(J.targetPath,M),B.push({targetPath:J.targetPath,backupPath:M});if(await Q(z,J.targetPath),$.delete(z),!M)B.push({targetPath:J.targetPath,backupPath:null});if(F.verbose)G.info(` \u2713 Updated ${J.resolvedTarget}`)}return{commit:q,rollback:Y}}catch(H){throw await Y(),H}}function zW(D){if(D.endsWith("@"))throw new c(`Invalid version specifier '${D}'. The trailing '@' has no version.
225
- Use '${D.slice(0,-1)}' to update to the latest version.`);return{component:D}}function MW(D,F,B){let $=Object.keys(D.installed);if(B.all)return $.map((Q)=>({component:Q}));if(B.registry)return $.filter((Q)=>{return D.installed[Q]?.registryName===B.registry}).map((Q)=>({component:Q}));let _=[];for(let Q of F){let Y=Q.component;if(!Y.includes("/")){let z=$.map((M)=>{let A=Z2(M);return`${A.registryName}/${A.name}`}).filter((M)=>M.endsWith(`/${Y}`));if(z.length===1)throw new U(`Ambiguous component '${Y}'. Did you mean '${z[0]}'?`);if(z.length>1)throw new U(`Ambiguous component '${Y}'. Found in multiple registries:
226
- `+z.map((M)=>` - ${M}`).join(`
264
+ ocx update --registry my-alias # Update all from a registry`);if(q&&X)throw new M(`Cannot specify components with --all.
265
+ Use either 'ocx update --all' or 'ocx update <components>'.`);if(G&&X)throw new M(`Cannot specify components with --registry.
266
+ Use either 'ocx update --registry <name>' or 'ocx update <components>'.`);if(q&&G)throw new M(`Cannot use --all with --registry.
267
+ Use either 'ocx update --all' or 'ocx update --registry <name>'.`);let j=JF(I,z,_);if(j.length===0){if(G)throw new B$(`No installed components from registry '${_.registry}'.`);throw new B$("No matching components found to update.")}let H=_.quiet?null:V$({text:"Checking for updates..."});H?.start();let Z=null,V="check",S=null,T=[],r=[];try{for(let k of j){let O=k.component,w=I.installed[O];if(!w)throw new B$(`Component '${O}' not found in receipt.`);let{registryName:v$,name:o}=w,Q$=v[v$];if(!Q$)throw new n(`Registry alias '${v$}' not configured. Component '${O}' cannot be updated.`);let x=(await I8(Q$.url,o,void 0)).manifest,t=G1(x),C=[];for(let $$ of t.files){let R$=await V1(Q$.url,o,$$.path);C.push({path:$$.path,content:Buffer.from(R$)})}let h=await j8(C),I$=`sha256:${h}`;if(h===w.hash)T.push({qualifiedName:O,oldVersion:w.revision,newVersion:I$,status:"up-to-date"});else if(_.dryRun)T.push({qualifiedName:O,oldVersion:w.revision,newVersion:I$,status:"would-update"});else T.push({qualifiedName:O,oldVersion:w.revision,newVersion:I$,status:"updated"}),r.push({canonicalId:O,component:t,files:C,newHash:h,newVersion:I$,baseUrl:Q$.url,registryName:v$,name:o})}if(H?.succeed(`Checked ${j.length} component(s)`),_.dryRun){YF(T,_);return}if(r.length===0){if(!_.quiet&&!_.json)W.info(""),W.success("All components are up to date.");if(_.json)console.log(JSON.stringify({success:!0,updated:[],upToDate:T},null,2));return}V="apply",Z=_.quiet?null:V$({text:"Updating components..."}),Z?.start();let A=new Map,u=[];for(let k of r){let O=[];for(let w of k.files){let v$=k.component.files.find((D$)=>D$.path===w.path);if(!v$)throw new M(`File "${w.path}" not found in component manifest for "${k.registryName}/${k.name}".`);let o=K1(v$.target,Y,U.cwd),Q$=$F(U.cwd,o);L1(A,{absolutePath:Q$,relativePath:o,content:w.content,source:`${k.registryName}/${k.name}:${v$.path}`}),O.push({resolvedTarget:o,targetPath:Q$,content:w.content})}u.push({update:k,preparedFiles:O})}S=await UF(u,{verbose:_.verbose,quiet:_.quiet,fileOps:Q});for(let k of u){let{update:O,preparedFiles:w}=k,v$=I.installed[O.canonicalId];if(!v$)throw new B$(`Component '${O.canonicalId}' not found in receipt.`);let o=[];for(let Q$ of w)o.push({path:Q$.resolvedTarget,hash:k1(Q$.content)});I.installed[O.canonicalId]={registryUrl:v$.registryUrl,registryName:v$.registryName,name:v$.name,revision:O.newVersion,hash:O.newHash,files:o,installedAt:v$.installedAt,updatedAt:new Date().toISOString(),...O.component.opencode&&{opencode:O.component.opencode}}}if(await x4(U.cwd,I),!S)throw Error("Internal error: missing applied write transaction after update apply phase.");if(await S.commit(),S=null,Z?.succeed(`Updated ${r.length} component(s)`),_.json)console.log(JSON.stringify({success:!0,updated:T.filter((k)=>k.status==="updated"),upToDate:T.filter((k)=>k.status==="up-to-date")},null,2));else if(!_.quiet){W.info("");for(let k of T)if(k.status==="updated")W.info(` \u2713 ${k.qualifiedName} (${k.oldVersion} \u2192 ${k.newVersion})`);else if(k.status==="up-to-date"&&_.verbose)W.info(` \u25CB ${k.qualifiedName} (already up to date)`);W.info(""),W.success(`Done! Updated ${r.length} component(s).`)}}catch(A){if(V==="apply"){if(S)await S.rollback(),S=null;Z?.fail(SW("apply"))}else H?.fail(SW("check"));throw A}}async function UF($,_){let U=[],Q=new Set,v=!1,J=_.fileOps?.rename??tA,Y=async()=>{if(v)return;v=!0;for(let I of Q)try{await i8(I,{force:!0})}catch{}for(let I of[...U].reverse())try{if(I.backupPath){if(R1(I.targetPath))await i8(I.targetPath,{force:!0,recursive:!0});if(R1(I.backupPath))await J(I.backupPath,I.targetPath)}else if(R1(I.targetPath))await i8(I.targetPath,{force:!0,recursive:!0})}catch{}},z=async()=>{if(v)return;v=!0;for(let I of U){if(!I.backupPath)continue;if(R1(I.backupPath))try{await i8(I.backupPath,{force:!0})}catch(X){if(!_.quiet){let q=X instanceof Error?X.message:String(X);W.warn(`Post-update cleanup warning: failed to remove backup "${I.backupPath}" (${q})`)}}}};try{for(let I of $)for(let X of I.preparedFiles){let q=eA(X.targetPath);if(!R1(q))await oA(q,{recursive:!0});if(R1(X.targetPath)){if((await aA(X.targetPath)).isDirectory())throw new M(`Cannot update "${X.resolvedTarget}": target path is a directory.`)}let G=`${X.targetPath}.ocx-update-tmp-${NW()}`;await sA(G,X.content),Q.add(G);let j=null;if(R1(X.targetPath))j=`${X.targetPath}.ocx-update-backup-${NW()}`,await J(X.targetPath,j),U.push({targetPath:X.targetPath,backupPath:j});if(await J(G,X.targetPath),Q.delete(G),!j)U.push({targetPath:X.targetPath,backupPath:null});if(_.verbose)W.info(` \u2713 Updated ${X.resolvedTarget}`)}return{commit:z,rollback:Y}}catch(I){throw await Y(),I}}function QF($){if($.endsWith("@"))throw new n(`Invalid version specifier '${$}'. The trailing '@' has no version.
268
+ Use '${$.slice(0,-1)}' to update to the latest version.`);return{component:$}}function JF($,_,U){let Q=Object.keys($.installed);if(U.all)return Q.map((J)=>({component:J}));if(U.registry)return Q.filter((J)=>{return $.installed[J]?.registryName===U.registry}).map((J)=>({component:J}));let v=[];for(let J of _){let Y=J.component;if(!Y.includes("/")){let G=Q.map((j)=>{let H=c6(j);return`${H.registryName}/${H.name}`}).filter((j)=>j.endsWith(`/${Y}`));if(G.length===1)throw new M(`Ambiguous component '${Y}'. Did you mean '${G[0]}'?`);if(G.length>1)throw new M(`Ambiguous component '${Y}'. Found in multiple registries:
269
+ `+G.map((j)=>` - ${j}`).join(`
227
270
  `)+`
228
271
 
229
- Please use a fully qualified name (alias/component).`);throw new U(`Component '${Y}' must include a registry alias (e.g., 'kdco/${Y}').`)}let{namespace:q,component:H}=u0(Y),J=$.filter((z)=>{let M=Z2(z);return M.registryName===q&&M.name===H});if(J.length===0)throw new MD(`Component '${Y}' is not installed.
230
- Run '${a6(Y,B)}' to install it first.`);let X=J[0];if(!X)throw Error("Unexpected: matchingIds has length but first element is undefined");_.push({component:X})}return _}function AW(D,F){let B=D.filter((Q)=>Q.status==="would-update"),_={dryRun:!0,command:"update",wouldPerform:B.map((Q)=>({action:"update",target:Q.qualifiedName,details:{from:Q.oldVersion,to:Q.newVersion}})),validation:{passed:!0},summary:B.length>0?`Would update ${B.length} component(s)`:"All components are up to date"};z0(_,{json:F.json,quiet:F.quiet})}var d$=V(()=>{gF();DF();tD();P0();BF();$D();PD();fD();k2();A8();iF();x0();m0()});import{resolve as jW}from"path";function KW(D,F){if(F==="not_found")return new MD(D);if(F==="parse_error")return new zD(D,"CONFIG_ERROR",XD.CONFIG);return new zD(D,"CONFIG_ERROR",XD.CONFIG)}function UW(D,F){let B=C3(D,{schemaErrors:F==="schema"?D.length:0}),$={valid:!1,errors:D,summary:{valid:!1,totalErrors:B.totalErrors,schemaErrors:B.schemaErrors,sourceFileErrors:B.sourceFileErrors,circularDependencyErrors:B.circularDependencyErrors,duplicateTargetErrors:B.duplicateTargetErrors,otherErrors:B.otherErrors}};return new g2($)}function VW(D){for(let F of D)console.log(P.red(` ${F}`))}function c$(D){D.command("validate").description("Validate a registry source (for registry authors)").argument("[path]","Registry source directory",".").option("--cwd <path>","Working directory",process.cwd()).option("--json","Output as JSON",!1).option("-q, --quiet","Suppress output",!1).option("--no-duplicate-targets","Skip duplicate target validation").action(async(F,B)=>{try{let $=jW(B.cwd,F),_=await N8($,{skipDuplicateTargets:B.duplicateTargets===!1});if(!_.success){let[Q="Registry validation failed"]=_.errors;if(_.failureType==="load"){let q=KW(Q,_.loadErrorKind);if(!B.json&&B.quiet){let H=q instanceof zD?q.exitCode:XD.GENERAL;process.exit(H)}throw q}let Y=UW(_.errors,_.failureType==="schema"?"schema":"rules");if(B.json)throw Y;if(!B.quiet)G.error(Y.message),VW(_.errors);process.exit(Y.exitCode)}if(!B.quiet&&!B.json)G.success("\u2713 Registry source is valid");if(B.json)LD({success:!0,data:{valid:!0,errors:[],summary:C3([])}})}catch($){if(!B.json&&B.quiet){let _=$ instanceof zD?$.exitCode:XD.GENERAL;process.exit(_)}t($,{json:B.json})}})}var l$=V(()=>{W2();L6();$D();PD();fD()});function p$(D){let F=D.command("verify").description("Verify integrity of installed components").argument("[components...]","Components to verify (optional, verifies all if omitted)");oD(F),w0(F),F.action(async(B,$)=>{try{await EW(B,$)}catch(_){t(_,{json:$.json})}})}async function EW(D,F){let B=F.cwd??process.cwd(),$=await V0.requireInitialized(B),_=await J0($.cwd);if(!_||Object.keys(_.installed).length===0){if(F.json)console.log(JSON.stringify({success:!0,verified:[],errors:[]},null,2));else if(!F.quiet)G.info("No components installed.");return}let Q;if(D.length>0)Q=y8(D,_);else Q=Object.keys(_.installed);let Y=F.quiet||F.json?null:jD({text:"Verifying components..."});Y?.start();let q=[],H=!1;for(let J of Q){let X=_.installed[J];if(!X){if(D.length>0)G.warn(`Component '${J}' not found in receipt.`);continue}let z=await N3($.cwd,X);if(!z.intact)H=!0;q.push({canonicalId:J,intact:z.intact,modified:z.modified,missing:z.missing})}if(Y?.succeed(`Verified ${q.length} component(s)`),F.json){if(console.log(JSON.stringify({success:!H,verified:q.filter((J)=>J.intact),errors:q.filter((J)=>!J.intact)},null,2)),H)process.exit(XD.CONFLICT);return}if(!F.quiet){G.info("");for(let J of q)if(J.intact){if(F.verbose)G.success(`\u2713 ${J.canonicalId} - all files intact`)}else{G.error(`\u2717 ${J.canonicalId} - integrity check failed`);for(let X of J.modified)G.error(` Modified: ${X}`);for(let X of J.missing)G.error(` Missing: ${X}`)}}if(H){if(!F.quiet)G.info(""),G.warn("Some files have been modified or are missing. Review local changes with git, then run 'ocx update <alias/component>' or 'ocx update --all' to restore.");throw new gD("File integrity check failed for one or more components.")}if(!F.quiet)G.info(""),G.success("All components verified successfully.")}var i$=V(()=>{gF();tD();x6();$D();PD();fD();iF();x0();m0()});function LW(){if(process.env.OCX_SELF_UPDATE==="off")return!1;if(V4(process.env.OCX_NO_UPDATE_CHECK,!1))return!1;if(process.env.CI)return!1;if(!process.stdout.isTTY)return!1;return!0}function n$(D){D.hook("postAction",async(F,B)=>{if(B.name()==="update"&&B.parent?.name()==="self")return;let $=B.opts();if($.json||$.quiet)return;if(!LW())return;try{let[{checkForUpdate:_},{notifyUpdate:Q}]=await Promise.all([Promise.resolve().then(() => (l6(),O$)),Promise.resolve().then(() => (s6(),k$))]),Y=await _();if(Y.ok&&Y.updateAvailable)Q(Y.current,Y.latest)}catch{}})}var s$=V(()=>{Z3()});var a$={};j2(a$,{runCli:()=>OW});async function OW(D=process.argv){let F=new G9().name("ocx").description("OpenCode Extensions - Install agents, skills, plugins, and commands").version(wW);nB(F),IB(F),g$(F),$$(F),i5(F),xB(F),c$(F),y$(F),p$(F),o5(F),B5(F),d5(F),cB(F),w5(F),n$(F),await F.parseAsync(D)}var wW="2.0.3";var o$=V(()=>{B8();E6();yB();lB();aB();_5();O5();c5();n5();r5();_$();f$();d$();l$();i$();s$()});o3();L1();if(import.meta.main)bW();async function bW(){try{let{runCli:D}=await Promise.resolve().then(() => (o$(),a$));await D()}catch(D){let{handleError:F}=await Promise.resolve().then(() => (PD(),E4));F(D)}}export{i2 as registrySchema,K3 as packumentSchema,t3 as ocxLockSchema,R2 as ocxConfigSchema,l2 as componentManifestSchema,U3 as buildRegistry};
272
+ Please use a fully qualified name (alias/component).`);throw new M(`Component '${Y}' must include a registry alias (e.g., 'kdco/${Y}').`)}let{namespace:z,component:I}=r4(Y),X=Q.filter((G)=>{let j=c6(G);return j.registryName===z&&j.name===I});if(X.length===0)throw new B$(`Component '${Y}' is not installed.
273
+ Run '${rY(Y,U)}' to install it first.`);let q=X[0];if(!q)throw Error("Unexpected: matchingIds has length but first element is undefined");v.push({component:q})}return v}function YF($,_){let U=$.filter((J)=>J.status==="would-update"),v={dryRun:!0,command:"update",wouldPerform:U.map((J)=>({action:"update",target:J.qualifiedName,details:{from:J.oldVersion,to:J.newVersion}})),validation:{passed:!0},summary:U.length>0?`Would update ${U.length} component(s)`:"All components are up to date"};S4(v,{json:_.json,quiet:_.quiet})}var RW=b(()=>{k0();D1();X4();o4();w1();z$();c$();i$();p6();G8();T0();a4();e4()});import{resolve as zF}from"path";function IF($,_){if(_==="not_found")return new B$($);if(_==="parse_error")return new b$($,"CONFIG_ERROR",K$.CONFIG);return new b$($,"CONFIG_ERROR",K$.CONFIG)}function XF($,_){let U=a_($,{schemaErrors:_==="schema"?$.length:0}),Q={valid:!1,errors:$,summary:{valid:!1,totalErrors:U.totalErrors,schemaErrors:U.schemaErrors,sourceFileErrors:U.sourceFileErrors,circularDependencyErrors:U.circularDependencyErrors,duplicateTargetErrors:U.duplicateTargetErrors,otherErrors:U.otherErrors}};return new z1(Q)}function qF($){for(let _ of $)console.log(g.red(` ${_}`))}function EW($){$.command("validate").description("Validate a registry source (for registry authors)").argument("[path]","Registry source directory",".").option("--cwd <path>","Working directory",process.cwd()).option("--json","Output as JSON",!1).option("-q, --quiet","Suppress output",!1).option("--no-duplicate-targets","Skip duplicate target validation").action(async(_,U)=>{try{let Q=zF(U.cwd,_),v=await F8(Q,{skipDuplicateTargets:U.duplicateTargets===!1});if(!v.success){let[J="Registry validation failed"]=v.errors;if(v.failureType==="load"){let z=IF(J,v.loadErrorKind);if(!U.json&&U.quiet){let I=z instanceof b$?z.exitCode:K$.GENERAL;process.exit(I)}throw z}let Y=XF(v.errors,v.failureType==="schema"?"schema":"rules");if(U.json)throw Y;if(!U.quiet)W.error(Y.message),qF(v.errors);process.exit(Y.exitCode)}if(!U.quiet&&!U.json)W.success("\u2713 Registry source is valid");if(U.json)O$({success:!0,data:{valid:!0,errors:[],summary:a_([])}})}catch(Q){if(!U.json&&U.quiet){let v=Q instanceof b$?Q.exitCode:K$.GENERAL;process.exit(v)}_$(Q,{json:U.json})}})}var PW=b(()=>{k6();DY();z$();c$();i$()});function xW($){let _=$.command("verify").description("Verify integrity of installed components").argument("[components...]","Components to verify (optional, verifies all if omitted)");Q4(_),m4(_),_.action(async(U,Q)=>{try{await GF(U,Q)}catch(v){_$(v,{json:Q.json})}})}async function GF($,_){let U=_.cwd??process.cwd(),Q=await y4.requireInitialized(U),v=await F4(Q.cwd);if(!v||Object.keys(v.installed).length===0){if(_.json)console.log(JSON.stringify({success:!0,verified:[],errors:[]},null,2));else if(!_.quiet)W.info("No components installed.");return}let J;if($.length>0)J=y8($,v);else J=Object.keys(v.installed);let Y=_.quiet||_.json?null:V$({text:"Verifying components..."});Y?.start();let z=[],I=!1;for(let X of J){let q=v.installed[X];if(!q){if($.length>0)W.warn(`Component '${X}' not found in receipt.`);continue}let G=await d_(Q.cwd,q);if(!G.intact)I=!0;z.push({canonicalId:X,intact:G.intact,modified:G.modified,missing:G.missing})}if(Y?.succeed(`Verified ${z.length} component(s)`),_.json){if(console.log(JSON.stringify({success:!I,verified:z.filter((X)=>X.intact),errors:z.filter((X)=>!X.intact)},null,2)),I)process.exit(K$.CONFLICT);return}if(!_.quiet){W.info("");for(let X of z)if(X.intact){if(_.verbose)W.success(`\u2713 ${X.canonicalId} - all files intact`)}else{W.error(`\u2717 ${X.canonicalId} - integrity check failed`);for(let q of X.modified)W.error(` Modified: ${q}`);for(let q of X.missing)W.error(` Missing: ${q}`)}}if(I){if(!_.quiet)W.info(""),W.warn("Some files have been modified or are missing. Review local changes with git, then run 'ocx update <alias/component>' or 'ocx update --all' to restore.");throw new t$("File integrity check failed for one or more components.")}if(!_.quiet)W.info(""),W.success("All components verified successfully.")}var uW=b(()=>{k0();X4();uY();z$();c$();i$();T0();a4();e4()});function jF(){if(process.env.OCX_SELF_UPDATE==="off")return!1;if(_j(process.env.OCX_NO_UPDATE_CHECK,!1))return!1;if(process.env.CI)return!1;if(!process.stdout.isTTY)return!1;return!0}function yW($){$.hook("postAction",async(_,U)=>{if(U.name()==="update"&&U.parent?.name()==="self")return;let Q=U.opts();if(Q.json||Q.quiet)return;if(!jF())return;try{let[{checkForUpdate:v},{notifyUpdate:J}]=await Promise.all([Promise.resolve().then(() => (lY(),jW)),Promise.resolve().then(() => (nY(),ZW))]),Y=await v();if(Y.ok&&Y.updateAvailable)J(Y.current,Y.latest)}catch{}})}var CW=b(()=>{l_()});var fW={};s$(fW,{runCli:()=>HF});async function HF($=process.argv){let _=new nq().name("ocx").description("OpenCode Extensions - Install agents, skills, plugins, and commands").version(KF);yK(_),VK(_),TW(_),iH(_),uH(_),AK(_),EW(_),FW(_),xW(_),mH(_),pK(_),RH(_),EK(_),GH(_),yW(_),await _.parseAsync($)}var KF="2.0.5";var mW=b(()=>{a2();VY();FK();PK();fK();nK();jH();EH();yH();gH();nH();OW();RW();PW();uW();CW()});p2();BJ();if(import.meta.main)WF();async function WF(){try{let{runCli:$}=await Promise.resolve().then(() => (mW(),fW));await $()}catch($){let{handleError:_}=await Promise.resolve().then(() => (c$(),vj));_($)}}export{j1 as registrySchema,x_ as packumentSchema,n2 as ocxLockSchema,h6 as ocxConfigSchema,q1 as componentManifestSchema,u_ as buildRegistry};
231
274
 
232
- //# debugId=471588A1A0C20C2C64756E2164756E21
275
+ //# debugId=742AA5BAD49273B064756E2164756E21