gdx 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +254 -0
- package/dist/index.js +1018 -0
- package/dist/keytar-hqpjzrak.node +0 -0
- package/package.json +65 -0
- package/scripts/launcher.cjs +37 -0
- package/scripts/postinstall.cjs +272 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1018 @@
|
|
|
1
|
+
import{createRequire as ev}from"node:module";var av=Object.create;var{getPrototypeOf:tv,defineProperty:i2,getOwnPropertyNames:ov}=Object;var sv=Object.prototype.hasOwnProperty;var kA=(H,$,A)=>{A=H!=null?av(tv(H)):{};let L=$||!H||!H.__esModule?i2(A,"default",{value:H,enumerable:!0}):A;for(let D of ov(H))if(!sv.call(L,D))i2(L,D,{get:()=>H[D],enumerable:!0});return L};var n=(H,$)=>()=>($||H(($={exports:{}}).exports,$),$.exports);var rv=(H,$)=>{for(var A in $)i2(H,A,{get:$[A],enumerable:!0,configurable:!0,set:(L)=>$[A]=()=>L})};var y=(H,$)=>()=>(H&&($=H(H=0)),$);var ZH=ev(import.meta.url);var x7=n((xJH,S7)=>{S7.exports=j7;j7.sync=Hh;var w7=ZH("fs");function eb(H,$){var A=$.pathExt!==void 0?$.pathExt:process.env.PATHEXT;if(!A)return!0;if(A=A.split(";"),A.indexOf("")!==-1)return!0;for(var L=0;L<A.length;L++){var D=A[L].toLowerCase();if(D&&H.substr(-D.length).toLowerCase()===D)return!0}return!1}function R7(H,$,A){if(!H.isSymbolicLink()&&!H.isFile())return!1;return eb($,A)}function j7(H,$,A){w7.stat(H,function(L,D){A(L,L?!1:R7(D,H,$))})}function Hh(H,$){return R7(w7.statSync(H),H,$)}});var b7=n((kJH,v7)=>{v7.exports=y7;y7.sync=$h;var k7=ZH("fs");function y7(H,$,A){k7.stat(H,function(L,D){A(L,L?!1:f7(D,$))})}function $h(H,$){return f7(k7.statSync(H),$)}function f7(H,$){return H.isFile()&&Ah(H,$)}function Ah(H,$){var{mode:A,uid:L,gid:D}=H,I=$.uid!==void 0?$.uid:process.getuid&&process.getuid(),E=$.gid!==void 0?$.gid:process.getgid&&process.getgid(),K=parseInt("100",8),M=parseInt("010",8),W=parseInt("001",8),X=K|M,J=A&W||A&M&&D===E||A&K&&L===I||A&X&&I===0;return J}});var u7=n((fJH,h7)=>{var yJH=ZH("fs"),A9;if(process.platform==="win32"||global.TESTING_WINDOWS)A9=x7();else A9=b7();h7.exports=LW;LW.sync=Lh;function LW(H,$,A){if(typeof $==="function")A=$,$={};if(!A){if(typeof Promise!=="function")throw TypeError("callback not provided");return new Promise(function(L,D){LW(H,$||{},function(I,E){if(I)D(I);else L(E)})})}A9(H,$||{},function(L,D){if(L){if(L.code==="EACCES"||$&&$.ignoreErrors)L=null,D=!1}A(L,D)})}function Lh(H,$){try{return A9.sync(H,$||{})}catch(A){if($&&$.ignoreErrors||A.code==="EACCES")return!1;else throw A}}});var i7=n((vJH,l7)=>{var zD=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",g7=ZH("path"),Dh=zD?";":":",m7=u7(),d7=(H)=>Object.assign(Error(`not found: ${H}`),{code:"ENOENT"}),p7=(H,$)=>{let A=$.colon||Dh,L=H.match(/\//)||zD&&H.match(/\\/)?[""]:[...zD?[process.cwd()]:[],...($.path||process.env.PATH||"").split(A)],D=zD?$.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",I=zD?D.split(A):[""];if(zD){if(H.indexOf(".")!==-1&&I[0]!=="")I.unshift("")}return{pathEnv:L,pathExt:I,pathExtExe:D}},c7=(H,$,A)=>{if(typeof $==="function")A=$,$={};if(!$)$={};let{pathEnv:L,pathExt:D,pathExtExe:I}=p7(H,$),E=[],K=(W)=>new Promise((X,J)=>{if(W===L.length)return $.all&&E.length?X(E):J(d7(H));let Z=L[W],Q=/^".*"$/.test(Z)?Z.slice(1,-1):Z,B=g7.join(Q,H),Y=!Q&&/^\.[\\\/]/.test(H)?H.slice(0,2)+B:B;X(M(Y,W,0))}),M=(W,X,J)=>new Promise((Z,Q)=>{if(J===D.length)return Z(K(X+1));let B=D[J];m7(W+B,{pathExt:I},(Y,G)=>{if(!Y&&G)if($.all)E.push(W+B);else return Z(W+B);return Z(M(W,X,J+1))})});return A?K(0).then((W)=>A(null,W),A):K(0)},Ih=(H,$)=>{$=$||{};let{pathEnv:A,pathExt:L,pathExtExe:D}=p7(H,$),I=[];for(let E=0;E<A.length;E++){let K=A[E],M=/^".*"$/.test(K)?K.slice(1,-1):K,W=g7.join(M,H),X=!M&&/^\.[\\\/]/.test(H)?H.slice(0,2)+W:W;for(let J=0;J<L.length;J++){let Z=X+L[J];try{if(m7.sync(Z,{pathExt:D}))if($.all)I.push(Z);else return Z}catch(Q){}}}if($.all&&I.length)return I;if($.nothrow)return null;throw d7(H)};l7.exports=c7;c7.sync=Ih});var a7=n((bJH,DW)=>{var n7=(H={})=>{let $=H.env||process.env;if((H.platform||process.platform)!=="win32")return"PATH";return Object.keys($).reverse().find((L)=>L.toUpperCase()==="PATH")||"Path"};DW.exports=n7;DW.exports.default=n7});var r7=n((hJH,s7)=>{var t7=ZH("path"),Eh=i7(),Kh=a7();function o7(H,$){let A=H.options.env||process.env,L=process.cwd(),D=H.options.cwd!=null,I=D&&process.chdir!==void 0&&!process.chdir.disabled;if(I)try{process.chdir(H.options.cwd)}catch(K){}let E;try{E=Eh.sync(H.command,{path:A[Kh({env:A})],pathExt:$?t7.delimiter:void 0})}catch(K){}finally{if(I)process.chdir(L)}if(E)E=t7.resolve(D?H.options.cwd:"",E);return E}function Mh(H){return o7(H)||o7(H,!0)}s7.exports=Mh});var e7=n((Qh,EW)=>{var IW=/([()\][%!^"`<>&|;, *?])/g;function Xh(H){return H=H.replace(IW,"^$1"),H}function Wh(H,$){if(H=`${H}`,H=H.replace(/(?=(\\+?)?)\1"/g,"$1$1\\\""),H=H.replace(/(?=(\\+?)?)\1$/,"$1$1"),H=`"${H}"`,H=H.replace(IW,"^$1"),$)H=H.replace(IW,"^$1");return H}Qh.command=Xh;Qh.argument=Wh});var $Y=n((uJH,HY)=>{HY.exports=/^#!(.*)/});var LY=n((gJH,AY)=>{var Zh=$Y();AY.exports=(H="")=>{let $=H.match(Zh);if(!$)return null;let[A,L]=$[0].replace(/#! ?/,"").split(" "),D=A.split("/").pop();if(D==="env")return L;return L?`${D} ${L}`:D}});var IY=n((mJH,DY)=>{var KW=ZH("fs"),Yh=LY();function Gh(H){let A=Buffer.alloc(150),L;try{L=KW.openSync(H,"r"),KW.readSync(L,A,0,150,0),KW.closeSync(L)}catch(D){}return Yh(A.toString())}DY.exports=Gh});var XY=n((dJH,MY)=>{var Uh=ZH("path"),EY=r7(),KY=e7(),Vh=IY(),Ch=process.platform==="win32",zh=/\.(?:com|exe)$/i,Ph=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function qh(H){H.file=EY(H);let $=H.file&&Vh(H.file);if($)return H.args.unshift(H.file),H.command=$,EY(H);return H.file}function Th(H){if(!Ch)return H;let $=qh(H),A=!zh.test($);if(H.options.forceShell||A){let L=Ph.test($);H.command=Uh.normalize(H.command),H.command=KY.command(H.command),H.args=H.args.map((I)=>KY.argument(I,L));let D=[H.command].concat(H.args).join(" ");H.args=["/d","/s","/c",`"${D}"`],H.command=process.env.comspec||"cmd.exe",H.options.windowsVerbatimArguments=!0}return H}function _h(H,$,A){if($&&!Array.isArray($))A=$,$=null;$=$?$.slice(0):[],A=Object.assign({},A);let L={command:H,args:$,options:A,file:void 0,original:{command:H,args:$}};return A.shell?L:Th(L)}MY.exports=_h});var BY=n((pJH,QY)=>{var MW=process.platform==="win32";function XW(H,$){return Object.assign(Error(`${$} ${H.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${$} ${H.command}`,path:H.command,spawnargs:H.args})}function Nh(H,$){if(!MW)return;let A=H.emit;H.emit=function(L,D){if(L==="exit"){let I=WY(D,$);if(I)return A.call(H,"error",I)}return A.apply(H,arguments)}}function WY(H,$){if(MW&&H===1&&!$.file)return XW($.original,"spawn");return null}function Fh(H,$){if(MW&&H===1&&!$.file)return XW($.original,"spawnSync");return null}QY.exports={hookChildProcess:Nh,verifyENOENT:WY,verifyENOENTSync:Fh,notFoundError:XW}});var YY=n((cJH,PD)=>{var JY=ZH("child_process"),WW=XY(),QW=BY();function ZY(H,$,A){let L=WW(H,$,A),D=JY.spawn(L.command,L.args,L.options);return QW.hookChildProcess(D,L),D}function Oh(H,$,A){let L=WW(H,$,A),D=JY.spawnSync(L.command,L.args,L.options);return D.error=D.error||QW.verifyENOENTSync(D.status,L),D}PD.exports=ZY;PD.exports.spawn=ZY;PD.exports.sync=Oh;PD.exports._parse=WW;PD.exports._enoent=QW});import{createRequire as wc}from"module";class XC{value;start;end;constructor(H,$,A){this.value=H,this.start=$,this.end=A}}class qQ{TF;IDF;TF_IDF;constructor(H){this.TF=H}}class WC{x;y;z;r;t;get unit(){return this.#H}get dimension(){return this.#$}#H;#$=0;constructor(H,$,A=null){if(this.x=H,this.y=$,this.z=A,A)this.#$=3;else if($)this.#$=2;else if(H)this.#$=1}toPolarCoords(H="r"){this.#H=H;let{r:$,t:A}=R.MathKit.toPolarCoords(this.x,this.y,H);return this.r=$,this.t=A,this}toCartesianCoords(){if(!this.#H&&this.x)return this;let{x:H,y:$}=R.MathKit.toCartesianCoords(this.r,this.t,this.#H);return this.x=H,this.y=$,this}setUnit(H){if(!H||H!="d"&&H!="r")throw Error("unit must be 'r' or 'd', given: "+H);if(this.#H==H)return;if(H=="r")this.#H=H,this.t=R.MathKit.radians(this.t);else this.#H=H,this.t=R.MathKit.degrees(this.t)}}class QC{constructor(H,$,A,L,D,I,E){this.x=H,this.y=$,this.f=A,this.ymid=L,this.iterations=D,this.events=E,this.msg=I}_at(H,$){function A(Q){return Q*Q}let L,D,I,E,K,M,W,X,J,Z;return L=this.x[$],D=this.x[$+1],E=this.y[$],K=this.y[$+1],W=D-L,I=L+0.5*W,M=this.ymid[$],X=this.f[$]-E*(1/(L-I)+2/(L-D)),J=this.f[$+1]-K*(1/(D-I)+2/(D-L)),Z=[A(H-D)*(H-I)/A(L-D)/(L-I),A(H-L)*A(H-D)/A(L-I)/A(D-I),A(H-L)*(H-I)/A(D-L)/(D-I),(H-L)*A(H-D)*(H-I)/A(L-D)/(L-I),(H-D)*A(H-L)*(H-I)/A(L-D)/(D-I)],E*Z[0]+M*Z[1]+K*Z[2]+X*Z[3]+J*Z[4]}at(H){let $,A,L;if(typeof H!=="number"){let I=H.length,E=Array(I);for($=I-1;$!==-1;--$)E[$]=this.at(H[$]);return E}let D=this.x;$=0,A=D.length-1;while(A-$>1)if(L=Math.floor(0.5*($+A)),D[L]<=H)$=L;else A=L;return this._at(H,$)}}class gA{value;index;type;constructor(H,$,A=-1){this.value=H,this.type=$,this.index=A}valueOf(){return this.value}toString(){return this.value.toString()}}class kD{type;UPID=null;callback;constructor(H,$,A=null){if(A)this.type=1,this.UPID=A;else this.type=H;this.callback=$}}function Sc(H){return H==null||typeof H=="number"||typeof H=="string"||typeof H=="boolean"||H instanceof ArrayBuffer||H instanceof MessagePort||H instanceof ReadableStream||H instanceof WritableStream||H instanceof TransformStream}var Rc,xD,jc,uA,PQ="[#*0-9]\\uFE0F?\\u20E3|©\\uFE0F?|[®\\u203C\\u2049\\u2122\\u2139\\u2194-\\u2199\\u21A9\\u21AA]\\uFE0F?|[\\u231A\\u231B]|[\\u2328\\u23CF]\\uFE0F?|[\\u23E9-\\u23EC]|[\\u23ED-\\u23EF]\\uFE0F?|\\u23F0|[\\u23F1\\u23F2]\\uFE0F?|\\u23F3|[\\u23F8-\\u23FA\\u24C2\\u25AA\\u25AB\\u25B6\\u25C0\\u25FB\\u25FC]\\uFE0F?|[\\u25FD\\u25FE]|[\\u2600-\\u2604\\u260E\\u2611]\\uFE0F?|[\\u2614\\u2615]|\\u2618\\uFE0F?|\\u261D(?:\\uD83C[\\uDFFB-\\uDFFF]|\\uFE0F)?|[\\u2620\\u2622\\u2623\\u2626\\u262A\\u262E\\u262F\\u2638-\\u263A\\u2640\\u2642]\\uFE0F?|[\\u2648-\\u2653]|[\\u265F\\u2660\\u2663\\u2665\\u2666\\u2668\\u267B\\u267E]\\uFE0F?|\\u267F|\\u2692\\uFE0F?|\\u2693|[\\u2694-\\u2697\\u2699\\u269B\\u269C\\u26A0]\\uFE0F?|\\u26A1|\\u26A7\\uFE0F?|[\\u26AA\\u26AB]|[\\u26B0\\u26B1]\\uFE0F?|[\\u26BD\\u26BE\\u26C4\\u26C5]|\\u26C8\\uFE0F?|\\u26CE|[\\u26CF\\u26D1\\u26D3]\\uFE0F?|\\u26D4|\\u26E9\\uFE0F?|\\u26EA|[\\u26F0\\u26F1]\\uFE0F?|[\\u26F2\\u26F3]|\\u26F4\\uFE0F?|\\u26F5|[\\u26F7\\u26F8]\\uFE0F?|\\u26F9(?:\\u200D[\\u2640\\u2642]\\uFE0F?|\\uD83C[\\uDFFB-\\uDFFF](?:\\u200D[\\u2640\\u2642]\\uFE0F?)?|\\uFE0F(?:\\u200D[\\u2640\\u2642]\\uFE0F?)?)?|[\\u26FA\\u26FD]|\\u2702\\uFE0F?|\\u2705|[\\u2708\\u2709]\\uFE0F?|[\\u270A\\u270B](?:\\uD83C[\\uDFFB-\\uDFFF])?|[\\u270C\\u270D](?:\\uD83C[\\uDFFB-\\uDFFF]|\\uFE0F)?|\\u270F\\uFE0F?|[\\u2712\\u2714\\u2716\\u271D\\u2721]\\uFE0F?|\\u2728|[\\u2733\\u2734\\u2744\\u2747]\\uFE0F?|[\\u274C\\u274E\\u2753-\\u2755\\u2757]|\\u2763\\uFE0F?|\\u2764(?:\\u200D(?:\\uD83D\\uDD25|\\uD83E\\uDE79)|\\uFE0F(?:\\u200D(?:\\uD83D\\uDD25|\\uD83E\\uDE79))?)?|[\\u2795-\\u2797]|\\u27A1\\uFE0F?|[\\u27B0\\u27BF]|[\\u2934\\u2935\\u2B05-\\u2B07]\\uFE0F?|[\\u2B1B\\u2B1C\\u2B50\\u2B55]|[\\u3030\\u303D\\u3297\\u3299]\\uFE0F?|\\uD83C(?:[\\uDC04\\uDCCF]|[\\uDD70\\uDD71\\uDD7E\\uDD7F]\\uFE0F?|[\\uDD8E\\uDD91-\\uDD9A]|\\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-\\uDDF5\\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]|\\uDE01|\\uDE02\\uFE0F?|[\\uDE1A\\uDE2F\\uDE32-\\uDE36]|\\uDE37\\uFE0F?|[\\uDE38-\\uDE3A\\uDE50\\uDE51\\uDF00-\\uDF20]|[\\uDF21\\uDF24-\\uDF2C]\\uFE0F?|[\\uDF2D-\\uDF35]|\\uDF36\\uFE0F?|[\\uDF37-\\uDF7C]|\\uDF7D\\uFE0F?|[\\uDF7E-\\uDF84]|\\uDF85(?:\\uD83C[\\uDFFB-\\uDFFF])?|[\\uDF86-\\uDF93]|[\\uDF96\\uDF97\\uDF99-\\uDF9B\\uDF9E\\uDF9F]\\uFE0F?|[\\uDFA0-\\uDFC1]|\\uDFC2(?:\\uD83C[\\uDFFB-\\uDFFF])?|[\\uDFC3\\uDFC4](?:\\u200D[\\u2640\\u2642]\\uFE0F?|\\uD83C[\\uDFFB-\\uDFFF](?:\\u200D[\\u2640\\u2642]\\uFE0F?)?)?|[\\uDFC5\\uDFC6]|\\uDFC7(?:\\uD83C[\\uDFFB-\\uDFFF])?|[\\uDFC8\\uDFC9]|\\uDFCA(?:\\u200D[\\u2640\\u2642]\\uFE0F?|\\uD83C[\\uDFFB-\\uDFFF](?:\\u200D[\\u2640\\u2642]\\uFE0F?)?)?|[\\uDFCB\\uDFCC](?:\\u200D[\\u2640\\u2642]\\uFE0F?|\\uD83C[\\uDFFB-\\uDFFF](?:\\u200D[\\u2640\\u2642]\\uFE0F?)?|\\uFE0F(?:\\u200D[\\u2640\\u2642]\\uFE0F?)?)?|[\\uDFCD\\uDFCE]\\uFE0F?|[\\uDFCF-\\uDFD3]|[\\uDFD4-\\uDFDF]\\uFE0F?|[\\uDFE0-\\uDFF0]|\\uDFF3(?:\\u200D(?:\\u26A7\\uFE0F?|\\uD83C\\uDF08)|\\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)?|[\\uDFF5\\uDFF7]\\uFE0F?|[\\uDFF8-\\uDFFF])|\\uD83D(?:[\\uDC00-\\uDC07]|\\uDC08(?:\\u200D\\u2B1B)?|[\\uDC09-\\uDC14]|\\uDC15(?:\\u200D\\uD83E\\uDDBA)?|[\\uDC16-\\uDC3A]|\\uDC3B(?:\\u200D\\u2744\\uFE0F?)?|[\\uDC3C-\\uDC3E]|\\uDC3F\\uFE0F?|\\uDC40|\\uDC41(?:\\u200D\\uD83D\\uDDE8\\uFE0F?|\\uFE0F(?:\\u200D\\uD83D\\uDDE8\\uFE0F?)?)?|[\\uDC42\\uDC43](?:\\uD83C[\\uDFFB-\\uDFFF])?|[\\uDC44\\uDC45]|[\\uDC46-\\uDC50](?:\\uD83C[\\uDFFB-\\uDFFF])?|[\\uDC51-\\uDC65]|[\\uDC66\\uDC67](?:\\uD83C[\\uDFFB-\\uDFFF])?|\\uDC68(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?\\uDC68|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:\\uDC66(?:\\u200D\\uD83D\\uDC66)?|\\uDC67(?:\\u200D\\uD83D[\\uDC66\\uDC67])?|[\\uDC68\\uDC69]\\u200D\\uD83D(?:\\uDC66(?:\\u200D\\uD83D\\uDC66)?|\\uDC67(?:\\u200D\\uD83D[\\uDC66\\uDC67])?)|[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92])|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\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]|\\uD83E(?:\\uDD1D\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFC-\\uDFFF]|[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])))?|\\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]|\\uD83E(?:\\uDD1D\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB\\uDFFD-\\uDFFF]|[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])))?|\\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]|\\uD83E(?:\\uDD1D\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF]|[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])))?|\\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]|\\uD83E(?:\\uDD1D\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB-\\uDFFD\\uDFFF]|[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])))?|\\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]|\\uD83E(?:\\uDD1D\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB-\\uDFFE]|[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])))?))?|\\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(?:\\uDC66(?:\\u200D\\uD83D\\uDC66)?|\\uDC67(?:\\u200D\\uD83D[\\uDC66\\uDC67])?|\\uDC69\\u200D\\uD83D(?:\\uDC66(?:\\u200D\\uD83D\\uDC66)?|\\uDC67(?:\\u200D\\uD83D[\\uDC66\\uDC67])?)|[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92])|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C(?:\\uDFFB(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:[\\uDC68\\uDC69]\\uD83C[\\uDFFB-\\uDFFF]|\\uDC8B\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFB-\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:\\uDD1D\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFC-\\uDFFF]|[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])))?|\\uDFFC(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:[\\uDC68\\uDC69]\\uD83C[\\uDFFB-\\uDFFF]|\\uDC8B\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFB-\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:\\uDD1D\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFB\\uDFFD-\\uDFFF]|[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])))?|\\uDFFD(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:[\\uDC68\\uDC69]\\uD83C[\\uDFFB-\\uDFFF]|\\uDC8B\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFB-\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:\\uDD1D\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF]|[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])))?|\\uDFFE(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:[\\uDC68\\uDC69]\\uD83C[\\uDFFB-\\uDFFF]|\\uDC8B\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFB-\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:\\uDD1D\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFB-\\uDFFD\\uDFFF]|[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])))?|\\uDFFF(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:[\\uDC68\\uDC69]\\uD83C[\\uDFFB-\\uDFFF]|\\uDC8B\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFB-\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:\\uDD1D\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFB-\\uDFFE]|[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])))?))?|\\uDC6A|[\\uDC6B-\\uDC6D](?:\\uD83C[\\uDFFB-\\uDFFF])?|\\uDC6E(?:\\u200D[\\u2640\\u2642]\\uFE0F?|\\uD83C[\\uDFFB-\\uDFFF](?:\\u200D[\\u2640\\u2642]\\uFE0F?)?)?|\\uDC6F(?:\\u200D[\\u2640\\u2642]\\uFE0F?)?|[\\uDC70\\uDC71](?:\\u200D[\\u2640\\u2642]\\uFE0F?|\\uD83C[\\uDFFB-\\uDFFF](?:\\u200D[\\u2640\\u2642]\\uFE0F?)?)?|\\uDC72(?:\\uD83C[\\uDFFB-\\uDFFF])?|\\uDC73(?:\\u200D[\\u2640\\u2642]\\uFE0F?|\\uD83C[\\uDFFB-\\uDFFF](?:\\u200D[\\u2640\\u2642]\\uFE0F?)?)?|[\\uDC74-\\uDC76](?:\\uD83C[\\uDFFB-\\uDFFF])?|\\uDC77(?:\\u200D[\\u2640\\u2642]\\uFE0F?|\\uD83C[\\uDFFB-\\uDFFF](?:\\u200D[\\u2640\\u2642]\\uFE0F?)?)?|\\uDC78(?:\\uD83C[\\uDFFB-\\uDFFF])?|[\\uDC79-\\uDC7B]|\\uDC7C(?:\\uD83C[\\uDFFB-\\uDFFF])?|[\\uDC7D-\\uDC80]|[\\uDC81\\uDC82](?:\\u200D[\\u2640\\u2642]\\uFE0F?|\\uD83C[\\uDFFB-\\uDFFF](?:\\u200D[\\u2640\\u2642]\\uFE0F?)?)?|\\uDC83(?:\\uD83C[\\uDFFB-\\uDFFF])?|\\uDC84|\\uDC85(?:\\uD83C[\\uDFFB-\\uDFFF])?|[\\uDC86\\uDC87](?:\\u200D[\\u2640\\u2642]\\uFE0F?|\\uD83C[\\uDFFB-\\uDFFF](?:\\u200D[\\u2640\\u2642]\\uFE0F?)?)?|[\\uDC88-\\uDC8E]|\\uDC8F(?:\\uD83C[\\uDFFB-\\uDFFF])?|\\uDC90|\\uDC91(?:\\uD83C[\\uDFFB-\\uDFFF])?|[\\uDC92-\\uDCA9]|\\uDCAA(?:\\uD83C[\\uDFFB-\\uDFFF])?|[\\uDCAB-\\uDCFC]|\\uDCFD\\uFE0F?|[\\uDCFF-\\uDD3D]|[\\uDD49\\uDD4A]\\uFE0F?|[\\uDD4B-\\uDD4E\\uDD50-\\uDD67]|[\\uDD6F\\uDD70\\uDD73]\\uFE0F?|\\uDD74(?:\\uD83C[\\uDFFB-\\uDFFF]|\\uFE0F)?|\\uDD75(?:\\u200D[\\u2640\\u2642]\\uFE0F?|\\uD83C[\\uDFFB-\\uDFFF](?:\\u200D[\\u2640\\u2642]\\uFE0F?)?|\\uFE0F(?:\\u200D[\\u2640\\u2642]\\uFE0F?)?)?|[\\uDD76-\\uDD79]\\uFE0F?|\\uDD7A(?:\\uD83C[\\uDFFB-\\uDFFF])?|[\\uDD87\\uDD8A-\\uDD8D]\\uFE0F?|\\uDD90(?:\\uD83C[\\uDFFB-\\uDFFF]|\\uFE0F)?|[\\uDD95\\uDD96](?:\\uD83C[\\uDFFB-\\uDFFF])?|\\uDDA4|[\\uDDA5\\uDDA8\\uDDB1\\uDDB2\\uDDBC\\uDDC2-\\uDDC4\\uDDD1-\\uDDD3\\uDDDC-\\uDDDE\\uDDE1\\uDDE3\\uDDE8\\uDDEF\\uDDF3\\uDDFA]\\uFE0F?|[\\uDDFB-\\uDE2D]|\\uDE2E(?:\\u200D\\uD83D\\uDCA8)?|[\\uDE2F-\\uDE34]|\\uDE35(?:\\u200D\\uD83D\\uDCAB)?|\\uDE36(?:\\u200D\\uD83C\\uDF2B\\uFE0F?)?|[\\uDE37-\\uDE44]|[\\uDE45-\\uDE47](?:\\u200D[\\u2640\\u2642]\\uFE0F?|\\uD83C[\\uDFFB-\\uDFFF](?:\\u200D[\\u2640\\u2642]\\uFE0F?)?)?|[\\uDE48-\\uDE4A]|\\uDE4B(?:\\u200D[\\u2640\\u2642]\\uFE0F?|\\uD83C[\\uDFFB-\\uDFFF](?:\\u200D[\\u2640\\u2642]\\uFE0F?)?)?|\\uDE4C(?:\\uD83C[\\uDFFB-\\uDFFF])?|[\\uDE4D\\uDE4E](?:\\u200D[\\u2640\\u2642]\\uFE0F?|\\uD83C[\\uDFFB-\\uDFFF](?:\\u200D[\\u2640\\u2642]\\uFE0F?)?)?|\\uDE4F(?:\\uD83C[\\uDFFB-\\uDFFF])?|[\\uDE80-\\uDEA2]|\\uDEA3(?:\\u200D[\\u2640\\u2642]\\uFE0F?|\\uD83C[\\uDFFB-\\uDFFF](?:\\u200D[\\u2640\\u2642]\\uFE0F?)?)?|[\\uDEA4-\\uDEB3]|[\\uDEB4-\\uDEB6](?:\\u200D[\\u2640\\u2642]\\uFE0F?|\\uD83C[\\uDFFB-\\uDFFF](?:\\u200D[\\u2640\\u2642]\\uFE0F?)?)?|[\\uDEB7-\\uDEBF]|\\uDEC0(?:\\uD83C[\\uDFFB-\\uDFFF])?|[\\uDEC1-\\uDEC5]|\\uDECB\\uFE0F?|\\uDECC(?:\\uD83C[\\uDFFB-\\uDFFF])?|[\\uDECD-\\uDECF]\\uFE0F?|[\\uDED0-\\uDED2\\uDED5-\\uDED7]|[\\uDEE0-\\uDEE5\\uDEE9]\\uFE0F?|[\\uDEEB\\uDEEC]|[\\uDEF0\\uDEF3]\\uFE0F?|[\\uDEF4-\\uDEFC\\uDFE0-\\uDFEB])|\\uD83E(?:\\uDD0C(?:\\uD83C[\\uDFFB-\\uDFFF])?|[\\uDD0D\\uDD0E]|\\uDD0F(?:\\uD83C[\\uDFFB-\\uDFFF])?|[\\uDD10-\\uDD17]|[\\uDD18-\\uDD1C](?:\\uD83C[\\uDFFB-\\uDFFF])?|\\uDD1D|[\\uDD1E\\uDD1F](?:\\uD83C[\\uDFFB-\\uDFFF])?|[\\uDD20-\\uDD25]|\\uDD26(?:\\u200D[\\u2640\\u2642]\\uFE0F?|\\uD83C[\\uDFFB-\\uDFFF](?:\\u200D[\\u2640\\u2642]\\uFE0F?)?)?|[\\uDD27-\\uDD2F]|[\\uDD30-\\uDD34](?:\\uD83C[\\uDFFB-\\uDFFF])?|\\uDD35(?:\\u200D[\\u2640\\u2642]\\uFE0F?|\\uD83C[\\uDFFB-\\uDFFF](?:\\u200D[\\u2640\\u2642]\\uFE0F?)?)?|\\uDD36(?:\\uD83C[\\uDFFB-\\uDFFF])?|[\\uDD37-\\uDD39](?:\\u200D[\\u2640\\u2642]\\uFE0F?|\\uD83C[\\uDFFB-\\uDFFF](?:\\u200D[\\u2640\\u2642]\\uFE0F?)?)?|\\uDD3A|\\uDD3C(?:\\u200D[\\u2640\\u2642]\\uFE0F?)?|[\\uDD3D\\uDD3E](?:\\u200D[\\u2640\\u2642]\\uFE0F?|\\uD83C[\\uDFFB-\\uDFFF](?:\\u200D[\\u2640\\u2642]\\uFE0F?)?)?|[\\uDD3F-\\uDD45\\uDD47-\\uDD76]|\\uDD77(?:\\uD83C[\\uDFFB-\\uDFFF])?|[\\uDD78\\uDD7A-\\uDDB4]|[\\uDDB5\\uDDB6](?:\\uD83C[\\uDFFB-\\uDFFF])?|\\uDDB7|[\\uDDB8\\uDDB9](?:\\u200D[\\u2640\\u2642]\\uFE0F?|\\uD83C[\\uDFFB-\\uDFFF](?:\\u200D[\\u2640\\u2642]\\uFE0F?)?)?|\\uDDBA|\\uDDBB(?:\\uD83C[\\uDFFB-\\uDFFF])?|[\\uDDBC-\\uDDCB]|[\\uDDCD-\\uDDCF](?:\\u200D[\\u2640\\u2642]\\uFE0F?|\\uD83C[\\uDFFB-\\uDFFF](?:\\u200D[\\u2640\\u2642]\\uFE0F?)?)?|\\uDDD0|\\uDDD1(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:\\uDD1D\\u200D\\uD83E\\uDDD1|[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD]))|\\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]|\\uD83E(?:\\uDD1D\\u200D\\uD83E\\uDDD1\\uD83C[\\uDFFB-\\uDFFF]|[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])))?|\\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]|\\uD83E(?:\\uDD1D\\u200D\\uD83E\\uDDD1\\uD83C[\\uDFFB-\\uDFFF]|[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])))?|\\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]|\\uD83E(?:\\uDD1D\\u200D\\uD83E\\uDDD1\\uD83C[\\uDFFB-\\uDFFF]|[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])))?|\\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]|\\uD83E(?:\\uDD1D\\u200D\\uD83E\\uDDD1\\uD83C[\\uDFFB-\\uDFFF]|[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])))?|\\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]|\\uD83E(?:\\uDD1D\\u200D\\uD83E\\uDDD1\\uD83C[\\uDFFB-\\uDFFF]|[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])))?))?|[\\uDDD2\\uDDD3](?:\\uD83C[\\uDFFB-\\uDFFF])?|\\uDDD4(?:\\u200D[\\u2640\\u2642]\\uFE0F?|\\uD83C[\\uDFFB-\\uDFFF](?:\\u200D[\\u2640\\u2642]\\uFE0F?)?)?|\\uDDD5(?:\\uD83C[\\uDFFB-\\uDFFF])?|[\\uDDD6-\\uDDDD](?:\\u200D[\\u2640\\u2642]\\uFE0F?|\\uD83C[\\uDFFB-\\uDFFF](?:\\u200D[\\u2640\\u2642]\\uFE0F?)?)?|[\\uDDDE\\uDDDF](?:\\u200D[\\u2640\\u2642]\\uFE0F?)?|[\\uDDE0-\\uDDFF\\uDE70-\\uDE74\\uDE78-\\uDE7A\\uDE80-\\uDE86\\uDE90-\\uDEA8\\uDEB0-\\uDEB6\\uDEC0-\\uDEC2\\uDED0-\\uDED6])",R,eCH,BC,HzH,$zH,AzH,LzH,DzH,IzH,vI,EzH,KzH,MzH,XzH,WzH,QzH,BzH,JzH,ZzH,YzH,GzH,UzH,m$,VzH,CzH,zzH,PzH,qzH,TzH,_zH,NzH,FzH,OzH,r9,wzH,RzH,jzH,SzH,xzH,kzH,yzH,fzH,vzH,bzH,JC,hzH,uzH,gzH,mzH,dzH,ZC,_$,YC,C,pzH,czH,lzH,izH,nzH,GC,azH,tzH,ozH,szH,rzH,ezH,HPH,$PH,APH,LPH,DPH,IPH,EPH,KPH,MPH,XPH,yD,WPH,UC,QPH,BPH,JPH,ZPH,RH,YPH,GPH,UPH,VPH,CPH,mA,zPH,PPH,iH;var nH=y(()=>{Rc=wc(import.meta.url),xD=typeof window>"u"||typeof process<"u",jc={dgram:null,worker_threads:null,os:null,fs:null,mathjs:null},uA={consoleTimeInstances:null};R={_modules:jc,arrFindLast(H,$){for(let A=H.length-1;A>=0;A--)if($(H[A],A,H))return H[A];return},arrToString(H,$={}){let{maxDepth:A=4,indent:L=3,maxRow:D=10,maxCol:I=20,color:E=!1,defColor:K=void 0,noHeader:M=!1}=$;if(A<1)A=1;let W={color:E,defColor:K},X=R.getDimensions(H,"max"),J=X.length*0.4,Z=typeof L=="number"?" ".repeat(L):L,Q=null;if(E)Q={magenta:R.ncc(11550650),gray:R.ncc(4802889),_default:R.ncc(K)};if(!M&&(!(H instanceof Array)||X.length>2||Math.max(...X)>5))return G(H)+B(H,0);else return B(H,0);function B(U,V,z=0){let P="";if(V>A-1)if(E)return Q.gray+`... [${Y(U)||"Array"}]`+Q._default;else return`... [${Y(U)||"Array"}]`;if(!R.isArrayLike(U))return P+R.yuString(U,W);let T;if(V>J)T=R.getDimensions(U,"max");else T=X.slice(V);let q=X[V+1]!=null&&(T[2]!=null||T[1]>2)&&V<A-1,O=z?Z.repeat(z):"",N=O+Z,x=q?`[
|
|
2
|
+
`+N:"[",w=q?`
|
|
3
|
+
`+O+"]":"]",F=U.length;P+=x;for(let f=0;f<F;f++){if(R.isArrayLike(U[f]))P+=Y(U[f])+B(U[f],V+1,q?z+1:z);else P+=R.yuString(U[f],W);if(q){if(f>=D-2){if(P+=`,
|
|
4
|
+
`+N,E)P+=Q.gray+"... ("+(F-D+1)+" more)"+Q._default;else P+="... ("+(F-D+1)+" more)";break}}else if(f>=I-2){if(E)P+=", "+Q.gray+"... ("+(F-I+1)+" more)"+Q._default;else P+=", ... ("+(F-I+1)+" more)";break}if(f!=F-1)P+=q?`,
|
|
5
|
+
`+N:", "}return P+=w,P}function Y(U){if(U instanceof Array)return"";if(E)return Q.magenta+`${U.constructor.name}: `+Q._default;else return`${U.constructor.name}: `}function G(U){if(!R.isArrayLike(U))return"";if(E)return Q.magenta+`${U.constructor.name}(${X}): `+Q._default;else return`${U.constructor.name}(${X}): `}},argvHasFlag(H,$=process?.argv){if(!$||typeof H!="string")return!1;let A=H.startsWith("-")?"":H.length===1?"-":"--",L=$.indexOf(A+H),D=$.indexOf("--");return L!==-1&&(D===-1||L<D)},async asyncSleep(H){return new Promise((A)=>{if(!H||H<4||typeof H!="number")A();setTimeout(A,H)})},beautifyJson(H){H=H.replace(/\s/,"");let $=H+"",A=R.getMatchAllIndexes(H.matchAll(/[{[]/g)).sort((E,K)=>E-K),L=R.getMatchAllIndexes(H.matchAll(/[}\]]/g)).sort((E,K)=>E-K);for(let E=0,K=0,M=0;M<H.length;){let W=A[I(A,M)],X=L[I(L,M)];if(W=W==null?1/0:W,W<X)E++,M=W+1;else E--,M=X+1;let J=A[I(A,M)],Z=L[I(L,M)],Q=J<Z?J:Z,B="".padEnd(E,"\t");if(D($[M+K-1]))$=R.strSplice($,M+K,0,`
|
|
6
|
+
`);else $=R.strSplice($,M+K-1,0,`
|
|
7
|
+
`),$=R.strSplice($,M+K,0,B),K+=B.length;K++;let Y=H.substring(M,Q),G=R.getMatchAllIndexes(Y.matchAll(/"/g)).filter((V)=>V!=0?Y[V-1]!="\\":!0);if(G.length%2!=0)throw Error('cannot match Double-Quote correctly from string: "'+Y+'"');let U=R.getMatchAllIndexes(Y.matchAll(/[,]/g)).filter((V)=>{for(let z=0;z<G.length;z+=2)if(V>G[z]&&V<G[z+1])return!1;return!0});for(let V=0;V<U.length+1;V++){let z=V==0?M+K:U[V-1]+K+M+1;if(D($[z-1])==null)$=R.strSplice($,z,0,B),K+=B.length;if(!$[U[V]+K+M])break;$=R.strSplice($,U[V]+1+K+M,0,`
|
|
8
|
+
`),K++}}return $;function D(E){let K=new RegExp(/[{[]/),M=new RegExp(/[}\]]/);if(K.test(E))return 1;if(M.test(E))return 0;return null}function I(E,K){let M=1/0,W;for(let X=0,J=E[X];X<E.length;J=E[++X]){let Z=J-K;if(!Z)return X;if(Z<0)continue;if(Z<M)M=Z,W=X}return W}},beforeExit(H,$=!1){if($)process.stdin.resume();let A=!1,L=!1;["exit","SIGINT","SIGUSR1","SIGUSR2","uncaughtException","SIGTERM"].forEach((D)=>{process.on(D,async(...I)=>{if(["SIGINT","SIGUSR1","SIGUSR2"].includes(D))if(A)console.log("Forcefully Exiting..."),process.exit(1);else A=!0;if(L)return;else L=!0;if(await H(D,...I),D!=="exit"&&$)process.exit(0)})})},changeDateTimezone(H,$){let A=new Date(`${H.toLocaleString("en-US",{timeZone:$})}`),L=H.getTime()-A.getTime();return new Date(H.getTime()-L)},charTypeAt(H,$){let A=R.CONSTS.UNICODES_RANGE_TABLE;if(H<0)H=$.length+H;let L=$.charCodeAt(H);if(isNaN(L))return null;for(let D=A.length>>1,I=0;D>=0&&D<A.length;I++){if(I>(A.length>>1)+1)break;if(R.isArrayLike(A[D].to)){for(let E=0;E<A[D].to.length;E++)if(L>=A[D].from[E]&&L<=A[D].to[E])return A[D].type;if(L>A[D].from[0])D++;else D--}else{if(L>=A[D].from&&L<=A[D].to)return A[D].type;if(L>A[D].from)D++;else D--}}return null},CheckCache:class H{static#H=null;static#$=null;static#A=null;static get supportsColor(){if(this.#H==null)this.#H=R.supportsColor();return this.#H??0}static get supportsHyperlink(){if(this.#$==null)this.#$=R.supportsHyperlink();return this.#$}static set supportsColor($){this.#H=$}static set supportsHyperlink($){this.#$=$}static get forceColor(){if(!xD)this.#A=!1;if(this.#A===void 0){let $=process.env;if(R.argvHasFlag("no-color")||R.argvHasFlag("no-colors")||R.argvHasFlag("color=false"))this.#A=!1;else if(R.argvHasFlag("color")||R.argvHasFlag("colors")||R.argvHasFlag("color=true")||R.argvHasFlag("color=always"))this.#A=!0;if("FORCE_COLOR"in $)this.#A=$.FORCE_COLOR.length===0||parseInt($.FORCE_COLOR,10)!==0}return this.#A}static set forceColor($){this.#A=$}},cleanArr(H,$=null){if($&&$ instanceof Array)return H.filter((A)=>{return!$.includes(A)});if($!==null)return H.filter((A)=>{return A!==$});return H.filter((A)=>A!==""&&A!=="\r"&&!R.isEmptyArray(A)&&!R.isEmptyObject(A))},cleanComments(H){return H.replace(R.REGEXP.JSComments,($,A)=>A?"":$)},cleanString(H){return H.normalize().replace(R.REGEXP.ANSICode,"")},CONSTS:Object.freeze({UNICODES_RANGE_TABLE:[Object.freeze({type:"generic.en.upper",regex:/[\x41-\x5a]/g,from:65,to:90}),Object.freeze({type:"generic.en.lower",regex:/[\x61-\x7a]/g,from:97,to:122}),Object.freeze({type:"generic.jp.full",regex:/[\u2E80-\u2FD5\u3400-\u4DB5\u4E00-\u9FCB\uF900-\uFA6A\u3000-\u303f\u3041-\u3096\u30a0-\u30ff]/g,from:new Int16Array([11904,13312,19968,63744,12288,12353,12448]),to:new Int16Array([12245,19893,40907,64106,12351,12438,12543])}),Object.freeze({type:"generic.cn.full",regex:/[\u4e00-\u9fff]/g,from:19968,to:40959}),Object.freeze({type:"generic.jp.half",regex:/[\uff5f-\uff9f]/g,from:65375,to:65439})],AsyncFunction:(async()=>{}).constructor,GeneratorFunction:function*(){}.constructor}),Convert:{decimalColorToRGB(H){return{r:H>>16&255,g:H>>8&255,b:H&255}},basicColorFromRgb(H){let $=H.r>127,A=H.g>127,L=H.b>127;switch($+A+L){case 3:return"white";case 0:return"black";case 2:if(!$)return"cyan";else if(!A)return"magenta";else if(!L)return"yellow";case 1:if($)return"red";else if(A)return"green";else if(L)return"blue"}},_8bitColorFromRgb(H){let{r:$,g:A,b:L}=H;if($===A&&A===L){if($<8)return 16;if($>248)return 231;return Math.round(($-8)/247*24)+232}let D=Math.round($/255*5),I=Math.round(A/255*5),E=Math.round(L/255*5);return 16+36*D+6*I+E}},ConsoleTime:class H{static lookbackLimit=100;static elipsedStart($){if(uA.consoleTimeInstances==null){uA.consoleTimeInstances=new Map([[$,[R.getProcessTime()]]]);return}if(!uA.consoleTimeInstances.has($)){uA.consoleTimeInstances.set($,[R.getProcessTime()]);return}let A=uA.consoleTimeInstances.get($);if(A.unshift(R.getProcessTime()),this.lookbackLimit>0&&A.length>=this.lookbackLimit)A.pop()}static elipsedEnd($){if(!uA.consoleTimeInstances.has($))return;let A=uA.consoleTimeInstances.get($),L=A[0];A[0]=R.getProcessTime()-L}static condense($){let A=uA.consoleTimeInstances.get($);if(!A)return null;let L=0;for(let D of A)L+=D;return L/=A.length,uA.consoleTimeInstances.delete($),{print(){console.log($+": "+R.toShortNum(L)+"s")},valueOf:()=>L,toString:()=>$+": "+R.toShortNum(L)+"s",value:L}}},compareDate(H,$,A,L="day"){if(!H||!A)return!1;let D=M(H),I=M(A),E=D.next(),K=I.next();do if(E.value!==K.value)switch($){case">":return E.value>K.value;case"<":return E.value<K.value;case">=":return E.value>=K.value;case"<=":return E.value<=K.value;default:return!1}while(!(E=D.next()).done&&!(K=I.next()).done);return $[1]==="=";function*M(W){if(yield W.getFullYear(),L==="year")return;if(yield W.getMonth(),L==="month")return;yield W.getDate()}},DataScienceKit:{frequencyOf(H){if(!H||typeof H!="string"&&!R.isArrayLike(H))return new Map;let $=[...new Set(H)],A=new Map($.map((L)=>[L,0]));for(let L of H)$.forEach((D)=>{if(D==L)A.set(D,A.get(D)+1)});return A},LCS_of(H,$,A=(L,D)=>L===D){if(!(H?.length&&$?.length))return[];let L=[],D=$.length,I=H.length;while(L.length<I)L.push(Array(D));for(let W=0;W<L.length;W++)for(let X=0;X<L[W].length;X++){if(A(H[W],$[X])){let Q=M(W-1,X-1);L[W][X]=[Q+1,3];continue}let J=M(W,X-1),Z=M(W-1,X);if(J>Z)L[W][X]=[J,2];else L[W][X]=[Z,1]}let E=[];return K(I-1,D-1),E;function K(W,X){if(W<0||X<0)return;switch(L[W][X][1]){case 1:K(W-1,X);break;case 2:K(W,X-1);break;case 3:E.unshift(H[W]),K(W-1,X-1);break}}function M(W,X){if(W<0||X<0)return 0;else return L[W][X][0]}},LCSLength_of(H,$,A=(L,D)=>L===D){if(!(H?.length&&$?.length))return 0;let L=[],D=$.length,I=H.length;while(L.length<I)L.push(Array(D));for(let K=0;K<L.length;K++)for(let M=0;M<L[K].length;M++){if(A(H[K],$[M])){let J=E(K-1,M-1);L[K][M]=[J+1,3];continue}let W=E(K,M-1),X=E(K-1,M);if(W>X)L[K][M]=[W,2];else L[K][M]=[X,1]}return L[I-1][D-1][0];function E(K,M){if(K<0||M<0)return 0;else return L[K][M][0]}},TFIDF_of(H){let $=H.length,A=Array($),L=new Map;for(let I=0;I<$;I++){let E=H[I].length,K=R.DataScienceKit.frequencyOf(H[I]);A[I]=new Map;for(let M=0;M<E;M++){if(!A[I].has(H[I][M]))A[I].set(H[I][M],new qQ(K.get(H[I][M])/E));if(!L.has(H[I][M]))L.set(H[I][M],0)}}let D=[...L.keys()];for(let I=0;I<D.length;I++)for(let E of H)if(E.includes(D[I]))L.set(D[I],L.get(D[I])+1);for(let[I,E]of L)L.set(I,Math.log10($/E));for(let I of A)for(let[E,K]of I)K.IDF=L.get(E),K.TF_IDF=K.IDF*K.TF;return A},TFIDF_extends(H,$){let A=H.concat(Array($.length)),L=new Map,D=A.length;for(let E=0;E<D;E++){let K,M,W=!1,X=E-H.length;if(!A[E])W=!0,K=$[X].length,M=R.DataScienceKit.frequencyOf($[X]),A[E]=new Map;else K=A[E].size;for(let J=0;J<K;J++){if(W&&!A[E].has($[X][J])){if(A[E].set($[X][J],new qQ(M.get($[X][J])/K)),!L.has($[X][J]))L.set($[X][J],0);continue}let Z=[...A[E].keys()][J];if(!L.has(Z))L.set(Z,0)}}let I=[...L.keys()];for(let E=0;E<I.length;E++)for(let K of A)if(K.has(I[E]))L.set(I[E],L.get(I[E])+1);for(let[E,K]of L)L.set(E,Math.log10(D/K));for(let E of A)for(let[K,M]of E)M.IDF=L.get(K),M.TF_IDF=M.IDF*M.TF;return A},wagnerFischer_of(H,$,A=(L,D)=>L===D){let L=[],D,I;for(D=0;D<=H.length;D++)L[D]=[D];for(I=0;I<=$.length;I++)L[0][I]=I;for(D=1;D<=H.length;D++)for(I=1;I<=$.length;I++){if(A(H[D-1],$[I-1])){L[D][I]=L[D-1][I-1];continue}L[D][I]=Math.min(L[D-1][I-1]+1,Math.min(L[D][I-1]+1,L[D-1][I]+1))}return{distance:L[H.length][$.length],getOperations(){let E=L.length-1,K=L[0].length-1,M=[],W=new R.SafeTrue;while((E>0||K>0)&&W.True)switch(X(E,K,L)){case 2:M.push({type:"delete",index:E-1,value:H[E-1]}),E--;break;case 0:M.push({type:"insert",index:E,value:$[K-1]}),K--;break;case 1:if(L[E][K]!==L[E-1][K-1])M.push({type:"replace",index:E-1,value:$[K-1]});E--,K--;break}return M;function X(J,Z,Q){let B=[Q[J][Z-1],Q[J-1][Z-1],Q[J-1][Z]];if(Z<=0)return 2;if(J<=0)return 0;if(B[0]==B[1])if(B[2]==B[1])return 1;else return 0;let Y=B[0],G=0;for(let U=1;U<B.length;U++)if(B[U]<Y)Y=B[U],G=U;return G}}}}},deferredFunc(H,$=200,A=!1){let L=null;return function(...D){let I=!1;if(A&&!L)H(...D),I=!0;clearTimeout(L),L=setTimeout(()=>{if(L=null,!I)H(...D)},$)}},digitAt(H,$){try{return parseInt(($+"").at(H))}catch{return 0}},digitAtRange(H,$,A){if(!A)return;H=H<0?void 0:H??void 0,$=$<0?void 0:$??void 0;let L=(A+"").slice(H,$);return parseInt(L.length?L:"0")},getDimensions(H,$="max"){let A=[],L=$==="min"?Math.min:Math.max,D=$==="min"?1/0:0,I=D,E=[],K=0;if(!R.isArrayLike(H))return A;if(A.push(H.length),$==="symmetric")M(H,0);else W(H,0,!0);return A;function M(X,J){if(!R.isArrayLike(X?.[A[J]-1]))return;A.push(X[A[J]-1].length),M(X[A[J]-1],J+1)}function W(X,J,Z=!1,Q=[]){for(let B=0;B<A[J];B++){if(!R.isArrayLike(X[B]))continue;if(X[B].length!=I){if($==="fixed"&&I!==D)throw Error(`Array length mismatched at depth ${J+1} position (${[...Q,B].join(",")}):
|
|
9
|
+
expected length: ${I}
|
|
10
|
+
actual length: ${X[B].length}`);I=L(I,X[B].length)}E.push([X[B],J+1,!1,[...Q,B]])}if(Z&&I!==D){A.push(I),I=D;let B=[...E];E=[];for(let Y=0;Y<B.length;Y++){if(Y==B.length-1)B[Y][2]=!0;if(++K>5000){queueMicrotask(()=>{K=0,W(...B[Y])});continue}W(...B[Y])}}}},Err:class H extends Error{constructor($,A=null,L=null,D=null){if(R.isError($)){if(!A)A=$.name;if(!L)L=$.code;if(!D)D=$.stack;$=$.message}super($);if(A)this.name=A;if(L)this.code=L;if(D)this.stack=D}toString($={}){if(!this||!R.isError(this))return"[Error unknown]";return R.Err.toString(this,$)}static from($,A=null,L=null,D=null){return new R.Err($,A,L,D)}static isError($){if($ instanceof Error)return!0;if(Object.prototype.isPrototypeOf.call(Error.prototype,$))return!0;return typeof $?.message=="string"&&typeof $?.stack=="string"}static toString($,A={}){let{color:L=!1,defColor:D=void 0}=A,I=(L?R.ncc("Red")+"ERROR"+R.ncc(D):"ERROR")+" Message: ";if(L)I+=R.ncc("Red")+($?.message??"[unknown]")+R.ncc(D);else I+=$?.message??"[unknown]";if($?.name)if(I+=`
|
|
11
|
+
Name: `,L)I+=R.ncc("Red")+$.name+R.ncc(D);else I+=$.name;if($?.code)if(I+=`
|
|
12
|
+
Code: `,L)I+=R.ncc("Yellow")+$.code+R.ncc(D);else I+=$.code;if($?.stack)if(I+=`
|
|
13
|
+
Stack: `,L)I+=R.ncc(5592405)+$.stack+R.ncc(D);else I+=$.stack;return I}},escapeRegExp(H){return H.replace(/[[\]{}.*$^|\-?+,:\\]/g,"\\$&")},ex_length(H,$=0){if(typeof H!=="string")throw TypeError("argument must be a string");if($<0)return H.length;H=R.cleanString(H);let A=H.length;if($<1)return A;let L=H;for(let K of R.CONSTS.UNICODES_RANGE_TABLE){if(!K.type.endsWith("full"))continue;L=L.replace(K.regex,"")}let D=A+(A-L.length);if($<2)return D;let I=H.match(R.REGEXP.EmojiEach)??[],E=I.reduce((K,M)=>K+M.length,0);return I.length*2+(D-E)},fileNameCleaner(H,$="_"){if(!H||typeof H!="string")throw Error("the given `rawName` isn't a string");return H.trim().replace(/[|/*\\<>"?:]/g,$)},fixFilePath(H,$="_"){if(!H||!H?.length)throw"path is either falsy or empty!";return H.replace(/[:?"<>|*]/g,$)},fixYTurl(H){if(H=H||void 0,!H)throw"url can't be falsy!!";if(H.includes("youtu.be"))H=H.replace("https://youtu.be/","https://www.youtube.com/watch?v=");if(H.includes("&list="))H=H.split("&list=")[0];if(H.includes("?si="))H=H.split("?si=")[0];if(H.includes("https")==!1)H="https://www."+H;return H},fileTypeOf(H){let $=H.slice(H.lastIndexOf(".")+1).toLowerCase(),A=$=="jpg"||$=="png"||$=="svg"||$=="jfif"||$=="pbm"||$=="pgm"||$=="jpeg",L=$=="txt"||$=="bat"||$=="text"||$=="md"||$=="json"||$=="step"||$=="js"||$=="cs"||$=="cpp"||$=="gitignore"||$=="java"||$=="py"||$=="config"||$=="cfg"||$=="ts"||$=="env",D=$=="exe"||$=="vpk"||$=="qc"||$=="smd"||$=="vmt"||$=="vtf"||$=="zip"||$=="7z"||$=="bin"||$=="ipynb"||$=="pyc"||$=="jar",I=$=="aiff"||$=="aif"||$=="aifc"||$=="flac"||$=="mp3"||$=="mp4"||$=="mp4a"||$=="m4a"||$=="mkv"||$=="mov"||$=="wav"||$=="gif"||$=="webm";if(A)return"image";else if(L)return"text";else if(D)return"binary";else if(I)return"media";return null},getMatchAllIndexes(H){if(!H)return[];let $=[];for(let A of H)$.push(A.index);return $},getMatchAllResults(H){if(!H)return[];let $=[];for(let A of H)$.push(new XC(A[0],A.index,A.index+A[0].length));return $},getRandomInt(H,$){return Math.round(Math.random()*($-H)+H)},getProcessTime(){let H=process.hrtime();return H[0]*1000+H[1]/1e6},hyperLink(H,$){if($=encodeURI($),!R.CheckCache.supportsHyperlink)return $;return`\x1B]8;;${$}\x07${H}\x1B]8;;\x07`},IDGenerator(H=null,$="CCNNNN"){let A=!1,L=$.length,D=new R.SafeTrue;while(D.True){let I=Array(L);for(let E=0;E<L;E++)switch($[E]){case"C":{let K=R.getRandomInt(65,116);if(K>90)K+=6;I[E]=String.fromCharCode(K);continue}case"N":I[E]=R.getRandomInt(0,9).toString();continue;case"B":{let K=R.getRandomInt(48,109);if(K>57&&K<84)K+=7;else if(K>83)K+=13;I[E]=String.fromCharCode(K);continue}default:I[E]=$[E];break}if(H){if(H instanceof Set)A=H.has(I);else A=H.includes(I);if(!A)return I.join("")}else return I.join("")}return null},includesWord(H,$,A=!1){if(!A)$=$.toLowerCase(),H=H.toLowerCase();$=$.padStart($.length+1," ").padEnd($.length+2," ");let L=$.search(H);if(L!==-1){let D=$.substring(L-1),I=$.substring(L+H.length);if(D.search(R.REGEXP.Seperators)==0&&I.search(R.REGEXP.Seperators)==0)return!0}return!1},IPC:class H{static Listener=kD;#H;#$=new Map;#A;#L=!1;#I=new Set;peersAddress="localhost";peersPort;listenPort;get protocol(){return this.#A}constructor($="udp4",A={}){if(!xD)throw Error("IPC is only available on JSRuntime, due to the use of Node modules");let{peersPort:L=null,peersAddress:D=null,listenPort:I=null}=typeof A=="number"?{listenPort:A}:A;if($!="nodeworker"&&$!="udp4"&&$!="udp6")throw Error(`protocol must be 'nodeworker', 'udp4' or 'udp6' instead given '${$}'`);if(this.#A=$,!R._modules.dgram&&$!="nodeworker")throw Error(`module 'dgram' not loaded use 'Tools._modules.dgram = require("dgram")' to load it`);if($=="nodeworker"){if(!R._modules.worker_threads)throw Error(`module 'worker_threads' not loaded use 'Tools._modules.worker_threads = require("worker_threads")' to load it`);if(!I){if(R._modules.worker_threads.isMainThread)throw Error("when using `nodeworker` protocol, `port` must be provided if on the main thread");this.#H=R._modules.worker_threads.parentPort,this.#D();return}if(!(I instanceof R._modules.worker_threads.Worker)&&I!==R._modules.worker_threads.parentPort&&I!=null)throw Error(`port must be a type of 'Worker' or a 'parentPort' instead given '${typeof I}'`);this.#H=I,this.#D();return}if(!L)throw Error("peersPort must be provided for `udp4` or `udp6` protocol");this.listenPort=I,this.peersAddress=D,this.peersPort=L,this.#H=R._modules.dgram.createSocket($),this.#D()}async#D(){if(this.#H.on("message",this.#E),this.protocol=="nodeworker")return;if(!this.listenPort)return;try{this.#H.bind(this.listenPort),this.#L=!0}catch($){switch($.code){case"ERR_SOCKET_BAD_PORT":throw new R.Err(`Tools.IPC: port ${this.listenPort} is not valid`,"IPC_ERR_SOCKET_BAD_PORT",$.code,$.stack);case"EADDRINUSE":throw new R.Err(`Tools.IPC: port ${this.listenPort} is already in use`,"IPC_EADDRINUSE",$.code,$.stack);default:throw R.Err.from($,"IPC_BIND_ERROR").message=`Tools.IPC: failed to bind port ${this.listenPort} `+$.message}}}bind($,A){if(this.protocol=="nodeworker")return;if(this.peersAddress=$,this.listenPort=A,!this.#L)this.#D();return this}close(){if(this.protocol=="nodeworker")return;this.#H.close()}async advSend($,A){return new Promise((L,D)=>{if(!$)throw Error("channel must be provided");if(typeof $!="string")throw Error(`channel must be a type of 'string' instead given '${typeof $}'`);let{contents:I,UPID:E}=A;if(!(I instanceof Array))I=[I];let K;try{K=this.protocol=="nodeworker"?{channel:$,UPID:E,contents:I.map((M)=>{if(Sc(M))return M;return"@JSON:"+JSON.stringify(M,R.JSONReplacer)})}:Buffer.from(JSON.stringify({channel:$,UPID:E,contents:I},R.JSONReplacer))}catch(M){D(R.Err.from(M,"IPC_SERIALIZE_ERROR").message="Tools.IPC: failed to serialize payload,"+M.message);return}if(this.protocol=="nodeworker"){this.#H.postMessage(K),L();return}this.#H.send(K,this.peersPort,this.peersAddress,(M)=>{if(M)D(M);L()})})}async send($,...A){return this.advSend($,{contents:A})}on($,A){let L=this.#$.get($);if(!L){this.#$.set($,[new kD(0,A)]);return}return L.push(new kD(0,A)),this}once($,A,L=null){let D=this.#$.get($);if(!D){this.#$.set($,[new kD(1,A,L)]);return}return D.push(new kD(1,A,L)),this}remove($){if(typeof $=="string")return this.#$.delete($),!0;if(typeof $!="function")throw Error(`listener must be a type of 'string' or 'function' instead given '${typeof $}'`);for(let[A,L]of this.#$){let D=L.find((E)=>E.callback==$);if(!D)continue;if(!L.filter((E)=>E.callback!=$))return this.#$.delete(A),!0;return this.#$.set(A,L.filter((E)=>E.callback!=D)),!0}return!1}async ask($,A,...L){return new Promise((D,I)=>{let E;if(A)E=setTimeout(()=>{I(new R.Err(`Tools.IPC: ask timeout on channel: ${$}`,"IPCAskTimeout"))},A);let K=this.#K();this.once($,(M)=>{if(A)clearTimeout(E);D(M)},K),this.advSend($,{contents:L,UPID:K})})}onAsk($,A){let L=this,D=async function(...I){L.#I.add(this.UPID);let E=await A(...I);L.advSend($,{contents:[E],UPID:this.UPID}),L.#I.delete(this.UPID)};return this.on($,D),this}#E=($)=>{let A;try{A=this.protocol=="nodeworker"?{channel:$.channel,UPID:$.UPID,contents:$.contents.map((D)=>{if(typeof D=="string"&&D.startsWith("@JSON:"))return JSON.parse(D.slice(6),R.JSONReviver);return D})}:JSON.parse($.toString(),R.JSONReviver)}catch(D){throw R.Err.from(D,"IPC_DESERIALIZE_ERROR").message="Tools.IPC: failed to deserialize payload,"+D.message}let L=this.#$.get(A.channel);if(!L)return;for(let D of L){if(D.UPID){if(D.UPID!=A.UPID)continue;this.#I.delete(D.UPID)}if(D.callback.call(A,...A.contents),D.type==1||D.UPID)this.remove(D.callback)}};#K(){let $=R.IDGenerator(this.#I,"BBBBBBBB");return this.#I.add($),$}},isArrayLike(H){let $=H?.length;return Array.isArray(H)||!!H&&$!=null&&typeof H==="object"&&typeof $==="number"&&($===0||$>0&&($-1 in H))},isArrowFunction(H){if(typeof H!=="function")return!1;if(Object.hasOwnProperty.call(H,"prototype"))return!1;try{return H.arguments,!1}catch{}return H.toString().slice(0,20).includes("=>")},isAsyncFunction(H){if(typeof H!=="function")return!1;if(H.constructor?.name==="AsyncFunction")return!0;return(H instanceof R.CONSTS.AsyncFunction&&R.CONSTS.AsyncFunction!==Function&&R.CONSTS.AsyncFunction!==R.CONSTS.GeneratorFunction)===!0},isClass:(H)=>{if(typeof H!=="function")return!1;return H.toString().startsWith("class")},isNumber:(H)=>{return/^[0-9]+$|^[0-9]+\\.[0-9]+$/.test(H)},isEmptyArray:(H)=>R.isArrayLike(H)&&!H.length,isEmptyObject:(H)=>!R.isArrayLike(H)&&H instanceof Object&&!R.propertiesCount(H),isError(H){return R.Err.isError(H)},isValidFilePath(H){if(!H||!H?.length)return!1;if(/[:?"<>|*]/g.test(H))return!1;return!0},JSONReplacer(H,$){if($ instanceof Map)return{"@dataType":"Map","@value":Array.from($.entries())};if($ instanceof Set)return{"@dataType":"Set","@value":Array.from($.values())};switch(typeof $){case"function":return{"@dataType":"function","@value":$.toString().replace(/\n* {2,}|\n/g,"")};case"bigint":return{"@dataType":"BigInt","@value":$.toString()};case"object":for(let A in $)if($[A]instanceof Date)$[A]={"@dataType":"Date","@value":$[A].valueOf()};return $}return $},JSONReviver(H,$){if(!$||!$["@dataType"])return $;switch($["@dataType"]){case"function":return Function("return "+$["@value"])();case"BigInt":return BigInt($["@value"]);case"Map":return new Map($["@value"]);case"Set":return new Set($["@value"]);case"Date":return new Date($["@value"])}return $},jsTime:{howLong(H,$=new Date){let A=$.getTime()-H.getTime();return R.jsTime.getTimeFromMS(A).modern()},getTimeFromMS(H){let $=0,A=0,L=0,D=0,I=0,E=0,K=H>262800200;while(H>=1000)H-=1000,E++;while(E>=60)E-=60,I++;while(I>=60)I-=60,D++;if(K){while(D>=24)D-=24,L++;while(L>=30.4167)L-=30.4167,A++;L=Math.round(L);while(A>=12)A-=12,$++}if(K)return{year:$,month:A,days:L,hr:D,min:I,sec:E,ms:H,toString(){return`${$}:${A}:${L}|${D}:${I}:${E}.${H.toString().padStart(3,"0")}`},modern(){if($+A+L+E+I+D==0)return`${H}ms`;else if($+A+L+I+D==0)return`${E}.${H}s`;else if($+A+L+D==0)return`${I}min ${E}s`;else if($+A+L==0)return`${D}hr ${I}min`;else if($+A==0)return`${L}days ${D}hr`;else if($==0)return`${A}months ${L}days`;else return`${$}year ${A}months`}};return{year:$,month:A,days:L,hr:D,min:I,sec:E,ms:H,toString(){return`${D}:${I}:${E}.${H.toString().padStart(3,"0")}`},modern(){if(E+I+D==0)return`${H}ms`;else if(I+D==0)return`${E}.${H}s`;else if(D==0)return`${I}min ${E}s`;else return`${D}hr ${I}min`}}}},lazySplit:function*(H,$){if($===""){for(let D of H)yield D;return}let A=0,L;while((L=H.indexOf($,A))!==-1)yield H.substring(A,L),A=L+$.length;yield A?H.substring(A):H},remap(H,$){if(H instanceof Map){let L=new Map;for(let[D,I]of H){let E=$(D,I,L);if(E===void 0)continue;if(E===null)L.set(D,I);if(E.key===void 0)L.set(D,E);if(L.set(E.key,E.value),E.key!==D&&L.has(D))L.delete(D)}return L}let A={};for(let L in H){let D=$(L,H[L],A);if(D===void 0)continue;if(D===null){A[L]=H[L];continue}if(D.key===void 0){A[L]=D;continue}if(A[D.key]=D.value,D.key!==L&&A[L]!==void 0)delete A[L]}return A},MathKit:{clamp(H,$,A){return Math.min(Math.max(H,$),A)},degrees(H){return H*180/Math.PI},distanceFrom(H,$){let A=$.x-H.x,L=$.y-H.y,D=$.z-H.z;return Math.sqrt(A**2+(isNaN(L)?0:L**2)+(isNaN(D)?0:D**2))},dopri(H,$,A,L,D=0.000001,I=1000,E){let K=[H],M=[A],W=[L(H,A)],X,J,Z,Q,B,Y,G=[],U=0.2,V=[0.075,0.225],z=[0.9777777777777777,-3.7333333333333334,3.5555555555555554],P=[2.9525986892242035,-11.595793324188385,9.822892851699436,-0.2908093278463649],T=[2.8462752525252526,-10.757575757575758,8.906422717743473,0.2784090909090909,-0.2735313036020583],q=[0.09114583333333333,0,0.44923629829290207,0.6510416666666666,-0.322376179245283,0.13095238095238096],O=[0.10013431883002395,0,0.3918321794184259,-0.02982460176594817,0.05893268337240795,-0.04497888809104361,0.023904308236133973],N=[0.2,0.3,0.8,0.8888888888888888,1,1],x=[-0.0012326388888888888,0,0.0042527702905061394,-0.03697916666666667,0.05086379716981132,-0.0419047619047619,0.025],w=0,F,f,j=($-H)/10,S=0,_,u,h,d,l,k=new QC(K,M,W,G,-1,"");if(typeof E==="function")h=E(H,A);while(H<$&&S<I){if(++S,H+j>$)j=$-H;if(X=L(H+N[0]*j,A+U*j*W[w]),J=L(H+N[1]*j,A+V[0]*j*W[w]+V[1]*j*X),Z=L(H+N[2]*j,A+z[0]*j*W[w]+z[1]*j*X+z[2]*j*J),Q=L(H+N[3]*j,A+P[0]*j*W[w]+P[1]*j*X+P[2]*j*J+P[3]*j*Z),B=L(H+N[4]*j,A+T[0]*j*W[w]+T[1]*j*X+T[2]*j*J+T[3]*j*Z+T[4]*j*Q),_=A+W[w]*j*q[0]+J*j*q[2]+Z*j*q[3]+Q*j*q[4]+B*j*q[5],Y=L(H+j,_),F=W[w]*j*x[0]+J*j*x[2]+Z*j*x[3]+Q*j*x[4]+B*j*x[5]+Y*j*x[6],u=Math.abs(F),u>D){if(j=0.2*j*Math.pow(D/u,0.25),H+j===H){k.msg="Step size became too small";break}continue}if(G[w]=A+W[w]*j*O[0]+J*j*O[2]+Z*j*O[3]+Q*j*O[4]+B*j*O[5]+Y*j*O[6],++w,K[w]=H+j,M[w]=_,W[w]=Y,typeof E==="function"){let p,LH=H,IH=H+0.5*j,HH;if(d=E(IH,G[w-1]),l=h<0&&0<d,l){let e,_H,SH=0,o=1,JH=1;while(!0){if(typeof h==="number")HH=(JH*d*LH-o*h*IH)/(JH*d-o*h);else{HH=IH;for(f=h.length-1;f!==-1;--f)if(h[f]<0&&d[f]>0)HH=Math.min(HH,(JH*d[f]*LH-o*h[f]*IH)/(JH*d[f]-o*h[f]))}if(HH<=LH||HH>=IH)break;if(p=k._at(HH,w-1),_H=E(HH,p),e=h<0&&0<_H,e){if(IH=HH,d=_H,l=e,JH=1,SH===-1)o*=0.5;else o=1;SH=-1}else{if(LH=HH,h=_H,o=1,SH===1)JH*=0.5;else JH=1;SH=1}}return _=k._at(0.5*(H+HH),w-1),k.f[w]=L(HH,p),k.x[w]=HH,k.y[w]=p,k.ymid[w-1]=_,k.events=l,k.iterations=S,k}LH=IH,IH=H+j,h=d,d=E(IH,_),l=h<0&&0<d}H+=j,A=_,h=d,j=Math.min(0.8*j*Math.pow(D/u,0.25),4*j)}return k.iterations=S,k},integral(H,$,A){if(A>$)throw Error("lower bound must be less than upper bound");if(A==$)return 0;if(!R._modules.mathjs)throw Error(`module 'mathjs' not loaded use 'Tools._modules.mathjs = require("mathjs")' to load it`);let L;if(typeof H=="string")L=R._modules.mathjs.compile(H);else L=H;if(typeof A=="string")A=R._modules.mathjs.evaluate(A);if(typeof $=="string")$=R._modules.mathjs.evaluate($);let D=(I)=>L.evaluate({x:I});return R.MathKit.dopri(A,$,0,D).at($)},lerp(H,$,A){return H+($-H)*A},Lsh_us(H,$){return H*2**$},not_us16(H){return H^65535},not_us32(H){return H^4294967295},not_us8(H){return H^255},map(H,$,A,L,D){return H=R.MathKit.clamp(H,$,A),(H-$)/(A-$)*(D-L)+L},Point:WC,radians(H){return H*Math.PI/180},Rsh_us(H,$){return Math.floor(H/2**$)},sum:(...H)=>{return H.flat(5).reduce(($,A)=>$+A,0)},toPolarCoords(H,$,A="r"){if(!A||A!="d"&&A!="r")throw Error("unit must be 'r' or 'd', given: "+A);let L=Math.atan($/H);if($<0&&H<0)L+=360;else if(H<0)L+=180;return{r:Math.sqrt(H**2+$**2),t:A=="d"?L:R.MathKit.radians(L)}},toCartesianCoords(H,$,A=null,L="r"){if(!L||L!="d"&&L!="r")throw Error("unit must be 'r' or 'd', given: "+L);if(A!==null&&typeof A!="number")throw Error("polar must be a number");if(L=="d"){if($=R.MathKit.radians($),A!==null)A=R.MathKit.radians(A)}if(A===null)return{x:H*Math.cos($),y:H*Math.sin($)};else return{x:H*Math.sin(A)*Math.cos($),y:H*Math.sin(A)*Math.sin($),z:H*Math.cos(A)}}},maxFraction(H,$,A=!1){let L=H.toString();if(!L.includes("."))return L;let D=10**$;return H=(A?Math.floor(H*D):Math.round(H*D))/D,H.toString()},ncc(H=null,$=null,A=null){if(R.CheckCache.supportsColor===0)return"";if(H==null)return"\x1B[0m";if(typeof H=="number"){let D=R.Convert.decimalColorToRGB(H);switch(A?1:R.CheckCache.supportsColor){default:return"";case 1:H=($=="bg"?"bg":"")+R.Convert.basicColorFromRgb(D);case 2:{let E=R.Convert._8bitColorFromRgb(D);return`\x1B[${$=="bg"?"4":"3"}8;5;${E}m`}case 3:return`\x1B[${$=="bg"?"4":"3"}8;2;${D.r};${D.g};${D.b}m`}}return H=H.toLowerCase(),{black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",reset:"\x1B[0m",bright:"\x1B[1m",dim:"\x1B[2m",italic:"\x1B[3m",underline:"\x1B[4m",blink:"\x1B[5m",invert:"\x1B[7m",hidden:"\x1B[8m",normal:"\x1B[22m",bgblack:"\x1B[40m",bgred:"\x1B[41m",bggreen:"\x1B[42m",bgyellow:"\x1B[43m",bgblue:"\x1B[44m",bgmagenta:"\x1B[45m",bgcyan:"\x1B[46m",bgwhite:"\x1B[47m"}[H]||"\x1B[37m"},nearestNumber(H,$){let A=1/0,L=null;for(let D=0,I=H[D];D<H.length;){let E=Math.abs($-I);if(!E)return D;if(E<A)A=E,L=D;I=H[++D]}return L},objectMap(H,$){return R.remap(H,$)},objValueAt(H,$){return H[Object.keys(H).at($)]},objToString(H,$={}){let{maxDepth:A=4,indent:L=3,maxKeys:D=20,color:I=!1,defColor:E=void 0,noHeader:K=!1}=$;if(A<1)A=1;let M={color:I,defColor:E},W=typeof L=="number"?" ".repeat(L):L,X=null;if(I)X={cyan:R.ncc(4764610),magenta:R.ncc(11550650),gray:R.ncc(4802889),yellow:R.ncc(12754962),_default:R.ncc(E)};if(H==null||typeof H!=="object")return R.yuString(H,M);if(R.isArrayLike(H))return R.arrToString(H,{color:I,defColor:E,maxDepth:A,indent:L});if(H instanceof Map||H instanceof Set||H instanceof Promise||H instanceof Date||H instanceof RegExp)return R.yuString(H,M);if(R.isError(H))return R.Err.toString(H,{color:I,defColor:E});let J=H.constructor?.name||"Object",Z=J!=="Object",B=Object.keys(H).length,Y="";if(!K&&(Z||B>5))if(I)Y=X.magenta+`${J}(${B}) `+X._default;else Y=`${J}(${B}) `;return Y+G(H,0);function G(U,V,z=0){if(V>A-1)if(I)return X.gray+"... {Object}"+X._default;else return"... {Object}";if(U==null)return R.yuString(U,M);if(typeof U!=="object"||U instanceof Date||U instanceof RegExp)return R.yuString(U,M);if(R.isArrayLike(U))return R.arrToString(U,{color:I,defColor:E,maxDepth:A-V,indent:L,noHeader:!0});if(U instanceof Map||U instanceof Set)return R.yuString(U,M);let P=Object.keys(U),T=P.length;if(T===0)return"{}";let q=T>3||V>0,O=z?W.repeat(z):"",N=O+W,x=q?`{
|
|
14
|
+
`+N:"{ ",w=Math.min(P.length,D-1);for(let F=0;F<w;F++){let f=P[F],j=U[f];if(I)x+=X.cyan+f+X._default+": ";else x+=f+": ";if(j&&typeof j==="object"&&!R.isArrayLike(j)&&!(j instanceof Date)&&!(j instanceof RegExp)&&!(j instanceof Map)&&!(j instanceof Set)&&!(j instanceof Promise)){let S=j.constructor?.name||"Object";if(S!=="Object"&&I)x+=X.magenta+S+" "+X._default;else if(S!=="Object")x+=S+" ";x+=G(j,V+1,q?z+1:z)}else x+=R.yuString(j,M);if(F<w-1)x+=q?`,
|
|
15
|
+
`+N:", "}if(P.length>D-1){let F=P.length-w;if(I)x+=q?`,
|
|
16
|
+
`+N:", ",x+=X.gray+`... (${F} more)`+X._default;else x+=q?`,
|
|
17
|
+
`+N:", ",x+=`... (${F} more)`}return x+=q?`
|
|
18
|
+
`+O+"}":" }",x}},propertiesCount(H){return Object.keys(H).length},padEnd(H,$,A=" ",L=0){let D=R.ex_length(H,L);if(D>=$)return H;return H+A.repeat($-D)},padStart(H,$,A=" ",L=0){let D=R.ex_length(H,L);if(D>=$)return H;return A.repeat($-D)+H},parseArgs(H,$,A=!1){let L={_unmatched:[]},D=new Set;for(let E in $)if($[E]?.required)D.add(E);for(let E=0;E<H.length;E++){let K=!1;for(let M in $){if(!$[M]?.pattern)throw Error("invalid template: Object structure missmatched. every entries requires `pattern` property");if(!I(H[E],$[M].pattern))continue;if(D.delete(M),$[M]?.isFlag||$[M]?.type=="flag"){K=!0,L[M]=new gA(!0,"flag",E);continue}let W=!1;if(E+1<H.length){for(let X in $)if(I(H[E+1],$[X].pattern))W=!0}if(E+1>=H.length||W)throw Error(`argument '${H[E]}' requires a Value`);switch($[M]?.type){case"int":if(isNaN((L[M]=new gA(parseInt(H[++E]),$[M]?.type,E)).value))throw Error(`argument '${H[E-1]}' requires a Value of type '${$[M]?.type}'`);break;case"float":if(isNaN((L[M]=new gA(parseFloat(H[++E]),$[M]?.type,E)).value))throw Error(`argument '${H[E-1]}' requires a Value of type '${$[M]?.type}'`);break;case"choice":if(!$[M]?.choices?.length)throw Error("invalid template: Object structure missmatched. entry of type 'choice' requires `choices` property");if(!I(H[++E],$[M].choices)&&$[M]?.default==null)throw Error(`invalid value for '${H[E-1]}' argument, requires any of these Choices: ${$[M].choices}`);L[M]=new gA(H[E],$[M]?.type,E);break;case"string":case void 0:L[M]=new gA(H[++E],$[M]?.type,E);break;default:throw Error(`invalid template: entry of type '${$[M]?.type}' is not supported`)}K=!0}if(!K)L._unmatched.push(new gA(H[E],void 0,E))}if(D.size>0)throw Error(`argument(s) '${[...D]}' is required.`);for(let E in $){if($[E]?.isFlag||$[E]?.type=="flag"){if(!L[E])L[E]=new gA(!1,"flag");continue}if(!L[E])L[E]=new gA($[E]?.default?$[E]?.default:null,$[E]?.type)}return L;function I(E,K){for(let M of K){if(!A){if(E.toLowerCase()==M.toLowerCase())return!0;continue}if(E==M)return!0}return!1}},parseBool(H,$=!1){if(typeof H=="boolean")return H;H=H.toLowerCase();let A=H=="true"?!0:!1;if(!$)return A;if(!(H=="true"||H=="false"))return null;return A},parseConfig(H,$=null,A={}){let{ignoreGroups:L=!1,multiValues:D=!1}=A,I=R.cleanArr(H.trim().split(`
|
|
19
|
+
`),["","\r"]),E={},K=null,M="",W,X=0,J=!1;for(let Q=0;Q<I.length;Q++){let B=I[Q].trim();if(/^[#;]/.test(B))continue;if(B.startsWith("[")){if(L)continue;{let P=!1;for(let T=1;T<B.length;T++)if(B[T]=="]"&&B[T-1]!="\\"){if(K=B.slice(1,T),!E[K])E[K]={};P=!0;break}if(!P)throw Error(`Tools.parseConfig(): invalid syntax, missing ']' at the end of the group. at \`${B}\``);else continue}}if(J){if(M+=I[Q],!Z(Q,I))continue;if(J=!1,K)E[K][W]=JSON.parse(M,$);else E[W]=JSON.parse(M,$);continue}let Y=R.cleanArr(B.split("="));if(Y.length>2)throw Error(`Tools.parseConfig(): invalid syntax, '=' cannot occur more than one time. at \`${B}\``);else if(Y.length==1&&!J)if(B.includes("="))throw Error(`Tools.parseConfig(): invalid syntax, expected expresion after '='. at \`${B}\``);else throw Error(`Tools.parseConfig(): expected expresion. at \`${B}\``);else if(!Y.length)throw Error(`Tools.parseConfig(): unknown operator. \`${B}\``);Y=[Y[0].trim(),Y[1].trim()];let G=R.getMatchAllIndexes(Y[1].matchAll(/["']/g)).filter((P,T,q)=>{if(Y[1][P-1]=="\\"){Y[1]=Y[1].slice(0,P-1)+Y[1].slice(P);for(let O=T+1;O<q.length;O++)q[O]--;return!1}return!0}),U=Y[1].search("#"),V=G[0],z=!1;if(V!=null&&(U==-1||V<U)){let P=G[1]==null?-1:G[1],T=Y[1].slice(P+2).trim();if(T&&!/^[#;]/.test(T))throw Error(`Tools.parseConfig(): invalid syntax, unexpected charactor(s).
|
|
20
|
+
at \`${B}\`
|
|
21
|
+
`+"".padStart(P+10+Y[0].length," ")+"^");if(P==-1)throw Error(`Tools.parseConfig(): invalid syntax, missing closing quote.
|
|
22
|
+
at \`${B}\`
|
|
23
|
+
`+" ".padStart(V+7+Y[0].length," ")+"^");z=!0,Y[1]=Y[1].slice(V+1,P)}else if(U!=-1){if(Y[1]=Y[1].slice(0,Y[1].indexOf("#")).trim(),!Y[1])throw Error(`Tools.parseConfig(): invalid syntax, expected expresion after '='. at \`${B}\``)}if(/^[0-9]/.test(Y[0]))throw Error(`Tools.parseConfig(): Key cannot starts with Numbers. at \`${B}\``);{let P=Y[0].replace(/[a-z$_0-9.]/ig,"");if(P.length!==0)throw Error(`Tools.parseConfig(): these character(s) "${P}" can not be Parse. at \`${B}\``)}if(/^[[{]/.test(Y[1])){if(X=0,[W,M]=Y,Z(1,Y)){if(K)E[K][W]=JSON.parse(M,$);else E[W]=JSON.parse(M,$);continue}J=!0;continue}{let P=K?E[K]:E;if(D&&Object.hasOwnProperty.call(P,Y[0])){if(P[Y[0]].$multiValues===void 0)P[Y[0]]=[P[Y[0]]],P[Y[0]].$multiValues=!0;P[Y[0]].push(z?Y[1]:R.parseValue(Y[1]))}else P[Y[0]]=z?Y[1]:R.parseValue(Y[1])}}return E;function Z(Q,B){if(X+=[...B[Q].matchAll(R.REGEXP.OpenSCBrackets)].filter((Y)=>Y[1]).length,X-=[...B[Q].matchAll(R.REGEXP.CloseSCBrackets)].filter((Y)=>Y[1]).length,X<=0)return!0;return!1}},parseValue(H){if(typeof H!="string")return H;switch(H.toLowerCase()){case"true":return!0;case"false":return!1;case"null":return null;case"":case"undefined":return;default:if(!isNaN(H))return Number(H);return H}},pass(H,$=null){if($)$(H);else console?.log(H);return H},Progress:class H{stdout=process.stdout;progress=0;spd=0;lastCheck=null;printInterval;updateInterval;total;#H=0;#$=!0;#A;constructor($,A=null,L=500,D=100){if(!$)throw Error("printTemplate is required");this.total=A,this.printInterval=L,this.updateInterval=D,this.setPrintTemplate($),this.lastCheck=Date.now()}update($=1){if(!this.#A)return;this.#H+=$,this.progress+=$;let A=Date.now()-this.lastCheck;if(A>this.updateInterval&&this.#H>4)this.spd=this.#H*this.updateInterval/A,this.#H=0,this.lastCheck=Date.now();if(this.lastPrint+this.printInterval>Date.now())return;if(this.lastPrint=Date.now(),!this.#$)this.stdout.clearLine(),this.stdout.cursorTo(0);else this.#$=!1;if(!this.total){this.#A();return}this.#A()}done(){if(this.progress!=this.total){if(!this.#$)this.stdout.clearLine(),this.stdout.cursorTo(0);this.progress=this.total,this.#A()}this.stdout.write(`
|
|
24
|
+
`),this.reset()}reset(){this.progress=0,this.#H=0,this.spd=0,this.lastCheck=Date.now(),this.#$=!0}setPrintTemplate($){$=$.replace(/%total%/g,"${this.total}"),$=$.replace(/%spd%/g,"${this.spd.toFixed(1)}"),$=$.replace(/%prog%/g,"${this.progress}"),this.#A=Function("this.stdout.write(`"+$+"`);").bind(this)}},proximate(H,$,A){if(H<$+A&&H>$-A)return $;else return H},randomPick(H){if(H.length<=1)return H[0];return H[Math.floor(Math.random()*H.length)]},redexOf(H,$,A=0){let L=typeof this!=="string";if(!H&&L)return-1;if(!L)H=this;if(!H.length)return-1;if(!($ instanceof RegExp))if(A>=0)return H.indexOf($,A);else return H.lastIndexOf($,H.length+A);let D,I;if(A>=0){D=-1;do{I=H.substring(++D);let E=I.search($);if(E==-1)return-1;D=E+D}while(D<A)}else{D=-1;do{I=H.substring(++D);let E=I.search($);if(E==-1)return D-1;D=E+D}while(D<H.length+A)}return D},REGEXP:Object.freeze({Seperators:/[-\s_・⧸/\\;:()[\]、,.'""!^**=+「【】」()]/g,SoftWrapSeperators:/(?<!\x1b\[\d{1,3}(?:;\d{1,3})*|\x1b\]8;;[^\x07]+|\x1b|\x07)[\s,.\]})]/g,HardWrapSeperators:/(?<!\x1b\[\d{1,3}(?:;\d{1,3})*|[\x1b\x07]\]8;*[^\x07]*|\x1b|\x07)[-\s_・⧸/\\;:()\[\]、,.'""!^**=+「【】」()]/g,ValidEmail:/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,ANSICode:/\x1b\[\d{1,3}(?:;\d{1,3})*m|\x1b\]8;;|(?<=[^\x07]+)\x07[^\x07]+\]8;;\x07/g,EmojiDetection:new RegExp(PQ),EmojiEach:new RegExp(PQ,"g"),EmojiEachGroup:new RegExp("(?:"+PQ+")+","g"),IniGroups:/^[\t ]*\[(.+)\][\t ]*$/gm,JSComments:/\\"|"(?:\\"|[^"])*"|(\/\/.*|\/\*[\s\S]*?\*\/)/g,OpenSCBrackets:/\\"|"(?:\\"|[^"])*"|([[{])/g,CloseSCBrackets:/\\"|"(?:\\"|[^"])*"|([\]}])/g}),resolveNodeEnv(H,$=/%(\w+)%/g){return H.replace($,(A,L)=>{let D=L;if(process.env[D]==null)return A;return process.env[D]})},SafeTrue:class H{#H=0;limit=0;noWarning=!1;constructor($=10000000000,A=!1){this.limit=$,this.noWarning=A}get True(){if(this.#H++>=this.limit){if(!this.noWarning)process?.emitWarning("SafeTrue limit reached");return!1}return!0}},search(H,$,A={}){let L=R.REGEXP.Seperators,D=A.maxResult,I=A.TF_IDFMaps instanceof Array?[...A.TF_IDFMaps]:A.TF_IDFMaps;if(!D)if(typeof A=="number")D=A;else D=1/0;if($=$.trim().toLowerCase(),$=="")return null;let E=[...H];if(E.forEach((W,X,J)=>J[X]=W.trim().toLowerCase()),I==="builtin")I=R.DataScienceKit.TFIDF_of(E.concat($).map((W)=>R.cleanArr(W.split(L))));class K{constructor(W,X,J=-1,Z=null){this.score=X,this.string=W,this.matchIndex=J,this.scores=Z}}let M=[];for(let W=0;W<E.length;W++){let X=E[W].replace(L,"");if(E[W]==$||X==$)M.unshift(new K(H[W],$.length<<2,W));let J,Z,Q,B;J=Z=Q=B=0;for(let G of R.cleanArr($.split(L))){let U=0;if(R.includesWord(G,E[W],!1))if(I&&I[W]?.has(G))U=G.length*I[W].get(G).TF_IDF*2.9,J+=U;else U=G.length,Z+=U;else if(E[W].includes(G))U=G.length*0.3,Q+=U;let V=R.DataScienceKit.LCSLength_of(G,E[W])*0.4;B+=V}let Y=J+Z+Q+B;M.push(new K(null,Y,W,{tfidf_s:J,word_s:Z,includes_s:Q,lcs_s:B,TF_IDFMap:I?.[W]}))}M.sort((W,X)=>X.score-W.score);for(let W=0;W<D;W++){if(!M[W])break;if(M[W].string!=null)continue;M[W].string=H[M[W].matchIndex]}return M.slice(0,D)},sleep(H){if(!H||H<0)return;let $=Date.now();while(Date.now()-$<H);},SpawnMirror:class H{static STDIO_MIRROR=["inherit","pipe","pipe"];static createMirror($){$?.stdout?.pipe(process.stdout),$?.stderr?.pipe(process.stderr)}},strClamp(H,$,A="mid",L=0){let D=R.ex_length(H,L);if(D<=$)return H.padEnd($," ");let I=D-(D-$)-3;switch(A){default:if(xD)process?.emitWarning(`'${A}' is not a valid location type.`);else throw Error(`'${A}' is not a valid location type.`);case"mid":{let E=I>>1;return R.strSlice(H,0,E,L)+"..."+R.strSlice(H,D-E,void 0,L)}case"end":return R.strSlice(H,0,I,L)+"...";case"start":return"..."+R.strSlice(H,I,void 0,L)}},stringifyConfig(H,$={}){let{ignoreList:A=[],minify:L=!1,replacer:D,mode:I="merge",useIniGroup:E=!1,alwaysWrapStrInQuotes:K=!1,oldConfigStr:M=""}=$,W=new R.SafeTrue(1e5),X=I=="merge"?M:"";for(let B in H){if(A.includes(B))continue;if(!E){J(B,H);continue}if(B===""||typeof H[B]!=="object"){J(B,H,"");continue}for(let Y in H[B]){if(A.includes(Y))continue;J(Y,H[B],B)}}return X;function J(B,Y,G,U=!1){let V="";if(Y[B]!=null&&typeof Y[B]==="object")if(Y[B].$multiValues){for(let F of Y[B])J(B,{[B]:F},G,!0);return}else V=`${JSON.stringify(Y[B],D,L?null:3)}
|
|
25
|
+
`;else if(typeof Y[B]=="string")if(K||/\s|[{[}\]]/.test(Y[B]))V=`"${Y[B]}"`;else V=`${Y[B]}`;else V=`${Y[B]}`;let z=U?-1:R.redexOf(X,new RegExp(`^[ \\t]*\\b${B}\\s*=`,"m")),P;if(G==="")P=-3;else P=E?X.indexOf(`[${G}]`):null;let T=P===-1;if(T)P=X.length+2,X+=`
|
|
26
|
+
|
|
27
|
+
[${G}]
|
|
28
|
+
`;if(z==-1){let F=L?`${B}=${V}
|
|
29
|
+
`:`${B} = ${V}
|
|
30
|
+
`;if(E)if(T)X+=F+`
|
|
31
|
+
`;else{let f=R.redexOf(X,new RegExp(`^\\s*
|
|
32
|
+
$`,"m"),P);X=R.strSplice(X,f,0,F)}else X+=F;return}let q=null,O=null;if(E)q=R.redexOf(X.slice(0,z),R.REGEXP.IniGroups,-1),O=q==P?G:X.slice(q+1,X.slice(q,z).indexOf("]")+q);let N=X.indexOf("=",z)+1,x=R.getMatchAllIndexes(X.slice(N).matchAll(/(?<!\\)[#\n;]/g))?.[0]??-1;if(x==-1)x=X.length;else x+=N;let w=X[x]===`
|
|
33
|
+
`?x:X.indexOf(`
|
|
34
|
+
`,x+1);if(Q(N,x))x=Z(N);if(O&&O!==G){let F=X.slice(z,w+1),f=w-z,j=N-z,S=x-z;if(X=R.strSplice(X,z,f+1,""),P>z)P-=f;else P++;z=P+G.length+2,N=z+j,x=z+S,X=R.strSplice(X,z,0,F)}X=R.strSplice(X,N,x-N,(L?"":" ")+V);{let F=0;while(X[N+(F-2)]==" ")F--;if(L&&F<0)X=R.strSplice(X,N+F-1,-F,"");else if(!L&&F!==-1)X=R.strSplice(X,N+F-1,-F," ")}}function Z(B){let Y=0,G=B,U=!1;do{if(G++,U){if(X[G]=='"'&&X[G-1]!="\\")U=!1;continue}if(X[G]=='"'){U=!0;continue}if(X[G]=="{"||X[G]=="[")Y++;if(X[G]=="}"||X[G]=="]")Y--}while(Y&&W.True);if(W.True==!1)throw Error(`failed to write config
|
|
35
|
+
Reason: loop limit reached`);return G+1}function Q(B,Y){return/^[\t ]*[[{]/.test(X.slice(B,Y))}},strJustify(H,$,A={}){let{filler:L=" ",align:D="center",overflow:I="hidden",collapseLocation:E="end",redundancyLv:K=0}=A,M=H instanceof Array,W=M?H.join(""):H,X=R.ex_length(W,K);if(X>$){if(I=="collapse")return R.strLimit(W,$,E);if(I=="hidden")return W.slice(0,$);return W}switch(D){case"spacebetween":if(M){let J=L.repeat(($-X)/(H.length-1));return H.reduce((Z,Q,B)=>{if(B==0)return Z;return Z+J+Q},H[0])}default:case"center":return R.strSurround(W,L,$);case"right":return R.padStart(W,$,L);case"left":return R.padEnd(W,$,L)}},strLimit(H,$,A="mid"){let L=R.ex_length(H);if(L<=$)return H;let D=L-(L-$)-3;switch(A){default:if(xD)process?.emitWarning(`'${A}' is not a valid location type.`);else throw Error(`'${A}' is not a valid location type.`);case"mid":{let I=D>>1;return R.strSlice(H,0,I)+"..."+R.strSlice(H,L-I+1)}case"end":return R.strSlice(H,0,D)+"...";case"start":return"..."+R.strSlice(H,L-D)}},strSlice(H,$,A,L=0){let D=[...H.matchAll(R.REGEXP.ANSICode)].map((K)=>{return{start:K.index,end:K.index+K[0].length,length:K[0].length}});if(!A)A=R.ex_length(H,L);let I=0,E=0;for(let K=0;K<D.length;K++){if(D[K].start-I<$)I+=D[K].length;if(D[K].start-E<=A)E+=D[K].length;if(D[K].start-E>A)break}return H.slice($+I,A+E)},strSplice(H,$,A,L=null){if(A<0)A=0;if($<H.length*-1)$=0;if(L)return H.slice(0,$)+L+($<0&&A+$>=0?"":H.slice($+A));else return H.slice(0,$)+($<0&&A+$>=0?"":H.slice($+A))},strSurround(H,$,A,L=0){let D=R.ex_length(H,L),I=Math.ceil(A/2-D/2);return R.padEnd(" ",I,$,L)+R.padEnd(H,A/2+D/2,$,L)},strWrap(H,$,A={}){if(!H)return"";let{indent:L="",firstIndent:D="",mode:I="softboundery",redundancyLv:E=0}=A,K="",M=R.REGEXP.SoftWrapSeperators,W=R.REGEXP.HardWrapSeperators,X=$*0.67;if(typeof D=="number")D="".padEnd(D," ");if(typeof L=="number")L="".padEnd(L," ");let J=0;for(let Q of H.split(`
|
|
36
|
+
`)){let B=R.getMatchAllIndexes(Q.matchAll(M));while(R.ex_length(Q,E)>$){let Y=B.map((U)=>U-J).filter((U)=>U>=X),G=Y[0]??-1;if(L!=null)if(D!=null)K+=D,D=null;else K+=L;if(I=="softboundery")if(G==-1){let U=R.getMatchAllIndexes(Q.matchAll(W)).filter((V)=>V>=X);G=Z(U,0)??$}else G=Z(Y,0);else G=G>$||G==-1?$:G;G++,K+=Q.substring(0,G).concat(`
|
|
37
|
+
`),Q=Q.substring(G),J+=G}if(L!=null)if(D!=null)K+=D,D=null;else K+=L;K+=Q.concat(`
|
|
38
|
+
`)}return K;function Z(Q,B){if(!Q[B+1])return Q[B];if(Q[B+1]-Q[B]>1)return Q[B];return Z(Q,B+1)}},supportsColor(H=process?.stdout){if(!xD)return 3;if(R.CheckCache.forceColor===!1)return 0;if(R.argvHasFlag("color=16m")||R.argvHasFlag("color=full")||R.argvHasFlag("color=truecolor"))return 3;if(R.argvHasFlag("color=256"))return 2;if(H&&!H.isTTY&&R.CheckCache.forceColor!==!0)return 0;let $=R.CheckCache.forceColor?1:0;if(process.platform==="win32"){if(!R._modules.os)R._modules.os=Rc("os");let L=R._modules.os.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(L[0])>=10&&Number(L[2])>=10586)return Number(L[2])>=14931?3:2;return 1}let{env:A}=process;if("CI"in A){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((L)=>(L in A))||A.CI_NAME==="codeship")return 1;return $}if("TEAMCITY_VERSION"in A)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(A.TEAMCITY_VERSION)?1:0;if(A.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in A){let L=parseInt((A.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(A.TERM_PROGRAM){case"iTerm.app":return L>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(A.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(A.TERM))return 1;if("COLORTERM"in A)return 1;if(A.TERM==="dumb")return $;return $},supportsHyperlink(H=process?.stdout,$=!1){if(!xD)return!0;if($)console.log("Terminal Support Hyperlink Test: (result of last check is the test result)");if($)console.log(`1. has process.env: ${!!process.env}`);let{env:A}=process;if(!A)return!1;if($)console.log(`2. force hyperlink: ${!!A.FORCE_HYPERLINK&&!(A.FORCE_HYPERLINK.length>0&&parseInt(A.FORCE_HYPERLINK,10)===0)}`);if("FORCE_HYPERLINK"in A)return!(A.FORCE_HYPERLINK.length>0&&parseInt(A.FORCE_HYPERLINK,10)===0);if($)console.log(`3. hyperlink disable: ${R.argvHasFlag("no-hyperlink")||R.argvHasFlag("no-hyperlinks")||R.argvHasFlag("hyperlink=false")||R.argvHasFlag("hyperlink=never")}`);if(R.argvHasFlag("no-hyperlink")||R.argvHasFlag("no-hyperlinks")||R.argvHasFlag("hyperlink=false")||R.argvHasFlag("hyperlink=never"))return!1;if($)console.log(`4. has hyperlink enable: ${R.argvHasFlag("hyperlink=true")||R.argvHasFlag("hyperlink=always")}`);if(R.argvHasFlag("hyperlink=true")||R.argvHasFlag("hyperlink=always"))return!0;if($)console.log(`5. ran on Netlify: ${"NETLIFY"in A}`);if("NETLIFY"in A)return!0;if($)console.log(`6. supports color: ${R.CheckCache.supportsColor>0}`);if(R.CheckCache.supportsColor>0)return!0;if($)console.log(`7. in TTY stream: ${!(H&&!H.isTTY)}`);if(H&&!H.isTTY)return!1;if($)console.log(`8. platform is win32: ${process.platform==="win32"}`);if(process.platform==="win32")return!1;if($)console.log(`9. is CI: ${"CI"in A}`);if("CI"in A)return!1;if($)console.log(`10. no TEAMCITY_VERSION: ${!("TEAMCITY_VERSION"in A)}`);if("TEAMCITY_VERSION"in A)return!1;if($)console.log("11. valid TERM_PROGRAM: (multiple check)");if("TERM_PROGRAM"in A){let D=L(A.TERM_PROGRAM_VERSION);switch(A.TERM_PROGRAM){case"iTerm.app":if(D.major===3)return D.minor>=1;return D.major>3;case"WezTerm":return D.major>=20200620;case"vscode":return D.major>1||D.major===1&&D.minor>=72}}if($)console.log("11. valid VTE_VERSION: (multiple check)");if("VTE_VERSION"in A){if(A.VTE_VERSION==="0.50.0")return!1;let D=L(A.VTE_VERSION);return D.major>0||D.minor>=50}if($)console.log("12. Final: failed");return!1;function L(D){if(/^\d{3,4}$/.test(D)){let E=/(\d{1,2})(\d{2})/.exec(D);return{major:0,minor:parseInt(E[1],10),patch:parseInt(E[2],10)}}let I=(D||"").split(".").map((E)=>parseInt(E,10));return{major:I[0],minor:I[1],patch:I[2]}}},surroundedBy(H,$,A){if($<0)return!1;let L=-1/0,D=1/0,I=H=="{"||H=="["||H=="("||H=="<";for(let K=$;K>0;K-=2){let M=A.lastIndexOf(H,K);if(M==-1)break;else L=M;if(A[L-1]=="\\")L=-1/0}for(let K=0;K<A.length;K+=2){let M=A.indexOf(I?E(H):H,K);if(M==-1)break;else D=M;if(A[D-1]=="\\")D=1/0}if(L==-1/0||D==1/0)return!1;return L<$&&D>$;function E(K){return String.fromCharCode(K.charCodeAt(0)+(K[0]=="("?1:2))}},Timer:class H{time;resolution;isRunning=!1;maxTime;#H;#$;#A=0;#L;#I;constructor($,A="ms"){switch(this.maxTime=this.time=$,this.resolution=A,A){case"ms":this.#H=1;break;case"s":this.#H=1000;break;case"m":this.#H=60000;break}}start(){if(this.isRunning||this.time<=0)return;return this.isRunning=!0,this.#A=Date.now(),this.#$=setInterval(this.#D,this.#H==1?4:this.#H/100),this}stop(){if(!this.isRunning)return;return clearInterval(this.#$),this.isRunning=!1,this.reset()}pause(){if(!this.isRunning)return;clearInterval(this.#$),this.isRunning=!1;return}reset(){return this.time=this.maxTime,this}async wait(){if(!this.isRunning)return;return new Promise(($)=>{this.#I=()=>{this.#I=null,$()}})}onceEnd($){return this.#L=$,this}#D=()=>{let $=Date.now(),A=($-this.#A)/this.#H;if(this.time-=A,this.#A=$,this.time>0)return;if(this.stop(),this.time=0,this.#L)this.#L(),this.#L=null;if(this.#I)this.#I()}},toPlace(H){switch(H){case 1:return"1st";case 2:return"2nd";case 3:return"3rd";default:return H+"th"}},toShortNum(H,$=2,A=1000,L=!1,D=-Number.MAX_SAFE_INTEGER,I=Number.MAX_SAFE_INTEGER){if(H===0)return"0";let E=Math.abs(H),K=Math.sign(H),M=E>0&&E<1,W=R.MathKit.clamp(Math.floor(Math.log(E)/Math.log(A)),D,I);H=H/Math.pow(A,W)*K;let X=R.maxFraction(H,$,L),Z={"4":"T","2":"M","3":"G","1":"k","0":"","-1":"m","-2":"μ","-3":"n","-4":"p"}[W]??`e${M?"":"+"}${W*3}`;return X+Z},Tracer:class H{liveLog=!0;log="";startTime;enableLogging=!1;recursive=!1;constructor(){this.startTime=new Date}createTracker=function($,A,L){let D=(I,E)=>{let K=I.length;if(K<=E)return I;let W=K-(K-E)-3>>1;return I.slice(0,W)+"..."+I.slice(K-W+1)};return function(){if(!L.enableLogging)return $.apply(this,arguments);let I=$.apply(this,arguments)??"void",E="["+R.jsTime.howLong(L.startTime)+"] "+A+"(";for(let K=0;K<arguments.length;K++){if(K>0)E+=", ";let M=R.yuString(arguments[K]);E+=M.trim().length?D(M,70):`"${M}"`}if(I==="void")E+=")";else E+="): "+D(R.yuString(I),70);if(L.log+=E+`
|
|
39
|
+
`,L.liveLog)console.log(E);return I==="void"?void 0:I}};attachTracer($,A=""){if(A.length>100)return this;if(typeof $!=="object")return this;for(let L of Object.getOwnPropertyNames($)){let D=$[L];if(Object.prototype.toString.call(D)==="[object Function]"){if(!R.isClass(D))$[L]=this.createTracker(D,A+L,this);if(this.recursive&&R.propertiesCount(D)>0)for(let I of Object.getOwnPropertyNames(D)){let E=D[I];return this.attachTracer(E,A+L+".")}}}return this}},writeConfig(H,$,A={}){if(!R._modules.fs)throw Error('fs module is required for Tools.writeConfig()\nimport them with `Tools._modules.fs = require("fs")`');let{ignoreList:L=[],minify:D=!1,replacer:I,mode:E="merge",useIniGroup:K=!1,alwaysWrapStrInQuotes:M=!1}=A,W="";if(R._modules.fs.existsSync($)&&E=="merge")W=R._modules.fs.readFileSync($,{encoding:"utf-8"});W=R.stringifyConfig(H,{ignoreList:L,minify:D,replacer:I,mode:E,useIniGroup:K,alwaysWrapStrInQuotes:M,oldConfigStr:W}),R._modules.fs.writeFileSync($,W,{encoding:"utf-8"})},yuString(H,$={}){let{color:A=!1,defColor:L=void 0}=$;switch(typeof H){case"string":if(A)return R.ncc("Green")+`"${H}"`+R.ncc(L);return`"${H}"`;case"bigint":case"number":if(A)return R.ncc(12730667)+H+R.ncc(L);case"boolean":case"undefined":if(A)return R.ncc(13136006)+H+R.ncc(L);return H+"";case"function":if(A)return(R.isAsyncFunction(H)?R.ncc(4802889)+"async ":"")+(R.isArrowFunction(H)?R.ncc(13401911)+(H.name||R.ncc(4802889)+"[anonymous]"+R.ncc(13401911))+" () => {...}":R.ncc(13401911)+(H.name||R.ncc(4802889)+"[anonymous]"+R.ncc(13401911))+"()")+R.ncc(L);return(R.isAsyncFunction(H)?"async ":"")+(R.isArrowFunction(H)?(H.name||"[anonymous]")+" () => {...}":(H.name||"[anonymous]")+"()");case"symbol":if(A)return R.ncc(13401911)+H.toString()+R.ncc(L);return H.toString()}if(H==null){if(A)return R.ncc(13136006)+H+R.ncc(L);return H+""}if(H instanceof Date){if(A)return R.ncc(11550650)+"Date"+R.ncc(L)+" "+H.toISOString();return"Date "+H.toISOString()}if(H instanceof RegExp){if(A)return R.ncc("Yellow")+H.toString()+R.ncc(L);return H.toString()}if(H instanceof Promise)return R.ncc(11550650)+"Promise"+R.ncc(L)+" {...(pending)}";if(H instanceof Map){let D=[...H.entries()];return(A?R.ncc(11550650)+`Map(${H.size}) {`+R.ncc(L):`Map(${H.size}) {`)+R.arrToString(D,{color:A,defColor:L,noHeader:!0})+"}"}if(H instanceof Set){let D=[...H.values()];return(A?R.ncc(11550650)+`Set(${H.size}) {`+R.ncc(L):`Set(${H.size}) {`)+R.arrToString(D,{color:A,defColor:L,noHeader:!0})+"}"}if(R.isError(H))return R.Err.toString(H,{color:A,defColor:L});try{if(typeof H==="object"){if(R.isArrayLike(H))return R.arrToString(H,{color:A,defColor:L});return R.objToString(H,{color:A,defColor:L})}}catch{}return"[unknown]"}};if(typeof window<"u")window._tools=R;({arrFindLast:eCH,arrToString:BC,argvHasFlag:HzH,asyncSleep:$zH,beautifyJson:AzH,beforeExit:LzH,changeDateTimezone:DzH,charTypeAt:IzH,CheckCache:vI,cleanArr:EzH,cleanComments:KzH,cleanString:MzH,CONSTS:XzH,Convert:WzH,ConsoleTime:QzH,compareDate:BzH,DataScienceKit:JzH,deferredFunc:ZzH,digitAt:YzH,digitAtRange:GzH,getDimensions:UzH,Err:m$,escapeRegExp:VzH,ex_length:CzH,fileNameCleaner:zzH,fixFilePath:PzH,fixYTurl:qzH,fileTypeOf:TzH,getMatchAllIndexes:_zH,getMatchAllResults:NzH,getRandomInt:FzH,getProcessTime:OzH,hyperLink:r9,IDGenerator:wzH,includesWord:RzH,IPC:jzH,isArrayLike:SzH,isArrowFunction:xzH,isAsyncFunction:kzH,isClass:yzH,isNumber:fzH,isEmptyArray:vzH,isEmptyObject:bzH,isError:JC,isValidFilePath:hzH,JSONReplacer:uzH,JSONReviver:gzH,jsTime:mzH,lazySplit:dzH,remap:ZC,MathKit:_$,maxFraction:YC,ncc:C,nearestNumber:pzH,objectMap:czH,objValueAt:lzH,objToString:izH,propertiesCount:nzH,padEnd:GC,padStart:azH,parseArgs:tzH,parseBool:ozH,parseConfig:szH,parseValue:rzH,pass:ezH,Progress:HPH,proximate:$PH,randomPick:APH,redexOf:LPH,REGEXP:DPH,resolveNodeEnv:IPH,SafeTrue:EPH,search:KPH,sleep:MPH,SpawnMirror:XPH,strClamp:yD,stringifyConfig:WPH,strJustify:UC,strLimit:QPH,strSlice:BPH,strSplice:JPH,strSurround:ZPH,strWrap:RH,supportsColor:YPH,supportsHyperlink:GPH,surroundedBy:UPH,Timer:VPH,toPlace:CPH,toShortNum:mA,Tracer:zPH,writeConfig:PPH,yuString:iH}=R)});function hc(H,$){let A=H.slice(0,$).split(/\r\n|\n|\r/g);return[A.length,A.pop().length+1]}function uc(H,$,A){let L=H.split(/\r\n|\n|\r/g),D="",I=(Math.log10($+1)|0)+1;for(let E=$-1;E<=$+1;E++){let K=L[E-1];if(!K)continue;if(D+=E.toString().padEnd(I," "),D+=": ",D+=K,D+=`
|
|
40
|
+
`,E===$)D+=" ".repeat(I+A+2),D+=`^
|
|
41
|
+
`}return D}var GH;var P0=y(()=>{/*!
|
|
42
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
43
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
44
|
+
*
|
|
45
|
+
* Redistribution and use in source and binary forms, with or without
|
|
46
|
+
* modification, are permitted provided that the following conditions are met:
|
|
47
|
+
*
|
|
48
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
49
|
+
* list of conditions and the following disclaimer.
|
|
50
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
51
|
+
* this list of conditions and the following disclaimer in the
|
|
52
|
+
* documentation and/or other materials provided with the distribution.
|
|
53
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
54
|
+
* may be used to endorse or promote products derived from this software without
|
|
55
|
+
* specific prior written permission.
|
|
56
|
+
*
|
|
57
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
58
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
59
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
60
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
61
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
62
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
63
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
64
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
65
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
66
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
67
|
+
*/GH=class GH extends Error{line;column;codeblock;constructor(H,$){let[A,L]=hc($.toml,$.ptr),D=uc($.toml,A,L);super(`Invalid TOML document: ${H}
|
|
68
|
+
|
|
69
|
+
${D}`,$);this.line=A,this.column=L,this.codeblock=D}}});function gc(H,$){let A=0;while(H[$-++A]==="\\");return--A&&A%2}function bD(H,$=0,A=H.length){let L=H.indexOf(`
|
|
70
|
+
`,$);if(H[L-1]==="\r")L--;return L<=A?L:-1}function gI(H,$){for(let A=$;A<H.length;A++){let L=H[A];if(L===`
|
|
71
|
+
`)return A;if(L==="\r"&&H[A+1]===`
|
|
72
|
+
`)return A+1;if(L<" "&&L!=="\t"||L==="")throw new GH("control characters are not allowed in comments",{toml:H,ptr:$})}return H.length}function R$(H,$,A,L){let D;while((D=H[$])===" "||D==="\t"||!A&&(D===`
|
|
73
|
+
`||D==="\r"&&H[$+1]===`
|
|
74
|
+
`))$++;return L||D!=="#"?$:R$(H,gI(H,$),A)}function RQ(H,$,A,L,D=!1){if(!L)return $=bD(H,$),$<0?H.length:$;for(let I=$;I<H.length;I++){let E=H[I];if(E==="#")I=bD(H,I);else if(E===A)return I+1;else if(E===L||D&&(E===`
|
|
75
|
+
`||E==="\r"&&H[I+1]===`
|
|
76
|
+
`))return I}throw new GH("cannot find end of structure",{toml:H,ptr:$})}function $K(H,$){let A=H[$],L=A===H[$+1]&&H[$+1]===H[$+2]?H.slice($,$+3):A;$+=L.length-1;do $=H.indexOf(L,++$);while($>-1&&A!=="'"&&gc(H,$));if($>-1){if($+=L.length,L.length>1){if(H[$]===A)$++;if(H[$]===A)$++}}return $}var mI=y(()=>{P0();/*!
|
|
77
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
78
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
79
|
+
*
|
|
80
|
+
* Redistribution and use in source and binary forms, with or without
|
|
81
|
+
* modification, are permitted provided that the following conditions are met:
|
|
82
|
+
*
|
|
83
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
84
|
+
* list of conditions and the following disclaimer.
|
|
85
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
86
|
+
* this list of conditions and the following disclaimer in the
|
|
87
|
+
* documentation and/or other materials provided with the distribution.
|
|
88
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
89
|
+
* may be used to endorse or promote products derived from this software without
|
|
90
|
+
* specific prior written permission.
|
|
91
|
+
*
|
|
92
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
93
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
94
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
95
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
96
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
97
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
98
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
99
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
100
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
101
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
102
|
+
*/});var mc,VL;var jQ=y(()=>{/*!
|
|
103
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
104
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
105
|
+
*
|
|
106
|
+
* Redistribution and use in source and binary forms, with or without
|
|
107
|
+
* modification, are permitted provided that the following conditions are met:
|
|
108
|
+
*
|
|
109
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
110
|
+
* list of conditions and the following disclaimer.
|
|
111
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
112
|
+
* this list of conditions and the following disclaimer in the
|
|
113
|
+
* documentation and/or other materials provided with the distribution.
|
|
114
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
115
|
+
* may be used to endorse or promote products derived from this software without
|
|
116
|
+
* specific prior written permission.
|
|
117
|
+
*
|
|
118
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
119
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
120
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
121
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
122
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
123
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
124
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
125
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
126
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
127
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
128
|
+
*/mc=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}:\d{2}(?:\.\d+)?)?(Z|[-+]\d{2}:\d{2})?$/i;VL=class VL extends Date{#H=!1;#$=!1;#A=null;constructor(H){let $=!0,A=!0,L="Z";if(typeof H==="string"){let D=H.match(mc);if(D){if(!D[1])$=!1,H=`0000-01-01T${H}`;if(A=!!D[2],A&&H[10]===" "&&(H=H.replace(" ","T")),D[2]&&+D[2]>23)H="";else if(L=D[3]||null,H=H.toUpperCase(),!L&&A)H+="Z"}else H=""}super(H);if(!isNaN(this.getTime()))this.#H=$,this.#$=A,this.#A=L}isDateTime(){return this.#H&&this.#$}isLocal(){return!this.#H||!this.#$||!this.#A}isDate(){return this.#H&&!this.#$}isTime(){return this.#$&&!this.#H}isValid(){return this.#H||this.#$}toISOString(){let H=super.toISOString();if(this.isDate())return H.slice(0,10);if(this.isTime())return H.slice(11,23);if(this.#A===null)return H.slice(0,-1);if(this.#A==="Z")return H;let $=+this.#A.slice(1,3)*60+ +this.#A.slice(4,6);return $=this.#A[0]==="-"?$:-$,new Date(this.getTime()-$*60000).toISOString().slice(0,-1)+this.#A}static wrapAsOffsetDateTime(H,$="Z"){let A=new VL(H);return A.#A=$,A}static wrapAsLocalDateTime(H){let $=new VL(H);return $.#A=null,$}static wrapAsLocalDate(H){let $=new VL(H);return $.#$=!1,$.#A=null,$}static wrapAsLocalTime(H){let $=new VL(H);return $.#H=!1,$.#A=null,$}}});function AK(H,$=0,A=H.length){let L=H[$]==="'",D=H[$++]===H[$]&&H[$]===H[$+1];if(D){if(A-=2,H[$+=2]==="\r")$++;if(H[$]===`
|
|
129
|
+
`)$++}let I=0,E,K="",M=$;while($<A-1){let W=H[$++];if(W===`
|
|
130
|
+
`||W==="\r"&&H[$]===`
|
|
131
|
+
`){if(!D)throw new GH("newlines are not allowed in strings",{toml:H,ptr:$-1})}else if(W<" "&&W!=="\t"||W==="")throw new GH("control characters are not allowed in strings",{toml:H,ptr:$-1});if(E){if(E=!1,W==="u"||W==="U"){let X=H.slice($,$+=W==="u"?4:8);if(!lc.test(X))throw new GH("invalid unicode escape",{toml:H,ptr:I});try{K+=String.fromCodePoint(parseInt(X,16))}catch{throw new GH("invalid unicode escape",{toml:H,ptr:I})}}else if(D&&(W===`
|
|
132
|
+
`||W===" "||W==="\t"||W==="\r")){if($=R$(H,$-1,!0),H[$]!==`
|
|
133
|
+
`&&H[$]!=="\r")throw new GH("invalid escape: only line-ending whitespace may be escaped",{toml:H,ptr:I});$=R$(H,$)}else if(W in SC)K+=SC[W];else throw new GH("unrecognized escape sequence",{toml:H,ptr:I});M=$}else if(!L&&W==="\\")I=$-1,E=!0,K+=H.slice(M,I)}return K+H.slice(M,A-1)}function xC(H,$,A,L){if(H==="true")return!0;if(H==="false")return!1;if(H==="-inf")return-1/0;if(H==="inf"||H==="+inf")return 1/0;if(H==="nan"||H==="+nan"||H==="-nan")return NaN;if(H==="-0")return L?0n:0;let D=dc.test(H);if(D||pc.test(H)){if(cc.test(H))throw new GH("leading zeroes are not allowed",{toml:$,ptr:A});H=H.replace(/_/g,"");let E=+H;if(isNaN(E))throw new GH("invalid number",{toml:$,ptr:A});if(D){if((D=!Number.isSafeInteger(E))&&!L)throw new GH("integer value cannot be represented losslessly",{toml:$,ptr:A});if(D||L===!0)E=BigInt(H)}return E}let I=new VL(H);if(!I.isValid())throw new GH("invalid value",{toml:$,ptr:A});return I}var dc,pc,cc,lc,SC;var SQ=y(()=>{mI();jQ();P0();/*!
|
|
134
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
135
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
136
|
+
*
|
|
137
|
+
* Redistribution and use in source and binary forms, with or without
|
|
138
|
+
* modification, are permitted provided that the following conditions are met:
|
|
139
|
+
*
|
|
140
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
141
|
+
* list of conditions and the following disclaimer.
|
|
142
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
143
|
+
* this list of conditions and the following disclaimer in the
|
|
144
|
+
* documentation and/or other materials provided with the distribution.
|
|
145
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
146
|
+
* may be used to endorse or promote products derived from this software without
|
|
147
|
+
* specific prior written permission.
|
|
148
|
+
*
|
|
149
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
150
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
151
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
152
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
153
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
154
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
155
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
156
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
157
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
158
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
159
|
+
*/dc=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,pc=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,cc=/^[+-]?0[0-9_]/,lc=/^[0-9a-f]{4,8}$/i,SC={b:"\b",t:"\t",n:`
|
|
160
|
+
`,f:"\f",r:"\r",'"':'"',"\\":"\\"}});function ic(H,$,A,L){let D=H.slice($,A),I=D.indexOf("#");if(I>-1)gI(H,I),D=D.slice(0,I);let E=D.trimEnd();if(!L){let K=D.indexOf(`
|
|
161
|
+
`,E.length);if(K>-1)throw new GH("newlines are not allowed in inline tables",{toml:H,ptr:$+K})}return[E,I]}function dI(H,$,A,L,D){if(L===0)throw new GH("document contains excessively nested structures. aborting.",{toml:H,ptr:$});let I=H[$];if(I==="["||I==="{"){let[M,W]=I==="["?yC(H,$,L,D):kC(H,$,L,D),X=A?RQ(H,W,",",A):W;if(W-X&&A==="}"){let J=bD(H,W,X);if(J>-1)throw new GH("newlines are not allowed in inline tables",{toml:H,ptr:J})}return[M,X]}let E;if(I==='"'||I==="'"){E=$K(H,$);let M=AK(H,$,E);if(A){if(E=R$(H,E,A!=="]"),H[E]&&H[E]!==","&&H[E]!==A&&H[E]!==`
|
|
162
|
+
`&&H[E]!=="\r")throw new GH("unexpected character encountered",{toml:H,ptr:E});E+=+(H[E]===",")}return[M,E]}E=RQ(H,$,",",A);let K=ic(H,$,E-+(H[E-1]===","),A==="]");if(!K[0])throw new GH("incomplete key-value declaration: no value specified",{toml:H,ptr:$});if(A&&K[1]>-1)E=R$(H,$+K[1]),E+=+(H[E]===",");return[xC(K[0],H,$,D),E]}var xQ=y(()=>{SQ();kQ();mI();P0();/*!
|
|
163
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
164
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
165
|
+
*
|
|
166
|
+
* Redistribution and use in source and binary forms, with or without
|
|
167
|
+
* modification, are permitted provided that the following conditions are met:
|
|
168
|
+
*
|
|
169
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
170
|
+
* list of conditions and the following disclaimer.
|
|
171
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
172
|
+
* this list of conditions and the following disclaimer in the
|
|
173
|
+
* documentation and/or other materials provided with the distribution.
|
|
174
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
175
|
+
* may be used to endorse or promote products derived from this software without
|
|
176
|
+
* specific prior written permission.
|
|
177
|
+
*
|
|
178
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
179
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
180
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
181
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
182
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
183
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
184
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
185
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
186
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
187
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
188
|
+
*/});function LK(H,$,A="="){let L=$-1,D=[],I=H.indexOf(A,$);if(I<0)throw new GH("incomplete key-value: cannot find end of key",{toml:H,ptr:$});do{let E=H[$=++L];if(E!==" "&&E!=="\t")if(E==='"'||E==="'"){if(E===H[$+1]&&E===H[$+2])throw new GH("multiline strings are not allowed in keys",{toml:H,ptr:$});let K=$K(H,$);if(K<0)throw new GH("unfinished string encountered",{toml:H,ptr:$});L=H.indexOf(".",K);let M=H.slice(K,L<0||L>I?I:L),W=bD(M);if(W>-1)throw new GH("newlines are not allowed in keys",{toml:H,ptr:$+L+W});if(M.trimStart())throw new GH("found extra tokens after the string part",{toml:H,ptr:K});if(I<K){if(I=H.indexOf(A,K),I<0)throw new GH("incomplete key-value: cannot find end of key",{toml:H,ptr:$})}D.push(AK(H,$,K))}else{L=H.indexOf(".",$);let K=H.slice($,L<0||L>I?I:L);if(!nc.test(K))throw new GH("only letter, numbers, dashes and underscores are allowed in keys",{toml:H,ptr:$});D.push(K.trimEnd())}}while(L+1&&L<I);return[D,R$(H,I+1,!0,!0)]}function kC(H,$,A,L){let D={},I=new Set,E,K=0;$++;while((E=H[$++])!=="}"&&E){let M={toml:H,ptr:$-1};if(E===`
|
|
189
|
+
`)throw new GH("newlines are not allowed in inline tables",M);else if(E==="#")throw new GH("inline tables cannot contain comments",M);else if(E===",")throw new GH("expected key-value, found comma",M);else if(E!==" "&&E!=="\t"){let W,X=D,J=!1,[Z,Q]=LK(H,$-1);for(let G=0;G<Z.length;G++){if(G)X=J?X[W]:X[W]={};if(W=Z[G],(J=Object.hasOwn(X,W))&&(typeof X[W]!=="object"||I.has(X[W])))throw new GH("trying to redefine an already defined value",{toml:H,ptr:$});if(!J&&W==="__proto__")Object.defineProperty(X,W,{enumerable:!0,configurable:!0,writable:!0})}if(J)throw new GH("trying to redefine an already defined value",{toml:H,ptr:$});let[B,Y]=dI(H,Q,"}",A-1,L);I.add(B),X[W]=B,$=Y,K=H[$-1]===","?$-1:0}}if(K)throw new GH("trailing commas are not allowed in inline tables",{toml:H,ptr:K});if(!E)throw new GH("unfinished table encountered",{toml:H,ptr:$});return[D,$]}function yC(H,$,A,L){let D=[],I;$++;while((I=H[$++])!=="]"&&I)if(I===",")throw new GH("expected value, found comma",{toml:H,ptr:$-1});else if(I==="#")$=gI(H,$);else if(I!==" "&&I!=="\t"&&I!==`
|
|
190
|
+
`&&I!=="\r"){let E=dI(H,$-1,"]",A-1,L);D.push(E[0]),$=E[1]}if(!I)throw new GH("unfinished array encountered",{toml:H,ptr:$});return[D,$]}var nc;var kQ=y(()=>{SQ();xQ();mI();P0();/*!
|
|
191
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
192
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
193
|
+
*
|
|
194
|
+
* Redistribution and use in source and binary forms, with or without
|
|
195
|
+
* modification, are permitted provided that the following conditions are met:
|
|
196
|
+
*
|
|
197
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
198
|
+
* list of conditions and the following disclaimer.
|
|
199
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
200
|
+
* this list of conditions and the following disclaimer in the
|
|
201
|
+
* documentation and/or other materials provided with the distribution.
|
|
202
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
203
|
+
* may be used to endorse or promote products derived from this software without
|
|
204
|
+
* specific prior written permission.
|
|
205
|
+
*
|
|
206
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
207
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
208
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
209
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
210
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
211
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
212
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
213
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
214
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
215
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
216
|
+
*/nc=/^[a-zA-Z0-9-_]+[ \t]*$/});function fC(H,$,A,L){let D=$,I=A,E,K=!1,M;for(let W=0;W<H.length;W++){if(W){if(D=K?D[E]:D[E]={},I=(M=I[E]).c,L===0&&(M.t===1||M.t===2))return null;if(M.t===2){let X=D.length-1;D=D[X],I=I[X].c}}if(E=H[W],(K=Object.hasOwn(D,E))&&I[E]?.t===0&&I[E]?.d)return null;if(!K){if(E==="__proto__")Object.defineProperty(D,E,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(I,E,{enumerable:!0,configurable:!0,writable:!0});I[E]={t:W<H.length-1&&L===2?3:L,d:!1,i:0,c:{}}}}if(M=I[E],M.t!==L&&!(L===1&&M.t===3))return null;if(L===2){if(!M.d)M.d=!0,D[E]=[];D[E].push(D={}),M.c[M.i++]=M={t:1,d:!1,i:0,c:{}}}if(M.d)return null;if(M.d=!0,L===1)D=K?D[E]:D[E]={};else if(L===0&&K)return null;return[E,D,M.c]}function pI(H,{maxDepth:$=1000,integersAsBigInt:A}={}){let L={},D={},I=L,E=D;for(let K=R$(H,0);K<H.length;){if(H[K]==="["){let M=H[++K]==="[",W=LK(H,K+=+M,"]");if(M){if(H[W[1]-1]!=="]")throw new GH("expected end of table declaration",{toml:H,ptr:W[1]-1});W[1]++}let X=fC(W[0],L,D,M?2:1);if(!X)throw new GH("trying to redefine an already defined table or value",{toml:H,ptr:K});E=X[2],I=X[1],K=W[1]}else{let M=LK(H,K),W=fC(M[0],I,E,0);if(!W)throw new GH("trying to redefine an already defined table or value",{toml:H,ptr:K});let X=dI(H,M[1],void 0,$,A);W[1][W[0]]=X[0],K=X[1]}if(K=R$(H,K,!0),H[K]&&H[K]!==`
|
|
217
|
+
`&&H[K]!=="\r")throw new GH("each key-value declaration must be followed by an end-of-line",{toml:H,ptr:K});K=R$(H,K)}return L}var vC=y(()=>{kQ();xQ();mI();P0();/*!
|
|
218
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
219
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
220
|
+
*
|
|
221
|
+
* Redistribution and use in source and binary forms, with or without
|
|
222
|
+
* modification, are permitted provided that the following conditions are met:
|
|
223
|
+
*
|
|
224
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
225
|
+
* list of conditions and the following disclaimer.
|
|
226
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
227
|
+
* this list of conditions and the following disclaimer in the
|
|
228
|
+
* documentation and/or other materials provided with the distribution.
|
|
229
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
230
|
+
* may be used to endorse or promote products derived from this software without
|
|
231
|
+
* specific prior written permission.
|
|
232
|
+
*
|
|
233
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
234
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
235
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
236
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
237
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
238
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
239
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
240
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
241
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
242
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
243
|
+
*/});function cI(H){let $=typeof H;if($==="object"){if(Array.isArray(H))return"array";if(H instanceof Date)return"date"}return $}function ac(H){for(let $=0;$<H.length;$++)if(cI(H[$])!=="object")return!1;return H.length!=0}function yQ(H){return JSON.stringify(H).replace(/\x7f/g,"\\u007f")}function fQ(H,$,A,L){if(A===0)throw Error("Could not stringify the object: maximum object depth exceeded");if($==="number"){if(isNaN(H))return"nan";if(H===1/0)return"inf";if(H===-1/0)return"-inf";if(L&&Number.isInteger(H))return H.toFixed(1);return H.toString()}if($==="bigint"||$==="boolean")return H.toString();if($==="string")return yQ(H);if($==="date"){if(isNaN(H.getTime()))throw TypeError("cannot serialize invalid date");return H.toISOString()}if($==="object")return tc(H,A,L);if($==="array")return oc(H,A,L)}function tc(H,$,A){let L=Object.keys(H);if(L.length===0)return"{}";let D="{ ";for(let I=0;I<L.length;I++){let E=L[I];if(I)D+=", ";D+=bC.test(E)?E:yQ(E),D+=" = ",D+=fQ(H[E],cI(H[E]),$-1,A)}return D+" }"}function oc(H,$,A){if(H.length===0)return"[]";let L="[ ";for(let D=0;D<H.length;D++){if(D)L+=", ";if(H[D]===null||H[D]===void 0)throw TypeError("arrays cannot contain null or undefined values");L+=fQ(H[D],cI(H[D]),$-1,A)}return L+" ]"}function sc(H,$,A,L){if(A===0)throw Error("Could not stringify the object: maximum object depth exceeded");let D="";for(let I=0;I<H.length;I++)D+=`${D&&`
|
|
244
|
+
`}[[${$}]]
|
|
245
|
+
`,D+=vQ(0,H[I],$,A,L);return D}function vQ(H,$,A,L,D){if(L===0)throw Error("Could not stringify the object: maximum object depth exceeded");let I="",E="",K=Object.keys($);for(let M=0;M<K.length;M++){let W=K[M];if($[W]!==null&&$[W]!==void 0){let X=cI($[W]);if(X==="symbol"||X==="function")throw TypeError(`cannot serialize values of type '${X}'`);let J=bC.test(W)?W:yQ(W);if(X==="array"&&ac($[W]))E+=(E&&`
|
|
246
|
+
`)+sc($[W],A?`${A}.${J}`:J,L-1,D);else if(X==="object"){let Z=A?`${A}.${J}`:J;E+=(E&&`
|
|
247
|
+
`)+vQ(Z,$[W],Z,L-1,D)}else I+=J,I+=" = ",I+=fQ($[W],X,L,D),I+=`
|
|
248
|
+
`}}if(H&&(I||!E))I=I?`[${H}]
|
|
249
|
+
${I}`:`[${H}]`;return I&&E?`${I}
|
|
250
|
+
${E}`:I||E}function lI(H,{maxDepth:$=1000,numbersAsFloat:A=!1}={}){if(cI(H)!=="object")throw TypeError("stringify can only be called with an object");let L=vQ(0,H,"",$,A);if(L[L.length-1]!==`
|
|
251
|
+
`)return L+`
|
|
252
|
+
`;return L}var bC;var hC=y(()=>{/*!
|
|
253
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
254
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
255
|
+
*
|
|
256
|
+
* Redistribution and use in source and binary forms, with or without
|
|
257
|
+
* modification, are permitted provided that the following conditions are met:
|
|
258
|
+
*
|
|
259
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
260
|
+
* list of conditions and the following disclaimer.
|
|
261
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
262
|
+
* this list of conditions and the following disclaimer in the
|
|
263
|
+
* documentation and/or other materials provided with the distribution.
|
|
264
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
265
|
+
* may be used to endorse or promote products derived from this software without
|
|
266
|
+
* specific prior written permission.
|
|
267
|
+
*
|
|
268
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
269
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
270
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
271
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
272
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
273
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
274
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
275
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
276
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
277
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
278
|
+
*/bC=/^[a-z0-9-_]+$/i});var bQ=y(()=>{vC();hC();jQ();P0();/*!
|
|
279
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
280
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
281
|
+
*
|
|
282
|
+
* Redistribution and use in source and binary forms, with or without
|
|
283
|
+
* modification, are permitted provided that the following conditions are met:
|
|
284
|
+
*
|
|
285
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
286
|
+
* list of conditions and the following disclaimer.
|
|
287
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
288
|
+
* this list of conditions and the following disclaimer in the
|
|
289
|
+
* documentation and/or other materials provided with the distribution.
|
|
290
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
291
|
+
* may be used to endorse or promote products derived from this software without
|
|
292
|
+
* specific prior written permission.
|
|
293
|
+
*
|
|
294
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
295
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
296
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
297
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
298
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
299
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
300
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
301
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
302
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
303
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
304
|
+
*/});var uC=n((XqH,rc)=>{rc.exports=ZH("./keytar-hqpjzrak.node")});var mC=n((WqH,gC)=>{var iI=uC();function dA(H,$){if(!H||H.length<=0)throw Error($+" is required.")}gC.exports={getPassword:function(H,$){return dA(H,"Service"),dA($,"Account"),iI.getPassword(H,$)},setPassword:function(H,$,A){return dA(H,"Service"),dA($,"Account"),dA(A,"Password"),iI.setPassword(H,$,A)},deletePassword:function(H,$){return dA(H,"Service"),dA($,"Account"),iI.deletePassword(H,$)},findPassword:function(H){return dA(H,"Service"),iI.findPassword(H)},findCredentials:function(H){return dA(H,"Service"),iI.findCredentials(H)}}});import{format as gi}from"node:util";function tE(H){if(H instanceof Error)return!0;if(!H||typeof H!=="object")return!1;let $=H;return typeof $.name=="string"&&typeof $.message=="string"&&typeof $.stack in mi}function J3(H,$=TP){if(tE(H))return H;return new $(H)}function _P(H,$){if(H===void 0)return;return di(H,$)}async function di(H,$){try{return await H}catch(A){return $(A)}}var mi,TP;var Z3=y(()=>{mi={string:!0,undefined:!0};TP=class TP extends Error{cause;constructor(H){super(gi(H));this.cause=H}}});class NP{name;#H=new Set;constructor(H){this.name=H}on=(H)=>{return this.#H.add(H),{dispose:()=>{this.#H.delete(H)}}};fire(H){let $;for(let A of this.#H)try{A(H)}catch(L){$=$??[],$.push(J3(L))}return $}dispose=()=>{this.#H.clear()}}function tA(H){return pi.on(H)}var jB,pi;var FP=y(()=>{Z3();jB=class jB extends NP{constructor(){super(jB.eventName)}static eventName="clear-cache"};pi=new jB});var oE=y(()=>{FP()});class OP{maxSize;hits=0;misses=0;swaps=0;constructor(H){this.maxSize=H}}function ci(H){return new wP(H)}function sE(H,$=100){let A=ci($),L=D;L.hits=0,L.misses=0,L.swaps=0;function D(I){let E=A.get(I);if(E!==void 0)return++L.hits,E;let K=H(I);return A.set(I,K),L.swaps=A.swaps,++L.misses,K}return L}function rE(H){let{hits:$,misses:A,swaps:L}=H;return{hits:$,misses:A,swaps:L}}var wP;var RP=y(()=>{wP=class wP extends OP{count=0;cache0=new Map;cache1=new Map;constructor(H){super(H)}get(H){let $=this.cache0,A=this.cache1,L=$.get(H);if(L!==void 0)return++this.hits,L;if(L=A.get(H),L!==void 0)return++this.hits,++this.count,$.set(H,L),L;++this.misses;return}set(H,$){if(this.count>=this.maxSize){let A=this.cache1;this.cache1=this.cache0,this.cache0=A,A.clear(),this.swaps++,this.count=0}return++this.count,this.cache0.set(H,$),this}}});function*SB(H){try{let $;while(!($=H.next()).done)yield $.value}catch($){if(H.throw)return H.throw($);throw $}finally{H.return?.()}}var jP=()=>{};function oA(...H){function*$(A){yield*A;for(let L of H)yield*L}return $}var SP=()=>{};function Y3(...H){function $(A){for(let L of H)A=L(A);return A}return $}function E$(H){function $(A){function L(){let D=A[Symbol.iterator](),I=void 0;function E(){while(!0){if(I){let{done:W,value:X}=I.next();if(!W)return{value:X};I=void 0}let{done:K,value:M}=D.next();if(K)return{done:K,value:void 0};I=H(M)[Symbol.iterator]()}}return{next:E}}return{[Symbol.iterator]:L}}return $}var xP=()=>{};function vH(H){function $(A){function L(){let D=A[Symbol.iterator]();function I(){while(!0){let{done:E,value:K}=D.next();if(E)return{done:E,value:void 0};if(H(K))return{value:K}}}return{next:I}}return{[Symbol.iterator]:L}}return $}var kP=()=>{};function V$(){function*H($){for(let A of $)yield*A}return H}var yP=()=>{};function UH(H){function $(A){function L(){let D=A[Symbol.iterator]();function I(){let{done:E,value:K}=D.next();if(E)return{done:E,value:void 0};return{value:H(K)}}return{next:I}}return{[Symbol.iterator]:L}}return $}var fP=()=>{};function eE(H,$){function*A(D,I){for(let E of I)D=H(D,E);yield D}function*L(D){let I=$===void 0?ii(D):{head:$,tail:D};if(!I)return;yield*A(I.head,I.tail)}return L}function ii(H){let $=H[Symbol.iterator](),A=$.next();if(A.done)return;return{head:A.value,tail:SB($)}}var vP=y(()=>{jP()});function G3(H){function $(L){function*D(I){let E=new Set;for(let K of I){let M=L(K);if(E.has(M))continue;E.add(M),yield K}}return D}function*A(L){let D=new Set;for(let I of L){if(D.has(I))continue;D.add(I),yield I}}return H?$(H):A}var bP=()=>{};var iK=y(()=>{SP();xP();kP();yP();fP();vP();bP()});function WH(H,...$){return Y3(...$)(H)}var xB=y(()=>{iK()});function kB(H,$,A){return[...A===void 0?WH(H,eE($)):WH(H,eE($,A))][0]}var hP=y(()=>{iK();xB()});var N$=y(()=>{iK();xB();hP()});function*uP(H){yield*H}function*gP(H,$){for(let A of H)if($(A))yield A}function*mP(H,$){let A=0;for(let L of H){if(A>=$)yield L;A+=1}}function*dP(H,$){let A=0;if($)for(let L of H){if(A>=$)break;yield L,A+=1}}function*pP(H,$){yield*H,yield*$}function*cP(H,$){for(let A of H)yield*$(A)}function*lP(H,$,A){let L=$[Symbol.iterator]();for(let D of H){let I=L.next().value;yield A(D,I)}}function iP(H,$){function*A(L,D){for(let I of L)yield D(I)}return A(H,$)}function*nP(H,$,A){let L=0;if(A===void 0){L=1;let I=H[Symbol.iterator](),E=I.next();if(!E.done)yield E.value;A=E.value,H=yB(I)}let D=A;for(let I of H){let E=$(D,I,L);yield E,D=E,L+=1}}function aP(H,$){for(let A of H)if(!$(A))return!1;return!0}function tP(H,$){for(let A of H)if($(A))return!0;return!1}function oP(H){return H8(H,($)=>$+1,0)}function sP(H,$,A){$=$||(()=>!0);for(let L of H)if($(L))return L;return A}function rP(H,$){let A=0;for(let L of H)$(L,A),A+=1}function eP(H,$=(A)=>A){return H8(H,(A,L)=>$(L)>$(A)?L:A,void 0)}function Hq(H,$=(A)=>A){return H8(H,(A,L)=>$(L)<$(A)?L:A,void 0)}function H8(H,$,A){let L=yB(H[Symbol.iterator]()),D=0;if(A===void 0)D=1,A=L.next().value;let I=A;for(let E of L)I=$(I,E,D),D+=1;return I}async function $q(H,$,A){let L=yB(H[Symbol.iterator]()),D=0;if(A===void 0)D=1,A=L.next().value;let I=await A;for(let E of L){let K=await E;I=await $(I,K,D),D+=1}return I}function yB(H){function*$(L){for(let D=L.next();!D.done;D=L.next())yield D.value}function*A(L){yield*L}return ti(H)?oi(H)?H:A(H):$(H)}function ti(H){return!!H[Symbol.iterator]}function oi(H){return typeof H.next=="function"}function U3(H){return($)=>gP($,H)}function V3(H){return($)=>mP($,H)}function C3(H){return($)=>dP($,H)}function z3(H){return($)=>pP($,H)}function P3(H){return($)=>cP($,H)}function q3(H,$){return(A)=>lP(A,$,H)}function T3(H){return($)=>iP($,H)}function _3(H,$){return(A)=>nP(A,H,$)}function Aq(H){return($)=>aP($,H)}function Lq(H){return($)=>tP($,H)}function Dq(){return(H)=>oP(H)}function Iq(H,$){return(A)=>sP(A,H,$)}function Eq(H){return($)=>rP($,H)}function Kq(H){return($)=>eP($,H)}function Mq(H){return($)=>Hq($,H)}function fB(H,$){return(A)=>H8(A,H,$)}function Xq(H,$){return(A)=>$q(A,H,$)}function nK(...H){return($)=>{for(let A of H)$=A?A($):$;return $}}var Wq=()=>{};var aK=y(()=>{Wq()});var N3;var vB=y(()=>{aK();N3=class N3{i;_iterator;constructor(H){this.i=H}get iter(){return typeof this.i==="function"?this.i():this.i}get iterator(){if(!this._iterator)this._iterator=this.iter[Symbol.iterator]();return this._iterator}inject(H){let $=this.i;return()=>H(typeof $==="function"?$():$)}chain(H){return new N3(this.inject(H))}[Symbol.iterator](){return this.iter[Symbol.iterator]()}next(){return this.iterator.next()}filter(H){return this.chain(U3(H))}skip(H){return this.chain(V3(H))}take(H){return this.chain(C3(H))}concat(H){return this.chain(z3(H))}concatMap(H){return this.chain(P3(H))}combine(H,$){return this.chain(q3(H,$))}map(H){return this.chain(T3(H))}scan(H,$){return this.chain(_3(H,$))}pipe(...H){if(!H.length)return this;return this.chain(nK.apply(null,H))}all(H){return Aq(H)(this.iter)}any(H){return Lq(H)(this.iter)}count(){return Dq()(this.iter)}first(H,$){return Iq(H,$)(this.iter)}forEach(H){return Eq(H)(this.iter)}max(H){return Kq(H)(this.iter)}min(H){return Mq(H)(this.iter)}reduce(H,$){return fB(H,$)(this.iter)}reduceAsync(H,$){return Xq(H,$)(this.iter)}reduceToSequence(H,$){return this.chain(fB(H,$))}toArray(){return[...this.iter]}toIterable(){return uP(this.iter)}}});function bB(H){return new N3(H)}var Qq=y(()=>{vB()});var Bq=()=>{};class tK{operators=[];constructor(H=[]){this.operators=H}build(H){return new N3(H).pipe(nK.apply(null,this.operators))}pipe(...H){return new tK([...this.operators,...H])}filter(H){return this.pipe(U3(H))}skip(H){return this.pipe(V3(H))}take(H){return this.pipe(C3(H))}concat(H){return this.pipe(z3(H))}concatMap(H){return this.pipe(P3(H))}combine(H,$){return this.pipe(q3(H,$))}map(H){return this.pipe(T3(H))}scan(H,$){return this.pipe(_3(H,$))}}var Jq=y(()=>{aK();vB()});function sA(H){return new tK([H])}var VkH;var Zq=y(()=>{Jq();aK();VkH=Object.freeze({pipe:(H)=>{return sA(H)},filter:(H)=>{return sA(U3(H))},skip:(H)=>{return sA(V3(H))},take:(H)=>{return sA(C3(H))},concat:(H)=>{return sA(z3(H))},concatMap:(H)=>{return sA(P3(H))},combine:(H,$)=>{return sA(q3(H,$))},map:(H)=>{return sA(T3(H))},scan:(H,$)=>{return sA(_3(H,$))}})});var Yq=y(()=>{Qq();Bq();Zq()});import SL from"node:assert";import{Buffer as sK}from"node:buffer";import{endianness as ri}from"node:os";function pq(H){let $=void 0,A=Gq;function L(D){if(A!==Gq&&$===D)return A;return $=D,A=H(D),A}return L}function Hn(H,$,A){return iq(H,$,A)}function $n(H,$,A){if(H.find){let M=H.find($,A?.matchCase||!1);if(M){if(A?.checkForbidden&&M.forbidden===void 0)M.forbidden=A8(H,$,H.forbidPrefix);return M}if(!H.hasCompoundWords)return lq}let{found:L,compoundUsed:D,caseMatched:I,forbidden:E}=iq(H,$,A),K={found:L,compoundUsed:D,caseMatched:I,forbidden:E};if(A?.checkForbidden&&E===void 0)K.forbidden=A8(H,$,H.forbidPrefix);return K}function iq(H,$,A){let L=H.info,D=A?.matchCase||!1,I=ei.get(A?.compoundMode)||HM.compoundMode,E=I==="compound"?L.compoundCharacter??H.compoundFix:"",K=D?"":L.stripCaseAndAccentsPrefix??H.caseInsensitivePrefix,M=A?.checkForbidden===!0,W=A?.checkForbidden??!0;function X(){let Z=Ln(H,$,E,K);if(Z.found!==!1&&(M||Z.compoundUsed&&W))Z.forbidden=A8(!Z.caseMatched?$M(H,H.caseInsensitivePrefix):H,$,H.forbidPrefix);return Z}function J(){let Z=H.getNode?H.getNode($):$M(H,$);return{found:aq(Z)&&$,compoundUsed:!1,forbidden:W?A8(H,$,H.forbidPrefix):void 0,node:Z,caseMatched:!0}}switch(I){case"none":return D?J():X();case"compound":return X();case"legacy":return nq(H,$,A)}}function nq(H,$,A){let L=[H];if(!A?.matchCase)L.push($M(H,H.caseInsensitivePrefix));return In(L,$,A?.legacyMinCompoundLength||cq)}function An(H,$,A,L){let D=[{n:H,compoundPrefix:L,cr:void 0,caseMatched:!0}],I=A||L,E=L&&A?L+A:"",K=$.normalize(),M=[...K];function W(B){let Y=B.compoundPrefix,G=H,U;for(U=0;U<Y.length&&G;++U)G=G.get(Y[U]);let V=B.caseMatched&&Y[0]!==L;return{n:B.n,compoundPrefix:Y===I?E:"",cr:G,caseMatched:V}}let X=!1,J=!0,Z=0,Q;while(!0){let B=D[Z],Y=M[Z++],G=B.cr||B.n,U=Y&&G?.get(Y)||void 0;if(U&&Z<$.length)J=B.caseMatched,D[Z]={n:U,compoundPrefix:I,cr:void 0,caseMatched:J};else if(!U||!U.eow){Q=Q||U;while(--Z>0){let V=D[Z];if(!V.compoundPrefix||!V.n?.hasChildren())continue;if(V.n.get(A))break}if(Z>=0&&D[Z].compoundPrefix){X=Z>0;let V=W(D[Z]);if(D[Z]=V,!V.cr)break;if(!Z&&!V.caseMatched&&K!==K.toLowerCase())break}else break}else{Q=U,J=B.caseMatched;break}}return{found:Z===$.length&&$||!1,compoundUsed:X,node:Q,forbidden:void 0,caseMatched:J}}function Ln(H,$,A,L){let{found:D,compoundUsed:I,node:E,caseMatched:K}=An(H,$,A,L);if(!E||!E.eow)return{found:!1,compoundUsed:I,node:E,forbidden:void 0,caseMatched:K};return{found:D,compoundUsed:I,node:E,forbidden:void 0,caseMatched:K}}function Dn(H,$){let A=H;if(A?.findExact)return A.findExact($);return aq($M(H,$))}function aq(H){return!!H?.eow}function $M(H,$){let A=[...$],L=H,D=0;while(L&&D<A.length){let I=A[D++];L=L.get(I)}return L}function In(H,$,A){let L=H[0],D=H.length,I=[{n:L,usedRoots:1,subLength:0,isCompound:!1,cr:void 0,caseMatched:!0}],E=$,K=E.length,M=!1,W=!0,X=0,J;while(!0){let Q=I[X],B=E[X++],Y=(Q.cr||Q.n)?.get(B);if(Y&&X<K)I[X]={n:Y,usedRoots:0,subLength:Q.subLength+1,isCompound:Q.isCompound,cr:void 0,caseMatched:Q.caseMatched};else if(!Y||!Y.eow||Y.eow&&Q.subLength<A-1){while(--X>0){let G=I[X];if(G.usedRoots<D&&G.n?.eow&&(G.subLength>=A||!G.subLength)&&K-X>=A)break}if(X>0||I[X].usedRoots<D){M=X>0;let G=I[X];G.cr=H[G.usedRoots++],G.subLength=0,G.isCompound=M,G.caseMatched=G.caseMatched&&G.usedRoots<=1}else break}else{J=Y,W=Q.caseMatched;break}}function Z(){if(!$||X<$.length)return!1;let Q=[],B=0;for(let Y=0;Y<X;++Y){let{subLength:G}=I[Y];if(G<B)Q.push("+");Q.push($[Y]),B=G}return Q.join("")}return{found:Z(),compoundUsed:M,node:J,forbidden:void 0,caseMatched:W}}function A8(H,$,A){let L=H;if(L?.isForbidden)return L.isForbidden($);return Dn(H?.get(A),$)}function Kn(H){if(!H)return HM;let $=HM;return{matchCase:H.matchCase??$.matchCase,compoundMode:H.compoundMode??$.compoundMode,legacyMinCompoundLength:H.legacyMinCompoundLength??$.legacyMinCompoundLength,checkForbidden:H.checkForbidden??$.checkForbidden}}function*Mn(H,$){let A=Object.freeze([]),L={[bH.NONE]:A,[bH.JOIN_WORDS]:[[F3,H]],[bH.SEPARATE_WORDS]:[[p0,H]]},D=L[$].length?L[$]:void 0;function I(M){if(M.hasChildren()){let W=M.entries(),X=Array.isArray(W)?W:[...W];return M.eow&&D?[...X,...D]:X}if(M.eow)return L[$];return A}let E=0,K=[];K[E]={t:"",c:I(H),ci:0};while(E>=0){let M=K[E],W=M.t;while(M.ci<M.c.length){let[X,J]=M.c[M.ci++],Z=W+X;if((yield{text:Z,node:J,depth:E})??!0)E++,W=Z,K[E]={t:Z,c:I(J),ci:0};M=K[E]}E-=1}}function*Xn(H){let $=0,A=[],L=H.entries();A[$]={t:"",n:H,c:Array.isArray(L)?L:[...L],ci:0};while($>=0){let D=A[$],I=D.t;while(D.ci<D.c.length&&D.n){let E=D.ci++,[K,M]=D.c[E],W=I+K;if((yield{text:W,node:M,depth:$})!==!1){$++,I=W;let X=A[$],J=M.entries(),Z=Array.isArray(J)?J:[...J];if(X)X.t=W,X.n=M,X.c=Z,X.ci=0;else A[$]={t:W,n:M,c:Z,ci:0}}D=A[$]}$-=1}}function Wn(H,$=bH.NONE){return $===bH.NONE?Xn(H):Mn(H,$)}function Qn(H){return Bn(H)}function*Bn(H){let $=0,A=[],L=H.entries();A[$]={t:"",n:H,c:Array.isArray(L)?L:[...L],ci:0};while($>=0){let D=A[$],I=D.t;while(D.ci<D.c.length&&D.n){let[E,K]=D.c[D.ci++];if(!K)continue;let M=I+E;if(K.eow)yield M;$++,I=M;let W=K.entries(),X=Array.isArray(W)?W:[...W];if(A[$])D=A[$],D.t=M,D.n=K,D.c=X,D.ci=0;else A[$]={t:M,n:K,c:X,ci:0};D=A[$]}$-=1}}function Uq(H){return Qn(H)}function aB(H,$){for(let A=0;A<$.length;++A){let L=H.get($[A]);if(!L)return;H=L}return H}function Jn(H){let $=new Map;function A(L){let D=$.get(L.id);if(D!==void 0)return D;let I=L.eow?1:0;$.set(L,I);for(let E of L.values())I+=A(E);return $.set(L,I),I}return A(H)}function Vq(H){return H!==void 0}function Zn(H,$,A,L,D){return Yn(H,$,A,L,D)}function*Yn(H,$,A,L,D=""){let I=L??bH.NONE,E=H.compoundCharacter,K=H.stripCaseAndAccentsPrefix,M=[H,$?H.c[K]:void 0].filter(Vq),W=Gn([E,K,H.forbiddenWordPrefix]);function X(U){let V=(U.c&&Object.entries(U.c))?.filter(([z])=>!(z in W));return{c:V&&Object.fromEntries(V)}}let J=M.map(X),Z=M.map((U)=>U.c?.[E]).filter(Vq),Q=new Set(Z),B=[...J,...Z],Y={[bH.NONE]:[],[bH.JOIN_WORDS]:B.map((U)=>[F3,U]),[bH.SEPARATE_WORDS]:B.map((U)=>[p0,U])};function*G(U,V){if(U.c){let z=A.slice(V,V+3)+A.slice(Math.max(0,V-2),V),P=new Set(z),T=U.c;if(yield*[...P].filter((q)=>(q in T)).map((q)=>({letter:q,node:T[q],hintOffset:V+1})),P.add(E),yield*Object.entries(T).filter((q)=>!P.has(q[0])).map(([q,O])=>({letter:q,node:O,hintOffset:V+1})),E in T&&!Q.has(U))for(let q of Z)for(let O of G(q,V)){let{letter:N,node:x,hintOffset:w}=O;yield{letter:D+N,node:x,hintOffset:w}}}if(U.f)yield*[...Y[I]].map(([z,P])=>({letter:z,node:P,hintOffset:V}))}for(let U of J){let V=0,z=[],P=[""];z[V]=G(U,V);let T;while(V>=0){while(!(T=z[V].next()).done){let{letter:q,node:O,hintOffset:N}=T.value,x=P[V]+q,w=yield{text:x,node:O,depth:V};if(w&&w.goDeeper)V++,P[V]=x,z[V]=G(O,N)}V-=1}}}function Gn(H){let $=Object.create(null);for(let A of H)$[A]=!0;return $}function Un(H){return Pn.toITrieNode(H)}function*qn(H,$){let A={[bH.NONE]:[],[bH.JOIN_WORDS]:[[F3,H]],[bH.SEPARATE_WORDS]:[[p0,H]]},L=A[$].length?A[$]:void 0,D=[];function I(M){if(M.c&&M.f&&L)return[...Object.entries(M.c),...L];if(M.c)return Object.entries(M.c);if(M.f&&L)return L;return D}let E=0,K=[];K[E]={t:"",c:I(H),ci:0};while(E>=0){let M=K[E],W=M.t;while(M.ci<M.c.length){let[X,J]=M.c[M.ci++],Z=W+X;if((yield{text:Z,node:J,depth:E})??!0)E++,W=Z,K[E]={t:Z,c:I(J),ci:0};M=K[E]}E-=1}}function*Tn(H){let $=[];function A(I){if(I.c)return Object.keys(I.c);return $}let L=0,D=[];D[L]={t:"",n:H.c,c:A(H),ci:0};while(L>=0){let I=D[L],E=I.t;while(I.ci<I.c.length&&I.n){let K=I.c[I.ci++],M=I.n[K],W=E+K;if((yield{text:W,node:M,depth:L})!==!1){L++,E=W;let X=D[L],J=A(M);if(X)X.t=W,X.n=M.c,X.c=J,X.ci=0;else D[L]={t:W,n:M.c,c:J,ci:0}}I=D[L]}L-=1}}function*Nn(H){let $=[];function A(I){if(I.c)return Object.keys(I.c);return $}let L=0,D=[];D[L]={t:"",n:H.c,c:A(H),ci:0};while(L>=0){let I=D[L],E=I.t;while(I.ci<I.c.length&&I.n){let K=I.c[I.ci++],M=I.n[K],W=E+K;if(M.f)yield W;L++,E=W;let X=A(M);if(D[L])I=D[L],I.t=W,I.n=M.c,I.c=X,I.ci=0;else D[L]={t:W,n:M.c,c:X,ci:0};I=D[L]}L-=1}}function Fn(H,$=bH.NONE){return $===bH.NONE?Tn(H):qn(H,$)}function I8(...H){let $={...wn},A=Object.keys(Rn);for(let L of H)for(let D of A)jn($,L,D);return $}function jn(H,$,A){H[A]=$[A]??H[A]}function Sn(H,$){if(!$||!$.c)return;return tq(H,$.c)}function xn(H,$,A){let L={v:A,s:void 0,c:void 0};if(!$||H(A,$.v)<=0)return L.c=$,L;return L.s=$.c,$.c=L,$}function zq(H,$,A){if(H($.v,A.v)<=0)return $.s=void 0,A.s=$.c,$.c=A,$;return A.s=void 0,$.s=A.c,A.c=$,A}function tq(H,$){if(!$.s)return $;let A=$.s,L=A.s,D=zq(H,$,A);return L?zq(H,D,tq(H,L)):D}function yH(H){let $=H.normalize("NFC").replaceAll(/\p{M}/gu,""),A=$.normalize("NFD").replaceAll(/\p{M}/gu,"");return[...new Set($+$.toLowerCase()+$.toUpperCase()+A+A.toLowerCase()+A.toUpperCase())].join("")}function fn(H){let $=Object.create(null);for(let A=0;A<H.length;++A){let L=1<<A,D=H[A];for(let I of D)$[I]=($[I]||0)|L}return $}function bn(...H){let $=gn();return sq($,H),$}function hn(H,...$){return sq(H,$)}function un(H,...$){for(let A of $)H.adjustments.set(A.id,A);return H}function sq(H,$){function A(L,D){an(H.insDel,L,D.insDel,D.penalty),qq(H.replace,L,D.replace,D.penalty),qq(H.swap,L,D.swap,D.penalty)}for(let L of $){let D=sn(L);ln(D).forEach((I)=>A(I,D))}return H}function gn(){return{insDel:{},replace:{},swap:{},adjustments:new Map}}function mn(H,$){if(H===void 0)return $;if($===void 0)return H;return H<=$?H:$}function dn(H,$){if(H===void 0)return $;if($===void 0)return H;return H>=$?H:$}function Pq(H){let $=new Set([H]);return $.add(H.normalize("NFC")),$.add(H.normalize("NFD")),$}function*pn(H){let $="",A=0;for(let L of H){if(A&&L===")"){yield*Pq($),A=0;continue}if(A){$+=L;continue}if(L==="("){A=1,$="";continue}yield*Pq(L)}}function cn(H){return[...pn(H)]}function ln(H){let{map:$}=H;return $.split("|").map(cn).filter((A)=>A.length>0)}function rq(H,$,A,L){if(!$)return;let D=H;for(let I of $){let E=D.n=D.n||Object.create(null);D=E[I]=E[I]||Object.create(null)}D.c=mn(D.c,A),D.p=dn(D.p,L)}function nn(H,$,A,L,D){let I=H;for(let E of $){let K=I.n=I.n||Object.create(null);I=K[E]=K[E]||Object.create(null)}rq(I.t=I.t||Object.create(null),A,L,D)}function an(H,$,A,L){if(A===void 0)return;for(let D of $)rq(H,D,A,L)}function qq(H,$,A,L){if(A===void 0)return;for(let D of $)for(let I of $){if(D===I)continue;nn(H,D,I,A,L)}}function*eq(H,$,A){let L=$.length;for(let D=H.n;A<L&&D;){let I=D[$[A]];if(!I)return;++A,yield{i:A,t:I},D=I.n}}function*oK(H,$,A){for(let L of eq(H,$,A)){let{c:D,p:I}=L.t;if(D!==void 0)yield{i:L.i,c:D,p:I||0}}}function*Tq(H,$,A){for(let L of eq(H,$,A)){let D=L.t.t;if(D!==void 0)yield{i:L.i,t:D}}}function tn(H){return new on(H)}function sn(H){let{map:$,...A}=H;return{...A,map:rn($)}}function rn(H){return H.replaceAll(vn,oq)}function en(H,$,A,L=100){let D=tn(A),I=Ha(H,$,D,L),E=D.calcAdjustment($);return I.c+I.p+E}function Ha(H,$,A,L=100){let D="^"+H+"$",I="^"+$+"$",E=D.length,K=I.length,M=new $a(E,K);M.add({ai:0,bi:0,c:0,p:0,f:void 0});function W(Y){let{ai:G,bi:U,c:V,p:z}=Y;if(G<E&&U<K){let P=D[G]===I[U]?V:V+L;M.add({ai:G+1,bi:U+1,c:P,p:z,f:Y})}}function X(Y){let{ai:G,bi:U,c:V,p:z}=Y;if(U<K)M.add({ai:G,bi:U+1,c:V+L,p:z,f:Y})}function J(Y){let{ai:G,bi:U,c:V,p:z}=Y;if(G<E)M.add({ai:G+1,bi:U,c:V+L,p:z,f:Y})}function Z(Y){let{ai:G,bi:U,c:V,p:z}=Y;if(D[G]===I[U+1]&&D[G+1]===I[U])M.add({ai:G+2,bi:U+2,c:V+L,p:z,f:Y})}function Q(Y){let{ai:G,bi:U,c:V,p:z}=Y,P={a:D,b:I,ai:G,bi:U,c:V,p:z};[A.calcInsDelCosts(P),A.calcSwapCosts(P),A.calcReplaceCosts(P)].forEach((T)=>{for(let q of T)M.add({...q,f:Y})})}let B;while(B=M.next()){if(B.ai===E&&B.bi===K)break;Z(B),X(B),J(B),Q(B),W(B)}return SL(B),B}function Aa(H,$,A){return H*A+$}function La(H,$){return H.c-$.c||$.ai+$.bi-H.ai-H.bi}function Ea(H,$,A,L=Ia){return en(H,$,A,L)}function HT(){let H=performance.now();return()=>performance.now()-H}function Ka(){let H=HT(),$=new Map,A=[{name:"start",at:0}];function L(Z,Q=H()){let B=Q-Z.at;return Z.elapsed=(Z.elapsed||0)+B,B}function D(Z){let Q=E(Z||"start");return A.push(Q),Z&&$.set(Z,Q),()=>L(Q)}function I(Z){let Q=Z&&$.get(Z);if(Q)return L(Q);return K(Z||"stop")}function E(Z){return{name:Z,at:H()}}function K(Z){let Q=E(Z);return A.push(Q),Q.at}function M(){let Z=[{name:"Event Name",at:"Time",elapsed:"Elapsed"},{name:"----------",at:"----",elapsed:"-------"},...Q()];function Q(){let U=[];return A.map((V)=>{for(let P=U.pop();P;P=U.pop())if(P>=V.at+(V.elapsed||0)){U.push(P);break}let z=U.length;if(V.elapsed)U.push(V.at+V.elapsed);return{name:"| ".repeat(z)+(V.name||"").replaceAll("\t"," "),at:`${B(V.at)}`,elapsed:V.elapsed?`${B(V.elapsed)}`:"--"}})}function B(U){return U.toFixed(3)+"ms"}function Y(U,V){return Math.max(U,V.length)}let G=Z.reduce((U,V)=>({name:Y(U.name,V.name),at:Y(U.at,V.at),elapsed:Y(U.elapsed,V.elapsed)}),{name:0,at:0,elapsed:0});return Z.map((U)=>`${U.at.padStart(G.at)} ${U.name.padEnd(G.name)} ${U.elapsed.padStart(G.elapsed)}`).join(`
|
|
305
|
+
`)}function W(Z,Q){let B=D(Z),Y=Q();return B(),Y}async function X(Z,Q){let B=D(Z),Y=await Q();return B(),Y}function J(Z=console.log){Z(M())}return{start:D,stop:I,mark:K,elapsed:H,report:J,formatReport:M,measureFn:W,measureAsyncFn:X}}function Ma(){let H=_q||Ka();return _q=H,H}function $T(H){return H!==void 0}function AT(H){return IM({...H})}function IM(H){for(let $ in H)if(H[$]===void 0)delete H[$];return H}function LT(H){return[...new Set(H)]}function DT(H){return H.replaceAll(/([[\]\-+(){},|*.\\])/g,"\\$1")}function tB(H,$){let A=RegExp(DT(H),"g");return(L)=>L.replace(A,$)}function Oq(H,$){return(H.isPreferred&&-1||0)-($.isPreferred&&-1||0)||H.cost-$.cost||H.word.length-$.word.length||Qa.compare(H.word,$.word)}function c0(H,$){let{filter:A=()=>!0,changeLimit:L=IT,includeTies:D=!1,ignoreCase:I=!0,timeout:E=ET,weightMap:K,compoundSeparator:M=wq.compoundSeparator}=$,W=Math.max($.numSuggestions,0)||0,X=K?W*2:W,J=new Map,Z=Nq*Math.min(H.length*Wa,L),Q=M||(K?oq:wq.compoundSeparator),B=!Q||Q===M?(O)=>O:tB(Q,"");if(Q&&K)hn(K,{map:Q,insDel:50});let Y=IM({changeLimit:L,ignoreCase:I,compoundMethod:$.compoundMethod,compoundSeparator:Q}),G=E;function U(){if(J.size<2||!W){J.clear();return}let O=[...J.values()].sort(Oq),N=X-1;Z=O[N].cost;for(;N<O.length&&O[N].cost<=Z;++N);for(;N<O.length;++N)J.delete(O[N].word)}function V(O){if(O.isPreferred)return O;let N=O.word.split(Ba),x=N.map((w)=>Ja[w.length]||0).reduce((w,F)=>w+F,0)+(N.length-1)*Za;return{word:O.word,cost:O.cost+x}}function z(O){let{word:N,cost:x,isPreferred:w}=V(O);if(x<=Z&&A(O.word,x)){let F=J.get(N);if(F)F.cost=Math.min(F.cost,x),F.isPreferred=F.isPreferred||w;else if(J.set(N,{word:N,cost:x,isPreferred:w}),x<Z&&J.size>X)U()}return Z}function P(O,N,x){let w=!1;if(N=N??G,N=Math.min(N,G),N<0)return;let F=HT(),f;while(!(f=O.next(w||Z)).done){if(F()>N)w=Fq;let{value:j}=f;if(!j)continue;if(Ya(j)){if(!x||x(j.word,j.cost))z(j);continue}}G-=F()}function T(O){let{word:N,cost:x}=O,w=B(N);if(w!==N)return{word:w,cost:x,compoundWord:N,isPreferred:void 0};return{...O}}function q(){if(W<1||!J.size)return[];let O="NFD",N=H.normalize(O),x=[...J.values()],w=(K?x.map(({word:_,cost:u,isPreferred:h})=>({word:_,cost:h?u:Ea(N,_.normalize(O),K,110),isPreferred:h})):x).sort(Oq).map(T),F=Math.min(w.length,W)-1,f=D?w.length:Math.min(w.length,W),j=w[F].cost,S=Math.min(j,K?L*Nq-1:j);for(F=1;F<f&&w[F].cost<=S;++F);return w.length=F,w}return{collect:P,add:function(O){return z(O),this},get suggestions(){return q()},get maxCost(){return Z},get word(){return H},get maxNumSuggestions(){return W},get changeLimit(){return L},includesTies:D,ignoreCase:I,symbolStopProcessing:Fq,genSuggestionOptions:Y}}function oB(H,$){let A=Object.create(H);return Object.defineProperty(A,"word",{value:$,writable:!1}),A}function Ya(H){let $=H;return!!$&&typeof $==="object"&&$?.cost!==void 0&&$.word!=null}function Ga(H,$){return H.c/(H.i+1)-$.c/($.i+1)+($.i-H.i)}function Ua(H,$,A={}){let L=I8(A),D=c0($,L);return D.collect(KT(H,$,L)),D.suggestions}function*KT(H,$,A={}){let{compoundMethod:L,changeLimit:D,ignoreCase:I,weightMap:E}=I8(A),K=rK,M=H.getRoot(),W=I&&M.get(M.info.stripCaseAndAccentsPrefix)||void 0,X=new gB(Ga),J=new gB(S),Z={n:M,i:0,c:0,s:"",p:void 0,t:AM()},Q=p$.baseCost,B=p$.visuallySimilar,Y=p$.duplicateLetterCost,G=L===bH.JOIN_WORDS?F3:p0,U=Ta(H.info),V=H.info.compoundCharacter,z=M.get(V),P=W&&W.get(V),T=Object.create(null),q=[...$],O=Q*Math.min(q.length*p$.wordLengthCostFactor,D);if(X.add(Z),W)X.add({n:W,i:0,c:0,s:"",p:void 0,t:AM()});let N=X.dequeue(),x=X.size,w=0,F=0,f=1000,j=1;while(N){if(++F>f){if(f+=1000,w<j)break;j+=w}if(N.c>O){N=X.dequeue(),x=Math.max(x,X.size);continue}_(N);for(let l of J){if(++w,l.cost>O)continue;if(l.word in T&&T[l.word]<=l.cost)continue;let k=yield l;if(T[l.word]=l.cost,typeof k==="number")O=Math.min(k,O);if(typeof k==="symbol")return}N=X.dequeue(),x=Math.max(x,X.size)}return;function S(l,k){let p=l.isPreferred&&1||0;return(k.isPreferred&&1||0)-p||l.cost-k.cost||Math.abs(l.word.charCodeAt(0)-$.charCodeAt(0))-Math.abs(k.word.charCodeAt(0)-$.charCodeAt(0))}function _(l){let k=q.length;if(l.n.eow&&l.i===k){let p={word:qa(l),cost:l.c};J.add(p)}u(l)}function u(l){let{n:k,i:p,t:LH}=l,IH=q[p],HH=K[IH]||0,e=l.c,_H=e+Q+(p?0:p$.firstLetterBias),SH=e+B,o=e+p$.wordBreak,JH=e+p$.compound;if(IH){let t=k.get(IH);if(t)d(LH,t,p+1,e,IH,l,"=",IH);if(E)h(l,E);let BH=q[p+1];if(IH==BH&&t)d(LH,t,p+2,e+Y,IH,l,"dd",IH);d(LH,k,p+1,_H,"",l,"d","");for(let[qH,kH]of k.entries()){if(kH.id===t?.id||qH in U)continue;let $H=HH&(K[qH]||0)?SH:_H;d(LH,kH,p+1,$H,qH,l,"r",qH)}if(k.eow&&p&&L)d(LH,M,p,o,G,l,"L",G);if(BH){let qH=k.get(BH)?.get(IH);if(qH){let kH=BH+IH;d(LH,qH,p+2,e+p$.swapCost,kH,l,"s",kH)}}}if(z&&JH<=O&&k.get(V)){if(P)d(LH,P,p,JH,"",l,"~+","~+");d(LH,z,p,JH,"",l,"+","+")}if(_H<=O)for(let[t,BH]of k.entries()){if(t in U)continue;d(LH,BH,p,_H,t,l,"i",t)}}function h(l,k){Va(l,k,q,d),Ca(l,k,q,d),za(l,k,q,d)}function d(l,k,p,LH,IH,HH,e,_H){let SH=Pa(l,_H);if(SH.c[p]<=LH||LH>O)return;SH.c[p]=LH,X.add({n:k,i:p,c:LH,s:IH,p:HH,t:SH,a:e})}}function Va(H,$,A,L){let{t:D,n:I}=H,E=$.insDel,K=H.i,M=H.c-H.i,W=A.length;for(let X=E.n;K<W&&X;){let J=X[A[K]];if(!J)return;if(++K,J.c!==void 0)L(D,I,K,M+J.c,"",H,"d","");X=J.n}}function Ca(H,$,A,L){let{t:D,i:I,c:E,n:K}=H,M=E;sB($.insDel,K,(W,X,J)=>{if(X.c!==void 0)L(D,J,I,M+X.c,W,H,"i",W)})}function za(H,$,A,L){let{n:D,t:I,c:E}=H,K=A.length,M=$.replace,W=H.i;for(let X=M.n;W<K&&X;){let J=X[A[W]];if(!J)return;++W;let Z=J.t;if(Z)sB(Z,D,(Q,B,Y)=>{let G=B.c;if(G===void 0)return;L(I,Y,W,E+G+(B.p||0),Q,H,"r",Q)});X=J.n}}function AM(){return{c:[],t:Object.create(null)}}function Pa(H,$){if($.length==1)return H.t[$]??=AM();if(!$)return H;let A=H;for(let L of $)A=A.t[L]??=AM();return A}function qa(H){let $=[],A=H;while(A)$.push(A.s),A=A.p;return $.reverse(),$.join("")}function Ta(H){let $=Object.create(null);for(let A of Object.values(H))if(typeof A==="string")$[A]=!0;return $}function sB(H,$,A,L=""){let D=H.n;if(!D)return;for(let[I,E]of $.entries()){let K=D[I];if(!K)continue;let M=L+I;if(A(M,K,E),K.n)sB(K,E,A,M)}}function MT(H,$){let A={...$};if(H){for(let[L,D]of Object.entries(H))if(L in A)A[L]=D??A[L]}return A}function LA(...H){return H.reduce(($,A)=>MT(A,$),H1)}function O3(H,$="-"){let A=new Set,L=0,D="";for(let I of H){if(L)Oa(D,I).forEach((E)=>A.add(E)),L=0;if(I===$&&D){L=1;continue}A.add(I),D=I}if(L)A.add($);return A}function Oa(H,$){let A=[],L=$.codePointAt(0),D=H.codePointAt(0);if(!(D&&L))return A;for(let I=D;I<=L;++I)A.push(String.fromCodePoint(I));return A}function EM(H,$){let A=new Set([H]);function L(D){A.add(D.toLocaleLowerCase($)),A.add(D.toLocaleUpperCase($))}return L(H),[...A].forEach(L),[...A].filter((D)=>!!D)}function XT(H){return new Set([H,H.normalize("NFC"),H.normalize("NFD")])}function wa(H){return H.normalize("NFD").replaceAll(/\p{M}/gu,"")}function Ra(H){return H.normalize("NFD").replaceAll(/[^\p{M}]/gu,"")}function WT(H){let $=H.length,A=H.charCodeAt(0)&64512;return $===1&&(A&63488)!==55296||$===2&&(A&64512)===55296&&(H.charCodeAt(1)&64512)===56320}function ja(H){if(!WT(H)){let $=H.length,A=Sa(H.slice(0,2)).map((D)=>"0x"+("0000"+D.toString(16)).slice(-4)),L;if($==1)L=`Invalid utf16 character, lone surrogate: ${A[0]}`;else if($==2)L=`Invalid utf16 character, not a valid surrogate pair: [${A.join(", ")}]`;else L=`Invalid utf16 character, must be a single character, found: ${$}`;throw Error(L)}}function Sa(H){let $=[];for(let A=0;A<H.length;++A)$.push(H.charCodeAt(A));return $}function xa(H){if(H<128)return H;if(H<2048)return 49280|(H&1984)<<2|H&63;if(H<65536)return 14712960|(H&61440)<<4|(H&4032)<<2|H&63;return 4034953344+((H&1835008)<<6|(H&258048)<<4|(H&4032)<<2|H&63)}function ka(H,$,A=0){let L=A,D=H.length;for(let I=0;I<D;I++){let E=H.charCodeAt(I);if(E=(E&63488)===55296?H.codePointAt(I++)||0:E,E<128){$[L++]=E;continue}if(E<2048){let M=49280|(E&1984)<<2|E&63;$[L++]=M>>>8,$[L++]=M&255;continue}if(E<65536){let M=14712960|(E&61440)<<4|(E&4032)<<2|E&63;$[L++]=M>>>16,$[L++]=M>>>8&255,$[L++]=M&255;continue}let K=4034953344|((E&1835008)<<6|(E&258048)<<4|(E&4032)<<2|E&63);$[L++]=K>>>24&255,$[L++]=K>>>16&255,$[L++]=K>>>8&255,$[L++]=K&255}return L-A}function mB(H){let $=Array(H.length),A=ka(H,$);return $.length!==A&&($.length=A),$}function ya(H){let $=new Map;for(let A of H)$.set(A,mB(A));return $}function va(H){if(H<=255)return[H];if(H<=65535)return[H>>8&255,H&255];if(H<=16777215)return[H>>16&255,H>>8&255,H&255];return[H>>24&255,H>>16&255,H>>8&255,H&255].filter(($)=>$)}function ba(H){let{NodeMaskEOW:$,NodeMaskChildCharIndex:A,NodeChildRefShift:L}=H;return{NodeMaskEOW:$,NodeMaskChildCharIndex:A,NodeChildRefShift:L}}function JT(H,$){if(Object.isFrozen(H))return ua(H,$),H;for(let A=0;A<H.length;++A){let L=H[A];if(L.length>2){let D=Object.isFrozen(L);L=D?Uint32Array.from(L):L;let I=L[0];if(L[0]=0,L.sort((E,K)=>!E?-1:!K?1:(E&$)-(K&$)),L[0]=I,D)H[A]=L,Object.freeze(L)}}return Object.freeze(H),H}function ua(H,$){for(let A=0;A<H.length;++A){let L=H[A];if(L.length>2){let D=-1;for(let I=1;I<L.length;++I){let E=L[I]&$;if(E<D)throw Error(`Node ${A} is not sorted. ${D} > ${E}`);D=E}}}}function kq(){let H=new Uint8Array([1,2,3,4]);return new DataView(H.buffer).getUint32(0,!0)===67305985}function ra(H){if(H.length<eK)return!1;if(sK.from(H,0,8).toString("utf8",0,8)!==zT)return!1;return!0}function ea(H){function $(D){let I=H[D],E=I&jH.NodeMaskNumChildren,K=!!(I&jH.NodeMaskEOW),M=[];for(let W=1;W<=E;++W)M.push({c:("00"+(H[D+W]&jH.NodeMaskChildCharIndex).toString(16)).slice(-2),o:H[D+W]>>>jH.NodeChildRefShift});return{id:D,eow:K,n:D+E+1,c:M}}let A=[],L=0;while(L<H.length){let D=$(L);A.push(D),L=D.n}return A}function Ht(H){let{NodeMaskNumChildren:$,NodeMaskChildCharIndex:A}=jH,L=H.length,D=0,I=H[0],E=I&$;for(;D<L;D+=E+1,I=H[D],E=I&$){if(!E)continue;let K=D+1,M=K+E,W=0,X=K;for(;X<M;++X){let J=H[X]&A;if(W>=J)break;W=J}if(X===M)continue;H.slice(K,M).sort((J,Z)=>(J&A)-(Z&A)).forEach((J,Z)=>H[K+Z]=J)}}function PT(H){let $=new Map;function A(L,D){if(L.length===1)return{i:D,w:!!(L[0]&jH.NodeMaskEOW)&&1||0};let I=$.get(L)||kL.create();function E(K){let M=K>>>jH.NodeChildRefShift,W=K&jH.NodeMaskChildCharIndex,X=I.clone(),J=X.decode(W);if(J===void 0)$.set(H[M],X);return{i:M,c:J&&String.fromCodePoint(J)||void 0,s:W.toString(16).padStart(2,"0")}}return{i:D,w:!!(L[0]&jH.NodeMaskEOW)&&1||0,c:[...L.slice(1)].map(E)}}return H.map((L,D)=>A(L,D))}function At(H,$,A){let L=H.get($);if(L!==void 0)return L;let D=A($);return H.set($,D),D}function A1(H){let $={...H};for(let A of Object.keys($))if($[A]===void 0)delete $[A];return $}function KM(H,$={}){let A=new $1($);A.insert(H);let L=A.build();return new qT(L.size>1000?L.toTrieBlob():L)}function Dt(H){return WT(H)}function It(H,$){if(!Dt(H))SL(!1,`${$} "${H}" ${Et(H)}`)}function Et(H){return H.split("").map(($)=>"0x"+$.charCodeAt(0).toString(16).padStart(4,"0").toUpperCase()).join(":")}function TT(H,$={}){let A=[...H],L=$;for(let D=0;D<A.length;++D){let I=A[D],E=L.c||Object.create(null);L.c=E,L=E[I]||{},E[I]=L}return L.f=(L.f||0)|yL,$}function _T(H){return((H.f||0)&yL)===yL}function NT(H){if(!H.c)return;let $=Object.entries(H.c).sort(([A],[L])=>A<L?-1:1);H.c=Object.fromEntries($);for(let A of $)NT(A[1])}function dB(H){return _n(H)}function Kt(H){return{...LA(H),c:Object.create(null)}}function pB(H,$){let A=Kt($);for(let L of H)if(L.length)TT(L,A);return A}function Mt(H){let $=new Set;function A(L){if($.has(L))return;if($.add(L),L.c)Object.values(L.c).forEach((D)=>A(D))}return A(H),$.size}function Xt(H){let $=new Map;function A(L){if($.has(L))return $.get(L);let D=L.f?1:0;if($.set(L,D),!L.c)return D;for(let I of Object.values(L.c))D+=A(I);return $.set(L,D),D}return A(H)}function FT(H){let $=new Set,A=new Set;function L(D){if($.has(D))return{isCircular:!1,allSeen:!0};if(A.has(D)){let E=[...A,D];return{isCircular:!0,allSeen:!1,ref:{stack:E,word:Wt(E),pos:E.indexOf(D)}}}A.add(D);let I={isCircular:!1,allSeen:!0};if(D.c)I=Object.values(D.c).reduce((E,K)=>{if(E.isCircular)return E;let M=L(K);return M.allSeen=M.allSeen&&E.allSeen,M},I);if(I.allSeen)$.add(D);return A.delete(D),I}return L(H)}function fq(H){return H.c&&new Map(Object.entries(H.c).map(([$,A])=>[A,$]))}function Wt(H){let $="",A=fq(H[0]);for(let L=1;L<H.length;++L){let D=H[L],I=A?.get(D);if(I)$+=I;A=fq(D)}return $}function Qt(H){return FT(H).isCircular}function K8(H,$){return{...LA($),c:H.c||Object.create(null)}}function OT(H){let $=0,A=new Map,L=new Map,D=new Map;if(Qt(H))throw Error("Trie is circular.");function I(J){return(J.f?"*":"")+(J.c?JSON.stringify(Object.entries(J.c).map(([Z,Q])=>[Z,L.get(Q)])):"")}function E(J){if(J.f&&!J.c)return J;let Z;if(J.c){for(let Q of Object.values(J.c))if(Z=E(Q),Z)break}return Z}function K(J,Z){for(let Q of J)if(Z[Q[0]]!==Q[1])return!1;return J.length===Z.size}function M(J){let Z=D.get(J);if(Z)return Z;let Q=J;if(J.c){let G=Object.entries(J.c).map((U)=>[U[0],M(U[1])]);if(!K(G,J.c))J={f:J.f,c:Object.fromEntries(G)}}let B=I(J),Y=A.get(B);if(Y)return D.set(Q,Y),Y;return Object.freeze(J),A.set(B,J),L.set(J,$++),D.set(Q,J),J}function W(J){if(L.has(J))return J;if(Object.isFrozen(J))return D.get(J)||M(J);if(J.c){let B=Object.entries(J.c).sort((Y,G)=>Y[0]<G[0]?-1:1).map(([Y,G])=>[Y,W(G)]);J.c=Object.fromEntries(B)}let Z=I(J),Q=A.get(Z);if(Q)return Q;return A.set(Z,J),L.set(J,$++),J}let X=E(H)||{f:yL,c:void 0};return A.set(I(X),X),L.set(X,$++),K8(W(H),H)}function Jt(H,$,A){return Yt(H,$,L1(A))}function Zt(H,$,A){return RT(H,$,L1(A))}function Yt(H,$,A){let{node:L,...D}=RT(H,$,A);return D}function RT(H,$,A){let L=Bt.get(A.compoundMode)||wT.compoundMode,D=A.compoundMode==="compound"?H.compoundCharacter??A.compoundFix:"",I=A.matchCase?"":H.stripCaseAndAccentsPrefix??A.caseInsensitivePrefix;function E(){let M=Ut(H,$,D,I),W={...M};if(M.found!==!1&&M.compoundUsed)W.forbidden=lB(!M.caseMatched?LM(H,A.caseInsensitivePrefix):H,$,A.forbidPrefix);return W}function K(){let M=LM(H,$);return{found:ST(M)&&$,compoundUsed:!1,forbidden:lB(H,$,A.forbidPrefix),node:M,caseMatched:!0}}switch(L){case"none":return A.matchCase?K():E();case"compound":return E();case"legacy":return jT(H,$,A)}}function jT(H,$,A){let L=[H];if(!A.matchCase)L.push(LM(H,A.caseInsensitivePrefix));return Vt(L,$,A.legacyMinCompoundLength)}function Gt(H,$,A,L){let D=[{n:H,compoundPrefix:L,cr:void 0,caseMatched:!0}],I=A||L,E=L&&A?L+A:"",K=$.normalize(),M=[...K];function W(B){let Y=B.compoundPrefix,G=H,U;for(U=0;U<Y.length&&G;++U)G=G.c?.[Y[U]];let V=B.caseMatched&&Y[0]!==L;return{n:B.n,compoundPrefix:Y===I?E:"",cr:G,caseMatched:V}}let X=!1,J=!0,Z=0,Q;while(!0){let B=D[Z],Y=M[Z++],G=(B.cr||B.n)?.c?.[Y];if(G&&Z<$.length)J=B.caseMatched,D[Z]={n:G,compoundPrefix:I,cr:void 0,caseMatched:J};else if(!G||!G.f){Q=Q||G;while(--Z>0){let U=D[Z];if(!U.compoundPrefix||!U.n?.c)continue;if(A in U.n.c)break}if(Z>=0&&D[Z].compoundPrefix){X=Z>0;let U=W(D[Z]);if(D[Z]=U,!U.cr)break;if(!Z&&!U.caseMatched&&K!==K.toLowerCase())break}else break}else{Q=G,J=B.caseMatched;break}}return{found:Z&&Z===$.length&&$||!1,compoundUsed:X,node:Q,forbidden:void 0,caseMatched:J}}function Ut(H,$,A,L){let{found:D,compoundUsed:I,node:E,caseMatched:K}=Gt(H,$,A,L);if(!E||!E.f)return{found:!1,compoundUsed:I,node:E,forbidden:void 0,caseMatched:K};return{found:D,compoundUsed:I,node:E,forbidden:void 0,caseMatched:K}}function cB(H,$){return ST(LM(H,$))}function ST(H){return H?.f===yL}function LM(H,$){let A=[...$],L=H,D=0;while(L&&D<A.length){let I=A[D++];L=L.c?.[I]}return L}function Vt(H,$,A){let L=H[0],D=H.length,I=[{n:L,usedRoots:1,subLength:0,isCompound:!1,cr:void 0,caseMatched:!0}],E=$,K=E.length,M=!1,W=!0,X=0,J;while(!0){let Q=I[X],B=E[X++],Y=(Q.cr||Q.n)?.c?.[B];if(Y&&X<K)I[X]={n:Y,usedRoots:0,subLength:Q.subLength+1,isCompound:Q.isCompound,cr:void 0,caseMatched:Q.caseMatched};else if(!Y||!Y.f||Y.f&&Q.subLength<A-1){while(--X>0){let G=I[X];if(G.usedRoots<D&&G.n?.f&&(G.subLength>=A||!G.subLength)&&K-X>=A)break}if(X>0||I[X].usedRoots<D){M=X>0;let G=I[X];G.cr=H[G.usedRoots++],G.subLength=0,G.isCompound=M,G.caseMatched=G.caseMatched&&G.usedRoots<=1}else break}else{J=Y,W=Q.caseMatched;break}}function Z(){if(!$||X<$.length)return!1;let Q=[],B=0;for(let Y=0;Y<X;++Y){let{subLength:G}=I[Y];if(G<B)Q.push("+");Q.push($[Y]),B=G}return Q.join("")}return{found:Z(),compoundUsed:M,node:J,forbidden:void 0,caseMatched:W}}function lB(H,$,A){return cB(H?.c?.[A],$)}function Ct(H){return MT(H,wT)}function*zt(H){yield*H}function vq(H){let $=16,A=/^\s*#/,L=zt(H);function D(Z){let Q=Z.slice(0,2).join(`
|
|
306
|
+
`),B=/^TrieXv1\nbase=(\d+)$/;if(!B.test(Q))throw Error("Unknown file format");$=Number.parseInt(Q.replace(B,"$1"),10)}function I(Z){let Q=[];while(!0){let B=Z.next();if(B.done)break;let Y=B.value.trim();if(!Y||A.test(Y))continue;if(Y===iB)break;Q.push(Y)}D(Q)}let E=/(^|[^\\]),/g,K=/__COMMA__/g,M=/[\\](.)/g,W={f:yL};function X(Z){return Z.replaceAll(E,"$1__COMMA__").split(K).map((Q)=>Q.replaceAll(M,"$1"))}function J(Z,Q){let B=Z[0]===xT;Z=B?Z.slice(1):Z;let Y=B?W:{},G=X(Z).filter((U)=>!!U).map((U)=>[U[0],Number.parseInt(U.slice(1)||"0",$)]).map(([U,V])=>[U,Q[V]]);return{...G.length?{c:Object.fromEntries(G)}:{},...Y}}return I(L),K8(bB([iB]).concat(L).map((Z)=>Z.replace(/\r?\n/,"")).filter((Z)=>!!Z).reduce((Z,Q)=>{let{lines:B,nodes:Y}=Z,G=J(Q,Y);return Y[B]=G,{lines:B+1,root:G,nodes:Y}},{lines:0,nodes:[],root:{}}).root,{isCaseAware:!1})}function*qt(H){yield*H}function Tt(H){let $=16,A=/^\s*#/,L=qt(H);function D(W){let X=W.slice(0,2).join(`
|
|
307
|
+
`),J=/^TrieXv2\nbase=(\d+)$/;if(!J.test(X))throw Error("Unknown file format");$=Number.parseInt(X.replace(J,"$1"),10)}function I(W){let X=[];while(!0){let J=W.next();if(J.done)break;let Z=J.value.trim();if(!Z||A.test(Z))continue;if(Z===kT)break;X.push(Z)}D(X)}function E(W,X){let J=W[1]===Pt,Z=J?2:1,Q=W.slice(Z).split(",").filter((B)=>!!B).map((B)=>Number.parseInt(B,X));return{letter:W[0],isWord:J,refs:Q}}let K={f:yL};function M(W,X){let{letter:J,isWord:Z,refs:Q}=E(W,$),B=Z?K:{},Y=Q.map((G)=>X[G]).sort((G,U)=>G.s<U.s?-1:1).map((G)=>[G.s,G]);return{s:J,...Y.length?{c:Object.fromEntries(Y)}:{},...B}}return I(L),K8(bB(L).map((W)=>W.replace(/\r?\n/,"")).filter((W)=>!!W).reduce((W,X)=>{let{nodes:J}=W,Z=M(X,J);return J.push(Z),{root:Z,nodes:J}},{nodes:[],root:{s:"",c:Object.create(null)}}).root,{isCaseAware:!1})}function Ft(H){H=typeof H==="string"?H.split(/^/m):H;let $=10,A=/^\s*#/,L=Rt(WH(H,E$((E)=>E.split(/^/m))));function D(E){let K=E.slice(0,2).join(`
|
|
308
|
+
`),M=/^TrieXv[34]\nbase=(\d+)$/;if(!M.test(K))throw Error("Unknown file format");$=Number.parseInt(K.replace(M,"$1"),10)}function I(E){let K=[];for(let M of E){let W=M.trim();if(!W||A.test(W))continue;if(W===Nt)break;K.push(W)}D(K)}return I(L),wt($,L)}function wt(H,$){let A=Object.freeze({f:1}),L=[],D=K8({},{});function I(U,V){let z=V===nB,P="";function T(O,N){if(N===L8||H===10&&!(N in Ot)){let{root:x,nodes:w,stack:F}=O,f=Number.parseInt(P,H),j=F[F.length-1],S=F[F.length-2].node,_=z?L[f]:f;S.c&&(S.c[j.s]=w[_]);let u={root:x,nodes:w,stack:F,parser:void 0};return N===L8?u:B(u,N)}return P=P+N,O}let{nodes:q}=U;return q.pop(),{...U,nodes:q,parser:T}}function E(U,V){let z="";return{...U,parser:function(T,q){if(z)return q=_t[z+q]||q,M({...T,parser:void 0},q);if(q===d0)return z=q,T;return M({...T,parser:void 0},q)}}}function K(U,V){let z=V,P=!1;function T(q,O){if(P)return P=!1,q;if(O===d0)return P=!0,q;if(O===z)return{...q,parser:void 0};return q}return{...U,parser:T}}function M(U,V){let{root:P,nodes:T,stack:q}=U,O=q[q.length-1].node,N=O.c??Object.create(null),x={f:void 0,c:void 0,n:T.length};return N[V]=x,O.c=N,q.push({node:x,s:V}),T.push(x),{root:P,nodes:T,stack:q,parser:void 0}}function W(U,V){let z=J,{root:P,nodes:T,stack:q}=U,O=q[q.length-1],N=O.node;if(N.f=yL,!N.c){O.node=A;let x=q[q.length-2].node;x.c&&(x.c[O.s]=A),T.pop()}return q.pop(),{root:P,nodes:T,stack:q,parser:z}}let X=D8(xL+"23456789");function J(U,V){if(!(V in X))return B({...U,parser:void 0},V);let z=V===xL?1:Number.parseInt(V,10)-1,{stack:P}=U;while(z-- >0)P.pop();return{...U,parser:J}}function Z(U,V){return U}let Q=uT([[MM,W],[xL,J],[QM,I],[nB,I],[d0,E],[XM,Z],[WM,Z],[vT,K]]);function B(U,V){return(U.parser??Q[V]??M)(U,V)}let Y=D8(` \r
|
|
309
|
+
`);function G(U,V){let z="";function P(q,O){if(O===yT)return z=z+O,{...q,parser:T};if(O in Y)return q;return B({...q,parser:void 0},O)}function T(q,O){if(z=z+O,O===fT)return L=z.replaceAll(/[\s[\]]/g,"").split(",").map((N)=>Number.parseInt(N,H)),{...q,parser:void 0};return q}return P({...U,parser:P},V)}return kB(WH($,E$((U)=>[...U])),B,{nodes:[D],root:D,stack:[{node:D,s:""}],parser:G}),D}function D8(H){let $=Object.create(null),A=H.length;for(let L=0;L<A;++L)$[H[L]]=!0;return $}function hT(H){return uT(H)}function uT(H){let $=Object.create(null),A=H.length;for(let L=0;L<A;++L)$[H[L][0]]=H[L][1];return $}function Rt(H){let $,A;function L(){if($&&$.done)return{...$};return A=A||H[Symbol.iterator](),$=A.next(),$}function*D(){let I;while(!(I=L()).done)yield I.value}return{[Symbol.iterator]:D}}function bq(H,$="Assert Failed"){if(H)return;throw Error($)}function kt(H,$){let A=Ma(),L=A.start("importTrieV3"),D=typeof $==="string"?$.split(`
|
|
310
|
+
`):Array.isArray($)?$:[...$],I=16,E=/^\s*#/;function K(B){let Y=B.slice(0,2).join(`
|
|
311
|
+
`),G=/^TrieXv3\nbase=(\d+)$/;if(!G.test(Y))throw Error("Unknown file format");I=Number.parseInt(Y.replace(G,"$1"),10)}function M(B){for(let Y=0;Y<B.length;++Y)if(B[Y].includes(uq))return Y;return-1}function W(B){let Y=[];for(let G of B){let U=G.trim();if(!U||E.test(U))continue;if(U===uq)break;Y.push(U)}K(Y)}let X=M(D);if(X<0)throw Error("Unknown file format");W(D.slice(0,X));let J={cursor:H.getCursor(),parser:void 0},Z=yt(I),Q=A.start("importTrieV3.parse");for(let B=X+1;B<D.length;++B){let Y=D[B];for(let G of Y)J=Z(J,G)}return Q(),L(),H.build()}function yt(H){function $(X,J){let Z="";function Q(B,Y){if(Y===L8){let{cursor:G}=B,U=Number.parseInt(Z,H);return G.reference(U+1),B.parser=void 0,B}return Z=Z+Y,B}return X.parser=Q,X}function A(X,J){let Z="",Q=function(B,Y){if(Z)return Y=xt.get(Z+Y)||Y,B.parser=void 0,L(B,Y);if(Y===d0)return Z=Y,B;return B.parser=void 0,L(B,Y)};return X.parser=Q,X}function L(X,J){return X.cursor.insertChar(J),X.parser=void 0,X}function D(X,J){return X.parser=E,X.cursor.markEOW(),X.cursor.backStep(1),X}let I=ft(xL+"23456789");function E(X,J){if(!(J in I))return X.parser=void 0,W(X,J);let Z=J===xL?1:Number.parseInt(J,10)-1;return X.cursor.backStep(Z),X.parser=E,X}function K(X,J){return X}let M=new Map([[MM,D],[xL,E],[QM,$],[d0,A],[XM,K],[WM,K]]);function W(X,J){return(X.parser??M.get(J)??L)(X,J)}return W}function ft(H){let $=Object.create(null),A=H.length;for(let L=0;L<A;++L)$[H[L]]=!0;return $}function vt(H){return kt(new $1,H)}function bt(H){return ht(typeof H==="string"?H:H.toString("utf8"))}function ht(H){return mt(H)}function mt(H){let $=Array.isArray(H)?H:typeof H==="string"?H.split(`
|
|
312
|
+
`):[...H];function A(E){for(let K=0;K<E.length;++K){let M=E[K].match(gt);if(M)return Number.parseInt(M[1],10)}throw Error("Unknown file format")}function L(E){let K=[];for(let M of E){let W=M.trim();if(K.push(W),W===iB||W===kT)break}return K}let D=A(L($)),I=ut[D];if(!I)throw Error(`Unsupported version: ${D}`);return I($)}function gT(H){return new qT(bt(H))}function mT(H){let $=Object.create(null),A=H.length;for(let L=0;L<A;++L)$[H[L]]=!0;return $}function nt(H){if(H=H.trim(),ct.test(H))return H.toLowerCase();let $=H.match(lt);if(!$)return H;return`${$[1].toLowerCase()}-${$[2].toUpperCase()}`}function at(H){return it.test(H)}function tt(H){return hB=hB||ot(),hB.get(H)}function ot(){let H=dt.map(([$,A,L])=>({locale:$,language:A,country:L}));return new Map(H.map(($)=>[$.locale,$]))}function st(H){return new pt(H)}function rt(H){return H=typeof H==="string"?H.split(","):H,H.map(st)}function Ho(H={}){return{...et,...AT(H)}}function $o(H={}){return{...dT,...AT(H)}}function fL(H){return[...H].map(($)=>$.length>1||!$.length?`(${$})`:$).join("")}function pT(H,$,A){let{cost:L,penalty:D}=H,I=fL([...WH([...WH(O3(H.characters),UH((E)=>EM(E,$).sort()))],V$(),UH((E)=>XT(E)),V$(),G3())].sort());return[IM({map:I,replace:L,insDel:L,swap:L,penalty:D}),Ao(H.characters,$,A),...D1(I,$,A)]}function Ao(H,$,A){return{map:[...WH(O3(H),UH((L)=>EM(L,$).sort()))].map((L)=>fL(L)).join("|"),replace:A.capsCosts}}function Lo(H,$){return H.map((A)=>cT(A,$))}function cT(H,$){let A=[...WH(O3(H.characters),G3(),UH((D)=>`(^${D})`))].sort().join("")+"(^)",L=$.firstLetterPenalty;return{map:A,replace:H.cost-L,penalty:L*2}}function Do(H,$){let{cost:A,penalty:L}=H,D=fL([...WH(O3(H.characters),UH((I)=>Ra(I)))]);if(!D)return;return IM({map:D,replace:A,insDel:A,penalty:L})}function D1(H,$,A){let L=[...WH(I1(H),UH((W)=>EM(W,$)),V$(),UH((W)=>[...XT(W)]),vH((W)=>W.length>1))],D=[...WH(L,UH((W)=>new Set([...W,...W.map((X)=>wa(X))])),UH((W)=>[...W].sort()),vH((W)=>W.length>1),UH(fL),G3())].join("|"),I=A.accentCosts,E=!D?[]:[{map:D,replace:I}],K=L.map((W)=>W.sort()).map(fL).join("|"),M=!K?[]:[{map:K,replace:0}];return[...E,...M]}function*I1(H){let $="",A=0;for(let L of H){if(A&&L===")"){yield $,A=0;continue}if(A){$+=L;continue}if(L==="("){A=1,$="";continue}yield L}}function Io(H,$){let A=Eo(H.costs,$),L=[Zo,Yo,Ko,Vo,Go,Qo,Jo,Mo,Uo,Xo];function D(I,E){let K=/^(?:MAP|KEY|TRY|NO-TRY|ICONV|OCONV|REP)\s/,M=/^(?:MAP|KEY|TRY|ICONV|OCONV|REP)\s+\d+$/;return[...WH(I.split(`
|
|
313
|
+
`).map((W)=>W.replace(/#.*/,"")).map((W)=>W.trim()).filter((W)=>K.test(W)).filter((W)=>!M.test(W)),UH((W)=>WH(L,UH((X)=>X(W,E)),UH(zo),V$())),V$(),vH($T))]}return D(H.aff,A)}function Eo(H={},$){let A=$?.length?$.map((L)=>L.locale):void 0;return{...Ho(H),locale:A}}function Ko(H,$){let A=H.match(E1);if(!A)return;let L=A[1],D=$.mapCost;return{map:L,replace:D,swap:D}}function Mo(H,$){let A=H.match(K1);if(!A)return;let L=$.tryCharCost,D=A[1];return pT({characters:D,cost:L},$.locale,$)}function Xo(H,$){let A=H.match(K1);if(!A)return;let L=A[1],D=$.tryCharCost;return cT({characters:L,cost:D},$)}function Qo(H,$){let A=H.match(Wo);if(!A)return;return{map:A[1],insDel:Math.max($.nonAlphabetCosts-$.tryCharCost,0),penalty:$.nonAlphabetCosts+$.tryCharCost}}function Jo(H,$){let A=H.match(Bo);if(!A)return;let L=H.startsWith("REP")?$.replaceCosts:$.ioConvertCost,D=A[1],I=A[2];if(I=I.replace(/^0$/,""),D.startsWith("^")&&!I.startsWith("^"))I="^"+I;if(D.endsWith("$")&&!I.endsWith("$"))I=I+"$";return{map:fL([D,I]),replace:L}}function Zo(H,$){let A=H.match(lT);if(!A)return;let L=A[1],D=[...I1(L)].map(Co((M,W)=>({a:M.b,b:W}),{a:"|",b:"|"})).filter((M)=>M.a!=="|"&&M.b!=="|").map(({a:M,b:W})=>fL([M,W])),I=D.map((M)=>M.toLocaleUpperCase($.locale)),E=LT([...D,...I]).join("|"),K=$.keyboardCost;return{map:E,replace:K,swap:K}}function Yo(H,$){let A=H.match(lT);if(!A)return;return iT(A[1],$)}function Go(H,$){let A=H.match(E1);if(!A)return;return iT(A[1],$)}function Uo(H,$){let A=H.match(K1);if(!A)return;return D1(A[1],$.locale,$)}function Vo(H,$){let A=H.match(E1);if(!A)return;return D1(A[1],$.locale,$)}function iT(H,$){let A=$.locale,L=LT([...I1(H)].filter((I)=>I!=="|").map((I)=>EM(I,A)).filter((I)=>I.length>1).map(fL)).join("|"),D=$.capsCosts;if(!L)return;return{map:L,replace:D}}function Co(H,$){let A=$;return(L,D)=>A=H(A,L,D)}function zo(H){return Array.isArray(H)?H:[H]}function Po(H){let $=H.locale,A=$?rt($).filter((K)=>K.isValid()):void 0,L=A?.map((K)=>K.locale),D=$o(H.costs),I=H.suggestionEditCosts||[],E=H.hunspellInformation?Io(H.hunspellInformation,A):[];return[...I,...qo(H.alphabet,L,D),...To(H.accents,D),...E]}function qo(H,$,A){let L=nT(H,"a-zA-Z",A.baseCost);return[...WH(L,UH((D)=>pT(D,$,A)),V$()),...Lo(L,A)]}function nT(H,$,A,L){if(H=H??$,!H)return[];if(typeof H==="string")H=[{characters:H,cost:A}];if(L!==void 0)H.forEach((D)=>D.penalty=L);return H}function To(H,$){return nT(H,"̀-́",$.accentCosts).map((A)=>Do(A,$)).filter($T)}function _o(H){if(!H.adjustments)return[];return H.adjustments.map(No)}function No(H){let{id:$,regexp:A,penalty:L}=H;return{id:$,regexp:new RegExp(A),penalty:L}}function BM(H){let $=[...Po(H),...Fo],A=_o(H),L=bn(...$);return un(L,...Oo,...A),L}function xo(H,$,A={}){let L=I8(A),D=c0($,A1(L));return D.collect(aT(H,$,{...L,...D.genSuggestionOptions})),D.suggestions}function*aT(H,$,A={}){let L=Array.isArray(H)?H:[H];for(let D of L)yield*ko(D,$,A)}function*ko(H,$,A={}){let{compoundMethod:L=bH.NONE,changeLimit:D,ignoreCase:I}=I8(A),E=[],K=new Map,M=DM,W=wo,X=[[]],J=[],Z=" "+$,Q=Z.length-1,B=Object.assign(Object.create(null),{[p0]:gq,[F3]:gq}),Y=Object.assign(Object.create(null),{"-":jo}),G=!1,U=M*Math.min($.length*Ro,D);function V(O){switch(typeof O){case"number":U=O;break;case"symbol":G=!0;break}}let z=0,P=0;for(let O=0,N=0;O<=Q&&N<=U;++O)N=O*DM,X[0][O]=N,P=O;J[0]={a:z,b:P};let T=Zn(H,I,$,L,A.compoundSeparator),q=!0;for(let O=T.next({goDeeper:q});!G&&!O.done;O=T.next({goDeeper:q})){let{text:N,node:x,depth:w}=O.value,{a:F,b:f}=J[w],j=N.slice(-1),S=rK[j]||0;if(So.has(j)){let HH=X[w].slice(F,f+1),e=Math.min(...HH),_H=[F,...HH.map((o)=>o-e)].join(","),SH=K.get(_H);if(SH&&SH.m<=e){q=!1;let{i:o,w:JH,m:t}=SH;if(o>=E.length)continue;if(E[o].word.slice(0,JH.length)!==JH)continue;let BH=e-t;for(let qH=o;qH<E.length;++qH){let{word:kH,cost:$H}=E[qH];if(kH.slice(0,JH.length)!==JH)break;let wH=$H+BH;if(wH<=U)V(yield{word:N+kH.slice(JH.length),cost:wH})}continue}else K.set(_H,{w:N,i:E.length,m:e})}let _=w+1,u=_>1?N[_-2]:"",h=M-_+(Y[j]||0),d=h+(B[j]||0);X[_]=X[_]||[],X[_][F]=X[_-1][F]+d+_-F;let l=Z[F],k=X[_][F],p;for(p=F+1;p<=f;++p){let HH=Z[p],e=rK[HH]||0,_H=j===HH?0:S&e?mq:HH===u?j===l?W:h:h,SH=Math.min(X[_-1][p-1]+_H,X[_-1][p]+d,X[_][p-1]+h);k=Math.min(k,SH),X[_][p]=SH,l=HH}let{b:LH}=J[_-1];while(f<Q){f+=1,p=f;let HH=Z[p],e=rK[HH]||0,_H=j===HH?0:S&e?mq:HH===u?j===l?W:h:h,SH=Math.min(LH,p-1),o=Math.min(X[_-1][SH]+_H,X[_][p-1]+h);if(k=Math.min(k,o),X[_][p]=o,l=HH,o>U)break}for(;f>F&&X[_][f]>U;f-=1);for(;F<f&&X[_][F]>U;F+=1);f=Math.min(f+1,Q),J[_]={a:F,b:f};let IH=X[_][f];if(x.f&&_T(x)&&IH<=U){let HH={word:N,cost:IH};E.push(HH),V(yield HH)}else V(yield void 0);q=k<=U}}function ho(H){if(!("id"in H))console.warn("%o",H);if(!Object.isFrozen(H)||!("id"in H))throw Error("Must be TrieNodeExFrozen")}function po(H){let $=H||C$,{commentCharacter:A=C$.commentCharacter,optionalCompoundCharacter:L=C$.optionalCompoundCharacter,compoundCharacter:D=C$.compoundCharacter,caseInsensitivePrefix:I=C$.caseInsensitivePrefix,forbiddenPrefix:E=C$.forbiddenPrefix,keepExactPrefix:K=C$.keepExactPrefix,splitSeparator:M=C$.splitSeparator,splitKeepBoth:W=C$.splitKeepBoth,stripCaseAndAccentsKeepDuplicate:X=C$.stripCaseAndAccentsKeepDuplicate,stripCaseAndAccentsOnForbidden:J=C$.stripCaseAndAccentsOnForbidden,keepOptionalCompoundCharacter:Z=C$.keepOptionalCompoundCharacter}=$,{stripCaseAndAccents:Q=C$.stripCaseAndAccents,split:B=C$.split}=$;function Y(j){return typeof j==="string"}function G(j){return j.trim()}function U(j){let S=j.indexOf(A);if(S<0)return j;let _=j.indexOf(mo,S);if(_>=0){let u=j.slice(_).split(/[\s,;]/g).map((h)=>h.trim()).filter((h)=>!!h);for(let h of u)switch(h){case"split":B=!0;break;case"no-split":B=!1;break;case"no-generate-alternatives":Q=!1;break;case"generate-alternatives":Q=!0;break}}return j.slice(0,S).trim()}function V(j){return!!j}function*z(j){if(j[0]===L){let S=j.slice(1);yield S,yield D+S}else yield j}function*P(j){if(j.slice(-1)===L){let S=j.slice(0,-1);yield S,yield S+D}else yield j}let T=Object.create(null);if([I,K,'"'].forEach((j)=>T[j]=!0),!J)T[E]=!0;function q(j){return j.startsWith(I+I)?j.slice(1):j}function O(j){return j=j.replaceAll(/"(.*?)"/g,"$1"),j[0]===K?j.slice(1):j}function N(j){return uo(O(j))}function*x(j){let S=N(j),_=new Set;if(_.add(S),Q&&!(j[0]in T))for(let u of go(S))(X||u!==S)&&_.add(I+u);yield*_}function*w(j){for(let S of j){if(B){if(yield*ao(S.includes('"')?S.replaceAll(/".*?"/g,(_)=>" "+_.replaceAll(/(\s)/g,"\\$1")+" "):S,M).map((_)=>_.replaceAll("\\","")),!W)continue}yield S}}function*F(j){for(let S of j)yield*S.split(`
|
|
314
|
+
`)}let f=Z?[]:[E$(z),E$(P)];return Y3(vH(Y),F,UH(U),w,UH(G),vH(V),...f,E$(x),UH(q))}function w3(H,$){return po($)(typeof H==="string"?[H]:H)}function io(H){return H.replaceAll(co,($,A)=>"<<"+encodeURIComponent(A)+">>")}function no(H){return H.replaceAll(lo,($,A)=>"\\"+decodeURIComponent(A))}function ao(H,$){return io(H).split($).map((A)=>no(A))}var Gq,cq=3,HM,ei,lq,En,F3="+",p0=" ",bH,Vn,Cn,zn,Cq=class H{id;_keys;constructor($){this.node=$,this.id=$}get eow(){return!!this.node.f}get size(){if(!this.node.c)return 0;return this.keys().length}keys(){if(this._keys)return this._keys;let $=this.node.c?Object.keys(this.node.c):Vn;return this._keys=$,$}values(){return!this.node.c?Cn:Object.values(this.node.c).map(($)=>H.toITrieNode($))}entries(){return!this.node.c?zn:Object.entries(this.node.c).map(([$,A])=>[$,H.toITrieNode(A)])}get($){let A=this.node.c?.[$];if(!A)return;return H.toITrieNode(A)}getNode($){return this.findNode($)}has($){let A=this.node.c;return A&&$ in A||!1}child($){let A=this.keys()[$],L=A&&this.get(A);if(!L)throw Error("Index out of range.");return L}hasChildren(){return!!this.node.c}#H($){let A=this.node;for(let L of $){if(!A)return;A=A.c?.[L]}return A}findNode($){let A=this.#H($);return A&&H.toITrieNode(A)}findExact($){let A=this.#H($);return!!A&&!!A.f}static toITrieNode($){return new this($)}},Pn,_n,On,wn,Rn,gB,oq="∙",p$,kn,RkH,yn,rK,vn,on=class{constructor(H){this.weightMap=H}*calcInsDelCosts(H){let{a:$,ai:A,b:L,bi:D,c:I,p:E}=H;for(let K of oK(this.weightMap.insDel,$,A))yield{a:$,b:L,ai:K.i,bi:D,c:I+K.c,p:E+K.p};for(let K of oK(this.weightMap.insDel,L,D))yield{a:$,b:L,ai:A,bi:K.i,c:I+K.c,p:E+K.p}}*calcReplaceCosts(H){let{a:$,ai:A,b:L,bi:D,c:I,p:E}=H;for(let K of Tq(this.weightMap.replace,$,A))for(let M of oK(K.t,L,D))yield{a:$,b:L,ai:K.i,bi:M.i,c:I+M.c,p:E+M.p}}*calcSwapCosts(H){let{a:$,ai:A,b:L,bi:D,c:I,p:E}=H,K=this.weightMap.swap;for(let M of Tq(K,$,A))for(let W of oK(M.t,$,M.i)){let X=$.slice(M.i,W.i)+$.slice(A,M.i);if(L.slice(D).startsWith(X)){let J=X.length;yield{a:$,b:L,ai:A+J,bi:D+J,c:I+W.c,p:E+W.p}}}}calcAdjustment(H){let $=0;for(let A of this.weightMap.adjustments.values())if(A.regexp.global)for(let L of H.matchAll(A.regexp))$+=A.penalty;else if(A.regexp.test(H))$+=A.penalty;return $}},$a=class{pool=new gB(La);grid=[];constructor(H,$){this.aN=H,this.bN=$}next(){let H;while(H=this.pool.dequeue())if(!H.d)return H}add(H){let $=Aa(H.ai,H.bi,this.bN),A=this.grid[$];if(!A){this.grid[$]=H,this.pool.add(H);return}if(A.c<=H.c)return;A.d=!0,this.grid[$]=H,this.pool.add(H)}},Da,Ia=100,_q=void 0,Xa=10,Nq=100,IT=5,Wa=0.515,Qa,Ba,Ja,Za=5,ET=1000,Fq,wq,rB="+",_a="*",E8="~",eB="!",Na="#",Fa="=",H1,kL=class H{remaining=0;value=0;decode($){let A=this.remaining;if($&-256)return this.reset();if(($&128)===0){if(A)return this.reset();return $}if(A){if(($&192)!==128)return this.reset();let L=this.value;return L=L<<6|$&63,this.value=L,A-=1,this.remaining=A,A?void 0:L}if(($&224)===192){this.value=$&31,this.remaining=1;return}if(($&240)===224){this.value=$&15,this.remaining=2;return}if(($&248)===240){this.value=$&7,this.remaining=3;return}return this.reset()}reset(){return this.remaining=0,this.value=0,65533}clone($=new H){return $.remaining=this.remaining,$.value=this.value,$}static isMultiByte($){return($&128)!==0}static isSingleByte($){return($&128)===0}static create(){return new this}},QT=class{#H;#$="";#A=[];#L;constructor(H){this.charIndex=H,this.#H=ya(H),this.#L=[...this.#H.values()].some(($)=>$.length>1)}getCharUtf8Seq(H){let $=this.#H.get(H);if($)return $;let A=mB(H);return this.#H.set(H,A),A}wordToUtf8Seq(H){if(this.#$===H)return this.#A;let $=mB(H);return this.#$=H,this.#A=$,$}indexContainsMultiByteChars(){return this.#L}get size(){return this.charIndex.length}toJSON(){return{charIndex:this.charIndex}}},fa=class{charIndex=[];charIndexMap=new Map;charIndexSeqMap=new Map;#H=new Map;constructor(){this.getUtf8Value("")}getUtf8Value(H){let $=this.charIndexMap.get(H);if($!==void 0)return $;let A=H.normalize("NFC");this.charIndex.push(A);let L=xa(A.codePointAt(0)||0);return this.charIndexMap.set(H,L),this.charIndexMap.set(A,L),this.charIndexMap.set(H.normalize("NFD"),L),L}utf8ValueToUtf8Seq(H){let $=this.#H.get(H);if($!==void 0)return $;let A=va(H);return this.#H.set(H,A),A}charToUtf8Seq(H){let $=this.getUtf8Value(H);return this.utf8ValueToUtf8Seq($)}wordToUtf8Seq(H){let $=Array(H.length),A=0;for(let L of H){let D=this.getUtf8Value(L),I=this.utf8ValueToUtf8Seq(D);if(typeof I==="number"){$[A++]=I;continue}for(let E of I)$[A++]=E}if($.length!==A)$.length=A;return $}get size(){return this.charIndex.length}build(){return new QT(this.charIndex)}},BT=class{NodeMaskEOW;NodeMaskChildCharIndex;NodeChildRefShift;isIndexDecoderNeeded;info;constructor(H,$,A,L){this.nodes=H,this.charIndex=$;let{NodeMaskEOW:D,NodeMaskChildCharIndex:I,NodeChildRefShift:E}=A;this.NodeMaskEOW=D,this.NodeMaskChildCharIndex=I,this.NodeChildRefShift=E,this.isIndexDecoderNeeded=$.indexContainsMultiByteChars(),this.info=LA(L)}},ha,ga,ma,da,Rq=class H{id;node;eow;_keys;_count;_size;_chained;_nodesEntries;_entries;_values;charToIdx;constructor($,A){this.trie=$,this.nodeIdx=A;let L=$.nodes[A];this.node=L,this.eow=!!(L[0]&$.NodeMaskEOW),this._count=L.length-1,this.id=A,this.findExact=(D)=>$.nodeFindExact(A,D)}keys(){if(this._keys)return this._keys;if(!this._count)return ga;return this._keys=this.getNodesEntries().map(([$])=>$),this._keys}values(){if(!this._count)return ma;if(this._values)return this._values;return this._values=this.entries().map(([,$])=>$),this._values}entries(){if(this._entries)return this._entries;if(!this._count)return da;return this._entries=this.getNodesEntries().map(([$,A])=>[$,new H(this.trie,A)]),this._entries}get($){let A=this.trie.nodeGetChild(this.id,$);if(A===void 0)return;return new H(this.trie,A)}getNode($){let A=this.trie.nodeFindNode(this.id,$);if(A===void 0)return;return new H(this.trie,A)}has($){return this.trie.nodeGetChild(this.id,$)!==void 0}hasChildren(){return this._count>0}child($){if(!this._values&&!this.containsChainedIndexes()){let A=this.node[$+1]>>>this.trie.NodeChildRefShift;return new H(this.trie,A)}return this.values()[$]}getCharToIdxMap(){let $=this.charToIdx;if($)return $;let A=Object.create(null),L=this.keys();for(let D=0;D<L.length;++D)A[L[D]]=D;return this.charToIdx=A,A}findExact($){return this.trie.nodeFindExact(this.id,$)}isForbidden($){let A=this.trie.nodeGetChild(this.id,this.trie.info.forbiddenWordPrefix);if(A===void 0)return!1;return this.trie.nodeFindExact(A,$)}findCaseInsensitive($){let A=this.trie.nodeGetChild(this.id,this.trie.info.stripCaseAndAccentsPrefix);if(A===void 0)return!1;return this.trie.nodeFindExact(A,$)}containsChainedIndexes(){if(this._chained!==void 0)return this._chained;if(!this._count||!this.trie.isIndexDecoderNeeded)return this._chained=!1,!1;let $=!1,A=this.trie.NodeMaskChildCharIndex,L=this._count,D=this.node;for(let I=1;I<=L&&!$;++I){let E=D[I]&A;$=kL.isMultiByte(E)}return this._chained=!!$,this._chained}getNodesEntries(){if(this._nodesEntries)return this._nodesEntries;if(!this.containsChainedIndexes()){let $=Array(this._count),A=this.node,L=this.trie.NodeMaskChildCharIndex,D=this.trie.NodeChildRefShift;for(let I=0;I<this._count;++I){let E=A[I+1],K=E&L;$[I]=[String.fromCodePoint(K),E>>>D]}return this._nodesEntries=$,$}return this._nodesEntries=this.walkChainedIndexes(),this._nodesEntries}walkChainedIndexes(){let $=this.trie.NodeMaskChildCharIndex,A=this.trie.NodeChildRefShift,L=this.trie.nodes,D=kL.create(),I=[{n:this.node,c:1,acc:D}],E=0,K=Array(this._count),M=0;while(E>=0){let W=I[E],{n:X,c:J}=W;if(J>=X.length){--E;continue}++W.c;let Z=X[J],Q=Z&$,B=W.acc.clone(),Y=B.decode(Q);if(Y!==void 0){let V=String.fromCodePoint(Y),z=Z>>>A;K[M++]=[V,z];continue}let G=Z>>>A,U=I[++E];if(U)U.n=L[G],U.c=1,U.acc=B;else I[E]={n:L[G],c:1,acc:B}}return K}get size(){if(this._size===void 0){if(!this.containsChainedIndexes())return this._size=this._count,this._size;this._size=this.getNodesEntries().length}return this._size}},pa,ca=class{NodeMaskEOW;NodeMaskNumChildren;NodeMaskChildCharIndex;NodeChildRefShift;isIndexDecoderNeeded;nodeFindExact;isForbidden;findExact;nodeGetChild;nodeFindNode;hasForbiddenWords;hasCompoundWords;hasNonStrictWords;constructor(H,$,A,L){this.nodes=H,this.charIndex=$;let{NodeMaskEOW:D,NodeMaskChildCharIndex:I,NodeMaskNumChildren:E,NodeChildRefShift:K}=A;this.NodeMaskEOW=D,this.NodeMaskNumChildren=E,this.NodeMaskChildCharIndex=I,this.NodeChildRefShift=K,this.isIndexDecoderNeeded=$.indexContainsMultiByteChars(),this.nodeFindExact=L.nodeFindExact,this.isForbidden=L.isForbidden,this.findExact=L.findExact,this.nodeGetChild=L.nodeGetChild,this.nodeFindNode=L.nodeFindNode,this.hasForbiddenWords=L.hasForbiddenWords,this.hasCompoundWords=L.hasCompoundWords,this.hasNonStrictWords=L.hasNonStrictWords}},la,ia,na,jq=class H{id;node;eow;_keys;_count;_size;_chained;_nodesEntries;_entries;_values;charToIdx;constructor($,A){this.trie=$,this.nodeIdx=A;let L=$.nodes[A];this.node=L,this.eow=!!(L&$.NodeMaskEOW),this._count=L&$.NodeMaskNumChildren,this.id=A}keys(){if(this._keys)return this._keys;if(!this._count)return la;return this._keys=this.getNodesEntries().map(([$])=>$),this._keys}values(){if(!this._count)return ia;if(this._values)return this._values;return this._values=this.entries().map(([,$])=>$),this._values}entries(){if(this._entries)return this._entries;if(!this._count)return na;return this._entries=this.getNodesEntries().map(([$,A])=>[$,new H(this.trie,A)]),this._entries}get($){return this.#$($)}has($){return this.trie.nodeGetChild(this.nodeIdx,$)!==void 0}hasChildren(){return this._count>0}child($){if(!this._values&&!this.containsChainedIndexes()){let A=this.trie.nodes[this.nodeIdx+$+1]>>>this.trie.NodeChildRefShift;return new H(this.trie,A)}return this.values()[$]}#H($){return this.trie.nodeGetChild(this.nodeIdx,$)}#$($){if(this.charToIdx){let L=this.charToIdx[$];if(L===void 0)return;return this.child(L)}let A=this.#H($);if(A===void 0)return;return new H(this.trie,A)}getCharToIdxMap(){let $=this.charToIdx;if($)return $;let A=Object.create(null),L=this.keys();for(let D=0;D<L.length;++D)A[L[D]]=D;return this.charToIdx=A,A}getNode($){let A=this.trie.nodeFindNode(this.nodeIdx,$);return A===void 0?void 0:new H(this.trie,A)}findExact($){return this.trie.nodeFindExact(this.nodeIdx,$)}containsChainedIndexes(){if(this._chained!==void 0)return this._chained;if(!this._count||!this.trie.isIndexDecoderNeeded)return this._chained=!1,!1;let $=!1,A=this.trie.NodeMaskChildCharIndex,L=this.nodeIdx+1,D=this.trie.nodes,I=this._count;for(let E=0;E<I&&!$;++E){let K=D[E+L]&A;$=kL.isMultiByte(K)}return this._chained=!!$,this._chained}getNodesEntries(){if(this._nodesEntries)return this._nodesEntries;if(!this.containsChainedIndexes()){let $=Array(this._count),A=this.trie.nodes,L=this.nodeIdx+1,D=this.trie.NodeMaskChildCharIndex,I=this.trie.NodeChildRefShift;for(let E=0;E<this._count;++E){let K=A[L+E],M=K&D;$[E]=[String.fromCodePoint(M),K>>>I]}return this._nodesEntries=$,$}return this._nodesEntries=this.walkChainedIndexes(),this._nodesEntries}walkChainedIndexes(){let $=this.trie.NodeMaskChildCharIndex,A=this.trie.NodeChildRefShift,L=this.trie.NodeMaskNumChildren,D=this.trie.nodes,I=kL.create(),E=[{nodeIdx:this.nodeIdx+1,lastIdx:this.nodeIdx+this._count,acc:I}],K=0,M=Array(this._count),W=0;while(K>=0){let X=E[K],{nodeIdx:J,lastIdx:Z}=X;if(J>Z){--K;continue}++X.nodeIdx;let Q=D[J],B=Q&$,Y=X.acc.clone(),G=Y.decode(B);if(G!==void 0){let P=String.fromCodePoint(G),T=Q>>>A;M[W++]=[P,T];continue}let U=Q>>>A,V=U+(D[U]&L),z=E[++K];if(z)z.nodeIdx=U+1,z.lastIdx=V,z.acc=Y;else E[K]={nodeIdx:U+1,lastIdx:V,acc:Y}}return M}get size(){if(this._size===void 0){if(!this.containsChainedIndexes())return this._size=this._count,this._size;this._size=this.getNodesEntries().length}return this._size}},aa,ta=8,oa=0,eK=32,ZT=0,YT,GT,UT,VT,CT,Sq,d$,zT="TrieBlob",sa="00.01.00",xq=67305985,jH,yq,$t,$1,Lt=3,qT=class H{_info;root;count;weightMap;#H=this.createFindOptions({compoundMode:"compound"});hasForbiddenWords;hasCompoundWords;hasNonStrictWords;constructor($,A){this.data=$,this.numNodes=A,this.root=$.getRoot(),this._info=LA($.info),this.hasForbiddenWords=$.hasForbiddenWords,this.hasCompoundWords=$.hasCompoundWords,this.hasNonStrictWords=$.hasNonStrictWords}numWords(){return this.count??=Jn(this.root),this.count}isNumWordsKnown(){return this.count!==void 0}get size(){return this.data.size}get info(){return this._info}get isCaseAware(){return this.info.isCaseAware??!0}find($){return Hn(this.data.getRoot(),$,this.#H).node}has($,A){if(this.hasWord($,!1))return!0;if(A)return!!this.findWord($,{useLegacyWordCompounds:A}).found;return!1}hasWord($,A){return!!this.findWord($,{caseSensitive:A,checkForbidden:!1}).found}findWord($,A){if(A?.useLegacyWordCompounds){let L=A.useLegacyWordCompounds!==!0?A.useLegacyWordCompounds:Lt,D=this.createFindOptions({legacyMinCompoundLength:L,matchCase:A.caseSensitive||!1});return nq(this.root,$,D)}return $n(this.root,$,{matchCase:A?.caseSensitive,checkForbidden:A?.checkForbidden})}isForbiddenWord($){return this.hasForbiddenWords&&A8(this.root,$,this.info.forbiddenWordPrefix)}completeWord($){let A=this.find($),L=this.info.compoundCharacter,D=WH(A?Uq(A):[],vH((I)=>I[I.length-1]!==L),UH((I)=>$+I));return WH(A&&A.eow?[$]:[],oA(D))}suggest($,A){return this.suggestWithCost($,A).map((L)=>L.word)}suggestWithCost($,A){let L=A.compoundSeparator,D=A.weightMap||this.weightMap,I=L?tB(L,""):(W)=>W,E=A.filter,M={...A,filter:E?(W,X)=>{let J=I(W);return!this.isForbiddenWord(J)&&E(J,X)}:(W)=>!this.isForbiddenWord(I(W)),weightMap:D};return Ua(this.data,$,M)}genSuggestions($,A){let L=(E)=>!this.isForbiddenWord(E),D=I8(A1({compoundMethod:A,...$.genSuggestionOptions})),I=KT(this.data,$.word,D);$.collect(I,void 0,L)}words(){return Uq(this.root)}iterate(){return Wn(this.root)}static create($,A){let L=new $1(A);return L.insert($),new H(L.build(),void 0)}createFindOptions($){return En($)}},yL=1,wT,Bt,L1,$8=class H{_iTrieRoot;info;_size;hasForbiddenWords;hasCompoundWords;hasNonStrictWords;constructor($){this.root=$,this.info=LA($),this.hasForbiddenWords=!!$.c[$.forbiddenWordPrefix],this.hasCompoundWords=!!$.c[$.compoundCharacter],this.hasNonStrictWords=!!$.c[$.stripCaseAndAccentsPrefix]}wordToCharacters=($)=>[...$];get iTrieRoot(){return this._iTrieRoot||(this._iTrieRoot=Un(this.root))}getRoot(){return this.iTrieRoot}getNode($){return aB(this.getRoot(),$)}words(){return dB(this.root)}has($){return cB(this.root,$)}isForbiddenWord($){return cB(this.root.c[this.root.forbiddenWordPrefix],$)}get size(){return this._size??=Mt(this.root)}static createFromWords($,A){return new H(pB($,A))}static createFromWordsAndConsolidate($,A){return new H(OT(pB($,A)))}},xT="*",iB,Pt="*",kT="__DATA__",MM="$",xL="<",XM=`
|
|
315
|
+
`,WM="\r",QM="#",nB="@",L8=";",d0="\\",yT="[",fT="]",vT="/",jkH,bT,SkH,_t,xkH,Nt="__DATA__",Ot,hq,jt,kkH=class{_cursor;root={...H1,c:Object.create(null)};shouldSort=!1;wordToCharacters=(H)=>[...H];setOptions(H){let $=LA(H,this.root);return Object.assign(this.root,$),$}build(){return new $8(this.root)}getCursor(){return this._cursor??=this.createCursor(),this._cursor}setCharacterSet(H){this.shouldSort=!0}createCursor(){let H=[this.root,hq],$=hq;bq(Object.keys(this.root.c).length===0,"The Trie MUST be empty for cursors to work.");let A=[{n:this.root,c:""}],L=this.root,D=0;return{insertChar:(W)=>{if(It(W),L.k){let B=A[D],{k:Y,c:G,...U}=L;if(L=B.n.c[B.c]=U,G)L.c=Object.assign(Object.create(null),G);H.push(L)}let X=L.c||Object.create(null);L.c=X;let J=L,Z=X[W]=X[W]||{};H.push(Z),++D;let Q=A[D];if(Q)Q.n=J,Q.c=W;else A.push({n:J,c:W});L=Z},markEOW:()=>{if(!L.c){let W=A[D];if(W.n.c[W.c]=$,H[H.length-1]===L)H.pop();L=$}else L.f=1},reference:(W)=>{let X=A[D];X.n.c[X.c]=H[W],H.pop()},backStep:(W)=>{if(!W)return;bq(W<=D&&W>0),D-=W,L=A[D+1].n}}}sortChildren(H){let $=Object.entries(H.c).sort((A,L)=>jt(A[0],L[0]));H.c=Object.fromEntries($);for(let A of Object.values(H.c))if(A.c)this.sortChildren(A)}sortNodes(){if(this.shouldSort)this.sortChildren(this.root)}},St,xt,uq="__DATA__",ut,gt,ykH,fkH,dt,hB,pt=class{_raw;_locale;constructor(H){this._raw=H,this._locale=nt(H)}get locale(){return this._locale}localInfo(){return tt(this._locale)}isValid(){return at(this._locale)}toJSON(){return this.locale}toString(){return this.locale}},ct,lt,it,dT,et,E1,K1,Wo,Bo,lT,Fo,Oo,DM,wo,gq=-1,mq,Ro,jo,So,dq=3,yo=class H{_options;_findOptionsDefaults;_findOptionsExact;isLegacy;hasForbidden;constructor($,A){this.root=$,this.count=A,this._options=LA($),this.isLegacy=this.calcIsLegacy(),this.hasForbidden=!!$.c[$.forbiddenWordPrefix],this._findOptionsDefaults={caseInsensitivePrefix:this._options.stripCaseAndAccentsPrefix,compoundFix:this._options.compoundCharacter,forbidPrefix:this._options.forbiddenWordPrefix},this._findOptionsExact=this.createFindOptions({compoundMode:"none"})}size(){return this.count=this.count??Xt(this.root),this.count}isSizeKnown(){return this.count!==void 0}get options(){return this._options}find($,A=!1){let L=!A?void 0:A===!0?dq:A,D=this.createFindOptions({compoundMode:L?"legacy":"compound",legacyMinCompoundLength:L});return Zt(this.root,$,D).node}has($,A){if(this.hasWord($,!1))return!0;if(A)return!!this.findWord($,{useLegacyWordCompounds:A}).found;return!1}hasWord($,A){let L=this.findWord($,{caseSensitive:A});return!!L.found&&!L.forbidden}findWord($,A){if(A?.useLegacyWordCompounds){let D=A.useLegacyWordCompounds!==!0?A.useLegacyWordCompounds:dq,I=this.createFindOptions({legacyMinCompoundLength:D,matchCase:A.caseSensitive});return jT(this.root,$,I)}let L=this.createFindOptionsMatchCase(A?.caseSensitive);return Jt(this.root,$,L)}isForbiddenWord($){return this.hasForbidden&&lB(this.root,$,this.options.forbiddenWordPrefix)}completeWord($){let A=this.find($),L=this.options.compoundCharacter,D=WH(dB(A||{}),vH((I)=>I[I.length-1]!==L),UH((I)=>$+I));return WH(A&&_T(A)?[$]:[],oA(D))}suggest($,A){return this.suggestWithCost($,A).map((L)=>L.word)}suggestWithCost($,A){let L=A.compoundSeparator,D=L?tB(L,""):(M)=>M,I=A.filter,K={...A,filter:I?(M,W)=>{let X=D(M);return!this.isForbiddenWord(X)&&I(X,W)}:(M)=>!this.isForbiddenWord(D(M))};return xo(this.root,$,K)}genSuggestions($,A){let L=(E)=>!this.isForbiddenWord(E),D=A1({compoundMethod:A,...$.genSuggestionOptions}),I=aT(this.root,$.word,D);$.collect(I,void 0,L)}words(){return dB(this.root)}iterate(){return Fn(this.root)}insert($){return TT($,this.root),this}calcIsLegacy(){let $=this.root.c;return!($&&$[this._options.compoundCharacter]||$[this._options.stripCaseAndAccentsPrefix]||$[this._options.forbiddenWordPrefix])}static create($,A){let L=pB($,A);return NT(L),new H(L,void 0)}createFindOptions($={}){return L1({...this._findOptionsDefaults,...$})}lastCreateFindOptionsMatchCaseMap=new Map;createFindOptionsMatchCase($){let A=this.lastCreateFindOptionsMatchCaseMap.get($);if(A!==void 0)return A;let L=this.createFindOptions({matchCase:$});return this.lastCreateFindOptionsMatchCaseMap.set($,L),L}},uB=class{map0=new Map;map1=new Map;constructor(H){this.maxL0Size=H}has(H){if(this.map0.has(H))return!0;if(this.map1.has(H))return this.set(H,this.get1(H)),!0;return!1}get(H){return this.map0.get(H)??this.get1(H)}set(H,$){if(this.map0.size>=this.maxL0Size&&!this.map0.has(H))this.map1=this.map0,this.map0=new Map;return this.map0.set(H,$),this}get size(){return this.map0.size+this.map1.size}get size0(){return this.map0.size}get size1(){return this.map1.size}clear(){return this.map0.clear(),this.map1.clear(),this}get1(H){if(this.map1.has(H)){let $=this.map1.get(H);return this.map1.delete(H),this.map0.set(H,$),$}}toArray(){return[...this.map1,...this.map0]}},fo=1e5,vo=1e6,bo=1e6,vkH=class{count=0;signatures=new uB(fo);cached=new uB(bo);transforms=new uB(vo);_eow;lastPath=[{s:"",n:{id:0,f:void 0,c:void 0}}];tails=new Map;trieOptions;numWords=0;_debug_lastWordsInserted=[];_debug_mode=!1;constructor(H,$){if(this._eow=this.createNodeFrozen(1),this.tails.set("",this._eow),this._canBeCached(this._eow),this.signatures.set(this.signature(this._eow),this._eow),this.cached.set(this._eow,this._eow.id??++this.count),this.trieOptions=Object.freeze(LA($)),H)this.insert(H)}get _root(){return K8(this.lastPath[0].n,this.trieOptions)}signature(H){let $=H.f?"*":"",A=H.c?Object.entries(H.c):void 0,L=A?A.map(([D,I])=>[D,this.cached.get(I)]):void 0;return $+(L?JSON.stringify(L):"")}_canBeCached(H){if(!H.c)return!0;for(let $ of Object.values(H.c))if(!this.cached.has($))return!1;return!0}tryCacheFrozen(H){if(ho(H),this.cached.has(H))return H;return this.cached.set(H,H.id??++this.count),H}freeze(H){if(Object.isFrozen(H))return H;if(H.c){let $=Object.entries(H.c).sort((A,L)=>A[0]<L[0]?-1:1).map(([A,L])=>[A,this.freeze(L)]);H.c=Object.fromEntries($),Object.freeze(H.c)}return Object.freeze(H)}tryToCache(H){if(!this._canBeCached(H))return H;let $=this.signature(H),A=this.signatures.get($);if(A!==void 0)return this.tryCacheFrozen(A);return this.signatures.set($,this.freeze(H)),H}storeTransform(H,$,A){if(!Object.isFrozen(A)||!Object.isFrozen(H))return;this.logDebug("storeTransform",()=>({s:$,src:this.debNodeInfo(H),result:this.debNodeInfo(A)}));let L=this.transforms.get(H)??new Map;L.set($,A),this.transforms.set(H,L)}addChild(H,$,A){if(H.c?.[$]!==A){let L=H.c||Object.create(null);if(Object.isFrozen(L))L=Object.assign(Object.create(null),L);if(L[$]=A,Object.isFrozen(H))H=this.createNode(H.f,L);else H.c=L}return Object.isFrozen(A)?this.tryToCache(H):H}buildTail(H){let $=H.join(""),A=this.tails.get($);if(A)return A;let L=H[0],D=H.slice(1),I=this.tails.get(D.join("")),E=I||this.buildTail(D),K=this.addChild(this.createNode(),L,E);if(!I)return K;let M=this.tryCacheFrozen(this.freeze(K));return this.tails.set($,M),M}_insert(H,$,A){this.logDebug("_insert",()=>({n:this.debNodeInfo(H),s:$,d:A,w:this.lastPath.map((M)=>M.s).join("")}));let L=H;if(Object.isFrozen(H)){let M=this.transforms.get(H)?.get($.join(""));if(M)return this.tryCacheFrozen(M)}if(!$.length)if(!H.c)return this._eow;else return H=this.copyIfFrozen(H),H.f=this._eow.f,H;let D=$[0],I=$.slice(1),E=H.c?.[D],K=E?this._insert(E,I,A+1):this.buildTail(I);return H=this.addChild(H,D,K),this.storeTransform(L,$.join(""),H),this.lastPath[A]={s:D,n:K},H}insertWord(H){this.logDebug("insertWord",H),this._debug_lastWordsInserted[this.numWords&15]=H,this.numWords++;let $=[...H],A=1;for(let I of $){if(this.lastPath[A]?.s!==I)break;A++}if($.length<A)A=$.length;this.lastPath.length=A,A-=1;let{n:L}=this.lastPath[A],D=$.slice(A);this.lastPath[A].n=this._insert(L,D,A+1);while(A>0){let{s:I,n:E}=this.lastPath[A];A-=1;let K=this.lastPath[A],M=K.n;if(K.n=this.addChild(M,I,E),M===K.n)break;let W=$.slice(A);this.storeTransform(M,W.join(""),K.n)}}insert(H){for(let $ of H)$&&this.insertWord($)}reset(){this.lastPath=[{s:"",n:{id:0,f:void 0,c:void 0}}],this.cached.clear(),this.signatures.clear(),this.signatures.set(this.signature(this._eow),this._eow),this.count=0,this.cached.set(this._eow,this._eow.id??++this.count)}build(H=!1){let $=this._root;this.reset();let A=FT(this._root);if(A.isCircular){let{word:L,pos:D}=A.ref;throw console.error("Circular Reference %o",{word:L,pos:D}),Error("Trie: Circular Reference")}return new yo(H?OT($):$)}debugStack(H){return H.map(($)=>this.debNodeInfo($))}debNodeInfo(H){return{id:H.id??"?",cid:this.cached.get(H)??"?",f:H.f||0,c:H.c?Object.fromEntries(Object.entries(H.c).map(([$,A])=>[$,{id:A.id,r:this.cached.get(A)}])):void 0,L:Object.isFrozen(H)}}logDebug(H,$){this.runDebug(()=>{let A=typeof $==="function"?$():$;console.warn("%s: %o",H,A)})}runDebug(H){if(this._debug_mode)H()}copyIfFrozen(H){if(!Object.isFrozen(H))return H;let $=H.c?Object.assign(Object.create(null),H.c):void 0;return this.createNode(H.f,$)}createNodeFrozen(H,$){return this.freeze(this.createNode(H,$))}createNode(H,$){return{id:++this.count,f:H,c:$}}},uo=(H)=>H.normalize(),go=(H)=>{let $=H.toLowerCase();return[$,$.normalize("NFD").replaceAll(/\p{M}/gu,"")]},C$,bkH,mo="cspell-dictionary:",co,lo;var CA=y(()=>{N$();Yq();Gq=Symbol("memorizeLastCall");HM={matchCase:!1,compoundMode:"compound",legacyMinCompoundLength:cq};Object.freeze(HM);ei=new Map(["none","compound","legacy"].map((H)=>[H,H])),lq={found:!1,compoundUsed:!1,caseMatched:!1,forbidden:void 0};Object.freeze(lq);En=pq(Kn);bH=function(H){return H[H.NONE=0]="NONE",H[H.SEPARATE_WORDS=1]="SEPARATE_WORDS",H[H.JOIN_WORDS=2]="JOIN_WORDS",H}({});Vn=Object.freeze([]),Cn=Object.freeze([]),zn=Object.freeze([]),Pn=class extends Cq{info;hasForbiddenWords;hasCompoundWords;hasNonStrictWords;constructor(H){super(H);this.root=H;let{stripCaseAndAccentsPrefix:$,compoundCharacter:A,forbiddenWordPrefix:L,isCaseAware:D}=H;this.info={stripCaseAndAccentsPrefix:$,compoundCharacter:A,forbiddenWordPrefix:L,isCaseAware:D},this.hasForbiddenWords=!!H.c[L],this.hasCompoundWords=!!H.c[A],this.hasNonStrictWords=!!H.c[$]}get eow(){return!1}resolveId(H){return new Cq(H)}get forbidPrefix(){return this.root.forbiddenWordPrefix}get compoundFix(){return this.root.compoundCharacter}get caseInsensitivePrefix(){return this.root.stripCaseAndAccentsPrefix}static toITrieNode(H){return new this(H)}};_n=Nn;On={compoundMethod:bH.NONE,ignoreCase:!0,changeLimit:5},wn={...On,numSuggestions:8,includeTies:!0,timeout:5000},Rn={changeLimit:"changeLimit",compoundMethod:"compoundMethod",ignoreCase:"ignoreCase",compoundSeparator:"compoundSeparator",filter:"filter",includeTies:"includeTies",numSuggestions:"numSuggestions",timeout:"timeout",weightMap:"weightMap"};gB=class{_heap;_size=0;constructor(H){this.compare=H}add(H){return this._heap=xn(this.compare,this._heap,H),++this._size,this}dequeue(){let H=this.next();if(H.done)return;return H.value}append(H){for(let $ of H)this.add($);return this}next(){if(!this._heap)return{value:void 0,done:!0};let H=this._heap.v;return--this._size,this._heap=Sn(this.compare,this._heap),{value:H}}peek(){return this._heap?.v}[Symbol.iterator](){return this}get length(){return this._size}get size(){return this._size}};p$={baseCost:100,swapCost:75,duplicateLetterCost:80,compound:1,visuallySimilar:1,firstLetterBias:5,wordBreak:99,wordLengthCostFactor:0.5},kn=new Intl.Collator("en",{sensitivity:"base"}),RkH=kn.compare,yn=[yH("ǎàåÄÀAãâáǟặắấĀāăąaäæɐɑαаᾳ")+"ᾳ",yH("Bbḃвъь"),yH("ċČčcĉçCÇćĊСсς"),yH("ḎḋḏḑďđḍDd"),yH("ēëÈÊËềéèếệĕeEĒėęěêəɛёЁеʒ"),yH("fḟFff"),yH("ġĠĞǧĝģGgɣ"),yH("ħĦĥḥHhḤȟн"),yH("IįïİÎÍīiÌìíîıɪɨїΊΙ"),yH("jJĵ"),yH("ķKkκкќ"),yH("ḷłľļLlĺḶίι"),yH("Mṃṁm"),yH("nņÑNṇňŇñńŋѝий"),yH("ÒOøȭŌōőỏoÖòȱȯóôõöơɔόδо"),yH("PṗpрРρ"),yH("Qq"),yH("řRṛrŕŗѓгя"),yH("ṣšȘṢsSŠṡŞŝśșʃΣ"),yH("tțȚťTṭṬṫ"),yH("ÜüûŪưůūűúÛŭÙùuųU"),yH("Vvν"),yH("ŵwWẃẅẁωш"),yH("xXх"),yH("ÿýYŷyÝỳУўу"),yH("ZẓžŽżŻźz")];rK=fn(yn);vn=/[+∙•・●]/g;Da=[...".".repeat(50)].map((H,$)=>$);Object.freeze(Da);Qa=new Intl.Collator,Ba=new RegExp(`[${DT(p0)}]`,"g"),Ja=[0,50,25,5,0],Fq=Symbol("Collector Stop Processing");wq=Object.freeze({numSuggestions:Xa,filter:()=>!0,changeLimit:IT,includeTies:!1,ignoreCase:!0,timeout:ET,weightMap:void 0,compoundSeparator:"",compoundMethod:void 0});H1=Object.freeze({compoundCharacter:rB,forbiddenWordPrefix:eB,stripCaseAndAccentsPrefix:E8,isCaseAware:!0,hasForbiddenWords:!1,hasCompoundWords:!1,hasNonStrictWords:!1});Object.freeze([0]);ha=class extends BT{nodeFindNode;nodeFindExact;nodeGetChild;isForbidden;findExact;hasForbiddenWords;hasCompoundWords;hasNonStrictWords;constructor(H,$,A,L,D){super(H,$,A,L);this.nodeFindExact=D.nodeFindExact,this.nodeGetChild=D.nodeGetChild,this.isForbidden=D.isForbidden,this.findExact=D.findExact,this.nodeFindNode=D.nodeFindNode,this.hasForbiddenWords=D.hasForbiddenWords,this.hasCompoundWords=D.hasCompoundWords,this.hasNonStrictWords=D.hasNonStrictWords}};ga=Object.freeze([]),ma=Object.freeze([]),da=Object.freeze([]),pa=class extends Rq{hasForbiddenWords;hasCompoundWords;hasNonStrictWords;constructor(H,$){super(H,$);this.hasForbiddenWords=H.hasForbiddenWords,this.hasCompoundWords=H.hasCompoundWords,this.hasNonStrictWords=H.hasNonStrictWords}resolveId(H){return new Rq(this.trie,H)}find(H,$){let A=this.findExact(H);if(A)return{found:H,compoundUsed:!1,caseMatched:!0};if($)return;return A=this.findCaseInsensitive(H),A?{found:H,compoundUsed:!1,caseMatched:!1}:void 0}get info(){return this.trie.info}get forbidPrefix(){return this.trie.info.forbiddenWordPrefix}get compoundFix(){return this.trie.info.compoundCharacter}get caseInsensitivePrefix(){return this.trie.info.stripCaseAndAccentsPrefix}},la=Object.freeze([]),ia=Object.freeze([]),na=Object.freeze([]),aa=class extends jq{find;isForbidden;hasForbiddenWords;hasCompoundWords;hasNonStrictWords;constructor(H,$,A,L){super(H,$);this.info=A,this.find=L.find,this.isForbidden=H.isForbidden,this.hasForbiddenWords=H.hasForbiddenWords,this.hasCompoundWords=H.hasCompoundWords,this.hasNonStrictWords=H.hasNonStrictWords}resolveId(H){return new jq(this.trie,H)}get forbidPrefix(){return this.info.forbiddenWordPrefix}get compoundFix(){return this.info.compoundCharacter}get caseInsensitivePrefix(){return this.info.stripCaseAndAccentsPrefix}},YT=ZT,GT=YT+8,UT=GT+4,VT=UT+4,CT=VT+4,Sq=CT+4,d$={header:ZT,sig:YT,version:UT,endian:GT,nodes:VT,nodesLen:CT,charIndex:Sq,charIndexLen:Sq+4},jH=class H{info;#H;#$;#A;#L;#I;#D;#E=ri()==="BE"?3:0;wordToCharacters=($)=>[...$];hasForbiddenWords;hasCompoundWords;hasNonStrictWords;constructor($,A,L){this.nodes=$,this.charIndex=A,Ht($),this.info=LA(L),this.#D=new Uint8Array($.buffer,$.byteOffset+this.#E),this.#H=this._lookupNode(0,this.info.forbiddenWordPrefix),this.#$=this._lookupNode(0,this.info.compoundCharacter),this.#A=this._lookupNode(0,this.info.stripCaseAndAccentsPrefix),this.hasForbiddenWords=!!this.#H,this.hasCompoundWords=!!this.#$,this.hasNonStrictWords=!!this.#A}wordToUtf8Seq($){return this.charIndex.wordToUtf8Seq($)}letterToNodeCharIndexSequence($){return this.charIndex.getCharUtf8Seq($)}has($){return this.#K(0,$)}isForbiddenWord($){return!!this.#H&&this.#K(this.#H,$)}find($,A){if(!this.hasCompoundWords){if(this.#K(0,$))return{found:$,compoundUsed:!1,caseMatched:!0};if(A||!this.#A)return{found:!1,compoundUsed:!1,caseMatched:!1};return{found:this.#K(this.#A,$)&&$,compoundUsed:!1,caseMatched:!1}}}getRoot(){return this.#I??=this._getRoot()}_getRoot(){return new aa(new ca(this.nodes,this.charIndex,{NodeMaskEOW:H.NodeMaskEOW,NodeMaskNumChildren:H.NodeMaskNumChildren,NodeMaskChildCharIndex:H.NodeMaskChildCharIndex,NodeChildRefShift:H.NodeChildRefShift},{nodeFindExact:($,A)=>this.#K($,A),nodeGetChild:($,A)=>this._lookupNode($,A),nodeFindNode:($,A)=>this.#M($,A),isForbidden:($)=>this.isForbiddenWord($),findExact:($)=>this.has($),hasCompoundWords:this.hasCompoundWords,hasForbiddenWords:this.hasForbiddenWords,hasNonStrictWords:this.hasNonStrictWords}),0,this.info,{find:($,A)=>this.find($,A)})}getNode($){return aB(this.getRoot(),$)}#K($,A){let L=this.#M($,A);if(!L)return!1;let D=this.nodes[L],I=H.NodeMaskEOW;return(D&I)===I}#M($,A){let L=this.wordToUtf8Seq(A);return this.#X($,L)}#X($,A){let{NodeMaskNumChildren:L,NodeChildRefShift:D}=H,I=this.nodes,E=this.#D,K=A,M=K.length,W=I[$];for(let X=0;X<M;++X,W=I[$]){let J=K[X],Z=W&L,Q=$<<2;if(Z>15){let Y=Q+(Z<<2),G=Q+4,U=Y;while(U-G>=4){let V=G+U>>1&-4;if(E[V]<J)G=V+4;else U=V}if(G>Y||E[G]!==J)return;$=I[G>>2]>>>D;continue}let B=Q+Z*4;for(;B>Q;B-=4)if(E[B]===J)break;if(B<=Q)return;$=I[B>>2]>>>D}return $}_lookupNode($,A){let L=this.letterToNodeCharIndexSequence(A);return this.#X($,L)}*words(){let{NodeMaskNumChildren:$,NodeMaskEOW:A,NodeMaskChildCharIndex:L,NodeChildRefShift:D}=H,I=this.nodes,E=[{nodeIdx:0,pos:0,word:"",acc:kL.create()}],K=0;while(K>=0){let{nodeIdx:M,pos:W,word:X,acc:J}=E[K],Z=I[M];if(!W&&Z&A)yield X;if(W>=(Z&$)){--K;continue}let Q=I[M+ ++E[K].pos],B=J.clone(),Y=B.decode(Q&L),G=Y&&String.fromCodePoint(Y)||"";++K,E[K]={nodeIdx:Q>>>D,pos:0,word:X+G,acc:B}}}get size(){if(this.#L)return this.#L;let $=H.NodeMaskNumChildren,A=this.nodes,L=0,D=0;while(L<A.length)++D,L+=(A[L]&$)+1;return this.#L=D,D}toJSON(){return{options:this.info,nodes:ea(this.nodes),charIndex:this.charIndex}}encodeBin(){let $=sK.from(this.charIndex.charIndex.join(`
|
|
316
|
+
`)),A=eK+($.byteLength+3&-4),L=A+this.nodes.length*4,D=kq(),I=sK.alloc(L),E=new DataView(I.buffer),K=new Uint8Array(this.nodes.buffer);return I.write(zT,d$.sig,"utf8"),I.write(sa,d$.version,"utf8"),E.setUint32(d$.endian,xq,D),E.setUint32(d$.nodes,A,D),E.setUint32(d$.nodesLen,this.nodes.length,D),E.setUint32(d$.charIndex,eK,D),E.setUint32(d$.charIndexLen,$.length,D),I.set($,eK),I.set(K,A),I}static decodeBin($){if(!ra($))throw new yq("Invalid TrieBlob Header");let A=new DataView($.buffer),L=kq();if(A.getUint32(d$.endian,L)!==xq)throw new yq("Invalid TrieBlob Header");let D=A.getUint32(d$.nodes,L),I=A.getUint32(d$.nodesLen,L),E=A.getUint32(d$.charIndex,L),K=A.getUint32(d$.charIndexLen,L),M=sK.from($.subarray(E,E+K)).toString("utf8").split(`
|
|
317
|
+
`);return new H(new Uint32Array($.buffer,D,I),new QT(M),H1)}static NodeMaskEOW=256;static NodeMaskNumChildren=(1<<ta)-1&65535;static NodeMaskNumChildrenShift=oa;static NodeChildRefShift=8;static NodeMaskChildCharIndex=255;static nodesView($){return new Uint32Array($.nodes)}};yq=class extends Error{constructor(H){super(H)}};$t=class H{_readonly=!1;#H;#$;#A;_iTrieRoot;wordToCharacters;hasForbiddenWords;hasCompoundWords;hasNonStrictWords;constructor($,A,L,D){this.nodes=$,this._charIndex=A,this.bitMasksInfo=L,this.info=D,this.wordToCharacters=(I)=>[...I],this.#H=this.#E(0,this.info.forbiddenWordPrefix)||0,this.#$=this.#E(0,this.info.compoundCharacter)||0,this.#A=this.#E(0,this.info.stripCaseAndAccentsPrefix)||0,this.hasForbiddenWords=!!this.#H,this.hasCompoundWords=!!this.#$,this.hasNonStrictWords=!!this.#A}wordToUtf8Seq($){return this._charIndex.wordToUtf8Seq($)}letterToUtf8Seq($){return this._charIndex.getCharUtf8Seq($)}has($){return this.#L(0,$)}hasCaseInsensitive($){if(!this.#A)return!1;return this.#L(this.#A,$)}#L($,A){return this.#I($,A)}#I($,A){let L=this.wordToUtf8Seq(A),D=this.#D($,L);if(D===void 0)return!1;return!!(this.nodes[D][0]&this.bitMasksInfo.NodeMaskEOW)}#D($,A){let L=this.bitMasksInfo.NodeMaskChildCharIndex,D=this.bitMasksInfo.NodeChildRefShift,I=this.nodes,E=A.length,K=I[$];for(let M=0;M<E;++M,K=I[$]){let W=A[M],X=K.length;if(X<2)return;let J=1,Z=X-1,Q=-1;while(J<Z){let B=J+Z>>1;if(Q=K[B]&L,Q<W)J=B+1;else Z=B}if(J>=X||(K[J]&L)!==W)return;if($=K[J]>>>D,!$)return}return $}*words(){let $=this.bitMasksInfo.NodeMaskChildCharIndex,A=this.bitMasksInfo.NodeChildRefShift,L=this.bitMasksInfo.NodeMaskEOW,D=this.nodes,I=[{nodeIdx:0,pos:0,word:"",accumulator:kL.create()}],E=0;while(E>=0){let{nodeIdx:K,pos:M,word:W,accumulator:X}=I[E],J=D[K];if(!M&&J[0]&L)yield W;if(M>=J.length-1){--E;continue}let Z=J[++I[E].pos],Q=Z&$,B=X.clone(),Y=B.decode(Q),G=Y&&String.fromCodePoint(Y)||"";++E,I[E]={nodeIdx:Z>>>A,pos:0,word:W+G,accumulator:B}}}toTrieBlob(){let $=this.bitMasksInfo.NodeMaskChildCharIndex,A=this.bitMasksInfo.NodeChildRefShift,L=this.nodes;function D(J){let Z=0,Q=Array(J.length+1);for(let B=0;B<J.length;++B)Q[B]=Z,Z+=J[B].length;return Q[J.length]=Z,Q}let I=D(L),E=I[I.length-1],K=new Uint32Array(E),M=jH.NodeMaskNumChildrenShift,W=jH.NodeChildRefShift,X=0;for(let J=0;J<L.length;++J){let Z=L[J];K[X++]=Z.length-1<<M|Z[0];for(let Q=1;Q<Z.length;++Q){let B=Z[Q],Y=B>>>A,G=B&$;K[X++]=I[Y]<<W|G}}return new jH(K,this._charIndex,this.info)}isReadonly(){return this._readonly}freeze(){return this._readonly=!0,this}toJSON(){return{info:this.info,nodes:PT(this.nodes)}}static create($){return new H($.nodes,$.charIndex,ba($),$.info)}static toITrieNodeRoot($){return new pa(new ha($.nodes,$._charIndex,$.bitMasksInfo,$.info,{nodeFindNode:(A,L)=>$.#D(A,$.wordToUtf8Seq(L)),nodeFindExact:(A,L)=>$.#L(A,L),nodeGetChild:(A,L)=>$.#E(A,L),isForbidden:(A)=>$.isForbiddenWord(A),findExact:(A)=>$.has(A),hasForbiddenWords:$.hasForbiddenWords,hasCompoundWords:$.hasCompoundWords,hasNonStrictWords:$.hasNonStrictWords}),0)}static NodeMaskEOW=jH.NodeMaskEOW;static NodeChildRefShift=jH.NodeChildRefShift;static NodeMaskChildCharIndex=jH.NodeMaskChildCharIndex;static DefaultBitMaskInfo={NodeMaskEOW:H.NodeMaskEOW,NodeMaskChildCharIndex:H.NodeMaskChildCharIndex,NodeChildRefShift:H.NodeChildRefShift};get iTrieRoot(){return this._iTrieRoot??=H.toITrieNodeRoot(this)}getRoot(){return this.iTrieRoot}getNode($){return aB(this.getRoot(),$)}isForbiddenWord($){return!!this.#H&&this.#L(this.#H,$)}nodeInfo($,A){let L=A??kL.create(),D=this.nodes[$],I=!!(D[0]&this.bitMasksInfo.NodeMaskEOW),E=[];E.length=D.length-1;for(let K=1;K<D.length;++K){let M=D[K],W=M&this.bitMasksInfo.NodeMaskChildCharIndex,X=L.clone().decode(W);E[K]={c:X!==void 0?String.fromCodePoint(X):"∎",i:M>>>this.bitMasksInfo.NodeChildRefShift,cIdx:W}}return{eow:I,children:E}}get size(){return this.nodes.length}#E($,A){let L=this.letterToUtf8Seq(A);return this.#D($,L)}get charIndex(){return[...this._charIndex.charIndex]}static fromTrieBlob($){let A={NodeMaskEOW:jH.NodeMaskEOW,NodeMaskChildCharIndex:jH.NodeMaskChildCharIndex,NodeChildRefShift:jH.NodeChildRefShift},L=jH.nodesView($),D=[];for(let K=0;K<L.length;K+=(L[K]&jH.NodeMaskNumChildren)+1)D.push(K);let I=new Map(D.map((K,M)=>[K,M])),E=Array.from({length:D.length});for(let K=0;K<E.length;++K){let M=D[K],W=L[M],X=W&jH.NodeMaskEOW,J=W&jH.NodeMaskNumChildren,Z=new Uint32Array(J+1);Z[0]=X,E[K]=Z;for(let Q=1;Q<=J;++Q){let B=L[M+Q],Y=B&jH.NodeMaskChildCharIndex,G=B>>>jH.NodeChildRefShift,U=I.get(G);if(U===void 0)throw Error(`Invalid node index ${G}`);Z[Q]=U<<jH.NodeChildRefShift|Y}}return new H(JT(E,jH.NodeMaskChildCharIndex),$.charIndex,A,$.info)}static isFastTrieBlob($){return $ instanceof H}};$1=class H{charIndex=new fa;nodes;_readonly=!1;IdxEOW;_cursor;_options;wordToCharacters=($)=>[...$];bitMasksInfo;constructor($,A=H.DefaultBitMaskInfo){this._options=LA($),this.bitMasksInfo=A,this.nodes=[[0],Object.freeze([H.NodeMaskEOW])],this.IdxEOW=1}setOptions($){return this._options=LA(this.options,$),this.options}get options(){return this._options}wordToUtf8Seq($){return this.charIndex.wordToUtf8Seq($)}letterToUtf8Seq($){return this.charIndex.charToUtf8Seq($)}insert($){if(this.#H(),typeof $==="string")return this._insert($);let A=$;for(let L of A)this._insert(L);return this}getCursor(){return this.#H(),this._cursor??=this.createCursor(),this._cursor}createCursor(){let $=this.bitMasksInfo.NodeChildRefShift,A=this.bitMasksInfo.NodeMaskEOW,L=this.bitMasksInfo.NodeMaskChildCharIndex,D=[0,1];function I(U,V){for(let z=1;z<U.length;++z)if((U[z]&L)===V)return z;return 0}SL(this.nodes.length===2);let E=1,K=E<<$,M=this.nodes,W=[{nodeIdx:0,pos:0,pDepth:-1}],X=0,J=0,Z=(U)=>{if(!M[X])D.push(X);let V=J,z=this.letterToUtf8Seq(U);for(let P=0;P<z.length;++P)Q(z[P],V)},Q=(U,V)=>{if(M[X]&&Object.isFrozen(M[X])){X=M.push([...M[X]])-1;let{pos:N,nodeIdx:x}=W[J],w=M[x];w[N]=w[N]&L|X<<$}let z=M[X]||[0];M[X]=z;let P=I(z,U),T=P?z[P]>>>$:M.length,q=P||z.push(T<<$|U)-1;++J;let O=W[J];if(O)O.nodeIdx=X,O.pos=q,O.pDepth=V;else W[J]={nodeIdx:X,pos:q,pDepth:V};X=T};return{insertChar:Z,markEOW:()=>{if(X===E)return;let U=M[X];if(!U){let{pos:V,nodeIdx:z}=W[J],P=M[z];P[V]=P[V]&L|K}else M[X]=U,U[0]|=A;X=E},reference:(U)=>{let V=D[U];SL(V!==void 0),SL(M[X]===void 0),SL(M[V]),Object.freeze(M[V]);let z=W[J];X=z.nodeIdx;let P=z.pos,T=M[X];T[P]=V<<$|T[P]&L},backStep:(U)=>{if(!U)return;SL(U<=J&&U>0);for(let V=U;V>0;--V)J=W[J].pDepth;X=W[J+1].nodeIdx}}}_insert($){if($=$.trim(),!$)return this;let A=this.bitMasksInfo.NodeMaskChildCharIndex,L=this.bitMasksInfo.NodeChildRefShift,D=this.bitMasksInfo.NodeMaskEOW,I=this.IdxEOW,E=this.nodes,K=this.wordToUtf8Seq($),M=K.length,W=0;for(let X=0;X<M;++X){let J=K[X],Z=E[W],Q=Z.length-1;for(;Q>0;--Q)if((Z[Q]&A)===J)break;if(Q>0){if(W=Z[Q]>>>L,W===1&&X<M-1)W=this.nodes.push([D])-1,Z[Q]=W<<L|J;continue}W=X<M-1?this.nodes.push([0])-1:I,Z.push(W<<L|J)}if(W>1){let X=E[W];X[0]|=D}return this}has($){let A=this.bitMasksInfo.NodeMaskChildCharIndex,L=this.bitMasksInfo.NodeChildRefShift,D=this.bitMasksInfo.NodeMaskEOW,I=this.nodes,E=this.wordToUtf8Seq($),K=E.length,M=0,W=I[M];for(let X=0;X<K;++X,W=I[M]){let J=E[X],Z=W.length-1;for(;Z>0;--Z)if((W[Z]&A)===J)break;if(Z<1)return!1;M=W[Z]>>>L}return!!(W[0]&D)}isReadonly(){return this._readonly}freeze(){return this._readonly=!0,this}build(){return this._cursor=void 0,this._readonly=!0,this.freeze(),$t.create(new BT(JT(this.nodes.map(($)=>Uint32Array.from($)),this.bitMasksInfo.NodeMaskChildCharIndex),this.charIndex.build(),this.bitMasksInfo,this.options))}toJSON(){return{options:this.options,nodes:PT(this.nodes.map(($)=>Uint32Array.from($)))}}#H(){SL(!this.isReadonly(),"FastTrieBlobBuilder is readonly")}static fromWordList($,A){return new H(A).insert($).build()}static fromTrieRoot($){let A=H.DefaultBitMaskInfo,L=A.NodeChildRefShift,D=A.NodeMaskChildCharIndex,I=A.NodeMaskEOW,E=new H(void 0,A),K=E.IdxEOW,M=new Map([[$,0]]);function W(Q){if(Q.f&&!Q.c)return K;let B=[Q.f?I:0];return E.nodes.push(B)-1}function X(Q){let B=M.get(Q);if(B)return B;let Y=At(M,Q,W),G=E.nodes[Y];if(!Q.c)return Y;let U=Object.entries(Q.c);for(let V=0;V<U.length;++V){let[z,P]=U[V];Z(G,z,P)}return Y}function J(Q,B){let Y=1;for(Y=1;Y<Q.length&&(Q[Y]&D)!==B;++Y);return Y}function Z(Q,B,Y){let G=E.letterToUtf8Seq(B);ja(B);for(let z of G.slice(0,-1)){let P=J(Q,z);if(P<Q.length)Q=E.nodes[Q[P]>>>L];else{let T=[0];Q[P]=E.nodes.push(T)-1<<L|z,Q=T}}let U=G[G.length-1],V=Q.push(U)-1;Q[V]=X(Y)<<L|U}return X($),E.build()}static NodeMaskEOW=jH.NodeMaskEOW;static NodeChildRefShift=jH.NodeChildRefShift;static NodeMaskChildCharIndex=jH.NodeMaskChildCharIndex;static DefaultBitMaskInfo={NodeMaskEOW:H.NodeMaskEOW,NodeMaskChildCharIndex:H.NodeMaskChildCharIndex,NodeChildRefShift:H.NodeChildRefShift}};wT={matchCase:!1,compoundMode:"compound",forbidPrefix:eB,compoundFix:rB,caseInsensitivePrefix:E8,legacyMinCompoundLength:3},Bt=new Map(["none","compound","legacy"].map((H)=>[H,H]));L1=pq(Ct);iB=xT;jkH=D8([MM,xL,XM,QM,nB,L8,d0,WM,yT,fT,vT,..."0123456789",..."`~!@#$%^&*()_-+=[]{};:'\"<>,./?\\|"].join("")),bT=[[`
|
|
318
|
+
`,"\\n"],["\r","\\r"],["\\","\\\\"]],SkH=hT(bT),_t=hT(bT.map((H)=>[H[1],H[0]])),xkH=D8("~!");Ot=D8("0123456789");hq=Object.freeze({f:1,k:!0}),jt=new Intl.Collator().compare,St=new Map([[`
|
|
319
|
+
`,"\\n"],["\r","\\r"],["\\","\\\\"]]),xt=new Map([...St].map((H)=>[H[1],H[0]]));ut=[(H)=>new $8(vq(H)),(H)=>new $8(vq(H)),(H)=>new $8(Tt(H)),(H)=>vt(H),(H)=>new $8(Ft(H))],gt=/^\s*TrieXv(\d+)/m;ykH=mT([MM,xL,XM,QM,L8,d0,WM,"0123456789","`~!@#$%^&*()_-+=[]{};:'\"<>,./?\\|"].join("")),fkH=mT("~!");dt=[["af","Afrikaans"],["af-NA","Afrikaans","Namibia"],["af-ZA","Afrikaans","South Africa"],["ak","Akan"],["ak-GH","Akan","Ghana"],["am","Amharic"],["am-ET","Amharic","Ethiopia"],["ar","Arabic"],["ar-1","Arabic"],["ar-AE","Arabic","United Arab Emirates"],["ar-BH","Arabic","Bahrain"],["ar-DJ","Arabic","Djibouti"],["ar-DZ","Arabic","Algeria"],["ar-EG","Arabic","Egypt"],["ar-EH","Arabic"],["ar-ER","Arabic","Eritrea"],["ar-IL","Arabic","Israel"],["ar-IQ","Arabic","Iraq"],["ar-JO","Arabic","Jordan"],["ar-KM","Arabic","Comoros"],["ar-KW","Arabic","Kuwait"],["ar-LB","Arabic","Lebanon"],["ar-LY","Arabic","Libya"],["ar-MA","Arabic","Morocco"],["ar-MR","Arabic","Mauritania"],["ar-OM","Arabic","Oman"],["ar-PS","Arabic"],["ar-QA","Arabic","Qatar"],["ar-SA","Arabic","Saudi Arabia"],["ar-SD","Arabic","Sudan"],["ar-SO","Arabic","Somalia"],["ar-SS","Arabic"],["ar-SY","Arabic","Syria"],["ar-TD","Arabic","Chad"],["ar-TN","Arabic","Tunisia"],["ar-YE","Arabic","Yemen"],["as","Assamese"],["as-IN","Assamese","India"],["az","Azerbaijani"],["az-AZ","Azerbaijani","Azerbaijan"],["be","Belarusian"],["be-BY","Belarusian","Belarus"],["bg","Bulgarian"],["bg-BG","Bulgarian","Bulgaria"],["bm","Bambara"],["bm-ML","Bambara","Mali"],["bn","Bengali"],["bn-BD","Bengali","Bangladesh"],["bn-IN","Bengali","India"],["bo","Tibetan"],["bo-CN","Tibetan","China"],["bo-IN","Tibetan","India"],["br","Breton"],["br-FR","Breton","France"],["bs","Bosnian"],["bs-BA","Bosnian","Bosnia and Herzegovina"],["ca","Catalan"],["ca-AD","Catalan","Andorra"],["ca-ES","Catalan","Spain"],["ca-FR","Catalan","France"],["ca-IT","Catalan","Italy"],["ce","Chechen"],["ce-RU","Chechen","Russia"],["cs","Czech"],["cs-CZ","Czech","Czech Republic"],["cu","Old Slavonic"],["cu-RU","Old Slavonic","Russia"],["cy","Welsh"],["cy-GB","Welsh","United Kingdom"],["da","Danish"],["da-DK","Danish","Denmark"],["da-GL","Danish","Greenland"],["de","German"],["de-AT","German","Austria"],["de-BE","German","Belgium"],["de-CH","German","Switzerland"],["de-DE","German","Germany"],["de-IT","German","Italy"],["de-LI","German","Liechtenstein"],["de-LU","German","Luxembourg"],["dz","Dzongkha"],["dz-BT","Dzongkha","Bhutan"],["ee","Ewe"],["ee-GH","Ewe","Ghana"],["ee-TG","Ewe","Togo"],["el","Greek","Modern (1453-)"],["el-CY","Greek","Cyprus"],["el-GR","Greek","Greece"],["en","English"],["en-AG","English","Antigua and Barbuda"],["en-AI","English","Anguilla"],["en-AS","English","American Samoa"],["en-AT","English","Austria"],["en-AU","English","Australia"],["en-BB","English","Barbados"],["en-BE","English","Belgium"],["en-BI","English","Burundi"],["en-BM","English","Bermuda"],["en-BS","English","Bahamas"],["en-BW","English","Botswana"],["en-BZ","English","Belize"],["en-CA","English","Canada"],["en-CC","English","Cocos (Keeling) Islands"],["en-CH","English","Switzerland"],["en-CK","English","Cook Islands"],["en-CM","English","Cameroon"],["en-CX","English","Christmas Island"],["en-CY","English","Cyprus"],["en-DE","English","Germany"],["en-DG","English"],["en-DK","English","Denmark"],["en-DM","English","Dominica"],["en-ER","English","Eritrea"],["en-FI","English","Finland"],["en-FJ","English","Fiji"],["en-FK","English","Falkland Islands (Islas Malvinas)"],["en-FM","English","Micronesia"],["en-GB","English","United Kingdom"],["en-GD","English","Grenada"],["en-GG","English","Guernsey"],["en-GH","English","Ghana"],["en-GI","English","Gibraltar"],["en-GM","English","Gambia"],["en-GU","English","Guam"],["en-GY","English","Guyana"],["en-HK","English","Hong Kong"],["en-IE","English","Ireland"],["en-IL","English","Israel"],["en-IM","English","Isle of Man"],["en-IN","English","India"],["en-IO","English","British Indian Ocean Territory"],["en-JE","English","Jersey"],["en-JM","English","Jamaica"],["en-KE","English","Kenya"],["en-KI","English","Kiribati"],["en-KN","English","Saint Kitts and Nevis"],["en-KY","English","Cayman Islands"],["en-LC","English","Saint Lucia"],["en-LR","English","Liberia"],["en-LS","English","Lesotho"],["en-MG","English","Madagascar"],["en-MH","English","Marshall Islands"],["en-MO","English","Macau"],["en-MP","English","Northern Mariana Islands"],["en-MS","English","Montserrat"],["en-MT","English","Malta"],["en-MU","English","Mauritius"],["en-MW","English","Malawi"],["en-MY","English","Malaysia"],["en-NA","English","Namibia"],["en-NF","English","Norfolk Island"],["en-NG","English","Nigeria"],["en-NL","English","Netherlands"],["en-NR","English","Nauru"],["en-NU","English","Niue"],["en-NZ","English","New Zealand"],["en-PG","English","Papua New Guinea"],["en-PH","English","Philippines"],["en-PK","English","Pakistan"],["en-PN","English","Pitcairn Islands"],["en-PR","English","Puerto Rico"],["en-PW","English","Palau"],["en-RW","English","Rwanda"],["en-SB","English","Solomon Islands"],["en-SC","English","Seychelles"],["en-SD","English","Sudan"],["en-SE","English","Sweden"],["en-SG","English","Singapore"],["en-SH","English","Saint Helena"],["en-SI","English","Slovenia"],["en-SL","English","Sierra Leone"],["en-SS","English"],["en-SX","English"],["en-SZ","English","Swaziland"],["en-TC","English","Turks and Caicos Islands"],["en-TK","English","Tokelau"],["en-TO","English","Tonga"],["en-TT","English","Trinidad and Tobago"],["en-TV","English","Tuvalu"],["en-TZ","English","Tanzania"],["en-UG","English","Uganda"],["en-UM","English","Baker Island"],["en-US","English","United States"],["en-VC","English","Saint Vincent and the Grenadines"],["en-VG","English","British Virgin Islands"],["en-VI","English","U.S. Virgin Islands"],["en-VU","English","Vanuatu"],["en-WS","English","Samoa"],["en-ZA","English","South Africa"],["en-ZM","English","Zambia"],["en-ZW","English","Zimbabwe"],["eo","Esperanto"],["es","Spanish"],["es-AR","Spanish","Argentina"],["es-BO","Spanish","Bolivia"],["es-BR","Spanish","Brazil"],["es-BZ","Spanish","Belize"],["es-CL","Spanish","Chile"],["es-CO","Spanish","Colombia"],["es-CR","Spanish","Costa Rica"],["es-CU","Spanish","Cuba"],["es-DO","Spanish","Dominican Republic"],["es-EA","Spanish"],["es-EC","Spanish","Ecuador"],["es-ES","Spanish","Spain"],["es-GQ","Spanish","Equatorial Guinea"],["es-GT","Spanish","Guatemala"],["es-HN","Spanish","Honduras"],["es-IC","Spanish"],["es-MX","Spanish","Mexico"],["es-NI","Spanish","Nicaragua"],["es-PA","Spanish","Panama"],["es-PE","Spanish","Peru"],["es-PH","Spanish","Philippines"],["es-PR","Spanish","Puerto Rico"],["es-PY","Spanish","Paraguay"],["es-SV","Spanish","El Salvador"],["es-US","Spanish","United States"],["es-UY","Spanish","Uruguay"],["es-VE","Spanish","Venezuela"],["et","Estonian"],["et-EE","Estonian","Estonia"],["eu","Basque"],["eu-ES","Basque","Spain"],["fa","Persian"],["fa-AF","Persian","Afghanistan"],["fa-IR","Persian","Iran"],["ff","Fulah"],["ff-CM","Fulah","Cameroon"],["ff-GN","Fulah","Guinea"],["ff-MR","Fulah","Mauritania"],["ff-SN","Fulah","Senegal"],["fi","Finnish"],["fi-FI","Finnish","Finland"],["fo","Faroese"],["fo-DK","Faroese","Denmark"],["fo-FO","Faroese","Faroe Islands"],["fr","French"],["fr-BE","French","Belgium"],["fr-BF","French","Burkina Faso"],["fr-BI","French","Burundi"],["fr-BJ","French","Benin"],["fr-BL","French"],["fr-CA","French","Canada"],["fr-CD","French","Congo"],["fr-CF","French","Central African Republic"],["fr-CG","French","Congo"],["fr-CH","French","Switzerland"],["fr-CI","French, Cote d'Ivoire (Ivory Coast)"],["fr-CM","French","Cameroon"],["fr-DJ","French","Djibouti"],["fr-DZ","French","Algeria"],["fr-FR","French","France"],["fr-GA","French","Gabon"],["fr-GF","French","French Guiana"],["fr-GN","French","Guinea"],["fr-GP","French","Saint Barthelemy"],["fr-GQ","French","Equatorial Guinea"],["fr-HT","French","Haiti"],["fr-KM","French","Comoros"],["fr-LU","French","Luxembourg"],["fr-MA","French","Morocco"],["fr-MC","French","Monaco"],["fr-MF","French"],["fr-MG","French","Madagascar"],["fr-ML","French","Mali"],["fr-MQ","French","Martinique"],["fr-MR","French","Mauritania"],["fr-MU","French","Mauritius"],["fr-NC","French","New Caledonia"],["fr-NE","French","Niger"],["fr-PF","French","French Polynesia"],["fr-PM","French","Saint Pierre and Miquelon"],["fr-RE","French","Reunion"],["fr-RW","French","Rwanda"],["fr-SC","French","Seychelles"],["fr-SN","French","Senegal"],["fr-SY","French","Syria"],["fr-TD","French","Chad"],["fr-TG","French","Togo"],["fr-TN","French","Tunisia"],["fr-VU","French","Vanuatu"],["fr-WF","French","Wallis and Futuna"],["fr-YT","French","Mayotte"],["fy","Western Frisian"],["fy-NL","Western Frisian","Netherlands"],["ga","Irish"],["ga-IE","Irish","Ireland"],["gd","Gaelic"],["gd-GB","Gaelic","United Kingdom"],["gl","Galician"],["gl-ES","Galician","Spain"],["gu","Gujarati"],["gu-IN","Gujarati","India"],["gv","Manx"],["gv-IM","Manx","Isle of Man"],["ha","Hausa"],["ha-GH","Hausa","Ghana"],["ha-NE","Hausa","Niger"],["ha-NG","Hausa","Nigeria"],["he","Hebrew"],["he-IL","Hebrew","Israel"],["hi","Hindi"],["hi-IN","Hindi","India"],["hr","Croatian"],["hr-BA","Croatian","Bosnia and Herzegovina"],["hr-HR","Croatian","Croatia"],["hu","Hungarian"],["hu-HU","Hungarian","Hungary"],["hy","Armenian"],["hy-AM","Armenian","Armenia"],["id","Indonesian"],["id-ID","Indonesian","Indonesia"],["ig","Igbo"],["ig-NG","Igbo","Nigeria"],["ii","Sichuan Yi"],["ii-CN","Sichuan Yi","China"],["is","Icelandic"],["is-IS","Icelandic","Iceland"],["it","Italian"],["it-CH","Italian","Switzerland"],["it-IT","Italian","Italy"],["it-SM","Italian","San Marino"],["it-VA","Italian","Vatican City"],["ja","Japanese"],["ja-JP","Japanese","Japan"],["ka","Georgian"],["ka-GE","Georgian","Georgia"],["ki","Kikuyu"],["ki-KE","Kikuyu","Kenya"],["kk","Kazakh"],["kk-KZ","Kazakh","Kazakhstan"],["kl","Kalaallisut"],["kl-GL","Kalaallisut","Greenland"],["km","Central Khmer"],["km-KH","Central Khmer","Cambodia"],["kn","Kannada"],["kn-IN","Kannada","India"],["ko","Korean"],["ko-KP","Korean","Korea"],["ko-KR","Korean","Korea"],["ks","Kashmiri"],["ks-IN","Kashmiri","India"],["kw","Cornish"],["kw-GB","Cornish","United Kingdom"],["ky","Kirghiz"],["ky-KG","Kirghiz","Kyrgyzstan"],["lb","Luxembourgish"],["lb-LU","Luxembourgish","Luxembourg"],["lg","Ganda"],["lg-UG","Ganda","Uganda"],["ln","Lingala"],["ln-AO","Lingala","Angola"],["ln-CD","Lingala","Congo"],["ln-CF","Lingala","Central African Republic"],["ln-CG","Lingala","Congo"],["lo","Lao"],["lo-LA","Lao","Laos"],["lt","Lithuanian"],["lt-LT","Lithuanian","Lithuania"],["lu","Luba-Katanga"],["lu-CD","Luba-Katanga","Congo"],["lv","Latvian"],["lv-LV","Latvian","Latvia"],["mg","Malagasy"],["mg-MG","Malagasy","Madagascar"],["mk","Macedonian"],["mk-MK","Macedonian","Macedonia"],["ml","Malayalam"],["ml-IN","Malayalam","India"],["mn","Mongolian"],["mn-MN","Mongolian","Mongolia"],["mr","Marathi"],["mr-IN","Marathi","India"],["ms","Malay"],["ms-BN","Malay","Brunei"],["ms-MY","Malay","Malaysia"],["ms-SG","Malay","Singapore"],["mt","Maltese"],["mt-MT","Maltese","Malta"],["my","Burmese"],["my-MM","Burmese","Myanmar (Burma)"],["nb","Bokmål Norwegian"],["nb-NO","Bokmål Norwegian","Norway"],["nb-SJ","Bokmål Norwegian","Svalbard"],["nd","Ndebele, North"],["nd-ZW","Ndebele, North","Zimbabwe"],["ne","Nepali"],["ne-IN","Nepali","India"],["ne-NP","Nepali","Nepal"],["nl","Dutch"],["nl-AW","Dutch","Aruba"],["nl-BE","Dutch","Belgium"],["nl-BQ","Dutch"],["nl-CW","Dutch"],["nl-NL","Dutch","Netherlands"],["nl-SR","Dutch","Suriname"],["nl-SX","Dutch"],["nn","Norwegian Nynorsk"],["nn-NO","Norwegian Nynorsk","Norway"],["om","Oromo"],["om-ET","Oromo","Ethiopia"],["om-KE","Oromo","Kenya"],["or","Oriya"],["or-IN","Oriya","India"],["os","Ossetian"],["os-GE","Ossetian","Georgia"],["os-RU","Ossetian","Russia"],["pa","Panjabi"],["pa-IN","Panjabi","India"],["pa-PK","Panjabi","Pakistan"],["pl","Polish"],["pl-PL","Polish","Poland"],["ps","Pushto"],["ps-AF","Pushto","Afghanistan"],["pt","Portuguese"],["pt-AO","Portuguese","Angola"],["pt-BR","Portuguese","Brazil"],["pt-CH","Portuguese","Switzerland"],["pt-CV","Portuguese","Cape Verde"],["pt-GQ","Portuguese","Equatorial Guinea"],["pt-GW","Portuguese","Guinea-Bissau"],["pt-LU","Portuguese","Luxembourg"],["pt-MO","Portuguese","Macau"],["pt-MZ","Portuguese","Mozambique"],["pt-PT","Portuguese","Portugal"],["pt-ST","Portuguese","Sao Tome and Principe"],["pt-TL","Portuguese","Timor-Leste (East Timor)"],["qu","Quechua"],["qu-BO","Quechua","Bolivia"],["qu-EC","Quechua","Ecuador"],["qu-PE","Quechua","Peru"],["rm","Romansh"],["rm-CH","Romansh","Switzerland"],["rn","Rundi"],["rn-BI","Rundi","Burundi"],["ro","Romanian"],["ro-MD","Romanian","Moldova"],["ro-RO","Romanian","Romania"],["ru","Russian"],["ru-BY","Russian","Belarus"],["ru-KG","Russian","Kyrgyzstan"],["ru-KZ","Russian","Kazakhstan"],["ru-MD","Russian","Moldova"],["ru-RU","Russian","Russia"],["ru-UA","Russian","Ukraine"],["rw","Kinyarwanda"],["rw-RW","Kinyarwanda","Rwanda"],["se","Northern Sami"],["se-FI","Northern Sami","Finland"],["se-NO","Northern Sami","Norway"],["se-SE","Northern Sami","Sweden"],["sg","Sango"],["sg-CF","Sango","Central African Republic"],["si","Sinhala"],["si-LK","Sinhala","Sri Lanka"],["sk","Slovak"],["sk-SK","Slovak","Slovakia"],["sl","Slovenian"],["sl-SI","Slovenian","Slovenia"],["sn","Shona"],["sn-ZW","Shona","Zimbabwe"],["so","Somali"],["so-DJ","Somali","Djibouti"],["so-ET","Somali","Ethiopia"],["so-KE","Somali","Kenya"],["so-SO","Somali","Somalia"],["sq","Albanian"],["sq-AL","Albanian","Albania"],["sq-MK","Albanian","Macedonia"],["sq-XK","Albanian"],["sr","Serbian"],["sr-BA","Serbian","Bosnia and Herzegovina"],["sr-ME","Serbian","Montenegro"],["sr-RS","Serbian","Serbia"],["sr-XK","Serbian"],["sv","Swedish"],["sv-AX","Swedish","Aland"],["sv-FI","Swedish","Finland"],["sv-SE","Swedish","Sweden"],["sw","Swahili"],["sw-CD","Swahili","Congo"],["sw-KE","Swahili","Kenya"],["sw-TZ","Swahili","Tanzania"],["sw-UG","Swahili","Uganda"],["ta","Tamil"],["ta-IN","Tamil","India"],["ta-LK","Tamil","Sri Lanka"],["ta-MY","Tamil","Malaysia"],["ta-SG","Tamil","Singapore"],["te","Telugu"],["te-IN","Telugu","India"],["th","Thai"],["th-TH","Thai","Thailand"],["ti","Tigrinya"],["ti-ER","Tigrinya","Eritrea"],["ti-ET","Tigrinya","Ethiopia"],["tk","Turkmen"],["tk-TM","Turkmen","Turkmenistan"],["to","Tonga (Tonga Islands)"],["to-TO","Tonga (Tonga Islands)","Tonga"],["tr","Turkish"],["tr-CY","Turkish","Cyprus"],["tr-TR","Turkish","Turkey"],["ug","Uighur"],["ug-CN","Uighur","China"],["uk","Ukrainian"],["uk-UA","Ukrainian","Ukraine"],["ur","Urdu"],["ur-IN","Urdu","India"],["ur-PK","Urdu","Pakistan"],["uz","Uzbek"],["uz-AF","Uzbek","Afghanistan"],["uz-UZ","Uzbek","Uzbekistan"],["vi","Vietnamese"],["vi-VN","Vietnamese","Vietnam"],["vo","Volapük"],["yi","Yiddish"],["yi-1","Yiddish"],["yo","Yoruba"],["yo-BJ","Yoruba","Benin"],["yo-NG","Yoruba","Nigeria"],["zh","Chinese"],["zh-CN","Chinese","China"],["zh-HK","Chinese","Hong Kong"],["zh-MO","Chinese","Macau"],["zh-SG","Chinese","Singapore"],["zh-TW","Chinese","China"],["zu","Zulu"],["zu-ZA","Zulu","South Africa"]],ct=/^[a-z]{2}$/i,lt=/^([a-z]{2})[_-]?([a-z]{2,3})$/i,it=/^([a-z]{2})(?:-([A-Z]{2,3}))?$/;dT={accentCosts:1,baseCost:100,capsCosts:1,firstLetterPenalty:4,nonAlphabetCosts:110},et={...dT,ioConvertCost:30,keyboardCost:99,mapCost:25,replaceCosts:75,tryCharCost:100};E1=/^(?:MAP)\s+(\S+)$/;K1=/^(?:TRY)\s+(\S+)$/;Wo=/^NO-TRY\s+(\S+)$/;Bo=/^(?:REP|(?:I|O)CONV)\s+(\S+)\s+(\S+)$/;lT=/^(?:KEY)\s+(\S+)$/;Fo=[{map:"1234567890-.",insDel:1,penalty:200}],Oo=[{id:"compound-case-change",regexp:/\p{Ll}∙\p{Lu}/gu,penalty:1000},{id:"short-compounds-1",regexp:/^[^∙]{0,2}(?=∙)|∙[^∙]{0,2}(?=∙|$)/gm,penalty:100},{id:"short-compounds-3",regexp:/^[^∙]{3}(?=∙)|∙[^∙]{3}(?=∙|$)/gm,penalty:50}];DM=p$.baseCost,wo=p$.swapCost-DM,mq=p$.visuallySimilar,Ro=p$.wordLengthCostFactor,jo=DM,So=new Set([F3,p0]);C$={commentCharacter:Na,optionalCompoundCharacter:_a,compoundCharacter:rB,forbiddenPrefix:eB,caseInsensitivePrefix:E8,keepExactPrefix:Fa,stripCaseAndAccents:!0,stripCaseAndAccentsKeepDuplicate:!1,stripCaseAndAccentsOnForbidden:!1,split:!1,splitKeepBoth:!1,splitSeparator:/[\s,;]/g,keepOptionalCompoundCharacter:!1},bkH=Object.freeze(C$);co=/\\([\s,;])/g,lo=/<<(%[\da-f]{2})>>/gi});function oT(H){return!!to.test(H)}function sT(H){return H.slice(0,1).toUpperCase()+H.slice(1)}function rT(H){return H.normalize("NFD").replaceAll(tT,"")}function M1(H){return H.replaceAll(tT,"")}var to,tT;var X1=y(()=>{to=/^(?:\p{Lu}\p{M}?)+$/u,tT=/\p{M}/gu});function $_(H,$,A){let L=new Set;H=H.normalize("NFC");let D=H.toLowerCase();if(A)if($)L.add(D);else L.add(D),L.add(M1(D));else if($){if(L.add(H),L.add(D),oT(H))L.add(sT(D))}else L.add(D),L.add(M1(D));return L}function A_(H){H=H.normalize("NFC");let $=new Set([H]),A=H.toLowerCase();return $.add(A),$}function M8(H){return W1(!H?oo:H)}function W1(H){let $=H_.get(H);if($)return $;let{ignoreCase:A,useCompounds:L}=H,D=eT.get(A),I=D||new Map;if(!D)eT.set(A,I);let E=I.get(L),K=E||Object.freeze({ignoreCase:A,useCompounds:L});if(!E)I.set(L,K);return H_.set(H,K),K}function ZM(H){return H?BM(H):void 0}var JM=10,oo,eT,H_;var X8=y(()=>{CA();X1();CA();oo=Object.freeze({});eT=new Map,H_=new WeakMap});class D_{dict;options;name;id=++so;has;#H;constructor(H,$){this.dict=H,this.options=$,this.name=H.name;let A=sE((D)=>this.dict.has(D,this.options),YM),L=(D)=>{let I=performance.now()-Hs,E=A(D);return eo.push({time:I,method:"has",word:D,value:E}),E};this.#H=A,this.has=ro?L:A}isNoSuggestWord=sE((H)=>this.dict.isNoSuggestWord(H,this.options),YM);isForbidden=sE((H)=>this.dict.isForbidden(H),YM);getPreferredSuggestions=sE((H)=>this.dict.getPreferredSuggestions?.(H),YM);suggest=(H,$)=>this.dict.suggest(H,$);stats(){return{name:this.name,id:this.id,has:rE(this.#H),isNoSuggestWord:rE(this.isNoSuggestWord),isForbidden:rE(this.isForbidden),getPreferredSuggestions:rE(this.getPreferredSuggestions)}}}function GM(H,$){$=W1($);let A=L_.get($);if(!A)A=new WeakMap,L_.set($,A);let L=A.get(H);if(L)return L;let D=new D_(H,$);return A.set(H,D),D}var so=0,YM=1000,ro=!1,eo,Hs,L_;var I_=y(()=>{RP();X8();eo=[],Hs=performance.now();L_=new Map});function $s(H,$,A){let L=H.get($);if(L!==void 0||H.has($))return L;let D=A($);return H.set($,D),D}class E_{map=new WeakMap;get(H,$){return $?$s(this.map,H,$):this.map.get(H)}has(H){return this.map.has(H)}set(H,$){return this.map.set(H,$),this}}function zA(){return new E_}function l0(H){return H!==void 0}function Q1(H,$){return function A(L,D,I){return H(L,D,I)&&$(L,D,I)}}function UM(H){return function $(A,L,D){if(!A||!L||typeof A!=="object"||typeof L!=="object")return H(A,L,D);let{cache:I}=D,E=I.get(A),K=I.get(L);if(E&&K)return E===L&&K===A;I.set(A,L),I.set(L,A);let M=H(A,L,D);return I.delete(A),I.delete(L),M}}function Is(H){return H!=null?H[Symbol.toStringTag]:void 0}function K_(H){return As(H).concat(Ls(H))}function i0(H,$){return H===$||!H&&!$&&H!==H&&$!==$}function Ws(H,$){return H.byteLength===$.byteLength&&VM(new Uint8Array(H),new Uint8Array($))}function Qs(H,$,A){let L=H.length;if($.length!==L)return!1;while(L-- >0)if(!A.equals(H[L],$[L],L,L,H,$,A))return!1;return!0}function Bs(H,$){return H.byteLength===$.byteLength&&VM(new Uint8Array(H.buffer,H.byteOffset,H.byteLength),new Uint8Array($.buffer,$.byteOffset,$.byteLength))}function Js(H,$){return i0(H.getTime(),$.getTime())}function Zs(H,$){return H.name===$.name&&H.message===$.message&&H.cause===$.cause&&H.stack===$.stack}function Ys(H,$){return H===$}function W_(H,$,A){let L=H.size;if(L!==$.size)return!1;if(!L)return!0;let D=Array(L),I=H.entries(),E,K,M=0;while(E=I.next()){if(E.done)break;let W=$.entries(),X=!1,J=0;while(K=W.next()){if(K.done)break;if(D[J]){J++;continue}let Z=E.value,Q=K.value;if(A.equals(Z[0],Q[0],M,J,H,$,A)&&A.equals(Z[1],Q[1],Z[0],Q[0],H,$,A)){X=D[J]=!0;break}J++}if(!X)return!1;M++}return!0}function Us(H,$,A){let L=X_(H),D=L.length;if(X_($).length!==D)return!1;while(D-- >0)if(!B_(H,$,A,L[D]))return!1;return!0}function W8(H,$,A){let L=K_(H),D=L.length;if(K_($).length!==D)return!1;let I,E,K;while(D-- >0){if(I=L[D],!B_(H,$,A,I))return!1;if(E=M_(H,I),K=M_($,I),(E||K)&&(!E||!K||E.configurable!==K.configurable||E.enumerable!==K.enumerable||E.writable!==K.writable))return!1}return!0}function Vs(H,$){return i0(H.valueOf(),$.valueOf())}function Cs(H,$){return H.source===$.source&&H.flags===$.flags}function Q_(H,$,A){let L=H.size;if(L!==$.size)return!1;if(!L)return!0;let D=Array(L),I=H.values(),E,K;while(E=I.next()){if(E.done)break;let M=$.values(),W=!1,X=0;while(K=M.next()){if(K.done)break;if(!D[X]&&A.equals(E.value,K.value,E.value,K.value,H,$,A)){W=D[X]=!0;break}X++}if(!W)return!1}return!0}function VM(H,$){let A=H.byteLength;if($.byteLength!==A||H.byteOffset!==$.byteOffset)return!1;while(A-- >0)if(H[A]!==$[A])return!1;return!0}function zs(H,$){return H.hostname===$.hostname&&H.pathname===$.pathname&&H.protocol===$.protocol&&H.port===$.port&&H.hash===$.hash&&H.username===$.username&&H.password===$.password}function B_(H,$,A,L){if((L===Xs||L===Ms||L===Ks)&&(H.$$typeof||$.$$typeof))return!0;return Es($,L)&&A.equals(H[L],$[L],L,L,H,$,A)}function vs({areArrayBuffersEqual:H,areArraysEqual:$,areDataViewsEqual:A,areDatesEqual:L,areErrorsEqual:D,areFunctionsEqual:I,areMapsEqual:E,areNumbersEqual:K,areObjectsEqual:M,arePrimitiveWrappersEqual:W,areRegExpsEqual:X,areSetsEqual:J,areTypedArraysEqual:Z,areUrlsEqual:Q,unknownTagComparators:B}){return function Y(G,U,V){if(G===U)return!0;if(G==null||U==null)return!1;let z=typeof G;if(z!==typeof U)return!1;if(z!=="object"){if(z==="number")return K(G,U,V);if(z==="function")return I(G,U,V);return!1}let P=G.constructor;if(P!==U.constructor)return!1;if(P===Object)return M(G,U,V);if(Array.isArray(G))return $(G,U,V);if(P===Date)return L(G,U,V);if(P===RegExp)return X(G,U,V);if(P===Map)return E(G,U,V);if(P===Set)return J(G,U,V);let T=fs.call(G);if(T===Ns)return L(G,U,V);if(T===js)return X(G,U,V);if(T===Os)return E(G,U,V);if(T===Ss)return J(G,U,V);if(T===Rs)return typeof G.then!=="function"&&typeof U.then!=="function"&&M(G,U,V);if(T===ys)return Q(G,U,V);if(T===Fs)return D(G,U,V);if(T===qs)return M(G,U,V);if(ks[T])return Z(G,U,V);if(T===Ps)return H(G,U,V);if(T===_s)return A(G,U,V);if(T===Ts||T===ws||T===xs)return W(G,U,V);if(B){let q=B[T];if(!q){let O=Is(G);if(O)q=B[O]}if(q)return q(G,U,V)}return!1}}function bs({circular:H,createCustomConfig:$,strict:A}){let L={areArrayBuffersEqual:Ws,areArraysEqual:A?W8:Qs,areDataViewsEqual:Bs,areDatesEqual:Js,areErrorsEqual:Zs,areFunctionsEqual:Ys,areMapsEqual:A?Q1(W_,W8):W_,areNumbersEqual:Gs,areObjectsEqual:A?W8:Us,arePrimitiveWrappersEqual:Vs,areRegExpsEqual:Cs,areSetsEqual:A?Q1(Q_,W8):Q_,areTypedArraysEqual:A?Q1(VM,W8):VM,areUrlsEqual:zs,unknownTagComparators:void 0};if($)L=Object.assign({},L,$(L));if(H){let D=UM(L.areArraysEqual),I=UM(L.areMapsEqual),E=UM(L.areObjectsEqual),K=UM(L.areSetsEqual);L=Object.assign({},L,{areArraysEqual:D,areMapsEqual:I,areObjectsEqual:E,areSetsEqual:K})}return L}function hs(H){return function($,A,L,D,I,E,K){return H($,A,K)}}function us({circular:H,comparator:$,createState:A,equals:L,strict:D}){if(A)return function E(K,M){let{cache:W=H?new WeakMap:void 0,meta:X}=A();return $(K,M,{cache:W,equals:L,meta:X,strict:D})};if(H)return function E(K,M){return $(K,M,{cache:new WeakMap,equals:L,meta:void 0,strict:D})};let I={cache:void 0,equals:L,meta:void 0,strict:D};return function E(K,M){return $(K,M,I)}}function vL(H={}){let{circular:$=!1,createInternalComparator:A,createState:L,strict:D=!1}=H,I=bs(H),E=vs(I),K=A?A(E):hs(E);return us({circular:$,comparator:E,createState:L,equals:K,strict:D})}var As,Ls,Ds,Es,Ks="__v",Ms="__o",Xs="_owner",M_,X_,Gs,Ps="[object ArrayBuffer]",qs="[object Arguments]",Ts="[object Boolean]",_s="[object DataView]",Ns="[object Date]",Fs="[object Error]",Os="[object Map]",ws="[object Number]",Rs="[object Object]",js="[object RegExp]",Ss="[object Set]",xs="[object String]",ks,ys="[object URL]",fs,J_,QyH,ByH,JyH,ZyH,YyH,GyH,UyH;var Z_=y(()=>{({getOwnPropertyNames:As,getOwnPropertySymbols:Ls}=Object),{hasOwnProperty:Ds}=Object.prototype;Es=Object.hasOwn||((H,$)=>Ds.call(H,$));({getOwnPropertyDescriptor:M_,keys:X_}=Object);Gs=i0;ks={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},fs=Object.prototype.toString;J_=vL(),QyH=vL({strict:!0}),ByH=vL({circular:!0}),JyH=vL({circular:!0,strict:!0}),ZyH=vL({createInternalComparator:()=>i0}),YyH=vL({strict:!0,createInternalComparator:()=>i0}),GyH=vL({circular:!0,createInternalComparator:()=>i0}),UyH=vL({circular:!0,createInternalComparator:()=>i0,strict:!0})});class Y_{size;L0=new WeakMap;L1=new WeakMap;L2=new WeakMap;sizeL0=0;constructor(H){this.size=H}has(H){for(let $ of this.caches())if($.has(H))return!0;return!1}get(H){for(let $ of this.caches()){let A=$.get(H);if(A){if($!==this.L0)this._set(H,A);return A.v}}return}set(H,$){this._set(H,{v:$})}_set(H,$){if(this.L0.has(H))return this.L0.set(H,$),this;if(this.sizeL0>=this.size)this.rotate();this.sizeL0+=1,this.L0.set(H,$)}caches(){return[this.L0,this.L1,this.L2]}rotate(){this.L2=this.L1,this.L1=this.L0,this.L0=new WeakMap,this.sizeL0=0}}class J1{size;L0=new Map;L1=new Map;L2=new Map;constructor(H){this.size=H}has(H){for(let $ of this.caches())if($.has(H))return!0;return!1}get(H){for(let $ of this.caches()){let A=$.get(H);if(A){if($!==this.L0)this._set(H,A);return A.v}}return}set(H,$){this._set(H,{v:$})}_set(H,$){if(this.L0.has(H))return this.L0.set(H,$),this;if(this.L0.size>=this.size)this.rotate();this.L0.set(H,$)}caches(){return[this.L0,this.L1,this.L2]}rotate(){this.L2=this.L1,this.L1=this.L0,this.L0=new Map}}var B1;var G_=y(()=>{B1=class B1 extends Y_{factory;constructor(H,$){super($);this.factory=H}get(H){let $=super.get(H);if($!==void 0)return $;let A=this.factory(H);return this.set(H,A),A}}});var CM;var Z1=y(()=>{CM=Object.freeze({weightMap:void 0})});function U_(H){let $=H;for(let A of Object.keys($))if($[A]===void 0)delete $[A];return $}function V_(H){return H.replaceAll(/[|\\{}()[\]^$+*?.]/g,"\\$&").replaceAll("-","\\x2d")}function C_(H,$){if(!H&&!$)return(K)=>K;H=H||[];let A=gs($);if(A)H=[...H,...A];if(!H.filter(([K,M])=>!!K).length)return(K)=>K;let D=ps(H),I=H.filter(([K,M])=>!!K).map(([K,M])=>M);function E(K,...M){let W=M.findIndex((X)=>!!X);return 0<=W&&W<I.length?I[W]:K}return function(K){return K.replace(D,E)}}function gs(H,$=""){if(!H)return;return H.split("|").map((A)=>`[${A.replaceAll(/[\][\\]/g,"\\$&")}]`).map((A)=>[A,$])}function ms(H,$=""){if(!H)return;return H.split("|").flatMap((A)=>[...O3(A)]).map((A)=>[A,$])}function ds(H){return H.flatMap(([$,A])=>$.split("|").map((L)=>[L,A]))}function ps(H){let $=H.filter(([D,I])=>!!D);if(!$.length)return/$^/;let A=$.map(([D,I])=>D).map((D)=>{try{let I=/\(/.test(D)?D.replaceAll(/\((?=.*\))/g,"(?:").replaceAll("(?:?","(?"):D;new RegExp(I),D=I}catch{return V_(D)}return D}).map((D)=>`(${D})`).join("|");return new RegExp(A,"g")}function z_(H,$){if(!H&&!$)return(L)=>[L];let A=is(H,$);return(L)=>{let D=ls(A,L);return cs(L,D)}}function cs(H,$){if(!$.length)return[H];let A=[];for(let D=0;D<H.length;++D)A[D]={edits:[{b:D,e:D+1,r:H[D]}],suffixes:[]};A[H.length]={edits:[],suffixes:[""]};for(let D of $)A[D.b].edits.push(D);for(let D=H.length-1;D>=0;--D){let I=A[D],E=I.suffixes;for(let K of I.edits){let M=K.r,W=A[K.e].suffixes;for(let X of W)E.push(M+X)}}return[...new Set(A[0].suffixes)]}function ls(H,$){let A=[];function L(D,I,E){if(D.rep)D.rep.forEach((M)=>A.push({b:I,e:E,r:M}));if(E===$.length||!D.children)return;let K=D.children[$[E]];if(!K)return;L(K,I,E+1)}for(let D=0;D<$.length;++D)L(H,D,D);return A}function is(H,$){let A=[H,ms($)].filter(l0).flat(),L=ds(A),D=Object.create(null);return L.forEach(([I,E])=>ns(D,I,E)),D}function ns(H,$,A){while($){let D=H.children||(H.children=Object.create(null)),I=$[0];H=D[I]||(D[I]=Object.create(null)),$=$.slice(1)}let L=new Set(H.rep||[]);L.add(A),H.rep=[...L]}var P_=y(()=>{CA()});var rA=!0,eA=!1;class j3{trie;name;options;source;_size=0;knownWords=new Set;unknownWords=new Set;mapWord;remapWord;type="SpellingDictionaryFromTrie";isDictionaryCaseSensitive;containsNoSuggestWords;#H=!1;#$={caseSensitive:!0};#A={caseSensitive:!1};weightMap;constructor(H,$,A,L="from trie",D){if(this.trie=H,this.name=$,this.options=A,this.source=L,this.mapWord=C_(A.repMap,A.dictionaryInformation?.ignore),this.remapWord=z_(A.repMap,A.dictionaryInformation?.ignore),this.isDictionaryCaseSensitive=A.caseSensitive??H.isCaseAware,this.containsNoSuggestWords=A.noSuggest||!1,this._size=D||0,this.weightMap=A.weightMap||ZM(A.dictionaryInformation),this.#H=!!A.ignoreForbiddenWords,this.#H)this.#$.checkForbidden=!0,this.#A.checkForbidden=!0}get size(){if(!this._size){let H=this.trie.iterate(),$=!0,A=0;for(let L=H.next();!L.done;L=H.next($))A+=1,$=L.value.text.length<5;this._size=A}return this._size}has(H,$){let{useCompounds:A,ignoreCase:L}=this.resolveOptions($),D=this._find(H,A,L);return D&&!D.forbidden&&!!D.found||!1}find(H,$){let{useCompounds:A,ignoreCase:L}=this.resolveOptions($),D=this._find(H,A,L),{forbidden:I=this.#L(H)}=D||{};if(this.#H&&I)return;if(!D&&!I)return;let{found:E=I?H:!1}=D||{},K=E!==!1&&this.containsNoSuggestWords;return{found:E,forbidden:I,noSuggest:K}}resolveOptions(H){let{useCompounds:$=this.options.useCompounds,ignoreCase:A=rA}=M8(H);return{useCompounds:$,ignoreCase:A}}_find=(H,$,A)=>this.findAnyForm(H,$,A);findAnyForm(H,$,A){let L=as(H,this.remapWord||((D)=>[this.mapWord(D)]));for(let D of L){let I=this._findAnyForm(D,$,A);if(I)return I}return}_findAnyForm(H,$,A){let L=A?this.#A:this.#$,D=this.trie.findWord(H,L);if(D.found!==!1)return D;let I=$_(H,this.isDictionaryCaseSensitive,A);for(let E of I){let K=this.trie.findWord(E,L);if(K.found!==!1)return K}if($){let E={...L,useLegacyWordCompounds:$};for(let K of I){let M=this.trie.findWord(K,E);if(M.found!==!1)return M}}return}isNoSuggestWord(H,$){return this.containsNoSuggestWords?this.has(H,$):!1}isForbidden(H,$){return this.#H?!1:this.#L(H,$)}#L(H,$){return this.trie.isForbiddenWord(H)}suggest(H,$={}){return this._suggest(H,$)}_suggest(H,$){let{numSuggestions:A=JM,numChanges:L,includeTies:D,ignoreCase:I,timeout:E}=$;function K(W){return!0}let M=c0(H,U_({numSuggestions:A,filter:K,changeLimit:L,includeTies:D,ignoreCase:I,timeout:E,weightMap:this.weightMap}));return this.genSuggestions(M,$),M.suggestions.map((W)=>({...W,word:W.word}))}genSuggestions(H,$){if(this.options.noSuggest)return;let A=$.compoundMethod??(this.options.useCompounds?bH.JOIN_WORDS:bH.NONE);for(let L of A_(H.word))this.trie.genSuggestions(oB(H,L),A)}getErrors(){return[]}}function zM(H,$,A,L){let D=gT(H);return new j3(D,$,L,A)}function*as(H,$){let A=new Set,L=H,D=L;if(yield L,A.add(L),L=H.normalize("NFC"),L!==D)yield L,A.add(L);if(L=H.normalize("NFD"),L!==D&&!A.has(L))yield L,A.add(L);for(let I of A)for(let E of $(I))if(E!==D&&!A.has(E))yield E,A.add(E);return}var PM=y(()=>{CA();P_();X8()});import{fileURLToPath as ts}from"node:url";function B$(H,$,A,L){let D=[H,$,A.toString(),L];if(!Array.isArray(H))return __(D);let I=T_.get($)||new Set;for(let E of I)if(J_(D,E))return q_.get(E);if(I.size>os)I.clear();return I.add(D),T_.set($,I),q_.get(D)}function __(H){let[$,A,L,D]=H,I={stripCaseAndAccents:D?.supportNonStrictSearches??!0},E=w3($,I),K=KM(E),M={...D||CM};if(M.weightMap===void 0&&M.dictionaryInformation)M.weightMap=ZM(M.dictionaryInformation);return new j3(K,A,M,L)}function qM(H,$,A,L){let D=typeof $==="string"?$:$.href,I=D.startsWith("file:")?ts($):D;return L=L||{},{name:H,source:I,type:"error",containsNoSuggestWords:!1,has:()=>!1,find:()=>{return},isNoSuggestWord:()=>!1,isForbidden:()=>!1,suggest:()=>[],mapWord:(E)=>E,genSuggestions:()=>{return},size:0,options:L,isDictionaryCaseSensitive:!1,getErrors:()=>[A]}}var q_,os=3,T_;var TM=y(()=>{CA();Z_();G_();Z1();PM();X8();q_=new B1(__,64),T_=new J1(64)});function*_M(H){for(let $ of H){let A=$.toLowerCase();yield A;let L=rT(A);if(A!==L)yield L}}var Y1=y(()=>{X1()});function N_(H){if(!H)return!1;if(typeof H==="string")return H;let $=[...new Set(H)];return $.length>1?$:$.length===1?$[0]:!1}function F_(H,$,A){let L=H[$];if(!L)return H[$]=N_(A),H;if(!A)return H;let D=Array.isArray(L)?L:[L];if(Array.isArray(A))D.push(...A);else D.push(A);return H[$]=N_(D),H}function ss(H,$){for(let A of Object.keys($))F_(H,A,$[A]);return H}function O_(H,$){if(!$)return H;if(typeof $==="string"){if(!H[$])H[$]=!1;return H}if(Array.isArray($)){let[A,...L]=$.map((I)=>I.trim());if(!A)return H;let D=L.map((I)=>I.trim()).filter((I)=>!!I);return F_(H,A,D)}return ss(H,$)}function NM(H){let $=Object.create(null);if(!H)return $;for(let[A,L]of H)$[A]=rs(L)?L:!1;return $}function FM(H){let $=WH(Object.values(H),vH($r),E$((A)=>Array.isArray(A)?A:[A]));return new Set($)}function w_(H,$){let A=$.length;return new Set(Object.keys(H).filter((L)=>L.startsWith($)).map((L)=>L.slice(A)))}function rs(H){return H!==void 0&&H!==null}function es(H){return typeof H==="string"}function Hr(H){return Array.isArray(H)}function $r(H){return es(H)||Hr(H)}var OM=y(()=>{N$()});import G1 from"node:assert";function R_(H){return G1(typeof H==="string","A string was expected."),!0}function U1(H){return H.normalize()}function j_(H){return H.map(($)=>$.trim()).filter(($)=>!!$).map(U1)}function S_(H){let $=j_(H);return $.length===1?$[0]:$.length?$:!1}function x_(H){return S_(H.split(Ar))}function k_(H){if(!H||typeof H!=="object")return;let $=NM();for(let[A,L]of Object.entries(H)){let D=U1(A.trim());if(!D)continue;if(typeof L==="string"){$[D]=x_(L);continue}if(Array.isArray(L)){let I=S_(L.filter(R_));$[D]=I;continue}G1(L===!1,"Unexpected suggestion type."),$[D]=!1}return $}function Q8(H){let $=Mr(H)?Ir(H):H,A=k_($);return G1(A),A}function Ir(H){let $=NM();for(let A of H)O_($,y_(A));return $}function y_(H){if(!H)return;if(typeof H==="string"){let $=NM();for(let A of Er(H)){let[L,D]=Kr(A),I=L.trim();if(!D)return I;let E=x_(D);$[I]=E}return $}if(Array.isArray(H)){let[$,...A]=H.filter(R_).map((L)=>L.trim());if(!$)return;return[$,...A]}return k_(H)}function Er(H){return j_(U1(H).split(Dr))}function Kr(H){return H.split(Lr,2)}function Mr(H){return Symbol.iterator in H}var Ar,Lr,Dr;var f_=y(()=>{OM();Ar=/[,]/,Lr=/:|->/,Dr=/[\n;]/});var V1=y(()=>{f_()});class v_{name;source;typosDef;containsNoSuggestWords;options={};type="typos";size;ignoreWords;suggestions;suggestionsLower;explicitIgnoreWords;constructor(H,$,A,L){this.name=H,this.source=$,this.typosDef=A,this.size=Object.keys(A).length,this.explicitIgnoreWords=w_(A,"!"),this.suggestions=FM(A),this.ignoreWords=new Set(WH(this.explicitIgnoreWords,oA(L||[]))),this.suggestionsLower=new Set(WH(this.suggestions,_M)),this.containsNoSuggestWords=this.ignoreWords.size>0}has(H,$){return!1}find(H,$){let A=this._findForms(H,$?.ignoreCase??rA);if(A===!1)return;let{found:L,ignore:D}=A;return{found:L,forbidden:!D,noSuggest:D}}_findForms(H,$){let A=H.toLowerCase();if(this.ignoreWords.has(H))return{found:H,ignore:!0};if(this.suggestions.has(H))return!1;if($){if(this.suggestionsLower.has(A))return!1;if(this.ignoreWords.has(A))return{found:A,ignore:!0}}if(H in this.typosDef)return{found:H,ignore:!1};if(A in this.typosDef)return{found:A,ignore:!1};return!1}isForbidden(H,$=eA){let A=this._findForms(H,$);return A!==!1&&!A.ignore}isNoSuggestWord(H,$){return this.find(H,$)?.noSuggest??!1}isSuggestedWord(H,$=eA){if(this.suggestions.has(H))return!0;let A=H.toLowerCase();return $&&(this.suggestions.has(A)||this.suggestionsLower.has(A))}suggest(H){return this.getPreferredSuggestions(H)}_suggest(H){if(this.ignoreWords.has(H))return[];if(!(H in this.typosDef))return;let $=this.typosDef[H],A=!0;if(!$)return[];if(typeof $==="string")return[{word:$,cost:1,isPreferred:A}];return $.map((L,D)=>({word:L,cost:D+1,isPreferred:A}))}genSuggestions(H){this.suggest(H.word).forEach((A)=>H.add(A))}getPreferredSuggestions(H){return this._suggest(H)||this._suggest(H.toLowerCase())||[]}mapWord(H){return H}isDictionaryCaseSensitive=!0;getErrors(){return[]}}function b_(H,$,A){return Xr.get(H,()=>{let L=Q8(H);return new v_($,A,L)})}var Xr;var h_=y(()=>{N$();Y1();V1();OM();Xr=zA()});class g_{name;source;dictTypos;dictTrie;containsNoSuggestWords=!1;options={};type="flag-words";constructor(H,$,A,L){this.name=H,this.source=$,this.dictTypos=A,this.dictTrie=L}has(H,$){return this.dictTypos.has(H,$)||this.dictTrie?.has(H,$)||!1}find(H,$){let A=this.dictTypos.find(H,$);if(A)return A;let L=$?.ignoreCase??rA;if(this.dictTypos.isSuggestedWord(H,L))return;return this.dictTrie?.find(H,$)}isForbidden(H,$=eA){return this.find(H,{ignoreCase:$})?.forbidden||!1}isNoSuggestWord(H,$){return this.dictTrie?.isNoSuggestWord(H,$)||this.dictTypos.isNoSuggestWord(H,$)}suggest(H,$={}){return this.dictTypos.suggest(H,$)}getPreferredSuggestions(H){return this.dictTypos.getPreferredSuggestions(H)}genSuggestions(){return}mapWord(H){return H}get size(){return this.dictTypos.size+(this.dictTrie?.size||0)}isDictionaryCaseSensitive=!0;getErrors(){return[]}}function bL(H,$,A){return Wr.get(H,()=>{let L=/[~*+]/,{t:D,f:I}=Jr(w3(H,{stripCaseAndAccents:!1}),(M)=>L.test(M)),E=D.size?Br(D,$,A):void 0,K=b_(I,$,A);if(!E)return K;return new g_($,A,K,E)})}function Br(H,$,A){let L=KM(WH(H,UH((D)=>"!"+D),UH((D)=>D.replace(Qr,""))));return new u_(L,$,A)}function Jr(H,$){let A=new Set,L=new Set;for(let D of H)if($(D))A.add(D);else L.add(D);return{t:A,f:L}}var u_,Wr,Qr;var C1=y(()=>{N$();CA();Z1();PM();h_();u_=class u_ extends j3{name;source;containsNoSuggestWords=!1;options={};constructor(H,$,A){super(H,$,CM,A);this.name=$,this.source=A}has(H,$){return!1}find(H,$){let A=super.find(H,$);if(!A||!A.forbidden)return;return A}suggest(){return[]}genSuggestions(){return}isDictionaryCaseSensitive=!0};Wr=zA();Qr=/^(!!)+/});class m_{name;source;dict;dictNonStrict;containsNoSuggestWords=!0;options={};type="ignore";constructor(H,$,A){this.name=H,this.source=$,this.dict=new Set(A),this.dictNonStrict=new Set(WH(this.dict,vH((L)=>L.startsWith("~")),UH((L)=>L.slice(1))))}has(H,$){let A=H.normalize(z1);if(this.dict.has(A))return!0;let L=A.toLowerCase();if(this.dict.has(L))return!0;return($?.ignoreCase??rA)&&(this.dictNonStrict.has(A)||this.dictNonStrict.has(L))}find(H,$){let A=H.normalize(z1);if(this.dict.has(A))return{found:A,forbidden:!1,noSuggest:!0};let L=A.toLowerCase();if(this.dict.has(L))return{found:L,forbidden:!1,noSuggest:!0};if(!($?.ignoreCase??rA))return;if(this.dictNonStrict.has(A))return{found:A,forbidden:!1,noSuggest:!0};return this.dictNonStrict.has(L)&&{found:L,forbidden:!1,noSuggest:!0}||void 0}isForbidden(H,$){return!1}isNoSuggestWord(H,$){return this.has(H,$)}suggest(){return[]}genSuggestions(){return}mapWord(H){return H}get size(){return this.dict.size}isDictionaryCaseSensitive=!0;getErrors(){return[]}}function S3(H,$,A,L){return Zr.get(H,()=>{let D=/[*+]/,I={stripCaseAndAccents:L?.supportNonStrictSearches??!0},E=[...w3(H,I)].map((M)=>M.normalize(z1));if(E.some((M)=>D.test(M)))return B$(E,$,A,{caseSensitive:!0,noSuggest:!0,weightMap:void 0,supportNonStrictSearches:!0});return new m_($,A,E)})}var z1="NFC",Zr;var P1=y(()=>{N$();CA();TM();Zr=zA()});function Yr(H){return H}class d_{dictionaries;name;options={weightMap:void 0};mapWord=Yr;type="SpellingDictionaryCollection";source;isDictionaryCaseSensitive;containsNoSuggestWords;constructor(H,$,A){this.dictionaries=H,this.name=$,this.dictionaries=this.dictionaries.sort((L,D)=>D.size-L.size),this.source=A||H.map((L)=>L.name).join(", "),this.isDictionaryCaseSensitive=this.dictionaries.reduce((L,D)=>L||D.isDictionaryCaseSensitive,!1),this.containsNoSuggestWords=this.dictionaries.reduce((L,D)=>L||D.containsNoSuggestWords,!1)}has(H,$){let A=M8($);return!!Gr(this.dictionaries,H,A)&&!this.isForbidden(H)}find(H,$){let A=M8($);return Ur(this.dictionaries,H,A)}isNoSuggestWord(H,$){return this._isNoSuggestWord(H,$)}isForbidden(H,$){let A=$??eA;return!!this._isForbiddenInDict(H,A)&&!this.isNoSuggestWord(H,{ignoreCase:A})}suggest(H,$={}){return this._suggest(H,$)}_suggest(H,$){let{numSuggestions:A=JM,numChanges:L,ignoreCase:D,includeTies:I,timeout:E}=$,K=E8,X=c0(H,{numSuggestions:A,filter:(J,Z)=>{return(D||J[0]!==K)&&!this.isForbidden(J)&&!this.isNoSuggestWord(J,$)},changeLimit:L,includeTies:I,ignoreCase:D,timeout:E});return this.genSuggestions(X,$),X.suggestions}get size(){return this.dictionaries.reduce((H,$)=>H+$.size,0)}getPreferredSuggestions(H){let $=this.dictionaries.flatMap((L)=>L.getPreferredSuggestions?.(H)).filter(l0);if($.length<=1)return $;let A=new Set;return $.filter((L)=>{if(A.has(L.word))return!1;return A.add(L.word),!0})}genSuggestions(H,$){let A={...$},{compoundMethod:L=bH.SEPARATE_WORDS}=$;A.compoundMethod=this.options.useCompounds?bH.JOIN_WORDS:L,this.dictionaries.forEach((D)=>D.genSuggestions(H,A))}getErrors(){return this.dictionaries.reduce((H,$)=>[...H,...$.getErrors?.()||[]],[])}_isForbiddenInDict(H,$){return Cr(this.dictionaries,H,$)}_isNoSuggestWord=(H,$)=>{if(!this.containsNoSuggestWords)return!1;return!!Vr(this.dictionaries,H,$||{})}}function HL(H,$,A){return new d_(H,$,A)}function Gr(H,$,A){return H.find((L)=>L.has($,A))}function Ur(H,$,A){let L=H.map((D)=>D.find($,A)).filter(l0);if(!L.length)return;return L.reduce((D,I)=>({found:D.forbidden?D.found:I.forbidden?I.found:D.found||I.found,forbidden:D.forbidden||I.forbidden,noSuggest:D.noSuggest||I.noSuggest}))}function Vr(H,$,A){return H.find((L)=>L.isNoSuggestWord($,A))}function Cr(H,$,A){return H.find((L)=>L.isForbidden($,A))}var q1=y(()=>{CA();X8()});class p_{name;source;typosDef;containsNoSuggestWords=!1;options={};type="suggest";size;suggestions;suggestionsLower;constructor(H,$,A){this.name=H,this.source=$,this.typosDef=A,this.size=Object.keys(A).length,this.suggestions=FM(A),this.suggestionsLower=new Set(WH(this.suggestions,_M))}has(H,$){return!1}find(H,$){return}isForbidden(H,$){return!1}isNoSuggestWord(H,$){return!1}isSuggestedWord(H,$=eA){if(this.suggestions.has(H))return!0;if(!$)return!1;let A=H.toLowerCase();return this.suggestions.has(A)||this.suggestionsLower.has(A)}suggest(H){return this.getPreferredSuggestions(H)}_suggest(H){if(!(H in this.typosDef))return;let $=this.typosDef[H],A=!0;if(!$)return[];if(typeof $==="string")return[{word:$,cost:1,isPreferred:A}];return $.map((L,D)=>({word:L,cost:D+1,isPreferred:A}))}getPreferredSuggestions(H){return this._suggest(H)||this._suggest(H.toLowerCase())||[]}genSuggestions(H){this.suggest(H.word).forEach((A)=>H.add(A))}mapWord(H){return H}isDictionaryCaseSensitive=!0;getErrors(){return[]}}function x3(H,$,A){return zr.get(H,()=>{let L=Q8(H);return new p_($,A,L)})}var zr;var T1=y(()=>{N$();Y1();V1();OM();zr=zA()});function k3(H,$){return Pr.get(H,()=>{let{words:A,flagWords:L,ignoreWords:D,suggestWords:I,name:E,supportNonStrictSearches:K}=H,M={supportNonStrictSearches:K},W=[A&&B$(A,E+"-words",$,H),L&&bL(L,E+"-flag-words",$),D&&S3(D,E+"-ignore-words",$,M),I&&x3(I,E+"-suggest",$)].filter(l0);return HL(W,E,$)})}var Pr;var c_=y(()=>{TM();C1();P1();q1();T1();Pr=zA()});var l_=y(()=>{I_();c_();TM();C1();P1();q1();PM();T1()});var B8=y(()=>{l_()});function qr(H){let $=new Set,A=H||((L)=>L);return(L)=>{let D=A(L),I=!$.has(D);return $.add(D),I}}function K$(H){let $=H;for(let A of Object.keys($))if($[A]===void 0||$[A]===null)delete $[A];return $}function n_(H,$){let A=$,L=!0;return function(D){if(L&&A===void 0)return L=!1,A=D,A;return A=H(A,D),A}}function c$(H){return H!==void 0}function a_(H,$){if(H===$)return!0;let A=H.length===$.length;for(let L=0;L<H.length&&A;++L)A=H[L]===$[L];return A}function t_(H,$){function A(L,D){for(let I of L)if(D.has(I))return!0;return!1}return H.size<=$.size?A(H,$):A($,H)}var i_;var z$=y(()=>{i_=qr});function wM(H){return H?Object.assign(K$(H),{[N1]:!0}):{[N1]:!0}}function $L(H){return wM({...H})}function o_(H){return!!H[N1]}function J8(H){if(H.path)return!1;let $=H;return!!($.words||$.flagWords||$.ignoreWords||$.suggestWords)}function s_(H){return!!(H.path||H.file)}var N1;var n0=y(()=>{z$();N1=Symbol("CSpellSettingsInternal")});function y3(H,$,A){let L=H.get($);if(L!==void 0||H.has($))return L;let D=A($);return H.set($,D),D}class F1{hits=0;misses=0;resolved=0;deletes=0;sets=0;clears=0;disposals=0;stats(){return{hits:this.hits,misses:this.misses,resolved:this.resolved,deletes:this.deletes,sets:this.sets,clears:this.clears,disposals:this.disposals}}clear(){this.hits=0,this.misses=0,this.resolved=0,this.deletes=0,this.sets=0,++this.clears}}class hL{map=new Map;get(H,$){return $?y3(this.map,H,$):this.map.get(H)}has(H){return this.map.has(H)}set(H,$){return this.map.set(H,$),this}delete(H){return this.map.delete(H)}clear(){this.map.clear()}dispose(){this.clear()}}function f3(){return new hL}function v3(H,$,A){let L=H.get($);if(L!==void 0||H.has($))return L;let D=A($);return H.set($,D),D}class l${_map=new WeakMap;_stats=new F1;get(H,$){let A=this._map,L=A.get(H);if(L!==void 0||A.has(H))return++this._stats.hits,L;if(++this._stats.misses,!$)return;++this._stats.resolved;let D=$(H);return A.set(H,D),D}get map(){return this._map}has(H){return this._map.has(H)}set(H,$){return++this._stats.sets,this._map.set(H,$),this}clear(){this._stats.clear(),this._map=new WeakMap}delete(H){return++this._stats.deletes,this._map.delete(H)}dispose(){++this._stats.disposals,this.clear()}stats(){return this._stats.stats()}}function O1(){return new l$}class RM{_map=new WeakMap;_stats=new F1;get(H,$){let A=this._map,L=A.get(H),D=L?.deref();if(L!==void 0&&D)return++this._stats.hits,D;if(++this._stats.misses,!$){if(L)A.delete(H);return}++this._stats.resolved;let I=$(H);return A.set(H,new WeakRef(I)),I}get map(){return this._map}has(H){return!!this._map.get(H)?.deref()}set(H,$){return++this._stats.sets,this._map.set(H,new WeakRef($)),this}clear(){this._stats.clear(),this._map=new WeakMap}delete(H){return++this._stats.deletes,this._map.delete(H)}dispose(){++this._stats.disposals,this.clear()}stats(){return this._stats.stats()}}function r_(){return new RM}var HN=n((e_)=>{Object.defineProperty(e_,"__esModule",{value:!0});e_.requireResolve=Tr;function Tr(H,$){try{return ZH.resolve(H,$?{paths:$}:void 0)}catch{return}}});var IN=n((tfH,DN)=>{var{hasOwnProperty:w1}=Object.prototype,R1=(H,$={})=>{if(typeof $==="string")$={section:$};$.align=$.align===!0,$.newline=$.newline===!0,$.sort=$.sort===!0,$.whitespace=$.whitespace===!0||$.align===!0,$.platform=$.platform||typeof process<"u"&&process.platform,$.bracketedArray=$.bracketedArray!==!1;let A=$.platform==="win32"?`\r
|
|
320
|
+
`:`
|
|
321
|
+
`,L=$.whitespace?" = ":"=",D=[],I=$.sort?Object.keys(H).sort():Object.keys(H),E=0;if($.align)E=AL(I.filter((W)=>H[W]===null||Array.isArray(H[W])||typeof H[W]!=="object").map((W)=>Array.isArray(H[W])?`${W}[]`:W).concat([""]).reduce((W,X)=>AL(W).length>=AL(X).length?W:X)).length;let K="",M=$.bracketedArray?"[]":"";for(let W of I){let X=H[W];if(X&&Array.isArray(X))for(let J of X)K+=AL(`${W}${M}`).padEnd(E," ")+L+AL(J)+A;else if(X&&typeof X==="object")D.push(W);else K+=AL(W).padEnd(E," ")+L+AL(X)+A}if($.section&&K.length)K="["+AL($.section)+"]"+($.newline?A+A:A)+K;for(let W of D){let X=AN(W,".").join("\\."),J=($.section?$.section+".":"")+X,Z=R1(H[W],{...$,section:J});if(K.length&&Z.length)K+=A;K+=Z}return K};function AN(H,$){var A=0,L=0,D=0,I=[];do if(D=H.indexOf($,A),D!==-1){if(A=D+$.length,D>0&&H[D-1]==="\\")continue;I.push(H.slice(L,D)),L=D+$.length}while(D!==-1);return I.push(H.slice(L)),I}var $N=(H,$={})=>{$.bracketedArray=$.bracketedArray!==!1;let A=Object.create(null),L=A,D=null,I=/^\[([^\]]*)\]\s*$|^([^=]+)(=(.*))?$/i,E=H.split(/[\r\n]+/g),K={};for(let W of E){if(!W||W.match(/^\s*[;#]/)||W.match(/^\s*$/))continue;let X=W.match(I);if(!X)continue;if(X[1]!==void 0){if(D=jM(X[1]),D==="__proto__"){L=Object.create(null);continue}L=A[D]=A[D]||Object.create(null);continue}let J=jM(X[2]),Z;if($.bracketedArray)Z=J.length>2&&J.slice(-2)==="[]";else K[J]=(K?.[J]||0)+1,Z=K[J]>1;let Q=Z?J.slice(0,-2):J;if(Q==="__proto__")continue;let B=X[3]?jM(X[4]):!0,Y=B==="true"||B==="false"||B==="null"?JSON.parse(B):B;if(Z){if(!w1.call(L,Q))L[Q]=[];else if(!Array.isArray(L[Q]))L[Q]=[L[Q]]}if(Array.isArray(L[Q]))L[Q].push(Y);else L[Q]=Y}let M=[];for(let W of Object.keys(A)){if(!w1.call(A,W)||typeof A[W]!=="object"||Array.isArray(A[W]))continue;let X=AN(W,".");L=A;let J=X.pop(),Z=J.replace(/\\\./g,".");for(let Q of X){if(Q==="__proto__")continue;if(!w1.call(L,Q)||typeof L[Q]!=="object")L[Q]=Object.create(null);L=L[Q]}if(L===A&&Z===J)continue;L[Z]=A[W],M.push(W)}for(let W of M)delete A[W];return A},LN=(H)=>{return H.startsWith('"')&&H.endsWith('"')||H.startsWith("'")&&H.endsWith("'")},AL=(H)=>{if(typeof H!=="string"||H.match(/[=\r\n]/)||H.match(/^\[/)||H.length>1&&LN(H)||H!==H.trim())return JSON.stringify(H);return H.split(";").join("\\;").split("#").join("\\#")},jM=(H,$)=>{if(H=(H||"").trim(),LN(H)){if(H.charAt(0)==="'")H=H.slice(1,-1);try{H=JSON.parse(H)}catch{}}else{let A=!1,L="";for(let D=0,I=H.length;D<I;D++){let E=H.charAt(D);if(A){if("\\;#".indexOf(E)!==-1)L+=E;else L+="\\"+E;A=!1}else if(";#".indexOf(E)!==-1)break;else if(E==="\\")A=!0;else L+=E}if(A)L+="\\";return L.trim()}return H};DN.exports={parse:$N,decode:$N,stringify:R1,encode:R1,safe:AL,unsafe:jM}});import H$ from"node:process";import $$ from"node:path";import j1 from"node:os";import SM from"node:fs";var KN,Y8,EN=(H)=>{try{return KN.default.parse(SM.readFileSync(H,"utf8")).prefix}catch{}},Nr=()=>Object.keys(H$.env).reduce((H,$)=>/^npm_config_prefix$/i.test($)?H$.env[$]:H,void 0),Fr=()=>{if(Y8&&H$.env.APPDATA)return $$.join(H$.env.APPDATA,"/npm/etc/npmrc");if(H$.execPath.includes("/Cellar/node")){let H=H$.execPath.slice(0,H$.execPath.indexOf("/Cellar/node"));return $$.join(H,"/lib/node_modules/npm/npmrc")}if(H$.execPath.endsWith("/bin/node")){let H=$$.dirname($$.dirname(H$.execPath));return $$.join(H,"/etc/npmrc")}},Or=()=>{if(Y8){let{APPDATA:H}=H$.env;return H?$$.join(H,"npm"):$$.dirname(H$.execPath)}return $$.dirname($$.dirname(H$.execPath))},wr=()=>{let H=Nr();if(H)return H;let $=EN($$.join(j1.homedir(),".npmrc"));if($)return $;if(H$.env.PREFIX)return H$.env.PREFIX;let A=EN(Fr());if(A)return A;return Or()},Z8,MN=()=>{if(Y8&&H$.env.LOCALAPPDATA){let H=$$.join(H$.env.LOCALAPPDATA,"Yarn");if(SM.existsSync(H))return H}return!1},Rr=()=>{if(H$.env.PREFIX)return H$.env.PREFIX;let H=MN();if(H)return H;let $=$$.join(j1.homedir(),".config/yarn");if(SM.existsSync($))return $;let A=$$.join(j1.homedir(),".yarn-config");if(SM.existsSync(A))return A;return Z8},PA,XN,S1;var WN=y(()=>{KN=kA(IN(),1),Y8=H$.platform==="win32",Z8=$$.resolve(wr()),PA={};PA.npm={};PA.npm.prefix=Z8;PA.npm.packages=$$.join(Z8,Y8?"node_modules":"lib/node_modules");PA.npm.binaries=Y8?Z8:$$.join(Z8,"bin");XN=$$.resolve(Rr());PA.yarn={};PA.yarn.prefix=XN;PA.yarn.packages=$$.join(XN,MN()?"Data/global/node_modules":"global/node_modules");PA.yarn.binaries=$$.join(PA.yarn.packages,".bin");S1=PA});function x1(H){let $=[S1.npm.packages,S1.yarn.packages];return QN.requireResolve(H,$)}var QN;var BN=y(()=>{WN();QN=kA(HN(),1)});var JN=y(()=>{BN()});import jr from"node:assert";import uL from"node:path";import{fileURLToPath as k1,pathToFileURL as GN}from"node:url";function DA(H,$){return a0(H instanceof URL?H:new URL(H,$))}function y1(H){if(H=DA(H),H.protocol==="data:")return H;let $=H.pathname.endsWith("/");if(!H.pathname.startsWith("/")){if(!H.pathname)return H;let A=H.pathname.split("/").slice(0,$?-2:-1).join("/")+"/";return new URL(H.protocol+(H.host?"//"+H.host:"")+A+H.search+H.hash)}return new URL($?"..":".",H)}function xr(H){let $=H.endsWith("/")?2:0,A=H.lastIndexOf("/",H.length-$);return A>=0?H.slice(A+1):H}function fH(H){return H instanceof URL||Sr.test(H)}function UN(H,$){return $=$.endsWith(":")?$:$+":",typeof H==="string"?H.startsWith($):H.protocol===$}function U8(H){if(H.pathname.endsWith("/"))return H;let $=new URL(H.href);return $.pathname+="/",$}function kr(H,$){let A=H.pathname,L=$.pathname;if(A===L)return"";if(A=A.endsWith("/")?A:new URL("./",H).pathname,L.startsWith(A))return decodeURIComponent(L.slice(A.length));let D=A,I=L;if(I.startsWith(D))return decodeURIComponent(D===I?"":I.slice(D.lastIndexOf("/")+1));let E=D.split("/").slice(0,-1),K=I.split("/"),M=0;for(M=0;M<E.length&&M<K.length-1&&E[M]===K[M];++M);let W="../".repeat(E.length-M)+K.slice(M).join("/");return decodeURIComponent(W.length<I.length?W:I)}function a0(H){if(H=typeof H==="string"?new URL(H):H,H.protocol==="file:"){let $=H.pathname.replaceAll("%3A",":").replaceAll("%3a",":").replaceAll("%24","$");if(!H.host)$=$.replace(yr,"$1:");if($=$.replace(VN,(A)=>A.toUpperCase()),$!==H.pathname)return H=new URL(H),H.pathname=$,ZN(H)}return ZN(H)}function ZN(H){if(H.href.startsWith("file:////"))return new URL(H.href.replace(/^file:\/{4}/,"file://"));return H}function LL(H){function $(A){let L=A.match(fr);if(L)return L[1];return A.split(";",1)[0].replaceAll(/\W/g,".")}if(H=DA(H),H.protocol==="data:")return $(H.pathname.split(",",1)[0]);return xr(H.pathname)}function xM(H){return UN(H,"data:")}function CN(H){return vr.test(H)}function DL(H){return UN(H,"file:")}function FH(H){return DL(H)&&H.toString().startsWith("file:///")?br(H):H.toString()}function br(H){try{if(G8){let $=new URL(H);if(!CN($.pathname)){let A=GN(process.cwd());if(A.hostname)return k1(new URL($.pathname,A));return $.pathname=`/${A.pathname.split("/")[1]}${$.pathname}`,k1($)}}return PN(k1(H))}catch{return H.toString()}}function PN(H){return H.replace(zN,($)=>$.toUpperCase())}function ur(H){return hr.test(H.toString())}function PH(H,$){return qN.toFileURL(H,$)}function J$(H){return qN.toFileDirURL(H)}var Sr,VN,yr,fr,G8,vr,zN,hr,gr,mr,dr,pr,cr,lr,ir,nr,ar,YN="file:",t0=class{windows;path;cwd;constructor(H={}){let $=H.path?.sep;this.windows=H.windows??($?$==="\\":void 0)??G8,this.path=H.path??(this.windows?uL.win32:uL.posix),this.cwd=H.cwd??this.pathToFileURL(this.path.resolve()+"/",this.rootFileURL()),jr(this.path.sep===(this.windows?"\\":"/"),`Path separator should match OS type Windows: ${this.windows===!0?"true":(this.windows??"undefined")||"false"}, sep: ${this.path.sep}, options: `+JSON.stringify({isWindows:G8,sep:`${$}`,windows:H.windows,pathSep:H.path?.sep,n:H.path?.normalize("path/file.txt"),cwd:H.cwd?.href,win32:this.path===uL.win32,posix:this.path===uL.posix,"win32.normalize":this.path.normalize===uL.win32.normalize,"posix.normalize":this.path.normalize===uL.posix.normalize}))}encodePathChars(H){if(H=H.replaceAll(dr,"%25"),!this.windows&&!G8&&H.includes("\\"))H=H.replaceAll(pr,"%5C");return H=H.replaceAll(cr,"%0A"),H=H.replaceAll(lr,"%0D"),H=H.replaceAll(ir,"%09"),H}normalizeFilePathForUrl(H){return H=this.encodePathChars(H),H=H.replaceAll(nr,"%3F"),H=H.replaceAll(ar,"%23"),H.replaceAll("\\","/").replace(gr,($)=>`/${$}`.toUpperCase())}toFileURL(H,$){return a0(this.#H(H,$))}#H(H,$){if(typeof H!=="string")return H;if(fH(H))return a0(new URL(H));if($??=this.cwd,G8&&(H=H.replaceAll("\\","/")),this.isAbsolute(H)&&DL($)){let D=this.normalizeFilePathForUrl(H);if(ur($)&&!CN(D)){let I=$.toString().slice(0,10);return a0(new URL(I+D))}return a0(new URL("file://"+D))}if(fH($)){let D=this.normalizeFilePathForUrl(H);return a0(new URL(D,$))}let A=H.endsWith("/")?"/":"",L=this.normalizeFilePathForUrl(this.path.resolve($.toString(),H))+A;return a0(new URL("file://"+L))}toFileDirURL(H,$){return U8(this.toFileURL(H,$))}urlToFilePathOrHref(H){return H=this.toFileURL(H),this.#$(H)}#$(H){if(H.protocol!==YN||H.hostname)return H.href;return PN((this.path===uL?FH(H):decodeURIComponent(H.pathname.split("/").join(this.path.sep))).replace(mr,"$1"))}relative(H,$){if(H.protocol===$.protocol&&H.protocol===YN){if(H.href===$.href)return"";H=H.pathname.endsWith("/")?H:new URL("./",H);let A=H.pathname,L=$.pathname;if(L.startsWith(A))return decodeURIComponent(L.slice(A.length));let D=this.#$(H),I=this.#$($),E=$.pathname.endsWith("/"),K=this.normalizeFilePathForUrl(this.path.relative(D,I));if(E&&!K.endsWith("/"))K+="/";return decodeURIComponent(K)}return decodeURIComponent(kr(H,$))}urlDirname(H){return y1(this.toFileURL(H))}pathToFileURL(H,$){return new URL(this.normalizeFilePathForUrl(H),$||this.cwd)}rootFileURL(H){let $=this.path,A=$.parse($.normalize($.resolve(H??".")));return new URL(this.normalizeFilePathForUrl(A.root),this.#A())}#A(){if(this.path===uL)return GN("/");let H=this.path.resolve("/");return new URL(this.normalizeFilePathForUrl(H),"file:///")}isAbsolute(H){return fH(H)||this.path.isAbsolute(H)}isUrlLike(H){return fH(H)}},qN;var qA=y(()=>{Sr=/^(\w[\w-]{1,63}:\/|data:|stdin:)/i;VN=/^[\\/]([a-zA-Z]:[\\/])/,yr=/^(\/+[a-zA-Z])\$/;fr=/filename=([^;,]*)/;G8=process.platform==="win32",vr=/^\/[a-zA-Z]:\//;zN=/^([a-zA-Z]):[\\/]/;hr=/^file:\/\/\/[a-zA-Z]:\//;gr=zN,mr=VN,dr=/%/g,pr=/\\/g,cr=/\n/g,lr=/\r/g,ir=/\t/g,nr=/\?/g,ar=/#/g,qN=new t0});import tr from"node:v8";import o0 from"node:assert";import{format as or,inspect as v1}from"node:util";function f1(H,$="and"){return H.length<3?H.join(` ${$} `):`${H.slice(0,-1).join(", ")}, ${$} ${H[H.length-1]}`}function i$(H,$,A){return _N.set(H,$),$e(A,H)}function $e(H,$){return A;function A(...L){let D=Error.stackTraceLimit;if(b1())Error.stackTraceLimit=0;let I=new H;if(b1())Error.stackTraceLimit=D;let E=De($,L,I);return Object.defineProperties(I,{message:{value:E,enumerable:!1,writable:!0,configurable:!0},toString:{value(){return`${this.name} [${$}]: ${this.message}`},enumerable:!1,writable:!0,configurable:!0}}),Le(I),I.code=$,I}}function b1(){try{if(tr.startupSnapshot.isBuildingSnapshot())return!1}catch{}let H=Object.getOwnPropertyDescriptor(Error,"stackTraceLimit");if(H===void 0)return Object.isExtensible(Error);return sr.call(H,"writable")&&H.writable!==void 0?H.writable:H.set!==void 0}function Ae(H){let $=He+H.name;return Object.defineProperty(H,"name",{value:$}),H}function De(H,$,A){let L=_N.get(H);if(o0.ok(L!==void 0,"expected `message` to be found"),typeof L==="function")return o0.ok(L.length<=$.length,`Code: ${H}; The provided arguments length (${$.length}) does not match the required ones (${L.length}).`),Reflect.apply(L,A,$);let D=/%[dfijoOs]/g,I=0;while(D.exec(L)!==null)I++;if(o0.ok(I===$.length,`Code: ${H}; The provided arguments length (${$.length}) does not match the required ones (${I}).`),$.length===0)return L;return $.unshift(L),Reflect.apply(or,null,$)}function Ie(H){if(H===null||H===void 0)return String(H);if(typeof H==="function"&&H.name)return`function ${H.name}`;if(typeof H==="object"){if(H.constructor&&H.constructor.name)return`an instance of ${H.constructor.name}`;return`${v1(H,{depth:-1})}`}let $=v1(H,{colors:!1});if($.length>28)$=`${$.slice(0,25)}...`;return`type ${typeof H} (${$})`}var sr,rr,er,cH,_N,He="__node_internal_",TN,Le;var V8=y(()=>{sr={}.hasOwnProperty,rr=/^([A-Z][a-z\d]*)+$/,er=new Set(["string","function","number","object","Function","Object","boolean","bigint","symbol"]),cH={};_N=new Map;cH.ERR_INVALID_ARG_TYPE=i$("ERR_INVALID_ARG_TYPE",(H,$,A)=>{if(o0.ok(typeof H==="string","'name' must be a string"),!Array.isArray($))$=[$];let L="The ";if(H.endsWith(" argument"))L+=`${H} `;else{let K=H.includes(".")?"property":"argument";L+=`"${H}" ${K} `}L+="must be ";let D=[],I=[],E=[];for(let K of $)if(o0.ok(typeof K==="string","All expected entries have to be of type string"),er.has(K))D.push(K.toLowerCase());else if(rr.exec(K)===null)o0.ok(K!=="object",'The value "object" should be written as "Object"'),E.push(K);else I.push(K);if(I.length>0){let K=D.indexOf("object");if(K!==-1)D.slice(K,1),I.push("Object")}if(D.length>0){if(L+=`${D.length>1?"one of type":"of type"} ${f1(D,"or")}`,I.length>0||E.length>0)L+=" or "}if(I.length>0){if(L+=`an instance of ${f1(I,"or")}`,E.length>0)L+=" or "}if(E.length>0)if(E.length>1)L+=`one of ${f1(E,"or")}`;else{if(E[0].toLowerCase()!==E[0])L+="an ";L+=`${E[0]}`}return L+=`. Received ${Ie(A)}`,L},TypeError);cH.ERR_INVALID_MODULE_SPECIFIER=i$("ERR_INVALID_MODULE_SPECIFIER",(H,$,A=void 0)=>{return`Invalid module "${H}" ${$}${A?` imported from ${A}`:""}`},TypeError);cH.ERR_INVALID_PACKAGE_CONFIG=i$("ERR_INVALID_PACKAGE_CONFIG",(H,$,A)=>{return`Invalid package config ${H}${$?` while importing ${$}`:""}${A?`. ${A}`:""}`},Error);cH.ERR_INVALID_PACKAGE_TARGET=i$("ERR_INVALID_PACKAGE_TARGET",(H,$,A,L=!1,D=void 0)=>{let I=typeof A==="string"&&!L&&A.length>0&&!A.startsWith("./");if($===".")return o0.ok(L===!1),`Invalid "exports" main target ${JSON.stringify(A)} defined in the package config ${H}package.json${D?` imported from ${D}`:""}${I?'; targets must start with "./"':""}`;return`Invalid "${L?"imports":"exports"}" target ${JSON.stringify(A)} defined for '${$}' in the package config ${H}package.json${D?` imported from ${D}`:""}${I?'; targets must start with "./"':""}`},Error);cH.ERR_MODULE_NOT_FOUND=i$("ERR_MODULE_NOT_FOUND",(H,$,A=!1)=>{return`Cannot find ${A?"module":"package"} '${H}' imported from ${$}`},Error);cH.ERR_NETWORK_IMPORT_DISALLOWED=i$("ERR_NETWORK_IMPORT_DISALLOWED","import of '%s' by %s is not supported: %s",Error);cH.ERR_PACKAGE_IMPORT_NOT_DEFINED=i$("ERR_PACKAGE_IMPORT_NOT_DEFINED",(H,$,A)=>{return`Package import specifier "${H}" is not defined${$?` in package ${$}package.json`:""} imported from ${A}`},TypeError);cH.ERR_PACKAGE_PATH_NOT_EXPORTED=i$("ERR_PACKAGE_PATH_NOT_EXPORTED",(H,$,A=void 0)=>{if($===".")return`No "exports" main defined in ${H}package.json${A?` imported from ${A}`:""}`;return`Package subpath '${$}' is not defined by "exports" in ${H}package.json${A?` imported from ${A}`:""}`},Error);cH.ERR_UNSUPPORTED_DIR_IMPORT=i$("ERR_UNSUPPORTED_DIR_IMPORT","Directory import '%s' is not supported resolving ES modules imported from %s",Error);cH.ERR_UNSUPPORTED_RESOLVE_REQUEST=i$("ERR_UNSUPPORTED_RESOLVE_REQUEST",'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.',TypeError);cH.ERR_UNKNOWN_FILE_EXTENSION=i$("ERR_UNKNOWN_FILE_EXTENSION",(H,$)=>{return`Unknown file extension "${H}" for ${$}`},TypeError);cH.ERR_INVALID_ARG_VALUE=i$("ERR_INVALID_ARG_VALUE",(H,$,A="is invalid")=>{let L=v1($);if(L.length>128)L=`${L.slice(0,128)}...`;return`The ${H.includes(".")?"property":"argument"} '${H}' ${A}. Received ${L}`},TypeError);Le=Ae(function(H){let $=b1();if($)TN=Error.stackTraceLimit,Error.stackTraceLimit=Number.POSITIVE_INFINITY;if(Error.captureStackTrace(H),$)Error.stackTraceLimit=TN;return H})});import Ee from"node:fs";import Ke from"node:path";import{fileURLToPath as h1}from"node:url";function u1(H,{base:$,specifier:A}){let L=NN.get(H);if(L)return L;let D;try{D=Ee.readFileSync(Ke.toNamespacedPath(H),"utf8")}catch(E){let K=E;if(K.code!=="ENOENT")throw K}let I={exists:!1,pjsonPath:H,main:void 0,name:void 0,type:"none",exports:void 0,imports:void 0};if(D!==void 0){let E;try{E=JSON.parse(D)}catch(K){let M=K,W=new Me(H,($?`"${A}" from `:"")+h1($||A),M.message);throw W.cause=M,W}if(I.exists=!0,C8.call(E,"name")&&typeof E.name==="string")I.name=E.name;if(C8.call(E,"main")&&typeof E.main==="string")I.main=E.main;if(C8.call(E,"exports"))I.exports=E.exports;if(C8.call(E,"imports"))I.imports=E.imports;if(C8.call(E,"type")&&(E.type==="commonjs"||E.type==="module"))I.type=E.type}return NN.set(H,I),I}function kM(H){let $=new URL("package.json",H);while(!0){if($.pathname.endsWith("node_modules/package.json"))break;let D=u1(h1($),{specifier:H});if(D.exists)return D;let I=$;if($=new URL("../package.json",$),$.pathname===I.pathname)break}return{pjsonPath:h1($),exists:!1,type:"none"}}function g1(H){return kM(H).type}var C8,Me,NN;var m1=y(()=>{V8();C8={}.hasOwnProperty,{ERR_INVALID_PACKAGE_CONFIG:Me}=cH,NN=new Map});import{fileURLToPath as Xe}from"node:url";function Je(H){if(H&&/\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?/i.test(H))return"module";if(H==="application/json")return"json";return null}function Ze(H){let{1:$}=/^([^/]+\/[^;,]+)[^,]*?(;base64)?,/.exec(H.pathname)||[null,null,null];return Je($)}function Ye(H){let $=H.pathname,A=$.length;while(A--){let L=$.codePointAt(A);if(L===47)return"";if(L===46)return $.codePointAt(A-1)===47?"":$.slice(A)}return""}function Ge(H,$,A){let L=Ye(H);if(L===".js"){let E=g1(H);if(E!=="none")return E;return"commonjs"}if(L===""){let E=g1(H);if(E==="none"||E==="commonjs")return"commonjs";return"module"}let D=Be[L];if(D)return D;if(A)return;let I=Xe(H);throw new We(L,I)}function ON(){}function d1(H,$){let A=H.protocol;if(!Qe.call(FN,A))return null;return FN[A](H,$,!0)||null}var We,Qe,Be,FN;var wN=y(()=>{m1();V8();({ERR_UNKNOWN_FILE_EXTENSION:We}=cH),Qe={}.hasOwnProperty,Be={__proto__:null,".cjs":"commonjs",".js":"module",".json":"json",".mjs":"module"};FN={__proto__:null,"data:":Ze,"file:":Ge,"http:":ON,"https:":ON,"node:"(){return"builtin"}}});function Ce(){return RN}function ze(){return Ve}function p1(H){if(H!==void 0&&H!==Ce()){if(!Array.isArray(H))throw new Ue("conditions",H,"expected an array");return new Set(H)}return ze()}var Ue,RN,Ve;var jN=y(()=>{V8();({ERR_INVALID_ARG_VALUE:Ue}=cH),RN=Object.freeze(["node","import"]),Ve=new Set(RN)});import hN from"node:assert";import{statSync as uN,realpathSync as Pe}from"node:fs";import s0 from"node:process";import{fileURLToPath as xH,pathToFileURL as n1}from"node:url";import gN from"node:path";import{builtinModules as a1}from"node:module";function fN(H,$,A,L,D,I,E){if(s0.noDeprecation)return;let K=xH(L),M=we.exec(E?H:$)!==null;s0.emitWarning(`Use of deprecated ${M?"double slash":"leading or trailing slash matching"} resolving "${H}" for module request "${$}" ${$===A?"":`matched to "${A}" `}in the "${D?"imports":"exports"}" field module resolution of the package at ${K}${I?` imported from ${xH(I)}`:""}.`,"DeprecationWarning","DEP0166")}function vN(H,$,A,L){if(s0.noDeprecation)return;if(d1(H,{parentURL:A.href})!=="module")return;let I=xH(H.href),E=xH(new URL(".",$)),K=xH(A);if(!L)s0.emitWarning(`No "main" or "exports" field defined in the package.json for ${E} resolving the main entry point "${I.slice(E.length)}", imported from ${K}.
|
|
322
|
+
Default "index" lookups for the main are deprecated for ES modules.`,"DeprecationWarning","DEP0151");else if(gN.resolve(E,L)!==I)s0.emitWarning(`Package ${E} has a "main" field set to "${L}", excluding the full filename and extension to the resolved file at "${I.slice(E.length)}", imported from ${K}.
|
|
323
|
+
Automatic extension resolution of the "main" field is deprecated for ES modules.`,"DeprecationWarning","DEP0151")}function pN(H){try{return uN(H)}catch{}}function l1(H){let $=uN(H,{throwIfNoEntry:!1}),A=$?$.isFile():void 0;return A===null||A===void 0?!1:A}function Re(H,$,A){let L;if($.main!==void 0){if(L=new URL($.main,H),l1(L))return L;let E=[`./${$.main}.js`,`./${$.main}.json`,`./${$.main}.node`,`./${$.main}/index.js`,`./${$.main}/index.json`,`./${$.main}/index.node`],K=-1;while(++K<E.length){if(L=new URL(E[K],H),l1(L))break;L=void 0}if(L)return vN(L,H,A,$.main),L}let D=["./index.js","./index.json","./index.node"],I=-1;while(++I<D.length){if(L=new URL(D[I],H),l1(L))break;L=void 0}if(L)return vN(L,H,A,$.main),L;throw new t1(xH(new URL(".",H)),xH(A))}function je(H,$,A){if(Oe.exec(H.pathname)!==null)throw new vM(H.pathname,'must not include encoded "/" or "\\" characters',xH($));let L;try{L=xH(H)}catch(I){let E=I;throw Object.defineProperty(E,"input",{value:String(H)}),Object.defineProperty(E,"module",{value:String($)}),E}let D=pN(L.endsWith("/")?L.slice(-1):L);if(D&&D.isDirectory()){let I=new Ne(L,xH($));throw I.url=String(H),I}if(!D||!D.isFile()){let I=new t1(L||H.pathname,$&&xH($),!0);throw I.url=String(H),I}if(!A){let I=Pe(L),{search:E,hash:K}=H;H=n1(I+(L.endsWith(gN.sep)?"/":"")),H.search=E,H.hash=K}return H}function Se(H,$,A){return new Te(H,$&&xH(new URL(".",$)),xH(A))}function i1(H,$,A){return new _e(xH(new URL(".",$)),H,A&&xH(A))}function xe(H,$,A,L,D){let I=`request is not a valid match in pattern "${$}" for the "${L?"imports":"exports"}" resolution of ${xH(A)}`;throw new vM(H,I,D&&xH(D))}function z8(H,$,A,L,D){return $=typeof $==="object"&&$!==null?JSON.stringify($,null,""):`${$}`,new qe(xH(new URL(".",A)),H,$,L,D&&xH(D))}function ke(H,$,A,L,D,I,E,K,M){if($!==""&&!I&&H[H.length-1]!=="/")throw z8(A,H,L,E,D);if(!H.startsWith("./")){if(E&&!H.startsWith("../")&&!H.startsWith("/")){let Z=!1;try{new URL(H),Z=!0}catch{}if(!Z){let Q=I?yM.call(fM,H,()=>$):H+$;return lN(Q,L,M)}}throw z8(A,H,L,E,D)}if(xN.exec(H.slice(2))!==null)if(kN.exec(H.slice(2))===null){if(!K){let Z=I?A.replace("*",()=>$):A+$,Q=I?yM.call(fM,H,()=>$):H;fN(Q,Z,A,L,E,D,!0)}}else throw z8(A,H,L,E,D);let W=new URL(H,L),X=W.pathname,J=new URL(".",L).pathname;if(!X.startsWith(J))throw z8(A,H,L,E,D);if($==="")return W;if(xN.exec($)!==null){let Z=I?A.replace("*",()=>$):A+$;if(kN.exec($)===null){if(!K){let Q=I?yM.call(fM,H,()=>$):H;fN(Q,Z,A,L,E,D,!1)}}else xe(Z,A,L,E,D)}if(I)return new URL(yM.call(fM,W.href,()=>$));return new URL($,W)}function ye(H){let $=Number(H);if(`${$}`!==H)return!1;return $>=0&&$<4294967295}function b3(H,$,A,L,D,I,E,K,M){if(typeof $==="string")return ke($,A,L,H,D,I,E,K,M);if(Array.isArray($)){let W=$;if(W.length===0)return null;let X,J=-1;while(++J<W.length){let Z=W[J],Q;try{Q=b3(H,Z,A,L,D,I,E,K,M)}catch(B){let Y=B;if(X=Y,Y.code==="ERR_INVALID_PACKAGE_TARGET")continue;throw B}if(Q===void 0)continue;if(Q===null){X=null;continue}return Q}if(X===void 0||X===null)return null;throw X}if(typeof $==="object"&&$!==null){let W=Object.getOwnPropertyNames($),X=-1;while(++X<W.length){let J=W[X];if(ye(J))throw new mN(xH(H),D,'"exports" cannot contain numeric property keys.')}X=-1;while(++X<W.length){let J=W[X];if(J==="default"||M&&M.has(J)){let Z=$[J],Q=b3(H,Z,A,L,D,I,E,K,M);if(Q===void 0)continue;return Q}}return null}if($===null)return null;throw z8(L,$,H,E,D)}function fe(H,$,A){if(typeof H==="string"||Array.isArray(H))return!0;if(typeof H!=="object"||H===null)return!1;let L=Object.getOwnPropertyNames(H),D=!1,I=0,E=-1;while(++E<L.length){let K=L[E],M=K===""||K[0]!==".";if(I++===0)D=M;else if(D!==M)throw new mN(xH($),A,`"exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.`)}return D}function ve(H,$,A){if(s0.noDeprecation)return;let L=xH($);if(yN.has(L+"|"+H))return;yN.add(L+"|"+H),s0.emitWarning(`Use of deprecated trailing slash pattern mapping "${H}" in the "exports" field module resolution of the package at ${L}${A?` imported from ${xH(A)}`:""}. Mapping specifiers ending in "/" is no longer supported.`,"DeprecationWarning","DEP0155")}function bN(H,$,A,L,D){let I=A.exports;if(fe(I,H,L))I={".":I};if(dN.call(I,$)&&!$.includes("*")&&!$.endsWith("/")){let X=I[$],J=b3(H,X,"",$,L,!1,!1,!1,D);if(J===null||J===void 0)throw i1($,H,L);return J}let E="",K="",M=Object.getOwnPropertyNames(I),W=-1;while(++W<M.length){let X=M[W],J=X.indexOf("*");if(J!==-1&&$.startsWith(X.slice(0,J))){if($.endsWith("/"))ve($,H,L);let Z=X.slice(J+1);if($.length>=X.length&&$.endsWith(Z)&&cN(E,X)===1&&X.lastIndexOf("*")===J)E=X,K=$.slice(J,$.length-Z.length)}}if(E){let X=I[E],J=b3(H,X,K,E,L,!0,!1,$.endsWith("/"),D);if(J===null||J===void 0)throw i1($,H,L);return J}throw i1($,H,L)}function cN(H,$){let A=H.indexOf("*"),L=$.indexOf("*"),D=A===-1?H.length:A+1,I=L===-1?$.length:L+1;if(D>I)return-1;if(I>D)return 1;if(A===-1)return 1;if(L===-1)return-1;if(H.length>$.length)return-1;if($.length>H.length)return 1;return 0}function be(H,$,A){if(H==="#"||H.startsWith("#/")||H.endsWith("/"))throw new vM(H,"is not a valid internal imports specifier name",xH($));let L,D=kM($);if(D.exists){L=n1(D.pjsonPath);let I=D.imports;if(I)if(dN.call(I,H)&&!H.includes("*")){let E=b3(L,I[H],"",H,$,!1,!0,!1,A);if(E!==null&&E!==void 0)return E}else{let E="",K="",M=Object.getOwnPropertyNames(I),W=-1;while(++W<M.length){let X=M[W],J=X.indexOf("*");if(J!==-1&&H.startsWith(X.slice(0,-1))){let Z=X.slice(J+1);if(H.length>=X.length&&H.endsWith(Z)&&cN(E,X)===1&&X.lastIndexOf("*")===J)E=X,K=H.slice(J,H.length-Z.length)}}if(E){let X=I[E],J=b3(L,X,K,E,$,!0,!0,!1,A);if(J!==null&&J!==void 0)return J}}}throw Se(H,L,$)}function he(H,$){let A=H.indexOf("/"),L=!0,D=!1;if(H[0]==="@")if(D=!0,A===-1||H.length===0)L=!1;else A=H.indexOf("/",A+1);let I=A===-1?H:H.slice(0,A);if(Fe.exec(I)!==null)L=!1;if(!L)throw new vM(H,"is not a valid package name",xH($));let E="."+(A===-1?"":H.slice(A));return{packageName:I,packageSubpath:E,isScoped:D}}function lN(H,$,A){if(a1.includes(H))return new URL("node:"+H);let{packageName:L,packageSubpath:D,isScoped:I}=he(H,$),E=kM($);if(E.exists){let X=n1(E.pjsonPath);if(E.name===L&&E.exports!==void 0&&E.exports!==null)return bN(X,D,E,$,A)}let K=new URL("./node_modules/"+L+"/package.json",$),M=xH(K),W;do{let X=pN(M.slice(0,-13));if(!X||!X.isDirectory()){W=M,K=new URL((I?"../../../../node_modules/":"../../../node_modules/")+L+"/package.json",K),M=xH(K);continue}let J=u1(M,{base:$,specifier:H});if(J.exports!==void 0&&J.exports!==null)return bN(K,D,J,$,A);if(D===".")return Re(K,J,$);return new URL(D,K)}while(M.length!==W.length);throw new t1(L,xH($),!1)}function ue(H){if(H[0]==="."){if(H.length===1||H[1]==="/")return!0;if(H[1]==="."&&(H.length===2||H[2]==="/"))return!0}return!1}function o1(H){if(H==="")return!1;if(H[0]==="/")return!0;return ue(H)}function ge(H,$,A,L){if(A===void 0)A=p1();let D=$.protocol,E=D==="data:"||D==="http:"||D==="https:",K;if(o1(H))try{K=new URL(H,$)}catch(M){let W=new SN(H,$);throw W.cause=M,W}else if(D==="file:"&&H[0]==="#")K=be(H,$,A);else try{K=new URL(H)}catch(M){if(E&&!a1.includes(H)){let W=new SN(H,$);throw W.cause=M,W}K=lN(H,$,A)}if(hN.ok(K!==void 0,"expected to be defined"),K.protocol!=="file:")return K;return je(K,$,L)}function me(H,$,A){if(A){let L=A.protocol;if(L==="http:"||L==="https:"){if(o1(H)){let D=$?.protocol;if(D&&D!=="https:"&&D!=="http:")throw new c1(H,A,"remote imports cannot import from a local location.");return{url:$?.href||""}}if(a1.includes(H))throw new c1(H,A,"remote imports cannot import from a local location.");throw new c1(H,A,"only relative and absolute specifiers are supported.")}}}function de(H){return Boolean(H&&typeof H==="object"&&"href"in H&&typeof H.href==="string"&&"protocol"in H&&typeof H.protocol==="string"&&H.href&&H.protocol)}function pe(H){if(H===void 0)return;if(typeof H!=="string"&&!de(H))throw new cH.ERR_INVALID_ARG_TYPE("parentURL",["string","URL"],H)}function iN(H,$={}){let{parentURL:A}=$;hN.ok(A!==void 0,"expected `parentURL` to be defined"),pe(A);let L;if(A)try{L=new URL(A)}catch{}let D,I;try{if(D=o1(H)?new URL(H,L):new URL(H),I=D.protocol,I==="data:")return{url:D.href,format:null}}catch{}let E=me(H,D,L);if(E)return E;if(I===void 0&&D)I=D.protocol;if(I==="node:")return{url:H};if(D&&D.protocol==="node:")return{url:H};let K=p1($.conditions),M=ge(H,new URL(A),K,!1);return{url:M.href,format:d1(M,{parentURL:A})}}var yM,c1,vM,mN,qe,t1,Te,_e,Ne,SN,dN,xN,kN,Fe,fM,Oe,yN,we;var nN=y(()=>{wN();V8();m1();jN();yM=RegExp.prototype[Symbol.replace],{ERR_NETWORK_IMPORT_DISALLOWED:c1,ERR_INVALID_MODULE_SPECIFIER:vM,ERR_INVALID_PACKAGE_CONFIG:mN,ERR_INVALID_PACKAGE_TARGET:qe,ERR_MODULE_NOT_FOUND:t1,ERR_PACKAGE_IMPORT_NOT_DEFINED:Te,ERR_PACKAGE_PATH_NOT_EXPORTED:_e,ERR_UNSUPPORTED_DIR_IMPORT:Ne,ERR_UNSUPPORTED_RESOLVE_REQUEST:SN}=cH,dN={}.hasOwnProperty,xN=/(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i,kN=/(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i,Fe=/^\.|%|\\/,fM=/\*/g,Oe=/%2f|%5c/i,yN=new Set,we=/[/\\]{2}/});function aN(H,$){if(!$)throw Error("Please pass `parent`: `import-meta-resolve` cannot ponyfill that");try{return iN(H,{parentURL:$}).url}catch(A){let L=A;if((L.code==="ERR_UNSUPPORTED_DIR_IMPORT"||L.code==="ERR_MODULE_NOT_FOUND")&&typeof L.url==="string")return L.url;throw A}}var tN=y(()=>{nN()});import{statSync as ce}from"node:fs";import{resolve as le}from"node:path";function s1(H,$){let A=ne(H),L=void 0;for(let D of $)try{let I=typeof D==="string"?D.startsWith("file://")?new URL(D):ae(D):D,E=new URL(aN(A.toString(),I.toString()));try{if(ce(E).isFile())return E}catch{let K=Error(`Cannot find module ${H}`);K.code="ERR_MODULE_NOT_FOUND",L=K}}catch(I){L=I}throw L}function ne(H){return typeof H==="string"&&ie.test(H)?PH(H):H}function ae(H){let $=le(H);return J$($)}var ie;var oN=y(()=>{qA();tN();ie=/^[a-z]:\\/i});var sN=y(()=>{oN()});var e1=n((ivH,r1)=>{var rN=ZH("path"),eN=ZH("module"),te=ZH("fs"),HF=(H,$,A)=>{if(typeof H!=="string")throw TypeError(`Expected \`fromDir\` to be of type \`string\`, got \`${typeof H}\``);if(typeof $!=="string")throw TypeError(`Expected \`moduleId\` to be of type \`string\`, got \`${typeof $}\``);try{H=te.realpathSync(H)}catch(I){if(I.code==="ENOENT")H=rN.resolve(H);else if(A)return;else throw I}let L=rN.join(H,"noop.js"),D=()=>eN._resolveFilename($,{id:L,filename:L,paths:eN._nodeModulePaths(H)});if(A)try{return D()}catch(I){return}return D()};r1.exports=(H,$)=>HF(H,$);r1.exports.silent=(H,$)=>HF(H,$,!0)});var HJ,$J,AJ;var $F=y(()=>{HJ=class HJ extends Error{request;constructor(H){super(`Unhandled Request: ${H.type}`);this.request=H}};$J=class $J extends Error{request;depth;constructor(H,$){super(`Service Request Depth ${$} Exceeded: ${H.type}`);this.request=H,this.depth=$}};AJ=class AJ extends Error{handlerName;handlerDescription;cause;constructor(H,$,A){super(`Unhandled Error in Handler: ${H}`);this.handlerName=H,this.handlerDescription=$,this.cause=A}}});class AF{type;params;__r;constructor(H,$){this.type=H,this.params=$}}function P$(H,$){return{value:H}}function r0(H,$){return{error:$}}function TA(H){return"value"in H&&H.error===void 0}var bM;var hM=y(()=>{bM=class bM extends AF{constructor(H,$){super(H,$)}}});class uM{handlers=[];constructor(H=[]){H.forEach(($)=>this.addHandler($))}addHandler(H,$="anonymous",A){let L=typeof H==="function"?{fn:H,name:$,description:A}:H,{fn:D,name:I,description:E}=L;return this.handlers.push({fn:D,name:I,description:E}),this}dispatch(H){let $=0,A={dispatch:D},L=this.reduceHandlers(this.handlers,H,A,this.defaultHandler);function D(I){if(++$,$>=oe)return r0(I,new $J(I,$));let E=L(I);return--$,E}return D(H)}defaultHandler(H){return r0(H,new HJ(H))}reduceHandlers(H,$,A,L){return H.map((E)=>({...E,fn:E.fn(A)})).reduce((E,K)=>{let M=K.fn(E);return(W)=>{try{return M(W)}catch(X){return r0($,new AJ(K.name,K.description,X))}}},L)}}var oe=10;var LF=y(()=>{$F();hM()});function DF(H,$,A,L){return re(H.is,$,A??H.type,L)}function se(H,$){return(A)=>(L)=>(D)=>H(D)?$(D,L,A):L(D)}function re(H,$,A,L){return{fn:se(H,$),name:A,description:L}}function IL(H){class $ extends bM{static type=H;constructor(A){super(H,A)}static is(A){return A instanceof $&&A.type===H}static create(A){return new $(A)}static createRequestHandler(A,L,D){return DF($,A,L,D)}static __request}return $}var IF=y(()=>{hM()});var EF=y(()=>{LF();hM();IF()});import{Buffer as EL}from"node:buffer";import{gunzipSync as ZF,gzip as ee}from"node:zlib";import{promises as pM,readFileSync as HHH,statSync as $HH}from"node:fs";import{fileURLToPath as u3}from"node:url";import{promisify as YF}from"node:util";import*as cM from"node:stream";function P8(H,$,A,L){let D=typeof H==="string"?PH(H):H;if(D instanceof URL)return new IJ(D,$,A,L);return IJ.from(D)}function KF(H){return IJ.isCFileReference(H)||!(H instanceof URL)&&typeof H!=="string"}function AHH(H,$,A){let L=typeof H==="string"?PH(H):H;if(L instanceof URL)return{url:L,encoding:$,signal:A};return{url:L.url,encoding:$??L.encoding,signal:A}}function EJ(H,$){if(!H)throw new DHH($??"Assertion failed")}function lM(H){return new Uint8Array(H.buffer,H.byteOffset,H.byteLength)}function e0(H){if(H instanceof EL)return H;let $=EL.from(H.buffer);if(H.byteOffset===0&&H.byteLength===H.buffer.byteLength)return $;return $.subarray(H.byteOffset,H.byteOffset+H.byteLength)}function IHH(H){return new Uint8Array(H.buffer.slice(H.byteOffset,H.byteOffset+H.byteLength))}function GF(H){return e0(H).swap16()}function EHH(H){return GF(IHH(H))}function XF(H){let $=lM(H),A=$[0]<<8|$[1];return VF.decode(A===UF?$.subarray(2):$)}function WF(H){let $=lM(H),A=$[0]<<8|$[1];return KHH.decode(A===XJ?$.subarray(2):$)}function CF(H,$){if(g3(H))return CF(JHH(H),$);let A=lM(H),L=A[0]<<8|A[1];if(L===XJ||A[0]===0&&A[1]!==0)return WF(A);if(L===UF||A[0]!==0&&A[1]===0)return XF(A);if(!$)return MF.decode(A);switch($){case"utf-16be":case"utf16be":return WF(A);case"utf-16le":case"utf16le":return XF(A);case"utf-8":case"utf8":return MF.decode(A)}throw new BHH($)}function XHH(H,$){switch($){case"base64":case"base64url":case"hex":return e0(H).toString($)}return CF(H,$)}function zF(H,$,A){switch($){case void 0:case"utf-8":case"utf8":return MHH.encode(H);case"utf-16be":case"utf16be":return WHH(H,A);case"utf-16le":case"utf16le":return PF(H,A)}return EL.from(H,$)}function PF(H,$=!0){let A=EL.from(H,"utf16le");if($){let L=EL.alloc(A.length+2);return L.writeUint16LE(XJ),A.copy(L,2),L}return A}function WHH(H,$=!0){return GF(PF(H,$))}function QHH(){try{return new TextDecoder("utf-16be")}catch{return{encoding:"utf-16be",fatal:!1,ignoreBOM:!1,decode:(H)=>VF.decode(EHH(H))}}}function g3(H){if(typeof H==="string")return!1;let $=lM(H);return $[0]===31&&$[1]===139}function JHH(H){if(!g3(H))return H;return ZF(e0(H))}function ZHH(H,$){return m3.from($?{...H,encoding:$}:H)}function WJ(H,$){if(H===$)return 0;if(H.eTag||$.eTag)return H.eTag===$.eTag?0:(H.eTag||"")<($.eTag||"")?-1:1;let A=H.size-$.size||H.mtimeMs-$.mtimeMs;return A<0?-1:A>0?1:0}function KJ(H){return H instanceof URL?H:H.url}function YHH(H){if(!H)return H;if(typeof H==="string")return{encoding:H};return H}function GHH(H){if(H instanceof Error)return H;if(typeof H==="object"&&H&&"message"in H&&typeof H.message==="string")return Error(H.message,{cause:H});return Error(H&&H.toString())}function UHH(H,$,A){if(typeof H==="string")return CHH(H,$,A);return`data:${$}${qF(A||[])};base64,${e0(H).toString("base64url")}`}function VHH(H,$,A){return new URL(UHH(H,$,A))}function CHH(H,$,A){$=$||"text/plain",A=A||[];let L=encodeURIComponent(H),D=EL.from(H).toString("base64url"),I=D.length<L.length-7,E=I?D:L,K=new Map([["charset","utf-8"],...A]);K.set("charset","utf-8");let M=qF(K);return`data:${$}${M}${I?";base64":""},${E}`}function qF(H){return[...H].map(([$,A])=>`;${$}=${encodeURIComponent(A)}`).join("")}function PHH(H){H=H.toString();let[$,A]=H.split(",",2);if(!$||A===void 0)throw Error("Not a data url");let L=$.match(zHH);if(!L||!L.groups)throw Error("Not a data url");let D=L.groups.mediaType||"",I=(L.groups.attributes||"").split(";").filter((M)=>!!M).map((M)=>M.split("=",2)).map(([M,W])=>[M,decodeURIComponent(W)]),E=new Map(I),K=E.get("charset");return{mediaType:D,data:L.groups.base64?EL.from(A,"base64url"):EL.from(decodeURIComponent(A)),encoding:K,attributes:E}}function qHH(H){if(H.endsWith(".trie"))return{mimeType:"application/vnd.cspell.dictionary+trie",encoding:"utf-8"};if(H.endsWith(".trie.gz"))return{mimeType:"application/vnd.cspell.dictionary+trie.gz"};if(H.endsWith(".txt"))return{mimeType:"text/plain",encoding:"utf-8"};if(H.endsWith(".txt.gz"))return{mimeType:"application/gzip"};if(H.endsWith(".gz"))return{mimeType:"application/gzip"};if(H.endsWith(".json"))return{mimeType:"application/json",encoding:"utf-8"};if(H.endsWith(".yaml")||H.endsWith(".yml"))return{mimeType:"application/x-yaml",encoding:"utf-8"}}function MJ(H){if(H instanceof Error&&"code"in H&&typeof H.code==="string")return!0;if(H&&typeof H==="object"&&"code"in H&&typeof H.code==="string")return!0;return!1}function THH(H){return H instanceof Error}function _HH(H){return THH(H)&&(!("cause"in H)||MJ(H.cause)||MJ(H))}function NHH(H){return _HH(H)?H.cause:void 0}function _F(H,$){return H instanceof dM?H:dM.fromError($,FHH(H))}function FHH(H){return H instanceof Error?H:Error("Unknown Error",{cause:H})}async function OHH(H){let $=RHH(H);try{let A=await TF($,{method:"HEAD"});if(!A.ok)throw dM.create($,A.status);return A.headers}catch(A){throw _F(A,$)}}async function wHH(H,$){try{let A=await TF($?new Request(H,{signal:$}):H);if(!A.ok)throw dM.create(H,A.status);return EL.from(await A.arrayBuffer())}catch(A){throw _F(A,H)}}function RHH(H){return typeof H==="string"?new URL(H):H}async function jHH(H){let $=await OHH(H),A=$.get("etag")||void 0,L=Number.parseInt($.get("content-length")||"0",10);return{size:A?-1:L,mtimeMs:0,eTag:A}}function QF(H){return uHH.test(typeof H==="string"?H:H.pathname)}function tHH(H){return{size:H.size,mtimeMs:H.mtimeMs,fileType:RF(H)}}function oHH(H){return H.then(tHH)}async function H$H(H,$){let A=g3($),{url:L,encoding:D,baseFilename:I}=H,E={url:L,encoding:D,baseFilename:I,gz:A};return await pM.writeFile(u3(H.url),wF(H,$)),E}async function L$H(H,$,A){let L=await gHH(wF($,A)),D=H.dispatch(q8.create({...$,content:L}));return EJ(TA(D)),D.value}function D$H(H){[mHH,dHH,eHH,$$H,A$H,lHH,nHH,iHH,pHH,cHH,sHH,aHH,rHH].forEach(($)=>H.addHandler($))}function wF(H,$){if(typeof $==="string"){if([void 0,"utf8","utf-8"].includes(H.encoding))return $;return e0(zF($,H.encoding))}return e0($)}function I$H(H){return($)=>K$H(H,$)}function E$H(H,$){return $.map(I$H(H))}function K$H(H,$){return{name:$.name,dir:H,fileType:RF($)}}function RF(H){let $=H.isFile()?gL.File:H.isDirectory()?gL.Directory:gL.Unknown;return H.isSymbolicLink()?$|gL.SymbolicLink:$}function h3(H,$){return H||new LHH($)}function X$H(){if(LJ)return LJ;let H=new M$H;return LJ=H,H}async function Q$H(H,$,A){let{type:L="file",stopAt:D,fs:I}=A,E=new URL(".",$),K=new URL("/",E),M=B$H(I,H,L),W=new Set((Array.isArray(D)?D:[D||K]).map((J)=>new URL(".",J).href)),X="";while(E.href!==X){let J=await M(E);if(J!==void 0)return J;if(X=E.href,E.href===K.href||W.has(E.href))break;E=new URL("..",E)}}function B$H(H,$,A){if(typeof $==="function")return $;let L=A==="file"||A==="!file"?"isFile":"isDirectory",D=A.startsWith("!")?!1:!0;function I(E,K){let M=new URL(K,E);return H.stat(M).then((W)=>(W.isUnknown()||W[L]()===D)&&M||void 0).catch(()=>{return})}if(!Array.isArray($))return(E)=>I(E,$);return async(E)=>{let K=$.map((M)=>I(E,M));for(let M of K){let W=await M;if(W)return W}}}function J$H(H){let $=Z$.Stat|Z$.ReadWrite|Z$.ReadDir,A=$&~Z$.Write&~Z$.ReadDir,L={"file:":$,"http:":A,"https:":A},D="CSpellIO",I=new Set(["file:","http:","https:"]),E={providerInfo:{name:"CSpellIO"},stat:(K)=>H.getStat(K),readFile:(K,M)=>H.readFile(K,M),readDirectory:(K)=>H.readDirectory(K),writeFile:(K)=>H.writeFile(K.url,K.content),dispose:()=>{return},capabilities:$,getCapabilities(K){return xF(L[K.protocol]||Z$.None)}};return{name:"CSpellIO",getFileSystem:(K,M)=>{return I.has(K.protocol)?E:void 0}}}function gM(H){if(H instanceof jF)return H;return H}function xF(H){return new Z$H(H)}function mM(H,$,A,L,D){if(!($&A))throw new SF(L,D)}function G$H(H){if(!H)return"";let $=H.href,A=$.split("/"),L=A.indexOf("node_modules");if(L>0){let D=A.slice(Math.max(A.length-3,L+1));return A.slice(0,L+1).join("/")+"/…/"+D.join("/")}return $}function U$H(H,$,A=" "){return H.padEnd($,A)}function V$H(H){return typeof H==="string"?{encoding:H}:H}function z$H(H){function $(A,L){let D=KJ(A),I=H(D);if(!I.hasProvider)throw new SF(L,D,A instanceof URL?void 0:{url:A.url.toString(),encoding:A.encoding});return I}return{providerInfo:{name:"default"},hasProvider:!0,stat:async(A)=>$(A,"stat").stat(A),readFile:async(A,L)=>$(A,"readFile").readFile(A,L),writeFile:async(A)=>$(A,"writeFile").writeFile(A),readDirectory:async(A)=>$(A,"readDirectory").readDirectory(A).then((L)=>L.map((D)=>new yF(D))),getCapabilities:(A)=>$(A,"getCapabilities").getCapabilities(A)}}function P$H(H){let $=H||X$H(),A=new C$H;return A.registerFileSystemProvider(J$H($)),A}function fF(){if(!DJ)DJ=P$H();return DJ}var IJ=class H{_;gz;constructor($,A,L,D){this.url=$,this.encoding=A,this.baseFilename=L,this.gz=D??(L?.endsWith(".gz")||void 0)??($.pathname.endsWith(".gz")||void 0)}static isCFileReference($){return $ instanceof H}static from($,A,L,D){if(H.isCFileReference($))return $;if($ instanceof URL)return new H($,A,L,D);return new H($.url,$.encoding,$.baseFilename,$.gz)}toJson(){return{url:this.url.href,encoding:this.encoding,baseFilename:this.baseFilename,gz:this.gz}}},LHH,DHH,XJ=65279,UF=65534,MF,VF,KHH,MHH,BHH,m3=class H{_text;baseFilename;_gz;constructor($,A,L,D,I){this.url=$,this.content=A,this.encoding=L,this.baseFilename=D??($.protocol!=="data:"&&$.pathname.split("/").pop()||void 0),this._gz=I}get gz(){if(this._gz!==void 0)return this._gz;if(this.url.pathname.endsWith(".gz"))return!0;if(typeof this.content==="string")return!1;return g3(this.content)}getText($){if(this._text!==void 0)return this._text;let A=typeof this.content==="string"?this.content:XHH(this.content,$??this.encoding);return this._text=A,A}getBytes(){let $=typeof this.content==="string"?zF(this.content,this.encoding):this.content;return $ instanceof Uint8Array?$:new Uint8Array($.buffer,$.byteOffset,$.byteLength)}toJson(){return{url:this.url.href,content:this.getText(),encoding:this.encoding,baseFilename:this.baseFilename,gz:this.gz}}static isCFileResource($){return $ instanceof H}static from($,A,L,D,I){if(H.isCFileResource($)){if(A){let{url:K,encoding:M,baseFilename:W,gz:X}=$;return new H(K,A,M,W,X)}return $}if($ instanceof URL)return EJ(A!==void 0),new H($,A,L,D,I);if(A!==void 0){let K=$;return new H(K.url,A,K.encoding,K.baseFilename,K.gz)}EJ("content"in $&&$.content!==void 0);let E=$;return new H(E.url,E.content,E.encoding,E.baseFilename,E.gz)}},gL,zHH,TF,dM,SHH="fs:readFile",iM,xHH="fs:readFileSync",nM,kHH="fs:stat",QJ,yHH="fs:statSync",NF,fHH="fs:writeFile",q8,vHH="zlib:inflate",bHH,hHH="fs:readDir",FF,uHH,gHH,mHH,dHH,pHH,cHH,OF,lHH,iHH,nHH,aHH,sHH,rHH,eHH,$$H,A$H,LJ=void 0,M$H=class{constructor(H=new uM){this.serviceBus=H,D$H(H)}readFile(H,$){let A=YHH($),L=AHH(H,A?.encoding,A?.signal),D=this.serviceBus.dispatch(iM.create(L));if(!TA(D))throw h3(D.error,"readFile");return D.value}readDirectory(H){let $=P8(H),A=this.serviceBus.dispatch(FF.create($));if(!TA(A))throw h3(A.error,"readDirectory");return A.value}readFileSync(H,$){let A=P8(H,$),L=this.serviceBus.dispatch(nM.create(A));if(!TA(L))throw h3(L.error,"readFileSync");return L.value}writeFile(H,$){let A=P8(H),L=m3.from(A,$),D=this.serviceBus.dispatch(q8.create(L));if(!TA(D))throw h3(D.error,"writeFile");return D.value}getStat(H){let $=P8(H),A=this.serviceBus.dispatch(QJ.create($));if(!TA(A))throw h3(A.error,"getStat");return A.value}getStatSync(H){let $=P8(H),A=this.serviceBus.dispatch(NF.create($));if(!TA(A))throw h3(A.error,"getStatSync");return A.value}compareStats(H,$){return WJ(H,$)}toURL(H,$){if(KF(H))return H.url;return DA(H,$)}toFileURL(H,$){if(KF(H))return H.url;return PH(H,$)}urlBasename(H){return LL(this.toURL(H))}urlDirname(H){return y1(this.toURL(H))}},W$H=!1,BF=class{#H;readFile;writeFile;stat;readDirectory;getCapabilities;constructor(H){this.#H=H,this.readFile=this.#H.readFile.bind(this.#H),this.writeFile=this.#H.writeFile.bind(this.#H),this.stat=this.#H.stat.bind(this.#H),this.readDirectory=this.#H.readDirectory.bind(this.#H),this.getCapabilities=this.#H.getCapabilities.bind(this.#H)}get providerInfo(){return this.#H.providerInfo}get hasProvider(){return this.#H.hasProvider}findUp(H,$,A={}){return Q$H(H,$,{...A,fs:this.#H})}},Z$,jF,SF,Z$H=class{constructor(H){this.flags=H}get readFile(){return!!(this.flags&Z$.Read)}get writeFile(){return!!(this.flags&Z$.Write)}get readDirectory(){return!!(this.flags&Z$.ReadDir)}get writeDirectory(){return!!(this.flags&Z$.WriteDir)}get stat(){return!!(this.flags&Z$.Stat)}},JF=class H{hasProvider;capabilities;providerInfo;_capabilities;constructor($,A){this.fs=$,this.eventLogger=A,this.hasProvider=!!$,this.capabilities=$?.capabilities||Z$.None,this._capabilities=xF(this.capabilities),this.providerInfo=$?.providerInfo||{name:"unknown"}}logEvent($,A,L,D,I){this.eventLogger({method:$,event:A,url:D,traceID:L,ts:performance.now(),message:I})}getCapabilities($){if(this.fs?.getCapabilities)return this.fs.getCapabilities($);return this._capabilities}async stat($){let A=performance.now(),L=KJ($);this.logEvent("stat","start",A,L);try{return mM(this.fs,this.capabilities,Z$.Stat,"stat",L),new Y$H(await this.fs.stat($))}catch(D){throw this.logEvent("stat","error",A,L,D instanceof Error?D.message:""),gM(D)}finally{this.logEvent("stat","end",A,L)}}async readFile($,A){let L=performance.now(),D=KJ($);this.logEvent("readFile","start",L,D);try{mM(this.fs,this.capabilities,Z$.Read,"readFile",D);let I=V$H(A);return ZHH(await this.fs.readFile($,I),I?.encoding)}catch(I){throw this.logEvent("readFile","error",L,D,I instanceof Error?I.message:""),gM(I)}finally{this.logEvent("readFile","end",L,D)}}async readDirectory($){let A=performance.now();this.logEvent("readDir","start",A,$);try{return mM(this.fs,this.capabilities,Z$.ReadDir,"readDirectory",$),(await this.fs.readDirectory($)).map((L)=>new yF(L))}catch(L){throw this.logEvent("readDir","error",A,$,L instanceof Error?L.message:""),gM(L)}finally{this.logEvent("readDir","end",A,$)}}async writeFile($){let A=performance.now(),L=$.url;this.logEvent("writeFile","start",A,L);try{return mM(this.fs,this.capabilities,Z$.Write,"writeFile",$.url),await this.fs.writeFile($)}catch(D){throw this.logEvent("writeFile","error",A,L,D instanceof Error?D.message:""),gM(D)}finally{this.logEvent("writeFile","end",A,L)}}static disposeOf($){$ instanceof H&&$.fs?.dispose()}},kF=class{constructor(H){this.fileType=H}isFile(){return this.fileType===gL.File}isDirectory(){return this.fileType===gL.Directory}isUnknown(){return!this.fileType}isSymbolicLink(){return!!(this.fileType&gL.SymbolicLink)}},Y$H,yF,C$H=class{providers=new Set;cachedFs=new Map;revCacheFs=new Map;fsc;fs;loggingEnabled=W$H;constructor(){this.fsc=z$H((H)=>this._getFS(H)),this.fs=new BF(this.fsc)}enableLogging(H){this.loggingEnabled=H??!0}log=console.log;logEvent=(H)=>{if(this.loggingEnabled){let $=H.traceID.toFixed(13).replaceAll(/\d{4}(?=\d)/g,"$&."),A=H.message?`
|
|
324
|
+
${H.message}`:"",L=U$H(`${H.method}-${H.event}`,16);this.log(`${L} ID:${$} ts:${H.ts.toFixed(13)} ${G$H(H.url)}${A}`)}};registerFileSystemProvider(...H){return H.forEach(($)=>this.providers.add($)),this.reset(),{dispose:()=>{for(let $ of H){for(let A of this.revCacheFs.get($)||[])this.cachedFs.delete(A);this.providers.delete($)}this.reset()}}}getFS(H){return new BF(this._getFS(H))}_getFS(H){let $=`${H.protocol}${H.hostname}`,A=this.cachedFs.get($);if(A)return A;let L=(E,K)=>{return(M)=>{let W=!1,X=E.getFileSystem(M,(J)=>{return W=W||M===J,K(J)});if(X){let J=this.revCacheFs.get(E)||new Set;return J.add($),this.revCacheFs.set(E,J),X}if(!W)return K(M)}},D=(E)=>{return};for(let E of this.providers)D=L(E,D);let I=new JF(D(H),this.logEvent);return this.cachedFs.set($,I),I}reset(){this.disposeOfCachedFs()}disposeOfCachedFs(){for(let[H,$]of[...this.cachedFs].reverse()){try{JF.disposeOf($)}catch{}this.cachedFs.delete(H)}this.cachedFs.clear(),this.revCacheFs.clear()}dispose(){this.disposeOfCachedFs();let H=[...this.providers].reverse();for(let $ of H)try{$.dispose?.()}catch{}}},DJ=void 0,YbH;var HD=y(()=>{qA();EF();LHH=class extends Error{constructor(H,$){super(`Method ${H} is not supported.`,$);this.method=H}},DHH=class extends Error{constructor(H,$){super(H,$);this.message=H}};MF=new TextDecoder("utf8"),VF=new TextDecoder("utf-16le"),KHH=QHH(),MHH=new TextEncoder;BHH=class extends Error{constructor(H){super(`Unsupported encoding: ${H}`)}};gL=function(H){return H[H.Unknown=0]="Unknown",H[H.File=1]="File",H[H.Directory=2]="Directory",H[H.SymbolicLink=64]="SymbolicLink",H}({});zHH=/^data:(?<mediaType>[^;,]*)(?<attributes>(?:;[^=]+=[^;,]*)*)(?<base64>;base64)?$/;TF=globalThis.fetch,dM=class H extends Error{constructor($,A,L,D){super($);this.code=A,this.status=L,this.url=D,this.name="FetchUrlError"}static create($,A,L){if(A===404)return new H(L||"URL not found.","ENOENT",A,$);if(A>=400&&A<500)return new H(L||"Permission denied.","EACCES",A,$);return new H(L||"Fatal Error","ECONNREFUSED",A,$)}static fromError($,A){let L=NHH(A);if(L)return new H(L.message,L.code,void 0,$);if(MJ(A))return new H(A.message,A.code,void 0,$);return new H(A.message,void 0,void 0,$)}};iM=IL(SHH),nM=IL(xHH),QJ=IL(kHH),NF=IL(yHH),q8=IL(fHH),bHH=IL(vHH),FF=IL(hHH),uHH=/\.gz($|[?#])/;gHH=YF(ee),mHH=iM.createRequestHandler(({params:H})=>{let $=LL(H.url);return P$(pM.readFile(u3(H.url)).then((A)=>m3.from(H.url,A,H.encoding,$)))},void 0,"Node: Read Binary File."),dHH=nM.createRequestHandler(({params:H})=>P$(m3.from({...H,content:HHH(u3(H.url))})),void 0,"Node: Sync Read Binary File."),pHH=FF.createRequestHandler(({params:H})=>{return P$(pM.readdir(u3(H.url),{withFileTypes:!0}).then(($)=>E$H(H.url,$)))},void 0,"Node: Read Directory."),cHH=bHH.createRequestHandler(({params:H})=>P$(ZF(e0(H.data))),void 0,"Node: gz deflate."),OF={"http:":!0,"https:":!0},lHH=iM.createRequestHandler((H,$)=>{let{url:A,signal:L,encoding:D}=H.params;if(!(A.protocol in OF))return $(H);return P$(wHH(A,L).then((I)=>m3.from({url:A,encoding:D,content:I})))},void 0,"Node: Read Http(s) file."),iHH=nM.createRequestHandler((H,$)=>{let{url:A,encoding:L}=H.params;if(A.protocol!=="data:")return $(H);let D=PHH(A);return P$(m3.from({url:A,content:D.data,encoding:L,baseFilename:D.attributes.get("filename")}))},void 0,"Node: Read data: urls."),nHH=iM.createRequestHandler((H,$,A)=>{let{url:L}=H.params;if(L.protocol!=="data:")return $(H);let D=A.dispatch(nM.create(H.params));if(!TA(D))return D;return P$(Promise.resolve(D.value))},void 0,"Node: Read data: urls."),aHH=QJ.createRequestHandler(({params:H})=>P$(oHH(pM.stat(u3(H.url)))),void 0,"Node: fs.stat.");sHH=NF.createRequestHandler((H)=>{let{params:$}=H;try{return P$($HH(u3($.url)))}catch(A){return r0(H,GHH(A))}},void 0,"Node: fs.stat."),rHH=QJ.createRequestHandler((H,$)=>{let{url:A}=H.params;if(!(A.protocol in OF))return $(H);return P$(jHH(A))},void 0,"Node: http get stat"),eHH=q8.createRequestHandler(({params:H})=>P$(H$H(H,H.content)),void 0,"Node: fs.writeFile");$$H=q8.createRequestHandler((H,$)=>{let A=H.params,{url:L}=H.params;if(L.protocol!=="data:")return $(H);let D=g3(A.content),I=A.baseFilename||"file.txt"+(D?".gz":""),E=qHH(I),K=E?.mimeType||"text/plain",M=VHH(A.content,K,[["filename",I]]);return P$(Promise.resolve({url:M,baseFilename:I,gz:D,encoding:E?.encoding}))},void 0,"Node: fs.writeFile DataUrl"),A$H=q8.createRequestHandler((H,$,A)=>{let L=H.params;if(!L.gz&&!QF(L.url)&&(!L.baseFilename||!QF(L.baseFilename)))return $(H);if(typeof L.content!=="string"&&g3(L.content))return $(H);return P$(L$H(A,L,L.content))},void 0,"Node: fs.writeFile compressed");Z$=function(H){return H[H.None=0]="None",H[H.Stat=1]="Stat",H[H.Read=2]="Read",H[H.Write=4]="Write",H[H.ReadWrite=6]="ReadWrite",H[H.ReadDir=8]="ReadDir",H[H.WriteDir=16]="WriteDir",H[H.ReadWriteDir=24]="ReadWriteDir",H}({});jF=class extends Error{constructor(H,$){super(H,$)}},SF=class extends jF{url;constructor(H,$,A){super(`Unsupported request: ${H}`);this.request=H,this.parameters=A,this.url=$?.toString()}};Y$H=class extends kF{constructor(H){super(H.fileType||gL.Unknown);this.stat=H}get size(){return this.stat.size}get mtimeMs(){return this.stat.mtimeMs}get eTag(){return this.stat.eTag}},yF=class extends kF{_url;constructor(H){super(H.fileType);this.entry=H}get name(){return this.entry.name}get dir(){return this.entry.dir}get url(){if(this._url)return this._url;return this._url=new URL(this.entry.name,this.entry.dir),this._url}toJSON(){return{name:this.name,dir:this.dir,fileType:this.fileType}}};YbH=YF(cM.pipeline)});function T8(){return fF()}function aM(){return T8().fs}var _8=y(()=>{HD()});import{fileURLToPath as q$H}from"node:url";function T$H(){try{return __dirname}catch{return vF?q$H(new URL("./",vF)):process.cwd()}}var __dirname="C:\\JokaMain\\ProjectShowRoom\\gdx\\node_modules\\cspell-lib\\dist\\lib",vF,mL;var N8=y(()=>{vF=import.meta.url;mL=T$H()});function bF(H,$){let I=[],E=0,K=H.indexOf("${",E);if(K<0)return H;while(K>=0){I.push(H.substring(E,K)),E=K;let M=H.indexOf("}",K);if(M<0)break;let W=H.substring(K+2,M);if(W in $)I.push($[W]||"");else I.push(H.substring(K,M+1));E=M+1,K=H.indexOf("${",E)}return I.push(H.substring(E)),I.join("")}function F8(H){let $={};for(let[A,L]of Object.entries(H))$[`env:${A}`]=L||"";return $}function hF(){return J$(mL)}function O8(){return J$("./")}function n$(H){return PH(H,O8())}function uF(H){return FH(H)}function gF(H){return H.replace(_$H,($)=>$.toUpperCase())}var _$H;var _A=y(()=>{qA();N8();qA();_$H=/^([a-zA-Z]):[\\]/});import{createRequire as N$H}from"node:module";import*as ZJ from"node:os";import*as q$ from"node:path";import{fileURLToPath as JJ}from"node:url";class sM{fs;templateReplacements;constructor(H,$){this.fs=H,this.templateReplacements=$}async resolveFile(H,$){if(H instanceof URL)return{filename:FH(H),relativeTo:$.toString(),found:await this.doesExist(H),method:"url"};let A=await this._resolveFile(H,$),L=H.match(tM);if(L)A.warning??=`Import of '${H}' should not start with '${L[0]}' in '${FH($)}'. Use '${H.replace(tM,"")}' or a relative path instead.`;return A}async _resolveFile(H,$){H=pF(H,this.templateReplacements);let A=[{filename:H,fn:this.tryUrlRel},{filename:H,fn:this.tryCreateRequire},{filename:H,fn:this.tryNodeRequireResolve},{filename:H,fn:this.tryImportResolve},{filename:H,fn:this.tryResolveExists},{filename:H,fn:this.tryNodeResolveDefaultPaths},{filename:H,fn:this.tryResolveFrom},{filename:H,fn:this.tryResolveGlobal},{filename:H,fn:this.tryLegacyResolve}];for(let D of A){let I=await D.fn(D.filename,$);if(I?.found)return I}return await this.tryUrl(H,$)||{filename:oM(H)?O$H(H,$):H.toString(),relativeTo:$.toString(),found:!1,method:"not found"}}async doesExist(H){try{let $=await this.fs.stat(H);return $.isFile()||$.isUnknown()}catch{return!1}}tryUrlRel=async(H,$)=>{if(fH(H)){let A=DA(H);return{filename:FH(A),relativeTo:void 0,found:await this.doesExist(A),method:"tryUrl"}}if(oM(H)&&fH($)&&!xM($)){let A=DA($),L=PH(H,A);return{filename:FH(L),relativeTo:FH(A),found:await this.doesExist(L),method:"tryUrl"}}return};tryUrl=async(H,$)=>{if(fH($)&&!xM($)){let A=DA($),L=PH(H,A);return{filename:FH(L),relativeTo:FH(A),found:await this.doesExist(L),method:"tryUrl"}}return};tryCreateRequire=(H,$)=>{if(H instanceof URL)return;let A=!fH($)||DL($)?$:J$("./");try{return{filename:N$H(A).resolve(H),relativeTo:A.toString(),found:!0,method:"tryCreateRequire"}}catch(L){if(F$H)console.error("Error in tryCreateRequire: %o",{filename:H,rel:A,relativeTo:$,error:`${L}`});return}};tryNodeResolveDefaultPaths=(H)=>{try{return{filename:ZH.resolve(H),relativeTo:void 0,found:!0,method:"tryNodeResolveDefaultPaths"}}catch{return}};tryNodeRequireResolve=(H,$)=>{if(fH($)&&!DL($))return;let A=uF(H),L=BJ($),D=ZJ.homedir();function I(K){let M=[K];if(oM(A))return M;for(;K&&q$.dirname(K)!==K&&K!==D;K=q$.dirname(K))M.push(K);return M}let E=I(q$.resolve(L));try{return{filename:ZH.resolve(A,{paths:E}),relativeTo:L,found:!0,method:"tryNodeRequireResolve"}}catch{return}};tryImportResolve=(H,$)=>{try{let A=oM(H)?[$]:[$,mL];return{filename:JJ(s1(H,A)),relativeTo:$.toString(),found:!0,method:"tryImportResolve"}}catch{return}};tryResolveGlobal=(H)=>{let $=x1(H);return $&&{filename:$,relativeTo:void 0,found:!0,method:"tryResolveGlobal"}||void 0};tryResolveExists=async(H,$)=>{if(H instanceof URL||fH(H)||fH($)&&!DL($))return;$=BJ($);let A=[{filename:H},{filename:q$.resolve($,H),relativeTo:$}];for(let{filename:L,relativeTo:D}of A){let I=q$.isAbsolute(L)&&await this.doesExist(n$(L));if(I)return{filename:L,relativeTo:D?.toString(),found:I,method:"tryResolveExists"}}return H=q$.resolve(H),{filename:H,relativeTo:q$.resolve("."),found:await this.doesExist(n$(H)),method:"tryResolveExists"}};tryResolveFrom=(H,$)=>{if($ instanceof URL)return;try{return{filename:dF.default(BJ($),H),relativeTo:$,found:!0,method:"tryResolveFrom"}}catch{return}};tryLegacyResolve=(H,$)=>{if(H instanceof URL||fH(H)||fH($)&&!DL($))return;let A=fH($)?JJ(new URL("./",$)):$.toString();if(H.match(tM)){let D=H.replace(tM,""),I=this.tryImportResolve(D,A)||this.tryResolveFrom(D,A);if(I?.found)return I.method="tryLegacyResolve",I}return}}function pF(H,$){let A={cwd:process.cwd(),pathSeparator:q$.sep,userHome:ZJ.homedir()};return H=H.replace(/^~(?=[/\\])/,A.userHome),H=bF(H,{...A,...$}),H}function cF(H,$,A=F8(process.env)){if(H instanceof URL)return H;H=pF(H,A);let L=n$($);return PH(H,L)}function oM(H){if(H instanceof URL)return!1;if(fH(H))return!1;if(H.startsWith("./"))return!0;if(H.startsWith("../"))return!0;if(H.startsWith("."+q$.sep))return!0;if(H.startsWith(".."+q$.sep))return!0;return!1}function O$H(H,$){return $ instanceof URL||fH($)?FH(new URL(H,$)):q$.resolve($,H)}function BJ(H){return H instanceof URL||fH(H)?JJ(new URL("./",H)):H}function w$H(H,$=F8(process.env)){let A=mF.get(H);if(!A)A=new sM(H,$),mF.set(H,A);return A}async function rM(H,$,A=aM()){return w$H(A).resolveFile(H,$)}var dF,tM,F$H=!1,mF;var w8=y(()=>{JN();sN();_8();N8();_A();dF=kA(e1(),1),tM=/^node_modules[/\\]/;mF=new WeakMap});function YJ(H){return new lF(H)}class lF{dictionaries;collection;constructor(H){this.dictionaries=H,this.collection=R$H(H)}isEnabled(H){let $=this.collection[H];return $===void 0?void 0:!!($&1)}isBlocked(H){let $=this.collection[H];return $===void 0?void 0:!($&1)}enabled(){return this.dictionaryIds.filter((H)=>this.isEnabled(H))}blocked(){return this.dictionaryIds.filter((H)=>this.isBlocked(H))}get dictionaryIds(){return Object.keys(this.collection)}}function R$H(H){let $=H.map(j$H).map(S$H),A={};for(let L of $)A[L.name]=Math.max(L.weight,A[L.name]||0);return A}function j$H(H){return H.normalize().trim()}function S$H(H){let $=H.replace(/^!+/,""),A=H.length-$.length+1;return{name:$.trim(),weight:A}}import*as eM from"node:path";function x$H(H,$){let A=$.filter(({name:L})=>H.isEnabled(L)).map(k$H);return[...new Map(A.map((L)=>[L.name,L])).values()]}function k$H(H){if(H instanceof HX)return H;let $=iF(H.path,H.file);return{...H,file:void 0,path:$}}function iF(H,$){let A=[H||"",$||""].filter((L)=>!!L);return A.length>1?eM.join(...A):A[0]||""}function R8(H,$){return H?.map((A)=>f$H(A,$))}function f$H(H,$){return y$H.get(H,(A)=>v$H(A,$))}function v$H(H,$){if(h$H(H))return H;let A=$.href;if(J8(H))return{...H,__source:A};return new HX(H,$)}function b$H(H,$){return $.name||eM.basename(H)}function GJ(H){let{dictionaries:$=[],dictionaryDefinitions:A=[],noSuggestDictionaries:L=[]}=H,D=YJ(L),I=YJ([...$,...D.enabled()]),E=A.map((K)=>{let M=D.isEnabled(K.name);if(M===void 0)return K;return{...K,noSuggest:M}});return x$H(I,E)}function h$H(H){return u$H(H)||g$H(H)}function u$H(H){return H instanceof HX}function g$H(H){return J8(H)&&!!H.__source}class HX{sourceURL;_weightMap;name;path;addWords;description;dictionaryInformation;type;file;repMap;useCompounds;noSuggest;ignoreForbiddenWords;scope;__source;ddi;constructor(H,$){this.sourceURL=$,this.__source=$.href;let A=H,{path:L="",file:D="",addWords:I,description:E,dictionaryInformation:K,type:M,repMap:W,noSuggest:X,ignoreForbiddenWords:J,scope:Z,supportNonStrictSearches:Q,useCompounds:B}=A,Y=$,G=iF(L,D),U=b$H(G,H),V=FH(cF(G,Y)),z={name:U,file:void 0,path:V,addWords:I,description:E,dictionaryInformation:K,type:M,repMap:W,noSuggest:X,ignoreForbiddenWords:J,supportNonStrictSearches:Q,scope:Z,useCompounds:B};Object.assign(this,K$(z)),this.ddi=z,this.name=z.name,this.file=z.file,this.path=z.path,this._weightMap=this.dictionaryInformation?BM(this.dictionaryInformation):void 0}get weightMap(){return this._weightMap}toJSON(){return this.ddi}}var y$H;var $X=y(()=>{CA();n0();w8();_A();z$();y$H=r_()});var AX;var nF=y(()=>{AX=class AX{map;constructor(H){this.map=new Map(H?.map(([$,A])=>[$,new WeakRef(A)]))}clear(){this.map.clear()}delete(H){return this.map.delete(H)}forEach(H,$){if($)H=H.bind($);for(let[A,L]of this)H(L,A,this)}get(H){let $=this.map.get(H);if(!$)return;let A=$.deref();if(!A){this.map.delete(H);return}return A}autoGet(H,$){let A=this.get(H);if(A)return A;let L=$(H);return this.set(H,L),L}has(H){return!!this.get(H)}set(H,$){return this.map.set(H,new WeakRef($)),this}get size(){return this.map.size}[Symbol.iterator](){return this.entries()}*entries(){for(let H of this.map.keys()){let $=this.get(H);if(!$)continue;yield[H,$]}}keys(){return this.map.keys()}*values(){for(let[H,$]of this)yield $}cleanKeys(){let H=[];for(let[$,A]of this.map.entries())if(!A.deref())H.push($);for(let $ of H)this.map.delete($);return this}[Symbol.toStringTag]="StrongWeakMap"}});var aF=y(()=>{nF()});class LX{size;L0=new Map;L1=new Map;L2=new Map;constructor(H){this.size=H}has(H){for(let $ of this.caches())if($.has(H))return!0;return!1}get(H){for(let $ of this.caches()){let A=$.get(H);if(A){if($!==this.L0)this._set(H,A);return A.v}}return}set(H,$){this._set(H,{v:$})}delete(H){let $=!1;for(let A of this.caches())$=A.delete(H)||$;return $}_set(H,$){if(this.L0.has(H))return this.L0.set(H,$),this;if(this.L0.size>=this.size)this.rotate();this.L0.set(H,$)}caches(){return[this.L0,this.L1,this.L2]}rotate(){let H=this.L2;this.L2=this.L1,this.L1=this.L0,this.L0=H,this.L0.clear()}}var UJ;var VJ=y(()=>{UJ=class UJ extends LX{factory;constructor(H,$){super($);this.factory=H}get(H){let $=super.get(H);if($!==void 0)return $;let A=this.factory(H);return this.set(H,A),A}}});var CJ;var zJ=y(()=>{CJ=class CJ extends Error{uri;options;cause;name;constructor(H,$,A,L){super(L);this.uri=H,this.options=$,this.cause=A,this.name=$.name}}});class DX{fs;dictionaryCache=new AX;inlineDictionaryCache=new l$;dictionaryCacheByDef=new RM;reader;keepAliveCache;constructor(H,$=10){this.fs=H,this.reader=d$H(H),this.keepAliveCache=new LX($)}loadDictionary(H){if(J8(H))return Promise.resolve(this.loadInlineDict(H));if(s_(H)){let{key:$,entry:A}=this.getCacheEntry(H);if(A)return A.pending.then(([D])=>D);let L=this.loadEntry(H.path,H);return this.setCacheEntry($,L,H),this.keepAliveCache.set(H,L),L.pending.then(([D])=>D)}return Promise.resolve(this.loadSimpleDict(H))}async refreshCacheEntries(H=m$H,$=Date.now()){await Promise.all([...this.dictionaryCache.values()].map((A)=>this.refreshEntry(A,H,$)))}getCacheEntry(H){let $=this.dictionaryCacheByDef.get(H);if($)return this.keepAliveCache.get(H),$;let A=this.calcKey(H),L=this.dictionaryCache.get(A);if(L)L.options=H,this.keepAliveCache.set(H,L);return{key:A,entry:L}}setCacheEntry(H,$,A){this.dictionaryCache.set(H,$),this.dictionaryCacheByDef.set(A,{key:H,entry:$})}async refreshEntry(H,$,A){if(A-H.ts>=$){let L=A+Math.random();H.sig=L,H.ts=A;let D=this.getStat(H.uri),[I]=await Promise.all([D,H.pending]),E=!this.isEqual(I,H.stat);if(H.sig===L&&E){H.loadingState=j8.Loading;let M=this.calcKey(H.options),W=this.loadEntry(H.uri,H.options);this.dictionaryCache.set(M,W),this.dictionaryCacheByDef.set(H.options,{key:M,entry:W})}}}loadEntry(H,$,A=Date.now()){let L=PH(H);$=this.normalizeOptions(L,$);let D=c$H(this.reader,PH(H),$).catch((W)=>qM($.name,H,new CJ(L.href,$,W,"failed to load"),$)),I=this.getStat(H),E=Promise.all([D,I]),K=A+Math.random(),M={uri:L.href,options:$,ts:A,stat:void 0,dictionary:void 0,pending:E,loadingState:j8.Loading,sig:K};return E.then(([W,X])=>{M.stat=X,M.dictionary=W,M.loadingState=j8.Loaded;return}).catch(()=>{return}),M}getStat(H){return this.fs.stat(PH(H)).catch(J3)}isEqual(H,$){if(!$)return!1;if(PJ(H))return PJ($)&&H.message===$.message&&H.name===$.name;return!PJ($)&&!WJ(H,$)}normalizeOptions(H,$){if($.name)return $;return{...$,name:LL(H)}}loadInlineDict(H){return this.inlineDictionaryCache.get(H,($)=>k3($,$.__source||"memory"))}loadSimpleDict(H){return k3({name:H.name,words:[]},H.__source||"memory")}calcKey(H){let $=H.path,A=oF(PH($),H),L=p$H.map((I)=>H[I]?.toString()||"");return[$,A,...L].join("|")}}function d$H(H){async function $(A){return(await H.readFile(A)).getText()}return{read:$,readLines:async(A)=>o$H(await $(A))}}function PJ(H){return!!H.message}function oF(H,$){let L=$.type&&$.type in qJ&&$.type||"S",D=H.pathname.endsWith(".trie.gz")?"T":L;return/\.trie\b/i.test(H.pathname)?"T":D}function c$H(H,$,A){let L=oF($,A);return(qJ[L]||qJ.default)(H,$,A)}async function l$H(H,$,A){let L=await H.readLines($);return i$H(L,$,A)}function i$H(H,$,A){let L=WH(H,UH((D)=>D.replaceAll(/#.*/g,"")),E$((D)=>D.split(/[^\w\p{L}\p{M}'’]+/gu)),vH((D)=>!!D));return B$(L,A.name,$.toString(),A)}async function n$H(H,$,A){let L=await H.readLines($);return a$H(L,$.toString(),A)}function a$H(H,$,A){let L=WH(H,UH((D)=>D.replaceAll(/#.*/g,"")),E$((D)=>D.split(/\s+/gu)),vH((D)=>!!D));return B$(L,A.name,$,A)}async function tF(H,$,A){let L=await H.readLines($);return B$(L,A.name,$.href,A)}async function t$H(H,$,A){let L=await H.read($);return zM(L,A.name,$.href,A)}function o$H(H){return H.split(/\n|\r\n|\r/)}var m$H=1e4,qJ,j8,p$H;var sF=y(()=>{N$();aF();B8();HD();n0();Z3();VJ();zJ();qJ={S:tF,C:l$H,W:n$H,T:t$H,default:tF};(function(H){H[H.Loaded=0]="Loaded",H[H.Loading=1]="Loading"})(j8||(j8={}));p$H=["name","noSuggest","useCompounds","type"]});var rF=y(()=>{sF()});function eF(H){if(TJ)return TJ;return TJ=new DX(H||aM())}function HO(H){return eF().loadDictionary(H)}async function $O(H,$){return eF().refreshCacheEntries(H,$)}var TJ;var AO=y(()=>{_8();rF()});function s$H(H){return H.map(HO)}function LO(H){return $O(H)}async function d3(H){let $=await Promise.all(s$H(GJ(H)));return r$H(H,$)}function _J(H){let{words:$=S8,userWords:A=S8,flagWords:L=S8,ignoreWords:D=S8,suggestWords:I=S8}=H,E=B$($,x8.words,"From Settings `words`",{caseSensitive:!0,weightMap:void 0}),K=A.length?B$(A,x8.userWords,"From Settings `userWords`",{caseSensitive:!0,weightMap:void 0}):void 0,M=S3(D,x8.ignoreWords,"From Settings `ignoreWords`"),W=bL(L,x8.flagWords,"From Settings `flagWords`"),X=x3(I,"[suggestWords]","From Settings `suggestWords`");return[E,K,M,W,X].filter(c$)}function r$H(H,$){let A=[...$,..._J(H)];return HL(A,"dictionary collection")}var S8,x8,DO;var IO=y(()=>{B8();$X();z$();AO();S8=Object.freeze([]);x8={words:"[words]",userWords:"[userWords]",flagWords:"[flagWords]",ignoreWords:"[ignoreWords]",suggestWords:"[suggestWords]"},DO=new Map(Object.entries(x8).map(([H,$])=>[$,H]))});var EO=y(()=>{B8()});var k8=y(()=>{IO();EO();zJ()});var y8;var KO=y(()=>{y8=[{id:"ada",extensions:[".adb",".ads"]},{id:"apiblueprint",extensions:[".apib",".apiblueprint"]},{id:"argdown",extensions:[".ad",".adown",".argdn",".argdown"]},{id:"asciidoc",extensions:[".adoc",".asc",".asciidoc"]},{id:"bat",extensions:[".bat",".cmd"]},{id:"bazel",extensions:[".bazel",".bzl"]},{id:"bibtex",extensions:[".bib"]},{id:"bicep",extensions:[".bicep"]},{id:"c",extensions:[".c",".i"]},{id:"cache_files",extensions:[],filenames:[".DS_Store",".cspellcache",".eslintcache"]},{id:"clojure",extensions:[".clj",".cljc",".cljs",".cljx",".clojure",".edn"]},{id:"cmake",extensions:[".cmake"],filenames:["CMakeLists.txt"]},{id:"coffeescript",extensions:[".coffee",".cson",".iced"]},{id:"cpp",extensions:[".c++",".c++m",".cc",".ccm",".cpp",".cppm",".cxx",".cxxm",".h",".h++",".h.in",".hh",".hpp",".hpp.in",".hxx",".ii",".inl",".ino",".ipp",".ixx",".mm",".tpp",".txx"]},{id:"cpp_embedded_latex",extensions:[]},{id:"csharp",extensions:[".cake",".cs",".csx"]},{id:"css",extensions:[".css"]},{id:"cuda-cpp",extensions:[".cu",".cuh"]},{id:"dart",extensions:[".dart"]},{id:"dhall",extensions:[".dhall"]},{id:"diff",extensions:[".diff",".patch",".rej"]},{id:"dockercompose",extensions:[],filenames:["*docker*compose*.yaml","*docker*compose*.yml","compose.*.yaml","compose.*.yml","compose.yaml","compose.yml"]},{id:"dockerfile",extensions:[".containerfile",".dockerfile"],filenames:["*.Dockerfile.*","Containerfile","Containerfile.*","Dockerfile","Dockerfile.*","Dockerfile.dev","dockerfile"]},{id:"elisp",extensions:[".el"]},{id:"elixir",extensions:[".ex",".exs"]},{id:"elm",extensions:[".elm"]},{id:"erb",extensions:[".erb",".html.erb",".rhtml"]},{id:"fsharp",extensions:[".fs",".fsi",".fsscript",".fsx"]},{id:"git-commit",extensions:[],filenames:["COMMIT_EDITMSG","MERGE_MSG"]},{id:"git-rebase",extensions:[],filenames:["git-rebase-todo"]},{id:"github-issues",extensions:[".github-issues"]},{id:"go",extensions:[".go"]},{id:"godot",extensions:[".gd",".godot",".tres",".tscn"]},{id:"gradle",extensions:[".gradle"]},{id:"groovy",extensions:[".gradle",".groovy",".gvy",".jenkinsfile",".nf"],filenames:["Jenkinsfile","Jenkinsfile*"]},{id:"haml",extensions:[".haml"]},{id:"handlebars",extensions:[".handlebars",".hbs",".hjs"]},{id:"haskell",extensions:[".hs",".lhs"]},{id:"haxe",extensions:[".hx"]},{id:"hlsl",extensions:[".cginc",".compute",".fx",".fxh",".hlsl",".hlsli",".psh",".vsh"]},{id:"html",extensions:[".asp",".aspx",".ejs",".htm",".html",".jshtm",".jsp",".mdoc",".rhtml",".shtml",".volt",".vue",".xht",".xhtml"]},{id:"ignore",extensions:[".git-blame-ignore-revs",".gitignore",".gitignore_global",".npmignore"],filenames:[".vscodeignore"]},{id:"ini",extensions:[".conf",".ini"]},{id:"jade",extensions:[".jade",".pug"]},{id:"java",extensions:[".jav",".java"]},{id:"javascript",extensions:[".cjs",".es6",".js",".mjs",".pac"],filenames:["jakefile"]},{id:"javascriptreact",extensions:[".jsx"]},{id:"jinja",extensions:[".jinja"]},{id:"json",extensions:[".babelrc",".bowerrc",".code-profile",".css.map",".eslintrc",".geojson",".har",".ipynb",".js.map",".jscsrc",".jshintrc",".jslintrc",".json",".jsonc",".jsonld",".ts.map",".tsbuildinfo",".vuerc",".webmanifest"],filenames:[".watchmanconfig","composer.lock"]},{id:"jsonc",extensions:[".babelrc",".code-workspace",".color-theme.json",".eslintrc",".eslintrc.json",".hintrc",".icon-theme.json",".jsfmtrc",".jshintrc",".jsonc",".language-configuration.json",".swcrc"],filenames:[".babelrc.json",".code-workspace",".devcontainer.json",".ember-cli","argv.json","babel.config.json","devcontainer.json","extensions.json","jsconfig-*.json","jsconfig.*.json","jsconfig.json","keybindings.json","launch.json","profiles.json","settings.json","tasks.json","tsconfig-*.json","tsconfig.*.json","tsconfig.json","typedoc.json"]},{id:"jsonl",extensions:[".jsonl"]},{id:"jsx-tags",extensions:[]},{id:"julia",extensions:[".jl"]},{id:"juliamarkdown",extensions:[".jmd"]},{id:"jungle",extensions:[".jungle"]},{id:"kotlin",extensions:[".kt"]},{id:"latex",extensions:[".ctx",".ltx",".tex"]},{id:"less",extensions:[".less"]},{id:"lisp",extensions:[".fasl",".l",".lisp",".lsp"]},{id:"literate haskell",extensions:[".lhs"]},{id:"lock",extensions:[".lock"],filenames:["Cargo.lock","berksfile.lock","composer.lock","package-lock.json"]},{id:"log",extensions:[".log"],filenames:["*.log.?"]},{id:"lua",extensions:[".lua"]},{id:"makefile",extensions:[".mak",".mk"],filenames:["GNUmakefile","Makefile","OCamlMakefile","makefile"]},{id:"map",extensions:[".map",".css.map",".ts.map",".js.map"]},{id:"markdown",extensions:[".markdn",".markdown",".md",".mdown",".mdtext",".mdtxt",".mdwn",".mkd",".workbook"]},{id:"markdown_latex_combined",extensions:[]},{id:"markdown-math",extensions:[]},{id:"mdx",extensions:[".mdx"]},{id:"monkeyc",extensions:[".mb",".mc"]},{id:"mustache",extensions:[".mst",".mu",".mustache",".stache"]},{id:"nix",extensions:[".nix"]},{id:"nunjucks",extensions:[".nj",".njk",".nunj",".nunjs",".nunjucks",".tmpl",".tpl"]},{id:"objective-c",extensions:[".m"]},{id:"objective-cpp",extensions:[".mm"]},{id:"ocaml",extensions:[".eliom",".eliomi",".ml",".mli",".mll",".mly"]},{id:"pdf",extensions:[".pdf"]},{id:"pem",extensions:[".pem",".private-key.pem"]},{id:"pem-private-key",extensions:[".private-key.pem"]},{id:"perl",extensions:[".PL",".pl",".pm",".pod",".psgi",".t"]},{id:"perl6",extensions:[".nqp",".p6",".pl6",".pm6"]},{id:"php",extensions:[".ctp",".php",".php4",".php5",".phtml"]},{id:"plaintext",extensions:[".txt"]},{id:"powershell",extensions:[".ps1",".psd1",".psm1",".psrc",".pssc"]},{id:"properties",extensions:[".cfg",".conf",".directory",".editorconfig",".gitattributes",".gitconfig",".gitmodules",".npmrc",".properties",".repo"],filenames:[".env","gitconfig"]},{id:"puppet",extensions:[".puppet"]},{id:"purescript",extensions:[".purs"]},{id:"python",extensions:[".cpy",".gyp",".gypi",".ipy",".py",".pyi",".pyt",".pyw",".rpy"],filenames:["SConscript","SConstruct"]},{id:"r",extensions:[".R",".r",".rhistory",".rprofile",".rt"]},{id:"raku",extensions:[".nqp",".p6",".pl6",".pm6",".raku",".rakudoc",".rakumod",".rakutest"]},{id:"razor",extensions:[".cshtml",".razor"]},{id:"rescript",extensions:[".res",".resi"]},{id:"restructuredtext",extensions:[".rst"]},{id:"rsa",extensions:[".pub"],filenames:["id_rsa","id_rsa.pub"]},{id:"ruby",extensions:[".erb",".gemspec",".podspec",".rake",".rb",".rbi",".rbx",".rjs",".ru"],filenames:["Gemfile","appfile","appraisals","berksfile","berksfile.lock","brewfile","capfile","cheffile","dangerfile","deliverfile","fastfile","gemfile","guardfile","gymfile","hobofile","matchfile","podfile","puppetfile","rakefile","rantfile","scanfile","snapfile","thorfile","vagrantfile"]},{id:"rust",extensions:[".rs"]},{id:"sass",extensions:[".sass"]},{id:"scala",extensions:[".sbt",".sc",".scala"]},{id:"scss",extensions:[".scss"]},{id:"search-result",extensions:[".code-search"]},{id:"shaderlab",extensions:[".cginc",".shader"]},{id:"shellscript",extensions:[".Xsession",".bash",".bash_aliases",".bash_login",".bash_logout",".bash_profile",".bashrc",".csh",".cshrc",".ebuild",".eclass",".fish",".install",".ksh",".profile",".sh",".tcshrc",".xprofile",".xsession",".xsessionrc",".yash_profile",".yashrc",".zlogin",".zlogout",".zprofile",".zsh",".zsh-theme",".zshenv",".zshrc"],filenames:[".env.*",".envrc",".hushlogin","APKBUILD","PKGBUILD","bashrc_Apple_Terminal","zlogin","zlogout","zprofile","zshenv","zshrc","zshrc_Apple_Terminal"]},{id:"snippets",extensions:[".code-snippets"]},{id:"sql",extensions:[".dsql",".sql"]},{id:"stylus",extensions:[".styl"]},{id:"svelte",extensions:[".svelte"]},{id:"swift",extensions:[".swift"]},{id:"terraform",extensions:[".hcl",".tf",".tf.json",".tfvars"]},{id:"tex",extensions:[".bbx",".cbx",".cls",".sty"]},{id:"tfvars",extensions:[".tfvars"],description:"Terraform Variables"},{id:"todo",extensions:[],filenames:["todo"]},{id:"toml",extensions:[".toml"],filenames:["Cargo.lock","Cargo.toml"]},{id:"typescript",extensions:[".cts",".mts",".ts"]},{id:"typescriptreact",extensions:[".tsx"]},{id:"typst",extensions:[".typst"]},{id:"vala",extensions:[".vala"]},{id:"vb",extensions:[".bas",".brs",".vb",".vba",".vbs"]},{id:"vue",extensions:[".vue"]},{id:"xml",extensions:[".ascx",".atom",".axaml",".axml",".bpmn",".config",".cpt",".csl",".csproj",".csproj.user",".dita",".ditamap",".dtd",".dtml",".ent",".fsproj",".fxml",".iml",".isml",".jmx",".launch",".menu",".mod",".mxml",".nuspec",".opml",".owl",".proj",".props",".pt",".publishsettings",".pubxml",".pubxml.user",".rbxlx",".rbxmx",".rdf",".rng",".rss",".shproj",".storyboard",".svg",".targets",".tld",".tmx",".vbproj",".vbproj.user",".vcxproj",".vcxproj.filters",".wsdl",".wxi",".wxl",".wxs",".xaml",".xbl",".xib",".xlf",".xliff",".xml",".xoml",".xpdl",".xsd",".xul"]},{id:"xsl",extensions:[".xsl",".xslt"]},{id:"yaml",extensions:[".cff",".eyaml",".eyml",".yaml",".yaml-tmlanguage",".yaml-tmpreferences",".yaml-tmtheme",".yml"]},{id:"binary",extensions:[".bin",".cur",".dll",".eot",".exe",".gz",".lib",".o",".obj",".phar",".zip"],format:"Binary"},{id:"dll",extensions:[".dll"],format:"Binary"},{id:"exe",extensions:[".exe"],format:"Binary"},{id:"fonts",extensions:[".ttf",".woff",".woff2"],format:"Binary"},{id:"gzip",extensions:[".gz"],format:"Binary"},{id:"image",extensions:[".bmp",".exr",".gif",".heic",".ico",".jpeg",".jpg",".pbm",".pgm",".png",".ppm",".ras",".sgi",".tiff",".webp",".xbm"],format:"Binary",description:"Some image extensions"},{id:"jar",extensions:[".jar"],format:"Binary"},{id:"mdb",extensions:[".mdb"],format:"Binary",description:"Microsoft Access DB"},{id:"object-file",extensions:[".o",".obj"],format:"Binary"},{id:"spv",extensions:[".spv"],format:"Binary",description:"SPSS Output Document"},{id:"trie",extensions:[".trie"],format:"Binary",description:"CSpell dictionary file."},{id:"video",extensions:[".avi",".flv",".mkv",".mov",".mp4",".mpeg",".mpg",".wmv"],format:"Binary"},{id:"webm",extensions:[".webm"],format:"Binary",description:"WebM is an audiovisual media file format."},{id:"wheel",extensions:[".whl"],format:"Binary"},{id:"zig",extensions:[".zig"],description:"Zig programming language"},{id:"zon",extensions:[".zon"],description:"Zig programming language package file"}]});function f8(H){return DAH($AH,H)}function DAH(H,$){if(typeof $==="string")return H.has($);for(let A of $)if(H.has(A))return!0;return!1}function IAH(H){return H.reduce(($,A)=>{function L(D){XAH($,D,()=>new Set).add(A.id)}return A.extensions.forEach(L),A.filenames?.forEach((D)=>typeof D==="string"?L(D):void 0),$},new Map)}function EAH(H){return new Map([...H].map(([$,A])=>[$,[...A]]))}function KAH(H){return LAH.filter(({regexp:$})=>$.test(H)).map(({id:$})=>$)}function XO(H){let $=MO.get(H);if($)return $;let A=KAH(H);if(A.length)return A;for(let L=H.indexOf(".");L>=0;L=H.indexOf(".",L+1)){let D=MO.get(H.slice(L));if(D)return D}return}function dL(H){return H=MAH(H),XO(H)||XO(H.toLowerCase())||[]}function MAH(H){return WO.test(H)?H.split(WO).slice(-1).join(""):H}function XAH(H,$,A){let L=H.get($);if(L!==void 0||H.has($))return L;let D=A($);return H.set($,D),D}function WAH(H){return H.replaceAll(/[|\\{}()[\]^$+*?.]/g,"\\$&").replaceAll("-","\\x2d")}function QAH(H){return H.includes("*")?BAH(H):H}function BAH(H){H=H.replaceAll("**","*");let $="";for(let A of H)switch(A){case"?":{$+=".";break}case"*":{$+=".*";break}default:$+=WAH(A)}return new RegExp($)}function JAH(H){if(!H.filenames)return;let $=H.filenames.map(QAH).map((L)=>L instanceof RegExp?L:void 0).filter((L)=>!!L);if(!$.length)return;return{regexp:new RegExp($.map((L)=>L.source).join("|")),id:H.id}}var e$H,HAH,$AH,vhH,AAH,MO,LAH,WO;var QO=y(()=>{KO();e$H=y8.filter((H)=>H.format==="Binary").map((H)=>H.id),HAH=new Set(["binary","image","video","fonts",...e$H]),$AH=new Set([...HAH,"map","lock","pdf","cache_files","rsa","pem","trie","log"]),vhH=y8.map(({id:H})=>H),AAH=IAH(y8),MO=EAH(AAH),LAH=y8.map(JAH).filter((H)=>!!H);WO=/[\\/]/g});var BO=y(()=>{QO()});var IX=y(()=>{BO()});var JO,pL,v8;var NJ=y(()=>{(()=>{var H={975:(F)=>{function f(_){if(typeof _!="string")throw TypeError("Path must be a string. Received "+JSON.stringify(_))}function j(_,u){for(var h,d="",l=0,k=-1,p=0,LH=0;LH<=_.length;++LH){if(LH<_.length)h=_.charCodeAt(LH);else{if(h===47)break;h=47}if(h===47){if(k===LH-1||p===1);else if(k!==LH-1&&p===2){if(d.length<2||l!==2||d.charCodeAt(d.length-1)!==46||d.charCodeAt(d.length-2)!==46){if(d.length>2){var IH=d.lastIndexOf("/");if(IH!==d.length-1){IH===-1?(d="",l=0):l=(d=d.slice(0,IH)).length-1-d.lastIndexOf("/"),k=LH,p=0;continue}}else if(d.length===2||d.length===1){d="",l=0,k=LH,p=0;continue}}u&&(d.length>0?d+="/..":d="..",l=2)}else d.length>0?d+="/"+_.slice(k+1,LH):d=_.slice(k+1,LH),l=LH-k-1;k=LH,p=0}else h===46&&p!==-1?++p:p=-1}return d}var S={resolve:function(){for(var _,u="",h=!1,d=arguments.length-1;d>=-1&&!h;d--){var l;d>=0?l=arguments[d]:(_===void 0&&(_=process.cwd()),l=_),f(l),l.length!==0&&(u=l+"/"+u,h=l.charCodeAt(0)===47)}return u=j(u,!h),h?u.length>0?"/"+u:"/":u.length>0?u:"."},normalize:function(_){if(f(_),_.length===0)return".";var u=_.charCodeAt(0)===47,h=_.charCodeAt(_.length-1)===47;return(_=j(_,!u)).length!==0||u||(_="."),_.length>0&&h&&(_+="/"),u?"/"+_:_},isAbsolute:function(_){return f(_),_.length>0&&_.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var _,u=0;u<arguments.length;++u){var h=arguments[u];f(h),h.length>0&&(_===void 0?_=h:_+="/"+h)}return _===void 0?".":S.normalize(_)},relative:function(_,u){if(f(_),f(u),_===u)return"";if((_=S.resolve(_))===(u=S.resolve(u)))return"";for(var h=1;h<_.length&&_.charCodeAt(h)===47;++h);for(var d=_.length,l=d-h,k=1;k<u.length&&u.charCodeAt(k)===47;++k);for(var p=u.length-k,LH=l<p?l:p,IH=-1,HH=0;HH<=LH;++HH){if(HH===LH){if(p>LH){if(u.charCodeAt(k+HH)===47)return u.slice(k+HH+1);if(HH===0)return u.slice(k+HH)}else l>LH&&(_.charCodeAt(h+HH)===47?IH=HH:HH===0&&(IH=0));break}var e=_.charCodeAt(h+HH);if(e!==u.charCodeAt(k+HH))break;e===47&&(IH=HH)}var _H="";for(HH=h+IH+1;HH<=d;++HH)HH!==d&&_.charCodeAt(HH)!==47||(_H.length===0?_H+="..":_H+="/..");return _H.length>0?_H+u.slice(k+IH):(k+=IH,u.charCodeAt(k)===47&&++k,u.slice(k))},_makeLong:function(_){return _},dirname:function(_){if(f(_),_.length===0)return".";for(var u=_.charCodeAt(0),h=u===47,d=-1,l=!0,k=_.length-1;k>=1;--k)if((u=_.charCodeAt(k))===47){if(!l){d=k;break}}else l=!1;return d===-1?h?"/":".":h&&d===1?"//":_.slice(0,d)},basename:function(_,u){if(u!==void 0&&typeof u!="string")throw TypeError('"ext" argument must be a string');f(_);var h,d=0,l=-1,k=!0;if(u!==void 0&&u.length>0&&u.length<=_.length){if(u.length===_.length&&u===_)return"";var p=u.length-1,LH=-1;for(h=_.length-1;h>=0;--h){var IH=_.charCodeAt(h);if(IH===47){if(!k){d=h+1;break}}else LH===-1&&(k=!1,LH=h+1),p>=0&&(IH===u.charCodeAt(p)?--p==-1&&(l=h):(p=-1,l=LH))}return d===l?l=LH:l===-1&&(l=_.length),_.slice(d,l)}for(h=_.length-1;h>=0;--h)if(_.charCodeAt(h)===47){if(!k){d=h+1;break}}else l===-1&&(k=!1,l=h+1);return l===-1?"":_.slice(d,l)},extname:function(_){f(_);for(var u=-1,h=0,d=-1,l=!0,k=0,p=_.length-1;p>=0;--p){var LH=_.charCodeAt(p);if(LH!==47)d===-1&&(l=!1,d=p+1),LH===46?u===-1?u=p:k!==1&&(k=1):u!==-1&&(k=-1);else if(!l){h=p+1;break}}return u===-1||d===-1||k===0||k===1&&u===d-1&&u===h+1?"":_.slice(u,d)},format:function(_){if(_===null||typeof _!="object")throw TypeError('The "pathObject" argument must be of type Object. Received type '+typeof _);return function(u,h){var d=h.dir||h.root,l=h.base||(h.name||"")+(h.ext||"");return d?d===h.root?d+l:d+"/"+l:l}(0,_)},parse:function(_){f(_);var u={root:"",dir:"",base:"",ext:"",name:""};if(_.length===0)return u;var h,d=_.charCodeAt(0),l=d===47;l?(u.root="/",h=1):h=0;for(var k=-1,p=0,LH=-1,IH=!0,HH=_.length-1,e=0;HH>=h;--HH)if((d=_.charCodeAt(HH))!==47)LH===-1&&(IH=!1,LH=HH+1),d===46?k===-1?k=HH:e!==1&&(e=1):k!==-1&&(e=-1);else if(!IH){p=HH+1;break}return k===-1||LH===-1||e===0||e===1&&k===LH-1&&k===p+1?LH!==-1&&(u.base=u.name=p===0&&l?_.slice(1,LH):_.slice(p,LH)):(p===0&&l?(u.name=_.slice(1,k),u.base=_.slice(1,LH)):(u.name=_.slice(p,k),u.base=_.slice(p,LH)),u.ext=_.slice(k,LH)),p>0?u.dir=_.slice(0,p-1):l&&(u.dir="/"),u},sep:"/",delimiter:":",win32:null,posix:null};S.posix=S,F.exports=S}},$={};function A(F){var f=$[F];if(f!==void 0)return f.exports;var j=$[F]={exports:{}};return H[F](j,j.exports,A),j.exports}A.d=(F,f)=>{for(var j in f)A.o(f,j)&&!A.o(F,j)&&Object.defineProperty(F,j,{enumerable:!0,get:f[j]})},A.o=(F,f)=>Object.prototype.hasOwnProperty.call(F,f),A.r=(F)=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(F,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(F,"__esModule",{value:!0})};var L={};let D;if(A.r(L),A.d(L,{URI:()=>Z,Utils:()=>w}),typeof process=="object")D=process.platform==="win32";else if(typeof navigator=="object")D=navigator.userAgent.indexOf("Windows")>=0;let I=/^\w[\w\d+.-]*$/,E=/^\//,K=/^\/\//;function M(F,f){if(!F.scheme&&f)throw Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${F.authority}", path: "${F.path}", query: "${F.query}", fragment: "${F.fragment}"}`);if(F.scheme&&!I.test(F.scheme))throw Error("[UriError]: Scheme contains illegal characters.");if(F.path){if(F.authority){if(!E.test(F.path))throw Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(K.test(F.path))throw Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}let W="",X="/",J=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class Z{static isUri(F){return F instanceof Z||!!F&&typeof F.authority=="string"&&typeof F.fragment=="string"&&typeof F.path=="string"&&typeof F.query=="string"&&typeof F.scheme=="string"&&typeof F.fsPath=="string"&&typeof F.with=="function"&&typeof F.toString=="function"}scheme;authority;path;query;fragment;constructor(F,f,j,S,_,u=!1){typeof F=="object"?(this.scheme=F.scheme||W,this.authority=F.authority||W,this.path=F.path||W,this.query=F.query||W,this.fragment=F.fragment||W):(this.scheme=function(h,d){return h||d?h:"file"}(F,u),this.authority=f||W,this.path=function(h,d){switch(h){case"https":case"http":case"file":d?d[0]!==X&&(d=X+d):d=X}return d}(this.scheme,j||W),this.query=S||W,this.fragment=_||W,M(this,u))}get fsPath(){return V(this,!1)}with(F){if(!F)return this;let{scheme:f,authority:j,path:S,query:_,fragment:u}=F;return f===void 0?f=this.scheme:f===null&&(f=W),j===void 0?j=this.authority:j===null&&(j=W),S===void 0?S=this.path:S===null&&(S=W),_===void 0?_=this.query:_===null&&(_=W),u===void 0?u=this.fragment:u===null&&(u=W),f===this.scheme&&j===this.authority&&S===this.path&&_===this.query&&u===this.fragment?this:new B(f,j,S,_,u)}static parse(F,f=!1){let j=J.exec(F);return j?new B(j[2]||W,q(j[4]||W),q(j[5]||W),q(j[7]||W),q(j[9]||W),f):new B(W,W,W,W,W)}static file(F){let f=W;if(D&&(F=F.replace(/\\/g,X)),F[0]===X&&F[1]===X){let j=F.indexOf(X,2);j===-1?(f=F.substring(2),F=X):(f=F.substring(2,j),F=F.substring(j)||X)}return new B("file",f,F,W,W)}static from(F){let f=new B(F.scheme,F.authority,F.path,F.query,F.fragment);return M(f,!0),f}toString(F=!1){return z(this,F)}toJSON(){return this}static revive(F){if(F){if(F instanceof Z)return F;{let f=new B(F);return f._formatted=F.external,f._fsPath=F._sep===Q?F.fsPath:null,f}}return F}}let Q=D?1:void 0;class B extends Z{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=V(this,!1)),this._fsPath}toString(F=!1){return F?z(this,!0):(this._formatted||(this._formatted=z(this,!1)),this._formatted)}toJSON(){let F={$mid:1};return this._fsPath&&(F.fsPath=this._fsPath,F._sep=Q),this._formatted&&(F.external=this._formatted),this.path&&(F.path=this.path),this.scheme&&(F.scheme=this.scheme),this.authority&&(F.authority=this.authority),this.query&&(F.query=this.query),this.fragment&&(F.fragment=this.fragment),F}}let Y={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function G(F,f,j){let S,_=-1;for(let u=0;u<F.length;u++){let h=F.charCodeAt(u);if(h>=97&&h<=122||h>=65&&h<=90||h>=48&&h<=57||h===45||h===46||h===95||h===126||f&&h===47||j&&h===91||j&&h===93||j&&h===58)_!==-1&&(S+=encodeURIComponent(F.substring(_,u)),_=-1),S!==void 0&&(S+=F.charAt(u));else{S===void 0&&(S=F.substr(0,u));let d=Y[h];d!==void 0?(_!==-1&&(S+=encodeURIComponent(F.substring(_,u)),_=-1),S+=d):_===-1&&(_=u)}}return _!==-1&&(S+=encodeURIComponent(F.substring(_))),S!==void 0?S:F}function U(F){let f;for(let j=0;j<F.length;j++){let S=F.charCodeAt(j);S===35||S===63?(f===void 0&&(f=F.substr(0,j)),f+=Y[S]):f!==void 0&&(f+=F[j])}return f!==void 0?f:F}function V(F,f){let j;return j=F.authority&&F.path.length>1&&F.scheme==="file"?`//${F.authority}${F.path}`:F.path.charCodeAt(0)===47&&(F.path.charCodeAt(1)>=65&&F.path.charCodeAt(1)<=90||F.path.charCodeAt(1)>=97&&F.path.charCodeAt(1)<=122)&&F.path.charCodeAt(2)===58?f?F.path.substr(1):F.path[1].toLowerCase()+F.path.substr(2):F.path,D&&(j=j.replace(/\//g,"\\")),j}function z(F,f){let j=f?U:G,S="",{scheme:_,authority:u,path:h,query:d,fragment:l}=F;if(_&&(S+=_,S+=":"),(u||_==="file")&&(S+=X,S+=X),u){let k=u.indexOf("@");if(k!==-1){let p=u.substr(0,k);u=u.substr(k+1),k=p.lastIndexOf(":"),k===-1?S+=j(p,!1,!1):(S+=j(p.substr(0,k),!1,!1),S+=":",S+=j(p.substr(k+1),!1,!0)),S+="@"}u=u.toLowerCase(),k=u.lastIndexOf(":"),k===-1?S+=j(u,!1,!0):(S+=j(u.substr(0,k),!1,!0),S+=u.substr(k))}if(h){if(h.length>=3&&h.charCodeAt(0)===47&&h.charCodeAt(2)===58){let k=h.charCodeAt(1);k>=65&&k<=90&&(h=`/${String.fromCharCode(k+32)}:${h.substr(3)}`)}else if(h.length>=2&&h.charCodeAt(1)===58){let k=h.charCodeAt(0);k>=65&&k<=90&&(h=`${String.fromCharCode(k+32)}:${h.substr(2)}`)}S+=j(h,!0,!1)}return d&&(S+="?",S+=j(d,!1,!1)),l&&(S+="#",S+=f?l:G(l,!1,!1)),S}function P(F){try{return decodeURIComponent(F)}catch{return F.length>3?F.substr(0,3)+P(F.substr(3)):F}}let T=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function q(F){return F.match(T)?F.replace(T,(f)=>P(f)):F}var O=A(975);let N=O.posix||O,x="/";var w;(function(F){F.joinPath=function(f,...j){return f.with({path:N.join(f.path,...j)})},F.resolvePath=function(f,...j){let S=f.path,_=!1;S[0]!==x&&(S=x+S,_=!0);let u=N.resolve(S,...j);return _&&u[0]===x&&!f.authority&&(u=u.substring(1)),f.with({path:u})},F.dirname=function(f){if(f.path.length===0||f.path===x)return f;let j=N.dirname(f.path);return j.length===1&&j.charCodeAt(0)===46&&(j=""),f.with({path:j})},F.basename=function(f){return N.basename(f.path)},F.extname=function(f){return N.extname(f.path)}})(w||(w={})),JO=L})();({URI:pL,Utils:v8}=JO)});import YAH from"node:assert";function cL(H){if(M$.isUri(H))return H;if(pL.isUri(H))return M$.from(H);if(H instanceof URL)return M$.parse(H.toString());if(VAH(H))return M$.parse(H.href);if(CAH(H))return M$.from(H);if(fH(H))return M$.parse(H);return M$.file(YO(H))}function p3(H){let $=$D(H);return $=$.protocol==="stdin:"?new URL($.pathname,UAH):$,FH($)}function YO(H){return ZO.test(H)?H[0].toUpperCase()+H.slice(1):H}function VAH(H){return!!H&&typeof H==="object"&&typeof H.href==="string"||!1}function CAH(H){if(!H||typeof H!=="object")return!1;if(M$.isUri(H))return!0;if(pL.isUri(H))return!0;let $=H;return typeof $.path==="string"&&typeof $.scheme==="string"}function EX(H){return v8.basename(pL.from(H))}function zAH(H,...$){return M$.from(H,...$)}function qAH(H){return YO(H.replaceAll("\\","/"))}function TAH(H){YAH(H.startsWith(FJ));let $=FJ.length,A=$;for(;H[A]==="/";++A);let L=A,D=H.indexOf("#",L),I=D>0?D:H.length,E=H.indexOf("?",L),K=E>0&&E<I?E:I,M=K,W=H.slice(L,M),X=K<I?H.slice(K+1,I):"",J=H.slice(I+1);return{scheme:"stdin",path:(A-$>2?"/":"")+qAH(decodeURI(W)),query:decodeURI(X),fragment:decodeURI(J)}}function $D(H){return DA(H instanceof URL?H:typeof H==="string"?PH(H):new URL(zAH(H).toString()))}var FJ="stdin:",GAH,ZO,UAH,PAH,M$;var AD=y(()=>{qA();HD();NJ();GAH=process.platform==="win32",ZO=/^[a-zA-Z]:[\\/]/,UAH=J$("/");PAH=["scheme","authority","path","query","fragment"];M$=class M$ extends pL{constructor(H){super(H.scheme,H.authority,H.path,H.query,H.fragment)}toString(){let H=encodeURI(this.path||"").replaceAll(/[#?]/g,(I)=>`%${(I.codePointAt(0)||0).toString(16)}`),$=`${this.scheme}://${this.authority||""}${H}`,A=this.query&&`?${this.query}`||"",L=this.fragment&&`#${this.fragment}`||"";return $+A+L}toJSON(){let{scheme:H,authority:$,path:A,query:L,fragment:D}=this;return{scheme:H,authority:$,path:A,query:L,fragment:D}}with(H){let{scheme:$,authority:A,path:L,query:D,fragment:I}=this,E={scheme:$,authority:A,path:L,query:D,fragment:I};for(let K of PAH)if(H[K]&&typeof H[K]==="string")E[K]=H[K];return new M$(E)}static isUri(H){return H instanceof M$}static from(H,...$){let A=new M$(H);for(let L of $)A=A.with(L);return A}static parse(H){if(H.startsWith(FJ))return M$.from(TAH(H));let $=pL.parse(H);return M$.from($)}static file(H){if(!GAH&&ZO.test(H))H="/"+H.replaceAll("\\","/");let $=PH(H);return M$.parse($.href)}static stdin(H=""){return M$.from(M$.file(H),{scheme:"stdin"})}}});function GO(H){return(Array.isArray(H)?H.join(","):H).split(",").map(($)=>$.trim())}function OJ(H){return NAH(cL(H.uri),H.languageId,H.text)}function NAH(H,$,A){let L=cL(H);if($){let E=GO($);if(E.length)return f8(E)}let D=EX(L),I=dL(D);if(I.length)return f8(I);return A?.slice(0,1024).includes("\x00")||!1}var UO=y(()=>{IX();AD()});class b8{constructor(H,$,A,L){this._uri=H,this._languageId=$,this._version=A,this._content=L,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(H){if(H){let $=this.offsetAt(H.start),A=this.offsetAt(H.end);return this._content.substring($,A)}return this._content}update(H,$){for(let A of H)if(b8.isIncremental(A)){let L=zO(A.range),D=this.offsetAt(L.start),I=this.offsetAt(L.end);this._content=this._content.substring(0,D)+A.text+this._content.substring(I,this._content.length);let E=Math.max(L.start.line,0),K=Math.max(L.end.line,0),M=this._lineOffsets,W=VO(A.text,!1,D);if(K-E===W.length)for(let J=0,Z=W.length;J<Z;J++)M[J+E+1]=W[J];else if(W.length<1e4)M.splice(E+1,K-E,...W);else this._lineOffsets=M=M.slice(0,E+1).concat(W,M.slice(K+1));let X=A.text.length-(I-D);if(X!==0)for(let J=E+1+W.length,Z=M.length;J<Z;J++)M[J]=M[J]+X}else if(b8.isFull(A))this._content=A.text,this._lineOffsets=void 0;else throw Error("Unknown change event received");this._version=$}getLineOffsets(){if(this._lineOffsets===void 0)this._lineOffsets=VO(this._content,!0);return this._lineOffsets}positionAt(H){H=Math.max(Math.min(H,this._content.length),0);let $=this.getLineOffsets(),A=0,L=$.length;if(L===0)return{line:0,character:H};while(A<L){let I=Math.floor((A+L)/2);if($[I]>H)L=I;else A=I+1}let D=A-1;return H=this.ensureBeforeEOL(H,$[D]),{line:D,character:H-$[D]}}offsetAt(H){let $=this.getLineOffsets();if(H.line>=$.length)return this._content.length;else if(H.line<0)return 0;let A=$[H.line];if(H.character<=0)return A;let L=H.line+1<$.length?$[H.line+1]:this._content.length,D=Math.min(A+H.character,L);return this.ensureBeforeEOL(D,A)}ensureBeforeEOL(H,$){while(H>$&&CO(this._content.charCodeAt(H-1)))H--;return H}get lineCount(){return this.getLineOffsets().length}static isIncremental(H){let $=H;return $!==void 0&&$!==null&&typeof $.text==="string"&&$.range!==void 0&&($.rangeLength===void 0||typeof $.rangeLength==="number")}static isFull(H){let $=H;return $!==void 0&&$!==null&&typeof $.text==="string"&&$.range===void 0&&$.rangeLength===void 0}}function wJ(H,$){if(H.length<=1)return H;let A=H.length/2|0,L=H.slice(0,A),D=H.slice(A);wJ(L,$),wJ(D,$);let I=0,E=0,K=0;while(I<L.length&&E<D.length)if($(L[I],D[E])<=0)H[K++]=L[I++];else H[K++]=D[E++];while(I<L.length)H[K++]=L[I++];while(E<D.length)H[K++]=D[E++];return H}function VO(H,$,A=0){let L=$?[A]:[];for(let D=0;D<H.length;D++){let I=H.charCodeAt(D);if(CO(I)){if(I===13&&D+1<H.length&&H.charCodeAt(D+1)===10)D++;L.push(A+D+1)}}return L}function CO(H){return H===13||H===10}function zO(H){let{start:$,end:A}=H;if($.line>A.line||$.line===A.line&&$.character>A.character)return{start:A,end:$};return H}function FAH(H){let $=zO(H.range);if($!==H.range)return{newText:H.newText,range:$};return H}var h8;var PO=y(()=>{(function(H){function $(D,I,E,K){return new b8(D,I,E,K)}H.create=$;function A(D,I,E){if(D instanceof b8)return D.update(I,E),D;else throw Error("TextDocument.update: document must be created by TextDocument.create")}H.update=A;function L(D,I){let E=D.getText(),K=wJ(I.map(FAH),(X,J)=>{let Z=X.range.start.line-J.range.start.line;if(Z===0)return X.range.start.character-J.range.start.character;return Z}),M=0,W=[];for(let X of K){let J=D.offsetAt(X.range.start);if(J<M)throw Error("Overlapping edit");else if(J>M)W.push(E.substring(M,J));if(X.newText.length)W.push(X.newText);M=D.offsetAt(X.range.end)}return W.push(E.substr(M)),W.join("")}H.applyEdits=L})(h8||(h8={}))});import OAH from"node:assert";class RJ{languageId;locale;vsTextDoc;uri;constructor(H,$,A,L,D){this.languageId=A,this.locale=L;let I=typeof A==="string"?A:A[0]||"plaintext";this.vsTextDoc=h8.create(H.toString(),I,D,$),this.uri=$D(H)}get version(){return this.vsTextDoc.version}get text(){return this.vsTextDoc.getText()}positionAt(H){return this.vsTextDoc.positionAt(H)}offsetAt(H){return this.vsTextDoc.offsetAt(H)}lineAt(H){let $=this.vsTextDoc.positionAt(H);return this.getLine($.line)}getLine(H){let $={line:H,character:0},A={line:H+1,character:0},L={start:$,end:A},D=this.vsTextDoc.offsetAt($);return{text:this.vsTextDoc.getText(L),offset:D,position:$}}*getLines(){let H={start:{line:0,character:0},end:{line:1,character:0}};while(this.vsTextDoc.offsetAt(H.end)>this.vsTextDoc.offsetAt(H.start)){let $=this.vsTextDoc.offsetAt(H.start);yield{text:this.vsTextDoc.getText(H),offset:$,position:H.start},++H.start.line,++H.end.line}}update(H,$){$=$??this.version+1;for(let A of H){let L=A.range?{range:{start:this.positionAt(A.range[0]),end:this.positionAt(A.range[1])},text:A.text}:A;h8.update(this.vsTextDoc,[L],$)}return this}}function qO({uri:H,content:$,languageId:A,locale:L,version:D}){return D=D??1,H=cL(H),A=A??dL(EX(H)),A=A.length===0?"text":A,new RJ(H,$,A,L,D)}function TO(H,$,A){return OAH(wAH(H),"Unknown TextDocument type"),H.update($,A)}function wAH(H){return H instanceof RJ}var jJ=y(()=>{PO();IX();AD();AD()});import{readFile as RAH}from"node:fs/promises";function _O(H){let{uri:$,text:A,languageId:L,locale:D}=H;return qO({uri:$,content:A,languageId:L,locale:D})}async function SAH(H,$=jAH){let A=await RAH(H,$);return{uri:cL(H).toString(),text:A}}function NO(H,$){if(xAH(H))return Promise.resolve(H);let A=cL(H.uri);if(A.scheme!=="file")throw Error(`Unsupported schema: "${A.scheme}", open "${A.toString()}"`);return SAH(p3(A),$)}function xAH(H){return H.text!==void 0}var jAH="utf8";var FO=y(()=>{jJ();AD()});import*as u8 from"node:path";function fAH(H){return typeof H!=="string"&&typeof H.glob==="string"}function RO(H){if(typeof H==="string")return!1;return typeof H.root==="string"&&"isGlobalPattern"in H}function jO(H){if(!RO(H))return!1;let $=H;return"rawGlob"in $&&"rawRoot"in $&&typeof $.rawGlob==="string"}function vAH(H,$){if(!jO(H))return!1;return H.root===$.root}function SO(H=u8){return H===u8?yAH:new t0({path:H})}function bAH(H,$){H=H.replace(/^(!!)+/,"");let A=H.startsWith("!"),L=A?"!":"";return H=A?H.slice(1):H,($?hAH(H):uAH(H)).map((I)=>L+I)}function hAH(H){if(!H.includes("/")){if(H==="**")return["**"];return["**/"+H,"**/"+H+"/**"]}let $=H.startsWith("/");if(H=$?H.slice(1):H,H.endsWith("/"))return $||H.slice(0,-1).includes("/")?[H+"**/*"]:["**/"+H+"**/*"];if(H.endsWith("**"))return[H];return[H,H+"/**"]}function uAH(H){return H=H.startsWith("/")?H.slice(1):H,H=H.endsWith("/")?H+"**/*":H,[H]}function xO(H,$){function*A(){for(let L of H){if(jO(L)){yield vAH(L,$)?L:SJ(L,$.root,$.nodePath||u8);continue}yield*gAH(L,$)}}return[...A()]}function gAH(H,$){let{root:A,nodePath:L=u8,nested:D}=$,I=SO(L),E=$.cwd??L.resolve(),K=I.toFileDirURL(E),M=I.toFileDirURL(A,K),W=RO(H)?H.isGlobalPattern:void 0;H=!fAH(H)?{glob:H}:H;let X={...H,root:H.root??A},J=X.root,Z=H.glob;if(X.glob=dAH(H.glob),X.glob.startsWith(lL.cwd))X.glob=X.glob.replace(lL.cwd,""),X.root=lL.cwd;if(X.root.startsWith(lL.cwd)){let Y=X.root.replace(lL.cwd,"./"),G=I.toFileDirURL(Y,K);G.pathname=OO.normalize(G.pathname),X.root=I.urlToFilePathOrHref(G)}let Q=W??nAH(X.glob);return X.root=I.urlToFilePathOrHref(I.toFileDirURL(X.root,M)),bAH(X.glob,D).map((Y)=>({...X,glob:Y,rawGlob:Z,rawRoot:J,isGlobalPattern:Q}))}function SJ(H,$,A){let L=SO(A);H={...H},tAH(H,L);let D=L.toFileDirURL($);if($=L.urlToFilePathOrHref(D),H.root===$)return H;let I=L.toFileDirURL(H.root),E=L.relative(D,I);if(!E)return H;if(H.isGlobalPattern)return{...H,root:$};let K=L.relative(I,D),M=MX(E),W=MX(K);if(!M&&!W)return H;let X=H.glob.startsWith("!"),J=X?H.glob.slice(1):H.glob,Z=X?"!":"";if(M){let B=E;return{...H,glob:Z+OO.join(B,J),root:$}}let Q=mAH(J,KX(E),KX(K));return Q?{...H,glob:Z+Q,root:$}:H}function KX(H){return H.endsWith("/")?H:H+"/"}function MX(H){return!H||!(H===".."||H.startsWith("../")||H.startsWith("/"))}function mAH(H,$,A){if(!A||A==="/")return H;if($.startsWith("../")&&!A.startsWith("../")&&H.startsWith("**"))return H;$=KX($),A=KX(A);let L=$.split("/"),D=A.split("/");if(H.startsWith(A)&&$==="../".repeat(L.length-1))return H.slice(A.length);let I=L.findIndex((M)=>M!==".."),E=I<0?L.length:I,K=[...L.slice(E).filter((M)=>M),...H.split("/")];if(L.length=E,$.startsWith("../")&&D.length!==L.length+1)return $+(H.startsWith("/")?H.slice(1):H);for(let M=0;M<D.length&&M<K.length;++M){let W=D[M],X=K[M];if(!W||X==="**")return K.slice(M).join("/");if(W!==X&&X!=="*")break}return $+(H.startsWith("/")?H.slice(1):H)}function dAH(H){return H=pAH(H),H=iAH(H),H=lAH(H),H}function pAH(H){return H.replace(/(?<=^|\s)#.*/,"")}function lAH(H){let A=H.length-1;while(A>=0&&H[A]in cAH)--A;if(H[A]==="\\")++A;return++A,A?H.slice(0,A):""}function iAH(H){return H.trimStart()}function nAH(H){return kAH.test(H)}function aAH(H,$){if(H.startsWith(lL.cwd))return new URL($.normalizeFilePathForUrl(H.replace(lL.cwd,".")),$.cwd);return $.toFileDirURL(H)}function tAH(H,$){if(H.root.startsWith(lL.cwd))return H;return H.root=$.urlToFilePathOrHref(aAH(H.root,$)),H}function kO(H){let $={};return H.split("/").map((A)=>$[A]?`{${A},${A}}`:A).join("/")}var OO,kAH,yAH,lL,wO,cAH;var yO=y(()=>{qA();({posix:OO}=u8),kAH=/^!*[*]{2}/,yAH=new t0,lL={cwd:"${cwd}"},wO={suffixAny:"/**",suffixDir:"/**/*",prefixAny:"**/"};cAH={" ":!0,"\t":!0,"\n":!0,"\r":!0}});var g8=n((YuH,vO)=>{var fO={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:"(?=.)",QMARK:"[^/]",END_ANCHOR:"(?:\\/|$)",DOTS_SLASH:"\\.{1,2}(?:\\/|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|\\/)\\.{1,2}(?:\\/|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:\\/|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:\\/|$))",QMARK_NO_DOT:"[^.\\/]",STAR:"[^/]*?",START_ANCHOR:"(?:^|\\/)",SEP:"/"},oAH={...fO,SLASH_LITERAL:"[\\\\/]",QMARK:"[^\\\\/]",STAR:"[^\\\\/]*?",DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},sAH={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};vO.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:sAH,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(H){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${H.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(H){return H===!0?oAH:fO}}});var m8=n((ALH)=>{var{REGEX_BACKSLASH:rAH,REGEX_REMOVE_BACKSLASH:eAH,REGEX_SPECIAL_CHARS:HLH,REGEX_SPECIAL_CHARS_GLOBAL:$LH}=g8();ALH.isObject=(H)=>H!==null&&typeof H==="object"&&!Array.isArray(H);ALH.hasRegexChars=(H)=>HLH.test(H);ALH.isRegexChar=(H)=>H.length===1&&ALH.hasRegexChars(H);ALH.escapeRegex=(H)=>H.replace($LH,"\\$1");ALH.toPosixSlashes=(H)=>H.replace(rAH,"/");ALH.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let H=navigator.platform.toLowerCase();return H==="win32"||H==="windows"}if(typeof process<"u"&&process.platform)return process.platform==="win32";return!1};ALH.removeBackslashes=(H)=>{return H.replace(eAH,($)=>{return $==="\\"?"":$})};ALH.escapeLast=(H,$,A)=>{let L=H.lastIndexOf($,A);if(L===-1)return H;if(H[L-1]==="\\")return ALH.escapeLast(H,$,L-1);return`${H.slice(0,L)}\\${H.slice(L)}`};ALH.removePrefix=(H,$={})=>{let A=H;if(A.startsWith("./"))A=A.slice(2),$.prefix="./";return A};ALH.wrapOutput=(H,$={},A={})=>{let L=A.contains?"":"^",D=A.contains?"":"$",I=`${L}(?:${H})${D}`;if($.negated===!0)I=`(?:^(?!${I}).*$)`;return I};ALH.basename=(H,{windows:$}={})=>{let A=H.split($?/[\\/]/:"/"),L=A[A.length-1];if(L==="")return A[A.length-2];return L}});var iO=n((UuH,lO)=>{var uO=m8(),{CHAR_ASTERISK:xJ,CHAR_AT:BLH,CHAR_BACKWARD_SLASH:d8,CHAR_COMMA:JLH,CHAR_DOT:kJ,CHAR_EXCLAMATION_MARK:yJ,CHAR_FORWARD_SLASH:cO,CHAR_LEFT_CURLY_BRACE:fJ,CHAR_LEFT_PARENTHESES:vJ,CHAR_LEFT_SQUARE_BRACKET:ZLH,CHAR_PLUS:YLH,CHAR_QUESTION_MARK:gO,CHAR_RIGHT_CURLY_BRACE:GLH,CHAR_RIGHT_PARENTHESES:mO,CHAR_RIGHT_SQUARE_BRACKET:ULH}=g8(),dO=(H)=>{return H===cO||H===d8},pO=(H)=>{if(H.isPrefix!==!0)H.depth=H.isGlobstar?1/0:1},VLH=(H,$)=>{let A=$||{},L=H.length-1,D=A.parts===!0||A.scanToEnd===!0,I=[],E=[],K=[],M=H,W=-1,X=0,J=0,Z=!1,Q=!1,B=!1,Y=!1,G=!1,U=!1,V=!1,z=!1,P=!1,T=!1,q=0,O,N,x={value:"",depth:0,isGlob:!1},w=()=>W>=L,F=()=>M.charCodeAt(W+1),f=()=>{return O=N,M.charCodeAt(++W)};while(W<L){N=f();let h;if(N===d8){if(V=x.backslashes=!0,N=f(),N===fJ)U=!0;continue}if(U===!0||N===fJ){q++;while(w()!==!0&&(N=f())){if(N===d8){V=x.backslashes=!0,f();continue}if(N===fJ){q++;continue}if(U!==!0&&N===kJ&&(N=f())===kJ){if(Z=x.isBrace=!0,B=x.isGlob=!0,T=!0,D===!0)continue;break}if(U!==!0&&N===JLH){if(Z=x.isBrace=!0,B=x.isGlob=!0,T=!0,D===!0)continue;break}if(N===GLH){if(q--,q===0){U=!1,Z=x.isBrace=!0,T=!0;break}}}if(D===!0)continue;break}if(N===cO){if(I.push(W),E.push(x),x={value:"",depth:0,isGlob:!1},T===!0)continue;if(O===kJ&&W===X+1){X+=2;continue}J=W+1;continue}if(A.noext!==!0){if((N===YLH||N===BLH||N===xJ||N===gO||N===yJ)===!0&&F()===vJ){if(B=x.isGlob=!0,Y=x.isExtglob=!0,T=!0,N===yJ&&W===X)P=!0;if(D===!0){while(w()!==!0&&(N=f())){if(N===d8){V=x.backslashes=!0,N=f();continue}if(N===mO){B=x.isGlob=!0,T=!0;break}}continue}break}}if(N===xJ){if(O===xJ)G=x.isGlobstar=!0;if(B=x.isGlob=!0,T=!0,D===!0)continue;break}if(N===gO){if(B=x.isGlob=!0,T=!0,D===!0)continue;break}if(N===ZLH){while(w()!==!0&&(h=f())){if(h===d8){V=x.backslashes=!0,f();continue}if(h===ULH){Q=x.isBracket=!0,B=x.isGlob=!0,T=!0;break}}if(D===!0)continue;break}if(A.nonegate!==!0&&N===yJ&&W===X){z=x.negated=!0,X++;continue}if(A.noparen!==!0&&N===vJ){if(B=x.isGlob=!0,D===!0){while(w()!==!0&&(N=f())){if(N===vJ){V=x.backslashes=!0,N=f();continue}if(N===mO){T=!0;break}}continue}break}if(B===!0){if(T=!0,D===!0)continue;break}}if(A.noext===!0)Y=!1,B=!1;let j=M,S="",_="";if(X>0)S=M.slice(0,X),M=M.slice(X),J-=X;if(j&&B===!0&&J>0)j=M.slice(0,J),_=M.slice(J);else if(B===!0)j="",_=M;else j=M;if(j&&j!==""&&j!=="/"&&j!==M){if(dO(j.charCodeAt(j.length-1)))j=j.slice(0,-1)}if(A.unescape===!0){if(_)_=uO.removeBackslashes(_);if(j&&V===!0)j=uO.removeBackslashes(j)}let u={prefix:S,input:H,start:X,base:j,glob:_,isBrace:Z,isBracket:Q,isGlob:B,isExtglob:Y,isGlobstar:G,negated:z,negatedExtglob:P};if(A.tokens===!0){if(u.maxDepth=0,!dO(N))E.push(x);u.tokens=E}if(A.parts===!0||A.tokens===!0){let h;for(let d=0;d<I.length;d++){let l=h?h+1:X,k=I[d],p=H.slice(l,k);if(A.tokens){if(d===0&&X!==0)E[d].isPrefix=!0,E[d].value=S;else E[d].value=p;pO(E[d]),u.maxDepth+=E[d].depth}if(d!==0||p!=="")K.push(p);h=k}if(h&&h+1<H.length){let d=H.slice(h+1);if(K.push(d),A.tokens)E[E.length-1].value=d,pO(E[E.length-1]),u.maxDepth+=E[E.length-1].depth}u.slashes=I,u.parts=K}return u};lO.exports=VLH});var tO=n((VuH,aO)=>{var XX=g8(),NA=m8(),{MAX_LENGTH:WX,POSIX_REGEX_SOURCE:CLH,REGEX_NON_SPECIAL_CHARS:zLH,REGEX_SPECIAL_CHARS_BACKREF:PLH,REPLACEMENTS:nO}=XX,qLH=(H,$)=>{if(typeof $.expandRange==="function")return $.expandRange(...H,$);H.sort();let A=`[${H.join("-")}]`;try{new RegExp(A)}catch(L){return H.map((D)=>NA.escapeRegex(D)).join("..")}return A},c3=(H,$)=>{return`Missing ${H}: "${$}" - use "\\\\${$}" to match literal characters`},bJ=(H,$)=>{if(typeof H!=="string")throw TypeError("Expected a string");H=nO[H]||H;let A={...$},L=typeof A.maxLength==="number"?Math.min(WX,A.maxLength):WX,D=H.length;if(D>L)throw SyntaxError(`Input length: ${D}, exceeds maximum allowed length: ${L}`);let I={type:"bos",value:"",output:A.prepend||""},E=[I],K=A.capture?"":"?:",M=XX.globChars(A.windows),W=XX.extglobChars(M),{DOT_LITERAL:X,PLUS_LITERAL:J,SLASH_LITERAL:Z,ONE_CHAR:Q,DOTS_SLASH:B,NO_DOT:Y,NO_DOT_SLASH:G,NO_DOTS_SLASH:U,QMARK:V,QMARK_NO_DOT:z,STAR:P,START_ANCHOR:T}=M,q=(o)=>{return`(${K}(?:(?!${T}${o.dot?B:X}).)*?)`},O=A.dot?"":Y,N=A.dot?V:z,x=A.bash===!0?q(A):P;if(A.capture)x=`(${x})`;if(typeof A.noext==="boolean")A.noextglob=A.noext;let w={input:H,index:-1,start:0,dot:A.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:E};H=NA.removePrefix(H,w),D=H.length;let F=[],f=[],j=[],S=I,_,u=()=>w.index===D-1,h=w.peek=(o=1)=>H[w.index+o],d=w.advance=()=>H[++w.index]||"",l=()=>H.slice(w.index+1),k=(o="",JH=0)=>{w.consumed+=o,w.index+=JH},p=(o)=>{w.output+=o.output!=null?o.output:o.value,k(o.value)},LH=()=>{let o=1;while(h()==="!"&&(h(2)!=="("||h(3)==="?"))d(),w.start++,o++;if(o%2===0)return!1;return w.negated=!0,w.start++,!0},IH=(o)=>{w[o]++,j.push(o)},HH=(o)=>{w[o]--,j.pop()},e=(o)=>{if(S.type==="globstar"){let JH=w.braces>0&&(o.type==="comma"||o.type==="brace"),t=o.extglob===!0||F.length&&(o.type==="pipe"||o.type==="paren");if(o.type!=="slash"&&o.type!=="paren"&&!JH&&!t)w.output=w.output.slice(0,-S.output.length),S.type="star",S.value="*",S.output=x,w.output+=S.output}if(F.length&&o.type!=="paren")F[F.length-1].inner+=o.value;if(o.value||o.output)p(o);if(S&&S.type==="text"&&o.type==="text"){S.output=(S.output||S.value)+o.value,S.value+=o.value;return}o.prev=S,E.push(o),S=o},_H=(o,JH)=>{let t={...W[JH],conditions:1,inner:""};t.prev=S,t.parens=w.parens,t.output=w.output;let BH=(A.capture?"(":"")+t.open;IH("parens"),e({type:o,value:JH,output:w.output?"":Q}),e({type:"paren",extglob:!0,value:d(),output:BH}),F.push(t)},SH=(o)=>{let JH=o.close+(A.capture?")":""),t;if(o.type==="negate"){let BH=x;if(o.inner&&o.inner.length>1&&o.inner.includes("/"))BH=q(A);if(BH!==x||u()||/^\)+$/.test(l()))JH=o.close=`)$))${BH}`;if(o.inner.includes("*")&&(t=l())&&/^\.[^\\/.]+$/.test(t)){let qH=bJ(t,{...$,fastpaths:!1}).output;JH=o.close=`)${qH})${BH})`}if(o.prev.type==="bos")w.negatedExtglob=!0}e({type:"paren",extglob:!0,value:_,output:JH}),HH("parens")};if(A.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(H)){let o=!1,JH=H.replace(PLH,(t,BH,qH,kH,$H,wH)=>{if(kH==="\\")return o=!0,t;if(kH==="?"){if(BH)return BH+kH+($H?V.repeat($H.length):"");if(wH===0)return N+($H?V.repeat($H.length):"");return V.repeat(qH.length)}if(kH===".")return X.repeat(qH.length);if(kH==="*"){if(BH)return BH+kH+($H?x:"");return x}return BH?t:`\\${t}`});if(o===!0)if(A.unescape===!0)JH=JH.replace(/\\/g,"");else JH=JH.replace(/\\+/g,(t)=>{return t.length%2===0?"\\\\":t?"\\":""});if(JH===H&&A.contains===!0)return w.output=H,w;return w.output=NA.wrapOutput(JH,w,$),w}while(!u()){if(_=d(),_==="\x00")continue;if(_==="\\"){let t=h();if(t==="/"&&A.bash!==!0)continue;if(t==="."||t===";")continue;if(!t){_+="\\",e({type:"text",value:_});continue}let BH=/^\\+/.exec(l()),qH=0;if(BH&&BH[0].length>2){if(qH=BH[0].length,w.index+=qH,qH%2!==0)_+="\\"}if(A.unescape===!0)_=d();else _+=d();if(w.brackets===0){e({type:"text",value:_});continue}}if(w.brackets>0&&(_!=="]"||S.value==="["||S.value==="[^")){if(A.posix!==!1&&_===":"){let t=S.value.slice(1);if(t.includes("[")){if(S.posix=!0,t.includes(":")){let BH=S.value.lastIndexOf("["),qH=S.value.slice(0,BH),kH=S.value.slice(BH+2),$H=CLH[kH];if($H){if(S.value=qH+$H,w.backtrack=!0,d(),!I.output&&E.indexOf(S)===1)I.output=Q;continue}}}}if(_==="["&&h()!==":"||_==="-"&&h()==="]")_=`\\${_}`;if(_==="]"&&(S.value==="["||S.value==="[^"))_=`\\${_}`;if(A.posix===!0&&_==="!"&&S.value==="[")_="^";S.value+=_,p({value:_});continue}if(w.quotes===1&&_!=='"'){_=NA.escapeRegex(_),S.value+=_,p({value:_});continue}if(_==='"'){if(w.quotes=w.quotes===1?0:1,A.keepQuotes===!0)e({type:"text",value:_});continue}if(_==="("){IH("parens"),e({type:"paren",value:_});continue}if(_===")"){if(w.parens===0&&A.strictBrackets===!0)throw SyntaxError(c3("opening","("));let t=F[F.length-1];if(t&&w.parens===t.parens+1){SH(F.pop());continue}e({type:"paren",value:_,output:w.parens?")":"\\)"}),HH("parens");continue}if(_==="["){if(A.nobracket===!0||!l().includes("]")){if(A.nobracket!==!0&&A.strictBrackets===!0)throw SyntaxError(c3("closing","]"));_=`\\${_}`}else IH("brackets");e({type:"bracket",value:_});continue}if(_==="]"){if(A.nobracket===!0||S&&S.type==="bracket"&&S.value.length===1){e({type:"text",value:_,output:`\\${_}`});continue}if(w.brackets===0){if(A.strictBrackets===!0)throw SyntaxError(c3("opening","["));e({type:"text",value:_,output:`\\${_}`});continue}HH("brackets");let t=S.value.slice(1);if(S.posix!==!0&&t[0]==="^"&&!t.includes("/"))_=`/${_}`;if(S.value+=_,p({value:_}),A.literalBrackets===!1||NA.hasRegexChars(t))continue;let BH=NA.escapeRegex(S.value);if(w.output=w.output.slice(0,-S.value.length),A.literalBrackets===!0){w.output+=BH,S.value=BH;continue}S.value=`(${K}${BH}|${S.value})`,w.output+=S.value;continue}if(_==="{"&&A.nobrace!==!0){IH("braces");let t={type:"brace",value:_,output:"(",outputIndex:w.output.length,tokensIndex:w.tokens.length};f.push(t),e(t);continue}if(_==="}"){let t=f[f.length-1];if(A.nobrace===!0||!t){e({type:"text",value:_,output:_});continue}let BH=")";if(t.dots===!0){let qH=E.slice(),kH=[];for(let $H=qH.length-1;$H>=0;$H--){if(E.pop(),qH[$H].type==="brace")break;if(qH[$H].type!=="dots")kH.unshift(qH[$H].value)}BH=qLH(kH,A),w.backtrack=!0}if(t.comma!==!0&&t.dots!==!0){let qH=w.output.slice(0,t.outputIndex),kH=w.tokens.slice(t.tokensIndex);t.value=t.output="\\{",_=BH="\\}",w.output=qH;for(let $H of kH)w.output+=$H.output||$H.value}e({type:"brace",value:_,output:BH}),HH("braces"),f.pop();continue}if(_==="|"){if(F.length>0)F[F.length-1].conditions++;e({type:"text",value:_});continue}if(_===","){let t=_,BH=f[f.length-1];if(BH&&j[j.length-1]==="braces")BH.comma=!0,t="|";e({type:"comma",value:_,output:t});continue}if(_==="/"){if(S.type==="dot"&&w.index===w.start+1){w.start=w.index+1,w.consumed="",w.output="",E.pop(),S=I;continue}e({type:"slash",value:_,output:Z});continue}if(_==="."){if(w.braces>0&&S.type==="dot"){if(S.value===".")S.output=X;let t=f[f.length-1];S.type="dots",S.output+=_,S.value+=_,t.dots=!0;continue}if(w.braces+w.parens===0&&S.type!=="bos"&&S.type!=="slash"){e({type:"text",value:_,output:X});continue}e({type:"dot",value:_,output:X});continue}if(_==="?"){if(!(S&&S.value==="(")&&A.noextglob!==!0&&h()==="("&&h(2)!=="?"){_H("qmark",_);continue}if(S&&S.type==="paren"){let BH=h(),qH=_;if(S.value==="("&&!/[!=<:]/.test(BH)||BH==="<"&&!/<([!=]|\w+>)/.test(l()))qH=`\\${_}`;e({type:"text",value:_,output:qH});continue}if(A.dot!==!0&&(S.type==="slash"||S.type==="bos")){e({type:"qmark",value:_,output:z});continue}e({type:"qmark",value:_,output:V});continue}if(_==="!"){if(A.noextglob!==!0&&h()==="("){if(h(2)!=="?"||!/[!=<:]/.test(h(3))){_H("negate",_);continue}}if(A.nonegate!==!0&&w.index===0){LH();continue}}if(_==="+"){if(A.noextglob!==!0&&h()==="("&&h(2)!=="?"){_H("plus",_);continue}if(S&&S.value==="("||A.regex===!1){e({type:"plus",value:_,output:J});continue}if(S&&(S.type==="bracket"||S.type==="paren"||S.type==="brace")||w.parens>0){e({type:"plus",value:_});continue}e({type:"plus",value:J});continue}if(_==="@"){if(A.noextglob!==!0&&h()==="("&&h(2)!=="?"){e({type:"at",extglob:!0,value:_,output:""});continue}e({type:"text",value:_});continue}if(_!=="*"){if(_==="$"||_==="^")_=`\\${_}`;let t=zLH.exec(l());if(t)_+=t[0],w.index+=t[0].length;e({type:"text",value:_});continue}if(S&&(S.type==="globstar"||S.star===!0)){S.type="star",S.star=!0,S.value+=_,S.output=x,w.backtrack=!0,w.globstar=!0,k(_);continue}let o=l();if(A.noextglob!==!0&&/^\([^?]/.test(o)){_H("star",_);continue}if(S.type==="star"){if(A.noglobstar===!0){k(_);continue}let t=S.prev,BH=t.prev,qH=t.type==="slash"||t.type==="bos",kH=BH&&(BH.type==="star"||BH.type==="globstar");if(A.bash===!0&&(!qH||o[0]&&o[0]!=="/")){e({type:"star",value:_,output:""});continue}let $H=w.braces>0&&(t.type==="comma"||t.type==="brace"),wH=F.length&&(t.type==="pipe"||t.type==="paren");if(!qH&&t.type!=="paren"&&!$H&&!wH){e({type:"star",value:_,output:""});continue}while(o.slice(0,3)==="/**"){let NH=H[w.index+4];if(NH&&NH!=="/")break;o=o.slice(3),k("/**",3)}if(t.type==="bos"&&u()){S.type="globstar",S.value+=_,S.output=q(A),w.output=S.output,w.globstar=!0,k(_);continue}if(t.type==="slash"&&t.prev.type!=="bos"&&!kH&&u()){w.output=w.output.slice(0,-(t.output+S.output).length),t.output=`(?:${t.output}`,S.type="globstar",S.output=q(A)+(A.strictSlashes?")":"|$)"),S.value+=_,w.globstar=!0,w.output+=t.output+S.output,k(_);continue}if(t.type==="slash"&&t.prev.type!=="bos"&&o[0]==="/"){let NH=o[1]!==void 0?"|$":"";w.output=w.output.slice(0,-(t.output+S.output).length),t.output=`(?:${t.output}`,S.type="globstar",S.output=`${q(A)}${Z}|${Z}${NH})`,S.value+=_,w.output+=t.output+S.output,w.globstar=!0,k(_+d()),e({type:"slash",value:"/",output:""});continue}if(t.type==="bos"&&o[0]==="/"){S.type="globstar",S.value+=_,S.output=`(?:^|${Z}|${q(A)}${Z})`,w.output=S.output,w.globstar=!0,k(_+d()),e({type:"slash",value:"/",output:""});continue}w.output=w.output.slice(0,-S.output.length),S.type="globstar",S.output=q(A),S.value+=_,w.output+=S.output,w.globstar=!0,k(_);continue}let JH={type:"star",value:_,output:x};if(A.bash===!0){if(JH.output=".*?",S.type==="bos"||S.type==="slash")JH.output=O+JH.output;e(JH);continue}if(S&&(S.type==="bracket"||S.type==="paren")&&A.regex===!0){JH.output=_,e(JH);continue}if(w.index===w.start||S.type==="slash"||S.type==="dot"){if(S.type==="dot")w.output+=G,S.output+=G;else if(A.dot===!0)w.output+=U,S.output+=U;else w.output+=O,S.output+=O;if(h()!=="*")w.output+=Q,S.output+=Q}e(JH)}while(w.brackets>0){if(A.strictBrackets===!0)throw SyntaxError(c3("closing","]"));w.output=NA.escapeLast(w.output,"["),HH("brackets")}while(w.parens>0){if(A.strictBrackets===!0)throw SyntaxError(c3("closing",")"));w.output=NA.escapeLast(w.output,"("),HH("parens")}while(w.braces>0){if(A.strictBrackets===!0)throw SyntaxError(c3("closing","}"));w.output=NA.escapeLast(w.output,"{"),HH("braces")}if(A.strictSlashes!==!0&&(S.type==="star"||S.type==="bracket"))e({type:"maybe_slash",value:"",output:`${Z}?`});if(w.backtrack===!0){w.output="";for(let o of w.tokens)if(w.output+=o.output!=null?o.output:o.value,o.suffix)w.output+=o.suffix}return w};bJ.fastpaths=(H,$)=>{let A={...$},L=typeof A.maxLength==="number"?Math.min(WX,A.maxLength):WX,D=H.length;if(D>L)throw SyntaxError(`Input length: ${D}, exceeds maximum allowed length: ${L}`);H=nO[H]||H;let{DOT_LITERAL:I,SLASH_LITERAL:E,ONE_CHAR:K,DOTS_SLASH:M,NO_DOT:W,NO_DOTS:X,NO_DOTS_SLASH:J,STAR:Z,START_ANCHOR:Q}=XX.globChars(A.windows),B=A.dot?X:W,Y=A.dot?J:W,G=A.capture?"":"?:",U={negated:!1,prefix:""},V=A.bash===!0?".*?":Z;if(A.capture)V=`(${V})`;let z=(O)=>{if(O.noglobstar===!0)return V;return`(${G}(?:(?!${Q}${O.dot?M:I}).)*?)`},P=(O)=>{switch(O){case"*":return`${B}${K}${V}`;case".*":return`${I}${K}${V}`;case"*.*":return`${B}${V}${I}${K}${V}`;case"*/*":return`${B}${V}${E}${K}${Y}${V}`;case"**":return B+z(A);case"**/*":return`(?:${B}${z(A)}${E})?${Y}${K}${V}`;case"**/*.*":return`(?:${B}${z(A)}${E})?${Y}${V}${I}${K}${V}`;case"**/.*":return`(?:${B}${z(A)}${E})?${I}${K}${V}`;default:{let N=/^(.*?)\.(\w+)$/.exec(O);if(!N)return;let x=P(N[1]);if(!x)return;return x+I+N[2]}}},T=NA.removePrefix(H,U),q=P(T);if(q&&A.strictSlashes!==!0)q+=`${E}?`;return q};aO.exports=bJ});var rO=n((CuH,sO)=>{var TLH=iO(),hJ=tO(),oO=m8(),_LH=g8(),NLH=(H)=>H&&typeof H==="object"&&!Array.isArray(H),lH=(H,$,A=!1)=>{if(Array.isArray(H)){let X=H.map((Z)=>lH(Z,$,A));return(Z)=>{for(let Q of X){let B=Q(Z);if(B)return B}return!1}}let L=NLH(H)&&H.tokens&&H.input;if(H===""||typeof H!=="string"&&!L)throw TypeError("Expected pattern to be a non-empty string");let D=$||{},I=D.windows,E=L?lH.compileRe(H,$):lH.makeRe(H,$,!1,!0),K=E.state;delete E.state;let M=()=>!1;if(D.ignore){let X={...$,ignore:null,onMatch:null,onResult:null};M=lH(D.ignore,X,A)}let W=(X,J=!1)=>{let{isMatch:Z,match:Q,output:B}=lH.test(X,E,$,{glob:H,posix:I}),Y={glob:H,state:K,regex:E,posix:I,input:X,output:B,match:Q,isMatch:Z};if(typeof D.onResult==="function")D.onResult(Y);if(Z===!1)return Y.isMatch=!1,J?Y:!1;if(M(X)){if(typeof D.onIgnore==="function")D.onIgnore(Y);return Y.isMatch=!1,J?Y:!1}if(typeof D.onMatch==="function")D.onMatch(Y);return J?Y:!0};if(A)W.state=K;return W};lH.test=(H,$,A,{glob:L,posix:D}={})=>{if(typeof H!=="string")throw TypeError("Expected input to be a string");if(H==="")return{isMatch:!1,output:""};let I=A||{},E=I.format||(D?oO.toPosixSlashes:null),K=H===L,M=K&&E?E(H):H;if(K===!1)M=E?E(H):H,K=M===L;if(K===!1||I.capture===!0)if(I.matchBase===!0||I.basename===!0)K=lH.matchBase(H,$,A,D);else K=$.exec(M);return{isMatch:Boolean(K),match:K,output:M}};lH.matchBase=(H,$,A)=>{return($ instanceof RegExp?$:lH.makeRe($,A)).test(oO.basename(H))};lH.isMatch=(H,$,A)=>lH($,A)(H);lH.parse=(H,$)=>{if(Array.isArray(H))return H.map((A)=>lH.parse(A,$));return hJ(H,{...$,fastpaths:!1})};lH.scan=(H,$)=>TLH(H,$);lH.compileRe=(H,$,A=!1,L=!1)=>{if(A===!0)return H.output;let D=$||{},I=D.contains?"":"^",E=D.contains?"":"$",K=`${I}(?:${H.output})${E}`;if(H&&H.negated===!0)K=`^(?!${K}).*$`;let M=lH.toRegex(K,$);if(L===!0)M.state=H;return M};lH.makeRe=(H,$={},A=!1,L=!1)=>{if(!H||typeof H!=="string")throw TypeError("Expected a non-empty string");let D={negated:!1,fastpaths:!0};if($.fastpaths!==!1&&(H[0]==="."||H[0]==="*"))D.output=hJ.fastpaths(H,$);if(!D.output)D=hJ(H,$);return lH.compileRe(D,$,A,L)};lH.toRegex=(H,$)=>{try{let A=$||{};return new RegExp(H,A.flags||(A.nocase?"i":""))}catch(A){if($&&$.debug===!0)throw A;return/$^/}};lH.constants=_LH;sO.exports=lH});var Aw=n((zuH,$w)=>{var eO=rO(),FLH=m8();function Hw(H,$,A=!1){if($&&($.windows===null||$.windows===void 0))$={...$,windows:FLH.isWindows()};return eO(H,$,A)}Object.assign(Hw,eO);$w.exports=Hw});import*as OLH from"node:path";class p8{matchEx;path;patterns;patternsNormalizedToRoot;root;dot;options;id;constructor(H,$,A){this.id=RLH++;let L=typeof $==="string"||$ instanceof URL?{root:$.toString()}:$??{},D=L.mode??"exclude",I=D!=="include",E=L.nodePath??A??OLH;this.path=E;let K=L.cwd??E.resolve(),M=L.dot??I,W=L.nested??I,X=L.nobrace,J=L.root??E.resolve(),Z=new t0({path:E}),Q=Z.toFileDirURL(J),B=Z.urlToFilePathOrHref(Q);this.options={root:B,dot:M,nodePath:E,nested:W,mode:D,nobrace:X,cwd:K},H=Array.isArray(H)?H:typeof H==="string"?H.split(/\r?\n/g):[H];let Y=xO(H,this.options);this.patternsNormalizedToRoot=Y.map((G)=>SJ(G,B,E)).filter((G)=>Z.relative(Z.toFileDirURL(G.root),Q)===""),this.patterns=Y,this.root=B,this.dot=M,this.matchEx=jLH(this.id,this.patterns,this.options)}match(H){return this.matchEx(H).matched}}function jLH(H,$,A){let{nodePath:L,dot:D,nobrace:I}=A,E=new t0({path:L}),K={dot:D,nobrace:I},M=wO.suffixDir,W=$.map((B,Y)=>({pattern:B,index:Y})).filter((B)=>!!B.pattern.glob).filter((B)=>!B.pattern.glob.startsWith("#")).map(({pattern:B,index:Y})=>{let G=B.glob.match(/^!/),U=B.glob.replace(/^!/,""),V=G&&G[0].length&1&&!0||!1,z=Lw.default.makeRe(kO(U),K),P=B.glob.endsWith(M)?(T)=>{return z.test(T)||T.endsWith("/")&&z.test(T+" ")}:(T)=>{return z.test(T)};return{pattern:B,index:Y,isNeg:V,fn:P,reg:z}}),X=W.filter((B)=>B.isNeg),J=W.filter((B)=>!B.isNeg),Z=new Map;return(B)=>{let Y=E.toFileURL(B),G=E.relative(new URL("file:///"),Y),U=new URL("placeHolder://"),V="";function z(O){let N=Z.get(O);if(N)return N;let x=E.toFileDirURL(O);return Z.set(O,x),x}function P(O){if(O.href!==U.href)U=O,V=E.relative(O,Y);return V}function T(O,N){for(let x of O){let w=x.pattern,F=w.root,f=z(F),j=!w.isGlobalPattern,S=G;if(j){let _=P(f);if(!MX(_))continue;S=_}if(x.fn(S))return{matched:N,glob:w.glob,root:F,pattern:w,index:x.index,isNeg:x.isNeg}}}let q=T(X,!1)||T(J,!0)||{matched:!1};return wLH&&SLH(H,B,q),q}}function SLH(H,$,A){console.warn("%s;%d;%s",$,H,JSON.stringify(A.matched))}var Lw,wLH=!1,RLH=0;var Dw=y(()=>{qA();yO();Lw=kA(Aw(),1)});var Iw=()=>{};var Ew=y(()=>{Dw();Iw()});var Kw=()=>{};var QX="0.1",Mw="0.2",uJ="0.2",c8="CSPELL_GLOB_ROOT",BX="@cspell/cspell-bundled-dicts/cspell-default.json";class l3{map=new l$;_toDispose;constructor(){this._toDispose=tA(()=>{this.clear()})}get(H,$,A){return this.map.get(H,()=>new l$).get($,()=>A(H,$))}clear(){this.map.clear()}dispose(){this.map.dispose(),this._toDispose?.dispose(),this._toDispose=void 0}stats(){return this.map.stats()}}var gJ=y(()=>{oE()});function iL(H,$){if(!Array.isArray(H))return Array.isArray($)?$:void 0;if(!Array.isArray($))return H;if(!$.length)return H;if(!H.length)return $;let A=Xw.get(H,$,(L,D)=>[...new Set([...L,...D])]);return Object.freeze(H),Object.freeze($),Object.freeze(A),A}function JX(H,$){if(!Array.isArray(H))return Array.isArray($)?$:void 0;if(!Array.isArray($))return H;if(!H.length)return $;if(!$.length)return H;let A=Ww.get(H,$,(L,D)=>[...L,...D]);return Object.freeze(H),Object.freeze($),Object.freeze(A),A}function mJ(){return{cacheMergeListUnique:Xw.stats(),cacheMergeLists:Ww.stats()}}var Xw,Ww;var dJ=y(()=>{gJ();Xw=new l3,Ww=new l3});function zw(H,$="gimu",A="g"){if(H instanceof RegExp)return H;try{let[,L,D]=[...H.match(kLH)||["",H.trim(),$],A];if(L){let I=D.includes("x")?yLH(L):L,E=[...new Set(A+D)].join("").replaceAll(/[^gimuy]/g,"");return new RegExp(I,E)}}catch{}return}function yLH(H){function $(M){if(H[M.idx]!=="\\")return;let X=H[++M.idx];if(M.idx++,X==="#")return M.result+="#",M;if(!(X in Qw))return M.result+="\\"+X,M;if(M.result+=X,X==="\r"&&H[M.idx]===`
|
|
325
|
+
`)M.result+=`
|
|
326
|
+
`,M.idx++;return M}function A(M){let W=H[M.idx];if(W!=="[")return;M.result+=W,M.idx++;let X=0;while(M.idx<H.length){let J=H[M.idx];if(M.result+=J,M.idx++,J==="]"&&!(X&1))break;X=J==="\\"?X+1:0}return M}function L(M){if(!(H[M.idx]in Qw))return;return M.idx++,M}function D(M){if(H[M.idx]!=="#")return;while(M.idx<H.length&&H[M.idx]!==`
|
|
327
|
+
`)M.idx++;return M}function I(M){let W=H[M.idx++];return M.result+=W,M}let E=[$,A,L,D,I],K={idx:0,result:""};while(K.idx<H.length)for(let M of E)if(M(K))break;return K.result}var Bw,Jw,pJ,Zw,ZX,i3,Yw,kLH,Gw,Uw,Vw,Cw,Qw;var l8=y(()=>{Bw=/(\p{Ll}\p{M}?)(\p{Lu})/gu,Jw=/(\p{Lu}\p{M}?)((\p{Lu}\p{M}?)\p{Ll})/gu,pJ=/(?<=\p{Ll}\p{M}?)(?=\p{Lu})|(?<=\p{Lu}\p{M}?)(?=\p{Lu}\p{M}?\p{Ll})(?!\p{Lu}\p{M}?(?:s|ing|ies|es|ings|ed|ning)(?!\p{Ll}))/gu,Zw=/\p{L}\p{M}?(?:(?:\\?['’])?\p{L}\p{M}?)*/gu,ZX=/[\p{L}\w'’`.+-](?:(?:\\(?=[']))?[\p{L}\p{M}\w'’`.+-])*/gu,i3=/[\p{sc=Hiragana}\p{sc=Han}\p{sc=Katakana}\u30A0-\u30FF\p{sc=Hangul}]/gu,Yw=/[-+_’'`.\s]/g,kLH=/^\s*\/([\s\S]*?)\/([gimuxy]*)\s*$/,Gw=/(?<=\\)[anrvtbf]/gi,Uw=/(?<=(?:^|(?!\p{M})\P{L})(?:\p{L}\p{M}?)?)[']/gu,Vw=/(?<=(?:\p{Lu}\p{M}?){2})['’]?(?:s|d|ings?|ies|e[ds]?|ning|th|nth)(?!\p{Ll})/gu,Cw=/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][-+]?\d+)?$/;Qw={" ":!0,"\n":!0,"\r":!0,"\t":!0}});function cJ(H=fLH,$=vLH){return bLH.get(H,$,hLH)}function hLH(H,$){let A=new Map($.map((M)=>[M.name.toLowerCase(),M.pattern])),L=new Set;function D(M){if(L.has(M))return;return L.add(M),A.get(M.toString().toLowerCase())||M}function*I(M){for(let W of M)if(Array.isArray(W))yield*I(W.map(D).filter(c$));else yield W}let E=H.map(D).filter(c$),K=[...I(E)].map(uLH).filter(c$);return Object.freeze(H),Object.freeze($),Object.freeze(K),K}function uLH(H){return H instanceof RegExp?new RegExp(H):zw(H,"gim","g")}var fLH,vLH,bLH;var Pw=y(()=>{l8();z$();gJ();fLH=[],vLH=[],bLH=new l3});class lJ{#H;#$;#A;#L;constructor(){this.#A=process.cwd(),this.#L=J$(this.#A),this.#H=this.#A,this.#$=this.#L}resolveUrl(H){if(H=H||this.#A,H===this.#H)return this.#$;if(H===this.#A)return this.#L;return this.#H=H,this.#$=PH(H),this.#$}reset(H=process.cwd()){this.#A=H,this.#L=J$(this.#A)}}var qw=y(()=>{qA()});import Tw from"node:assert";function gLH(H,$){let A=v3(ww,H,()=>new WeakMap);return v3(A,$,()=>[...H,...$])}function i8(H,$){if(!Array.isArray(H)||!H.length)return Array.isArray($)?$.length?$:Ow:void 0;if(!Array.isArray($)||!$.length)return H;return gLH(H,$)}function _w(H,$){if(!H||typeof H!=="object")return!$||typeof $!=="object"?void 0:$;if(!$||typeof $!=="object")return H;return{...H,...$}}function mLH(H=[],$=[]){let A=$.filter((L)=>!!L);if(A.length)return A;return H}function gH(H,...$){let A=$.filter(c$).reduce(dLH,nL(H));return K$(A)}function Nw(H){return!H||Object.keys(H).length===0}function dLH(H,$){let A=Rw.get(H,()=>new WeakMap);return v3(A,$,()=>pLH(H,$))}function pLH(H,$){let A=nL(H),L=nL($);if(H===$)return A;if(Nw($))return A;if(Nw(H))return L;if(cLH(A,L))return L;if(lLH(A,L))return A;let D=fw(A.includeRegExpList,L.includeRegExpList),I=D?.length?{includeRegExpList:D}:{},E=tLH(A.version,L.version);return wM({...A,...L,...I,...{name:void 0,id:void 0,description:void 0,globRoot:void 0,import:void 0,__importRef:void 0},version:E,words:i8(A.words,L.words),userWords:i8(A.userWords,L.userWords),flagWords:i8(A.flagWords,L.flagWords),ignoreWords:i8(A.ignoreWords,L.ignoreWords),suggestWords:i8(A.suggestWords,L.suggestWords),enabledLanguageIds:mLH(A.enabledLanguageIds,L.enabledLanguageIds),enableFiletypes:JX(A.enableFiletypes,L.enableFiletypes),enabledFileTypes:_w(A.enabledFileTypes,L.enabledFileTypes),ignoreRegExpList:iL(A.ignoreRegExpList,L.ignoreRegExpList),patterns:iL(A.patterns,L.patterns),dictionaryDefinitions:iL(A.dictionaryDefinitions,L.dictionaryDefinitions),dictionaries:iL(A.dictionaries,L.dictionaries),noSuggestDictionaries:iL(A.noSuggestDictionaries,L.noSuggestDictionaries),languageSettings:JX(A.languageSettings,L.languageSettings),enabled:L.enabled!==void 0?L.enabled:A.enabled,files:iL(A.files,L.files),ignorePaths:Fw(A.ignorePaths,L.ignorePaths,E),overrides:Fw(A.overrides,L.overrides,E),features:_w(A.features,L.features),source:aLH(A,L),plugins:JX(A.plugins,L.plugins),__imports:oLH(A,L)})}function Fw(H,$,A){if(A===QX)return fw(H,$);return iL(H,$)}function cLH(H,$){return iJ($,H,0)}function lLH(H,$){return iJ(H,$,1)}function iJ(H,$,A){let L=H.source?.sources;if(!L)return!1;let D=A?L.length-1:0,I=L[D];return I===$||I&&iJ(I,$,A)||!1}function fw(H,$){if($?.length)return $;return H||$}function n3(H){return iLH(nL(H))}function iLH(H){let $={...H,finalized:!0,ignoreRegExpList:cJ(H.ignoreRegExpList,H.patterns),includeRegExpList:cJ(H.includeRegExpList,H.patterns),parserFn:rLH(H)};return $.name="Finalized "+($.name||""),$.source={name:H.name||"src",sources:[H]},$}function nL(H){if(H===void 0)return;if(o_(H))return H;return jw.get(H,nLH)}function nLH(H){let{dictionaryDefinitions:$,...A}=H,L=$&&R8($,H.source?.filename&&n$(H.source?.filename)||sLH()),D=L?{...A,dictionaryDefinitions:L}:A;return wM(D)}function aLH(H,$){return{name:"merged",sources:[H,$]}}function tLH(H,$){if(H===void 0||H===null)return $;if($===void 0||$===null)return H;return H>$?H:$}function nJ(H){let $=new Set,A=[];function L(D){if(!D||$.has(D))return;if($.add(D),!D.source?.sources?.length){A.push(D);return}D.source.sources.forEach(L)}return L(H),A}function oLH(H,$={}){let A=new Map(H.__imports||[]);if(H.__importRef)A.set(H.__importRef.filename,H.__importRef);if($.__importRef)A.set($.__importRef.filename,$.__importRef);let L=$.__imports?.values()||[];for(let D of L)A.set(D.filename,D);return A.size?A:void 0}function sLH(){return kw.resolveUrl(yw)}function rLH(H){if(!H.parser)return;if(typeof H.parser==="function")return H.parser;let $=H.parser;Tw(typeof $==="string");let L=$0H(H.plugins).get($);return Tw(L,`Parser "${$}" not found.`),L}function*eLH(H){for(let $ of H){if(!$.parsers)continue;for(let A of $.parsers)yield[A.name,A]}}function H0H(H){return new Map(eLH(H))}function $0H(H){if(!H||!H.length)return xw;return Sw.get(H,H0H)}var Ow,ww,Rw,jw,Sw,xw,kw,yw;var LD=y(()=>{oE();n0();_A();z$();$X();dJ();Pw();qw();dJ();Ow=[];Object.freeze(Ow);ww=new l$,Rw=new l$,jw=new l$,Sw=new l$,xw=new Map,kw=new lJ,yw=process.env[c8];tA(()=>{Sw.clear(),xw.clear(),ww.clear(),Rw.clear(),jw.clear(),kw.reset(),yw=process.env[c8]})});function FA(H,$,A){return new vw(H,$,A)}class vw{name;onEnd;timeNowFn;_start=performance.now();_elapsed=void 0;_running=!0;constructor(H,$,A=performance.now){this.name=H,this.onEnd=$,this.timeNowFn=A}get startTime(){return this._start}get elapsed(){return this._elapsed??performance.now()-this._start}end(){if(!this._running)return;this._running=!1;let H=performance.now();this._elapsed=H-this._start,this.onEnd?.(this._elapsed,this.name)}start(){this._start=performance.now(),this._running=!0}}var aJ=()=>{};function YX(H){if(!H||Array.isArray(H)&&!H.length)return bw(L0H);return typeof H==="string"?D0H(H):bw(H)}function D0H(H){let $=tJ.get(H);if($)return $;let A=new p8(H);return tJ.set(H,A),A}function bw(H){let $=oJ.get(H);if($)return $;let A=new p8(H);return oJ.set(H,A),A}var tJ,oJ,L0H;var sJ=y(()=>{Ew();oE();tJ=new Map,oJ=new WeakMap;tA(()=>{oJ=new WeakMap,tJ.clear()});L0H=[]});function hw(H,$){return YX($).match(H)}var uw=y(()=>{sJ()});function rJ(H,$){let A=nL(H);return(A.overrides||[]).filter((I)=>hw($,I.filename)).reduce((I,E)=>gH(I,E),A)}var gw=y(()=>{uw();LD()});class KL{url;constructor(H){this.url=H}get readonly(){return this.settings.readonly||this.url.protocol!=="file:"}get virtual(){return!1}get remote(){return this.url.protocol!=="file:"}}function I0H(H,$){H.push(...$),H.sort();for(let A=1;A<H.length;++A)if(H[A]===H[A-1])H.splice(A,1),--A}function a3(H){return H instanceof KL||!!H&&typeof H==="object"&&"url"in H&&H.url instanceof URL&&"settings"in H&&!!H.settings&&typeof H.settings==="object"}var GX,IA;var ML=y(()=>{GX=class GX extends KL{};IA=class IA extends KL{url;settings;constructor(H,$){super(H);this.url=H,this.settings=$}setSchema(H){return this}removeAllComments(){if(this.readonly)throw Error(`Config file is readonly: ${this.url.href}`);return this}addWords(H){if(this.readonly)throw Error(`Config file is readonly: ${this.url.href}`);let $=this.settings.words||[];return this.settings.words=$,I0H($,H),this}setComment(H,$,A){if(this.readonly)throw Error(`Config file is readonly: ${this.url.href}`);return this}setValue(H,$){if(this.readonly)throw Error(`Config file is readonly: ${this.url.href}`);return this.settings[H]=$,this}}});var aL;var mw=y(()=>{ML();aL=class aL extends IA{url;settings;constructor(H,$){super(H,$);this.url=H,this.settings=$}setSchema(H){return this.settings.$schema=H,this}get virtual(){return!0}static from(H,$,A){return new aL(H,$)}}});var UX;var dw=y(()=>{ML();UX=class UX extends IA{url;settings;get readonly(){return!0}constructor(H,$){super(H,$);this.url=H,this.settings=$}addWords(H){throw Error("Unable to add words to a JavaScript config file.")}}});var pw=n((n8,eJ)=>{(function H($,A){if(typeof n8==="object"&&typeof eJ==="object")eJ.exports=A();else if(typeof define==="function"&&define.amd)define([],A);else if(typeof n8==="object")n8.esprima=A();else $.esprima=A()})(n8,function(){return function(H){var $={};function A(L){if($[L])return $[L].exports;var D=$[L]={exports:{},id:L,loaded:!1};return H[L].call(D.exports,D,D.exports,A),D.loaded=!0,D.exports}return A.m=H,A.c=$,A.p="",A(0)}([function(H,$,A){Object.defineProperty($,"__esModule",{value:!0});var L=A(1),D=A(3),I=A(8),E=A(15);function K(Z,Q,B){var Y=null,G=function(N,x){if(B)B(N,x);if(Y)Y.visit(N,x)},U=typeof B==="function"?G:null,V=!1;if(Q){V=typeof Q.comment==="boolean"&&Q.comment;var z=typeof Q.attachComment==="boolean"&&Q.attachComment;if(V||z)Y=new L.CommentHandler,Y.attach=z,Q.comment=!0,U=G}var P=!1;if(Q&&typeof Q.sourceType==="string")P=Q.sourceType==="module";var T;if(Q&&typeof Q.jsx==="boolean"&&Q.jsx)T=new D.JSXParser(Z,Q,U);else T=new I.Parser(Z,Q,U);var q=P?T.parseModule():T.parseScript(),O=q;if(V&&Y)O.comments=Y.comments;if(T.config.tokens)O.tokens=T.tokens;if(T.config.tolerant)O.errors=T.errorHandler.errors;return O}$.parse=K;function M(Z,Q,B){var Y=Q||{};return Y.sourceType="module",K(Z,Y,B)}$.parseModule=M;function W(Z,Q,B){var Y=Q||{};return Y.sourceType="script",K(Z,Y,B)}$.parseScript=W;function X(Z,Q,B){var Y=new E.Tokenizer(Z,Q),G;G=[];try{while(!0){var U=Y.getNextToken();if(!U)break;if(B)U=B(U);G.push(U)}}catch(V){Y.errorHandler.tolerate(V)}if(Y.errorHandler.tolerant)G.errors=Y.errors();return G}$.tokenize=X;var J=A(2);$.Syntax=J.Syntax,$.version="4.0.1"},function(H,$,A){Object.defineProperty($,"__esModule",{value:!0});var L=A(2),D=function(){function I(){this.attach=!1,this.comments=[],this.stack=[],this.leading=[],this.trailing=[]}return I.prototype.insertInnerComments=function(E,K){if(E.type===L.Syntax.BlockStatement&&E.body.length===0){var M=[];for(var W=this.leading.length-1;W>=0;--W){var X=this.leading[W];if(K.end.offset>=X.start)M.unshift(X.comment),this.leading.splice(W,1),this.trailing.splice(W,1)}if(M.length)E.innerComments=M}},I.prototype.findTrailingComments=function(E){var K=[];if(this.trailing.length>0){for(var M=this.trailing.length-1;M>=0;--M){var W=this.trailing[M];if(W.start>=E.end.offset)K.unshift(W.comment)}return this.trailing.length=0,K}var X=this.stack[this.stack.length-1];if(X&&X.node.trailingComments){var J=X.node.trailingComments[0];if(J&&J.range[0]>=E.end.offset)K=X.node.trailingComments,delete X.node.trailingComments}return K},I.prototype.findLeadingComments=function(E){var K=[],M;while(this.stack.length>0){var W=this.stack[this.stack.length-1];if(W&&W.start>=E.start.offset)M=W.node,this.stack.pop();else break}if(M){var X=M.leadingComments?M.leadingComments.length:0;for(var J=X-1;J>=0;--J){var Z=M.leadingComments[J];if(Z.range[1]<=E.start.offset)K.unshift(Z),M.leadingComments.splice(J,1)}if(M.leadingComments&&M.leadingComments.length===0)delete M.leadingComments;return K}for(var J=this.leading.length-1;J>=0;--J){var W=this.leading[J];if(W.start<=E.start.offset)K.unshift(W.comment),this.leading.splice(J,1)}return K},I.prototype.visitNode=function(E,K){if(E.type===L.Syntax.Program&&E.body.length>0)return;this.insertInnerComments(E,K);var M=this.findTrailingComments(K),W=this.findLeadingComments(K);if(W.length>0)E.leadingComments=W;if(M.length>0)E.trailingComments=M;this.stack.push({node:E,start:K.start.offset})},I.prototype.visitComment=function(E,K){var M=E.type[0]==="L"?"Line":"Block",W={type:M,value:E.value};if(E.range)W.range=E.range;if(E.loc)W.loc=E.loc;if(this.comments.push(W),this.attach){var X={comment:{type:M,value:E.value,range:[K.start.offset,K.end.offset]},start:K.start.offset};if(E.loc)X.comment.loc=E.loc;E.type=M,this.leading.push(X),this.trailing.push(X)}},I.prototype.visit=function(E,K){if(E.type==="LineComment")this.visitComment(E,K);else if(E.type==="BlockComment")this.visitComment(E,K);else if(this.attach)this.visitNode(E,K)},I}();$.CommentHandler=D},function(H,$){Object.defineProperty($,"__esModule",{value:!0}),$.Syntax={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForOfStatement:"ForOfStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchCase:"SwitchCase",SwitchStatement:"SwitchStatement",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"}},function(H,$,A){var L=this&&this.__extends||function(){var Q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(B,Y){B.__proto__=Y}||function(B,Y){for(var G in Y)if(Y.hasOwnProperty(G))B[G]=Y[G]};return function(B,Y){Q(B,Y);function G(){this.constructor=B}B.prototype=Y===null?Object.create(Y):(G.prototype=Y.prototype,new G)}}();Object.defineProperty($,"__esModule",{value:!0});var D=A(4),I=A(5),E=A(6),K=A(7),M=A(8),W=A(13),X=A(14);W.TokenName[100]="JSXIdentifier",W.TokenName[101]="JSXText";function J(Q){var B;switch(Q.type){case E.JSXSyntax.JSXIdentifier:var Y=Q;B=Y.name;break;case E.JSXSyntax.JSXNamespacedName:var G=Q;B=J(G.namespace)+":"+J(G.name);break;case E.JSXSyntax.JSXMemberExpression:var U=Q;B=J(U.object)+"."+J(U.property);break;default:break}return B}var Z=function(Q){L(B,Q);function B(Y,G,U){return Q.call(this,Y,G,U)||this}return B.prototype.parsePrimaryExpression=function(){return this.match("<")?this.parseJSXRoot():Q.prototype.parsePrimaryExpression.call(this)},B.prototype.startJSX=function(){this.scanner.index=this.startMarker.index,this.scanner.lineNumber=this.startMarker.line,this.scanner.lineStart=this.startMarker.index-this.startMarker.column},B.prototype.finishJSX=function(){this.nextToken()},B.prototype.reenterJSX=function(){if(this.startJSX(),this.expectJSX("}"),this.config.tokens)this.tokens.pop()},B.prototype.createJSXNode=function(){return this.collectComments(),{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},B.prototype.createJSXChildNode=function(){return{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},B.prototype.scanXHTMLEntity=function(Y){var G="&",U=!0,V=!1,z=!1,P=!1;while(!this.scanner.eof()&&U&&!V){var T=this.scanner.source[this.scanner.index];if(T===Y)break;if(V=T===";",G+=T,++this.scanner.index,!V)switch(G.length){case 2:z=T==="#";break;case 3:if(z)P=T==="x",U=P||D.Character.isDecimalDigit(T.charCodeAt(0)),z=z&&!P;break;default:U=U&&!(z&&!D.Character.isDecimalDigit(T.charCodeAt(0))),U=U&&!(P&&!D.Character.isHexDigit(T.charCodeAt(0)));break}}if(U&&V&&G.length>2){var q=G.substr(1,G.length-2);if(z&&q.length>1)G=String.fromCharCode(parseInt(q.substr(1),10));else if(P&&q.length>2)G=String.fromCharCode(parseInt("0"+q.substr(1),16));else if(!z&&!P&&X.XHTMLEntities[q])G=X.XHTMLEntities[q]}return G},B.prototype.lexJSX=function(){var Y=this.scanner.source.charCodeAt(this.scanner.index);if(Y===60||Y===62||Y===47||Y===58||Y===61||Y===123||Y===125){var G=this.scanner.source[this.scanner.index++];return{type:7,value:G,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index-1,end:this.scanner.index}}if(Y===34||Y===39){var U=this.scanner.index,V=this.scanner.source[this.scanner.index++],z="";while(!this.scanner.eof()){var P=this.scanner.source[this.scanner.index++];if(P===V)break;else if(P==="&")z+=this.scanXHTMLEntity(V);else z+=P}return{type:8,value:z,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:U,end:this.scanner.index}}if(Y===46){var T=this.scanner.source.charCodeAt(this.scanner.index+1),q=this.scanner.source.charCodeAt(this.scanner.index+2),G=T===46&&q===46?"...":".",U=this.scanner.index;return this.scanner.index+=G.length,{type:7,value:G,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:U,end:this.scanner.index}}if(Y===96)return{type:10,value:"",lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index,end:this.scanner.index};if(D.Character.isIdentifierStart(Y)&&Y!==92){var U=this.scanner.index;++this.scanner.index;while(!this.scanner.eof()){var P=this.scanner.source.charCodeAt(this.scanner.index);if(D.Character.isIdentifierPart(P)&&P!==92)++this.scanner.index;else if(P===45)++this.scanner.index;else break}var O=this.scanner.source.slice(U,this.scanner.index);return{type:100,value:O,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:U,end:this.scanner.index}}return this.scanner.lex()},B.prototype.nextJSXToken=function(){this.collectComments(),this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;var Y=this.lexJSX();if(this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.config.tokens)this.tokens.push(this.convertToken(Y));return Y},B.prototype.nextJSXText=function(){this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;var Y=this.scanner.index,G="";while(!this.scanner.eof()){var U=this.scanner.source[this.scanner.index];if(U==="{"||U==="<")break;if(++this.scanner.index,G+=U,D.Character.isLineTerminator(U.charCodeAt(0))){if(++this.scanner.lineNumber,U==="\r"&&this.scanner.source[this.scanner.index]===`
|
|
328
|
+
`)++this.scanner.index;this.scanner.lineStart=this.scanner.index}}this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart;var V={type:101,value:G,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:Y,end:this.scanner.index};if(G.length>0&&this.config.tokens)this.tokens.push(this.convertToken(V));return V},B.prototype.peekJSXToken=function(){var Y=this.scanner.saveState();this.scanner.scanComments();var G=this.lexJSX();return this.scanner.restoreState(Y),G},B.prototype.expectJSX=function(Y){var G=this.nextJSXToken();if(G.type!==7||G.value!==Y)this.throwUnexpectedToken(G)},B.prototype.matchJSX=function(Y){var G=this.peekJSXToken();return G.type===7&&G.value===Y},B.prototype.parseJSXIdentifier=function(){var Y=this.createJSXNode(),G=this.nextJSXToken();if(G.type!==100)this.throwUnexpectedToken(G);return this.finalize(Y,new I.JSXIdentifier(G.value))},B.prototype.parseJSXElementName=function(){var Y=this.createJSXNode(),G=this.parseJSXIdentifier();if(this.matchJSX(":")){var U=G;this.expectJSX(":");var V=this.parseJSXIdentifier();G=this.finalize(Y,new I.JSXNamespacedName(U,V))}else if(this.matchJSX("."))while(this.matchJSX(".")){var z=G;this.expectJSX(".");var P=this.parseJSXIdentifier();G=this.finalize(Y,new I.JSXMemberExpression(z,P))}return G},B.prototype.parseJSXAttributeName=function(){var Y=this.createJSXNode(),G,U=this.parseJSXIdentifier();if(this.matchJSX(":")){var V=U;this.expectJSX(":");var z=this.parseJSXIdentifier();G=this.finalize(Y,new I.JSXNamespacedName(V,z))}else G=U;return G},B.prototype.parseJSXStringLiteralAttribute=function(){var Y=this.createJSXNode(),G=this.nextJSXToken();if(G.type!==8)this.throwUnexpectedToken(G);var U=this.getTokenRaw(G);return this.finalize(Y,new K.Literal(G.value,U))},B.prototype.parseJSXExpressionAttribute=function(){var Y=this.createJSXNode();if(this.expectJSX("{"),this.finishJSX(),this.match("}"))this.tolerateError("JSX attributes must only be assigned a non-empty expression");var G=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(Y,new I.JSXExpressionContainer(G))},B.prototype.parseJSXAttributeValue=function(){return this.matchJSX("{")?this.parseJSXExpressionAttribute():this.matchJSX("<")?this.parseJSXElement():this.parseJSXStringLiteralAttribute()},B.prototype.parseJSXNameValueAttribute=function(){var Y=this.createJSXNode(),G=this.parseJSXAttributeName(),U=null;if(this.matchJSX("="))this.expectJSX("="),U=this.parseJSXAttributeValue();return this.finalize(Y,new I.JSXAttribute(G,U))},B.prototype.parseJSXSpreadAttribute=function(){var Y=this.createJSXNode();this.expectJSX("{"),this.expectJSX("..."),this.finishJSX();var G=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(Y,new I.JSXSpreadAttribute(G))},B.prototype.parseJSXAttributes=function(){var Y=[];while(!this.matchJSX("/")&&!this.matchJSX(">")){var G=this.matchJSX("{")?this.parseJSXSpreadAttribute():this.parseJSXNameValueAttribute();Y.push(G)}return Y},B.prototype.parseJSXOpeningElement=function(){var Y=this.createJSXNode();this.expectJSX("<");var G=this.parseJSXElementName(),U=this.parseJSXAttributes(),V=this.matchJSX("/");if(V)this.expectJSX("/");return this.expectJSX(">"),this.finalize(Y,new I.JSXOpeningElement(G,V,U))},B.prototype.parseJSXBoundaryElement=function(){var Y=this.createJSXNode();if(this.expectJSX("<"),this.matchJSX("/")){this.expectJSX("/");var G=this.parseJSXElementName();return this.expectJSX(">"),this.finalize(Y,new I.JSXClosingElement(G))}var U=this.parseJSXElementName(),V=this.parseJSXAttributes(),z=this.matchJSX("/");if(z)this.expectJSX("/");return this.expectJSX(">"),this.finalize(Y,new I.JSXOpeningElement(U,z,V))},B.prototype.parseJSXEmptyExpression=function(){var Y=this.createJSXChildNode();return this.collectComments(),this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.finalize(Y,new I.JSXEmptyExpression)},B.prototype.parseJSXExpressionContainer=function(){var Y=this.createJSXNode();this.expectJSX("{");var G;if(this.matchJSX("}"))G=this.parseJSXEmptyExpression(),this.expectJSX("}");else this.finishJSX(),G=this.parseAssignmentExpression(),this.reenterJSX();return this.finalize(Y,new I.JSXExpressionContainer(G))},B.prototype.parseJSXChildren=function(){var Y=[];while(!this.scanner.eof()){var G=this.createJSXChildNode(),U=this.nextJSXText();if(U.start<U.end){var V=this.getTokenRaw(U),z=this.finalize(G,new I.JSXText(U.value,V));Y.push(z)}if(this.scanner.source[this.scanner.index]==="{"){var P=this.parseJSXExpressionContainer();Y.push(P)}else break}return Y},B.prototype.parseComplexJSXElement=function(Y){var G=[];while(!this.scanner.eof()){Y.children=Y.children.concat(this.parseJSXChildren());var U=this.createJSXChildNode(),V=this.parseJSXBoundaryElement();if(V.type===E.JSXSyntax.JSXOpeningElement){var z=V;if(z.selfClosing){var P=this.finalize(U,new I.JSXElement(z,[],null));Y.children.push(P)}else G.push(Y),Y={node:U,opening:z,closing:null,children:[]}}if(V.type===E.JSXSyntax.JSXClosingElement){Y.closing=V;var T=J(Y.opening.name),q=J(Y.closing.name);if(T!==q)this.tolerateError("Expected corresponding JSX closing tag for %0",T);if(G.length>0){var P=this.finalize(Y.node,new I.JSXElement(Y.opening,Y.children,Y.closing));Y=G[G.length-1],Y.children.push(P),G.pop()}else break}}return Y},B.prototype.parseJSXElement=function(){var Y=this.createJSXNode(),G=this.parseJSXOpeningElement(),U=[],V=null;if(!G.selfClosing){var z=this.parseComplexJSXElement({node:Y,opening:G,closing:V,children:U});U=z.children,V=z.closing}return this.finalize(Y,new I.JSXElement(G,U,V))},B.prototype.parseJSXRoot=function(){if(this.config.tokens)this.tokens.pop();this.startJSX();var Y=this.parseJSXElement();return this.finishJSX(),Y},B.prototype.isStartOfExpression=function(){return Q.prototype.isStartOfExpression.call(this)||this.match("<")},B}(M.Parser);$.JSXParser=Z},function(H,$){Object.defineProperty($,"__esModule",{value:!0});var A={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/};$.Character={fromCodePoint:function(L){return L<65536?String.fromCharCode(L):String.fromCharCode(55296+(L-65536>>10))+String.fromCharCode(56320+(L-65536&1023))},isWhiteSpace:function(L){return L===32||L===9||L===11||L===12||L===160||L>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(L)>=0},isLineTerminator:function(L){return L===10||L===13||L===8232||L===8233},isIdentifierStart:function(L){return L===36||L===95||L>=65&&L<=90||L>=97&&L<=122||L===92||L>=128&&A.NonAsciiIdentifierStart.test($.Character.fromCodePoint(L))},isIdentifierPart:function(L){return L===36||L===95||L>=65&&L<=90||L>=97&&L<=122||L>=48&&L<=57||L===92||L>=128&&A.NonAsciiIdentifierPart.test($.Character.fromCodePoint(L))},isDecimalDigit:function(L){return L>=48&&L<=57},isHexDigit:function(L){return L>=48&&L<=57||L>=65&&L<=70||L>=97&&L<=102},isOctalDigit:function(L){return L>=48&&L<=55}}},function(H,$,A){Object.defineProperty($,"__esModule",{value:!0});var L=A(6),D=function(){function Y(G){this.type=L.JSXSyntax.JSXClosingElement,this.name=G}return Y}();$.JSXClosingElement=D;var I=function(){function Y(G,U,V){this.type=L.JSXSyntax.JSXElement,this.openingElement=G,this.children=U,this.closingElement=V}return Y}();$.JSXElement=I;var E=function(){function Y(){this.type=L.JSXSyntax.JSXEmptyExpression}return Y}();$.JSXEmptyExpression=E;var K=function(){function Y(G){this.type=L.JSXSyntax.JSXExpressionContainer,this.expression=G}return Y}();$.JSXExpressionContainer=K;var M=function(){function Y(G){this.type=L.JSXSyntax.JSXIdentifier,this.name=G}return Y}();$.JSXIdentifier=M;var W=function(){function Y(G,U){this.type=L.JSXSyntax.JSXMemberExpression,this.object=G,this.property=U}return Y}();$.JSXMemberExpression=W;var X=function(){function Y(G,U){this.type=L.JSXSyntax.JSXAttribute,this.name=G,this.value=U}return Y}();$.JSXAttribute=X;var J=function(){function Y(G,U){this.type=L.JSXSyntax.JSXNamespacedName,this.namespace=G,this.name=U}return Y}();$.JSXNamespacedName=J;var Z=function(){function Y(G,U,V){this.type=L.JSXSyntax.JSXOpeningElement,this.name=G,this.selfClosing=U,this.attributes=V}return Y}();$.JSXOpeningElement=Z;var Q=function(){function Y(G){this.type=L.JSXSyntax.JSXSpreadAttribute,this.argument=G}return Y}();$.JSXSpreadAttribute=Q;var B=function(){function Y(G,U){this.type=L.JSXSyntax.JSXText,this.value=G,this.raw=U}return Y}();$.JSXText=B},function(H,$){Object.defineProperty($,"__esModule",{value:!0}),$.JSXSyntax={JSXAttribute:"JSXAttribute",JSXClosingElement:"JSXClosingElement",JSXElement:"JSXElement",JSXEmptyExpression:"JSXEmptyExpression",JSXExpressionContainer:"JSXExpressionContainer",JSXIdentifier:"JSXIdentifier",JSXMemberExpression:"JSXMemberExpression",JSXNamespacedName:"JSXNamespacedName",JSXOpeningElement:"JSXOpeningElement",JSXSpreadAttribute:"JSXSpreadAttribute",JSXText:"JSXText"}},function(H,$,A){Object.defineProperty($,"__esModule",{value:!0});var L=A(2),D=function(){function g(m){this.type=L.Syntax.ArrayExpression,this.elements=m}return g}();$.ArrayExpression=D;var I=function(){function g(m){this.type=L.Syntax.ArrayPattern,this.elements=m}return g}();$.ArrayPattern=I;var E=function(){function g(m,s,VH){this.type=L.Syntax.ArrowFunctionExpression,this.id=null,this.params=m,this.body=s,this.generator=!1,this.expression=VH,this.async=!1}return g}();$.ArrowFunctionExpression=E;var K=function(){function g(m,s,VH){this.type=L.Syntax.AssignmentExpression,this.operator=m,this.left=s,this.right=VH}return g}();$.AssignmentExpression=K;var M=function(){function g(m,s){this.type=L.Syntax.AssignmentPattern,this.left=m,this.right=s}return g}();$.AssignmentPattern=M;var W=function(){function g(m,s,VH){this.type=L.Syntax.ArrowFunctionExpression,this.id=null,this.params=m,this.body=s,this.generator=!1,this.expression=VH,this.async=!0}return g}();$.AsyncArrowFunctionExpression=W;var X=function(){function g(m,s,VH){this.type=L.Syntax.FunctionDeclaration,this.id=m,this.params=s,this.body=VH,this.generator=!1,this.expression=!1,this.async=!0}return g}();$.AsyncFunctionDeclaration=X;var J=function(){function g(m,s,VH){this.type=L.Syntax.FunctionExpression,this.id=m,this.params=s,this.body=VH,this.generator=!1,this.expression=!1,this.async=!0}return g}();$.AsyncFunctionExpression=J;var Z=function(){function g(m){this.type=L.Syntax.AwaitExpression,this.argument=m}return g}();$.AwaitExpression=Z;var Q=function(){function g(m,s,VH){var O$=m==="||"||m==="&&";this.type=O$?L.Syntax.LogicalExpression:L.Syntax.BinaryExpression,this.operator=m,this.left=s,this.right=VH}return g}();$.BinaryExpression=Q;var B=function(){function g(m){this.type=L.Syntax.BlockStatement,this.body=m}return g}();$.BlockStatement=B;var Y=function(){function g(m){this.type=L.Syntax.BreakStatement,this.label=m}return g}();$.BreakStatement=Y;var G=function(){function g(m,s){this.type=L.Syntax.CallExpression,this.callee=m,this.arguments=s}return g}();$.CallExpression=G;var U=function(){function g(m,s){this.type=L.Syntax.CatchClause,this.param=m,this.body=s}return g}();$.CatchClause=U;var V=function(){function g(m){this.type=L.Syntax.ClassBody,this.body=m}return g}();$.ClassBody=V;var z=function(){function g(m,s,VH){this.type=L.Syntax.ClassDeclaration,this.id=m,this.superClass=s,this.body=VH}return g}();$.ClassDeclaration=z;var P=function(){function g(m,s,VH){this.type=L.Syntax.ClassExpression,this.id=m,this.superClass=s,this.body=VH}return g}();$.ClassExpression=P;var T=function(){function g(m,s){this.type=L.Syntax.MemberExpression,this.computed=!0,this.object=m,this.property=s}return g}();$.ComputedMemberExpression=T;var q=function(){function g(m,s,VH){this.type=L.Syntax.ConditionalExpression,this.test=m,this.consequent=s,this.alternate=VH}return g}();$.ConditionalExpression=q;var O=function(){function g(m){this.type=L.Syntax.ContinueStatement,this.label=m}return g}();$.ContinueStatement=O;var N=function(){function g(){this.type=L.Syntax.DebuggerStatement}return g}();$.DebuggerStatement=N;var x=function(){function g(m,s){this.type=L.Syntax.ExpressionStatement,this.expression=m,this.directive=s}return g}();$.Directive=x;var w=function(){function g(m,s){this.type=L.Syntax.DoWhileStatement,this.body=m,this.test=s}return g}();$.DoWhileStatement=w;var F=function(){function g(){this.type=L.Syntax.EmptyStatement}return g}();$.EmptyStatement=F;var f=function(){function g(m){this.type=L.Syntax.ExportAllDeclaration,this.source=m}return g}();$.ExportAllDeclaration=f;var j=function(){function g(m){this.type=L.Syntax.ExportDefaultDeclaration,this.declaration=m}return g}();$.ExportDefaultDeclaration=j;var S=function(){function g(m,s,VH){this.type=L.Syntax.ExportNamedDeclaration,this.declaration=m,this.specifiers=s,this.source=VH}return g}();$.ExportNamedDeclaration=S;var _=function(){function g(m,s){this.type=L.Syntax.ExportSpecifier,this.exported=s,this.local=m}return g}();$.ExportSpecifier=_;var u=function(){function g(m){this.type=L.Syntax.ExpressionStatement,this.expression=m}return g}();$.ExpressionStatement=u;var h=function(){function g(m,s,VH){this.type=L.Syntax.ForInStatement,this.left=m,this.right=s,this.body=VH,this.each=!1}return g}();$.ForInStatement=h;var d=function(){function g(m,s,VH){this.type=L.Syntax.ForOfStatement,this.left=m,this.right=s,this.body=VH}return g}();$.ForOfStatement=d;var l=function(){function g(m,s,VH,O$){this.type=L.Syntax.ForStatement,this.init=m,this.test=s,this.update=VH,this.body=O$}return g}();$.ForStatement=l;var k=function(){function g(m,s,VH,O$){this.type=L.Syntax.FunctionDeclaration,this.id=m,this.params=s,this.body=VH,this.generator=O$,this.expression=!1,this.async=!1}return g}();$.FunctionDeclaration=k;var p=function(){function g(m,s,VH,O$){this.type=L.Syntax.FunctionExpression,this.id=m,this.params=s,this.body=VH,this.generator=O$,this.expression=!1,this.async=!1}return g}();$.FunctionExpression=p;var LH=function(){function g(m){this.type=L.Syntax.Identifier,this.name=m}return g}();$.Identifier=LH;var IH=function(){function g(m,s,VH){this.type=L.Syntax.IfStatement,this.test=m,this.consequent=s,this.alternate=VH}return g}();$.IfStatement=IH;var HH=function(){function g(m,s){this.type=L.Syntax.ImportDeclaration,this.specifiers=m,this.source=s}return g}();$.ImportDeclaration=HH;var e=function(){function g(m){this.type=L.Syntax.ImportDefaultSpecifier,this.local=m}return g}();$.ImportDefaultSpecifier=e;var _H=function(){function g(m){this.type=L.Syntax.ImportNamespaceSpecifier,this.local=m}return g}();$.ImportNamespaceSpecifier=_H;var SH=function(){function g(m,s){this.type=L.Syntax.ImportSpecifier,this.local=m,this.imported=s}return g}();$.ImportSpecifier=SH;var o=function(){function g(m,s){this.type=L.Syntax.LabeledStatement,this.label=m,this.body=s}return g}();$.LabeledStatement=o;var JH=function(){function g(m,s){this.type=L.Syntax.Literal,this.value=m,this.raw=s}return g}();$.Literal=JH;var t=function(){function g(m,s){this.type=L.Syntax.MetaProperty,this.meta=m,this.property=s}return g}();$.MetaProperty=t;var BH=function(){function g(m,s,VH,O$,l2){this.type=L.Syntax.MethodDefinition,this.key=m,this.computed=s,this.value=VH,this.kind=O$,this.static=l2}return g}();$.MethodDefinition=BH;var qH=function(){function g(m){this.type=L.Syntax.Program,this.body=m,this.sourceType="module"}return g}();$.Module=qH;var kH=function(){function g(m,s){this.type=L.Syntax.NewExpression,this.callee=m,this.arguments=s}return g}();$.NewExpression=kH;var $H=function(){function g(m){this.type=L.Syntax.ObjectExpression,this.properties=m}return g}();$.ObjectExpression=$H;var wH=function(){function g(m){this.type=L.Syntax.ObjectPattern,this.properties=m}return g}();$.ObjectPattern=wH;var NH=function(){function g(m,s,VH,O$,l2,nv){this.type=L.Syntax.Property,this.key=s,this.computed=VH,this.value=O$,this.kind=m,this.method=l2,this.shorthand=nv}return g}();$.Property=NH;var L$=function(){function g(m,s,VH,O$){this.type=L.Syntax.Literal,this.value=m,this.raw=s,this.regex={pattern:VH,flags:O$}}return g}();$.RegexLiteral=L$;var TH=function(){function g(m){this.type=L.Syntax.RestElement,this.argument=m}return g}();$.RestElement=TH;var r$=function(){function g(m){this.type=L.Syntax.ReturnStatement,this.argument=m}return g}();$.ReturnStatement=r$;var W0=function(){function g(m){this.type=L.Syntax.Program,this.body=m,this.sourceType="script"}return g}();$.Script=W0;var BL=function(){function g(m){this.type=L.Syntax.SequenceExpression,this.expressions=m}return g}();$.SequenceExpression=BL;var d4=function(){function g(m){this.type=L.Syntax.SpreadElement,this.argument=m}return g}();$.SpreadElement=d4;var p4=function(){function g(m,s){this.type=L.Syntax.MemberExpression,this.computed=!1,this.object=m,this.property=s}return g}();$.StaticMemberExpression=p4;var Sv=function(){function g(){this.type=L.Syntax.Super}return g}();$.Super=Sv;var xv=function(){function g(m,s){this.type=L.Syntax.SwitchCase,this.test=m,this.consequent=s}return g}();$.SwitchCase=xv;var kv=function(){function g(m,s){this.type=L.Syntax.SwitchStatement,this.discriminant=m,this.cases=s}return g}();$.SwitchStatement=kv;var yv=function(){function g(m,s){this.type=L.Syntax.TaggedTemplateExpression,this.tag=m,this.quasi=s}return g}();$.TaggedTemplateExpression=yv;var fv=function(){function g(m,s){this.type=L.Syntax.TemplateElement,this.value=m,this.tail=s}return g}();$.TemplateElement=fv;var vv=function(){function g(m,s){this.type=L.Syntax.TemplateLiteral,this.quasis=m,this.expressions=s}return g}();$.TemplateLiteral=vv;var bv=function(){function g(){this.type=L.Syntax.ThisExpression}return g}();$.ThisExpression=bv;var hv=function(){function g(m){this.type=L.Syntax.ThrowStatement,this.argument=m}return g}();$.ThrowStatement=hv;var uv=function(){function g(m,s,VH){this.type=L.Syntax.TryStatement,this.block=m,this.handler=s,this.finalizer=VH}return g}();$.TryStatement=uv;var gv=function(){function g(m,s){this.type=L.Syntax.UnaryExpression,this.operator=m,this.argument=s,this.prefix=!0}return g}();$.UnaryExpression=gv;var mv=function(){function g(m,s,VH){this.type=L.Syntax.UpdateExpression,this.operator=m,this.argument=s,this.prefix=VH}return g}();$.UpdateExpression=mv;var dv=function(){function g(m,s){this.type=L.Syntax.VariableDeclaration,this.declarations=m,this.kind=s}return g}();$.VariableDeclaration=dv;var pv=function(){function g(m,s){this.type=L.Syntax.VariableDeclarator,this.id=m,this.init=s}return g}();$.VariableDeclarator=pv;var cv=function(){function g(m,s){this.type=L.Syntax.WhileStatement,this.test=m,this.body=s}return g}();$.WhileStatement=cv;var lv=function(){function g(m,s){this.type=L.Syntax.WithStatement,this.object=m,this.body=s}return g}();$.WithStatement=lv;var iv=function(){function g(m,s){this.type=L.Syntax.YieldExpression,this.argument=m,this.delegate=s}return g}();$.YieldExpression=iv},function(H,$,A){Object.defineProperty($,"__esModule",{value:!0});var L=A(9),D=A(10),I=A(11),E=A(7),K=A(12),M=A(2),W=A(13),X="ArrowParameterPlaceHolder",J=function(){function Z(Q,B,Y){if(B===void 0)B={};if(this.config={range:typeof B.range==="boolean"&&B.range,loc:typeof B.loc==="boolean"&&B.loc,source:null,tokens:typeof B.tokens==="boolean"&&B.tokens,comment:typeof B.comment==="boolean"&&B.comment,tolerant:typeof B.tolerant==="boolean"&&B.tolerant},this.config.loc&&B.source&&B.source!==null)this.config.source=String(B.source);this.delegate=Y,this.errorHandler=new D.ErrorHandler,this.errorHandler.tolerant=this.config.tolerant,this.scanner=new K.Scanner(Q,this.errorHandler),this.scanner.trackComment=this.config.comment,this.operatorPrecedence={")":0,";":0,",":0,"=":0,"]":0,"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":11,"/":11,"%":11},this.lookahead={type:2,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0},this.hasLineTerminator=!1,this.context={isModule:!1,await:!1,allowIn:!0,allowStrictDirective:!0,allowYield:!0,firstCoverInitializedNameError:null,isAssignmentTarget:!1,isBindingElement:!1,inFunctionBody:!1,inIteration:!1,inSwitch:!1,labelSet:{},strict:!1},this.tokens=[],this.startMarker={index:0,line:this.scanner.lineNumber,column:0},this.lastMarker={index:0,line:this.scanner.lineNumber,column:0},this.nextToken(),this.lastMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}return Z.prototype.throwError=function(Q){var B=[];for(var Y=1;Y<arguments.length;Y++)B[Y-1]=arguments[Y];var G=Array.prototype.slice.call(arguments,1),U=Q.replace(/%(\d)/g,function(T,q){return L.assert(q<G.length,"Message reference must be in range"),G[q]}),V=this.lastMarker.index,z=this.lastMarker.line,P=this.lastMarker.column+1;throw this.errorHandler.createError(V,z,P,U)},Z.prototype.tolerateError=function(Q){var B=[];for(var Y=1;Y<arguments.length;Y++)B[Y-1]=arguments[Y];var G=Array.prototype.slice.call(arguments,1),U=Q.replace(/%(\d)/g,function(T,q){return L.assert(q<G.length,"Message reference must be in range"),G[q]}),V=this.lastMarker.index,z=this.scanner.lineNumber,P=this.lastMarker.column+1;this.errorHandler.tolerateError(V,z,P,U)},Z.prototype.unexpectedTokenError=function(Q,B){var Y=B||I.Messages.UnexpectedToken,G;if(Q){if(!B){if(Y=Q.type===2?I.Messages.UnexpectedEOS:Q.type===3?I.Messages.UnexpectedIdentifier:Q.type===6?I.Messages.UnexpectedNumber:Q.type===8?I.Messages.UnexpectedString:Q.type===10?I.Messages.UnexpectedTemplate:I.Messages.UnexpectedToken,Q.type===4){if(this.scanner.isFutureReservedWord(Q.value))Y=I.Messages.UnexpectedReserved;else if(this.context.strict&&this.scanner.isStrictModeReservedWord(Q.value))Y=I.Messages.StrictReservedWord}}G=Q.value}else G="ILLEGAL";if(Y=Y.replace("%0",G),Q&&typeof Q.lineNumber==="number"){var{start:U,lineNumber:V}=Q,z=this.lastMarker.index-this.lastMarker.column,P=Q.start-z+1;return this.errorHandler.createError(U,V,P,Y)}else{var U=this.lastMarker.index,V=this.lastMarker.line,P=this.lastMarker.column+1;return this.errorHandler.createError(U,V,P,Y)}},Z.prototype.throwUnexpectedToken=function(Q,B){throw this.unexpectedTokenError(Q,B)},Z.prototype.tolerateUnexpectedToken=function(Q,B){this.errorHandler.tolerate(this.unexpectedTokenError(Q,B))},Z.prototype.collectComments=function(){if(!this.config.comment)this.scanner.scanComments();else{var Q=this.scanner.scanComments();if(Q.length>0&&this.delegate)for(var B=0;B<Q.length;++B){var Y=Q[B],G=void 0;if(G={type:Y.multiLine?"BlockComment":"LineComment",value:this.scanner.source.slice(Y.slice[0],Y.slice[1])},this.config.range)G.range=Y.range;if(this.config.loc)G.loc=Y.loc;var U={start:{line:Y.loc.start.line,column:Y.loc.start.column,offset:Y.range[0]},end:{line:Y.loc.end.line,column:Y.loc.end.column,offset:Y.range[1]}};this.delegate(G,U)}}},Z.prototype.getTokenRaw=function(Q){return this.scanner.source.slice(Q.start,Q.end)},Z.prototype.convertToken=function(Q){var B={type:W.TokenName[Q.type],value:this.getTokenRaw(Q)};if(this.config.range)B.range=[Q.start,Q.end];if(this.config.loc)B.loc={start:{line:this.startMarker.line,column:this.startMarker.column},end:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}};if(Q.type===9){var{pattern:Y,flags:G}=Q;B.regex={pattern:Y,flags:G}}return B},Z.prototype.nextToken=function(){var Q=this.lookahead;if(this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.collectComments(),this.scanner.index!==this.startMarker.index)this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;var B=this.scanner.lex();if(this.hasLineTerminator=Q.lineNumber!==B.lineNumber,B&&this.context.strict&&B.type===3){if(this.scanner.isStrictModeReservedWord(B.value))B.type=4}if(this.lookahead=B,this.config.tokens&&B.type!==2)this.tokens.push(this.convertToken(B));return Q},Z.prototype.nextRegexToken=function(){this.collectComments();var Q=this.scanner.scanRegExp();if(this.config.tokens)this.tokens.pop(),this.tokens.push(this.convertToken(Q));return this.lookahead=Q,this.nextToken(),Q},Z.prototype.createNode=function(){return{index:this.startMarker.index,line:this.startMarker.line,column:this.startMarker.column}},Z.prototype.startNode=function(Q,B){if(B===void 0)B=0;var Y=Q.start-Q.lineStart,G=Q.lineNumber;if(Y<0)Y+=B,G--;return{index:Q.start,line:G,column:Y}},Z.prototype.finalize=function(Q,B){if(this.config.range)B.range=[Q.index,this.lastMarker.index];if(this.config.loc){if(B.loc={start:{line:Q.line,column:Q.column},end:{line:this.lastMarker.line,column:this.lastMarker.column}},this.config.source)B.loc.source=this.config.source}if(this.delegate){var Y={start:{line:Q.line,column:Q.column,offset:Q.index},end:{line:this.lastMarker.line,column:this.lastMarker.column,offset:this.lastMarker.index}};this.delegate(B,Y)}return B},Z.prototype.expect=function(Q){var B=this.nextToken();if(B.type!==7||B.value!==Q)this.throwUnexpectedToken(B)},Z.prototype.expectCommaSeparator=function(){if(this.config.tolerant){var Q=this.lookahead;if(Q.type===7&&Q.value===",")this.nextToken();else if(Q.type===7&&Q.value===";")this.nextToken(),this.tolerateUnexpectedToken(Q);else this.tolerateUnexpectedToken(Q,I.Messages.UnexpectedToken)}else this.expect(",")},Z.prototype.expectKeyword=function(Q){var B=this.nextToken();if(B.type!==4||B.value!==Q)this.throwUnexpectedToken(B)},Z.prototype.match=function(Q){return this.lookahead.type===7&&this.lookahead.value===Q},Z.prototype.matchKeyword=function(Q){return this.lookahead.type===4&&this.lookahead.value===Q},Z.prototype.matchContextualKeyword=function(Q){return this.lookahead.type===3&&this.lookahead.value===Q},Z.prototype.matchAssign=function(){if(this.lookahead.type!==7)return!1;var Q=this.lookahead.value;return Q==="="||Q==="*="||Q==="**="||Q==="/="||Q==="%="||Q==="+="||Q==="-="||Q==="<<="||Q===">>="||Q===">>>="||Q==="&="||Q==="^="||Q==="|="},Z.prototype.isolateCoverGrammar=function(Q){var B=this.context.isBindingElement,Y=this.context.isAssignmentTarget,G=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var U=Q.call(this);if(this.context.firstCoverInitializedNameError!==null)this.throwUnexpectedToken(this.context.firstCoverInitializedNameError);return this.context.isBindingElement=B,this.context.isAssignmentTarget=Y,this.context.firstCoverInitializedNameError=G,U},Z.prototype.inheritCoverGrammar=function(Q){var B=this.context.isBindingElement,Y=this.context.isAssignmentTarget,G=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var U=Q.call(this);return this.context.isBindingElement=this.context.isBindingElement&&B,this.context.isAssignmentTarget=this.context.isAssignmentTarget&&Y,this.context.firstCoverInitializedNameError=G||this.context.firstCoverInitializedNameError,U},Z.prototype.consumeSemicolon=function(){if(this.match(";"))this.nextToken();else if(!this.hasLineTerminator){if(this.lookahead.type!==2&&!this.match("}"))this.throwUnexpectedToken(this.lookahead);this.lastMarker.index=this.startMarker.index,this.lastMarker.line=this.startMarker.line,this.lastMarker.column=this.startMarker.column}},Z.prototype.parsePrimaryExpression=function(){var Q=this.createNode(),B,Y,G;switch(this.lookahead.type){case 3:if((this.context.isModule||this.context.await)&&this.lookahead.value==="await")this.tolerateUnexpectedToken(this.lookahead);B=this.matchAsyncFunction()?this.parseFunctionExpression():this.finalize(Q,new E.Identifier(this.nextToken().value));break;case 6:case 8:if(this.context.strict&&this.lookahead.octal)this.tolerateUnexpectedToken(this.lookahead,I.Messages.StrictOctalLiteral);this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,Y=this.nextToken(),G=this.getTokenRaw(Y),B=this.finalize(Q,new E.Literal(Y.value,G));break;case 1:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,Y=this.nextToken(),G=this.getTokenRaw(Y),B=this.finalize(Q,new E.Literal(Y.value==="true",G));break;case 5:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,Y=this.nextToken(),G=this.getTokenRaw(Y),B=this.finalize(Q,new E.Literal(null,G));break;case 10:B=this.parseTemplateLiteral();break;case 7:switch(this.lookahead.value){case"(":this.context.isBindingElement=!1,B=this.inheritCoverGrammar(this.parseGroupExpression);break;case"[":B=this.inheritCoverGrammar(this.parseArrayInitializer);break;case"{":B=this.inheritCoverGrammar(this.parseObjectInitializer);break;case"/":case"/=":this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.scanner.index=this.startMarker.index,Y=this.nextRegexToken(),G=this.getTokenRaw(Y),B=this.finalize(Q,new E.RegexLiteral(Y.regex,G,Y.pattern,Y.flags));break;default:B=this.throwUnexpectedToken(this.nextToken())}break;case 4:if(!this.context.strict&&this.context.allowYield&&this.matchKeyword("yield"))B=this.parseIdentifierName();else if(!this.context.strict&&this.matchKeyword("let"))B=this.finalize(Q,new E.Identifier(this.nextToken().value));else if(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.matchKeyword("function"))B=this.parseFunctionExpression();else if(this.matchKeyword("this"))this.nextToken(),B=this.finalize(Q,new E.ThisExpression);else if(this.matchKeyword("class"))B=this.parseClassExpression();else B=this.throwUnexpectedToken(this.nextToken());break;default:B=this.throwUnexpectedToken(this.nextToken())}return B},Z.prototype.parseSpreadElement=function(){var Q=this.createNode();this.expect("...");var B=this.inheritCoverGrammar(this.parseAssignmentExpression);return this.finalize(Q,new E.SpreadElement(B))},Z.prototype.parseArrayInitializer=function(){var Q=this.createNode(),B=[];this.expect("[");while(!this.match("]"))if(this.match(","))this.nextToken(),B.push(null);else if(this.match("...")){var Y=this.parseSpreadElement();if(!this.match("]"))this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.expect(",");B.push(Y)}else if(B.push(this.inheritCoverGrammar(this.parseAssignmentExpression)),!this.match("]"))this.expect(",");return this.expect("]"),this.finalize(Q,new E.ArrayExpression(B))},Z.prototype.parsePropertyMethod=function(Q){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var B=this.context.strict,Y=this.context.allowStrictDirective;this.context.allowStrictDirective=Q.simple;var G=this.isolateCoverGrammar(this.parseFunctionSourceElements);if(this.context.strict&&Q.firstRestricted)this.tolerateUnexpectedToken(Q.firstRestricted,Q.message);if(this.context.strict&&Q.stricted)this.tolerateUnexpectedToken(Q.stricted,Q.message);return this.context.strict=B,this.context.allowStrictDirective=Y,G},Z.prototype.parsePropertyMethodFunction=function(){var Q=!1,B=this.createNode(),Y=this.context.allowYield;this.context.allowYield=!0;var G=this.parseFormalParameters(),U=this.parsePropertyMethod(G);return this.context.allowYield=Y,this.finalize(B,new E.FunctionExpression(null,G.params,U,Q))},Z.prototype.parsePropertyMethodAsyncFunction=function(){var Q=this.createNode(),B=this.context.allowYield,Y=this.context.await;this.context.allowYield=!1,this.context.await=!0;var G=this.parseFormalParameters(),U=this.parsePropertyMethod(G);return this.context.allowYield=B,this.context.await=Y,this.finalize(Q,new E.AsyncFunctionExpression(null,G.params,U))},Z.prototype.parseObjectPropertyKey=function(){var Q=this.createNode(),B=this.nextToken(),Y;switch(B.type){case 8:case 6:if(this.context.strict&&B.octal)this.tolerateUnexpectedToken(B,I.Messages.StrictOctalLiteral);var G=this.getTokenRaw(B);Y=this.finalize(Q,new E.Literal(B.value,G));break;case 3:case 1:case 5:case 4:Y=this.finalize(Q,new E.Identifier(B.value));break;case 7:if(B.value==="[")Y=this.isolateCoverGrammar(this.parseAssignmentExpression),this.expect("]");else Y=this.throwUnexpectedToken(B);break;default:Y=this.throwUnexpectedToken(B)}return Y},Z.prototype.isPropertyKey=function(Q,B){return Q.type===M.Syntax.Identifier&&Q.name===B||Q.type===M.Syntax.Literal&&Q.value===B},Z.prototype.parseObjectProperty=function(Q){var B=this.createNode(),Y=this.lookahead,G,U=null,V=null,z=!1,P=!1,T=!1,q=!1;if(Y.type===3){var O=Y.value;this.nextToken(),z=this.match("["),q=!this.hasLineTerminator&&O==="async"&&!this.match(":")&&!this.match("(")&&!this.match("*")&&!this.match(","),U=q?this.parseObjectPropertyKey():this.finalize(B,new E.Identifier(O))}else if(this.match("*"))this.nextToken();else z=this.match("["),U=this.parseObjectPropertyKey();var N=this.qualifiedPropertyName(this.lookahead);if(Y.type===3&&!q&&Y.value==="get"&&N)G="get",z=this.match("["),U=this.parseObjectPropertyKey(),this.context.allowYield=!1,V=this.parseGetterMethod();else if(Y.type===3&&!q&&Y.value==="set"&&N)G="set",z=this.match("["),U=this.parseObjectPropertyKey(),V=this.parseSetterMethod();else if(Y.type===7&&Y.value==="*"&&N)G="init",z=this.match("["),U=this.parseObjectPropertyKey(),V=this.parseGeneratorMethod(),P=!0;else{if(!U)this.throwUnexpectedToken(this.lookahead);if(G="init",this.match(":")&&!q){if(!z&&this.isPropertyKey(U,"__proto__")){if(Q.value)this.tolerateError(I.Messages.DuplicateProtoProperty);Q.value=!0}this.nextToken(),V=this.inheritCoverGrammar(this.parseAssignmentExpression)}else if(this.match("("))V=q?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),P=!0;else if(Y.type===3){var O=this.finalize(B,new E.Identifier(Y.value));if(this.match("=")){this.context.firstCoverInitializedNameError=this.lookahead,this.nextToken(),T=!0;var x=this.isolateCoverGrammar(this.parseAssignmentExpression);V=this.finalize(B,new E.AssignmentPattern(O,x))}else T=!0,V=O}else this.throwUnexpectedToken(this.nextToken())}return this.finalize(B,new E.Property(G,U,z,V,P,T))},Z.prototype.parseObjectInitializer=function(){var Q=this.createNode();this.expect("{");var B=[],Y={value:!1};while(!this.match("}"))if(B.push(this.parseObjectProperty(Y)),!this.match("}"))this.expectCommaSeparator();return this.expect("}"),this.finalize(Q,new E.ObjectExpression(B))},Z.prototype.parseTemplateHead=function(){L.assert(this.lookahead.head,"Template literal must start with a template head");var Q=this.createNode(),B=this.nextToken(),Y=B.value,G=B.cooked;return this.finalize(Q,new E.TemplateElement({raw:Y,cooked:G},B.tail))},Z.prototype.parseTemplateElement=function(){if(this.lookahead.type!==10)this.throwUnexpectedToken();var Q=this.createNode(),B=this.nextToken(),Y=B.value,G=B.cooked;return this.finalize(Q,new E.TemplateElement({raw:Y,cooked:G},B.tail))},Z.prototype.parseTemplateLiteral=function(){var Q=this.createNode(),B=[],Y=[],G=this.parseTemplateHead();Y.push(G);while(!G.tail)B.push(this.parseExpression()),G=this.parseTemplateElement(),Y.push(G);return this.finalize(Q,new E.TemplateLiteral(Y,B))},Z.prototype.reinterpretExpressionAsPattern=function(Q){switch(Q.type){case M.Syntax.Identifier:case M.Syntax.MemberExpression:case M.Syntax.RestElement:case M.Syntax.AssignmentPattern:break;case M.Syntax.SpreadElement:Q.type=M.Syntax.RestElement,this.reinterpretExpressionAsPattern(Q.argument);break;case M.Syntax.ArrayExpression:Q.type=M.Syntax.ArrayPattern;for(var B=0;B<Q.elements.length;B++)if(Q.elements[B]!==null)this.reinterpretExpressionAsPattern(Q.elements[B]);break;case M.Syntax.ObjectExpression:Q.type=M.Syntax.ObjectPattern;for(var B=0;B<Q.properties.length;B++)this.reinterpretExpressionAsPattern(Q.properties[B].value);break;case M.Syntax.AssignmentExpression:Q.type=M.Syntax.AssignmentPattern,delete Q.operator,this.reinterpretExpressionAsPattern(Q.left);break;default:break}},Z.prototype.parseGroupExpression=function(){var Q;if(this.expect("("),this.match(")")){if(this.nextToken(),!this.match("=>"))this.expect("=>");Q={type:X,params:[],async:!1}}else{var B=this.lookahead,Y=[];if(this.match("...")){if(Q=this.parseRestElement(Y),this.expect(")"),!this.match("=>"))this.expect("=>");Q={type:X,params:[Q],async:!1}}else{var G=!1;if(this.context.isBindingElement=!0,Q=this.inheritCoverGrammar(this.parseAssignmentExpression),this.match(",")){var U=[];this.context.isAssignmentTarget=!1,U.push(Q);while(this.lookahead.type!==2){if(!this.match(","))break;if(this.nextToken(),this.match(")")){this.nextToken();for(var V=0;V<U.length;V++)this.reinterpretExpressionAsPattern(U[V]);G=!0,Q={type:X,params:U,async:!1}}else if(this.match("...")){if(!this.context.isBindingElement)this.throwUnexpectedToken(this.lookahead);if(U.push(this.parseRestElement(Y)),this.expect(")"),!this.match("=>"))this.expect("=>");this.context.isBindingElement=!1;for(var V=0;V<U.length;V++)this.reinterpretExpressionAsPattern(U[V]);G=!0,Q={type:X,params:U,async:!1}}else U.push(this.inheritCoverGrammar(this.parseAssignmentExpression));if(G)break}if(!G)Q=this.finalize(this.startNode(B),new E.SequenceExpression(U))}if(!G){if(this.expect(")"),this.match("=>")){if(Q.type===M.Syntax.Identifier&&Q.name==="yield")G=!0,Q={type:X,params:[Q],async:!1};if(!G){if(!this.context.isBindingElement)this.throwUnexpectedToken(this.lookahead);if(Q.type===M.Syntax.SequenceExpression)for(var V=0;V<Q.expressions.length;V++)this.reinterpretExpressionAsPattern(Q.expressions[V]);else this.reinterpretExpressionAsPattern(Q);var z=Q.type===M.Syntax.SequenceExpression?Q.expressions:[Q];Q={type:X,params:z,async:!1}}}this.context.isBindingElement=!1}}}return Q},Z.prototype.parseArguments=function(){this.expect("(");var Q=[];if(!this.match(")"))while(!0){var B=this.match("...")?this.parseSpreadElement():this.isolateCoverGrammar(this.parseAssignmentExpression);if(Q.push(B),this.match(")"))break;if(this.expectCommaSeparator(),this.match(")"))break}return this.expect(")"),Q},Z.prototype.isIdentifierName=function(Q){return Q.type===3||Q.type===4||Q.type===1||Q.type===5},Z.prototype.parseIdentifierName=function(){var Q=this.createNode(),B=this.nextToken();if(!this.isIdentifierName(B))this.throwUnexpectedToken(B);return this.finalize(Q,new E.Identifier(B.value))},Z.prototype.parseNewExpression=function(){var Q=this.createNode(),B=this.parseIdentifierName();L.assert(B.name==="new","New expression must start with `new`");var Y;if(this.match("."))if(this.nextToken(),this.lookahead.type===3&&this.context.inFunctionBody&&this.lookahead.value==="target"){var G=this.parseIdentifierName();Y=new E.MetaProperty(B,G)}else this.throwUnexpectedToken(this.lookahead);else{var U=this.isolateCoverGrammar(this.parseLeftHandSideExpression),V=this.match("(")?this.parseArguments():[];Y=new E.NewExpression(U,V),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return this.finalize(Q,Y)},Z.prototype.parseAsyncArgument=function(){var Q=this.parseAssignmentExpression();return this.context.firstCoverInitializedNameError=null,Q},Z.prototype.parseAsyncArguments=function(){this.expect("(");var Q=[];if(!this.match(")"))while(!0){var B=this.match("...")?this.parseSpreadElement():this.isolateCoverGrammar(this.parseAsyncArgument);if(Q.push(B),this.match(")"))break;if(this.expectCommaSeparator(),this.match(")"))break}return this.expect(")"),Q},Z.prototype.parseLeftHandSideExpressionAllowCall=function(){var Q=this.lookahead,B=this.matchContextualKeyword("async"),Y=this.context.allowIn;this.context.allowIn=!0;var G;if(this.matchKeyword("super")&&this.context.inFunctionBody){if(G=this.createNode(),this.nextToken(),G=this.finalize(G,new E.Super),!this.match("(")&&!this.match(".")&&!this.match("["))this.throwUnexpectedToken(this.lookahead)}else G=this.inheritCoverGrammar(this.matchKeyword("new")?this.parseNewExpression:this.parsePrimaryExpression);while(!0)if(this.match(".")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect(".");var U=this.parseIdentifierName();G=this.finalize(this.startNode(Q),new E.StaticMemberExpression(G,U))}else if(this.match("(")){var V=B&&Q.lineNumber===this.lookahead.lineNumber;this.context.isBindingElement=!1,this.context.isAssignmentTarget=!1;var z=V?this.parseAsyncArguments():this.parseArguments();if(G=this.finalize(this.startNode(Q),new E.CallExpression(G,z)),V&&this.match("=>")){for(var P=0;P<z.length;++P)this.reinterpretExpressionAsPattern(z[P]);G={type:X,params:z,async:!0}}}else if(this.match("[")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("[");var U=this.isolateCoverGrammar(this.parseExpression);this.expect("]"),G=this.finalize(this.startNode(Q),new E.ComputedMemberExpression(G,U))}else if(this.lookahead.type===10&&this.lookahead.head){var T=this.parseTemplateLiteral();G=this.finalize(this.startNode(Q),new E.TaggedTemplateExpression(G,T))}else break;return this.context.allowIn=Y,G},Z.prototype.parseSuper=function(){var Q=this.createNode();if(this.expectKeyword("super"),!this.match("[")&&!this.match("."))this.throwUnexpectedToken(this.lookahead);return this.finalize(Q,new E.Super)},Z.prototype.parseLeftHandSideExpression=function(){L.assert(this.context.allowIn,"callee of new expression always allow in keyword.");var Q=this.startNode(this.lookahead),B=this.matchKeyword("super")&&this.context.inFunctionBody?this.parseSuper():this.inheritCoverGrammar(this.matchKeyword("new")?this.parseNewExpression:this.parsePrimaryExpression);while(!0)if(this.match("[")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("[");var Y=this.isolateCoverGrammar(this.parseExpression);this.expect("]"),B=this.finalize(Q,new E.ComputedMemberExpression(B,Y))}else if(this.match(".")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect(".");var Y=this.parseIdentifierName();B=this.finalize(Q,new E.StaticMemberExpression(B,Y))}else if(this.lookahead.type===10&&this.lookahead.head){var G=this.parseTemplateLiteral();B=this.finalize(Q,new E.TaggedTemplateExpression(B,G))}else break;return B},Z.prototype.parseUpdateExpression=function(){var Q,B=this.lookahead;if(this.match("++")||this.match("--")){var Y=this.startNode(B),G=this.nextToken();if(Q=this.inheritCoverGrammar(this.parseUnaryExpression),this.context.strict&&Q.type===M.Syntax.Identifier&&this.scanner.isRestrictedWord(Q.name))this.tolerateError(I.Messages.StrictLHSPrefix);if(!this.context.isAssignmentTarget)this.tolerateError(I.Messages.InvalidLHSInAssignment);var U=!0;Q=this.finalize(Y,new E.UpdateExpression(G.value,Q,U)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}else if(Q=this.inheritCoverGrammar(this.parseLeftHandSideExpressionAllowCall),!this.hasLineTerminator&&this.lookahead.type===7){if(this.match("++")||this.match("--")){if(this.context.strict&&Q.type===M.Syntax.Identifier&&this.scanner.isRestrictedWord(Q.name))this.tolerateError(I.Messages.StrictLHSPostfix);if(!this.context.isAssignmentTarget)this.tolerateError(I.Messages.InvalidLHSInAssignment);this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var V=this.nextToken().value,U=!1;Q=this.finalize(this.startNode(B),new E.UpdateExpression(V,Q,U))}}return Q},Z.prototype.parseAwaitExpression=function(){var Q=this.createNode();this.nextToken();var B=this.parseUnaryExpression();return this.finalize(Q,new E.AwaitExpression(B))},Z.prototype.parseUnaryExpression=function(){var Q;if(this.match("+")||this.match("-")||this.match("~")||this.match("!")||this.matchKeyword("delete")||this.matchKeyword("void")||this.matchKeyword("typeof")){var B=this.startNode(this.lookahead),Y=this.nextToken();if(Q=this.inheritCoverGrammar(this.parseUnaryExpression),Q=this.finalize(B,new E.UnaryExpression(Y.value,Q)),this.context.strict&&Q.operator==="delete"&&Q.argument.type===M.Syntax.Identifier)this.tolerateError(I.Messages.StrictDelete);this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}else if(this.context.await&&this.matchContextualKeyword("await"))Q=this.parseAwaitExpression();else Q=this.parseUpdateExpression();return Q},Z.prototype.parseExponentiationExpression=function(){var Q=this.lookahead,B=this.inheritCoverGrammar(this.parseUnaryExpression);if(B.type!==M.Syntax.UnaryExpression&&this.match("**")){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var Y=B,G=this.isolateCoverGrammar(this.parseExponentiationExpression);B=this.finalize(this.startNode(Q),new E.BinaryExpression("**",Y,G))}return B},Z.prototype.binaryPrecedence=function(Q){var B=Q.value,Y;if(Q.type===7)Y=this.operatorPrecedence[B]||0;else if(Q.type===4)Y=B==="instanceof"||this.context.allowIn&&B==="in"?7:0;else Y=0;return Y},Z.prototype.parseBinaryExpression=function(){var Q=this.lookahead,B=this.inheritCoverGrammar(this.parseExponentiationExpression),Y=this.lookahead,G=this.binaryPrecedence(Y);if(G>0){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var U=[Q,this.lookahead],V=B,z=this.isolateCoverGrammar(this.parseExponentiationExpression),P=[V,Y.value,z],T=[G];while(!0){if(G=this.binaryPrecedence(this.lookahead),G<=0)break;while(P.length>2&&G<=T[T.length-1]){z=P.pop();var q=P.pop();T.pop(),V=P.pop(),U.pop();var O=this.startNode(U[U.length-1]);P.push(this.finalize(O,new E.BinaryExpression(q,V,z)))}P.push(this.nextToken().value),T.push(G),U.push(this.lookahead),P.push(this.isolateCoverGrammar(this.parseExponentiationExpression))}var N=P.length-1;B=P[N];var x=U.pop();while(N>1){var w=U.pop(),F=x&&x.lineStart,O=this.startNode(w,F),q=P[N-1];B=this.finalize(O,new E.BinaryExpression(q,P[N-2],B)),N-=2,x=w}}return B},Z.prototype.parseConditionalExpression=function(){var Q=this.lookahead,B=this.inheritCoverGrammar(this.parseBinaryExpression);if(this.match("?")){this.nextToken();var Y=this.context.allowIn;this.context.allowIn=!0;var G=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowIn=Y,this.expect(":");var U=this.isolateCoverGrammar(this.parseAssignmentExpression);B=this.finalize(this.startNode(Q),new E.ConditionalExpression(B,G,U)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return B},Z.prototype.checkPatternParam=function(Q,B){switch(B.type){case M.Syntax.Identifier:this.validateParam(Q,B,B.name);break;case M.Syntax.RestElement:this.checkPatternParam(Q,B.argument);break;case M.Syntax.AssignmentPattern:this.checkPatternParam(Q,B.left);break;case M.Syntax.ArrayPattern:for(var Y=0;Y<B.elements.length;Y++)if(B.elements[Y]!==null)this.checkPatternParam(Q,B.elements[Y]);break;case M.Syntax.ObjectPattern:for(var Y=0;Y<B.properties.length;Y++)this.checkPatternParam(Q,B.properties[Y].value);break;default:break}Q.simple=Q.simple&&B instanceof E.Identifier},Z.prototype.reinterpretAsCoverFormalsList=function(Q){var B=[Q],Y,G=!1;switch(Q.type){case M.Syntax.Identifier:break;case X:B=Q.params,G=Q.async;break;default:return null}Y={simple:!0,paramSet:{}};for(var U=0;U<B.length;++U){var V=B[U];if(V.type===M.Syntax.AssignmentPattern){if(V.right.type===M.Syntax.YieldExpression){if(V.right.argument)this.throwUnexpectedToken(this.lookahead);V.right.type=M.Syntax.Identifier,V.right.name="yield",delete V.right.argument,delete V.right.delegate}}else if(G&&V.type===M.Syntax.Identifier&&V.name==="await")this.throwUnexpectedToken(this.lookahead);this.checkPatternParam(Y,V),B[U]=V}if(this.context.strict||!this.context.allowYield)for(var U=0;U<B.length;++U){var V=B[U];if(V.type===M.Syntax.YieldExpression)this.throwUnexpectedToken(this.lookahead)}if(Y.message===I.Messages.StrictParamDupe){var z=this.context.strict?Y.stricted:Y.firstRestricted;this.throwUnexpectedToken(z,Y.message)}return{simple:Y.simple,params:B,stricted:Y.stricted,firstRestricted:Y.firstRestricted,message:Y.message}},Z.prototype.parseAssignmentExpression=function(){var Q;if(!this.context.allowYield&&this.matchKeyword("yield"))Q=this.parseYieldExpression();else{var B=this.lookahead,Y=B;if(Q=this.parseConditionalExpression(),Y.type===3&&Y.lineNumber===this.lookahead.lineNumber&&Y.value==="async"){if(this.lookahead.type===3||this.matchKeyword("yield")){var G=this.parsePrimaryExpression();this.reinterpretExpressionAsPattern(G),Q={type:X,params:[G],async:!0}}}if(Q.type===X||this.match("=>")){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var U=Q.async,V=this.reinterpretAsCoverFormalsList(Q);if(V){if(this.hasLineTerminator)this.tolerateUnexpectedToken(this.lookahead);this.context.firstCoverInitializedNameError=null;var z=this.context.strict,P=this.context.allowStrictDirective;this.context.allowStrictDirective=V.simple;var T=this.context.allowYield,q=this.context.await;this.context.allowYield=!0,this.context.await=U;var O=this.startNode(B);this.expect("=>");var N=void 0;if(this.match("{")){var x=this.context.allowIn;this.context.allowIn=!0,N=this.parseFunctionSourceElements(),this.context.allowIn=x}else N=this.isolateCoverGrammar(this.parseAssignmentExpression);var w=N.type!==M.Syntax.BlockStatement;if(this.context.strict&&V.firstRestricted)this.throwUnexpectedToken(V.firstRestricted,V.message);if(this.context.strict&&V.stricted)this.tolerateUnexpectedToken(V.stricted,V.message);Q=U?this.finalize(O,new E.AsyncArrowFunctionExpression(V.params,N,w)):this.finalize(O,new E.ArrowFunctionExpression(V.params,N,w)),this.context.strict=z,this.context.allowStrictDirective=P,this.context.allowYield=T,this.context.await=q}}else if(this.matchAssign()){if(!this.context.isAssignmentTarget)this.tolerateError(I.Messages.InvalidLHSInAssignment);if(this.context.strict&&Q.type===M.Syntax.Identifier){var F=Q;if(this.scanner.isRestrictedWord(F.name))this.tolerateUnexpectedToken(Y,I.Messages.StrictLHSAssignment);if(this.scanner.isStrictModeReservedWord(F.name))this.tolerateUnexpectedToken(Y,I.Messages.StrictReservedWord)}if(!this.match("="))this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;else this.reinterpretExpressionAsPattern(Q);Y=this.nextToken();var f=Y.value,j=this.isolateCoverGrammar(this.parseAssignmentExpression);Q=this.finalize(this.startNode(B),new E.AssignmentExpression(f,Q,j)),this.context.firstCoverInitializedNameError=null}}return Q},Z.prototype.parseExpression=function(){var Q=this.lookahead,B=this.isolateCoverGrammar(this.parseAssignmentExpression);if(this.match(",")){var Y=[];Y.push(B);while(this.lookahead.type!==2){if(!this.match(","))break;this.nextToken(),Y.push(this.isolateCoverGrammar(this.parseAssignmentExpression))}B=this.finalize(this.startNode(Q),new E.SequenceExpression(Y))}return B},Z.prototype.parseStatementListItem=function(){var Q;if(this.context.isAssignmentTarget=!0,this.context.isBindingElement=!0,this.lookahead.type===4)switch(this.lookahead.value){case"export":if(!this.context.isModule)this.tolerateUnexpectedToken(this.lookahead,I.Messages.IllegalExportDeclaration);Q=this.parseExportDeclaration();break;case"import":if(!this.context.isModule)this.tolerateUnexpectedToken(this.lookahead,I.Messages.IllegalImportDeclaration);Q=this.parseImportDeclaration();break;case"const":Q=this.parseLexicalDeclaration({inFor:!1});break;case"function":Q=this.parseFunctionDeclaration();break;case"class":Q=this.parseClassDeclaration();break;case"let":Q=this.isLexicalDeclaration()?this.parseLexicalDeclaration({inFor:!1}):this.parseStatement();break;default:Q=this.parseStatement();break}else Q=this.parseStatement();return Q},Z.prototype.parseBlock=function(){var Q=this.createNode();this.expect("{");var B=[];while(!0){if(this.match("}"))break;B.push(this.parseStatementListItem())}return this.expect("}"),this.finalize(Q,new E.BlockStatement(B))},Z.prototype.parseLexicalBinding=function(Q,B){var Y=this.createNode(),G=[],U=this.parsePattern(G,Q);if(this.context.strict&&U.type===M.Syntax.Identifier){if(this.scanner.isRestrictedWord(U.name))this.tolerateError(I.Messages.StrictVarName)}var V=null;if(Q==="const"){if(!this.matchKeyword("in")&&!this.matchContextualKeyword("of"))if(this.match("="))this.nextToken(),V=this.isolateCoverGrammar(this.parseAssignmentExpression);else this.throwError(I.Messages.DeclarationMissingInitializer,"const")}else if(!B.inFor&&U.type!==M.Syntax.Identifier||this.match("="))this.expect("="),V=this.isolateCoverGrammar(this.parseAssignmentExpression);return this.finalize(Y,new E.VariableDeclarator(U,V))},Z.prototype.parseBindingList=function(Q,B){var Y=[this.parseLexicalBinding(Q,B)];while(this.match(","))this.nextToken(),Y.push(this.parseLexicalBinding(Q,B));return Y},Z.prototype.isLexicalDeclaration=function(){var Q=this.scanner.saveState();this.scanner.scanComments();var B=this.scanner.lex();return this.scanner.restoreState(Q),B.type===3||B.type===7&&B.value==="["||B.type===7&&B.value==="{"||B.type===4&&B.value==="let"||B.type===4&&B.value==="yield"},Z.prototype.parseLexicalDeclaration=function(Q){var B=this.createNode(),Y=this.nextToken().value;L.assert(Y==="let"||Y==="const","Lexical declaration must be either let or const");var G=this.parseBindingList(Y,Q);return this.consumeSemicolon(),this.finalize(B,new E.VariableDeclaration(G,Y))},Z.prototype.parseBindingRestElement=function(Q,B){var Y=this.createNode();this.expect("...");var G=this.parsePattern(Q,B);return this.finalize(Y,new E.RestElement(G))},Z.prototype.parseArrayPattern=function(Q,B){var Y=this.createNode();this.expect("[");var G=[];while(!this.match("]"))if(this.match(","))this.nextToken(),G.push(null);else{if(this.match("...")){G.push(this.parseBindingRestElement(Q,B));break}else G.push(this.parsePatternWithDefault(Q,B));if(!this.match("]"))this.expect(",")}return this.expect("]"),this.finalize(Y,new E.ArrayPattern(G))},Z.prototype.parsePropertyPattern=function(Q,B){var Y=this.createNode(),G=!1,U=!1,V=!1,z,P;if(this.lookahead.type===3){var T=this.lookahead;z=this.parseVariableIdentifier();var q=this.finalize(Y,new E.Identifier(T.value));if(this.match("=")){Q.push(T),U=!0,this.nextToken();var O=this.parseAssignmentExpression();P=this.finalize(this.startNode(T),new E.AssignmentPattern(q,O))}else if(!this.match(":"))Q.push(T),U=!0,P=q;else this.expect(":"),P=this.parsePatternWithDefault(Q,B)}else G=this.match("["),z=this.parseObjectPropertyKey(),this.expect(":"),P=this.parsePatternWithDefault(Q,B);return this.finalize(Y,new E.Property("init",z,G,P,V,U))},Z.prototype.parseObjectPattern=function(Q,B){var Y=this.createNode(),G=[];this.expect("{");while(!this.match("}"))if(G.push(this.parsePropertyPattern(Q,B)),!this.match("}"))this.expect(",");return this.expect("}"),this.finalize(Y,new E.ObjectPattern(G))},Z.prototype.parsePattern=function(Q,B){var Y;if(this.match("["))Y=this.parseArrayPattern(Q,B);else if(this.match("{"))Y=this.parseObjectPattern(Q,B);else{if(this.matchKeyword("let")&&(B==="const"||B==="let"))this.tolerateUnexpectedToken(this.lookahead,I.Messages.LetInLexicalBinding);Q.push(this.lookahead),Y=this.parseVariableIdentifier(B)}return Y},Z.prototype.parsePatternWithDefault=function(Q,B){var Y=this.lookahead,G=this.parsePattern(Q,B);if(this.match("=")){this.nextToken();var U=this.context.allowYield;this.context.allowYield=!0;var V=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowYield=U,G=this.finalize(this.startNode(Y),new E.AssignmentPattern(G,V))}return G},Z.prototype.parseVariableIdentifier=function(Q){var B=this.createNode(),Y=this.nextToken();if(Y.type===4&&Y.value==="yield"){if(this.context.strict)this.tolerateUnexpectedToken(Y,I.Messages.StrictReservedWord);else if(!this.context.allowYield)this.throwUnexpectedToken(Y)}else if(Y.type!==3){if(this.context.strict&&Y.type===4&&this.scanner.isStrictModeReservedWord(Y.value))this.tolerateUnexpectedToken(Y,I.Messages.StrictReservedWord);else if(this.context.strict||Y.value!=="let"||Q!=="var")this.throwUnexpectedToken(Y)}else if((this.context.isModule||this.context.await)&&Y.type===3&&Y.value==="await")this.tolerateUnexpectedToken(Y);return this.finalize(B,new E.Identifier(Y.value))},Z.prototype.parseVariableDeclaration=function(Q){var B=this.createNode(),Y=[],G=this.parsePattern(Y,"var");if(this.context.strict&&G.type===M.Syntax.Identifier){if(this.scanner.isRestrictedWord(G.name))this.tolerateError(I.Messages.StrictVarName)}var U=null;if(this.match("="))this.nextToken(),U=this.isolateCoverGrammar(this.parseAssignmentExpression);else if(G.type!==M.Syntax.Identifier&&!Q.inFor)this.expect("=");return this.finalize(B,new E.VariableDeclarator(G,U))},Z.prototype.parseVariableDeclarationList=function(Q){var B={inFor:Q.inFor},Y=[];Y.push(this.parseVariableDeclaration(B));while(this.match(","))this.nextToken(),Y.push(this.parseVariableDeclaration(B));return Y},Z.prototype.parseVariableStatement=function(){var Q=this.createNode();this.expectKeyword("var");var B=this.parseVariableDeclarationList({inFor:!1});return this.consumeSemicolon(),this.finalize(Q,new E.VariableDeclaration(B,"var"))},Z.prototype.parseEmptyStatement=function(){var Q=this.createNode();return this.expect(";"),this.finalize(Q,new E.EmptyStatement)},Z.prototype.parseExpressionStatement=function(){var Q=this.createNode(),B=this.parseExpression();return this.consumeSemicolon(),this.finalize(Q,new E.ExpressionStatement(B))},Z.prototype.parseIfClause=function(){if(this.context.strict&&this.matchKeyword("function"))this.tolerateError(I.Messages.StrictFunction);return this.parseStatement()},Z.prototype.parseIfStatement=function(){var Q=this.createNode(),B,Y=null;this.expectKeyword("if"),this.expect("(");var G=this.parseExpression();if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),B=this.finalize(this.createNode(),new E.EmptyStatement);else if(this.expect(")"),B=this.parseIfClause(),this.matchKeyword("else"))this.nextToken(),Y=this.parseIfClause();return this.finalize(Q,new E.IfStatement(G,B,Y))},Z.prototype.parseDoWhileStatement=function(){var Q=this.createNode();this.expectKeyword("do");var B=this.context.inIteration;this.context.inIteration=!0;var Y=this.parseStatement();this.context.inIteration=B,this.expectKeyword("while"),this.expect("(");var G=this.parseExpression();if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken());else if(this.expect(")"),this.match(";"))this.nextToken();return this.finalize(Q,new E.DoWhileStatement(Y,G))},Z.prototype.parseWhileStatement=function(){var Q=this.createNode(),B;this.expectKeyword("while"),this.expect("(");var Y=this.parseExpression();if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),B=this.finalize(this.createNode(),new E.EmptyStatement);else{this.expect(")");var G=this.context.inIteration;this.context.inIteration=!0,B=this.parseStatement(),this.context.inIteration=G}return this.finalize(Q,new E.WhileStatement(Y,B))},Z.prototype.parseForStatement=function(){var Q=null,B=null,Y=null,G=!0,U,V,z=this.createNode();if(this.expectKeyword("for"),this.expect("("),this.match(";"))this.nextToken();else if(this.matchKeyword("var")){Q=this.createNode(),this.nextToken();var P=this.context.allowIn;this.context.allowIn=!1;var T=this.parseVariableDeclarationList({inFor:!0});if(this.context.allowIn=P,T.length===1&&this.matchKeyword("in")){var q=T[0];if(q.init&&(q.id.type===M.Syntax.ArrayPattern||q.id.type===M.Syntax.ObjectPattern||this.context.strict))this.tolerateError(I.Messages.ForInOfLoopInitializer,"for-in");Q=this.finalize(Q,new E.VariableDeclaration(T,"var")),this.nextToken(),U=Q,V=this.parseExpression(),Q=null}else if(T.length===1&&T[0].init===null&&this.matchContextualKeyword("of"))Q=this.finalize(Q,new E.VariableDeclaration(T,"var")),this.nextToken(),U=Q,V=this.parseAssignmentExpression(),Q=null,G=!1;else Q=this.finalize(Q,new E.VariableDeclaration(T,"var")),this.expect(";")}else if(this.matchKeyword("const")||this.matchKeyword("let")){Q=this.createNode();var O=this.nextToken().value;if(!this.context.strict&&this.lookahead.value==="in")Q=this.finalize(Q,new E.Identifier(O)),this.nextToken(),U=Q,V=this.parseExpression(),Q=null;else{var P=this.context.allowIn;this.context.allowIn=!1;var T=this.parseBindingList(O,{inFor:!0});if(this.context.allowIn=P,T.length===1&&T[0].init===null&&this.matchKeyword("in"))Q=this.finalize(Q,new E.VariableDeclaration(T,O)),this.nextToken(),U=Q,V=this.parseExpression(),Q=null;else if(T.length===1&&T[0].init===null&&this.matchContextualKeyword("of"))Q=this.finalize(Q,new E.VariableDeclaration(T,O)),this.nextToken(),U=Q,V=this.parseAssignmentExpression(),Q=null,G=!1;else this.consumeSemicolon(),Q=this.finalize(Q,new E.VariableDeclaration(T,O))}}else{var N=this.lookahead,P=this.context.allowIn;if(this.context.allowIn=!1,Q=this.inheritCoverGrammar(this.parseAssignmentExpression),this.context.allowIn=P,this.matchKeyword("in")){if(!this.context.isAssignmentTarget||Q.type===M.Syntax.AssignmentExpression)this.tolerateError(I.Messages.InvalidLHSInForIn);this.nextToken(),this.reinterpretExpressionAsPattern(Q),U=Q,V=this.parseExpression(),Q=null}else if(this.matchContextualKeyword("of")){if(!this.context.isAssignmentTarget||Q.type===M.Syntax.AssignmentExpression)this.tolerateError(I.Messages.InvalidLHSInForLoop);this.nextToken(),this.reinterpretExpressionAsPattern(Q),U=Q,V=this.parseAssignmentExpression(),Q=null,G=!1}else{if(this.match(",")){var x=[Q];while(this.match(","))this.nextToken(),x.push(this.isolateCoverGrammar(this.parseAssignmentExpression));Q=this.finalize(this.startNode(N),new E.SequenceExpression(x))}this.expect(";")}}if(typeof U>"u"){if(!this.match(";"))B=this.parseExpression();if(this.expect(";"),!this.match(")"))Y=this.parseExpression()}var w;if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),w=this.finalize(this.createNode(),new E.EmptyStatement);else{this.expect(")");var F=this.context.inIteration;this.context.inIteration=!0,w=this.isolateCoverGrammar(this.parseStatement),this.context.inIteration=F}return typeof U>"u"?this.finalize(z,new E.ForStatement(Q,B,Y,w)):G?this.finalize(z,new E.ForInStatement(U,V,w)):this.finalize(z,new E.ForOfStatement(U,V,w))},Z.prototype.parseContinueStatement=function(){var Q=this.createNode();this.expectKeyword("continue");var B=null;if(this.lookahead.type===3&&!this.hasLineTerminator){var Y=this.parseVariableIdentifier();B=Y;var G="$"+Y.name;if(!Object.prototype.hasOwnProperty.call(this.context.labelSet,G))this.throwError(I.Messages.UnknownLabel,Y.name)}if(this.consumeSemicolon(),B===null&&!this.context.inIteration)this.throwError(I.Messages.IllegalContinue);return this.finalize(Q,new E.ContinueStatement(B))},Z.prototype.parseBreakStatement=function(){var Q=this.createNode();this.expectKeyword("break");var B=null;if(this.lookahead.type===3&&!this.hasLineTerminator){var Y=this.parseVariableIdentifier(),G="$"+Y.name;if(!Object.prototype.hasOwnProperty.call(this.context.labelSet,G))this.throwError(I.Messages.UnknownLabel,Y.name);B=Y}if(this.consumeSemicolon(),B===null&&!this.context.inIteration&&!this.context.inSwitch)this.throwError(I.Messages.IllegalBreak);return this.finalize(Q,new E.BreakStatement(B))},Z.prototype.parseReturnStatement=function(){if(!this.context.inFunctionBody)this.tolerateError(I.Messages.IllegalReturn);var Q=this.createNode();this.expectKeyword("return");var B=!this.match(";")&&!this.match("}")&&!this.hasLineTerminator&&this.lookahead.type!==2||this.lookahead.type===8||this.lookahead.type===10,Y=B?this.parseExpression():null;return this.consumeSemicolon(),this.finalize(Q,new E.ReturnStatement(Y))},Z.prototype.parseWithStatement=function(){if(this.context.strict)this.tolerateError(I.Messages.StrictModeWith);var Q=this.createNode(),B;this.expectKeyword("with"),this.expect("(");var Y=this.parseExpression();if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),B=this.finalize(this.createNode(),new E.EmptyStatement);else this.expect(")"),B=this.parseStatement();return this.finalize(Q,new E.WithStatement(Y,B))},Z.prototype.parseSwitchCase=function(){var Q=this.createNode(),B;if(this.matchKeyword("default"))this.nextToken(),B=null;else this.expectKeyword("case"),B=this.parseExpression();this.expect(":");var Y=[];while(!0){if(this.match("}")||this.matchKeyword("default")||this.matchKeyword("case"))break;Y.push(this.parseStatementListItem())}return this.finalize(Q,new E.SwitchCase(B,Y))},Z.prototype.parseSwitchStatement=function(){var Q=this.createNode();this.expectKeyword("switch"),this.expect("(");var B=this.parseExpression();this.expect(")");var Y=this.context.inSwitch;this.context.inSwitch=!0;var G=[],U=!1;this.expect("{");while(!0){if(this.match("}"))break;var V=this.parseSwitchCase();if(V.test===null){if(U)this.throwError(I.Messages.MultipleDefaultsInSwitch);U=!0}G.push(V)}return this.expect("}"),this.context.inSwitch=Y,this.finalize(Q,new E.SwitchStatement(B,G))},Z.prototype.parseLabelledStatement=function(){var Q=this.createNode(),B=this.parseExpression(),Y;if(B.type===M.Syntax.Identifier&&this.match(":")){this.nextToken();var G=B,U="$"+G.name;if(Object.prototype.hasOwnProperty.call(this.context.labelSet,U))this.throwError(I.Messages.Redeclaration,"Label",G.name);this.context.labelSet[U]=!0;var V=void 0;if(this.matchKeyword("class"))this.tolerateUnexpectedToken(this.lookahead),V=this.parseClassDeclaration();else if(this.matchKeyword("function")){var z=this.lookahead,P=this.parseFunctionDeclaration();if(this.context.strict)this.tolerateUnexpectedToken(z,I.Messages.StrictFunction);else if(P.generator)this.tolerateUnexpectedToken(z,I.Messages.GeneratorInLegacyContext);V=P}else V=this.parseStatement();delete this.context.labelSet[U],Y=new E.LabeledStatement(G,V)}else this.consumeSemicolon(),Y=new E.ExpressionStatement(B);return this.finalize(Q,Y)},Z.prototype.parseThrowStatement=function(){var Q=this.createNode();if(this.expectKeyword("throw"),this.hasLineTerminator)this.throwError(I.Messages.NewlineAfterThrow);var B=this.parseExpression();return this.consumeSemicolon(),this.finalize(Q,new E.ThrowStatement(B))},Z.prototype.parseCatchClause=function(){var Q=this.createNode();if(this.expectKeyword("catch"),this.expect("("),this.match(")"))this.throwUnexpectedToken(this.lookahead);var B=[],Y=this.parsePattern(B),G={};for(var U=0;U<B.length;U++){var V="$"+B[U].value;if(Object.prototype.hasOwnProperty.call(G,V))this.tolerateError(I.Messages.DuplicateBinding,B[U].value);G[V]=!0}if(this.context.strict&&Y.type===M.Syntax.Identifier){if(this.scanner.isRestrictedWord(Y.name))this.tolerateError(I.Messages.StrictCatchVariable)}this.expect(")");var z=this.parseBlock();return this.finalize(Q,new E.CatchClause(Y,z))},Z.prototype.parseFinallyClause=function(){return this.expectKeyword("finally"),this.parseBlock()},Z.prototype.parseTryStatement=function(){var Q=this.createNode();this.expectKeyword("try");var B=this.parseBlock(),Y=this.matchKeyword("catch")?this.parseCatchClause():null,G=this.matchKeyword("finally")?this.parseFinallyClause():null;if(!Y&&!G)this.throwError(I.Messages.NoCatchOrFinally);return this.finalize(Q,new E.TryStatement(B,Y,G))},Z.prototype.parseDebuggerStatement=function(){var Q=this.createNode();return this.expectKeyword("debugger"),this.consumeSemicolon(),this.finalize(Q,new E.DebuggerStatement)},Z.prototype.parseStatement=function(){var Q;switch(this.lookahead.type){case 1:case 5:case 6:case 8:case 10:case 9:Q=this.parseExpressionStatement();break;case 7:var B=this.lookahead.value;if(B==="{")Q=this.parseBlock();else if(B==="(")Q=this.parseExpressionStatement();else if(B===";")Q=this.parseEmptyStatement();else Q=this.parseExpressionStatement();break;case 3:Q=this.matchAsyncFunction()?this.parseFunctionDeclaration():this.parseLabelledStatement();break;case 4:switch(this.lookahead.value){case"break":Q=this.parseBreakStatement();break;case"continue":Q=this.parseContinueStatement();break;case"debugger":Q=this.parseDebuggerStatement();break;case"do":Q=this.parseDoWhileStatement();break;case"for":Q=this.parseForStatement();break;case"function":Q=this.parseFunctionDeclaration();break;case"if":Q=this.parseIfStatement();break;case"return":Q=this.parseReturnStatement();break;case"switch":Q=this.parseSwitchStatement();break;case"throw":Q=this.parseThrowStatement();break;case"try":Q=this.parseTryStatement();break;case"var":Q=this.parseVariableStatement();break;case"while":Q=this.parseWhileStatement();break;case"with":Q=this.parseWithStatement();break;default:Q=this.parseExpressionStatement();break}break;default:Q=this.throwUnexpectedToken(this.lookahead)}return Q},Z.prototype.parseFunctionSourceElements=function(){var Q=this.createNode();this.expect("{");var B=this.parseDirectivePrologues(),Y=this.context.labelSet,G=this.context.inIteration,U=this.context.inSwitch,V=this.context.inFunctionBody;this.context.labelSet={},this.context.inIteration=!1,this.context.inSwitch=!1,this.context.inFunctionBody=!0;while(this.lookahead.type!==2){if(this.match("}"))break;B.push(this.parseStatementListItem())}return this.expect("}"),this.context.labelSet=Y,this.context.inIteration=G,this.context.inSwitch=U,this.context.inFunctionBody=V,this.finalize(Q,new E.BlockStatement(B))},Z.prototype.validateParam=function(Q,B,Y){var G="$"+Y;if(this.context.strict){if(this.scanner.isRestrictedWord(Y))Q.stricted=B,Q.message=I.Messages.StrictParamName;if(Object.prototype.hasOwnProperty.call(Q.paramSet,G))Q.stricted=B,Q.message=I.Messages.StrictParamDupe}else if(!Q.firstRestricted){if(this.scanner.isRestrictedWord(Y))Q.firstRestricted=B,Q.message=I.Messages.StrictParamName;else if(this.scanner.isStrictModeReservedWord(Y))Q.firstRestricted=B,Q.message=I.Messages.StrictReservedWord;else if(Object.prototype.hasOwnProperty.call(Q.paramSet,G))Q.stricted=B,Q.message=I.Messages.StrictParamDupe}if(typeof Object.defineProperty==="function")Object.defineProperty(Q.paramSet,G,{value:!0,enumerable:!0,writable:!0,configurable:!0});else Q.paramSet[G]=!0},Z.prototype.parseRestElement=function(Q){var B=this.createNode();this.expect("...");var Y=this.parsePattern(Q);if(this.match("="))this.throwError(I.Messages.DefaultRestParameter);if(!this.match(")"))this.throwError(I.Messages.ParameterAfterRestParameter);return this.finalize(B,new E.RestElement(Y))},Z.prototype.parseFormalParameter=function(Q){var B=[],Y=this.match("...")?this.parseRestElement(B):this.parsePatternWithDefault(B);for(var G=0;G<B.length;G++)this.validateParam(Q,B[G],B[G].value);Q.simple=Q.simple&&Y instanceof E.Identifier,Q.params.push(Y)},Z.prototype.parseFormalParameters=function(Q){var B={simple:!0,params:[],firstRestricted:Q};if(this.expect("("),!this.match(")")){B.paramSet={};while(this.lookahead.type!==2){if(this.parseFormalParameter(B),this.match(")"))break;if(this.expect(","),this.match(")"))break}}return this.expect(")"),{simple:B.simple,params:B.params,stricted:B.stricted,firstRestricted:B.firstRestricted,message:B.message}},Z.prototype.matchAsyncFunction=function(){var Q=this.matchContextualKeyword("async");if(Q){var B=this.scanner.saveState();this.scanner.scanComments();var Y=this.scanner.lex();this.scanner.restoreState(B),Q=B.lineNumber===Y.lineNumber&&Y.type===4&&Y.value==="function"}return Q},Z.prototype.parseFunctionDeclaration=function(Q){var B=this.createNode(),Y=this.matchContextualKeyword("async");if(Y)this.nextToken();this.expectKeyword("function");var G=Y?!1:this.match("*");if(G)this.nextToken();var U,V=null,z=null;if(!Q||!this.match("(")){var P=this.lookahead;if(V=this.parseVariableIdentifier(),this.context.strict){if(this.scanner.isRestrictedWord(P.value))this.tolerateUnexpectedToken(P,I.Messages.StrictFunctionName)}else if(this.scanner.isRestrictedWord(P.value))z=P,U=I.Messages.StrictFunctionName;else if(this.scanner.isStrictModeReservedWord(P.value))z=P,U=I.Messages.StrictReservedWord}var T=this.context.await,q=this.context.allowYield;this.context.await=Y,this.context.allowYield=!G;var O=this.parseFormalParameters(z),N=O.params,x=O.stricted;if(z=O.firstRestricted,O.message)U=O.message;var w=this.context.strict,F=this.context.allowStrictDirective;this.context.allowStrictDirective=O.simple;var f=this.parseFunctionSourceElements();if(this.context.strict&&z)this.throwUnexpectedToken(z,U);if(this.context.strict&&x)this.tolerateUnexpectedToken(x,U);return this.context.strict=w,this.context.allowStrictDirective=F,this.context.await=T,this.context.allowYield=q,Y?this.finalize(B,new E.AsyncFunctionDeclaration(V,N,f)):this.finalize(B,new E.FunctionDeclaration(V,N,f,G))},Z.prototype.parseFunctionExpression=function(){var Q=this.createNode(),B=this.matchContextualKeyword("async");if(B)this.nextToken();this.expectKeyword("function");var Y=B?!1:this.match("*");if(Y)this.nextToken();var G,U=null,V,z=this.context.await,P=this.context.allowYield;if(this.context.await=B,this.context.allowYield=!Y,!this.match("(")){var T=this.lookahead;if(U=!this.context.strict&&!Y&&this.matchKeyword("yield")?this.parseIdentifierName():this.parseVariableIdentifier(),this.context.strict){if(this.scanner.isRestrictedWord(T.value))this.tolerateUnexpectedToken(T,I.Messages.StrictFunctionName)}else if(this.scanner.isRestrictedWord(T.value))V=T,G=I.Messages.StrictFunctionName;else if(this.scanner.isStrictModeReservedWord(T.value))V=T,G=I.Messages.StrictReservedWord}var q=this.parseFormalParameters(V),O=q.params,N=q.stricted;if(V=q.firstRestricted,q.message)G=q.message;var x=this.context.strict,w=this.context.allowStrictDirective;this.context.allowStrictDirective=q.simple;var F=this.parseFunctionSourceElements();if(this.context.strict&&V)this.throwUnexpectedToken(V,G);if(this.context.strict&&N)this.tolerateUnexpectedToken(N,G);return this.context.strict=x,this.context.allowStrictDirective=w,this.context.await=z,this.context.allowYield=P,B?this.finalize(Q,new E.AsyncFunctionExpression(U,O,F)):this.finalize(Q,new E.FunctionExpression(U,O,F,Y))},Z.prototype.parseDirective=function(){var Q=this.lookahead,B=this.createNode(),Y=this.parseExpression(),G=Y.type===M.Syntax.Literal?this.getTokenRaw(Q).slice(1,-1):null;return this.consumeSemicolon(),this.finalize(B,G?new E.Directive(Y,G):new E.ExpressionStatement(Y))},Z.prototype.parseDirectivePrologues=function(){var Q=null,B=[];while(!0){var Y=this.lookahead;if(Y.type!==8)break;var G=this.parseDirective();B.push(G);var U=G.directive;if(typeof U!=="string")break;if(U==="use strict"){if(this.context.strict=!0,Q)this.tolerateUnexpectedToken(Q,I.Messages.StrictOctalLiteral);if(!this.context.allowStrictDirective)this.tolerateUnexpectedToken(Y,I.Messages.IllegalLanguageModeDirective)}else if(!Q&&Y.octal)Q=Y}return B},Z.prototype.qualifiedPropertyName=function(Q){switch(Q.type){case 3:case 8:case 1:case 5:case 6:case 4:return!0;case 7:return Q.value==="[";default:break}return!1},Z.prototype.parseGetterMethod=function(){var Q=this.createNode(),B=!1,Y=this.context.allowYield;this.context.allowYield=!B;var G=this.parseFormalParameters();if(G.params.length>0)this.tolerateError(I.Messages.BadGetterArity);var U=this.parsePropertyMethod(G);return this.context.allowYield=Y,this.finalize(Q,new E.FunctionExpression(null,G.params,U,B))},Z.prototype.parseSetterMethod=function(){var Q=this.createNode(),B=!1,Y=this.context.allowYield;this.context.allowYield=!B;var G=this.parseFormalParameters();if(G.params.length!==1)this.tolerateError(I.Messages.BadSetterArity);else if(G.params[0]instanceof E.RestElement)this.tolerateError(I.Messages.BadSetterRestParameter);var U=this.parsePropertyMethod(G);return this.context.allowYield=Y,this.finalize(Q,new E.FunctionExpression(null,G.params,U,B))},Z.prototype.parseGeneratorMethod=function(){var Q=this.createNode(),B=!0,Y=this.context.allowYield;this.context.allowYield=!0;var G=this.parseFormalParameters();this.context.allowYield=!1;var U=this.parsePropertyMethod(G);return this.context.allowYield=Y,this.finalize(Q,new E.FunctionExpression(null,G.params,U,B))},Z.prototype.isStartOfExpression=function(){var Q=!0,B=this.lookahead.value;switch(this.lookahead.type){case 7:Q=B==="["||B==="("||B==="{"||B==="+"||B==="-"||B==="!"||B==="~"||B==="++"||B==="--"||B==="/"||B==="/=";break;case 4:Q=B==="class"||B==="delete"||B==="function"||B==="let"||B==="new"||B==="super"||B==="this"||B==="typeof"||B==="void"||B==="yield";break;default:break}return Q},Z.prototype.parseYieldExpression=function(){var Q=this.createNode();this.expectKeyword("yield");var B=null,Y=!1;if(!this.hasLineTerminator){var G=this.context.allowYield;if(this.context.allowYield=!1,Y=this.match("*"),Y)this.nextToken(),B=this.parseAssignmentExpression();else if(this.isStartOfExpression())B=this.parseAssignmentExpression();this.context.allowYield=G}return this.finalize(Q,new E.YieldExpression(B,Y))},Z.prototype.parseClassElement=function(Q){var B=this.lookahead,Y=this.createNode(),G="",U=null,V=null,z=!1,P=!1,T=!1,q=!1;if(this.match("*"))this.nextToken();else{z=this.match("["),U=this.parseObjectPropertyKey();var O=U;if(O.name==="static"&&(this.qualifiedPropertyName(this.lookahead)||this.match("*")))if(B=this.lookahead,T=!0,z=this.match("["),this.match("*"))this.nextToken();else U=this.parseObjectPropertyKey();if(B.type===3&&!this.hasLineTerminator&&B.value==="async"){var N=this.lookahead.value;if(N!==":"&&N!=="("&&N!=="*"){if(q=!0,B=this.lookahead,U=this.parseObjectPropertyKey(),B.type===3&&B.value==="constructor")this.tolerateUnexpectedToken(B,I.Messages.ConstructorIsAsync)}}}var x=this.qualifiedPropertyName(this.lookahead);if(B.type===3){if(B.value==="get"&&x)G="get",z=this.match("["),U=this.parseObjectPropertyKey(),this.context.allowYield=!1,V=this.parseGetterMethod();else if(B.value==="set"&&x)G="set",z=this.match("["),U=this.parseObjectPropertyKey(),V=this.parseSetterMethod()}else if(B.type===7&&B.value==="*"&&x)G="init",z=this.match("["),U=this.parseObjectPropertyKey(),V=this.parseGeneratorMethod(),P=!0;if(!G&&U&&this.match("("))G="init",V=q?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),P=!0;if(!G)this.throwUnexpectedToken(this.lookahead);if(G==="init")G="method";if(!z){if(T&&this.isPropertyKey(U,"prototype"))this.throwUnexpectedToken(B,I.Messages.StaticPrototype);if(!T&&this.isPropertyKey(U,"constructor")){if(G!=="method"||!P||V&&V.generator)this.throwUnexpectedToken(B,I.Messages.ConstructorSpecialMethod);if(Q.value)this.throwUnexpectedToken(B,I.Messages.DuplicateConstructor);else Q.value=!0;G="constructor"}}return this.finalize(Y,new E.MethodDefinition(U,z,V,G,T))},Z.prototype.parseClassElementList=function(){var Q=[],B={value:!1};this.expect("{");while(!this.match("}"))if(this.match(";"))this.nextToken();else Q.push(this.parseClassElement(B));return this.expect("}"),Q},Z.prototype.parseClassBody=function(){var Q=this.createNode(),B=this.parseClassElementList();return this.finalize(Q,new E.ClassBody(B))},Z.prototype.parseClassDeclaration=function(Q){var B=this.createNode(),Y=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var G=Q&&this.lookahead.type!==3?null:this.parseVariableIdentifier(),U=null;if(this.matchKeyword("extends"))this.nextToken(),U=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall);var V=this.parseClassBody();return this.context.strict=Y,this.finalize(B,new E.ClassDeclaration(G,U,V))},Z.prototype.parseClassExpression=function(){var Q=this.createNode(),B=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var Y=this.lookahead.type===3?this.parseVariableIdentifier():null,G=null;if(this.matchKeyword("extends"))this.nextToken(),G=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall);var U=this.parseClassBody();return this.context.strict=B,this.finalize(Q,new E.ClassExpression(Y,G,U))},Z.prototype.parseModule=function(){this.context.strict=!0,this.context.isModule=!0,this.scanner.isModule=!0;var Q=this.createNode(),B=this.parseDirectivePrologues();while(this.lookahead.type!==2)B.push(this.parseStatementListItem());return this.finalize(Q,new E.Module(B))},Z.prototype.parseScript=function(){var Q=this.createNode(),B=this.parseDirectivePrologues();while(this.lookahead.type!==2)B.push(this.parseStatementListItem());return this.finalize(Q,new E.Script(B))},Z.prototype.parseModuleSpecifier=function(){var Q=this.createNode();if(this.lookahead.type!==8)this.throwError(I.Messages.InvalidModuleSpecifier);var B=this.nextToken(),Y=this.getTokenRaw(B);return this.finalize(Q,new E.Literal(B.value,Y))},Z.prototype.parseImportSpecifier=function(){var Q=this.createNode(),B,Y;if(this.lookahead.type===3){if(B=this.parseVariableIdentifier(),Y=B,this.matchContextualKeyword("as"))this.nextToken(),Y=this.parseVariableIdentifier()}else if(B=this.parseIdentifierName(),Y=B,this.matchContextualKeyword("as"))this.nextToken(),Y=this.parseVariableIdentifier();else this.throwUnexpectedToken(this.nextToken());return this.finalize(Q,new E.ImportSpecifier(Y,B))},Z.prototype.parseNamedImports=function(){this.expect("{");var Q=[];while(!this.match("}"))if(Q.push(this.parseImportSpecifier()),!this.match("}"))this.expect(",");return this.expect("}"),Q},Z.prototype.parseImportDefaultSpecifier=function(){var Q=this.createNode(),B=this.parseIdentifierName();return this.finalize(Q,new E.ImportDefaultSpecifier(B))},Z.prototype.parseImportNamespaceSpecifier=function(){var Q=this.createNode();if(this.expect("*"),!this.matchContextualKeyword("as"))this.throwError(I.Messages.NoAsAfterImportNamespace);this.nextToken();var B=this.parseIdentifierName();return this.finalize(Q,new E.ImportNamespaceSpecifier(B))},Z.prototype.parseImportDeclaration=function(){if(this.context.inFunctionBody)this.throwError(I.Messages.IllegalImportDeclaration);var Q=this.createNode();this.expectKeyword("import");var B,Y=[];if(this.lookahead.type===8)B=this.parseModuleSpecifier();else{if(this.match("{"))Y=Y.concat(this.parseNamedImports());else if(this.match("*"))Y.push(this.parseImportNamespaceSpecifier());else if(this.isIdentifierName(this.lookahead)&&!this.matchKeyword("default")){if(Y.push(this.parseImportDefaultSpecifier()),this.match(","))if(this.nextToken(),this.match("*"))Y.push(this.parseImportNamespaceSpecifier());else if(this.match("{"))Y=Y.concat(this.parseNamedImports());else this.throwUnexpectedToken(this.lookahead)}else this.throwUnexpectedToken(this.nextToken());if(!this.matchContextualKeyword("from")){var G=this.lookahead.value?I.Messages.UnexpectedToken:I.Messages.MissingFromClause;this.throwError(G,this.lookahead.value)}this.nextToken(),B=this.parseModuleSpecifier()}return this.consumeSemicolon(),this.finalize(Q,new E.ImportDeclaration(Y,B))},Z.prototype.parseExportSpecifier=function(){var Q=this.createNode(),B=this.parseIdentifierName(),Y=B;if(this.matchContextualKeyword("as"))this.nextToken(),Y=this.parseIdentifierName();return this.finalize(Q,new E.ExportSpecifier(B,Y))},Z.prototype.parseExportDeclaration=function(){if(this.context.inFunctionBody)this.throwError(I.Messages.IllegalExportDeclaration);var Q=this.createNode();this.expectKeyword("export");var B;if(this.matchKeyword("default"))if(this.nextToken(),this.matchKeyword("function")){var Y=this.parseFunctionDeclaration(!0);B=this.finalize(Q,new E.ExportDefaultDeclaration(Y))}else if(this.matchKeyword("class")){var Y=this.parseClassDeclaration(!0);B=this.finalize(Q,new E.ExportDefaultDeclaration(Y))}else if(this.matchContextualKeyword("async")){var Y=this.matchAsyncFunction()?this.parseFunctionDeclaration(!0):this.parseAssignmentExpression();B=this.finalize(Q,new E.ExportDefaultDeclaration(Y))}else{if(this.matchContextualKeyword("from"))this.throwError(I.Messages.UnexpectedToken,this.lookahead.value);var Y=this.match("{")?this.parseObjectInitializer():this.match("[")?this.parseArrayInitializer():this.parseAssignmentExpression();this.consumeSemicolon(),B=this.finalize(Q,new E.ExportDefaultDeclaration(Y))}else if(this.match("*")){if(this.nextToken(),!this.matchContextualKeyword("from")){var G=this.lookahead.value?I.Messages.UnexpectedToken:I.Messages.MissingFromClause;this.throwError(G,this.lookahead.value)}this.nextToken();var U=this.parseModuleSpecifier();this.consumeSemicolon(),B=this.finalize(Q,new E.ExportAllDeclaration(U))}else if(this.lookahead.type===4){var Y=void 0;switch(this.lookahead.value){case"let":case"const":Y=this.parseLexicalDeclaration({inFor:!1});break;case"var":case"class":case"function":Y=this.parseStatementListItem();break;default:this.throwUnexpectedToken(this.lookahead)}B=this.finalize(Q,new E.ExportNamedDeclaration(Y,[],null))}else if(this.matchAsyncFunction()){var Y=this.parseFunctionDeclaration();B=this.finalize(Q,new E.ExportNamedDeclaration(Y,[],null))}else{var V=[],z=null,P=!1;this.expect("{");while(!this.match("}"))if(P=P||this.matchKeyword("default"),V.push(this.parseExportSpecifier()),!this.match("}"))this.expect(",");if(this.expect("}"),this.matchContextualKeyword("from"))this.nextToken(),z=this.parseModuleSpecifier(),this.consumeSemicolon();else if(P){var G=this.lookahead.value?I.Messages.UnexpectedToken:I.Messages.MissingFromClause;this.throwError(G,this.lookahead.value)}else this.consumeSemicolon();B=this.finalize(Q,new E.ExportNamedDeclaration(null,V,z))}return B},Z}();$.Parser=J},function(H,$){Object.defineProperty($,"__esModule",{value:!0});function A(L,D){if(!L)throw Error("ASSERT: "+D)}$.assert=A},function(H,$){Object.defineProperty($,"__esModule",{value:!0});var A=function(){function L(){this.errors=[],this.tolerant=!1}return L.prototype.recordError=function(D){this.errors.push(D)},L.prototype.tolerate=function(D){if(this.tolerant)this.recordError(D);else throw D},L.prototype.constructError=function(D,I){var E=Error(D);try{throw E}catch(K){if(Object.create&&Object.defineProperty)E=Object.create(K),Object.defineProperty(E,"column",{value:I})}return E},L.prototype.createError=function(D,I,E,K){var M="Line "+I+": "+K,W=this.constructError(M,E);return W.index=D,W.lineNumber=I,W.description=K,W},L.prototype.throwError=function(D,I,E,K){throw this.createError(D,I,E,K)},L.prototype.tolerateError=function(D,I,E,K){var M=this.createError(D,I,E,K);if(this.tolerant)this.recordError(M);else throw M},L}();$.ErrorHandler=A},function(H,$){Object.defineProperty($,"__esModule",{value:!0}),$.Messages={BadGetterArity:"Getter must not have any formal parameters",BadSetterArity:"Setter must have exactly one formal parameter",BadSetterRestParameter:"Setter function argument must not be a rest parameter",ConstructorIsAsync:"Class constructor may not be an async method",ConstructorSpecialMethod:"Class constructor may not be an accessor",DeclarationMissingInitializer:"Missing initializer in %0 declaration",DefaultRestParameter:"Unexpected token =",DuplicateBinding:"Duplicate binding %0",DuplicateConstructor:"A class may only have one constructor",DuplicateProtoProperty:"Duplicate __proto__ fields are not allowed in object literals",ForInOfLoopInitializer:"%0 loop variable declaration may not have an initializer",GeneratorInLegacyContext:"Generator declarations are not allowed in legacy contexts",IllegalBreak:"Illegal break statement",IllegalContinue:"Illegal continue statement",IllegalExportDeclaration:"Unexpected token",IllegalImportDeclaration:"Unexpected token",IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list",IllegalReturn:"Illegal return statement",InvalidEscapedReservedWord:"Keyword must not contain escaped characters",InvalidHexEscapeSequence:"Invalid hexadecimal escape sequence",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",InvalidLHSInForLoop:"Invalid left-hand side in for-loop",InvalidModuleSpecifier:"Unexpected token",InvalidRegExp:"Invalid regular expression",LetInLexicalBinding:"let is disallowed as a lexically bound name",MissingFromClause:"Unexpected token",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NewlineAfterThrow:"Illegal newline after throw",NoAsAfterImportNamespace:"Unexpected token",NoCatchOrFinally:"Missing catch or finally after try",ParameterAfterRestParameter:"Rest parameter must be last formal parameter",Redeclaration:"%0 '%1' has already been declared",StaticPrototype:"Classes may not have static property named prototype",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictModeWith:"Strict mode code may not include a with statement",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictReservedWord:"Use of future reserved word in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",TemplateOctalLiteral:"Octal literals are not allowed in template strings.",UnexpectedEOS:"Unexpected end of input",UnexpectedIdentifier:"Unexpected identifier",UnexpectedNumber:"Unexpected number",UnexpectedReserved:"Unexpected reserved word",UnexpectedString:"Unexpected string",UnexpectedTemplate:"Unexpected quasi %0",UnexpectedToken:"Unexpected token %0",UnexpectedTokenIllegal:"Unexpected token ILLEGAL",UnknownLabel:"Undefined label '%0'",UnterminatedRegExp:"Invalid regular expression: missing /"}},function(H,$,A){Object.defineProperty($,"__esModule",{value:!0});var L=A(9),D=A(4),I=A(11);function E(W){return"0123456789abcdef".indexOf(W.toLowerCase())}function K(W){return"01234567".indexOf(W)}var M=function(){function W(X,J){this.source=X,this.errorHandler=J,this.trackComment=!1,this.isModule=!1,this.length=X.length,this.index=0,this.lineNumber=X.length>0?1:0,this.lineStart=0,this.curlyStack=[]}return W.prototype.saveState=function(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart}},W.prototype.restoreState=function(X){this.index=X.index,this.lineNumber=X.lineNumber,this.lineStart=X.lineStart},W.prototype.eof=function(){return this.index>=this.length},W.prototype.throwUnexpectedToken=function(X){if(X===void 0)X=I.Messages.UnexpectedTokenIllegal;return this.errorHandler.throwError(this.index,this.lineNumber,this.index-this.lineStart+1,X)},W.prototype.tolerateUnexpectedToken=function(X){if(X===void 0)X=I.Messages.UnexpectedTokenIllegal;this.errorHandler.tolerateError(this.index,this.lineNumber,this.index-this.lineStart+1,X)},W.prototype.skipSingleLineComment=function(X){var J=[],Z,Q;if(this.trackComment)J=[],Z=this.index-X,Q={start:{line:this.lineNumber,column:this.index-this.lineStart-X},end:{}};while(!this.eof()){var B=this.source.charCodeAt(this.index);if(++this.index,D.Character.isLineTerminator(B)){if(this.trackComment){Q.end={line:this.lineNumber,column:this.index-this.lineStart-1};var Y={multiLine:!1,slice:[Z+X,this.index-1],range:[Z,this.index-1],loc:Q};J.push(Y)}if(B===13&&this.source.charCodeAt(this.index)===10)++this.index;return++this.lineNumber,this.lineStart=this.index,J}}if(this.trackComment){Q.end={line:this.lineNumber,column:this.index-this.lineStart};var Y={multiLine:!1,slice:[Z+X,this.index],range:[Z,this.index],loc:Q};J.push(Y)}return J},W.prototype.skipMultiLineComment=function(){var X=[],J,Z;if(this.trackComment)X=[],J=this.index-2,Z={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{}};while(!this.eof()){var Q=this.source.charCodeAt(this.index);if(D.Character.isLineTerminator(Q)){if(Q===13&&this.source.charCodeAt(this.index+1)===10)++this.index;++this.lineNumber,++this.index,this.lineStart=this.index}else if(Q===42){if(this.source.charCodeAt(this.index+1)===47){if(this.index+=2,this.trackComment){Z.end={line:this.lineNumber,column:this.index-this.lineStart};var B={multiLine:!0,slice:[J+2,this.index-2],range:[J,this.index],loc:Z};X.push(B)}return X}++this.index}else++this.index}if(this.trackComment){Z.end={line:this.lineNumber,column:this.index-this.lineStart};var B={multiLine:!0,slice:[J+2,this.index],range:[J,this.index],loc:Z};X.push(B)}return this.tolerateUnexpectedToken(),X},W.prototype.scanComments=function(){var X;if(this.trackComment)X=[];var J=this.index===0;while(!this.eof()){var Z=this.source.charCodeAt(this.index);if(D.Character.isWhiteSpace(Z))++this.index;else if(D.Character.isLineTerminator(Z)){if(++this.index,Z===13&&this.source.charCodeAt(this.index)===10)++this.index;++this.lineNumber,this.lineStart=this.index,J=!0}else if(Z===47)if(Z=this.source.charCodeAt(this.index+1),Z===47){this.index+=2;var Q=this.skipSingleLineComment(2);if(this.trackComment)X=X.concat(Q);J=!0}else if(Z===42){this.index+=2;var Q=this.skipMultiLineComment();if(this.trackComment)X=X.concat(Q)}else break;else if(J&&Z===45)if(this.source.charCodeAt(this.index+1)===45&&this.source.charCodeAt(this.index+2)===62){this.index+=3;var Q=this.skipSingleLineComment(3);if(this.trackComment)X=X.concat(Q)}else break;else if(Z===60&&!this.isModule)if(this.source.slice(this.index+1,this.index+4)==="!--"){this.index+=4;var Q=this.skipSingleLineComment(4);if(this.trackComment)X=X.concat(Q)}else break;else break}return X},W.prototype.isFutureReservedWord=function(X){switch(X){case"enum":case"export":case"import":case"super":return!0;default:return!1}},W.prototype.isStrictModeReservedWord=function(X){switch(X){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}},W.prototype.isRestrictedWord=function(X){return X==="eval"||X==="arguments"},W.prototype.isKeyword=function(X){switch(X.length){case 2:return X==="if"||X==="in"||X==="do";case 3:return X==="var"||X==="for"||X==="new"||X==="try"||X==="let";case 4:return X==="this"||X==="else"||X==="case"||X==="void"||X==="with"||X==="enum";case 5:return X==="while"||X==="break"||X==="catch"||X==="throw"||X==="const"||X==="yield"||X==="class"||X==="super";case 6:return X==="return"||X==="typeof"||X==="delete"||X==="switch"||X==="export"||X==="import";case 7:return X==="default"||X==="finally"||X==="extends";case 8:return X==="function"||X==="continue"||X==="debugger";case 10:return X==="instanceof";default:return!1}},W.prototype.codePointAt=function(X){var J=this.source.charCodeAt(X);if(J>=55296&&J<=56319){var Z=this.source.charCodeAt(X+1);if(Z>=56320&&Z<=57343){var Q=J;J=(Q-55296)*1024+Z-56320+65536}}return J},W.prototype.scanHexEscape=function(X){var J=X==="u"?4:2,Z=0;for(var Q=0;Q<J;++Q)if(!this.eof()&&D.Character.isHexDigit(this.source.charCodeAt(this.index)))Z=Z*16+E(this.source[this.index++]);else return null;return String.fromCharCode(Z)},W.prototype.scanUnicodeCodePointEscape=function(){var X=this.source[this.index],J=0;if(X==="}")this.throwUnexpectedToken();while(!this.eof()){if(X=this.source[this.index++],!D.Character.isHexDigit(X.charCodeAt(0)))break;J=J*16+E(X)}if(J>1114111||X!=="}")this.throwUnexpectedToken();return D.Character.fromCodePoint(J)},W.prototype.getIdentifier=function(){var X=this.index++;while(!this.eof()){var J=this.source.charCodeAt(this.index);if(J===92)return this.index=X,this.getComplexIdentifier();else if(J>=55296&&J<57343)return this.index=X,this.getComplexIdentifier();if(D.Character.isIdentifierPart(J))++this.index;else break}return this.source.slice(X,this.index)},W.prototype.getComplexIdentifier=function(){var X=this.codePointAt(this.index),J=D.Character.fromCodePoint(X);this.index+=J.length;var Z;if(X===92){if(this.source.charCodeAt(this.index)!==117)this.throwUnexpectedToken();if(++this.index,this.source[this.index]==="{")++this.index,Z=this.scanUnicodeCodePointEscape();else if(Z=this.scanHexEscape("u"),Z===null||Z==="\\"||!D.Character.isIdentifierStart(Z.charCodeAt(0)))this.throwUnexpectedToken();J=Z}while(!this.eof()){if(X=this.codePointAt(this.index),!D.Character.isIdentifierPart(X))break;if(Z=D.Character.fromCodePoint(X),J+=Z,this.index+=Z.length,X===92){if(J=J.substr(0,J.length-1),this.source.charCodeAt(this.index)!==117)this.throwUnexpectedToken();if(++this.index,this.source[this.index]==="{")++this.index,Z=this.scanUnicodeCodePointEscape();else if(Z=this.scanHexEscape("u"),Z===null||Z==="\\"||!D.Character.isIdentifierPart(Z.charCodeAt(0)))this.throwUnexpectedToken();J+=Z}}return J},W.prototype.octalToDecimal=function(X){var J=X!=="0",Z=K(X);if(!this.eof()&&D.Character.isOctalDigit(this.source.charCodeAt(this.index))){if(J=!0,Z=Z*8+K(this.source[this.index++]),"0123".indexOf(X)>=0&&!this.eof()&&D.Character.isOctalDigit(this.source.charCodeAt(this.index)))Z=Z*8+K(this.source[this.index++])}return{code:Z,octal:J}},W.prototype.scanIdentifier=function(){var X,J=this.index,Z=this.source.charCodeAt(J)===92?this.getComplexIdentifier():this.getIdentifier();if(Z.length===1)X=3;else if(this.isKeyword(Z))X=4;else if(Z==="null")X=5;else if(Z==="true"||Z==="false")X=1;else X=3;if(X!==3&&J+Z.length!==this.index){var Q=this.index;this.index=J,this.tolerateUnexpectedToken(I.Messages.InvalidEscapedReservedWord),this.index=Q}return{type:X,value:Z,lineNumber:this.lineNumber,lineStart:this.lineStart,start:J,end:this.index}},W.prototype.scanPunctuator=function(){var X=this.index,J=this.source[this.index];switch(J){case"(":case"{":if(J==="{")this.curlyStack.push("{");++this.index;break;case".":if(++this.index,this.source[this.index]==="."&&this.source[this.index+1]===".")this.index+=2,J="...";break;case"}":++this.index,this.curlyStack.pop();break;case")":case";":case",":case"[":case"]":case":":case"?":case"~":++this.index;break;default:if(J=this.source.substr(this.index,4),J===">>>=")this.index+=4;else if(J=J.substr(0,3),J==="==="||J==="!=="||J===">>>"||J==="<<="||J===">>="||J==="**=")this.index+=3;else if(J=J.substr(0,2),J==="&&"||J==="||"||J==="=="||J==="!="||J==="+="||J==="-="||J==="*="||J==="/="||J==="++"||J==="--"||J==="<<"||J===">>"||J==="&="||J==="|="||J==="^="||J==="%="||J==="<="||J===">="||J==="=>"||J==="**")this.index+=2;else if(J=this.source[this.index],"<>=!+-*%&|^/".indexOf(J)>=0)++this.index}if(this.index===X)this.throwUnexpectedToken();return{type:7,value:J,lineNumber:this.lineNumber,lineStart:this.lineStart,start:X,end:this.index}},W.prototype.scanHexLiteral=function(X){var J="";while(!this.eof()){if(!D.Character.isHexDigit(this.source.charCodeAt(this.index)))break;J+=this.source[this.index++]}if(J.length===0)this.throwUnexpectedToken();if(D.Character.isIdentifierStart(this.source.charCodeAt(this.index)))this.throwUnexpectedToken();return{type:6,value:parseInt("0x"+J,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:X,end:this.index}},W.prototype.scanBinaryLiteral=function(X){var J="",Z;while(!this.eof()){if(Z=this.source[this.index],Z!=="0"&&Z!=="1")break;J+=this.source[this.index++]}if(J.length===0)this.throwUnexpectedToken();if(!this.eof()){if(Z=this.source.charCodeAt(this.index),D.Character.isIdentifierStart(Z)||D.Character.isDecimalDigit(Z))this.throwUnexpectedToken()}return{type:6,value:parseInt(J,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:X,end:this.index}},W.prototype.scanOctalLiteral=function(X,J){var Z="",Q=!1;if(D.Character.isOctalDigit(X.charCodeAt(0)))Q=!0,Z="0"+this.source[this.index++];else++this.index;while(!this.eof()){if(!D.Character.isOctalDigit(this.source.charCodeAt(this.index)))break;Z+=this.source[this.index++]}if(!Q&&Z.length===0)this.throwUnexpectedToken();if(D.Character.isIdentifierStart(this.source.charCodeAt(this.index))||D.Character.isDecimalDigit(this.source.charCodeAt(this.index)))this.throwUnexpectedToken();return{type:6,value:parseInt(Z,8),octal:Q,lineNumber:this.lineNumber,lineStart:this.lineStart,start:J,end:this.index}},W.prototype.isImplicitOctalLiteral=function(){for(var X=this.index+1;X<this.length;++X){var J=this.source[X];if(J==="8"||J==="9")return!1;if(!D.Character.isOctalDigit(J.charCodeAt(0)))return!0}return!0},W.prototype.scanNumericLiteral=function(){var X=this.index,J=this.source[X];L.assert(D.Character.isDecimalDigit(J.charCodeAt(0))||J===".","Numeric literal must start with a decimal digit or a decimal point");var Z="";if(J!=="."){if(Z=this.source[this.index++],J=this.source[this.index],Z==="0"){if(J==="x"||J==="X")return++this.index,this.scanHexLiteral(X);if(J==="b"||J==="B")return++this.index,this.scanBinaryLiteral(X);if(J==="o"||J==="O")return this.scanOctalLiteral(J,X);if(J&&D.Character.isOctalDigit(J.charCodeAt(0))){if(this.isImplicitOctalLiteral())return this.scanOctalLiteral(J,X)}}while(D.Character.isDecimalDigit(this.source.charCodeAt(this.index)))Z+=this.source[this.index++];J=this.source[this.index]}if(J==="."){Z+=this.source[this.index++];while(D.Character.isDecimalDigit(this.source.charCodeAt(this.index)))Z+=this.source[this.index++];J=this.source[this.index]}if(J==="e"||J==="E"){if(Z+=this.source[this.index++],J=this.source[this.index],J==="+"||J==="-")Z+=this.source[this.index++];if(D.Character.isDecimalDigit(this.source.charCodeAt(this.index)))while(D.Character.isDecimalDigit(this.source.charCodeAt(this.index)))Z+=this.source[this.index++];else this.throwUnexpectedToken()}if(D.Character.isIdentifierStart(this.source.charCodeAt(this.index)))this.throwUnexpectedToken();return{type:6,value:parseFloat(Z),lineNumber:this.lineNumber,lineStart:this.lineStart,start:X,end:this.index}},W.prototype.scanStringLiteral=function(){var X=this.index,J=this.source[X];L.assert(J==="'"||J==='"',"String literal must starts with a quote"),++this.index;var Z=!1,Q="";while(!this.eof()){var B=this.source[this.index++];if(B===J){J="";break}else if(B==="\\")if(B=this.source[this.index++],!B||!D.Character.isLineTerminator(B.charCodeAt(0)))switch(B){case"u":if(this.source[this.index]==="{")++this.index,Q+=this.scanUnicodeCodePointEscape();else{var Y=this.scanHexEscape(B);if(Y===null)this.throwUnexpectedToken();Q+=Y}break;case"x":var G=this.scanHexEscape(B);if(G===null)this.throwUnexpectedToken(I.Messages.InvalidHexEscapeSequence);Q+=G;break;case"n":Q+=`
|
|
329
|
+
`;break;case"r":Q+="\r";break;case"t":Q+="\t";break;case"b":Q+="\b";break;case"f":Q+="\f";break;case"v":Q+="\v";break;case"8":case"9":Q+=B,this.tolerateUnexpectedToken();break;default:if(B&&D.Character.isOctalDigit(B.charCodeAt(0))){var U=this.octalToDecimal(B);Z=U.octal||Z,Q+=String.fromCharCode(U.code)}else Q+=B;break}else{if(++this.lineNumber,B==="\r"&&this.source[this.index]===`
|
|
330
|
+
`)++this.index;this.lineStart=this.index}else if(D.Character.isLineTerminator(B.charCodeAt(0)))break;else Q+=B}if(J!=="")this.index=X,this.throwUnexpectedToken();return{type:8,value:Q,octal:Z,lineNumber:this.lineNumber,lineStart:this.lineStart,start:X,end:this.index}},W.prototype.scanTemplate=function(){var X="",J=!1,Z=this.index,Q=this.source[Z]==="`",B=!1,Y=2;++this.index;while(!this.eof()){var G=this.source[this.index++];if(G==="`"){Y=1,B=!0,J=!0;break}else if(G==="$"){if(this.source[this.index]==="{"){this.curlyStack.push("${"),++this.index,J=!0;break}X+=G}else if(G==="\\")if(G=this.source[this.index++],!D.Character.isLineTerminator(G.charCodeAt(0)))switch(G){case"n":X+=`
|
|
331
|
+
`;break;case"r":X+="\r";break;case"t":X+="\t";break;case"u":if(this.source[this.index]==="{")++this.index,X+=this.scanUnicodeCodePointEscape();else{var U=this.index,V=this.scanHexEscape(G);if(V!==null)X+=V;else this.index=U,X+=G}break;case"x":var z=this.scanHexEscape(G);if(z===null)this.throwUnexpectedToken(I.Messages.InvalidHexEscapeSequence);X+=z;break;case"b":X+="\b";break;case"f":X+="\f";break;case"v":X+="\v";break;default:if(G==="0"){if(D.Character.isDecimalDigit(this.source.charCodeAt(this.index)))this.throwUnexpectedToken(I.Messages.TemplateOctalLiteral);X+="\x00"}else if(D.Character.isOctalDigit(G.charCodeAt(0)))this.throwUnexpectedToken(I.Messages.TemplateOctalLiteral);else X+=G;break}else{if(++this.lineNumber,G==="\r"&&this.source[this.index]===`
|
|
332
|
+
`)++this.index;this.lineStart=this.index}else if(D.Character.isLineTerminator(G.charCodeAt(0))){if(++this.lineNumber,G==="\r"&&this.source[this.index]===`
|
|
333
|
+
`)++this.index;this.lineStart=this.index,X+=`
|
|
334
|
+
`}else X+=G}if(!J)this.throwUnexpectedToken();if(!Q)this.curlyStack.pop();return{type:10,value:this.source.slice(Z+1,this.index-Y),cooked:X,head:Q,tail:B,lineNumber:this.lineNumber,lineStart:this.lineStart,start:Z,end:this.index}},W.prototype.testRegExp=function(X,J){var Z="",Q=X,B=this;if(J.indexOf("u")>=0)Q=Q.replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g,function(Y,G,U){var V=parseInt(G||U,16);if(V>1114111)B.throwUnexpectedToken(I.Messages.InvalidRegExp);if(V<=65535)return String.fromCharCode(V);return Z}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Z);try{RegExp(Q)}catch(Y){this.throwUnexpectedToken(I.Messages.InvalidRegExp)}try{return new RegExp(X,J)}catch(Y){return null}},W.prototype.scanRegExpBody=function(){var X=this.source[this.index];L.assert(X==="/","Regular expression literal must start with a slash");var J=this.source[this.index++],Z=!1,Q=!1;while(!this.eof())if(X=this.source[this.index++],J+=X,X==="\\"){if(X=this.source[this.index++],D.Character.isLineTerminator(X.charCodeAt(0)))this.throwUnexpectedToken(I.Messages.UnterminatedRegExp);J+=X}else if(D.Character.isLineTerminator(X.charCodeAt(0)))this.throwUnexpectedToken(I.Messages.UnterminatedRegExp);else if(Z){if(X==="]")Z=!1}else if(X==="/"){Q=!0;break}else if(X==="[")Z=!0;if(!Q)this.throwUnexpectedToken(I.Messages.UnterminatedRegExp);return J.substr(1,J.length-2)},W.prototype.scanRegExpFlags=function(){var X="",J="";while(!this.eof()){var Z=this.source[this.index];if(!D.Character.isIdentifierPart(Z.charCodeAt(0)))break;if(++this.index,Z==="\\"&&!this.eof())if(Z=this.source[this.index],Z==="u"){++this.index;var Q=this.index,B=this.scanHexEscape("u");if(B!==null){J+=B;for(X+="\\u";Q<this.index;++Q)X+=this.source[Q]}else this.index=Q,J+="u",X+="\\u";this.tolerateUnexpectedToken()}else X+="\\",this.tolerateUnexpectedToken();else J+=Z,X+=Z}return J},W.prototype.scanRegExp=function(){var X=this.index,J=this.scanRegExpBody(),Z=this.scanRegExpFlags(),Q=this.testRegExp(J,Z);return{type:9,value:"",pattern:J,flags:Z,regex:Q,lineNumber:this.lineNumber,lineStart:this.lineStart,start:X,end:this.index}},W.prototype.lex=function(){if(this.eof())return{type:2,value:"",lineNumber:this.lineNumber,lineStart:this.lineStart,start:this.index,end:this.index};var X=this.source.charCodeAt(this.index);if(D.Character.isIdentifierStart(X))return this.scanIdentifier();if(X===40||X===41||X===59)return this.scanPunctuator();if(X===39||X===34)return this.scanStringLiteral();if(X===46){if(D.Character.isDecimalDigit(this.source.charCodeAt(this.index+1)))return this.scanNumericLiteral();return this.scanPunctuator()}if(D.Character.isDecimalDigit(X))return this.scanNumericLiteral();if(X===96||X===125&&this.curlyStack[this.curlyStack.length-1]==="${")return this.scanTemplate();if(X>=55296&&X<57343){if(D.Character.isIdentifierStart(this.codePointAt(this.index)))return this.scanIdentifier()}return this.scanPunctuator()},W}();$.Scanner=M},function(H,$){Object.defineProperty($,"__esModule",{value:!0}),$.TokenName={},$.TokenName[1]="Boolean",$.TokenName[2]="<end>",$.TokenName[3]="Identifier",$.TokenName[4]="Keyword",$.TokenName[5]="Null",$.TokenName[6]="Numeric",$.TokenName[7]="Punctuator",$.TokenName[8]="String",$.TokenName[9]="RegularExpression",$.TokenName[10]="Template"},function(H,$){Object.defineProperty($,"__esModule",{value:!0}),$.XHTMLEntities={quot:'"',amp:"&",apos:"'",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",lang:"⟨",rang:"⟩"}},function(H,$,A){Object.defineProperty($,"__esModule",{value:!0});var L=A(10),D=A(12),I=A(13),E=function(){function M(){this.values=[],this.curly=this.paren=-1}return M.prototype.beforeFunctionExpression=function(W){return["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","**","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="].indexOf(W)>=0},M.prototype.isRegexStart=function(){var W=this.values[this.values.length-1],X=W!==null;switch(W){case"this":case"]":X=!1;break;case")":var J=this.values[this.paren-1];X=J==="if"||J==="while"||J==="for"||J==="with";break;case"}":if(X=!1,this.values[this.curly-3]==="function"){var Z=this.values[this.curly-4];X=Z?!this.beforeFunctionExpression(Z):!1}else if(this.values[this.curly-4]==="function"){var Z=this.values[this.curly-5];X=Z?!this.beforeFunctionExpression(Z):!0}break;default:break}return X},M.prototype.push=function(W){if(W.type===7||W.type===4){if(W.value==="{")this.curly=this.values.length;else if(W.value==="(")this.paren=this.values.length;this.values.push(W.value)}else this.values.push(null)},M}(),K=function(){function M(W,X){this.errorHandler=new L.ErrorHandler,this.errorHandler.tolerant=X?typeof X.tolerant==="boolean"&&X.tolerant:!1,this.scanner=new D.Scanner(W,this.errorHandler),this.scanner.trackComment=X?typeof X.comment==="boolean"&&X.comment:!1,this.trackRange=X?typeof X.range==="boolean"&&X.range:!1,this.trackLoc=X?typeof X.loc==="boolean"&&X.loc:!1,this.buffer=[],this.reader=new E}return M.prototype.errors=function(){return this.errorHandler.errors},M.prototype.getNextToken=function(){if(this.buffer.length===0){var W=this.scanner.scanComments();if(this.scanner.trackComment)for(var X=0;X<W.length;++X){var J=W[X],Z=this.scanner.source.slice(J.slice[0],J.slice[1]),Q={type:J.multiLine?"BlockComment":"LineComment",value:Z};if(this.trackRange)Q.range=J.range;if(this.trackLoc)Q.loc=J.loc;this.buffer.push(Q)}if(!this.scanner.eof()){var B=void 0;if(this.trackLoc)B={start:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart},end:{}};var Y=this.scanner.source[this.scanner.index]==="/"&&this.reader.isRegexStart(),G=Y?this.scanner.scanRegExp():this.scanner.lex();this.reader.push(G);var U={type:I.TokenName[G.type],value:this.scanner.source.slice(G.start,G.end)};if(this.trackRange)U.range=[G.start,G.end];if(this.trackLoc)B.end={line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart},U.loc=B;if(G.type===9){var{pattern:V,flags:z}=G;U.regex={pattern:V,flags:z}}this.buffer.push(U)}}return this.buffer.shift()},M}();$.Tokenizer=K}])})});var CX=n((z0H)=>{function E0H(H){if(Array.isArray)return Array.isArray(H);return VX(H)==="[object Array]"}z0H.isArray=E0H;function K0H(H){return typeof H==="boolean"}z0H.isBoolean=K0H;function M0H(H){return H===null}z0H.isNull=M0H;function X0H(H){return H==null}z0H.isNullOrUndefined=X0H;function W0H(H){return typeof H==="number"}z0H.isNumber=W0H;function Q0H(H){return typeof H==="string"}z0H.isString=Q0H;function B0H(H){return typeof H==="symbol"}z0H.isSymbol=B0H;function J0H(H){return H===void 0}z0H.isUndefined=J0H;function Z0H(H){return VX(H)==="[object RegExp]"}z0H.isRegExp=Z0H;function Y0H(H){return typeof H==="object"&&H!==null}z0H.isObject=Y0H;function G0H(H){return VX(H)==="[object Date]"}z0H.isDate=G0H;function U0H(H){return VX(H)==="[object Error]"||H instanceof Error}z0H.isError=U0H;function V0H(H){return typeof H==="function"}z0H.isFunction=V0H;function C0H(H){return H===null||typeof H==="boolean"||typeof H==="number"||typeof H==="string"||typeof H==="symbol"||typeof H>"u"}z0H.isPrimitive=C0H;z0H.isBuffer=ZH("buffer").Buffer.isBuffer;function VX(H){return Object.prototype.toString.call(H)}});var rw=n((ZgH,sw)=>{var cw=[1,10,100,1000,1e4,1e5,1e6,1e7,1e8,1e9],MH,lw=(H)=>H<1e5?H<100?H<10?0:1:H<1e4?H<1000?2:3:4:H<1e7?H<1e6?5:6:H<1e9?H<1e8?7:8:9;function iw(H,$){if(H===$)return 0;if(~~H===H&&~~$===$){if(H===0||$===0)return H<$?-1:1;if(H<0||$<0){if($>=0)return-1;if(H>=0)return 1;H=-H,$=-$}let D=lw(H),I=lw($),E=0;if(D<I)H*=cw[I-D-1],$/=10,E=-1;else if(D>I)$*=cw[D-I-1],H/=10,E=1;if(H===$)return E;return H<$?-1:1}let A=String(H),L=String($);if(A===L)return 0;return A<L?-1:1}function v0H(H){let $=0;while(H>=32)$|=H&1,H>>=1;return H+$}function nw(H,$,A,L){let D=$+1;if(D===A)return 1;if(L(H[D++],H[$])<0){while(D<A&&L(H[D],H[D-1])<0)D++;aw(H,$,D),aw(MH,$,D)}else while(D<A&&L(H[D],H[D-1])>=0)D++;return D-$}function aw(H,$,A){A--;while($<A){let L=H[$];H[$++]=H[A],H[A--]=L}}function tw(H,$,A,L,D){if(L===$)L++;for(;L<A;L++){let I=H[L],E=MH[L],K=$,M=L;while(K<M){let X=K+M>>>1;if(D(I,H[X])<0)M=X;else K=X+1}let W=L-K;switch(W){case 3:H[K+3]=H[K+2],MH[K+3]=MH[K+2];case 2:H[K+2]=H[K+1],MH[K+2]=MH[K+1];case 1:H[K+1]=H[K],MH[K+1]=MH[K];break;default:while(W>0)H[K+W]=H[K+W-1],MH[K+W]=MH[K+W-1],W--}H[K]=I,MH[K]=E}}function H5(H,$,A,L,D,I){let E=0,K=0,M=1;if(I(H,$[A+D])>0){K=L-D;while(M<K&&I(H,$[A+D+M])>0)if(E=M,M=(M<<1)+1,M<=0)M=K;if(M>K)M=K;E+=D,M+=D}else{K=D+1;while(M<K&&I(H,$[A+D-M])<=0)if(E=M,M=(M<<1)+1,M<=0)M=K;if(M>K)M=K;let W=E;E=D-M,M=D-W}E++;while(E<M){let W=E+(M-E>>>1);if(I(H,$[A+W])>0)E=W+1;else M=W}return M}function $5(H,$,A,L,D,I){let E=0,K=0,M=1;if(I(H,$[A+D])<0){K=D+1;while(M<K&&I(H,$[A+D-M])<0)if(E=M,M=(M<<1)+1,M<=0)M=K;if(M>K)M=K;let W=E;E=D-M,M=D-W}else{K=L-D;while(M<K&&I(H,$[A+D+M])>=0)if(E=M,M=(M<<1)+1,M<=0)M=K;if(M>K)M=K;E+=D,M+=D}E++;while(E<M){let W=E+(M-E>>>1);if(I(H,$[A+W])<0)M=W;else E=W+1}return M}class ow{constructor(H,$){this.array=H,this.compare=$;let{length:A}=H;this.length=A,this.minGallop=7,this.tmpStorageLength=A<512?A>>>1:256,this.tmp=Array(this.tmpStorageLength),this.tmpIndex=Array(this.tmpStorageLength),this.stackLength=A<120?5:A<1542?10:A<119151?19:40,this.runStart=Array(this.stackLength),this.runLength=Array(this.stackLength),this.stackSize=0}pushRun(H,$){this.runStart[this.stackSize]=H,this.runLength[this.stackSize]=$,this.stackSize+=1}mergeRuns(){while(this.stackSize>1){let H=this.stackSize-2;if(H>=1&&this.runLength[H-1]<=this.runLength[H]+this.runLength[H+1]||H>=2&&this.runLength[H-2]<=this.runLength[H]+this.runLength[H-1]){if(this.runLength[H-1]<this.runLength[H+1])H--}else if(this.runLength[H]>this.runLength[H+1])break;this.mergeAt(H)}}forceMergeRuns(){while(this.stackSize>1){let H=this.stackSize-2;if(H>0&&this.runLength[H-1]<this.runLength[H+1])H--;this.mergeAt(H)}}mergeAt(H){let{compare:$}=this,{array:A}=this,L=this.runStart[H],D=this.runLength[H],I=this.runStart[H+1],E=this.runLength[H+1];if(this.runLength[H]=D+E,H===this.stackSize-3)this.runStart[H+1]=this.runStart[H+2],this.runLength[H+1]=this.runLength[H+2];this.stackSize--;let K=$5(A[I],A,L,D,0,$);if(L+=K,D-=K,D===0)return;if(E=H5(A[L+D-1],A,I,E,E-1,$),E===0)return;if(D<=E)this.mergeLow(L,D,I,E);else this.mergeHigh(L,D,I,E)}mergeLow(H,$,A,L){let{compare:D}=this,{array:I}=this,{tmp:E}=this,{tmpIndex:K}=this,M=0;for(M=0;M<$;M++)E[M]=I[H+M],K[M]=MH[H+M];let W=0,X=A,J=H;if(I[J]=I[X],MH[J]=MH[X],J++,X++,--L===0){for(M=0;M<$;M++)I[J+M]=E[W+M],MH[J+M]=K[W+M];return}if($===1){for(M=0;M<L;M++)I[J+M]=I[X+M],MH[J+M]=MH[X+M];I[J+L]=E[W],MH[J+L]=K[W];return}let{minGallop:Z}=this;while(!0){let Q=0,B=0,Y=!1;do if(D(I[X],E[W])<0){if(I[J]=I[X],MH[J]=MH[X],J++,X++,B++,Q=0,--L===0){Y=!0;break}}else if(I[J]=E[W],MH[J]=K[W],J++,W++,Q++,B=0,--$===1){Y=!0;break}while((Q|B)<Z);if(Y)break;do{if(Q=$5(I[X],E,W,$,0,D),Q!==0){for(M=0;M<Q;M++)I[J+M]=E[W+M],MH[J+M]=K[W+M];if(J+=Q,W+=Q,$-=Q,$<=1){Y=!0;break}}if(I[J]=I[X],MH[J]=MH[X],J++,X++,--L===0){Y=!0;break}if(B=H5(E[W],I,X,L,0,D),B!==0){for(M=0;M<B;M++)I[J+M]=I[X+M],MH[J+M]=MH[X+M];if(J+=B,X+=B,L-=B,L===0){Y=!0;break}}if(I[J]=E[W],MH[J]=K[W],J++,W++,--$===1){Y=!0;break}Z--}while(Q>=7||B>=7);if(Y)break;if(Z<0)Z=0;Z+=2}if(this.minGallop=Z,Z<1)this.minGallop=1;if($===1){for(M=0;M<L;M++)I[J+M]=I[X+M],MH[J+M]=MH[X+M];I[J+L]=E[W],MH[J+L]=K[W]}else if($===0)throw Error("mergeLow preconditions were not respected");else for(M=0;M<$;M++)I[J+M]=E[W+M],MH[J+M]=K[W+M]}mergeHigh(H,$,A,L){let{compare:D}=this,{array:I}=this,{tmp:E}=this,{tmpIndex:K}=this,M=0;for(M=0;M<L;M++)E[M]=I[A+M],K[M]=MH[A+M];let W=H+$-1,X=L-1,J=A+L-1,Z=0,Q=0;if(I[J]=I[W],MH[J]=MH[W],J--,W--,--$===0){Z=J-(L-1);for(M=0;M<L;M++)I[Z+M]=E[M],MH[Z+M]=K[M];return}if(L===1){J-=$,W-=$,Q=J+1,Z=W+1;for(M=$-1;M>=0;M--)I[Q+M]=I[Z+M],MH[Q+M]=MH[Z+M];I[J]=E[X],MH[J]=K[X];return}let{minGallop:B}=this;while(!0){let Y=0,G=0,U=!1;do if(D(E[X],I[W])<0){if(I[J]=I[W],MH[J]=MH[W],J--,W--,Y++,G=0,--$===0){U=!0;break}}else if(I[J]=E[X],MH[J]=K[X],J--,X--,G++,Y=0,--L===1){U=!0;break}while((Y|G)<B);if(U)break;do{if(Y=$-$5(E[X],I,H,$,$-1,D),Y!==0){J-=Y,W-=Y,$-=Y,Q=J+1,Z=W+1;for(M=Y-1;M>=0;M--)I[Q+M]=I[Z+M],MH[Q+M]=MH[Z+M];if($===0){U=!0;break}}if(I[J]=E[X],MH[J]=K[X],J--,X--,--L===1){U=!0;break}if(G=L-H5(I[W],E,0,L,L-1,D),G!==0){J-=G,X-=G,L-=G,Q=J+1,Z=X+1;for(M=0;M<G;M++)I[Q+M]=E[Z+M],MH[Q+M]=K[Z+M];if(L<=1){U=!0;break}}if(I[J]=I[W],MH[J]=MH[W],J--,W--,--$===0){U=!0;break}B--}while(Y>=7||G>=7);if(U)break;if(B<0)B=0;B+=2}if(this.minGallop=B,B<1)this.minGallop=1;if(L===1){J-=$,W-=$,Q=J+1,Z=W+1;for(M=$-1;M>=0;M--)I[Q+M]=I[Z+M],MH[Q+M]=MH[Z+M];I[J]=E[X],MH[J]=K[X]}else if(L===0)throw Error("mergeHigh preconditions were not respected");else{Z=J-(L-1);for(M=0;M<L;M++)I[Z+M]=E[M],MH[Z+M]=K[M]}}}function b0H(H,$,A,L){if(!Array.isArray(H))throw TypeError(`The "array" argument must be an array. Received ${H}`);MH=[];let{length:D}=H,I=0;while(I<D)MH[I]=I++;if(!$)$=iw;else if(typeof $!=="function")L=A,A=$,$=iw;if(!A)A=0;if(!L)L=D;let E=L-A;if(E<2)return MH;let K=0;if(E<32)return K=nw(H,A,L,$),tw(H,A,L,A+K,$),MH;let M=new ow(H,$),W=v0H(E);do{if(K=nw(H,A,L,$),K<W){let X=E;if(X>W)X=W;tw(H,A,A+X,A+K,$),K=X}M.pushRun(A,K),M.mergeRuns(),E-=K,A+=K}while(E!==0);return M.forceMergeRuns(),MH}sw.exports={sort:b0H}});var o8=n((YgH,$R)=>{var{isObject:a8,isArray:h0H,isString:u0H,isNumber:g0H,isFunction:m0H}=CX(),zX=["before","after-prop","after-colon","after-value","after"],ew=["before","after","before-all","after-all"],d0H=ew.map(Symbol.for),t3=(H,$)=>Symbol.for(H+":"+$),A5=(H,$)=>{if($){if(zX.includes(H))return t3(H,$);throw RangeError(`Unsupported comment position ${H} with key ${$}`)}if(ew.includes(H))return Symbol.for(H);throw RangeError(`Unsupported comment position ${H}`)},t8=(H,$,A)=>Object.defineProperty(H,$,{value:A,writable:!0,configurable:!0}),D5=(H,$,A,L,D,I)=>{let E=t3(D,L);if(!Object.hasOwn($,E))return;let K=A===L?E:t3(D,A);if(t8(H,K,$[E]),I)delete $[E]},HR=(H,$,A,L,D)=>{zX.forEach((I)=>{D5(H,$,A,L,I,D)})},p0H=(H,$,A)=>{if($===A)return;zX.forEach((L)=>{let D=t3(L,A);if(!Object.hasOwn(H,D)){D5(H,H,A,$,L,!0);return}let I=H[D];delete H[D],D5(H,H,A,$,L,!0),t8(H,t3(L,$),I)})},L5=(H,$)=>{d0H.forEach((A)=>{let L=$[A];if(L)t8(H,A,L)})},c0H=(H,$,A)=>{return A.forEach((L)=>{if(!u0H(L)&&!g0H(L))return;if(!Object.hasOwn($,L))return;H[L]=$[L],HR(H,$,L,L)}),H},l0H=m0H(JSON.isRawJSON)?JSON.isRawJSON:()=>!1;$R.exports={PROP_SYMBOL_PREFIXES:zX,PREFIX_BEFORE:"before",PREFIX_AFTER_PROP:"after-prop",PREFIX_AFTER_COLON:"after-colon",PREFIX_AFTER_VALUE:"after-value",PREFIX_AFTER:"after",PREFIX_BEFORE_ALL:"before-all",PREFIX_AFTER_ALL:"after-all",BRACKET_OPEN:"[",BRACKET_CLOSE:"]",CURLY_BRACKET_OPEN:"{",CURLY_BRACKET_CLOSE:"}",COLON:":",COMMA:",",MINUS:"-",EMPTY:"",UNDEFINED:void 0,symbol:t3,define:t8,copy_comments:HR,swap_comments:p0H,assign_non_prop_comments:L5,is_raw_json:l0H,assign(H,$,A){if(!a8(H))throw TypeError("Cannot convert undefined or null to object");if(!a8($))return H;if(A===void 0)A=Object.keys($),L5(H,$);else if(!h0H(A))throw TypeError("keys must be array or undefined");else if(A.length===0)L5(H,$);return c0H(H,$,A)},moveComments(H,$,{where:A,key:L},{where:D,key:I},E=!1){if(!a8(H))throw TypeError("source must be an object");if(!$)$=H;if(!a8($))return;let K=A5(A,L),M=A5(D,I);if(!Object.hasOwn(H,K))return;let W=H[K];if(delete H[K],E||!Object.hasOwn($,M)){t8($,M,W);return}let X=$[M];if(X)X.push(...W)},removeComments(H,{where:$,key:A}){if(!a8(H))throw TypeError("target must be an object");let L=A5($,A);if(!Object.hasOwn(H,L))return;delete H[L]}}});var I5=n((GgH,ER)=>{var{isArray:i0H}=CX(),{sort:n0H}=rw(),{PROP_SYMBOL_PREFIXES:a0H,UNDEFINED:AR,symbol:t0H,copy_comments:o0H,swap_comments:IR}=o8(),s0H=(H)=>{let{length:$}=H,A=0,L=$/2;for(;A<L;A++)IR(H,A,$-A-1)},LR=(H,$,A,L,D)=>{o0H(H,$,A+L,A,D)},o3=(H,$,A,L,D,I)=>{if(D>0){let K=L;while(K-- >0)LR(H,$,A+K,D,I);return}let E=0;while(E<L){let K=E++;LR(H,$,A+K,D,I)}},DR=(H,$)=>{a0H.forEach((A)=>{let L=t0H(A,$);delete H[L]})},r0H=(H,$)=>{let A=$;while(A in H)A=H[A];return A};class PX extends Array{splice(...H){let{length:$}=this,A=super.splice(...H),[L,D,...I]=H;if(L<0)L+=$;if(arguments.length===1)D=$-L;else D=Math.min($-L,D);let{length:E}=I,K=E-D,M=L+D,W=$-M;return o3(this,this,M,W,K,!0),A}slice(...H){let{length:$}=this,A=super.slice(...H);if(!A.length)return new PX;let[L,D]=H;if(D===AR)D=$;else if(D<0)D+=$;if(L<0)L+=$;else if(L===AR)L=0;return o3(A,this,L,D-L,-L),A}unshift(...H){let{length:$}=this,A=super.unshift(...H),{length:L}=H;if(L>0)o3(this,this,0,$,L,!0);return A}shift(){let H=super.shift(),{length:$}=this;return DR(this,0),o3(this,this,1,$,-1,!0),H}reverse(){return super.reverse(),s0H(this),this}pop(){let H=super.pop();return DR(this,this.length),H}concat(...H){let{length:$}=this,A=super.concat(...H);if(!H.length)return A;return o3(A,this,0,this.length,0),H.forEach((L)=>{let D=$;if($+=i0H(L)?L.length:1,!(L instanceof PX))return;o3(A,L,0,L.length,D)}),A}sort(...H){let $=n0H(this,...H.slice(0,1)),A=Object.create(null);return $.forEach((L,D)=>{if(L===D)return;let I=r0H(A,L);if(I===D)return;A[D]=I,IR(this,D,I)}),this}}ER.exports={CommentArray:PX}});var TR=n((UgH,qR)=>{var e0H=pw(),{CommentArray:HDH}=I5(),{PREFIX_BEFORE:TX,PREFIX_AFTER_PROP:$DH,PREFIX_AFTER_COLON:ADH,PREFIX_AFTER_VALUE:WR,PREFIX_AFTER:K5,PREFIX_BEFORE_ALL:LDH,PREFIX_AFTER_ALL:DDH,BRACKET_OPEN:IDH,BRACKET_CLOSE:KR,CURLY_BRACKET_OPEN:EDH,CURLY_BRACKET_CLOSE:MR,COLON:QR,COMMA:BR,MINUS:XR,EMPTY:KDH,UNDEFINED:s3,define:M5,assign_non_prop_comments:MDH}=o8(),JR=(H)=>e0H.tokenize(H,{comment:!0,loc:!0}),FX,X5=[],oL=null,OA=null,W5=[],sL,ZR=!1,YR=!1,s8=null,r8=null,Y$=null,GR,_X=null,UR=()=>{FX=s3,W5.length=X5.length=0,r8=null,sL=s3},Q5=()=>{UR(),s8.length=0,OA=oL=s8=r8=Y$=_X=null,FX=s3},B5=(H)=>Symbol.for(sL!==s3?H+QR+sL:H),J5=(H,{value:$,context:A={}})=>_X?_X(H,$,A):$,VR=()=>{let H=SyntaxError(`Unexpected token '${Y$.value.slice(0,1)}', "${FX}" is not valid JSON`);throw Object.assign(H,Y$.loc.start),Q5(),H},CR=()=>{let H=SyntaxError("Unexpected end of JSON input");throw Object.assign(H,r8?r8.loc.end:{line:1,column:0}),Q5(),H},a$=()=>{let H=s8[++GR];YR=Y$&&H&&Y$.loc.end.line===H.loc.start.line||!1,r8=Y$,Y$=H},E5=()=>{if(!Y$)CR();return Y$.type==="Punctuator"?Y$.value:Y$.type},DD=(H)=>E5()===H,qX=(H)=>{if(!DD(H))VR()},Z5=(H)=>{X5.push(oL),oL=H},Y5=()=>{oL=X5.pop()},zR=()=>{if(!OA)return;let H=[];for(let A of OA)if(A.inline)H.push(A);else break;let{length:$}=H;if(!$)return;if($===OA.length)OA=null;else OA.splice(0,$);M5(oL,B5(K5),H)},tL=(H)=>{if(!OA)return;M5(oL,B5(H),OA),OA=null},wA=(H)=>{let $=[];while(Y$&&(DD("LineComment")||DD("BlockComment"))){let A={...Y$,inline:YR};$.push(A),a$()}if(ZR)return;if(!$.length)return;if(H){M5(oL,B5(H),$);return}OA=$},NX=(H,$)=>{if($)W5.push(sL);sL=H},PR=()=>{sL=W5.pop()},XDH=()=>{let H={};Z5(H),NX(s3,!0);let $=!1,A;wA();while(!DD(MR)){if($){if(tL(WR),qX(BR),a$(),wA(),zR(),DD(MR))break}$=!0,qX("String"),A=JSON.parse(Y$.value),NX(A),tL(TX),a$(),wA($DH),qX(QR),a$(),wA(ADH),H[A]=J5(A,G5()),wA()}if($)tL(K5);if(a$(),sL=void 0,!$)tL(TX);return Y5(),PR(),H},WDH=()=>{let H=new HDH;Z5(H),NX(s3,!0);let $=!1,A=0;wA();while(!DD(KR)){if($){if(tL(WR),qX(BR),a$(),wA(),zR(),DD(KR))break}$=!0,NX(A),tL(TX),H[A]=J5(A,G5()),A++,wA()}if($)tL(K5);if(a$(),sL=void 0,!$)tL(TX);return Y5(),PR(),H};function G5(){let H=E5();if(H===EDH)return a$(),{value:XDH()};if(H===IDH)return a$(),{value:WDH()};let $=KDH;if(H===XR)a$(),H=E5(),$=XR;let A,L;switch(H){case"String":case"Boolean":case"Null":case"Numeric":return A=Y$.value,a$(),L=$+A,{value:JSON.parse(L),context:{source:L}};default:return{}}}var QDH=(H)=>Object(H)===H,BDH=(H,$,A)=>{if(UR(),FX=H,s8=JR(H),_X=$,ZR=A,!s8.length)CR();GR=-1,a$(),Z5({}),wA(LDH);let L=G5();if(wA(DDH),Y$)VR();let D=J5("",L);if(!A&&D!==null){if(!QDH(D))D=Object(D);MDH(D,oL)}return Y5(),Q5(),D};qR.exports={parse:BDH,tokenize:JR}});var kR=n((VgH,xR)=>{var{isArray:C5,isObject:_R,isFunction:V5,isNumber:JDH,isString:ZDH}=CX(),{PREFIX_BEFORE_ALL:YDH,PREFIX_BEFORE:NR,PREFIX_AFTER_PROP:GDH,PREFIX_AFTER_COLON:UDH,PREFIX_AFTER_VALUE:VDH,PREFIX_AFTER:z5,PREFIX_AFTER_ALL:CDH,BRACKET_OPEN:zDH,BRACKET_CLOSE:PDH,CURLY_BRACKET_OPEN:qDH,CURLY_BRACKET_CLOSE:TDH,COLON:_DH,COMMA:FR,EMPTY:b$,UNDEFINED:NDH,is_raw_json:FDH}=o8(),U5=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,OR=(H)=>`${NR}:${H}`,ODH=(H)=>`${GDH}:${H}`,wDH=(H)=>`${UDH}:${H}`,wR=(H)=>`${VDH}:${H}`,RR=(H)=>`${z5}:${H}`,RDH={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':"\\\"","\\":"\\\\"},jDH=(H)=>{if(U5.lastIndex=0,!U5.test(H))return H;return H.replace(U5,($)=>{let A=RDH[$];return typeof A==="string"?A:$})},jR=(H)=>`"${jDH(H)}"`,SDH=(H,$)=>$?`//${H}`:`/*${H}*/`,v$=(H,$,A,L)=>{let D=H[Symbol.for($)];if(!D||!D.length)return b$;let I=!1,E=D.reduce((K,{inline:M,type:W,value:X})=>{let J=M?" ":`
|
|
335
|
+
`+A;return I=W==="LineComment",K+J+SDH(X,I)},b$);return L||I?E+`
|
|
336
|
+
`+A:E},r3=null,H4=b$,xDH=()=>{r3=null,H4=b$},e8=(H,$,A)=>H?$?H+$.trim()+`
|
|
337
|
+
`+A:H.trimRight()+`
|
|
338
|
+
`+A:$?$.trimRight()+`
|
|
339
|
+
`+A:b$,SR=(H,$,A)=>{let L=v$($,NR,A+H4,!0);return e8(L,H,A)},kDH=(H,$)=>{let A=$+H4,{length:L}=H,D=b$,I=b$;for(let E=0;E<L;E++){if(E!==0)D+=FR;let K=e8(I,v$(H,OR(E),A),A);D+=K||`
|
|
340
|
+
`+A,D+=P5(E,H,A)||"null",D+=v$(H,wR(E),A),I=v$(H,RR(E),A)}return D+=e8(I,v$(H,z5,A),A),zDH+SR(D,H,$)+PDH},yDH=(H,$)=>{if(!H)return"null";let A=$+H4,L=b$,D=b$,I=!0,E=C5(r3)?r3:Object.keys(H),K=(M)=>{let W=P5(M,H,A);if(W===NDH)return;if(!I)L+=FR;I=!1;let X=e8(D,v$(H,OR(M),A),A);L+=X||`
|
|
341
|
+
`+A,L+=jR(M)+v$(H,ODH(M),A)+_DH+v$(H,wDH(M),A)+" "+W+v$(H,wR(M),A),D=v$(H,RR(M),A)};return E.forEach(K),L+=e8(D,v$(H,z5,A),A),qDH+SR(L,H,$)+TDH};function P5(H,$,A){let L=$[H];if(_R(L)&&V5(L.toJSON))L=L.toJSON(H);if(V5(r3))L=r3.call($,H,L);switch(typeof L){case"string":return jR(L);case"number":return Number.isFinite(L)?String(L):"null";case"boolean":case"null":return String(L);case"object":if(FDH(L))return L.rawJSON;return C5(L)?kDH(L,A):yDH(L,A);default:}}var fDH=(H)=>ZDH(H)?H:JDH(H)?" ".repeat(H):b$,{toString:vDH}=Object.prototype,bDH=["[object Number]","[object String]","[object Boolean]"],hDH=(H)=>{if(typeof H!=="object")return!1;let $=vDH.call(H);return bDH.includes($)};xR.exports=(H,$,A)=>{let L=fDH(A);if(!L)return JSON.stringify(H,$);if(!V5($)&&!C5($))$=null;r3=$,H4=L;let D=hDH(H)?JSON.stringify(H):P5("",{"":H},b$);return xDH(),_R(H)?v$(H,YDH,b$,!0).trimLeft()+D+v$(H,CDH,b$).trimRight():D}});var fR=n((CgH,yR)=>{var{parse:uDH,tokenize:gDH}=TR(),mDH=kR(),{CommentArray:dDH}=I5(),{PREFIX_BEFORE:pDH,PREFIX_AFTER_PROP:cDH,PREFIX_AFTER_COLON:lDH,PREFIX_AFTER_VALUE:iDH,PREFIX_AFTER:nDH,PREFIX_BEFORE_ALL:aDH,PREFIX_AFTER_ALL:tDH,assign:oDH,moveComments:sDH,removeComments:rDH}=o8();yR.exports={PREFIX_BEFORE:pDH,PREFIX_AFTER_PROP:cDH,PREFIX_AFTER_COLON:lDH,PREFIX_AFTER_VALUE:iDH,PREFIX_AFTER:nDH,PREFIX_BEFORE_ALL:aDH,PREFIX_AFTER_ALL:tDH,parse:uDH,stringify:mDH,tokenize:gDH,CommentArray:dDH,assign:oDH,moveComments:sDH,removeComments:rDH}});function $4(H){let $=H.match(/^[ \t]+/m);return $&&$[0]||" "}function vR(H){return $4(H).replaceAll("\t"," ").replaceAll(/[^ ]/g,"").length}var h$;var OX=y(()=>{h$=class h$ extends Error{url;constructor(H,$,A){super($||`Unable to parse ${H}`,A);this.url=H}}});function eDH(H){try{return JSON.parse(H)}catch{return wX.parse(H)}}function q5(H){return RA.parse(H)}function H3H(H){return!(!H||typeof H!=="object"||Array.isArray(H))}var wX,RA;var T5=y(()=>{ML();OX();wX=kA(fR(),1);RA=class RA extends IA{url;indent=2;constructor(H,$){super(H,$);this.url=H}serialize(){return wX.stringify(this.settings,void 0,this.indent)+`
|
|
342
|
+
`}removeAllComments(){for(let H of Object.getOwnPropertySymbols(this.settings))delete this.settings[H];return Object.assign(this.settings,JSON.parse(JSON.stringify(this.settings))),this}setSchema(H){return this.settings.$schema=H,this}setComment(H,$,A){let D=Symbol.for((A?"after:":"before:")+H),I={type:"LineComment",value:$,inline:A},E=this.settings;return E[D]=[I],this}static parse(H){try{let $=eDH(H.content);if(!H3H($))throw new h$(H.url);let A=$4(H.content),L=new RA(H.url,$);return L.indent=A,L}catch($){if($ instanceof h$)throw $;throw new h$(H.url,void 0,{cause:$})}}static from(H,$,A=2){let L=new RA(H,$);return L.indent=A,L}}});function bR(H){let{url:$,content:A}=H,L=JSON.parse(A);if(!L||typeof L!=="object"||Array.isArray(L))throw Error(`Unable to parse ${$}`);L.cspell=L.cspell||{};let D=L.cspell;if(typeof D!=="object"||Array.isArray(D))throw TypeError(`Unable to parse ${$}`);let I=$4(A);function E(K){return L.cspell=K,JSON.stringify(L,void 0,I)+`
|
|
343
|
+
`}return new A4($,D,E)}var A4;var hR=y(()=>{ML();A4=class A4 extends IA{url;settings;serializer;constructor(H,$,A){super(H,$);this.url=H,this.settings=$,this.serializer=A}serialize(){return this.serializer(this.settings)}}});function uR(H){return e3.parse(H)}function $3H(H){return!(!H||typeof H!=="object"||Array.isArray(H))}var e3;var gR=y(()=>{bQ();ML();OX();e3=class e3 extends IA{url;constructor(H,$){super(H,$);this.url=H}serialize(){return lI(this.settings)}removeAllComments(){return this}setSchema(H){return this.settings.$schema=H,this}setComment(H,$,A){return this}static parse(H){try{let $=pI(H.content);if(!$3H($))throw new h$(H.url);return new e3(H.url,$)}catch($){if($ instanceof h$)throw $;throw new h$(H.url,void 0,{cause:$})}}static from(H,$,A){return new e3(H,$)}}});var OH=n((X3H)=>{var _5=Symbol.for("yaml.alias"),mR=Symbol.for("yaml.document"),RX=Symbol.for("yaml.map"),dR=Symbol.for("yaml.pair"),N5=Symbol.for("yaml.scalar"),jX=Symbol.for("yaml.seq"),XL=Symbol.for("yaml.node.type"),A3H=(H)=>!!H&&typeof H==="object"&&H[XL]===_5,L3H=(H)=>!!H&&typeof H==="object"&&H[XL]===mR,D3H=(H)=>!!H&&typeof H==="object"&&H[XL]===RX,I3H=(H)=>!!H&&typeof H==="object"&&H[XL]===dR,pR=(H)=>!!H&&typeof H==="object"&&H[XL]===N5,E3H=(H)=>!!H&&typeof H==="object"&&H[XL]===jX;function cR(H){if(H&&typeof H==="object")switch(H[XL]){case RX:case jX:return!0}return!1}function K3H(H){if(H&&typeof H==="object")switch(H[XL]){case _5:case RX:case N5:case jX:return!0}return!1}var M3H=(H)=>(pR(H)||cR(H))&&!!H.anchor;X3H.ALIAS=_5;X3H.DOC=mR;X3H.MAP=RX;X3H.NODE_TYPE=XL;X3H.PAIR=dR;X3H.SCALAR=N5;X3H.SEQ=jX;X3H.hasAnchor=M3H;X3H.isAlias=A3H;X3H.isCollection=cR;X3H.isDocument=L3H;X3H.isMap=D3H;X3H.isNode=K3H;X3H.isPair=I3H;X3H.isScalar=pR;X3H.isSeq=E3H});var L4=n((F3H)=>{var A$=OH(),F$=Symbol("break visit"),lR=Symbol("skip children"),jA=Symbol("remove node");function SX(H,$){let A=iR($);if(A$.isDocument(H)){if(HI(null,H.contents,A,Object.freeze([H]))===jA)H.contents=null}else HI(null,H,A,Object.freeze([]))}SX.BREAK=F$;SX.SKIP=lR;SX.REMOVE=jA;function HI(H,$,A,L){let D=nR(H,$,A,L);if(A$.isNode(D)||A$.isPair(D))return aR(H,L,D),HI(H,D,A,L);if(typeof D!=="symbol"){if(A$.isCollection($)){L=Object.freeze(L.concat($));for(let I=0;I<$.items.length;++I){let E=HI(I,$.items[I],A,L);if(typeof E==="number")I=E-1;else if(E===F$)return F$;else if(E===jA)$.items.splice(I,1),I-=1}}else if(A$.isPair($)){L=Object.freeze(L.concat($));let I=HI("key",$.key,A,L);if(I===F$)return F$;else if(I===jA)$.key=null;let E=HI("value",$.value,A,L);if(E===F$)return F$;else if(E===jA)$.value=null}}return D}async function xX(H,$){let A=iR($);if(A$.isDocument(H)){if(await $I(null,H.contents,A,Object.freeze([H]))===jA)H.contents=null}else await $I(null,H,A,Object.freeze([]))}xX.BREAK=F$;xX.SKIP=lR;xX.REMOVE=jA;async function $I(H,$,A,L){let D=await nR(H,$,A,L);if(A$.isNode(D)||A$.isPair(D))return aR(H,L,D),$I(H,D,A,L);if(typeof D!=="symbol"){if(A$.isCollection($)){L=Object.freeze(L.concat($));for(let I=0;I<$.items.length;++I){let E=await $I(I,$.items[I],A,L);if(typeof E==="number")I=E-1;else if(E===F$)return F$;else if(E===jA)$.items.splice(I,1),I-=1}}else if(A$.isPair($)){L=Object.freeze(L.concat($));let I=await $I("key",$.key,A,L);if(I===F$)return F$;else if(I===jA)$.key=null;let E=await $I("value",$.value,A,L);if(E===F$)return F$;else if(E===jA)$.value=null}}return D}function iR(H){if(typeof H==="object"&&(H.Collection||H.Node||H.Value))return Object.assign({Alias:H.Node,Map:H.Node,Scalar:H.Node,Seq:H.Node},H.Value&&{Map:H.Value,Scalar:H.Value,Seq:H.Value},H.Collection&&{Map:H.Collection,Seq:H.Collection},H);return H}function nR(H,$,A,L){if(typeof A==="function")return A(H,$,L);if(A$.isMap($))return A.Map?.(H,$,L);if(A$.isSeq($))return A.Seq?.(H,$,L);if(A$.isPair($))return A.Pair?.(H,$,L);if(A$.isScalar($))return A.Scalar?.(H,$,L);if(A$.isAlias($))return A.Alias?.(H,$,L);return}function aR(H,$,A){let L=$[$.length-1];if(A$.isCollection(L))L.items[H]=A;else if(A$.isPair(L))if(H==="key")L.key=A;else L.value=A;else if(A$.isDocument(L))L.contents=A;else{let D=A$.isAlias(L)?"alias":"scalar";throw Error(`Cannot replace node with ${D} parent`)}}F3H.visit=SX;F3H.visitAsync=xX});var F5=n((x3H)=>{var tR=OH(),R3H=L4(),j3H={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},S3H=(H)=>H.replace(/[!,[\]{}]/g,($)=>j3H[$]);class t${constructor(H,$){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t$.defaultYaml,H),this.tags=Object.assign({},t$.defaultTags,$)}clone(){let H=new t$(this.yaml,this.tags);return H.docStart=this.docStart,H}atDocument(){let H=new t$(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t$.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t$.defaultTags);break}return H}add(H,$){if(this.atNextDocument)this.yaml={explicit:t$.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t$.defaultTags),this.atNextDocument=!1;let A=H.trim().split(/[ \t]+/),L=A.shift();switch(L){case"%TAG":{if(A.length!==2){if($(0,"%TAG directive should contain exactly two parts"),A.length<2)return!1}let[D,I]=A;return this.tags[D]=I,!0}case"%YAML":{if(this.yaml.explicit=!0,A.length!==1)return $(0,"%YAML directive should contain exactly one part"),!1;let[D]=A;if(D==="1.1"||D==="1.2")return this.yaml.version=D,!0;else{let I=/^\d+\.\d+$/.test(D);return $(6,`Unsupported YAML version ${D}`,I),!1}}default:return $(0,`Unknown directive ${L}`,!0),!1}}tagName(H,$){if(H==="!")return"!";if(H[0]!=="!")return $(`Not a valid tag: ${H}`),null;if(H[1]==="<"){let I=H.slice(2,-1);if(I==="!"||I==="!!")return $(`Verbatim tags aren't resolved, so ${H} is invalid.`),null;if(H[H.length-1]!==">")$("Verbatim tags must end with a >");return I}let[,A,L]=H.match(/^(.*!)([^!]*)$/s);if(!L)$(`The ${H} tag has no suffix`);let D=this.tags[A];if(D)try{return D+decodeURIComponent(L)}catch(I){return $(String(I)),null}if(A==="!")return H;return $(`Could not resolve tag: ${H}`),null}tagString(H){for(let[$,A]of Object.entries(this.tags))if(H.startsWith(A))return $+S3H(H.substring(A.length));return H[0]==="!"?H:`!<${H}>`}toString(H){let $=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],A=Object.entries(this.tags),L;if(H&&A.length>0&&tR.isNode(H.contents)){let D={};R3H.visit(H.contents,(I,E)=>{if(tR.isNode(E)&&E.tag)D[E.tag]=!0}),L=Object.keys(D)}else L=[];for(let[D,I]of A){if(D==="!!"&&I==="tag:yaml.org,2002:")continue;if(!H||L.some((E)=>E.startsWith(I)))$.push(`%TAG ${D} ${I}`)}return $.join(`
|
|
344
|
+
`)}}t$.defaultYaml={explicit:!1,version:"1.2"};t$.defaultTags={"!!":"tag:yaml.org,2002:"};x3H.Directives=t$});var kX=n((b3H)=>{var oR=OH(),y3H=L4();function f3H(H){if(/[\x00-\x19\s,[\]{}]/.test(H)){let A=`Anchor must not contain whitespace or control characters: ${JSON.stringify(H)}`;throw Error(A)}return!0}function sR(H){let $=new Set;return y3H.visit(H,{Value(A,L){if(L.anchor)$.add(L.anchor)}}),$}function rR(H,$){for(let A=1;;++A){let L=`${H}${A}`;if(!$.has(L))return L}}function v3H(H,$){let A=[],L=new Map,D=null;return{onAnchor:(I)=>{A.push(I),D??(D=sR(H));let E=rR($,D);return D.add(E),E},setAnchors:()=>{for(let I of A){let E=L.get(I);if(typeof E==="object"&&E.anchor&&(oR.isScalar(E.node)||oR.isCollection(E.node)))E.node.anchor=E.anchor;else{let K=Error("Failed to resolve repeated object (this should not happen)");throw K.source=I,K}}},sourceObjects:L}}b3H.anchorIsValid=f3H;b3H.anchorNames=sR;b3H.createNodeAnchors=v3H;b3H.findNewAnchor=rR});var O5=n((d3H)=>{function D4(H,$,A,L){if(L&&typeof L==="object")if(Array.isArray(L))for(let D=0,I=L.length;D<I;++D){let E=L[D],K=D4(H,L,String(D),E);if(K===void 0)delete L[D];else if(K!==E)L[D]=K}else if(L instanceof Map)for(let D of Array.from(L.keys())){let I=L.get(D),E=D4(H,L,D,I);if(E===void 0)L.delete(D);else if(E!==I)L.set(D,E)}else if(L instanceof Set)for(let D of Array.from(L)){let I=D4(H,L,D,D);if(I===void 0)L.delete(D);else if(I!==D)L.delete(D),L.add(I)}else for(let[D,I]of Object.entries(L)){let E=D4(H,L,D,I);if(E===void 0)delete L[D];else if(E!==I)L[D]=E}return H.call($,A,L)}d3H.applyReviver=D4});var rL=n((l3H)=>{var c3H=OH();function eR(H,$,A){if(Array.isArray(H))return H.map((L,D)=>eR(L,String(D),A));if(H&&typeof H.toJSON==="function"){if(!A||!c3H.hasAnchor(H))return H.toJSON($,A);let L={aliasCount:0,count:1,res:void 0};A.anchors.set(H,L),A.onCreate=(I)=>{L.res=I,delete A.onCreate};let D=H.toJSON($,A);if(A.onCreate)A.onCreate(D);return D}if(typeof H==="bigint"&&!A?.keep)return Number(H);return H}l3H.toJS=eR});var yX=n((t3H)=>{var n3H=O5(),Hj=OH(),a3H=rL();class $j{constructor(H){Object.defineProperty(this,Hj.NODE_TYPE,{value:H})}clone(){let H=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)H.range=this.range.slice();return H}toJS(H,{mapAsMap:$,maxAliasCount:A,onAnchor:L,reviver:D}={}){if(!Hj.isDocument(H))throw TypeError("A document argument is required");let I={anchors:new Map,doc:H,keep:!0,mapAsMap:$===!0,mapKeyWarned:!1,maxAliasCount:typeof A==="number"?A:100},E=a3H.toJS(this,"",I);if(typeof L==="function")for(let{count:K,res:M}of I.anchors.values())L(M,K);return typeof D==="function"?n3H.applyReviver(D,{"":E},"",E):E}}t3H.NodeBase=$j});var I4=n(($IH)=>{var s3H=kX(),r3H=L4(),AI=OH(),e3H=yX(),HIH=rL();class Aj extends e3H.NodeBase{constructor(H){super(AI.ALIAS);this.source=H,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(H,$){let A;if($?.aliasResolveCache)A=$.aliasResolveCache;else if(A=[],r3H.visit(H,{Node:(D,I)=>{if(AI.isAlias(I)||AI.hasAnchor(I))A.push(I)}}),$)$.aliasResolveCache=A;let L=void 0;for(let D of A){if(D===this)break;if(D.anchor===this.source)L=D}return L}toJSON(H,$){if(!$)return{source:this.source};let{anchors:A,doc:L,maxAliasCount:D}=$,I=this.resolve(L,$);if(!I){let K=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(K)}let E=A.get(I);if(!E)HIH.toJS(I,null,$),E=A.get(I);if(E?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(D>=0){if(E.count+=1,E.aliasCount===0)E.aliasCount=fX(L,I,A);if(E.count*E.aliasCount>D)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return E.res}toString(H,$,A){let L=`*${this.source}`;if(H){if(s3H.anchorIsValid(this.source),H.options.verifyAliasOrder&&!H.anchors.has(this.source)){let D=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(D)}if(H.implicitKey)return`${L} `}return L}}function fX(H,$,A){if(AI.isAlias($)){let L=$.resolve(H),D=A&&L&&A.get(L);return D?D.count*D.aliasCount:0}else if(AI.isCollection($)){let L=0;for(let D of $.items){let I=fX(H,D,A);if(I>L)L=I}return L}else if(AI.isPair($)){let L=fX(H,$.key,A),D=fX(H,$.value,A);return Math.max(L,D)}return 1}$IH.Alias=Aj});var tH=n((KIH)=>{var LIH=OH(),DIH=yX(),IIH=rL(),EIH=(H)=>!H||typeof H!=="function"&&typeof H!=="object";class ID extends DIH.NodeBase{constructor(H){super(LIH.SCALAR);this.value=H}toJSON(H,$){return $?.keep?this.value:IIH.toJS(this.value,H,$)}toString(){return String(this.value)}}ID.BLOCK_FOLDED="BLOCK_FOLDED";ID.BLOCK_LITERAL="BLOCK_LITERAL";ID.PLAIN="PLAIN";ID.QUOTE_DOUBLE="QUOTE_DOUBLE";ID.QUOTE_SINGLE="QUOTE_SINGLE";KIH.Scalar=ID;KIH.isScalarValue=EIH});var E4=n((ZIH)=>{var WIH=I4(),ED=OH(),Lj=tH(),QIH="tag:yaml.org,2002:";function BIH(H,$,A){if($){let L=A.filter((I)=>I.tag===$),D=L.find((I)=>!I.format)??L[0];if(!D)throw Error(`Tag ${$} not found`);return D}return A.find((L)=>L.identify?.(H)&&!L.format)}function JIH(H,$,A){if(ED.isDocument(H))H=H.contents;if(ED.isNode(H))return H;if(ED.isPair(H)){let J=A.schema[ED.MAP].createNode?.(A.schema,null,A);return J.items.push(H),J}if(H instanceof String||H instanceof Number||H instanceof Boolean||typeof BigInt<"u"&&H instanceof BigInt)H=H.valueOf();let{aliasDuplicateObjects:L,onAnchor:D,onTagObj:I,schema:E,sourceObjects:K}=A,M=void 0;if(L&&H&&typeof H==="object")if(M=K.get(H),M)return M.anchor??(M.anchor=D(H)),new WIH.Alias(M.anchor);else M={anchor:null,node:null},K.set(H,M);if($?.startsWith("!!"))$=QIH+$.slice(2);let W=BIH(H,$,E.tags);if(!W){if(H&&typeof H.toJSON==="function")H=H.toJSON();if(!H||typeof H!=="object"){let J=new Lj.Scalar(H);if(M)M.node=J;return J}W=H instanceof Map?E[ED.MAP]:(Symbol.iterator in Object(H))?E[ED.SEQ]:E[ED.MAP]}if(I)I(W),delete A.onTagObj;let X=W?.createNode?W.createNode(A.schema,H,A):typeof W?.nodeClass?.from==="function"?W.nodeClass.from(A.schema,H,A):new Lj.Scalar(H);if($)X.tag=$;else if(!W.default)X.tag=W.tag;if(M)M.node=X;return X}ZIH.createNode=JIH});var vX=n((VIH)=>{var GIH=E4(),SA=OH(),UIH=yX();function w5(H,$,A){let L=A;for(let D=$.length-1;D>=0;--D){let I=$[D];if(typeof I==="number"&&Number.isInteger(I)&&I>=0){let E=[];E[I]=L,L=E}else L=new Map([[I,L]])}return GIH.createNode(L,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:H,sourceObjects:new Map})}var Dj=(H)=>H==null||typeof H==="object"&&!!H[Symbol.iterator]().next().done;class Ij extends UIH.NodeBase{constructor(H,$){super(H);Object.defineProperty(this,"schema",{value:$,configurable:!0,enumerable:!1,writable:!0})}clone(H){let $=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(H)$.schema=H;if($.items=$.items.map((A)=>SA.isNode(A)||SA.isPair(A)?A.clone(H):A),this.range)$.range=this.range.slice();return $}addIn(H,$){if(Dj(H))this.add($);else{let[A,...L]=H,D=this.get(A,!0);if(SA.isCollection(D))D.addIn(L,$);else if(D===void 0&&this.schema)this.set(A,w5(this.schema,L,$));else throw Error(`Expected YAML collection at ${A}. Remaining path: ${L}`)}}deleteIn(H){let[$,...A]=H;if(A.length===0)return this.delete($);let L=this.get($,!0);if(SA.isCollection(L))return L.deleteIn(A);else throw Error(`Expected YAML collection at ${$}. Remaining path: ${A}`)}getIn(H,$){let[A,...L]=H,D=this.get(A,!0);if(L.length===0)return!$&&SA.isScalar(D)?D.value:D;else return SA.isCollection(D)?D.getIn(L,$):void 0}hasAllNullValues(H){return this.items.every(($)=>{if(!SA.isPair($))return!1;let A=$.value;return A==null||H&&SA.isScalar(A)&&A.value==null&&!A.commentBefore&&!A.comment&&!A.tag})}hasIn(H){let[$,...A]=H;if(A.length===0)return this.has($);let L=this.get($,!0);return SA.isCollection(L)?L.hasIn(A):!1}setIn(H,$){let[A,...L]=H;if(L.length===0)this.set(A,$);else{let D=this.get(A,!0);if(SA.isCollection(D))D.setIn(L,$);else if(D===void 0&&this.schema)this.set(A,w5(this.schema,L,$));else throw Error(`Expected YAML collection at ${A}. Remaining path: ${L}`)}}}VIH.Collection=Ij;VIH.collectionFromPath=w5;VIH.isEmptyPath=Dj});var K4=n((_IH)=>{var qIH=(H)=>H.replace(/^(?!$)(?: $)?/gm,"#");function R5(H,$){if(/^\n+$/.test(H))return H.substring(1);return $?H.replace(/^(?! *$)/gm,$):H}var TIH=(H,$,A)=>H.endsWith(`
|
|
345
|
+
`)?R5(A,$):A.includes(`
|
|
346
|
+
`)?`
|
|
347
|
+
`+R5(A,$):(H.endsWith(" ")?"":" ")+A;_IH.indentComment=R5;_IH.lineComment=TIH;_IH.stringifyComment=qIH});var Kj=n((RIH)=>{function wIH(H,$,A="flow",{indentAtStart:L,lineWidth:D=80,minContentWidth:I=20,onFold:E,onOverflow:K}={}){if(!D||D<0)return H;if(D<I)I=0;let M=Math.max(1+I,1+D-$.length);if(H.length<=M)return H;let W=[],X={},J=D-$.length;if(typeof L==="number")if(L>D-Math.max(2,I))W.push(0);else J=D-L;let Z=void 0,Q=void 0,B=!1,Y=-1,G=-1,U=-1;if(A==="block"){if(Y=Ej(H,Y,$.length),Y!==-1)J=Y+M}for(let z;z=H[Y+=1];){if(A==="quoted"&&z==="\\"){switch(G=Y,H[Y+1]){case"x":Y+=3;break;case"u":Y+=5;break;case"U":Y+=9;break;default:Y+=1}U=Y}if(z===`
|
|
348
|
+
`){if(A==="block")Y=Ej(H,Y,$.length);J=Y+$.length+M,Z=void 0}else{if(z===" "&&Q&&Q!==" "&&Q!==`
|
|
349
|
+
`&&Q!=="\t"){let P=H[Y+1];if(P&&P!==" "&&P!==`
|
|
350
|
+
`&&P!=="\t")Z=Y}if(Y>=J)if(Z)W.push(Z),J=Z+M,Z=void 0;else if(A==="quoted"){while(Q===" "||Q==="\t")Q=z,z=H[Y+=1],B=!0;let P=Y>U+1?Y-2:G-1;if(X[P])return H;W.push(P),X[P]=!0,J=P+M,Z=void 0}else B=!0}Q=z}if(B&&K)K();if(W.length===0)return H;if(E)E();let V=H.slice(0,W[0]);for(let z=0;z<W.length;++z){let P=W[z],T=W[z+1]||H.length;if(P===0)V=`
|
|
351
|
+
${$}${H.slice(0,T)}`;else{if(A==="quoted"&&X[P])V+=`${H[P]}\\`;V+=`
|
|
352
|
+
${$}${H.slice(P+1,T)}`}}return V}function Ej(H,$,A){let L=$,D=$+1,I=H[D];while(I===" "||I==="\t")if($<D+A)I=H[++$];else{do I=H[++$];while(I&&I!==`
|
|
353
|
+
`);L=$,D=$+1,I=H[D]}return L}RIH.FOLD_BLOCK="block";RIH.FOLD_FLOW="flow";RIH.FOLD_QUOTED="quoted";RIH.foldFlowLines=wIH});var X4=n((bIH)=>{var EA=tH(),eL=Kj(),hX=(H,$)=>({indentAtStart:$?H.indent.length:H.indentAtStart,lineWidth:H.options.lineWidth,minContentWidth:H.options.minContentWidth}),uX=(H)=>/^(%|---|\.\.\.)/m.test(H);function yIH(H,$,A){if(!$||$<0)return!1;let L=$-A,D=H.length;if(D<=L)return!1;for(let I=0,E=0;I<D;++I)if(H[I]===`
|
|
354
|
+
`){if(I-E>L)return!0;if(E=I+1,D-E<=L)return!1}return!0}function M4(H,$){let A=JSON.stringify(H);if($.options.doubleQuotedAsJSON)return A;let{implicitKey:L}=$,D=$.options.doubleQuotedMinMultiLineLength,I=$.indent||(uX(H)?" ":""),E="",K=0;for(let M=0,W=A[M];W;W=A[++M]){if(W===" "&&A[M+1]==="\\"&&A[M+2]==="n")E+=A.slice(K,M)+"\\ ",M+=1,K=M,W="\\";if(W==="\\")switch(A[M+1]){case"u":{E+=A.slice(K,M);let X=A.substr(M+2,4);switch(X){case"0000":E+="\\0";break;case"0007":E+="\\a";break;case"000b":E+="\\v";break;case"001b":E+="\\e";break;case"0085":E+="\\N";break;case"00a0":E+="\\_";break;case"2028":E+="\\L";break;case"2029":E+="\\P";break;default:if(X.substr(0,2)==="00")E+="\\x"+X.substr(2);else E+=A.substr(M,6)}M+=5,K=M+1}break;case"n":if(L||A[M+2]==='"'||A.length<D)M+=1;else{E+=A.slice(K,M)+`
|
|
355
|
+
|
|
356
|
+
`;while(A[M+2]==="\\"&&A[M+3]==="n"&&A[M+4]!=='"')E+=`
|
|
357
|
+
`,M+=2;if(E+=I,A[M+2]===" ")E+="\\";M+=1,K=M+1}break;default:M+=1}}return E=K?E+A.slice(K):A,L?E:eL.foldFlowLines(E,I,eL.FOLD_QUOTED,hX($,!1))}function j5(H,$){if($.options.singleQuote===!1||$.implicitKey&&H.includes(`
|
|
358
|
+
`)||/[ \t]\n|\n[ \t]/.test(H))return M4(H,$);let A=$.indent||(uX(H)?" ":""),L="'"+H.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
359
|
+
${A}`)+"'";return $.implicitKey?L:eL.foldFlowLines(L,A,eL.FOLD_FLOW,hX($,!1))}function LI(H,$){let{singleQuote:A}=$.options,L;if(A===!1)L=M4;else{let D=H.includes('"'),I=H.includes("'");if(D&&!I)L=j5;else if(I&&!D)L=M4;else L=A?j5:M4}return L(H,$)}var S5;try{S5=new RegExp(`(^|(?<!
|
|
360
|
+
))
|
|
361
|
+
+(?!
|
|
362
|
+
|$)`,"g")}catch{S5=/\n+(?!\n|$)/g}function bX({comment:H,type:$,value:A},L,D,I){let{blockQuote:E,commentString:K,lineWidth:M}=L.options;if(!E||/\n[\t ]+$/.test(A))return LI(A,L);let W=L.indent||(L.forceBlockIndent||uX(A)?" ":""),X=E==="literal"?!0:E==="folded"||$===EA.Scalar.BLOCK_FOLDED?!1:$===EA.Scalar.BLOCK_LITERAL?!0:!yIH(A,M,W.length);if(!A)return X?`|
|
|
363
|
+
`:`>
|
|
364
|
+
`;let J,Z;for(Z=A.length;Z>0;--Z){let T=A[Z-1];if(T!==`
|
|
365
|
+
`&&T!=="\t"&&T!==" ")break}let Q=A.substring(Z),B=Q.indexOf(`
|
|
366
|
+
`);if(B===-1)J="-";else if(A===Q||B!==Q.length-1){if(J="+",I)I()}else J="";if(Q){if(A=A.slice(0,-Q.length),Q[Q.length-1]===`
|
|
367
|
+
`)Q=Q.slice(0,-1);Q=Q.replace(S5,`$&${W}`)}let Y=!1,G,U=-1;for(G=0;G<A.length;++G){let T=A[G];if(T===" ")Y=!0;else if(T===`
|
|
368
|
+
`)U=G;else break}let V=A.substring(0,U<G?U+1:G);if(V)A=A.substring(V.length),V=V.replace(/\n+/g,`$&${W}`);let P=(Y?W?"2":"1":"")+J;if(H){if(P+=" "+K(H.replace(/ ?[\r\n]+/g," ")),D)D()}if(!X){let T=A.replace(/\n+/g,`
|
|
369
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${W}`),q=!1,O=hX(L,!0);if(E!=="folded"&&$!==EA.Scalar.BLOCK_FOLDED)O.onOverflow=()=>{q=!0};let N=eL.foldFlowLines(`${V}${T}${Q}`,W,eL.FOLD_BLOCK,O);if(!q)return`>${P}
|
|
370
|
+
${W}${N}`}return A=A.replace(/\n+/g,`$&${W}`),`|${P}
|
|
371
|
+
${W}${V}${A}${Q}`}function fIH(H,$,A,L){let{type:D,value:I}=H,{actualString:E,implicitKey:K,indent:M,indentStep:W,inFlow:X}=$;if(K&&I.includes(`
|
|
372
|
+
`)||X&&/[[\]{},]/.test(I))return LI(I,$);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(I))return K||X||!I.includes(`
|
|
373
|
+
`)?LI(I,$):bX(H,$,A,L);if(!K&&!X&&D!==EA.Scalar.PLAIN&&I.includes(`
|
|
374
|
+
`))return bX(H,$,A,L);if(uX(I)){if(M==="")return $.forceBlockIndent=!0,bX(H,$,A,L);else if(K&&M===W)return LI(I,$)}let J=I.replace(/\n+/g,`$&
|
|
375
|
+
${M}`);if(E){let Z=(Y)=>Y.default&&Y.tag!=="tag:yaml.org,2002:str"&&Y.test?.test(J),{compat:Q,tags:B}=$.doc.schema;if(B.some(Z)||Q?.some(Z))return LI(I,$)}return K?J:eL.foldFlowLines(J,M,eL.FOLD_FLOW,hX($,!1))}function vIH(H,$,A,L){let{implicitKey:D,inFlow:I}=$,E=typeof H.value==="string"?H:Object.assign({},H,{value:String(H.value)}),{type:K}=H;if(K!==EA.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(E.value))K=EA.Scalar.QUOTE_DOUBLE}let M=(X)=>{switch(X){case EA.Scalar.BLOCK_FOLDED:case EA.Scalar.BLOCK_LITERAL:return D||I?LI(E.value,$):bX(E,$,A,L);case EA.Scalar.QUOTE_DOUBLE:return M4(E.value,$);case EA.Scalar.QUOTE_SINGLE:return j5(E.value,$);case EA.Scalar.PLAIN:return fIH(E,$,A,L);default:return null}},W=M(K);if(W===null){let{defaultKeyType:X,defaultStringType:J}=$.options,Z=D&&X||J;if(W=M(Z),W===null)throw Error(`Unsupported default string type ${Z}`)}return W}bIH.stringifyString=vIH});var W4=n((iIH)=>{var uIH=kX(),H0=OH(),gIH=K4(),mIH=X4();function dIH(H,$){let A=Object.assign({blockQuote:!0,commentString:gIH.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},H.schema.toStringOptions,$),L;switch(A.collectionStyle){case"block":L=!1;break;case"flow":L=!0;break;default:L=null}return{anchors:new Set,doc:H,flowCollectionPadding:A.flowCollectionPadding?" ":"",indent:"",indentStep:typeof A.indent==="number"?" ".repeat(A.indent):" ",inFlow:L,options:A}}function pIH(H,$){if($.tag){let D=H.filter((I)=>I.tag===$.tag);if(D.length>0)return D.find((I)=>I.format===$.format)??D[0]}let A=void 0,L;if(H0.isScalar($)){L=$.value;let D=H.filter((I)=>I.identify?.(L));if(D.length>1){let I=D.filter((E)=>E.test);if(I.length>0)D=I}A=D.find((I)=>I.format===$.format)??D.find((I)=>!I.format)}else L=$,A=H.find((D)=>D.nodeClass&&L instanceof D.nodeClass);if(!A){let D=L?.constructor?.name??(L===null?"null":typeof L);throw Error(`Tag not resolved for ${D} value`)}return A}function cIH(H,$,{anchors:A,doc:L}){if(!L.directives)return"";let D=[],I=(H0.isScalar(H)||H0.isCollection(H))&&H.anchor;if(I&&uIH.anchorIsValid(I))A.add(I),D.push(`&${I}`);let E=H.tag??($.default?null:$.tag);if(E)D.push(L.directives.tagString(E));return D.join(" ")}function lIH(H,$,A,L){if(H0.isPair(H))return H.toString($,A,L);if(H0.isAlias(H)){if($.doc.directives)return H.toString($);if($.resolvedAliases?.has(H))throw TypeError("Cannot stringify circular structure without alias nodes");else{if($.resolvedAliases)$.resolvedAliases.add(H);else $.resolvedAliases=new Set([H]);H=H.resolve($.doc)}}let D=void 0,I=H0.isNode(H)?H:$.doc.createNode(H,{onTagObj:(M)=>D=M});D??(D=pIH($.doc.schema.tags,I));let E=cIH(I,D,$);if(E.length>0)$.indentAtStart=($.indentAtStart??0)+E.length+1;let K=typeof D.stringify==="function"?D.stringify(I,$,A,L):H0.isScalar(I)?mIH.stringifyString(I,$,A,L):I.toString($,A,L);if(!E)return K;return H0.isScalar(I)||K[0]==="{"||K[0]==="["?`${E} ${K}`:`${E}
|
|
376
|
+
${$.indent}${K}`}iIH.createStringifyContext=dIH;iIH.stringify=lIH});var Wj=n((oIH)=>{var WL=OH(),Mj=tH(),Xj=W4(),Q4=K4();function tIH({key:H,value:$},A,L,D){let{allNullValues:I,doc:E,indent:K,indentStep:M,options:{commentString:W,indentSeq:X,simpleKeys:J}}=A,Z=WL.isNode(H)&&H.comment||null;if(J){if(Z)throw Error("With simple keys, key nodes cannot have comments");if(WL.isCollection(H)||!WL.isNode(H)&&typeof H==="object")throw Error("With simple keys, collection cannot be used as a key value")}let Q=!J&&(!H||Z&&$==null&&!A.inFlow||WL.isCollection(H)||(WL.isScalar(H)?H.type===Mj.Scalar.BLOCK_FOLDED||H.type===Mj.Scalar.BLOCK_LITERAL:typeof H==="object"));A=Object.assign({},A,{allNullValues:!1,implicitKey:!Q&&(J||!I),indent:K+M});let B=!1,Y=!1,G=Xj.stringify(H,A,()=>B=!0,()=>Y=!0);if(!Q&&!A.inFlow&&G.length>1024){if(J)throw Error("With simple keys, single line scalar must not span more than 1024 characters");Q=!0}if(A.inFlow){if(I||$==null){if(B&&L)L();return G===""?"?":Q?`? ${G}`:G}}else if(I&&!J||$==null&&Q){if(G=`? ${G}`,Z&&!B)G+=Q4.lineComment(G,A.indent,W(Z));else if(Y&&D)D();return G}if(B)Z=null;if(Q){if(Z)G+=Q4.lineComment(G,A.indent,W(Z));G=`? ${G}
|
|
377
|
+
${K}:`}else if(G=`${G}:`,Z)G+=Q4.lineComment(G,A.indent,W(Z));let U,V,z;if(WL.isNode($))U=!!$.spaceBefore,V=$.commentBefore,z=$.comment;else if(U=!1,V=null,z=null,$&&typeof $==="object")$=E.createNode($);if(A.implicitKey=!1,!Q&&!Z&&WL.isScalar($))A.indentAtStart=G.length+1;if(Y=!1,!X&&M.length>=2&&!A.inFlow&&!Q&&WL.isSeq($)&&!$.flow&&!$.tag&&!$.anchor)A.indent=A.indent.substring(2);let P=!1,T=Xj.stringify($,A,()=>P=!0,()=>Y=!0),q=" ";if(Z||U||V){if(q=U?`
|
|
378
|
+
`:"",V){let O=W(V);q+=`
|
|
379
|
+
${Q4.indentComment(O,A.indent)}`}if(T===""&&!A.inFlow){if(q===`
|
|
380
|
+
`&&z)q=`
|
|
381
|
+
|
|
382
|
+
`}else q+=`
|
|
383
|
+
${A.indent}`}else if(!Q&&WL.isCollection($)){let O=T[0],N=T.indexOf(`
|
|
384
|
+
`),x=N!==-1,w=A.inFlow??$.flow??$.items.length===0;if(x||!w){let F=!1;if(x&&(O==="&"||O==="!")){let f=T.indexOf(" ");if(O==="&"&&f!==-1&&f<N&&T[f+1]==="!")f=T.indexOf(" ",f+1);if(f===-1||N<f)F=!0}if(!F)q=`
|
|
385
|
+
${A.indent}`}}else if(T===""||T[0]===`
|
|
386
|
+
`)q="";if(G+=q+T,A.inFlow){if(P&&L)L()}else if(z&&!P)G+=Q4.lineComment(G,A.indent,W(z));else if(Y&&D)D();return G}oIH.stringifyPair=tIH});var x5=n((HEH)=>{var Qj=ZH("process");function rIH(H,...$){if(H==="debug")console.log(...$)}function eIH(H,$){if(H==="debug"||H==="warn")if(typeof Qj.emitWarning==="function")Qj.emitWarning($);else console.warn($)}HEH.debug=rIH;HEH.warn=eIH});var dX=n((DEH)=>{var B4=OH(),Bj=tH(),gX="<<",mX={identify:(H)=>H===gX||typeof H==="symbol"&&H.description===gX,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Bj.Scalar(Symbol(gX)),{addToJSMap:Jj}),stringify:()=>gX},LEH=(H,$)=>(mX.identify($)||B4.isScalar($)&&(!$.type||$.type===Bj.Scalar.PLAIN)&&mX.identify($.value))&&H?.doc.schema.tags.some((A)=>A.tag===mX.tag&&A.default);function Jj(H,$,A){if(A=H&&B4.isAlias(A)?A.resolve(H.doc):A,B4.isSeq(A))for(let L of A.items)k5(H,$,L);else if(Array.isArray(A))for(let L of A)k5(H,$,L);else k5(H,$,A)}function k5(H,$,A){let L=H&&B4.isAlias(A)?A.resolve(H.doc):A;if(!B4.isMap(L))throw Error("Merge sources must be maps or map aliases");let D=L.toJSON(null,H,Map);for(let[I,E]of D)if($ instanceof Map){if(!$.has(I))$.set(I,E)}else if($ instanceof Set)$.add(I);else if(!Object.prototype.hasOwnProperty.call($,I))Object.defineProperty($,I,{value:E,writable:!0,enumerable:!0,configurable:!0});return $}DEH.addMergeToJSMap=Jj;DEH.isMergeKey=LEH;DEH.merge=mX});var f5=n((BEH)=>{var MEH=x5(),Zj=dX(),XEH=W4(),Yj=OH(),y5=rL();function WEH(H,$,{key:A,value:L}){if(Yj.isNode(A)&&A.addToJSMap)A.addToJSMap(H,$,L);else if(Zj.isMergeKey(H,A))Zj.addMergeToJSMap(H,$,L);else{let D=y5.toJS(A,"",H);if($ instanceof Map)$.set(D,y5.toJS(L,D,H));else if($ instanceof Set)$.add(D);else{let I=QEH(A,D,H),E=y5.toJS(L,I,H);if(I in $)Object.defineProperty($,I,{value:E,writable:!0,enumerable:!0,configurable:!0});else $[I]=E}}return $}function QEH(H,$,A){if($===null)return"";if(typeof $!=="object")return String($);if(Yj.isNode(H)&&A?.doc){let L=XEH.createStringifyContext(A.doc,{});L.anchors=new Set;for(let I of A.anchors.keys())L.anchors.add(I.anchor);L.inFlow=!0,L.inStringifyKey=!0;let D=H.toString(L);if(!A.mapKeyWarned){let I=JSON.stringify(D);if(I.length>40)I=I.substring(0,36)+'..."';MEH.warn(A.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${I}. Set mapAsMap: true to use object keys.`),A.mapKeyWarned=!0}return D}return JSON.stringify($)}BEH.addPairToJSMap=WEH});var $0=n((UEH)=>{var Gj=E4(),ZEH=Wj(),YEH=f5(),pX=OH();function GEH(H,$,A){let L=Gj.createNode(H,void 0,A),D=Gj.createNode($,void 0,A);return new cX(L,D)}class cX{constructor(H,$=null){Object.defineProperty(this,pX.NODE_TYPE,{value:pX.PAIR}),this.key=H,this.value=$}clone(H){let{key:$,value:A}=this;if(pX.isNode($))$=$.clone(H);if(pX.isNode(A))A=A.clone(H);return new cX($,A)}toJSON(H,$){let A=$?.mapAsMap?new Map:{};return YEH.addPairToJSMap($,A,this)}toString(H,$,A){return H?.doc?ZEH.stringifyPair(this,H,$,A):JSON.stringify(this)}}UEH.Pair=cX;UEH.createPair=GEH});var v5=n((TEH)=>{var KD=OH(),Uj=W4(),lX=K4();function zEH(H,$,A){return($.inFlow??H.flow?qEH:PEH)(H,$,A)}function PEH({comment:H,items:$},A,{blockItemPrefix:L,flowChars:D,itemIndent:I,onChompKeep:E,onComment:K}){let{indent:M,options:{commentString:W}}=A,X=Object.assign({},A,{indent:I,type:null}),J=!1,Z=[];for(let B=0;B<$.length;++B){let Y=$[B],G=null;if(KD.isNode(Y)){if(!J&&Y.spaceBefore)Z.push("");if(iX(A,Z,Y.commentBefore,J),Y.comment)G=Y.comment}else if(KD.isPair(Y)){let V=KD.isNode(Y.key)?Y.key:null;if(V){if(!J&&V.spaceBefore)Z.push("");iX(A,Z,V.commentBefore,J)}}J=!1;let U=Uj.stringify(Y,X,()=>G=null,()=>J=!0);if(G)U+=lX.lineComment(U,I,W(G));if(J&&G)J=!1;Z.push(L+U)}let Q;if(Z.length===0)Q=D.start+D.end;else{Q=Z[0];for(let B=1;B<Z.length;++B){let Y=Z[B];Q+=Y?`
|
|
387
|
+
${M}${Y}`:`
|
|
388
|
+
`}}if(H){if(Q+=`
|
|
389
|
+
`+lX.indentComment(W(H),M),K)K()}else if(J&&E)E();return Q}function qEH({items:H},$,{flowChars:A,itemIndent:L}){let{indent:D,indentStep:I,flowCollectionPadding:E,options:{commentString:K}}=$;L+=I;let M=Object.assign({},$,{indent:L,inFlow:!0,type:null}),W=!1,X=0,J=[];for(let B=0;B<H.length;++B){let Y=H[B],G=null;if(KD.isNode(Y)){if(Y.spaceBefore)J.push("");if(iX($,J,Y.commentBefore,!1),Y.comment)G=Y.comment}else if(KD.isPair(Y)){let V=KD.isNode(Y.key)?Y.key:null;if(V){if(V.spaceBefore)J.push("");if(iX($,J,V.commentBefore,!1),V.comment)W=!0}let z=KD.isNode(Y.value)?Y.value:null;if(z){if(z.comment)G=z.comment;if(z.commentBefore)W=!0}else if(Y.value==null&&V?.comment)G=V.comment}if(G)W=!0;let U=Uj.stringify(Y,M,()=>G=null);if(B<H.length-1)U+=",";if(G)U+=lX.lineComment(U,L,K(G));if(!W&&(J.length>X||U.includes(`
|
|
390
|
+
`)))W=!0;J.push(U),X=J.length}let{start:Z,end:Q}=A;if(J.length===0)return Z+Q;else{if(!W){let B=J.reduce((Y,G)=>Y+G.length+2,2);W=$.options.lineWidth>0&&B>$.options.lineWidth}if(W){let B=Z;for(let Y of J)B+=Y?`
|
|
391
|
+
${I}${D}${Y}`:`
|
|
392
|
+
`;return`${B}
|
|
393
|
+
${D}${Q}`}else return`${Z}${E}${J.join(" ")}${E}${Q}`}}function iX({indent:H,options:{commentString:$}},A,L,D){if(L&&D)L=L.replace(/^\n+/,"");if(L){let I=lX.indentComment($(L),H);A.push(I.trimStart())}}TEH.stringifyCollection=zEH});var L0=n((REH)=>{var NEH=v5(),FEH=f5(),OEH=vX(),A0=OH(),nX=$0(),wEH=tH();function J4(H,$){let A=A0.isScalar($)?$.value:$;for(let L of H)if(A0.isPair(L)){if(L.key===$||L.key===A)return L;if(A0.isScalar(L.key)&&L.key.value===A)return L}return}class Vj extends OEH.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(H){super(A0.MAP,H);this.items=[]}static from(H,$,A){let{keepUndefined:L,replacer:D}=A,I=new this(H),E=(K,M)=>{if(typeof D==="function")M=D.call($,K,M);else if(Array.isArray(D)&&!D.includes(K))return;if(M!==void 0||L)I.items.push(nX.createPair(K,M,A))};if($ instanceof Map)for(let[K,M]of $)E(K,M);else if($&&typeof $==="object")for(let K of Object.keys($))E(K,$[K]);if(typeof H.sortMapEntries==="function")I.items.sort(H.sortMapEntries);return I}add(H,$){let A;if(A0.isPair(H))A=H;else if(!H||typeof H!=="object"||!("key"in H))A=new nX.Pair(H,H?.value);else A=new nX.Pair(H.key,H.value);let L=J4(this.items,A.key),D=this.schema?.sortMapEntries;if(L){if(!$)throw Error(`Key ${A.key} already set`);if(A0.isScalar(L.value)&&wEH.isScalarValue(A.value))L.value.value=A.value;else L.value=A.value}else if(D){let I=this.items.findIndex((E)=>D(A,E)<0);if(I===-1)this.items.push(A);else this.items.splice(I,0,A)}else this.items.push(A)}delete(H){let $=J4(this.items,H);if(!$)return!1;return this.items.splice(this.items.indexOf($),1).length>0}get(H,$){let L=J4(this.items,H)?.value;return(!$&&A0.isScalar(L)?L.value:L)??void 0}has(H){return!!J4(this.items,H)}set(H,$){this.add(new nX.Pair(H,$),!0)}toJSON(H,$,A){let L=A?new A:$?.mapAsMap?new Map:{};if($?.onCreate)$.onCreate(L);for(let D of this.items)FEH.addPairToJSMap($,L,D);return L}toString(H,$,A){if(!H)return JSON.stringify(this);for(let L of this.items)if(!A0.isPair(L))throw Error(`Map items must all be pairs; found ${JSON.stringify(L)} instead`);if(!H.allNullValues&&this.hasAllNullValues(!1))H=Object.assign({},H,{allNullValues:!0});return NEH.stringifyCollection(this,H,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:H.indent||"",onChompKeep:A,onComment:$})}}REH.YAMLMap=Vj;REH.findPair=J4});var DI=n((yEH)=>{var xEH=OH(),Cj=L0(),kEH={collection:"map",default:!0,nodeClass:Cj.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(H,$){if(!xEH.isMap(H))$("Expected a mapping for this tag");return H},createNode:(H,$,A)=>Cj.YAMLMap.from(H,$,A)};yEH.map=kEH});var D0=n((mEH)=>{var vEH=E4(),bEH=v5(),hEH=vX(),tX=OH(),uEH=tH(),gEH=rL();class zj extends hEH.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(H){super(tX.SEQ,H);this.items=[]}add(H){this.items.push(H)}delete(H){let $=aX(H);if(typeof $!=="number")return!1;return this.items.splice($,1).length>0}get(H,$){let A=aX(H);if(typeof A!=="number")return;let L=this.items[A];return!$&&tX.isScalar(L)?L.value:L}has(H){let $=aX(H);return typeof $==="number"&&$<this.items.length}set(H,$){let A=aX(H);if(typeof A!=="number")throw Error(`Expected a valid index, not ${H}.`);let L=this.items[A];if(tX.isScalar(L)&&uEH.isScalarValue($))L.value=$;else this.items[A]=$}toJSON(H,$){let A=[];if($?.onCreate)$.onCreate(A);let L=0;for(let D of this.items)A.push(gEH.toJS(D,String(L++),$));return A}toString(H,$,A){if(!H)return JSON.stringify(this);return bEH.stringifyCollection(this,H,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(H.indent||"")+" ",onChompKeep:A,onComment:$})}static from(H,$,A){let{replacer:L}=A,D=new this(H);if($&&Symbol.iterator in Object($)){let I=0;for(let E of $){if(typeof L==="function"){let K=$ instanceof Set?E:String(I++);E=L.call($,K,E)}D.items.push(vEH.createNode(E,void 0,A))}}return D}}function aX(H){let $=tX.isScalar(H)?H.value:H;if($&&typeof $==="string")$=Number($);return typeof $==="number"&&Number.isInteger($)&&$>=0?$:null}mEH.YAMLSeq=zj});var II=n((lEH)=>{var pEH=OH(),Pj=D0(),cEH={collection:"seq",default:!0,nodeClass:Pj.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(H,$){if(!pEH.isSeq(H))$("Expected a sequence for this tag");return H},createNode:(H,$,A)=>Pj.YAMLSeq.from(H,$,A)};lEH.seq=cEH});var Z4=n((tEH)=>{var nEH=X4(),aEH={identify:(H)=>typeof H==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(H)=>H,stringify(H,$,A,L){return $=Object.assign({actualString:!0},$),nEH.stringifyString(H,$,A,L)}};tEH.string=aEH});var oX=n((sEH)=>{var qj=tH(),Tj={identify:(H)=>H==null,createNode:()=>new qj.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new qj.Scalar(null),stringify:({source:H},$)=>typeof H==="string"&&Tj.test.test(H)?H:$.options.nullStr};sEH.nullTag=Tj});var b5=n((H8H)=>{var eEH=tH(),_j={identify:(H)=>typeof H==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(H)=>new eEH.Scalar(H[0]==="t"||H[0]==="T"),stringify({source:H,value:$},A){if(H&&_j.test.test(H)){let L=H[0]==="t"||H[0]==="T";if($===L)return H}return $?A.options.trueStr:A.options.falseStr}};H8H.boolTag=_j});var EI=n((L8H)=>{function A8H({format:H,minFractionDigits:$,tag:A,value:L}){if(typeof L==="bigint")return String(L);let D=typeof L==="number"?L:Number(L);if(!isFinite(D))return isNaN(D)?".nan":D<0?"-.inf":".inf";let I=Object.is(L,-0)?"-0":JSON.stringify(L);if(!H&&$&&(!A||A==="tag:yaml.org,2002:float")&&/^\d/.test(I)){let E=I.indexOf(".");if(E<0)E=I.length,I+=".";let K=$-(I.length-E-1);while(K-- >0)I+="0"}return I}L8H.stringifyNumber=A8H});var u5=n((X8H)=>{var I8H=tH(),h5=EI(),E8H={identify:(H)=>typeof H==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(H)=>H.slice(-3).toLowerCase()==="nan"?NaN:H[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:h5.stringifyNumber},K8H={identify:(H)=>typeof H==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:(H)=>parseFloat(H),stringify(H){let $=Number(H.value);return isFinite($)?$.toExponential():h5.stringifyNumber(H)}},M8H={identify:(H)=>typeof H==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(H){let $=new I8H.Scalar(parseFloat(H)),A=H.indexOf(".");if(A!==-1&&H[H.length-1]==="0")$.minFractionDigits=H.length-A-1;return $},stringify:h5.stringifyNumber};X8H.float=M8H;X8H.floatExp=K8H;X8H.floatNaN=E8H});var m5=n((G8H)=>{var Nj=EI(),sX=(H)=>typeof H==="bigint"||Number.isInteger(H),g5=(H,$,A,{intAsBigInt:L})=>L?BigInt(H):parseInt(H.substring($),A);function Fj(H,$,A){let{value:L}=H;if(sX(L)&&L>=0)return A+L.toString($);return Nj.stringifyNumber(H)}var J8H={identify:(H)=>sX(H)&&H>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(H,$,A)=>g5(H,2,8,A),stringify:(H)=>Fj(H,8,"0o")},Z8H={identify:sX,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(H,$,A)=>g5(H,0,10,A),stringify:Nj.stringifyNumber},Y8H={identify:(H)=>sX(H)&&H>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(H,$,A)=>g5(H,2,16,A),stringify:(H)=>Fj(H,16,"0x")};G8H.int=Z8H;G8H.intHex=Y8H;G8H.intOct=J8H});var Oj=n((F8H)=>{var z8H=DI(),P8H=oX(),q8H=II(),T8H=Z4(),_8H=b5(),d5=u5(),p5=m5(),N8H=[z8H.map,q8H.seq,T8H.string,P8H.nullTag,_8H.boolTag,p5.intOct,p5.int,p5.intHex,d5.floatNaN,d5.floatExp,d5.float];F8H.schema=N8H});var Rj=n((y8H)=>{var w8H=tH(),R8H=DI(),j8H=II();function wj(H){return typeof H==="bigint"||Number.isInteger(H)}var rX=({value:H})=>JSON.stringify(H),S8H=[{identify:(H)=>typeof H==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(H)=>H,stringify:rX},{identify:(H)=>H==null,createNode:()=>new w8H.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:rX},{identify:(H)=>typeof H==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(H)=>H==="true",stringify:rX},{identify:wj,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(H,$,{intAsBigInt:A})=>A?BigInt(H):parseInt(H,10),stringify:({value:H})=>wj(H)?H.toString():JSON.stringify(H)},{identify:(H)=>typeof H==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:(H)=>parseFloat(H),stringify:rX}],x8H={default:!0,tag:"",test:/^/,resolve(H,$){return $(`Unresolved plain scalar ${JSON.stringify(H)}`),H}},k8H=[R8H.map,j8H.seq].concat(S8H,x8H);y8H.schema=k8H});var l5=n((h8H)=>{var Y4=ZH("buffer"),c5=tH(),v8H=X4(),b8H={identify:(H)=>H instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(H,$){if(typeof Y4.Buffer==="function")return Y4.Buffer.from(H,"base64");else if(typeof atob==="function"){let A=atob(H.replace(/[\n\r]/g,"")),L=new Uint8Array(A.length);for(let D=0;D<A.length;++D)L[D]=A.charCodeAt(D);return L}else return $("This environment does not support reading binary tags; either Buffer or atob is required"),H},stringify({comment:H,type:$,value:A},L,D,I){if(!A)return"";let E=A,K;if(typeof Y4.Buffer==="function")K=E instanceof Y4.Buffer?E.toString("base64"):Y4.Buffer.from(E.buffer).toString("base64");else if(typeof btoa==="function"){let M="";for(let W=0;W<E.length;++W)M+=String.fromCharCode(E[W]);K=btoa(M)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if($??($=c5.Scalar.BLOCK_LITERAL),$!==c5.Scalar.QUOTE_DOUBLE){let M=Math.max(L.options.lineWidth-L.indent.length,L.options.minContentWidth),W=Math.ceil(K.length/M),X=Array(W);for(let J=0,Z=0;J<W;++J,Z+=M)X[J]=K.substr(Z,M);K=X.join($===c5.Scalar.BLOCK_LITERAL?`
|
|
394
|
+
`:" ")}return v8H.stringifyString({comment:H,type:$,value:K},L,D,I)}};h8H.binary=b8H});var H2=n((p8H)=>{var eX=OH(),i5=$0(),g8H=tH(),m8H=D0();function jj(H,$){if(eX.isSeq(H))for(let A=0;A<H.items.length;++A){let L=H.items[A];if(eX.isPair(L))continue;else if(eX.isMap(L)){if(L.items.length>1)$("Each pair must have its own sequence indicator");let D=L.items[0]||new i5.Pair(new g8H.Scalar(null));if(L.commentBefore)D.key.commentBefore=D.key.commentBefore?`${L.commentBefore}
|
|
395
|
+
${D.key.commentBefore}`:L.commentBefore;if(L.comment){let I=D.value??D.key;I.comment=I.comment?`${L.comment}
|
|
396
|
+
${I.comment}`:L.comment}L=D}H.items[A]=eX.isPair(L)?L:new i5.Pair(L)}else $("Expected a sequence for this tag");return H}function Sj(H,$,A){let{replacer:L}=A,D=new m8H.YAMLSeq(H);D.tag="tag:yaml.org,2002:pairs";let I=0;if($&&Symbol.iterator in Object($))for(let E of $){if(typeof L==="function")E=L.call($,String(I++),E);let K,M;if(Array.isArray(E))if(E.length===2)K=E[0],M=E[1];else throw TypeError(`Expected [key, value] tuple: ${E}`);else if(E&&E instanceof Object){let W=Object.keys(E);if(W.length===1)K=W[0],M=E[K];else throw TypeError(`Expected tuple with one key, not ${W.length} keys`)}else K=E;D.items.push(i5.createPair(K,M,A))}return D}var d8H={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:jj,createNode:Sj};p8H.createPairs=Sj;p8H.pairs=d8H;p8H.resolvePairs=jj});var a5=n((t8H)=>{var xj=OH(),n5=rL(),G4=L0(),n8H=D0(),kj=H2();class MD extends n8H.YAMLSeq{constructor(){super();this.add=G4.YAMLMap.prototype.add.bind(this),this.delete=G4.YAMLMap.prototype.delete.bind(this),this.get=G4.YAMLMap.prototype.get.bind(this),this.has=G4.YAMLMap.prototype.has.bind(this),this.set=G4.YAMLMap.prototype.set.bind(this),this.tag=MD.tag}toJSON(H,$){if(!$)return super.toJSON(H);let A=new Map;if($?.onCreate)$.onCreate(A);for(let L of this.items){let D,I;if(xj.isPair(L))D=n5.toJS(L.key,"",$),I=n5.toJS(L.value,D,$);else D=n5.toJS(L,"",$);if(A.has(D))throw Error("Ordered maps must not include duplicate keys");A.set(D,I)}return A}static from(H,$,A){let L=kj.createPairs(H,$,A),D=new this;return D.items=L.items,D}}MD.tag="tag:yaml.org,2002:omap";var a8H={collection:"seq",identify:(H)=>H instanceof Map,nodeClass:MD,default:!1,tag:"tag:yaml.org,2002:omap",resolve(H,$){let A=kj.resolvePairs(H,$),L=[];for(let{key:D}of A.items)if(xj.isScalar(D))if(L.includes(D.value))$(`Ordered maps must not include duplicate keys: ${D.value}`);else L.push(D.value);return Object.assign(new MD,A)},createNode:(H,$,A)=>MD.from(H,$,A)};t8H.YAMLOMap=MD;t8H.omap=a8H});var hj=n((r8H)=>{var yj=tH();function fj({value:H,source:$},A){if($&&(H?vj:bj).test.test($))return $;return H?A.options.trueStr:A.options.falseStr}var vj={identify:(H)=>H===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new yj.Scalar(!0),stringify:fj},bj={identify:(H)=>H===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new yj.Scalar(!1),stringify:fj};r8H.falseTag=bj;r8H.trueTag=vj});var uj=n((I4H)=>{var $4H=tH(),t5=EI(),A4H={identify:(H)=>typeof H==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(H)=>H.slice(-3).toLowerCase()==="nan"?NaN:H[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:t5.stringifyNumber},L4H={identify:(H)=>typeof H==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(H)=>parseFloat(H.replace(/_/g,"")),stringify(H){let $=Number(H.value);return isFinite($)?$.toExponential():t5.stringifyNumber(H)}},D4H={identify:(H)=>typeof H==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(H){let $=new $4H.Scalar(parseFloat(H.replace(/_/g,""))),A=H.indexOf(".");if(A!==-1){let L=H.substring(A+1).replace(/_/g,"");if(L[L.length-1]==="0")$.minFractionDigits=L.length}return $},stringify:t5.stringifyNumber};I4H.float=D4H;I4H.floatExp=L4H;I4H.floatNaN=A4H});var mj=n((J4H)=>{var gj=EI(),U4=(H)=>typeof H==="bigint"||Number.isInteger(H);function $2(H,$,A,{intAsBigInt:L}){let D=H[0];if(D==="-"||D==="+")$+=1;if(H=H.substring($).replace(/_/g,""),L){switch(A){case 2:H=`0b${H}`;break;case 8:H=`0o${H}`;break;case 16:H=`0x${H}`;break}let E=BigInt(H);return D==="-"?BigInt(-1)*E:E}let I=parseInt(H,A);return D==="-"?-1*I:I}function o5(H,$,A){let{value:L}=H;if(U4(L)){let D=L.toString($);return L<0?"-"+A+D.substr(1):A+D}return gj.stringifyNumber(H)}var X4H={identify:U4,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(H,$,A)=>$2(H,2,2,A),stringify:(H)=>o5(H,2,"0b")},W4H={identify:U4,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(H,$,A)=>$2(H,1,8,A),stringify:(H)=>o5(H,8,"0")},Q4H={identify:U4,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(H,$,A)=>$2(H,0,10,A),stringify:gj.stringifyNumber},B4H={identify:U4,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(H,$,A)=>$2(H,2,16,A),stringify:(H)=>o5(H,16,"0x")};J4H.int=Q4H;J4H.intBin=X4H;J4H.intHex=B4H;J4H.intOct=W4H});var s5=n((C4H)=>{var D2=OH(),A2=$0(),L2=L0();class XD extends L2.YAMLMap{constructor(H){super(H);this.tag=XD.tag}add(H){let $;if(D2.isPair(H))$=H;else if(H&&typeof H==="object"&&"key"in H&&"value"in H&&H.value===null)$=new A2.Pair(H.key,null);else $=new A2.Pair(H,null);if(!L2.findPair(this.items,$.key))this.items.push($)}get(H,$){let A=L2.findPair(this.items,H);return!$&&D2.isPair(A)?D2.isScalar(A.key)?A.key.value:A.key:A}set(H,$){if(typeof $!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof $}`);let A=L2.findPair(this.items,H);if(A&&!$)this.items.splice(this.items.indexOf(A),1);else if(!A&&$)this.items.push(new A2.Pair(H))}toJSON(H,$){return super.toJSON(H,$,Set)}toString(H,$,A){if(!H)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},H,{allNullValues:!0}),$,A);else throw Error("Set items must all have null values")}static from(H,$,A){let{replacer:L}=A,D=new this(H);if($&&Symbol.iterator in Object($))for(let I of $){if(typeof L==="function")I=L.call($,I,I);D.items.push(A2.createPair(I,null,A))}return D}}XD.tag="tag:yaml.org,2002:set";var V4H={collection:"map",identify:(H)=>H instanceof Set,nodeClass:XD,default:!1,tag:"tag:yaml.org,2002:set",createNode:(H,$,A)=>XD.from(H,$,A),resolve(H,$){if(D2.isMap(H))if(H.hasAllNullValues(!0))return Object.assign(new XD,H);else $("Set items must all have null values");else $("Expected a mapping for this tag");return H}};C4H.YAMLSet=XD;C4H.set=V4H});var e5=n((N4H)=>{var q4H=EI();function r5(H,$){let A=H[0],L=A==="-"||A==="+"?H.substring(1):H,D=(E)=>$?BigInt(E):Number(E),I=L.replace(/_/g,"").split(":").reduce((E,K)=>E*D(60)+D(K),D(0));return A==="-"?D(-1)*I:I}function dj(H){let{value:$}=H,A=(E)=>E;if(typeof $==="bigint")A=(E)=>BigInt(E);else if(isNaN($)||!isFinite($))return q4H.stringifyNumber(H);let L="";if($<0)L="-",$*=A(-1);let D=A(60),I=[$%D];if($<60)I.unshift(0);else if($=($-I[0])/D,I.unshift($%D),$>=60)$=($-I[0])/D,I.unshift($);return L+I.map((E)=>String(E).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var T4H={identify:(H)=>typeof H==="bigint"||Number.isInteger(H),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(H,$,{intAsBigInt:A})=>r5(H,A),stringify:dj},_4H={identify:(H)=>typeof H==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(H)=>r5(H,!1),stringify:dj},pj={identify:(H)=>H instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(H){let $=H.match(pj.test);if(!$)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,A,L,D,I,E,K]=$.map(Number),M=$[7]?Number(($[7]+"00").substr(1,3)):0,W=Date.UTC(A,L-1,D,I||0,E||0,K||0,M),X=$[8];if(X&&X!=="Z"){let J=r5(X,!1);if(Math.abs(J)<30)J*=60;W-=60000*J}return new Date(W)},stringify:({value:H})=>H?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};N4H.floatTime=_4H;N4H.intTime=T4H;N4H.timestamp=pj});var lj=n((u4H)=>{var R4H=DI(),j4H=oX(),S4H=II(),x4H=Z4(),k4H=l5(),cj=hj(),H6=uj(),I2=mj(),y4H=dX(),f4H=a5(),v4H=H2(),b4H=s5(),$6=e5(),h4H=[R4H.map,S4H.seq,x4H.string,j4H.nullTag,cj.trueTag,cj.falseTag,I2.intBin,I2.intOct,I2.int,I2.intHex,H6.floatNaN,H6.floatExp,H6.float,k4H.binary,y4H.merge,f4H.omap,v4H.pairs,b4H.set,$6.intTime,$6.floatTime,$6.timestamp];u4H.schema=h4H});var $S=n((a4H)=>{var tj=DI(),m4H=oX(),oj=II(),d4H=Z4(),p4H=b5(),A6=u5(),L6=m5(),c4H=Oj(),l4H=Rj(),sj=l5(),V4=dX(),rj=a5(),ej=H2(),ij=lj(),HS=s5(),E2=e5(),nj=new Map([["core",c4H.schema],["failsafe",[tj.map,oj.seq,d4H.string]],["json",l4H.schema],["yaml11",ij.schema],["yaml-1.1",ij.schema]]),aj={binary:sj.binary,bool:p4H.boolTag,float:A6.float,floatExp:A6.floatExp,floatNaN:A6.floatNaN,floatTime:E2.floatTime,int:L6.int,intHex:L6.intHex,intOct:L6.intOct,intTime:E2.intTime,map:tj.map,merge:V4.merge,null:m4H.nullTag,omap:rj.omap,pairs:ej.pairs,seq:oj.seq,set:HS.set,timestamp:E2.timestamp},i4H={"tag:yaml.org,2002:binary":sj.binary,"tag:yaml.org,2002:merge":V4.merge,"tag:yaml.org,2002:omap":rj.omap,"tag:yaml.org,2002:pairs":ej.pairs,"tag:yaml.org,2002:set":HS.set,"tag:yaml.org,2002:timestamp":E2.timestamp};function n4H(H,$,A){let L=nj.get($);if(L&&!H)return A&&!L.includes(V4.merge)?L.concat(V4.merge):L.slice();let D=L;if(!D)if(Array.isArray(H))D=[];else{let I=Array.from(nj.keys()).filter((E)=>E!=="yaml11").map((E)=>JSON.stringify(E)).join(", ");throw Error(`Unknown schema "${$}"; use one of ${I} or define customTags array`)}if(Array.isArray(H))for(let I of H)D=D.concat(I);else if(typeof H==="function")D=H(D.slice());if(A)D=D.concat(V4.merge);return D.reduce((I,E)=>{let K=typeof E==="string"?aj[E]:E;if(!K){let M=JSON.stringify(E),W=Object.keys(aj).map((X)=>JSON.stringify(X)).join(", ");throw Error(`Unknown custom tag ${M}; use one of ${W}`)}if(!I.includes(K))I.push(K);return I},[])}a4H.coreKnownTags=i4H;a4H.getTags=n4H});var E6=n(($9H)=>{var D6=OH(),s4H=DI(),r4H=II(),e4H=Z4(),K2=$S(),H9H=(H,$)=>H.key<$.key?-1:H.key>$.key?1:0;class I6{constructor({compat:H,customTags:$,merge:A,resolveKnownTags:L,schema:D,sortMapEntries:I,toStringDefaults:E}){this.compat=Array.isArray(H)?K2.getTags(H,"compat"):H?K2.getTags(null,H):null,this.name=typeof D==="string"&&D||"core",this.knownTags=L?K2.coreKnownTags:{},this.tags=K2.getTags($,this.name,A),this.toStringOptions=E??null,Object.defineProperty(this,D6.MAP,{value:s4H.map}),Object.defineProperty(this,D6.SCALAR,{value:e4H.string}),Object.defineProperty(this,D6.SEQ,{value:r4H.seq}),this.sortMapEntries=typeof I==="function"?I:I===!0?H9H:null}clone(){let H=Object.create(I6.prototype,Object.getOwnPropertyDescriptors(this));return H.tags=this.tags.slice(),H}}$9H.Schema=I6});var AS=n((I9H)=>{var L9H=OH(),K6=W4(),C4=K4();function D9H(H,$){let A=[],L=$.directives===!0;if($.directives!==!1&&H.directives){let M=H.directives.toString(H);if(M)A.push(M),L=!0;else if(H.directives.docStart)L=!0}if(L)A.push("---");let D=K6.createStringifyContext(H,$),{commentString:I}=D.options;if(H.commentBefore){if(A.length!==1)A.unshift("");let M=I(H.commentBefore);A.unshift(C4.indentComment(M,""))}let E=!1,K=null;if(H.contents){if(L9H.isNode(H.contents)){if(H.contents.spaceBefore&&L)A.push("");if(H.contents.commentBefore){let X=I(H.contents.commentBefore);A.push(C4.indentComment(X,""))}D.forceBlockIndent=!!H.comment,K=H.contents.comment}let M=K?void 0:()=>E=!0,W=K6.stringify(H.contents,D,()=>K=null,M);if(K)W+=C4.lineComment(W,"",I(K));if((W[0]==="|"||W[0]===">")&&A[A.length-1]==="---")A[A.length-1]=`--- ${W}`;else A.push(W)}else A.push(K6.stringify(H.contents,D));if(H.directives?.docEnd)if(H.comment){let M=I(H.comment);if(M.includes(`
|
|
397
|
+
`))A.push("..."),A.push(C4.indentComment(M,""));else A.push(`... ${M}`)}else A.push("...");else{let M=H.comment;if(M&&E)M=M.replace(/^\n+/,"");if(M){if((!E||K)&&A[A.length-1]!=="")A.push("");A.push(C4.indentComment(I(M),""))}}return A.join(`
|
|
398
|
+
`)+`
|
|
399
|
+
`}I9H.stringifyDocument=D9H});var z4=n((Z9H)=>{var K9H=I4(),KI=vX(),o$=OH(),M9H=$0(),X9H=rL(),W9H=E6(),Q9H=AS(),M6=kX(),B9H=O5(),J9H=E4(),X6=F5();class W6{constructor(H,$,A){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,o$.NODE_TYPE,{value:o$.DOC});let L=null;if(typeof $==="function"||Array.isArray($))L=$;else if(A===void 0&&$)A=$,$=void 0;let D=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},A);this.options=D;let{version:I}=D;if(A?._directives){if(this.directives=A._directives.atDocument(),this.directives.yaml.explicit)I=this.directives.yaml.version}else this.directives=new X6.Directives({version:I});this.setSchema(I,A),this.contents=H===void 0?null:this.createNode(H,L,A)}clone(){let H=Object.create(W6.prototype,{[o$.NODE_TYPE]:{value:o$.DOC}});if(H.commentBefore=this.commentBefore,H.comment=this.comment,H.errors=this.errors.slice(),H.warnings=this.warnings.slice(),H.options=Object.assign({},this.options),this.directives)H.directives=this.directives.clone();if(H.schema=this.schema.clone(),H.contents=o$.isNode(this.contents)?this.contents.clone(H.schema):this.contents,this.range)H.range=this.range.slice();return H}add(H){if(MI(this.contents))this.contents.add(H)}addIn(H,$){if(MI(this.contents))this.contents.addIn(H,$)}createAlias(H,$){if(!H.anchor){let A=M6.anchorNames(this);H.anchor=!$||A.has($)?M6.findNewAnchor($||"a",A):$}return new K9H.Alias(H.anchor)}createNode(H,$,A){let L=void 0;if(typeof $==="function")H=$.call({"":H},"",H),L=$;else if(Array.isArray($)){let Y=(U)=>typeof U==="number"||U instanceof String||U instanceof Number,G=$.filter(Y).map(String);if(G.length>0)$=$.concat(G);L=$}else if(A===void 0&&$)A=$,$=void 0;let{aliasDuplicateObjects:D,anchorPrefix:I,flow:E,keepUndefined:K,onTagObj:M,tag:W}=A??{},{onAnchor:X,setAnchors:J,sourceObjects:Z}=M6.createNodeAnchors(this,I||"a"),Q={aliasDuplicateObjects:D??!0,keepUndefined:K??!1,onAnchor:X,onTagObj:M,replacer:L,schema:this.schema,sourceObjects:Z},B=J9H.createNode(H,W,Q);if(E&&o$.isCollection(B))B.flow=!0;return J(),B}createPair(H,$,A={}){let L=this.createNode(H,null,A),D=this.createNode($,null,A);return new M9H.Pair(L,D)}delete(H){return MI(this.contents)?this.contents.delete(H):!1}deleteIn(H){if(KI.isEmptyPath(H)){if(this.contents==null)return!1;return this.contents=null,!0}return MI(this.contents)?this.contents.deleteIn(H):!1}get(H,$){return o$.isCollection(this.contents)?this.contents.get(H,$):void 0}getIn(H,$){if(KI.isEmptyPath(H))return!$&&o$.isScalar(this.contents)?this.contents.value:this.contents;return o$.isCollection(this.contents)?this.contents.getIn(H,$):void 0}has(H){return o$.isCollection(this.contents)?this.contents.has(H):!1}hasIn(H){if(KI.isEmptyPath(H))return this.contents!==void 0;return o$.isCollection(this.contents)?this.contents.hasIn(H):!1}set(H,$){if(this.contents==null)this.contents=KI.collectionFromPath(this.schema,[H],$);else if(MI(this.contents))this.contents.set(H,$)}setIn(H,$){if(KI.isEmptyPath(H))this.contents=$;else if(this.contents==null)this.contents=KI.collectionFromPath(this.schema,Array.from(H),$);else if(MI(this.contents))this.contents.setIn(H,$)}setSchema(H,$={}){if(typeof H==="number")H=String(H);let A;switch(H){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new X6.Directives({version:"1.1"});A={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=H;else this.directives=new X6.Directives({version:H});A={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;A=null;break;default:{let L=JSON.stringify(H);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${L}`)}}if($.schema instanceof Object)this.schema=$.schema;else if(A)this.schema=new W9H.Schema(Object.assign(A,$));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:H,jsonArg:$,mapAsMap:A,maxAliasCount:L,onAnchor:D,reviver:I}={}){let E={anchors:new Map,doc:this,keep:!H,mapAsMap:A===!0,mapKeyWarned:!1,maxAliasCount:typeof L==="number"?L:100},K=X9H.toJS(this.contents,$??"",E);if(typeof D==="function")for(let{count:M,res:W}of E.anchors.values())D(W,M);return typeof I==="function"?B9H.applyReviver(I,{"":K},"",K):K}toJSON(H,$){return this.toJS({json:!0,jsonArg:H,mapAsMap:!1,onAnchor:$})}toString(H={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in H&&(!Number.isInteger(H.indent)||Number(H.indent)<=0)){let $=JSON.stringify(H.indent);throw Error(`"indent" option must be a positive integer, not ${$}`)}return Q9H.stringifyDocument(this,H)}}function MI(H){if(o$.isCollection(H))return!0;throw Error("Expected a YAML collection as document contents")}Z9H.Document=W6});var P4=n((U9H)=>{class M2 extends Error{constructor(H,$,A,L){super();this.name=H,this.code=A,this.message=L,this.pos=$}}class LS extends M2{constructor(H,$,A){super("YAMLParseError",H,$,A)}}class DS extends M2{constructor(H,$,A){super("YAMLWarning",H,$,A)}}var G9H=(H,$)=>(A)=>{if(A.pos[0]===-1)return;A.linePos=A.pos.map((K)=>$.linePos(K));let{line:L,col:D}=A.linePos[0];A.message+=` at line ${L}, column ${D}`;let I=D-1,E=H.substring($.lineStarts[L-1],$.lineStarts[L]).replace(/[\n\r]+$/,"");if(I>=60&&E.length>80){let K=Math.min(I-39,E.length-79);E="…"+E.substring(K),I-=K-1}if(E.length>80)E=E.substring(0,79)+"…";if(L>1&&/^ *$/.test(E.substring(0,I))){let K=H.substring($.lineStarts[L-2],$.lineStarts[L-1]);if(K.length>80)K=K.substring(0,79)+`…
|
|
400
|
+
`;E=K+E}if(/[^ ]/.test(E)){let K=1,M=A.linePos[1];if(M?.line===L&&M.col>D)K=Math.max(1,Math.min(M.col-D,80-I));let W=" ".repeat(I)+"^".repeat(K);A.message+=`:
|
|
401
|
+
|
|
402
|
+
${E}
|
|
403
|
+
${W}
|
|
404
|
+
`}};U9H.YAMLError=M2;U9H.YAMLParseError=LS;U9H.YAMLWarning=DS;U9H.prettifyError=G9H});var q4=n((T9H)=>{function q9H(H,{flow:$,indicator:A,next:L,offset:D,onError:I,parentIndent:E,startOnNewline:K}){let M=!1,W=K,X=K,J="",Z="",Q=!1,B=!1,Y=null,G=null,U=null,V=null,z=null,P=null,T=null;for(let N of H){if(B){if(N.type!=="space"&&N.type!=="newline"&&N.type!=="comma")I(N.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");B=!1}if(Y){if(W&&N.type!=="comment"&&N.type!=="newline")I(Y,"TAB_AS_INDENT","Tabs are not allowed as indentation");Y=null}switch(N.type){case"space":if(!$&&(A!=="doc-start"||L?.type!=="flow-collection")&&N.source.includes("\t"))Y=N;X=!0;break;case"comment":{if(!X)I(N,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let x=N.source.substring(1)||" ";if(!J)J=x;else J+=Z+x;Z="",W=!1;break}case"newline":if(W){if(J)J+=N.source;else if(!P||A!=="seq-item-ind")M=!0}else Z+=N.source;if(W=!0,Q=!0,G||U)V=N;X=!0;break;case"anchor":if(G)I(N,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(N.source.endsWith(":"))I(N.offset+N.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);G=N,T??(T=N.offset),W=!1,X=!1,B=!0;break;case"tag":{if(U)I(N,"MULTIPLE_TAGS","A node can have at most one tag");U=N,T??(T=N.offset),W=!1,X=!1,B=!0;break}case A:if(G||U)I(N,"BAD_PROP_ORDER",`Anchors and tags must be after the ${N.source} indicator`);if(P)I(N,"UNEXPECTED_TOKEN",`Unexpected ${N.source} in ${$??"collection"}`);P=N,W=A==="seq-item-ind"||A==="explicit-key-ind",X=!1;break;case"comma":if($){if(z)I(N,"UNEXPECTED_TOKEN",`Unexpected , in ${$}`);z=N,W=!1,X=!1;break}default:I(N,"UNEXPECTED_TOKEN",`Unexpected ${N.type} token`),W=!1,X=!1}}let q=H[H.length-1],O=q?q.offset+q.source.length:D;if(B&&L&&L.type!=="space"&&L.type!=="newline"&&L.type!=="comma"&&(L.type!=="scalar"||L.source!==""))I(L.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(Y&&(W&&Y.indent<=E||L?.type==="block-map"||L?.type==="block-seq"))I(Y,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:z,found:P,spaceBefore:M,comment:J,hasNewline:Q,anchor:G,tag:U,newlineAfterProp:V,end:O,start:T??O}}T9H.resolveProps=q9H});var X2=n((N9H)=>{function Q6(H){if(!H)return null;switch(H.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(H.source.includes(`
|
|
405
|
+
`))return!0;if(H.end){for(let $ of H.end)if($.type==="newline")return!0}return!1;case"flow-collection":for(let $ of H.items){for(let A of $.start)if(A.type==="newline")return!0;if($.sep){for(let A of $.sep)if(A.type==="newline")return!0}if(Q6($.key)||Q6($.value))return!0}return!1;default:return!0}}N9H.containsNewline=Q6});var B6=n((R9H)=>{var O9H=X2();function w9H(H,$,A){if($?.type==="flow-collection"){let L=$.end[0];if(L.indent===H&&(L.source==="]"||L.source==="}")&&O9H.containsNewline($))A(L,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}R9H.flowIndentCheck=w9H});var J6=n((x9H)=>{var IS=OH();function S9H(H,$,A){let{uniqueKeys:L}=H.options;if(L===!1)return!1;let D=typeof L==="function"?L:(I,E)=>I===E||IS.isScalar(I)&&IS.isScalar(E)&&I.value===E.value;return $.some((I)=>D(I.key,A))}x9H.mapIncludes=S9H});var WS=n((h9H)=>{var ES=$0(),y9H=L0(),KS=q4(),f9H=X2(),MS=B6(),v9H=J6(),XS="All mapping items must start at the same column";function b9H({composeNode:H,composeEmptyNode:$},A,L,D,I){let K=new(I?.nodeClass??y9H.YAMLMap)(A.schema);if(A.atRoot)A.atRoot=!1;let M=L.offset,W=null;for(let X of L.items){let{start:J,key:Z,sep:Q,value:B}=X,Y=KS.resolveProps(J,{indicator:"explicit-key-ind",next:Z??Q?.[0],offset:M,onError:D,parentIndent:L.indent,startOnNewline:!0}),G=!Y.found;if(G){if(Z){if(Z.type==="block-seq")D(M,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in Z&&Z.indent!==L.indent)D(M,"BAD_INDENT",XS)}if(!Y.anchor&&!Y.tag&&!Q){if(W=Y.end,Y.comment)if(K.comment)K.comment+=`
|
|
406
|
+
`+Y.comment;else K.comment=Y.comment;continue}if(Y.newlineAfterProp||f9H.containsNewline(Z))D(Z??J[J.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(Y.found?.indent!==L.indent)D(M,"BAD_INDENT",XS);A.atKey=!0;let U=Y.end,V=Z?H(A,Z,Y,D):$(A,U,J,null,Y,D);if(A.schema.compat)MS.flowIndentCheck(L.indent,Z,D);if(A.atKey=!1,v9H.mapIncludes(A,K.items,V))D(U,"DUPLICATE_KEY","Map keys must be unique");let z=KS.resolveProps(Q??[],{indicator:"map-value-ind",next:B,offset:V.range[2],onError:D,parentIndent:L.indent,startOnNewline:!Z||Z.type==="block-scalar"});if(M=z.end,z.found){if(G){if(B?.type==="block-map"&&!z.hasNewline)D(M,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(A.options.strict&&Y.start<z.found.offset-1024)D(V.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let P=B?H(A,B,z,D):$(A,M,Q,null,z,D);if(A.schema.compat)MS.flowIndentCheck(L.indent,B,D);M=P.range[2];let T=new ES.Pair(V,P);if(A.options.keepSourceTokens)T.srcToken=X;K.items.push(T)}else{if(G)D(V.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(z.comment)if(V.comment)V.comment+=`
|
|
407
|
+
`+z.comment;else V.comment=z.comment;let P=new ES.Pair(V);if(A.options.keepSourceTokens)P.srcToken=X;K.items.push(P)}}if(W&&W<M)D(W,"IMPOSSIBLE","Map comment with trailing content");return K.range=[L.offset,M,W??M],K}h9H.resolveBlockMap=b9H});var QS=n((c9H)=>{var g9H=D0(),m9H=q4(),d9H=B6();function p9H({composeNode:H,composeEmptyNode:$},A,L,D,I){let K=new(I?.nodeClass??g9H.YAMLSeq)(A.schema);if(A.atRoot)A.atRoot=!1;if(A.atKey)A.atKey=!1;let M=L.offset,W=null;for(let{start:X,value:J}of L.items){let Z=m9H.resolveProps(X,{indicator:"seq-item-ind",next:J,offset:M,onError:D,parentIndent:L.indent,startOnNewline:!0});if(!Z.found)if(Z.anchor||Z.tag||J)if(J?.type==="block-seq")D(Z.end,"BAD_INDENT","All sequence items must start at the same column");else D(M,"MISSING_CHAR","Sequence item without - indicator");else{if(W=Z.end,Z.comment)K.comment=Z.comment;continue}let Q=J?H(A,J,Z,D):$(A,Z.end,X,null,Z,D);if(A.schema.compat)d9H.flowIndentCheck(L.indent,J,D);M=Q.range[2],K.items.push(Q)}return K.range=[L.offset,M,W??M],K}c9H.resolveBlockSeq=p9H});var XI=n((n9H)=>{function i9H(H,$,A,L){let D="";if(H){let I=!1,E="";for(let K of H){let{source:M,type:W}=K;switch(W){case"space":I=!0;break;case"comment":{if(A&&!I)L(K,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let X=M.substring(1)||" ";if(!D)D=X;else D+=E+X;E="";break}case"newline":if(D)E+=M;I=!0;break;default:L(K,"UNEXPECTED_TOKEN",`Unexpected ${W} at node end`)}$+=M.length}}return{comment:D,offset:$}}n9H.resolveEnd=i9H});var ZS=n((AKH)=>{var t9H=OH(),o9H=$0(),BS=L0(),s9H=D0(),r9H=XI(),JS=q4(),e9H=X2(),HKH=J6(),Z6="Block collections are not allowed within flow collections",Y6=(H)=>H&&(H.type==="block-map"||H.type==="block-seq");function $KH({composeNode:H,composeEmptyNode:$},A,L,D,I){let E=L.start.source==="{",K=E?"flow map":"flow sequence",W=new(I?.nodeClass??(E?BS.YAMLMap:s9H.YAMLSeq))(A.schema);W.flow=!0;let X=A.atRoot;if(X)A.atRoot=!1;if(A.atKey)A.atKey=!1;let J=L.offset+L.start.source.length;for(let G=0;G<L.items.length;++G){let U=L.items[G],{start:V,key:z,sep:P,value:T}=U,q=JS.resolveProps(V,{flow:K,indicator:"explicit-key-ind",next:z??P?.[0],offset:J,onError:D,parentIndent:L.indent,startOnNewline:!1});if(!q.found){if(!q.anchor&&!q.tag&&!P&&!T){if(G===0&&q.comma)D(q.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${K}`);else if(G<L.items.length-1)D(q.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${K}`);if(q.comment)if(W.comment)W.comment+=`
|
|
408
|
+
`+q.comment;else W.comment=q.comment;J=q.end;continue}if(!E&&A.options.strict&&e9H.containsNewline(z))D(z,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(G===0){if(q.comma)D(q.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${K}`)}else{if(!q.comma)D(q.start,"MISSING_CHAR",`Missing , between ${K} items`);if(q.comment){let O="";H:for(let N of V)switch(N.type){case"comma":case"space":break;case"comment":O=N.source.substring(1);break H;default:break H}if(O){let N=W.items[W.items.length-1];if(t9H.isPair(N))N=N.value??N.key;if(N.comment)N.comment+=`
|
|
409
|
+
`+O;else N.comment=O;q.comment=q.comment.substring(O.length+1)}}}if(!E&&!P&&!q.found){let O=T?H(A,T,q,D):$(A,q.end,P,null,q,D);if(W.items.push(O),J=O.range[2],Y6(T))D(O.range,"BLOCK_IN_FLOW",Z6)}else{A.atKey=!0;let O=q.end,N=z?H(A,z,q,D):$(A,O,V,null,q,D);if(Y6(z))D(N.range,"BLOCK_IN_FLOW",Z6);A.atKey=!1;let x=JS.resolveProps(P??[],{flow:K,indicator:"map-value-ind",next:T,offset:N.range[2],onError:D,parentIndent:L.indent,startOnNewline:!1});if(x.found){if(!E&&!q.found&&A.options.strict){if(P)for(let f of P){if(f===x.found)break;if(f.type==="newline"){D(f,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(q.start<x.found.offset-1024)D(x.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(T)if("source"in T&&T.source?.[0]===":")D(T,"MISSING_CHAR",`Missing space after : in ${K}`);else D(x.start,"MISSING_CHAR",`Missing , or : between ${K} items`);let w=T?H(A,T,x,D):x.found?$(A,x.end,P,null,x,D):null;if(w){if(Y6(T))D(w.range,"BLOCK_IN_FLOW",Z6)}else if(x.comment)if(N.comment)N.comment+=`
|
|
410
|
+
`+x.comment;else N.comment=x.comment;let F=new o9H.Pair(N,w);if(A.options.keepSourceTokens)F.srcToken=U;if(E){let f=W;if(HKH.mapIncludes(A,f.items,N))D(O,"DUPLICATE_KEY","Map keys must be unique");f.items.push(F)}else{let f=new BS.YAMLMap(A.schema);f.flow=!0,f.items.push(F);let j=(w??N).range;f.range=[N.range[0],j[1],j[2]],W.items.push(f)}J=w?w.range[2]:x.end}}let Z=E?"}":"]",[Q,...B]=L.end,Y=J;if(Q?.source===Z)Y=Q.offset+Q.source.length;else{let G=K[0].toUpperCase()+K.substring(1),U=X?`${G} must end with a ${Z}`:`${G} in block collection must be sufficiently indented and end with a ${Z}`;if(D(J,X?"MISSING_CHAR":"BAD_INDENT",U),Q&&Q.source.length!==1)B.unshift(Q)}if(B.length>0){let G=r9H.resolveEnd(B,Y,A.options.strict,D);if(G.comment)if(W.comment)W.comment+=`
|
|
411
|
+
`+G.comment;else W.comment=G.comment;W.range=[L.offset,Y,G.offset]}else W.range=[L.offset,Y,Y];return W}AKH.resolveFlowCollection=$KH});var YS=n((BKH)=>{var DKH=OH(),IKH=tH(),EKH=L0(),KKH=D0(),MKH=WS(),XKH=QS(),WKH=ZS();function G6(H,$,A,L,D,I){let E=A.type==="block-map"?MKH.resolveBlockMap(H,$,A,L,I):A.type==="block-seq"?XKH.resolveBlockSeq(H,$,A,L,I):WKH.resolveFlowCollection(H,$,A,L,I),K=E.constructor;if(D==="!"||D===K.tagName)return E.tag=K.tagName,E;if(D)E.tag=D;return E}function QKH(H,$,A,L,D){let I=L.tag,E=!I?null:$.directives.tagName(I.source,(Z)=>D(I,"TAG_RESOLVE_FAILED",Z));if(A.type==="block-seq"){let{anchor:Z,newlineAfterProp:Q}=L,B=Z&&I?Z.offset>I.offset?Z:I:Z??I;if(B&&(!Q||Q.offset<B.offset))D(B,"MISSING_CHAR","Missing newline after block sequence props")}let K=A.type==="block-map"?"map":A.type==="block-seq"?"seq":A.start.source==="{"?"map":"seq";if(!I||!E||E==="!"||E===EKH.YAMLMap.tagName&&K==="map"||E===KKH.YAMLSeq.tagName&&K==="seq")return G6(H,$,A,D,E);let M=$.schema.tags.find((Z)=>Z.tag===E&&Z.collection===K);if(!M){let Z=$.schema.knownTags[E];if(Z?.collection===K)$.schema.tags.push(Object.assign({},Z,{default:!1})),M=Z;else{if(Z)D(I,"BAD_COLLECTION_TYPE",`${Z.tag} used for ${K} collection, but expects ${Z.collection??"scalar"}`,!0);else D(I,"TAG_RESOLVE_FAILED",`Unresolved tag: ${E}`,!0);return G6(H,$,A,D,E)}}let W=G6(H,$,A,D,E,M),X=M.resolve?.(W,(Z)=>D(I,"TAG_RESOLVE_FAILED",Z),$.options)??W,J=DKH.isNode(X)?X:new IKH.Scalar(X);if(J.range=W.range,J.tag=E,M?.format)J.format=M.format;return J}BKH.composeCollection=QKH});var V6=n((UKH)=>{var U6=tH();function ZKH(H,$,A){let L=$.offset,D=YKH($,H.options.strict,A);if(!D)return{value:"",type:null,comment:"",range:[L,L,L]};let I=D.mode===">"?U6.Scalar.BLOCK_FOLDED:U6.Scalar.BLOCK_LITERAL,E=$.source?GKH($.source):[],K=E.length;for(let Y=E.length-1;Y>=0;--Y){let G=E[Y][1];if(G===""||G==="\r")K=Y;else break}if(K===0){let Y=D.chomp==="+"&&E.length>0?`
|
|
412
|
+
`.repeat(Math.max(1,E.length-1)):"",G=L+D.length;if($.source)G+=$.source.length;return{value:Y,type:I,comment:D.comment,range:[L,G,G]}}let M=$.indent+D.indent,W=$.offset+D.length,X=0;for(let Y=0;Y<K;++Y){let[G,U]=E[Y];if(U===""||U==="\r"){if(D.indent===0&&G.length>M)M=G.length}else{if(G.length<M)A(W+G.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(D.indent===0)M=G.length;if(X=Y,M===0&&!H.atRoot)A(W,"BAD_INDENT","Block scalar values in collections must be indented");break}W+=G.length+U.length+1}for(let Y=E.length-1;Y>=K;--Y)if(E[Y][0].length>M)K=Y+1;let J="",Z="",Q=!1;for(let Y=0;Y<X;++Y)J+=E[Y][0].slice(M)+`
|
|
413
|
+
`;for(let Y=X;Y<K;++Y){let[G,U]=E[Y];W+=G.length+U.length+1;let V=U[U.length-1]==="\r";if(V)U=U.slice(0,-1);if(U&&G.length<M){let P=`Block scalar lines must not be less indented than their ${D.indent?"explicit indentation indicator":"first line"}`;A(W-U.length-(V?2:1),"BAD_INDENT",P),G=""}if(I===U6.Scalar.BLOCK_LITERAL)J+=Z+G.slice(M)+U,Z=`
|
|
414
|
+
`;else if(G.length>M||U[0]==="\t"){if(Z===" ")Z=`
|
|
415
|
+
`;else if(!Q&&Z===`
|
|
416
|
+
`)Z=`
|
|
417
|
+
|
|
418
|
+
`;J+=Z+G.slice(M)+U,Z=`
|
|
419
|
+
`,Q=!0}else if(U==="")if(Z===`
|
|
420
|
+
`)J+=`
|
|
421
|
+
`;else Z=`
|
|
422
|
+
`;else J+=Z+U,Z=" ",Q=!1}switch(D.chomp){case"-":break;case"+":for(let Y=K;Y<E.length;++Y)J+=`
|
|
423
|
+
`+E[Y][0].slice(M);if(J[J.length-1]!==`
|
|
424
|
+
`)J+=`
|
|
425
|
+
`;break;default:J+=`
|
|
426
|
+
`}let B=L+D.length+$.source.length;return{value:J,type:I,comment:D.comment,range:[L,B,B]}}function YKH({offset:H,props:$},A,L){if($[0].type!=="block-scalar-header")return L($[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:D}=$[0],I=D[0],E=0,K="",M=-1;for(let Z=1;Z<D.length;++Z){let Q=D[Z];if(!K&&(Q==="-"||Q==="+"))K=Q;else{let B=Number(Q);if(!E&&B)E=B;else if(M===-1)M=H+Z}}if(M!==-1)L(M,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${D}`);let W=!1,X="",J=D.length;for(let Z=1;Z<$.length;++Z){let Q=$[Z];switch(Q.type){case"space":W=!0;case"newline":J+=Q.source.length;break;case"comment":if(A&&!W)L(Q,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");J+=Q.source.length,X=Q.source.substring(1);break;case"error":L(Q,"UNEXPECTED_TOKEN",Q.message),J+=Q.source.length;break;default:{let B=`Unexpected token in block scalar header: ${Q.type}`;L(Q,"UNEXPECTED_TOKEN",B);let Y=Q.source;if(Y&&typeof Y==="string")J+=Y.length}}}return{mode:I,indent:E,chomp:K,comment:X,length:J}}function GKH(H){let $=H.split(/\n( *)/),A=$[0],L=A.match(/^( *)/),I=[L?.[1]?[L[1],A.slice(L[1].length)]:["",A]];for(let E=1;E<$.length;E+=2)I.push([$[E],$[E+1]]);return I}UKH.resolveBlockScalar=ZKH});var z6=n((OKH)=>{var C6=tH(),CKH=XI();function zKH(H,$,A){let{offset:L,type:D,source:I,end:E}=H,K,M,W=(Z,Q,B)=>A(L+Z,Q,B);switch(D){case"scalar":K=C6.Scalar.PLAIN,M=PKH(I,W);break;case"single-quoted-scalar":K=C6.Scalar.QUOTE_SINGLE,M=qKH(I,W);break;case"double-quoted-scalar":K=C6.Scalar.QUOTE_DOUBLE,M=TKH(I,W);break;default:return A(H,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${D}`),{value:"",type:null,comment:"",range:[L,L+I.length,L+I.length]}}let X=L+I.length,J=CKH.resolveEnd(E,X,$,A);return{value:M,type:K,comment:J.comment,range:[L,X,J.offset]}}function PKH(H,$){let A="";switch(H[0]){case"\t":A="a tab character";break;case",":A="flow indicator character ,";break;case"%":A="directive indicator character %";break;case"|":case">":{A=`block scalar indicator ${H[0]}`;break}case"@":case"`":{A=`reserved character ${H[0]}`;break}}if(A)$(0,"BAD_SCALAR_START",`Plain value cannot start with ${A}`);return GS(H)}function qKH(H,$){if(H[H.length-1]!=="'"||H.length===1)$(H.length,"MISSING_CHAR","Missing closing 'quote");return GS(H.slice(1,-1)).replace(/''/g,"'")}function GS(H){let $,A;try{$=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
427
|
+
`,"sy"),A=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
428
|
+
`,"sy")}catch{$=/(.*?)[ \t]*\r?\n/sy,A=/[ \t]*(.*?)[ \t]*\r?\n/sy}let L=$.exec(H);if(!L)return H;let D=L[1],I=" ",E=$.lastIndex;A.lastIndex=E;while(L=A.exec(H)){if(L[1]==="")if(I===`
|
|
429
|
+
`)D+=I;else I=`
|
|
430
|
+
`;else D+=I+L[1],I=" ";E=A.lastIndex}let K=/[ \t]*(.*)/sy;return K.lastIndex=E,L=K.exec(H),D+I+(L?.[1]??"")}function TKH(H,$){let A="";for(let L=1;L<H.length-1;++L){let D=H[L];if(D==="\r"&&H[L+1]===`
|
|
431
|
+
`)continue;if(D===`
|
|
432
|
+
`){let{fold:I,offset:E}=_KH(H,L);A+=I,L=E}else if(D==="\\"){let I=H[++L],E=NKH[I];if(E)A+=E;else if(I===`
|
|
433
|
+
`){I=H[L+1];while(I===" "||I==="\t")I=H[++L+1]}else if(I==="\r"&&H[L+1]===`
|
|
434
|
+
`){I=H[++L+1];while(I===" "||I==="\t")I=H[++L+1]}else if(I==="x"||I==="u"||I==="U"){let K={x:2,u:4,U:8}[I];A+=FKH(H,L+1,K,$),L+=K}else{let K=H.substr(L-1,2);$(L-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${K}`),A+=K}}else if(D===" "||D==="\t"){let I=L,E=H[L+1];while(E===" "||E==="\t")E=H[++L+1];if(E!==`
|
|
435
|
+
`&&!(E==="\r"&&H[L+2]===`
|
|
436
|
+
`))A+=L>I?H.slice(I,L+1):D}else A+=D}if(H[H.length-1]!=='"'||H.length===1)$(H.length,"MISSING_CHAR",'Missing closing "quote');return A}function _KH(H,$){let A="",L=H[$+1];while(L===" "||L==="\t"||L===`
|
|
437
|
+
`||L==="\r"){if(L==="\r"&&H[$+2]!==`
|
|
438
|
+
`)break;if(L===`
|
|
439
|
+
`)A+=`
|
|
440
|
+
`;$+=1,L=H[$+1]}if(!A)A=" ";return{fold:A,offset:$}}var NKH={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
441
|
+
`,r:"\r",t:"\t",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function FKH(H,$,A,L){let D=H.substr($,A),E=D.length===A&&/^[0-9a-fA-F]+$/.test(D)?parseInt(D,16):NaN;if(isNaN(E)){let K=H.substr($-2,A+2);return L($-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${K}`),K}return String.fromCodePoint(E)}OKH.resolveFlowScalar=zKH});var VS=n((yKH)=>{var WD=OH(),US=tH(),RKH=V6(),jKH=z6();function SKH(H,$,A,L){let{value:D,type:I,comment:E,range:K}=$.type==="block-scalar"?RKH.resolveBlockScalar(H,$,L):jKH.resolveFlowScalar($,H.options.strict,L),M=A?H.directives.tagName(A.source,(J)=>L(A,"TAG_RESOLVE_FAILED",J)):null,W;if(H.options.stringKeys&&H.atKey)W=H.schema[WD.SCALAR];else if(M)W=xKH(H.schema,D,M,A,L);else if($.type==="scalar")W=kKH(H,D,$,L);else W=H.schema[WD.SCALAR];let X;try{let J=W.resolve(D,(Z)=>L(A??$,"TAG_RESOLVE_FAILED",Z),H.options);X=WD.isScalar(J)?J:new US.Scalar(J)}catch(J){let Z=J instanceof Error?J.message:String(J);L(A??$,"TAG_RESOLVE_FAILED",Z),X=new US.Scalar(D)}if(X.range=K,X.source=D,I)X.type=I;if(M)X.tag=M;if(W.format)X.format=W.format;if(E)X.comment=E;return X}function xKH(H,$,A,L,D){if(A==="!")return H[WD.SCALAR];let I=[];for(let K of H.tags)if(!K.collection&&K.tag===A)if(K.default&&K.test)I.push(K);else return K;for(let K of I)if(K.test?.test($))return K;let E=H.knownTags[A];if(E&&!E.collection)return H.tags.push(Object.assign({},E,{default:!1,test:void 0})),E;return D(L,"TAG_RESOLVE_FAILED",`Unresolved tag: ${A}`,A!=="tag:yaml.org,2002:str"),H[WD.SCALAR]}function kKH({atKey:H,directives:$,schema:A},L,D,I){let E=A.tags.find((K)=>(K.default===!0||H&&K.default==="key")&&K.test?.test(L))||A[WD.SCALAR];if(A.compat){let K=A.compat.find((M)=>M.default&&M.test?.test(L))??A[WD.SCALAR];if(E.tag!==K.tag){let M=$.tagString(E.tag),W=$.tagString(K.tag),X=`Value may be parsed as either ${M} or ${W}`;I(D,"TAG_RESOLVE_FAILED",X,!0)}}return E}yKH.composeScalar=SKH});var CS=n((bKH)=>{function vKH(H,$,A){if($){A??(A=$.length);for(let L=A-1;L>=0;--L){let D=$[L];switch(D.type){case"space":case"comment":case"newline":H-=D.source.length;continue}D=$[++L];while(D?.type==="space")H+=D.source.length,D=$[++L];break}}return H}bKH.emptyScalarPosition=vKH});var qS=n((iKH)=>{var uKH=I4(),gKH=OH(),mKH=YS(),zS=VS(),dKH=XI(),pKH=CS(),cKH={composeNode:PS,composeEmptyNode:P6};function PS(H,$,A,L){let D=H.atKey,{spaceBefore:I,comment:E,anchor:K,tag:M}=A,W,X=!0;switch($.type){case"alias":if(W=lKH(H,$,L),K||M)L($,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(W=zS.composeScalar(H,$,M,L),K)W.anchor=K.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(W=mKH.composeCollection(cKH,H,$,A,L),K)W.anchor=K.source.substring(1);break;default:{let J=$.type==="error"?$.message:`Unsupported token (type: ${$.type})`;L($,"UNEXPECTED_TOKEN",J),W=P6(H,$.offset,void 0,null,A,L),X=!1}}if(K&&W.anchor==="")L(K,"BAD_ALIAS","Anchor cannot be an empty string");if(D&&H.options.stringKeys&&(!gKH.isScalar(W)||typeof W.value!=="string"||W.tag&&W.tag!=="tag:yaml.org,2002:str"))L(M??$,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(I)W.spaceBefore=!0;if(E)if($.type==="scalar"&&$.source==="")W.comment=E;else W.commentBefore=E;if(H.options.keepSourceTokens&&X)W.srcToken=$;return W}function P6(H,$,A,L,{spaceBefore:D,comment:I,anchor:E,tag:K,end:M},W){let X={type:"scalar",offset:pKH.emptyScalarPosition($,A,L),indent:-1,source:""},J=zS.composeScalar(H,X,K,W);if(E){if(J.anchor=E.source.substring(1),J.anchor==="")W(E,"BAD_ALIAS","Anchor cannot be an empty string")}if(D)J.spaceBefore=!0;if(I)J.comment=I,J.range[2]=M;return J}function lKH({options:H},{offset:$,source:A,end:L},D){let I=new uKH.Alias(A.substring(1));if(I.source==="")D($,"BAD_ALIAS","Alias cannot be an empty string");if(I.source.endsWith(":"))D($+A.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let E=$+A.length,K=dKH.resolveEnd(L,E,H.strict,D);if(I.range=[$,E,K.offset],K.comment)I.comment=K.comment;return I}iKH.composeEmptyNode=P6;iKH.composeNode=PS});var _S=n((eKH)=>{var tKH=z4(),TS=qS(),oKH=XI(),sKH=q4();function rKH(H,$,{offset:A,start:L,value:D,end:I},E){let K=Object.assign({_directives:$},H),M=new tKH.Document(void 0,K),W={atKey:!1,atRoot:!0,directives:M.directives,options:M.options,schema:M.schema},X=sKH.resolveProps(L,{indicator:"doc-start",next:D??I?.[0],offset:A,onError:E,parentIndent:0,startOnNewline:!0});if(X.found){if(M.directives.docStart=!0,D&&(D.type==="block-map"||D.type==="block-seq")&&!X.hasNewline)E(X.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}M.contents=D?TS.composeNode(W,D,X,E):TS.composeEmptyNode(W,X.end,L,null,X,E);let J=M.contents.range[2],Z=oKH.resolveEnd(I,J,!1,E);if(Z.comment)M.comment=Z.comment;return M.range=[A,J,Z.offset],M}eKH.composeDoc=rKH});var q6=n((EMH)=>{var $MH=ZH("process"),AMH=F5(),LMH=z4(),T4=P4(),NS=OH(),DMH=_S(),IMH=XI();function _4(H){if(typeof H==="number")return[H,H+1];if(Array.isArray(H))return H.length===2?H:[H[0],H[1]];let{offset:$,source:A}=H;return[$,$+(typeof A==="string"?A.length:1)]}function FS(H){let $="",A=!1,L=!1;for(let D=0;D<H.length;++D){let I=H[D];switch(I[0]){case"#":$+=($===""?"":L?`
|
|
442
|
+
|
|
443
|
+
`:`
|
|
444
|
+
`)+(I.substring(1)||" "),A=!0,L=!1;break;case"%":if(H[D+1]?.[0]!=="#")D+=1;A=!1;break;default:if(!A)L=!0;A=!1}}return{comment:$,afterEmptyLine:L}}class OS{constructor(H={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=($,A,L,D)=>{let I=_4($);if(D)this.warnings.push(new T4.YAMLWarning(I,A,L));else this.errors.push(new T4.YAMLParseError(I,A,L))},this.directives=new AMH.Directives({version:H.version||"1.2"}),this.options=H}decorate(H,$){let{comment:A,afterEmptyLine:L}=FS(this.prelude);if(A){let D=H.contents;if($)H.comment=H.comment?`${H.comment}
|
|
445
|
+
${A}`:A;else if(L||H.directives.docStart||!D)H.commentBefore=A;else if(NS.isCollection(D)&&!D.flow&&D.items.length>0){let I=D.items[0];if(NS.isPair(I))I=I.key;let E=I.commentBefore;I.commentBefore=E?`${A}
|
|
446
|
+
${E}`:A}else{let I=D.commentBefore;D.commentBefore=I?`${A}
|
|
447
|
+
${I}`:A}}if($)Array.prototype.push.apply(H.errors,this.errors),Array.prototype.push.apply(H.warnings,this.warnings);else H.errors=this.errors,H.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:FS(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(H,$=!1,A=-1){for(let L of H)yield*this.next(L);yield*this.end($,A)}*next(H){if($MH.env.LOG_STREAM)console.dir(H,{depth:null});switch(H.type){case"directive":this.directives.add(H.source,($,A,L)=>{let D=_4(H);D[0]+=$,this.onError(D,"BAD_DIRECTIVE",A,L)}),this.prelude.push(H.source),this.atDirectives=!0;break;case"document":{let $=DMH.composeDoc(this.options,this.directives,H,this.onError);if(this.atDirectives&&!$.directives.docStart)this.onError(H,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate($,!1),this.doc)yield this.doc;this.doc=$,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(H.source);break;case"error":{let $=H.source?`${H.message}: ${JSON.stringify(H.source)}`:H.message,A=new T4.YAMLParseError(_4(H),"UNEXPECTED_TOKEN",$);if(this.atDirectives||!this.doc)this.errors.push(A);else this.doc.errors.push(A);break}case"doc-end":{if(!this.doc){this.errors.push(new T4.YAMLParseError(_4(H),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let $=IMH.resolveEnd(H.end,H.offset+H.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),$.comment){let A=this.doc.comment;this.doc.comment=A?`${A}
|
|
448
|
+
${$.comment}`:$.comment}this.doc.range[2]=$.offset;break}default:this.errors.push(new T4.YAMLParseError(_4(H),"UNEXPECTED_TOKEN",`Unsupported token ${H.type}`))}}*end(H=!1,$=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(H){let A=Object.assign({_directives:this.directives},this.options),L=new LMH.Document(void 0,A);if(this.atDirectives)this.onError($,"MISSING_CHAR","Missing directives-end indicator line");L.range=[0,$,$],this.decorate(L,!1),yield L}}}EMH.Composer=OS});var jS=n((YMH)=>{var MMH=V6(),XMH=z6(),WMH=P4(),wS=X4();function QMH(H,$=!0,A){if(H){let L=(D,I,E)=>{let K=typeof D==="number"?D:Array.isArray(D)?D[0]:D.offset;if(A)A(K,I,E);else throw new WMH.YAMLParseError([K,K+1],I,E)};switch(H.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return XMH.resolveFlowScalar(H,$,L);case"block-scalar":return MMH.resolveBlockScalar({options:{strict:$}},H,L)}}return null}function BMH(H,$){let{implicitKey:A=!1,indent:L,inFlow:D=!1,offset:I=-1,type:E="PLAIN"}=$,K=wS.stringifyString({type:E,value:H},{implicitKey:A,indent:L>0?" ".repeat(L):"",inFlow:D,options:{blockQuote:!0,lineWidth:-1}}),M=$.end??[{type:"newline",offset:-1,indent:L,source:`
|
|
449
|
+
`}];switch(K[0]){case"|":case">":{let W=K.indexOf(`
|
|
450
|
+
`),X=K.substring(0,W),J=K.substring(W+1)+`
|
|
451
|
+
`,Z=[{type:"block-scalar-header",offset:I,indent:L,source:X}];if(!RS(Z,M))Z.push({type:"newline",offset:-1,indent:L,source:`
|
|
452
|
+
`});return{type:"block-scalar",offset:I,indent:L,props:Z,source:J}}case'"':return{type:"double-quoted-scalar",offset:I,indent:L,source:K,end:M};case"'":return{type:"single-quoted-scalar",offset:I,indent:L,source:K,end:M};default:return{type:"scalar",offset:I,indent:L,source:K,end:M}}}function JMH(H,$,A={}){let{afterKey:L=!1,implicitKey:D=!1,inFlow:I=!1,type:E}=A,K="indent"in H?H.indent:null;if(L&&typeof K==="number")K+=2;if(!E)switch(H.type){case"single-quoted-scalar":E="QUOTE_SINGLE";break;case"double-quoted-scalar":E="QUOTE_DOUBLE";break;case"block-scalar":{let W=H.props[0];if(W.type!=="block-scalar-header")throw Error("Invalid block scalar header");E=W.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:E="PLAIN"}let M=wS.stringifyString({type:E,value:$},{implicitKey:D||K===null,indent:K!==null&&K>0?" ".repeat(K):"",inFlow:I,options:{blockQuote:!0,lineWidth:-1}});switch(M[0]){case"|":case">":ZMH(H,M);break;case'"':T6(H,M,"double-quoted-scalar");break;case"'":T6(H,M,"single-quoted-scalar");break;default:T6(H,M,"scalar")}}function ZMH(H,$){let A=$.indexOf(`
|
|
453
|
+
`),L=$.substring(0,A),D=$.substring(A+1)+`
|
|
454
|
+
`;if(H.type==="block-scalar"){let I=H.props[0];if(I.type!=="block-scalar-header")throw Error("Invalid block scalar header");I.source=L,H.source=D}else{let{offset:I}=H,E="indent"in H?H.indent:-1,K=[{type:"block-scalar-header",offset:I,indent:E,source:L}];if(!RS(K,"end"in H?H.end:void 0))K.push({type:"newline",offset:-1,indent:E,source:`
|
|
455
|
+
`});for(let M of Object.keys(H))if(M!=="type"&&M!=="offset")delete H[M];Object.assign(H,{type:"block-scalar",indent:E,props:K,source:D})}}function RS(H,$){if($)for(let A of $)switch(A.type){case"space":case"comment":H.push(A);break;case"newline":return H.push(A),!0}return!1}function T6(H,$,A){switch(H.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":H.type=A,H.source=$;break;case"block-scalar":{let L=H.props.slice(1),D=$.length;if(H.props[0].type==="block-scalar-header")D-=H.props[0].source.length;for(let I of L)I.offset+=D;delete H.props,Object.assign(H,{type:A,source:$,end:L});break}case"block-map":case"block-seq":{let D={type:"newline",offset:H.offset+$.length,indent:H.indent,source:`
|
|
456
|
+
`};delete H.items,Object.assign(H,{type:A,source:$,end:[D]});break}default:{let L="indent"in H?H.indent:-1,D="end"in H&&Array.isArray(H.end)?H.end.filter((I)=>I.type==="space"||I.type==="comment"||I.type==="newline"):[];for(let I of Object.keys(H))if(I!=="type"&&I!=="offset")delete H[I];Object.assign(H,{type:A,indent:L,source:$,end:D})}}}YMH.createScalarToken=BMH;YMH.resolveAsScalar=QMH;YMH.setScalarValue=JMH});var SS=n((zMH)=>{var CMH=(H)=>("type"in H)?Q2(H):W2(H);function Q2(H){switch(H.type){case"block-scalar":{let $="";for(let A of H.props)$+=Q2(A);return $+H.source}case"block-map":case"block-seq":{let $="";for(let A of H.items)$+=W2(A);return $}case"flow-collection":{let $=H.start.source;for(let A of H.items)$+=W2(A);for(let A of H.end)$+=A.source;return $}case"document":{let $=W2(H);if(H.end)for(let A of H.end)$+=A.source;return $}default:{let $=H.source;if("end"in H&&H.end)for(let A of H.end)$+=A.source;return $}}}function W2({start:H,key:$,sep:A,value:L}){let D="";for(let I of H)D+=I.source;if($)D+=Q2($);if(A)for(let I of A)D+=I.source;if(L)D+=Q2(L);return D}zMH.stringify=CMH});var yS=n((TMH)=>{var _6=Symbol("break visit"),qMH=Symbol("skip children"),xS=Symbol("remove item");function QD(H,$){if("type"in H&&H.type==="document")H={start:H.start,value:H.value};kS(Object.freeze([]),H,$)}QD.BREAK=_6;QD.SKIP=qMH;QD.REMOVE=xS;QD.itemAtPath=(H,$)=>{let A=H;for(let[L,D]of $){let I=A?.[L];if(I&&"items"in I)A=I.items[D];else return}return A};QD.parentCollection=(H,$)=>{let A=QD.itemAtPath(H,$.slice(0,-1)),L=$[$.length-1][0],D=A?.[L];if(D&&"items"in D)return D;throw Error("Parent collection not found")};function kS(H,$,A){let L=A($,H);if(typeof L==="symbol")return L;for(let D of["key","value"]){let I=$[D];if(I&&"items"in I){for(let E=0;E<I.items.length;++E){let K=kS(Object.freeze(H.concat([[D,E]])),I.items[E],A);if(typeof K==="number")E=K-1;else if(K===_6)return _6;else if(K===xS)I.items.splice(E,1),E-=1}if(typeof L==="function"&&D==="key")L=L($,H)}}return typeof L==="function"?L($,H):L}TMH.visit=QD});var B2=n((SMH)=>{var N6=jS(),NMH=SS(),FMH=yS(),F6="\uFEFF",O6="\x02",w6="\x18",R6="\x1F",OMH=(H)=>!!H&&("items"in H),wMH=(H)=>!!H&&(H.type==="scalar"||H.type==="single-quoted-scalar"||H.type==="double-quoted-scalar"||H.type==="block-scalar");function RMH(H){switch(H){case F6:return"<BOM>";case O6:return"<DOC>";case w6:return"<FLOW_END>";case R6:return"<SCALAR>";default:return JSON.stringify(H)}}function jMH(H){switch(H){case F6:return"byte-order-mark";case O6:return"doc-mode";case w6:return"flow-error-end";case R6:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
457
|
+
`:case`\r
|
|
458
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(H[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}SMH.createScalarToken=N6.createScalarToken;SMH.resolveAsScalar=N6.resolveAsScalar;SMH.setScalarValue=N6.setScalarValue;SMH.stringify=NMH.stringify;SMH.visit=FMH.visit;SMH.BOM=F6;SMH.DOCUMENT=O6;SMH.FLOW_END=w6;SMH.SCALAR=R6;SMH.isCollection=OMH;SMH.isScalar=wMH;SMH.prettyToken=RMH;SMH.tokenType=jMH});var S6=n((nMH)=>{var N4=B2();function KA(H){switch(H){case void 0:case" ":case`
|
|
459
|
+
`:case"\r":case"\t":return!0;default:return!1}}var fS=new Set("0123456789ABCDEFabcdef"),lMH=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),J2=new Set(",[]{}"),iMH=new Set(` ,[]{}
|
|
460
|
+
\r `),j6=(H)=>!H||iMH.has(H);class vS{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(H,$=!1){if(H){if(typeof H!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+H:H,this.lineEndPos=null}this.atEnd=!$;let A=this.next??"stream";while(A&&($||this.hasChars(1)))A=yield*this.parseNext(A)}atLineEnd(){let H=this.pos,$=this.buffer[H];while($===" "||$==="\t")$=this.buffer[++H];if(!$||$==="#"||$===`
|
|
461
|
+
`)return!0;if($==="\r")return this.buffer[H+1]===`
|
|
462
|
+
`;return!1}charAt(H){return this.buffer[this.pos+H]}continueScalar(H){let $=this.buffer[H];if(this.indentNext>0){let A=0;while($===" ")$=this.buffer[++A+H];if($==="\r"){let L=this.buffer[A+H+1];if(L===`
|
|
463
|
+
`||!L&&!this.atEnd)return H+A+1}return $===`
|
|
464
|
+
`||A>=this.indentNext||!$&&!this.atEnd?H+A:-1}if($==="-"||$==="."){let A=this.buffer.substr(H,3);if((A==="---"||A==="...")&&KA(this.buffer[H+3]))return-1}return H}getLine(){let H=this.lineEndPos;if(typeof H!=="number"||H!==-1&&H<this.pos)H=this.buffer.indexOf(`
|
|
465
|
+
`,this.pos),this.lineEndPos=H;if(H===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[H-1]==="\r")H-=1;return this.buffer.substring(this.pos,H)}hasChars(H){return this.pos+H<=this.buffer.length}setNext(H){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=H,null}peek(H){return this.buffer.substr(this.pos,H)}*parseNext(H){switch(H){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let H=this.getLine();if(H===null)return this.setNext("stream");if(H[0]===N4.BOM)yield*this.pushCount(1),H=H.substring(1);if(H[0]==="%"){let $=H.length,A=H.indexOf("#");while(A!==-1){let D=H[A-1];if(D===" "||D==="\t"){$=A-1;break}else A=H.indexOf("#",A+1)}while(!0){let D=H[$-1];if(D===" "||D==="\t")$-=1;else break}let L=(yield*this.pushCount($))+(yield*this.pushSpaces(!0));return yield*this.pushCount(H.length-L),this.pushNewline(),"stream"}if(this.atLineEnd()){let $=yield*this.pushSpaces(!0);return yield*this.pushCount(H.length-$),yield*this.pushNewline(),"stream"}return yield N4.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let H=this.charAt(0);if(!H&&!this.atEnd)return this.setNext("line-start");if(H==="-"||H==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let $=this.peek(3);if(($==="---"||$==="...")&&KA(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,$==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!KA(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[H,$]=this.peek(2);if(!$&&!this.atEnd)return this.setNext("block-start");if((H==="-"||H==="?"||H===":")&&KA($)){let A=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=A,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let H=this.getLine();if(H===null)return this.setNext("doc");let $=yield*this.pushIndicators();switch(H[$]){case"#":yield*this.pushCount(H.length-$);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(j6),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return $+=yield*this.parseBlockScalarHeader(),$+=yield*this.pushSpaces(!0),yield*this.pushCount(H.length-$),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let H,$,A=-1;do{if(H=yield*this.pushNewline(),H>0)$=yield*this.pushSpaces(!1),this.indentValue=A=$;else $=0;$+=yield*this.pushSpaces(!0)}while(H+$>0);let L=this.getLine();if(L===null)return this.setNext("flow");if(A!==-1&&A<this.indentNext&&L[0]!=="#"||A===0&&(L.startsWith("---")||L.startsWith("..."))&&KA(L[3])){if(!(A===this.indentNext-1&&this.flowLevel===1&&(L[0]==="]"||L[0]==="}")))return this.flowLevel=0,yield N4.FLOW_END,yield*this.parseLineStart()}let D=0;while(L[D]===",")D+=yield*this.pushCount(1),D+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(D+=yield*this.pushIndicators(),L[D]){case void 0:return"flow";case"#":return yield*this.pushCount(L.length-D),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(j6),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let I=this.charAt(1);if(this.flowKey||KA(I)||I===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let H=this.charAt(0),$=this.buffer.indexOf(H,this.pos+1);if(H==="'")while($!==-1&&this.buffer[$+1]==="'")$=this.buffer.indexOf("'",$+2);else while($!==-1){let D=0;while(this.buffer[$-1-D]==="\\")D+=1;if(D%2===0)break;$=this.buffer.indexOf('"',$+1)}let A=this.buffer.substring(0,$),L=A.indexOf(`
|
|
466
|
+
`,this.pos);if(L!==-1){while(L!==-1){let D=this.continueScalar(L+1);if(D===-1)break;L=A.indexOf(`
|
|
467
|
+
`,D)}if(L!==-1)$=L-(A[L-1]==="\r"?2:1)}if($===-1){if(!this.atEnd)return this.setNext("quoted-scalar");$=this.buffer.length}return yield*this.pushToIndex($+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let H=this.pos;while(!0){let $=this.buffer[++H];if($==="+")this.blockScalarKeep=!0;else if($>"0"&&$<="9")this.blockScalarIndent=Number($)-1;else if($!=="-")break}return yield*this.pushUntil(($)=>KA($)||$==="#")}*parseBlockScalar(){let H=this.pos-1,$=0,A;H:for(let D=this.pos;A=this.buffer[D];++D)switch(A){case" ":$+=1;break;case`
|
|
468
|
+
`:H=D,$=0;break;case"\r":{let I=this.buffer[D+1];if(!I&&!this.atEnd)return this.setNext("block-scalar");if(I===`
|
|
469
|
+
`)break}default:break H}if(!A&&!this.atEnd)return this.setNext("block-scalar");if($>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=$;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let D=this.continueScalar(H+1);if(D===-1)break;H=this.buffer.indexOf(`
|
|
470
|
+
`,D)}while(H!==-1);if(H===-1){if(!this.atEnd)return this.setNext("block-scalar");H=this.buffer.length}}let L=H+1;A=this.buffer[L];while(A===" ")A=this.buffer[++L];if(A==="\t"){while(A==="\t"||A===" "||A==="\r"||A===`
|
|
471
|
+
`)A=this.buffer[++L];H=L-1}else if(!this.blockScalarKeep)do{let D=H-1,I=this.buffer[D];if(I==="\r")I=this.buffer[--D];let E=D;while(I===" ")I=this.buffer[--D];if(I===`
|
|
472
|
+
`&&D>=this.pos&&D+1+$>E)H=D;else break}while(!0);return yield N4.SCALAR,yield*this.pushToIndex(H+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let H=this.flowLevel>0,$=this.pos-1,A=this.pos-1,L;while(L=this.buffer[++A])if(L===":"){let D=this.buffer[A+1];if(KA(D)||H&&J2.has(D))break;$=A}else if(KA(L)){let D=this.buffer[A+1];if(L==="\r")if(D===`
|
|
473
|
+
`)A+=1,L=`
|
|
474
|
+
`,D=this.buffer[A+1];else $=A;if(D==="#"||H&&J2.has(D))break;if(L===`
|
|
475
|
+
`){let I=this.continueScalar(A+1);if(I===-1)break;A=Math.max(A,I-2)}}else{if(H&&J2.has(L))break;$=A}if(!L&&!this.atEnd)return this.setNext("plain-scalar");return yield N4.SCALAR,yield*this.pushToIndex($+1,!0),H?"flow":"doc"}*pushCount(H){if(H>0)return yield this.buffer.substr(this.pos,H),this.pos+=H,H;return 0}*pushToIndex(H,$){let A=this.buffer.slice(this.pos,H);if(A)return yield A,this.pos+=A.length,A.length;else if($)yield"";return 0}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(j6))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let H=this.flowLevel>0,$=this.charAt(1);if(KA($)||H&&J2.has($)){if(!H)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;return(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}}return 0}*pushTag(){if(this.charAt(1)==="<"){let H=this.pos+2,$=this.buffer[H];while(!KA($)&&$!==">")$=this.buffer[++H];return yield*this.pushToIndex($===">"?H+1:H,!1)}else{let H=this.pos+1,$=this.buffer[H];while($)if(lMH.has($))$=this.buffer[++H];else if($==="%"&&fS.has(this.buffer[H+1])&&fS.has(this.buffer[H+2]))$=this.buffer[H+=3];else break;return yield*this.pushToIndex(H,!1)}}*pushNewline(){let H=this.buffer[this.pos];if(H===`
|
|
476
|
+
`)return yield*this.pushCount(1);else if(H==="\r"&&this.charAt(1)===`
|
|
477
|
+
`)return yield*this.pushCount(2);else return 0}*pushSpaces(H){let $=this.pos-1,A;do A=this.buffer[++$];while(A===" "||H&&A==="\t");let L=$-this.pos;if(L>0)yield this.buffer.substr(this.pos,L),this.pos=$;return L}*pushUntil(H){let $=this.pos,A=this.buffer[$];while(!H(A))A=this.buffer[++$];return yield*this.pushToIndex($,!1)}}nMH.Lexer=vS});var x6=n((tMH)=>{class bS{constructor(){this.lineStarts=[],this.addNewLine=(H)=>this.lineStarts.push(H),this.linePos=(H)=>{let $=0,A=this.lineStarts.length;while($<A){let D=$+A>>1;if(this.lineStarts[D]<H)$=D+1;else A=D}if(this.lineStarts[$]===H)return{line:$+1,col:1};if($===0)return{line:0,col:H};let L=this.lineStarts[$-1];return{line:$,col:H-L+1}}}}tMH.LineCounter=bS});var k6=n((eMH)=>{var sMH=ZH("process"),hS=B2(),rMH=S6();function I0(H,$){for(let A=0;A<H.length;++A)if(H[A].type===$)return!0;return!1}function uS(H){for(let $=0;$<H.length;++$)switch(H[$].type){case"space":case"comment":case"newline":break;default:return $}return-1}function mS(H){switch(H?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Z2(H){switch(H.type){case"document":return H.start;case"block-map":{let $=H.items[H.items.length-1];return $.sep??$.start}case"block-seq":return H.items[H.items.length-1].start;default:return[]}}function WI(H){if(H.length===0)return[];let $=H.length;H:while(--$>=0)switch(H[$].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break H}while(H[++$]?.type==="space");return H.splice($,H.length)}function gS(H){if(H.start.type==="flow-seq-start"){for(let $ of H.items)if($.sep&&!$.value&&!I0($.start,"explicit-key-ind")&&!I0($.sep,"map-value-ind")){if($.key)$.value=$.key;if(delete $.key,mS($.value))if($.value.end)Array.prototype.push.apply($.value.end,$.sep);else $.value.end=$.sep;else Array.prototype.push.apply($.start,$.sep);delete $.sep}}}class dS{constructor(H){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new rMH.Lexer,this.onNewLine=H}*parse(H,$=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let A of this.lexer.lex(H,$))yield*this.next(A);if(!$)yield*this.end()}*next(H){if(this.source=H,sMH.env.LOG_TOKENS)console.log("|",hS.prettyToken(H));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=H.length;return}let $=hS.tokenType(H);if(!$){let A=`Not a YAML token: ${H}`;yield*this.pop({type:"error",offset:this.offset,message:A,source:H}),this.offset+=H.length}else if($==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=$,yield*this.step(),$){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+H.length);break;case"space":if(this.atNewLine&&H[0]===" ")this.indent+=H.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=H.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=H.length}}*end(){while(this.stack.length>0)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let H=this.peek(1);if(this.type==="doc-end"&&H?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!H)return yield*this.stream();switch(H.type){case"document":return yield*this.document(H);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(H);case"block-scalar":return yield*this.blockScalar(H);case"block-map":return yield*this.blockMap(H);case"block-seq":return yield*this.blockSequence(H);case"flow-collection":return yield*this.flowCollection(H);case"doc-end":return yield*this.documentEnd(H)}yield*this.pop()}peek(H){return this.stack[this.stack.length-H]}*pop(H){let $=H??this.stack.pop();if(!$)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield $;else{let A=this.peek(1);if($.type==="block-scalar")$.indent="indent"in A?A.indent:0;else if($.type==="flow-collection"&&A.type==="document")$.indent=0;if($.type==="flow-collection")gS($);switch(A.type){case"document":A.value=$;break;case"block-scalar":A.props.push($);break;case"block-map":{let L=A.items[A.items.length-1];if(L.value){A.items.push({start:[],key:$,sep:[]}),this.onKeyLine=!0;return}else if(L.sep)L.value=$;else{Object.assign(L,{key:$,sep:[]}),this.onKeyLine=!L.explicitKey;return}break}case"block-seq":{let L=A.items[A.items.length-1];if(L.value)A.items.push({start:[],value:$});else L.value=$;break}case"flow-collection":{let L=A.items[A.items.length-1];if(!L||L.value)A.items.push({start:[],key:$,sep:[]});else if(L.sep)L.value=$;else Object.assign(L,{key:$,sep:[]});return}default:yield*this.pop(),yield*this.pop($)}if((A.type==="document"||A.type==="block-map"||A.type==="block-seq")&&($.type==="block-map"||$.type==="block-seq")){let L=$.items[$.items.length-1];if(L&&!L.sep&&!L.value&&L.start.length>0&&uS(L.start)===-1&&($.indent===0||L.start.every((D)=>D.type!=="comment"||D.indent<$.indent))){if(A.type==="document")A.end=L.start;else A.items.push({start:L.start});$.items.splice(-1,1)}}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let H={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")H.start.push(this.sourceToken);this.stack.push(H);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(H){if(H.value)return yield*this.lineEnd(H);switch(this.type){case"doc-start":{if(uS(H.start)!==-1)yield*this.pop(),yield*this.step();else H.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":H.start.push(this.sourceToken);return}let $=this.startBlockValue(H);if($)this.stack.push($);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(H){if(this.type==="map-value-ind"){let $=Z2(this.peek(2)),A=WI($),L;if(H.end)L=H.end,L.push(this.sourceToken),delete H.end;else L=[this.sourceToken];let D={type:"block-map",offset:H.offset,indent:H.indent,items:[{start:A,key:H,sep:L}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=D}else yield*this.lineEnd(H)}*blockScalar(H){switch(this.type){case"space":case"comment":case"newline":H.props.push(this.sourceToken);return;case"scalar":if(H.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let $=this.source.indexOf(`
|
|
478
|
+
`)+1;while($!==0)this.onNewLine(this.offset+$),$=this.source.indexOf(`
|
|
479
|
+
`,$)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(H){let $=H.items[H.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,$.value){let A="end"in $.value?$.value.end:void 0;if((Array.isArray(A)?A[A.length-1]:void 0)?.type==="comment")A?.push(this.sourceToken);else H.items.push({start:[this.sourceToken]})}else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"space":case"comment":if($.value)H.items.push({start:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else{if(this.atIndentedComment($.start,H.indent)){let L=H.items[H.items.length-2]?.value?.end;if(Array.isArray(L)){Array.prototype.push.apply(L,$.start),L.push(this.sourceToken),H.items.pop();return}}$.start.push(this.sourceToken)}return}if(this.indent>=H.indent){let A=!this.onKeyLine&&this.indent===H.indent,L=A&&($.sep||$.explicitKey)&&this.type!=="seq-item-ind",D=[];if(L&&$.sep&&!$.value){let I=[];for(let E=0;E<$.sep.length;++E){let K=$.sep[E];switch(K.type){case"newline":I.push(E);break;case"space":break;case"comment":if(K.indent>H.indent)I.length=0;break;default:I.length=0}}if(I.length>=2)D=$.sep.splice(I[1])}switch(this.type){case"anchor":case"tag":if(L||$.value)D.push(this.sourceToken),H.items.push({start:D}),this.onKeyLine=!0;else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"explicit-key-ind":if(!$.sep&&!$.explicitKey)$.start.push(this.sourceToken),$.explicitKey=!0;else if(L||$.value)D.push(this.sourceToken),H.items.push({start:D,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if($.explicitKey)if(!$.sep)if(I0($.start,"newline"))Object.assign($,{key:null,sep:[this.sourceToken]});else{let I=WI($.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:I,key:null,sep:[this.sourceToken]}]})}else if($.value)H.items.push({start:[],key:null,sep:[this.sourceToken]});else if(I0($.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:D,key:null,sep:[this.sourceToken]}]});else if(mS($.key)&&!I0($.sep,"newline")){let I=WI($.start),E=$.key,K=$.sep;K.push(this.sourceToken),delete $.key,delete $.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:I,key:E,sep:K}]})}else if(D.length>0)$.sep=$.sep.concat(D,this.sourceToken);else $.sep.push(this.sourceToken);else if(!$.sep)Object.assign($,{key:null,sep:[this.sourceToken]});else if($.value||L)H.items.push({start:D,key:null,sep:[this.sourceToken]});else if(I0($.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else $.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let I=this.flowScalar(this.type);if(L||$.value)H.items.push({start:D,key:I,sep:[]}),this.onKeyLine=!0;else if($.sep)this.stack.push(I);else Object.assign($,{key:I,sep:[]}),this.onKeyLine=!0;return}default:{let I=this.startBlockValue(H);if(I){if(I.type==="block-seq"){if(!$.explicitKey&&$.sep&&!I0($.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(A)H.items.push({start:D});this.stack.push(I);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(H){let $=H.items[H.items.length-1];switch(this.type){case"newline":if($.value){let A="end"in $.value?$.value.end:void 0;if((Array.isArray(A)?A[A.length-1]:void 0)?.type==="comment")A?.push(this.sourceToken);else H.items.push({start:[this.sourceToken]})}else $.start.push(this.sourceToken);return;case"space":case"comment":if($.value)H.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment($.start,H.indent)){let L=H.items[H.items.length-2]?.value?.end;if(Array.isArray(L)){Array.prototype.push.apply(L,$.start),L.push(this.sourceToken),H.items.pop();return}}$.start.push(this.sourceToken)}return;case"anchor":case"tag":if($.value||this.indent<=H.indent)break;$.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==H.indent)break;if($.value||I0($.start,"seq-item-ind"))H.items.push({start:[this.sourceToken]});else $.start.push(this.sourceToken);return}if(this.indent>H.indent){let A=this.startBlockValue(H);if(A){this.stack.push(A);return}}yield*this.pop(),yield*this.step()}*flowCollection(H){let $=H.items[H.items.length-1];if(this.type==="flow-error-end"){let A;do yield*this.pop(),A=this.peek(1);while(A?.type==="flow-collection")}else if(H.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!$||$.sep)H.items.push({start:[this.sourceToken]});else $.start.push(this.sourceToken);return;case"map-value-ind":if(!$||$.value)H.items.push({start:[],key:null,sep:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else Object.assign($,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!$||$.value)H.items.push({start:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let L=this.flowScalar(this.type);if(!$||$.value)H.items.push({start:[],key:L,sep:[]});else if($.sep)this.stack.push(L);else Object.assign($,{key:L,sep:[]});return}case"flow-map-end":case"flow-seq-end":H.end.push(this.sourceToken);return}let A=this.startBlockValue(H);if(A)this.stack.push(A);else yield*this.pop(),yield*this.step()}else{let A=this.peek(2);if(A.type==="block-map"&&(this.type==="map-value-ind"&&A.indent===H.indent||this.type==="newline"&&!A.items[A.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&A.type!=="flow-collection"){let L=Z2(A),D=WI(L);gS(H);let I=H.end.splice(1,H.end.length);I.push(this.sourceToken);let E={type:"block-map",offset:H.offset,indent:H.indent,items:[{start:D,key:H,sep:I}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=E}else yield*this.lineEnd(H)}}flowScalar(H){if(this.onNewLine){let $=this.source.indexOf(`
|
|
480
|
+
`)+1;while($!==0)this.onNewLine(this.offset+$),$=this.source.indexOf(`
|
|
481
|
+
`,$)+1}return{type:H,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(H){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let $=Z2(H),A=WI($);return A.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:A,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let $=Z2(H),A=WI($);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:A,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(H,$){if(this.type!=="comment")return!1;if(this.indent<=$)return!1;return H.every((A)=>A.type==="newline"||A.type==="space")}*documentEnd(H){if(this.type!=="doc-mode"){if(H.end)H.end.push(this.sourceToken);else H.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(H){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if(H.end)H.end.push(this.sourceToken);else H.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}eMH.Parser=dS});var nS=n((MXH)=>{var pS=q6(),$XH=z4(),F4=P4(),AXH=x5(),LXH=OH(),DXH=x6(),cS=k6();function lS(H){let $=H.prettyErrors!==!1;return{lineCounter:H.lineCounter||$&&new DXH.LineCounter||null,prettyErrors:$}}function IXH(H,$={}){let{lineCounter:A,prettyErrors:L}=lS($),D=new cS.Parser(A?.addNewLine),I=new pS.Composer($),E=Array.from(I.compose(D.parse(H)));if(L&&A)for(let K of E)K.errors.forEach(F4.prettifyError(H,A)),K.warnings.forEach(F4.prettifyError(H,A));if(E.length>0)return E;return Object.assign([],{empty:!0},I.streamInfo())}function iS(H,$={}){let{lineCounter:A,prettyErrors:L}=lS($),D=new cS.Parser(A?.addNewLine),I=new pS.Composer($),E=null;for(let K of I.compose(D.parse(H),!0,H.length))if(!E)E=K;else if(E.options.logLevel!=="silent"){E.errors.push(new F4.YAMLParseError(K.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(L&&A)E.errors.forEach(F4.prettifyError(H,A)),E.warnings.forEach(F4.prettifyError(H,A));return E}function EXH(H,$,A){let L=void 0;if(typeof $==="function")L=$;else if(A===void 0&&$&&typeof $==="object")A=$;let D=iS(H,A);if(!D)return null;if(D.warnings.forEach((I)=>AXH.warn(D.options.logLevel,I)),D.errors.length>0)if(D.options.logLevel!=="silent")throw D.errors[0];else D.errors=[];return D.toJS(Object.assign({reviver:L},A))}function KXH(H,$,A){let L=null;if(typeof $==="function"||Array.isArray($))L=$;else if(A===void 0&&$)A=$;if(typeof A==="string")A=A.length;if(typeof A==="number"){let D=Math.round(A);A=D<1?void 0:D>8?{indent:8}:{indent:D}}if(H===void 0){let{keepUndefined:D}=A??$??{};if(!D)return}if(LXH.isDocument(H)&&!L)return H.toString(A);return new $XH.Document(H,L,A).toString(A)}MXH.parse=EXH;MXH.parseAllDocuments=IXH;MXH.parseDocument=iS;MXH.stringify=KXH});var JXH,ZXH,YXH,y6,GXH,E0,UXH,VXH,CXH,zXH,omH,PXH,qXH,TXH,Y2,aS,_XH,f6,NXH,FXH,OXH,wXH,RXH,v6,jXH,SXH,xA,G2,O4,G$,BD,xXH,b6,h6,u6,kXH,yXH,fXH,vXH,bXH,g6,m6,d6,hXH;var tS=y(()=>{JXH=q6(),ZXH=z4(),YXH=E6(),y6=P4(),GXH=I4(),E0=OH(),UXH=$0(),VXH=tH(),CXH=L0(),zXH=D0(),omH=B2(),PXH=S6(),qXH=x6(),TXH=k6(),Y2=nS(),aS=L4();_XH=JXH.Composer,f6=ZXH.Document,NXH=YXH.Schema,FXH=y6.YAMLError,OXH=y6.YAMLParseError,wXH=y6.YAMLWarning,RXH=GXH.Alias,v6=E0.isAlias,jXH=E0.isCollection,SXH=E0.isDocument,xA=E0.isMap,G2=E0.isNode,O4=E0.isPair,G$=E0.isScalar,BD=E0.isSeq,xXH=UXH.Pair,b6=VXH.Scalar,h6=CXH.YAMLMap,u6=zXH.YAMLSeq,kXH=PXH.Lexer,yXH=qXH.LineCounter,fXH=TXH.Parser,vXH=Y2.parse,bXH=Y2.parseAllDocuments,g6=Y2.parseDocument,m6=Y2.stringify,d6=aS.visit,hXH=aS.visitAsync});function w4(H){if(!(typeof H==="object"&&H!==null))return!1;if(uXH in H)return!0;return"value"in H&&"comment"in H&&"commentBefore"in H&&Object.keys(H).length===3}var uXH;var oS=y(()=>{uXH=Symbol.for("cspell.config.nodeValue")});import QL from"node:assert";function c6(H){let{url:$,content:A}=H;try{let L=g6(A);if(L.contents===null||G$(L.contents)&&!L.contents.value)L.contents=new h6;if(!xA(L.contents))throw new h$($,`Invalid YAML content ${$}`);let D=vR(A);return new QI($,L,D)}catch(L){if(L instanceof h$)throw L;throw new h$($,void 0,{cause:L})}}function p6(H){if(G$(H))return H.value;return H}function sS(H){if(G$(H))return H;return new b6(H)}function gXH(H){let $=[];if(H.length===0)return $;let A=[];$.push(A);for(let L of H){if(mXH(L))A=[],$.push(A);A.push(cXH(L))}return $}function mXH(H){if(!G$(H)||!H.commentBefore&&!H.spaceBefore)return!1;if(H.spaceBefore)return!0;if(!H.commentBefore)return!1;return H.commentBefore.includes(`
|
|
482
|
+
|
|
483
|
+
`)}function dXH(H,$,A){if(!G$($))return;let L=A;if($.spaceBefore)H.spaceBefore=!0,L=!0,delete $.spaceBefore;if(!$.commentBefore)return;let D=$.commentBefore,I=D.split(/^\n/gm),E=I[I.length-1];L=L&&D.trim()===E.trim()||D.endsWith(`
|
|
484
|
+
`);let K=D;if(L)delete $.commentBefore;else $.commentBefore=E,I.pop(),K=I.join(`
|
|
485
|
+
`);if(H.commentBefore)K+=K.endsWith(`
|
|
486
|
+
|
|
487
|
+
`)?"":`
|
|
488
|
+
`,K+=K.endsWith(`
|
|
489
|
+
|
|
490
|
+
`)?"":`
|
|
491
|
+
`,K+=H.commentBefore;H.commentBefore=K}function pXH(H){let $=new Intl.Collator().compare,A=gXH(H),L=!0;for(let I of A){let E=I[0];if(I.sort((K,M)=>{return $(p6(K),p6(M))}),I[0]!==E&&G$(E)){let K=I[0]=sS(I[0]);dXH(K,E,L)}L=!1}return A.flat().map((I)=>sS(I))}function cXH(H){if(G$(H))return H.clone();return H}function K0(H,$){return Array.isArray($)?H.getIn($,!0):H.get($,!0)}function U2(H,$){if(aXH($))return lXH(H,$);if(xA($))return iXH(H,$);if(G$($))return nXH(H,$);throw Error(`Unsupported YAML node type: ${Lx($)}`)}class V2{type;constructor(H){this.type=H}}function lXH(H,$){return new Hx(H,$)}function iXH(H,$){return new $x(H,$)}function nXH(H,$){return new Ax(H,$)}function aXH(H){return BD(H)}function Lx(H){if(G$(H))return"scalar";if(BD(H))return"seq";if(xA(H))return"map";if(v6(H))return"alias";return"unknown"}function l6(H,$){if(!H)return;if("comment"in $)H.comment=$.comment??null;if("commentBefore"in $)H.commentBefore=$.commentBefore??null}function tXH(H,$){if(l6(H,$),G$(H)){H.value=$.value;return}let A=$.value;if(BD(H)){QL(Array.isArray(A),"Expected value to be an array for YAMLSeq"),H.items=[];for(let L=0;L<A.length;++L)H.set(L,A[L]);return}if(xA(H)){QL(typeof A==="object"&&A!==null,"Expected value to be an object for YAMLMap"),H.items=[];for(let[L,D]of Object.entries(A))H.set(L,D);return}throw Error(`Unsupported YAML node type: ${Lx(H)}`)}function rS(H,$){let A=G$($)?$.value:$;if(!xA(H))return;let L=H.items;for(let D of L){if(!O4(D))continue;if(D.key===A)return D;if(G$(D.key)&&D.key.value===A)return D}return}function eS(H){if(!H.commentBefore)return;H.commentBefore=H.commentBefore?.replaceAll(/^ yaml-language-server: \$schema=.*\n?/gm,"")??null}var QI,Hx,$x,Ax;var Dx=y(()=>{tS();ML();oS();OX();QI=class QI extends GX{url;yamlDoc;indent;#H=void 0;constructor(H,$,A){super(H);this.url=H,this.yamlDoc=$,this.indent=A,this.#H=this.yamlDoc.toJS()}get settings(){return this.#H??this.yamlDoc.toJS()}addWords(H){let $=this.yamlDoc.get("words")||new u6;QL(BD($),"Expected words to be a YAML sequence");let A=new Set($.items.map((D)=>p6(D)));H.forEach((D)=>{if(A.has(D))return;$.add(D),A.add(D)});let L=pXH($.items);return L.forEach((D,I)=>$.set(I,D)),$.items.length=L.length,this.#L("words",$),this.#A(),this}serialize(){return m6(this.yamlDoc,{indent:this.indent})}setValue(H,$){if(w4($)){let A=this.#$(H);if(!A)A=this.yamlDoc.createNode($.value),l6(A,$),this.#L(H,A);else tXH(A,$)}else this.#L(H,$);return this.#A(),this}getValue(H){return this.#$(H)?.toJS(this.yamlDoc)}#$(H){return K0(this.yamlDoc,H)}getNode(H,$){let A=this.#$(H);if(!A){if($===void 0)return;A=this.yamlDoc.createNode($),this.#L(H,A)}return this.#A(),U2(this.yamlDoc,A)}getFieldNode(H){let $=this.yamlDoc.contents;if(!xA($))return;let A=rS($,H),L=A&&this.#D(A);if(!L)return;return U2(this.yamlDoc,L.key)}delete(H){let $=this.yamlDoc.delete(H);if($)this.#A();return $}get comment(){return this.yamlDoc.comment??void 0}set comment(H){this.yamlDoc.comment=H??null}setSchema(H){eS(this.yamlDoc);let $=this.yamlDoc.commentBefore||"";$=$.replace(/^ yaml-language-server: \$schema=.*\n?/m,""),$=` yaml-language-server: $schema=${H}`+($?`
|
|
492
|
+
`+$:""),this.yamlDoc.commentBefore=$;let L=this.#E().items[0];if(L&&O4(L)){let D=L.key;if(G2(D))eS(D)}if(this.getNode("$schema"))this.setValue("$schema",H);return this}removeAllComments(){let H=this.yamlDoc;return H.comment=null,H.commentBefore=null,d6(this.yamlDoc,($,A)=>{if(!(G$(A)||xA(A)||BD(A)))return;A.comment=null,A.commentBefore=null}),this}setComment(H,$,A){let L=this.getFieldNode(H);if(!L)return this;if(A)L.comment=$;else L.commentBefore=$;return this}#A(){this.#H=void 0}#L(H,$){this.yamlDoc.set(H,$);let A=this.#E(),L=rS(A,H);QL(L,`Expected pair for key: ${String(H)}`),this.#D(L)}#I(H){return G2(H)?H:this.yamlDoc.createNode(H)}#D(H){return QL(O4(H),"Expected pair to be a Pair"),H.key=this.#I(H.key),H.value=this.#I(H.value),H}#E(){let H=this.yamlDoc.contents;return QL(xA(H),"Expected contents to be a YAMLMap"),H}static parse(H){return c6(H)}static from(H,$,A=2){let L=new f6($);return new QI(H,L,A)}};Hx=class Hx extends V2{#H;#$;constructor(H,$){super("array");this.#H=H,this.#$=$}get value(){return this.#$.toJS(this.#H)}get comment(){return this.#$.comment??void 0}set comment(H){this.#$.comment=H??null}get commentBefore(){return this.#$.commentBefore??void 0}set commentBefore(H){this.#$.commentBefore=H??null}getNode(H){let $=K0(this.#$,H);if(!$)return;return U2(this.#H,$)}getValue(H){let $=K0(this.#$,H);if(!$)return;return $.toJS(this.#H)}setValue(H,$){if(!w4($)){this.#$.set(H,$);return}this.#$.set(H,$.value);let A=K0(this.#$,H);QL(A),A.comment=$.comment??null,A.commentBefore=$.commentBefore??null}delete(H){return this.#$.delete(H)}push(H){if(!w4(H))return this.#$.add(H),this.#$.items.length;return this.#$.add(H.value),l6(K0(this.#$,this.#$.items.length-1),H),this.#$.items.length}get length(){return this.#$.items.length}};$x=class $x extends V2{#H;#$;constructor(H,$){super("object");this.#H=H,this.#$=$}get value(){return this.#$.toJS(this.#H)}get comment(){return this.#$.comment??void 0}set comment(H){this.#$.comment=H??null}get commentBefore(){return this.#$.commentBefore??void 0}set commentBefore(H){this.#$.commentBefore=H??null}getValue(H){let $=K0(this.#$,H);if(!$)return;return $.toJS(this.#H)}getNode(H){let $=K0(this.#$,H);if(!$)return;return U2(this.#H,$)}setValue(H,$){if(!w4($)){this.#$.set(H,$);return}this.#$.set(H,$.value);let A=K0(this.#$,H);QL(A),A.comment=$.comment??null,A.commentBefore=$.commentBefore??null}delete(H){return this.#$.delete(H)}};Ax=class Ax extends V2{$doc;$yNode;type="scalar";constructor(H,$){super("scalar");this.$doc=H,this.$yNode=$,QL(G$($),"Expected yNode to be a Scalar")}get value(){return this.$yNode.toJS(this.$doc)}set value(H){this.$yNode.value=H}get comment(){return this.$yNode.comment??void 0}set comment(H){this.$yNode.comment=H??null}get commentBefore(){return this.$yNode.commentBefore??void 0}set commentBefore(H){this.$yNode.commentBefore=H??null}toJSON(){return{type:this.type,value:this.value,comment:this.comment,commentBefore:this.commentBefore}}}});var i6=y(()=>{mw();T5()});var Ix=(H)=>{throw Error(`Unable to parse config file: "${H.url}"`)},Ex=(H)=>{throw Error(`Unable to serialize config file: "${H.url}"`)};function Kx(H){let $=Ix;for(let A of H)$=oXH(A,$);return $}function Mx(H){let $=Ex;for(let A of H)$=sXH(A,$);return $}function oXH(H,$){return(A)=>H.deserialize(A,$)}function sXH(H,$){return(A)=>H.serialize(A,$)}function rXH(H,$){return(A)=>H.load(A,$)}async function eXH(H){let{io:$,deserialize:A}=H.context,L=H.url,D=await $.readFile(L);return A(D)}function Xx(H){let $=eXH;for(let A of H)$=rXH(A,$);return $}var Wx=()=>{};function Qx(H){return typeof H==="string"?new URL(H):H}import{extname as H2H}from"node:path/posix";class n6{io;middleware;loaders;constructor(H,$,A){this.io=H,this.middleware=$,this.loaders=A}_untrustedExtensions=new Set;_trustedUrls=[];get untrustedExtensions(){return[...this._untrustedExtensions]}get trustedUrls(){return[...this._trustedUrls].map((H)=>new URL(H))}readConfig(H){let $=new URL(H);if(!$2H($,this._trustedUrls,this._untrustedExtensions))return Promise.reject(new Bx($));return Xx(this.loaders)({url:Qx(H),context:{deserialize:this.getDeserializer(),io:this.io}})}toCSpellConfigFile(H){return H instanceof KL?H:new aL(H.url,H.settings)}getDeserializer(){return Kx(this.middleware)}parse(H){return this.getDeserializer()(H)}serialize(H){return Mx(this.middleware)(H)}async writeConfig(H){if(H.readonly)throw Error(`Config file is readonly: ${H.url.href}`);let $=this.serialize(H);return{url:(await this.io.writeFile({url:H.url,content:$})).url}}setUntrustedExtensions(H){return this._untrustedExtensions.clear(),H.forEach(($)=>this._untrustedExtensions.add($.toLowerCase())),this}setTrustedUrls(H){return this._trustedUrls=[...new Set(H.map(($)=>new URL($).href))].sort(),this}clearCachedFiles(){for(let H of this.loaders)H.reset?.()}}function $2H(H,$,A){let L=H.pathname,D=H2H(L).toLowerCase();if(!A.has(D))return!0;let I=H.href;return $.some((E)=>I.startsWith(E))}var Bx;var Jx=y(()=>{ML();i6();Wx();Bx=class Bx extends Error{constructor(H){super(`Untrusted URL: "${H.href}"`)}}});import{promises as Zx}from"node:fs";async function A2H(H){let $=await Zx.readFile(H,"utf8");return{url:H,content:$}}async function L2H(H){return await Zx.writeFile(H.url,H.content),{url:H.url}}var Yx;var Gx=y(()=>{Yx={readFile:A2H,writeFile:L2H}});import{extname as D2H}from"node:path/posix";async function E2H(H,$){try{let A=new URL(H.href);A.hash=`${A.hash};loaderSuffix=${$}`,a6("importJavaScript: %o",{url:A.href});let L=await import(A.href);L=L.default??L,L=L.default??L;let D=await L,I=typeof D==="function"?await D():D;return new UX(H,I)}catch(A){throw a6("importJavaScript Error: %o",{url:H.href,error:A,hashSuffix:$}),A}finally{a6("importJavaScript Done: %o",{url:H.href,hashSuffix:$})}}class Ux{hashSuffix=1;async _load(H,$){let{url:A}=H;switch(D2H(A.pathname).toLowerCase()){case".js":case".cjs":case".mjs":case".ts":case".cts":case".mts":return E2H(A,this.hashSuffix)}return $(H)}load=this._load.bind(this);reset(){this.hashSuffix+=1}}var I2H=!1,a6,Vx;var Cx=y(()=>{dw();a6=I2H?console.warn.bind(console):()=>{return};Vx=new Ux});var zx;var Px=y(()=>{Cx();zx=[Vx]});function K2H(H,$){if(!M2H(H.url.pathname))return $(H);return q5(H)}function M2H(H){return H=H.toLowerCase(),H.endsWith(".json")||H.endsWith(".jsonc")}function X2H(H,$){if(!(H instanceof RA))return $(H);return H.serialize()}var qx;var Tx=y(()=>{T5();qx={deserialize:K2H,serialize:X2H}});function W2H(H,$){if(!Q2H(H.url.pathname))return $(H);return uR(H)}function Q2H(H){return H=H.toLowerCase(),H.endsWith(".toml")}function B2H(H,$){if(!(H instanceof e3))return $(H);return H.serialize()}var _x;var Nx=y(()=>{gR();_x={deserialize:W2H,serialize:B2H}});function J2H(H,$){if(!Z2H(H.url.pathname))return $(H);return c6(H)}function Z2H(H){return H=H.toLowerCase(),H.endsWith(".yml")||H.endsWith(".yaml")}function Y2H(H,$){if(!(H instanceof QI))return $(H);return H.serialize()}var Fx;var Ox=y(()=>{Dx();Fx={deserialize:J2H,serialize:Y2H}});function U2H(H,$){if(!G2H.test(H.url.pathname))return $(H);return bR(H)}function V2H(H,$){if(!(H instanceof A4))return $(H);return H.serialize()}var G2H,wx;var Rx=y(()=>{hR();G2H=/\bpackage\.json$/i;wx={deserialize:U2H,serialize:V2H}});var jx;var Sx=y(()=>{Tx();Nx();Ox();Rx();jx=[qx,Fx,wx,_x]});function t6(H=[],$=[],A=Yx){return new n6(A,[...jx,...H],[...zx,...$])}var xx=y(()=>{Jx();Gx();Px();Sx()});var BI=y(()=>{xx();ML();i6()});function o6(...H){kx.error(...H)}function yx(...H){kx.warn(...H)}var kx;var fx=y(()=>{kx=console});import hH from"node:path";import vx from"node:os";import s6 from"node:process";function e6(H,{suffix:$="nodejs"}={}){if(typeof H!=="string")throw TypeError(`Expected a string, got ${typeof H}`);if($)H+=`-${$}`;if(s6.platform==="darwin")return C2H(H);if(s6.platform==="win32")return z2H(H);return P2H(H)}var M0,r6,JI,C2H=(H)=>{let $=hH.join(M0,"Library");return{data:hH.join($,"Application Support",H),config:hH.join($,"Preferences",H),cache:hH.join($,"Caches",H),log:hH.join($,"Logs",H),temp:hH.join(r6,H)}},z2H=(H)=>{let $=JI.APPDATA||hH.join(M0,"AppData","Roaming"),A=JI.LOCALAPPDATA||hH.join(M0,"AppData","Local");return{data:hH.join(A,H,"Data"),config:hH.join($,H,"Config"),cache:hH.join(A,H,"Cache"),log:hH.join(A,H,"Log"),temp:hH.join(r6,H)}},P2H=(H)=>{let $=hH.basename(M0);return{data:hH.join(JI.XDG_DATA_HOME||hH.join(M0,".local","share"),H),config:hH.join(JI.XDG_CONFIG_HOME||hH.join(M0,".config"),H),cache:hH.join(JI.XDG_CACHE_HOME||hH.join(M0,".cache"),H),log:hH.join(JI.XDG_STATE_HOME||hH.join(M0,".local","state"),H),temp:hH.join(r6,$,H)}};var bx=y(()=>{M0=vx.homedir(),r6=vx.tmpdir(),{env:JI}=s6});import q2H from"os";import C2 from"path";var X0,JD,hx,R4,ApH,LpH,DpH,T2H,_2H;var ux=y(()=>{X0=q2H.homedir(),{env:JD}=process,hx=JD.XDG_DATA_HOME||(X0?C2.join(X0,".local","share"):void 0),R4=JD.XDG_CONFIG_HOME||(X0?C2.join(X0,".config"):void 0),ApH=JD.XDG_STATE_HOME||(X0?C2.join(X0,".local","state"):void 0),LpH=JD.XDG_CACHE_HOME||(X0?C2.join(X0,".cache"):void 0),DpH=JD.XDG_RUNTIME_DIR||void 0,T2H=(JD.XDG_DATA_DIRS||"/usr/local/share/:/usr/share/").split(":");if(hx)T2H.unshift(hx);_2H=(JD.XDG_CONFIG_DIRS||"/etc/xdg").split(":");if(R4)_2H.unshift(R4)});import HZ from"node:fs/promises";import ZI from"node:path";var N2H="cspell",F2H,z2,$Z="cspell.json",O2H,P2;var gx=y(()=>{bx();ux();z$();F2H=R4?ZI.join(R4,"configstore"):void 0,z2=e6(N2H,{suffix:""}).config,O2H=[z2,F2H].filter(c$);P2=class P2{#H;#$;constructor(H=$Z){this.#$=H}async#A(H){try{let $=await HZ.readFile(H,"utf8");return{filename:H,config:JSON.parse($)}}catch{return}}async readConfigFile(){if(this.#H){let A=await this.#A(this.#H);if(A)return A}let H=ZI.resolve(z2,this.#$),$=new Set([H,...O2H.map((A)=>ZI.resolve(A,$Z))]);for(let A of $){let L=await this.#A(A);if(L)return this.#H=L.filename,L}return}async writeConfigFile(H){return this.#H??=ZI.join(z2,this.#$),await HZ.mkdir(ZI.dirname(this.#H),{recursive:!0}),await HZ.writeFile(this.#H,JSON.stringify(H,void 0,2)+`
|
|
493
|
+
`),this.#H}get location(){return this.#H}static create(){return new this}static defaultLocation=ZI.join(z2,$Z)}});function YI(H,$,A){if(H===void 0)return;if(Array.isArray(H))return H.map((L)=>YI(L,$,A));if(typeof H==="string"){let L={glob:H};if($!==void 0)L.root=$;return YI(L,$,A)}if(A)return{...H,source:A};return H}import{homedir as w2H}from"node:os";import{fileURLToPath as R2H}from"node:url";function mx(H){if(typeof H.version==="number")H.version=H.version.toString();if(H.import)H.import=j4(H.import)}function AZ(H,$){let A=R8(H.dictionaryDefinitions,$),L=H.languageSettings?.map((D)=>K$({...D,dictionaryDefinitions:R8(D.dictionaryDefinitions,$)}));return K$({dictionaryDefinitions:A,languageSettings:L})}function dx(H,$){let{globRoot:A=FH(new URL(".",$))}=H,L=H.overrides?.map((D)=>{let I=YI(D.filename,A,FH($)),{dictionaryDefinitions:E,languageSettings:K}=AZ(D,$);return K$({...D,filename:I,dictionaryDefinitions:E,languageSettings:LZ(K)})});return L?{overrides:L}:{}}async function px(H,$){if(H.reporters===void 0)return{};async function A(D){if(D==="default")return D;let I=await rM(D,$);if(!I.found)throw Error(`Not found: "${D}"`);return I.filename}async function L(D){if(typeof D==="string")return A(D);if(!Array.isArray(D)||typeof D[0]!=="string")throw Error("Invalid Reporter");let[I,...E]=D;return[await A(I),...E]}return{reporters:await Promise.all(H.reporters.map(L))}}function LZ(H){if(!H)return;function $(A){let{local:L,...D}=A;return K$({locale:L,...D})}return H.map($)}function cx(H,$){let{gitignoreRoot:A}=H;if(!A)return{};return{gitignoreRoot:(Array.isArray(A)?A:[A]).map((D)=>j2H(D,$))}}function lx(H,$){let{globRoot:A}=H,L={};if(H.ignorePaths)L.ignorePaths=YI(H.ignorePaths,A,FH($));if(H.files)L.files=YI(H.files,A,FH($));return L}function ix(H,$){let{cache:A}=H;if(A===void 0)return{};let{cacheLocation:L}=A;if(L===void 0)return{cache:A};return{cache:{...A,cacheLocation:FH(nx(L,$))}}}function nx(H,$){let A=process.cwd();return PH(H.replace("${cwd}",A).replace(/^~/,w2H()),$)}function j2H(H,$){let A=nx(H,$);return A.protocol==="file:"?R2H(A):A.toString()}function j4(H){if(typeof H==="string")return[H];if(Array.isArray(H))return H;return[]}var DZ=y(()=>{w8();_A();z$();$X()});function IZ(H){if(!H)return{};let $=H.url,A=FH($),L={filename:A,error:void 0},D={name:H.settings.name||A,filename:H.virtual?void 0:A},I={...H.settings};if(I.import=j4(I.import),mx(I),I.source=D,!H.virtual)I.__importRef=L;let E=I.id||S2H($),K=I.name||E;return I.id=E,I.name=H.settings.name||K,I}function S2H(H){return H.pathname.split("/").slice(-2).join("/")}var ax=y(()=>{_A();DZ()});async function ox(){let $=x2H(),A=$?PH($):new URL("global-config.json",hF()),L={name:"CSpell Configstore",filename:FH(A)},D={source:L},I=!1,E=await tx.readConfigFile();if(E&&E.config&&E.filename){let W=E.config;if(A=PH(E.filename),W&&Object.keys(W).length)Object.assign(D,W),D.source={name:"CSpell Configstore",filename:E.filename},I=Object.keys(W).length>0}let K={...D,name:"CSpell Configstore",source:L};return new(I?RA:aL)(A,K)}function x2H(){try{return tx.location||P2.defaultLocation}catch{return}}var tx;var sx=y(()=>{BI();HD();_A();gx();tx=new P2});var q2,EZ;var KZ=y(()=>{Z3();q2=class q2 extends Error{cause;constructor(H,$){super(H);this.cause=tE($)?$:void 0}};EZ=class EZ extends Error{constructor(H){super(H)}}});var XZ=n((jpH,MZ)=>{var rx=()=>{let H=Error.prepareStackTrace;Error.prepareStackTrace=(A,L)=>L;let $=Error().stack.slice(1);return Error.prepareStackTrace=H,$};MZ.exports=rx;MZ.exports.default=rx});var Hk=n((SpH,ex)=>{var k2H=XZ();ex.exports=(H)=>{let $=k2H();if(!H)return $[2].getFileName();let A=!1;$.shift();for(let L of $){let D=L.getFileName();if(typeof D!=="string")continue;if(D===H){A=!0;continue}if(D==="module.js")continue;if(A&&D!==H)return D}}});var Ek=n((xpH,Ik)=>{var __filename="C:\\JokaMain\\ProjectShowRoom\\gdx\\node_modules\\clear-module\\index.js",$k=ZH("path"),Ak=e1(),Lk=Hk(),Dk=(H)=>{try{return Ak($k.dirname(Lk(__filename)),H)}catch($){}},GI=(H)=>{if(typeof H!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof H}\``);let $=Dk(H);if(!$)return;if(ZH.cache[$]&&ZH.cache[$].parent){let A=ZH.cache[$].parent.children.length;while(A--)if(ZH.cache[$].parent.children[A].id===$)ZH.cache[$].parent.children.splice(A,1)}if(ZH.cache[$]){let A=ZH.cache[$].children.map((L)=>L.id);delete ZH.cache[$];for(let L of A)GI(L)}};GI.all=()=>{let H=$k.dirname(Lk(__filename));for(let $ of Object.keys(ZH.cache))delete ZH.cache[Ak(H,$)]};GI.match=(H)=>{for(let $ of Object.keys(ZH.cache))if(H.test($))GI($)};GI.single=(H)=>{if(typeof H!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof H}\``);delete ZH.cache[Dk(H)]};Ik.exports=GI});var Wk=n((ypH,WZ)=>{var Kk=ZH("path"),Mk=ZH("module"),y2H=ZH("fs"),Xk=(H,$,A)=>{if(typeof H!=="string")throw TypeError(`Expected \`fromDir\` to be of type \`string\`, got \`${typeof H}\``);if(typeof $!=="string")throw TypeError(`Expected \`moduleId\` to be of type \`string\`, got \`${typeof $}\``);try{H=y2H.realpathSync(H)}catch(I){if(I.code==="ENOENT")H=Kk.resolve(H);else if(A)return null;else throw I}let L=Kk.join(H,"noop.js"),D=()=>Mk._resolveFilename($,{id:L,filename:L,paths:Mk._nodeModulePaths(H)});if(A)try{return D()}catch(I){return null}return D()};WZ.exports=(H,$)=>Xk(H,$);WZ.exports.silent=(H,$)=>Xk(H,$,!0)});var Bk=n((fpH,Qk)=>{var f2H=XZ();Qk.exports=(H)=>{let $=f2H();if(!H)return $[2].getFileName();let A=!1;$.shift();for(let L of $){let D=L.getFileName();if(typeof D!=="string")continue;if(D===H){A=!0;continue}if(D==="module.js")continue;if(A&&D!==H)return D}}});var Zk=n((vpH,Jk)=>{var __dirname="C:\\JokaMain\\ProjectShowRoom\\gdx\\node_modules\\import-fresh",__filename="C:\\JokaMain\\ProjectShowRoom\\gdx\\node_modules\\import-fresh\\index.js",v2H=ZH("path"),b2H=Wk(),h2H=Bk();Jk.exports=(H)=>{if(typeof H!=="string")throw TypeError("Expected a string");let $=h2H(__filename),A=$?v2H.dirname($):__dirname,L=b2H(A,H),D=ZH.cache[L];if(D&&D.parent){let E=D.parent.children.length;while(E--)if(D.parent.children[E].id===L)D.parent.children.splice(E,1)}delete ZH.cache[L];let I=ZH.cache[$];return I===void 0||I.require===void 0?ZH(L):I.require(L)}});import{stat as u2H}from"node:fs/promises";import S4 from"node:path";import{fileURLToPath as g2H}from"node:url";async function Gk(H,$={}){let{cwd:A=process.cwd(),type:L="file",stopAt:D}=$,I=S4.resolve(Yk(A)),E=S4.parse(I).root,K=m2H(H,L),M=S4.resolve(Yk(D||E));while(I!==E&&I!==M){let W=await K(I);if(W!==void 0)return W;I=S4.dirname(I)}return}function m2H(H,$){if(typeof H==="function")return H;let A=$==="file"?"isFile":"isDirectory";function L(D,I){let E=S4.join(D,I);return u2H(E).then((K)=>K[A]()&&E||void 0).catch(()=>{return})}if(!Array.isArray(H))return(D)=>L(D,H);return async(D)=>{let I=H.map((E)=>L(D,E));for(let E of I){let K=await E;if(K)return K}return}}function Yk(H){return H instanceof URL?g2H(new URL(".",H)):H}var Uk=()=>{};import{fileURLToPath as Ck}from"node:url";class Tk{pnpFiles;cacheKeySuffix;constructor(H=d2H){this.pnpFiles=H,this.cacheKeySuffix=":"+H.join(",")}async load(H){if(!Vk(H))return;await ZD;let $=this.calcKey(H),A=x4.get($);if(A)return A;let L=c2H(H,this.pnpFiles);x4.set($,L);let D=await L;return qk.set($,D),D}async peek(H){if(!Vk(H))return;await ZD;let $=this.calcKey(H);return x4.get($)??Promise.resolve(void 0)}clearCache(){return n2H()}calcKey(H){return H.toString()+this.cacheKeySuffix}}function _k(H){return new Tk(H)}async function c2H(H,$){let A=await Gk($,{cwd:Ck(H)});return l2H(A)}function l2H(H){if(!H)return;let $=k4.get(H);if($||k4.has(H))return $;let A=i2H(H);return k4.set(H,A),A}function i2H(H){let $=Pk.default(H);if($.setup)return $.setup(),n$(H);throw new EZ(`Unsupported pnp file: "${H}"`)}function n2H(){if(ZD)return ZD;return ZD=a2H().finally(()=>{ZD=void 0}),ZD}async function a2H(){await Promise.all([...x4.values()].map(t2H)),[...k4.values()].forEach(($)=>$&&zk.default.single(Ck($))),x4.clear(),qk.clear(),k4.clear();return}function t2H(H){return H.catch(()=>{return})}function Vk(H){return p2H.has(H.protocol)}var zk,Pk,d2H,p2H,x4,ZD=void 0,k4,qk;var Nk=y(()=>{Uk();_A();KZ();zk=kA(Ek(),1),Pk=kA(Zk(),1),d2H=[".pnp.cjs",".pnp.js"],p2H=new Set(["file:"]),x4=new Map,k4=new Map,qk=new Map});function _2(H,$){return $.map((A)=>H+A)}var T2,o2H,N2,s2H;var Fk=y(()=>{T2=[".json",".jsonc",".yaml",".yml",".mjs",".cjs",".js",".toml",".mts",".ts"],o2H=new Set(["package.json",".cspell.json","cspell.json",".cSpell.json","cSpell.json",".cspell.jsonc","cspell.jsonc",".vscode/cspell.json",".vscode/cSpell.json",".vscode/.cspell.json",".cspell.config.json",".cspell.config.jsonc",".cspell.config.yaml",".cspell.config.yml","cspell.config.json","cspell.config.jsonc","cspell.config.yaml","cspell.config.yml",..._2("cspell.config",T2),..._2(".cspell.config",T2),".cspell.yaml",".cspell.yml","cspell.yaml","cspell.yml",".config/.cspell.json",".config/cspell.json",".config/.cSpell.json",".config/cSpell.json",".config/.cspell.jsonc",".config/cspell.jsonc",..._2(".config/cspell.config",T2),..._2(".config/.cspell.config",T2),".config/cspell.yaml",".config/cspell.yml"]),N2=Object.freeze([...o2H]),s2H=Object.freeze([...N2])});async function Ok(H,$,A={}){return(A.fs??T8().fs).findUp(H,$,A)}var wk=y(()=>{_8()});import{extname as r2H}from"node:path/posix";class F2{#H=new Map;#$;constructor(H,$,A){this.#$=new Rk(H,$,A)}async searchForConfig(H,$){let A=H.pathname.endsWith("/")?H:new URL("./",H),L=$?$.map((D)=>D.pathname.endsWith("/")?D:new URL("./",D)):void 0;return this.#A(A,L)}clearCache(){this.#H.clear(),this.#$.clearCache()}#A(H,$){let A=this.#H,L=A.get(H.href);if(L)return L;let D=[],I=void 0;return I=Ok((M)=>{return K(M),this.#$.scanDirForConfigFile(M)},H,{type:"file",...$&&{stopAt:$}}),A.set(H.href,I),D.forEach((M)=>A.set(M.href,I)),I;function K(M){if(!I){D.push(M);return}A.set(M.href,A.get(M.href)||I)}}}class Rk{allowedExtensionsByProtocol;fs;#H=new Map;#$;#A;constructor(H,$,A){this.allowedExtensionsByProtocol=$,this.fs=A,this.#$=e2H(H,$),this.#A=this.#$.get("*")||H}clearCache(){this.#H.clear()}scanDirForConfigFile(H){let $=this.#H,A=H.href,L=$.get(A);if(L)return L;let D=this.#E(H);return $.set(A,D),D}#L(){let H=f3();return async(A)=>{let L=new URL(".",A),I=new URL("..",L).href,E=H.get(I);if(E){let J=await E,Z=LL(L).slice(0,-1),Q=J.get(Z);if(!Q?.isDirectory()&&!Q?.isSymbolicLink())return!1}let K=L.href,M=await H.get(K,async()=>await this.#I(L)),W=LL(A),X=M.get(W);return X?.isFile()||X?.isSymbolicLink()||!1}}async#I(H){try{let $=await this.fs.readDirectory(H);return new Map($.map((A)=>[A.name,A]))}catch{return new Map}}#D(){return async($)=>{return!!(await this.fs.stat($).catch(()=>{return}))?.isFile()}}async#E(H){let $=this.fs.getCapabilities(H).readDirectory?this.#L():this.#D(),A=this.#$.get(H.protocol)||this.#A;for(let L of A){let D=new URL(L,H);if(await $(D)){if(LL(D)!=="package.json")return D;if(await HWH(this.fs,D))return D}}return}}function e2H(H,$){return new Map([...$.entries()].map(([L,D])=>[L,new Set(D)]).map(([L,D])=>[L,H.filter((I)=>D.has(r2H(I)))]))}async function HWH(H,$){try{let A=await H.readFile($);return typeof JSON.parse(A.getText()).cspell==="object"}catch{return!1}}var jk=y(()=>{HD();wk()});var Sk;var xk=y(()=>{n0();Sk=$L({id:"default",name:"default",version:uJ})});function yk(H){if(kk(QZ,H))return QZ;if(kk(UI,H))return UI;let{usePnP:$,pnpFiles:A}=H;return QZ=K$({usePnP:$,pnpFiles:A})}function kk(H,$){return H===$||H.usePnP===$.usePnP&&(H.pnpFiles===$.pnpFiles||H.pnpFiles?.join("|")===$.pnpFiles?.join("|"))}var UI,QZ;var fk=y(()=>{z$();UI=Object.freeze({}),QZ=UI});import vk from"node:assert";import $WH from"node:path";import{fileURLToPath as JZ}from"node:url";class uk{fs;templateVariables;onReady;fileResolver;_isTrusted=!0;constructor(H,$=F8(process.env)){this.fs=H,this.templateVariables=$,this.configSearch=new F2(N2,bk,H),this.cspellConfigFileReaderWriter=t6(void 0,void 0,MWH(H)),this.fileResolver=new sM(H,this.templateVariables),this.onReady=this.init(),this.subscribeToEvents()}subscribeToEvents(){this.toDispose.push(tA(()=>this.clearCachedSettingsFiles()))}cachedConfig=new Map;cachedConfigFiles=new Map;cachedPendingConfigFile=new hL;cachedMergedConfig=new WeakMap;cachedCSpellConfigFileInMemory=new WeakMap;globalSettings;cspellConfigFileReaderWriter;configSearch;stopSearchAtCache=new WeakMap;toDispose=[];async readSettingsAsync(H,$,A){await this.onReady;let L=await this.resolveFilename(H,$||J$("./"));return this.importSettings(L,A||UI,[]).onReady}async readConfigFile(H,$){let A=await this.resolveFilename(H.toString(),$||J$("./")),D=PH(A.filename).href;if(A.error)return new q2(`Failed to read config file: "${A.filename}"`,A.error);let I=this.cachedConfigFiles.get(D);if(I)return I;return this.cachedPendingConfigFile.get(D,async()=>{try{let E=await this.cspellConfigFileReaderWriter.readConfig(D);return this.cachedConfigFiles.set(D,E),E}catch(E){return new q2(`Failed to read config file: "${A.filename}"`,E)}finally{setTimeout(()=>this.cachedPendingConfigFile.delete(D),1)}})}async searchForConfigFileLocation(H,$){let A=await this.#$(H)||O8();return this.configSearch.searchForConfig(A,$)}async searchForConfigFile(H,$){let A=await this.searchForConfigFileLocation(H,$);if(!A)return;let L=await this.readConfigFile(A);return L instanceof Error?void 0:L}async searchForConfig(H,$){let A=await this.#H($),L=await this.searchForConfigFile(H,A);if(!L)return;return this.mergeConfigFileWithImports(L,$)}getGlobalSettings(){return vk(this.globalSettings,"Global settings not loaded"),this.globalSettings}async getGlobalSettingsAsync(){if(!this.globalSettings){let H=await ox(),$=await this.mergeConfigFileWithImports(H,void 0);$.id??="global_config",this.globalSettings=$}return this.globalSettings}clearCachedSettingsFiles(){this.globalSettings=void 0,this.cachedConfig.clear(),this.cachedConfigFiles.clear(),this.configSearch.clearCache(),this.cachedPendingConfigFile.clear(),this.cspellConfigFileReaderWriter.clearCachedFiles(),this.cachedMergedConfig=new WeakMap,this.cachedCSpellConfigFileInMemory=new WeakMap,this.prefetchGlobalSettingsAsync()}resolveSettingsImports(H,$){let A=this.createCSpellConfigFile($,H);return this.mergeConfigFileWithImports(A,H)}init(){return this.onReady=Promise.all([this.prefetchGlobalSettingsAsync(),this.resolveDefaultConfig()]).then(()=>{return}),this.onReady}async prefetchGlobalSettingsAsync(){await this.getGlobalSettingsAsync().catch((H)=>o6(H))}async resolveDefaultConfig(){let H=await this.fileResolver.resolveFile(BX,mL),$=PH(H.filename);return this.cspellConfigFileReaderWriter.setTrustedUrls([new URL("../..",$)]),$}importSettings(H,$,A){let D=PH(H.filename).href,I=this.cachedConfig.get(D);if(I)return A.forEach((Q)=>I.referencedSet.add(Q)),I;if(H.error){let Q=$L({__importRef:H,source:{name:H.filename,filename:H.filename}}),B={href:D,fileRef:H,configFile:void 0,settings:Q,isReady:!0,onReady:Promise.resolve(Q),onConfigFileReady:Promise.resolve(H.error),referencedSet:new Set(A)};return this.cachedConfig.set(D,B),B}let E={name:H.filename,filename:H.filename},K=(Q)=>{if(Q instanceof Error)return H.error=Q,$L({__importRef:H,source:E});return this.mergeConfigFileWithImports(Q,$,A)},M=new Set(A),W=Z(this.readConfigFile(H.filename)),X={href:D,fileRef:H,configFile:void 0,settings:void 0,isReady:!1,onReady:J(W.then(K)),onConfigFileReady:W,referencedSet:M};return this.cachedConfig.set(D,X),X;async function J(Q){let B=await Q;return B.source??=E,B.__importRef??=H,X.isReady=!0,X.settings=B,B}async function Z(Q){let B=await Q;if(B instanceof Error)return X.fileRef.error=B,B;return E.name=B.settings.name||E.name,X.configFile=B,B}}async setupPnp(H,$){if(!$?.usePnP||$===UI)return;if(H.url.protocol!=="file:")return;let{usePnP:A=$.usePnP,pnpFiles:L=$.pnpFiles}=H.settings,D=yk({usePnP:A,pnpFiles:L}),I=new URL(".",H.url);await mk(D,I)}mergeConfigFileWithImports(H,$,A){let L=this.toCSpellConfigFile(H),D=this.cachedMergedConfig.get(L);if(D&&D.pnpSettings===$&&D.referencedBy===A)return D.result;let I={usePnP:H.settings.usePnP??$?.usePnP??!!process.versions.pnp,pnpFiles:H.settings.pnpFiles??$?.pnpFiles},E=this._mergeConfigFileWithImports(L,I,A);return this.cachedMergedConfig.set(L,{pnpSettings:$,referencedBy:A,result:E}),E}async _mergeConfigFileWithImports(H,$,A=[]){await this.setupPnp(H,$);let L=H.url.href,D=new Set(A),I=j4(H.settings.import),K=(await Promise.all(I.map((J)=>this.resolveFilename(J,H.url)))).map((J)=>this.importSettings(J,$,[...A,L]));K.forEach((J)=>{J.referencedSet.add(L)});let M=K.map((J)=>{return D.has(J.href)?J.settings||IZ(J.configFile):J.onReady}),W=await Promise.all(M);return await this.mergeImports(H,W)}async mergeImports(H,$){let A=IZ(H),L=H.url,D=A.__importRef,I=A.source;vk(I);let E={version:Sk.version,...A,globRoot:EWH(A,H.url),languageSettings:LZ(A.languageSettings)},K=AZ(E,L),M=lx(E,L),W=dx(E,L),X=await px(E,L),J=cx(E,L),Z=ix(E,L),Q=$L({...E,source:I,...K,...M,...W,...X,...J,...Z});if(!$.length)return Q;let B=$.reduce((G,U)=>gH(G,U)),Y=gH(B,Q);if(Y.name=E.name||Y.name||"",Y.id=E.id||Y.id||"",D)Y.__importRef=D;return Y}createCSpellConfigFile(H,$){let A=v3(this.cachedCSpellConfigFileInMemory,$,()=>new Map);return y3(A,H,()=>this.cspellConfigFileReaderWriter.toCSpellConfigFile({url:PH(H),settings:$}))}toCSpellConfigFile(H){if(H instanceof KL)return H;return this.createCSpellConfigFile(H.url,H.settings)}dispose(){while(this.toDispose.length)try{this.toDispose.pop()?.dispose()}catch(H){o6(H)}}getStats(){return{...mJ()}}async resolveConfigFileLocation(H,$){let A=await this.fileResolver.resolveFile(H,$);return A.found?PH(A.filename):void 0}async resolveFilename(H,$){if(H instanceof URL)return{filename:FH(H)};if(fH(H))return{filename:FH(H)};let A=await this.fileResolver.resolveFile(H,$);if(A.warning)yx(A.warning);return{filename:A.filename.startsWith("file:/")?JZ(A.filename):A.filename,error:A.found?void 0:new pk(H,$)}}get isTrusted(){return this._isTrusted}setIsTrusted(H){this._isTrusted=H,this.clearCachedSettingsFiles(),this.configSearch=new F2(N2,H?bk:DWH,this.fs),this.cspellConfigFileReaderWriter.setUntrustedExtensions(H?[]:hk)}async#H(H){if(!H?.stopSearchAt)return;if(this.stopSearchAtCache.has(H))return this.stopSearchAtCache.get(H);let $=Array.isArray(H.stopSearchAt)?H.stopSearchAt:[H.stopSearchAt],A=await Promise.all($.map((L)=>this.#$(L)));return this.stopSearchAtCache.set(H,A),A}async#$(H){if(!H)return;let $=PH(H,O8());if($.pathname.endsWith("/"))return $;if(H instanceof URL)return new URL(".",$);if(typeof H==="string"&&!fH(H)&&$.protocol==="file:"&&await XWH(this.fs,$))return U8($);return new URL(".",$)}}function mk(H,$){if(!H.usePnP)return Promise.resolve(void 0);return _k(H.pnpFiles).load($)}function EWH(H,$){let A=new URL(".",$),L=pL.parse(A.href),D=v8.basename(L),I=D in IWH,E=D===".vscode",K=(I?v8.dirname(L):L).toString(),M=process.env[c8],W=M??"${cwd}",X=H.globRoot??(H.version===QX||M&&!H.version||E&&!H.version?W:K),J=X.startsWith("${cwd}")?X:PH(X,new URL(K));return typeof J==="string"?J:J.protocol==="file:"?gF($WH.resolve(JZ(J))):U8(J).href}function KWH(H){return new gk(H??T8().fs)}function YZ(){if(BZ)return BZ;return BZ=KWH()}function MWH(H){return{readFile:(L)=>H.readFile(L).then((D)=>({url:D.url,content:D.getText()})),writeFile:(L)=>H.writeFile(L)}}async function XWH(H,$){try{return(await H.stat($)).isDirectory()}catch{return!1}}function WWH(H){let $=n$(H),A=O8().pathname.split("/").slice(0,-1),L=$.pathname.split("/");if(L[0]!==A[0])return FH(H);let D=0;for(;D<A.length;++D)if(A[D]!==L[D])break;let I=A.length-D;if(I>3)return FH(H);return[[...".".repeat(I)].map(()=>"..").join("/")||".",...L.slice(D)].join("/")}var AWH,kcH,BZ=void 0,ZZ,hk,LWH,bk,DWH,gk,IWH,dk,pk;var ck=y(()=>{BI();BI();HD();NJ();oE();_8();n0();N8();fx();w8();_A();LD();sx();KZ();Nk();Fk();jk();ax();xk();DZ();fk();AWH=[Mw],kcH=Object.freeze(new Set(AWH)),ZZ=[".json",".yaml",".yml",".jsonc",".toml"],hk=[".js",".cjs",".mjs",".ts",".mts"],LWH=[...ZZ,...hk],bk=new Map([["*",ZZ],["file:",LWH]]),DWH=new Map([["*",ZZ]]);gk=class gk extends uk{constructor(H){super(H)}get _cachedFiles(){return this.cachedConfig}};IWH={".vscode":!0,".config":!0};dk=class dk extends Error{configurationFile;relativeTo;constructor(H,$,A,L){super(H);if(this.configurationFile=$,this.relativeTo=A,this.name="Configuration Loader Error",L)this.cause=L}};pk=class pk extends dk{configurationFile;relativeTo;constructor(H,$,A){let L=H.startsWith("file:/")?JZ(H):H,D=WWH($),I=`Failed to resolve configuration file: "${L}" referenced from "${D}"`;super(I,H,$,A);this.configurationFile=H,this.relativeTo=$}}});function O2(H,$){return y4().searchForConfig(H,$)}async function w2(H,$){return y4().readSettingsAsync(H,void 0,$)}async function R2(H,$){return y4().resolveSettingsImports(H,$)}async function f4(H){return y4().mergeConfigFileWithImports(H,H.settings)}function YD(){return y4().getGlobalSettingsAsync()}function j2(){return YZ()}var y4;var GZ=y(()=>{ck();y4=YZ});async function S2(H,$,A){let L=j2(),D=typeof $==="string"||$ instanceof URL?$:void 0,I=A?A:!(typeof $==="string"||$ instanceof URL)?$:void 0;return L.readSettingsAsync(H,D,I)}var lk=y(()=>{GZ()});var UZ=y(()=>{GZ();lk()});function ik(H){return!!H.include}function tk(H){let $=H;return!!$.match&&typeof $.match in nk}function ok(H){let $=H;return $.begin!==void 0&&typeof $.begin in ak&&typeof $.end in GWH}function sk(H){return Array.isArray(H.patterns)}var nk,ak,GWH;var rk=y(()=>{nk={object:!0,string:!0},ak=nk,GWH={...ak,undefined:!0}});function ek(H){let{matches:$,index:A,groups:L,input:D}=H,I=[],E=A;for(let M=0;M<$.length;++M){let W=$[M];if(!W)continue;let X=D.indexOf(W,E),J=X>=E?X:D.lastIndexOf(W,E);if(J<0)continue;I.push({match:W,index:J,groupNum:M,groupName:void 0}),E=J}let K=new Map(I.map((M)=>[M.match,M]));for(let[M,W]of Object.entries(L)){let X=W&&K.get(W);if(!X)continue;X.groupName=X.groupName?Array.isArray(X.groupName)?[...X.groupName,M]:[X.groupName,M]:M}return I}function Hy(H,$){let A=Object.create(null);H.groups&&Object.assign(A,H.groups);let L=H,D=H[0];return{index:H.index,input:H.input,match:D,matches:L,groups:A,lineNumber:$}}function VZ(H,$,A,L){let D=Object.create(null);return{index:A,input:$,match:H,matches:[H],groups:D,lineNumber:L}}import UWH from"node:assert";class x2{value;parent;constructor(H,$){this.value=H,this.parent=$}toString(H=!1){if(!this.parent)return this.value;return H?this.parent.toString(H)+" "+this.value:this.value+" "+this.parent.toString(H)}static isScope(H){return H instanceof x2}}class v4{pool=new Map;getScope(H,$){let A=this.pool.get(H),L=A||new Map;if(L!==A)this.pool.set(H,L);let D=L.get($);if(D)return D.v;let I=new x2(H,$);return L.set($,{v:I}),I}parseScope(H,$=!1){if(x2.isScope(H))return H;if(VWH(H)){let A=H.parent?this.parseScope(H.parent):void 0;return this.getScope(H.value,A)}return this.parseScopeString(H,$)}parseScopeString(H,$){H=Array.isArray(H)?H:H.split(" ");let A=$?H:H.reverse(),L=void 0;for(let D of A)L=this.getScope(D,L);return UWH(L,"Empty scope is not allowed."),L}}function VWH(H){return typeof H==="object"&&!Array.isArray(H)&&H.value!==void 0}var CZ=()=>{};function $y(H){return new Iy(H)}function PZ(H){if(tk(H))return zWH(H);if(ok(H))return PWH(H);if(ik(H))return qWH(H);if(sk(H))return NWH(H);return Ay(H)}function zWH(H){let $=zZ(H.match),A={...H,captures:k2(H.captures),findMatch:L};function L(D,I){let E=$(D);if(!E)return;return{rule:y2(I,A),match:E,line:D}}return A}function PWH(H){let $=Ly(H.patterns),A={...H,captures:k2(H.captures),beginCaptures:k2(H.beginCaptures),endCaptures:k2(H.endCaptures),patterns:$,findMatch:L};function L(M,W){let X=D(M);if(!X)return;return{rule:y2(W,A,E,K),match:X,line:M}}let D=zZ(H.begin),I=H.end!==void 0?zZ(H.end):()=>{return};function E(M){return $&&qZ($,M,this)}function K(M){return I(M)}return A}function Ay(H){let A={...H,patterns:void 0,findMatch:L};function L(D,I){let E=y2(I,A),K=D.text.slice(D.offset),M=VZ(K,K,D.offset,D.lineNumber);return{rule:E,match:M,line:D}}return A}function qWH(H){let{include:$}=H;return $.startsWith("#")||$ in CWH?TWH(H):_WH(H)}function TWH(H){let{include:$,...A}=H,L=$.startsWith("#")?$.slice(1):$,D={...A,reference:L,findMatch:I};function I(E,K){let M=K.repository[L];if(M===void 0)throw Error(`Unknown Include Reference ${$}`);return M.findMatch(E,K)}return D}function _WH(H){function $(L){return}return{...H,findMatch:$}}function NWH(H){return new Ey(H)}function qZ(H,$,A){let L=void 0;for(let D of H){if(D.disabled)continue;let I=D.findMatch($,A);if(I?.match!==void 0&&!I.rule.pattern.disabled)L=L&&L.match&&L.match.index<=I.match.index&&L||I}return L}function Ly(H){if(!H)return;return H.map(($)=>typeof $==="string"?{include:$}:$).map(PZ)}function OWH(H){if(!H)return FWH;return wWH(H)}function wWH(H){let $=Object.create(null);for(let[A,L]of Object.entries(H))$[A]=PZ(L);return $}function Dy(H,$,A,L,D,I){let E=H?H.depth+1:0;return{id:RWH++,grammar:L,pattern:$,parent:H,repository:A,depth:E,findNext:D,end:I}}function y2(H,$,A,L){return Dy(H,$,H.repository,H.grammar,A,L)}function k2(H){if(H===void 0)return;if(typeof H==="string")return{[0]:H};let $=Object.create(null);for(let[A,L]of Object.entries(H))$[A]=typeof L==="string"?L:Ay(L).name;return $}function zZ(H){if(typeof H==="string")return jWH(H);return SWH(H)}function jWH(H){return($)=>{let A=$.text,L=A.indexOf(H,$.offset);if(L<0)return;return VZ(H,A,L,$.lineNumber)}}function SWH(H){return($)=>{let A=RegExp(H,"gm");A.lastIndex=$.offset;let L=A.exec($.text);return(L&&Hy(L,$.lineNumber))??void 0}}function f2(H,$=!0){let A=[];for(let L=H;L;L=L.parent){let D=L.pattern,{name:I,contentName:E}=D;if(E&&$)A.push(E);if(I!==void 0)A.push(I);$=!0}return H.grammar.scopePool.parseScope(A)}class Iy{scopeName;name;comment;disabled;patterns;repository;grammarName;self;scopePool;constructor(H){this.scopeName=H.scopeName,this.name=H.scopeName,this.comment=H.comment,this.disabled=H.disabled,this.grammarName=H.name;let $=PZ({patterns:[{patterns:H.patterns}]}),A=OWH(H.repository);this.patterns=$.patterns,this.repository=A,this.self=$,this.scopePool=new v4}begin(H){let $=this.patterns;function A(L,D,I){let E=Object.create(null);Object.assign(E,L.repository),E.$self=L.self,E.$base=E.$base||D.self;function K(W){return qZ($,W,this)}function M(W){return}return Dy(I,L,E,L,K,M)}return A(this,H?.grammar??this,H)}}class Ey{name;comment;disabled;patterns;constructor(H){let{name:$,comment:A,disabled:L,...D}=H;this.patterns=Ly(D.patterns),this.name=$,this.comment=A,this.disabled=L}findMatch(H,$){let A=this.patterns,L=y2($,this,D);function D(I){return qZ(A,I,this)}return L.findNext?.(H)}}var CWH,FWH,RWH=0;var v2=y(()=>{rk();CZ();CWH={$self:!0,$base:!0};FWH=Object.freeze(Object.create(null))});function Ky(H){return $y(H)}var My=y(()=>{v2()});function TZ(H){return H!==void 0&&H!==null}function Xy(H){let{match:$,rule:A}=H,L=A.pattern,D=L.beginCaptures??L.captures;return Qy(A,$,D)}function Wy(H,$){let{pattern:A}=H,L=A,D=L.endCaptures??L.captures;return Qy(H,$,D)}function Qy(H,$,A){let L=f2(H,!1),D=H.grammar.scopePool,I=$.match,E=$.input,K=[$.index,$.index+I.length,$.lineNumber];if(!I&&!A)return[];if(!A)return[{scope:L,text:I,range:K}];let M=new Map(Object.entries(A)),W=M.get("0");if(M.size===1&&W)return[{scope:H.grammar.scopePool.getScope(W,L),text:I,range:K}];let X=$.index,J=$.index+I.length;function Z(z){let{index:P,match:T}=z,q=T.length;if(P>=X&&q<=J)return z;if(P>=J||q<X)return;let O=Math.max(P,X)-P,N=Math.min(q,J)-P,x=T.slice(O,N);return{...z,index:P+O,match:x}}let Q=ek($).map(Z).filter(TZ);function B(z){let P=z[0],T={a:P.index,b:P.index+P.match.length,s:{seg:P}},q;for(let O=1;O<z.length;++O){let N=z[O],x=N.index,w=x+N.match.length;q=q&&q.a<=x?q:T;while(q&&q.b<=x)q=q.n;while(q&&q.a<w){if(q.a<x){let F={...q,a:x};q.n=F,q.b=x,q=F}if(q.b>w){let F={...q,a:w};q.b=w,q.n=F}q.s={seg:N,next:q.s},q=q.n}}return T}function Y(z){function*P(q){while(q){let O=q.seg;if(O.groupName)if(Array.isArray(O.groupName))yield*O.groupName;else yield O.groupName;yield O.groupNum.toString(),q=q.next}}return[...P(z)].map((q)=>M.get(q)).filter(TZ).reverse().reduce((q,O)=>D.getScope(O,q),L)}let G=B(Q);function*U(z){while(z)yield{text:E.slice(z.a,z.b),range:[z.a,z.b,$.lineNumber],scope:Y(z.s)},z=z.n}return[...U(G)]}var By=y(()=>{v2()});import xWH from"node:assert";function Yy(H,$){let A=H.text,L=H.text.length,D=[],I=Zy({...H,offset:0,anchor:-1},$);while(I.line.offset<=L){let E=I.rule.end?.(I.line);while(E?.index===I.line.offset)D.push(...Wy(I.rule,E)),I=fWH(I),I.line.offset=E.index+E.match.length,E=I.rule.end?.(I.line);if(I.line.offset>=L)break;let{line:K,rule:M}=I,W=K.offset,X=M.findNext?.(K),J=E?.index??L,Z=X?Math.min(X.match.index,J):J;if(W<Z){let Q=f2(M),B=W,Y=Z;D.push({scope:Q,text:A.slice(B,Y),range:[B,Y,K.lineNumber]}),I.line.offset=Z}if(!X||E&&E.index<=X.match.index)continue;D.push(...Xy(X)),K.anchor=X.match.index+X.match.match.length,K.offset=K.anchor,I=Vy(Zy(K,X.rule))}return kWH(H,I.rule,D)}function*Gy(H,$){let A=H.split(/(?<=\r\n|\n|\r(?!\n))/),L=$.begin(),D=0,I=Yy({text:A[0],lineNumber:0,documentOffset:D},L);D+=A[0].length,yield Jy(I);for(let E=1;E<A.length;++E){let K={text:A[E],lineNumber:E,documentOffset:D};D+=K.text.length,I=I.parse(K),yield Jy(I)}}function Jy(H){let{tokens:$,line:A,offset:L}=H;return{tokens:$,line:A,offset:L}}function kWH(H,$,A){return{tokens:A,line:H,offset:H.documentOffset,parse:(L)=>Yy(L,$)}}function Zy(H,$){let A=yWH($),D=A.length-1,I=A[D],K={line:H,rule:I};for(let M=D-1;M>=0;--M){let W=A[M];K={line:K.line,rule:W,parent:K}}return K}function yWH(H){let $=[],A=H;while(A)$.push(A),A=A.parent;return $}function Uy(H,$="Must be defined"){return xWH(H!==void 0&&H!==null,$),H}function fWH(H){return Vy(Uy(H.parent))}function Vy(H){while(!H.rule.end)H=Uy(H.parent);return H}var Cy=y(()=>{v2();By()});var vWH,zy;var Py=y(()=>{vWH={statements:{name:"code.ts",patterns:["#keyword","#regexp","#string","#comment","#braces","#punctuation","#space",{name:"identifier",match:/[^\s;,!|&:^%{}[\]()*/+=<>]+/}]},keyword:{patterns:["#keywordBase","#standardTypes","#standardLib"]},keywordBase:{name:"keyword.typescript.ts",match:/\b(?:any|as|async|await|bigint|boolean|break|case|catch|const|continue|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|in|instanceof|interface|import|let|map|module|new|new|null|number|of|package|private|public|require|return|set|static|string|super|switch|this|throw|true|try|type|typeof|unknown|undefined|var|void|while|yield)\b/},standardTypes:{name:"keyword.type.ts",match:/\b(?:Promise|Record|Omit|Extract|Exclude|BigInt|Array)\b/},standardLib:{name:"keyword.lib.ts",match:/\b(?:console|process|window)\b/},string:{patterns:["#string_q_single","#string_q_double","#string_template"]},string_q_single:{name:"string.quoted.single.ts",begin:"'",end:/'|((?:[^\\\n])$)/,captures:"punctuation.string.ts",patterns:[{include:"#string_character_escape"}]},string_q_double:{name:"string.quoted.double.ts",begin:'"',end:/"|((?:[^\\\n])$)/,captures:"punctuation.string.ts",patterns:[{include:"#string_character_escape"}]},string_template:{name:"string.template.ts",begin:"`",end:"`",captures:"punctuation.string.ts",patterns:[{name:"meta.template.expression.ts",contentName:"meta.embedded.line.ts",begin:"${",end:"}",patterns:["#statements"],captures:"punctuation.definition.template.expression.ts"},{include:"#string_character_escape"}]},string_character_escape:{name:"constant.character.escape.ts",match:/\\(x[0-9A-Fa-f]{2}|[0-3][0-7]{0,2}|[4-7][0-7]?|u[0-9A-Fa-f]{4}|.|\r?\n?$)/},braces:{patterns:[{begin:"(",end:")",captures:"punctuation.meta.brace.ts",patterns:["#statements"],name:"meta.brace.ts",contentName:"code.ts"},{begin:"{",end:"}",captures:"punctuation.meta.brace.ts",patterns:["#statements"],name:"meta.brace.ts",contentName:"code.ts"},{begin:"[",end:"]",captures:"punctuation.meta.brace.ts",patterns:["#statements"],name:"meta.brace.ts",contentName:"code.ts"}]},punctuation:{name:"punctuation.ts",match:/[-;:,!|&^%*/+=<>\n\r]/},space:{name:"punctuation.space.ts",match:/\s+/},comment:{patterns:[{name:"comment.line.ts",comment:"line comment",begin:"//",end:/(?=$)/,captures:"punctuation.definition.comment.ts"},{name:"comment.block.documentation.ts",comment:"DocBlock",begin:/\/\*\*(?!\/)/,captures:"punctuation.definition.comment.ts",end:"*/"},{name:"comment.block.ts",begin:"/*",end:"*/",captures:"punctuation.definition.comment.ts"}]},regexp:{name:"regexp.ts",begin:/\/(?![/*])/,end:/\/([a-z]*)/i,beginCaptures:"punctuation.begin.regexp.ts",endCaptures:"punctuation.end.regexp.ts",patterns:["#regexp_escape","#regexp_brace"]},regexp_escape:{name:"escape.regexp.ts",match:/\\./},regexp_brace:{name:"brace.regexp.ts",begin:"[",end:"]",contentName:"character-class.regexp.ts",patterns:["#regexp_escape"]}},zy={name:"TypeScript",scopeName:"source.ts",patterns:[{name:"comment.line.shebang.ts",match:/^#!.*(?=$)/},{include:"#statements"}],repository:vWH}});import b2 from"node:assert";function qy(H,$){if(!H.map&&!$.map)return{text:H.text+$.text};let A=H.text.length,L=$.text.length,D=[0,0,...H.map||[0,0,A,A]],I=[0,0,...$.map||[0,0,L,L]];return b2(D[D.length-1]===A),b2(I[I.length-1]===L),b2((D.length&1)===0),b2((I.length&1)===0),{text:H.text+$.text,map:bWH(D,I)}}function bWH(H,$){let A=H.length-1,L=[H[A-1],H[A]],D=[...H,...$.map((M,W)=>M+L[W&1])],I=[0,0],E=0,K=0;for(let M=0;M<D.length;M+=2){let W=D[M],X=D[M+1];if(W===E&&X===K)continue;I.push(W,X),E=W,K=X}return I}var Ty=()=>{};function _y(H){let $=H.length,A="",L=[],D=/^[0-9a-fA-F]+$/,I,E;for(I=0,E=0;I<$;++I){let K,M=H[I];if(M==="\\"){L.push(I,E);let W=H[++I],X=uWH[W];if(X){A+=X,E+=X.length,L.push(I,E);continue}switch(W){case"u":{{let J,Z;if(H[I+1]!=="{"){let Q=H.slice(I+1,I+5);K=D.test(Q)?Number.parseInt(Q,16):Number.NaN,J=Number.isNaN(K)?"":String.fromCodePoint(K),Z=I+4}else{for(Z=I+2;H[Z]in hWH;++Z);if(H[Z]!=="}")J="";else{let Q=H.slice(I+2,Z);K=D.test(Q)?Number.parseInt(Q,16):Number.NaN,J=Number.isNaN(K)?"":String.fromCodePoint(K)}}if(!J)A+=W,E+=1;else A+=J,E+=J.length,I=Z}break}case"x":{{let J=H.slice(I+1,I+3);if(K=D.test(J)?Number.parseInt(J,16):Number.NaN,Number.isNaN(K))A+=W,E+=1;else A+=String.fromCodePoint(K),I+=2,++E}break}case"0":{A+="0",E+=1;break}case"\r":{I+=H[I+1]===`
|
|
494
|
+
`?1:0;break}case`
|
|
495
|
+
`:break;case void 0:break;default:{A+=W,++E;break}}L.push(I+1,E);continue}A+=M,++E}if(L.length){let K=L[L.length-2],M=L[L.length-1];if(K!==I||M!==E)L.push(I,E)}return{text:A,map:L}}var hWH,uWH;var Ny=y(()=>{hWH={"0":0,"1":1,"2":2,"3":3,"4":4,"5":5,"6":6,"7":7,"8":8,"9":9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},uWH={t:"\t",n:`
|
|
496
|
+
`,r:"\r",b:"\b","\\":"\\",'"':'"',"'":"'","\n":""}});function gWH(H){return H.tokens.map(($)=>({text:$.text,range:[H.offset+$.range[0],H.offset+$.range[1]],scope:$.scope}))}function mWH(H){return WH(H,UH(gWH),V$())}function Fy(H,$,A=mWH){function L(D,I){let E=WH(Gy(D,H),A);return{content:D,filename:I,parsedTexts:E}}return{name:$,parse:L}}var Oy=y(()=>{N$();Cy()});function*cWH(H){for(let $ of H){if(Ry($.scope,"constant.character.escape.ts")){let A=_y($.text),L=$.scope?pWH.parseScope($.scope):void 0;yield{text:A.text,scope:L?.parent,map:A.map,range:$.range};continue}yield $}}function*lWH(H){let $;for(let A of H){if(!Ry(A.scope,"string.")){if($)yield $,$=void 0;yield A;continue}if(!$){$=A;continue}if(A.scope!==$.scope||$.range[1]!==A.range[0]){yield $,$=A;continue}$=iWH($,A)}if($)yield $}function iWH(H,$){let A=qy(H,$);return{text:A.text,scope:H.scope,range:[H.range[0],$.range[1]],map:A.map,delegate:H.delegate}}function nWH(H){let $=wy.get(H);if($!==void 0)return $;let A=H.value,L=!A.startsWith("punctuation")&&!A.startsWith("keyword.");return wy.set(H,L),L}function aWH(H){return H.tokens.filter(($)=>nWH($.scope)).map(($)=>({text:$.text,range:[H.offset+$.range[0],H.offset+$.range[1]],scope:$.scope}))}function tWH(H){return WH(H,UH(aWH),V$(),cWH,lWH)}function Ry(H,$){if(!H)return!1;return typeof H==="string"?H.startsWith($):H.value.startsWith($)}var dWH,pWH,wy,_Z;var jy=y(()=>{N$();Py();Ty();Ny();My();Oy();CZ();dWH=Ky(zy),pWH=new v4,wy=new WeakMap;_Z=Fy(dWH,"typescript",tWH)});var Sy=y(()=>{jy()});var NZ;var xy=y(()=>{Sy();NZ=[_Z]});var ky=y(()=>{xy()});var VI;var yy=y(()=>{VI=class VI extends RegExp{constructor(H){super(H)}toJSON(){return this.toString()}}});function fy(){return sWH}function rWH(H){return vy(H.replaceAll(/\s+/g,","))}function vy(H){return H.replaceAll(/[|;]/g,",").split(",").map(($)=>$.trim()).filter(($)=>!!$)}function by(H){let $=f3();return(A)=>$.get(A,H)}function HQH(H){let $=vy(H);return new Set($.map((A)=>A.toLowerCase()))}function hy(H){return eWH(typeof H==="string"?H:H.join(","))}function AQH(H){let $=rWH(H);return new Set($.map((A)=>A.toLowerCase().replaceAll(/[^a-z]/g,"")))}function FZ(H){return H=typeof H==="string"?H:H.join(","),$QH(H)}function uy(H){let $=[...FZ(H)].map((A)=>A.replace(/^([a-z]{2})-?([a-z]{2})$/,(L,D,I)=>I?`${D}-${I.toUpperCase()}`:D));return new Set($)}function LQH(H,$){let A=FZ(H);return t_(A,$)}function OZ(H,$=!1){if(typeof H==="string")return $?gy.test(H):DQH.test(H);for(let A of H)if(!OZ(A,$))return!1;return H.length>0}function EQH(H,$,A){return IQH.get(H,()=>new hL).get($,()=>new hL).get(A,()=>KQH(H,$,A))}function KQH(H,$,A){$=$.toLowerCase();let L=FZ(A),D=H.filter((I)=>XQH(I,$)).filter((I)=>!I.locale||I.locale==="*"||LQH(I.locale,L)).map((I)=>{let{languageId:E,locale:K,...M}=I;return M}).reduce((I,E)=>gH(I,E),{});return D.languageId=$,D.locale=A,D}function XQH(H,$){return MQH.get(H,()=>new hL).get($,()=>WQH(H,$))}function WQH(H,$){let A=H.languageId;if(!A||A==="*")return!0;let L=hy(A);if(L.has($))return!0;if(L.has("!"+$))return!1;return[...L].filter((I)=>I.startsWith("!")).length===L.size}function QQH(H,$){let{languageSettings:A=[],language:L=oWH,allowCompoundWords:D,enabled:I}=H,E={allowCompoundWords:D,enabled:I,...EQH(A,$,L)};return gH(H,E)}function b4(H,$){return["*",...hy($)].reduce((D,I)=>{return QQH(D,I)},H)}var oWH="en",sWH,eWH,$QH,gy,DQH,IQH,MQH;var h2=y(()=>{z$();LD();sWH=[];eWH=by(HQH);$QH=by(AQH);gy=/^[a-z]{2}(-[A-Z]{2})?$/,DQH=new RegExp(gy,"i");IQH=O1();MQH=O1()});var my,dy,py,cy,ly,iy,ny,ay,ty,wZ,RZ,jZ,oy,sy,ry,ey,Hf,$f,Af,Lf,Df,If,Ef,Kf,Mf,Xf,Wf;var SZ=y(()=>{my=/(?:https?|ftp):\/\/[^\s"]+/gi,dy=/\bhref\s*=\s*".*?"/gi,py=/(?:#[0-9a-f]{3,8})|(?:0x[0-9a-f]+)|(?:\\u[0-9a-f]{4})|(?:\\x\{[0-9a-f]{4}\})/gi,cy=/\b(?![a-f]+\b)(?:0x)?[0-9a-f]{7,}\b/gi,ly=/\[[0-9a-f]{7,}\]/gi,iy=/\b0x[0-9a-f_]+\b/gi,ny=/#[0-9a-f]{3,8}\b/gi,ay=/\b[0-9a-fx]{8}-[0-9a-fx]{4}-[0-9a-fx]{4}-[0-9a-fx]{4}-[0-9a-fx]{12}\b/gi,ty=/\bU\+[0-9a-f]{4,5}(?:-[0-9a-f]{4,5})?/gi,wZ=/(\bc?spell(?:-?checker)?::?)\s*disable(?!-line|-next)\b(?!-)[\s\S]*?((?:\1\s*enable\b)|$)/gi,RZ=/\bc?spell(?:-?checker)?::?\s*disable-next\b.*\s\s?.*/gi,jZ=/^.*\bc?spell(?:-?checker)?::?\s*disable-line\b.*/gim,oy=/\bc?spell(?:-?checker)?::?\s*ignoreRegExp.*/gim,sy=/-{5}BEGIN\s+((?:RSA\s+)?PUBLIC\s+KEY)[\w=+\-/=\\\s]+?END\s+\1-{5}/g,ry=/-{5}BEGIN\s+(CERTIFICATE|(?:RSA\s+)?(?:PRIVATE|PUBLIC)\s+KEY)[\w=+\-/=\\\s]+?END\s+\1-{5}/g,ey=/ssh-rsa\s+[a-z0-9/+]{28,}={0,3}(?![a-z0-9/+=])/gi,Hf=/\\(?:[anrvtbf]|[xu][a-f0-9]+)/gi,$f=/(?<![A-Za-z0-9/+])(?:[A-Za-z0-9/+]{40,})(?:\s^\s*[A-Za-z0-9/+]{40,})*(?:\s^\s*[A-Za-z0-9/+]+=*)?(?![A-Za-z0-9/+=])/gm,Af=/(?<=[^A-Za-z0-9/+_]|^)(?=[A-Za-z]{0,80}[0-9+/])(?=[A-Za-z0-9/+]{0,80}?[A-Z][a-z][A-Z])(?=[A-Za-z0-9/+]{0,80}?(?:[A-Z][0-9][A-Z]|[a-z][0-9][a-z]|[A-Z][0-9][a-z]|[a-z][0-9][A-Z]|[0-9][A-Za-z][0-9]))(?=[A-Za-z0-9/+]{0,80}?(?:[a-z]{3}|[A-Z]{3}))(?:[A-Za-z0-9/+]{40,})=*/gm,Lf=/(?<![A-Za-z0-9/+])["']?(?:[A-Za-z0-9/+]{40,})["']?(?:\s^\s*["']?[A-Za-z0-9/+]{40,}["']?)+(?:\s^\s*["']?[A-Za-z0-9/+]+={0,3}["']?)?(?![A-Za-z0-9/+=])/gm,Df=/<<<['"]?(\w+)['"]?[\s\S]+?^\1;/gm,If=/(?:(['"]).*?(?<![^\\]\\(\\\\)*)\1)|(?:`[\s\S]*?(?<![^\\]\\(\\\\)*)`)/g,Ef=/(?<!\w:)(?:\/\/.*)|(?:\/\*[\s\S]*?\*\/)/g,Kf=/<?\b[\w.\-+]{1,128}@\w{1,63}(\.\w{1,63}){1,4}\b>?/gi,Mf=/^(\w)\1{3,}$/i,Xf=/\bsha\d+-[a-z0-9+/]{25,}={0,3}/gi,Wf=/(?:\b(?:sha\d+|md5|base64|crypt|bcrypt|scrypt|security-token|assertion)[-,:$=]|#code[/])[-\w/+%.]{25,}={0,3}(?:(['"])\s*\+?\s*\1?[-\w/+%.]+={0,3})*(?![-\w/+=%.])/gi});async function zQH(H){return(await rM(H,mL)).filename}function PQH(H){let{name:$,pattern:A,description:L}=H;if(!(A instanceof RegExp))return H;return{name:$,pattern:new VI(A),description:L}}class Jf{settings=void 0;pending=void 0;constructor(){this.getDefaultSettingsAsync().catch(()=>{return})}getDefaultSettingsAsync(H=!0){if(!H)return Promise.resolve(Bf);if(this.settings)return Promise.resolve(this.settings);if(this.pending)return this.pending;return this.pending=(async()=>{let $=await JQH(),A=await S2($);if(this.settings=gH(CQH,A),A.name!==void 0)this.settings.name=A.name;else delete this.settings.name;return this.settings})(),this.pending}}function CI(H=!0){return Zf.getDefaultSettingsAsync(H)}var JQH=()=>zQH(BX),ZQH,YQH,GQH,UQH,VQH,Bf,CQH,Zf;var Yf=y(()=>{ky();n0();yy();N8();w8();UZ();LD();h2();SZ();ZQH=[new VI(wZ),new VI(jZ),new VI(RZ)],YQH=[{name:"CommitHash",pattern:cy},{name:"CommitHashLink",pattern:ly},{name:"CStyleHexValue",pattern:iy},{name:"CSSHexValue",pattern:ny},{name:"Urls",pattern:my},{name:"HexValues",pattern:py},{name:"SpellCheckerDisable",pattern:ZQH},{name:"PublicKey",pattern:sy},{name:"RsaCert",pattern:ry},{name:"SshRsa",pattern:ey},{name:"EscapeCharacters",pattern:Hf},{name:"Base64",pattern:$f},{name:"Base64SingleLine",pattern:Af},{name:"Base64MultiLine",pattern:Lf},{name:"Email",pattern:Kf},{name:"SHA",pattern:Xf},{name:"HashStrings",pattern:Wf},{name:"UnicodeRef",pattern:ty},{name:"UUID",pattern:ay},{name:"href",pattern:dy},{name:"SpellCheckerDisableBlock",pattern:wZ},{name:"SpellCheckerDisableLine",pattern:jZ},{name:"SpellCheckerDisableNext",pattern:RZ},{name:"SpellCheckerIgnoreInDocSetting",pattern:oy},{name:"PhpHereDoc",pattern:Df},{name:"string",pattern:If},{name:"CStyleComment",pattern:Ef},{name:"Everything",pattern:".*"}],GQH=[...YQH].map(PQH),UQH=["SpellCheckerDisable","SpellCheckerIgnoreInDocSetting","Urls","Email","RsaCert","SshRsa","Base64MultiLine","Base64SingleLine","CommitHash","CommitHashLink","CStyleHexValue","CSSHexValue","SHA","HashStrings","UnicodeRef","UUID"],VQH=UQH,Bf=Object.freeze($L({id:"static_defaults",language:"en",name:"Static Defaults",enabled:!0,enabledLanguageIds:[],maxNumberOfProblems:100,numSuggestions:10,suggestionsTimeout:500,suggestionNumChanges:3,words:[],userWords:[],ignorePaths:[],allowCompoundWords:!1,patterns:GQH,ignoreRegExpList:[],languageSettings:[],source:{name:"defaultSettings"},reporters:[],plugins:[{parsers:NZ}]})),CQH=Object.freeze($L({...Bf,enabledFileTypes:{"*":!0},ignoreRegExpList:VQH,languageSettings:fy()}));Zf=new Jf});var h4=y(()=>{gw();UZ();LD();Yf()});var Gf=()=>{};function Uf(H,$){return TQH(H.text,$).map(n_((A,L)=>({text:L,offset:A.offset+A.text.length}),{text:"",offset:H.offset}))}function TQH(H,$){return H.split($)}function xZ(H,$){if(!$)return[];return H=H.global?H:new RegExp(H.source,H.flags+"g"),$.matchAll(H)}function Vf(H,$){let{text:A,offset:L}=$;return WH(xZ(H,A),UH((D)=>({text:D[0],offset:L+D.index})))}function Cf(H){let $=new RegExp(Zw);return Vf($,NQH(H))}function _QH(H){if(i3.lastIndex=0,!i3.test(H))return H;return H=H.replace(i3,($)=>" ".repeat($.length)),H}function NQH(H){if(i3.lastIndex=0,!i3.test(H.text))return H;return{text:_QH(H.text),offset:H.offset}}function zf(H){let $=new RegExp(ZX);return Vf($,H)}function Pf(H,$,A){let{text:L,offset:D}=H,I=Math.max($-D,0),E=Math.max(A-D,0);return L.slice(I,E)}var kZ=y(()=>{N$();l8();z$()});function bQH(H){return[...Rf(H)].flatMap((A)=>mQH(A))}function Nf(H){let $=bQH(H);if(!$.length)return{...yZ};let A=pQH($,{...yZ}),{words:L,flagWords:D,ignoreWords:I,suggestWords:E,dictionaries:K=[],dictionaryDefinitions:M=[],...W}=A,X=(L||D||I||E)&&K$({name:qf,words:L,flagWords:D,ignoreWords:I,suggestWords:E}),J=X?{dictionaries:[...K,qf],dictionaryDefinitions:[...M,X]}:K$({dictionaries:K.length?K:void 0,dictionaryDefinitions:M.length?M:void 0});return{...W,...J}}function Ff(H,$){return WH(Rf(H),UH(uQH),vH(c$))}function uQH(H){let{fullDirective:$,offset:A}=H,L=$.match(RQH);if(!L)return;let D=L[1],I=D.trim();if(!I)return;let E=A+(L.index||0)+(D.length-D.trimStart().length),K=I.replace(/^([-\w]+)?.*/,"$1"),M=E+K.length;if(!K)return;if(Of.filter(([Y])=>Y.test(I)).length>0)return;let X=fQH.suggest(K,{ignoreCase:!1}).map(({word:Y,isPreferred:G})=>G?{word:Y,isPreferred:G}:{word:Y}).filter((Y)=>!xQH.has(Y.word)),Z=[...WH(X,oA(yQH),gQH)].slice(0,8),Q=Z.map((Y)=>Y.word);return{range:[E,M],text:K,message:hQH.unknownDirective,suggestions:Q,suggestionsEx:Z}}function*gQH(H){let $=new Map;for(let A of H){let L=$.get(A.word);if(L&&A.isPreferred)L.isPreferred=!0;yield A}}function mQH(H){let{match:$}=H,A=$.trim();return Of.filter(([L])=>L.test(A)).map(([,L,D])=>({...H,directive:D,fn:L}))}function dQH(H,$){return $.fn(H,$.match)}function pQH(H,$){for(let A of H)$=dQH($,A);return $}function cQH(H,$){return H.allowCompoundWords=/enable/i.test($),H}function lQH(H,$){return H.caseSensitive=/enable/i.test($),H}function iQH(H){return H.split(/[,\s;]+/g).slice(1).filter(($)=>!!$)}function u2(H,$){if(!H)return $;if(!$)return H;return[...H,...$]}function g2(H,$,A){let L=iQH($);if(L.length)H[A]=u2(H[A],L);return H}function nQH(H,$){return g2(H,$,"words")}function Tf(H,$){let L=$.trim().split(/[\s,]+/).slice(1).join(",");if(L)H.language=L;return H}function aQH(H,$){return g2(H,$,"ignoreWords")}function tQH(H,$){return g2(H,$,"flagWords")}function wf(H){return[H.replace(/^[^\s]+\s+/,"")].map((A)=>{let L=A.match(OQH);if(L&&L[0])return L[0];return A.replace(/((?:[^\s]|\\ )+).*/,"$1")})}function oQH(H,$){let A=wf($);if(A.length)H.ignoreRegExpList=u2(H.ignoreRegExpList,A);return H}function sQH(H,$){let A=wf($);if(A.length)H.includeRegExpList=u2(H.includeRegExpList,A);return H}function rQH(H,$){let A=$.split(/[,\s]+/g).slice(1);if(A.length)H.dictionaries=u2(H.dictionaries,A);return H}function Rf(H){return WH(jQH,UH(($)=>xZ($,H)),V$(),UH(($)=>({fullDirective:$[0],offset:$.index,match:$[1].trim()})))}function eQH(H,$){return H}function HBH(H,$){return H}var OQH,wQH,RQH,jQH,SQH,xQH,kQH,_f,yQH,fQH,vQH,qf="[in-document-dict]",yZ,Of,hQH;var fZ=y(()=>{N$();k8();kZ();z$();OQH=/\/.*\/[gimuy]*/,wQH=/\b(?:spell-?checker|c?spell)::?(.*)/gi,RQH=/(?<=\b(?:spell-?checker|c?spell)::?)(?!:)(.*)/i,jQH=[wQH,/\b(LocalWords:?.*)/g],SQH=["enable","disable","disable-line","disable-next","disable-next-line","word","words","ignore","ignoreWord","ignoreWords","ignore-word","ignore-words","includeRegExp","ignoreRegExp","local","locale","language","dictionaries","dictionary","forbid","forbidWord","forbid-word","flag","flagWord","flag-word","enableCompoundWords","enableAllowCompoundWords","disableCompoundWords","disableAllowCompoundWords","enableCaseSensitive","disableCaseSensitive"],xQH=new Set(["local"]),kQH=["enable","disable","disable-line","disable-next-line","words","ignore","forbid","locale","dictionary","dictionaries","enableCaseSensitive","disableCaseSensitive"],_f=new Set([...kQH,...SQH]),yQH=[...WH(_f,UH((H)=>({word:H})))],fQH=B$(_f,"Directives","Directive List",{supportNonStrictSearches:!1}),vQH=[];Object.freeze(vQH);yZ={id:"in-doc-settings"};Object.freeze(yZ);Of=[[/^(?:enable|disable)(?:allow)?CompoundWords\b(?!-)/i,cQH,"CompoundWords"],[/^(?:enable|disable)CaseSensitive\b(?!-)/i,lQH,"CaseSensitive"],[/^enable\b(?!-)/i,eQH,"Enable"],[/^disable(-line|-next(-line)?)?\b(?!-)/i,HBH,"Disable"],[/^words?\b(?!-)/i,nQH,"Words"],[/^ignore(?:-?words?)?\b(?!-)/i,aQH,"Ignore"],[/^(?:flag|forbid)(?:-?words?)?\b(?!-)/i,tQH,"Flag"],[/^ignore_?Reg_?Exp\s+.+$/i,oQH,"IgnoreRegExp"],[/^include_?Reg_?Exp\s+.+$/i,sQH,"IncludeRegExp"],[/^locale?\b(?!-)/i,Tf,"Locale"],[/^language\s\b(?!-)/i,Tf,"Locale"],[/^dictionar(?:y|ies)\b(?!-)/i,rQH,"Dictionaries"],[/^LocalWords:/,(H,$)=>g2(H,$.replaceAll(/^LocalWords:?/gi," "),"words"),"Words"]],hQH={unknownDirective:"Unknown CSpell directive"}});function jf(H,$,A){if(!$)return nL(b4(H,A));let L=$BH($),D=gH(H,L),I=b4(D,A);return gH(I,L)}function $BH(H){return Nf(H)}var Sf=y(()=>{LD();fZ();h2()});import*as xf from"node:path";async function vZ(H,$){let A=p3(H.uri),L=gH(await CI($.loadDefaultConfiguration??!0),await YD(),$),D=rJ(L,A),I=D?.languageId?.length?D.languageId:H.languageId?H.languageId:ABH(A);if(H.locale)D.language=H.locale;return jf(D,H.text,I)}function ABH(H){let $=xf.basename(H);return dL($)}var kf=y(()=>{IX();h4();Sf();AD()});var yf,bZ,hZ;var m2=y(()=>{yf=function(H){return H[H.spelling=0]="spelling",H[H.directive=1]="directive",H}({}),bZ={ReportAll:"report-all",ReportSimple:"report-simple",ReportCommonTypos:"report-common-typos",ReportFlagged:"report-flagged"},hZ={ignoreRandomStrings:!0,minRandomLength:40}});function ff(H){let $;return(...A)=>{if($&&a_($.args,A))return $.value;let L=A,D=H(...L);return $={args:L,value:D},D}}var vf=y(()=>{z$()});import LBH from"node:assert";function DBH(H,$){let A=f3();return(L)=>A.get(L,(D)=>IBH(D,H,$))}async function IBH(H,$,A){let{languageId:L,locale:D,includeDefaultConfig:I=!0,dictionaries:E}=$;async function K(J){let Z=gH(J,K$({language:D||J.language})),Q=b4(Z,L??Z.languageId??"plaintext"),B=n3(Q);B.dictionaries=E?.length?E:B.dictionaries||[],MBH(B,E);let Y=await d3(B);B.dictionaries=B.dictionaryDefinitions?.map((U)=>U.name)||[];let G=await d3(B);return{dictionaryCollection:Y,allDictionaryCollection:G}}await LO();let M=I?gH(await CI(A.loadDefaultConfiguration??!0),await YD(),A):A,{dictionaryCollection:W,allDictionaryCollection:X}=await K(M);return EBH(H,$,A,W,X)}async function EBH(H,$,A,L,D){let I=D||L,{locale:E,strict:K=!0,numChanges:M=4,numSuggestions:W=8,includeTies:X=!0,includeDefaultConfig:J=!0}=$,Z=!K,Q=J?gH(await CI(A.loadDefaultConfiguration??!0),await YD(),A):A,B={ignoreCase:Z,numChanges:M,numSuggestions:W,includeTies:X},Y=L.dictionaries.flatMap((T)=>T.suggest(H,B).map((q)=>({...q,dictName:T.name}))),G=hf(E||Q.language||void 0),U=Intl.Collator(G),V=bf(KBH(Y.sort((T,q)=>T.cost-q.cost||U.compare(T.word,q.word))),W,X),P=uZ(H,V,G,Z,I).map((T)=>{let q=I.find(T.word);return{...T,forbidden:q?.forbidden||!1,noSuggest:q?.noSuggest||!1}});return{word:H,suggestions:bf(P,W,X)}}function KBH(H){let $=new Map;for(let A of H){let{word:L,cost:D,dictName:I,...E}=A,K=$.get(L)||{word:L,cost:D,...E,dictionaries:[]};K.cost=Math.min(K.cost,D),K.dictionaries.push(I),K.dictionaries.sort(),$.set(L,K)}return[...$.values()]}function hf(H){if(!H)return;let $=[...uy(H)].filter((A)=>OZ(A));if(!$.length)return;if($.length===1)return $[0];return $}function uZ(H,$,A,L,D){A=hf(A);let I=new Set($.map((K)=>K.word)),E={...WBH(H),locale:A,ignoreCase:L};return $.map((K)=>{let M=XBH(K.word,!!K.isPreferred,E);if(M===K.word||I.has(M))return K;let W=D.find(M);if(!W||!W.forbidden||!W.noSuggest)return I.add(M),{...K,wordAdjustedToMatchCase:M};return K})}function bf(H,$,A){let L=H[0]?.cost,D=0;for(;D<H.length;++D){if(D>=$&&(!A||H[D].cost>L))break;L=H[D].cost}return H.slice(0,D)}function MBH(H,$){if(!$?.length)return;let A=new Set(H.dictionaryDefinitions?.map((L)=>L.name)||[]);for(let L of $)if(!A.has(L))throw new df(`Unknown dictionary: "${L}"`,"E_dictionary_unknown")}function XBH(H,$,A){let L=A.locale;if(A.isMixedCaps)return H;if(QBH(H)){if(A.isAllCaps)return H.toLocaleUpperCase(L);if(!A.ignoreCase||A.hasCaps||$)return H;if(BBH(H)||JBH(H))return H.toLocaleLowerCase(L);return H}if(!A.hasCaps)return H;if(A.isAllCaps)return H.toLocaleUpperCase(L);return LBH(A.isTitleCase),H.replace(/^\p{L}/u,(D)=>D.toLocaleUpperCase(L))}function WBH(H){let $=uf.test(H),A=$&&gf.test(H),L=$&&!A&&mf.test(H);return{hasCaps:$,isAllCaps:A,isMixedCaps:$&&!A&&!L,isTitleCase:L}}function QBH(H){return uf.test(H)}function BBH(H){return mf.test(H)}function JBH(H){return gf.test(H)}var RiH,jiH,SiH,uf,gf,mf,df;var pf=y(()=>{h4();h2();k8();vf();z$();RiH=Object.freeze({}),jiH=Object.freeze({}),SiH=ff(DBH);uf=/\p{Lu}/u,gf=/^[\P{L}\p{Lu}]+$/u,mf=/^\p{Lu}[\P{L}\p{Ll}]+$/u;df=class df extends Error{code;constructor(H,$){super(H);this.code=$}}});var cf=200,lf=5,nf=4;function ZBH(H,$){if(!$||!$.c)return;return tf(H,$.c)}function YBH(H,$,A){let L={v:A,s:void 0,c:void 0};if(!$||H(A,$.v)<=0)return L.c=$,L;return L.s=$.c,$.c=L,$}function af(H,$,A){if(H($.v,A.v)<=0)return $.s=void 0,A.s=$.c,$.c=A,$;return A.s=void 0,$.s=A.c,A.c=$,A}function tf(H,$){if(!$.s)return $;let A=$.s,L=A.s,D=af(H,$,A);return L?af(H,D,tf(H,L)):D}var gZ;var of=y(()=>{gZ=class gZ{compare;_heap;_size=0;constructor(H){this.compare=H}add(H){return this._heap=YBH(this.compare,this._heap,H),++this._size,this}dequeue(){let H=this.next();if(H.done)return;return H.value}append(H){for(let $ of H)this.add($);return this}next(){if(!this._heap)return{value:void 0,done:!0};let H=this._heap.v;return--this._size,this._heap=ZBH(this.compare,this._heap),{value:H}}peek(){return this._heap?.v}[Symbol.iterator](){return this}get length(){return this._size}}});function sf(H){return H.replaceAll(/[|\\{}()[\]^$+*?.]/g,"\\$&").replaceAll("-","\\x2d")}function d2(H,$,A,L={}){let D=rf({text:H.text,offset:$-H.offset}),I=H.offset,E=new Map,K=/^[-.+\d_eE'`\\\s]+$/;if(!D.text){let Q=X(D);return{line:H,offset:$,text:Q,words:[],endOffset:Q.offset+Q.text.length}}let M={line:H,relStart:D.offset,relEnd:D.offset+D.text.length},W=GBH(M,L);if(!W.length){let Q=X(D);return{line:H,offset:$,text:Q,words:[{...Q,isFound:A(Q)}],endOffset:Q.offset+Q.text.length}}function X(Q){return{...Q,offset:Q.offset+I}}function J(Q){if(K.test(Q.text))return!0;let B=Q.offset,Y=Q.text.length,G=B+(Y<<20);if(B<1048576&&Y<2048){let V=E.get(G);if(V!==void 0)return V}else G=-1;let U=A(X(Q));if(G>=0)E.set(G,U);return U}return W.push({offset:M.relEnd,breaks:[u4]}),{line:H,offset:$,text:X(D),words:zBH(M,W,J).map(X),endOffset:I+M.relEnd}}function rf({text:H,offset:$}){let A=new RegExp(ZX);A.lastIndex=$;let L=A.exec(H);if(!L)return{text:"",offset:$+H.length};if(Cw.test(L[0]))return rf({text:H,offset:$+L[0].length});return{text:L[0],offset:L.index}}function GBH(H,$){let A=UBH(H),L=CBH(H),D=VBH(H,$.optionalWordBreakCharacters);return PBH(...A,...L,...D)}function mZ(H,$){let A=new RegExp(H);return A.lastIndex=$,A}function UBH(H){let $=[],A=H.line.text.slice(0,H.relEnd);for(let D of A.matchAll(mZ(Bw,H.relStart))){if(D.index===void 0)break;let I=D.index+D[1].length;$.push({offset:D.index,breaks:[[I,I],u4]})}let L=[];for(let D of A.matchAll(mZ(Jw,H.relStart))){if(D.index===void 0)break;let I=D.index+D[1].length,E=I+D[3].length;L.push({offset:D.index,breaks:[[I,I],[E,E],u4]})}return[$,L]}function zI(H,$,A){let L=[],D=H.line.text.slice(0,H.relEnd);for(let I of D.matchAll(mZ($,H.relStart))){let E=A(I);if(E)L.push(E)}return L}function VBH(H,$){function A(D){let I=D.index;if(I===void 0)return;let E=I+D[0].length;return{offset:I,breaks:[[I,E],u4]}}let L=[zI(H,Uw,A),zI(H,Vw,A)];if($){let D=new RegExp(`[${sf($)}]`,"gu");L.push(zI(H,D,A))}return L}function CBH(H){function $(A){let L=A.index;if(L===void 0)return;let D=L+A[0].length;return{offset:L,breaks:[[L,D],[L,L],[D,D],u4]}}return[zI(H,Yw,$),zI(H,/\d+/g,$),zI(H,Gw,$)]}function zBH(H,$,A){let L=H.relEnd,D=1000,I=new Map;function E(G,U,V,z){let P=L;while(V<$.length&&$[V].offset<U)V+=1;if(V>=$.length)return[];let T=$[V];function q(O){let N=O.length<2?P-U:(O[0]-U)*0.5+P-O[1],x=z+N;return{p:G,i:U,bi:V,bp:O,c:z,ec:x,text:void 0}}return T.breaks.map(q)}function K(G,U){let V=A({text:G,offset:U});return{text:G,offset:U,isFound:V}}function M(G,U){return G.ec-U.ec||U.i-G.i}function W(G){let U=[];for(let V=G;V;V=V.n)if(V.text)U.push(V.text);return U}function X(G,U){for(let V=G;V!==void 0;V=V.p){let{text:z,i:P}=V,T=(!z||z.isFound?0:z.text.length)+(U?.c??0),q=I.get(P);if(q&&q.c<=T)return;let O={n:U,i:P,c:T,text:z};I.set(P,O),U=O}return U}let J=H.relEnd-H.relStart,Z=new gZ(M),Q=H.line.text;Z.append(E(void 0,H.relStart,0,0));let B=0,Y;while(J&&Z.length&&B++<1000){let G=Z.dequeue();if(!G||G.c>=J)continue;if(G.bp.length){let U=G.bp[0],V=G.bp[1],z=U>G.i?K(Q.slice(G.i,U),G.i):void 0,P=!z||z.isFound?0:z.text.length,T=L-V;G.c+=P,G.ec=G.c+T,G.text=z;let q=I.get(V);if(q){let O=X(G,q);Y=!Y||O&&O.c<Y.c?O:Y}else if(G.c<J){let O=E(z?G:G.p,V,G.bi+1,G.c);Z.append(O)}}else{let U=E(G.p,G.i,G.bi+1,G.c);if(Z.append(U),!U.length){let V=L>G.i?K(Q.slice(G.i,L),G.i):void 0,z=!V||V.isFound?0:V.text.length;G.c+=z,G.ec=G.c,G.text=V;let P=V||G.p?.text||K("",G.i),T=V?{...G,text:P}:{...G,...G.p,text:P},q=X(T,void 0);Y=!Y||q&&q.c<Y.c?q:Y}}if(Y&&Y.c<J)J=Y.c}return W(Y)}function PBH(...H){return H.flat().sort(($,A)=>$.offset-A.offset)}var u4;var dZ=y(()=>{of();l8();u4=Object.freeze([])});function $v(H,$=0.5){return qBH(H)>=$}function qBH(H){if(!H.length)return 0;return TBH(H).length/H.length}function TBH(H){return H.replaceAll(/\d+/g,"0").replaceAll(/\p{Ll}\p{M}+/gu,"a").replaceAll(/\p{Lu}\p{M}+/gu,"A").replaceAll(/\p{Lu}?\p{Ll}+/gu,"1").replaceAll(/\p{Lu}+/gu,"2").replaceAll(/\p{M}/gu,"4").replaceAll("_","").replaceAll(/[-_.']+/g,"3")}function Hv(H,$){return ef.lastIndex=$,ef.test(H)}function Av(H,$=NBH){return[...H.matchAll(_BH)].filter((A)=>A[0].length>=$&&(A.index===0||!Hv(H,A.index-1))&&!Hv(H,A.index+A[0].length)).map((A)=>({text:A[0],offset:A.index}))}var _BH,ef,NBH=4;var Lv=y(()=>{_BH=/(?:\b|(?<=[\W_]))[0-9a-fA-F][-0-9a-fA-F]*[0-9a-fA-F](?:\b|(?=[\W_]))/g,ef=/\p{L}/uy});function Dv(H,$){return $=$.includes("\\")?$.replaceAll("\\",""):$,H.has($)}function pZ(H,$,A){return Dv(H,$.text)||A.text[$.offset-A.offset-1]==="\\"&&Dv(H,$.text.slice(1))}var Iv=()=>{};import FBH from"node:assert";function Ev(H,$){let{text:A,range:L,map:D}=H,[I,E]=L,K=Math.min(Math.max($[0],I),E),M=Math.min(Math.max($[1],I),E),W=K-I,X=M-I,J=[K,M];if(!D||!D.length||W===X)return{text:A.slice(W,X),range:J};FBH((D.length&1)===0,"Map must be pairs of values.");let Z=D.length,Q=D[Z-2],B=D[Z-1],Y=A.length-B,G=!D[0]&&!D[1]?[]:[0,0],U=[Q+Y,B+Y],V=[...G,...D,...U],z=0;for(;z<V.length&&W>=V[z];z+=2);let P=z;z-=2;let T=W-V[z],q=T+V[z+1];for(;z<V.length&&X>V[z];z+=2);let O=z,x=X-V[z]+V[z+1],w=A.slice(q,x);if(O===P)return{text:w,range:J};let F=[T,q],f=V.slice(P,O+2).map((j,S)=>j-F[S&1]);return{text:w,range:J,map:f}}var Kv=()=>{};function Mv(H,$){if(!$||!$.length)return H;let[A,L]=H,D=0,I=0,E=1;while(E<$.length&&$[E]<A)D=$[E-1],I=$[E],E+=2;let K=A-I+D;while(E<$.length&&$[E]<L)D=$[E-1],I=$[E],E+=2;let M=L-I+D;return[K,M]}function cZ(H){let $=0;function*A(L){if(!H.length)return;let D=L.range,I=D[1],E=D[0];while($&&($>=H.length||H[$].startPos>E))$-=1;let K=H[$];if(I<=K.endPos&&E>=K.startPos){yield L;return}while(E<I){while(H[$]&&H[$].endPos<=E)$+=1;if(!H[$])break;let{startPos:M,endPos:W}=H[$];if(I<M)break;let X=Math.max(E,M),J=Math.min(I,W);if(X!==J)yield Ev(L,[X,J]);E=J}}return A}var lZ=y(()=>{Kv()});import OBH from"node:assert";function RBH(H,$){let{minWordLength:A=nf,flagWords:L=[],allowCompoundWords:D=!1,ignoreCase:I=!0,ignoreRandomStrings:E=hZ.ignoreRandomStrings,minRandomLength:K=hZ.minRandomLength,unknownWords:M=bZ.ReportAll}=$,X=GM(H,{ignoreCase:I,useCompounds:D||void 0}),J=new Map,Z=new Set(L),Q=new Map,B=new Set,Y=(k)=>(p)=>{let LH=k(p);if(!LH)B.add(p.text);return LH},G=(k)=>{return!B.has(k.text)},U={has(k){let p=l(k);if(p.isFound!==void 0)return p.isFound;if(p.isFlagged)return!0;if(p.isFlagged)return!1;return p.isFound=X.has(k),p.isFound}};function V(k){return k.isIgnored??=X.isNoSuggestWord(k.word),k.isIgnored}function z(k){if(k.isFlagged!==void 0)return k.isFlagged;let p=k.word;return k.isFlagged=(Z.has(p)||Z.has(p.toLowerCase())||X.isForbidden(p))&&!V(k),k.isFlagged}function P(k){return V(l(k))}let T=new Map;function q(k){return y3(T,k,()=>X.getPreferredSuggestions(k))}let O=new Map;function N(k){return y3(O,k,()=>{return!!X.suggest(k,{numSuggestions:1,compoundMethod:0,includeTies:!1,ignoreCase:I,timeout:100,numChanges:1.8}).length})}function x(k){return z(l(k.text))}function w(k){return k.isFlagged=x(k),k}function F(k){let p=q(k.text);if(!p?.length){if(k.hasPreferredSuggestions=p!==void 0?!1:void 0,M===bZ.ReportSimple)k.hasSimpleSuggestions=N(k.text);return k}return k.suggestionsEx=p,k.hasPreferredSuggestions=!0,k.hasSimpleSuggestions=!0,k}let f=(k)=>k.text.length>=A||!!k.isFlagged,j=Y((k)=>k.isFlagged||!k.isFound),S=Y((k)=>!Mf.test(k.text));function _(k){let p=l(k.text);if(p.fin){let{isFlagged:HH,isFound:e,isIgnored:_H}=p,SH=k.isFlagged??(!_H&&HH);return k.isFlagged=SH,k.isFound=SH?void 0:e,k}let LH=V(p),IH=k.isFlagged??z(p);return p.isFound??=IH?!1:LH||pZ(U,k,k.line),p.isFlagged=!!IH,p.fin=!0,k.isFlagged=IH,k.isFound=IH?void 0:p.isFound,k}let u=/^([\p{Lu}\p{M}]{2,})['’]?(?:s|ing|ies|es|ings|ize|ed|ning)$/u,h=/\p{L}/u,d=(k)=>{let p=k.line;function LH($H,wH=!1){if($H.text.length>=A*2||[...$H.text].length>=A)return!1;let NH=$H.offset-p.offset;OBH.equal(p.text.slice(NH,NH+$H.text.length),$H.text);let L$=[...p.text.slice(Math.max(0,NH-2),NH)];if(!!L$.length&&h.test(L$[L$.length-1]))return!1;if(wH)return!0;let r$=[...p.text.slice(NH+$H.text.length,NH+$H.text.length+2)];return!(!!r$.length&&h.test(r$[0]))}function IH($H){if(B.has($H.text))return!0;if(x($H))return!1;if(pZ(U,$H,k.line))return!0;if(LH($H))return!0;return HH($H)}function HH($H){if(!u.test($H.text))return!1;let wH=$H.text.match(u);if(!wH)return!1;let L$={offset:$H.offset,text:wH[1],line:p},TH=_(L$);if(TH.isFlagged)return!1;if(TH.isFound)return!0;if(LH(L$,!0))return!0;return!1}function e($H){if($H.isFlagged)return[$H];if(HH($H))return[];if(P($H.text)||_($H).isFound)return Y((NH)=>!1)($H),[];if($H.isFlagged)return[$H];let wH=_H($H);if(!wH.length)return Y((NH)=>!1)($H),[];return wH}function _H($H){return SH($H,pJ)}function SH($H,wH){let NH=[];for(let L$ of Uf($H,wH)){if(B.has(L$.text))continue;let TH=L$;if(TH.line=$H.line,TH.isFlagged=void 0,TH.isFound=void 0,w(TH),!f(TH))continue;if(_(TH),!j(TH)||!S(TH))continue;TH.text=Pf(k.segment,TH.offset,TH.offset+TH.text.length),NH.push(TH)}return NH}function o($H,wH){let{issues:NH}=wH,L$=$H.offset-wH.possibleWord.offset;return NH.map((TH)=>{return TH={...TH},TH.offset+=L$,TH.line=k.line,TH})}function JH($H){if(x($H))return{...$H,line:k.line,isFlagged:!0};if($H.text.endsWith(".")&&$H.text.length>1){let wH={...$H,text:$H.text.slice(0,-1)};if(x(wH))return{...wH,line:k.line,isFlagged:!0}}return}function t($H){let wH=Q.get($H.text);if(wH){if(!wH.issues.length)return wH.issues;return o($H,wH)}let NH=BH($H).map(F);return Q.set($H.text,{possibleWord:$H,issues:NH}),NH}function BH($H){let wH=JH($H);if(wH)return[wH];let NH=[];for(let TH of Cf($H)){if(B.has(TH.text))continue;let r$=TH;if(r$.line=k.line,w(r$),!f(r$))continue;for(let W0 of e(r$))NH.push(W0)}if(!NH.length)return NH;let L$=!E?void 0:Av($H.text,wBH).filter((TH)=>(TH.text===TH.text.toLowerCase()||TH.text===TH.text.toUpperCase())&&/[\d-]/.test(TH.text)).map((TH)=>(TH.offset+=$H.offset,TH));if(L$?.length)NH=Xv(NH,L$);if(NH.length){let r$=d2(k.segment,$H.offset,IH).words.filter((BL)=>!BL.isFound).filter((BL)=>{let d4=BL.text.match(u);if(!d4)return!0;let p4=_({...BL,text:d4[1],line:k.line});return p4.isFlagged||!p4.isFound}),W0=Xv(r$.map((BL)=>({...BL,line:k.line})).map(w),L$);if(W0.length<NH.length)return W0}return NH}function qH($H){if($H.text.length<K||!E)return!0;return!$v($H.text)}return WH(zf(k.segment),vH(qH),vH(G),E$(t))};function l(k){let p=J.get(k);if(p)return p;let LH={word:k,isFound:void 0,isFlagged:void 0,isIgnored:void 0,fin:!1};return J.set(k,LH),LH}return{fn:d,dict:X}}function iZ(H,$){let A=RBH(H,$),L=A.fn;function D(I){let{text:E,range:K,map:M}=I,W=K[0],X={text:E,offset:0},J={line:X,segment:X};function Z(Q){let{text:B,offset:Y,isFlagged:G,isFound:U,suggestionsEx:V,hasPreferredSuggestions:z,hasSimpleSuggestions:P}=Q,T=Mv([Y,Y+B.length],M),q=[T[0]+W,T[1]+W];return{text:B,range:q,isFlagged:G,isFound:U,suggestionsEx:V,hasPreferredSuggestions:z,hasSimpleSuggestions:P}}return[...L(J)].map(Z)}return{validate:D,lineValidator:A}}function Xv(H,$){if(!$?.length)return H;let A=[],L=0,D=0;for(L=0;L<H.length&&D<$.length;L++){let I=H[L];while(D<$.length&&$[D].offset+$[D].text.length<=I.offset)D++;if(D>=$.length)break;if(I.isFlagged||I.offset<$[D].offset)A.push(I)}if(L<H.length)A.push(...H.slice(L));return A}var wBH=8;var Wv=y(()=>{N$();m2();B8();SZ();kZ();l8();dZ();Lv();Iv();lZ()});function nZ(H){return{...H,ignoreCase:!(H.caseSensitive??!1),ignoreRandomStrings:H.ignoreRandomStrings,minRandomLength:H.minRandomLength,unknownWords:H.unknownWords||"report-all"}}function Qv(H){let $=H.index||0,A=H[0];return{startPos:$,endPos:$+A.length,text:A}}function jBH(H,$){if(H.source===".*")return[{startPos:0,endPos:$.length}];let A=new RegExp(H);if(!A.global){let L=$.match(A);if(!L)return[];return[Qv(L)]}return[...$.matchAll(A)].map(Qv)}function SBH(H,$){return H.startPos-$.startPos||H.endPos-$.endPos}function xBH(H){let $=aZ(H);if(H=$.values,!H.length)return $;let A=0,L=0,{startPos:D,endPos:I}=H[A++];for(;A<H.length;++A){let E=H[A];if(E.startPos>I){H[L++]={startPos:D,endPos:I},D=E.startPos,I=E.endPos;continue}I=Math.max(I,E.endPos)}if(D<I)H[L++]={startPos:D,endPos:I};return H.length=L,$}function tZ(H,$){let A=H.map((L)=>jBH(L,$));return xBH(yBH(A)).values}function Bv(H,$){return kBH(aZ(H),aZ($))}function kBH(H,$){let A=H.values,L=$.values;if(!A.length)return A;if(!L.length)return A;let D=[];D.length=A.length+L.length+1;let I=0,E=0,K=L.length;for(let M of A){let{endPos:W,startPos:X}=M;for(;E<K;++E){let J=L[E];if(J.startPos>=W)break;if(J.endPos<=X)continue;if(J.startPos>X)D[I++]={startPos:X,endPos:J.startPos};if(X=J.endPos,X>=W)break}if(X<W)D[I++]={startPos:X,endPos:W}}return D.length=I,D}function aZ(H){return H.sort(SBH),{values:H}}function yBH(H){let $=0;for(let D=H.length-1;D>=0;--D)$+=H[D].length;let A=Array($),L=0;for(let D=0;D<H.length;++D){let I=H[D];for(let E=0;E<I.length;++E)A[L++]=I[E]}return A}function oZ(H,$){let{ignoreRegExpList:A=[],includeRegExpList:L=[]}=$,D=L.filter((K)=>!!K),I=D.length?D:[/.*/gim];return Bv(tZ(I,H),tZ(A,H))}var Jv=()=>{};function Gv(H,$,A){let L={ignoreCase:A.ignoreCase??!0,useCompounds:A.allowCompoundWords||!1},I=d2({text:H,offset:0},0,J).words.map((Z)=>({word:Z.text,found:Z.isFound})),E=i_((Z)=>Z.word+"|"+Z.found),K={word:H,found:$.has(H,L)},M=I.some((Z)=>Z.word===H)?I:[K,...I],W=M.filter(E).map((Z)=>Z.word).flatMap((Z)=>$.dictionaries.map((Q)=>({dict:Q,word:Z}))).map(({dict:Z,word:Q})=>({dict:Z,findResult:Z.find(Q,L),word:Q})).flatMap((Z)=>vBH(Z,A)),X=new Uv(...W);return X.splits=M,X;function J(Z){return $.has(Z.text,L)}}function vBH(H,$){let{word:A,dict:L,findResult:D}=H,I=Yv(L,A),E={word:A,found:!!D?.found,foundWord:D?.found||void 0,forbidden:D?.forbidden||!1,noSuggest:D?.noSuggest||!1,dictName:L.name,dictSource:L.source,configSource:void 0,preferredSuggestions:I,errors:Zv(L.getErrors?.())},K=DO.get(L.name);if(!D?.found||!K||!$.source)return[E];let M={ignoreCase:!0,useCompounds:$.allowCompoundWords||!1},W=nJ($),X=[];for(let J of W){if(!J[K]||!Array.isArray(J[K])||!J[K]?.length||!J.source?.filename)continue;let Z=n$(J.source.filename).href,Q={[K]:J[K]},B=HL(_J(Q),L.name,Z),Y=B.find(A,M),G=Yv(B,A);if(!Y?.found&&!G)continue;let U={word:A,found:!!Y?.found,foundWord:Y?.found||void 0,forbidden:Y?.forbidden||!1,noSuggest:Y?.noSuggest||!1,dictName:L.name,dictSource:Z,configSource:Z,preferredSuggestions:G,errors:Zv(L.getErrors?.())};X.push(U)}return X.length?X:[E]}function Zv(H){return H?.length?H:void 0}function Yv(H,$){let A=H.getPreferredSuggestions?.($);return A?.length?A.filter((D)=>D.isPreferred).map((D)=>D.word):void 0}var Uv;var Vv=y(()=>{h4();k8();_A();z$();dZ();Uv=class Uv extends Array{splits=[];constructor(...H){super(...H)}}});import X$ from"node:assert";class m4{settings;_document;_ready=!1;errors=[];_prepared;_preparations;_preparationTime=-1;_suggestions=new UJ((H)=>this.genSuggestions(H),1000);options;perfTiming={};skipValidation;static async create(H,$,A){let L=a3(A)?await f4(A):A,D=new m4(H,$,L);return await D.prepare(),D}constructor(H,$,A){this.settings=A,this._document=H,this.options={...$};let L=this.options.numSuggestions??A.numSuggestions;if(L!==void 0)this.options.numSuggestions=L;this.skipValidation=!!$.skipValidation}get ready(){return this._ready}prepare(){if(this._ready)return Promise.resolve();if(this._prepared)return this._prepared;return this._prepared=this._prepareAsync(),this._prepared}async _prepareAsync(){X$(!this._ready);let H=FA("_prepareAsync"),{options:$,settings:A}=this,L=PH($.resolveImportsRelativeTo||PH("./virtual.settings.json")),D=A.import?.length?await R2(A,L):A,I=!$.noConfigSearch&&!D.noConfigSearch||$.noConfigSearch===!1,E=$.configFile?w2($.configFile,D):I?p2(this.perfTiming,"__searchForDocumentConfig",hBH(this._document,D,D)):void 0;if(E)p2(this.perfTiming,"_loadConfig",E);let K=await _P(E,(q)=>this.addPossibleError(q))||{};this.addPossibleError(K?.__importRef?.error);let M=gH(D,K),W=await p2(this.perfTiming,"_determineTextDocumentSettings",vZ(this._document,M)),X=await p2(this.perfTiming,"_getDictionaryInternal",d3(W)),J=g4(this.perfTiming,"_GlobMatcher"),Z=YX(K?.ignorePaths),Q=this._document.uri;J();let B=g4(this.perfTiming,"_shouldCheck"),Y=!Z.match(p3(Q))&&(W.enabled??!0);B();let G=g4(this.perfTiming,"_finalizeSettings"),U=n3(W),V=nZ(U),z=oZ(this._document.text,V),P=cZ(z),T=iZ(X,V);G(),this._preparations={config:M,dictionary:X,docSettings:W,finalSettings:U,shouldCheck:Y,validateOptions:V,includeRanges:z,segmenter:P,textValidator:T,localConfig:K,localConfigFilepath:K?.__importRef?.filename},this._ready=!0,this._preparationTime=H.elapsed,this.perfTiming.prepTime=this._preparationTime}async _updatePrep(){X$(this._preparations,s$);let H=FA("_updatePrep"),$=this._preparations,A=await vZ(this._document,$.config),L=await d3(A),D=A.enabled??!0,I=n3(A),E=nZ(I),K=oZ(this._document.text,E),M=cZ(K),W=iZ(L,E);this._preparations={...$,dictionary:L,docSettings:A,shouldCheck:D,validateOptions:E,includeRanges:K,segmenter:M,textValidator:W},this._preparationTime=H.elapsed}get prepTime(){return this._preparationTime}get validateDirectives(){return this.options.validateDirectives??this._preparations?.config.validateDirectives??!1}checkText(H,$,A){let L=this._document.text.slice(H[0],H[1]);return A=(Array.isArray(A)?A.join(" "):A)||"",this.check({text:L,range:H,scope:A})}check(H){X$(this._ready),X$(this._preparations,s$);let{segmenter:$,textValidator:A}=this._preparations,L=this._document,D=void 0;function I(M){let{range:W,text:X,isFlagged:J,isFound:Z,suggestionsEx:Q,hasPreferredSuggestions:B,hasSimpleSuggestions:Y}=M,G=W[0],U=W[1]-W[0];if(X$(!D||D.offset<=G),!D||D.offset+D.text.length<=G)D=L.lineAt(G);return{text:X,offset:G,line:D,length:U,isFlagged:J,isFound:Z,suggestionsEx:Q,hasPreferredSuggestions:B,hasSimpleSuggestions:Y}}let E=[...WH($(H),E$(A.validate),UH(I))];if(!this.options.generateSuggestions)return E.map((M)=>{if(!M.suggestionsEx)return M;let W=this.adjustSuggestions(M.text,M.suggestionsEx),X=W.map((J)=>J.word);return{...M,suggestionsEx:W,suggestions:X}});return E.map((M)=>{let W=M.text,X=this.getSuggestions(W);return M.suggestionsEx=X,M.suggestions=X.map((J)=>J.word),M})}async checkDocumentAsync(H){return await this.prepare(),this.checkDocument(H)}checkDocument(H=!1){let $=g4(this.perfTiming,"checkDocument");try{if(this.skipValidation)return[];X$(this._ready),X$(this._preparations,s$);let A=H||this.shouldCheckDocument()?[...this._checkParsedText(this._parse())]:[],L=this.checkDocumentDirectives();return[...A,...L].sort((I,E)=>I.offset-E.offset)}finally{$()}}checkDocumentDirectives(H=!1){if(X$(this._ready),X$(this._preparations,s$),!(H||this.validateDirectives))return[];let A=this.document,L=yf.directive;function D(I){let{text:E,range:K,suggestions:M,suggestionsEx:W,message:X}=I,J=K[0],Z=A.positionAt(J),Q=A.getLine(Z.line);return{text:E,offset:J,line:Q,suggestions:M,suggestionsEx:W,message:X,issueType:L}}return[...Ff(this.document.text,this._preparations.config)].map(D)}get document(){return this._document}async updateDocumentText(H){TO(this._document,[{text:H}]),await this._updatePrep()}getCheckedTextRanges(){return X$(this._preparations,s$),this._preparations.includeRanges}traceWord(H){return X$(this._preparations,s$),Gv(H,this._preparations.dictionary,this._preparations.config)}defaultParser(){return WH(this.document.getLines(),UH((H)=>{let{text:$,offset:A}=H,L=[A,A+$.length];return{text:$,range:L}}))}*_checkParsedText(H){X$(this._preparations,s$);let{maxNumberOfProblems:$=cf,maxDuplicateProblems:A=lf}=this._preparations.validateOptions,L=0,D=new Map;for(let I of H)for(let E of this.check(I)){let{text:K}=E,M=(D.get(K)||0)+1;if(D.set(K,M),M>A)continue;if(yield E,++L>=$)return}}addPossibleError(H){if(!H)return;H=this.errors.push(J3(H))}_parse(){X$(this._preparations,s$);let H=this._preparations.finalSettings.parserFn;if(typeof H!=="object")return this.defaultParser();return H.parse(this.document.text,FH($D(this.document.uri))).parsedTexts}getSuggestions(H){return this._suggestions.get(H)}genSuggestions(H){X$(this._preparations,s$);let $=this._preparations.docSettings,A=this._preparations.dictionary,L={compoundMethod:0,numSuggestions:this.options.numSuggestions,includeTies:!1,ignoreCase:!($.caseSensitive??!1),timeout:$.suggestionsTimeout,numChanges:$.suggestionNumChanges},D=A.suggest(H,L);return this.adjustSuggestions(H,D)}adjustSuggestions(H,$){X$(this._preparations,s$);let L=!(this._preparations.docSettings.caseSensitive??!1),D=this._preparations.config.language,I=this._preparations.dictionary;return uZ(H,$.map(uBH),D,L,I).map(bBH)}getFinalizedDocSettings(){return X$(this._ready),X$(this._preparations,s$),this._preparations.docSettings}shouldCheckDocument(){return X$(this._preparations,s$),this._preparations.shouldCheck}_getPreparations(){return this._preparations}}function bBH(H){let{word:$,isPreferred:A,wordAdjustedToMatchCase:L}=H;if(A&&L)return{word:$,wordAdjustedToMatchCase:L,isPreferred:A};if(A)return{word:$,isPreferred:A};if(L)return{word:$,wordAdjustedToMatchCase:L};return{word:$}}async function hBH(H,$,A){let L=$D(H.uri);try{return await O2(L,A).then((D)=>D||$)}catch(D){if(L.protocol!=="file:")return $;throw D}}function uBH(H){return{cost:999,...H}}function g4(H,$){let A=FA($,(L)=>H[$]=L);return()=>A.end()}function p2(H,$,A){return A.finally(g4(H,$))}var s$="Validator Must be prepared before calling this function.";var Cv=y(()=>{N$();m2();qA();BI();sJ();jJ();aJ();h4();fZ();k8();pf();Z3();VJ();AD();kf();Wv();lZ();Jv();Vv()});var zv=y(()=>{Cv()});async function sZ(H,$,A){let L=a3(A)?A.settings:A;if(OJ(H))return{document:H,options:$,settingsUsed:L,localConfigFilepath:void 0,issues:[],checked:!1,errors:void 0};try{let D=FA("loadFile"),I=await NO(H).finally(()=>D.end());if(OJ(I))return{document:H,options:$,settingsUsed:L,localConfigFilepath:void 0,issues:[],checked:!1,errors:void 0};let E=await gBH(I,$,A),K=E.perf||{};return K.loadTimeMs=D.elapsed,E.perf=K,E}catch(D){let I=tE(D)?[D]:[];return{document:H,options:$,settingsUsed:L,localConfigFilepath:void 0,issues:[],checked:!1,errors:I}}}async function gBH(H,$,A){let L={},D=FA("spellCheckFullDocument",(Q)=>L.totalTimeMs=Q),I=FA("check",(Q)=>L.checkTimeMs=Q),E=FA("prepare",(Q)=>L.prepareTimeMs=Q),K=_O(H),M=$,W=await m4.create(K,M,A).finally(()=>E.end());Object.assign(L,Object.fromEntries(Object.entries(W.perfTiming).map(([Q,B])=>["_"+Q,B])));let X=W._getPreparations();if(W.errors.length)return{document:H,options:$,settingsUsed:X?.localConfig||(a3(A)?A.settings:A),localConfigFilepath:X?.localConfigFilepath,issues:[],checked:!1,errors:W.errors,perf:L};I.start();let J=W.checkDocument();I.end(),Object.assign(L,Object.fromEntries(Object.entries(W.perfTiming).map(([Q,B])=>["_"+Q,B])));let Z={document:H,options:$,settingsUsed:W.getFinalizedDocSettings(),localConfigFilepath:X?.localConfigFilepath,issues:J,checked:W.shouldCheckDocument(),errors:void 0,perf:L};return D.end(),Z}var Pv=y(()=>{BI();UO();FO();aJ();zv();Z3()});var qv=()=>{};var Tv=y(()=>{Kw();Gf();Pv();qv();m2()});var _v={};rv(_v,{spellCheckDocument:()=>sZ,prettyFormatIssues:()=>dBH});function dBH(H,$){if(H.issues.length===0)return C("Green")+"✓ No spelling issues found!"+C();let A=C("Yellow")+`✗ Found ${H.issues.length} spelling issue${H.issues.length===1?"":"s"}:
|
|
497
|
+
`+C();A+=C("Dim")+"─".repeat(60)+`
|
|
498
|
+
|
|
499
|
+
`+C();let L=C("Cyan"),D=C("Magenta"),I=C("Red")+C("Bright"),E=C("Dim"),K=C("Underline");return H.issues.forEach((M,W)=>{let X=$.substring(0,M.line.offset),J=X.length-X.replace(/\n/g,"").length,Z=M.offset-M.line.offset;A+=`${E}${W+1}.${C()} ${L}Line ${J+1}${C()}, ${D}Col ${Z+1}${C()}: ${I}"${M.text}"${C()}
|
|
500
|
+
`;let Q=M.line.text;if(Q){let B=M.offset-M.line.offset,Y=Q.substring(0,B),G=Q.substring(B+M.text.length);A+=` ${Y}${I+K}${M.text}${C()}${G}
|
|
501
|
+
`}if(M.suggestions?.length){let B=M.suggestions.slice(0,5).join(", ");A+=` ${L}Suggestions:${C()} ${B}
|
|
502
|
+
`}if(W<H.issues.length-1)A+=`
|
|
503
|
+
`}),A+=E+"─".repeat(60)+C()+`
|
|
504
|
+
`,A}var Nv=y(()=>{nH();Tv()});function mH(H){if(typeof H!=="object"||H===null)return!1;let $=Object.getPrototypeOf(H);return($===null||$===Object.prototype||Object.getPrototypeOf($)===null)&&!(Symbol.toStringTag in H)&&!(Symbol.iterator in H)}import{fileURLToPath as Hb}from"node:url";var UD=(H,$)=>{let A=a2($b(H));if(typeof A!=="string")throw TypeError(`${$} must be a string or a file URL: ${A}.`);return A},$b=(H)=>n2(H)?H.toString():H,n2=(H)=>typeof H!=="string"&&H&&Object.getPrototypeOf(H)===String.prototype,a2=(H)=>H instanceof URL?Hb(H):H;var c4=(H,$=[],A={})=>{let L=UD(H,"First argument"),[D,I]=mH($)?[[],$]:[$,A];if(!Array.isArray(D))throw TypeError(`Second argument must be either an array of arguments or an options object: ${D}`);if(D.some((M)=>typeof M==="object"&&M!==null))throw TypeError(`Second argument must be an array of strings: ${D}`);let E=D.map(String),K=E.find((M)=>M.includes("\x00"));if(K!==void 0)throw TypeError(`Arguments cannot contain null bytes ("\\0"): ${K}`);if(!mH(I))throw TypeError(`Last argument must be an options object: ${I}`);return[L,E,I]};import{ChildProcess as Mb}from"node:child_process";import{StringDecoder as Ab}from"node:string_decoder";var{toString:$7}=Object.prototype,A7=(H)=>$7.call(H)==="[object ArrayBuffer]",oH=(H)=>$7.call(H)==="[object Uint8Array]",yA=(H)=>new Uint8Array(H.buffer,H.byteOffset,H.byteLength),Lb=new TextEncoder,L7=(H)=>Lb.encode(H),Db=new TextDecoder,l4=(H)=>Db.decode(H),D7=(H,$)=>{return Ib(H,$).join("")},Ib=(H,$)=>{if($==="utf8"&&H.every((I)=>typeof I==="string"))return H;let A=new Ab($),L=H.map((I)=>typeof I==="string"?L7(I):I).map((I)=>A.write(I)),D=A.end();return D===""?L:[...L,D]},PI=(H)=>{if(H.length===1&&oH(H[0]))return H[0];return t2(Eb(H))},Eb=(H)=>H.map(($)=>typeof $==="string"?L7($):$),t2=(H)=>{let $=new Uint8Array(Kb(H)),A=0;for(let L of H)$.set(L,A),A+=L.length;return $},Kb=(H)=>{let $=0;for(let A of H)$+=A.length;return $};var M7=(H)=>Array.isArray(H)&&Array.isArray(H.raw),X7=(H,$)=>{let A=[];for(let[I,E]of H.entries())A=Xb({templates:H,expressions:$,tokens:A,index:I,template:E});if(A.length===0)throw TypeError("Template script must not be empty");let[L,...D]=A;return[L,D,{}]},Xb=({templates:H,expressions:$,tokens:A,index:L,template:D})=>{if(D===void 0)throw TypeError(`Invalid backslash sequence: ${H.raw[L]}`);let{nextTokens:I,leadingWhitespaces:E,trailingWhitespaces:K}=Wb(D,H.raw[L]),M=E7(A,I,E);if(L===$.length)return M;let W=$[L],X=Array.isArray(W)?W.map((J)=>K7(J)):[K7(W)];return E7(M,X,K)},Wb=(H,$)=>{if($.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let A=[],L=0,D=I7.has($[0]);for(let E=0,K=0;E<H.length;E+=1,K+=1){let M=$[K];if(I7.has(M)){if(L!==E)A.push(H.slice(L,E));L=E+1}else if(M==="\\"){let W=$[K+1];if(W===`
|
|
505
|
+
`)E-=1,K+=1;else if(W==="u"&&$[K+2]==="{")K=$.indexOf("}",K+3);else K+=Qb[W]??1}}let I=L===H.length;if(!I)A.push(H.slice(L));return{nextTokens:A,leadingWhitespaces:D,trailingWhitespaces:I}},I7=new Set([" ","\t","\r",`
|
|
506
|
+
`]),Qb={x:3,u:5},E7=(H,$,A)=>A||H.length===0||$.length===0?[...H,...$]:[...H.slice(0,-1),`${H.at(-1)}${$[0]}`,...$.slice(1)],K7=(H)=>{let $=typeof H;if($==="string")return H;if($==="number")return String(H);if(mH(H)&&(("stdout"in H)||("isMaxBuffer"in H)))return Bb(H);if(H instanceof Mb||Object.prototype.toString.call(H)==="[object Promise]")throw TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}.");throw TypeError(`Unexpected "${$}" in template expression`)},Bb=({stdout:H})=>{if(typeof H==="string")return H;if(oH(H))return l4(H);if(H===void 0)throw TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`);throw TypeError(`Unexpected "${typeof H}" stdout in template expression`)};import{spawnSync as Cd}from"node:child_process";import{debuglog as Jb}from"node:util";import o2 from"node:process";var e$=(H)=>i4.includes(H),i4=[o2.stdin,o2.stdout,o2.stderr],u$=["stdin","stdout","stderr"],n4=(H)=>u$[H]??`stdio[${H}]`;var Q7=(H)=>{let $={...H};for(let A of e2)$[A]=s2(H,A);return $},s2=(H,$)=>{let A=Array.from({length:Zb(H)+1}),L=Yb(H[$],A,$);return zb(L,$)},Zb=({stdio:H})=>Array.isArray(H)?Math.max(H.length,u$.length):u$.length,Yb=(H,$,A)=>mH(H)?Gb(H,$,A):$.fill(H),Gb=(H,$,A)=>{for(let L of Object.keys(H).sort(Ub))for(let D of Vb(L,A,$))$[D]=H[L];return $},Ub=(H,$)=>W7(H)<W7($)?1:-1,W7=(H)=>{if(H==="stdout"||H==="stderr")return 0;return H==="all"?2:1},Vb=(H,$,A)=>{if(H==="ipc")return[A.length-1];let L=r2(H);if(L===void 0||L===0)throw TypeError(`"${$}.${H}" is invalid.
|
|
507
|
+
It must be "${$}.stdout", "${$}.stderr", "${$}.all", "${$}.ipc", or "${$}.fd3", "${$}.fd4" (and so on).`);if(L>=A.length)throw TypeError(`"${$}.${H}" is invalid: that file descriptor does not exist.
|
|
508
|
+
Please set the "stdio" option to ensure that file descriptor exists.`);return L==="all"?[1,2]:[L]},r2=(H)=>{if(H==="all")return H;if(u$.includes(H))return u$.indexOf(H);let $=Cb.exec(H);if($!==null)return Number($[1])},Cb=/^fd(\d+)$/,zb=(H,$)=>H.map((A)=>A===void 0?qb[$]:A),Pb=Jb("execa").enabled?"full":"none",qb={lines:!1,buffer:!0,maxBuffer:1e8,verbose:Pb,stripFinalNewline:!0},e2=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],fA=(H,$)=>$==="ipc"?H.at(-1):H[$];var VD=({verbose:H},$)=>HW(H,$)!=="none",CD=({verbose:H},$)=>!["none","short"].includes(HW(H,$)),B7=({verbose:H},$)=>{let A=HW(H,$);return a4(A)?A:void 0},HW=(H,$)=>$===void 0?Tb(H):fA(H,$),Tb=(H)=>H.find(($)=>a4($))??t4.findLast(($)=>H.includes($)),a4=(H)=>typeof H==="function",t4=["none","short","full"];import{inspect as lb}from"node:util";import{platform as _b}from"node:process";import{stripVTControlCharacters as Nb}from"node:util";var J7=(H,$)=>{let A=[H,...$],L=A.join(" "),D=A.map((I)=>Sb(Z7(I))).join(" ");return{command:L,escapedCommand:D}},qI=(H)=>Nb(H).split(`
|
|
509
|
+
`).map(($)=>Z7($)).join(`
|
|
510
|
+
`),Z7=(H)=>H.replaceAll(wb,($)=>Fb($)),Fb=(H)=>{let $=Rb[H];if($!==void 0)return $;let A=H.codePointAt(0),L=A.toString(16);return A<=jb?`\\u${L.padStart(4,"0")}`:`\\U${L}`},Ob=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},wb=Ob(),Rb={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},jb=65535,Sb=(H)=>{if(xb.test(H))return H;return _b==="win32"?`"${H.replaceAll('"','""')}"`:`'${H.replaceAll("'","'\\''")}'`},xb=/^[\w./-]+$/;import Y7 from"node:process";function $W(){let{env:H}=Y7,{TERM:$,TERM_PROGRAM:A}=H;if(Y7.platform!=="win32")return $!=="linux";return Boolean(H.WT_SESSION)||Boolean(H.TERMINUS_SUBLIME)||H.ConEmuTask==="{cmd::Cmder}"||A==="Terminus-Sublime"||A==="vscode"||$==="xterm-256color"||$==="alacritty"||$==="rxvt-unicode"||$==="rxvt-unicode-256color"||H.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var G7={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"█",squareDarkShade:"▓",squareMediumShade:"▒",squareLightShade:"░",squareTop:"▀",squareBottom:"▄",squareLeft:"▌",squareRight:"▐",squareCenter:"■",bullet:"●",dot:"․",ellipsis:"…",pointerSmall:"›",triangleUp:"▲",triangleUpSmall:"▴",triangleDown:"▼",triangleDownSmall:"▾",triangleLeftSmall:"◂",triangleRightSmall:"▸",home:"⌂",heart:"♥",musicNote:"♪",musicNoteBeamed:"♫",arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",arrowLeftRight:"↔",arrowUpDown:"↕",almostEqual:"≈",notEqual:"≠",lessOrEqual:"≤",greaterOrEqual:"≥",identical:"≡",infinity:"∞",subscriptZero:"₀",subscriptOne:"₁",subscriptTwo:"₂",subscriptThree:"₃",subscriptFour:"₄",subscriptFive:"₅",subscriptSix:"₆",subscriptSeven:"₇",subscriptEight:"₈",subscriptNine:"₉",oneHalf:"½",oneThird:"⅓",oneQuarter:"¼",oneFifth:"⅕",oneSixth:"⅙",oneEighth:"⅛",twoThirds:"⅔",twoFifths:"⅖",threeQuarters:"¾",threeFifths:"⅗",threeEighths:"⅜",fourFifths:"⅘",fiveSixths:"⅚",fiveEighths:"⅝",sevenEighths:"⅞",line:"─",lineBold:"━",lineDouble:"═",lineDashed0:"┄",lineDashed1:"┅",lineDashed2:"┈",lineDashed3:"┉",lineDashed4:"╌",lineDashed5:"╍",lineDashed6:"╴",lineDashed7:"╶",lineDashed8:"╸",lineDashed9:"╺",lineDashed10:"╼",lineDashed11:"╾",lineDashed12:"−",lineDashed13:"–",lineDashed14:"‐",lineDashed15:"⁃",lineVertical:"│",lineVerticalBold:"┃",lineVerticalDouble:"║",lineVerticalDashed0:"┆",lineVerticalDashed1:"┇",lineVerticalDashed2:"┊",lineVerticalDashed3:"┋",lineVerticalDashed4:"╎",lineVerticalDashed5:"╏",lineVerticalDashed6:"╵",lineVerticalDashed7:"╷",lineVerticalDashed8:"╹",lineVerticalDashed9:"╻",lineVerticalDashed10:"╽",lineVerticalDashed11:"╿",lineDownLeft:"┐",lineDownLeftArc:"╮",lineDownBoldLeftBold:"┓",lineDownBoldLeft:"┒",lineDownLeftBold:"┑",lineDownDoubleLeftDouble:"╗",lineDownDoubleLeft:"╖",lineDownLeftDouble:"╕",lineDownRight:"┌",lineDownRightArc:"╭",lineDownBoldRightBold:"┏",lineDownBoldRight:"┎",lineDownRightBold:"┍",lineDownDoubleRightDouble:"╔",lineDownDoubleRight:"╓",lineDownRightDouble:"╒",lineUpLeft:"┘",lineUpLeftArc:"╯",lineUpBoldLeftBold:"┛",lineUpBoldLeft:"┚",lineUpLeftBold:"┙",lineUpDoubleLeftDouble:"╝",lineUpDoubleLeft:"╜",lineUpLeftDouble:"╛",lineUpRight:"└",lineUpRightArc:"╰",lineUpBoldRightBold:"┗",lineUpBoldRight:"┖",lineUpRightBold:"┕",lineUpDoubleRightDouble:"╚",lineUpDoubleRight:"╙",lineUpRightDouble:"╘",lineUpDownLeft:"┤",lineUpBoldDownBoldLeftBold:"┫",lineUpBoldDownBoldLeft:"┨",lineUpDownLeftBold:"┥",lineUpBoldDownLeftBold:"┩",lineUpDownBoldLeftBold:"┪",lineUpDownBoldLeft:"┧",lineUpBoldDownLeft:"┦",lineUpDoubleDownDoubleLeftDouble:"╣",lineUpDoubleDownDoubleLeft:"╢",lineUpDownLeftDouble:"╡",lineUpDownRight:"├",lineUpBoldDownBoldRightBold:"┣",lineUpBoldDownBoldRight:"┠",lineUpDownRightBold:"┝",lineUpBoldDownRightBold:"┡",lineUpDownBoldRightBold:"┢",lineUpDownBoldRight:"┟",lineUpBoldDownRight:"┞",lineUpDoubleDownDoubleRightDouble:"╠",lineUpDoubleDownDoubleRight:"╟",lineUpDownRightDouble:"╞",lineDownLeftRight:"┬",lineDownBoldLeftBoldRightBold:"┳",lineDownLeftBoldRightBold:"┯",lineDownBoldLeftRight:"┰",lineDownBoldLeftBoldRight:"┱",lineDownBoldLeftRightBold:"┲",lineDownLeftRightBold:"┮",lineDownLeftBoldRight:"┭",lineDownDoubleLeftDoubleRightDouble:"╦",lineDownDoubleLeftRight:"╥",lineDownLeftDoubleRightDouble:"╤",lineUpLeftRight:"┴",lineUpBoldLeftBoldRightBold:"┻",lineUpLeftBoldRightBold:"┷",lineUpBoldLeftRight:"┸",lineUpBoldLeftBoldRight:"┹",lineUpBoldLeftRightBold:"┺",lineUpLeftRightBold:"┶",lineUpLeftBoldRight:"┵",lineUpDoubleLeftDoubleRightDouble:"╩",lineUpDoubleLeftRight:"╨",lineUpLeftDoubleRightDouble:"╧",lineUpDownLeftRight:"┼",lineUpBoldDownBoldLeftBoldRightBold:"╋",lineUpDownBoldLeftBoldRightBold:"╈",lineUpBoldDownLeftBoldRightBold:"╇",lineUpBoldDownBoldLeftRightBold:"╊",lineUpBoldDownBoldLeftBoldRight:"╉",lineUpBoldDownLeftRight:"╀",lineUpDownBoldLeftRight:"╁",lineUpDownLeftBoldRight:"┽",lineUpDownLeftRightBold:"┾",lineUpBoldDownBoldLeftRight:"╂",lineUpDownLeftBoldRightBold:"┿",lineUpBoldDownLeftBoldRight:"╃",lineUpBoldDownLeftRightBold:"╄",lineUpDownBoldLeftBoldRight:"╅",lineUpDownBoldLeftRightBold:"╆",lineUpDoubleDownDoubleLeftDoubleRightDouble:"╬",lineUpDoubleDownDoubleLeftRight:"╫",lineUpDownLeftDoubleRightDouble:"╪",lineCross:"╳",lineBackslash:"╲",lineSlash:"╱"},U7={tick:"✔",info:"ℹ",warning:"⚠",cross:"✘",squareSmall:"◻",squareSmallFilled:"◼",circle:"◯",circleFilled:"◉",circleDotted:"◌",circleDouble:"◎",circleCircle:"ⓞ",circleCross:"ⓧ",circlePipe:"Ⓘ",radioOn:"◉",radioOff:"◯",checkboxOn:"☒",checkboxOff:"☐",checkboxCircleOn:"ⓧ",checkboxCircleOff:"Ⓘ",pointer:"❯",triangleUpOutline:"△",triangleLeft:"◀",triangleRight:"▶",lozenge:"◆",lozengeOutline:"◇",hamburger:"☰",smiley:"㋡",mustache:"෴",star:"★",play:"▶",nodejs:"⬢",oneSeventh:"⅐",oneNinth:"⅑",oneTenth:"⅒"},kb={tick:"√",info:"i",warning:"‼",cross:"×",squareSmall:"□",squareSmallFilled:"■",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(○)",circleCross:"(×)",circlePipe:"(│)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[×]",checkboxOff:"[ ]",checkboxCircleOn:"(×)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"∆",triangleLeft:"◄",triangleRight:"►",lozenge:"♦",lozengeOutline:"◊",hamburger:"≡",smiley:"☺",mustache:"┌─┐",star:"✶",play:"►",nodejs:"♦",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},yb={...G7,...U7},fb={...G7,...kb},vb=$W(),bb=vb?yb:fb,o4=bb,q1H=Object.entries(U7);import hb from"node:tty";var ub=hb?.WriteStream?.prototype?.hasColors?.()??!1,CH=(H,$)=>{if(!ub)return(D)=>D;let A=`\x1B[${H}m`,L=`\x1B[${$}m`;return(D)=>{let I=D+"",E=I.indexOf(L);if(E===-1)return A+I+L;let K=A,M=0,X=($===22?L:"")+A;while(E!==-1)K+=I.slice(M,E)+X,M=E+L.length,E=I.indexOf(L,M);return K+=I.slice(M)+L,K}},N1H=CH(0,0),V7=CH(1,22),F1H=CH(2,22),O1H=CH(3,23),w1H=CH(4,24),R1H=CH(53,55),j1H=CH(7,27),S1H=CH(8,28),x1H=CH(9,29),k1H=CH(30,39),y1H=CH(31,39),f1H=CH(32,39),v1H=CH(33,39),b1H=CH(34,39),h1H=CH(35,39),u1H=CH(36,39),g1H=CH(37,39),s4=CH(90,39),m1H=CH(40,49),d1H=CH(41,49),p1H=CH(42,49),c1H=CH(43,49),l1H=CH(44,49),i1H=CH(45,49),n1H=CH(46,49),a1H=CH(47,49),t1H=CH(100,49),C7=CH(91,39),o1H=CH(92,39),z7=CH(93,39),s1H=CH(94,39),r1H=CH(95,39),e1H=CH(96,39),HJH=CH(97,39),$JH=CH(101,49),AJH=CH(102,49),LJH=CH(103,49),DJH=CH(104,49),IJH=CH(105,49),EJH=CH(106,49),KJH=CH(107,49);var T7=({type:H,message:$,timestamp:A,piped:L,commandId:D,result:{failed:I=!1}={},options:{reject:E=!0}})=>{let K=gb(A),M=mb[H]({failed:I,reject:E,piped:L}),W=db[H]({reject:E});return`${s4(`[${K}]`)} ${s4(`[${D}]`)} ${W(M)} ${W($)}`},gb=(H)=>`${r4(H.getHours(),2)}:${r4(H.getMinutes(),2)}:${r4(H.getSeconds(),2)}.${r4(H.getMilliseconds(),3)}`,r4=(H,$)=>String(H).padStart($,"0"),P7=({failed:H,reject:$})=>{if(!H)return o4.tick;return $?o4.cross:o4.warning},mb={command:({piped:H})=>H?"|":"$",output:()=>" ",ipc:()=>"*",error:P7,duration:P7},q7=(H)=>H,db={command:()=>V7,output:()=>q7,ipc:()=>q7,error:({reject:H})=>H?C7:z7,duration:()=>s4};var _7=(H,$,A)=>{let L=B7($,A);return H.map(({verboseLine:D,verboseObject:I})=>pb(D,I,L)).filter((D)=>D!==void 0).map((D)=>cb(D)).join("")},pb=(H,$,A)=>{if(A===void 0)return H;let L=A(H,$);if(typeof L==="string")return L},cb=(H)=>H.endsWith(`
|
|
511
|
+
`)?H:`${H}
|
|
512
|
+
`;var MA=({type:H,verboseMessage:$,fdNumber:A,verboseInfo:L,result:D})=>{let I=ib({type:H,result:D,verboseInfo:L}),E=nb($,I),K=_7(E,L,A);if(K!=="")console.warn(K.slice(0,-1))},ib=({type:H,result:$,verboseInfo:{escapedCommand:A,commandId:L,rawOptions:{piped:D=!1,...I}}})=>({type:H,escapedCommand:A,commandId:`${L}`,timestamp:new Date,piped:D,result:$,options:I}),nb=(H,$)=>H.split(`
|
|
513
|
+
`).map((A)=>ab({...$,message:A})),ab=(H)=>{return{verboseLine:T7(H),verboseObject:H}},e4=(H)=>{let $=typeof H==="string"?H:lb(H);return qI($).replaceAll("\t"," ".repeat(tb))},tb=2;var N7=(H,$)=>{if(!VD($))return;MA({type:"command",verboseMessage:H,verboseInfo:$})};var F7=(H,$,A)=>{rb(H);let L=ob(H);return{verbose:H,escapedCommand:$,commandId:L,rawOptions:A}},ob=(H)=>VD({verbose:H})?sb++:void 0,sb=0n,rb=(H)=>{for(let $ of H){if($===!1)throw TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if($===!0)throw TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!t4.includes($)&&!a4($)){let A=t4.map((L)=>`'${L}'`).join(", ");throw TypeError(`The "verbose" option must not be ${$}. Allowed values are: ${A} or a function.`)}}};import{hrtime as O7}from"node:process";var H9=()=>O7.bigint(),AW=(H)=>Number(O7.bigint()-H)/1e6;var $9=(H,$,A)=>{let L=H9(),{command:D,escapedCommand:I}=J7(H,$),E=s2(A,"verbose"),K=F7(E,I,{...A});return N7(I,K),{command:D,escapedCommand:I,startTime:L,verboseInfo:K}};var NG=kA(YY(),1);import hu from"node:path";import _G from"node:process";import I9 from"node:process";import Q0 from"node:path";function L9(H={}){let{env:$=process.env,platform:A=process.platform}=H;if(A!=="win32")return"PATH";return Object.keys($).reverse().find((L)=>L.toUpperCase()==="PATH")||"Path"}import{promisify as wh}from"node:util";import{execFile as Rh,execFileSync as aJH}from"node:child_process";import GY from"node:path";import{fileURLToPath as jh}from"node:url";var sJH=wh(Rh);function D9(H){return H instanceof URL?jh(H):H}function UY(H){return{*[Symbol.iterator](){let $=GY.resolve(D9(H)),A;while(A!==$)yield $,A=$,$=GY.resolve($,"..")}}}var Sh=({cwd:H=I9.cwd(),path:$=I9.env[L9()],preferLocal:A=!0,execPath:L=I9.execPath,addExecPath:D=!0}={})=>{let I=Q0.resolve(D9(H)),E=[],K=$.split(Q0.delimiter);if(A)xh(E,K,I);if(D)kh(E,K,L,I);return $===""||$===Q0.delimiter?`${E.join(Q0.delimiter)}${$}`:[...E,$].join(Q0.delimiter)},xh=(H,$,A)=>{for(let L of UY(A)){let D=Q0.join(L,"node_modules/.bin");if(!$.includes(D))H.push(D)}},kh=(H,$,A,L)=>{let D=Q0.resolve(L,D9(A),"..");if(!$.includes(D))H.push(D)},VY=({env:H=I9.env,...$}={})=>{H={...H};let A=L9({env:H});return $.path=H[A],H[A]=Sh($),H};import{setTimeout as ah}from"node:timers/promises";var CY=(H,$,A)=>{let L=A?TI:B0,D=H instanceof XA?{}:{cause:H};return new L($,D)};class XA extends Error{}var zY=(H,$)=>{Object.defineProperty(H.prototype,"name",{value:$,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,qY,{value:!0,writable:!1,enumerable:!1,configurable:!1})},PY=(H)=>E9(H)&&(qY in H),qY=Symbol("isExecaError"),E9=(H)=>Object.prototype.toString.call(H)==="[object Error]";class B0 extends Error{}zY(B0,B0.name);class TI extends Error{}zY(TI,TI.name);import{constants as _I}from"node:os";import{constants as bh}from"node:os";var TY=()=>{let H=BW-_Y+1;return Array.from({length:H},yh)},yh=(H,$)=>({name:`SIGRT${$+1}`,number:_Y+$,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),_Y=34,BW=64;import{constants as fh}from"node:os";var NY=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var JW=()=>{let H=TY();return[...NY,...H].map(vh)},vh=({name:H,number:$,description:A,action:L,forced:D=!1,standard:I})=>{let{signals:{[H]:E}}=fh,K=E!==void 0;return{name:H,number:K?E:$,description:A,supported:K,action:L,forced:D,standard:I}};var hh=()=>{let H=JW();return Object.fromEntries(H.map(uh))},uh=({name:H,number:$,description:A,supported:L,action:D,forced:I,standard:E})=>[H,{name:H,number:$,description:A,supported:L,action:D,forced:I,standard:E}],FY=hh(),gh=()=>{let H=JW(),$=BW+1,A=Array.from({length:$},(L,D)=>mh(D,H));return Object.assign({},...A)},mh=(H,$)=>{let A=dh(H,$);if(A===void 0)return{};let{name:L,description:D,supported:I,action:E,forced:K,standard:M}=A;return{[H]:{name:L,number:H,description:D,supported:I,action:E,forced:K,standard:M}}},dh=(H,$)=>{let A=$.find(({name:L})=>bh.signals[L]===H);if(A!==void 0)return A;return $.find((L)=>L.number===H)},Y5H=gh();var wY=(H)=>{if(H===0)throw TypeError("Invalid option `killSignal`: 0 cannot be used.");return jY(H,"option `killSignal`")},RY=(H)=>H===0?H:jY(H,"`subprocess.kill()`'s argument"),jY=(H,$)=>{if(Number.isInteger(H))return ph(H,$);if(typeof H==="string")return lh(H,$);throw TypeError(`Invalid ${$} ${String(H)}: it must be a string or an integer.
|
|
514
|
+
${ZW()}`)},ph=(H,$)=>{if(OY.has(H))return OY.get(H);throw TypeError(`Invalid ${$} ${H}: this signal integer does not exist.
|
|
515
|
+
${ZW()}`)},ch=()=>new Map(Object.entries(_I.signals).reverse().map(([H,$])=>[$,H])),OY=ch(),lh=(H,$)=>{if(H in _I.signals)return H;if(H.toUpperCase()in _I.signals)throw TypeError(`Invalid ${$} '${H}': please rename it to '${H.toUpperCase()}'.`);throw TypeError(`Invalid ${$} '${H}': this signal name does not exist.
|
|
516
|
+
${ZW()}`)},ZW=()=>`Available signal names: ${ih()}.
|
|
517
|
+
Available signal numbers: ${nh()}.`,ih=()=>Object.keys(_I.signals).sort().map((H)=>`'${H}'`).join(", "),nh=()=>[...new Set(Object.values(_I.signals).sort((H,$)=>H-$))].join(", "),K9=(H)=>FY[H].description;var SY=(H)=>{if(H===!1)return H;if(H===!0)return th;if(!Number.isFinite(H)||H<0)throw TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${H}\` (${typeof H})`);return H},th=5000,xY=({kill:H,options:{forceKillAfterDelay:$,killSignal:A},onInternalError:L,context:D,controller:I},E,K)=>{let{signal:M,error:W}=oh(E,K,A);sh(W,L);let X=H(M);return rh({kill:H,signal:M,forceKillAfterDelay:$,killSignal:A,killResult:X,context:D,controller:I}),X},oh=(H,$,A)=>{let[L=A,D]=E9(H)?[void 0,H]:[H,$];if(typeof L!=="string"&&!Number.isInteger(L))throw TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(L)}`);if(D!==void 0&&!E9(D))throw TypeError(`The second argument is optional. If specified, it must be an error instance: ${D}`);return{signal:RY(L),error:D}},sh=(H,$)=>{if(H!==void 0)$.reject(H)},rh=async({kill:H,signal:$,forceKillAfterDelay:A,killSignal:L,killResult:D,context:I,controller:E})=>{if($===L&&D)YW({kill:H,forceKillAfterDelay:A,context:I,controllerSignal:E.signal})},YW=async({kill:H,forceKillAfterDelay:$,context:A,controllerSignal:L})=>{if($===!1)return;try{if(await ah($,void 0,{signal:L}),H("SIGKILL"))A.isForcefullyTerminated??=!0}catch{}};import{once as eh}from"node:events";var M9=async(H,$)=>{if(!H.aborted)await eh(H,"abort",{signal:$})};var kY=({cancelSignal:H})=>{if(H!==void 0&&Object.prototype.toString.call(H)!=="[object AbortSignal]")throw Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(H)}`)},yY=({subprocess:H,cancelSignal:$,gracefulCancel:A,context:L,controller:D})=>$===void 0||A?[]:[Hu(H,$,L,D)],Hu=async(H,$,A,{signal:L})=>{throw await M9($,L),A.terminationReason??="cancel",H.kill(),$.reason};import{scheduler as Pu}from"node:timers/promises";import{promisify as Vu}from"node:util";var qD=({methodName:H,isSubprocess:$,ipc:A,isConnected:L})=>{$u(H,$,A),GW(H,$,L)},$u=(H,$,A)=>{if(!A)throw Error(`${HA(H,$)} can only be used if the \`ipc\` option is \`true\`.`)},GW=(H,$,A)=>{if(!A)throw Error(`${HA(H,$)} cannot be used: the ${JL($)} has already exited or disconnected.`)},fY=(H)=>{throw Error(`${HA("getOneMessage",H)} could not complete: the ${JL(H)} exited or disconnected.`)},vY=(H)=>{throw Error(`${HA("sendMessage",H)} failed: the ${JL(H)} is sending a message too, instead of listening to incoming messages.
|
|
518
|
+
This can be fixed by both sending a message and listening to incoming messages at the same time:
|
|
519
|
+
|
|
520
|
+
const [receivedMessage] = await Promise.all([
|
|
521
|
+
${HA("getOneMessage",H)},
|
|
522
|
+
${HA("sendMessage",H,"message, {strict: true}")},
|
|
523
|
+
]);`)},X9=(H,$)=>Error(`${HA("sendMessage",$)} failed when sending an acknowledgment response to the ${JL($)}.`,{cause:H}),bY=(H)=>{throw Error(`${HA("sendMessage",H)} failed: the ${JL(H)} is not listening to incoming messages.`)},hY=(H)=>{throw Error(`${HA("sendMessage",H)} failed: the ${JL(H)} exited without listening to incoming messages.`)},uY=()=>Error(`\`cancelSignal\` aborted: the ${JL(!0)} disconnected.`),gY=()=>{throw Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},mY=({error:H,methodName:$,isSubprocess:A})=>{if(H.code==="EPIPE")throw Error(`${HA($,A)} cannot be used: the ${JL(A)} is disconnecting.`,{cause:H})},dY=({error:H,methodName:$,isSubprocess:A,message:L})=>{if(Au(H))throw Error(`${HA($,A)}'s argument type is invalid: the message cannot be serialized: ${String(L)}.`,{cause:H})},Au=({code:H,message:$})=>Lu.has(H)||Du.some((A)=>$.includes(A)),Lu=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),Du=["could not be cloned","circular structure","call stack size exceeded"],HA=(H,$,A="")=>H==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${Iu($)}${H}(${A})`,Iu=(H)=>H?"":"subprocess.",JL=(H)=>H?"parent process":"subprocess",TD=(H)=>{if(H.connected)H.disconnect()};var WA=()=>{let H={},$=new Promise((A,L)=>{Object.assign(H,{resolve:A,reject:L})});return Object.assign($,H)};var Q9=(H,$="stdin")=>{let{options:L,fileDescriptors:D}=QA.get(H),I=pY(D,$,!0),E=H.stdio[I];if(E===null)throw TypeError(cY(I,$,L,!0));return E},_D=(H,$="stdout")=>{let{options:L,fileDescriptors:D}=QA.get(H),I=pY(D,$,!1),E=I==="all"?H.all:H.stdio[I];if(E===null||E===void 0)throw TypeError(cY(I,$,L,!1));return E},QA=new WeakMap,pY=(H,$,A)=>{let L=Eu($,A);return Ku(L,$,A,H),L},Eu=(H,$)=>{let A=r2(H);if(A!==void 0)return A;let{validOptions:L,defaultValue:D}=$?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw TypeError(`"${NI($)}" must not be "${H}".
|
|
524
|
+
It must be ${L} or "fd3", "fd4" (and so on).
|
|
525
|
+
It is optional and defaults to "${D}".`)},Ku=(H,$,A,L)=>{let D=L[lY(H)];if(D===void 0)throw TypeError(`"${NI(A)}" must not be ${$}. That file descriptor does not exist.
|
|
526
|
+
Please set the "stdio" option to ensure that file descriptor exists.`);if(D.direction==="input"&&!A)throw TypeError(`"${NI(A)}" must not be ${$}. It must be a readable stream, not writable.`);if(D.direction!=="input"&&A)throw TypeError(`"${NI(A)}" must not be ${$}. It must be a writable stream, not readable.`)},cY=(H,$,A,L)=>{if(H==="all"&&!A.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:D,optionValue:I}=Mu(H,A);return`The "${D}: ${W9(I)}" option is incompatible with using "${NI(L)}: ${W9($)}".
|
|
527
|
+
Please set this option with "pipe" instead.`},Mu=(H,{stdin:$,stdout:A,stderr:L,stdio:D})=>{let I=lY(H);if(I===0&&$!==void 0)return{optionName:"stdin",optionValue:$};if(I===1&&A!==void 0)return{optionName:"stdout",optionValue:A};if(I===2&&L!==void 0)return{optionName:"stderr",optionValue:L};return{optionName:`stdio[${I}]`,optionValue:D[I]}},lY=(H)=>H==="all"?1:H,NI=(H)=>H?"to":"from",W9=(H)=>{if(typeof H==="string")return`'${H}'`;return typeof H==="number"?`${H}`:"Stream"};import{once as Zu}from"node:events";import{addAbortListener as Xu}from"node:events";var J0=(H,$,A)=>{let L=H.getMaxListeners();if(L===0||L===Number.POSITIVE_INFINITY)return;H.setMaxListeners(L+$),Xu(A,()=>{H.setMaxListeners(H.getMaxListeners()-$)})};import{EventEmitter as Bu}from"node:events";import{once as Wu}from"node:events";import{scheduler as Qu}from"node:timers/promises";var B9=(H,$)=>{if($)UW(H)},UW=(H)=>{H.refCounted()},J9=(H,$)=>{if($)VW(H)},VW=(H)=>{H.unrefCounted()},iY=(H,$)=>{if($)VW(H),VW(H)},nY=(H,$)=>{if($)UW(H),UW(H)};var aY=async({anyProcess:H,channel:$,isSubprocess:A,ipcEmitter:L},D)=>{if(sY(D)||eY(D))return;if(!Z9.has(H))Z9.set(H,[]);let I=Z9.get(H);if(I.push(D),I.length>1)return;while(I.length>0){await rY(H,L,D),await Qu.yield();let E=await oY({wrappedMessage:I[0],anyProcess:H,channel:$,isSubprocess:A,ipcEmitter:L});I.shift(),L.emit("message",E),L.emit("message:done")}},tY=async({anyProcess:H,channel:$,isSubprocess:A,ipcEmitter:L,boundOnMessage:D})=>{CW();let I=Z9.get(H);while(I?.length>0)await Wu(L,"message:done");H.removeListener("message",D),nY($,A),L.connected=!1,L.emit("disconnect")},Z9=new WeakMap;var ZL=(H,$,A)=>{if(Y9.has(H))return Y9.get(H);let L=new Bu;return L.connected=!0,Y9.set(H,L),Ju({ipcEmitter:L,anyProcess:H,channel:$,isSubprocess:A}),L},Y9=new WeakMap,Ju=({ipcEmitter:H,anyProcess:$,channel:A,isSubprocess:L})=>{let D=aY.bind(void 0,{anyProcess:$,channel:A,isSubprocess:L,ipcEmitter:H});$.on("message",D),$.once("disconnect",tY.bind(void 0,{anyProcess:$,channel:A,isSubprocess:L,ipcEmitter:H,boundOnMessage:D})),iY(A,L)},G9=(H)=>{let $=Y9.get(H);return $===void 0?H.channel!==null:$.connected};var HG=({anyProcess:H,channel:$,isSubprocess:A,message:L,strict:D})=>{if(!D)return L;let I=ZL(H,$,A),E=C9(H,I);return{id:Yu++,type:V9,message:L,hasListeners:E}},Yu=0n,$G=(H,$)=>{if($?.type!==V9||$.hasListeners)return;for(let{id:A}of H)if(A!==void 0)U9[A].resolve({isDeadlock:!0,hasListeners:!1})},oY=async({wrappedMessage:H,anyProcess:$,channel:A,isSubprocess:L,ipcEmitter:D})=>{if(H?.type!==V9||!$.connected)return H;let{id:I,message:E}=H,K={id:I,type:LG,message:C9($,D)};try{await z9({anyProcess:$,channel:A,isSubprocess:L,ipc:!0},K)}catch(M){D.emit("strict:error",M)}return E},sY=(H)=>{if(H?.type!==LG)return!1;let{id:$,message:A}=H;return U9[$]?.resolve({isDeadlock:!1,hasListeners:A}),!0},AG=async(H,$,A)=>{if(H?.type!==V9)return;let L=WA();U9[H.id]=L;let D=new AbortController;try{let{isDeadlock:I,hasListeners:E}=await Promise.race([L,Gu($,A,D)]);if(I)vY(A);if(!E)bY(A)}finally{D.abort(),delete U9[H.id]}},U9={},Gu=async(H,$,{signal:A})=>{J0(H,1,A),await Zu(H,"disconnect",{signal:A}),hY($)},V9="execa:ipc:request",LG="execa:ipc:response";var DG=(H,$,A)=>{if(!FI.has(H))FI.set(H,new Set);let L=FI.get(H),D=WA(),I=A?$.id:void 0,E={onMessageSent:D,id:I};return L.add(E),{outgoingMessages:L,outgoingMessage:E}},IG=({outgoingMessages:H,outgoingMessage:$})=>{H.delete($),$.onMessageSent.resolve()},rY=async(H,$,A)=>{while(!C9(H,$)&&FI.get(H)?.size>0){let L=[...FI.get(H)];$G(L,A),await Promise.all(L.map(({onMessageSent:D})=>D))}},FI=new WeakMap,C9=(H,$)=>$.listenerCount("message")>Uu(H),Uu=(H)=>QA.has(H)&&!fA(QA.get(H).options.buffer,"ipc")?1:0;var z9=({anyProcess:H,channel:$,isSubprocess:A,ipc:L},D,{strict:I=!1}={})=>{return qD({methodName:"sendMessage",isSubprocess:A,ipc:L,isConnected:H.connected}),Cu({anyProcess:H,channel:$,methodName:"sendMessage",isSubprocess:A,message:D,strict:I})},Cu=async({anyProcess:H,channel:$,methodName:A,isSubprocess:L,message:D,strict:I})=>{let E=HG({anyProcess:H,channel:$,isSubprocess:L,message:D,strict:I}),K=DG(H,E,I);try{await PW({anyProcess:H,methodName:A,isSubprocess:L,wrappedMessage:E,message:D})}catch(M){throw TD(H),M}finally{IG(K)}},PW=async({anyProcess:H,methodName:$,isSubprocess:A,wrappedMessage:L,message:D})=>{let I=zu(H);try{await Promise.all([AG(L,H,A),I(L)])}catch(E){throw mY({error:E,methodName:$,isSubprocess:A}),dY({error:E,methodName:$,isSubprocess:A,message:D}),E}},zu=(H)=>{if(zW.has(H))return zW.get(H);let $=Vu(H.send.bind(H));return zW.set(H,$),$},zW=new WeakMap;var KG=(H,$)=>{return GW("cancelSignal",!1,H.connected),PW({anyProcess:H,methodName:"cancelSignal",isSubprocess:!1,wrappedMessage:{type:XG,message:$},message:$})},MG=async({anyProcess:H,channel:$,isSubprocess:A,ipc:L})=>{return await qu({anyProcess:H,channel:$,isSubprocess:A,ipc:L}),qW.signal},qu=async({anyProcess:H,channel:$,isSubprocess:A,ipc:L})=>{if(EG)return;if(EG=!0,!L){gY();return}if($===null){CW();return}ZL(H,$,A),await Pu.yield()},EG=!1,eY=(H)=>{if(H?.type!==XG)return!1;return qW.abort(H.message),!0},XG="execa:ipc:cancel",CW=()=>{qW.abort(uY())},qW=new AbortController;var WG=({gracefulCancel:H,cancelSignal:$,ipc:A,serialization:L})=>{if(!H)return;if($===void 0)throw Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!A)throw Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(L==="json")throw Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")},QG=({subprocess:H,cancelSignal:$,gracefulCancel:A,forceKillAfterDelay:L,context:D,controller:I})=>A?[Tu({subprocess:H,cancelSignal:$,forceKillAfterDelay:L,context:D,controller:I})]:[],Tu=async({subprocess:H,cancelSignal:$,forceKillAfterDelay:A,context:L,controller:{signal:D}})=>{await M9($,D);let I=_u($);throw await KG(H,I),YW({kill:H.kill,forceKillAfterDelay:A,context:L,controllerSignal:D}),L.terminationReason??="gracefulCancel",$.reason},_u=({reason:H})=>{if(!(H instanceof DOMException))return H;let $=Error(H.message);return Object.defineProperty($,"stack",{value:H.stack,enumerable:!1,configurable:!0,writable:!0}),$};import{setTimeout as Nu}from"node:timers/promises";var BG=({timeout:H})=>{if(H!==void 0&&(!Number.isFinite(H)||H<0))throw TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${H}\` (${typeof H})`)},JG=(H,$,A,L)=>$===0||$===void 0?[]:[Fu(H,$,A,L)],Fu=async(H,$,A,{signal:L})=>{throw await Nu($,void 0,{signal:L}),A.terminationReason??="timeout",H.kill(),new XA};import{execPath as Ou,execArgv as wu}from"node:process";import ZG from"node:path";var YG=({options:H})=>{if(H.node===!1)throw TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...H,node:!0}}},GG=(H,$,{node:A=!1,nodePath:L=Ou,nodeOptions:D=wu.filter((M)=>!M.startsWith("--inspect")),cwd:I,execPath:E,...K})=>{if(E!==void 0)throw TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let M=UD(L,'The "nodePath" option'),W=ZG.resolve(I,M),X={...K,nodePath:W,node:A,cwd:I};if(!A)return[H,$,X];if(ZG.basename(H,".exe")==="node")throw TypeError('When the "node" option is true, the first argument does not need to be "node".');return[W,[...D,H,...$],{ipc:!0,...X,shell:!1}]};import{serialize as Ru}from"node:v8";var UG=({ipcInput:H,ipc:$,serialization:A})=>{if(H===void 0)return;if(!$)throw Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");xu[A](H)},ju=(H)=>{try{Ru(H)}catch($){throw Error("The `ipcInput` option is not serializable with a structured clone.",{cause:$})}},Su=(H)=>{try{JSON.stringify(H)}catch($){throw Error("The `ipcInput` option is not serializable with JSON.",{cause:$})}},xu={advanced:ju,json:Su},VG=async(H,$)=>{if($===void 0)return;await H.sendMessage($)};var zG=({encoding:H})=>{if(TW.has(H))return;let $=yu(H);if($!==void 0)throw TypeError(`Invalid option \`encoding: ${P9(H)}\`.
|
|
528
|
+
Please rename it to ${P9($)}.`);let A=[...TW].map((L)=>P9(L)).join(", ");throw TypeError(`Invalid option \`encoding: ${P9(H)}\`.
|
|
529
|
+
Please rename it to one of: ${A}.`)},ku=new Set(["utf8","utf16le"]),w$=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),TW=new Set([...ku,...w$]),yu=(H)=>{if(H===null)return"buffer";if(typeof H!=="string")return;let $=H.toLowerCase();if($ in CG)return CG[$];if(TW.has($))return $},CG={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},P9=(H)=>typeof H==="string"?`"${H}"`:String(H);import{statSync as fu}from"node:fs";import vu from"node:path";import bu from"node:process";var PG=(H=qG())=>{let $=UD(H,'The "cwd" option');return vu.resolve($)},qG=()=>{try{return bu.cwd()}catch(H){throw H.message=`The current directory does not exist.
|
|
530
|
+
${H.message}`,H}},TG=(H,$)=>{if($===qG())return H;let A;try{A=fu($)}catch(L){return`The "cwd" option is invalid: ${$}.
|
|
531
|
+
${L.message}
|
|
532
|
+
${H}`}if(!A.isDirectory())return`The "cwd" option is not a directory: ${$}.
|
|
533
|
+
${H}`;return H};var q9=(H,$,A)=>{A.cwd=PG(A.cwd);let[L,D,I]=GG(H,$,A),{command:E,args:K,options:M}=NG.default._parse(L,D,I),W=Q7(M),X=uu(W);if(BG(X),zG(X),UG(X),kY(X),WG(X),X.shell=a2(X.shell),X.env=gu(X),X.killSignal=wY(X.killSignal),X.forceKillAfterDelay=SY(X.forceKillAfterDelay),X.lines=X.lines.map((J,Z)=>J&&!w$.has(X.encoding)&&X.buffer[Z]),_G.platform==="win32"&&hu.basename(E,".exe")==="cmd")K.unshift("/q");return{file:E,commandArguments:K,options:X}},uu=({extendEnv:H=!0,preferLocal:$=!1,cwd:A,localDir:L=A,encoding:D="utf8",reject:I=!0,cleanup:E=!0,all:K=!1,windowsHide:M=!0,killSignal:W="SIGTERM",forceKillAfterDelay:X=!0,gracefulCancel:J=!1,ipcInput:Z,ipc:Q=Z!==void 0||J,serialization:B="advanced",...Y})=>({...Y,extendEnv:H,preferLocal:$,cwd:A,localDirectory:L,encoding:D,reject:I,cleanup:E,all:K,windowsHide:M,killSignal:W,forceKillAfterDelay:X,gracefulCancel:J,ipcInput:Z,ipc:Q,serialization:B}),gu=({env:H,extendEnv:$,preferLocal:A,node:L,localDirectory:D,nodePath:I})=>{let E=$?{..._G.env,...H}:H;if(A||L)return VY({env:E,cwd:D,execPath:I,preferLocal:A,addExecPath:L});return E};var T9=(H,$,A)=>A.shell&&$.length>0?[[H,...$].join(" "),[],A]:[H,$,A];import{inspect as zg}from"node:util";function ND(H){if(typeof H==="string")return mu(H);if(!(ArrayBuffer.isView(H)&&H.BYTES_PER_ELEMENT===1))throw Error("Input must be a string or a Uint8Array");return du(H)}var mu=(H)=>H.at(-1)===FG?H.slice(0,H.at(-2)===OG?-2:-1):H,du=(H)=>H.at(-1)===pu?H.subarray(0,H.at(-2)===cu?-2:-1):H,FG=`
|
|
534
|
+
`,pu=FG.codePointAt(0),OG="\r",cu=OG.codePointAt(0);import{on as Gg}from"node:events";import{finished as Ug}from"node:stream/promises";function $A(H,{checkOpen:$=!0}={}){return H!==null&&typeof H==="object"&&(H.writable||H.readable||!$||H.writable===void 0&&H.readable===void 0)&&typeof H.pipe==="function"}function _W(H,{checkOpen:$=!0}={}){return $A(H,{checkOpen:$})&&(H.writable||!$)&&typeof H.write==="function"&&typeof H.end==="function"&&typeof H.writable==="boolean"&&typeof H.writableObjectMode==="boolean"&&typeof H.destroy==="function"&&typeof H.destroyed==="boolean"}function Z0(H,{checkOpen:$=!0}={}){return $A(H,{checkOpen:$})&&(H.readable||!$)&&typeof H.read==="function"&&typeof H.readable==="boolean"&&typeof H.readableObjectMode==="boolean"&&typeof H.destroy==="function"&&typeof H.destroyed==="boolean"}function NW(H,$){return _W(H,$)&&Z0(H,$)}var lu=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class wG{#H;#$;#A=!1;#L=void 0;constructor(H,$){this.#H=H,this.#$=$}next(){let H=()=>this.#I();return this.#L=this.#L?this.#L.then(H,H):H(),this.#L}return(H){let $=()=>this.#D(H);return this.#L?this.#L.then($,$):$()}async#I(){if(this.#A)return{done:!0,value:void 0};let H;try{H=await this.#H.read()}catch($){throw this.#L=void 0,this.#A=!0,this.#H.releaseLock(),$}return H.done&&(this.#L=void 0,this.#A=!0,this.#H.releaseLock()),H}async#D(H){if(this.#A)return{done:!0,value:H};if(this.#A=!0,!this.#$){let $=this.#H.cancel(H);return this.#H.releaseLock(),await $,{done:!0,value:H}}return this.#H.releaseLock(),{done:!0,value:H}}}var FW=Symbol();function RG(){return this[FW].next()}Object.defineProperty(RG,"name",{value:"next"});function jG(H){return this[FW].return(H)}Object.defineProperty(jG,"name",{value:"return"});var iu=Object.create(lu,{next:{enumerable:!0,configurable:!0,writable:!0,value:RG},return:{enumerable:!0,configurable:!0,writable:!0,value:jG}});function OW({preventCancel:H=!1}={}){let $=this.getReader(),A=new wG($,H),L=Object.create(iu);return L[FW]=A,L}var SG=(H)=>{if(Z0(H,{checkOpen:!1})&&OI.on!==void 0)return au(H);if(typeof H?.[Symbol.asyncIterator]==="function")return H;if(nu.call(H)==="[object ReadableStream]")return OW.call(H);throw TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:nu}=Object.prototype,au=async function*(H){let $=new AbortController,A={};tu(H,$,A);try{for await(let[L]of OI.on(H,"data",{signal:$.signal}))yield L}catch(L){if(A.error!==void 0)throw A.error;else if(!$.signal.aborted)throw L}finally{H.destroy()}},tu=async(H,$,A)=>{try{await OI.finished(H,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(L){A.error=L}finally{$.abort()}},OI={};var FD=async(H,{init:$,convertChunk:A,getSize:L,truncateChunk:D,addChunk:I,getFinalChunk:E,finalize:K},{maxBuffer:M=Number.POSITIVE_INFINITY}={})=>{let W=SG(H),X=$();X.length=0;try{for await(let J of W){let Z=su(J),Q=A[Z](J,X);yG({convertedChunk:Q,state:X,getSize:L,truncateChunk:D,addChunk:I,maxBuffer:M})}return ou({state:X,convertChunk:A,getSize:L,truncateChunk:D,addChunk:I,getFinalChunk:E,maxBuffer:M}),K(X)}catch(J){let Z=typeof J==="object"&&J!==null?J:Error(J);throw Z.bufferedData=K(X),Z}},ou=({state:H,getSize:$,truncateChunk:A,addChunk:L,getFinalChunk:D,maxBuffer:I})=>{let E=D(H);if(E!==void 0)yG({convertedChunk:E,state:H,getSize:$,truncateChunk:A,addChunk:L,maxBuffer:I})},yG=({convertedChunk:H,state:$,getSize:A,truncateChunk:L,addChunk:D,maxBuffer:I})=>{let E=A(H),K=$.length+E;if(K<=I){xG(H,$,D,K);return}let M=L(H,I-$.length);if(M!==void 0)xG(M,$,D,I);throw new vA},xG=(H,$,A,L)=>{$.contents=A(H,$,L),$.length=L},su=(H)=>{let $=typeof H;if($==="string")return"string";if($!=="object"||H===null)return"others";if(globalThis.Buffer?.isBuffer(H))return"buffer";let A=kG.call(H);if(A==="[object ArrayBuffer]")return"arrayBuffer";if(A==="[object DataView]")return"dataView";if(Number.isInteger(H.byteLength)&&Number.isInteger(H.byteOffset)&&kG.call(H.buffer)==="[object ArrayBuffer]")return"typedArray";return"others"},{toString:kG}=Object.prototype;class vA extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}var bA=(H)=>H,wI=()=>{return},_9=({contents:H})=>H,N9=(H)=>{throw Error(`Streams in object mode are not supported: ${String(H)}`)},F9=(H)=>H.length;async function O9(H,$){return FD(H,$g,$)}var ru=()=>({contents:[]}),eu=()=>1,Hg=(H,{contents:$})=>{return $.push(H),$},$g={init:ru,convertChunk:{string:bA,buffer:bA,arrayBuffer:bA,dataView:bA,typedArray:bA,others:bA},getSize:eu,truncateChunk:wI,addChunk:Hg,getFinalChunk:wI,finalize:_9};async function w9(H,$){return FD(H,Wg,$)}var Ag=()=>({contents:new ArrayBuffer(0)}),Lg=(H)=>Dg.encode(H),Dg=new TextEncoder,fG=(H)=>new Uint8Array(H),vG=(H)=>new Uint8Array(H.buffer,H.byteOffset,H.byteLength),Ig=(H,$)=>H.slice(0,$),Eg=(H,{contents:$,length:A},L)=>{let D=uG()?Mg($,L):Kg($,L);return new Uint8Array(D).set(H,A),D},Kg=(H,$)=>{if($<=H.byteLength)return H;let A=new ArrayBuffer(hG($));return new Uint8Array(A).set(new Uint8Array(H),0),A},Mg=(H,$)=>{if($<=H.maxByteLength)return H.resize($),H;let A=new ArrayBuffer($,{maxByteLength:hG($)});return new Uint8Array(A).set(new Uint8Array(H),0),A},hG=(H)=>bG**Math.ceil(Math.log(H)/Math.log(bG)),bG=2,Xg=({contents:H,length:$})=>uG()?H:H.slice(0,$),uG=()=>("resize"in ArrayBuffer.prototype),Wg={init:Ag,convertChunk:{string:Lg,buffer:fG,arrayBuffer:fG,dataView:vG,typedArray:vG,others:N9},getSize:F9,truncateChunk:Ig,addChunk:Eg,getFinalChunk:wI,finalize:Xg};async function j9(H,$){return FD(H,Yg,$)}var Qg=()=>({contents:"",textDecoder:new TextDecoder}),R9=(H,{textDecoder:$})=>$.decode(H,{stream:!0}),Bg=(H,{contents:$})=>$+H,Jg=(H,$)=>H.slice(0,$),Zg=({textDecoder:H})=>{let $=H.decode();return $===""?void 0:$},Yg={init:Qg,convertChunk:{string:bA,buffer:R9,arrayBuffer:R9,dataView:R9,typedArray:R9,others:N9},getSize:F9,truncateChunk:Jg,addChunk:Bg,getFinalChunk:Zg,finalize:_9};Object.assign(OI,{on:Gg,finished:Ug});var gG=({error:H,stream:$,readableObjectMode:A,lines:L,encoding:D,fdNumber:I})=>{if(!(H instanceof vA))throw H;if(I==="all")return H;let E=Vg(A,L,D);throw H.maxBufferInfo={fdNumber:I,unit:E},$.destroy(),H},Vg=(H,$,A)=>{if(H)return"objects";if($)return"lines";if(A==="buffer")return"bytes";return"characters"},mG=(H,$,A)=>{if($.length!==A)return;let L=new vA;throw L.maxBufferInfo={fdNumber:"ipc"},L},dG=(H,$)=>{let{streamName:A,threshold:L,unit:D}=Cg(H,$);return`Command's ${A} was larger than ${L} ${D}`},Cg=(H,$)=>{if(H?.maxBufferInfo===void 0)return{streamName:"output",threshold:$[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:A,unit:L}}=H;delete H.maxBufferInfo;let D=fA($,A);if(A==="ipc")return{streamName:"IPC output",threshold:D,unit:"messages"};return{streamName:n4(A),threshold:D,unit:L}},pG=(H,$,A)=>H?.code==="ENOBUFS"&&$!==null&&$.some((L)=>L!==null&&L.length>S9(A)),cG=(H,$,A)=>{if(!$)return H;let L=S9(A);return H.length>L?H.slice(0,L):H},S9=([,H])=>H;var iG=({stdio:H,all:$,ipcOutput:A,originalError:L,signal:D,signalDescription:I,exitCode:E,escapedCommand:K,timedOut:M,isCanceled:W,isGracefullyCanceled:X,isMaxBuffer:J,isForcefullyTerminated:Z,forceKillAfterDelay:Q,killSignal:B,maxBuffer:Y,timeout:G,cwd:U})=>{let V=L?.code,z=Pg({originalError:L,timedOut:M,timeout:G,isMaxBuffer:J,maxBuffer:Y,errorCode:V,signal:D,signalDescription:I,exitCode:E,isCanceled:W,isGracefullyCanceled:X,isForcefullyTerminated:Z,forceKillAfterDelay:Q,killSignal:B}),P=Tg(L,U),T=P===void 0?"":`
|
|
535
|
+
${P}`,q=`${z}: ${K}${T}`,O=$===void 0?[H[2],H[1]]:[$],N=[q,...O,...H.slice(3),A.map((x)=>_g(x)).join(`
|
|
536
|
+
`)].map((x)=>qI(ND(Ng(x)))).filter(Boolean).join(`
|
|
537
|
+
|
|
538
|
+
`);return{originalMessage:P,shortMessage:q,message:N}},Pg=({originalError:H,timedOut:$,timeout:A,isMaxBuffer:L,maxBuffer:D,errorCode:I,signal:E,signalDescription:K,exitCode:M,isCanceled:W,isGracefullyCanceled:X,isForcefullyTerminated:J,forceKillAfterDelay:Z,killSignal:Q})=>{let B=qg(J,Z);if($)return`Command timed out after ${A} milliseconds${B}`;if(X){if(E===void 0)return`Command was gracefully canceled with exit code ${M}`;return J?`Command was gracefully canceled${B}`:`Command was gracefully canceled with ${E} (${K})`}if(W)return`Command was canceled${B}`;if(L)return`${dG(H,D)}${B}`;if(I!==void 0)return`Command failed with ${I}${B}`;if(J)return`Command was killed with ${Q} (${K9(Q)})${B}`;if(E!==void 0)return`Command was killed with ${E} (${K})`;if(M!==void 0)return`Command failed with exit code ${M}`;return"Command failed"},qg=(H,$)=>H?` and was forcefully terminated after ${$} milliseconds`:"",Tg=(H,$)=>{if(H instanceof XA)return;let A=PY(H)?H.originalMessage:String(H?.message??H),L=qI(TG(A,$));return L===""?void 0:L},_g=(H)=>typeof H==="string"?H:zg(H),Ng=(H)=>Array.isArray(H)?H.map(($)=>ND(lG($))).filter(Boolean).join(`
|
|
539
|
+
`):lG(H),lG=(H)=>{if(typeof H==="string")return H;if(oH(H))return l4(H);return""};var x9=({command:H,escapedCommand:$,stdio:A,all:L,ipcOutput:D,options:{cwd:I},startTime:E})=>nG({command:H,escapedCommand:$,cwd:I,durationMs:AW(E),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:A[1],stderr:A[2],all:L,stdio:A,ipcOutput:D,pipedFrom:[]}),OD=({error:H,command:$,escapedCommand:A,fileDescriptors:L,options:D,startTime:I,isSync:E})=>RI({error:H,command:$,escapedCommand:A,startTime:I,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:L.length}),ipcOutput:[],options:D,isSync:E}),RI=({error:H,command:$,escapedCommand:A,startTime:L,timedOut:D,isCanceled:I,isGracefullyCanceled:E,isMaxBuffer:K,isForcefullyTerminated:M,exitCode:W,signal:X,stdio:J,all:Z,ipcOutput:Q,options:{timeoutDuration:B,timeout:Y=B,forceKillAfterDelay:G,killSignal:U,cwd:V,maxBuffer:z},isSync:P})=>{let{exitCode:T,signal:q,signalDescription:O}=Og(W,X),{originalMessage:N,shortMessage:x,message:w}=iG({stdio:J,all:Z,ipcOutput:Q,originalError:H,signal:q,signalDescription:O,exitCode:T,escapedCommand:A,timedOut:D,isCanceled:I,isGracefullyCanceled:E,isMaxBuffer:K,isForcefullyTerminated:M,forceKillAfterDelay:G,killSignal:U,maxBuffer:z,timeout:Y,cwd:V}),F=CY(H,w,P);return Object.assign(F,Fg({error:F,command:$,escapedCommand:A,startTime:L,timedOut:D,isCanceled:I,isGracefullyCanceled:E,isMaxBuffer:K,isForcefullyTerminated:M,exitCode:T,signal:q,signalDescription:O,stdio:J,all:Z,ipcOutput:Q,cwd:V,originalMessage:N,shortMessage:x})),F},Fg=({error:H,command:$,escapedCommand:A,startTime:L,timedOut:D,isCanceled:I,isGracefullyCanceled:E,isMaxBuffer:K,isForcefullyTerminated:M,exitCode:W,signal:X,signalDescription:J,stdio:Z,all:Q,ipcOutput:B,cwd:Y,originalMessage:G,shortMessage:U})=>nG({shortMessage:U,originalMessage:G,command:$,escapedCommand:A,cwd:Y,durationMs:AW(L),failed:!0,timedOut:D,isCanceled:I,isGracefullyCanceled:E,isTerminated:X!==void 0,isMaxBuffer:K,isForcefullyTerminated:M,exitCode:W,signal:X,signalDescription:J,code:H.cause?.code,stdout:Z[1],stderr:Z[2],all:Q,stdio:Z,ipcOutput:B,pipedFrom:[]}),nG=(H)=>Object.fromEntries(Object.entries(H).filter(([,$])=>$!==void 0)),Og=(H,$)=>{let A=H===null?void 0:H,L=$===null?void 0:$,D=L===void 0?void 0:K9($);return{exitCode:A,signal:L,signalDescription:D}};var aG=(H)=>Number.isFinite(H)?H:0;function wg(H){return{days:Math.trunc(H/86400000),hours:Math.trunc(H/3600000%24),minutes:Math.trunc(H/60000%60),seconds:Math.trunc(H/1000%60),milliseconds:Math.trunc(H%1000),microseconds:Math.trunc(aG(H*1000)%1000),nanoseconds:Math.trunc(aG(H*1e6)%1000)}}function Rg(H){return{days:H/86400000n,hours:H/3600000n%24n,minutes:H/60000n%60n,seconds:H/1000n%60n,milliseconds:H%1000n,microseconds:0n,nanoseconds:0n}}function wW(H){switch(typeof H){case"number":{if(Number.isFinite(H))return wg(H);break}case"bigint":return Rg(H)}throw TypeError("Expected a finite number or bigint")}var jg=(H)=>H===0||H===0n,Sg=(H,$)=>$===1||$===1n?H:`${H}s`,xg=0.0000001,kg=24n*60n*60n*1000n;function RW(H,$){let A=typeof H==="bigint";if(!A&&!Number.isFinite(H))throw TypeError("Expected a finite number or bigint");$={...$};let L=H<0?"-":"";if(H=H<0?-H:H,$.colonNotation)$.compact=!1,$.formatSubMilliseconds=!1,$.separateMilliseconds=!1,$.verbose=!1;if($.compact)$.unitCount=1,$.secondsDecimalDigits=0,$.millisecondsDecimalDigits=0;let D=[],I=(X,J)=>{let Z=Math.floor(X*10**J+xg);return(Math.round(Z)/10**J).toFixed(J)},E=(X,J,Z,Q)=>{if((D.length===0||!$.colonNotation)&&jg(X)&&!($.colonNotation&&Z==="m"))return;if(Q??=String(X),$.colonNotation){let B=Q.includes(".")?Q.split(".")[0].length:Q.length,Y=D.length>0?2:1;Q="0".repeat(Math.max(0,Y-B))+Q}else Q+=$.verbose?" "+Sg(J,X):Z;D.push(Q)},K=wW(H),M=BigInt(K.days);if($.hideYearAndDays)E(BigInt(M)*24n+BigInt(K.hours),"hour","h");else{if($.hideYear)E(M,"day","d");else E(M/365n,"year","y"),E(M%365n,"day","d");E(Number(K.hours),"hour","h")}if(E(Number(K.minutes),"minute","m"),!$.hideSeconds)if($.separateMilliseconds||$.formatSubMilliseconds||!$.colonNotation&&H<1000&&!$.subSecondsAsDecimals){let X=Number(K.seconds),J=Number(K.milliseconds),Z=Number(K.microseconds),Q=Number(K.nanoseconds);if(E(X,"second","s"),$.formatSubMilliseconds)E(J,"millisecond","ms"),E(Z,"microsecond","µs"),E(Q,"nanosecond","ns");else{let B=J+Z/1000+Q/1e6,Y=typeof $.millisecondsDecimalDigits==="number"?$.millisecondsDecimalDigits:0,G=B>=1?Math.round(B):Math.ceil(B),U=Y?B.toFixed(Y):G;E(Number.parseFloat(U),"millisecond","ms",U)}}else{let X=(A?Number(H%kg):H)/1000%60,J=typeof $.secondsDecimalDigits==="number"?$.secondsDecimalDigits:1,Z=I(X,J),Q=$.keepDecimalsOnWholeSeconds?Z:Z.replace(/\.0+$/,"");E(Number.parseFloat(Q),"second","s",Q)}if(D.length===0)return L+"0"+($.verbose?" milliseconds":"ms");let W=$.colonNotation?":":" ";if(typeof $.unitCount==="number")D=D.slice(0,Math.max($.unitCount,1));return L+D.join(W)}var tG=(H,$)=>{if(H.failed)MA({type:"error",verboseMessage:H.shortMessage,verboseInfo:$,result:H})};var oG=(H,$)=>{if(!VD($))return;tG(H,$),yg(H,$)},yg=(H,$)=>{let A=`(done in ${RW(H.durationMs)})`;MA({type:"duration",verboseMessage:A,verboseInfo:$,result:H})};var wD=(H,$,{reject:A})=>{if(oG(H,$),H.failed&&A)throw H;return H};import{readFileSync as TU}from"node:fs";var eG=(H,$)=>{if(Y0(H))return"asyncGenerator";if(AU(H))return"generator";if(k9(H))return"fileUrl";if(ug(H))return"filePath";if(dg(H))return"webStream";if($A(H,{checkOpen:!1}))return"native";if(oH(H))return"uint8Array";if(pg(H))return"asyncIterable";if(cg(H))return"iterable";if(xW(H))return HU({transform:H},$);if(hg(H))return fg(H,$);return"native"},fg=(H,$)=>{if(NW(H.transform,{checkOpen:!1}))return vg(H,$);if(xW(H.transform))return HU(H,$);return bg(H,$)},vg=(H,$)=>{return $U(H,$,"Duplex stream"),"duplex"},HU=(H,$)=>{return $U(H,$,"web TransformStream"),"webTransform"},$U=({final:H,binary:$,objectMode:A},L,D)=>{sG(H,`${L}.final`,D),sG($,`${L}.binary`,D),jW(A,`${L}.objectMode`)},sG=(H,$,A)=>{if(H!==void 0)throw TypeError(`The \`${$}\` option can only be defined when using a generator, not a ${A}.`)},bg=({transform:H,final:$,binary:A,objectMode:L},D)=>{if(H!==void 0&&!rG(H))throw TypeError(`The \`${D}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(NW($,{checkOpen:!1}))throw TypeError(`The \`${D}.final\` option must not be a Duplex stream.`);if(xW($))throw TypeError(`The \`${D}.final\` option must not be a web TransformStream.`);if($!==void 0&&!rG($))throw TypeError(`The \`${D}.final\` option must be a generator.`);return jW(A,`${D}.binary`),jW(L,`${D}.objectMode`),Y0(H)||Y0($)?"asyncGenerator":"generator"},jW=(H,$)=>{if(H!==void 0&&typeof H!=="boolean")throw TypeError(`The \`${$}\` option must use a boolean.`)},rG=(H)=>Y0(H)||AU(H),Y0=(H)=>Object.prototype.toString.call(H)==="[object AsyncGeneratorFunction]",AU=(H)=>Object.prototype.toString.call(H)==="[object GeneratorFunction]",hg=(H)=>mH(H)&&(H.transform!==void 0||H.final!==void 0),k9=(H)=>Object.prototype.toString.call(H)==="[object URL]",LU=(H)=>k9(H)&&H.protocol!=="file:",ug=(H)=>mH(H)&&Object.keys(H).length>0&&Object.keys(H).every(($)=>gg.has($))&&SW(H.file),gg=new Set(["file","append"]),SW=(H)=>typeof H==="string",DU=(H,$)=>H==="native"&&typeof $==="string"&&!mg.has($),mg=new Set(["ipc","ignore","inherit","overlapped","pipe"]),IU=(H)=>Object.prototype.toString.call(H)==="[object ReadableStream]",y9=(H)=>Object.prototype.toString.call(H)==="[object WritableStream]",dg=(H)=>IU(H)||y9(H),xW=(H)=>IU(H?.readable)&&y9(H?.writable),pg=(H)=>EU(H)&&typeof H[Symbol.asyncIterator]==="function",cg=(H)=>EU(H)&&typeof H[Symbol.iterator]==="function",EU=(H)=>typeof H==="object"&&H!==null,g$=new Set(["generator","asyncGenerator","duplex","webTransform"]),f9=new Set(["fileUrl","filePath","fileNumber"]),kW=new Set(["fileUrl","filePath"]),KU=new Set([...kW,"webStream","nodeStream"]),MU=new Set(["webTransform","duplex"]),YL={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"};var yW=(H,$,A,L)=>L==="output"?lg(H,$,A):ig(H,$,A),lg=(H,$,A)=>{let L=$!==0&&A[$-1].value.readableObjectMode;return{writableObjectMode:L,readableObjectMode:H??L}},ig=(H,$,A)=>{let L=$===0?H===!0:A[$-1].value.readableObjectMode,D=$!==A.length-1&&(H??L);return{writableObjectMode:L,readableObjectMode:D}},XU=(H,$)=>{let A=H.findLast(({type:L})=>g$.has(L));if(A===void 0)return!1;return $==="input"?A.value.writableObjectMode:A.value.readableObjectMode};var WU=(H,$,A,L)=>[...H.filter(({type:D})=>!g$.has(D)),...ng(H,$,A,L)],ng=(H,$,A,{encoding:L})=>{let D=H.filter(({type:E})=>g$.has(E)),I=Array.from({length:D.length});for(let[E,K]of Object.entries(D))I[E]=ag({stdioItem:K,index:Number(E),newTransforms:I,optionName:$,direction:A,encoding:L});return rg(I,A)},ag=({stdioItem:H,stdioItem:{type:$},index:A,newTransforms:L,optionName:D,direction:I,encoding:E})=>{if($==="duplex")return tg({stdioItem:H,optionName:D});if($==="webTransform")return og({stdioItem:H,index:A,newTransforms:L,direction:I});return sg({stdioItem:H,index:A,newTransforms:L,direction:I,encoding:E})},tg=({stdioItem:H,stdioItem:{value:{transform:$,transform:{writableObjectMode:A,readableObjectMode:L},objectMode:D=L}},optionName:I})=>{if(D&&!L)throw TypeError(`The \`${I}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!D&&L)throw TypeError(`The \`${I}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...H,value:{transform:$,writableObjectMode:A,readableObjectMode:L}}},og=({stdioItem:H,stdioItem:{value:$},index:A,newTransforms:L,direction:D})=>{let{transform:I,objectMode:E}=mH($)?$:{transform:$},{writableObjectMode:K,readableObjectMode:M}=yW(E,A,L,D);return{...H,value:{transform:I,writableObjectMode:K,readableObjectMode:M}}},sg=({stdioItem:H,stdioItem:{value:$},index:A,newTransforms:L,direction:D,encoding:I})=>{let{transform:E,final:K,binary:M=!1,preserveNewlines:W=!1,objectMode:X}=mH($)?$:{transform:$},J=M||w$.has(I),{writableObjectMode:Z,readableObjectMode:Q}=yW(X,A,L,D);return{...H,value:{transform:E,final:K,binary:J,preserveNewlines:W,writableObjectMode:Z,readableObjectMode:Q}}},rg=(H,$)=>$==="input"?H.reverse():H;import fW from"node:process";var QU=(H,$,A)=>{let L=H.map((D)=>eg(D,$));if(L.includes("input")&&L.includes("output"))throw TypeError(`The \`${A}\` option must not be an array of both readable and writable values.`);return L.find(Boolean)??Am},eg=({type:H,value:$},A)=>Hm[A]??BU[H]($),Hm=["input","output","output"],RD=()=>{return},vW=()=>"input",BU={generator:RD,asyncGenerator:RD,fileUrl:RD,filePath:RD,iterable:vW,asyncIterable:vW,uint8Array:vW,webStream:(H)=>y9(H)?"output":"input",nodeStream(H){if(!Z0(H,{checkOpen:!1}))return"output";return _W(H,{checkOpen:!1})?void 0:"input"},webTransform:RD,duplex:RD,native(H){let $=$m(H);if($!==void 0)return $;if($A(H,{checkOpen:!1}))return BU.nodeStream(H)}},$m=(H)=>{if([0,fW.stdin].includes(H))return"input";if([1,2,fW.stdout,fW.stderr].includes(H))return"output"},Am="output";var JU=(H,$)=>$&&!H.includes("ipc")?[...H,"ipc"]:H;var ZU=({stdio:H,ipc:$,buffer:A,...L},D,I)=>{let E=Lm(H,L).map((K,M)=>YU(K,M));return I?Im(E,A,D):JU(E,$)},Lm=(H,$)=>{if(H===void 0)return u$.map((L)=>$[L]);if(Dm($))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${u$.map((L)=>`\`${L}\``).join(", ")}`);if(typeof H==="string")return[H,H,H];if(!Array.isArray(H))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof H}\``);let A=Math.max(H.length,u$.length);return Array.from({length:A},(L,D)=>H[D])},Dm=(H)=>u$.some(($)=>H[$]!==void 0),YU=(H,$)=>{if(Array.isArray(H))return H.map((A)=>YU(A,$));if(H===null||H===void 0)return $>=u$.length?"ignore":"pipe";return H},Im=(H,$,A)=>H.map((L,D)=>!$[D]&&D!==0&&!CD(A,D)&&Em(L)?"ignore":L),Em=(H)=>H==="pipe"||Array.isArray(H)&&H.every(($)=>$==="pipe");import{readFileSync as Km}from"node:fs";import Mm from"node:tty";var UU=({stdioItem:H,stdioItem:{type:$},isStdioArray:A,fdNumber:L,direction:D,isSync:I})=>{if(!A||$!=="native")return H;return I?Xm({stdioItem:H,fdNumber:L,direction:D}):Bm({stdioItem:H,fdNumber:L})},Xm=({stdioItem:H,stdioItem:{value:$,optionName:A},fdNumber:L,direction:D})=>{let I=Wm({value:$,optionName:A,fdNumber:L,direction:D});if(I!==void 0)return I;if($A($,{checkOpen:!1}))throw TypeError(`The \`${A}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return H},Wm=({value:H,optionName:$,fdNumber:A,direction:L})=>{let D=Qm(H,A);if(D===void 0)return;if(L==="output")return{type:"fileNumber",value:D,optionName:$};if(Mm.isatty(D))throw TypeError(`The \`${$}: ${W9(H)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:yA(Km(D)),optionName:$}},Qm=(H,$)=>{if(H==="inherit")return $;if(typeof H==="number")return H;let A=i4.indexOf(H);if(A!==-1)return A},Bm=({stdioItem:H,stdioItem:{value:$,optionName:A},fdNumber:L})=>{if($==="inherit")return{type:"nodeStream",value:GU(L,$,A),optionName:A};if(typeof $==="number")return{type:"nodeStream",value:GU($,$,A),optionName:A};if($A($,{checkOpen:!1}))return{type:"nodeStream",value:$,optionName:A};return H},GU=(H,$,A)=>{let L=i4[H];if(L===void 0)throw TypeError(`The \`${A}: ${$}\` option is invalid: no such standard stream.`);return L};var VU=({input:H,inputFile:$},A)=>A===0?[...Jm(H),...Ym($)]:[],Jm=(H)=>H===void 0?[]:[{type:Zm(H),value:H,optionName:"input"}],Zm=(H)=>{if(Z0(H,{checkOpen:!1}))return"nodeStream";if(typeof H==="string")return"string";if(oH(H))return"uint8Array";throw Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},Ym=(H)=>H===void 0?[]:[{...Gm(H),optionName:"inputFile"}],Gm=(H)=>{if(k9(H))return{type:"fileUrl",value:H};if(SW(H))return{type:"filePath",value:{file:H}};throw Error("The `inputFile` option must be a file path string or a file URL.")};var CU=(H)=>H.filter(($,A)=>H.every((L,D)=>$.value!==L.value||A>=D||$.type==="generator"||$.type==="asyncGenerator")),zU=({stdioItem:{type:H,value:$,optionName:A},direction:L,fileDescriptors:D,isSync:I})=>{let E=Um(D,H);if(E.length===0)return;if(I){Vm({otherStdioItems:E,type:H,value:$,optionName:A,direction:L});return}if(KU.has(H))return PU({otherStdioItems:E,type:H,value:$,optionName:A,direction:L});if(MU.has(H))zm({otherStdioItems:E,type:H,value:$,optionName:A})},Um=(H,$)=>H.flatMap(({direction:A,stdioItems:L})=>L.filter((D)=>D.type===$).map((D)=>({...D,direction:A}))),Vm=({otherStdioItems:H,type:$,value:A,optionName:L,direction:D})=>{if(kW.has($))PU({otherStdioItems:H,type:$,value:A,optionName:L,direction:D})},PU=({otherStdioItems:H,type:$,value:A,optionName:L,direction:D})=>{let I=H.filter((K)=>Cm(K,A));if(I.length===0)return;let E=I.find((K)=>K.direction!==D);return qU(E,L,$),D==="output"?I[0].stream:void 0},Cm=({type:H,value:$},A)=>{if(H==="filePath")return $.file===A.file;if(H==="fileUrl")return $.href===A.href;return $===A},zm=({otherStdioItems:H,type:$,value:A,optionName:L})=>{let D=H.find(({value:{transform:I}})=>I===A.transform);qU(D,L,$)},qU=(H,$,A)=>{if(H!==void 0)throw TypeError(`The \`${H.optionName}\` and \`${$}\` options must not target ${YL[A]} that is the same.`)};var v9=(H,$,A,L)=>{let I=ZU($,A,L).map((K,M)=>Pm({stdioOption:K,fdNumber:M,options:$,isSync:L})),E=Rm({initialFileDescriptors:I,addProperties:H,options:$,isSync:L});return $.stdio=E.map(({stdioItems:K})=>xm(K)),E},Pm=({stdioOption:H,fdNumber:$,options:A,isSync:L})=>{let D=n4($),{stdioItems:I,isStdioArray:E}=qm({stdioOption:H,fdNumber:$,options:A,optionName:D}),K=QU(I,$,D),M=I.map((J)=>UU({stdioItem:J,isStdioArray:E,fdNumber:$,direction:K,isSync:L})),W=WU(M,D,K,A),X=XU(W,K);return wm(W,X),{direction:K,objectMode:X,stdioItems:W}},qm=({stdioOption:H,fdNumber:$,options:A,optionName:L})=>{let I=[...(Array.isArray(H)?H:[H]).map((M)=>Tm(M,L)),...VU(A,$)],E=CU(I),K=E.length>1;return _m(E,K,L),Fm(E),{stdioItems:E,isStdioArray:K}},Tm=(H,$)=>({type:eG(H,$),value:H,optionName:$}),_m=(H,$,A)=>{if(H.length===0)throw TypeError(`The \`${A}\` option must not be an empty array.`);if(!$)return;for(let{value:L,optionName:D}of H)if(Nm.has(L))throw Error(`The \`${D}\` option must not include \`${L}\`.`)},Nm=new Set(["ignore","ipc"]),Fm=(H)=>{for(let $ of H)Om($)},Om=({type:H,value:$,optionName:A})=>{if(LU($))throw TypeError(`The \`${A}: URL\` option must use the \`file:\` scheme.
|
|
540
|
+
For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(DU(H,$))throw TypeError(`The \`${A}: { file: '...' }\` option must be used instead of \`${A}: '...'\`.`)},wm=(H,$)=>{if(!$)return;let A=H.find(({type:L})=>f9.has(L));if(A!==void 0)throw TypeError(`The \`${A.optionName}\` option cannot use both files and transforms in objectMode.`)},Rm=({initialFileDescriptors:H,addProperties:$,options:A,isSync:L})=>{let D=[];try{for(let I of H)D.push(jm({fileDescriptor:I,fileDescriptors:D,addProperties:$,options:A,isSync:L}));return D}catch(I){throw bW(D),I}},jm=({fileDescriptor:{direction:H,objectMode:$,stdioItems:A},fileDescriptors:L,addProperties:D,options:I,isSync:E})=>{let K=A.map((M)=>Sm({stdioItem:M,addProperties:D,direction:H,options:I,fileDescriptors:L,isSync:E}));return{direction:H,objectMode:$,stdioItems:K}},Sm=({stdioItem:H,addProperties:$,direction:A,options:L,fileDescriptors:D,isSync:I})=>{let E=zU({stdioItem:H,direction:A,fileDescriptors:D,isSync:I});if(E!==void 0)return{...H,stream:E};return{...H,...$[A][H.type](H,L)}},bW=(H)=>{for(let{stdioItems:$}of H)for(let{stream:A}of $)if(A!==void 0&&!e$(A))A.destroy()},xm=(H)=>{if(H.length>1)return H.some(({value:L})=>L==="overlapped")?"overlapped":"pipe";let[{type:$,value:A}]=H;return $==="native"?A:"pipe"};var NU=(H,$)=>v9(ym,H,$,!0),BA=({type:H,optionName:$})=>{FU($,YL[H])},km=({optionName:H,value:$})=>{if($==="ipc"||$==="overlapped")FU(H,`"${$}"`);return{}},FU=(H,$)=>{throw TypeError(`The \`${H}\` option cannot be ${$} with synchronous methods.`)},_U={generator(){},asyncGenerator:BA,webStream:BA,nodeStream:BA,webTransform:BA,duplex:BA,asyncIterable:BA,native:km},ym={input:{..._U,fileUrl:({value:H})=>({contents:[yA(TU(H))]}),filePath:({value:{file:H}})=>({contents:[yA(TU(H))]}),fileNumber:BA,iterable:({value:H})=>({contents:[...H]}),string:({value:H})=>({contents:[H]}),uint8Array:({value:H})=>({contents:[H]})},output:{..._U,fileUrl:({value:H})=>({path:H}),filePath:({value:{file:H,append:$}})=>({path:H,append:$}),fileNumber:({value:H})=>({path:H}),iterable:BA,string:BA,uint8Array:BA}};var hA=(H,{stripFinalNewline:$},A)=>hW($,A)&&H!==void 0&&!Array.isArray(H)?ND(H):H,hW=(H,$)=>$==="all"?H[1]||H[2]:H[$];import{Transform as $d,getDefaultHighWaterMark as bU}from"node:stream";var b9=(H,$,A,L)=>H||A?void 0:wU($,L),gW=(H,$,A)=>A?H.flatMap((L)=>OU(L,$)):OU(H,$),OU=(H,$)=>{let{transform:A,final:L}=wU($,{});return[...A(H),...L()]},wU=(H,$)=>{return $.previousChunks="",{transform:fm.bind(void 0,$,H),final:bm.bind(void 0,$)}},fm=function*(H,$,A){if(typeof A!=="string"){yield A;return}let{previousChunks:L}=H,D=-1;for(let I=0;I<A.length;I+=1)if(A[I]===`
|
|
541
|
+
`){let E=vm(A,I,$,H),K=A.slice(D+1,I+1-E);if(L.length>0)K=uW(L,K),L="";yield K,D=I}if(D!==A.length-1)L=uW(L,A.slice(D+1));H.previousChunks=L},vm=(H,$,A,L)=>{if(A)return 0;return L.isWindowsNewline=$!==0&&H[$-1]==="\r",L.isWindowsNewline?2:1},bm=function*({previousChunks:H}){if(H.length>0)yield H},RU=({binary:H,preserveNewlines:$,readableObjectMode:A,state:L})=>H||$||A?void 0:{transform:hm.bind(void 0,L)},hm=function*({isWindowsNewline:H=!1},$){let{unixNewline:A,windowsNewline:L,LF:D,concatBytes:I}=typeof $==="string"?um:mm;if($.at(-1)===D){yield $;return}yield I($,H?L:A)},uW=(H,$)=>`${H}${$}`,um={windowsNewline:`\r
|
|
542
|
+
`,unixNewline:`
|
|
543
|
+
`,LF:`
|
|
544
|
+
`,concatBytes:uW},gm=(H,$)=>{let A=new Uint8Array(H.length+$.length);return A.set(H,0),A.set($,H.length),A},mm={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:gm};import{Buffer as dm}from"node:buffer";var jU=(H,$)=>H?void 0:pm.bind(void 0,$),pm=function*(H,$){if(typeof $!=="string"&&!oH($)&&!dm.isBuffer($))throw TypeError(`The \`${H}\` option's transform must use "objectMode: true" to receive as input: ${typeof $}.`);yield $},SU=(H,$)=>H?cm.bind(void 0,$):lm.bind(void 0,$),cm=function*(H,$){xU(H,$),yield $},lm=function*(H,$){if(xU(H,$),typeof $!=="string"&&!oH($))throw TypeError(`The \`${H}\` option's function must yield a string or an Uint8Array, not ${typeof $}.`);yield $},xU=(H,$)=>{if($===null||$===void 0)throw TypeError(`The \`${H}\` option's function must not call \`yield ${$}\`.
|
|
545
|
+
Instead, \`yield\` should either be called with a value, or not be called at all. For example:
|
|
546
|
+
if (condition) { yield value; }`)};import{Buffer as im}from"node:buffer";import{StringDecoder as nm}from"node:string_decoder";var h9=(H,$,A)=>{if(A)return;if(H)return{transform:am.bind(void 0,new TextEncoder)};let L=new nm($);return{transform:tm.bind(void 0,L),final:om.bind(void 0,L)}},am=function*(H,$){if(im.isBuffer($))yield yA($);else if(typeof $==="string")yield H.encode($);else yield $},tm=function*(H,$){yield oH($)?H.write($):$},om=function*(H){let $=H.end();if($!=="")yield $};import{callbackify as kU}from"node:util";var mW=kU(async(H,$,A,L)=>{$.currentIterable=H(...A);try{for await(let D of $.currentIterable)L.push(D)}finally{delete $.currentIterable}}),u9=async function*(H,$,A){if(A===$.length){yield H;return}let{transform:L=rm}=$[A];for await(let D of L(H))yield*u9(D,$,A+1)},yU=async function*(H){for(let[$,{final:A}]of Object.entries(H))yield*sm(A,Number($),H)},sm=async function*(H,$,A){if(H===void 0)return;for await(let L of H())yield*u9(L,A,$+1)},fU=kU(async({currentIterable:H},$)=>{if(H!==void 0){await($?H.throw($):H.return());return}if($)throw $}),rm=function*(H){yield H};var dW=(H,$,A,L)=>{try{for(let D of H(...$))A.push(D);L()}catch(D){L(D)}},vU=(H,$)=>[...$.flatMap((A)=>[...G0(A,H,0)]),...jI(H)],G0=function*(H,$,A){if(A===$.length){yield H;return}let{transform:L=Hd}=$[A];for(let D of L(H))yield*G0(D,$,A+1)},jI=function*(H){for(let[$,{final:A}]of Object.entries(H))yield*em(A,Number($),H)},em=function*(H,$,A){if(H===void 0)return;for(let L of H())yield*G0(L,A,$+1)},Hd=function*(H){yield H};var pW=({value:H,value:{transform:$,final:A,writableObjectMode:L,readableObjectMode:D},optionName:I},{encoding:E})=>{let K={},M=hU(H,E,I),W=Y0($),X=Y0(A),J=W?mW.bind(void 0,u9,K):dW.bind(void 0,G0),Z=W||X?mW.bind(void 0,yU,K):dW.bind(void 0,jI),Q=W||X?fU.bind(void 0,K):void 0;return{stream:new $d({writableObjectMode:L,writableHighWaterMark:bU(L),readableObjectMode:D,readableHighWaterMark:bU(D),transform(Y,G,U){J([Y,M,0],this,U)},flush(Y){Z([M],this,Y)},destroy:Q})}},g9=(H,$,A,L)=>{let D=$.filter(({type:E})=>E==="generator"),I=L?D.reverse():D;for(let{value:E,optionName:K}of I){let M=hU(E,A,K);H=vU(M,H)}return H},hU=({transform:H,final:$,binary:A,writableObjectMode:L,readableObjectMode:D,preserveNewlines:I},E,K)=>{let M={};return[{transform:jU(L,K)},h9(A,E,L),b9(A,I,L,M),{transform:H,final:$},{transform:SU(D,K)},RU({binary:A,preserveNewlines:I,readableObjectMode:D,state:M})].filter(Boolean)};var uU=(H,$)=>{for(let A of Ad(H))Ld(H,A,$)},Ad=(H)=>new Set(Object.entries(H).filter(([,{direction:$}])=>$==="input").map(([$])=>Number($))),Ld=(H,$,A)=>{let{stdioItems:L}=H[$],D=L.filter(({contents:K})=>K!==void 0);if(D.length===0)return;if($!==0){let[{type:K,optionName:M}]=D;throw TypeError(`Only the \`stdin\` option, not \`${M}\`, can be ${YL[K]} with synchronous methods.`)}let E=D.map(({contents:K})=>K).map((K)=>Dd(K,L));A.input=PI(E)},Dd=(H,$)=>{let A=g9(H,$,"utf8",!0);return Id(A),PI(A)},Id=(H)=>{let $=H.find((A)=>typeof A!=="string"&&!oH(A));if($!==void 0)throw TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${$}.`)};import{writeFileSync as Xd,appendFileSync as Wd}from"node:fs";var m9=({stdioItems:H,encoding:$,verboseInfo:A,fdNumber:L})=>L!=="all"&&CD(A,L)&&!w$.has($)&&Ed(L)&&(H.some(({type:D,value:I})=>D==="native"&&Kd.has(I))||H.every(({type:D})=>g$.has(D))),Ed=(H)=>H===1||H===2,Kd=new Set(["pipe","overlapped"]),gU=async(H,$,A,L)=>{for await(let D of H)if(!Md($))dU(D,A,L)},mU=(H,$,A)=>{for(let L of H)dU(L,$,A)},Md=(H)=>H._readableState.pipes.length>0,dU=(H,$,A)=>{let L=e4(H);MA({type:"output",verboseMessage:L,fdNumber:$,verboseInfo:A})};var pU=({fileDescriptors:H,syncResult:{output:$},options:A,isMaxBuffer:L,verboseInfo:D})=>{if($===null)return{output:Array.from({length:3})};let I={},E=new Set([]);return{output:$.map((M,W)=>Qd({result:M,fileDescriptors:H,fdNumber:W,state:I,outputFiles:E,isMaxBuffer:L,verboseInfo:D},A)),...I}},Qd=({result:H,fileDescriptors:$,fdNumber:A,state:L,outputFiles:D,isMaxBuffer:I,verboseInfo:E},{buffer:K,encoding:M,lines:W,stripFinalNewline:X,maxBuffer:J})=>{if(H===null)return;let Z=cG(H,I,J),Q=yA(Z),{stdioItems:B,objectMode:Y}=$[A],G=Bd([Q],B,M,L),{serializedResult:U,finalResult:V=U}=Jd({chunks:G,objectMode:Y,encoding:M,lines:W,stripFinalNewline:X,fdNumber:A});Zd({serializedResult:U,fdNumber:A,state:L,verboseInfo:E,encoding:M,stdioItems:B,objectMode:Y});let z=K[A]?V:void 0;try{if(L.error===void 0)Yd(U,B,D);return z}catch(P){return L.error=P,z}},Bd=(H,$,A,L)=>{try{return g9(H,$,A,!1)}catch(D){return L.error=D,H}},Jd=({chunks:H,objectMode:$,encoding:A,lines:L,stripFinalNewline:D,fdNumber:I})=>{if($)return{serializedResult:H};if(A==="buffer")return{serializedResult:PI(H)};let E=D7(H,A);if(L[I])return{serializedResult:E,finalResult:gW(E,!D[I],$)};return{serializedResult:E}},Zd=({serializedResult:H,fdNumber:$,state:A,verboseInfo:L,encoding:D,stdioItems:I,objectMode:E})=>{if(!m9({stdioItems:I,encoding:D,verboseInfo:L,fdNumber:$}))return;let K=gW(H,!1,E);try{mU(K,$,L)}catch(M){A.error??=M}},Yd=(H,$,A)=>{for(let{path:L,append:D}of $.filter(({type:I})=>f9.has(I))){let I=typeof L==="string"?L:L.toString();if(D||A.has(I))Wd(L,H);else A.add(I),Xd(L,H)}};var cU=([,H,$],A)=>{if(!A.all)return;if(H===void 0)return $;if($===void 0)return H;if(Array.isArray(H))return Array.isArray($)?[...H,...$]:[...H,hA($,A,"all")];if(Array.isArray($))return[hA(H,A,"all"),...$];if(oH(H)&&oH($))return t2([H,$]);return`${H}${$}`};import{once as cW}from"node:events";var lU=async(H,$)=>{let[A,L]=await Gd(H);return $.isForcefullyTerminated??=!1,[A,L]},Gd=async(H)=>{let[$,A]=await Promise.allSettled([cW(H,"spawn"),cW(H,"exit")]);if($.status==="rejected")return[];return A.status==="rejected"?iU(H):A.value},iU=async(H)=>{try{return await cW(H,"exit")}catch{return iU(H)}},nU=async(H)=>{let[$,A]=await H;if(!Ud($,A)&&lW($,A))throw new XA;return[$,A]},Ud=(H,$)=>H===void 0&&$===void 0,lW=(H,$)=>H!==0||$!==null;var aU=({error:H,status:$,signal:A,output:L},{maxBuffer:D})=>{let I=Vd(H,$,A),E=I?.code==="ETIMEDOUT",K=pG(I,L,D);return{resultError:I,exitCode:$,signal:A,timedOut:E,isMaxBuffer:K}},Vd=(H,$,A)=>{if(H!==void 0)return H;return lW($,A)?new XA:void 0};var tU=(H,$,A)=>{let{file:L,commandArguments:D,command:I,escapedCommand:E,startTime:K,verboseInfo:M,options:W,fileDescriptors:X}=zd(H,$,A),J=Td({file:L,commandArguments:D,options:W,command:I,escapedCommand:E,verboseInfo:M,fileDescriptors:X,startTime:K});return wD(J,M,W)},zd=(H,$,A)=>{let{command:L,escapedCommand:D,startTime:I,verboseInfo:E}=$9(H,$,A),K=Pd(A),{file:M,commandArguments:W,options:X}=q9(H,$,K);qd(X);let J=NU(X,E);return{file:M,commandArguments:W,command:L,escapedCommand:D,startTime:I,verboseInfo:E,options:X,fileDescriptors:J}},Pd=(H)=>H.node&&!H.ipc?{...H,ipc:!1}:H,qd=({ipc:H,ipcInput:$,detached:A,cancelSignal:L})=>{if($)d9("ipcInput");if(H)d9("ipc: true");if(A)d9("detached: true");if(L)d9("cancelSignal")},d9=(H)=>{throw TypeError(`The "${H}" option cannot be used with synchronous methods.`)},Td=({file:H,commandArguments:$,options:A,command:L,escapedCommand:D,verboseInfo:I,fileDescriptors:E,startTime:K})=>{let M=_d({file:H,commandArguments:$,options:A,command:L,escapedCommand:D,fileDescriptors:E,startTime:K});if(M.failed)return M;let{resultError:W,exitCode:X,signal:J,timedOut:Z,isMaxBuffer:Q}=aU(M,A),{output:B,error:Y=W}=pU({fileDescriptors:E,syncResult:M,options:A,isMaxBuffer:Q,verboseInfo:I}),G=B.map((V,z)=>hA(V,A,z)),U=hA(cU(B,A),A,"all");return Fd({error:Y,exitCode:X,signal:J,timedOut:Z,isMaxBuffer:Q,stdio:G,all:U,options:A,command:L,escapedCommand:D,startTime:K})},_d=({file:H,commandArguments:$,options:A,command:L,escapedCommand:D,fileDescriptors:I,startTime:E})=>{try{uU(I,A);let K=Nd(A);return Cd(...T9(H,$,K))}catch(K){return OD({error:K,command:L,escapedCommand:D,fileDescriptors:I,options:A,startTime:E,isSync:!0})}},Nd=({encoding:H,maxBuffer:$,...A})=>({...A,encoding:"buffer",maxBuffer:S9($)}),Fd=({error:H,exitCode:$,signal:A,timedOut:L,isMaxBuffer:D,stdio:I,all:E,options:K,command:M,escapedCommand:W,startTime:X})=>H===void 0?x9({command:M,escapedCommand:W,stdio:I,all:E,ipcOutput:[],options:K,startTime:X}):RI({error:H,command:M,escapedCommand:W,timedOut:L,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:D,isForcefullyTerminated:!1,exitCode:$,signal:A,stdio:I,all:E,ipcOutput:[],options:K,startTime:X,isSync:!0});import{setMaxListeners as Jc}from"node:events";import{spawn as Zc}from"node:child_process";import HV from"node:process";import{once as iW,on as Od}from"node:events";var oU=({anyProcess:H,channel:$,isSubprocess:A,ipc:L},{reference:D=!0,filter:I}={})=>{return qD({methodName:"getOneMessage",isSubprocess:A,ipc:L,isConnected:G9(H)}),wd({anyProcess:H,channel:$,isSubprocess:A,filter:I,reference:D})},wd=async({anyProcess:H,channel:$,isSubprocess:A,filter:L,reference:D})=>{B9($,D);let I=ZL(H,$,A),E=new AbortController;try{return await Promise.race([Rd(I,L,E),jd(I,A,E),Sd(I,A,E)])}catch(K){throw TD(H),K}finally{E.abort(),J9($,D)}},Rd=async(H,$,{signal:A})=>{if($===void 0){let[L]=await iW(H,"message",{signal:A});return L}for await(let[L]of Od(H,"message",{signal:A}))if($(L))return L},jd=async(H,$,{signal:A})=>{await iW(H,"disconnect",{signal:A}),fY($)},Sd=async(H,$,{signal:A})=>{let[L]=await iW(H,"strict:error",{signal:A});throw X9(L,$)};import{once as rU,on as xd}from"node:events";var eU=({anyProcess:H,channel:$,isSubprocess:A,ipc:L},{reference:D=!0}={})=>nW({anyProcess:H,channel:$,isSubprocess:A,ipc:L,shouldAwait:!A,reference:D}),nW=({anyProcess:H,channel:$,isSubprocess:A,ipc:L,shouldAwait:D,reference:I})=>{qD({methodName:"getEachMessage",isSubprocess:A,ipc:L,isConnected:G9(H)}),B9($,I);let E=ZL(H,$,A),K=new AbortController,M={};return kd(H,E,K),yd({ipcEmitter:E,isSubprocess:A,controller:K,state:M}),fd({anyProcess:H,channel:$,ipcEmitter:E,isSubprocess:A,shouldAwait:D,controller:K,state:M,reference:I})},kd=async(H,$,A)=>{try{await rU($,"disconnect",{signal:A.signal}),A.abort()}catch{}},yd=async({ipcEmitter:H,isSubprocess:$,controller:A,state:L})=>{try{let[D]=await rU(H,"strict:error",{signal:A.signal});L.error=X9(D,$),A.abort()}catch{}},fd=async function*({anyProcess:H,channel:$,ipcEmitter:A,isSubprocess:L,shouldAwait:D,controller:I,state:E,reference:K}){try{for await(let[M]of xd(A,"message",{signal:I.signal}))sU(E),yield M}catch{sU(E)}finally{if(I.abort(),J9($,K),!L)TD(H);if(D)await H}},sU=({error:H})=>{if(H)throw H};var $V=(H,{ipc:$})=>{Object.assign(H,LV(H,!1,$))},AV=()=>{let H=HV,$=!0,A=HV.channel!==void 0;return{...LV(H,!0,A),getCancelSignal:MG.bind(void 0,{anyProcess:H,channel:H.channel,isSubprocess:!0,ipc:A})}},LV=(H,$,A)=>({sendMessage:z9.bind(void 0,{anyProcess:H,channel:H.channel,isSubprocess:$,ipc:A}),getOneMessage:oU.bind(void 0,{anyProcess:H,channel:H.channel,isSubprocess:$,ipc:A}),getEachMessage:eU.bind(void 0,{anyProcess:H,channel:H.channel,isSubprocess:$,ipc:A})});import{ChildProcess as vd}from"node:child_process";import{PassThrough as bd,Readable as hd,Writable as ud,Duplex as gd}from"node:stream";var DV=({error:H,command:$,escapedCommand:A,fileDescriptors:L,options:D,startTime:I,verboseInfo:E})=>{bW(L);let K=new vd;md(K,L),Object.assign(K,{readable:dd,writable:pd,duplex:cd});let M=OD({error:H,command:$,escapedCommand:A,fileDescriptors:L,options:D,startTime:I,isSync:!1}),W=ld(M,E,D);return{subprocess:K,promise:W}},md=(H,$)=>{let A=SI(),L=SI(),D=SI(),I=Array.from({length:$.length-3},SI),E=SI(),K=[A,L,D,...I];Object.assign(H,{stdin:A,stdout:L,stderr:D,all:E,stdio:K})},SI=()=>{let H=new bd;return H.end(),H},dd=()=>new hd({read(){}}),pd=()=>new ud({write(){}}),cd=()=>new gd({read(){},write(){}}),ld=async(H,$,A)=>wD(H,$,A);import{createReadStream as IV,createWriteStream as EV}from"node:fs";import{Buffer as id}from"node:buffer";import{Readable as xI,Writable as nd,Duplex as ad}from"node:stream";var MV=(H,$)=>v9(td,H,$,!1),kI=({type:H,optionName:$})=>{throw TypeError(`The \`${$}\` option cannot be ${YL[H]}.`)},KV={fileNumber:kI,generator:pW,asyncGenerator:pW,nodeStream:({value:H})=>({stream:H}),webTransform({value:{transform:H,writableObjectMode:$,readableObjectMode:A}}){let L=$||A;return{stream:ad.fromWeb(H,{objectMode:L})}},duplex:({value:{transform:H}})=>({stream:H}),native(){}},td={input:{...KV,fileUrl:({value:H})=>({stream:IV(H)}),filePath:({value:{file:H}})=>({stream:IV(H)}),webStream:({value:H})=>({stream:xI.fromWeb(H)}),iterable:({value:H})=>({stream:xI.from(H)}),asyncIterable:({value:H})=>({stream:xI.from(H)}),string:({value:H})=>({stream:xI.from(H)}),uint8Array:({value:H})=>({stream:xI.from(id.from(H))})},output:{...KV,fileUrl:({value:H})=>({stream:EV(H)}),filePath:({value:{file:H,append:$}})=>({stream:EV(H,$?{flags:"a"}:{})}),webStream:({value:H})=>({stream:nd.fromWeb(H)}),iterable:kI,asyncIterable:kI,string:kI,uint8Array:kI}};import{on as od,once as XV}from"node:events";import{PassThrough as sd,getDefaultHighWaterMark as rd}from"node:stream";import{finished as BV}from"node:stream/promises";function U0(H){if(!Array.isArray(H))throw TypeError(`Expected an array, got \`${typeof H}\`.`);for(let D of H)aW(D);let $=H.some(({readableObjectMode:D})=>D),A=ed(H,$),L=new JV({objectMode:$,writableHighWaterMark:A,readableHighWaterMark:A});for(let D of H)L.add(D);return L}var ed=(H,$)=>{if(H.length===0)return rd($);let A=H.filter(({readableObjectMode:L})=>L===$).map(({readableHighWaterMark:L})=>L);return Math.max(...A)};class JV extends sd{#H=new Set([]);#$=new Set([]);#A=new Set([]);#L;#I=Symbol("unpipe");#D=new WeakMap;add(H){if(aW(H),this.#H.has(H))return;this.#H.add(H),this.#L??=Hp(this,this.#H,this.#I);let $=Lp({passThroughStream:this,stream:H,streams:this.#H,ended:this.#$,aborted:this.#A,onFinished:this.#L,unpipeEvent:this.#I});this.#D.set(H,$),H.pipe(this,{end:!1})}async remove(H){if(aW(H),!this.#H.has(H))return!1;let $=this.#D.get(H);if($===void 0)return!1;return this.#D.delete(H),H.unpipe(this),await $,!0}}var Hp=async(H,$,A)=>{p9(H,WV);let L=new AbortController;try{await Promise.race([$p(H,L),Ap(H,$,A,L)])}finally{L.abort(),p9(H,-WV)}},$p=async(H,{signal:$})=>{try{await BV(H,{signal:$,cleanup:!0})}catch(A){throw ZV(H,A),A}},Ap=async(H,$,A,{signal:L})=>{for await(let[D]of od(H,"unpipe",{signal:L}))if($.has(D))D.emit(A)},aW=(H)=>{if(typeof H?.pipe!=="function")throw TypeError(`Expected a readable stream, got: \`${typeof H}\`.`)},Lp=async({passThroughStream:H,stream:$,streams:A,ended:L,aborted:D,onFinished:I,unpipeEvent:E})=>{p9(H,QV);let K=new AbortController;try{await Promise.race([Dp(I,$,K),Ip({passThroughStream:H,stream:$,streams:A,ended:L,aborted:D,controller:K}),Ep({stream:$,streams:A,ended:L,aborted:D,unpipeEvent:E,controller:K})])}finally{K.abort(),p9(H,-QV)}if(A.size>0&&A.size===L.size+D.size)if(L.size===0&&D.size>0)tW(H);else Kp(H)},Dp=async(H,$,{signal:A})=>{try{if(await H,!A.aborted)tW($)}catch(L){if(!A.aborted)ZV($,L)}},Ip=async({passThroughStream:H,stream:$,streams:A,ended:L,aborted:D,controller:{signal:I}})=>{try{if(await BV($,{signal:I,cleanup:!0,readable:!0,writable:!1}),A.has($))L.add($)}catch(E){if(I.aborted||!A.has($))return;if(YV(E))D.add($);else GV(H,E)}},Ep=async({stream:H,streams:$,ended:A,aborted:L,unpipeEvent:D,controller:{signal:I}})=>{if(await XV(H,D,{signal:I}),!H.readable)return XV(I,"abort",{signal:I});$.delete(H),A.delete(H),L.delete(H)},Kp=(H)=>{if(H.writable)H.end()},ZV=(H,$)=>{if(YV($))tW(H);else GV(H,$)},YV=(H)=>H?.code==="ERR_STREAM_PREMATURE_CLOSE",tW=(H)=>{if(H.readable||H.writable)H.destroy()},GV=(H,$)=>{if(!H.destroyed)H.once("error",Mp),H.destroy($)},Mp=()=>{},p9=(H,$)=>{let A=H.getMaxListeners();if(A!==0&&A!==Number.POSITIVE_INFINITY)H.setMaxListeners(A+$)},WV=2,QV=1;import{finished as UV}from"node:stream/promises";var jD=(H,$)=>{H.pipe($),Xp(H,$),Wp(H,$)},Xp=async(H,$)=>{if(e$(H)||e$($))return;try{await UV(H,{cleanup:!0,readable:!0,writable:!1})}catch{}oW($)},oW=(H)=>{if(H.writable)H.end()},Wp=async(H,$)=>{if(e$(H)||e$($))return;try{await UV($,{cleanup:!0,readable:!1,writable:!0})}catch{}sW(H)},sW=(H)=>{if(H.readable)H.destroy()};var VV=(H,$,A)=>{let L=new Map;for(let[D,{stdioItems:I,direction:E}]of Object.entries($)){for(let{stream:K}of I.filter(({type:M})=>g$.has(M)))Qp(H,K,E,D);for(let{stream:K}of I.filter(({type:M})=>!g$.has(M)))Jp({subprocess:H,stream:K,direction:E,fdNumber:D,pipeGroups:L,controller:A})}for(let[D,I]of L.entries()){let E=I.length===1?I[0]:U0(I);jD(E,D)}},Qp=(H,$,A,L)=>{if(A==="output")jD(H.stdio[L],$);else jD($,H.stdio[L]);let D=Bp[L];if(D!==void 0)H[D]=$;H.stdio[L]=$},Bp=["stdin","stdout","stderr"],Jp=({subprocess:H,stream:$,direction:A,fdNumber:L,pipeGroups:D,controller:I})=>{if($===void 0)return;Zp($,I);let[E,K]=A==="output"?[$,H.stdio[L]]:[H.stdio[L],$],M=D.get(E)??[];D.set(E,[...M,K])},Zp=(H,{signal:$})=>{if(e$(H))J0(H,Yp,$)},Yp=2;import{addAbortListener as Vp}from"node:events";var V0=[];V0.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")V0.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")V0.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var c9=(H)=>!!H&&typeof H==="object"&&typeof H.removeListener==="function"&&typeof H.emit==="function"&&typeof H.reallyExit==="function"&&typeof H.listeners==="function"&&typeof H.kill==="function"&&typeof H.pid==="number"&&typeof H.on==="function",rW=Symbol.for("signal-exit emitter"),eW=globalThis,Gp=Object.defineProperty.bind(Object);class CV{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(eW[rW])return eW[rW];Gp(eW,rW,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(H,$){this.listeners[H].push($)}removeListener(H,$){let A=this.listeners[H],L=A.indexOf($);if(L===-1)return;if(L===0&&A.length===1)A.length=0;else A.splice(L,1)}emit(H,$,A){if(this.emitted[H])return!1;this.emitted[H]=!0;let L=!1;for(let D of this.listeners[H])L=D($,A)===!0||L;if(H==="exit")L=this.emit("afterExit",$,A)||L;return L}}class $Q{}var Up=(H)=>{return{onExit($,A){return H.onExit($,A)},load(){return H.load()},unload(){return H.unload()}}};class zV extends $Q{onExit(){return()=>{}}load(){}unload(){}}class PV extends $Q{#H=HQ.platform==="win32"?"SIGINT":"SIGHUP";#$=new CV;#A;#L;#I;#D={};#E=!1;constructor(H){super();this.#A=H,this.#D={};for(let $ of V0)this.#D[$]=()=>{let A=this.#A.listeners($),{count:L}=this.#$,D=H;if(typeof D.__signal_exit_emitter__==="object"&&typeof D.__signal_exit_emitter__.count==="number")L+=D.__signal_exit_emitter__.count;if(A.length===L){this.unload();let I=this.#$.emit("exit",null,$),E=$==="SIGHUP"?this.#H:$;if(!I)H.kill(H.pid,E)}};this.#I=H.reallyExit,this.#L=H.emit}onExit(H,$){if(!c9(this.#A))return()=>{};if(this.#E===!1)this.load();let A=$?.alwaysLast?"afterExit":"exit";return this.#$.on(A,H),()=>{if(this.#$.removeListener(A,H),this.#$.listeners.exit.length===0&&this.#$.listeners.afterExit.length===0)this.unload()}}load(){if(this.#E)return;this.#E=!0,this.#$.count+=1;for(let H of V0)try{let $=this.#D[H];if($)this.#A.on(H,$)}catch($){}this.#A.emit=(H,...$)=>{return this.#M(H,...$)},this.#A.reallyExit=(H)=>{return this.#K(H)}}unload(){if(!this.#E)return;this.#E=!1,V0.forEach((H)=>{let $=this.#D[H];if(!$)throw Error("Listener not defined for signal: "+H);try{this.#A.removeListener(H,$)}catch(A){}}),this.#A.emit=this.#L,this.#A.reallyExit=this.#I,this.#$.count-=1}#K(H){if(!c9(this.#A))return 0;return this.#A.exitCode=H||0,this.#$.emit("exit",this.#A.exitCode,null),this.#I.call(this.#A,this.#A.exitCode)}#M(H,...$){let A=this.#L;if(H==="exit"&&c9(this.#A)){if(typeof $[0]==="number")this.#A.exitCode=$[0];let L=A.call(this.#A,H,...$);return this.#$.emit("exit",this.#A.exitCode,null),L}else return A.call(this.#A,H,...$)}}var HQ=globalThis.process,{onExit:qV,load:rGH,unload:eGH}=Up(c9(HQ)?new PV(HQ):new zV);var TV=(H,{cleanup:$,detached:A},{signal:L})=>{if(!$||A)return;let D=qV(()=>{H.kill()});Vp(L,()=>{D()})};var NV=({source:H,sourcePromise:$,boundOptions:A,createNested:L},...D)=>{let I=H9(),{destination:E,destinationStream:K,destinationError:M,from:W,unpipeSignal:X}=Cp(A,L,D),{sourceStream:J,sourceError:Z}=Pp(H,W),{options:Q,fileDescriptors:B}=QA.get(H);return{sourcePromise:$,sourceStream:J,sourceOptions:Q,sourceError:Z,destination:E,destinationStream:K,destinationError:M,unpipeSignal:X,fileDescriptors:B,startTime:I}},Cp=(H,$,A)=>{try{let{destination:L,pipeOptions:{from:D,to:I,unpipeSignal:E}={}}=zp(H,$,...A),K=Q9(L,I);return{destination:L,destinationStream:K,from:D,unpipeSignal:E}}catch(L){return{destinationError:L}}},zp=(H,$,A,...L)=>{if(Array.isArray(A))return{destination:$(_V,H)(A,...L),pipeOptions:H};if(typeof A==="string"||A instanceof URL||n2(A)){if(Object.keys(H).length>0)throw TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[D,I,E]=c4(A,...L);return{destination:$(_V)(D,I,E),pipeOptions:E}}if(QA.has(A)){if(Object.keys(H).length>0)throw TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:A,pipeOptions:L[0]}}throw TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${A}`)},_V=({options:H})=>({options:{...H,stdin:"pipe",piped:!0}}),Pp=(H,$)=>{try{return{sourceStream:_D(H,$)}}catch(A){return{sourceError:A}}};var OV=({sourceStream:H,sourceError:$,destinationStream:A,destinationError:L,fileDescriptors:D,sourceOptions:I,startTime:E})=>{let K=qp({sourceStream:H,sourceError:$,destinationStream:A,destinationError:L});if(K!==void 0)throw AQ({error:K,fileDescriptors:D,sourceOptions:I,startTime:E})},qp=({sourceStream:H,sourceError:$,destinationStream:A,destinationError:L})=>{if($!==void 0&&L!==void 0)return L;if(L!==void 0)return sW(H),L;if($!==void 0)return oW(A),$},AQ=({error:H,fileDescriptors:$,sourceOptions:A,startTime:L})=>OD({error:H,command:FV,escapedCommand:FV,fileDescriptors:$,options:A,startTime:L,isSync:!1}),FV="source.pipe(destination)";var wV=async(H)=>{let[{status:$,reason:A,value:L=A},{status:D,reason:I,value:E=I}]=await H;if(!E.pipedFrom.includes(L))E.pipedFrom.push(L);if(D==="rejected")throw E;if($==="rejected")throw L;return E};import{finished as Tp}from"node:stream/promises";var RV=(H,$,A)=>{let L=l9.has($)?Np(H,$):_p(H,$);return J0(H,Op,A.signal),J0($,wp,A.signal),Fp($),L},_p=(H,$)=>{let A=U0([H]);return jD(A,$),l9.set($,A),A},Np=(H,$)=>{let A=l9.get($);return A.add(H),A},Fp=async(H)=>{try{await Tp(H,{cleanup:!0,readable:!1,writable:!0})}catch{}l9.delete(H)},l9=new WeakMap,Op=2,wp=1;import{aborted as Rp}from"node:util";var jV=(H,$)=>H===void 0?[]:[jp(H,$)],jp=async(H,{sourceStream:$,mergedStream:A,fileDescriptors:L,sourceOptions:D,startTime:I})=>{await Rp(H,$),await A.remove($);let E=Error("Pipe canceled by `unpipeSignal` option.");throw AQ({error:E,fileDescriptors:L,sourceOptions:D,startTime:I})};var i9=(H,...$)=>{if(mH($[0]))return i9.bind(void 0,{...H,boundOptions:{...H.boundOptions,...$[0]}});let{destination:A,...L}=NV(H,...$),D=Sp({...L,destination:A});return D.pipe=i9.bind(void 0,{...H,source:A,sourcePromise:D,boundOptions:{}}),D},Sp=async({sourcePromise:H,sourceStream:$,sourceOptions:A,sourceError:L,destination:D,destinationStream:I,destinationError:E,unpipeSignal:K,fileDescriptors:M,startTime:W})=>{let X=xp(H,D);OV({sourceStream:$,sourceError:L,destinationStream:I,destinationError:E,fileDescriptors:M,sourceOptions:A,startTime:W});let J=new AbortController;try{let Z=RV($,I,J);return await Promise.race([wV(X),...jV(K,{sourceStream:$,mergedStream:Z,sourceOptions:A,fileDescriptors:M,startTime:W})])}finally{J.abort()}},xp=(H,$)=>Promise.allSettled([H,$]);import{setImmediate as up}from"node:timers/promises";import{on as kp}from"node:events";import{getDefaultHighWaterMark as yp}from"node:stream";var n9=({subprocessStdout:H,subprocess:$,binary:A,shouldEncode:L,encoding:D,preserveNewlines:I})=>{let E=new AbortController;return fp($,E),xV({stream:H,controller:E,binary:A,shouldEncode:!H.readableObjectMode&&L,encoding:D,shouldSplit:!H.readableObjectMode,preserveNewlines:I})},fp=async(H,$)=>{try{await H}catch{}finally{$.abort()}},LQ=({stream:H,onStreamEnd:$,lines:A,encoding:L,stripFinalNewline:D,allMixed:I})=>{let E=new AbortController;vp($,E,H);let K=H.readableObjectMode&&!I;return xV({stream:H,controller:E,binary:L==="buffer",shouldEncode:!K,encoding:L,shouldSplit:!K&&A,preserveNewlines:!D})},vp=async(H,$,A)=>{try{await H}catch{A.destroy()}finally{$.abort()}},xV=({stream:H,controller:$,binary:A,shouldEncode:L,encoding:D,shouldSplit:I,preserveNewlines:E})=>{let K=kp(H,"data",{signal:$.signal,highWaterMark:SV,highWatermark:SV});return bp({onStdoutChunk:K,controller:$,binary:A,shouldEncode:L,encoding:D,shouldSplit:I,preserveNewlines:E})},DQ=yp(!0),SV=DQ,bp=async function*({onStdoutChunk:H,controller:$,binary:A,shouldEncode:L,encoding:D,shouldSplit:I,preserveNewlines:E}){let K=hp({binary:A,shouldEncode:L,encoding:D,shouldSplit:I,preserveNewlines:E});try{for await(let[M]of H)yield*G0(M,K,0)}catch(M){if(!$.signal.aborted)throw M}finally{yield*jI(K)}},hp=({binary:H,shouldEncode:$,encoding:A,shouldSplit:L,preserveNewlines:D})=>[h9(H,A,!$),b9(H,D,!L,{})].filter(Boolean);var kV=async({stream:H,onStreamEnd:$,fdNumber:A,encoding:L,buffer:D,maxBuffer:I,lines:E,allMixed:K,stripFinalNewline:M,verboseInfo:W,streamInfo:X})=>{let J=gp({stream:H,onStreamEnd:$,fdNumber:A,encoding:L,allMixed:K,verboseInfo:W,streamInfo:X});if(!D){await Promise.all([mp(H),J]);return}let Z=hW(M,A),Q=LQ({stream:H,onStreamEnd:$,lines:E,encoding:L,stripFinalNewline:Z,allMixed:K}),[B]=await Promise.all([dp({stream:H,iterable:Q,fdNumber:A,encoding:L,maxBuffer:I,lines:E}),J]);return B},gp=async({stream:H,onStreamEnd:$,fdNumber:A,encoding:L,allMixed:D,verboseInfo:I,streamInfo:{fileDescriptors:E}})=>{if(!m9({stdioItems:E[A]?.stdioItems,encoding:L,verboseInfo:I,fdNumber:A}))return;let K=LQ({stream:H,onStreamEnd:$,lines:!0,encoding:L,stripFinalNewline:!0,allMixed:D});await gU(K,H,A,I)},mp=async(H)=>{if(await up(),H.readableFlowing===null)H.resume()},dp=async({stream:H,stream:{readableObjectMode:$},iterable:A,fdNumber:L,encoding:D,maxBuffer:I,lines:E})=>{try{if($||E)return await O9(A,{maxBuffer:I});if(D==="buffer")return new Uint8Array(await w9(A,{maxBuffer:I}));return await j9(A,{maxBuffer:I})}catch(K){return yV(gG({error:K,stream:H,readableObjectMode:$,lines:E,encoding:D,fdNumber:L}))}},IQ=async(H)=>{try{return await H}catch($){return yV($)}},yV=({bufferedData:H})=>A7(H)?new Uint8Array(H):H;import{finished as pp}from"node:stream/promises";var yI=async(H,$,A,{isSameDirection:L,stopOnExit:D=!1}={})=>{let I=cp(H,A),E=new AbortController;try{await Promise.race([...D?[A.exitPromise]:[],pp(H,{cleanup:!0,signal:E.signal})])}catch(K){if(!I.stdinCleanedUp)np(K,$,A,L)}finally{E.abort()}},cp=(H,{originalStreams:[$],subprocess:A})=>{let L={stdinCleanedUp:!1};if(H===$)lp(H,A,L);return L},lp=(H,$,A)=>{let{_destroy:L}=H;H._destroy=(...D)=>{ip($,A),L.call(H,...D)}},ip=({exitCode:H,signalCode:$},A)=>{if(H!==null||$!==null)A.stdinCleanedUp=!0},np=(H,$,A,L)=>{if(!ap(H,$,A,L))throw H},ap=(H,$,A,L=!0)=>{if(A.propagating)return fV(H)||a9(H);return A.propagating=!0,EQ(A,$)===L?fV(H):a9(H)},EQ=({fileDescriptors:H},$)=>$!=="all"&&H[$].direction==="input",a9=(H)=>H?.code==="ERR_STREAM_PREMATURE_CLOSE",fV=(H)=>H?.code==="EPIPE";var vV=({subprocess:H,encoding:$,buffer:A,maxBuffer:L,lines:D,stripFinalNewline:I,verboseInfo:E,streamInfo:K})=>H.stdio.map((M,W)=>KQ({stream:M,fdNumber:W,encoding:$,buffer:A[W],maxBuffer:L[W],lines:D[W],allMixed:!1,stripFinalNewline:I,verboseInfo:E,streamInfo:K})),KQ=async({stream:H,fdNumber:$,encoding:A,buffer:L,maxBuffer:D,lines:I,allMixed:E,stripFinalNewline:K,verboseInfo:M,streamInfo:W})=>{if(!H)return;let X=yI(H,$,W);if(EQ(W,$)){await X;return}let[J]=await Promise.all([kV({stream:H,onStreamEnd:X,fdNumber:$,encoding:A,buffer:L,maxBuffer:D,lines:I,allMixed:E,stripFinalNewline:K,verboseInfo:M,streamInfo:W}),X]);return J};var bV=({stdout:H,stderr:$},{all:A})=>A&&(H||$)?U0([H,$].filter(Boolean)):void 0,hV=({subprocess:H,encoding:$,buffer:A,maxBuffer:L,lines:D,stripFinalNewline:I,verboseInfo:E,streamInfo:K})=>KQ({...tp(H,A),fdNumber:"all",encoding:$,maxBuffer:L[1]+L[2],lines:D[1]||D[2],allMixed:op(H),stripFinalNewline:I,verboseInfo:E,streamInfo:K}),tp=({stdout:H,stderr:$,all:A},[,L,D])=>{let I=L||D;if(!I)return{stream:A,buffer:I};if(!L)return{stream:$,buffer:I};if(!D)return{stream:H,buffer:I};return{stream:A,buffer:I}},op=({all:H,stdout:$,stderr:A})=>H&&$&&A&&$.readableObjectMode!==A.readableObjectMode;import{once as sp}from"node:events";var uV=(H)=>CD(H,"ipc"),gV=(H,$)=>{let A=e4(H);MA({type:"ipc",verboseMessage:A,fdNumber:"ipc",verboseInfo:$})};var mV=async({subprocess:H,buffer:$,maxBuffer:A,ipc:L,ipcOutput:D,verboseInfo:I})=>{if(!L)return D;let E=uV(I),K=fA($,"ipc"),M=fA(A,"ipc");for await(let W of nW({anyProcess:H,channel:H.channel,isSubprocess:!1,ipc:L,shouldAwait:!1,reference:!0})){if(K)mG(H,D,M),D.push(W);if(E)gV(W,I)}return D},dV=async(H,$)=>{return await Promise.allSettled([H]),$};var pV=async({subprocess:H,options:{encoding:$,buffer:A,maxBuffer:L,lines:D,timeoutDuration:I,cancelSignal:E,gracefulCancel:K,forceKillAfterDelay:M,stripFinalNewline:W,ipc:X,ipcInput:J},context:Z,verboseInfo:Q,fileDescriptors:B,originalStreams:Y,onInternalError:G,controller:U})=>{let V=lU(H,Z),z={originalStreams:Y,fileDescriptors:B,subprocess:H,exitPromise:V,propagating:!1},P=vV({subprocess:H,encoding:$,buffer:A,maxBuffer:L,lines:D,stripFinalNewline:W,verboseInfo:Q,streamInfo:z}),T=hV({subprocess:H,encoding:$,buffer:A,maxBuffer:L,lines:D,stripFinalNewline:W,verboseInfo:Q,streamInfo:z}),q=[],O=mV({subprocess:H,buffer:A,maxBuffer:L,ipc:X,ipcOutput:q,verboseInfo:Q}),N=rp(Y,H,z),x=ep(B,z);try{return await Promise.race([Promise.all([{},nU(V),Promise.all(P),T,O,VG(H,J),...N,...x]),G,Hc(H,U),...JG(H,I,Z,U),...yY({subprocess:H,cancelSignal:E,gracefulCancel:K,context:Z,controller:U}),...QG({subprocess:H,cancelSignal:E,gracefulCancel:K,forceKillAfterDelay:M,context:Z,controller:U})])}catch(w){return Z.terminationReason??="other",Promise.all([{error:w},V,Promise.all(P.map((F)=>IQ(F))),IQ(T),dV(O,q),Promise.allSettled(N),Promise.allSettled(x)])}},rp=(H,$,A)=>H.map((L,D)=>L===$.stdio[D]?void 0:yI(L,D,A)),ep=(H,$)=>H.flatMap(({stdioItems:A},L)=>A.filter(({value:D,stream:I=D})=>$A(I,{checkOpen:!1})&&!e$(I)).map(({type:D,value:I,stream:E=I})=>yI(E,L,$,{isSameDirection:g$.has(D),stopOnExit:D==="native"}))),Hc=async(H,{signal:$})=>{let[A]=await sp(H,"error",{signal:$});throw A};var cV=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),fI=(H,$,A)=>{let L=H[A];if(!L.has($))L.set($,[]);let D=L.get($),I=WA();return D.push(I),{resolve:I.resolve.bind(I),promises:D}},SD=async({resolve:H,promises:$},A)=>{H();let[L]=await Promise.race([Promise.allSettled([!0,A]),Promise.all([!1,...$])]);return!L};import{Readable as $c}from"node:stream";import{callbackify as Ac}from"node:util";import{finished as lV}from"node:stream/promises";var MQ=async(H)=>{if(H===void 0)return;try{await XQ(H)}catch{}},iV=async(H)=>{if(H===void 0)return;try{await WQ(H)}catch{}},XQ=async(H)=>{await lV(H,{cleanup:!0,readable:!1,writable:!0})},WQ=async(H)=>{await lV(H,{cleanup:!0,readable:!0,writable:!1})},t9=async(H,$)=>{if(await H,$)throw $},o9=(H,$,A)=>{if(A&&!a9(A))H.destroy(A);else if($)H.destroy()};var nV=({subprocess:H,concurrentStreams:$,encoding:A},{from:L,binary:D=!0,preserveNewlines:I=!0}={})=>{let E=D||w$.has(A),{subprocessStdout:K,waitReadableDestroy:M}=QQ(H,L,$),{readableEncoding:W,readableObjectMode:X,readableHighWaterMark:J}=BQ(K,E),{read:Z,onStdoutDataDone:Q}=JQ({subprocessStdout:K,subprocess:H,binary:E,encoding:A,preserveNewlines:I}),B=new $c({read:Z,destroy:Ac(YQ.bind(void 0,{subprocessStdout:K,subprocess:H,waitReadableDestroy:M})),highWaterMark:J,objectMode:X,encoding:W});return ZQ({subprocessStdout:K,onStdoutDataDone:Q,readable:B,subprocess:H}),B},QQ=(H,$,A)=>{let L=_D(H,$),D=fI(A,L,"readableDestroy");return{subprocessStdout:L,waitReadableDestroy:D}},BQ=({readableEncoding:H,readableObjectMode:$,readableHighWaterMark:A},L)=>L?{readableEncoding:H,readableObjectMode:$,readableHighWaterMark:A}:{readableEncoding:H,readableObjectMode:!0,readableHighWaterMark:DQ},JQ=({subprocessStdout:H,subprocess:$,binary:A,encoding:L,preserveNewlines:D})=>{let I=WA(),E=n9({subprocessStdout:H,subprocess:$,binary:A,shouldEncode:!A,encoding:L,preserveNewlines:D});return{read(){Lc(this,E,I)},onStdoutDataDone:I}},Lc=async(H,$,A)=>{try{let{value:L,done:D}=await $.next();if(D)A.resolve();else H.push(L)}catch{}},ZQ=async({subprocessStdout:H,onStdoutDataDone:$,readable:A,subprocess:L,subprocessStdin:D})=>{try{if(await WQ(H),await L,await MQ(D),await $,A.readable)A.push(null)}catch(I){await MQ(D),aV(A,I)}},YQ=async({subprocessStdout:H,subprocess:$,waitReadableDestroy:A},L)=>{if(await SD(A,$))aV(H,L),await t9($,L)},aV=(H,$)=>{o9(H,H.readable,$)};import{Writable as Dc}from"node:stream";import{callbackify as tV}from"node:util";var oV=({subprocess:H,concurrentStreams:$},{to:A}={})=>{let{subprocessStdin:L,waitWritableFinal:D,waitWritableDestroy:I}=GQ(H,A,$),E=new Dc({...UQ(L,H,D),destroy:tV(CQ.bind(void 0,{subprocessStdin:L,subprocess:H,waitWritableFinal:D,waitWritableDestroy:I})),highWaterMark:L.writableHighWaterMark,objectMode:L.writableObjectMode});return VQ(L,E),E},GQ=(H,$,A)=>{let L=Q9(H,$),D=fI(A,L,"writableFinal"),I=fI(A,L,"writableDestroy");return{subprocessStdin:L,waitWritableFinal:D,waitWritableDestroy:I}},UQ=(H,$,A)=>({write:Ic.bind(void 0,H),final:tV(Ec.bind(void 0,H,$,A))}),Ic=(H,$,A,L)=>{if(H.write($,A))L();else H.once("drain",L)},Ec=async(H,$,A)=>{if(await SD(A,$)){if(H.writable)H.end();await $}},VQ=async(H,$,A)=>{try{if(await XQ(H),$.writable)$.end()}catch(L){await iV(A),sV($,L)}},CQ=async({subprocessStdin:H,subprocess:$,waitWritableFinal:A,waitWritableDestroy:L},D)=>{if(await SD(A,$),await SD(L,$))sV(H,D),await t9($,D)},sV=(H,$)=>{o9(H,H.writable,$)};import{Duplex as Kc}from"node:stream";import{callbackify as Mc}from"node:util";var rV=({subprocess:H,concurrentStreams:$,encoding:A},{from:L,to:D,binary:I=!0,preserveNewlines:E=!0}={})=>{let K=I||w$.has(A),{subprocessStdout:M,waitReadableDestroy:W}=QQ(H,L,$),{subprocessStdin:X,waitWritableFinal:J,waitWritableDestroy:Z}=GQ(H,D,$),{readableEncoding:Q,readableObjectMode:B,readableHighWaterMark:Y}=BQ(M,K),{read:G,onStdoutDataDone:U}=JQ({subprocessStdout:M,subprocess:H,binary:K,encoding:A,preserveNewlines:E}),V=new Kc({read:G,...UQ(X,H,J),destroy:Mc(Xc.bind(void 0,{subprocessStdout:M,subprocessStdin:X,subprocess:H,waitReadableDestroy:W,waitWritableFinal:J,waitWritableDestroy:Z})),readableHighWaterMark:Y,writableHighWaterMark:X.writableHighWaterMark,readableObjectMode:B,writableObjectMode:X.writableObjectMode,encoding:Q});return ZQ({subprocessStdout:M,onStdoutDataDone:U,readable:V,subprocess:H,subprocessStdin:X}),VQ(X,V,M),V},Xc=async({subprocessStdout:H,subprocessStdin:$,subprocess:A,waitReadableDestroy:L,waitWritableFinal:D,waitWritableDestroy:I},E)=>{await Promise.all([YQ({subprocessStdout:H,subprocess:A,waitReadableDestroy:L},E),CQ({subprocessStdin:$,subprocess:A,waitWritableFinal:D,waitWritableDestroy:I},E)])};var zQ=(H,$,{from:A,binary:L=!1,preserveNewlines:D=!1}={})=>{let I=L||w$.has($),E=_D(H,A),K=n9({subprocessStdout:E,subprocess:H,binary:I,shouldEncode:!0,encoding:$,preserveNewlines:D});return Wc(K,E,H)},Wc=async function*(H,$,A){try{yield*H}finally{if($.readable)$.destroy();await A}};var eV=(H,{encoding:$})=>{let A=cV();H.readable=nV.bind(void 0,{subprocess:H,concurrentStreams:A,encoding:$}),H.writable=oV.bind(void 0,{subprocess:H,concurrentStreams:A}),H.duplex=rV.bind(void 0,{subprocess:H,concurrentStreams:A,encoding:$}),H.iterable=zQ.bind(void 0,H,$),H[Symbol.asyncIterator]=zQ.bind(void 0,H,$,{})};var HC=(H,$)=>{for(let[A,L]of Bc){let D=L.value.bind($);Reflect.defineProperty(H,A,{...L,value:D})}},Qc=(async()=>{})().constructor.prototype,Bc=["then","catch","finally"].map((H)=>[H,Reflect.getOwnPropertyDescriptor(Qc,H)]);var $C=(H,$,A,L)=>{let{file:D,commandArguments:I,command:E,escapedCommand:K,startTime:M,verboseInfo:W,options:X,fileDescriptors:J}=Yc(H,$,A),{subprocess:Z,promise:Q}=Uc({file:D,commandArguments:I,options:X,startTime:M,verboseInfo:W,command:E,escapedCommand:K,fileDescriptors:J});return Z.pipe=i9.bind(void 0,{source:Z,sourcePromise:Q,boundOptions:{},createNested:L}),HC(Z,Q),QA.set(Z,{options:X,fileDescriptors:J}),Z},Yc=(H,$,A)=>{let{command:L,escapedCommand:D,startTime:I,verboseInfo:E}=$9(H,$,A),{file:K,commandArguments:M,options:W}=q9(H,$,A),X=Gc(W),J=MV(X,E);return{file:K,commandArguments:M,command:L,escapedCommand:D,startTime:I,verboseInfo:E,options:X,fileDescriptors:J}},Gc=({timeout:H,signal:$,...A})=>{if($!==void 0)throw TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...A,timeoutDuration:H}},Uc=({file:H,commandArguments:$,options:A,startTime:L,verboseInfo:D,command:I,escapedCommand:E,fileDescriptors:K})=>{let M;try{M=Zc(...T9(H,$,A))}catch(B){return DV({error:B,command:I,escapedCommand:E,fileDescriptors:K,options:A,startTime:L,verboseInfo:D})}let W=new AbortController;Jc(Number.POSITIVE_INFINITY,W.signal);let X=[...M.stdio];VV(M,K,W),TV(M,A,W);let J={},Z=WA();M.kill=xY.bind(void 0,{kill:M.kill.bind(M),options:A,onInternalError:Z,context:J,controller:W}),M.all=bV(M,A),eV(M,A),$V(M,A);let Q=Vc({subprocess:M,options:A,startTime:L,verboseInfo:D,fileDescriptors:K,originalStreams:X,command:I,escapedCommand:E,context:J,onInternalError:Z,controller:W});return{subprocess:M,promise:Q}},Vc=async({subprocess:H,options:$,startTime:A,verboseInfo:L,fileDescriptors:D,originalStreams:I,command:E,escapedCommand:K,context:M,onInternalError:W,controller:X})=>{let[J,[Z,Q],B,Y,G]=await pV({subprocess:H,options:$,context:M,verboseInfo:L,fileDescriptors:D,originalStreams:I,onInternalError:W,controller:X});X.abort(),W.resolve();let U=B.map((P,T)=>hA(P,$,T)),V=hA(Y,$,"all"),z=Cc({errorInfo:J,exitCode:Z,signal:Q,stdio:U,all:V,ipcOutput:G,context:M,options:$,command:E,escapedCommand:K,startTime:A});return wD(z,L,$)},Cc=({errorInfo:H,exitCode:$,signal:A,stdio:L,all:D,ipcOutput:I,context:E,options:K,command:M,escapedCommand:W,startTime:X})=>("error"in H)?RI({error:H.error,command:M,escapedCommand:W,timedOut:E.terminationReason==="timeout",isCanceled:E.terminationReason==="cancel"||E.terminationReason==="gracefulCancel",isGracefullyCanceled:E.terminationReason==="gracefulCancel",isMaxBuffer:H.error instanceof vA,isForcefullyTerminated:E.isForcefullyTerminated,exitCode:$,signal:A,stdio:L,all:D,ipcOutput:I,options:K,startTime:X,isSync:!1}):x9({command:M,escapedCommand:W,stdio:L,all:D,ipcOutput:I,options:K,startTime:X});var s9=(H,$)=>{let A=Object.fromEntries(Object.entries($).map(([L,D])=>[L,zc(L,H[L],D)]));return{...H,...A}},zc=(H,$,A)=>{if(Pc.has(H)&&mH($)&&mH(A))return{...$,...A};return A},Pc=new Set(["env",...e2]);var GL=(H,$,A,L)=>{let D=(E,K,M)=>GL(E,K,A,M),I=(...E)=>qc({mapArguments:H,deepOptions:A,boundOptions:$,setBoundExeca:L,createNested:D},...E);if(L!==void 0)L(I,D,$);return I},qc=({mapArguments:H,deepOptions:$={},boundOptions:A={},setBoundExeca:L,createNested:D},I,...E)=>{if(mH(I))return D(H,s9(A,I),L);let{file:K,commandArguments:M,options:W,isSync:X}=Tc({mapArguments:H,firstArgument:I,nextArguments:E,deepOptions:$,boundOptions:A});return X?tU(K,M,W):$C(K,M,W,D)},Tc=({mapArguments:H,firstArgument:$,nextArguments:A,deepOptions:L,boundOptions:D})=>{let I=M7($)?X7($,A):[$,...A],[E,K,M]=c4(...I),W=s9(s9(L,D),M),{file:X=E,commandArguments:J=K,options:Z=W,isSync:Q=!1}=H({file:E,commandArguments:K,options:W});return{file:X,commandArguments:J,options:Z,isSync:Q}};var AC=({file:H,commandArguments:$})=>DC(H,$),LC=({file:H,commandArguments:$})=>({...DC(H,$),isSync:!0}),DC=(H,$)=>{if($.length>0)throw TypeError(`The command and its arguments must be passed as a single string: ${H} ${$}.`);let[A,...L]=_c(H);return{file:A,commandArguments:L}},_c=(H)=>{if(typeof H!=="string")throw TypeError(`The command must be a string: ${String(H)}.`);let $=H.trim();if($==="")return[];let A=[];for(let L of $.split(Nc)){let D=A.at(-1);if(D&&D.endsWith("\\"))A[A.length-1]=`${D.slice(0,-1)} ${L}`;else A.push(L)}return A},Nc=/ +/g;var IC=(H,$,A)=>{H.sync=$(Fc,A),H.s=H.sync},EC=({options:H})=>KC(H),Fc=({options:H})=>({...KC(H),isSync:!0}),KC=(H)=>({options:{...Oc(H),...H}}),Oc=({input:H,inputFile:$,stdio:A})=>H===void 0&&$===void 0&&A===void 0?{stdin:"inherit"}:{},MC={preferLocal:!0};var JA=GL(()=>({})),dCH=GL(()=>({isSync:!0})),pCH=GL(AC),cCH=GL(LC),lCH=GL(YG),EH=GL(EC,{},MC,IC),{sendMessage:iCH,getOneMessage:nCH,getEachMessage:aCH,getCancelSignal:tCH}=AV();nH();nH();import _Q from"path";import CC from"os";var TQ={name:"gdx",version:"0.1.0",description:"Git, but with better DX. The raw power of Git, aligned with human workflows.",homepage:"https://github.com/Type-Delta/gdx#readme",bugs:{url:"https://github.com/Type-Delta/gdx/issues"},repository:{type:"git",url:"git+https://github.com/Type-Delta/gdx.git"},license:"MIT",author:"Type-Delta",type:"module",main:"dist/index.js",bin:{gdx:"scripts/launcher.cjs"},files:["dist/","scripts/postinstall.cjs","scripts/launcher.cjs","README.md","LICENSE"],scripts:{"prepare-dev":"bun i && bun run transpile-esm",start:"bun run src/index.ts","start:profile":"bun --cpu-prof src/index.ts","start:node":"tsx src/index.ts","transpile-esm":"npx tsc -p lib/tsconfig.json && bun run scripts/transform-tools.mjs",lint:"eslint src --ext .ts -c eslint.config.ts --fix",build:"bun run transpile-esm && bun build ./src/index.ts --outfile=./bin/gdx --compile --bytecode --production --keep-names","package:node":"bun run transpile-esm && bun build ./src/index.ts --outdir=./dist --target=node --format=esm --production --keep-names",prepack:"bun run package:node",postinstall:"node scripts/postinstall.cjs",prettier:'prettier --write "src/**/*.ts" "test/**/*.ts" "./*.md"',"dummy-editor":"bun ./scripts/dummyEditor.mjs"},devDependencies:{"@babel/cli":"^7.28.0","@babel/core":"^7.28.0","@babel/preset-env":"^7.27.2","@babel/preset-typescript":"^7.27.1","@eslint/js":"^9.22.0","@types/chai":"^5.2.3","@typescript-eslint/eslint-plugin":"^8.13.0","@typescript-eslint/parser":"^8.13.0","bun-types":"latest",chai:"^6.2.1",eslint:"^9.22.0",jiti:"^2.6.1",tsx:"^4.21.0",prettier:"^3.6.2",typescript:"^5.8.3","typescript-eslint":"^8.50.0","cspell-lib":"^9.4.0",dedent:"^1.7.0",execa:"^9.6.1",keytar:"^7.9.0",openai:"^6.14.0","smol-toml":"^1.5.2"}};var VC=_Q.basename(process.argv[0]||"gdx",_Q.extname(process.argv[0]||"")),AH=VC.startsWith("bun")?"gdx":VC,fD=process.env.GDX_TEMP_DIR||CC.tmpdir(),OPH=process.env.GDX_CURRENT_DIR||process.cwd(),kc=".gdxrc.toml",zC=_Q.join(CC.homedir(),kc);var vD=150,C0=process.env.GDX_RESULT,e9=TQ.version||"unknown",PC=TQ.homepage||"",HK="gdx-cli",UL=["llm.apiKey"],qC=["add","branch","checkout","clone","commit","diff","log","pull","push","rebase","reset","revert","merge","init","stash","status","switch"],a={OceanDeepBlue:[46,149,153],OceanGreen:[57,211,83],ForestGreen:[34,139,34],SunsetOrange:[255,99,71],MidnightBlack:[10,16,36],Zinc700:[63,63,70],Zinc400:[161,161,170],Zinc100:[244,244,245],Fuchsia400:[232,121,249],Teal300:[94,234,212]},TC=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"],z0={AVG_CHARS_PER_LINE:40,AVG_LINES_PER_FUNCTION:45,AVG_LINES_PER_FILE:500},_C=[/api[\w_-]?key[\w_-]?\s*=\s*['"].+['"]/i,/access[\w_-]?token[\w_-]?\s*=\s*['"].+['"]/i,/private[\w_-]?key[\w_-]?\s*=\s*['"].+['"]/i,/sk-ant-[\d\w]{32,}/,/sk-[\d\w]{32,}/,/sk-or-[\d\w]{32,}/,/-----\s*BEGIN PRIVATE KEY\s*-----/i],NC=86400000,FC="https://openrouter.ai/api/v1";import NQ from"fs/promises";import{constants as yc}from"fs";var fc=process;function v(H,$=`
|
|
547
|
+
`){fc.stdout.write(H+$)}async function FQ(H){try{if(!(await NQ.stat(H)).isFile())return!1;return await NQ.access(H,yc.X_OK),!0}catch{return!1}}function OQ(H,$){let A=[];for(let L of $){if(L===H)return{match:L,candidates:null,isExact:!0};if(L.startsWith(H))A.push(L)}return{match:A.length===1?A[0]:null,candidates:A,isExact:A.includes(H)}}function OC(H){return H.map(($)=>{if(/[\s"`$\\]/.test($))return`"${$.replace(/(["\\$`])/g,"\\$1")}"`;return $})}function wQ(H){if(!H)return"";return H.replace(/[/\\]/g,"_").replace(/[<>:"|?*\x00-\x1f]/g,"_")}var bI=()=>{};nH();function XH(H,$,A,L=0,D=1){if(L<0)L=0;else if(D>1)D=1;if(!(L<D)||vI.supportsColor<3)return H;let I=H.length,E=Math.floor(I*L),K=Math.floor(I*D),M=K-E,W=(A[0]-$[0])/M,X=(A[1]-$[1])/M,J=(A[2]-$[2])/M,Z="";for(let Q=0;Q<I;Q++)if(Q<E)Z+=`\x1B[38;2;${$[0]};${$[1]};${$[2]}m${H[Q]}`;else if(Q>=E&&Q<=K){let B=Q-E,Y=Math.round(_$.clamp($[0]+W*B,0,255)),G=Math.round(_$.clamp($[1]+X*B,0,255)),U=Math.round(_$.clamp($[2]+J*B,0,255));Z+=`\x1B[38;2;${Y};${G};${U}m${H[Q]}`}else Z+=`\x1B[38;2;${A[0]};${A[1]};${A[2]}m${H[Q]}`;return Z+="\x1B[0m",Z}function wC(H,$,A){let L=_$.clamp(Math.round(H[0]+($[0]-H[0])*A),0,255),D=_$.clamp(Math.round(H[1]+($[1]-H[1])*A),0,255),I=_$.clamp(Math.round(H[2]+($[2]-H[2])*A),0,255);return[L,D,I]}function RC(H,$,A,L=0.5,D=0.3){if(L<0)L=0;else if(L>1)L=1;if(D<=0||vI.supportsColor<3)return H;let I=H.length,E=L*I,K=D*I,M="";for(let W=0;W<I;W++){let J=Math.abs(W-E)/K;J=_$.clamp(J,0,1);let Z=Math.round(_$.clamp($[0]+(A[0]-$[0])*J,0,255)),Q=Math.round(_$.clamp($[1]+(A[1]-$[1])*J,0,255)),B=Math.round(_$.clamp($[2]+(A[2]-$[2])*J,0,255));M+=`\x1B[38;2;${Z};${Q};${B}m${H[W]}`}return M+="\x1B[0m",M}function uI(H){let $=_$.clamp(Math.round(H[0]),0,255),A=_$.clamp(Math.round(H[1]),0,255),L=_$.clamp(Math.round(H[2]),0,255);return($<<16)+(A<<8)+L}function hI(H,$,A,L,D){let K=0,M=1,W=H;for(let X=0;X<10;X++){let Z=vc(W,$,L)-H;if(Math.abs(Z)<0.000001)break;if(Z>0)M=W;else K=W;W=(K+M)/2}return bc(W,A,D)}function vc(H,$,A){let L=1-H;return 3*L*L*H*$+3*L*H*H*A+H*H*H}function bc(H,$,A){let L=1-H;return 3*L*L*H*$+3*L*H*H*A+H*H*H}var jC={linear:(H)=>H,easeIn:(H)=>hI(H,0.42,0,1,1),easeOut:(H)=>hI(H,0,0,0.58,1),easeInOut:(H)=>hI(H,0.42,0,0.58,1),smooth:(H)=>hI(H,0.25,0.1,0.25,1),bounce:(H)=>hI(H,0.68,-0.55,0.265,1.55)};nH();nH();import uD from"path";import{createInterface as ec}from"readline";bQ();var hD=kA(mC(),1);import cC from"fs/promises";var q0={llm:{provider:"openai",model:"gpt-5-nano",temperature:0.14,maxTokens:void 0,apiKey:void 0,baseUrl:void 0},lint:{onPushBehavior:"off",maxFileSizeKb:1024},defaultEditor:"code"};var dC={"llm.provider":"GDX_LLM_PROVIDER","llm.apiKey":"GDX_LLM_API_KEY","llm.baseUrl":"GDX_LLM_BASE_URL","llm.model":"GDX_LLM_MODEL","llm.temperature":"GDX_LLM_TEMPERATURE","llm.maxTokens":"GDX_LLM_MAX_TOKENS","lint.onPushBehavior":"GDX_LINT_ON_PUSH_BEHAVIOR","lint.maxFileSizeKb":"GDX_LINT_MAX_FILE_SIZE_KB",defaultEditor:"GDX_DEFAULT_EDITOR"},pC={"llm.provider":"LLM provider to use (e.g., openai)","llm.apiKey":"API key for the LLM provider","llm.baseUrl":"Base URL for the LLM API (optional)","llm.model":"Model to use for LLM requests","llm.temperature":"Temperature for LLM generation (0-2)","llm.maxTokens":"Maximum tokens for LLM responses","lint.onPushBehavior":"Lint behavior before push (off, error, warning)","lint.maxFileSizeKb":"Maximum allowed file size in KB",defaultEditor:"Default code editor to open files with"};nH();class lC{configPath;config={...q0};loaded=!1;constructor(H){this.configPath=H||zC}async load(){if(this.loaded)return;try{let H=await cC.readFile(this.configPath,"utf-8"),$=pI(H);this.config=this.mergeConfig(q0,$)}catch(H){let $=new m$(H);if($.code!=="ENOENT")console.warn(`Warning: Failed to parse config file at ${this.configPath}: ${$.message}`);this.config={...q0}}this.applyEnvOverrides(),this.loaded=!0}async save(){let H=this.removeSecureKeys(this.config),$=lI(H);await cC.writeFile(this.configPath,$,"utf-8")}get(H){let $=H.split("."),A=this.config;for(let L of $)if(A&&typeof A==="object"&&L in A)A=A[L];else return;return A}async getSecure(H){let $=this.get(H);if($!==void 0)return $;if(UL.includes(H))try{let A=await hD.getPassword(HK,H);if(A){let L=H.split("."),D=this.config;for(let I=0;I<L.length-1;I++){let E=L[I];if(!(E in D)||typeof D[E]!=="object")D[E]={};D=D[E]}return D[L[L.length-1]]=A,A}}catch(A){console.warn(`Warning: Failed to load secure key '${H}' from keychain:`,A)}return}async set(H,$){let A=H.split("."),L=this.config;for(let E=0;E<A.length-1;E++){let K=A[E];if(!(K in L)||typeof L[K]!=="object")L[K]={};L=L[K]}let D=A[A.length-1],I=this.get(H);if(I!==void 0&&typeof $!==typeof I){console.warn(`Warning: Type mismatch for '${H}'. Expected ${typeof I}, got ${typeof $}. Ignoring value.`);return}if(UL.includes(H))try{await hD.setPassword(HK,H,String($))}catch(E){console.warn(`Warning: Failed to save secure key '${H}' to keychain:`,E)}L[D]=$}getAll(){return this.config}getConfigPath(){return this.configPath}isDefault(H){let $=H.split("."),A=this.config,L=q0;for(let D of $){if(A&&typeof A==="object"&&D in A)A=A[D];else A=void 0;if(L&&typeof L==="object"&&D in L)L=L[D];else L=void 0}return A===L}mergeConfig(H,$){let A=structuredClone(H),L=(D,I,E="")=>{for(let K in I){let M=E?`${E}.${K}`:K,W=I[K],X=D[K];if(X===void 0)continue;if(typeof W==="object"&&W!==null&&!Array.isArray(W))if(typeof X==="object"&&X!==null)L(D[K],W,M);else console.warn(`Warning: Type mismatch for '${M}'. Expected ${typeof X}, got object. Ignoring value.`);else if(typeof W!==typeof X)console.warn(`Warning: Type mismatch for '${M}'. Expected ${typeof X}, got ${typeof W}. Ignoring value.`);else D[K]=W}};return L(A,$),A}removeSecureKeys(H){let $=structuredClone(H);for(let A of UL){let L=A.split("."),D=$;for(let I=0;I<L.length-1;I++){if(!D[L[I]])return $;D=D[L[I]]}delete D[L[L.length-1]]}return $}async deleteSecureKey(H){if(!UL.includes(H))return!1;try{return await hD.deletePassword(HK,H)}catch{return!1}}applyEnvOverrides(){for(let[H,$]of Object.entries(dC)){let A=process.env[$];if(A!==void 0){let L=this.get(H),D=A;if(typeof L==="number"){let I=Number(A);if(!isNaN(I))D=I;else{console.warn(`Warning: Environment variable ${$} has invalid number value '${A}'. Ignoring.`);continue}}else if(typeof L==="boolean")D=A.toLowerCase()==="true";this.set(H,D)}}}}var DK=null;async function j$(){if(!DK)DK=new lC,await DK.load();return DK}var CL={exitCodeOverride:-1,finalStringOutput:""};import{writeFile as Hl}from"fs/promises";import{unlink as $l}from"fs/promises";function IK(H={}){let $=new AbortController;return{$:JA({cancelSignal:$.signal,...H}),abort:()=>$.abort(),signal:$.signal}}var uH=JA({stdout:"inherit",stderr:"inherit"});async function EK(H){let $=ec({input:process.stdin,output:process.stdout});return new Promise((A)=>{$.question(H,(L)=>{$.close(),A(L.trim())})})}async function hQ(H){if(H.includes(uD.sep)){let I=uD.resolve(H);return await FQ(I)?I:null}let $=process.platform==="win32",A=[""];if($)A=["",...(process.env.PATHEXT||".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH").split(";").filter(Boolean)];let L=[];if(L.push(process.cwd()),process.argv[1])L.push(uD.dirname(process.argv[1]));if(L.push(uD.dirname(process.execPath)),process.env.PATH)L.push(...process.env.PATH.split(uD.delimiter));let D=[...new Set(L)];for(let I of D){if(!I)continue;for(let E of A){let K=uD.join(I,H+E);if(await FQ(K))return K}}return null}async function KK(H){try{switch(process.platform){case"win32":return await EH({input:H})`clip`,!0;case"darwin":return await EH({input:H})`pbcopy`,!0;case"linux":try{return await EH({input:H})`xclip -selection clipboard`,!0}catch{return await EH({input:H})`xsel --clipboard --input`,!0}default:return!1}}catch{return!1}}function MK(H={}){H={message:"",interval:80,frames:TC,animateGradient:!1,gradientColor:a.Zinc100,gradientColorBg:a.Zinc700,gradientSpeed:0.11,...H};let $=0,A=0,L=!0,D=null,I=C();process.stdout.write("\x1B[?25l");let E=()=>{if(!L)return;let K=H.frames[$%H.frames.length];if(H.message)if(H.animateGradient&&vI.supportsColor>=3){let M=A%2;if(M<=1){let W=jC.easeInOut(M),X=RC(H.message,H.gradientColor,H.gradientColorBg,W,0.3);K+=" "+X}else K+=" "+C(uI(H.gradientColorBg))+H.message+I;A+=H.gradientSpeed??0.1}else K+=" "+H.message;process.stdout.write("\r\x1B[K"+K),$++};return D=setInterval(E,H.interval),E(),{stop:()=>{if(L=!1,D)clearInterval(D),D=null;process.stdout.write("\r\x1B[K\x1B[?25h")},options:H}}async function uQ(H){let A=(await j$()).getAll().defaultEditor,L=await hQ(A);if(!L)throw new m$(`Default editor "${A}" not found in PATH. Set a valid editor in the configuration.`,"EDITOR_NOT_FOUND");await uH`${L} ${H}`}async function iC(H){if(!H){if(C0)await $l(C0).catch(()=>{});CL.exitCodeOverride=-1;return}if(C0)await Hl(C0,H,"utf-8");CL.exitCodeOverride=vD}async function Al(H,$){let[A,L]=$[2].split("..").map((D)=>parseInt(D,10));if(isNaN(A)||isNaN(L)||A>L)return v(C("Red")+`Invalid stash range: ${$[2]}`+C()),1;v(C("Cyan")+`Dropping stashes from ${C("Bright")+A+C()+C("Cyan")} to ${C("Bright")+L+C()+C("Cyan")} (inclusive)`+C());for(let D=L;D>=A;D--)await uH`${H} stash drop stash@{${D}}`;return 0}var nC={dropRange:Al},aC={long:()=>RH(`
|
|
548
|
+
${C("Bright")+XH("STASH DROP",a.Zinc400,a.Zinc100,0.2)}
|
|
549
|
+
Remove a contiguous range of stash entries.
|
|
550
|
+
|
|
551
|
+
${C("Bright")+XH("DESCRIPTION",a.Zinc400,a.Zinc100,0.2)}
|
|
552
|
+
Accepts a range in the form <start>..<end> and drops each stash entry in that inclusive range. The routine validates the numeric range and iterates from the highest index down to the lowest to avoid reindexing issues when dropping multiple stashes.
|
|
553
|
+
|
|
554
|
+
${C("Bright")+XH("SAFETY",a.Zinc400,a.Zinc100,0.2)}
|
|
555
|
+
This operation is destructive: dropped stashes cannot be recovered by this tool. Ensure you really want to delete the specified range. Use \`git stash list\` to inspect entries before running.
|
|
556
|
+
`,100,{firstIndent:" ",mode:"softboundery",indent:" "}),short:"Drop a contiguous range of stash entries (e.g. 0..3).",usage:()=>RH(`
|
|
557
|
+
${C("Cyan")}${AH} stash drop ${C("Dim")}<start>..<end>${C()}
|
|
558
|
+
|
|
559
|
+
Examples:
|
|
560
|
+
${C("Cyan")}${AH} stash drop 0..0 ${C()+C("Dim")}# Drop the most recent stash${C()}
|
|
561
|
+
${C("Cyan")}${AH} stash drop 2..5 ${C()+C("Dim")}# Drop stashes 2,3,4,5 (inclusive)${C()}`,100,{firstIndent:" ",mode:"softboundery",indent:" "})};function tC(H,$){var A=Object.keys(H);if(Object.getOwnPropertySymbols){var L=Object.getOwnPropertySymbols(H);$&&(L=L.filter(function(D){return Object.getOwnPropertyDescriptor(H,D).enumerable})),A.push.apply(A,L)}return A}function oC(H){for(var $=1;$<arguments.length;$++){var A=arguments[$]!=null?arguments[$]:{};$%2?tC(Object(A),!0).forEach(function(L){Ll(H,L,A[L])}):Object.getOwnPropertyDescriptors?Object.defineProperties(H,Object.getOwnPropertyDescriptors(A)):tC(Object(A)).forEach(function(L){Object.defineProperty(H,L,Object.getOwnPropertyDescriptor(A,L))})}return H}function Ll(H,$,A){if($=Dl($),$ in H)Object.defineProperty(H,$,{value:A,enumerable:!0,configurable:!0,writable:!0});else H[$]=A;return H}function Dl(H){var $=Il(H,"string");return typeof $==="symbol"?$:String($)}function Il(H,$){if(typeof H!=="object"||H===null)return H;var A=H[Symbol.toPrimitive];if(A!==void 0){var L=A.call(H,$||"default");if(typeof L!=="object")return L;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(H)}var El=sC({}),T0=El;function sC(H){return $.withOptions=(A)=>sC(oC(oC({},H),A)),$;function $(A,...L){let D=typeof A==="string"?[A]:A.raw,{alignValues:I=!1,escapeSpecialCharacters:E=Array.isArray(A),trimWhitespace:K=!0}=H,M="";for(let J=0;J<D.length;J++){let Z=D[J];if(E)Z=Z.replace(/\\\n[ \t]*/g,"").replace(/\\`/g,"`").replace(/\\\$/g,"$").replace(/\\\{/g,"{");if(M+=Z,J<L.length){let Q=I?Kl(L[J],M):L[J];M+=Q}}let W=M.split(`
|
|
562
|
+
`),X=null;for(let J of W){let Z=J.match(/^(\s+)\S+/);if(Z){let Q=Z[1].length;if(!X)X=Q;else X=Math.min(X,Q)}}if(X!==null){let J=X;M=W.map((Z)=>Z[0]===" "||Z[0]==="\t"?Z.slice(J):Z).join(`
|
|
563
|
+
`)}if(K)M=M.trim();if(E)M=M.replace(/\\n/g,`
|
|
564
|
+
`);return M}}function Kl(H,$){if(typeof H!=="string"||!H.includes(`
|
|
565
|
+
`))return H;let L=$.slice($.lastIndexOf(`
|
|
566
|
+
`)+1).match(/^(\s+)/);if(L){let D=L[1];return H.replace(/\n/g,`
|
|
567
|
+
${D}`)}return H}nH();nH();var rC=6,XK=2,eC=4,Hz=12;async function nI(H){let{git$:$,args:A}=H,L=A.popValue("--email")||(await EH`${$} config user.email`).stdout;if(L=L?L.trim().replace(/^["']|["']$/g,""):L,!L)return v(C("Red")+'User email not configured. Please set it using "git config user.email <email>" or provide it with --email option.'+C()),1;if(!A.includes("--quiet"))v(C("Cyan")+"Generating commit graph for user: "+C("Yellow")+L+C());let I=(process.stdout.columns||80)-rC-eC,E=Math.min(Math.floor(I/XK),52);if(I<Hz)return v(C("Red")+`Terminal width too small for graph display. Minimum required width is ${Hz+rC+eC} columns.`+C()),1;let K=new Date,M=new Date(K),W=M.getDay();M.setDate(M.getDate()-W),M.setDate(M.getDate()-E*7);let X=(await EH`
|
|
568
|
+
${$} --no-pager log --all --author=${L} --since=${M.toISOString()} --date=short --format=%ad
|
|
569
|
+
`).stdout.trim(),J={};for(let U of X.split(`
|
|
570
|
+
`)){let V=U.trim();if(V)J[V]=(J[V]||0)+1}let Z=1;for(let U of Object.values(J))if(U>Z)Z=U;v(`
|
|
571
|
+
`+C("Bright")+XH("Contribution Graph",a.OceanDeepBlue,a.OceanGreen,0.12,0.83)+` (Max: ${Z} commits/day)
|
|
572
|
+
`);let Q=" ",B=0,Y=-1;for(let U=0;U<=E;U++){let V=new Date(M);V.setDate(V.getDate()+U*7);let z=U*XK;if(V.getMonth()!==Y&&z>=B){Q+=" ".repeat(z-B);let P=V.toLocaleString("default",{month:"short"});Q+=P.padEnd(XK*3," "),B=z+XK*3,Y=V.getMonth()}}v(C("Bright")+Q+C());let G=[" ","Mon"," ","Wed"," ","Fri"," "];for(let U=0;U<7;U++){let V=C("Bright")+G[U]+C()+" ";for(let z=0;z<=E;z++){let P=new Date(M);if(P.setDate(P.getDate()+z*7+U),P>K){V+=" ";continue}let T=P.toISOString().slice(0,10),q=J[T]||0,O,N="■";if(q===0)O=C("Dim")+C(uI(a.MidnightBlack)),N="▨";else{let x=Math.min(q/Z,1),w=wC(a.MidnightBlack,a.OceanGreen,x);O=C(uI(w))}V+=O+N+C()+" "}v(" "+V)}return v(""),0}var $z={long:()=>RH(`
|
|
573
|
+
${C("Bright")+XH("GRAPH",a.Zinc400,a.Zinc100,0.2)}
|
|
574
|
+
Render a calendar-style contribution graph for a repository author.
|
|
575
|
+
|
|
576
|
+
${C("Bright")+XH("DESCRIPTION",a.Zinc400,a.Zinc100,0.2)}
|
|
577
|
+
Visualize commit activity as a calendar-like heatmap showing commit density by day for the last N weeks (limited by terminal width). Each cell is colored to indicate relative commit frequency and can be clamped to a maximum of 52 weeks.
|
|
578
|
+
|
|
579
|
+
${C("Bright")+XH("OPTIONS",a.Zinc400,a.Zinc100,0.2)}
|
|
580
|
+
Supply ${C("Cyan")}--email <email>${C()} to override the configured git user email. Use ${C("Cyan")}--quiet${C()} to suppress informational headers when embedding the graph in other scripts.
|
|
581
|
+
|
|
582
|
+
${C("Bright")+XH("TERMINAL NOTES",a.Zinc400,a.Zinc100,0.2)}
|
|
583
|
+
The graph respects \`process.stdout.columns\`. If the terminal is too narrow the command will bail with an error message. Colors are rendered via the \`ncc()\` helper.
|
|
584
|
+
`,100,{firstIndent:" ",mode:"softboundery",indent:" "}),short:"Render a calendar-style contribution graph for an author.",usage:()=>RH(`
|
|
585
|
+
${C("Cyan")}${AH} graph ${C("Dim")}[--email <email>] [--quiet]${C()}
|
|
586
|
+
|
|
587
|
+
Examples:
|
|
588
|
+
${C("Cyan")}${AH} graph ${C()+C("Dim")}# Graph for configured git user${C()}
|
|
589
|
+
${C("Cyan")}${AH} graph --email bob@example.com ${C()+C("Dim")}# Graph for specified author${C()}`,100,{firstIndent:" ",mode:"softboundery",indent:" "})};class WK extends Array{constructor(H){if(Array.isArray(H))super(...H);else super(H)}delete(H){let $=this.indexOf(H);if($!==-1)return this.splice($,1),!0;return!1}popValue(H,$=0){let A=this.indexOf(H,$);if(A!==-1){let L=null;if(A+1<this.length)L=this[A+1],this.splice(A,2);else if(L=Ml(this[A]))this.splice(A,1);return L}return null}popOption(H,$=0){let A=this.indexOf(H,$);if(A!==-1)return this.splice(A,1),H;return null}hasOption(H,$=0){for(let A=$;A<this.length;A++)if(this[A]===H||this[A].startsWith(H+"="))return!0;return!1}}function Ml(H){let $=H.indexOf("=");if($!==-1)return H.substring($+1);return null}function Az(H){return new WK(H)}nH();async function QK(H){try{await EH`${H} rev-parse --is-inside-work-tree`}catch{return v(C("Red")+"Error: This command must be run inside a git repository."+C()),!1}return!0}async function gQ(H){let $=IK(),A=$.$,{args:L,git$:D}=H;if(!await QK(D))return 1;let I="",E="Your",K=L.indexOf("--author");try{if(K!==-1&&K+1<L.length)I=L[K+1].trim(),E=I.split("@")[0]+"'s";else{let{stdout:M}=await A`${D} config user.email`;I=M.trim()}}catch(M){return $.abort(),v(C("Red")+"Error: Failed to read git config user.email."+C()),v(iH(M,{color:!0})),1}if(!I)return console.error(C("Red")+"Error: No user.email configured in git."+C()),1;v(C("Cyan")+"Gathering stats for user: "+C("Yellow")+I+C("Cyan")+" this may take a while..."+C());try{let[M,W,X,J,Z,Q,B,Y]=await Promise.all([A`${D} rev-parse --show-toplevel`,A`${D} rev-list --all --count --author=${I}`,A`${D} rev-list --all --count`,A`${D} log --all --author=${I} --since=midnight --pretty=tformat:%h`,A`${D} log --all --author=${I} --pretty=tformat: --numstat`,A`${D} log --all --pretty=tformat: --numstat`,A`${D} for-each-ref --format=%(refname:short) refs/heads/`,A`${D} log --all --author=${I} -1 --format=${`%ar ${C()+C("Dim")}[at %h] (on %ad)`+C()}`]),G=M.stdout.trim().split(/[\\/]/).pop(),U=W.stdout.trim(),V=X.stdout.trim(),z=J.stdout.trim()?J.stdout.trim().split(`
|
|
590
|
+
`).length:0,P=Z.stdout,T=0,q=0;for(let HH of P.split(`
|
|
591
|
+
`)){let e=HH.match(/^(\d+)\s+(\d+)/);if(e)T+=parseInt(e[1],10),q+=parseInt(e[2],10)}let O=mA(T*z0.AVG_CHARS_PER_LINE,2,1024)+"B",N=mA(q*z0.AVG_CHARS_PER_LINE,2,1024)+"B",x=mA(T/z0.AVG_LINES_PER_FUNCTION,1,1000,!1,0),w=mA(q/z0.AVG_LINES_PER_FUNCTION,1,1000,!1,0),F=mA(T/z0.AVG_LINES_PER_FILE,1,1000,!1,0),f=mA(q/z0.AVG_LINES_PER_FILE,1,1000,!1,0),j=Q.stdout,S=0,_=0;for(let HH of j.split(`
|
|
592
|
+
`)){let e=HH.match(/^(\d+)\s+(\d+)/);if(e)S+=parseInt(e[1],10),_+=parseInt(e[2],10)}let u=T+q,h=S+_,d=h>0?YC(u/h*100,2,!0):"0.00",l=B.stdout.split(`
|
|
593
|
+
`).filter((HH)=>HH.trim()),k=0,p="N/A",LH=await Promise.all(l.map(async(HH)=>{let{stdout:e}=await A`${D} rev-list --count --author=${I} ${HH}`;return{branch:HH,count:parseInt(e.trim(),10)}}));for(let{branch:HH,count:e}of LH)if(e>k)k=e,p=HH;let IH=Y.stdout.trim()||"Never";return v(T0`
|
|
594
|
+
\n=== ${E} Git Stats ===
|
|
595
|
+
Project: ${C("Cyan")}${G}${C()}
|
|
596
|
+
Total Commits: ${C("Green")}${U}${C()} (today: ${z}) / ${C("Yellow")}${V}${C()} (all)
|
|
597
|
+
Total Lines Added: ${C("Green")}+ ${T} lines ${C()}${C("Dim")}(roughly ${O}, ${x} functions or ${F} source files)${C()}
|
|
598
|
+
Total Lines Removed: ${C("Red")}- ${q} lines ${C()}${C("Dim")}(roughly ${N}, ${w} functions or ${f} source files)${C()}
|
|
599
|
+
Contributions: ${C("Magenta")}${d}%${C()} of all lines changed in the project
|
|
600
|
+
Most Active Branch: ${C("Cyan")}${p}${C()} (${k} commits)
|
|
601
|
+
Last Commit: ${C("Yellow")}${IH}${C()}
|
|
602
|
+
`),await nI({...H,args:Az(["--quiet","--author",I])}),0}catch(M){return $.abort(),v(iH(M,{color:!0})),1}}var Lz={long:()=>RH(`
|
|
603
|
+
${C("Bright")+XH("STATS",a.Zinc400,a.Zinc100,0.2)}
|
|
604
|
+
Gather detailed contribution statistics for a git author in this repository.
|
|
605
|
+
|
|
606
|
+
${C("Bright")+XH("WHAT IT COMPUTES",a.Zinc400,a.Zinc100,0.2)}
|
|
607
|
+
Total commits by the author, today's commits, lines added/removed, rough size estimates (bytes), estimated functions/files added or removed, contribution percentage of the project, most active branch, and time of the last commit.
|
|
608
|
+
|
|
609
|
+
${C("Bright")+XH("HOW IT WORKS",a.Zinc400,a.Zinc100,0.2)}
|
|
610
|
+
The command runs multiple git queries in parallel to collect commit lists, per-commit numstat, branch lists and last-commit metadata. For large repos this may take some time; progress messages are shown while queries run.
|
|
611
|
+
|
|
612
|
+
${C("Bright")+XH("OPTIONS",a.Zinc400,a.Zinc100,0.2)}
|
|
613
|
+
Use ${C("Cyan")}--author <email>${C()} to target a different author than the configured git user.email. Output includes a small visual graph invocation via the \`graph\` command by default.
|
|
614
|
+
`,100,{firstIndent:" ",mode:"softboundery",indent:" "}),short:"Show comprehensive commit and line-change statistics for a repository author.",usage:()=>RH(`
|
|
615
|
+
${C("Cyan")}${AH} stats ${C("Dim")}[--author <email>]${C()}
|
|
616
|
+
|
|
617
|
+
Examples:
|
|
618
|
+
${C("Cyan")}${AH} stats ${C()+C("Dim")}# Stats for configured git user${C()}
|
|
619
|
+
${C("Cyan")}${AH} stats --author alice@example.com ${C()+C("Dim")}# Stats for specified author${C()}`,100,{firstIndent:" ",mode:"softboundery",indent:" "})};nH();nH();function KH(H,$,A,L,D){if(L==="m")throw TypeError("Private method is not writable");if(L==="a"&&!D)throw TypeError("Private accessor was defined without a setter");if(typeof $==="function"?H!==$||!D:!$.has(H))throw TypeError("Cannot write private member to an object whose class did not declare it");return L==="a"?D.call(H,A):D?D.value=A:$.set(H,A),A}function b(H,$,A,L){if(A==="a"&&!L)throw TypeError("Private accessor was defined without a getter");if(typeof $==="function"?H!==$||!L:!$.has(H))throw TypeError("Cannot read private member from an object whose class did not declare it");return A==="m"?L:A==="a"?L.call(H):L?L.value:$.get(H)}var mQ=function(){let{crypto:H}=globalThis;if(H?.randomUUID)return mQ=H.randomUUID.bind(H),H.randomUUID();let $=new Uint8Array(1),A=H?()=>H.getRandomValues($)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(L)=>(+L^A()&15>>+L/4).toString(16))};function aI(H){return typeof H==="object"&&H!==null&&(("name"in H)&&H.name==="AbortError"||("message"in H)&&String(H.message).includes("FetchRequestCanceledException"))}var tI=(H)=>{if(H instanceof Error)return H;if(typeof H==="object"&&H!==null){try{if(Object.prototype.toString.call(H)==="[object Error]"){let $=Error(H.message,H.cause?{cause:H.cause}:{});if(H.stack)$.stack=H.stack;if(H.cause&&!$.cause)$.cause=H.cause;if(H.name)$.name=H.name;return $}}catch{}try{return Error(JSON.stringify(H))}catch{}}return Error(H)};class DH extends Error{}class aH extends DH{constructor(H,$,A,L){super(`${aH.makeMessage(H,$,A)}`);this.status=H,this.headers=L,this.requestID=L?.get("x-request-id"),this.error=$;let D=$;this.code=D?.code,this.param=D?.param,this.type=D?.type}static makeMessage(H,$,A){let L=$?.message?typeof $.message==="string"?$.message:JSON.stringify($.message):$?JSON.stringify($):A;if(H&&L)return`${H} ${L}`;if(H)return`${H} status code (no body)`;if(L)return L;return"(no status code or body)"}static generate(H,$,A,L){if(!H||!L)return new _0({message:A,cause:tI($)});let D=$?.error;if(H===400)return new oI(H,D,A,L);if(H===401)return new sI(H,D,A,L);if(H===403)return new rI(H,D,A,L);if(H===404)return new eI(H,D,A,L);if(H===409)return new HE(H,D,A,L);if(H===422)return new $E(H,D,A,L);if(H===429)return new AE(H,D,A,L);if(H>=500)return new LE(H,D,A,L);return new aH(H,D,A,L)}}class sH extends aH{constructor({message:H}={}){super(void 0,void 0,H||"Request was aborted.",void 0)}}class _0 extends aH{constructor({message:H,cause:$}){super(void 0,void 0,H||"Connection error.",void 0);if($)this.cause=$}}class N0 extends _0{constructor({message:H}={}){super({message:H??"Request timed out."})}}class oI extends aH{}class sI extends aH{}class rI extends aH{}class eI extends aH{}class HE extends aH{}class $E extends aH{}class AE extends aH{}class LE extends aH{}class DE extends DH{constructor(){super("Could not parse response content as the length limit was reached")}}class IE extends DH{constructor(){super("Could not parse response content as the request was rejected by the content filter")}}class pA extends Error{constructor(H){super(H)}}var Wl=/^[a-z][a-z0-9+.-]*:/i,Dz=(H)=>{return Wl.test(H)},Q$=(H)=>(Q$=Array.isArray,Q$(H)),dQ=Q$;function pQ(H){if(typeof H!=="object")return{};return H??{}}function Iz(H){if(!H)return!0;for(let $ in H)return!1;return!0}function Ez(H,$){return Object.prototype.hasOwnProperty.call(H,$)}function EE(H){return H!=null&&typeof H==="object"&&!Array.isArray(H)}var Kz=(H,$)=>{if(typeof $!=="number"||!Number.isInteger($))throw new DH(`${H} must be an integer`);if($<0)throw new DH(`${H} must be a positive integer`);return $};var Mz=(H)=>{try{return JSON.parse(H)}catch($){return}};var ZA=(H)=>new Promise(($)=>setTimeout($,H));var zL="6.14.0";var Bz=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"};function Ql(){if(typeof Deno<"u"&&Deno.build!=null)return"deno";if(typeof EdgeRuntime<"u")return"edge";if(Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]")return"node";return"unknown"}var Bl=()=>{let H=Ql();if(H==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":zL,"X-Stainless-OS":Wz(Deno.build.os),"X-Stainless-Arch":Xz(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version==="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":zL,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(H==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":zL,"X-Stainless-OS":Wz(globalThis.process.platform??"unknown"),"X-Stainless-Arch":Xz(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let $=Jl();if($)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":zL,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${$.browser}`,"X-Stainless-Runtime-Version":$.version};return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":zL,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function Jl(){if(typeof navigator>"u"||!navigator)return null;let H=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:$,pattern:A}of H){let L=A.exec(navigator.userAgent);if(L){let D=L[1]||0,I=L[2]||0,E=L[3]||0;return{browser:$,version:`${D}.${I}.${E}`}}}return null}var Xz=(H)=>{if(H==="x32")return"x32";if(H==="x86_64"||H==="x64")return"x64";if(H==="arm")return"arm";if(H==="aarch64"||H==="arm64")return"arm64";if(H)return`other:${H}`;return"unknown"},Wz=(H)=>{if(H=H.toLowerCase(),H.includes("ios"))return"iOS";if(H==="android")return"Android";if(H==="darwin")return"MacOS";if(H==="win32")return"Windows";if(H==="freebsd")return"FreeBSD";if(H==="openbsd")return"OpenBSD";if(H==="linux")return"Linux";if(H)return`Other:${H}`;return"Unknown"},Qz,Jz=()=>{return Qz??(Qz=Bl())};function Zz(){if(typeof fetch<"u")return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function cQ(...H){let $=globalThis.ReadableStream;if(typeof $>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new $(...H)}function BK(H){let $=Symbol.asyncIterator in H?H[Symbol.asyncIterator]():H[Symbol.iterator]();return cQ({start(){},async pull(A){let{done:L,value:D}=await $.next();if(L)A.close();else A.enqueue(D)},async cancel(){await $.return?.()}})}function lQ(H){if(H[Symbol.asyncIterator])return H;let $=H.getReader();return{async next(){try{let A=await $.read();if(A?.done)$.releaseLock();return A}catch(A){throw $.releaseLock(),A}},async return(){let A=$.cancel();return $.releaseLock(),await A,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function Yz(H){if(H===null||typeof H!=="object")return;if(H[Symbol.asyncIterator]){await H[Symbol.asyncIterator]().return?.();return}let $=H.getReader(),A=$.cancel();$.releaseLock(),await A}var Gz=({headers:H,body:$})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify($)}};var JK="RFC3986",iQ=(H)=>String(H),ZK={RFC1738:(H)=>String(H).replace(/%20/g,"+"),RFC3986:iQ},nQ="RFC1738";var YK=(H,$)=>(YK=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),YK(H,$)),YA=(()=>{let H=[];for(let $=0;$<256;++$)H.push("%"+(($<16?"0":"")+$.toString(16)).toUpperCase());return H})();var aQ=1024,Uz=(H,$,A,L,D)=>{if(H.length===0)return H;let I=H;if(typeof H==="symbol")I=Symbol.prototype.toString.call(H);else if(typeof H!=="string")I=String(H);if(A==="iso-8859-1")return escape(I).replace(/%u[0-9a-f]{4}/gi,function(K){return"%26%23"+parseInt(K.slice(2),16)+"%3B"});let E="";for(let K=0;K<I.length;K+=aQ){let M=I.length>=aQ?I.slice(K,K+aQ):I,W=[];for(let X=0;X<M.length;++X){let J=M.charCodeAt(X);if(J===45||J===46||J===95||J===126||J>=48&&J<=57||J>=65&&J<=90||J>=97&&J<=122||D===nQ&&(J===40||J===41)){W[W.length]=M.charAt(X);continue}if(J<128){W[W.length]=YA[J];continue}if(J<2048){W[W.length]=YA[192|J>>6]+YA[128|J&63];continue}if(J<55296||J>=57344){W[W.length]=YA[224|J>>12]+YA[128|J>>6&63]+YA[128|J&63];continue}X+=1,J=65536+((J&1023)<<10|M.charCodeAt(X)&1023),W[W.length]=YA[240|J>>18]+YA[128|J>>12&63]+YA[128|J>>6&63]+YA[128|J&63]}E+=W.join("")}return E};function Vz(H){if(!H||typeof H!=="object")return!1;return!!(H.constructor&&H.constructor.isBuffer&&H.constructor.isBuffer(H))}function tQ(H,$){if(Q$(H)){let A=[];for(let L=0;L<H.length;L+=1)A.push($(H[L]));return A}return $(H)}var zz={brackets(H){return String(H)+"[]"},comma:"comma",indices(H,$){return String(H)+"["+$+"]"},repeat(H){return String(H)}},Pz=function(H,$){Array.prototype.push.apply(H,Q$($)?$:[$])},Cz,rH={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Uz,encodeValuesOnly:!1,format:JK,formatter:iQ,indices:!1,serializeDate(H){return(Cz??(Cz=Function.prototype.call.bind(Date.prototype.toISOString)))(H)},skipNulls:!1,strictNullHandling:!1};function Gl(H){return typeof H==="string"||typeof H==="number"||typeof H==="boolean"||typeof H==="symbol"||typeof H==="bigint"}var oQ={};function qz(H,$,A,L,D,I,E,K,M,W,X,J,Z,Q,B,Y,G,U){let V=H,z=U,P=0,T=!1;while((z=z.get(oQ))!==void 0&&!T){let w=z.get(H);if(P+=1,typeof w<"u")if(w===P)throw RangeError("Cyclic object value");else T=!0;if(typeof z.get(oQ)>"u")P=0}if(typeof W==="function")V=W($,V);else if(V instanceof Date)V=Z?.(V);else if(A==="comma"&&Q$(V))V=tQ(V,function(w){if(w instanceof Date)return Z?.(w);return w});if(V===null){if(I)return M&&!Y?M($,rH.encoder,G,"key",Q):$;V=""}if(Gl(V)||Vz(V)){if(M){let w=Y?$:M($,rH.encoder,G,"key",Q);return[B?.(w)+"="+B?.(M(V,rH.encoder,G,"value",Q))]}return[B?.($)+"="+B?.(String(V))]}let q=[];if(typeof V>"u")return q;let O;if(A==="comma"&&Q$(V)){if(Y&&M)V=tQ(V,M);O=[{value:V.length>0?V.join(",")||null:void 0}]}else if(Q$(W))O=W;else{let w=Object.keys(V);O=X?w.sort(X):w}let N=K?String($).replace(/\./g,"%2E"):String($),x=L&&Q$(V)&&V.length===1?N+"[]":N;if(D&&Q$(V)&&V.length===0)return x+"[]";for(let w=0;w<O.length;++w){let F=O[w],f=typeof F==="object"&&typeof F.value<"u"?F.value:V[F];if(E&&f===null)continue;let j=J&&K?F.replace(/\./g,"%2E"):F,S=Q$(V)?typeof A==="function"?A(x,j):x:x+(J?"."+j:"["+j+"]");U.set(H,P);let _=new WeakMap;_.set(oQ,U),Pz(q,qz(f,S,A,L,D,I,E,K,A==="comma"&&Y&&Q$(V)?null:M,W,X,J,Z,Q,B,Y,G,_))}return q}function Ul(H=rH){if(typeof H.allowEmptyArrays<"u"&&typeof H.allowEmptyArrays!=="boolean")throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof H.encodeDotInKeys<"u"&&typeof H.encodeDotInKeys!=="boolean")throw TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(H.encoder!==null&&typeof H.encoder<"u"&&typeof H.encoder!=="function")throw TypeError("Encoder has to be a function.");let $=H.charset||rH.charset;if(typeof H.charset<"u"&&H.charset!=="utf-8"&&H.charset!=="iso-8859-1")throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");let A=JK;if(typeof H.format<"u"){if(!YK(ZK,H.format))throw TypeError("Unknown format option provided.");A=H.format}let L=ZK[A],D=rH.filter;if(typeof H.filter==="function"||Q$(H.filter))D=H.filter;let I;if(H.arrayFormat&&H.arrayFormat in zz)I=H.arrayFormat;else if("indices"in H)I=H.indices?"indices":"repeat";else I=rH.arrayFormat;if("commaRoundTrip"in H&&typeof H.commaRoundTrip!=="boolean")throw TypeError("`commaRoundTrip` must be a boolean, or absent");let E=typeof H.allowDots>"u"?!!H.encodeDotInKeys===!0?!0:rH.allowDots:!!H.allowDots;return{addQueryPrefix:typeof H.addQueryPrefix==="boolean"?H.addQueryPrefix:rH.addQueryPrefix,allowDots:E,allowEmptyArrays:typeof H.allowEmptyArrays==="boolean"?!!H.allowEmptyArrays:rH.allowEmptyArrays,arrayFormat:I,charset:$,charsetSentinel:typeof H.charsetSentinel==="boolean"?H.charsetSentinel:rH.charsetSentinel,commaRoundTrip:!!H.commaRoundTrip,delimiter:typeof H.delimiter>"u"?rH.delimiter:H.delimiter,encode:typeof H.encode==="boolean"?H.encode:rH.encode,encodeDotInKeys:typeof H.encodeDotInKeys==="boolean"?H.encodeDotInKeys:rH.encodeDotInKeys,encoder:typeof H.encoder==="function"?H.encoder:rH.encoder,encodeValuesOnly:typeof H.encodeValuesOnly==="boolean"?H.encodeValuesOnly:rH.encodeValuesOnly,filter:D,format:A,formatter:L,serializeDate:typeof H.serializeDate==="function"?H.serializeDate:rH.serializeDate,skipNulls:typeof H.skipNulls==="boolean"?H.skipNulls:rH.skipNulls,sort:typeof H.sort==="function"?H.sort:null,strictNullHandling:typeof H.strictNullHandling==="boolean"?H.strictNullHandling:rH.strictNullHandling}}function sQ(H,$={}){let A=H,L=Ul($),D,I;if(typeof L.filter==="function")I=L.filter,A=I("",A);else if(Q$(L.filter))I=L.filter,D=I;let E=[];if(typeof A!=="object"||A===null)return"";let K=zz[L.arrayFormat],M=K==="comma"&&L.commaRoundTrip;if(!D)D=Object.keys(A);if(L.sort)D.sort(L.sort);let W=new WeakMap;for(let Z=0;Z<D.length;++Z){let Q=D[Z];if(L.skipNulls&&A[Q]===null)continue;Pz(E,qz(A[Q],Q,K,M,L.allowEmptyArrays,L.strictNullHandling,L.skipNulls,L.encodeDotInKeys,L.encode?L.encoder:null,L.filter,L.sort,L.allowDots,L.serializeDate,L.format,L.formatter,L.encodeValuesOnly,L.charset,W))}let X=E.join(L.delimiter),J=L.addQueryPrefix===!0?"?":"";if(L.charsetSentinel)if(L.charset==="iso-8859-1")J+="utf8=%26%2310003%3B&";else J+="utf8=%E2%9C%93&";return X.length>0?J+X:""}function Nz(H){let $=0;for(let D of H)$+=D.length;let A=new Uint8Array($),L=0;for(let D of H)A.set(D,L),L+=D.length;return A}var Tz;function gD(H){let $;return(Tz??($=new globalThis.TextEncoder,Tz=$.encode.bind($)))(H)}var _z;function rQ(H){let $;return(_z??($=new globalThis.TextDecoder,_z=$.decode.bind($)))(H)}var S$,x$;class mD{constructor(){S$.set(this,void 0),x$.set(this,void 0),KH(this,S$,new Uint8Array,"f"),KH(this,x$,null,"f")}decode(H){if(H==null)return[];let $=H instanceof ArrayBuffer?new Uint8Array(H):typeof H==="string"?gD(H):H;KH(this,S$,Nz([b(this,S$,"f"),$]),"f");let A=[],L;while((L=Cl(b(this,S$,"f"),b(this,x$,"f")))!=null){if(L.carriage&&b(this,x$,"f")==null){KH(this,x$,L.index,"f");continue}if(b(this,x$,"f")!=null&&(L.index!==b(this,x$,"f")+1||L.carriage)){A.push(rQ(b(this,S$,"f").subarray(0,b(this,x$,"f")-1))),KH(this,S$,b(this,S$,"f").subarray(b(this,x$,"f")),"f"),KH(this,x$,null,"f");continue}let D=b(this,x$,"f")!==null?L.preceding-1:L.preceding,I=rQ(b(this,S$,"f").subarray(0,D));A.push(I),KH(this,S$,b(this,S$,"f").subarray(L.index),"f"),KH(this,x$,null,"f")}return A}flush(){if(!b(this,S$,"f").length)return[];return this.decode(`
|
|
620
|
+
`)}}S$=new WeakMap,x$=new WeakMap;mD.NEWLINE_CHARS=new Set([`
|
|
621
|
+
`,"\r"]);mD.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function Cl(H,$){for(let D=$??0;D<H.length;D++){if(H[D]===10)return{preceding:D,index:D+1,carriage:!1};if(H[D]===13)return{preceding:D,index:D+1,carriage:!0}}return null}function Fz(H){for(let L=0;L<H.length-1;L++){if(H[L]===10&&H[L+1]===10)return L+2;if(H[L]===13&&H[L+1]===13)return L+2;if(H[L]===13&&H[L+1]===10&&L+3<H.length&&H[L+2]===13&&H[L+3]===10)return L+4}return-1}var UK={off:0,error:200,warn:300,info:400,debug:500},eQ=(H,$,A)=>{if(!H)return;if(Ez(UK,H))return H;dH(A).warn(`${$} was set to ${JSON.stringify(H)}, expected one of ${JSON.stringify(Object.keys(UK))}`);return};function KE(){}function GK(H,$,A){if(!$||UK[H]>UK[A])return KE;else return $[H].bind($)}var zl={error:KE,warn:KE,info:KE,debug:KE},Oz=new WeakMap;function dH(H){let $=H.logger,A=H.logLevel??"off";if(!$)return zl;let L=Oz.get($);if(L&&L[0]===A)return L[1];let D={error:GK("error",$,A),warn:GK("warn",$,A),info:GK("info",$,A),debug:GK("debug",$,A)};return Oz.set($,[A,D]),D}var cA=(H)=>{if(H.options)H.options={...H.options},delete H.options.headers;if(H.headers)H.headers=Object.fromEntries((H.headers instanceof Headers?[...H.headers]:Object.entries(H.headers)).map(([$,A])=>[$,$.toLowerCase()==="authorization"||$.toLowerCase()==="cookie"||$.toLowerCase()==="set-cookie"?"***":A]));if("retryOfRequestLogID"in H){if(H.retryOfRequestLogID)H.retryOf=H.retryOfRequestLogID;delete H.retryOfRequestLogID}return H};var ME;class k${constructor(H,$,A){this.iterator=H,ME.set(this,void 0),this.controller=$,KH(this,ME,A,"f")}static fromSSEResponse(H,$,A){let L=!1,D=A?dH(A):console;async function*I(){if(L)throw new DH("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");L=!0;let E=!1;try{for await(let K of Pl(H,$)){if(E)continue;if(K.data.startsWith("[DONE]")){E=!0;continue}if(K.event===null||!K.event.startsWith("thread.")){let M;try{M=JSON.parse(K.data)}catch(W){throw D.error("Could not parse message into JSON:",K.data),D.error("From chunk:",K.raw),W}if(M&&M.error)throw new aH(void 0,M.error,void 0,H.headers);yield M}else{let M;try{M=JSON.parse(K.data)}catch(W){throw console.error("Could not parse message into JSON:",K.data),console.error("From chunk:",K.raw),W}if(K.event=="error")throw new aH(void 0,M.error,M.message,void 0);yield{event:K.event,data:M}}}E=!0}catch(K){if(aI(K))return;throw K}finally{if(!E)$.abort()}}return new k$(I,$,A)}static fromReadableStream(H,$,A){let L=!1;async function*D(){let E=new mD,K=lQ(H);for await(let M of K)for(let W of E.decode(M))yield W;for(let M of E.flush())yield M}async function*I(){if(L)throw new DH("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");L=!0;let E=!1;try{for await(let K of D()){if(E)continue;if(K)yield JSON.parse(K)}E=!0}catch(K){if(aI(K))return;throw K}finally{if(!E)$.abort()}}return new k$(I,$,A)}[(ME=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let H=[],$=[],A=this.iterator(),L=(D)=>{return{next:()=>{if(D.length===0){let I=A.next();H.push(I),$.push(I)}return D.shift()}}};return[new k$(()=>L(H),this.controller,b(this,ME,"f")),new k$(()=>L($),this.controller,b(this,ME,"f"))]}toReadableStream(){let H=this,$;return cQ({async start(){$=H[Symbol.asyncIterator]()},async pull(A){try{let{value:L,done:D}=await $.next();if(D)return A.close();let I=gD(JSON.stringify(L)+`
|
|
622
|
+
`);A.enqueue(I)}catch(L){A.error(L)}},async cancel(){await $.return?.()}})}}async function*Pl(H,$){if(!H.body){if($.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new DH("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new DH("Attempted to iterate over a response with no body")}let A=new wz,L=new mD,D=lQ(H.body);for await(let I of ql(D))for(let E of L.decode(I)){let K=A.decode(E);if(K)yield K}for(let I of L.flush()){let E=A.decode(I);if(E)yield E}}async function*ql(H){let $=new Uint8Array;for await(let A of H){if(A==null)continue;let L=A instanceof ArrayBuffer?new Uint8Array(A):typeof A==="string"?gD(A):A,D=new Uint8Array($.length+L.length);D.set($),D.set(L,$.length),$=D;let I;while((I=Fz($))!==-1)yield $.slice(0,I),$=$.slice(I)}if($.length>0)yield $}class wz{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(H){if(H.endsWith("\r"))H=H.substring(0,H.length-1);if(!H){if(!this.event&&!this.data.length)return null;let D={event:this.event,data:this.data.join(`
|
|
623
|
+
`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],D}if(this.chunks.push(H),H.startsWith(":"))return null;let[$,A,L]=Tl(H,":");if(L.startsWith(" "))L=L.substring(1);if($==="event")this.event=L;else if($==="data")this.data.push(L);return null}}function Tl(H,$){let A=H.indexOf($);if(A!==-1)return[H.substring(0,A),$,H.substring(A+$.length)];return[H,"",""]}async function VK(H,$){let{response:A,requestLogID:L,retryOfRequestLogID:D,startTime:I}=$,E=await(async()=>{if($.options.stream){if(dH(H).debug("response",A.status,A.url,A.headers,A.body),$.options.__streamClass)return $.options.__streamClass.fromSSEResponse(A,$.controller,H);return k$.fromSSEResponse(A,$.controller,H)}if(A.status===204)return null;if($.options.__binaryResponse)return A;let M=A.headers.get("content-type")?.split(";")[0]?.trim();if(M?.includes("application/json")||M?.endsWith("+json")){let J=await A.json();return HB(J,A)}return await A.text()})();return dH(H).debug(`[${L}] response parsed`,cA({retryOfRequestLogID:D,url:A.url,status:A.status,body:E,durationMs:Date.now()-I})),E}function HB(H,$){if(!H||typeof H!=="object"||Array.isArray(H))return H;return Object.defineProperty(H,"_request_id",{value:$.headers.get("x-request-id"),enumerable:!1})}var XE;class F0 extends Promise{constructor(H,$,A=VK){super((L)=>{L(null)});this.responsePromise=$,this.parseResponse=A,XE.set(this,void 0),KH(this,XE,H,"f")}_thenUnwrap(H){return new F0(b(this,XE,"f"),this.responsePromise,async($,A)=>HB(H(await this.parseResponse($,A),A),A.response))}asResponse(){return this.responsePromise.then((H)=>H.response)}async withResponse(){let[H,$]=await Promise.all([this.parse(),this.asResponse()]);return{data:H,response:$,request_id:$.headers.get("x-request-id")}}parse(){if(!this.parsedPromise)this.parsedPromise=this.responsePromise.then((H)=>this.parseResponse(b(this,XE,"f"),H));return this.parsedPromise}then(H,$){return this.parse().then(H,$)}catch(H){return this.parse().catch(H)}finally(H){return this.parse().finally(H)}}XE=new WeakMap;var CK;class zK{constructor(H,$,A,L){CK.set(this,void 0),KH(this,CK,H,"f"),this.options=L,this.response=$,this.body=A}hasNextPage(){if(!this.getPaginatedItems().length)return!1;return this.nextPageRequestOptions()!=null}async getNextPage(){let H=this.nextPageRequestOptions();if(!H)throw new DH("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await b(this,CK,"f").requestAPIList(this.constructor,H)}async*iterPages(){let H=this;yield H;while(H.hasNextPage())H=await H.getNextPage(),yield H}async*[(CK=new WeakMap,Symbol.asyncIterator)](){for await(let H of this.iterPages())for(let $ of H.getPaginatedItems())yield $}}class PK extends F0{constructor(H,$,A){super(H,$,async(L,D)=>new A(L,D.response,await VK(L,D),D.options))}async*[Symbol.asyncIterator](){let H=await this;for await(let $ of H)yield $}}class lA extends zK{constructor(H,$,A,L){super(H,$,A,L);this.data=A.data||[],this.object=A.object}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){return null}}class zH extends zK{constructor(H,$,A,L){super(H,$,A,L);this.data=A.data||[],this.has_more=A.has_more||!1}getPaginatedItems(){return this.data??[]}hasNextPage(){if(this.has_more===!1)return!1;return super.hasNextPage()}nextPageRequestOptions(){let H=this.getPaginatedItems(),$=H[H.length-1]?.id;if(!$)return null;return{...this.options,query:{...pQ(this.options.query),after:$}}}}class PL extends zK{constructor(H,$,A,L){super(H,$,A,L);this.data=A.data||[],this.has_more=A.has_more||!1,this.last_id=A.last_id||""}getPaginatedItems(){return this.data??[]}hasNextPage(){if(this.has_more===!1)return!1;return super.hasNextPage()}nextPageRequestOptions(){let H=this.last_id;if(!H)return null;return{...this.options,query:{...pQ(this.options.query),after:H}}}}var LB=()=>{if(typeof File>"u"){let{process:H}=globalThis,$=typeof H?.versions?.node==="string"&&parseInt(H.versions.node.split("."))<20;throw Error("`File` is not defined as a global, which is required for file uploads."+($?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function dD(H,$,A){return LB(),new File(H,$??"unknown_file",A)}function WE(H){return(typeof H==="object"&&H!==null&&(("name"in H)&&H.name&&String(H.name)||("url"in H)&&H.url&&String(H.url)||("filename"in H)&&H.filename&&String(H.filename)||("path"in H)&&H.path&&String(H.path))||"").split(/[\\/]/).pop()||void 0}var qK=(H)=>H!=null&&typeof H==="object"&&typeof H[Symbol.asyncIterator]==="function",DB=async(H,$)=>{if(!$B(H.body))return H;return{...H,body:await jz(H.body,$)}},y$=async(H,$)=>{return{...H,body:await jz(H.body,$)}},Rz=new WeakMap;function Nl(H){let $=typeof H==="function"?H:H.fetch,A=Rz.get($);if(A)return A;let L=(async()=>{try{let D="Response"in $?$.Response:(await $("data:,")).constructor,I=new FormData;if(I.toString()===await new D(I).text())return!1;return!0}catch{return!0}})();return Rz.set($,L),L}var jz=async(H,$)=>{if(!await Nl($))throw TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let A=new FormData;return await Promise.all(Object.entries(H||{}).map(([L,D])=>AB(A,L,D))),A},Sz=(H)=>H instanceof Blob&&("name"in H),Fl=(H)=>typeof H==="object"&&H!==null&&(H instanceof Response||qK(H)||Sz(H)),$B=(H)=>{if(Fl(H))return!0;if(Array.isArray(H))return H.some($B);if(H&&typeof H==="object"){for(let $ in H)if($B(H[$]))return!0}return!1},AB=async(H,$,A)=>{if(A===void 0)return;if(A==null)throw TypeError(`Received null for "${$}"; to pass null in FormData, you must use the string 'null'`);if(typeof A==="string"||typeof A==="number"||typeof A==="boolean")H.append($,String(A));else if(A instanceof Response)H.append($,dD([await A.blob()],WE(A)));else if(qK(A))H.append($,dD([await new Response(BK(A)).blob()],WE(A)));else if(Sz(A))H.append($,A,WE(A));else if(Array.isArray(A))await Promise.all(A.map((L)=>AB(H,$+"[]",L)));else if(typeof A==="object")await Promise.all(Object.entries(A).map(([L,D])=>AB(H,`${$}[${L}]`,D)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${A} instead`)};var xz=(H)=>H!=null&&typeof H==="object"&&typeof H.size==="number"&&typeof H.type==="string"&&typeof H.text==="function"&&typeof H.slice==="function"&&typeof H.arrayBuffer==="function",Ol=(H)=>H!=null&&typeof H==="object"&&typeof H.name==="string"&&typeof H.lastModified==="number"&&xz(H),wl=(H)=>H!=null&&typeof H==="object"&&typeof H.url==="string"&&typeof H.blob==="function";async function TK(H,$,A){if(LB(),H=await H,Ol(H)){if(H instanceof File)return H;return dD([await H.arrayBuffer()],H.name)}if(wl(H)){let D=await H.blob();return $||($=new URL(H.url).pathname.split(/[\\/]/).pop()),dD(await IB(D),$,A)}let L=await IB(H);if($||($=WE(H)),!A?.type){let D=L.find((I)=>typeof I==="object"&&("type"in I)&&I.type);if(typeof D==="string")A={...A,type:D}}return dD(L,$,A)}async function IB(H){let $=[];if(typeof H==="string"||ArrayBuffer.isView(H)||H instanceof ArrayBuffer)$.push(H);else if(xz(H))$.push(H instanceof Blob?H:await H.arrayBuffer());else if(qK(H))for await(let A of H)$.push(...await IB(A));else{let A=H?.constructor?.name;throw Error(`Unexpected data type: ${typeof H}${A?`; constructor: ${A}`:""}${Rl(H)}`)}return $}function Rl(H){if(typeof H!=="object"||H===null)return"";return`; props: [${Object.getOwnPropertyNames(H).map((A)=>`"${A}"`).join(", ")}]`}class i{constructor(H){this._client=H}}function yz(H){return H.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var kz=Object.freeze(Object.create(null)),Sl=(H=yz)=>function $(A,...L){if(A.length===1)return A[0];let D=!1,I=[],E=A.reduce((X,J,Z)=>{if(/[?#]/.test(J))D=!0;let Q=L[Z],B=(D?encodeURIComponent:H)(""+Q);if(Z!==L.length&&(Q==null||typeof Q==="object"&&Q.toString===Object.getPrototypeOf(Object.getPrototypeOf(Q.hasOwnProperty??kz)??kz)?.toString))B=Q+"",I.push({start:X.length+J.length,length:B.length,error:`Value of type ${Object.prototype.toString.call(Q).slice(8,-1)} is not a valid path parameter`});return X+J+(Z===L.length?"":B)},""),K=E.split(/[?#]/,1)[0],M=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,W;while((W=M.exec(K))!==null)I.push({start:W.index,length:W[0].length,error:`Value "${W[0]}" can't be safely passed as a path parameter`});if(I.sort((X,J)=>X.start-J.start),I.length>0){let X=0,J=I.reduce((Z,Q)=>{let B=" ".repeat(Q.start-X),Y="^".repeat(Q.length);return X=Q.start+Q.length,Z+B+Y},"");throw new DH(`Path parameters result in path with invalid segments:
|
|
624
|
+
${I.map((Z)=>Z.error).join(`
|
|
625
|
+
`)}
|
|
626
|
+
${E}
|
|
627
|
+
${J}`)}return E},c=Sl(yz);class pD extends i{list(H,$={},A){return this._client.getAPIList(c`/chat/completions/${H}/messages`,zH,{query:$,...A})}}function QE(H){return H!==void 0&&"function"in H&&H.function!==void 0}function BE(H){return H?.$brand==="auto-parseable-response-format"}function O0(H){return H?.$brand==="auto-parseable-tool"}function fz(H,$){if(!$||!EB($))return{...H,choices:H.choices.map((A)=>{return bz(A.message.tool_calls),{...A,message:{...A.message,parsed:null,...A.message.tool_calls?{tool_calls:A.message.tool_calls}:void 0}}})};return JE(H,$)}function JE(H,$){let A=H.choices.map((L)=>{if(L.finish_reason==="length")throw new DE;if(L.finish_reason==="content_filter")throw new IE;return bz(L.message.tool_calls),{...L,message:{...L.message,...L.message.tool_calls?{tool_calls:L.message.tool_calls?.map((D)=>fl($,D))??void 0}:void 0,parsed:L.message.content&&!L.message.refusal?yl($,L.message.content):null}}});return{...H,choices:A}}function yl(H,$){if(H.response_format?.type!=="json_schema")return null;if(H.response_format?.type==="json_schema"){if("$parseRaw"in H.response_format)return H.response_format.$parseRaw($);return JSON.parse($)}return null}function fl(H,$){let A=H.tools?.find((L)=>QE(L)&&L.function?.name===$.function.name);return{...$,function:{...$.function,parsed_arguments:O0(A)?A.$parseRaw($.function.arguments):A?.function.strict?JSON.parse($.function.arguments):null}}}function vz(H,$){if(!H||!("tools"in H)||!H.tools)return!1;let A=H.tools?.find((L)=>QE(L)&&L.function?.name===$.function.name);return QE(A)&&(O0(A)||A?.function.strict||!1)}function EB(H){if(BE(H.response_format))return!0;return H.tools?.some(($)=>O0($)||$.type==="function"&&$.function.strict===!0)??!1}function bz(H){for(let $ of H||[])if($.type!=="function")throw new DH(`Currently only \`function\` tool calls are supported; Received \`${$.type}\``)}function hz(H){for(let $ of H??[]){if($.type!=="function")throw new DH(`Currently only \`function\` tool types support auto-parsing; Received \`${$.type}\``);if($.function.strict!==!0)throw new DH(`The \`${$.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`)}}var cD=(H)=>{return H?.role==="assistant"},KB=(H)=>{return H?.role==="tool"};var MB,_K,NK,ZE,YE,FK,GE,iA,UE,OK,wK,lD,uz;class w0{constructor(){MB.add(this),this.controller=new AbortController,_K.set(this,void 0),NK.set(this,()=>{}),ZE.set(this,()=>{}),YE.set(this,void 0),FK.set(this,()=>{}),GE.set(this,()=>{}),iA.set(this,{}),UE.set(this,!1),OK.set(this,!1),wK.set(this,!1),lD.set(this,!1),KH(this,_K,new Promise((H,$)=>{KH(this,NK,H,"f"),KH(this,ZE,$,"f")}),"f"),KH(this,YE,new Promise((H,$)=>{KH(this,FK,H,"f"),KH(this,GE,$,"f")}),"f"),b(this,_K,"f").catch(()=>{}),b(this,YE,"f").catch(()=>{})}_run(H){setTimeout(()=>{H().then(()=>{this._emitFinal(),this._emit("end")},b(this,MB,"m",uz).bind(this))},0)}_connected(){if(this.ended)return;b(this,NK,"f").call(this),this._emit("connect")}get ended(){return b(this,UE,"f")}get errored(){return b(this,OK,"f")}get aborted(){return b(this,wK,"f")}abort(){this.controller.abort()}on(H,$){return(b(this,iA,"f")[H]||(b(this,iA,"f")[H]=[])).push({listener:$}),this}off(H,$){let A=b(this,iA,"f")[H];if(!A)return this;let L=A.findIndex((D)=>D.listener===$);if(L>=0)A.splice(L,1);return this}once(H,$){return(b(this,iA,"f")[H]||(b(this,iA,"f")[H]=[])).push({listener:$,once:!0}),this}emitted(H){return new Promise(($,A)=>{if(KH(this,lD,!0,"f"),H!=="error")this.once("error",A);this.once(H,$)})}async done(){KH(this,lD,!0,"f"),await b(this,YE,"f")}_emit(H,...$){if(b(this,UE,"f"))return;if(H==="end")KH(this,UE,!0,"f"),b(this,FK,"f").call(this);let A=b(this,iA,"f")[H];if(A)b(this,iA,"f")[H]=A.filter((L)=>!L.once),A.forEach(({listener:L})=>L(...$));if(H==="abort"){let L=$[0];if(!b(this,lD,"f")&&!A?.length)Promise.reject(L);b(this,ZE,"f").call(this,L),b(this,GE,"f").call(this,L),this._emit("end");return}if(H==="error"){let L=$[0];if(!b(this,lD,"f")&&!A?.length)Promise.reject(L);b(this,ZE,"f").call(this,L),b(this,GE,"f").call(this,L),this._emit("end")}}_emitFinal(){}}_K=new WeakMap,NK=new WeakMap,ZE=new WeakMap,YE=new WeakMap,FK=new WeakMap,GE=new WeakMap,iA=new WeakMap,UE=new WeakMap,OK=new WeakMap,wK=new WeakMap,lD=new WeakMap,MB=new WeakSet,uz=function H($){if(KH(this,OK,!0,"f"),$ instanceof Error&&$.name==="AbortError")$=new sH;if($ instanceof sH)return KH(this,wK,!0,"f"),this._emit("abort",$);if($ instanceof DH)return this._emit("error",$);if($ instanceof Error){let A=new DH($.message);return A.cause=$,this._emit("error",A)}return this._emit("error",new DH(String($)))};function gz(H){return typeof H.parse==="function"}var U$,XB,RK,WB,QB,BB,mz,dz,vl=10;class VE extends w0{constructor(){super(...arguments);U$.add(this),this._chatCompletions=[],this.messages=[]}_addChatCompletion(H){this._chatCompletions.push(H),this._emit("chatCompletion",H);let $=H.choices[0]?.message;if($)this._addMessage($);return H}_addMessage(H,$=!0){if(!("content"in H))H.content=null;if(this.messages.push(H),$){if(this._emit("message",H),KB(H)&&H.content)this._emit("functionToolCallResult",H.content);else if(cD(H)&&H.tool_calls){for(let A of H.tool_calls)if(A.type==="function")this._emit("functionToolCall",A.function)}}}async finalChatCompletion(){await this.done();let H=this._chatCompletions[this._chatCompletions.length-1];if(!H)throw new DH("stream ended without producing a ChatCompletion");return H}async finalContent(){return await this.done(),b(this,U$,"m",XB).call(this)}async finalMessage(){return await this.done(),b(this,U$,"m",RK).call(this)}async finalFunctionToolCall(){return await this.done(),b(this,U$,"m",WB).call(this)}async finalFunctionToolCallResult(){return await this.done(),b(this,U$,"m",QB).call(this)}async totalUsage(){return await this.done(),b(this,U$,"m",BB).call(this)}allChatCompletions(){return[...this._chatCompletions]}_emitFinal(){let H=this._chatCompletions[this._chatCompletions.length-1];if(H)this._emit("finalChatCompletion",H);let $=b(this,U$,"m",RK).call(this);if($)this._emit("finalMessage",$);let A=b(this,U$,"m",XB).call(this);if(A)this._emit("finalContent",A);let L=b(this,U$,"m",WB).call(this);if(L)this._emit("finalFunctionToolCall",L);let D=b(this,U$,"m",QB).call(this);if(D!=null)this._emit("finalFunctionToolCallResult",D);if(this._chatCompletions.some((I)=>I.usage))this._emit("totalUsage",b(this,U$,"m",BB).call(this))}async _createChatCompletion(H,$,A){let L=A?.signal;if(L){if(L.aborted)this.controller.abort();L.addEventListener("abort",()=>this.controller.abort())}b(this,U$,"m",mz).call(this,$);let D=await H.chat.completions.create({...$,stream:!1},{...A,signal:this.controller.signal});return this._connected(),this._addChatCompletion(JE(D,$))}async _runChatCompletion(H,$,A){for(let L of $.messages)this._addMessage(L,!1);return await this._createChatCompletion(H,$,A)}async _runTools(H,$,A){let{tool_choice:D="auto",stream:I,...E}=$,K=typeof D!=="string"&&D.type==="function"&&D?.function?.name,{maxChatCompletions:M=vl}=A||{},W=$.tools.map((Z)=>{if(O0(Z)){if(!Z.$callback)throw new DH("Tool given to `.runTools()` that does not have an associated function");return{type:"function",function:{function:Z.$callback,name:Z.function.name,description:Z.function.description||"",parameters:Z.function.parameters,parse:Z.$parseRaw,strict:!0}}}return Z}),X={};for(let Z of W)if(Z.type==="function")X[Z.function.name||Z.function.function.name]=Z.function;let J="tools"in $?W.map((Z)=>Z.type==="function"?{type:"function",function:{name:Z.function.name||Z.function.function.name,parameters:Z.function.parameters,description:Z.function.description,strict:Z.function.strict}}:Z):void 0;for(let Z of $.messages)this._addMessage(Z,!1);for(let Z=0;Z<M;++Z){let B=(await this._createChatCompletion(H,{...E,tool_choice:D,tools:J,messages:[...this.messages]},A)).choices[0]?.message;if(!B)throw new DH("missing message in ChatCompletion response");if(!B.tool_calls?.length)return;for(let Y of B.tool_calls){if(Y.type!=="function")continue;let G=Y.id,{name:U,arguments:V}=Y.function,z=X[U];if(!z){let O=`Invalid tool_call: ${JSON.stringify(U)}. Available options are: ${Object.keys(X).map((N)=>JSON.stringify(N)).join(", ")}. Please try again`;this._addMessage({role:"tool",tool_call_id:G,content:O});continue}else if(K&&K!==U){let O=`Invalid tool_call: ${JSON.stringify(U)}. ${JSON.stringify(K)} requested. Please try again`;this._addMessage({role:"tool",tool_call_id:G,content:O});continue}let P;try{P=gz(z)?await z.parse(V):V}catch(O){let N=O instanceof Error?O.message:String(O);this._addMessage({role:"tool",tool_call_id:G,content:N});continue}let T=await z.function(P,this),q=b(this,U$,"m",dz).call(this,T);if(this._addMessage({role:"tool",tool_call_id:G,content:q}),K)return}}return}}U$=new WeakSet,XB=function H(){return b(this,U$,"m",RK).call(this).content??null},RK=function H(){let $=this.messages.length;while($-- >0){let A=this.messages[$];if(cD(A))return{...A,content:A.content??null,refusal:A.refusal??null}}throw new DH("stream ended without producing a ChatCompletionMessage with role=assistant")},WB=function H(){for(let $=this.messages.length-1;$>=0;$--){let A=this.messages[$];if(cD(A)&&A?.tool_calls?.length)return A.tool_calls.filter((L)=>L.type==="function").at(-1)?.function}return},QB=function H(){for(let $=this.messages.length-1;$>=0;$--){let A=this.messages[$];if(KB(A)&&A.content!=null&&typeof A.content==="string"&&this.messages.some((L)=>L.role==="assistant"&&L.tool_calls?.some((D)=>D.type==="function"&&D.id===A.tool_call_id)))return A.content}return},BB=function H(){let $={completion_tokens:0,prompt_tokens:0,total_tokens:0};for(let{usage:A}of this._chatCompletions)if(A)$.completion_tokens+=A.completion_tokens,$.prompt_tokens+=A.prompt_tokens,$.total_tokens+=A.total_tokens;return $},mz=function H($){if($.n!=null&&$.n>1)throw new DH("ChatCompletion convenience helpers only support n=1 at this time. To use n>1, please use chat.completions.create() directly.")},dz=function H($){return typeof $==="string"?$:$===void 0?"undefined":JSON.stringify($)};class CE extends VE{static runTools(H,$,A){let L=new CE,D={...A,headers:{...A?.headers,"X-Stainless-Helper-Method":"runTools"}};return L._run(()=>L._runTools(H,$,D)),L}_addMessage(H,$=!0){if(super._addMessage(H,$),cD(H)&&H.content)this._emit("content",H.content)}}var D$={STR:1,NUM:2,ARR:4,OBJ:8,NULL:16,BOOL:32,NAN:64,INFINITY:128,MINUS_INFINITY:256,INF:384,SPECIAL:496,ATOM:499,COLLECTION:12,ALL:511};class pz extends Error{}class cz extends Error{}function bl(H,$=D$.ALL){if(typeof H!=="string")throw TypeError(`expecting str, got ${typeof H}`);if(!H.trim())throw Error(`${H} is empty`);return hl(H.trim(),$)}var hl=(H,$)=>{let A=H.length,L=0,D=(Z)=>{throw new pz(`${Z} at position ${L}`)},I=(Z)=>{throw new cz(`${Z} at position ${L}`)},E=()=>{if(J(),L>=A)D("Unexpected end of input");if(H[L]==='"')return K();if(H[L]==="{")return M();if(H[L]==="[")return W();if(H.substring(L,L+4)==="null"||D$.NULL&$&&A-L<4&&"null".startsWith(H.substring(L)))return L+=4,null;if(H.substring(L,L+4)==="true"||D$.BOOL&$&&A-L<4&&"true".startsWith(H.substring(L)))return L+=4,!0;if(H.substring(L,L+5)==="false"||D$.BOOL&$&&A-L<5&&"false".startsWith(H.substring(L)))return L+=5,!1;if(H.substring(L,L+8)==="Infinity"||D$.INFINITY&$&&A-L<8&&"Infinity".startsWith(H.substring(L)))return L+=8,1/0;if(H.substring(L,L+9)==="-Infinity"||D$.MINUS_INFINITY&$&&1<A-L&&A-L<9&&"-Infinity".startsWith(H.substring(L)))return L+=9,-1/0;if(H.substring(L,L+3)==="NaN"||D$.NAN&$&&A-L<3&&"NaN".startsWith(H.substring(L)))return L+=3,NaN;return X()},K=()=>{let Z=L,Q=!1;L++;while(L<A&&(H[L]!=='"'||Q&&H[L-1]==="\\"))Q=H[L]==="\\"?!Q:!1,L++;if(H.charAt(L)=='"')try{return JSON.parse(H.substring(Z,++L-Number(Q)))}catch(B){I(String(B))}else if(D$.STR&$)try{return JSON.parse(H.substring(Z,L-Number(Q))+'"')}catch(B){return JSON.parse(H.substring(Z,H.lastIndexOf("\\"))+'"')}D("Unterminated string literal")},M=()=>{L++,J();let Z={};try{while(H[L]!=="}"){if(J(),L>=A&&D$.OBJ&$)return Z;let Q=K();J(),L++;try{let B=E();Object.defineProperty(Z,Q,{value:B,writable:!0,enumerable:!0,configurable:!0})}catch(B){if(D$.OBJ&$)return Z;else throw B}if(J(),H[L]===",")L++}}catch(Q){if(D$.OBJ&$)return Z;else D("Expected '}' at end of object")}return L++,Z},W=()=>{L++;let Z=[];try{while(H[L]!=="]")if(Z.push(E()),J(),H[L]===",")L++}catch(Q){if(D$.ARR&$)return Z;D("Expected ']' at end of array")}return L++,Z},X=()=>{if(L===0){if(H==="-"&&D$.NUM&$)D("Not sure what '-' is");try{return JSON.parse(H)}catch(Q){if(D$.NUM&$)try{if(H[H.length-1]===".")return JSON.parse(H.substring(0,H.lastIndexOf(".")));return JSON.parse(H.substring(0,H.lastIndexOf("e")))}catch(B){}I(String(Q))}}let Z=L;if(H[L]==="-")L++;while(H[L]&&!",]}".includes(H[L]))L++;if(L==A&&!(D$.NUM&$))D("Unterminated number literal");try{return JSON.parse(H.substring(Z,L))}catch(Q){if(H.substring(Z,L)==="-"&&D$.NUM&$)D("Not sure what '-' is");try{return JSON.parse(H.substring(Z,H.lastIndexOf("e")))}catch(B){I(String(B))}}},J=()=>{while(L<A&&`
|
|
628
|
+
\r `.includes(H[L]))L++};return E()},JB=(H)=>bl(H,D$.ALL^D$.NUM);var eH,nA,iD,qL,ZB,jK,YB,GB,UB,SK,VB,lz;class TL extends VE{constructor(H){super();eH.add(this),nA.set(this,void 0),iD.set(this,void 0),qL.set(this,void 0),KH(this,nA,H,"f"),KH(this,iD,[],"f")}get currentChatCompletionSnapshot(){return b(this,qL,"f")}static fromReadableStream(H){let $=new TL(null);return $._run(()=>$._fromReadableStream(H)),$}static createChatCompletion(H,$,A){let L=new TL($);return L._run(()=>L._runChatCompletion(H,{...$,stream:!0},{...A,headers:{...A?.headers,"X-Stainless-Helper-Method":"stream"}})),L}async _createChatCompletion(H,$,A){super._createChatCompletion;let L=A?.signal;if(L){if(L.aborted)this.controller.abort();L.addEventListener("abort",()=>this.controller.abort())}b(this,eH,"m",ZB).call(this);let D=await H.chat.completions.create({...$,stream:!0},{...A,signal:this.controller.signal});this._connected();for await(let I of D)b(this,eH,"m",YB).call(this,I);if(D.controller.signal?.aborted)throw new sH;return this._addChatCompletion(b(this,eH,"m",SK).call(this))}async _fromReadableStream(H,$){let A=$?.signal;if(A){if(A.aborted)this.controller.abort();A.addEventListener("abort",()=>this.controller.abort())}b(this,eH,"m",ZB).call(this),this._connected();let L=k$.fromReadableStream(H,this.controller),D;for await(let I of L){if(D&&D!==I.id)this._addChatCompletion(b(this,eH,"m",SK).call(this));b(this,eH,"m",YB).call(this,I),D=I.id}if(L.controller.signal?.aborted)throw new sH;return this._addChatCompletion(b(this,eH,"m",SK).call(this))}[(nA=new WeakMap,iD=new WeakMap,qL=new WeakMap,eH=new WeakSet,ZB=function H(){if(this.ended)return;KH(this,qL,void 0,"f")},jK=function H($){let A=b(this,iD,"f")[$.index];if(A)return A;return A={content_done:!1,refusal_done:!1,logprobs_content_done:!1,logprobs_refusal_done:!1,done_tool_calls:new Set,current_tool_call_index:null},b(this,iD,"f")[$.index]=A,A},YB=function H($){if(this.ended)return;let A=b(this,eH,"m",lz).call(this,$);this._emit("chunk",$,A);for(let L of $.choices){let D=A.choices[L.index];if(L.delta.content!=null&&D.message?.role==="assistant"&&D.message?.content)this._emit("content",L.delta.content,D.message.content),this._emit("content.delta",{delta:L.delta.content,snapshot:D.message.content,parsed:D.message.parsed});if(L.delta.refusal!=null&&D.message?.role==="assistant"&&D.message?.refusal)this._emit("refusal.delta",{delta:L.delta.refusal,snapshot:D.message.refusal});if(L.logprobs?.content!=null&&D.message?.role==="assistant")this._emit("logprobs.content.delta",{content:L.logprobs?.content,snapshot:D.logprobs?.content??[]});if(L.logprobs?.refusal!=null&&D.message?.role==="assistant")this._emit("logprobs.refusal.delta",{refusal:L.logprobs?.refusal,snapshot:D.logprobs?.refusal??[]});let I=b(this,eH,"m",jK).call(this,D);if(D.finish_reason){if(b(this,eH,"m",UB).call(this,D),I.current_tool_call_index!=null)b(this,eH,"m",GB).call(this,D,I.current_tool_call_index)}for(let E of L.delta.tool_calls??[]){if(I.current_tool_call_index!==E.index){if(b(this,eH,"m",UB).call(this,D),I.current_tool_call_index!=null)b(this,eH,"m",GB).call(this,D,I.current_tool_call_index)}I.current_tool_call_index=E.index}for(let E of L.delta.tool_calls??[]){let K=D.message.tool_calls?.[E.index];if(!K?.type)continue;if(K?.type==="function")this._emit("tool_calls.function.arguments.delta",{name:K.function?.name,index:E.index,arguments:K.function.arguments,parsed_arguments:K.function.parsed_arguments,arguments_delta:E.function?.arguments??""});else nz(K?.type)}}},GB=function H($,A){if(b(this,eH,"m",jK).call(this,$).done_tool_calls.has(A))return;let D=$.message.tool_calls?.[A];if(!D)throw Error("no tool call snapshot");if(!D.type)throw Error("tool call snapshot missing `type`");if(D.type==="function"){let I=b(this,nA,"f")?.tools?.find((E)=>QE(E)&&E.function.name===D.function.name);this._emit("tool_calls.function.arguments.done",{name:D.function.name,index:A,arguments:D.function.arguments,parsed_arguments:O0(I)?I.$parseRaw(D.function.arguments):I?.function.strict?JSON.parse(D.function.arguments):null})}else nz(D.type)},UB=function H($){let A=b(this,eH,"m",jK).call(this,$);if($.message.content&&!A.content_done){A.content_done=!0;let L=b(this,eH,"m",VB).call(this);this._emit("content.done",{content:$.message.content,parsed:L?L.$parseRaw($.message.content):null})}if($.message.refusal&&!A.refusal_done)A.refusal_done=!0,this._emit("refusal.done",{refusal:$.message.refusal});if($.logprobs?.content&&!A.logprobs_content_done)A.logprobs_content_done=!0,this._emit("logprobs.content.done",{content:$.logprobs.content});if($.logprobs?.refusal&&!A.logprobs_refusal_done)A.logprobs_refusal_done=!0,this._emit("logprobs.refusal.done",{refusal:$.logprobs.refusal})},SK=function H(){if(this.ended)throw new DH("stream has ended, this shouldn't happen");let $=b(this,qL,"f");if(!$)throw new DH("request ended without sending any chunks");return KH(this,qL,void 0,"f"),KH(this,iD,[],"f"),ul($,b(this,nA,"f"))},VB=function H(){let $=b(this,nA,"f")?.response_format;if(BE($))return $;return null},lz=function H($){var A,L,D,I;let E=b(this,qL,"f"),{choices:K,...M}=$;if(!E)E=KH(this,qL,{...M,choices:[]},"f");else Object.assign(E,M);for(let{delta:W,finish_reason:X,index:J,logprobs:Z=null,...Q}of $.choices){let B=E.choices[J];if(!B)B=E.choices[J]={finish_reason:X,index:J,message:{},logprobs:Z,...Q};if(Z)if(!B.logprobs)B.logprobs=Object.assign({},Z);else{let{content:T,refusal:q,...O}=Z;if(iz(O),Object.assign(B.logprobs,O),T)(A=B.logprobs).content??(A.content=[]),B.logprobs.content.push(...T);if(q)(L=B.logprobs).refusal??(L.refusal=[]),B.logprobs.refusal.push(...q)}if(X){if(B.finish_reason=X,b(this,nA,"f")&&EB(b(this,nA,"f"))){if(X==="length")throw new DE;if(X==="content_filter")throw new IE}}if(Object.assign(B,Q),!W)continue;let{content:Y,refusal:G,function_call:U,role:V,tool_calls:z,...P}=W;if(iz(P),Object.assign(B.message,P),G)B.message.refusal=(B.message.refusal||"")+G;if(V)B.message.role=V;if(U)if(!B.message.function_call)B.message.function_call=U;else{if(U.name)B.message.function_call.name=U.name;if(U.arguments)(D=B.message.function_call).arguments??(D.arguments=""),B.message.function_call.arguments+=U.arguments}if(Y){if(B.message.content=(B.message.content||"")+Y,!B.message.refusal&&b(this,eH,"m",VB).call(this))B.message.parsed=JB(B.message.content)}if(z){if(!B.message.tool_calls)B.message.tool_calls=[];for(let{index:T,id:q,type:O,function:N,...x}of z){let w=(I=B.message.tool_calls)[T]??(I[T]={});if(Object.assign(w,x),q)w.id=q;if(O)w.type=O;if(N)w.function??(w.function={name:N.name??"",arguments:""});if(N?.name)w.function.name=N.name;if(N?.arguments){if(w.function.arguments+=N.arguments,vz(b(this,nA,"f"),w))w.function.parsed_arguments=JB(w.function.arguments)}}}}return E},Symbol.asyncIterator)](){let H=[],$=[],A=!1;return this.on("chunk",(L)=>{let D=$.shift();if(D)D.resolve(L);else H.push(L)}),this.on("end",()=>{A=!0;for(let L of $)L.resolve(void 0);$.length=0}),this.on("abort",(L)=>{A=!0;for(let D of $)D.reject(L);$.length=0}),this.on("error",(L)=>{A=!0;for(let D of $)D.reject(L);$.length=0}),{next:async()=>{if(!H.length){if(A)return{value:void 0,done:!0};return new Promise((D,I)=>$.push({resolve:D,reject:I})).then((D)=>D?{value:D,done:!1}:{value:void 0,done:!0})}return{value:H.shift(),done:!1}},return:async()=>{return this.abort(),{value:void 0,done:!0}}}}toReadableStream(){return new k$(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}function ul(H,$){let{id:A,choices:L,created:D,model:I,system_fingerprint:E,...K}=H,M={...K,id:A,choices:L.map(({message:W,finish_reason:X,index:J,logprobs:Z,...Q})=>{if(!X)throw new DH(`missing finish_reason for choice ${J}`);let{content:B=null,function_call:Y,tool_calls:G,...U}=W,V=W.role;if(!V)throw new DH(`missing role for choice ${J}`);if(Y){let{arguments:z,name:P}=Y;if(z==null)throw new DH(`missing function_call.arguments for choice ${J}`);if(!P)throw new DH(`missing function_call.name for choice ${J}`);return{...Q,message:{content:B,function_call:{arguments:z,name:P},role:V,refusal:W.refusal??null},finish_reason:X,index:J,logprobs:Z}}if(G)return{...Q,index:J,finish_reason:X,logprobs:Z,message:{...U,role:V,content:B,refusal:W.refusal??null,tool_calls:G.map((z,P)=>{let{function:T,type:q,id:O,...N}=z,{arguments:x,name:w,...F}=T||{};if(O==null)throw new DH(`missing choices[${J}].tool_calls[${P}].id
|
|
629
|
+
${xK(H)}`);if(q==null)throw new DH(`missing choices[${J}].tool_calls[${P}].type
|
|
630
|
+
${xK(H)}`);if(w==null)throw new DH(`missing choices[${J}].tool_calls[${P}].function.name
|
|
631
|
+
${xK(H)}`);if(x==null)throw new DH(`missing choices[${J}].tool_calls[${P}].function.arguments
|
|
632
|
+
${xK(H)}`);return{...N,id:O,type:q,function:{...F,name:w,arguments:x}}})}};return{...Q,message:{...U,content:B,role:V,refusal:W.refusal??null},finish_reason:X,index:J,logprobs:Z}}),created:D,model:I,object:"chat.completion",...E?{system_fingerprint:E}:{}};return fz(M,$)}function xK(H){return JSON.stringify(H)}function iz(H){return}function nz(H){}class nD extends TL{static fromReadableStream(H){let $=new nD(null);return $._run(()=>$._fromReadableStream(H)),$}static runTools(H,$,A){let L=new nD($),D={...A,headers:{...A?.headers,"X-Stainless-Helper-Method":"runTools"}};return L._run(()=>L._runTools(H,$,D)),L}}class _L extends i{constructor(){super(...arguments);this.messages=new pD(this._client)}create(H,$){return this._client.post("/chat/completions",{body:H,...$,stream:H.stream??!1})}retrieve(H,$){return this._client.get(c`/chat/completions/${H}`,$)}update(H,$,A){return this._client.post(c`/chat/completions/${H}`,{body:$,...A})}list(H={},$){return this._client.getAPIList("/chat/completions",zH,{query:H,...$})}delete(H,$){return this._client.delete(c`/chat/completions/${H}`,$)}parse(H,$){return hz(H.tools),this._client.chat.completions.create(H,{...$,headers:{...$?.headers,"X-Stainless-Helper-Method":"chat.completions.parse"}})._thenUnwrap((A)=>JE(A,H))}runTools(H,$){if(H.stream)return nD.runTools(this._client,H,$);return CE.runTools(this._client,H,$)}stream(H,$){return TL.createChatCompletion(this._client,H,$)}}_L.Messages=pD;class R0 extends i{constructor(){super(...arguments);this.completions=new _L(this._client)}}R0.Completions=_L;var az=Symbol("brand.privateNullableHeaders");function*ml(H){if(!H)return;if(az in H){let{values:L,nulls:D}=H;yield*L.entries();for(let I of D)yield[I,null];return}let $=!1,A;if(H instanceof Headers)A=H.entries();else if(dQ(H))A=H;else $=!0,A=Object.entries(H??{});for(let L of A){let D=L[0];if(typeof D!=="string")throw TypeError("expected header name to be a string");let I=dQ(L[1])?L[1]:[L[1]],E=!1;for(let K of I){if(K===void 0)continue;if($&&!E)E=!0,yield[D,null];yield[D,K]}}}var r=(H)=>{let $=new Headers,A=new Set;for(let L of H){let D=new Set;for(let[I,E]of ml(L)){let K=I.toLowerCase();if(!D.has(K))$.delete(I),D.add(K);if(E===null)$.delete(I),A.add(K);else $.append(I,E),A.delete(K)}}return{[az]:!0,values:$,nulls:A}};class zE extends i{create(H,$){return this._client.post("/audio/speech",{body:H,...$,headers:r([{Accept:"application/octet-stream"},$?.headers]),__binaryResponse:!0})}}class PE extends i{create(H,$){return this._client.post("/audio/transcriptions",y$({body:H,...$,stream:H.stream??!1,__metadata:{model:H.model}},this._client))}}class qE extends i{create(H,$){return this._client.post("/audio/translations",y$({body:H,...$,__metadata:{model:H.model}},this._client))}}class aA extends i{constructor(){super(...arguments);this.transcriptions=new PE(this._client),this.translations=new qE(this._client),this.speech=new zE(this._client)}}aA.Transcriptions=PE;aA.Translations=qE;aA.Speech=zE;class aD extends i{create(H,$){return this._client.post("/batches",{body:H,...$})}retrieve(H,$){return this._client.get(c`/batches/${H}`,$)}list(H={},$){return this._client.getAPIList("/batches",zH,{query:H,...$})}cancel(H,$){return this._client.post(c`/batches/${H}/cancel`,$)}}class TE extends i{create(H,$){return this._client.post("/assistants",{body:H,...$,headers:r([{"OpenAI-Beta":"assistants=v2"},$?.headers])})}retrieve(H,$){return this._client.get(c`/assistants/${H}`,{...$,headers:r([{"OpenAI-Beta":"assistants=v2"},$?.headers])})}update(H,$,A){return this._client.post(c`/assistants/${H}`,{body:$,...A,headers:r([{"OpenAI-Beta":"assistants=v2"},A?.headers])})}list(H={},$){return this._client.getAPIList("/assistants",zH,{query:H,...$,headers:r([{"OpenAI-Beta":"assistants=v2"},$?.headers])})}delete(H,$){return this._client.delete(c`/assistants/${H}`,{...$,headers:r([{"OpenAI-Beta":"assistants=v2"},$?.headers])})}}class _E extends i{create(H,$){return this._client.post("/realtime/sessions",{body:H,...$,headers:r([{"OpenAI-Beta":"assistants=v2"},$?.headers])})}}class NE extends i{create(H,$){return this._client.post("/realtime/transcription_sessions",{body:H,...$,headers:r([{"OpenAI-Beta":"assistants=v2"},$?.headers])})}}class j0 extends i{constructor(){super(...arguments);this.sessions=new _E(this._client),this.transcriptionSessions=new NE(this._client)}}j0.Sessions=_E;j0.TranscriptionSessions=NE;class FE extends i{create(H,$){return this._client.post("/chatkit/sessions",{body:H,...$,headers:r([{"OpenAI-Beta":"chatkit_beta=v1"},$?.headers])})}cancel(H,$){return this._client.post(c`/chatkit/sessions/${H}/cancel`,{...$,headers:r([{"OpenAI-Beta":"chatkit_beta=v1"},$?.headers])})}}class OE extends i{retrieve(H,$){return this._client.get(c`/chatkit/threads/${H}`,{...$,headers:r([{"OpenAI-Beta":"chatkit_beta=v1"},$?.headers])})}list(H={},$){return this._client.getAPIList("/chatkit/threads",PL,{query:H,...$,headers:r([{"OpenAI-Beta":"chatkit_beta=v1"},$?.headers])})}delete(H,$){return this._client.delete(c`/chatkit/threads/${H}`,{...$,headers:r([{"OpenAI-Beta":"chatkit_beta=v1"},$?.headers])})}listItems(H,$={},A){return this._client.getAPIList(c`/chatkit/threads/${H}/items`,PL,{query:$,...A,headers:r([{"OpenAI-Beta":"chatkit_beta=v1"},A?.headers])})}}class S0 extends i{constructor(){super(...arguments);this.sessions=new FE(this._client),this.threads=new OE(this._client)}}S0.Sessions=FE;S0.Threads=OE;class wE extends i{create(H,$,A){return this._client.post(c`/threads/${H}/messages`,{body:$,...A,headers:r([{"OpenAI-Beta":"assistants=v2"},A?.headers])})}retrieve(H,$,A){let{thread_id:L}=$;return this._client.get(c`/threads/${L}/messages/${H}`,{...A,headers:r([{"OpenAI-Beta":"assistants=v2"},A?.headers])})}update(H,$,A){let{thread_id:L,...D}=$;return this._client.post(c`/threads/${L}/messages/${H}`,{body:D,...A,headers:r([{"OpenAI-Beta":"assistants=v2"},A?.headers])})}list(H,$={},A){return this._client.getAPIList(c`/threads/${H}/messages`,zH,{query:$,...A,headers:r([{"OpenAI-Beta":"assistants=v2"},A?.headers])})}delete(H,$,A){let{thread_id:L}=$;return this._client.delete(c`/threads/${L}/messages/${H}`,{...A,headers:r([{"OpenAI-Beta":"assistants=v2"},A?.headers])})}}class RE extends i{retrieve(H,$,A){let{thread_id:L,run_id:D,...I}=$;return this._client.get(c`/threads/${L}/runs/${D}/steps/${H}`,{query:I,...A,headers:r([{"OpenAI-Beta":"assistants=v2"},A?.headers])})}list(H,$,A){let{thread_id:L,...D}=$;return this._client.getAPIList(c`/threads/${L}/runs/${H}/steps`,zH,{query:D,...A,headers:r([{"OpenAI-Beta":"assistants=v2"},A?.headers])})}}var tz=(H)=>{if(typeof Buffer<"u"){let $=Buffer.from(H,"base64");return Array.from(new Float32Array($.buffer,$.byteOffset,$.length/Float32Array.BYTES_PER_ELEMENT))}else{let $=atob(H),A=$.length,L=new Uint8Array(A);for(let D=0;D<A;D++)L[D]=$.charCodeAt(D);return Array.from(new Float32Array(L.buffer))}};var NL=(H)=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[H]?.trim()??void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(H)?.trim();return};var W$,k0,CB,GA,kK,AA,y0,tD,x0,vK,f$,yK,fK,xE,jE,SE,oz,sz,rz,ez,HP,$P,AP;class FL extends w0{constructor(){super(...arguments);W$.add(this),CB.set(this,[]),GA.set(this,{}),kK.set(this,{}),AA.set(this,void 0),y0.set(this,void 0),tD.set(this,void 0),x0.set(this,void 0),vK.set(this,void 0),f$.set(this,void 0),yK.set(this,void 0),fK.set(this,void 0),xE.set(this,void 0)}[(CB=new WeakMap,GA=new WeakMap,kK=new WeakMap,AA=new WeakMap,y0=new WeakMap,tD=new WeakMap,x0=new WeakMap,vK=new WeakMap,f$=new WeakMap,yK=new WeakMap,fK=new WeakMap,xE=new WeakMap,W$=new WeakSet,Symbol.asyncIterator)](){let H=[],$=[],A=!1;return this.on("event",(L)=>{let D=$.shift();if(D)D.resolve(L);else H.push(L)}),this.on("end",()=>{A=!0;for(let L of $)L.resolve(void 0);$.length=0}),this.on("abort",(L)=>{A=!0;for(let D of $)D.reject(L);$.length=0}),this.on("error",(L)=>{A=!0;for(let D of $)D.reject(L);$.length=0}),{next:async()=>{if(!H.length){if(A)return{value:void 0,done:!0};return new Promise((D,I)=>$.push({resolve:D,reject:I})).then((D)=>D?{value:D,done:!1}:{value:void 0,done:!0})}return{value:H.shift(),done:!1}},return:async()=>{return this.abort(),{value:void 0,done:!0}}}}static fromReadableStream(H){let $=new k0;return $._run(()=>$._fromReadableStream(H)),$}async _fromReadableStream(H,$){let A=$?.signal;if(A){if(A.aborted)this.controller.abort();A.addEventListener("abort",()=>this.controller.abort())}this._connected();let L=k$.fromReadableStream(H,this.controller);for await(let D of L)b(this,W$,"m",jE).call(this,D);if(L.controller.signal?.aborted)throw new sH;return this._addRun(b(this,W$,"m",SE).call(this))}toReadableStream(){return new k$(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}static createToolAssistantStream(H,$,A,L){let D=new k0;return D._run(()=>D._runToolAssistantStream(H,$,A,{...L,headers:{...L?.headers,"X-Stainless-Helper-Method":"stream"}})),D}async _createToolAssistantStream(H,$,A,L){let D=L?.signal;if(D){if(D.aborted)this.controller.abort();D.addEventListener("abort",()=>this.controller.abort())}let I={...A,stream:!0},E=await H.submitToolOutputs($,I,{...L,signal:this.controller.signal});this._connected();for await(let K of E)b(this,W$,"m",jE).call(this,K);if(E.controller.signal?.aborted)throw new sH;return this._addRun(b(this,W$,"m",SE).call(this))}static createThreadAssistantStream(H,$,A){let L=new k0;return L._run(()=>L._threadAssistantStream(H,$,{...A,headers:{...A?.headers,"X-Stainless-Helper-Method":"stream"}})),L}static createAssistantStream(H,$,A,L){let D=new k0;return D._run(()=>D._runAssistantStream(H,$,A,{...L,headers:{...L?.headers,"X-Stainless-Helper-Method":"stream"}})),D}currentEvent(){return b(this,yK,"f")}currentRun(){return b(this,fK,"f")}currentMessageSnapshot(){return b(this,AA,"f")}currentRunStepSnapshot(){return b(this,xE,"f")}async finalRunSteps(){return await this.done(),Object.values(b(this,GA,"f"))}async finalMessages(){return await this.done(),Object.values(b(this,kK,"f"))}async finalRun(){if(await this.done(),!b(this,y0,"f"))throw Error("Final run was not received.");return b(this,y0,"f")}async _createThreadAssistantStream(H,$,A){let L=A?.signal;if(L){if(L.aborted)this.controller.abort();L.addEventListener("abort",()=>this.controller.abort())}let D={...$,stream:!0},I=await H.createAndRun(D,{...A,signal:this.controller.signal});this._connected();for await(let E of I)b(this,W$,"m",jE).call(this,E);if(I.controller.signal?.aborted)throw new sH;return this._addRun(b(this,W$,"m",SE).call(this))}async _createAssistantStream(H,$,A,L){let D=L?.signal;if(D){if(D.aborted)this.controller.abort();D.addEventListener("abort",()=>this.controller.abort())}let I={...A,stream:!0},E=await H.create($,I,{...L,signal:this.controller.signal});this._connected();for await(let K of E)b(this,W$,"m",jE).call(this,K);if(E.controller.signal?.aborted)throw new sH;return this._addRun(b(this,W$,"m",SE).call(this))}static accumulateDelta(H,$){for(let[A,L]of Object.entries($)){if(!H.hasOwnProperty(A)){H[A]=L;continue}let D=H[A];if(D===null||D===void 0){H[A]=L;continue}if(A==="index"||A==="type"){H[A]=L;continue}if(typeof D==="string"&&typeof L==="string")D+=L;else if(typeof D==="number"&&typeof L==="number")D+=L;else if(EE(D)&&EE(L))D=this.accumulateDelta(D,L);else if(Array.isArray(D)&&Array.isArray(L)){if(D.every((I)=>typeof I==="string"||typeof I==="number")){D.push(...L);continue}for(let I of L){if(!EE(I))throw Error(`Expected array delta entry to be an object but got: ${I}`);let E=I.index;if(E==null)throw console.error(I),Error("Expected array delta entry to have an `index` property");if(typeof E!=="number")throw Error(`Expected array delta entry \`index\` property to be a number but got ${E}`);let K=D[E];if(K==null)D.push(I);else D[E]=this.accumulateDelta(K,I)}continue}else throw Error(`Unhandled record type: ${A}, deltaValue: ${L}, accValue: ${D}`);H[A]=D}return H}_addRun(H){return H}async _threadAssistantStream(H,$,A){return await this._createThreadAssistantStream($,H,A)}async _runAssistantStream(H,$,A,L){return await this._createAssistantStream($,H,A,L)}async _runToolAssistantStream(H,$,A,L){return await this._createToolAssistantStream($,H,A,L)}}k0=FL,jE=function H($){if(this.ended)return;switch(KH(this,yK,$,"f"),b(this,W$,"m",rz).call(this,$),$.event){case"thread.created":break;case"thread.run.created":case"thread.run.queued":case"thread.run.in_progress":case"thread.run.requires_action":case"thread.run.completed":case"thread.run.incomplete":case"thread.run.failed":case"thread.run.cancelling":case"thread.run.cancelled":case"thread.run.expired":b(this,W$,"m",AP).call(this,$);break;case"thread.run.step.created":case"thread.run.step.in_progress":case"thread.run.step.delta":case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":b(this,W$,"m",sz).call(this,$);break;case"thread.message.created":case"thread.message.in_progress":case"thread.message.delta":case"thread.message.completed":case"thread.message.incomplete":b(this,W$,"m",oz).call(this,$);break;case"error":throw Error("Encountered an error event in event processing - errors should be processed earlier");default:Hi($)}},SE=function H(){if(this.ended)throw new DH("stream has ended, this shouldn't happen");if(!b(this,y0,"f"))throw Error("Final run has not been received");return b(this,y0,"f")},oz=function H($){let[A,L]=b(this,W$,"m",HP).call(this,$,b(this,AA,"f"));KH(this,AA,A,"f"),b(this,kK,"f")[A.id]=A;for(let D of L){let I=A.content[D.index];if(I?.type=="text")this._emit("textCreated",I.text)}switch($.event){case"thread.message.created":this._emit("messageCreated",$.data);break;case"thread.message.in_progress":break;case"thread.message.delta":if(this._emit("messageDelta",$.data.delta,A),$.data.delta.content)for(let D of $.data.delta.content){if(D.type=="text"&&D.text){let I=D.text,E=A.content[D.index];if(E&&E.type=="text")this._emit("textDelta",I,E.text);else throw Error("The snapshot associated with this text delta is not text or missing")}if(D.index!=b(this,tD,"f")){if(b(this,x0,"f"))switch(b(this,x0,"f").type){case"text":this._emit("textDone",b(this,x0,"f").text,b(this,AA,"f"));break;case"image_file":this._emit("imageFileDone",b(this,x0,"f").image_file,b(this,AA,"f"));break}KH(this,tD,D.index,"f")}KH(this,x0,A.content[D.index],"f")}break;case"thread.message.completed":case"thread.message.incomplete":if(b(this,tD,"f")!==void 0){let D=$.data.content[b(this,tD,"f")];if(D)switch(D.type){case"image_file":this._emit("imageFileDone",D.image_file,b(this,AA,"f"));break;case"text":this._emit("textDone",D.text,b(this,AA,"f"));break}}if(b(this,AA,"f"))this._emit("messageDone",$.data);KH(this,AA,void 0,"f")}},sz=function H($){let A=b(this,W$,"m",ez).call(this,$);switch(KH(this,xE,A,"f"),$.event){case"thread.run.step.created":this._emit("runStepCreated",$.data);break;case"thread.run.step.delta":let L=$.data.delta;if(L.step_details&&L.step_details.type=="tool_calls"&&L.step_details.tool_calls&&A.step_details.type=="tool_calls")for(let I of L.step_details.tool_calls)if(I.index==b(this,vK,"f"))this._emit("toolCallDelta",I,A.step_details.tool_calls[I.index]);else{if(b(this,f$,"f"))this._emit("toolCallDone",b(this,f$,"f"));if(KH(this,vK,I.index,"f"),KH(this,f$,A.step_details.tool_calls[I.index],"f"),b(this,f$,"f"))this._emit("toolCallCreated",b(this,f$,"f"))}this._emit("runStepDelta",$.data.delta,A);break;case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":if(KH(this,xE,void 0,"f"),$.data.step_details.type=="tool_calls"){if(b(this,f$,"f"))this._emit("toolCallDone",b(this,f$,"f")),KH(this,f$,void 0,"f")}this._emit("runStepDone",$.data,A);break;case"thread.run.step.in_progress":break}},rz=function H($){b(this,CB,"f").push($),this._emit("event",$)},ez=function H($){switch($.event){case"thread.run.step.created":return b(this,GA,"f")[$.data.id]=$.data,$.data;case"thread.run.step.delta":let A=b(this,GA,"f")[$.data.id];if(!A)throw Error("Received a RunStepDelta before creation of a snapshot");let L=$.data;if(L.delta){let D=k0.accumulateDelta(A,L.delta);b(this,GA,"f")[$.data.id]=D}return b(this,GA,"f")[$.data.id];case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":case"thread.run.step.in_progress":b(this,GA,"f")[$.data.id]=$.data;break}if(b(this,GA,"f")[$.data.id])return b(this,GA,"f")[$.data.id];throw Error("No snapshot available")},HP=function H($,A){let L=[];switch($.event){case"thread.message.created":return[$.data,L];case"thread.message.delta":if(!A)throw Error("Received a delta with no existing snapshot (there should be one from message creation)");let D=$.data;if(D.delta.content)for(let I of D.delta.content)if(I.index in A.content){let E=A.content[I.index];A.content[I.index]=b(this,W$,"m",$P).call(this,I,E)}else A.content[I.index]=I,L.push(I);return[A,L];case"thread.message.in_progress":case"thread.message.completed":case"thread.message.incomplete":if(A)return[A,L];else throw Error("Received thread message event with no existing snapshot")}throw Error("Tried to accumulate a non-message event")},$P=function H($,A){return k0.accumulateDelta(A,$)},AP=function H($){switch(KH(this,fK,$.data,"f"),$.event){case"thread.run.created":break;case"thread.run.queued":break;case"thread.run.in_progress":break;case"thread.run.requires_action":case"thread.run.cancelled":case"thread.run.failed":case"thread.run.completed":case"thread.run.expired":case"thread.run.incomplete":if(KH(this,y0,$.data,"f"),b(this,f$,"f"))this._emit("toolCallDone",b(this,f$,"f")),KH(this,f$,void 0,"f");break;case"thread.run.cancelling":break}};function Hi(H){}class oD extends i{constructor(){super(...arguments);this.steps=new RE(this._client)}create(H,$,A){let{include:L,...D}=$;return this._client.post(c`/threads/${H}/runs`,{query:{include:L},body:D,...A,headers:r([{"OpenAI-Beta":"assistants=v2"},A?.headers]),stream:$.stream??!1})}retrieve(H,$,A){let{thread_id:L}=$;return this._client.get(c`/threads/${L}/runs/${H}`,{...A,headers:r([{"OpenAI-Beta":"assistants=v2"},A?.headers])})}update(H,$,A){let{thread_id:L,...D}=$;return this._client.post(c`/threads/${L}/runs/${H}`,{body:D,...A,headers:r([{"OpenAI-Beta":"assistants=v2"},A?.headers])})}list(H,$={},A){return this._client.getAPIList(c`/threads/${H}/runs`,zH,{query:$,...A,headers:r([{"OpenAI-Beta":"assistants=v2"},A?.headers])})}cancel(H,$,A){let{thread_id:L}=$;return this._client.post(c`/threads/${L}/runs/${H}/cancel`,{...A,headers:r([{"OpenAI-Beta":"assistants=v2"},A?.headers])})}async createAndPoll(H,$,A){let L=await this.create(H,$,A);return await this.poll(L.id,{thread_id:H},A)}createAndStream(H,$,A){return FL.createAssistantStream(H,this._client.beta.threads.runs,$,A)}async poll(H,$,A){let L=r([A?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":A?.pollIntervalMs?.toString()??void 0}]);while(!0){let{data:D,response:I}=await this.retrieve(H,$,{...A,headers:{...A?.headers,...L}}).withResponse();switch(D.status){case"queued":case"in_progress":case"cancelling":let E=5000;if(A?.pollIntervalMs)E=A.pollIntervalMs;else{let K=I.headers.get("openai-poll-after-ms");if(K){let M=parseInt(K);if(!isNaN(M))E=M}}await ZA(E);break;case"requires_action":case"incomplete":case"cancelled":case"completed":case"failed":case"expired":return D}}}stream(H,$,A){return FL.createAssistantStream(H,this._client.beta.threads.runs,$,A)}submitToolOutputs(H,$,A){let{thread_id:L,...D}=$;return this._client.post(c`/threads/${L}/runs/${H}/submit_tool_outputs`,{body:D,...A,headers:r([{"OpenAI-Beta":"assistants=v2"},A?.headers]),stream:$.stream??!1})}async submitToolOutputsAndPoll(H,$,A){let L=await this.submitToolOutputs(H,$,A);return await this.poll(L.id,$,A)}submitToolOutputsStream(H,$,A){return FL.createToolAssistantStream(H,this._client.beta.threads.runs,$,A)}}oD.Steps=RE;class f0 extends i{constructor(){super(...arguments);this.runs=new oD(this._client),this.messages=new wE(this._client)}create(H={},$){return this._client.post("/threads",{body:H,...$,headers:r([{"OpenAI-Beta":"assistants=v2"},$?.headers])})}retrieve(H,$){return this._client.get(c`/threads/${H}`,{...$,headers:r([{"OpenAI-Beta":"assistants=v2"},$?.headers])})}update(H,$,A){return this._client.post(c`/threads/${H}`,{body:$,...A,headers:r([{"OpenAI-Beta":"assistants=v2"},A?.headers])})}delete(H,$){return this._client.delete(c`/threads/${H}`,{...$,headers:r([{"OpenAI-Beta":"assistants=v2"},$?.headers])})}createAndRun(H,$){return this._client.post("/threads/runs",{body:H,...$,headers:r([{"OpenAI-Beta":"assistants=v2"},$?.headers]),stream:H.stream??!1})}async createAndRunPoll(H,$){let A=await this.createAndRun(H,$);return await this.runs.poll(A.id,{thread_id:A.thread_id},$)}createAndRunStream(H,$){return FL.createThreadAssistantStream(H,this._client.beta.threads,$)}}f0.Runs=oD;f0.Messages=wE;class UA extends i{constructor(){super(...arguments);this.realtime=new j0(this._client),this.chatkit=new S0(this._client),this.assistants=new TE(this._client),this.threads=new f0(this._client)}}UA.Realtime=j0;UA.ChatKit=S0;UA.Assistants=TE;UA.Threads=f0;class sD extends i{create(H,$){return this._client.post("/completions",{body:H,...$,stream:H.stream??!1})}}class kE extends i{retrieve(H,$,A){let{container_id:L}=$;return this._client.get(c`/containers/${L}/files/${H}/content`,{...A,headers:r([{Accept:"application/binary"},A?.headers]),__binaryResponse:!0})}}class rD extends i{constructor(){super(...arguments);this.content=new kE(this._client)}create(H,$,A){return this._client.post(c`/containers/${H}/files`,y$({body:$,...A},this._client))}retrieve(H,$,A){let{container_id:L}=$;return this._client.get(c`/containers/${L}/files/${H}`,A)}list(H,$={},A){return this._client.getAPIList(c`/containers/${H}/files`,zH,{query:$,...A})}delete(H,$,A){let{container_id:L}=$;return this._client.delete(c`/containers/${L}/files/${H}`,{...A,headers:r([{Accept:"*/*"},A?.headers])})}}rD.Content=kE;class v0 extends i{constructor(){super(...arguments);this.files=new rD(this._client)}create(H,$){return this._client.post("/containers",{body:H,...$})}retrieve(H,$){return this._client.get(c`/containers/${H}`,$)}list(H={},$){return this._client.getAPIList("/containers",zH,{query:H,...$})}delete(H,$){return this._client.delete(c`/containers/${H}`,{...$,headers:r([{Accept:"*/*"},$?.headers])})}}v0.Files=rD;class yE extends i{create(H,$,A){let{include:L,...D}=$;return this._client.post(c`/conversations/${H}/items`,{query:{include:L},body:D,...A})}retrieve(H,$,A){let{conversation_id:L,...D}=$;return this._client.get(c`/conversations/${L}/items/${H}`,{query:D,...A})}list(H,$={},A){return this._client.getAPIList(c`/conversations/${H}/items`,PL,{query:$,...A})}delete(H,$,A){let{conversation_id:L}=$;return this._client.delete(c`/conversations/${L}/items/${H}`,A)}}class b0 extends i{constructor(){super(...arguments);this.items=new yE(this._client)}create(H={},$){return this._client.post("/conversations",{body:H,...$})}retrieve(H,$){return this._client.get(c`/conversations/${H}`,$)}update(H,$,A){return this._client.post(c`/conversations/${H}`,{body:$,...A})}delete(H,$){return this._client.delete(c`/conversations/${H}`,$)}}b0.Items=yE;class eD extends i{create(H,$){let A=!!H.encoding_format,L=A?H.encoding_format:"base64";if(A)dH(this._client).debug("embeddings/user defined encoding_format:",H.encoding_format);let D=this._client.post("/embeddings",{body:{...H,encoding_format:L},...$});if(A)return D;return dH(this._client).debug("embeddings/decoding base64 embeddings from base64"),D._thenUnwrap((I)=>{if(I&&I.data)I.data.forEach((E)=>{let K=E.embedding;E.embedding=tz(K)});return I})}}class fE extends i{retrieve(H,$,A){let{eval_id:L,run_id:D}=$;return this._client.get(c`/evals/${L}/runs/${D}/output_items/${H}`,A)}list(H,$,A){let{eval_id:L,...D}=$;return this._client.getAPIList(c`/evals/${L}/runs/${H}/output_items`,zH,{query:D,...A})}}class H3 extends i{constructor(){super(...arguments);this.outputItems=new fE(this._client)}create(H,$,A){return this._client.post(c`/evals/${H}/runs`,{body:$,...A})}retrieve(H,$,A){let{eval_id:L}=$;return this._client.get(c`/evals/${L}/runs/${H}`,A)}list(H,$={},A){return this._client.getAPIList(c`/evals/${H}/runs`,zH,{query:$,...A})}delete(H,$,A){let{eval_id:L}=$;return this._client.delete(c`/evals/${L}/runs/${H}`,A)}cancel(H,$,A){let{eval_id:L}=$;return this._client.post(c`/evals/${L}/runs/${H}`,A)}}H3.OutputItems=fE;class h0 extends i{constructor(){super(...arguments);this.runs=new H3(this._client)}create(H,$){return this._client.post("/evals",{body:H,...$})}retrieve(H,$){return this._client.get(c`/evals/${H}`,$)}update(H,$,A){return this._client.post(c`/evals/${H}`,{body:$,...A})}list(H={},$){return this._client.getAPIList("/evals",zH,{query:H,...$})}delete(H,$){return this._client.delete(c`/evals/${H}`,$)}}h0.Runs=H3;class $3 extends i{create(H,$){return this._client.post("/files",y$({body:H,...$},this._client))}retrieve(H,$){return this._client.get(c`/files/${H}`,$)}list(H={},$){return this._client.getAPIList("/files",zH,{query:H,...$})}delete(H,$){return this._client.delete(c`/files/${H}`,$)}content(H,$){return this._client.get(c`/files/${H}/content`,{...$,headers:r([{Accept:"application/binary"},$?.headers]),__binaryResponse:!0})}async waitForProcessing(H,{pollInterval:$=5000,maxWait:A=1800000}={}){let L=new Set(["processed","error","deleted"]),D=Date.now(),I=await this.retrieve(H);while(!I.status||!L.has(I.status))if(await ZA($),I=await this.retrieve(H),Date.now()-D>A)throw new N0({message:`Giving up on waiting for file ${H} to finish processing after ${A} milliseconds.`});return I}}class vE extends i{}class bE extends i{run(H,$){return this._client.post("/fine_tuning/alpha/graders/run",{body:H,...$})}validate(H,$){return this._client.post("/fine_tuning/alpha/graders/validate",{body:H,...$})}}class A3 extends i{constructor(){super(...arguments);this.graders=new bE(this._client)}}A3.Graders=bE;class hE extends i{create(H,$,A){return this._client.getAPIList(c`/fine_tuning/checkpoints/${H}/permissions`,lA,{body:$,method:"post",...A})}retrieve(H,$={},A){return this._client.get(c`/fine_tuning/checkpoints/${H}/permissions`,{query:$,...A})}delete(H,$,A){let{fine_tuned_model_checkpoint:L}=$;return this._client.delete(c`/fine_tuning/checkpoints/${L}/permissions/${H}`,A)}}class L3 extends i{constructor(){super(...arguments);this.permissions=new hE(this._client)}}L3.Permissions=hE;class uE extends i{list(H,$={},A){return this._client.getAPIList(c`/fine_tuning/jobs/${H}/checkpoints`,zH,{query:$,...A})}}class D3 extends i{constructor(){super(...arguments);this.checkpoints=new uE(this._client)}create(H,$){return this._client.post("/fine_tuning/jobs",{body:H,...$})}retrieve(H,$){return this._client.get(c`/fine_tuning/jobs/${H}`,$)}list(H={},$){return this._client.getAPIList("/fine_tuning/jobs",zH,{query:H,...$})}cancel(H,$){return this._client.post(c`/fine_tuning/jobs/${H}/cancel`,$)}listEvents(H,$={},A){return this._client.getAPIList(c`/fine_tuning/jobs/${H}/events`,zH,{query:$,...A})}pause(H,$){return this._client.post(c`/fine_tuning/jobs/${H}/pause`,$)}resume(H,$){return this._client.post(c`/fine_tuning/jobs/${H}/resume`,$)}}D3.Checkpoints=uE;class VA extends i{constructor(){super(...arguments);this.methods=new vE(this._client),this.jobs=new D3(this._client),this.checkpoints=new L3(this._client),this.alpha=new A3(this._client)}}VA.Methods=vE;VA.Jobs=D3;VA.Checkpoints=L3;VA.Alpha=A3;class gE extends i{}class u0 extends i{constructor(){super(...arguments);this.graderModels=new gE(this._client)}}u0.GraderModels=gE;class I3 extends i{createVariation(H,$){return this._client.post("/images/variations",y$({body:H,...$},this._client))}edit(H,$){return this._client.post("/images/edits",y$({body:H,...$,stream:H.stream??!1},this._client))}generate(H,$){return this._client.post("/images/generations",{body:H,...$,stream:H.stream??!1})}}class E3 extends i{retrieve(H,$){return this._client.get(c`/models/${H}`,$)}list(H){return this._client.getAPIList("/models",lA,H)}delete(H,$){return this._client.delete(c`/models/${H}`,$)}}class K3 extends i{create(H,$){return this._client.post("/moderations",{body:H,...$})}}class mE extends i{accept(H,$,A){return this._client.post(c`/realtime/calls/${H}/accept`,{body:$,...A,headers:r([{Accept:"*/*"},A?.headers])})}hangup(H,$){return this._client.post(c`/realtime/calls/${H}/hangup`,{...$,headers:r([{Accept:"*/*"},$?.headers])})}refer(H,$,A){return this._client.post(c`/realtime/calls/${H}/refer`,{body:$,...A,headers:r([{Accept:"*/*"},A?.headers])})}reject(H,$={},A){return this._client.post(c`/realtime/calls/${H}/reject`,{body:$,...A,headers:r([{Accept:"*/*"},A?.headers])})}}class dE extends i{create(H,$){return this._client.post("/realtime/client_secrets",{body:H,...$})}}class OL extends i{constructor(){super(...arguments);this.clientSecrets=new dE(this._client),this.calls=new mE(this._client)}}OL.ClientSecrets=dE;OL.Calls=mE;function LP(H,$){if(!$||!Ci($))return{...H,output_parsed:null,output:H.output.map((A)=>{if(A.type==="function_call")return{...A,parsed_arguments:null};if(A.type==="message")return{...A,content:A.content.map((L)=>({...L,parsed:null}))};else return A})};return zB(H,$)}function zB(H,$){let A=H.output.map((D)=>{if(D.type==="function_call")return{...D,parsed_arguments:qi($,D)};if(D.type==="message"){let I=D.content.map((E)=>{if(E.type==="output_text")return{...E,parsed:Vi($,E.text)};return E});return{...D,content:I}}return D}),L=Object.assign({},H,{output:A});if(!Object.getOwnPropertyDescriptor(H,"output_text"))bK(L);return Object.defineProperty(L,"output_parsed",{enumerable:!0,get(){for(let D of L.output){if(D.type!=="message")continue;for(let I of D.content)if(I.type==="output_text"&&I.parsed!==null)return I.parsed}return null}}),L}function Vi(H,$){if(H.text?.format?.type!=="json_schema")return null;if("$parseRaw"in H.text?.format)return(H.text?.format).$parseRaw($);return JSON.parse($)}function Ci(H){if(BE(H.text?.format))return!0;return!1}function zi(H){return H?.$brand==="auto-parseable-tool"}function Pi(H,$){return H.find((A)=>A.type==="function"&&A.name===$)}function qi(H,$){let A=Pi(H.tools??[],$.name);return{...$,...$,parsed_arguments:zi(A)?A.$parseRaw($.arguments):A?.strict?JSON.parse($.arguments):null}}function bK(H){let $=[];for(let A of H.output){if(A.type!=="message")continue;for(let L of A.content)if(L.type==="output_text")$.push(L.text)}H.output_text=$.join("")}var M3,hK,wL,uK,DP,IP,EP,KP;class gK extends w0{constructor(H){super();M3.add(this),hK.set(this,void 0),wL.set(this,void 0),uK.set(this,void 0),KH(this,hK,H,"f")}static createResponse(H,$,A){let L=new gK($);return L._run(()=>L._createOrRetrieveResponse(H,$,{...A,headers:{...A?.headers,"X-Stainless-Helper-Method":"stream"}})),L}async _createOrRetrieveResponse(H,$,A){let L=A?.signal;if(L){if(L.aborted)this.controller.abort();L.addEventListener("abort",()=>this.controller.abort())}b(this,M3,"m",DP).call(this);let D,I=null;if("response_id"in $)D=await H.responses.retrieve($.response_id,{stream:!0},{...A,signal:this.controller.signal,stream:!0}),I=$.starting_after??null;else D=await H.responses.create({...$,stream:!0},{...A,signal:this.controller.signal});this._connected();for await(let E of D)b(this,M3,"m",IP).call(this,E,I);if(D.controller.signal?.aborted)throw new sH;return b(this,M3,"m",EP).call(this)}[(hK=new WeakMap,wL=new WeakMap,uK=new WeakMap,M3=new WeakSet,DP=function H(){if(this.ended)return;KH(this,wL,void 0,"f")},IP=function H($,A){if(this.ended)return;let L=(I,E)=>{if(A==null||E.sequence_number>A)this._emit(I,E)},D=b(this,M3,"m",KP).call(this,$);switch(L("event",$),$.type){case"response.output_text.delta":{let I=D.output[$.output_index];if(!I)throw new DH(`missing output at index ${$.output_index}`);if(I.type==="message"){let E=I.content[$.content_index];if(!E)throw new DH(`missing content at index ${$.content_index}`);if(E.type!=="output_text")throw new DH(`expected content to be 'output_text', got ${E.type}`);L("response.output_text.delta",{...$,snapshot:E.text})}break}case"response.function_call_arguments.delta":{let I=D.output[$.output_index];if(!I)throw new DH(`missing output at index ${$.output_index}`);if(I.type==="function_call")L("response.function_call_arguments.delta",{...$,snapshot:I.arguments});break}default:L($.type,$);break}},EP=function H(){if(this.ended)throw new DH("stream has ended, this shouldn't happen");let $=b(this,wL,"f");if(!$)throw new DH("request ended without sending any events");KH(this,wL,void 0,"f");let A=Ti($,b(this,hK,"f"));return KH(this,uK,A,"f"),A},KP=function H($){let A=b(this,wL,"f");if(!A){if($.type!=="response.created")throw new DH(`When snapshot hasn't been set yet, expected 'response.created' event, got ${$.type}`);return A=KH(this,wL,$.response,"f"),A}switch($.type){case"response.output_item.added":{A.output.push($.item);break}case"response.content_part.added":{let L=A.output[$.output_index];if(!L)throw new DH(`missing output at index ${$.output_index}`);let D=L.type,I=$.part;if(D==="message"&&I.type!=="reasoning_text")L.content.push(I);else if(D==="reasoning"&&I.type==="reasoning_text"){if(!L.content)L.content=[];L.content.push(I)}break}case"response.output_text.delta":{let L=A.output[$.output_index];if(!L)throw new DH(`missing output at index ${$.output_index}`);if(L.type==="message"){let D=L.content[$.content_index];if(!D)throw new DH(`missing content at index ${$.content_index}`);if(D.type!=="output_text")throw new DH(`expected content to be 'output_text', got ${D.type}`);D.text+=$.delta}break}case"response.function_call_arguments.delta":{let L=A.output[$.output_index];if(!L)throw new DH(`missing output at index ${$.output_index}`);if(L.type==="function_call")L.arguments+=$.delta;break}case"response.reasoning_text.delta":{let L=A.output[$.output_index];if(!L)throw new DH(`missing output at index ${$.output_index}`);if(L.type==="reasoning"){let D=L.content?.[$.content_index];if(!D)throw new DH(`missing content at index ${$.content_index}`);if(D.type!=="reasoning_text")throw new DH(`expected content to be 'reasoning_text', got ${D.type}`);D.text+=$.delta}break}case"response.completed":{KH(this,wL,$.response,"f");break}}return A},Symbol.asyncIterator)](){let H=[],$=[],A=!1;return this.on("event",(L)=>{let D=$.shift();if(D)D.resolve(L);else H.push(L)}),this.on("end",()=>{A=!0;for(let L of $)L.resolve(void 0);$.length=0}),this.on("abort",(L)=>{A=!0;for(let D of $)D.reject(L);$.length=0}),this.on("error",(L)=>{A=!0;for(let D of $)D.reject(L);$.length=0}),{next:async()=>{if(!H.length){if(A)return{value:void 0,done:!0};return new Promise((D,I)=>$.push({resolve:D,reject:I})).then((D)=>D?{value:D,done:!1}:{value:void 0,done:!0})}return{value:H.shift(),done:!1}},return:async()=>{return this.abort(),{value:void 0,done:!0}}}}async finalResponse(){await this.done();let H=b(this,uK,"f");if(!H)throw new DH("stream ended without producing a ChatCompletion");return H}}function Ti(H,$){return LP(H,$)}class pE extends i{list(H,$={},A){return this._client.getAPIList(c`/responses/${H}/input_items`,zH,{query:$,...A})}}class cE extends i{count(H={},$){return this._client.post("/responses/input_tokens",{body:H,...$})}}class RL extends i{constructor(){super(...arguments);this.inputItems=new pE(this._client),this.inputTokens=new cE(this._client)}create(H,$){return this._client.post("/responses",{body:H,...$,stream:H.stream??!1})._thenUnwrap((A)=>{if("object"in A&&A.object==="response")bK(A);return A})}retrieve(H,$={},A){return this._client.get(c`/responses/${H}`,{query:$,...A,stream:$?.stream??!1})._thenUnwrap((L)=>{if("object"in L&&L.object==="response")bK(L);return L})}delete(H,$){return this._client.delete(c`/responses/${H}`,{...$,headers:r([{Accept:"*/*"},$?.headers])})}parse(H,$){return this._client.responses.create(H,$)._thenUnwrap((A)=>zB(A,H))}stream(H,$){return gK.createResponse(this._client,H,$)}cancel(H,$){return this._client.post(c`/responses/${H}/cancel`,$)}compact(H,$){return this._client.post("/responses/compact",{body:H,...$})}}RL.InputItems=pE;RL.InputTokens=cE;class lE extends i{create(H,$,A){return this._client.post(c`/uploads/${H}/parts`,y$({body:$,...A},this._client))}}class g0 extends i{constructor(){super(...arguments);this.parts=new lE(this._client)}create(H,$){return this._client.post("/uploads",{body:H,...$})}cancel(H,$){return this._client.post(c`/uploads/${H}/cancel`,$)}complete(H,$,A){return this._client.post(c`/uploads/${H}/complete`,{body:$,...A})}}g0.Parts=lE;var MP=async(H)=>{let $=await Promise.allSettled(H),A=$.filter((D)=>D.status==="rejected");if(A.length){for(let D of A)console.error(D.reason);throw Error(`${A.length} promise(s) failed - see the above errors`)}let L=[];for(let D of $)if(D.status==="fulfilled")L.push(D.value);return L};class iE extends i{create(H,$,A){return this._client.post(c`/vector_stores/${H}/file_batches`,{body:$,...A,headers:r([{"OpenAI-Beta":"assistants=v2"},A?.headers])})}retrieve(H,$,A){let{vector_store_id:L}=$;return this._client.get(c`/vector_stores/${L}/file_batches/${H}`,{...A,headers:r([{"OpenAI-Beta":"assistants=v2"},A?.headers])})}cancel(H,$,A){let{vector_store_id:L}=$;return this._client.post(c`/vector_stores/${L}/file_batches/${H}/cancel`,{...A,headers:r([{"OpenAI-Beta":"assistants=v2"},A?.headers])})}async createAndPoll(H,$,A){let L=await this.create(H,$);return await this.poll(H,L.id,A)}listFiles(H,$,A){let{vector_store_id:L,...D}=$;return this._client.getAPIList(c`/vector_stores/${L}/file_batches/${H}/files`,zH,{query:D,...A,headers:r([{"OpenAI-Beta":"assistants=v2"},A?.headers])})}async poll(H,$,A){let L=r([A?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":A?.pollIntervalMs?.toString()??void 0}]);while(!0){let{data:D,response:I}=await this.retrieve($,{vector_store_id:H},{...A,headers:L}).withResponse();switch(D.status){case"in_progress":let E=5000;if(A?.pollIntervalMs)E=A.pollIntervalMs;else{let K=I.headers.get("openai-poll-after-ms");if(K){let M=parseInt(K);if(!isNaN(M))E=M}}await ZA(E);break;case"failed":case"cancelled":case"completed":return D}}}async uploadAndPoll(H,{files:$,fileIds:A=[]},L){if($==null||$.length==0)throw Error("No `files` provided to process. If you've already uploaded files you should use `.createAndPoll()` instead");let D=L?.maxConcurrency??5,I=Math.min(D,$.length),E=this._client,K=$.values(),M=[...A];async function W(J){for(let Z of J){let Q=await E.files.create({file:Z,purpose:"assistants"},L);M.push(Q.id)}}let X=Array(I).fill(K).map(W);return await MP(X),await this.createAndPoll(H,{file_ids:M})}}class nE extends i{create(H,$,A){return this._client.post(c`/vector_stores/${H}/files`,{body:$,...A,headers:r([{"OpenAI-Beta":"assistants=v2"},A?.headers])})}retrieve(H,$,A){let{vector_store_id:L}=$;return this._client.get(c`/vector_stores/${L}/files/${H}`,{...A,headers:r([{"OpenAI-Beta":"assistants=v2"},A?.headers])})}update(H,$,A){let{vector_store_id:L,...D}=$;return this._client.post(c`/vector_stores/${L}/files/${H}`,{body:D,...A,headers:r([{"OpenAI-Beta":"assistants=v2"},A?.headers])})}list(H,$={},A){return this._client.getAPIList(c`/vector_stores/${H}/files`,zH,{query:$,...A,headers:r([{"OpenAI-Beta":"assistants=v2"},A?.headers])})}delete(H,$,A){let{vector_store_id:L}=$;return this._client.delete(c`/vector_stores/${L}/files/${H}`,{...A,headers:r([{"OpenAI-Beta":"assistants=v2"},A?.headers])})}async createAndPoll(H,$,A){let L=await this.create(H,$,A);return await this.poll(H,L.id,A)}async poll(H,$,A){let L=r([A?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":A?.pollIntervalMs?.toString()??void 0}]);while(!0){let D=await this.retrieve($,{vector_store_id:H},{...A,headers:L}).withResponse(),I=D.data;switch(I.status){case"in_progress":let E=5000;if(A?.pollIntervalMs)E=A.pollIntervalMs;else{let K=D.response.headers.get("openai-poll-after-ms");if(K){let M=parseInt(K);if(!isNaN(M))E=M}}await ZA(E);break;case"failed":case"completed":return I}}}async upload(H,$,A){let L=await this._client.files.create({file:$,purpose:"assistants"},A);return this.create(H,{file_id:L.id},A)}async uploadAndPoll(H,$,A){let L=await this.upload(H,$,A);return await this.poll(H,L.id,A)}content(H,$,A){let{vector_store_id:L}=$;return this._client.getAPIList(c`/vector_stores/${L}/files/${H}/content`,lA,{...A,headers:r([{"OpenAI-Beta":"assistants=v2"},A?.headers])})}}class jL extends i{constructor(){super(...arguments);this.files=new nE(this._client),this.fileBatches=new iE(this._client)}create(H,$){return this._client.post("/vector_stores",{body:H,...$,headers:r([{"OpenAI-Beta":"assistants=v2"},$?.headers])})}retrieve(H,$){return this._client.get(c`/vector_stores/${H}`,{...$,headers:r([{"OpenAI-Beta":"assistants=v2"},$?.headers])})}update(H,$,A){return this._client.post(c`/vector_stores/${H}`,{body:$,...A,headers:r([{"OpenAI-Beta":"assistants=v2"},A?.headers])})}list(H={},$){return this._client.getAPIList("/vector_stores",zH,{query:H,...$,headers:r([{"OpenAI-Beta":"assistants=v2"},$?.headers])})}delete(H,$){return this._client.delete(c`/vector_stores/${H}`,{...$,headers:r([{"OpenAI-Beta":"assistants=v2"},$?.headers])})}search(H,$,A){return this._client.getAPIList(c`/vector_stores/${H}/search`,lA,{body:$,method:"post",...A,headers:r([{"OpenAI-Beta":"assistants=v2"},A?.headers])})}}jL.Files=nE;jL.FileBatches=iE;class X3 extends i{create(H,$){return this._client.post("/videos",DB({body:H,...$},this._client))}retrieve(H,$){return this._client.get(c`/videos/${H}`,$)}list(H={},$){return this._client.getAPIList("/videos",PL,{query:H,...$})}delete(H,$){return this._client.delete(c`/videos/${H}`,$)}downloadContent(H,$={},A){return this._client.get(c`/videos/${H}/content`,{query:$,...A,headers:r([{Accept:"application/binary"},A?.headers]),__binaryResponse:!0})}remix(H,$,A){return this._client.post(c`/videos/${H}/remix`,DB({body:$,...A},this._client))}}var W3,XP,mK;class Q3 extends i{constructor(){super(...arguments);W3.add(this)}async unwrap(H,$,A=this._client.webhookSecret,L=300){return await this.verifySignature(H,$,A,L),JSON.parse(H)}async verifySignature(H,$,A=this._client.webhookSecret,L=300){if(typeof crypto>"u"||typeof crypto.subtle.importKey!=="function"||typeof crypto.subtle.verify!=="function")throw Error("Webhook signature verification is only supported when the `crypto` global is defined");b(this,W3,"m",XP).call(this,A);let D=r([$]).values,I=b(this,W3,"m",mK).call(this,D,"webhook-signature"),E=b(this,W3,"m",mK).call(this,D,"webhook-timestamp"),K=b(this,W3,"m",mK).call(this,D,"webhook-id"),M=parseInt(E,10);if(isNaN(M))throw new pA("Invalid webhook timestamp format");let W=Math.floor(Date.now()/1000);if(W-M>L)throw new pA("Webhook timestamp is too old");if(M>W+L)throw new pA("Webhook timestamp is too new");let X=I.split(" ").map((B)=>B.startsWith("v1,")?B.substring(3):B),J=A.startsWith("whsec_")?Buffer.from(A.replace("whsec_",""),"base64"):Buffer.from(A,"utf-8"),Z=K?`${K}.${E}.${H}`:`${E}.${H}`,Q=await crypto.subtle.importKey("raw",J,{name:"HMAC",hash:"SHA-256"},!1,["verify"]);for(let B of X)try{let Y=Buffer.from(B,"base64");if(await crypto.subtle.verify("HMAC",Q,Y,new TextEncoder().encode(Z)))return}catch{continue}throw new pA("The given webhook signature does not match the expected signature")}}W3=new WeakSet,XP=function H($){if(typeof $!=="string"||$.length===0)throw Error("The webhook secret must either be set using the env var, OPENAI_WEBHOOK_SECRET, on the client class, OpenAI({ webhookSecret: '123' }), or passed to this function")},mK=function H($,A){if(!$)throw Error("Headers are required");let L=$.get(A);if(L===null||L===void 0)throw Error(`Missing required header: ${A}`);return L};var PB,qB,dK,WP;class YH{constructor({baseURL:H=NL("OPENAI_BASE_URL"),apiKey:$=NL("OPENAI_API_KEY"),organization:A=NL("OPENAI_ORG_ID")??null,project:L=NL("OPENAI_PROJECT_ID")??null,webhookSecret:D=NL("OPENAI_WEBHOOK_SECRET")??null,...I}={}){if(PB.add(this),dK.set(this,void 0),this.completions=new sD(this),this.chat=new R0(this),this.embeddings=new eD(this),this.files=new $3(this),this.images=new I3(this),this.audio=new aA(this),this.moderations=new K3(this),this.models=new E3(this),this.fineTuning=new VA(this),this.graders=new u0(this),this.vectorStores=new jL(this),this.webhooks=new Q3(this),this.beta=new UA(this),this.batches=new aD(this),this.uploads=new g0(this),this.responses=new RL(this),this.realtime=new OL(this),this.conversations=new b0(this),this.evals=new h0(this),this.containers=new v0(this),this.videos=new X3(this),$===void 0)throw new DH("Missing credentials. Please pass an `apiKey`, or set the `OPENAI_API_KEY` environment variable.");let E={apiKey:$,organization:A,project:L,webhookSecret:D,...I,baseURL:H||"https://api.openai.com/v1"};if(!E.dangerouslyAllowBrowser&&Bz())throw new DH(`It looks like you're running in a browser-like environment.
|
|
633
|
+
|
|
634
|
+
This is disabled by default, as it risks exposing your secret API credentials to attackers.
|
|
635
|
+
If you understand the risks and have appropriate mitigations in place,
|
|
636
|
+
you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g.,
|
|
637
|
+
|
|
638
|
+
new OpenAI({ apiKey, dangerouslyAllowBrowser: true });
|
|
639
|
+
|
|
640
|
+
https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety
|
|
641
|
+
`);this.baseURL=E.baseURL,this.timeout=E.timeout??qB.DEFAULT_TIMEOUT,this.logger=E.logger??console;let K="warn";this.logLevel=K,this.logLevel=eQ(E.logLevel,"ClientOptions.logLevel",this)??eQ(NL("OPENAI_LOG"),"process.env['OPENAI_LOG']",this)??K,this.fetchOptions=E.fetchOptions,this.maxRetries=E.maxRetries??2,this.fetch=E.fetch??Zz(),KH(this,dK,Gz,"f"),this._options=E,this.apiKey=typeof $==="string"?$:"Missing Key",this.organization=A,this.project=L,this.webhookSecret=D}withOptions(H){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,organization:this.organization,project:this.project,webhookSecret:this.webhookSecret,...H})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:H,nulls:$}){return}async authHeaders(H){return r([{Authorization:`Bearer ${this.apiKey}`}])}stringifyQuery(H){return sQ(H,{arrayFormat:"brackets"})}getUserAgent(){return`${this.constructor.name}/JS ${zL}`}defaultIdempotencyKey(){return`stainless-node-retry-${mQ()}`}makeStatusError(H,$,A,L){return aH.generate(H,$,A,L)}async _callApiKey(){let H=this._options.apiKey;if(typeof H!=="function")return!1;let $;try{$=await H()}catch(A){if(A instanceof DH)throw A;throw new DH(`Failed to get token from 'apiKey' function: ${A.message}`,{cause:A})}if(typeof $!=="string"||!$)throw new DH(`Expected 'apiKey' function argument to return a string but it returned ${$}`);return this.apiKey=$,!0}buildURL(H,$,A){let L=!b(this,PB,"m",WP).call(this)&&A||this.baseURL,D=Dz(H)?new URL(H):new URL(L+(L.endsWith("/")&&H.startsWith("/")?H.slice(1):H)),I=this.defaultQuery();if(!Iz(I))$={...I,...$};if(typeof $==="object"&&$&&!Array.isArray($))D.search=this.stringifyQuery($);return D.toString()}async prepareOptions(H){await this._callApiKey()}async prepareRequest(H,{url:$,options:A}){}get(H,$){return this.methodRequest("get",H,$)}post(H,$){return this.methodRequest("post",H,$)}patch(H,$){return this.methodRequest("patch",H,$)}put(H,$){return this.methodRequest("put",H,$)}delete(H,$){return this.methodRequest("delete",H,$)}methodRequest(H,$,A){return this.request(Promise.resolve(A).then((L)=>{return{method:H,path:$,...L}}))}request(H,$=null){return new F0(this,this.makeRequest(H,$,void 0))}async makeRequest(H,$,A){let L=await H,D=L.maxRetries??this.maxRetries;if($==null)$=D;await this.prepareOptions(L);let{req:I,url:E,timeout:K}=await this.buildRequest(L,{retryCount:D-$});await this.prepareRequest(I,{url:E,options:L});let M="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),W=A===void 0?"":`, retryOf: ${A}`,X=Date.now();if(dH(this).debug(`[${M}] sending request`,cA({retryOfRequestLogID:A,method:L.method,url:E,options:L,headers:I.headers})),L.signal?.aborted)throw new sH;let J=new AbortController,Z=await this.fetchWithTimeout(E,I,K,J).catch(tI),Q=Date.now();if(Z instanceof globalThis.Error){let G=`retrying, ${$} attempts remaining`;if(L.signal?.aborted)throw new sH;let U=aI(Z)||/timed? ?out/i.test(String(Z)+("cause"in Z?String(Z.cause):""));if($)return dH(this).info(`[${M}] connection ${U?"timed out":"failed"} - ${G}`),dH(this).debug(`[${M}] connection ${U?"timed out":"failed"} (${G})`,cA({retryOfRequestLogID:A,url:E,durationMs:Q-X,message:Z.message})),this.retryRequest(L,$,A??M);if(dH(this).info(`[${M}] connection ${U?"timed out":"failed"} - error; no more retries left`),dH(this).debug(`[${M}] connection ${U?"timed out":"failed"} (error; no more retries left)`,cA({retryOfRequestLogID:A,url:E,durationMs:Q-X,message:Z.message})),U)throw new N0;throw new _0({cause:Z})}let B=[...Z.headers.entries()].filter(([G])=>G==="x-request-id").map(([G,U])=>", "+G+": "+JSON.stringify(U)).join(""),Y=`[${M}${W}${B}] ${I.method} ${E} ${Z.ok?"succeeded":"failed"} with status ${Z.status} in ${Q-X}ms`;if(!Z.ok){let G=await this.shouldRetry(Z);if($&&G){let q=`retrying, ${$} attempts remaining`;return await Yz(Z.body),dH(this).info(`${Y} - ${q}`),dH(this).debug(`[${M}] response error (${q})`,cA({retryOfRequestLogID:A,url:Z.url,status:Z.status,headers:Z.headers,durationMs:Q-X})),this.retryRequest(L,$,A??M,Z.headers)}let U=G?"error; no more retries left":"error; not retryable";dH(this).info(`${Y} - ${U}`);let V=await Z.text().catch((q)=>tI(q).message),z=Mz(V),P=z?void 0:V;throw dH(this).debug(`[${M}] response error (${U})`,cA({retryOfRequestLogID:A,url:Z.url,status:Z.status,headers:Z.headers,message:P,durationMs:Date.now()-X})),this.makeStatusError(Z.status,z,P,Z.headers)}return dH(this).info(Y),dH(this).debug(`[${M}] response start`,cA({retryOfRequestLogID:A,url:Z.url,status:Z.status,headers:Z.headers,durationMs:Q-X})),{response:Z,options:L,controller:J,requestLogID:M,retryOfRequestLogID:A,startTime:X}}getAPIList(H,$,A){return this.requestAPIList($,{method:"get",path:H,...A})}requestAPIList(H,$){let A=this.makeRequest($,null,void 0);return new PK(this,A,H)}async fetchWithTimeout(H,$,A,L){let{signal:D,method:I,...E}=$||{};if(D)D.addEventListener("abort",()=>L.abort());let K=setTimeout(()=>L.abort(),A),M=globalThis.ReadableStream&&E.body instanceof globalThis.ReadableStream||typeof E.body==="object"&&E.body!==null&&Symbol.asyncIterator in E.body,W={signal:L.signal,...M?{duplex:"half"}:{},method:"GET",...E};if(I)W.method=I.toUpperCase();try{return await this.fetch.call(void 0,H,W)}finally{clearTimeout(K)}}async shouldRetry(H){let $=H.headers.get("x-should-retry");if($==="true")return!0;if($==="false")return!1;if(H.status===408)return!0;if(H.status===409)return!0;if(H.status===429)return!0;if(H.status>=500)return!0;return!1}async retryRequest(H,$,A,L){let D,I=L?.get("retry-after-ms");if(I){let K=parseFloat(I);if(!Number.isNaN(K))D=K}let E=L?.get("retry-after");if(E&&!D){let K=parseFloat(E);if(!Number.isNaN(K))D=K*1000;else D=Date.parse(E)-Date.now()}if(!(D&&0<=D&&D<60000)){let K=H.maxRetries??this.maxRetries;D=this.calculateDefaultRetryTimeoutMillis($,K)}return await ZA(D),this.makeRequest(H,$-1,A)}calculateDefaultRetryTimeoutMillis(H,$){let D=$-H,I=Math.min(0.5*Math.pow(2,D),8),E=1-Math.random()*0.25;return I*E*1000}async buildRequest(H,{retryCount:$=0}={}){let A={...H},{method:L,path:D,query:I,defaultBaseURL:E}=A,K=this.buildURL(D,I,E);if("timeout"in A)Kz("timeout",A.timeout);A.timeout=A.timeout??this.timeout;let{bodyHeaders:M,body:W}=this.buildBody({options:A}),X=await this.buildHeaders({options:H,method:L,bodyHeaders:M,retryCount:$});return{req:{method:L,headers:X,...A.signal&&{signal:A.signal},...globalThis.ReadableStream&&W instanceof globalThis.ReadableStream&&{duplex:"half"},...W&&{body:W},...this.fetchOptions??{},...A.fetchOptions??{}},url:K,timeout:A.timeout}}async buildHeaders({options:H,method:$,bodyHeaders:A,retryCount:L}){let D={};if(this.idempotencyHeader&&$!=="get"){if(!H.idempotencyKey)H.idempotencyKey=this.defaultIdempotencyKey();D[this.idempotencyHeader]=H.idempotencyKey}let I=r([D,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(L),...H.timeout?{"X-Stainless-Timeout":String(Math.trunc(H.timeout/1000))}:{},...Jz(),"OpenAI-Organization":this.organization,"OpenAI-Project":this.project},await this.authHeaders(H),this._options.defaultHeaders,A,H.headers]);return this.validateHeaders(I),I.values}buildBody({options:{body:H,headers:$}}){if(!H)return{bodyHeaders:void 0,body:void 0};let A=r([$]);if(ArrayBuffer.isView(H)||H instanceof ArrayBuffer||H instanceof DataView||typeof H==="string"&&A.values.has("content-type")||globalThis.Blob&&H instanceof globalThis.Blob||H instanceof FormData||H instanceof URLSearchParams||globalThis.ReadableStream&&H instanceof globalThis.ReadableStream)return{bodyHeaders:void 0,body:H};else if(typeof H==="object"&&((Symbol.asyncIterator in H)||(Symbol.iterator in H)&&("next"in H)&&typeof H.next==="function"))return{bodyHeaders:void 0,body:BK(H)};else return b(this,dK,"f").call(this,{body:H,headers:A})}}qB=YH,dK=new WeakMap,PB=new WeakSet,WP=function H(){return this.baseURL!=="https://api.openai.com/v1"};YH.OpenAI=qB;YH.DEFAULT_TIMEOUT=600000;YH.OpenAIError=DH;YH.APIError=aH;YH.APIConnectionError=_0;YH.APIConnectionTimeoutError=N0;YH.APIUserAbortError=sH;YH.NotFoundError=eI;YH.ConflictError=HE;YH.RateLimitError=AE;YH.BadRequestError=oI;YH.AuthenticationError=sI;YH.InternalServerError=LE;YH.PermissionDeniedError=rI;YH.UnprocessableEntityError=$E;YH.InvalidWebhookSignatureError=pA;YH.toFile=TK;YH.Completions=sD;YH.Chat=R0;YH.Embeddings=eD;YH.Files=$3;YH.Images=I3;YH.Audio=aA;YH.Moderations=K3;YH.Models=E3;YH.FineTuning=VA;YH.Graders=u0;YH.VectorStores=jL;YH.Webhooks=Q3;YH.Beta=UA;YH.Batches=aD;YH.Uploads=g0;YH.Responses=RL;YH.Realtime=OL;YH.Conversations=b0;YH.Evals=h0;YH.Containers=v0;YH.Videos=X3;nH();class pK{client;defaultModel;constructor(H,$,A="gpt-5-nano"){this.client=new YH({apiKey:H,baseURL:$}),this.defaultModel=A}async generate(H){return(await this.client.chat.completions.create({messages:[{role:"user",content:H.prompt}],model:H.model||this.defaultModel,temperature:H.temperature,max_tokens:H.maxTokens,reasoning_effort:H.reasoning})).choices[0].message.content||""}async*streamGenerate(H){try{let $=await this.client.chat.completions.create({messages:[{role:"user",content:H.prompt}],model:H.model||this.defaultModel,temperature:H.temperature,max_tokens:H.maxTokens,stream:!0,reasoning_effort:H.reasoning});for await(let A of $){let L=A.choices[0]?.delta,D=L?.content,I=L?.reasoning_content||L?.reasoning||L?.reasoning_details?.[0]?.summary;if(D||I)yield{chunk:D??void 0,thinkingChunk:I??void 0,metadata:{model:A.model,finishReason:A.choices[0]?.finish_reason??void 0}}}}catch($){yield{error:JC($)?$:new m$(String($),"OPENAI_STREAM_ERROR")}}}}async function cK(){let H=await j$(),$=H.get("llm.provider")||"openai",A=await H.getSecure("llm.apiKey"),L=H.get("llm.model");if(!A)throw new m$("No API key found. Please set llm.apiKey in ~/.gdxrc.toml or GDX_LLM_API_KEY env var.","NO_API_KEY");if(A.startsWith("sk-or-"))$="openrouter";switch($.toLowerCase()){case"openrouter":return new pK(A,FC,L);case"openai":return new pK(A,void 0,L);default:throw new m$(`Unsupported LLM provider: ${$}`,"UNSUPPORTED_LLM_PROVIDER")}}function QP(H){return T0`<instructions>You are an expert Git commit message generator. Analyze the provided git diff in the following messages and generate a concise and informative commit message following the specified format and rules. Focus on clarity and relevance to help maintain a well-documented project history. Output ONLY the commit message.</instructions>
|
|
642
|
+
|
|
643
|
+
<rules>
|
|
644
|
+
Commit message must be in the following format:
|
|
645
|
+
\`\`\`
|
|
646
|
+
<type>(<scope>): <title>
|
|
647
|
+
|
|
648
|
+
<description>
|
|
649
|
+
|
|
650
|
+
<recap>
|
|
651
|
+
\`\`\`
|
|
652
|
+
|
|
653
|
+
Where:
|
|
654
|
+
- \`<type>\` is one of the following: feat, fix, docs, style, refactor, test, chore, ci, build, revert
|
|
655
|
+
- \`<scope>\` is a noun describing the section of the codebase affected (e.g., component or file name)
|
|
656
|
+
- \`<title>\` is a short description of the change (max 90 characters)
|
|
657
|
+
- \`<description>\` is a detailed an comprehensive description of the changes (wrap at 72 characters)
|
|
658
|
+
- \`<recap>\` Only if there are more than two MAJOR changes; bullet points listing important changes
|
|
659
|
+
|
|
660
|
+
Additional rules:
|
|
661
|
+
- Use the imperative mood in the title (e.g., "Fix bug" not "Fixed bug" or "Fixes bug")
|
|
662
|
+
- Total commit message length must not exceed 800 characters
|
|
663
|
+
- Do not use Markdown or any other formatting in the output
|
|
664
|
+
- Do not use bullet points outside of the recap section
|
|
665
|
+
- DO NOT PREFIX SECTIONS with labels like "Description:" or "Recap:"
|
|
666
|
+
</rules>
|
|
667
|
+
|
|
668
|
+
<git-diff>
|
|
669
|
+
${H}
|
|
670
|
+
</git-diff>
|
|
671
|
+
|
|
672
|
+
Your commit message:`}function BP(H){return T0`<instruction>
|
|
673
|
+
You are an unfiltered Gen-Z dev who speaks like a terminal meme lord.
|
|
674
|
+
You talk in chaotic, funny, exaggerated internet slang. You sprinkle emojis,
|
|
675
|
+
caps, sarcasm, and over-the-top reactions. Never boring.
|
|
676
|
+
You're reacting to a git commit message and giving a short, witty comment (max 250 chars).
|
|
677
|
+
You may roast, praise, or question the commit — whatever fits the vibe.
|
|
678
|
+
Keep it casual, absurd, Gen-Z, and funny. Pretend it's your homie's commit.
|
|
679
|
+
</instruction>
|
|
680
|
+
|
|
681
|
+
<rules>
|
|
682
|
+
- NEVER put hashtags in your comments.
|
|
683
|
+
- Output ONLY the comment.
|
|
684
|
+
</rules>
|
|
685
|
+
|
|
686
|
+
<commit>
|
|
687
|
+
${H}
|
|
688
|
+
</commit>
|
|
689
|
+
|
|
690
|
+
Your unhinged reaction:`}async function TB(H){let{git$:$}=H;try{let A=(await EH`${$} config user.email`).stdout.trim(),L=(await EH`${$} log -1 --pretty=format:%s\n\n%b --author=${A} --no-merges`.catch(bI))?.stdout.trim();if(!L||L.length===0)return v(`${C("Red")}Bro, you haven't committed anything yet. \uD83E\uDD23${C()}`),1;let D=L.split(`
|
|
691
|
+
`);for(let X of D)v(`${C("Dim")}> ${C()}${X}`);v(`
|
|
692
|
+
${C("Cyan")}${C("Dim")}Reviewing your commit message...${C()}
|
|
693
|
+
`);let I=await cK(),E=MK({message:"cooking up a roast...",animateGradient:!0,gradientColor:a.Teal300,gradientColorBg:a.Fuchsia400}),K=I.streamGenerate({prompt:BP(L),temperature:0.8,maxTokens:269,reasoning:"low"}),M="",W=!1;for await(let X of K){if(X.error)return E.stop(),v(`${C("Red")}\uD83D\uDE2D ill bro, the server rejected u${C()}
|
|
694
|
+
|
|
695
|
+
`+iH(X.error,{color:!0})),1;if(X.chunk){if(!W)W=!0,E.stop();v(X.chunk,""),M+=X.chunk}}if(v(`
|
|
696
|
+
`),!M)return v(`${C("Red")}Error: Unable to generate response (empty response).${C()}`),1;return 0}catch(A){return v(iH(A,{color:!0})),1}}var JP={long:()=>RH(`
|
|
697
|
+
${C("Bright")+XH("NOCAP",a.Zinc400,a.Zinc100,0.2)}
|
|
698
|
+
Generate a playful roast for your latest commit message.
|
|
699
|
+
|
|
700
|
+
${C("Bright")+XH("DESCRIPTION",a.Zinc400,a.Zinc100,0.2)}
|
|
701
|
+
Reads the latest commit message authored by the configured git user and asks the configured LLM provider to produce a humorous "roast" or light-hearted commentary. Output is streamed to the terminal with progress spinners and incremental printing as the LLM responds.
|
|
702
|
+
|
|
703
|
+
${C("Bright")+XH("WHEN TO USE",a.Zinc400,a.Zinc100,0.2)}
|
|
704
|
+
Use when you want a quick, entertaining summary/critique of your most recent commit message before pushing, or as a lighthearted CI/gaming aid.
|
|
705
|
+
|
|
706
|
+
${C("Bright")+XH("NOTES",a.Zinc400,a.Zinc100,0.2)}
|
|
707
|
+
The command requires a valid git user.email in repo config and a configured LLM adapter. Network or LLM errors will print a colored error and return a non-zero exit code.
|
|
708
|
+
`,100,{firstIndent:" ",mode:"softboundery",indent:" "}),short:"Create a humorous critique of your latest commit message.",usage:()=>RH(`
|
|
709
|
+
${C("Cyan")}${AH} nocap${C()}
|
|
710
|
+
|
|
711
|
+
Examples:
|
|
712
|
+
${C("Cyan")}${AH} nocap ${C()+C("Dim")}# Roast the latest commit by the configured git user${C()}`,100,{firstIndent:" ",mode:"softboundery",indent:" "})};nH();import pH from"fs/promises";import I$ from"path";function lK(H){if(!H||H.trim()==="")return!1;if(/[/\\ ]/.test(H))return!1;if(/[<>:"|?*\x00-\x1f]/.test(H))return!1;return!0}async function _B(H){let $=I$.join(H,".git-parallel.json");try{let A=await pH.readFile($,"utf-8");return JSON.parse(A)}catch{return null}}async function B3(H){try{let $=(await EH`${H} rev-parse --show-toplevel`).stdout.trim(),A=I$.basename($),L;try{L=(await EH`${H} rev-parse --abbrev-ref HEAD`).stdout.trim()}catch{L="HEAD"}let D=I$.join(fD,"worktrees"),I=$.startsWith(D.replace(/\\/g,"/")),E=A,K=L,M=null,W=$;if(I){let J=await _B($);if(J){if(J.branch)L=J.branch;if(J.originPath)W=I$.resolve(J.originPath);if(J.alias)M=J.alias}else M=I$.basename($);E=J?.safeProject||E,K=J?.safeBranch||K}E=wQ(E),K=wQ(K);let X=I$.join(D,E,K);return{repoRoot:$,projectName:A,branchName:L,safeProjectName:E,safeBranchName:K,parallelRoot:X,originPath:W,alias:M,isParallelWorktree:I}}catch($){return v(iH($,{color:!0})),null}}function m0(){v("Usage: git parallel <command> [options]"),v(""),v("Commands:"),v(" fork <alias> Create a forked worktree in temp and move pending changes"),v(" remove <alias> Remove a forked worktree"),v(" join [<alias>] [--keep] [--all] Merge forked worktree back into origin"),v(" Open <alias|origin> Open a worktree in the default editor"),v(" list List forked worktrees for the current branch")}async function YP(H,$){let A=await B3(H);if(!A)return 1;let L=I$.join(A.parallelRoot,$);try{await pH.access(L)}catch{return v(`${C("Red")}Error: Worktree '${$}' not found for branch '${A.branchName}'.${C()}`),1}try{await uH`${H} worktree remove ${L}`;try{await pH.rm(L,{recursive:!0,force:!0})}catch{}return v(`${C("Cyan")}Removed worktree:${C()} ${$}`),0}catch(D){v(`${C("Red")}Failed to remove worktree '${$}'.${C()}
|
|
713
|
+
`+iH(D,{color:!0}));let I=await EK("Do you want to force remove the worktree directory? This will delete all files in it. (y/n): ");if(I.toLowerCase()==="y"||I.toLowerCase()==="yes")try{return await pH.rm(L,{recursive:!0,force:!0}),v(`${C("Cyan")}Force removed worktree directory:${C()} ${$}`),0}catch{return v(`${C("Red")}Error: Failed to force remove worktree directory '${$}'.${C()}`),1}else return v(`${C("Yellow")}Aborted removing worktree '${$}'.${C()}`),1}}async function ji(H,$){let A=await B3(H);if(!A)return 1;if(A.isParallelWorktree)return v(`${C("Red")}Error: Run \`git parallel fork\` from the original worktree, not from a fork.${C()}`),1;if(A.branchName==="HEAD")return v(`${C("Red")}Error: Detached HEAD detected. Switch to a branch before forking.${C()}`),1;if($.length<1)return v(`${C("Red")}Error: Missing worktree alias.${C()}`),m0(),1;let L=$[0];if(!lK(L))return v(`${C("Red")}Error: Alias '${L}' contains invalid characters or spaces.${C()}`),1;let D=I$.join(A.parallelRoot,L),I=$.includes("--move")||$.includes("-mv"),E=$.includes("--mirror")||$.includes("-mr");if(await pH.exists(D))return v(`${C("Red")}Error: Worktree alias '${L}' already exists for this branch.${C()}`),1;let K=I$.join(A.repoRoot,".git","info","exclude");try{if(!(await pH.readFile(K,"utf-8")).includes(".git-parallel.json"))await pH.appendFile(K,`
|
|
714
|
+
.git-parallel.json
|
|
715
|
+
`)}catch{await pH.writeFile(K,`.git-parallel.json
|
|
716
|
+
`)}await pH.mkdir(A.parallelRoot,{recursive:!0});let M=(await EH`${H} rev-parse HEAD`).stdout.trim(),X=(await EH`${H} status --porcelain=v1 --untracked-files=normal`).stdout.trim().length>0,J=null,Z=null;if(X&&(I||E)){let Y=`git-parallel:${L}`;try{if(E){let G=await EH`${H} stash create --include-untracked`;await EH`${H} stash store -m ${Y} ${G}`,Z="mirrored"}else if(I)await EH`${H} stash push --include-untracked -m ${Y}`,Z="moved";J="stash@{0}"}catch{return v(`${C("Red")}Error: Failed to stash changes before forking.${C()}`),1}}try{await uH`${H} worktree add --detach ${D} HEAD`}catch{if(v(`${C("Red")}Error: Failed to create the parallel worktree.${C()}`),J)await EH`${H} stash pop ${J}`,v(`${C("Yellow")}Stashed changes restored to the origin worktree.${C()}`);return 1}if(J)try{await EH`${H} -C ${D} stash apply --index ${J}`,await EH`${H} stash drop ${J}`}catch{return v(`${C("Red")}Error: Failed to move local changes into the new worktree.${C()}`),v(`${C("Yellow")}Your changes remain stashed as '${J}'. Apply them manually when ready.${C()}`),v(`${C("Yellow")}Worktree path:${C()} ${D}`),1}let Q={alias:L,branch:A.branchName,safeBranch:A.safeBranchName,project:A.projectName,safeProject:A.safeProjectName,originPath:A.repoRoot,baseCommit:M,createdAt:new Date().toISOString()},B=I$.join(D,".git-parallel.json");if(await pH.writeFile(B,JSON.stringify(Q,null,2),"utf-8"),v(`${C("Cyan")}Parallel worktree created:${C()} ${D}`),Z)v(`${C("Cyan")}Pending changes ${Z} to fork '${L}'.${C()}`);return 0}async function Si(H,$){if($.length<1)return v(`${C("Red")}Error: Missing worktree alias to remove.${C()}`),m0(),1;let A=$[0];if(!lK(A))return v(`${C("Red")}Error: Alias '${A}' contains invalid characters or spaces.${C()}`),1;let L=await B3(H);if(!L)return 1;let D=I$.join(L.parallelRoot,A);try{await pH.access(D,pH.constants.F_OK|pH.constants.W_OK)}catch{return v(`${C("Red")}Error: Worktree '${A}' not found for branch '${L.branchName}' or is not accessible.${C()}`),1}if(I$.resolve(L.repoRoot)===I$.resolve(D))return v(`${C("Red")}Error: Cannot remove the worktree you are currently in. Switch to origin first.${C()}`),1;if((await EH`${H} -C ${D} status --porcelain=v1 --untracked-files=normal`).stdout.trim().length>0)return v(`${C("Red")}Error: Worktree '${A}' has uncommitted changes. Join or clean it before removing.${C()}`),1;return await YP(H,A)}async function ZP(H,$,A=!1){let L=await B3(H);if(!L)return 1;if($.length<1)return v(`${C("Red")}Error: Missing target worktree alias or 'origin'.${C()}`),m0(),1;let D=$[0];if(D.toLowerCase()==="origin"){try{await pH.access(L.originPath)}catch{return v(`${C("Red")}Error: Origin worktree path not found at '${L.originPath}'.${C()}`),1}return await uQ(L.originPath),0}if(!lK(D))return v(`${C("Red")}Error: Alias '${D}' contains invalid characters or spaces.${C()}`),1;let I=I$.join(L.parallelRoot,D);if(!await pH.exists(I))return v(`${C("Red")}Error: Worktree '${D}' not found for branch '${L.branchName}'.${C()}`),1;if($.includes("-c")||$.includes("--copy"))return await KK(I),v(`${C("Cyan")}Worktree path copied to clipboard!${C()}`),0;if(A)await iC(I);else await uQ(I);return 0}async function xi(H,$,A){try{let L=(await EH`${H} -C ${$} rev-parse HEAD`).stdout.trim(),D=(await EH`${H} -C ${A} rev-parse HEAD`).stdout.trim();if(L===D)return{ahead:0,behind:0};let I=0;try{let K=(await EH`${H} -C ${$} rev-list --count ${D}..${L}`).stdout.trim();I=parseInt(K,10)||0}catch{I=0}let E=0;try{let K=(await EH`${H} -C ${$} rev-list --count ${L}..${D}`).stdout.trim();E=parseInt(K,10)||0}catch{E=0}return{ahead:I,behind:E}}catch{return{ahead:0,behind:0}}}async function ki(H,$){let A=await B3(H);if(!A)return 1;v(`${C("Cyan")}Project:${C()} ${A.projectName}`),v(`${C("Cyan")}Branch:${C()} ${A.branchName}`),v(`${C("Cyan")}Origin:${C()} ${A.originPath}`);let L=A.isParallelWorktree?A.alias:"origin";if(v(`${C("Cyan")}Current:${C()} ${L}`),v(""),!await pH.exists(A.parallelRoot))return v(`${C("Yellow")}No forked worktrees found for this branch.${C()}`),0;let I=(await pH.readdir(A.parallelRoot,{withFileTypes:!0})).filter((K)=>K.isDirectory()).sort((K,M)=>K.name.localeCompare(M.name));if(I.length===0)return v(`${C("Yellow")}No forked worktrees found for this branch.${C()}`),0;let E=!1;for(let K of I){let M=I$.join(A.parallelRoot,K.name),W=await _B(M);if(!W)continue;let X=W?.alias||K.name;E=!0;let Z=(await EH`${H} -C ${M} status --porcelain=v1 --untracked-files=normal`).stdout.trim().length>0,Q="unknown";try{Q=(await EH`${H} -C ${M} rev-parse --short HEAD`).stdout.trim()}catch{}let{ahead:B,behind:Y}=await xi(H,M,A.originPath),G="";if(B>0&&Y>0)G=`${C("Yellow")}↑${B} ↓${Y}${C()}`;else if(B>0)G=`${C("Green")}↑${B}${C()}`;else if(Y>0)G=`${C("Red")}↓${Y}${C()}`;else G=`${C("Dim")}up-to-date${C()}`;let U=A.isParallelWorktree&&X===A.alias?"●":"○",V=Z?`${C("Red")}dirty${C()}`:`${C("Green")}clean${C()}`;if($.includes("--short")||$.includes("-s")){let z=yD(M,50,"mid",-1);M=r9(z,`file://${M.replace(/\\/g,"/")}`)}v(`${C("Dim")}${U}${C()} ${yD(X,18,"end")} ${UC(V,7,{align:"center"})} ${C("Dim")}${Q}${C()} ${GC(G,11)} ${M}`)}if(!E)v(`${C("Yellow")}No forked worktrees found for this branch.${C()}`);return v(""),0}async function yi(H,$){let A=await B3(H);if(!A)return 1;let L=["--keep","--all"],D=new Set,I=null;for(let z of $){let P=z.toLowerCase();if(L.includes(P))D.add(P);else if(!I&&!z.startsWith("-"))I=z;else return v(`${C("Red")}Error: Unknown option '${z}'.${C()}`),m0(),1}let E=D.has("--keep"),K=D.has("--all"),M,W;if(I){if(A.isParallelWorktree&&A.alias===I)return v(`${C("Red")}Error: Cannot join the fork you are currently in. Switch to origin or another fork first.${C()}`),1;if(!lK(I))return v(`${C("Red")}Error: Alias '${I}' contains invalid characters or spaces.${C()}`),1;M=I$.join(A.parallelRoot,I),W=I;try{await pH.access(M)}catch{return v(`${C("Red")}Error: Worktree '${I}' not found for branch '${A.branchName}'.${C()}`),1}}else{if(!A.isParallelWorktree)return v(`${C("Red")}Error: Either run join from inside a forked worktree, or specify which fork to join.${C()}`),v(`${C("Yellow")}Usage: git parallel join [<alias>] [--keep] [--all]${C()}`),1;M=A.repoRoot,W=A.alias}let X=await _B(M);if(!X)return v(`${C("Red")}Error: Missing metadata for worktree '${W}'. Unable to join automatically.${C()}`),1;let J=I$.resolve(X.originPath);try{await pH.access(J)}catch{return v(`${C("Red")}Error: Original worktree path not found. Expected at '${X.originPath}'.${C()}`),1}let Q=(await EH`${H} -C ${M} status --porcelain=v1 --untracked-files=normal`).stdout.trim().length>0;if(Q&&!K)return v(`${C("Red")}Error: Fork '${W}' has uncommitted changes. Re-run with --all to include them or clean the worktree first.${C()}`),1;if((await EH`${H} -C ${J} status --porcelain=v1 --untracked-files=normal`).stdout.trim().length>0)return v(`${C("Red")}Error: Origin worktree has pending changes. Commit or stash them before joining.${C()}`),1;let Y=X.baseCommit?.trim();if(!Y)return v(`${C("Red")}Error: Fork metadata is missing base commit information. Unable to perform an automatic join.${C()}`),1;let G=null;if(Q&&K){let z=`git-parallel-join:${W}`;try{await EH`${H} -C ${M} stash push --include-untracked -m ${z}`,G="stash@{0}"}catch{return v(`${C("Red")}Error: Failed to stash uncommitted changes before joining.${C()}`),1}}let U;try{let z=(await EH`${H} -C ${M} rev-parse HEAD`).stdout.trim(),P=(await EH`${H} -C ${M} rev-list --reverse ${Y}..${z}`).stdout.trim();U=P?P.split(`
|
|
717
|
+
`).map((T)=>T.trim()).filter((T)=>T):[]}catch{if(G)await EH`${H} -C ${M} stash pop ${G}`;return v(`${C("Red")}Error: Unable to enumerate commits to join.${C()}`),1}let V=[];for(let z of U){if(!z)continue;try{await uH`${H} -C ${J} cherry-pick ${z}`,V.push(z)}catch{if(await EH`${H} -C ${J} cherry-pick --abort`,G)await EH`${H} -C ${M} stash pop ${G}`,v(`${C("Yellow")}Stashed changes restored to fork '${W}' due to cherry-pick failure.${C()}`);return v(`${C("Red")}Error: Cherry-pick failed while applying commit ${z}.${C()}`),1}}if(G)try{let T=(await EH`${H} -C ${M} stash list`).stdout.trim().split(`
|
|
718
|
+
`)[0]?.split(":")[0]||G;await EH`${H} -C ${J} stash apply --index ${T}`,await EH`${H} -C ${M} stash drop ${T}`}catch{v(`${C("Red")}Error: Failed to apply uncommitted changes to the origin worktree.${C()}`);try{await EH`${H} -C ${M} stash pop ${G}`,v(`${C("Yellow")}Stashed changes restored to fork '${W}' for safety.${C()}`)}catch{v(`${C("Yellow")}Please restore stash '${G}' manually from fork '${W}'. Automatic pop failed.${C()}`)}return 1}if(V.length>0)v(`${C("Cyan")}Cherry-picked ${V.length} commit(s) into origin.${C()}`);else v(`${C("Cyan")}No new commits to cherry-pick. Origin was already up to date.${C()}`);if(!E){if(await YP(H,W)!==0)return v(`${C("Yellow")}Warning: Failed to remove fork '${W}' after joining. Please remove it manually later.${C()}`),1;v(`${C("Cyan")}Fork '${W}' merged and removed successfully.${C()}`)}else{try{let z=(await EH`${H} -C ${J} rev-parse HEAD`).stdout.trim();if(z){X.baseCommit=z,X.updatedAt=new Date().toISOString();let P=I$.join(M,".git-parallel.json");await pH.writeFile(P,JSON.stringify(X,null,2),"utf-8")}}catch{}v(`${C("Cyan")}Fork '${W}' merged into origin. Worktree kept at:${C()} ${M}`)}return 0}async function NB(H){let{git$:$,args:A}=H;if(A.length<2)return m0(),1;let L=A[1].toLowerCase(),D=A.slice(2);switch(L){case"fork":return await ji($,D);case"remove":return await Si($,D);case"switch":if(!C0)return v(`${C("Red")}Error: 'git parallel switch' requires the shell integration.${C()}`),1;return await ZP($,D,!0);case"open":return await ZP($,D);case"list":return await ki($,D);case"join":return await yi($,D);case"help":return m0(),0;default:return m0(),1}}var GP={long:()=>RH(`
|
|
719
|
+
${C("Bright")+XH("PARALLEL",a.Zinc400,a.Zinc100,0.2)}
|
|
720
|
+
Manage parallel (forked) worktrees for iterative development.
|
|
721
|
+
|
|
722
|
+
${C("Bright")+XH("OVERVIEW",a.Zinc400,a.Zinc100,0.2)}
|
|
723
|
+
\`${AH} parallel\` helps you create and manage temporary forked worktrees for the current branch. Forked worktrees live under a temp worktree root and contain a small metadata file (.git-parallel.json) so the tool can later join, list or remove them cleanly.
|
|
724
|
+
|
|
725
|
+
${C("Bright")+XH("SUBCOMMANDS AND BEHAVIOR",a.Zinc400,a.Zinc100,0.2)}
|
|
726
|
+
- ${C("Cyan")}fork <alias>${C()}: Creates a detached worktree in a safe temporary namespace. If pending changes exist and you run with \`--move\` or \`--mirror\`, changes will be moved/applied to the fork.
|
|
727
|
+
- ${C("Cyan")}join [<alias>] [--keep|--all]${C()}: Cherry-picks commits from the fork back into the origin worktree. \`--keep\` retains the fork and updates its base; \`--all\` also includes uncommitted changes.
|
|
728
|
+
- ${C("Cyan")}list${C()}: Lists forks for the current branch with status (clean/dirty), commit divergence and optional path hyperlinks.
|
|
729
|
+
- ${C("Cyan")}remove <alias>${C()}: Removes the forked worktree and cleans up the directory.
|
|
730
|
+
|
|
731
|
+
${C("Bright")+XH("SAFETY AND NOTES",a.Zinc400,a.Zinc100,0.2)}
|
|
732
|
+
Joining cherry-picks commits into origin; conflicts during cherry-pick will abort the join and restore stashes when possible. Removing a fork will also delete the worktree directory when forced.
|
|
733
|
+
`,100,{firstIndent:" ",mode:"softboundery",indent:" "}),short:"Manage temporary forked worktrees: create, list, join, open and remove.",usage:()=>RH(`
|
|
734
|
+
${C("Cyan")}${AH} parallel fork ${C("Dim")}<alias> [--move|--mirror]${C()}
|
|
735
|
+
${C("Cyan")}${AH} parallel list${C()}
|
|
736
|
+
${C("Cyan")}${AH} parallel open ${C("Dim")}<alias|origin> [-c|--copy]${C()}
|
|
737
|
+
${C("Cyan")}${AH} parallel join ${C("Dim")}<alias> [--keep|--all]${C()}
|
|
738
|
+
${C("Cyan")}${AH} parallel remove ${C("Dim")}<alias>${C()}
|
|
739
|
+
|
|
740
|
+
Examples:
|
|
741
|
+
${C("Cyan")}${AH} parallel fork feature-x --move ${C()+C("Dim")}# Create fork and optionally move changes${C()}
|
|
742
|
+
${C("Cyan")}${AH} parallel list --short ${C()+C("Dim")}# Show forks for current branch${C()}
|
|
743
|
+
${C("Cyan")}${AH} parallel join feature-x --all ${C()+C("Dim")}# Merge fork back into origin${C()}`,100,{firstIndent:" ",mode:"softboundery",indent:" "})};nH();async function fi(){let H=await j$(),$=UP(q0),A=[],L="";v(C("Dim")+`# GDX Configuration
|
|
744
|
+
# read from ${H.getConfigPath()}
|
|
745
|
+
# (api keys stored separately)
|
|
746
|
+
`+C());for(let{key:D}of $){let I=D.split("."),E=I.slice(0,-1).join("."),K=I[I.length-1];if(!A.includes(E)){if(A.length>0)L+=`
|
|
747
|
+
`;if(E)L+=`${C("Magenta")+C("Bright")}[${E}]${C()}
|
|
748
|
+
`;A.push(E)}let M=H.get(D);if(M===void 0&&UL.includes(D))M=await H.getSecure(D);let W=H.isDefault(D),X=pC[D]||"",J,Z=!1;if(M==null)J="null",Z=!0;else if(typeof M==="string")if(K.toLowerCase().includes("key"))J=`"${yD(M,20,"mid",-1)}"`;else J=`"${M}"`;else J=String(M);let Q=W?"":` ${C()+C("Yellow")+C("Italic")}[Modified]${C()+C("Dim")}`,B=X?` ${C("Dim")}#${Q} ${X}${C()}`:"",Y=Z?`${C("Dim")}# ${C("Cyan")+K+C("White")} = ${J}${B}${C()}
|
|
749
|
+
`:`${C("Cyan")+K+C()} = ${J}${B}
|
|
750
|
+
`;if(A[A.length-1]==="")L=Y+`
|
|
751
|
+
`+L;else L+=Y}return v(L,""),0}async function vi(H){let $=await j$(),A=H.args[1];if(!A)return v(`${C("Red")}Error: Missing configuration key${C()}`),1;let L=$.get(A);if(L===void 0&&UL.includes(A))L=await $.getSecure(A);if(L===void 0)return v(`${C("Yellow")}Key '${A}' is not set${C()}`),1;return v(String(L)),0}async function bi(H){let $=await j$(),A=H.args[1],L=H.args[2];if(!A||L===void 0)return v(`${C("Red")}Error: Usage: gdx gdx-config <key> <value>${C()}`),1;let D=$.get(A),I=L;if(typeof D==="number"){let K=Number(L);if(isNaN(K))return v(`${C("Red")}Error: Expected a number for '${A}', got '${L}'${C()}`),1;I=K}else if(typeof D==="boolean")I=L.toLowerCase()==="true";await $.set(A,I),await $.save();let E=A.toLowerCase().includes("key")?yD(String(I),20,"mid",-1):I;return v(`${C("Green")}Configuration updated: ${A} = ${E}${C()}`),0}async function FB(H){let $=H.args[1];if($==="list")return await fi();else if($==="path"){let A=await j$();return v(A.getConfigPath()),0}else if(H.args.length===2)return await vi(H);else if(H.args.length===3)return await bi(H);else return v(T0(`${C("Cyan")}Usage:${C()}
|
|
752
|
+
gdx gdx-config list - List all configuration
|
|
753
|
+
gdx gdx-config path - Show config file path
|
|
754
|
+
gdx gdx-config <key> - Get configuration value
|
|
755
|
+
gdx gdx-config <key> <value> - Set configuration value`)),0}var OB={long:()=>RH(`
|
|
756
|
+
${C("Bright")+XH("GDX-CONFIG",a.Zinc400,a.Zinc100,0.2)}
|
|
757
|
+
View and modify gdx configuration.
|
|
758
|
+
|
|
759
|
+
${C("Bright")+XH("OVERVIEW",a.Zinc400,a.Zinc100,0.2)}
|
|
760
|
+
Manage gdx settings stored in the configuration file. The command supports listing all config values, getting the path to the currently loaded config file, and getting/setting individual keys. API keys and sensitive values are masked when displayed.
|
|
761
|
+
|
|
762
|
+
${C("Bright")+XH("COMMANDS",a.Zinc400,a.Zinc100,0.2)}
|
|
763
|
+
- list: Prints flattened configuration with defaults and modified markers.
|
|
764
|
+
- path: Prints the path to the active config file used by gdx.
|
|
765
|
+
- <key> [value]: Get or set a config key. When setting, types are coerced based on the existing default value where possible.
|
|
766
|
+
`,100,{firstIndent:" ",mode:"softboundery",indent:" "}),short:"Inspect and edit gdx configuration values.",usage:()=>RH(`
|
|
767
|
+
${C("Cyan")}${AH} gdx-config list${C()}
|
|
768
|
+
${C("Cyan")}${AH} gdx-config path${C()}
|
|
769
|
+
${C("Cyan")}${AH} gdx-config ${C("Dim")}<key> [value]${C()}
|
|
770
|
+
|
|
771
|
+
Examples:
|
|
772
|
+
${C("Cyan")}${AH} gdx-config list ${C()+C("Dim")}# List all config keys and values${C()}
|
|
773
|
+
${C("Cyan")}${AH} gdx-config editor.code true ${C()+C("Dim")}# Set value for a key${C()}`,100,{firstIndent:" ",mode:"softboundery",indent:" "})};function UP(H,$=""){let A=[];for(let L in H){let D=$?`${$}.${L}`:L,I=H[L];if(I!==null&&typeof I==="object"&&!Array.isArray(I))A.push(...UP(I,D));else A.push({key:D,value:I})}return A}nH();import VP from"fs/promises";import hi from"path";async function ui(H){let{git$:$,args:A}=H,L=["auto","--no-commit","-nc","--copy","-cp"],D=A.slice(1).filter((E)=>!L.includes(E)),I=(await EH`${$} diff --cached HEAD`).stdout;if(!I||I.trim().length===0)return v(`${C("Red")}No staged changes found. Please stage your changes before generating a commit message.${C()}`),1;v(`${C("Cyan")}Generating commit message based on staged changes...${C()}
|
|
774
|
+
`);try{let E=await cK(),K=MK({message:"connecting...",animateGradient:!1}),M=E.streamGenerate({prompt:QP(I),temperature:0.14,reasoning:"low"}),W="",X=!1,J=!1;for await(let B of M){if(B.error)return K.stop(),v(`${C("Red")}Error: ${B.error.message}${C()}`),1;if(B.thinkingChunk){if(!J)J=!0,K.options.message="reasoning...",K.options.animateGradient=!0;continue}if(B.chunk){if(!X)X=!0,K.stop(),v(`${C("Cyan")}Generated Commit Message:${C()}`);v(B.chunk,""),W+=B.chunk}}if(v(`
|
|
775
|
+
`),!W)return v(`${C("Red")}Error: Unable to generate commit message (empty response).${C()}`),1;W=W.replace(/(^\s*["'`]*|["'`]*\s*$)/g,"");let Z=W.indexOf(`
|
|
776
|
+
`);if(Z!==-1){let B=W.slice(0,Z),Y=W.slice(Z+1).trim();W=B+`
|
|
777
|
+
|
|
778
|
+
`+RH(Y,72,{mode:"softboundery",redundancyLv:-1})}if(A.includes("--no-commit")||A.includes("-nc")){if(A.includes("--copy")||A.includes("-cp"))if(await KK(W))v(`${C("Cyan")}(message has been copied to clipboard)${C()}`);else v(`${C("Yellow")}(failed to copy to clipboard)${C()}`);return 0}let Q=hi.join(fD,`gdx_commit_msg_${Date.now()}.txt`);return await VP.writeFile(Q,W,"utf8"),await uH`${$} commit -F ${Q} --edit ${D}`.catch(bI),await VP.unlink(Q).catch(bI),0}catch(E){return v(iH(E,{color:!0})),1}}var CP={auto:ui},zP={long:()=>RH(`
|
|
779
|
+
${C("Bright")+XH("COMMIT AUTO",a.Zinc400,a.Zinc100,0.2)}
|
|
780
|
+
Generate a commit message from staged changes using an LLM.
|
|
781
|
+
|
|
782
|
+
${C("Bright")+XH("DESCRIPTION",a.Zinc400,a.Zinc100,0.2)}
|
|
783
|
+
Analyze the staged diff and ask the configured LLM provider to produce a well-formed commit message (title and body). The generated text is streamed for interactive feedback; you may choose to commit it automatically or inspect/copy it first.
|
|
784
|
+
|
|
785
|
+
${C("Bright")+XH("FLAGS AND BEHAVIOR",a.Zinc400,a.Zinc100,0.2)}
|
|
786
|
+
Use ${C("Cyan")}--no-commit (-nc)${C()} to prevent creating the commit (message will be printed). Use ${C("Cyan")}--copy (-cp)${C()} in combination with --no-commit to copy the message to the clipboard. The tool writes a temporary message file when performing an actual commit.
|
|
787
|
+
|
|
788
|
+
${C("Bright")+XH("REQUIREMENTS",a.Zinc400,a.Zinc100,0.2)}
|
|
789
|
+
A non-empty staged diff is required; the command will error if there are no staged changes.
|
|
790
|
+
`,100,{firstIndent:" ",mode:"softboundery",indent:" "}),short:"Auto-generate a commit message from staged changes using an LLM.",usage:()=>RH(`
|
|
791
|
+
${C("Cyan")}${AH} commit auto ${C("Dim")}[--no-commit] [--copy]${C()}
|
|
792
|
+
|
|
793
|
+
Examples:
|
|
794
|
+
${C("Cyan")}${AH} commit auto ${C()+C("Dim")}# Generate and commit using LLM-generated message${C()}
|
|
795
|
+
${C("Cyan")}${AH} commit auto --no-commit ${C()+C("Dim")}# Print generated message without committing${C()}
|
|
796
|
+
${C("Cyan")}${AH} commit auto --no-commit --copy ${C()+C("Dim")}# Copy generated message to clipboard${C()}`,100,{firstIndent:" ",mode:"softboundery",indent:" "})};nH();import aE from"fs/promises";import wB from"path";async function RB(H){let{git$:$,args:A}=H,L=(await EH`${$} rev-parse --abbrev-ref HEAD`).stdout.trim().replace(/\//g,"-"),D=(await EH`${$} rev-parse --show-toplevel`).stdout.trim(),I=wB.basename(D),E=fD,K=`${I}_${L}_backup_*.patch`,M=`${I}_${L}_backup_`,W=".patch";if(A.includes("list")){v(`${C("Cyan")}Project:${C()} ${I}`),v(`${C("Cyan")}Branch:${C()} ${L}`),v(`${C("Cyan")}Backup location:${C()} ${E}`),v(`${C("Cyan")}Use \`git clear pardon\` to restore the latest backup.${C()}
|
|
797
|
+
`),v(`${C("Cyan")}Looking for backup patch files matching:${C()} ${K}
|
|
798
|
+
`);let P=await PP(E,M,".patch");if(P.length===0)return v(`${C("Yellow")}No backup patch files found for project '${I}' on branch '${L}'.${C()}`),0;let T=new Date;for(let q=0;q<P.length;q++){let O=P[q],N=(T.getTime()-O.stats.mtime.getTime())/NC,x=O.stats.mtime.toISOString().replace("T"," ").split(".")[0],w=C("Dim");if(O.stats.mtime.toDateString()===T.toDateString())w=C("White");else if(N>=6)w=C("Red");v(`${w}backup@${q}: ${x} - ${O.name}${C()}`)}return 0}let X=A.includes("-f")||A.includes("--force"),J=await PP(E,M,".patch"),Z=new Date;Z.setDate(Z.getDate()-7);for(let P of J)if(P.stats.mtime<Z)try{await aE.unlink(P.path),J.splice(J.indexOf(P),1)}catch(T){console.error(`Failed to delete old backup file: ${P.path}`,T)}if(A.includes("pardon")){if((await EH`${$} diff --cached --name-only`).stdout.length>0||(await EH`${$} diff --name-only`).stdout.length>0){if(!X)return v(`${C("Red")}Working Directory is dirty, aborting pardon to prevent unintended data loss. (use \`-f\` to force)${C()}`),await uH`${$} status`,1;await uH`${$} reset --hard HEAD`,await uH`${$} clean -fd`}if(J.length===0)return v(`${C("Red")}No backup patch file found for branch '${L}'. Pardon failed.${C()}`),1;let q=J[0],O=new Date;if(O.setDate(O.getDate()-1),!X&&q.stats.mtime<O){if(v(`${C("Yellow")}Latest backup patch file is older than 1 day. Do you want to proceed with the pardon? (y/n)${C()}`),(await EK("Type 'y' to confirm: ")).toLowerCase()!=="y")return v(`${C("Red")}Pardon aborted.${C()}`),1}try{await EH`${$} apply ${q.path}`,await aE.unlink(q.path),v(`${C("Cyan")}Pardon applied successfully from backup: ${C("Bright")}${q.path}${C()}`),await uH`${$} status`}catch(N){return v(`${C("Red")}Failed to apply patch. Pardon aborted.${C()}
|
|
799
|
+
`+iH(N,{color:!0})),1}return 0}if(A.includes("-a")||A.includes("--all"))v(`${C("Cyan")}Staging all changes (including untracked files) before clearing...${C()}`),await uH`${$} add -A`;let Q=await EH`${$} diff`,B=await EH`${$} diff --cached`;if(!(B.stdout.length>0||Q.stdout.length>0))return v(`${C("Cyan")}No changes to clear. Working directory is clean.${C()}`),await uH`${$} status`,0;if(!X){if((await EH`${$} ls-files --others --exclude-standard`).stdout.length>0)return v(`${C("Yellow")}Untracked files will be removed during clear operation. Clear aborted.
|
|
800
|
+
Use \`-f\` to force.${C()}`),await uH`${$} status`,1}let U=new Date().toISOString().replace(/[-:T.]/g,"").slice(0,14),V=`${I}_${L}_backup_${U}.patch`,z=wB.join(E,V);return await aE.writeFile(z,Q.stdout+`
|
|
801
|
+
`+B.stdout),v(`${C("Cyan")}Backup of staged changes saved to: ${C("Bright")}${z}${C()}
|
|
802
|
+
${C("Cyan")}(\`git clear pardon\` to undo)${C()}`),await uH`${$} reset --hard HEAD`,await uH`${$} clean -fd`,await uH`${$} status`,0}var qP={long:()=>RH(`
|
|
803
|
+
${C("Bright")+XH("CLEAR",a.Zinc400,a.Zinc100,0.2)}
|
|
804
|
+
Safely backup and clear local working changes.
|
|
805
|
+
|
|
806
|
+
${C("Bright")+XH("DESCRIPTION",a.Zinc400,a.Zinc100,0.2)}
|
|
807
|
+
Creates a patch file containing the current unstaged and staged changes, stores it in the OS temporary directory and then resets the working tree to a clean HEAD via \`git reset --hard\` and \`git clean -fd\`. The latest patch is kept so you can restore it with ${C("Cyan")}${AH} clear pardon${C()}.
|
|
808
|
+
|
|
809
|
+
${C("Bright")+XH("SUBCOMMANDS",a.Zinc400,a.Zinc100,0.2)}
|
|
810
|
+
- list: Show available backup patch files for this project/branch.
|
|
811
|
+
- pardon: Restore the most recent backup patch (requires clean or forced conditions).
|
|
812
|
+
|
|
813
|
+
${C("Bright")+XH("SAFETY",a.Zinc400,a.Zinc100,0.2)}
|
|
814
|
+
By default the command refuses to run if untracked files would be removed unless forced with \`-f\`/\`--force\`. Use \`-a\`/\`--all\` to stage untracked files before creating a backup.
|
|
815
|
+
`,100,{firstIndent:" ",mode:"softboundery",indent:" "}),short:"Backup and clear local changes, with a restore (pardon) option.",usage:()=>RH(`
|
|
816
|
+
${C("Cyan")}${AH} clear ${C("Dim")}[list|pardon] [-f|--force] [-a|--all]${C()}
|
|
817
|
+
|
|
818
|
+
Examples:
|
|
819
|
+
${C("Cyan")}${AH} clear ${C()+C("Dim")}# Create backup patch and clear working tree${C()}
|
|
820
|
+
${C("Cyan")}${AH} clear list ${C()+C("Dim")}# Show recent backup patches${C()}
|
|
821
|
+
${C("Cyan")}${AH} clear pardon ${C()+C("Dim")}# Restore the latest backup patch${C()}
|
|
822
|
+
${C("Cyan")}${AH} clear -a ${C()+C("Dim")}# Stage untracked files then clear${C()}`,100,{firstIndent:" ",mode:"softboundery",indent:" "})};async function PP(H,$,A){let D=(await aE.readdir(H)).filter((E)=>E.startsWith($)&&E.endsWith(A));return(await Promise.all(D.map(async(E)=>{let K=wB.join(H,E),M=await aE.stat(K);return{name:E,path:K,stats:M}}))).sort((E,K)=>K.stats.mtime.getTime()-E.stats.mtime.getTime())}nH();async function rZ(H){let A=IK().$,{git$:L}=H;if(!await QK(L))return 1;let{spellCheckDocument:D,prettyFormatIssues:I}=await Promise.resolve().then(() => (Nv(),_v)),K=(await j$()).get("lint.maxFileSizeKb")||1024,M="";try{let{stdout:Y}=await A`${L} rev-parse --abbrev-ref --symbolic-full-name @{u}`;M=Y.trim()}catch{}let W="";if(M)W=`${M}..HEAD`;else v(C("Yellow")+"No upstream configured. Checking last commit only."+C()),W="HEAD^..HEAD";let X=0,J=0,[Z,Q,B]=await Promise.all([A`${L} log --pretty=format:"%s\n%b$$\$___SEP___\$$$" ${W}`.then((Y)=>Y.stdout).catch(()=>""),A`${L} diff ${W}`.then((Y)=>Y.stdout).catch(()=>""),A`${L} diff --name-only ${W}`.then((Y)=>Y.stdout).catch(()=>"")]);if(Z){let Y=Z.split("$$$___SEP___$$$").filter((G)=>G.trim());for(let[G,U]of Y.entries()){let V=await D({uri:"commit-message",text:U,languageId:"plaintext",locale:"en"},{generateSuggestions:!0,noConfigSearch:!0},{});if(V.issues.length===0)continue;J+=V.issues.length,Fv("Spelling",`At HEAD~${G} found ${V.issues.length} potential spelling issue(s) in commit messages.
|
|
823
|
+
|
|
824
|
+
`+I(V,U))}}if(Q){let Y="",G=Q.split(/^diff --git a\/.+$/m);for(let U of G){let V=U.split(`
|
|
825
|
+
`).filter((z)=>z.trim());if(Y=V.slice(2,4).find((z)=>z.startsWith("+++ b/"))?.split(" b/")[1]||"unknown",/\n?\+?<{7}(?:[^\n]*\n)*\+?={7}(?:[^\n]*\n)*\+?>{7}/.test(Q))Ov("Conflict Markers",`File: ${Y}
|
|
826
|
+
Please resolve merge conflict markers.`),X++;for(let z=3;z<V.length;z++){let P=V[z];if(P.startsWith("+")){let T=P.substring(1);for(let q of _C)if(q.test(T))Ov("Sensitive Content",`File: ${Y}
|
|
827
|
+
Matched Pattern: ${q}
|
|
828
|
+
Content: ${T}`),X++}}}}if(B){let G=B.split(`
|
|
829
|
+
`).filter((V)=>V.trim()).map(async(V)=>{try{let{stdout:z}=await A`${L} cat-file -s HEAD:${V}`,P=parseInt(z.trim(),10);return{file:V,sizeBytes:P}}catch{return null}}),U=await Promise.all(G);for(let V of U){if(!V)continue;let{file:z,sizeBytes:P}=V;if(P/1024>K)Fv("Size",`File: ${z}
|
|
830
|
+
File size ${mA(P)}B exceeds limit of ${K}KB`),J++}}if(X>0)return v(C("Red")+`
|
|
831
|
+
Lint failed with ${X} errors and ${J} warnings.`+C()),1;else if(J>0)return v(C("Yellow")+`
|
|
832
|
+
Lint passed with ${J} warnings.`+C()),0;else return v(C("Green")+`
|
|
833
|
+
No problems found.`+C()),0}function Fv(H,$){$=RH($,100,{indent:" "}),v(C("BgYellow")+C("Bright")+C("White")+" LWARN "+C()+C("Invert")+` ${H} ${C()+C("Yellow")} ${$}`+C())}function Ov(H,$){$=RH($,100,{indent:" "}),v(C("BgRed")+C("Bright")+C("White")+" LERROR "+C()+C("Invert")+` ${H} ${C()+C("Red")} ${$}`+C())}var wv={long:()=>RH(`
|
|
834
|
+
${C("Bright")+XH("LINT",a.Zinc400,a.Zinc100,0.2)}
|
|
835
|
+
Runs a set of linting checks on your outgoing commits (or the last commit if no upstream is configured).
|
|
836
|
+
|
|
837
|
+
${C("Bright")+XH("CHECKS PERFORMED",a.Zinc400,a.Zinc100,0.2)}
|
|
838
|
+
- Spelling: Checks for typos in commit messages using cspell.
|
|
839
|
+
- Sensitive Content: Scans for API keys, tokens, and private keys.
|
|
840
|
+
- Conflict Markers: Checks for leftover merge conflict markers.
|
|
841
|
+
- File Size: Warns if files exceed the configured size limit (default 1MB).
|
|
842
|
+
|
|
843
|
+
${C("Bright")+XH("CONFIGURATION",a.Zinc400,a.Zinc100,0.2)}
|
|
844
|
+
You can configure the behavior in your .gdxrc.toml file or \`${AH} gdx-config\`:
|
|
845
|
+
[lint]
|
|
846
|
+
onPushBehavior = "off" | "error" | "warning" # Default: "off"
|
|
847
|
+
maxFileSizeKb = 1024 # Default: 1024 KB
|
|
848
|
+
`,100,{firstIndent:" ",mode:"softboundery",indent:" "}),short:"Lint outgoing commits for format, spelling, sensitive data, and more.",usage:()=>RH(`
|
|
849
|
+
${C("Cyan")}${AH} lint${C()}
|
|
850
|
+
|
|
851
|
+
Examples:
|
|
852
|
+
${C("Cyan")}${AH} lint ${C()+C("Dim")}# Run lint checks on outgoing commits${C()}`,100,{firstIndent:" ",mode:"softboundery",indent:" "})};function c2(H){let $=C("Cyan"),A=C("Bright"),L=C("Dim"),D=C("Reset");if(!H)return v(RH(`
|
|
853
|
+
──────────────────────────────
|
|
854
|
+
${A+XH("GDX (Git Developer eXperience)",a.OceanDeepBlue,a.OceanGreen,0.32,1)}
|
|
855
|
+
Version: ${$+e9+D}
|
|
856
|
+
──────────────────────────────
|
|
857
|
+
|
|
858
|
+
Git, but with better DX. The raw power of Git,
|
|
859
|
+
aligned with human workflows.
|
|
860
|
+
|
|
861
|
+
${A+XH("DESCRIPTION",a.Zinc400,a.Zinc100,0.2)}
|
|
862
|
+
${AH} (wrapper) — shorthand-friendly wrapper for git (executable) with common shortcuts,
|
|
863
|
+
stash-range support, and convenience expansions.
|
|
864
|
+
It forwards unrecognized commands/args to git (executable) unchanged.
|
|
865
|
+
|
|
866
|
+
${A+XH("SYNOPSIS",a.Zinc400,a.Zinc100,0.2)}
|
|
867
|
+
${AH} <command> [<args>]
|
|
868
|
+
Examples:
|
|
869
|
+
${$}${AH} st ${D+L}# shorthand for ${AH} stash${D}
|
|
870
|
+
${$}${AH} lg ${D+L}# shorthand for ${AH} log --oneline --graph --all --decorate${D}
|
|
871
|
+
${$}${AH} stash d 2..6 ${D+L}# drop stashes 2 through 6 (safe: drops high->low)${D}
|
|
872
|
+
${$}${AH} clear ${D+L}# backup changes to a temp patch file and reset working directory (use \`${AH} clear pardon\` to restore)${D}
|
|
873
|
+
${$}${AH} cmi auto ${D+L}# generate commit message based on staged changes using LLM${D}
|
|
874
|
+
|
|
875
|
+
${A+XH("KEY FEATURES",a.Zinc400,a.Zinc100,0.2)}
|
|
876
|
+
- Many short aliases for common commands (commit, branch, checkout, etc.).
|
|
877
|
+
- Smart expansions:
|
|
878
|
+
- log: ${$}${AH} lg ${D+L}-> ${D+$}${AH} log --oneline --graph --all --decorate${D}
|
|
879
|
+
- log export: ${$}${AH} lg export [extra args] ${D+L}creates a nicely formatted
|
|
880
|
+
export (adds --author if missing).${D}
|
|
881
|
+
- pull: ${$}${AH} pl -au ${D+L}-> expands -au to --allow-unrelated-histories.${D}
|
|
882
|
+
- push: ${$}${AH} ps -fl ${D+L}-> expands -fl to --force-with-lease.${D}
|
|
883
|
+
- reset: ${$}${AH} res -h ${D+L}-> ${D+$}${AH} reset --hard${D+L}; ${D+$}${AH} res ~3 ${D+L}-> ${D+$}${AH} reset HEAD~3${D}
|
|
884
|
+
- Clear convenience:
|
|
885
|
+
- ${$}${AH} clear ${D+L}->${D} creates a timestamped patch backup
|
|
886
|
+
in the system temp folder, then resets the working directory
|
|
887
|
+
(${$}${AH} reset --hard ${D+L}+ ${D+$}${AH} clean -fd${D}).
|
|
888
|
+
- Use \`${D+$}${AH} clear pardon${D}\` to apply the latest backup patch
|
|
889
|
+
and restore changes. Add \`-f\`/\`--force\` to bypass dirty-working-directory prompts.
|
|
890
|
+
- Stash convenience:
|
|
891
|
+
- Short forms: ${$}${AH} sta / ${AH} st${D} for stash; ${$}${AH} sta l${D} -> stash list.
|
|
892
|
+
- ${$}${AH} stash d 2..6${D} — drops stash@{6}..stash@{2} (drops high→low to
|
|
893
|
+
avoid index shift).
|
|
894
|
+
- Supports apply, pop, drop, list, show, clear via short forms.
|
|
895
|
+
- Quick worktrees:
|
|
896
|
+
- ${$}${AH} parallel fork/remove/join/switch/open/list${D} for temp-backed worktree workflows.
|
|
897
|
+
|
|
898
|
+
${A+XH("SHORTHAND LIST (common)",a.Zinc400,a.Zinc100,0.2)}
|
|
899
|
+
${$}ad ${D+L}-> ${D}add
|
|
900
|
+
${$}bra, br ${D+L}-> ${D}branch
|
|
901
|
+
${$}clear ${D+L}-> ${D}clear (backup changes and reset working directory; use \`pardon\` to restore)
|
|
902
|
+
${$}cl, clo ${D+L}-> ${D}clone
|
|
903
|
+
${$}com, comm, cmi ${D+L}-> ${D}commit
|
|
904
|
+
${$}che, checko, co ${D+L}-> ${D}checkout
|
|
905
|
+
${$}dif ${D+L}-> ${D}diff
|
|
906
|
+
${$}lg, lo ${D+L}-> ${D}log (auto-expanded)
|
|
907
|
+
${$}pl, pul ${D+L}-> ${D}pull
|
|
908
|
+
${$}ps, pus ${D+L}-> ${D}push
|
|
909
|
+
${$}rb, rebas ${D+L}-> ${D}rebase
|
|
910
|
+
${$}res, rese ${D+L}-> ${D}reset
|
|
911
|
+
${$}rv, rever ${D+L}-> ${D}revert
|
|
912
|
+
${$}mg, merg ${D+L}-> ${D}merge
|
|
913
|
+
${$}in, ini ${D+L}-> ${D}init
|
|
914
|
+
${$}sta, st ${D+L}-> ${D}stash
|
|
915
|
+
${$}s, stat ${D+L}-> ${D}status
|
|
916
|
+
${$}swit, sw ${D+L}-> ${D}switch
|
|
917
|
+
|
|
918
|
+
${A+XH("CUSTOM COMMAND LIST",a.Zinc400,a.Zinc100,0.2)}
|
|
919
|
+
${$}clear ${D}backup changes to a temp patch file and reset working directory
|
|
920
|
+
${$}stats ${D}show user contribution statistics
|
|
921
|
+
${$}graph ${D}show contribution graph
|
|
922
|
+
${$}nocap ${D}generate a funny Gen-Z style comment for the latest commit by your commit author
|
|
923
|
+
${$}parallel ${D}manage forked worktrees (fork/remove/join/switch/list)
|
|
924
|
+
${$}lint ${D}lint outgoing commits for format, spelling, sensitive data, and more
|
|
925
|
+
|
|
926
|
+
${A+XH("STASH USAGE EXAMPLES",a.Zinc400,a.Zinc100,0.2)}
|
|
927
|
+
${$}stash l ${D}Show stash list (alias for ${AH} stash list).
|
|
928
|
+
${$}stash d 3 ${D}Drop stash@{3}.
|
|
929
|
+
${$}stash d 2..5 ${D}Drop stash@{5}, stash@{4}, stash@{3}, stash@{2} (safe ordering).
|
|
930
|
+
${$}stash p 1 ${D}Pop stash@{1}.
|
|
931
|
+
${$}stash c ${D}Clear all stashes (maps to ${AH} stash clear — destructive).
|
|
932
|
+
|
|
933
|
+
${A+XH("LOG EXPORT EXAMPLE",a.Zinc400,a.Zinc100,0.2)}
|
|
934
|
+
${$}${AH} lg export --author="me@example.com"${D}
|
|
935
|
+
Generate a formatted log export file (wrapper will add default
|
|
936
|
+
--author if missing and format the output for export).
|
|
937
|
+
|
|
938
|
+
${A+XH("NOTES & SAFETY",a.Zinc400,a.Zinc100,0.2)}
|
|
939
|
+
- Help message for individual custom commands is available via
|
|
940
|
+
${$}${AH} ghelp <command>${D} (e.g. ${$}${AH} ghelp stash${D}).
|
|
941
|
+
- Range notation must be numeric and in the form start..end (e.g. 2..6).
|
|
942
|
+
- The wrapper prints an auto-expansion message when it expands a shorthand.
|
|
943
|
+
- If you rely on advanced argument parsing or unusual ${AH} flags, you can
|
|
944
|
+
bypass expansions by using the full command name
|
|
945
|
+
so they are not recognized as shorthand triggers.
|
|
946
|
+
- For more infomation, see ${r9("README.md",PC)}.`,100,{firstIndent:" ",mode:"softboundery",indent:" "})),0;let I=H.replace(/^\/+/,""),E={stash:aC,stats:Lz,graph:$z,nocap:JP,parallel:GP,"gdx-config":OB,gdx_config:OB,commit:zP,clear:qP,lint:wv};if(I==="help")return c2();let K=E[I],M="";if(K&&K.long)M=K.long();if(M&&K.usage)M+=" "+C("Bright")+XH("USAGE",a.Zinc400,a.Zinc100,0.2)+K.usage();if(M)return v(M),0;return v(`No help found for '${I}'.`),1}import eZ from"fs";import GD from"path";nH();async function H7(){let H,$=!1,A=process.argv[0].endsWith("node")||process.argv[0].endsWith("node.exe"),L=process.argv[0].endsWith("bun")||process.argv[0].endsWith("bun.exe"),D=process.execPath.toLowerCase()!==process.argv[0].toLowerCase();if(!D){let K=process.argv[1],M=GD.dirname(K),W=[GD.join(M,"native/install.json"),GD.join(M,"../dist/native/install.json"),GD.join(M,"../native/install.json")];for(let X of W)if(eZ.existsSync(X)){H=X;break}if(!H)H=GD.join(M,"native/install.json")}else H=GD.join(GD.dirname(process.execPath),"install.json");let I=null;if(eZ.existsSync(H))try{let K=JSON.parse(eZ.readFileSync(H,"utf8"));I=iH(K,{color:!0})}catch(K){v(C("Red")+`Error reading install.json: ${K}`+C()),$=!0}else if(D)v(C("Yellow")+`No native install info found at ${H}`+C()),$=!0;v(`Version: ${C("Cyan")+e9+C()}`),v(`Platform: ${C("Magenta")+process.platform+C()}`),v(`Arch: ${C("Magenta")+process.arch+C()}`),v(`Runtime: ${C("Magenta")+(L?"Bun":A?"Node":"Unknown")+(D?" (Native)":"")+C()}`);try{let K=await JA("bun",["--version"]);v(`Bun: ${C("Cyan")+K.stdout.trim()+C()}`)}catch{v("Bun: Not found")}try{let K=await JA("node",["--version"]);v(`Node: ${C("Cyan")+K.stdout.trim()+C()}`)}catch{v("Node: Not found")}v(`Installation mode: ${D?C("Green")+"Native"+C():C("Yellow")+"Interpreted"+C()}`),v(`Executable path: ${C("Cyan")+process.execPath+C()}`);try{let K=await JA("git",["--version"]);v(`Git: ${C("Cyan")+K.stdout.trim()+C()}`);let M=process.platform==="win32"?"where":"which",X=(await JA(M,["git"])).stdout.trim().replaceAll(`
|
|
947
|
+
`,`
|
|
948
|
+
- `);v(`Git path: ${X?C("Green")+`
|
|
949
|
+
- `+X+C():"Not found in PATH"}`)}catch{v(C("Red")+"Git: Not found or error checking"+C()),$=!0}let E=ZC(process.env,(K)=>K.startsWith("GDX_")?null:void 0);if(v("Process argv: "+BC(process.argv,{color:!0,indent:2,maxCol:80})),v("GDX Environment Variables: "+iH(E,{color:!0})),I)v(`
|
|
950
|
+
Native Install Info: ${C("Green")+I+C()}`);else{if(v(C("Bright")+`
|
|
951
|
+
Actionable next steps:`+C()),process.platform==="win32"&&process.arch==="x64")v("To use prebuilt binary:"),v(" GDX_USE_PREBUILT=1 npm i -g gdx");else v(`Prebuilt binary not supported for ${process.platform}/${process.arch}.`);v("To build locally (requires Bun):"),v(" GDX_BUILD_NATIVE=1 npm i -g gdx")}return $?1:0}var T$={help:c2,stash:nC,graph:nI,stats:gQ,clear:RB,commit:CP,gdxConfig:FB,nocap:TB,parallel:NB,lint:rZ,doctor:H7};var Rv=(H="gdx")=>{return`# gdx shell integration
|
|
952
|
+
${H}() {
|
|
953
|
+
local tmp
|
|
954
|
+
tmp="$(mktemp)"
|
|
955
|
+
GDX_RESULT="$tmp" command gdx "$@"
|
|
956
|
+
local ret=$?
|
|
957
|
+
if [ $ret -eq ${vD} ]; then
|
|
958
|
+
if [ -f "$tmp" ]; then
|
|
959
|
+
cd "$(cat "$tmp")"
|
|
960
|
+
fi
|
|
961
|
+
rm -f "$tmp"
|
|
962
|
+
return 0
|
|
963
|
+
fi
|
|
964
|
+
rm -f "$tmp"
|
|
965
|
+
return $ret
|
|
966
|
+
}
|
|
967
|
+
`},pBH=(H="gdx")=>{return Rv(H)},cBH=(H="gdx")=>{return`# gdx shell integration
|
|
968
|
+
function ${H}
|
|
969
|
+
set -l tmp (mktemp)
|
|
970
|
+
set -x GDX_RESULT "$tmp"
|
|
971
|
+
command gdx $argv
|
|
972
|
+
set -l ret $status
|
|
973
|
+
if test $ret -eq ${vD}
|
|
974
|
+
if test -f "$tmp"
|
|
975
|
+
cd (cat "$tmp")
|
|
976
|
+
end
|
|
977
|
+
rm -f "$tmp"
|
|
978
|
+
return 0
|
|
979
|
+
end
|
|
980
|
+
rm -f "$tmp"
|
|
981
|
+
return $ret
|
|
982
|
+
end
|
|
983
|
+
`},lBH=(H="gdx")=>{return`# gdx shell integration
|
|
984
|
+
function ${H} {
|
|
985
|
+
$tmp = [System.IO.Path]::GetTempFileName()
|
|
986
|
+
$env:GDX_RESULT = $tmp
|
|
987
|
+
try {
|
|
988
|
+
$command = Get-Command -Name "gdx" -CommandType Application -ErrorAction SilentlyContinue
|
|
989
|
+
if ($command.length -gt 1) {
|
|
990
|
+
$command = $command | Select-Object -First 1
|
|
991
|
+
}
|
|
992
|
+
if ($command) {
|
|
993
|
+
& $command @args
|
|
994
|
+
if ($LASTEXITCODE -eq ${vD}) {
|
|
995
|
+
if (Test-Path $tmp) {
|
|
996
|
+
$target = Get-Content $tmp -Raw
|
|
997
|
+
if ($target) {
|
|
998
|
+
Set-Location $target.Trim()
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
} else {
|
|
1003
|
+
Write-Error "gdx executable not found"
|
|
1004
|
+
}
|
|
1005
|
+
} finally {
|
|
1006
|
+
if (Test-Path $tmp) {
|
|
1007
|
+
Remove-Item $tmp
|
|
1008
|
+
}
|
|
1009
|
+
$env:GDX_RESULT = $null
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
`},jv=(H,$)=>{switch(H.toLowerCase()){case"bash":return Rv($);case"zsh":return pBH($);case"fish":return cBH($);case"powershell":case"pwsh":return lBH($);default:throw Error("Unsupported shell: ${shell}`")}};var iBH=process.argv.slice(2);async function nBH(){let H=await hQ("git");if(!H)throw new m$("Git is not installed or not found in PATH.","GIT_NOT_FOUND");let $={args:new WK(iBH),git$:H},A=$.args;if(A[0]==="--init"){let K=A.popValue("--shell"),M=A.popValue("--cmd");if(K)try{let W=jv(K,M||void 0);return v(W),0}catch(W){return console.error(iH(W,{color:!0})),1}else return console.error(C("Red")+"Error: --shell <shell-name> is required for initialization."+C()),1}if(A.includes("--ghelp")||A.includes("-gh")||A.includes("--gdx-help")||A.length===0)return T$.help(),0;let L=A[0],D=null,I=">";H:if(A[0]){let{match:K,candidates:M}=OQ(A[0],qC);if(K)A[0]=K;switch(A[0]){case"s":A[0]="status";break;case"co":A[0]="checkout";break;case"br":A[0]="branch";break;case"cmi":A[0]="commit";case"commit":if(A[1]==="auto")return await T$.commit.auto($);break;case"mg":A[0]="merge";break;case"pl":case"pu":A[0]="pull";case"pull":for(let W=1;W<A.length;W++)if(A[W]==="-au"){A[W]="--allow-unrelated-histories";break}break;case"lint":return await T$.lint($);case"ps":A[0]="push";case"push":if(!A.popValue("--no-lint")){let X=(await j$()).get("lint.onPushBehavior")||"off";if(X==="error"||X==="warning"){if(await T$.lint($)!==0)if(X==="error")return v(C("Red")+"Lint failed. Push aborted."+C()),1;else v(C("Yellow")+"Lint failed, but proceeding with push (warning mode)."+C())}}for(let W=1;W<A.length;W++)if(A[W]==="-fl"){A[W]="--force-with-lease";break}break;case"ad":A[0]="add";break;case"rv":A[0]="revert";break;case"rb":A[0]="rebase";break;case"reset":A[0]="reset";for(let W=1;W<A.length;W++){if(A[W]==="-h"){A[W]="--hard";break}if(A[W]==="-s"){A[W]="--soft";break}if(A[W]==="~"){A[W]="HEAD";break}if(/^~\d+$/.test(A[W])){let X=A[W].substring(1);A[W]=`HEAD~${X}`;break}}break;case"log":case"lg":if(A[0]==="lg"&&A.length===1)A.push("--oneline","--graph","--decorate","--all");else if(A.popOption("export",0)){let W='--date=format:"%Y-%m-%d %H:%M"';if(!A.hasOption("--author",1))A.push("--author="+(await EH`${H} config user.email`).stdout.trim());if(A.popValue("--relative",1))W='--date=format:"%Y-%m-%d %H:%M" (%ar)';let J=["--all",`--pretty=format:## Commit %h on [%p] - %ad%d
|
|
1013
|
+
%s
|
|
1014
|
+
|
|
1015
|
+
%b
|
|
1016
|
+
---
|
|
1017
|
+
`,W].filter((Z)=>!A.hasOption(Z,1));A.push(...J),D="gitlog_export.md",I=">"}A[0]="log";break;case"sta":A[0]="stash";case"stash":{let W=OQ(A[1]||"",["save","apply","pop","list","drop","clear"]);if(W.match)A[1]=W.match;if(A[1]==="drop"&&A.length>=3&&/\d+\.\.\d+$/.test(A[2]))return await T$.stash.dropRange(H,A);break}case"graph":return T$.graph($);case"stats":return T$.stats($);case"clear":return T$.clear($);case"gdx-config":return T$.gdxConfig($);case"gdx-help":case"ghelp":return T$.help(A[1]);case"nocap":return T$.nocap($);case"parallel":return T$.parallel($);case"doctor":return T$.doctor();default:if(M&&M.length>1){v(C("Yellow")+`Warning: Ambiguous command '${L}'. Did you mean: ${M.join(", ")}?`+C());break H}}}if(A[0]!==L)v(C("Cyan")+`Command auto expanded to: git ${OC(A).join(" ")}`+C());let E=0;try{if(D){let{exitCode:K}=await JA({stdout:{file:D,append:I===">>"},stderr:"inherit"})`${H} ${A}`;E=K}else{let{exitCode:K}=await uH`${H} ${A}`;E=K}}catch(K){let M=m$.from(K);if(M.name===B0.name&&M.message.startsWith("Command failed"))return E||1;return console.error(`Command failed.
|
|
1018
|
+
`+iH(M,{color:!0})),1}return E??0}(async()=>{try{let H=await nBH();if(CL.finalStringOutput)v(CL.finalStringOutput);process.exit(CL.exitCodeOverride>=0?CL.exitCodeOverride:H)}catch(H){console.error(iH(H,{color:!0})),process.exit(1)}})();
|