@karmaniverous/stan-core 0.1.3 → 0.3.0-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/dist/mjs/index.js CHANGED
@@ -1 +1 @@
1
- import e,{existsSync as t,readFileSync as n,rmSync as r}from"node:fs";import{stat as s,readFile as i,open as o,readdir as a,copyFile as c,writeFile as u,mkdir as l,rm as f}from"node:fs/promises";import p,{resolve as h,join as d,dirname as m}from"node:path";import{ensureDir as g,pathExists as y,move as v,remove as b}from"fs-extra";import _ from"node:process";import{fileURLToPath as w}from"node:url";import S from"process";import A from"buffer";import{createHash as k}from"node:crypto";import{spawn as E}from"node:child_process";import x from"os";import $ from"path";import O from"util";import R from"stream";import C from"events";import T from"fs";const N="archive.tar",P="archive.prev.tar",L=e=>e.replace(/\\/g,"/"),I=(e,t)=>{const n=L(e).replace(/\/+$/,""),r=L(t);return r===n||r.startsWith(`${n}/`)},M=(e,t)=>{const n=L(e);return I(`${n}/diff`,t)||I(`${n}/patch`,t)},D=I,j=e=>{const t=e.replace(/\\/g,"/");return e=>!(M(t,e)||((e,t)=>{const n=L(e);return L(t)===`${n}/output/${N}`||L(t)===`${n}/output/archive.diff.tar`||L(t)===`${n}/output/archive.warnings.txt`})(t,e))},F=1048576,H=async(e,t)=>{const n=[],r=[],a=[];await Promise.all(t.map(async t=>{const c=t.replace(/\\/g,"/");const u=h(e,t);let l=null;try{l=await s(u)}catch{return}const f=l?.size??0;let p,d=!1;try{d=await(async e=>{try{const t=await o(e,"r");try{const e=Buffer.allocUnsafe(8192),{bytesRead:n}=await t.read(e,0,e.length,0);for(let t=0;t<n;t+=1)if(0===e[t])return!0;return!1}finally{await t.close().catch(()=>{})}}catch{return!1}})(u)}catch{d=!1}if(d)return void r.push({path:c,size:f});n.push(c);try{if(f<=F||f<5*F){p=(e=>{const t=e.replace(/\r\n/g,"\n");return 0===t.length?0:t.split("\n").length})(await i(u,"utf8"))}}catch{}(f>F||"number"==typeof p&&p>3e3)&&a.push({path:c,size:f,loc:p})}));const c=[];if(r.length>0){c.push(`Binary files excluded from archive (${r.length.toString()}):`);for(const e of r)c.push(` - ${e.path} (${e.size.toString()} bytes)`);c.push("")}if(a.length>0){c.push(`Large text files (included; consider excludes if unwanted) (${a.length.toString()}):`);for(const e of a){const t=[` - ${e.path}`,`(${e.size.toString()} bytes)`];"number"==typeof e.loc&&t.push(`${e.loc.toString()} LOC`),c.push(t.join(" "))}c.push(""),c.push(`Thresholds: size > ${F.toString()} bytes or LOC > ${3e3.toString()}`)}0===c.length&&c.push("No archive warnings.");const u=c.join("\n")+(c.length?"\n":"");return{textFiles:n,excludedBinaries:r,largeText:a,warningsBody:u}};var B="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function z(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var K,U={exports:{}};var q,Z,G,W,V,Y,Q,J,X,ee,te,ne=(K||(K=1,function(e){function t(e){return Array.isArray(e)?e:[e]}const n=/^\s+$/,r=/(?:[^\\]|^)\\$/,s=/^\\!/,i=/^\\#/,o=/\r?\n/g,a=/^\.{0,2}\/|^\.{1,2}$/,c=/\/$/,u="/";let l="node-ignore";"undefined"!=typeof Symbol&&(l=Symbol.for("node-ignore"));const f=l,p=(e,t,n)=>(Object.defineProperty(e,t,{value:n}),n),h=/([0-z])-([0-z])/g,d=()=>!1,m=[[/^\uFEFF/,()=>""],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,n)=>t+(0===n.indexOf("\\")?" ":"")],[/(\\+?)\s/g,(e,t)=>{const{length:n}=t;return t.slice(0,n-n%2)+" "}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,n)=>t+6<n.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,n)=>t+n.replace(/\\\*/g,"[^\\/]*")],[/\\\\\\(?=[$.|*+(){^])/g,()=>"\\"],[/\\\\/g,()=>"\\"],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,n,r,s)=>"\\"===t?`\\[${n}${(e=>{const{length:t}=e;return e.slice(0,t-t%2)})(r)}${s}`:"]"===s&&r.length%2==0?`[${(e=>e.replace(h,(e,t,n)=>t.charCodeAt(0)<=n.charCodeAt(0)?e:""))(n)}${r}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`]],g=/(^|\\\/)?\\\*$/,y="regex",v="checkRegex",b={[y]:(e,t)=>(t?`${t}[^/]+`:"[^/]*")+"(?=$|\\/$)",[v]:(e,t)=>(t?`${t}[^/]*`:"[^/]*")+"(?=$|\\/$)"},_=e=>"string"==typeof e;class w{constructor(e,t,n,r,s,i){this.pattern=e,this.mark=t,this.negative=s,p(this,"body",n),p(this,"ignoreCase",r),p(this,"regexPrefix",i)}get regex(){const e="_"+y;return this[e]?this[e]:this._make(y,e)}get checkRegex(){const e="_"+v;return this[e]?this[e]:this._make(v,e)}_make(e,t){const n=this.regexPrefix.replace(g,b[e]),r=this.ignoreCase?new RegExp(n,"i"):new RegExp(n);return p(this,t,r)}}const S=({pattern:e,mark:t},n)=>{let r=!1,o=e;0===o.indexOf("!")&&(r=!0,o=o.substr(1)),o=o.replace(s,"!").replace(i,"#");const a=(e=>m.reduce((t,[n,r])=>t.replace(n,r.bind(e)),e))(o);return new w(e,t,o,n,r,a)};class A{constructor(e){this._ignoreCase=e,this._rules=[]}_add(e){if(e&&e[f])return this._rules=this._rules.concat(e._rules._rules),void(this._added=!0);if(_(e)&&(e={pattern:e}),(e=>e&&_(e)&&!n.test(e)&&!r.test(e)&&0!==e.indexOf("#"))(e.pattern)){const t=S(e,this._ignoreCase);this._added=!0,this._rules.push(t)}}add(e){return this._added=!1,t(_(e)?(e=>e.split(o).filter(Boolean))(e):e).forEach(this._add,this),this._added}test(e,t,n){let r,s=!1,i=!1;this._rules.forEach(o=>{const{negative:a}=o;i===a&&s!==i||a&&!s&&!i&&!t||o[n].test(e)&&(s=!a,i=a,r=a?void 0:o)});const o={ignored:s,unignored:i};return r&&(o.rule=r),o}}const k=(e,t)=>{throw new t(e)},E=(e,t,n)=>_(e)?e?!E.isNotRelative(e)||n(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):n("path must not be empty",TypeError):n(`path must be a string, but got \`${t}\``,TypeError),x=e=>a.test(e);E.isNotRelative=x,E.convert=e=>e;class ${constructor({ignorecase:e=!0,ignoreCase:t=e,allowRelativePaths:n=!1}={}){p(this,f,!0),this._rules=new A(t),this._strictPathCheck=!n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(e){return this._rules.add(e)&&this._initCache(),this}addPattern(e){return this.add(e)}_test(e,t,n,r){const s=e&&E.convert(e);return E(s,e,this._strictPathCheck?k:d),this._t(s,t,n,r)}checkIgnore(e){if(!c.test(e))return this.test(e);const t=e.split(u).filter(Boolean);if(t.pop(),t.length){const e=this._t(t.join(u)+u,this._testCache,!0,t);if(e.ignored)return e}return this._rules.test(e,!1,v)}_t(e,t,n,r){if(e in t)return t[e];if(r||(r=e.split(u).filter(Boolean)),r.pop(),!r.length)return t[e]=this._rules.test(e,n,y);const s=this._t(r.join(u)+u,t,n,r);return t[e]=s.ignored?s:this._rules.test(e,n,y)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return t(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}}const O=e=>new $(e),R=()=>{E.convert=e=>/^\\\\\?\\/.test(e)||/["<>|\u0000-\u001F]+/u.test(e)?e:e.replace(/\\/g,"/");const e=/^[a-z]:\//i;E.isNotRelative=t=>e.test(t)||x(t)};"undefined"!=typeof process&&"win32"===process.platform&&R(),e.exports=O,O.default=O,e.exports.isPathValid=e=>E(e&&E.convert(e),e,d),p(e.exports,Symbol.for("setupWindows"),R)}(U)),U.exports),re=z(ne),se={};function ie(){if(Z)return q;Z=1;const e="\\\\/",t=`[^${e}]`,n="\\.",r="\\/",s="[^/]",i=`(?:${r}|$)`,o=`(?:^|${r})`,a=`${n}{1,2}${i}`,c={DOT_LITERAL:n,PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:r,ONE_CHAR:"(?=.)",QMARK:s,END_ANCHOR:i,DOTS_SLASH:a,NO_DOT:`(?!${n})`,NO_DOTS:`(?!${o}${a})`,NO_DOT_SLASH:`(?!${n}{0,1}${i})`,NO_DOTS_SLASH:`(?!${a})`,QMARK_NO_DOT:`[^.${r}]`,STAR:`${s}*?`,START_ANCHOR:o,SEP:"/"},u={...c,SLASH_LITERAL:`[${e}]`,QMARK:t,STAR:`${t}*?`,DOTS_SLASH:`${n}{1,2}(?:[${e}]|$)`,NO_DOT:`(?!${n})`,NO_DOTS:`(?!(?:^|[${e}])${n}{1,2}(?:[${e}]|$))`,NO_DOT_SLASH:`(?!${n}{0,1}(?:[${e}]|$))`,NO_DOTS_SLASH:`(?!${n}{1,2}(?:[${e}]|$))`,QMARK_NO_DOT:`[^.${e}]`,START_ANCHOR:`(?:^|[${e}])`,END_ANCHOR:`(?:[${e}]|$)`,SEP:"\\"};return q={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{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"},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:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?u:c}}function oe(){return G||(G=1,function(e){const{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:s}=ie();e.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),e.hasRegexChars=e=>r.test(e),e.isRegexChar=t=>1===t.length&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(s,"\\$1"),e.toPosixSlashes=e=>e.replace(t,"/"),e.isWindows=()=>{if("undefined"!=typeof navigator&&navigator.platform){const e=navigator.platform.toLowerCase();return"win32"===e||"windows"===e}return!("undefined"==typeof process||!process.platform)&&"win32"===process.platform},e.removeBackslashes=e=>e.replace(n,e=>"\\"===e?"":e),e.escapeLast=(t,n,r)=>{const s=t.lastIndexOf(n,r);return-1===s?t:"\\"===t[s-1]?e.escapeLast(t,n,s-1):`${t.slice(0,s)}\\${t.slice(s)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith("./")&&(n=n.slice(2),t.prefix="./"),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?"":"^"}(?:${e})${n.contains?"":"$"}`;return!0===t.negated&&(r=`(?:^(?!${r}).*$)`),r},e.basename=(e,{windows:t}={})=>{const n=e.split(t?/[\\/]/:"/"),r=n[n.length-1];return""===r?n[n.length-2]:r}}(se)),se}function ae(){if(V)return W;V=1;const e=oe(),{CHAR_ASTERISK:t,CHAR_AT:n,CHAR_BACKWARD_SLASH:r,CHAR_COMMA:s,CHAR_DOT:i,CHAR_EXCLAMATION_MARK:o,CHAR_FORWARD_SLASH:a,CHAR_LEFT_CURLY_BRACE:c,CHAR_LEFT_PARENTHESES:u,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:f,CHAR_QUESTION_MARK:p,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:d,CHAR_RIGHT_SQUARE_BRACKET:m}=ie(),g=e=>e===a||e===r,y=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};return W=(v,b)=>{const _=b||{},w=v.length-1,S=!0===_.parts||!0===_.scanToEnd,A=[],k=[],E=[];let x,$,O=v,R=-1,C=0,T=0,N=!1,P=!1,L=!1,I=!1,M=!1,D=!1,j=!1,F=!1,H=!1,B=!1,z=0,K={value:"",depth:0,isGlob:!1};const U=()=>R>=w,q=()=>O.charCodeAt(R+1),Z=()=>(x=$,O.charCodeAt(++R));for(;R<w;){let e;if($=Z(),$!==r){if(!0===D||$===c){for(z++;!0!==U()&&($=Z());)if($!==r)if($!==c){if(!0!==D&&$===i&&($=Z())===i){if(N=K.isBrace=!0,L=K.isGlob=!0,B=!0,!0===S)continue;break}if(!0!==D&&$===s){if(N=K.isBrace=!0,L=K.isGlob=!0,B=!0,!0===S)continue;break}if($===h&&(z--,0===z)){D=!1,N=K.isBrace=!0,B=!0;break}}else z++;else j=K.backslashes=!0,Z();if(!0===S)continue;break}if($!==a){if(!0!==_.noext){if(!0===($===f||$===n||$===t||$===p||$===o)&&q()===u){if(L=K.isGlob=!0,I=K.isExtglob=!0,B=!0,$===o&&R===C&&(H=!0),!0===S){for(;!0!==U()&&($=Z());)if($!==r){if($===d){L=K.isGlob=!0,B=!0;break}}else j=K.backslashes=!0,$=Z();continue}break}}if($===t){if(x===t&&(M=K.isGlobstar=!0),L=K.isGlob=!0,B=!0,!0===S)continue;break}if($===p){if(L=K.isGlob=!0,B=!0,!0===S)continue;break}if($===l){for(;!0!==U()&&(e=Z());)if(e!==r){if(e===m){P=K.isBracket=!0,L=K.isGlob=!0,B=!0;break}}else j=K.backslashes=!0,Z();if(!0===S)continue;break}if(!0===_.nonegate||$!==o||R!==C){if(!0!==_.noparen&&$===u){if(L=K.isGlob=!0,!0===S){for(;!0!==U()&&($=Z());)if($!==u){if($===d){B=!0;break}}else j=K.backslashes=!0,$=Z();continue}break}if(!0===L){if(B=!0,!0===S)continue;break}}else F=K.negated=!0,C++}else{if(A.push(R),k.push(K),K={value:"",depth:0,isGlob:!1},!0===B)continue;if(x===i&&R===C+1){C+=2;continue}T=R+1}}else j=K.backslashes=!0,$=Z(),$===c&&(D=!0)}!0===_.noext&&(I=!1,L=!1);let G=O,W="",V="";C>0&&(W=O.slice(0,C),O=O.slice(C),T-=C),G&&!0===L&&T>0?(G=O.slice(0,T),V=O.slice(T)):!0===L?(G="",V=O):G=O,G&&""!==G&&"/"!==G&&G!==O&&g(G.charCodeAt(G.length-1))&&(G=G.slice(0,-1)),!0===_.unescape&&(V&&(V=e.removeBackslashes(V)),G&&!0===j&&(G=e.removeBackslashes(G)));const Y={prefix:W,input:v,start:C,base:G,glob:V,isBrace:N,isBracket:P,isGlob:L,isExtglob:I,isGlobstar:M,negated:F,negatedExtglob:H};if(!0===_.tokens&&(Y.maxDepth=0,g($)||k.push(K),Y.tokens=k),!0===_.parts||!0===_.tokens){let e;for(let t=0;t<A.length;t++){const n=e?e+1:C,r=A[t],s=v.slice(n,r);_.tokens&&(0===t&&0!==C?(k[t].isPrefix=!0,k[t].value=W):k[t].value=s,y(k[t]),Y.maxDepth+=k[t].depth),0===t&&""===s||E.push(s),e=r}if(e&&e+1<v.length){const t=v.slice(e+1);E.push(t),_.tokens&&(k[k.length-1].value=t,y(k[k.length-1]),Y.maxDepth+=k[k.length-1].depth)}Y.slashes=A,Y.parts=E}return Y},W}function ce(){if(Q)return Y;Q=1;const e=ie(),t=oe(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_BACKREF:i,REPLACEMENTS:o}=e,a=(e,n)=>{if("function"==typeof n.expandRange)return n.expandRange(...e,n);e.sort();const r=`[${e.join("-")}]`;try{new RegExp(r)}catch(n){return e.map(e=>t.escapeRegex(e)).join("..")}return r},c=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,u=(l,f)=>{if("string"!=typeof l)throw new TypeError("Expected a string");l=o[l]||l;const p={...f},h="number"==typeof p.maxLength?Math.min(n,p.maxLength):n;let d=l.length;if(d>h)throw new SyntaxError(`Input length: ${d}, exceeds maximum allowed length: ${h}`);const m={type:"bos",value:"",output:p.prepend||""},g=[m],y=p.capture?"":"?:",v=e.globChars(p.windows),b=e.extglobChars(v),{DOT_LITERAL:_,PLUS_LITERAL:w,SLASH_LITERAL:S,ONE_CHAR:A,DOTS_SLASH:k,NO_DOT:E,NO_DOT_SLASH:x,NO_DOTS_SLASH:$,QMARK:O,QMARK_NO_DOT:R,STAR:C,START_ANCHOR:T}=v,N=e=>`(${y}(?:(?!${T}${e.dot?k:_}).)*?)`,P=p.dot?"":E,L=p.dot?O:R;let I=!0===p.bash?N(p):C;p.capture&&(I=`(${I})`),"boolean"==typeof p.noext&&(p.noextglob=p.noext);const M={input:l,index:-1,start:0,dot:!0===p.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:g};l=t.removePrefix(l,M),d=l.length;const D=[],j=[],F=[];let H,B=m;const z=()=>M.index===d-1,K=M.peek=(e=1)=>l[M.index+e],U=M.advance=()=>l[++M.index]||"",q=()=>l.slice(M.index+1),Z=(e="",t=0)=>{M.consumed+=e,M.index+=t},G=e=>{M.output+=null!=e.output?e.output:e.value,Z(e.value)},W=()=>{let e=1;for(;"!"===K()&&("("!==K(2)||"?"===K(3));)U(),M.start++,e++;return e%2!=0&&(M.negated=!0,M.start++,!0)},V=e=>{M[e]++,F.push(e)},Y=e=>{M[e]--,F.pop()},Q=e=>{if("globstar"===B.type){const t=M.braces>0&&("comma"===e.type||"brace"===e.type),n=!0===e.extglob||D.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||n||(M.output=M.output.slice(0,-B.output.length),B.type="star",B.value="*",B.output=I,M.output+=B.output)}if(D.length&&"paren"!==e.type&&(D[D.length-1].inner+=e.value),(e.value||e.output)&&G(e),B&&"text"===B.type&&"text"===e.type)return B.output=(B.output||B.value)+e.value,void(B.value+=e.value);e.prev=B,g.push(e),B=e},J=(e,t)=>{const n={...b[t],conditions:1,inner:""};n.prev=B,n.parens=M.parens,n.output=M.output;const r=(p.capture?"(":"")+n.open;V("parens"),Q({type:e,value:t,output:M.output?"":A}),Q({type:"paren",extglob:!0,value:U(),output:r}),D.push(n)},X=e=>{let t,n=e.close+(p.capture?")":"");if("negate"===e.type){let r=I;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(r=N(p)),(r!==I||z()||/^\)+$/.test(q()))&&(n=e.close=`)$))${r}`),e.inner.includes("*")&&(t=q())&&/^\.[^\\/.]+$/.test(t)){const s=u(t,{...f,fastpaths:!1}).output;n=e.close=`)${s})${r})`}"bos"===e.prev.type&&(M.negatedExtglob=!0)}Q({type:"paren",extglob:!0,value:H,output:n}),Y("parens")};if(!1!==p.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(l)){let e=!1,n=l.replace(i,(t,n,r,s,i,o)=>"\\"===s?(e=!0,t):"?"===s?n?n+s+(i?O.repeat(i.length):""):0===o?L+(i?O.repeat(i.length):""):O.repeat(r.length):"."===s?_.repeat(r.length):"*"===s?n?n+s+(i?I:""):I:n?t:`\\${t}`);return!0===e&&(n=!0===p.unescape?n.replace(/\\/g,""):n.replace(/\\+/g,e=>e.length%2==0?"\\\\":e?"\\":"")),n===l&&!0===p.contains?(M.output=l,M):(M.output=t.wrapOutput(n,M,f),M)}for(;!z();){if(H=U(),"\0"===H)continue;if("\\"===H){const e=K();if("/"===e&&!0!==p.bash)continue;if("."===e||";"===e)continue;if(!e){H+="\\",Q({type:"text",value:H});continue}const t=/^\\+/.exec(q());let n=0;if(t&&t[0].length>2&&(n=t[0].length,M.index+=n,n%2!=0&&(H+="\\")),!0===p.unescape?H=U():H+=U(),0===M.brackets){Q({type:"text",value:H});continue}}if(M.brackets>0&&("]"!==H||"["===B.value||"[^"===B.value)){if(!1!==p.posix&&":"===H){const e=B.value.slice(1);if(e.includes("[")&&(B.posix=!0,e.includes(":"))){const e=B.value.lastIndexOf("["),t=B.value.slice(0,e),n=B.value.slice(e+2),s=r[n];if(s){B.value=t+s,M.backtrack=!0,U(),m.output||1!==g.indexOf(B)||(m.output=A);continue}}}("["===H&&":"!==K()||"-"===H&&"]"===K())&&(H=`\\${H}`),"]"!==H||"["!==B.value&&"[^"!==B.value||(H=`\\${H}`),!0===p.posix&&"!"===H&&"["===B.value&&(H="^"),B.value+=H,G({value:H});continue}if(1===M.quotes&&'"'!==H){H=t.escapeRegex(H),B.value+=H,G({value:H});continue}if('"'===H){M.quotes=1===M.quotes?0:1,!0===p.keepQuotes&&Q({type:"text",value:H});continue}if("("===H){V("parens"),Q({type:"paren",value:H});continue}if(")"===H){if(0===M.parens&&!0===p.strictBrackets)throw new SyntaxError(c("opening","("));const e=D[D.length-1];if(e&&M.parens===e.parens+1){X(D.pop());continue}Q({type:"paren",value:H,output:M.parens?")":"\\)"}),Y("parens");continue}if("["===H){if(!0!==p.nobracket&&q().includes("]"))V("brackets");else{if(!0!==p.nobracket&&!0===p.strictBrackets)throw new SyntaxError(c("closing","]"));H=`\\${H}`}Q({type:"bracket",value:H});continue}if("]"===H){if(!0===p.nobracket||B&&"bracket"===B.type&&1===B.value.length){Q({type:"text",value:H,output:`\\${H}`});continue}if(0===M.brackets){if(!0===p.strictBrackets)throw new SyntaxError(c("opening","["));Q({type:"text",value:H,output:`\\${H}`});continue}Y("brackets");const e=B.value.slice(1);if(!0===B.posix||"^"!==e[0]||e.includes("/")||(H=`/${H}`),B.value+=H,G({value:H}),!1===p.literalBrackets||t.hasRegexChars(e))continue;const n=t.escapeRegex(B.value);if(M.output=M.output.slice(0,-B.value.length),!0===p.literalBrackets){M.output+=n,B.value=n;continue}B.value=`(${y}${n}|${B.value})`,M.output+=B.value;continue}if("{"===H&&!0!==p.nobrace){V("braces");const e={type:"brace",value:H,output:"(",outputIndex:M.output.length,tokensIndex:M.tokens.length};j.push(e),Q(e);continue}if("}"===H){const e=j[j.length-1];if(!0===p.nobrace||!e){Q({type:"text",value:H,output:H});continue}let t=")";if(!0===e.dots){const e=g.slice(),n=[];for(let t=e.length-1;t>=0&&(g.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&n.unshift(e[t].value);t=a(n,p),M.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const n=M.output.slice(0,e.outputIndex),r=M.tokens.slice(e.tokensIndex);e.value=e.output="\\{",H=t="\\}",M.output=n;for(const e of r)M.output+=e.output||e.value}Q({type:"brace",value:H,output:t}),Y("braces"),j.pop();continue}if("|"===H){D.length>0&&D[D.length-1].conditions++,Q({type:"text",value:H});continue}if(","===H){let e=H;const t=j[j.length-1];t&&"braces"===F[F.length-1]&&(t.comma=!0,e="|"),Q({type:"comma",value:H,output:e});continue}if("/"===H){if("dot"===B.type&&M.index===M.start+1){M.start=M.index+1,M.consumed="",M.output="",g.pop(),B=m;continue}Q({type:"slash",value:H,output:S});continue}if("."===H){if(M.braces>0&&"dot"===B.type){"."===B.value&&(B.output=_);const e=j[j.length-1];B.type="dots",B.output+=H,B.value+=H,e.dots=!0;continue}if(M.braces+M.parens===0&&"bos"!==B.type&&"slash"!==B.type){Q({type:"text",value:H,output:_});continue}Q({type:"dot",value:H,output:_});continue}if("?"===H){if(!(B&&"("===B.value)&&!0!==p.noextglob&&"("===K()&&"?"!==K(2)){J("qmark",H);continue}if(B&&"paren"===B.type){const e=K();let t=H;("("===B.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(q()))&&(t=`\\${H}`),Q({type:"text",value:H,output:t});continue}if(!0!==p.dot&&("slash"===B.type||"bos"===B.type)){Q({type:"qmark",value:H,output:R});continue}Q({type:"qmark",value:H,output:O});continue}if("!"===H){if(!0!==p.noextglob&&"("===K()&&("?"!==K(2)||!/[!=<:]/.test(K(3)))){J("negate",H);continue}if(!0!==p.nonegate&&0===M.index){W();continue}}if("+"===H){if(!0!==p.noextglob&&"("===K()&&"?"!==K(2)){J("plus",H);continue}if(B&&"("===B.value||!1===p.regex){Q({type:"plus",value:H,output:w});continue}if(B&&("bracket"===B.type||"paren"===B.type||"brace"===B.type)||M.parens>0){Q({type:"plus",value:H});continue}Q({type:"plus",value:w});continue}if("@"===H){if(!0!==p.noextglob&&"("===K()&&"?"!==K(2)){Q({type:"at",extglob:!0,value:H,output:""});continue}Q({type:"text",value:H});continue}if("*"!==H){"$"!==H&&"^"!==H||(H=`\\${H}`);const e=s.exec(q());e&&(H+=e[0],M.index+=e[0].length),Q({type:"text",value:H});continue}if(B&&("globstar"===B.type||!0===B.star)){B.type="star",B.star=!0,B.value+=H,B.output=I,M.backtrack=!0,M.globstar=!0,Z(H);continue}let e=q();if(!0!==p.noextglob&&/^\([^?]/.test(e)){J("star",H);continue}if("star"===B.type){if(!0===p.noglobstar){Z(H);continue}const t=B.prev,n=t.prev,r="slash"===t.type||"bos"===t.type,s=n&&("star"===n.type||"globstar"===n.type);if(!0===p.bash&&(!r||e[0]&&"/"!==e[0])){Q({type:"star",value:H,output:""});continue}const i=M.braces>0&&("comma"===t.type||"brace"===t.type),o=D.length&&("pipe"===t.type||"paren"===t.type);if(!r&&"paren"!==t.type&&!i&&!o){Q({type:"star",value:H,output:""});continue}for(;"/**"===e.slice(0,3);){const t=l[M.index+4];if(t&&"/"!==t)break;e=e.slice(3),Z("/**",3)}if("bos"===t.type&&z()){B.type="globstar",B.value+=H,B.output=N(p),M.output=B.output,M.globstar=!0,Z(H);continue}if("slash"===t.type&&"bos"!==t.prev.type&&!s&&z()){M.output=M.output.slice(0,-(t.output+B.output).length),t.output=`(?:${t.output}`,B.type="globstar",B.output=N(p)+(p.strictSlashes?")":"|$)"),B.value+=H,M.globstar=!0,M.output+=t.output+B.output,Z(H);continue}if("slash"===t.type&&"bos"!==t.prev.type&&"/"===e[0]){const n=void 0!==e[1]?"|$":"";M.output=M.output.slice(0,-(t.output+B.output).length),t.output=`(?:${t.output}`,B.type="globstar",B.output=`${N(p)}${S}|${S}${n})`,B.value+=H,M.output+=t.output+B.output,M.globstar=!0,Z(H+U()),Q({type:"slash",value:"/",output:""});continue}if("bos"===t.type&&"/"===e[0]){B.type="globstar",B.value+=H,B.output=`(?:^|${S}|${N(p)}${S})`,M.output=B.output,M.globstar=!0,Z(H+U()),Q({type:"slash",value:"/",output:""});continue}M.output=M.output.slice(0,-B.output.length),B.type="globstar",B.output=N(p),B.value+=H,M.output+=B.output,M.globstar=!0,Z(H);continue}const n={type:"star",value:H,output:I};!0!==p.bash?!B||"bracket"!==B.type&&"paren"!==B.type||!0!==p.regex?(M.index!==M.start&&"slash"!==B.type&&"dot"!==B.type||("dot"===B.type?(M.output+=x,B.output+=x):!0===p.dot?(M.output+=$,B.output+=$):(M.output+=P,B.output+=P),"*"!==K()&&(M.output+=A,B.output+=A)),Q(n)):(n.output=H,Q(n)):(n.output=".*?","bos"!==B.type&&"slash"!==B.type||(n.output=P+n.output),Q(n))}for(;M.brackets>0;){if(!0===p.strictBrackets)throw new SyntaxError(c("closing","]"));M.output=t.escapeLast(M.output,"["),Y("brackets")}for(;M.parens>0;){if(!0===p.strictBrackets)throw new SyntaxError(c("closing",")"));M.output=t.escapeLast(M.output,"("),Y("parens")}for(;M.braces>0;){if(!0===p.strictBrackets)throw new SyntaxError(c("closing","}"));M.output=t.escapeLast(M.output,"{"),Y("braces")}if(!0===p.strictSlashes||"star"!==B.type&&"bracket"!==B.type||Q({type:"maybe_slash",value:"",output:`${S}?`}),!0===M.backtrack){M.output="";for(const e of M.tokens)M.output+=null!=e.output?e.output:e.value,e.suffix&&(M.output+=e.suffix)}return M};return u.fastpaths=(r,s)=>{const i={...s},a="number"==typeof i.maxLength?Math.min(n,i.maxLength):n,c=r.length;if(c>a)throw new SyntaxError(`Input length: ${c}, exceeds maximum allowed length: ${a}`);r=o[r]||r;const{DOT_LITERAL:u,SLASH_LITERAL:l,ONE_CHAR:f,DOTS_SLASH:p,NO_DOT:h,NO_DOTS:d,NO_DOTS_SLASH:m,STAR:g,START_ANCHOR:y}=e.globChars(i.windows),v=i.dot?d:h,b=i.dot?m:h,_=i.capture?"":"?:";let w=!0===i.bash?".*?":g;i.capture&&(w=`(${w})`);const S=e=>!0===e.noglobstar?w:`(${_}(?:(?!${y}${e.dot?p:u}).)*?)`,A=e=>{switch(e){case"*":return`${v}${f}${w}`;case".*":return`${u}${f}${w}`;case"*.*":return`${v}${w}${u}${f}${w}`;case"*/*":return`${v}${w}${l}${f}${b}${w}`;case"**":return v+S(i);case"**/*":return`(?:${v}${S(i)}${l})?${b}${f}${w}`;case"**/*.*":return`(?:${v}${S(i)}${l})?${b}${w}${u}${f}${w}`;case"**/.*":return`(?:${v}${S(i)}${l})?${u}${f}${w}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const n=A(t[1]);if(!n)return;return n+u+t[2]}}},k=t.removePrefix(r,{negated:!1,prefix:""});let E=A(k);return E&&!0!==i.strictSlashes&&(E+=`${l}?`),E},Y=u}function ue(){if(X)return J;X=1;const e=ae(),t=ce(),n=oe(),r=ie(),s=(e,t,n=!1)=>{if(Array.isArray(e)){const r=e.map(e=>s(e,t,n)),i=e=>{for(const t of r){const n=t(e);if(n)return n}return!1};return i}const r=(i=e)&&"object"==typeof i&&!Array.isArray(i)&&e.tokens&&e.input;var i;if(""===e||"string"!=typeof e&&!r)throw new TypeError("Expected pattern to be a non-empty string");const o=t||{},a=o.windows,c=r?s.compileRe(e,t):s.makeRe(e,t,!1,!0),u=c.state;delete c.state;let l=()=>!1;if(o.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};l=s(o.ignore,e,n)}const f=(n,r=!1)=>{const{isMatch:i,match:f,output:p}=s.test(n,c,t,{glob:e,posix:a}),h={glob:e,state:u,regex:c,posix:a,input:n,output:p,match:f,isMatch:i};return"function"==typeof o.onResult&&o.onResult(h),!1===i?(h.isMatch=!1,!!r&&h):l(n)?("function"==typeof o.onIgnore&&o.onIgnore(h),h.isMatch=!1,!!r&&h):("function"==typeof o.onMatch&&o.onMatch(h),!r||h)};return n&&(f.state=u),f};return s.test=(e,t,r,{glob:i,posix:o}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};const a=r||{},c=a.format||(o?n.toPosixSlashes:null);let u=e===i,l=u&&c?c(e):e;return!1===u&&(l=c?c(e):e,u=l===i),!1!==u&&!0!==a.capture||(u=!0===a.matchBase||!0===a.basename?s.matchBase(e,t,r,o):t.exec(l)),{isMatch:Boolean(u),match:u,output:l}},s.matchBase=(e,t,r)=>(t instanceof RegExp?t:s.makeRe(t,r)).test(n.basename(e)),s.isMatch=(e,t,n)=>s(t,n)(e),s.parse=(e,n)=>Array.isArray(e)?e.map(e=>s.parse(e,n)):t(e,{...n,fastpaths:!1}),s.scan=(t,n)=>e(t,n),s.compileRe=(e,t,n=!1,r=!1)=>{if(!0===n)return e.output;const i=t||{},o=i.contains?"":"^",a=i.contains?"":"$";let c=`${o}(?:${e.output})${a}`;e&&!0===e.negated&&(c=`^(?!${c}).*$`);const u=s.toRegex(c,t);return!0===r&&(u.state=e),u},s.makeRe=(e,n={},r=!1,i=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let o={negated:!1,fastpaths:!0};return!1===n.fastpaths||"."!==e[0]&&"*"!==e[0]||(o.output=t.fastpaths(e,n)),o.output||(o=t(e,n)),s.compileRe(o,n,r,i)},s.toRegex=(e,t)=>{try{const n=t||{};return new RegExp(e,n.flags||(n.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},s.constants=r,J=s}function le(){if(te)return ee;te=1;const e=ue(),t=oe();function n(n,r,s=!1){return!r||null!==r.windows&&void 0!==r.windows||(r={...r,windows:t.isWindows()}),e(n,r,s)}return Object.assign(n,e),ee=n}var fe=z(le());const pe=(e,t)=>{const n=t.replace(/\\/g,"/").replace(/^\.\/+/,"");const r=`${n}/system`,s=`${n}/output`,i=`${n}/diff`,o=`${n}/dist`,a=`${n}/patch`,c=`${n}/imports`;return{rootRel:n,systemRel:r,outputRel:s,diffRel:i,distRel:o,patchRel:a,importsRel:c,rootAbs:h(e,n),systemAbs:h(e,r),outputAbs:h(e,s),diffAbs:h(e,i),distAbs:h(e,o),patchAbs:h(e,a),importsAbs:h(e,c)}},he=async e=>{const t=[],n=["."];for(;n.length;){const r=n.pop(),s=h(e,r),i=await a(s,{withFileTypes:!0});for(const e of i){const s="."===r?e.name:d(r,e.name);e.isDirectory()?n.push(s):t.push(s.replace(/\\/g,"/"))}}return t},de=(e,t)=>{const n=t.replace(/\\/g,"/").replace(/\/+$/,"");return e===n||e.startsWith(n+"/")},me=e=>{const t=e.replace(/\\/g,"/").replace(/^\.\/+/,"").replace(/\/+$/,"");if(!/[*?[\]{}()!]/.test(n=t)&&!n.includes("**"))return t?e=>de(e,t):()=>!1;var n;const r=fe(t,{dot:!0});return e=>r(e)},ge=async(e,{cwd:n,stanPath:r,includeOutputDir:s,includes:o=[],excludes:a=[]})=>{const c=r.replace(/\\/g,"/"),u=((e,t)=>{const n=new Set;for(const r of e){if("package.json"===r)continue;if(!r.endsWith("/package.json"))continue;const e=r.slice(0,-13);e.startsWith("node_modules/")||e.startsWith(".git/")||e===t||e.startsWith(`${t}/`)||e.length>0&&n.add(e)}return Array.from(n)})(e,c),l=await(async e=>{const n=h(e,".gitignore");if(!t(n))return null;try{const e=await i(n,"utf8"),t=re();return t.add(e),t}catch{return null}})(n),f=[e=>de(e,"node_modules"),e=>de(e,".git"),...l?[e=>l.ignores(e)]:[],...a.map(me),...u.map(e=>t=>de(t,e)),e=>M(c,e)];s||f.push(e=>D(`${c}/output`,e));const p=e.filter(e=>!f.some(t=>t(e)));if(o.length>0){const t=o.map(me),n=[e=>M(c,e),...s?[]:[e=>D(`${c}/output`,e)]],r=new Set(p);for(const n of e)t.some(e=>e(n))&&r.add(n);const i=a.map(me);return e.filter(e=>r.has(e)&&!n.some(t=>t(e))&&!i.some(t=>t(e)))}return p},ye=async(e,t)=>{const n=pe(e,t);return await g(n.rootAbs),await g(n.outputAbs),await g(n.diffAbs),await g(n.patchAbs),{rootAbs:n.rootAbs,outputAbs:n.outputAbs,diffAbs:n.diffAbs,patchAbs:n.patchAbs}},ve=async(e,t)=>{const n=await ye(e,t);return{outDir:n.outputAbs,diffDir:n.diffAbs}},be=async(e,n,r={})=>{const{includeOutputDir:s=!1,fileName:i,includes:o=[],excludes:a=[]}=r;let u=i??"archive.tar";u.endsWith(".tar")||(u+=".tar");const{outDir:l,diffDir:f}=await ve(e,n),p=await he(e),d=await ge(p,{cwd:e,stanPath:n,includeOutputDir:s,includes:o,excludes:a}),m=h(l,u),g=h(f,P);if(t(m))try{await c(m,g)}catch{}const{textFiles:y,warningsBody:v}=await H(e,d),b=y,_=(v??"").trim();_&&"No archive warnings."!==_&&r.onArchiveWarnings?.(_);const w=await import("./index-ucZa1KMb.js");if(s){const t=Array.from(new Set([...b,`${n.replace(/\\/g,"/")}/output`]));await w.create({file:m,cwd:e,filter:j(n)},t)}else await w.create({file:m,cwd:e,filter:j(n)},b);if(!t(g))try{await c(m,g)}catch{}return m},_e=".stan",we="code -g {file}",Se=e=>e instanceof URL?w(e):e;function Ae({cwd:t}={}){const n=function(t,{cwd:n=_.cwd(),type:r="file",stopAt:s}={}){let i=p.resolve(Se(n)??"");const{root:o}=p.parse(i);s=p.resolve(i,Se(s)??o);const a=p.isAbsolute(t);for(;i;){const n=a?t:p.join(i,t);try{const t=e.statSync(n,{throwIfNoEntry:!1});if("file"===r&&t?.isFile()||"directory"===r&&t?.isDirectory())return n}catch{}if(i===s||i===o)break;i=p.dirname(i)}}("package.json",{cwd:t});return n&&p.dirname(n)}const ke=["stan.config.yml","stan.config.yaml","stan.config.json"],Ee=e=>{for(const n of ke){const r=h(e,n);if(t(r))return r}return null},xe=e=>{const t=Ee(e);if(t)return t;const n=new Set;let r=e;for(;r;){const e=Ae({cwd:r});if(!e||n.has(e))break;n.add(e);const t=Ee(e);if(t)return t;const s=m(e);if(s===e||n.has(s))break;r=s}return null};var $e,Oe={},Re={},Ce={},Te={};function Ne(){if($e)return Te;$e=1;const e=Symbol.for("yaml.alias"),t=Symbol.for("yaml.document"),n=Symbol.for("yaml.map"),r=Symbol.for("yaml.pair"),s=Symbol.for("yaml.scalar"),i=Symbol.for("yaml.seq"),o=Symbol.for("yaml.node.type"),a=e=>!!e&&"object"==typeof e&&e[o]===s;function c(e){if(e&&"object"==typeof e)switch(e[o]){case n:case i:return!0}return!1}return Te.ALIAS=e,Te.DOC=t,Te.MAP=n,Te.NODE_TYPE=o,Te.PAIR=r,Te.SCALAR=s,Te.SEQ=i,Te.hasAnchor=e=>(a(e)||c(e))&&!!e.anchor,Te.isAlias=t=>!!t&&"object"==typeof t&&t[o]===e,Te.isCollection=c,Te.isDocument=e=>!!e&&"object"==typeof e&&e[o]===t,Te.isMap=e=>!!e&&"object"==typeof e&&e[o]===n,Te.isNode=function(t){if(t&&"object"==typeof t)switch(t[o]){case e:case n:case s:case i:return!0}return!1},Te.isPair=e=>!!e&&"object"==typeof e&&e[o]===r,Te.isScalar=a,Te.isSeq=e=>!!e&&"object"==typeof e&&e[o]===i,Te}var Pe,Le,Ie={};function Me(){if(Pe)return Ie;Pe=1;var e=Ne();const t=Symbol("break visit"),n=Symbol("skip children"),r=Symbol("remove node");function s(t,n){const s=c(n);if(e.isDocument(t)){i(null,t.contents,s,Object.freeze([t]))===r&&(t.contents=null)}else i(null,t,s,Object.freeze([]))}function i(n,s,o,a){const c=u(n,s,o,a);if(e.isNode(c)||e.isPair(c))return l(n,a,c),i(n,c,o,a);if("symbol"!=typeof c)if(e.isCollection(s)){a=Object.freeze(a.concat(s));for(let e=0;e<s.items.length;++e){const n=i(e,s.items[e],o,a);if("number"==typeof n)e=n-1;else{if(n===t)return t;n===r&&(s.items.splice(e,1),e-=1)}}}else if(e.isPair(s)){a=Object.freeze(a.concat(s));const e=i("key",s.key,o,a);if(e===t)return t;e===r&&(s.key=null);const n=i("value",s.value,o,a);if(n===t)return t;n===r&&(s.value=null)}return c}async function o(t,n){const s=c(n);if(e.isDocument(t)){await a(null,t.contents,s,Object.freeze([t]))===r&&(t.contents=null)}else await a(null,t,s,Object.freeze([]))}async function a(n,s,i,o){const c=await u(n,s,i,o);if(e.isNode(c)||e.isPair(c))return l(n,o,c),a(n,c,i,o);if("symbol"!=typeof c)if(e.isCollection(s)){o=Object.freeze(o.concat(s));for(let e=0;e<s.items.length;++e){const n=await a(e,s.items[e],i,o);if("number"==typeof n)e=n-1;else{if(n===t)return t;n===r&&(s.items.splice(e,1),e-=1)}}}else if(e.isPair(s)){o=Object.freeze(o.concat(s));const e=await a("key",s.key,i,o);if(e===t)return t;e===r&&(s.key=null);const n=await a("value",s.value,i,o);if(n===t)return t;n===r&&(s.value=null)}return c}function c(e){return"object"==typeof e&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function u(t,n,r,s){return"function"==typeof r?r(t,n,s):e.isMap(n)?r.Map?.(t,n,s):e.isSeq(n)?r.Seq?.(t,n,s):e.isPair(n)?r.Pair?.(t,n,s):e.isScalar(n)?r.Scalar?.(t,n,s):e.isAlias(n)?r.Alias?.(t,n,s):void 0}function l(t,n,r){const s=n[n.length-1];if(e.isCollection(s))s.items[t]=r;else if(e.isPair(s))"key"===t?s.key=r:s.value=r;else{if(!e.isDocument(s)){const t=e.isAlias(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${t} parent`)}s.contents=r}}return s.BREAK=t,s.SKIP=n,s.REMOVE=r,o.BREAK=t,o.SKIP=n,o.REMOVE=r,Ie.visit=s,Ie.visitAsync=o,Ie}function De(){if(Le)return Ce;Le=1;var e=Ne(),t=Me();const n={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},r=e=>e.replace(/[!,[\]{}]/g,e=>n[e]);class s{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},s.defaultYaml,e),this.tags=Object.assign({},s.defaultTags,t)}clone(){const e=new s(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new s(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:s.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},s.defaultTags)}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:s.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},s.defaultTags),this.atNextDocument=!1);const n=e.trim().split(/[ \t]+/),r=n.shift();switch(r){case"%TAG":{if(2!==n.length&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;const[e,r]=n;return this.tags[e]=r,!0}case"%YAML":{if(this.yaml.explicit=!0,1!==n.length)return t(0,"%YAML directive should contain exactly one part"),!1;const[e]=n;if("1.1"===e||"1.2"===e)return this.yaml.version=e,!0;return t(6,`Unsupported YAML version ${e}`,/^\d+\.\d+$/.test(e)),!1}default:return t(0,`Unknown directive ${r}`,!0),!1}}tagName(e,t){if("!"===e)return"!";if("!"!==e[0])return t(`Not a valid tag: ${e}`),null;if("<"===e[1]){const n=e.slice(2,-1);return"!"===n||"!!"===n?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(">"!==e[e.length-1]&&t("Verbatim tags must end with a >"),n)}const[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);const s=this.tags[n];if(s)try{return s+decodeURIComponent(r)}catch(e){return t(String(e)),null}return"!"===n?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+r(e.substring(n.length));return"!"===e[0]?e:`!<${e}>`}toString(n){const r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags);let i;if(n&&s.length>0&&e.isNode(n.contents)){const r={};t.visit(n.contents,(t,n)=>{e.isNode(n)&&n.tag&&(r[n.tag]=!0)}),i=Object.keys(r)}else i=[];for(const[e,t]of s)"!!"===e&&"tag:yaml.org,2002:"===t||n&&!i.some(e=>e.startsWith(t))||r.push(`%TAG ${e} ${t}`);return r.join("\n")}}return s.defaultYaml={explicit:!1,version:"1.2"},s.defaultTags={"!!":"tag:yaml.org,2002:"},Ce.Directives=s,Ce}var je,Fe={},He={},Be={};function ze(){if(je)return Be;je=1;var e=Ne(),t=Me();function n(e){const n=new Set;return t.visit(e,{Value(e,t){t.anchor&&n.add(t.anchor)}}),n}function r(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}return Be.anchorIsValid=function(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const t=JSON.stringify(e);throw new Error(`Anchor must not contain whitespace or control characters: ${t}`)}return!0},Be.anchorNames=n,Be.createNodeAnchors=function(t,s){const i=[],o=new Map;let a=null;return{onAnchor:e=>{i.push(e),a??(a=n(t));const o=r(s,a);return a.add(o),o},setAnchors:()=>{for(const t of i){const n=o.get(t);if("object"!=typeof n||!n.anchor||!e.isScalar(n.node)&&!e.isCollection(n.node)){const e=new Error("Failed to resolve repeated object (this should not happen)");throw e.source=t,e}n.node.anchor=n.anchor}},sourceObjects:o}},Be.findNewAnchor=r,Be}var Ke,Ue={},qe={};function Ze(){if(Ke)return qe;return Ke=1,qe.applyReviver=function e(t,n,r,s){if(s&&"object"==typeof s)if(Array.isArray(s))for(let n=0,r=s.length;n<r;++n){const r=s[n],i=e(t,s,String(n),r);void 0===i?delete s[n]:i!==r&&(s[n]=i)}else if(s instanceof Map)for(const n of Array.from(s.keys())){const r=s.get(n),i=e(t,s,n,r);void 0===i?s.delete(n):i!==r&&s.set(n,i)}else if(s instanceof Set)for(const n of Array.from(s)){const r=e(t,s,n,n);void 0===r?s.delete(n):r!==n&&(s.delete(n),s.add(r))}else for(const[n,r]of Object.entries(s)){const i=e(t,s,n,r);void 0===i?delete s[n]:i!==r&&(s[n]=i)}return t.call(n,r,s)},qe}var Ge,We,Ve,Ye={};function Qe(){if(Ge)return Ye;Ge=1;var e=Ne();return Ye.toJS=function t(n,r,s){if(Array.isArray(n))return n.map((e,n)=>t(e,String(n),s));if(n&&"function"==typeof n.toJSON){if(!s||!e.hasAnchor(n))return n.toJSON(r,s);const t={aliasCount:0,count:1,res:void 0};s.anchors.set(n,t),s.onCreate=e=>{t.res=e,delete s.onCreate};const i=n.toJSON(r,s);return s.onCreate&&s.onCreate(i),i}return"bigint"!=typeof n||s?.keep?n:Number(n)},Ye}function Je(){if(We)return Ue;We=1;var e=Ze(),t=Ne(),n=Qe();return Ue.NodeBase=class{constructor(e){Object.defineProperty(this,t.NODE_TYPE,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(r,{mapAsMap:s,maxAliasCount:i,onAnchor:o,reviver:a}={}){if(!t.isDocument(r))throw new TypeError("A document argument is required");const c={anchors:new Map,doc:r,keep:!0,mapAsMap:!0===s,mapKeyWarned:!1,maxAliasCount:"number"==typeof i?i:100},u=n.toJS(this,"",c);if("function"==typeof o)for(const{count:e,res:t}of c.anchors.values())o(t,e);return"function"==typeof a?e.applyReviver(a,{"":u},"",u):u}},Ue}function Xe(){if(Ve)return He;Ve=1;var e=ze(),t=Me(),n=Ne(),r=Je(),s=Qe();let i=class extends r.NodeBase{constructor(e){super(n.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){let s,i;r?.aliasResolveCache?s=r.aliasResolveCache:(s=[],t.visit(e,{Node:(e,t)=>{(n.isAlias(t)||n.hasAnchor(t))&&s.push(t)}}),r&&(r.aliasResolveCache=s));for(const e of s){if(e===this)break;e.anchor===this.source&&(i=e)}return i}toJSON(e,t){if(!t)return{source:this.source};const{anchors:n,doc:r,maxAliasCount:i}=t,a=this.resolve(r,t);if(!a){const e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(e)}let c=n.get(a);if(c||(s.toJS(a,null,t),c=n.get(a)),!c||void 0===c.res){throw new ReferenceError("This should not happen: Alias anchor was not resolved?")}if(i>=0&&(c.count+=1,0===c.aliasCount&&(c.aliasCount=o(r,a,n)),c.count*c.aliasCount>i)){throw new ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return c.res}toString(t,n,r){const s=`*${this.source}`;if(t){if(e.anchorIsValid(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(e)}if(t.implicitKey)return`${s} `}return s}};function o(e,t,r){if(n.isAlias(t)){const n=t.resolve(e),s=r&&n&&r.get(n);return s?s.count*s.aliasCount:0}if(n.isCollection(t)){let n=0;for(const s of t.items){const t=o(e,s,r);t>n&&(n=t)}return n}if(n.isPair(t)){const n=o(e,t.key,r),s=o(e,t.value,r);return Math.max(n,s)}return 1}return He.Alias=i,He}var et,tt,nt,rt={},st={},it={};function ot(){if(et)return it;et=1;var e=Ne(),t=Je(),n=Qe();let r=class extends t.NodeBase{constructor(t){super(e.SCALAR),this.value=t}toJSON(e,t){return t?.keep?this.value:n.toJS(this.value,e,t)}toString(){return String(this.value)}};return r.BLOCK_FOLDED="BLOCK_FOLDED",r.BLOCK_LITERAL="BLOCK_LITERAL",r.PLAIN="PLAIN",r.QUOTE_DOUBLE="QUOTE_DOUBLE",r.QUOTE_SINGLE="QUOTE_SINGLE",it.Scalar=r,it.isScalarValue=e=>!e||"function"!=typeof e&&"object"!=typeof e,it}function at(){if(tt)return st;tt=1;var e=Xe(),t=Ne(),n=ot();return st.createNode=function(r,s,i){if(t.isDocument(r)&&(r=r.contents),t.isNode(r))return r;if(t.isPair(r)){const e=i.schema[t.MAP].createNode?.(i.schema,null,i);return e.items.push(r),e}(r instanceof String||r instanceof Number||r instanceof Boolean||"undefined"!=typeof BigInt&&r instanceof BigInt)&&(r=r.valueOf());const{aliasDuplicateObjects:o,onAnchor:a,onTagObj:c,schema:u,sourceObjects:l}=i;let f;if(o&&r&&"object"==typeof r){if(f=l.get(r),f)return f.anchor??(f.anchor=a(r)),new e.Alias(f.anchor);f={anchor:null,node:null},l.set(r,f)}s?.startsWith("!!")&&(s="tag:yaml.org,2002:"+s.slice(2));let p=function(e,t,n){if(t){const e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}(r,s,u.tags);if(!p){if(r&&"function"==typeof r.toJSON&&(r=r.toJSON()),!r||"object"!=typeof r){const e=new n.Scalar(r);return f&&(f.node=e),e}p=r instanceof Map?u[t.MAP]:Symbol.iterator in Object(r)?u[t.SEQ]:u[t.MAP]}c&&(c(p),delete i.onTagObj);const h=p?.createNode?p.createNode(i.schema,r,i):"function"==typeof p?.nodeClass?.from?p.nodeClass.from(i.schema,r,i):new n.Scalar(r);return s?h.tag=s:p.default||(h.tag=p.tag),f&&(f.node=h),h},st}function ct(){if(nt)return rt;nt=1;var e=at(),t=Ne(),n=Je();function r(t,n,r){let s=r;for(let e=n.length-1;e>=0;--e){const t=n[e];if("number"==typeof t&&Number.isInteger(t)&&t>=0){const e=[];e[t]=s,s=e}else s=new Map([[t,s]])}return e.createNode(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}const s=e=>null==e||"object"==typeof e&&!!e[Symbol.iterator]().next().done;let i=class extends n.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(n=>t.isNode(n)||t.isPair(n)?n.clone(e):n),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(s(e))this.add(n);else{const[s,...i]=e,o=this.get(s,!0);if(t.isCollection(o))o.addIn(i,n);else{if(void 0!==o||!this.schema)throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`);this.set(s,r(this.schema,i,n))}}}deleteIn(e){const[n,...r]=e;if(0===r.length)return this.delete(n);const s=this.get(n,!0);if(t.isCollection(s))return s.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(e,n){const[r,...s]=e,i=this.get(r,!0);return 0===s.length?!n&&t.isScalar(i)?i.value:i:t.isCollection(i)?i.getIn(s,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!t.isPair(n))return!1;const r=n.value;return null==r||e&&t.isScalar(r)&&null==r.value&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){const[n,...r]=e;if(0===r.length)return this.has(n);const s=this.get(n,!0);return!!t.isCollection(s)&&s.hasIn(r)}setIn(e,n){const[s,...i]=e;if(0===i.length)this.set(s,n);else{const e=this.get(s,!0);if(t.isCollection(e))e.setIn(i,n);else{if(void 0!==e||!this.schema)throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`);this.set(s,r(this.schema,i,n))}}}};return rt.Collection=i,rt.collectionFromPath=r,rt.isEmptyPath=s,rt}var ut,lt={},ft={},pt={},ht={};function dt(){if(ut)return ht;ut=1;function e(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}return ht.indentComment=e,ht.lineComment=(t,n,r)=>t.endsWith("\n")?e(r,n):r.includes("\n")?"\n"+e(r,n):(t.endsWith(" ")?"":" ")+r,ht.stringifyComment=e=>e.replace(/^(?!$)(?: $)?/gm,"#"),ht}var mt,gt,yt,vt,bt={},_t={};function wt(){if(mt)return _t;mt=1;const e="block",t="quoted";function n(e,t,n){let r=t,s=t+1,i=e[s];for(;" "===i||"\t"===i;)if(t<s+n)i=e[++t];else{do{i=e[++t]}while(i&&"\n"!==i);r=t,s=t+1,i=e[s]}return r}return _t.FOLD_BLOCK=e,_t.FOLD_FLOW="flow",_t.FOLD_QUOTED=t,_t.foldFlowLines=function(r,s,i="flow",{indentAtStart:o,lineWidth:a=80,minContentWidth:c=20,onFold:u,onOverflow:l}={}){if(!a||a<0)return r;a<c&&(c=0);const f=Math.max(1+c,1+a-s.length);if(r.length<=f)return r;const p=[],h={};let d,m,g=a-s.length;"number"==typeof o&&(o>a-Math.max(2,c)?p.push(0):g=a-o);let y=!1,v=-1,b=-1,_=-1;i===e&&(v=n(r,v,s.length),-1!==v&&(g=v+f));for(let o;o=r[v+=1];){if(i===t&&"\\"===o){switch(b=v,r[v+1]){case"x":v+=3;break;case"u":v+=5;break;case"U":v+=9;break;default:v+=1}_=v}if("\n"===o)i===e&&(v=n(r,v,s.length)),g=v+s.length+f,d=void 0;else{if(" "===o&&m&&" "!==m&&"\n"!==m&&"\t"!==m){const e=r[v+1];e&&" "!==e&&"\n"!==e&&"\t"!==e&&(d=v)}if(v>=g)if(d)p.push(d),g=d+f,d=void 0;else if(i===t){for(;" "===m||"\t"===m;)m=o,o=r[v+=1],y=!0;const e=v>_+1?v-2:b-1;if(h[e])return r;p.push(e),h[e]=!0,g=e+f,d=void 0}else y=!0}m=o}if(y&&l&&l(),0===p.length)return r;u&&u();let w=r.slice(0,p[0]);for(let e=0;e<p.length;++e){const n=p[e],o=p[e+1]||r.length;0===n?w=`\n${s}${r.slice(0,o)}`:(i===t&&h[n]&&(w+=`${r[n]}\\`),w+=`\n${s}${r.slice(n+1,o)}`)}return w},_t}function St(){if(gt)return bt;gt=1;var e=ot(),t=wt();const n=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),r=e=>/^(%|---|\.\.\.)/m.test(e);function s(e,s){const i=JSON.stringify(e);if(s.options.doubleQuotedAsJSON)return i;const{implicitKey:o}=s,a=s.options.doubleQuotedMinMultiLineLength,c=s.indent||(r(e)?" ":"");let u="",l=0;for(let e=0,t=i[e];t;t=i[++e])if(" "===t&&"\\"===i[e+1]&&"n"===i[e+2]&&(u+=i.slice(l,e)+"\\ ",e+=1,l=e,t="\\"),"\\"===t)switch(i[e+1]){case"u":{u+=i.slice(l,e);const t=i.substr(e+2,4);switch(t){case"0000":u+="\\0";break;case"0007":u+="\\a";break;case"000b":u+="\\v";break;case"001b":u+="\\e";break;case"0085":u+="\\N";break;case"00a0":u+="\\_";break;case"2028":u+="\\L";break;case"2029":u+="\\P";break;default:"00"===t.substr(0,2)?u+="\\x"+t.substr(2):u+=i.substr(e,6)}e+=5,l=e+1}break;case"n":if(o||'"'===i[e+2]||i.length<a)e+=1;else{for(u+=i.slice(l,e)+"\n\n";"\\"===i[e+2]&&"n"===i[e+3]&&'"'!==i[e+4];)u+="\n",e+=2;u+=c," "===i[e+2]&&(u+="\\"),e+=1,l=e+1}break;default:e+=1}return u=l?u+i.slice(l):i,o?u:t.foldFlowLines(u,c,t.FOLD_QUOTED,n(s,!1))}function i(e,i){if(!1===i.options.singleQuote||i.implicitKey&&e.includes("\n")||/[ \t]\n|\n[ \t]/.test(e))return s(e,i);const o=i.indent||(r(e)?" ":""),a="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&\n${o}`)+"'";return i.implicitKey?a:t.foldFlowLines(a,o,t.FOLD_FLOW,n(i,!1))}function o(e,t){const{singleQuote:n}=t.options;let r;if(!1===n)r=s;else{const t=e.includes('"'),o=e.includes("'");r=t&&!o?i:o&&!t?s:n?i:s}return r(e,t)}let a;try{a=new RegExp("(^|(?<!\n))\n+(?!\n|$)","g")}catch{a=/\n+(?!\n|$)/g}function c({comment:s,type:i,value:c},u,l,f){const{blockQuote:p,commentString:h,lineWidth:d}=u.options;if(!p||/\n[\t ]+$/.test(c))return o(c,u);const m=u.indent||(u.forceBlockIndent||r(c)?" ":""),g="literal"===p||"folded"!==p&&i!==e.Scalar.BLOCK_FOLDED&&(i===e.Scalar.BLOCK_LITERAL||!function(e,t,n){if(!t||t<0)return!1;const r=t-n,s=e.length;if(s<=r)return!1;for(let t=0,n=0;t<s;++t)if("\n"===e[t]){if(t-n>r)return!0;if(n=t+1,s-n<=r)return!1}return!0}(c,d,m.length));if(!c)return g?"|\n":">\n";let y,v;for(v=c.length;v>0;--v){const e=c[v-1];if("\n"!==e&&"\t"!==e&&" "!==e)break}let b=c.substring(v);const _=b.indexOf("\n");-1===_?y="-":c===b||_!==b.length-1?(y="+",f&&f()):y="",b&&(c=c.slice(0,-b.length),"\n"===b[b.length-1]&&(b=b.slice(0,-1)),b=b.replace(a,`$&${m}`));let w,S=!1,A=-1;for(w=0;w<c.length;++w){const e=c[w];if(" "===e)S=!0;else{if("\n"!==e)break;A=w}}let k=c.substring(0,A<w?A+1:w);k&&(c=c.substring(k.length),k=k.replace(/\n+/g,`$&${m}`));let E=(S?m?"2":"1":"")+y;if(s&&(E+=" "+h(s.replace(/ ?[\r\n]+/g," ")),l&&l()),!g){const r=c.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${m}`);let s=!1;const o=n(u,!0);"folded"!==p&&i!==e.Scalar.BLOCK_FOLDED&&(o.onOverflow=()=>{s=!0});const a=t.foldFlowLines(`${k}${r}${b}`,m,t.FOLD_BLOCK,o);if(!s)return`>${E}\n${m}${a}`}return`|${E}\n${m}${k}${c=c.replace(/\n+/g,`$&${m}`)}${b}`}return bt.stringifyString=function(a,u,l,f){const{implicitKey:p,inFlow:h}=u,d="string"==typeof a.value?a:Object.assign({},a,{value:String(a.value)});let{type:m}=a;m!==e.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(d.value)&&(m=e.Scalar.QUOTE_DOUBLE);const g=a=>{switch(a){case e.Scalar.BLOCK_FOLDED:case e.Scalar.BLOCK_LITERAL:return p||h?o(d.value,u):c(d,u,l,f);case e.Scalar.QUOTE_DOUBLE:return s(d.value,u);case e.Scalar.QUOTE_SINGLE:return i(d.value,u);case e.Scalar.PLAIN:return function(s,i,a,u){const{type:l,value:f}=s,{actualString:p,implicitKey:h,indent:d,indentStep:m,inFlow:g}=i;if(h&&f.includes("\n")||g&&/[[\]{},]/.test(f))return o(f,i);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(f))return h||g||!f.includes("\n")?o(f,i):c(s,i,a,u);if(!h&&!g&&l!==e.Scalar.PLAIN&&f.includes("\n"))return c(s,i,a,u);if(r(f)){if(""===d)return i.forceBlockIndent=!0,c(s,i,a,u);if(h&&d===m)return o(f,i)}const y=f.replace(/\n+/g,`$&\n${d}`);if(p){const e=e=>e.default&&"tag:yaml.org,2002:str"!==e.tag&&e.test?.test(y),{compat:t,tags:n}=i.doc.schema;if(n.some(e)||t?.some(e))return o(f,i)}return h?y:t.foldFlowLines(y,d,t.FOLD_FLOW,n(i,!1))}(d,u,l,f);default:return null}};let y=g(m);if(null===y){const{defaultKeyType:e,defaultStringType:t}=u.options,n=p&&e||t;if(y=g(n),null===y)throw new Error(`Unsupported default string type ${n}`)}return y},bt}function At(){if(yt)return pt;yt=1;var e=ze(),t=Ne(),n=dt(),r=St();return pt.createStringifyContext=function(e,t){const r=Object.assign({blockQuote:!0,commentString:n.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},e.schema.toStringOptions,t);let s;switch(r.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:e,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:"number"==typeof r.indent?" ".repeat(r.indent):" ",inFlow:s,options:r}},pt.stringify=function(n,s,i,o){if(t.isPair(n))return n.toString(s,i,o);if(t.isAlias(n)){if(s.doc.directives)return n.toString(s);if(s.resolvedAliases?.has(n))throw new TypeError("Cannot stringify circular structure without alias nodes");s.resolvedAliases?s.resolvedAliases.add(n):s.resolvedAliases=new Set([n]),n=n.resolve(s.doc)}let a;const c=t.isNode(n)?n:s.doc.createNode(n,{onTagObj:e=>a=e});a??(a=function(e,n){if(n.tag){const t=e.filter(e=>e.tag===n.tag);if(t.length>0)return t.find(e=>e.format===n.format)??t[0]}let r,s;if(t.isScalar(n)){s=n.value;let t=e.filter(e=>e.identify?.(s));if(t.length>1){const e=t.filter(e=>e.test);e.length>0&&(t=e)}r=t.find(e=>e.format===n.format)??t.find(e=>!e.format)}else s=n,r=e.find(e=>e.nodeClass&&s instanceof e.nodeClass);if(!r)throw new Error(`Tag not resolved for ${s?.constructor?.name??(null===s?"null":typeof s)} value`);return r}(s.doc.schema.tags,c));const u=function(n,r,{anchors:s,doc:i}){if(!i.directives)return"";const o=[],a=(t.isScalar(n)||t.isCollection(n))&&n.anchor;a&&e.anchorIsValid(a)&&(s.add(a),o.push(`&${a}`));const c=n.tag??(r.default?null:r.tag);return c&&o.push(i.directives.tagString(c)),o.join(" ")}(c,a,s);u.length>0&&(s.indentAtStart=(s.indentAtStart??0)+u.length+1);const l="function"==typeof a.stringify?a.stringify(c,s,i,o):t.isScalar(c)?r.stringifyString(c,s,i,o):c.toString(s,i,o);return u?t.isScalar(c)||"{"===l[0]||"["===l[0]?`${u} ${l}`:`${u}\n${s.indent}${l}`:l},pt}function kt(){if(vt)return ft;vt=1;var e=Ne(),t=ot(),n=At(),r=dt();return ft.stringifyPair=function({key:s,value:i},o,a,c){const{allNullValues:u,doc:l,indent:f,indentStep:p,options:{commentString:h,indentSeq:d,simpleKeys:m}}=o;let g=e.isNode(s)&&s.comment||null;if(m){if(g)throw new Error("With simple keys, key nodes cannot have comments");if(e.isCollection(s)||!e.isNode(s)&&"object"==typeof s){throw new Error("With simple keys, collection cannot be used as a key value")}}let y=!m&&(!s||g&&null==i&&!o.inFlow||e.isCollection(s)||(e.isScalar(s)?s.type===t.Scalar.BLOCK_FOLDED||s.type===t.Scalar.BLOCK_LITERAL:"object"==typeof s));o=Object.assign({},o,{allNullValues:!1,implicitKey:!y&&(m||!u),indent:f+p});let v,b,_,w=!1,S=!1,A=n.stringify(s,o,()=>w=!0,()=>S=!0);if(!y&&!o.inFlow&&A.length>1024){if(m)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");y=!0}if(o.inFlow){if(u||null==i)return w&&a&&a(),""===A?"?":y?`? ${A}`:A}else if(u&&!m||null==i&&y)return A=`? ${A}`,g&&!w?A+=r.lineComment(A,o.indent,h(g)):S&&c&&c(),A;w&&(g=null),y?(g&&(A+=r.lineComment(A,o.indent,h(g))),A=`? ${A}\n${f}:`):(A=`${A}:`,g&&(A+=r.lineComment(A,o.indent,h(g)))),e.isNode(i)?(v=!!i.spaceBefore,b=i.commentBefore,_=i.comment):(v=!1,b=null,_=null,i&&"object"==typeof i&&(i=l.createNode(i))),o.implicitKey=!1,y||g||!e.isScalar(i)||(o.indentAtStart=A.length+1),S=!1,d||!(p.length>=2)||o.inFlow||y||!e.isSeq(i)||i.flow||i.tag||i.anchor||(o.indent=o.indent.substring(2));let k=!1;const E=n.stringify(i,o,()=>k=!0,()=>S=!0);let x=" ";if(g||v||b){if(x=v?"\n":"",b){const e=h(b);x+=`\n${r.indentComment(e,o.indent)}`}""!==E||o.inFlow?x+=`\n${o.indent}`:"\n"===x&&(x="\n\n")}else if(!y&&e.isCollection(i)){const e=E[0],t=E.indexOf("\n"),n=-1!==t,r=o.inFlow??i.flow??0===i.items.length;if(n||!r){let r=!1;if(n&&("&"===e||"!"===e)){let n=E.indexOf(" ");"&"===e&&-1!==n&&n<t&&"!"===E[n+1]&&(n=E.indexOf(" ",n+1)),(-1===n||t<n)&&(r=!0)}r||(x=`\n${o.indent}`)}}else""!==E&&"\n"!==E[0]||(x="");return A+=x+E,o.inFlow?k&&a&&a():_&&!k?A+=r.lineComment(A,o.indent,h(_)):S&&c&&c(),A},ft}var Et,xt={},$t={};function Ot(){if(Et)return $t;Et=1;var e=S;return $t.debug=function(e,...t){"debug"===e&&console.log(...t)},$t.warn=function(t,n){"debug"!==t&&"warn"!==t||("function"==typeof e.emitWarning?e.emitWarning(n):console.warn(n))},$t}var Rt,Ct,Tt,Nt={};function Pt(){if(Rt)return Nt;Rt=1;var e=Ne(),t=ot();const n="<<",r={identify:e=>e===n||"symbol"==typeof e&&e.description===n,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new t.Scalar(Symbol(n)),{addToJSMap:s}),stringify:()=>n};function s(t,n,r){if(r=t&&e.isAlias(r)?r.resolve(t.doc):r,e.isSeq(r))for(const e of r.items)i(t,n,e);else if(Array.isArray(r))for(const e of r)i(t,n,e);else i(t,n,r)}function i(t,n,r){const s=t&&e.isAlias(r)?r.resolve(t.doc):r;if(!e.isMap(s))throw new Error("Merge sources must be maps or map aliases");const i=s.toJSON(null,t,Map);for(const[e,t]of i)n instanceof Map?n.has(e)||n.set(e,t):n instanceof Set?n.add(e):Object.prototype.hasOwnProperty.call(n,e)||Object.defineProperty(n,e,{value:t,writable:!0,enumerable:!0,configurable:!0});return n}return Nt.addMergeToJSMap=s,Nt.isMergeKey=(n,s)=>(r.identify(s)||e.isScalar(s)&&(!s.type||s.type===t.Scalar.PLAIN)&&r.identify(s.value))&&n?.doc.schema.tags.some(e=>e.tag===r.tag&&e.default),Nt.merge=r,Nt}function Lt(){if(Ct)return xt;Ct=1;var e=Ot(),t=Pt(),n=At(),r=Ne(),s=Qe();return xt.addPairToJSMap=function(i,o,{key:a,value:c}){if(r.isNode(a)&&a.addToJSMap)a.addToJSMap(i,o,c);else if(t.isMergeKey(i,a))t.addMergeToJSMap(i,o,c);else{const t=s.toJS(a,"",i);if(o instanceof Map)o.set(t,s.toJS(c,t,i));else if(o instanceof Set)o.add(t);else{const u=function(t,s,i){if(null===s)return"";if("object"!=typeof s)return String(s);if(r.isNode(t)&&i?.doc){const r=n.createStringifyContext(i.doc,{});r.anchors=new Set;for(const e of i.anchors.keys())r.anchors.add(e.anchor);r.inFlow=!0,r.inStringifyKey=!0;const s=t.toString(r);if(!i.mapKeyWarned){let t=JSON.stringify(s);t.length>40&&(t=t.substring(0,36)+'..."'),e.warn(i.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${t}. Set mapAsMap: true to use object keys.`),i.mapKeyWarned=!0}return s}return JSON.stringify(s)}(a,t,i),l=s.toJS(c,u,i);u in o?Object.defineProperty(o,u,{value:l,writable:!0,enumerable:!0,configurable:!0}):o[u]=l}}return o},xt}function It(){if(Tt)return lt;Tt=1;var e=at(),t=kt(),n=Lt(),r=Ne();let s=class e{constructor(e,t=null){Object.defineProperty(this,r.NODE_TYPE,{value:r.PAIR}),this.key=e,this.value=t}clone(t){let{key:n,value:s}=this;return r.isNode(n)&&(n=n.clone(t)),r.isNode(s)&&(s=s.clone(t)),new e(n,s)}toJSON(e,t){const r=t?.mapAsMap?new Map:{};return n.addPairToJSMap(t,r,this)}toString(e,n,r){return e?.doc?t.stringifyPair(this,e,n,r):JSON.stringify(this)}};return lt.Pair=s,lt.createPair=function(t,n,r){const i=e.createNode(t,void 0,r),o=e.createNode(n,void 0,r);return new s(i,o)},lt}var Mt,Dt,jt,Ft={},Ht={},Bt={},zt={};function Kt(){if(Mt)return zt;Mt=1;var e=Ne(),t=At(),n=dt();function r({comment:r,items:s},o,{blockItemPrefix:a,flowChars:c,itemIndent:u,onChompKeep:l,onComment:f}){const{indent:p,options:{commentString:h}}=o,d=Object.assign({},o,{indent:u,type:null});let m=!1;const g=[];for(let r=0;r<s.length;++r){const c=s[r];let l=null;if(e.isNode(c))!m&&c.spaceBefore&&g.push(""),i(o,g,c.commentBefore,m),c.comment&&(l=c.comment);else if(e.isPair(c)){const t=e.isNode(c.key)?c.key:null;t&&(!m&&t.spaceBefore&&g.push(""),i(o,g,t.commentBefore,m))}m=!1;let f=t.stringify(c,d,()=>l=null,()=>m=!0);l&&(f+=n.lineComment(f,u,h(l))),m&&l&&(m=!1),g.push(a+f)}let y;if(0===g.length)y=c.start+c.end;else{y=g[0];for(let e=1;e<g.length;++e){const t=g[e];y+=t?`\n${p}${t}`:"\n"}}return r?(y+="\n"+n.indentComment(h(r),p),f&&f()):m&&l&&l(),y}function s({items:r},s,{flowChars:o,itemIndent:a}){const{indent:c,indentStep:u,flowCollectionPadding:l,options:{commentString:f}}=s;a+=u;const p=Object.assign({},s,{indent:a,inFlow:!0,type:null});let h=!1,d=0;const m=[];for(let o=0;o<r.length;++o){const c=r[o];let u=null;if(e.isNode(c))c.spaceBefore&&m.push(""),i(s,m,c.commentBefore,!1),c.comment&&(u=c.comment);else if(e.isPair(c)){const t=e.isNode(c.key)?c.key:null;t&&(t.spaceBefore&&m.push(""),i(s,m,t.commentBefore,!1),t.comment&&(h=!0));const n=e.isNode(c.value)?c.value:null;n?(n.comment&&(u=n.comment),n.commentBefore&&(h=!0)):null==c.value&&t?.comment&&(u=t.comment)}u&&(h=!0);let l=t.stringify(c,p,()=>u=null);o<r.length-1&&(l+=","),u&&(l+=n.lineComment(l,a,f(u))),!h&&(m.length>d||l.includes("\n"))&&(h=!0),m.push(l),d=m.length}const{start:g,end:y}=o;if(0===m.length)return g+y;if(!h){const e=m.reduce((e,t)=>e+t.length+2,2);h=s.options.lineWidth>0&&e>s.options.lineWidth}if(h){let e=g;for(const t of m)e+=t?`\n${u}${c}${t}`:"\n";return`${e}\n${c}${y}`}return`${g}${l}${m.join(" ")}${l}${y}`}function i({indent:e,options:{commentString:t}},r,s,i){if(s&&i&&(s=s.replace(/^\n+/,"")),s){const i=n.indentComment(t(s),e);r.push(i.trimStart())}}return zt.stringifyCollection=function(e,t,n){return(t.inFlow??e.flow?s:r)(e,t,n)},zt}function Ut(){if(Dt)return Bt;Dt=1;var e=Kt(),t=Lt(),n=ct(),r=Ne(),s=It(),i=ot();function o(e,t){const n=r.isScalar(t)?t.value:t;for(const s of e)if(r.isPair(s)){if(s.key===t||s.key===n)return s;if(r.isScalar(s.key)&&s.key.value===n)return s}}let a=class extends n.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(r.MAP,e),this.items=[]}static from(e,t,n){const{keepUndefined:r,replacer:i}=n,o=new this(e),a=(e,a)=>{if("function"==typeof i)a=i.call(t,e,a);else if(Array.isArray(i)&&!i.includes(e))return;(void 0!==a||r)&&o.items.push(s.createPair(e,a,n))};if(t instanceof Map)for(const[e,n]of t)a(e,n);else if(t&&"object"==typeof t)for(const e of Object.keys(t))a(e,t[e]);return"function"==typeof e.sortMapEntries&&o.items.sort(e.sortMapEntries),o}add(e,t){let n;n=r.isPair(e)?e:e&&"object"==typeof e&&"key"in e?new s.Pair(e.key,e.value):new s.Pair(e,e?.value);const a=o(this.items,n.key),c=this.schema?.sortMapEntries;if(a){if(!t)throw new Error(`Key ${n.key} already set`);r.isScalar(a.value)&&i.isScalarValue(n.value)?a.value.value=n.value:a.value=n.value}else if(c){const e=this.items.findIndex(e=>c(n,e)<0);-1===e?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){const t=o(this.items,e);if(!t)return!1;return this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){const n=o(this.items,e),s=n?.value;return(!t&&r.isScalar(s)?s.value:s)??void 0}has(e){return!!o(this.items,e)}set(e,t){this.add(new s.Pair(e,t),!0)}toJSON(e,n,r){const s=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(s);for(const e of this.items)t.addPairToJSMap(n,s,e);return s}toString(t,n,s){if(!t)return JSON.stringify(this);for(const e of this.items)if(!r.isPair(e))throw new Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),e.stringifyCollection(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:s,onComment:n})}};return Bt.YAMLMap=a,Bt.findPair=o,Bt}function qt(){if(jt)return Ht;jt=1;var e=Ne(),t=Ut();const n={collection:"map",default:!0,nodeClass:t.YAMLMap,tag:"tag:yaml.org,2002:map",resolve:(t,n)=>(e.isMap(t)||n("Expected a mapping for this tag"),t),createNode:(e,n,r)=>t.YAMLMap.from(e,n,r)};return Ht.map=n,Ht}var Zt,Gt,Wt={},Vt={};function Yt(){if(Zt)return Vt;Zt=1;var e=at(),t=Kt(),n=ct(),r=Ne(),s=ot(),i=Qe();let o=class extends n.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(r.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){const t=a(e);if("number"!=typeof t)return!1;return this.items.splice(t,1).length>0}get(e,t){const n=a(e);if("number"!=typeof n)return;const s=this.items[n];return!t&&r.isScalar(s)?s.value:s}has(e){const t=a(e);return"number"==typeof t&&t<this.items.length}set(e,t){const n=a(e);if("number"!=typeof n)throw new Error(`Expected a valid index, not ${e}.`);const i=this.items[n];r.isScalar(i)&&s.isScalarValue(t)?i.value=t:this.items[n]=t}toJSON(e,t){const n=[];t?.onCreate&&t.onCreate(n);let r=0;for(const e of this.items)n.push(i.toJS(e,String(r++),t));return n}toString(e,n,r){return e?t.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(t,n,r){const{replacer:s}=r,i=new this(t);if(n&&Symbol.iterator in Object(n)){let t=0;for(let o of n){if("function"==typeof s){const e=n instanceof Set?o:String(t++);o=s.call(n,e,o)}i.items.push(e.createNode(o,void 0,r))}}return i}};function a(e){let t=r.isScalar(e)?e.value:e;return t&&"string"==typeof t&&(t=Number(t)),"number"==typeof t&&Number.isInteger(t)&&t>=0?t:null}return Vt.YAMLSeq=o,Vt}function Qt(){if(Gt)return Wt;Gt=1;var e=Ne(),t=Yt();const n={collection:"seq",default:!0,nodeClass:t.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve:(t,n)=>(e.isSeq(t)||n("Expected a sequence for this tag"),t),createNode:(e,n,r)=>t.YAMLSeq.from(e,n,r)};return Wt.seq=n,Wt}var Jt,Xt={};function en(){if(Jt)return Xt;Jt=1;var e=St();const t={identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:(t,n,r,s)=>(n=Object.assign({actualString:!0},n),e.stringifyString(t,n,r,s))};return Xt.string=t,Xt}var tn,nn={},rn={};function sn(){if(tn)return rn;tn=1;var e=ot();const t={identify:e=>null==e,createNode:()=>new e.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new e.Scalar(null),stringify:({source:e},n)=>"string"==typeof e&&t.test.test(e)?e:n.options.nullStr};return rn.nullTag=t,rn}var on,an={};function cn(){if(on)return an;on=1;var e=ot();const t={identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new e.Scalar("t"===t[0]||"T"===t[0]),stringify({source:e,value:n},r){if(e&&t.test.test(e)){if(n===("t"===e[0]||"T"===e[0]))return e}return n?r.options.trueStr:r.options.falseStr}};return an.boolTag=t,an}var un,ln,fn={},pn={};function hn(){if(un)return pn;return un=1,pn.stringifyNumber=function({format:e,minFractionDigits:t,tag:n,value:r}){if("bigint"==typeof r)return String(r);const s="number"==typeof r?r:Number(r);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let i=JSON.stringify(r);if(!e&&t&&(!n||"tag:yaml.org,2002:float"===n)&&/^\d/.test(i)){let e=i.indexOf(".");e<0&&(e=i.length,i+=".");let n=t-(i.length-e-1);for(;n-- >0;)i+="0"}return i},pn}function dn(){if(ln)return fn;ln=1;var e=ot(),t=hn();const n={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?NaN:"-"===e[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:t.stringifyNumber},r={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const n=Number(e.value);return isFinite(n)?n.toExponential():t.stringifyNumber(e)}},s={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){const n=new e.Scalar(parseFloat(t)),r=t.indexOf(".");return-1!==r&&"0"===t[t.length-1]&&(n.minFractionDigits=t.length-r-1),n},stringify:t.stringifyNumber};return fn.float=s,fn.floatExp=r,fn.floatNaN=n,fn}var mn,gn={};function yn(){if(mn)return gn;mn=1;var e=hn();const t=e=>"bigint"==typeof e||Number.isInteger(e),n=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function r(n,r,s){const{value:i}=n;return t(i)&&i>=0?s+i.toString(r):e.stringifyNumber(n)}const s={identify:e=>t(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,r)=>n(e,2,8,r),stringify:e=>r(e,8,"0o")},i={identify:t,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,r)=>n(e,0,10,r),stringify:e.stringifyNumber},o={identify:e=>t(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,r)=>n(e,2,16,r),stringify:e=>r(e,16,"0x")};return gn.int=i,gn.intHex=o,gn.intOct=s,gn}var vn,bn={};function _n(){if(vn)return bn;vn=1;var e=qt(),t=sn(),n=Qt(),r=en(),s=cn(),i=dn(),o=yn();const a=[e.map,n.seq,r.string,t.nullTag,s.boolTag,o.intOct,o.int,o.intHex,i.floatNaN,i.floatExp,i.float];return bn.schema=a,bn}var wn,Sn={};function An(){if(wn)return Sn;wn=1;var e=ot(),t=qt(),n=Qt();function r(e){return"bigint"==typeof e||Number.isInteger(e)}const s=({value:e})=>JSON.stringify(e),i=[{identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:s},{identify:e=>null==e,createNode:()=>new e.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:s},{identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>"true"===e,stringify:s},{identify:r,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>r(e)?e.toString():JSON.stringify(e)},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:s}],o={default:!0,tag:"",test:/^/,resolve:(e,t)=>(t(`Unresolved plain scalar ${JSON.stringify(e)}`),e)},a=[t.map,n.seq].concat(i,o);return Sn.schema=a,Sn}var kn,En={};function xn(){if(kn)return En;kn=1;var e=A,t=ot(),n=St();const r={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,n){if("function"==typeof e.Buffer)return e.Buffer.from(t,"base64");if("function"==typeof atob){const e=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(e.length);for(let t=0;t<e.length;++t)n[t]=e.charCodeAt(t);return n}return n("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:r,type:s,value:i},o,a,c){if(!i)return"";const u=i;let l;if("function"==typeof e.Buffer)l=u instanceof e.Buffer?u.toString("base64"):e.Buffer.from(u.buffer).toString("base64");else{if("function"!=typeof btoa)throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");{let e="";for(let t=0;t<u.length;++t)e+=String.fromCharCode(u[t]);l=btoa(e)}}if(s??(s=t.Scalar.BLOCK_LITERAL),s!==t.Scalar.QUOTE_DOUBLE){const e=Math.max(o.options.lineWidth-o.indent.length,o.options.minContentWidth),n=Math.ceil(l.length/e),r=new Array(n);for(let t=0,s=0;t<n;++t,s+=e)r[t]=l.substr(s,e);l=r.join(s===t.Scalar.BLOCK_LITERAL?"\n":" ")}return n.stringifyString({comment:r,type:s,value:l},o,a,c)}};return En.binary=r,En}var $n,On,Rn={},Cn={};function Tn(){if($n)return Cn;$n=1;var e=Ne(),t=It(),n=ot(),r=Yt();function s(r,s){if(e.isSeq(r))for(let i=0;i<r.items.length;++i){let o=r.items[i];if(!e.isPair(o)){if(e.isMap(o)){o.items.length>1&&s("Each pair must have its own sequence indicator");const e=o.items[0]||new t.Pair(new n.Scalar(null));if(o.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${o.commentBefore}\n${e.key.commentBefore}`:o.commentBefore),o.comment){const t=e.value??e.key;t.comment=t.comment?`${o.comment}\n${t.comment}`:o.comment}o=e}r.items[i]=e.isPair(o)?o:new t.Pair(o)}}else s("Expected a sequence for this tag");return r}function i(e,n,s){const{replacer:i}=s,o=new r.YAMLSeq(e);o.tag="tag:yaml.org,2002:pairs";let a=0;if(n&&Symbol.iterator in Object(n))for(let e of n){let r,c;if("function"==typeof i&&(e=i.call(n,String(a++),e)),Array.isArray(e)){if(2!==e.length)throw new TypeError(`Expected [key, value] tuple: ${e}`);r=e[0],c=e[1]}else if(e&&e instanceof Object){const t=Object.keys(e);if(1!==t.length)throw new TypeError(`Expected tuple with one key, not ${t.length} keys`);r=t[0],c=e[r]}else r=e;o.items.push(t.createPair(r,c,s))}return o}const o={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:s,createNode:i};return Cn.createPairs=i,Cn.pairs=o,Cn.resolvePairs=s,Cn}function Nn(){if(On)return Rn;On=1;var e=Ne(),t=Qe(),n=Ut(),r=Yt(),s=Tn();class i extends r.YAMLSeq{constructor(){super(),this.add=n.YAMLMap.prototype.add.bind(this),this.delete=n.YAMLMap.prototype.delete.bind(this),this.get=n.YAMLMap.prototype.get.bind(this),this.has=n.YAMLMap.prototype.has.bind(this),this.set=n.YAMLMap.prototype.set.bind(this),this.tag=i.tag}toJSON(n,r){if(!r)return super.toJSON(n);const s=new Map;r?.onCreate&&r.onCreate(s);for(const n of this.items){let i,o;if(e.isPair(n)?(i=t.toJS(n.key,"",r),o=t.toJS(n.value,i,r)):i=t.toJS(n,"",r),s.has(i))throw new Error("Ordered maps must not include duplicate keys");s.set(i,o)}return s}static from(e,t,n){const r=s.createPairs(e,t,n),i=new this;return i.items=r.items,i}}i.tag="tag:yaml.org,2002:omap";const o={collection:"seq",identify:e=>e instanceof Map,nodeClass:i,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,n){const r=s.resolvePairs(t,n),o=[];for(const{key:t}of r.items)e.isScalar(t)&&(o.includes(t.value)?n(`Ordered maps must not include duplicate keys: ${t.value}`):o.push(t.value));return Object.assign(new i,r)},createNode:(e,t,n)=>i.from(e,t,n)};return Rn.YAMLOMap=i,Rn.omap=o,Rn}var Pn,Ln={},In={};function Mn(){if(Pn)return In;Pn=1;var e=ot();function t({value:e,source:t},s){return t&&(e?n:r).test.test(t)?t:e?s.options.trueStr:s.options.falseStr}const n={identify:e=>!0===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new e.Scalar(!0),stringify:t},r={identify:e=>!1===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new e.Scalar(!1),stringify:t};return In.falseTag=r,In.trueTag=n,In}var Dn,jn={};function Fn(){if(Dn)return jn;Dn=1;var e=ot(),t=hn();const n={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?NaN:"-"===e[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:t.stringifyNumber},r={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const n=Number(e.value);return isFinite(n)?n.toExponential():t.stringifyNumber(e)}},s={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){const n=new e.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(-1!==r){const e=t.substring(r+1).replace(/_/g,"");"0"===e[e.length-1]&&(n.minFractionDigits=e.length)}return n},stringify:t.stringifyNumber};return jn.float=s,jn.floatExp=r,jn.floatNaN=n,jn}var Hn,Bn={};var zn,Kn={};function Un(){if(zn)return Kn;zn=1;var e=Ne(),t=It(),n=Ut();class r extends n.YAMLMap{constructor(e){super(e),this.tag=r.tag}add(r){let s;s=e.isPair(r)?r:r&&"object"==typeof r&&"key"in r&&"value"in r&&null===r.value?new t.Pair(r.key,null):new t.Pair(r,null);n.findPair(this.items,s.key)||this.items.push(s)}get(t,r){const s=n.findPair(this.items,t);return!r&&e.isPair(s)?e.isScalar(s.key)?s.key.value:s.key:s}set(e,r){if("boolean"!=typeof r)throw new Error("Expected boolean value for set(key, value) in a YAML set, not "+typeof r);const s=n.findPair(this.items,e);s&&!r?this.items.splice(this.items.indexOf(s),1):!s&&r&&this.items.push(new t.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,n,r){const{replacer:s}=r,i=new this(e);if(n&&Symbol.iterator in Object(n))for(let e of n)"function"==typeof s&&(e=s.call(n,e,e)),i.items.push(t.createPair(e,null,r));return i}}r.tag="tag:yaml.org,2002:set";const s={collection:"map",identify:e=>e instanceof Set,nodeClass:r,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>r.from(e,t,n),resolve(t,n){if(e.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new r,t);n("Set items must all have null values")}else n("Expected a mapping for this tag");return t}};return Kn.YAMLSet=r,Kn.set=s,Kn}var qn,Zn,Gn,Wn,Vn={};function Yn(){if(qn)return Vn;qn=1;var e=hn();function t(e,t){const n=e[0],r="-"===n||"+"===n?e.substring(1):e,s=e=>t?BigInt(e):Number(e),i=r.replace(/_/g,"").split(":").reduce((e,t)=>e*s(60)+s(t),s(0));return"-"===n?s(-1)*i:i}function n(t){let{value:n}=t,r=e=>e;if("bigint"==typeof n)r=e=>BigInt(e);else if(isNaN(n)||!isFinite(n))return e.stringifyNumber(t);let s="";n<0&&(s="-",n*=r(-1));const i=r(60),o=[n%i];return n<60?o.unshift(0):(n=(n-o[0])/i,o.unshift(n%i),n>=60&&(n=(n-o[0])/i,o.unshift(n))),s+o.map(e=>String(e).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const r={identify:e=>"bigint"==typeof e||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,n,{intAsBigInt:r})=>t(e,r),stringify:n},s={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>t(e,!1),stringify:n},i={identify:e=>e 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(e){const n=e.match(i.test);if(!n)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,r,s,o,a,c,u]=n.map(Number),l=n[7]?Number((n[7]+"00").substr(1,3)):0;let f=Date.UTC(r,s-1,o,a||0,c||0,u||0,l);const p=n[8];if(p&&"Z"!==p){let e=t(p,!1);Math.abs(e)<30&&(e*=60),f-=6e4*e}return new Date(f)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};return Vn.floatTime=s,Vn.intTime=r,Vn.timestamp=i,Vn}function Qn(){if(Zn)return Ln;Zn=1;var e=qt(),t=sn(),n=Qt(),r=en(),s=xn(),i=Mn(),o=Fn(),a=function(){if(Hn)return Bn;Hn=1;var e=hn();const t=e=>"bigint"==typeof e||Number.isInteger(e);function n(e,t,n,{intAsBigInt:r}){const s=e[0];if("-"!==s&&"+"!==s||(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}const t=BigInt(e);return"-"===s?BigInt(-1)*t:t}const i=parseInt(e,n);return"-"===s?-1*i:i}function r(n,r,s){const{value:i}=n;if(t(i)){const e=i.toString(r);return i<0?"-"+s+e.substr(1):s+e}return e.stringifyNumber(n)}const s={identify:t,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,r)=>n(e,2,2,r),stringify:e=>r(e,2,"0b")},i={identify:t,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,r)=>n(e,1,8,r),stringify:e=>r(e,8,"0")},o={identify:t,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,r)=>n(e,0,10,r),stringify:e.stringifyNumber},a={identify:t,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,r)=>n(e,2,16,r),stringify:e=>r(e,16,"0x")};return Bn.int=o,Bn.intBin=s,Bn.intHex=a,Bn.intOct=i,Bn}(),c=Pt(),u=Nn(),l=Tn(),f=Un(),p=Yn();const h=[e.map,n.seq,r.string,t.nullTag,i.trueTag,i.falseTag,a.intBin,a.intOct,a.int,a.intHex,o.floatNaN,o.floatExp,o.float,s.binary,c.merge,u.omap,l.pairs,f.set,p.intTime,p.floatTime,p.timestamp];return Ln.schema=h,Ln}function Jn(){if(Gn)return nn;Gn=1;var e=qt(),t=sn(),n=Qt(),r=en(),s=cn(),i=dn(),o=yn(),a=_n(),c=An(),u=xn(),l=Pt(),f=Nn(),p=Tn(),h=Qn(),d=Un(),m=Yn();const g=new Map([["core",a.schema],["failsafe",[e.map,n.seq,r.string]],["json",c.schema],["yaml11",h.schema],["yaml-1.1",h.schema]]),y={binary:u.binary,bool:s.boolTag,float:i.float,floatExp:i.floatExp,floatNaN:i.floatNaN,floatTime:m.floatTime,int:o.int,intHex:o.intHex,intOct:o.intOct,intTime:m.intTime,map:e.map,merge:l.merge,null:t.nullTag,omap:f.omap,pairs:p.pairs,seq:n.seq,set:d.set,timestamp:m.timestamp},v={"tag:yaml.org,2002:binary":u.binary,"tag:yaml.org,2002:merge":l.merge,"tag:yaml.org,2002:omap":f.omap,"tag:yaml.org,2002:pairs":p.pairs,"tag:yaml.org,2002:set":d.set,"tag:yaml.org,2002:timestamp":m.timestamp};return nn.coreKnownTags=v,nn.getTags=function(e,t,n){const r=g.get(t);if(r&&!e)return n&&!r.includes(l.merge)?r.concat(l.merge):r.slice();let s=r;if(!s){if(!Array.isArray(e)){const e=Array.from(g.keys()).filter(e=>"yaml11"!==e).map(e=>JSON.stringify(e)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}s=[]}if(Array.isArray(e))for(const t of e)s=s.concat(t);else"function"==typeof e&&(s=e(s.slice()));return n&&(s=s.concat(l.merge)),s.reduce((e,t)=>{const n="string"==typeof t?y[t]:t;if(!n){const e=JSON.stringify(t),n=Object.keys(y).map(e=>JSON.stringify(e)).join(", ");throw new Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])},nn}function Xn(){if(Wn)return Ft;Wn=1;var e=Ne(),t=qt(),n=Qt(),r=en(),s=Jn();const i=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;return Ft.Schema=class o{constructor({compat:o,customTags:a,merge:c,resolveKnownTags:u,schema:l,sortMapEntries:f,toStringDefaults:p}){this.compat=Array.isArray(o)?s.getTags(o,"compat"):o?s.getTags(null,o):null,this.name="string"==typeof l&&l||"core",this.knownTags=u?s.coreKnownTags:{},this.tags=s.getTags(a,this.name,c),this.toStringOptions=p??null,Object.defineProperty(this,e.MAP,{value:t.map}),Object.defineProperty(this,e.SCALAR,{value:r.string}),Object.defineProperty(this,e.SEQ,{value:n.seq}),this.sortMapEntries="function"==typeof f?f:!0===f?i:null}clone(){const e=Object.create(o.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}},Ft}var er,tr,nr={};function rr(){if(er)return nr;er=1;var e=Ne(),t=At(),n=dt();return nr.stringifyDocument=function(r,s){const i=[];let o=!0===s.directives;if(!1!==s.directives&&r.directives){const e=r.directives.toString(r);e?(i.push(e),o=!0):r.directives.docStart&&(o=!0)}o&&i.push("---");const a=t.createStringifyContext(r,s),{commentString:c}=a.options;if(r.commentBefore){1!==i.length&&i.unshift("");const e=c(r.commentBefore);i.unshift(n.indentComment(e,""))}let u=!1,l=null;if(r.contents){if(e.isNode(r.contents)){if(r.contents.spaceBefore&&o&&i.push(""),r.contents.commentBefore){const e=c(r.contents.commentBefore);i.push(n.indentComment(e,""))}a.forceBlockIndent=!!r.comment,l=r.contents.comment}const s=l?void 0:()=>u=!0;let f=t.stringify(r.contents,a,()=>l=null,s);l&&(f+=n.lineComment(f,"",c(l))),"|"!==f[0]&&">"!==f[0]||"---"!==i[i.length-1]?i.push(f):i[i.length-1]=`--- ${f}`}else i.push(t.stringify(r.contents,a));if(r.directives?.docEnd)if(r.comment){const e=c(r.comment);e.includes("\n")?(i.push("..."),i.push(n.indentComment(e,""))):i.push(`... ${e}`)}else i.push("...");else{let e=r.comment;e&&u&&(e=e.replace(/^\n+/,"")),e&&(u&&!l||""===i[i.length-1]||i.push(""),i.push(n.indentComment(c(e),"")))}return i.join("\n")+"\n"},nr}function sr(){if(tr)return Fe;tr=1;var e=Xe(),t=ct(),n=Ne(),r=It(),s=Qe(),i=Xn(),o=rr(),a=ze(),c=Ze(),u=at(),l=De();function f(e){if(n.isCollection(e))return!0;throw new Error("Expected a YAML collection as document contents")}return Fe.Document=class p{constructor(e,t,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,n.NODE_TYPE,{value:n.DOC});let s=null;"function"==typeof t||Array.isArray(t)?s=t:void 0===r&&t&&(r=t,t=void 0);const i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=i;let{version:o}=i;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new l.Directives({version:o}),this.setSchema(o,r),this.contents=void 0===e?null:this.createNode(e,s,r)}clone(){const e=Object.create(p.prototype,{[n.NODE_TYPE]:{value:n.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=n.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){f(this.contents)&&this.contents.add(e)}addIn(e,t){f(this.contents)&&this.contents.addIn(e,t)}createAlias(t,n){if(!t.anchor){const e=a.anchorNames(this);t.anchor=!n||e.has(n)?a.findNewAnchor(n||"a",e):n}return new e.Alias(t.anchor)}createNode(e,t,r){let s;if("function"==typeof t)e=t.call({"":e},"",e),s=t;else if(Array.isArray(t)){const e=e=>"number"==typeof e||e instanceof String||e instanceof Number,n=t.filter(e).map(String);n.length>0&&(t=t.concat(n)),s=t}else void 0===r&&t&&(r=t,t=void 0);const{aliasDuplicateObjects:i,anchorPrefix:o,flow:c,keepUndefined:l,onTagObj:f,tag:p}=r??{},{onAnchor:h,setAnchors:d,sourceObjects:m}=a.createNodeAnchors(this,o||"a"),g={aliasDuplicateObjects:i??!0,keepUndefined:l??!1,onAnchor:h,onTagObj:f,replacer:s,schema:this.schema,sourceObjects:m},y=u.createNode(e,p,g);return c&&n.isCollection(y)&&(y.flow=!0),d(),y}createPair(e,t,n={}){const s=this.createNode(e,null,n),i=this.createNode(t,null,n);return new r.Pair(s,i)}delete(e){return!!f(this.contents)&&this.contents.delete(e)}deleteIn(e){return t.isEmptyPath(e)?null!=this.contents&&(this.contents=null,!0):!!f(this.contents)&&this.contents.deleteIn(e)}get(e,t){return n.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,r){return t.isEmptyPath(e)?!r&&n.isScalar(this.contents)?this.contents.value:this.contents:n.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return!!n.isCollection(this.contents)&&this.contents.has(e)}hasIn(e){return t.isEmptyPath(e)?void 0!==this.contents:!!n.isCollection(this.contents)&&this.contents.hasIn(e)}set(e,n){null==this.contents?this.contents=t.collectionFromPath(this.schema,[e],n):f(this.contents)&&this.contents.set(e,n)}setIn(e,n){t.isEmptyPath(e)?this.contents=n:null==this.contents?this.contents=t.collectionFromPath(this.schema,Array.from(e),n):f(this.contents)&&this.contents.setIn(e,n)}setSchema(e,t={}){let n;switch("number"==typeof e&&(e=String(e)),e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new l.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new l.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{const t=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else{if(!n)throw new Error("With a null YAML version, the { schema: Schema } option is required");this.schema=new i.Schema(Object.assign(n,t))}}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:o}={}){const a={anchors:new Map,doc:this,keep:!e,mapAsMap:!0===n,mapKeyWarned:!1,maxAliasCount:"number"==typeof r?r:100},u=s.toJS(this.contents,t??"",a);if("function"==typeof i)for(const{count:e,res:t}of a.anchors.values())i(t,e);return"function"==typeof o?c.applyReviver(o,{"":u},"",u):u}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return o.stringifyDocument(this,e)}},Fe}var ir,or={};function ar(){if(ir)return or;ir=1;class e extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}}return or.YAMLError=e,or.YAMLParseError=class extends e{constructor(e,t,n){super("YAMLParseError",e,t,n)}},or.YAMLWarning=class extends e{constructor(e,t,n){super("YAMLWarning",e,t,n)}},or.prettifyError=(e,t)=>n=>{if(-1===n.pos[0])return;n.linePos=n.pos.map(e=>t.linePos(e));const{line:r,col:s}=n.linePos[0];n.message+=` at line ${r}, column ${s}`;let i=s-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(i>=60&&o.length>80){const e=Math.min(i-39,o.length-79);o="…"+o.substring(e),i-=e-1}if(o.length>80&&(o=o.substring(0,79)+"…"),r>1&&/^ *$/.test(o.substring(0,i))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+"…\n"),o=n+o}if(/[^ ]/.test(o)){let e=1;const t=n.linePos[1];t&&t.line===r&&t.col>s&&(e=Math.max(1,Math.min(t.col-s,80-i)));const a=" ".repeat(i)+"^".repeat(e);n.message+=`:\n\n${o}\n${a}\n`}},or}var cr,ur={},lr={},fr={},pr={},hr={};function dr(){if(cr)return hr;return cr=1,hr.resolveProps=function(e,{flow:t,indicator:n,next:r,offset:s,onError:i,parentIndent:o,startOnNewline:a}){let c=!1,u=a,l=a,f="",p="",h=!1,d=!1,m=null,g=null,y=null,v=null,b=null,_=null,w=null;for(const s of e)switch(d&&("space"!==s.type&&"newline"!==s.type&&"comma"!==s.type&&i(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),d=!1),m&&(u&&"comment"!==s.type&&"newline"!==s.type&&i(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),m=null),s.type){case"space":t||"doc-start"===n&&"flow-collection"===r?.type||!s.source.includes("\t")||(m=s),l=!0;break;case"comment":{l||i(s,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const e=s.source.substring(1)||" ";f?f+=p+e:f=e,p="",u=!1;break}case"newline":u?f?f+=s.source:_&&"seq-item-ind"===n||(c=!0):p+=s.source,u=!0,h=!0,(g||y)&&(v=s),l=!0;break;case"anchor":g&&i(s,"MULTIPLE_ANCHORS","A node can have at most one anchor"),s.source.endsWith(":")&&i(s.offset+s.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=s,w??(w=s.offset),u=!1,l=!1,d=!0;break;case"tag":y&&i(s,"MULTIPLE_TAGS","A node can have at most one tag"),y=s,w??(w=s.offset),u=!1,l=!1,d=!0;break;case n:(g||y)&&i(s,"BAD_PROP_ORDER",`Anchors and tags must be after the ${s.source} indicator`),_&&i(s,"UNEXPECTED_TOKEN",`Unexpected ${s.source} in ${t??"collection"}`),_=s,u="seq-item-ind"===n||"explicit-key-ind"===n,l=!1;break;case"comma":if(t){b&&i(s,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),b=s,u=!1,l=!1;break}default:i(s,"UNEXPECTED_TOKEN",`Unexpected ${s.type} token`),u=!1,l=!1}const S=e[e.length-1],A=S?S.offset+S.source.length:s;return d&&r&&"space"!==r.type&&"newline"!==r.type&&"comma"!==r.type&&("scalar"!==r.type||""!==r.source)&&i(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m&&(u&&m.indent<=o||"block-map"===r?.type||"block-seq"===r?.type)&&i(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:_,spaceBefore:c,comment:f,hasNewline:h,anchor:g,tag:y,newlineAfterProp:v,end:A,start:w??A}},hr}var mr,gr={};function yr(){if(mr)return gr;return mr=1,gr.containsNewline=function e(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes("\n"))return!0;if(t.end)for(const e of t.end)if("newline"===e.type)return!0;return!1;case"flow-collection":for(const n of t.items){for(const e of n.start)if("newline"===e.type)return!0;if(n.sep)for(const e of n.sep)if("newline"===e.type)return!0;if(e(n.key)||e(n.value))return!0}return!1;default:return!0}},gr}var vr,br={};function _r(){if(vr)return br;vr=1;var e=yr();return br.flowIndentCheck=function(t,n,r){if("flow-collection"===n?.type){const s=n.end[0];if(s.indent===t&&("]"===s.source||"}"===s.source)&&e.containsNewline(n)){r(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}},br}var wr,Sr,Ar={};function kr(){if(wr)return Ar;wr=1;var e=Ne();return Ar.mapIncludes=function(t,n,r){const{uniqueKeys:s}=t.options;if(!1===s)return!1;const i="function"==typeof s?s:(t,n)=>t===n||e.isScalar(t)&&e.isScalar(n)&&t.value===n.value;return n.some(e=>i(e.key,r))},Ar}function Er(){if(Sr)return pr;Sr=1;var e=It(),t=Ut(),n=dr(),r=yr(),s=_r(),i=kr();const o="All mapping items must start at the same column";return pr.resolveBlockMap=function({composeNode:a,composeEmptyNode:c},u,l,f,p){const h=new(p?.nodeClass??t.YAMLMap)(u.schema);u.atRoot&&(u.atRoot=!1);let d=l.offset,m=null;for(const t of l.items){const{start:p,key:g,sep:y,value:v}=t,b=n.resolveProps(p,{indicator:"explicit-key-ind",next:g??y?.[0],offset:d,onError:f,parentIndent:l.indent,startOnNewline:!0}),_=!b.found;if(_){if(g&&("block-seq"===g.type?f(d,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in g&&g.indent!==l.indent&&f(d,"BAD_INDENT",o)),!b.anchor&&!b.tag&&!y){m=b.end,b.comment&&(h.comment?h.comment+="\n"+b.comment:h.comment=b.comment);continue}(b.newlineAfterProp||r.containsNewline(g))&&f(g??p[p.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else b.found?.indent!==l.indent&&f(d,"BAD_INDENT",o);u.atKey=!0;const w=b.end,S=g?a(u,g,b,f):c(u,w,p,null,b,f);u.schema.compat&&s.flowIndentCheck(l.indent,g,f),u.atKey=!1,i.mapIncludes(u,h.items,S)&&f(w,"DUPLICATE_KEY","Map keys must be unique");const A=n.resolveProps(y??[],{indicator:"map-value-ind",next:v,offset:S.range[2],onError:f,parentIndent:l.indent,startOnNewline:!g||"block-scalar"===g.type});if(d=A.end,A.found){_&&("block-map"!==v?.type||A.hasNewline||f(d,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),u.options.strict&&b.start<A.found.offset-1024&&f(S.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const n=v?a(u,v,A,f):c(u,d,y,null,A,f);u.schema.compat&&s.flowIndentCheck(l.indent,v,f),d=n.range[2];const r=new e.Pair(S,n);u.options.keepSourceTokens&&(r.srcToken=t),h.items.push(r)}else{_&&f(S.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),A.comment&&(S.comment?S.comment+="\n"+A.comment:S.comment=A.comment);const n=new e.Pair(S);u.options.keepSourceTokens&&(n.srcToken=t),h.items.push(n)}}return m&&m<d&&f(m,"IMPOSSIBLE","Map comment with trailing content"),h.range=[l.offset,d,m??d],h},pr}var xr,$r={};function Or(){if(xr)return $r;xr=1;var e=Yt(),t=dr(),n=_r();return $r.resolveBlockSeq=function({composeNode:r,composeEmptyNode:s},i,o,a,c){const u=new(c?.nodeClass??e.YAMLSeq)(i.schema);i.atRoot&&(i.atRoot=!1),i.atKey&&(i.atKey=!1);let l=o.offset,f=null;for(const{start:e,value:c}of o.items){const p=t.resolveProps(e,{indicator:"seq-item-ind",next:c,offset:l,onError:a,parentIndent:o.indent,startOnNewline:!0});if(!p.found){if(!(p.anchor||p.tag||c)){f=p.end,p.comment&&(u.comment=p.comment);continue}c&&"block-seq"===c.type?a(p.end,"BAD_INDENT","All sequence items must start at the same column"):a(l,"MISSING_CHAR","Sequence item without - indicator")}const h=c?r(i,c,p,a):s(i,p.end,e,null,p,a);i.schema.compat&&n.flowIndentCheck(o.indent,c,a),l=h.range[2],u.items.push(h)}return u.range=[o.offset,l,f??l],u},$r}var Rr,Cr,Tr,Nr={},Pr={};function Lr(){if(Rr)return Pr;return Rr=1,Pr.resolveEnd=function(e,t,n,r){let s="";if(e){let i=!1,o="";for(const a of e){const{source:e,type:c}=a;switch(c){case"space":i=!0;break;case"comment":{n&&!i&&r(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const t=e.substring(1)||" ";s?s+=o+t:s=t,o="";break}case"newline":s&&(o+=e),i=!0;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}t+=e.length}}return{comment:s,offset:t}},Pr}function Ir(){if(Cr)return Nr;Cr=1;var e=Ne(),t=It(),n=Ut(),r=Yt(),s=Lr(),i=dr(),o=yr(),a=kr();const c="Block collections are not allowed within flow collections",u=e=>e&&("block-map"===e.type||"block-seq"===e.type);return Nr.resolveFlowCollection=function({composeNode:l,composeEmptyNode:f},p,h,d,m){const g="{"===h.start.source,y=g?"flow map":"flow sequence",v=new(m?.nodeClass??(g?n.YAMLMap:r.YAMLSeq))(p.schema);v.flow=!0;const b=p.atRoot;b&&(p.atRoot=!1),p.atKey&&(p.atKey=!1);let _=h.offset+h.start.source.length;for(let r=0;r<h.items.length;++r){const s=h.items[r],{start:m,key:b,sep:w,value:S}=s,A=i.resolveProps(m,{flow:y,indicator:"explicit-key-ind",next:b??w?.[0],offset:_,onError:d,parentIndent:h.indent,startOnNewline:!1});if(!A.found){if(!(A.anchor||A.tag||w||S)){0===r&&A.comma?d(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${y}`):r<h.items.length-1&&d(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${y}`),A.comment&&(v.comment?v.comment+="\n"+A.comment:v.comment=A.comment),_=A.end;continue}!g&&p.options.strict&&o.containsNewline(b)&&d(b,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(0===r)A.comma&&d(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${y}`);else if(A.comma||d(A.start,"MISSING_CHAR",`Missing , between ${y} items`),A.comment){let t="";e:for(const e of m)switch(e.type){case"comma":case"space":break;case"comment":t=e.source.substring(1);break e;default:break e}if(t){let n=v.items[v.items.length-1];e.isPair(n)&&(n=n.value??n.key),n.comment?n.comment+="\n"+t:n.comment=t,A.comment=A.comment.substring(t.length+1)}}if(g||w||A.found){p.atKey=!0;const e=A.end,r=b?l(p,b,A,d):f(p,e,m,null,A,d);u(b)&&d(r.range,"BLOCK_IN_FLOW",c),p.atKey=!1;const o=i.resolveProps(w??[],{flow:y,indicator:"map-value-ind",next:S,offset:r.range[2],onError:d,parentIndent:h.indent,startOnNewline:!1});if(o.found){if(!g&&!A.found&&p.options.strict){if(w)for(const e of w){if(e===o.found)break;if("newline"===e.type){d(e,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}A.start<o.found.offset-1024&&d(o.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else S&&("source"in S&&S.source&&":"===S.source[0]?d(S,"MISSING_CHAR",`Missing space after : in ${y}`):d(o.start,"MISSING_CHAR",`Missing , or : between ${y} items`));const k=S?l(p,S,o,d):o.found?f(p,o.end,w,null,o,d):null;k?u(S)&&d(k.range,"BLOCK_IN_FLOW",c):o.comment&&(r.comment?r.comment+="\n"+o.comment:r.comment=o.comment);const E=new t.Pair(r,k);if(p.options.keepSourceTokens&&(E.srcToken=s),g){const t=v;a.mapIncludes(p,t.items,r)&&d(e,"DUPLICATE_KEY","Map keys must be unique"),t.items.push(E)}else{const e=new n.YAMLMap(p.schema);e.flow=!0,e.items.push(E);const t=(k??r).range;e.range=[r.range[0],t[1],t[2]],v.items.push(e)}_=k?k.range[2]:o.end}else{const e=S?l(p,S,A,d):f(p,A.end,w,null,A,d);v.items.push(e),_=e.range[2],u(S)&&d(e.range,"BLOCK_IN_FLOW",c)}}const w=g?"}":"]",[S,...A]=h.end;let k=_;if(S&&S.source===w)k=S.offset+S.source.length;else{const e=y[0].toUpperCase()+y.substring(1);d(_,b?"MISSING_CHAR":"BAD_INDENT",b?`${e} must end with a ${w}`:`${e} in block collection must be sufficiently indented and end with a ${w}`),S&&1!==S.source.length&&A.unshift(S)}if(A.length>0){const e=s.resolveEnd(A,k,p.options.strict,d);e.comment&&(v.comment?v.comment+="\n"+e.comment:v.comment=e.comment),v.range=[h.offset,k,e.offset]}else v.range=[h.offset,k,k];return v},Nr}function Mr(){if(Tr)return fr;Tr=1;var e=Ne(),t=ot(),n=Ut(),r=Yt(),s=Er(),i=Or(),o=Ir();function a(e,t,n,r,a,c){const u="block-map"===n.type?s.resolveBlockMap(e,t,n,r,c):"block-seq"===n.type?i.resolveBlockSeq(e,t,n,r,c):o.resolveFlowCollection(e,t,n,r,c),l=u.constructor;return"!"===a||a===l.tagName?(u.tag=l.tagName,u):(a&&(u.tag=a),u)}return fr.composeCollection=function(s,i,o,c,u){const l=c.tag,f=l?i.directives.tagName(l.source,e=>u(l,"TAG_RESOLVE_FAILED",e)):null;if("block-seq"===o.type){const{anchor:e,newlineAfterProp:t}=c,n=e&&l?e.offset>l.offset?e:l:e??l;if(n&&(!t||t.offset<n.offset)){u(n,"MISSING_CHAR","Missing newline after block sequence props")}}const p="block-map"===o.type?"map":"block-seq"===o.type?"seq":"{"===o.start.source?"map":"seq";if(!l||!f||"!"===f||f===n.YAMLMap.tagName&&"map"===p||f===r.YAMLSeq.tagName&&"seq"===p)return a(s,i,o,u,f);let h=i.schema.tags.find(e=>e.tag===f&&e.collection===p);if(!h){const e=i.schema.knownTags[f];if(!e||e.collection!==p)return e?u(l,"BAD_COLLECTION_TYPE",`${e.tag} used for ${p} collection, but expects ${e.collection??"scalar"}`,!0):u(l,"TAG_RESOLVE_FAILED",`Unresolved tag: ${f}`,!0),a(s,i,o,u,f);i.schema.tags.push(Object.assign({},e,{default:!1})),h=e}const d=a(s,i,o,u,f,h),m=h.resolve?.(d,e=>u(l,"TAG_RESOLVE_FAILED",e),i.options)??d,g=e.isNode(m)?m:new t.Scalar(m);return g.range=d.range,g.tag=f,h?.format&&(g.format=h.format),g},fr}var Dr,jr={},Fr={};function Hr(){if(Dr)return Fr;Dr=1;var e=ot();return Fr.resolveBlockScalar=function(t,n,r){const s=n.offset,i=function({offset:e,props:t},n,r){if("block-scalar-header"!==t[0].type)return r(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:s}=t[0],i=s[0];let o=0,a="",c=-1;for(let t=1;t<s.length;++t){const n=s[t];if(a||"-"!==n&&"+"!==n){const r=Number(n);!o&&r?o=r:-1===c&&(c=e+t)}else a=n}-1!==c&&r(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${s}`);let u=!1,l="",f=s.length;for(let e=1;e<t.length;++e){const s=t[e];switch(s.type){case"space":u=!0;case"newline":f+=s.source.length;break;case"comment":if(n&&!u){r(s,"MISSING_CHAR","Comments must be separated from other tokens by white space characters")}f+=s.source.length,l=s.source.substring(1);break;case"error":r(s,"UNEXPECTED_TOKEN",s.message),f+=s.source.length;break;default:{r(s,"UNEXPECTED_TOKEN",`Unexpected token in block scalar header: ${s.type}`);const e=s.source;e&&"string"==typeof e&&(f+=e.length)}}}return{mode:i,indent:o,chomp:a,comment:l,length:f}}(n,t.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[s,s,s]};const o=">"===i.mode?e.Scalar.BLOCK_FOLDED:e.Scalar.BLOCK_LITERAL,a=n.source?function(e){const t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),s=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let e=1;e<t.length;e+=2)s.push([t[e],t[e+1]]);return s}(n.source):[];let c=a.length;for(let e=a.length-1;e>=0;--e){const t=a[e][1];if(""!==t&&"\r"!==t)break;c=e}if(0===c){const e="+"===i.chomp&&a.length>0?"\n".repeat(Math.max(1,a.length-1)):"";let t=s+i.length;return n.source&&(t+=n.source.length),{value:e,type:o,comment:i.comment,range:[s,t,t]}}let u=n.indent+i.indent,l=n.offset+i.length,f=0;for(let e=0;e<c;++e){const[n,s]=a[e];if(""!==s&&"\r"!==s){if(n.length<u){const e="Block scalars with more-indented leading empty lines must use an explicit indentation indicator";r(l+n.length,"MISSING_CHAR",e)}if(0===i.indent&&(u=n.length),f=e,0===u&&!t.atRoot){r(l,"BAD_INDENT","Block scalar values in collections must be indented")}break}0===i.indent&&n.length>u&&(u=n.length),l+=n.length+s.length+1}for(let e=a.length-1;e>=c;--e)a[e][0].length>u&&(c=e+1);let p="",h="",d=!1;for(let e=0;e<f;++e)p+=a[e][0].slice(u)+"\n";for(let t=f;t<c;++t){let[n,s]=a[t];l+=n.length+s.length+1;const c="\r"===s[s.length-1];if(c&&(s=s.slice(0,-1)),s&&n.length<u){const e=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;r(l-s.length-(c?2:1),"BAD_INDENT",e),n=""}o===e.Scalar.BLOCK_LITERAL?(p+=h+n.slice(u)+s,h="\n"):n.length>u||"\t"===s[0]?(" "===h?h="\n":d||"\n"!==h||(h="\n\n"),p+=h+n.slice(u)+s,h="\n",d=!0):""===s?"\n"===h?p+="\n":h="\n":(p+=h+s,h=" ",d=!1)}switch(i.chomp){case"-":break;case"+":for(let e=c;e<a.length;++e)p+="\n"+a[e][0].slice(u);"\n"!==p[p.length-1]&&(p+="\n");break;default:p+="\n"}const m=s+i.length+n.source.length;return{value:p,type:o,comment:i.comment,range:[s,m,m]}},Fr}var Br,zr,Kr={};function Ur(){if(Br)return Kr;Br=1;var e=ot(),t=Lr();function n(e){let t,n;try{t=new RegExp("(.*?)(?<![ \t])[ \t]*\r?\n","sy"),n=new RegExp("[ \t]*(.*?)(?:(?<![ \t])[ \t]*)?\r?\n","sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let s=r[1],i=" ",o=t.lastIndex;for(n.lastIndex=o;r=n.exec(e);)""===r[1]?"\n"===i?s+=i:i="\n":(s+=i+r[1],i=" "),o=n.lastIndex;const a=/[ \t]*(.*)/sy;return a.lastIndex=o,r=a.exec(e),s+i+(r?.[1]??"")}function r(e,t){let n="",r=e[t+1];for(;!(" "!==r&&"\t"!==r&&"\n"!==r&&"\r"!==r||"\r"===r&&"\n"!==e[t+2]);)"\n"===r&&(n+="\n"),r=e[(t+=1)+1];return n||(n=" "),{fold:n,offset:t}}const s={0:"\0",a:"",b:"\b",e:"",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function i(e,t,n,r){const s=e.substr(t,n),i=s.length===n&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;if(isNaN(i)){const s=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${s}`),s}return String.fromCodePoint(i)}return Kr.resolveFlowScalar=function(o,a,c){const{offset:u,type:l,source:f,end:p}=o;let h,d;const m=(e,t,n)=>c(u+e,t,n);switch(l){case"scalar":h=e.Scalar.PLAIN,d=function(e,t){let r="";switch(e[0]){case"\t":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":r=`block scalar indicator ${e[0]}`;break;case"@":case"`":r=`reserved character ${e[0]}`}r&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`);return n(e)}(f,m);break;case"single-quoted-scalar":h=e.Scalar.QUOTE_SINGLE,d=function(e,t){"'"===e[e.length-1]&&1!==e.length||t(e.length,"MISSING_CHAR","Missing closing 'quote");return n(e.slice(1,-1)).replace(/''/g,"'")}(f,m);break;case"double-quoted-scalar":h=e.Scalar.QUOTE_DOUBLE,d=function(e,t){let n="";for(let o=1;o<e.length-1;++o){const a=e[o];if("\r"!==a||"\n"!==e[o+1])if("\n"===a){const{fold:t,offset:s}=r(e,o);n+=t,o=s}else if("\\"===a){let r=e[++o];const a=s[r];if(a)n+=a;else if("\n"===r)for(r=e[o+1];" "===r||"\t"===r;)r=e[1+ ++o];else if("\r"===r&&"\n"===e[o+1])for(r=e[1+ ++o];" "===r||"\t"===r;)r=e[1+ ++o];else if("x"===r||"u"===r||"U"===r){const s={x:2,u:4,U:8}[r];n+=i(e,o+1,s,t),o+=s}else{const r=e.substr(o-1,2);t(o-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${r}`),n+=r}}else if(" "===a||"\t"===a){const t=o;let r=e[o+1];for(;" "===r||"\t"===r;)r=e[1+ ++o];"\n"===r||"\r"===r&&"\n"===e[o+2]||(n+=o>t?e.slice(t,o+1):a)}else n+=a}'"'===e[e.length-1]&&1!==e.length||t(e.length,"MISSING_CHAR",'Missing closing "quote');return n}(f,m);break;default:return c(o,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${l}`),{value:"",type:null,comment:"",range:[u,u+f.length,u+f.length]}}const g=u+f.length,y=t.resolveEnd(p,g,a,c);return{value:d,type:h,comment:y.comment,range:[u,g,y.offset]}},Kr}function qr(){if(zr)return jr;zr=1;var e=Ne(),t=ot(),n=Hr(),r=Ur();return jr.composeScalar=function(s,i,o,a){const{value:c,type:u,comment:l,range:f}="block-scalar"===i.type?n.resolveBlockScalar(s,i,a):r.resolveFlowScalar(i,s.options.strict,a),p=o?s.directives.tagName(o.source,e=>a(o,"TAG_RESOLVE_FAILED",e)):null;let h,d;h=s.options.stringKeys&&s.atKey?s.schema[e.SCALAR]:p?function(t,n,r,s,i){if("!"===r)return t[e.SCALAR];const o=[];for(const e of t.tags)if(!e.collection&&e.tag===r){if(!e.default||!e.test)return e;o.push(e)}for(const e of o)if(e.test?.test(n))return e;const a=t.knownTags[r];if(a&&!a.collection)return t.tags.push(Object.assign({},a,{default:!1,test:void 0})),a;return i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,"tag:yaml.org,2002:str"!==r),t[e.SCALAR]}(s.schema,c,p,o,a):"scalar"===i.type?function({atKey:t,directives:n,schema:r},s,i,o){const a=r.tags.find(e=>(!0===e.default||t&&"key"===e.default)&&e.test?.test(s))||r[e.SCALAR];if(r.compat){const t=r.compat.find(e=>e.default&&e.test?.test(s))??r[e.SCALAR];if(a.tag!==t.tag){o(i,"TAG_RESOLVE_FAILED",`Value may be parsed as either ${n.tagString(a.tag)} or ${n.tagString(t.tag)}`,!0)}}return a}(s,c,i,a):s.schema[e.SCALAR];try{const n=h.resolve(c,e=>a(o??i,"TAG_RESOLVE_FAILED",e),s.options);d=e.isScalar(n)?n:new t.Scalar(n)}catch(e){const n=e instanceof Error?e.message:String(e);a(o??i,"TAG_RESOLVE_FAILED",n),d=new t.Scalar(c)}return d.range=f,d.source=c,u&&(d.type=u),p&&(d.tag=p),h.format&&(d.format=h.format),l&&(d.comment=l),d},jr}var Zr,Gr,Wr,Vr,Yr={};function Qr(){if(Zr)return Yr;return Zr=1,Yr.emptyScalarPosition=function(e,t,n){if(t){n??(n=t.length);for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case"space":case"comment":case"newline":e-=n.source.length;continue}for(n=t[++r];"space"===n?.type;)e+=n.source.length,n=t[++r];break}}return e},Yr}function Jr(){if(Gr)return lr;Gr=1;var e=Xe(),t=Ne(),n=Mr(),r=qr(),s=Lr(),i=Qr();const o={composeNode:a,composeEmptyNode:c};function a(i,a,u,l){const f=i.atKey,{spaceBefore:p,comment:h,anchor:d,tag:m}=u;let g,y=!0;switch(a.type){case"alias":g=function({options:t},{offset:n,source:r,end:i},o){const a=new e.Alias(r.substring(1));""===a.source&&o(n,"BAD_ALIAS","Alias cannot be an empty string");a.source.endsWith(":")&&o(n+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const c=n+r.length,u=s.resolveEnd(i,c,t.strict,o);a.range=[n,c,u.offset],u.comment&&(a.comment=u.comment);return a}(i,a,l),(d||m)&&l(a,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":g=r.composeScalar(i,a,m,l),d&&(g.anchor=d.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":g=n.composeCollection(o,i,a,u,l),d&&(g.anchor=d.source.substring(1));break;default:l(a,"UNEXPECTED_TOKEN","error"===a.type?a.message:`Unsupported token (type: ${a.type})`),g=c(i,a.offset,void 0,null,u,l),y=!1}if(d&&""===g.anchor&&l(d,"BAD_ALIAS","Anchor cannot be an empty string"),f&&i.options.stringKeys&&(!t.isScalar(g)||"string"!=typeof g.value||g.tag&&"tag:yaml.org,2002:str"!==g.tag)){l(m??a,"NON_STRING_KEY","With stringKeys, all keys must be strings")}return p&&(g.spaceBefore=!0),h&&("scalar"===a.type&&""===a.source?g.comment=h:g.commentBefore=h),i.options.keepSourceTokens&&y&&(g.srcToken=a),g}function c(e,t,n,s,{spaceBefore:o,comment:a,anchor:c,tag:u,end:l},f){const p={type:"scalar",offset:i.emptyScalarPosition(t,n,s),indent:-1,source:""},h=r.composeScalar(e,p,u,f);return c&&(h.anchor=c.source.substring(1),""===h.anchor&&f(c,"BAD_ALIAS","Anchor cannot be an empty string")),o&&(h.spaceBefore=!0),a&&(h.comment=a,h.range[2]=l),h}return lr.composeEmptyNode=c,lr.composeNode=a,lr}function Xr(){if(Wr)return ur;Wr=1;var e=sr(),t=Jr(),n=Lr(),r=dr();return ur.composeDoc=function(s,i,{offset:o,start:a,value:c,end:u},l){const f=Object.assign({_directives:i},s),p=new e.Document(void 0,f),h={atKey:!1,atRoot:!0,directives:p.directives,options:p.options,schema:p.schema},d=r.resolveProps(a,{indicator:"doc-start",next:c??u?.[0],offset:o,onError:l,parentIndent:0,startOnNewline:!0});d.found&&(p.directives.docStart=!0,!c||"block-map"!==c.type&&"block-seq"!==c.type||d.hasNewline||l(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),p.contents=c?t.composeNode(h,c,d,l):t.composeEmptyNode(h,d.end,a,null,d,l);const m=p.contents.range[2],g=n.resolveEnd(u,m,!1,l);return g.comment&&(p.comment=g.comment),p.range=[o,m,g.offset],p},ur}function es(){if(Vr)return Re;Vr=1;var e=S,t=De(),n=sr(),r=ar(),s=Ne(),i=Xr(),o=Lr();function a(e){if("number"==typeof e)return[e,e+1];if(Array.isArray(e))return 2===e.length?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+("string"==typeof n?n.length:1)]}function c(e){let t="",n=!1,r=!1;for(let s=0;s<e.length;++s){const i=e[s];switch(i[0]){case"#":t+=(""===t?"":r?"\n\n":"\n")+(i.substring(1)||" "),n=!0,r=!1;break;case"%":"#"!==e[s+1]?.[0]&&(s+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}return Re.Composer=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,s)=>{const i=a(e);s?this.warnings.push(new r.YAMLWarning(i,t,n)):this.errors.push(new r.YAMLParseError(i,t,n))},this.directives=new t.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){const{comment:n,afterEmptyLine:r}=c(this.prelude);if(n){const i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(s.isCollection(i)&&!i.flow&&i.items.length>0){let e=i.items[0];s.isPair(e)&&(e=e.key);const t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{const e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:c(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(const t of e)yield*this.next(t);yield*this.end(t,n)}*next(t){switch(e.env.LOG_STREAM&&console.dir(t,{depth:null}),t.type){case"directive":this.directives.add(t.source,(e,n,r)=>{const s=a(t);s[0]+=e,this.onError(s,"BAD_DIRECTIVE",n,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const e=i.composeDoc(this.options,this.directives,t,this.onError);this.atDirectives&&!e.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(e,!1),this.doc&&(yield this.doc),this.doc=e,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const e=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,n=new r.YAMLParseError(a(t),"UNEXPECTED_TOKEN",e);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){const e="Unexpected doc-end without preceding document";this.errors.push(new r.YAMLParseError(a(t),"UNEXPECTED_TOKEN",e));break}this.doc.directives.docEnd=!0;const e=o.resolveEnd(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),e.comment){const t=this.doc.comment;this.doc.comment=t?`${t}\n${e.comment}`:e.comment}this.doc.range[2]=e.offset;break}default:this.errors.push(new r.YAMLParseError(a(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const e=Object.assign({_directives:this.directives},this.options),r=new n.Document(void 0,e);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,t,t],this.decorate(r,!1),yield r}}},Re}var ts,ns={},rs={};function ss(){if(ts)return rs;ts=1;var e=Hr(),t=Ur(),n=ar(),r=St();function s(e,t){if(t)for(const n of t)switch(n.type){case"space":case"comment":e.push(n);break;case"newline":return e.push(n),!0}return!1}function i(e,t,n){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=n,e.source=t;break;case"block-scalar":{const r=e.props.slice(1);let s=t.length;"block-scalar-header"===e.props[0].type&&(s-=e.props[0].source.length);for(const e of r)e.offset+=s;delete e.props,Object.assign(e,{type:n,source:t,end:r});break}case"block-map":case"block-seq":{const r={type:"newline",offset:e.offset+t.length,indent:e.indent,source:"\n"};delete e.items,Object.assign(e,{type:n,source:t,end:[r]});break}default:{const r="indent"in e?e.indent:-1,s="end"in e&&Array.isArray(e.end)?e.end.filter(e=>"space"===e.type||"comment"===e.type||"newline"===e.type):[];for(const t of Object.keys(e))"type"!==t&&"offset"!==t&&delete e[t];Object.assign(e,{type:n,indent:r,source:t,end:s})}}}return rs.createScalarToken=function(e,t){const{implicitKey:n=!1,indent:i,inFlow:o=!1,offset:a=-1,type:c="PLAIN"}=t,u=r.stringifyString({type:c,value:e},{implicitKey:n,indent:i>0?" ".repeat(i):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}}),l=t.end??[{type:"newline",offset:-1,indent:i,source:"\n"}];switch(u[0]){case"|":case">":{const e=u.indexOf("\n"),t=u.substring(0,e),n=u.substring(e+1)+"\n",r=[{type:"block-scalar-header",offset:a,indent:i,source:t}];return s(r,l)||r.push({type:"newline",offset:-1,indent:i,source:"\n"}),{type:"block-scalar",offset:a,indent:i,props:r,source:n}}case'"':return{type:"double-quoted-scalar",offset:a,indent:i,source:u,end:l};case"'":return{type:"single-quoted-scalar",offset:a,indent:i,source:u,end:l};default:return{type:"scalar",offset:a,indent:i,source:u,end:l}}},rs.resolveAsScalar=function(r,s=!0,i){if(r){const o=(e,t,r)=>{const s="number"==typeof e?e:Array.isArray(e)?e[0]:e.offset;if(!i)throw new n.YAMLParseError([s,s+1],t,r);i(s,t,r)};switch(r.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return t.resolveFlowScalar(r,s,o);case"block-scalar":return e.resolveBlockScalar({options:{strict:s}},r,o)}}return null},rs.setScalarValue=function(e,t,n={}){let{afterKey:o=!1,implicitKey:a=!1,inFlow:c=!1,type:u}=n,l="indent"in e?e.indent:null;if(o&&"number"==typeof l&&(l+=2),!u)switch(e.type){case"single-quoted-scalar":u="QUOTE_SINGLE";break;case"double-quoted-scalar":u="QUOTE_DOUBLE";break;case"block-scalar":{const t=e.props[0];if("block-scalar-header"!==t.type)throw new Error("Invalid block scalar header");u=">"===t.source[0]?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:u="PLAIN"}const f=r.stringifyString({type:u,value:t},{implicitKey:a||null===l,indent:null!==l&&l>0?" ".repeat(l):"",inFlow:c,options:{blockQuote:!0,lineWidth:-1}});switch(f[0]){case"|":case">":!function(e,t){const n=t.indexOf("\n"),r=t.substring(0,n),i=t.substring(n+1)+"\n";if("block-scalar"===e.type){const t=e.props[0];if("block-scalar-header"!==t.type)throw new Error("Invalid block scalar header");t.source=r,e.source=i}else{const{offset:t}=e,n="indent"in e?e.indent:-1,o=[{type:"block-scalar-header",offset:t,indent:n,source:r}];s(o,"end"in e?e.end:void 0)||o.push({type:"newline",offset:-1,indent:n,source:"\n"});for(const t of Object.keys(e))"type"!==t&&"offset"!==t&&delete e[t];Object.assign(e,{type:"block-scalar",indent:n,props:o,source:i})}}(e,f);break;case'"':i(e,f,"double-quoted-scalar");break;case"'":i(e,f,"single-quoted-scalar");break;default:i(e,f,"scalar")}},rs}var is,os={};function as(){if(is)return os;is=1;function e(n){switch(n.type){case"block-scalar":{let t="";for(const r of n.props)t+=e(r);return t+n.source}case"block-map":case"block-seq":{let e="";for(const r of n.items)e+=t(r);return e}case"flow-collection":{let e=n.start.source;for(const r of n.items)e+=t(r);for(const t of n.end)e+=t.source;return e}case"document":{let e=t(n);if(n.end)for(const t of n.end)e+=t.source;return e}default:{let e=n.source;if("end"in n&&n.end)for(const t of n.end)e+=t.source;return e}}}function t({start:t,key:n,sep:r,value:s}){let i="";for(const e of t)i+=e.source;if(n&&(i+=e(n)),r)for(const e of r)i+=e.source;return s&&(i+=e(s)),i}return os.stringify=n=>"type"in n?e(n):t(n),os}var cs,us,ls={};function fs(){if(cs)return ls;cs=1;const e=Symbol("break visit"),t=Symbol("skip children"),n=Symbol("remove item");function r(e,t){"type"in e&&"document"===e.type&&(e={start:e.start,value:e.value}),s(Object.freeze([]),e,t)}function s(t,r,i){let o=i(r,t);if("symbol"==typeof o)return o;for(const a of["key","value"]){const c=r[a];if(c&&"items"in c){for(let r=0;r<c.items.length;++r){const o=s(Object.freeze(t.concat([[a,r]])),c.items[r],i);if("number"==typeof o)r=o-1;else{if(o===e)return e;o===n&&(c.items.splice(r,1),r-=1)}}"function"==typeof o&&"key"===a&&(o=o(r,t))}}return"function"==typeof o?o(r,t):o}return r.BREAK=e,r.SKIP=t,r.REMOVE=n,r.itemAtPath=(e,t)=>{let n=e;for(const[e,r]of t){const t=n?.[e];if(!t||!("items"in t))return;n=t.items[r]}return n},r.parentCollection=(e,t)=>{const n=r.itemAtPath(e,t.slice(0,-1)),s=t[t.length-1][0],i=n?.[s];if(i&&"items"in i)return i;throw new Error("Parent collection not found")},ls.visit=r,ls}function ps(){if(us)return ns;us=1;var e=ss(),t=as(),n=fs();return ns.createScalarToken=e.createScalarToken,ns.resolveAsScalar=e.resolveAsScalar,ns.setScalarValue=e.setScalarValue,ns.stringify=t.stringify,ns.visit=n.visit,ns.BOM="\ufeff",ns.DOCUMENT="",ns.FLOW_END="",ns.SCALAR="",ns.isCollection=e=>!!e&&"items"in e,ns.isScalar=e=>!!e&&("scalar"===e.type||"single-quoted-scalar"===e.type||"double-quoted-scalar"===e.type||"block-scalar"===e.type),ns.prettyToken=function(e){switch(e){case"\ufeff":return"<BOM>";case"":return"<DOC>";case"":return"<FLOW_END>";case"":return"<SCALAR>";default:return JSON.stringify(e)}},ns.tokenType=function(e){switch(e){case"\ufeff":return"byte-order-mark";case"":return"doc-mode";case"":return"flow-error-end";case"":return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case"\n":case"\r\n":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(e[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},ns}var hs,ds={};function ms(){if(hs)return ds;hs=1;var e=ps();function t(e){switch(e){case void 0:case" ":case"\n":case"\r":case"\t":return!0;default:return!1}}const n=new Set("0123456789ABCDEFabcdef"),r=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),s=new Set(",[]{}"),i=new Set(" ,[]{}\n\r\t"),o=e=>!e||i.has(e);return ds.Lexer=class{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(e,t=!1){if(e){if("string"!=typeof e)throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??"stream";for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;" "===t||"\t"===t;)t=this.buffer[++e];return!t||"#"===t||"\n"===t||"\r"===t&&"\n"===this.buffer[e+1]}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let n=this.buffer[e];if(this.indentNext>0){let t=0;for(;" "===n;)n=this.buffer[++t+e];if("\r"===n){const n=this.buffer[t+e+1];if("\n"===n||!n&&!this.atEnd)return e+t+1}return"\n"===n||t>=this.indentNext||!n&&!this.atEnd?e+t:-1}if("-"===n||"."===n){const n=this.buffer.substr(e,3);if(("---"===n||"..."===n)&&t(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return("number"!=typeof e||-1!==e&&e<this.pos)&&(e=this.buffer.indexOf("\n",this.pos),this.lineEndPos=e),-1===e?this.atEnd?this.buffer.substring(this.pos):null:("\r"===this.buffer[e-1]&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){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 t=this.getLine();if(null===t)return this.setNext("stream");if(t[0]===e.BOM&&(yield*this.pushCount(1),t=t.substring(1)),"%"===t[0]){let e=t.length,n=t.indexOf("#");for(;-1!==n;){const r=t[n-1];if(" "===r||"\t"===r){e=n-1;break}n=t.indexOf("#",n+1)}for(;;){const n=t[e-1];if(" "!==n&&"\t"!==n)break;e-=1}const r=(yield*this.pushCount(e))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){const e=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-e),yield*this.pushNewline(),"stream"}return yield e.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){const e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if("-"===e||"."===e){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const e=this.peek(3);if(("---"===e||"..."===e)&&t(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,"---"===e?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!t(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if(("-"===e||"?"===e||":"===e)&&t(n)){const e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const e=this.getLine();if(null===e)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);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(o),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=(yield*this.parseBlockScalarHeader()),t+=(yield*this.pushSpaces(!0)),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let n,r,s=-1;do{n=yield*this.pushNewline(),n>0?(r=yield*this.pushSpaces(!1),this.indentValue=s=r):r=0,r+=(yield*this.pushSpaces(!0))}while(n+r>0);const i=this.getLine();if(null===i)return this.setNext("flow");if(-1!==s&&s<this.indentNext&&"#"!==i[0]||0===s&&(i.startsWith("---")||i.startsWith("..."))&&t(i[3])){if(!(s===this.indentNext-1&&1===this.flowLevel&&("]"===i[0]||"}"===i[0])))return this.flowLevel=0,yield e.FLOW_END,yield*this.parseLineStart()}let a=0;for(;","===i[a];)a+=(yield*this.pushCount(1)),a+=(yield*this.pushSpaces(!0)),this.flowKey=!1;switch(a+=(yield*this.pushIndicators()),i[a]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-a),"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(o),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const e=this.charAt(1);if(this.flowKey||t(e)||","===e)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const e=this.charAt(0);let t=this.buffer.indexOf(e,this.pos+1);if("'"===e)for(;-1!==t&&"'"===this.buffer[t+1];)t=this.buffer.indexOf("'",t+2);else for(;-1!==t;){let e=0;for(;"\\"===this.buffer[t-1-e];)e+=1;if(e%2==0)break;t=this.buffer.indexOf('"',t+1)}const n=this.buffer.substring(0,t);let r=n.indexOf("\n",this.pos);if(-1!==r){for(;-1!==r;){const e=this.continueScalar(r+1);if(-1===e)break;r=n.indexOf("\n",e)}-1!==r&&(t=r-("\r"===n[r-1]?2:1))}if(-1===t){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){const t=this.buffer[++e];if("+"===t)this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if("-"!==t)break}return yield*this.pushUntil(e=>t(e)||"#"===e)}*parseBlockScalar(){let t,n=this.pos-1,r=0;e:for(let e=this.pos;t=this.buffer[e];++e)switch(t){case" ":r+=1;break;case"\n":n=e,r=0;break;case"\r":{const t=this.buffer[e+1];if(!t&&!this.atEnd)return this.setNext("block-scalar");if("\n"===t)break}default:break e}if(!t&&!this.atEnd)return this.setNext("block-scalar");if(r>=this.indentNext){-1===this.blockScalarIndent?this.indentNext=r:this.indentNext=this.blockScalarIndent+(0===this.indentNext?1:this.indentNext);do{const e=this.continueScalar(n+1);if(-1===e)break;n=this.buffer.indexOf("\n",e)}while(-1!==n);if(-1===n){if(!this.atEnd)return this.setNext("block-scalar");n=this.buffer.length}}let s=n+1;for(t=this.buffer[s];" "===t;)t=this.buffer[++s];if("\t"===t){for(;"\t"===t||" "===t||"\r"===t||"\n"===t;)t=this.buffer[++s];n=s-1}else if(!this.blockScalarKeep)for(;;){let e=n-1,t=this.buffer[e];"\r"===t&&(t=this.buffer[--e]);const s=e;for(;" "===t;)t=this.buffer[--e];if(!("\n"===t&&e>=this.pos&&e+1+r>s))break;n=e}return yield e.SCALAR,yield*this.pushToIndex(n+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const n=this.flowLevel>0;let r,i=this.pos-1,o=this.pos-1;for(;r=this.buffer[++o];)if(":"===r){const e=this.buffer[o+1];if(t(e)||n&&s.has(e))break;i=o}else if(t(r)){let e=this.buffer[o+1];if("\r"===r&&("\n"===e?(o+=1,r="\n",e=this.buffer[o+1]):i=o),"#"===e||n&&s.has(e))break;if("\n"===r){const e=this.continueScalar(o+1);if(-1===e)break;o=Math.max(o,e-2)}}else{if(n&&s.has(r))break;i=o}return r||this.atEnd?(yield e.SCALAR,yield*this.pushToIndex(i+1,!0),n?"flow":"doc"):this.setNext("plain-scalar")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){const n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(o))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const e=this.flowLevel>0,n=this.charAt(1);if(t(n)||e&&s.has(n))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if("<"===this.charAt(1)){let e=this.pos+2,n=this.buffer[e];for(;!t(n)&&">"!==n;)n=this.buffer[++e];return yield*this.pushToIndex(">"===n?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(r.has(t))t=this.buffer[++e];else{if("%"!==t||!n.has(this.buffer[e+1])||!n.has(this.buffer[e+2]))break;t=this.buffer[e+=3]}return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return"\n"===e?yield*this.pushCount(1):"\r"===e&&"\n"===this.charAt(1)?yield*this.pushCount(2):0}*pushSpaces(e){let t,n=this.pos-1;do{t=this.buffer[++n]}while(" "===t||e&&"\t"===t);const r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},ds}var gs,ys={};function vs(){if(gs)return ys;gs=1;return ys.LineCounter=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){const r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(0===t)return{line:0,col:e};return{line:t,col:e-this.lineStarts[t-1]+1}}}},ys}var bs,_s={};function ws(){if(bs)return _s;bs=1;var e=S,t=ps(),n=ms();function r(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function s(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function i(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function o(e){switch(e.type){case"document":return e.start;case"block-map":{const t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function a(e){if(0===e.length)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;"space"===e[++t]?.type;);return e.splice(t,e.length)}function c(e){if("flow-seq-start"===e.start.type)for(const t of e.items)!t.sep||t.value||r(t.start,"explicit-key-ind")||r(t.sep,"map-value-ind")||(t.key&&(t.value=t.key),delete t.key,i(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}return _s.Parser=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new n.Lexer,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&0===this.offset&&this.onNewLine(0);for(const n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(n){if(this.source=n,e.env.LOG_TOKENS&&console.log("|",t.prettyToken(n)),this.atScalar)return this.atScalar=!1,yield*this.step(),void(this.offset+=n.length);const r=t.tokenType(n);if(r)if("scalar"===r)this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=r,yield*this.step(),r){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+n.length);break;case"space":this.atNewLine&&" "===n[0]&&(this.indent+=n.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=n.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=n.length}else{const e=`Not a YAML token: ${n}`;yield*this.pop({type:"error",offset:this.offset,message:e,source:n}),this.offset+=n.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if("doc-end"!==this.type||e&&"doc-end"===e.type){if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}else{for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source})}}peek(e){return this.stack[this.stack.length-e]}*pop(e){const t=e??this.stack.pop();if(t)if(0===this.stack.length)yield t;else{const e=this.peek(1);switch("block-scalar"===t.type?t.indent="indent"in e?e.indent:0:"flow-collection"===t.type&&"document"===e.type&&(t.indent=0),"flow-collection"===t.type&&c(t),e.type){case"document":e.value=t;break;case"block-scalar":e.props.push(t);break;case"block-map":{const n=e.items[e.items.length-1];if(n.value)return e.items.push({start:[],key:t,sep:[]}),void(this.onKeyLine=!0);if(!n.sep)return Object.assign(n,{key:t,sep:[]}),void(this.onKeyLine=!n.explicitKey);n.value=t;break}case"block-seq":{const n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case"flow-collection":{const n=e.items[e.items.length-1];return void(!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]}))}default:yield*this.pop(),yield*this.pop(t)}if(!("document"!==e.type&&"block-map"!==e.type&&"block-seq"!==e.type||"block-map"!==t.type&&"block-seq"!==t.type)){const n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&-1===s(n.start)&&(0===t.indent||n.start.every(e=>"comment"!==e.type||e.indent<t.indent))&&("document"===e.type?e.end=n.start:e.items.push({start:n.start}),t.items.splice(-1,1))}}else{const e="Tried to pop an empty stack";yield{type:"error",offset:this.offset,source:"",message:e}}}*stream(){switch(this.type){case"directive-line":return void(yield{type:"directive",offset:this.offset,source:this.source});case"byte-order-mark":case"space":case"comment":case"newline":return void(yield this.sourceToken);case"doc-mode":case"doc-start":{const e={type:"document",offset:this.offset,start:[]};return"doc-start"===this.type&&e.start.push(this.sourceToken),void this.stack.push(e)}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":return void(-1!==s(e.start)?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken));case"anchor":case"tag":case"space":case"comment":case"newline":return void e.start.push(this.sourceToken)}const t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if("map-value-ind"===this.type){const t=a(o(this.peek(2)));let n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];const r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:t,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":return void e.props.push(this.sourceToken);case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){const n="end"in t.value?t.value.end:void 0,r=Array.isArray(n)?n[n.length-1]:void 0;"comment"===r?.type?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){const n=e.items[e.items.length-2],r=n?.value?.end;if(Array.isArray(r))return Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),void e.items.pop()}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const n=!this.onKeyLine&&this.indent===e.indent,s=n&&(t.sep||t.explicitKey)&&"seq-item-ind"!==this.type;let o=[];if(s&&t.sep&&!t.value){const n=[];for(let r=0;r<t.sep.length;++r){const s=t.sep[r];switch(s.type){case"newline":n.push(r);break;case"space":break;case"comment":s.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(o=t.sep.splice(n[1]))}switch(this.type){case"anchor":case"tag":return void(s||t.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken));case"explicit-key-ind":return t.sep||t.explicitKey?s||t.value?(o.push(this.sourceToken),e.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}):(t.start.push(this.sourceToken),t.explicitKey=!0),void(this.onKeyLine=!0);case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(r(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(i(t.key)&&!r(t.sep,"newline")){const e=a(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else o.length>0?t.sep=t.sep.concat(o,this.sourceToken):t.sep.push(this.sourceToken);else if(r(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{const e=a(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||s?e.items.push({start:o,key:null,sep:[this.sourceToken]}):r(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return void(this.onKeyLine=!0);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const n=this.flowScalar(this.type);return void(s||t.value?(e.items.push({start:o,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0))}default:{const s=this.startBlockValue(e);if(s){if("block-seq"===s.type){if(!t.explicitKey&&t.sep&&!r(t.sep,"newline"))return void(yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source}))}else n&&e.items.push({start:o});return void this.stack.push(s)}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){const n="end"in t.value?t.value.end:void 0,r=Array.isArray(n)?n[n.length-1]:void 0;"comment"===r?.type?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){const n=e.items[e.items.length-2],r=n?.value?.end;if(Array.isArray(r))return Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),void e.items.pop()}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;return void t.start.push(this.sourceToken);case"seq-item-ind":if(this.indent!==e.indent)break;return void(t.value||r(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken))}if(this.indent>e.indent){const t=this.startBlockValue(e);if(t)return void this.stack.push(t)}yield*this.pop(),yield*this.step()}*flowCollection(e){const t=e.items[e.items.length-1];if("flow-error-end"===this.type){let e;do{yield*this.pop(),e=this.peek(1)}while(e&&"flow-collection"===e.type)}else if(0===e.end.length){switch(this.type){case"comma":case"explicit-key-ind":return void(!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken));case"map-value-ind":return void(!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]}));case"space":case"comment":case"newline":case"anchor":case"tag":return void(!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken));case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const n=this.flowScalar(this.type);return void(!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]}))}case"flow-map-end":case"flow-seq-end":return void e.end.push(this.sourceToken)}const n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{const t=this.peek(2);if("block-map"===t.type&&("map-value-ind"===this.type&&t.indent===e.indent||"newline"===this.type&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if("map-value-ind"===this.type&&"flow-collection"!==t.type){const n=a(o(t));c(e);const r=e.end.splice(1,e.end.length);r.push(this.sourceToken);const s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){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;const t=a(o(e));return t.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const t=a(o(e));return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return"comment"===this.type&&(!(this.indent<=t)&&e.every(e=>"newline"===e.type||"space"===e.type))}*documentEnd(e){"doc-mode"!==this.type&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop()))}*lineEnd(e){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;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop())}}},_s}var Ss,As,ks={};function Es(){if(Ss)return ks;Ss=1;var e=es(),t=sr(),n=ar(),r=Ot(),s=Ne(),i=vs(),o=ws();function a(e){const t=!1!==e.prettyErrors;return{lineCounter:e.lineCounter||t&&new i.LineCounter||null,prettyErrors:t}}function c(t,r={}){const{lineCounter:s,prettyErrors:i}=a(r),c=new o.Parser(s?.addNewLine),u=new e.Composer(r);let l=null;for(const e of u.compose(c.parse(t),!0,t.length))if(l){if("silent"!==l.options.logLevel){l.errors.push(new n.YAMLParseError(e.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}else l=e;return i&&s&&(l.errors.forEach(n.prettifyError(t,s)),l.warnings.forEach(n.prettifyError(t,s))),l}return ks.parse=function(e,t,n){let s;"function"==typeof t?s=t:void 0===n&&t&&"object"==typeof t&&(n=t);const i=c(e,n);if(!i)return null;if(i.warnings.forEach(e=>r.warn(i.options.logLevel,e)),i.errors.length>0){if("silent"!==i.options.logLevel)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:s},n))},ks.parseAllDocuments=function(t,r={}){const{lineCounter:s,prettyErrors:i}=a(r),c=new o.Parser(s?.addNewLine),u=new e.Composer(r),l=Array.from(u.compose(c.parse(t)));if(i&&s)for(const e of l)e.errors.forEach(n.prettifyError(t,s)),e.warnings.forEach(n.prettifyError(t,s));return l.length>0?l:Object.assign([],{empty:!0},u.streamInfo())},ks.parseDocument=c,ks.stringify=function(e,n,r){let i=null;if("function"==typeof n||Array.isArray(n)?i=n:void 0===r&&n&&(r=n),"string"==typeof r&&(r=r.length),"number"==typeof r){const e=Math.round(r);r=e<1?void 0:e>8?{indent:8}:{indent:e}}if(void 0===e){const{keepUndefined:e}=r??n??{};if(!e)return}return s.isDocument(e)&&!i?e.toString(r):new t.Document(e,i,r).toString(r)},ks}var xs=function(){if(As)return Oe;As=1;var e=es(),t=sr(),n=Xn(),r=ar(),s=Xe(),i=Ne(),o=It(),a=ot(),c=Ut(),u=Yt(),l=ps(),f=ms(),p=vs(),h=ws(),d=Es(),m=Me();return Oe.Composer=e.Composer,Oe.Document=t.Document,Oe.Schema=n.Schema,Oe.YAMLError=r.YAMLError,Oe.YAMLParseError=r.YAMLParseError,Oe.YAMLWarning=r.YAMLWarning,Oe.Alias=s.Alias,Oe.isAlias=i.isAlias,Oe.isCollection=i.isCollection,Oe.isDocument=i.isDocument,Oe.isMap=i.isMap,Oe.isNode=i.isNode,Oe.isPair=i.isPair,Oe.isScalar=i.isScalar,Oe.isSeq=i.isSeq,Oe.Pair=o.Pair,Oe.Scalar=a.Scalar,Oe.YAMLMap=c.YAMLMap,Oe.YAMLSeq=u.YAMLSeq,Oe.CST=l,Oe.Lexer=f.Lexer,Oe.LineCounter=p.LineCounter,Oe.Parser=h.Parser,Oe.parse=d.parse,Oe.parseAllDocuments=d.parseAllDocuments,Oe.parseDocument=d.parseDocument,Oe.stringify=d.stringify,Oe.visit=m.visit,Oe.visitAsync=m.visitAsync,Oe}(),$s=z(xs);function Os(e,t,n){function r(n,r){var s;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(s=n._zod).traits??(s.traits=new Set),n._zod.traits.add(e),t(n,r);for(const e in o.prototype)e in n||Object.defineProperty(n,e,{value:o.prototype[e].bind(n)});n._zod.constr=o,n._zod.def=r}const s=n?.Parent??Object;class i extends s{}function o(e){var t;const s=n?.Parent?new i:this;r(s,e),(t=s._zod).deferred??(t.deferred=[]);for(const e of s._zod.deferred)e();return s}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}class Rs extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Cs extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const Ts={};function Ns(e){return Ts}function Ps(e,t){return"bigint"==typeof t?t.toString():t}function Ls(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Is(e){return null==e}function Ms(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const Ds=Symbol("evaluating");function js(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Ds)return void 0===r&&(r=Ds,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Fs(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Hs(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Bs(e){return JSON.stringify(e)}const zs="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ks(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Us=Ls(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function qs(e){if(!1===Ks(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==Ks(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function Zs(e){return qs(e)?{...e}:Array.isArray(e)?[...e]:e}const Gs=new Set(["string","number","symbol"]);function Ws(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Vs(e,t,n){const r=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(r._zod.parent=e),r}function Ys(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}const Qs={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Js(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function Xs(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function ei(e){return"string"==typeof e?e:e?.message}function ti(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const s=ei(e.inst?._zod.def?.error?.(e))??ei(t?.error?.(e))??ei(n.customError?.(e))??ei(n.localeError?.(e))??"Invalid input";r.message=s}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function ni(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function ri(...e){const[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}const si=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ps,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ii=Os("$ZodError",si),oi=Os("$ZodError",si,{Parent:Error});const ai=e=>(t,n,r,s)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new Rs;if(o.issues.length){const t=new(s?.Err??e)(o.issues.map(e=>ti(e,i,Ns())));throw zs(t,s?.callee),t}return o.value},ci=e=>async(t,n,r,s)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise&&(o=await o),o.issues.length){const t=new(s?.Err??e)(o.issues.map(e=>ti(e,i,Ns())));throw zs(t,s?.callee),t}return o.value},ui=e=>(t,n,r)=>{const s=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new Rs;return i.issues.length?{success:!1,error:new(e??ii)(i.issues.map(e=>ti(e,s,Ns())))}:{success:!0,data:i.value}},li=ui(oi),fi=e=>async(t,n,r)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},s);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(e=>ti(e,s,Ns())))}:{success:!0,data:i.value}},pi=fi(oi),hi=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ai(e)(t,n,s)},di=e=>(t,n,r)=>ai(e)(t,n,r),mi=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ci(e)(t,n,s)},gi=e=>async(t,n,r)=>ci(e)(t,n,r),yi=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ui(e)(t,n,s)},vi=e=>(t,n,r)=>ui(e)(t,n,r),bi=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return fi(e)(t,n,s)},_i=e=>async(t,n,r)=>fi(e)(t,n,r),wi=/^[cC][^\s-]{8,}$/,Si=/^[0-9a-z]+$/,Ai=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ki=/^[0-9a-vA-V]{20}$/,Ei=/^[A-Za-z0-9]{27}$/,xi=/^[a-zA-Z0-9_-]{21}$/,$i=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Oi=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ri=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Ci=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const Ti=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ni=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Pi=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Li=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ii=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Mi=/^[A-Za-z0-9_-]*$/,Di=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,ji=/^\+(?:[0-9]){6,14}[0-9]$/,Fi="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Hi=new RegExp(`^${Fi}$`);function Bi(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const zi=/^-?\d+$/,Ki=/^-?\d+(?:\.\d+)?/,Ui=/^(?:true|false)$/i,qi=/^[^A-Z]*$/,Zi=/^[^a-z]*$/,Gi=Os("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Wi={number:"number",bigint:"bigint",object:"date"},Vi=Os("$ZodCheckLessThan",(e,t)=>{Gi.init(e,t);const n=Wi[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Yi=Os("$ZodCheckGreaterThan",(e,t)=>{Gi.init(e,t);const n=Wi[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Qi=Os("$ZodCheckMultipleOf",(e,t)=>{Gi.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let s=(r.split(".")[1]||"").length;if(0===s&&/\d?e-\d?/.test(r)){const e=r.match(/\d?e-(\d?)/);e?.[1]&&(s=Number.parseInt(e[1]))}const i=n>s?n:s;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/10**i}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Ji=Os("$ZodCheckNumberFormat",(e,t)=>{Gi.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[s,i]=Qs[t.format];e._zod.onattach.push(e=>{const r=e._zod.bag;r.format=t.format,r.minimum=s,r.maximum=i,n&&(r.pattern=zi)}),e._zod.check=o=>{const a=o.value;if(n){if(!Number.isInteger(a))return void o.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?o.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort}):o.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort}))}a<s&&o.issues.push({origin:"number",input:a,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),a>i&&o.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inst:e})}}),Xi=Os("$ZodCheckMaxLength",(e,t)=>{var n;Gi.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Is(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const r=n.value;if(r.length<=t.maximum)return;const s=ni(r);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),eo=Os("$ZodCheckMinLength",(e,t)=>{var n;Gi.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Is(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const r=n.value;if(r.length>=t.minimum)return;const s=ni(r);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),to=Os("$ZodCheckLengthEquals",(e,t)=>{var n;Gi.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Is(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{const r=n.value,s=r.length;if(s===t.length)return;const i=ni(r),o=s>t.length;n.issues.push({origin:i,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),no=Os("$ZodCheckStringFormat",(e,t)=>{var n,r;Gi.init(e,t),e._zod.onattach.push(e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),ro=Os("$ZodCheckRegex",(e,t)=>{no.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),so=Os("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=qi),no.init(e,t)}),io=Os("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Zi),no.init(e,t)}),oo=Os("$ZodCheckIncludes",(e,t)=>{Gi.init(e,t);const n=Ws(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),ao=Os("$ZodCheckStartsWith",(e,t)=>{Gi.init(e,t);const n=new RegExp(`^${Ws(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),co=Os("$ZodCheckEndsWith",(e,t)=>{Gi.init(e,t);const n=new RegExp(`.*${Ws(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),uo=Os("$ZodCheckOverwrite",(e,t)=>{Gi.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class lo{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e);for(const e of r)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}const fo={major:4,minor:1,patch:11},po=Os("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=fo;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const t of r)for(const n of t._zod.onattach)n(e);if(0===r.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,n)=>{let r,s=Js(e);for(const i of t){if(i._zod.def.when){if(!i._zod.def.when(e))continue}else if(s)continue;const t=e.issues.length,o=i._zod.check(e);if(o instanceof Promise&&!1===n?.async)throw new Rs;if(r||o instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await o;e.issues.length!==t&&(s||(s=Js(e,t)))});else{if(e.issues.length===t)continue;s||(s=Js(e,t))}}return r?r.then(()=>e):e},n=(n,s,i)=>{if(Js(n))return n.aborted=!0,n;const o=t(s,r,i);if(o instanceof Promise){if(!1===i.async)throw new Rs;return o.then(t=>e._zod.parse(t,i))}return e._zod.parse(o,i)};e._zod.run=(s,i)=>{if(i.skipChecks)return e._zod.parse(s,i);if("backward"===i.direction){const t=e._zod.parse({value:s.value,issues:[]},{...i,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,s,i)):n(t,s,i)}const o=e._zod.parse(s,i);if(o instanceof Promise){if(!1===i.async)throw new Rs;return o.then(e=>t(e,r,i))}return t(o,r,i)}}e["~standard"]={validate:t=>{try{const n=li(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return pi(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}}),ho=Os("$ZodString",(e,t)=>{var n;po.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=e._zod.bag,new RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(r){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),mo=Os("$ZodStringFormat",(e,t)=>{no.init(e,t),ho.init(e,t)}),go=Os("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Oi),mo.init(e,t)}),yo=Os("$ZodUUID",(e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Ri(e))}else t.pattern??(t.pattern=Ri());mo.init(e,t)}),vo=Os("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Ci),mo.init(e,t)}),bo=Os("$ZodURL",(e,t)=>{mo.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),s=new URL(r);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Di.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=s.href:n.value=r)}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),_o=Os("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),mo.init(e,t)}),wo=Os("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=xi),mo.init(e,t)}),So=Os("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=wi),mo.init(e,t)}),Ao=Os("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Si),mo.init(e,t)}),ko=Os("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Ai),mo.init(e,t)}),Eo=Os("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ki),mo.init(e,t)}),xo=Os("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Ei),mo.init(e,t)}),$o=Os("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=Bi({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${Fi}T(?:${r})$`)}(t)),mo.init(e,t)}),Oo=Os("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Hi),mo.init(e,t)}),Ro=Os("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${Bi(t)}$`)),mo.init(e,t)}),Co=Os("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=$i),mo.init(e,t)}),To=Os("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Ti),mo.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv4"})}),No=Os("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Ni),mo.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv6"}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),Po=Os("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Pi),mo.init(e,t)}),Lo=Os("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Li),mo.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(2!==r.length)throw new Error;const[e,t]=r;if(!t)throw new Error;const n=Number(t);if(`${n}`!==t)throw new Error;if(n<0||n>128)throw new Error;new URL(`http://[${e}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Io(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Mo=Os("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Ii),mo.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{Io(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});const Do=Os("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Mi),mo.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{(function(e){if(!Mi.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return Io(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),jo=Os("$ZodE164",(e,t)=>{t.pattern??(t.pattern=ji),mo.init(e,t)});const Fo=Os("$ZodJWT",(e,t)=>{mo.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[r]=n;if(!r)return!1;const s=JSON.parse(atob(r));return!("typ"in s&&"JWT"!==s?.typ||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Ho=Os("$ZodNumber",(e,t)=>{po.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ki,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const s=n.value;if("number"==typeof s&&!Number.isNaN(s)&&Number.isFinite(s))return n;const i="number"==typeof s?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...i?{received:i}:{}}),n}}),Bo=Os("$ZodNumber",(e,t)=>{Ji.init(e,t),Ho.init(e,t)}),zo=Os("$ZodBoolean",(e,t)=>{po.init(e,t),e._zod.pattern=Ui,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}const s=n.value;return"boolean"==typeof s||n.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),n}}),Ko=Os("$ZodUnknown",(e,t)=>{po.init(e,t),e._zod.parse=e=>e}),Uo=Os("$ZodNever",(e,t)=>{po.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function qo(e,t,n){e.issues.length&&t.issues.push(...Xs(n,e.issues)),t.value[n]=e.value}const Zo=Os("$ZodArray",(e,t)=>{po.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const i=[];for(let e=0;e<s.length;e++){const o=s[e],a=t.element._zod.run({value:o,issues:[]},r);a instanceof Promise?i.push(a.then(t=>qo(t,n,e))):qo(a,n,e)}return i.length?Promise.all(i).then(()=>n):n}});function Go(e,t,n,r){e.issues.length&&t.issues.push(...Xs(n,e.issues)),void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function Wo(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const n=(r=e.shape,Object.keys(r).filter(e=>"optional"===r[e]._zod.optin&&"optional"===r[e]._zod.optout));var r;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Vo(e,t,n,r,s,i){const o=[],a=s.keySet,c=s.catchall._zod,u=c.def.type;for(const s of Object.keys(t)){if(a.has(s))continue;if("never"===u){o.push(s);continue}const i=c.run({value:t[s],issues:[]},r);i instanceof Promise?e.push(i.then(e=>Go(e,n,s,t))):Go(i,n,s,t)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}const Yo=Os("$ZodObject",(e,t)=>{po.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!n?.get){const e=t.shape;Object.defineProperty(t,"shape",{get:()=>{const n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}const r=Ls(()=>Wo(t));js(e._zod,"propValues",()=>{const e=t.shape,n={};for(const t in e){const r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(const e of r.values)n[t].add(e)}}return n});const s=Ks,i=t.catchall;let o;e._zod.parse=(t,n)=>{o??(o=r.value);const a=t.value;if(!s(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const c=[],u=o.shape;for(const e of o.keys){const r=u[e]._zod.run({value:a[e],issues:[]},n);r instanceof Promise?c.push(r.then(n=>Go(n,t,e,a))):Go(r,t,e,a)}return i?Vo(c,a,t,n,r.value,e):c.length?Promise.all(c).then(()=>t):t}}),Qo=Os("$ZodObjectJIT",(e,t)=>{Yo.init(e,t);const n=e._zod.parse,r=Ls(()=>Wo(t));let s;const i=Ks,o=!Ts.jitless,a=o&&Us.value,c=t.catchall;let u;e._zod.parse=(l,f)=>{u??(u=r.value);const p=l.value;return i(p)?o&&a&&!1===f?.async&&!0!==f.jitless?(s||(s=(e=>{const t=new lo(["shape","payload","ctx"]),n=r.value,s=e=>{const t=Bs(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const i=Object.create(null);let o=0;for(const e of n.keys)i[e]="key_"+o++;t.write("const newResult = {};");for(const e of n.keys){const n=i[e],r=Bs(e);t.write(`const ${n} = ${s(e)};`),t.write(`\n if (${n}.issues.length) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${r}, ...iss.path] : [${r}]\n })));\n }\n \n \n if (${n}.value === undefined) {\n if (${r} in input) {\n newResult[${r}] = undefined;\n }\n } else {\n newResult[${r}] = ${n}.value;\n }\n \n `)}t.write("payload.value = newResult;"),t.write("return payload;");const a=t.compile();return(t,n)=>a(e,t,n)})(t.shape)),l=s(l,f),c?Vo([],p,l,f,u,e):l):n(l,f):(l.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),l)}});function Jo(e,t,n,r){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const s=e.filter(e=>!Js(e));return 1===s.length?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ti(e,r,Ns())))}),t)}const Xo=Os("$ZodUnion",(e,t)=>{po.init(e,t),js(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),js(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),js(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),js(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>Ms(e.source)).join("|")})$`)}});const n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=(s,i)=>{if(n)return r(s,i);let o=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:s.value,issues:[]},i);if(t instanceof Promise)a.push(t),o=!0;else{if(0===t.issues.length)return t;a.push(t)}}return o?Promise.all(a).then(t=>Jo(t,s,e,i)):Jo(a,s,e,i)}}),ea=Os("$ZodIntersection",(e,t)=>{po.init(e,t),e._zod.parse=(e,n)=>{const r=e.value,s=t.left._zod.run({value:r,issues:[]},n),i=t.right._zod.run({value:r,issues:[]},n);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([t,n])=>na(e,t,n)):na(e,s,i)}});function ta(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(qs(e)&&qs(t)){const n=Object.keys(t),r=Object.keys(e).filter(e=>-1!==n.indexOf(e)),s={...e,...t};for(const n of r){const r=ta(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};s[n]=r.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const s=ta(e[r],t[r]);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function na(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Js(e))return e;const r=ta(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const ra=Os("$ZodRecord",(e,t)=>{po.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!qs(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const i=[];if(t.keyType._zod.values){const o=t.keyType._zod.values;n.value={};for(const e of o)if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){const o=t.valueType._zod.run({value:s[e],issues:[]},r);o instanceof Promise?i.push(o.then(t=>{t.issues.length&&n.issues.push(...Xs(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...Xs(e,o.issues)),n.value[e]=o.value)}let a;for(const e in s)o.has(e)||(a=a??[],a.push(e));a&&a.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:a})}else{n.value={};for(const o of Reflect.ownKeys(s)){if("__proto__"===o)continue;const a=t.keyType._zod.run({value:o,issues:[]},r);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(a.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(e=>ti(e,r,Ns())),input:o,path:[o],inst:e}),n.value[a.value]=a.value;continue}const c=t.valueType._zod.run({value:s[o],issues:[]},r);c instanceof Promise?i.push(c.then(e=>{e.issues.length&&n.issues.push(...Xs(o,e.issues)),n.value[a.value]=e.value})):(c.issues.length&&n.issues.push(...Xs(o,c.issues)),n.value[a.value]=c.value)}}return i.length?Promise.all(i).then(()=>n):n}}),sa=Os("$ZodEnum",(e,t)=>{po.init(e,t);const n=function(e){const t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t)}(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(e=>Gs.has(typeof e)).map(e=>"string"==typeof e?Ws(e):e.toString()).join("|")})$`),e._zod.parse=(t,s)=>{const i=t.value;return r.has(i)||t.issues.push({code:"invalid_value",values:n,input:i,inst:e}),t}}),ia=Os("$ZodTransform",(e,t)=>{po.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new Cs(e.constructor.name);const s=t.transform(n.value,n);if(r.async){return(s instanceof Promise?s:Promise.resolve(s)).then(e=>(n.value=e,n))}if(s instanceof Promise)throw new Rs;return n.value=s,n}});function oa(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const aa=Os("$ZodOptional",(e,t)=>{po.init(e,t),e._zod.optin="optional",e._zod.optout="optional",js(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),js(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Ms(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>oa(t,e.value)):oa(r,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),ca=Os("$ZodNullable",(e,t)=>{po.init(e,t),js(e._zod,"optin",()=>t.innerType._zod.optin),js(e._zod,"optout",()=>t.innerType._zod.optout),js(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Ms(e.source)}|null)$`):void 0}),js(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),ua=Os("$ZodDefault",(e,t)=>{po.init(e,t),e._zod.optin="optional",js(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>la(e,t)):la(r,t)}});function la(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const fa=Os("$ZodPrefault",(e,t)=>{po.init(e,t),e._zod.optin="optional",js(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),pa=Os("$ZodNonOptional",(e,t)=>{po.init(e,t),js(e._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(t=>ha(t,e)):ha(s,e)}});function ha(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const da=Os("$ZodCatch",(e,t)=>{po.init(e,t),js(e._zod,"optin",()=>t.innerType._zod.optin),js(e._zod,"optout",()=>t.innerType._zod.optout),js(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ti(e,n,Ns()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ti(e,n,Ns()))},input:e.value}),e.issues=[]),e)}}),ma=Os("$ZodPipe",(e,t)=>{po.init(e,t),js(e._zod,"values",()=>t.in._zod.values),js(e._zod,"optin",()=>t.in._zod.optin),js(e._zod,"optout",()=>t.out._zod.optout),js(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){const r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>ga(e,t.in,n)):ga(r,t.in,n)}const r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>ga(e,t.out,n)):ga(r,t.out,n)}});function ga(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const ya=Os("$ZodReadonly",(e,t)=>{po.init(e,t),js(e._zod,"propValues",()=>t.innerType._zod.propValues),js(e._zod,"values",()=>t.innerType._zod.values),js(e._zod,"optin",()=>t.innerType._zod.optin),js(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(va):va(r)}});function va(e){return e.value=Object.freeze(e.value),e}const ba=Os("$ZodCustom",(e,t)=>{Gi.init(e,t),po.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const r=n.value,s=t.fn(r);if(s instanceof Promise)return s.then(t=>_a(t,n,r,e));_a(s,n,r,e)}});function _a(e,t,n,r){if(!e){const e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(ri(e))}}class wa{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const n=t[0];if(this._map.set(e,n),n&&"object"==typeof n&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function Sa(){return new wa}const Aa=Sa();function ka(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ys(t)})}function Ea(e,t){return new Vi({check:"less_than",...Ys(t),value:e,inclusive:!1})}function xa(e,t){return new Vi({check:"less_than",...Ys(t),value:e,inclusive:!0})}function $a(e,t){return new Yi({check:"greater_than",...Ys(t),value:e,inclusive:!1})}function Oa(e,t){return new Yi({check:"greater_than",...Ys(t),value:e,inclusive:!0})}function Ra(e,t){return new Qi({check:"multiple_of",...Ys(t),value:e})}function Ca(e,t){return new Xi({check:"max_length",...Ys(t),maximum:e})}function Ta(e,t){return new eo({check:"min_length",...Ys(t),minimum:e})}function Na(e,t){return new to({check:"length_equals",...Ys(t),length:e})}function Pa(e){return new uo({check:"overwrite",tx:e})}function La(e){const t=function(e,t){const n=new Gi({check:"custom",...Ys(t)});return n._zod.check=e,n}(n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(ri(e,n.value,t._zod.def));else{const r=e;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),n.issues.push(ri(r))}},e(n.value,n)));return t}const Ia=Os("ZodISODateTime",(e,t)=>{$o.init(e,t),cc.init(e,t)});function Ma(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ys(t)})}(Ia,e)}const Da=Os("ZodISODate",(e,t)=>{Oo.init(e,t),cc.init(e,t)});function ja(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Ys(t)})}(Da,e)}const Fa=Os("ZodISOTime",(e,t)=>{Ro.init(e,t),cc.init(e,t)});function Ha(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ys(t)})}(Fa,e)}const Ba=Os("ZodISODuration",(e,t)=>{Co.init(e,t),cc.init(e,t)});function za(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ys(t)})}(Ba,e)}const Ka=(e,t)=>{ii.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t){const n=t||function(e){return e.message},r={_errors:[]},s=e=>{for(const t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map(e=>s({issues:e}));else if("invalid_key"===t.code)s({issues:t.issues});else if("invalid_element"===t.code)s({issues:t.issues});else if(0===t.path.length)r._errors.push(n(t));else{let e=r,s=0;for(;s<t.path.length;){const r=t.path[s];s===t.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(n(t))):e[r]=e[r]||{_errors:[]},e=e[r],s++}}};return s(e),r}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const n={},r=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):r.push(t(s));return{formErrors:r,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Ps,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Ps,2)}},isEmpty:{get:()=>0===e.issues.length}})},Ua=Os("ZodError",Ka),qa=Os("ZodError",Ka,{Parent:Error}),Za=ai(qa),Ga=ci(qa),Wa=ui(qa),Va=fi(qa),Ya=hi(qa),Qa=di(qa),Ja=mi(qa),Xa=gi(qa),ec=yi(qa),tc=vi(qa),nc=bi(qa),rc=_i(qa),sc=Os("ZodType",(e,t)=>(po.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Hs(t,{checks:[...t.checks??[],...n.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]})),e.clone=(t,n)=>Vs(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>Za(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Wa(e,t,n),e.parseAsync=async(t,n)=>Ga(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Va(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Ya(e,t,n),e.decode=(t,n)=>Qa(e,t,n),e.encodeAsync=async(t,n)=>Ja(e,t,n),e.decodeAsync=async(t,n)=>Xa(e,t,n),e.safeEncode=(t,n)=>ec(e,t,n),e.safeDecode=(t,n)=>tc(e,t,n),e.safeEncodeAsync=async(t,n)=>nc(e,t,n),e.safeDecodeAsync=async(t,n)=>rc(e,t,n),e.refine=(t,n)=>e.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Ys(n)})}(iu,e,t)}(t,n)),e.superRefine=t=>e.check(La(t)),e.overwrite=t=>e.check(Pa(t)),e.optional=()=>Vc(e),e.nullable=()=>Qc(e),e.nullish=()=>Vc(Qc(e)),e.nonoptional=t=>function(e,t){return new eu({type:"nonoptional",innerType:e,...Ys(t)})}(e,t),e.array=()=>jc(e),e.or=t=>zc([e,t]),e.and=t=>new Kc({type:"intersection",left:e,right:t}),e.transform=t=>ru(e,new Gc({type:"transform",transform:t})),e.default=t=>{return n=t,new Jc({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():Zs(n)}});var n},e.prefault=t=>{return n=t,new Xc({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():Zs(n)}});var n},e.catch=t=>{return new tu({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>ru(e,t),e.readonly=()=>new su({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return Aa.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>Aa.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Aa.get(e);const n=e.clone();return Aa.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),ic=Os("_ZodString",(e,t)=>{ho.init(e,t),sc.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new ro({check:"string_format",format:"regex",...Ys(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new oo({check:"string_format",format:"includes",...Ys(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new ao({check:"string_format",format:"starts_with",...Ys(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new co({check:"string_format",format:"ends_with",...Ys(t),suffix:e})}(...t)),e.min=(...t)=>e.check(Ta(...t)),e.max=(...t)=>e.check(Ca(...t)),e.length=(...t)=>e.check(Na(...t)),e.nonempty=(...t)=>e.check(Ta(1,...t)),e.lowercase=t=>e.check(function(e){return new so({check:"string_format",format:"lowercase",...Ys(e)})}(t)),e.uppercase=t=>e.check(function(e){return new io({check:"string_format",format:"uppercase",...Ys(e)})}(t)),e.trim=()=>e.check(Pa(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return Pa(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(Pa(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(Pa(e=>e.toUpperCase()))}),oc=Os("ZodString",(e,t)=>{ho.init(e,t),ic.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ys(t)})}(uc,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ys(t)})}(pc,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ys(t)})}($c,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ys(t)})}(hc,t)),e.guid=t=>e.check(ka(lc,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ys(t)})}(fc,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ys(t)})}(fc,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ys(t)})}(fc,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ys(t)})}(fc,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ys(t)})}(dc,t)),e.guid=t=>e.check(ka(lc,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ys(t)})}(mc,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ys(t)})}(gc,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ys(t)})}(yc,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ys(t)})}(kc,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ys(t)})}(Ec,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ys(t)})}(vc,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ys(t)})}(bc,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ys(t)})}(_c,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ys(t)})}(wc,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ys(t)})}(Sc,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ys(t)})}(Ac,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ys(t)})}(xc,t)),e.datetime=t=>e.check(Ma(t)),e.date=t=>e.check(ja(t)),e.time=t=>e.check(Ha(t)),e.duration=t=>e.check(za(t))});function ac(e){return function(e,t){return new e({type:"string",...Ys(t)})}(oc,e)}const cc=Os("ZodStringFormat",(e,t)=>{mo.init(e,t),ic.init(e,t)}),uc=Os("ZodEmail",(e,t)=>{vo.init(e,t),cc.init(e,t)}),lc=Os("ZodGUID",(e,t)=>{go.init(e,t),cc.init(e,t)}),fc=Os("ZodUUID",(e,t)=>{yo.init(e,t),cc.init(e,t)}),pc=Os("ZodURL",(e,t)=>{bo.init(e,t),cc.init(e,t)}),hc=Os("ZodEmoji",(e,t)=>{_o.init(e,t),cc.init(e,t)}),dc=Os("ZodNanoID",(e,t)=>{wo.init(e,t),cc.init(e,t)}),mc=Os("ZodCUID",(e,t)=>{So.init(e,t),cc.init(e,t)}),gc=Os("ZodCUID2",(e,t)=>{Ao.init(e,t),cc.init(e,t)}),yc=Os("ZodULID",(e,t)=>{ko.init(e,t),cc.init(e,t)}),vc=Os("ZodXID",(e,t)=>{Eo.init(e,t),cc.init(e,t)}),bc=Os("ZodKSUID",(e,t)=>{xo.init(e,t),cc.init(e,t)}),_c=Os("ZodIPv4",(e,t)=>{To.init(e,t),cc.init(e,t)}),wc=Os("ZodIPv6",(e,t)=>{No.init(e,t),cc.init(e,t)}),Sc=Os("ZodCIDRv4",(e,t)=>{Po.init(e,t),cc.init(e,t)}),Ac=Os("ZodCIDRv6",(e,t)=>{Lo.init(e,t),cc.init(e,t)}),kc=Os("ZodBase64",(e,t)=>{Mo.init(e,t),cc.init(e,t)}),Ec=Os("ZodBase64URL",(e,t)=>{Do.init(e,t),cc.init(e,t)}),xc=Os("ZodE164",(e,t)=>{jo.init(e,t),cc.init(e,t)}),$c=Os("ZodJWT",(e,t)=>{Fo.init(e,t),cc.init(e,t)}),Oc=Os("ZodNumber",(e,t)=>{Ho.init(e,t),sc.init(e,t),e.gt=(t,n)=>e.check($a(t,n)),e.gte=(t,n)=>e.check(Oa(t,n)),e.min=(t,n)=>e.check(Oa(t,n)),e.lt=(t,n)=>e.check(Ea(t,n)),e.lte=(t,n)=>e.check(xa(t,n)),e.max=(t,n)=>e.check(xa(t,n)),e.int=t=>e.check(Cc(t)),e.safe=t=>e.check(Cc(t)),e.positive=t=>e.check($a(0,t)),e.nonnegative=t=>e.check(Oa(0,t)),e.negative=t=>e.check(Ea(0,t)),e.nonpositive=t=>e.check(xa(0,t)),e.multipleOf=(t,n)=>e.check(Ra(t,n)),e.step=(t,n)=>e.check(Ra(t,n)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});const Rc=Os("ZodNumberFormat",(e,t)=>{Bo.init(e,t),Oc.init(e,t)});function Cc(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ys(t)})}(Rc,e)}const Tc=Os("ZodBoolean",(e,t)=>{zo.init(e,t),sc.init(e,t)});function Nc(e){return function(e,t){return new e({type:"boolean",...Ys(t)})}(Tc,e)}const Pc=Os("ZodUnknown",(e,t)=>{Ko.init(e,t),sc.init(e,t)});function Lc(){return new Pc({type:"unknown"})}const Ic=Os("ZodNever",(e,t)=>{Uo.init(e,t),sc.init(e,t)});function Mc(e){return function(e,t){return new e({type:"never",...Ys(t)})}(Ic,e)}const Dc=Os("ZodArray",(e,t)=>{Zo.init(e,t),sc.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(Ta(t,n)),e.nonempty=t=>e.check(Ta(1,t)),e.max=(t,n)=>e.check(Ca(t,n)),e.length=(t,n)=>e.check(Na(t,n)),e.unwrap=()=>e.element});function jc(e,t){return function(e,t,n){return new e({type:"array",element:t,...Ys(n)})}(Dc,e,t)}const Fc=Os("ZodObject",(e,t)=>{Qo.init(e,t),sc.init(e,t),js(e,"shape",()=>t.shape),e.keyof=()=>function(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new Zc({type:"enum",entries:n,...Ys(t)})}(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Lc()}),e.loose=()=>e.clone({...e._zod.def,catchall:Lc()}),e.strict=()=>e.clone({...e._zod.def,catchall:Mc()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!qs(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const r=Hs(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Fs(this,"shape",n),n},checks:[]});return Vs(e,r)}(e,t),e.safeExtend=t=>function(e,t){if(!qs(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return Fs(this,"shape",n),n},checks:e._zod.def.checks};return Vs(e,n)}(e,t),e.merge=t=>function(e,t){const n=Hs(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Fs(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Vs(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def;return Vs(e,Hs(e._zod.def,{get shape(){const e={};for(const r in t){if(!(r in n.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Fs(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,r=Hs(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Fs(this,"shape",r),r},checks:[]});return Vs(e,r)}(e,t),e.partial=(...t)=>function(e,t,n){const r=Hs(t._zod.def,{get shape(){const r=t._zod.def.shape,s={...r};if(n)for(const t in n){if(!(t in r))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(s[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(const t in r)s[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return Fs(this,"shape",s),s},checks:[]});return Vs(t,r)}(Wc,e,t[0]),e.required=(...t)=>function(e,t,n){const r=Hs(t._zod.def,{get shape(){const r=t._zod.def.shape,s={...r};if(n)for(const t in n){if(!(t in s))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(s[t]=new e({type:"nonoptional",innerType:r[t]}))}else for(const t in r)s[t]=new e({type:"nonoptional",innerType:r[t]});return Fs(this,"shape",s),s},checks:[]});return Vs(t,r)}(eu,e,t[0])});function Hc(e,t){const n={type:"object",shape:e??{},...Ys(t)};return new Fc(n)}const Bc=Os("ZodUnion",(e,t)=>{Xo.init(e,t),sc.init(e,t),e.options=t.options});function zc(e,t){return new Bc({type:"union",options:e,...Ys(t)})}const Kc=Os("ZodIntersection",(e,t)=>{ea.init(e,t),sc.init(e,t)});const Uc=Os("ZodRecord",(e,t)=>{ra.init(e,t),sc.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function qc(e,t,n){return new Uc({type:"record",keyType:e,valueType:t,...Ys(n)})}const Zc=Os("ZodEnum",(e,t)=>{sa.init(e,t),sc.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{const s={};for(const r of e){if(!n.has(r))throw new Error(`Key ${r} not found in enum`);s[r]=t.entries[r]}return new Zc({...t,checks:[],...Ys(r),entries:s})},e.exclude=(e,r)=>{const s={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete s[t]}return new Zc({...t,checks:[],...Ys(r),entries:s})}});const Gc=Os("ZodTransform",(e,t)=>{ia.init(e,t),sc.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new Cs(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(ri(r,n.value,t));else{const t=r;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(ri(t))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(e=>(n.value=e,n)):(n.value=s,n)}});const Wc=Os("ZodOptional",(e,t)=>{aa.init(e,t),sc.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Vc(e){return new Wc({type:"optional",innerType:e})}const Yc=Os("ZodNullable",(e,t)=>{ca.init(e,t),sc.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Qc(e){return new Yc({type:"nullable",innerType:e})}const Jc=Os("ZodDefault",(e,t)=>{ua.init(e,t),sc.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});const Xc=Os("ZodPrefault",(e,t)=>{fa.init(e,t),sc.init(e,t),e.unwrap=()=>e._zod.def.innerType});const eu=Os("ZodNonOptional",(e,t)=>{pa.init(e,t),sc.init(e,t),e.unwrap=()=>e._zod.def.innerType});const tu=Os("ZodCatch",(e,t)=>{da.init(e,t),sc.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});const nu=Os("ZodPipe",(e,t)=>{ma.init(e,t),sc.init(e,t),e.in=t.in,e.out=t.out});function ru(e,t){return new nu({type:"pipe",in:e,out:t})}const su=Os("ZodReadonly",(e,t)=>{ya.init(e,t),sc.init(e,t),e.unwrap=()=>e._zod.def.innerType});const iu=Os("ZodCustom",(e,t)=>{ba.init(e,t),sc.init(e,t)});function ou(e){return function(e,t){return new e({type:"number",coerce:!0,checks:[],...Ys(t)})}(Oc,e)}const au=jc(ac()).default([]).optional(),cu=zc([ac(),jc(ac())]),uu=qc(ac(),cu).optional(),lu=Hc({script:ac().min(1,{message:"script must be a non-empty string"}),warnPattern:ac().min(1,{message:"warnPattern must be a non-empty string"}).optional().refine(e=>"string"!=typeof e||(e=>{try{return new RegExp(e),!0}catch{return!1}})(e),{message:"warnPattern: invalid regular expression"})}).strict(),fu=qc(ac(),zc([ac().min(1),lu])).default({}),pu=zc([Nc(),ac(),function(e,t){return new e({type:"number",checks:[],...Ys(t)})}(Oc,hu)]).transform(e=>{if("boolean"==typeof e)return e;if("number"==typeof e)return 1===e;const t=String(e).trim().toLowerCase();return"1"===t||"true"===t||"0"!==t&&"false"!==t&&void 0}).optional();var hu;const du=Hc({archive:pu,combine:pu,keep:pu,sequential:pu,live:pu,plan:pu,hangWarn:ou().int().positive().optional(),hangKill:ou().int().positive().optional(),hangKillGrace:ou().int().positive().optional(),scripts:zc([Nc(),jc(ac())]).optional()}).strict().optional(),mu=Hc({file:ac().optional()}).strict().optional(),gu=Hc({stash:pu}).strict().optional(),yu=Hc({debug:pu,boring:pu,patch:mu,run:du,snap:gu}).strict().optional(),vu=Hc({stanPath:ac().min(1,{message:"stanPath must be a non-empty string"}),scripts:fu,includes:au,excludes:au,imports:uu,maxUndos:ou().int().positive().optional(),devMode:pu,cliDefaults:yu,patchOpenCommand:ac().optional()}).strict(),bu=e=>e instanceof Ua?e.issues.map(e=>{const t=e.path.join(".")||"(root)";let n=e.message;return"stanPath"===t&&/Expected string/i.test(n)&&(n="stanPath must be a non-empty string"),"scripts"===t&&/expected\s+(record|object)/i.test(n)&&(n="scripts must be an object"),`${t}: ${n}`}).join("\n"):String(e),_u=e=>{if(!e||"object"!=typeof e)return;const t=e,n={};for(const e of Object.keys(t)){const r=t[e];if("string"==typeof r){const t=r.trim();t&&(n[e]=[t])}else if(Array.isArray(r)){const t=r.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0);t.length&&(n[e]=t)}}return Object.keys(n).length?n:void 0},wu=e=>{if(["archive","init"].filter(t=>Object.prototype.hasOwnProperty.call(e??{},t)).length>0)throw new Error('scripts: keys "archive" and "init" not allowed')},Su=e=>{const t=xe(e);if(!t)throw new Error("stan config not found");const r=n(t,"utf8"),s=t.endsWith(".json")?JSON.parse(r):$s.parse(r);try{const e=vu.parse(s);wu(e.scripts??{});const t=_u(e.imports);return{stanPath:e.stanPath,scripts:e.scripts,includes:e.includes??[],excludes:e.excludes??[],imports:t,maxUndos:e.maxUndos,devMode:e.devMode,patchOpenCommand:e.patchOpenCommand??we,cliDefaults:e.cliDefaults}}catch(e){throw new Error(bu(e))}},Au=async e=>{const t=xe(e);if(!t)throw new Error("stan config not found");return(async e=>{const t=await i(e,"utf8"),n=e.endsWith(".json")?JSON.parse(t):$s.parse(t);let r;try{r=vu.parse(n)}catch(e){throw new Error(bu(e))}wu(r.scripts??{});const s=_u(r.imports);return{stanPath:r.stanPath,scripts:r.scripts,includes:r.includes??[],excludes:r.excludes??[],imports:s,maxUndos:r.maxUndos,devMode:r.devMode,patchOpenCommand:r.patchOpenCommand??we,cliDefaults:r.cliDefaults}})(t)},ku=e=>{try{return Su(e).stanPath}catch{return _e}},Eu=async e=>{try{return(await Au(e)).stanPath}catch{return _e}},xu=async(e,n,s=!1)=>{const i=pe(e,n);if(await ye(e,n),!s){const e=h(i.outputAbs,N);if(t(e))try{await c(e,h(i.diffAbs,P))}catch{}const n=await a(i.outputAbs,{withFileTypes:!0});for(const e of n)r(h(i.outputAbs,e.name),{recursive:!0,force:!0})}return i.rootAbs},$u=async(e,t)=>{const n={};for(const r of t){const t=h(e,r),s=await i(t),o=k("sha256").update(s).digest("hex");n[r]=o}return n},Ou=e=>d(e,".archive.snapshot.json"),Ru=async({cwd:e,stanPath:t,includes:n,excludes:r})=>{const{diffDir:s}=await ve(e,t),i=await he(e),o=await ge(i,{cwd:e,stanPath:t,includeOutputDir:!1,includes:n??[],excludes:r??[]}),a=await $u(e,o),c=Ou(s);return await u(c,JSON.stringify(a,null,2),"utf8"),c},Cu=async({cwd:e,stanPath:n,baseName:r,includes:s,excludes:o,updateSnapshot:a="createIfMissing",includeOutputDirInDiff:c=!1,onArchiveWarnings:l})=>{const{outDir:f,diffDir:p}=await ve(e,n),h=await he(e),m=await ge(h,{cwd:e,stanPath:n,includeOutputDir:!1,includes:s??[],excludes:o??[]}),g=await $u(e,m),y=Ou(p),v=t(y),b=v?JSON.parse(await i(y,"utf8")):{},_=v?m.filter(e=>!b[e]||b[e]!==g[e]):[...m],{textFiles:w,warningsBody:S}=await H(e,_),A=w,k=(S??"").trim();k&&"No archive warnings."!==k&&l?.(k);const E=d(f,`${r}.diff.tar`),x=await import("./index-ucZa1KMb.js");if(c){const t=Array.from(new Set([...A,`${n.replace(/\\/g,"/")}/output`]));await x.create({file:E,cwd:e,filter:j(n)},t)}else if(0===A.length){const t=(e=>d(e,".stan_no_changes"))(p);await u(t,"no changes","utf8");const r=[`${n.replace(/\\/g,"/")}/diff/.stan_no_changes`];await x.create({file:E,cwd:e},r)}else{const t=Array.from(new Set([...A]));await x.create({file:E,cwd:e},t)}return"replace"===a?await u(y,JSON.stringify(g,null,2),"utf8"):"createIfMissing"!==a||v||await u(y,JSON.stringify(g,null,2),"utf8"),{diffPath:E}},Tu=e=>e.replace(/\\/g,"/"),Nu=/^###\s+Patch:\s+(.+?)\s*$/m,Pu=/^###\s+Full Listing:\s+(.+?)\s*$/m,Lu=/^##\s+Commit Message\s*$/m,Iu=/^##\s+.*$|^###\s+.*$/m,Mu=/^###\s+File Ops\s*$/m,Du=e=>/^[/\\]/.test(e),ju=e=>(Tu(e)||"").split("/").filter(Boolean).join("/").replace(/\/+$/,""),Fu=e=>{const t=[],n=[];{const t=new RegExp(Iu.source,"gm");let r;for(;r=t.exec(e);)n.push(r.index)}n.push(e.length);for(let r=0;r<n.length-1;r+=1){const s=n[r],i=n[r+1],o=e.slice(s,i);if(Lu.test(o)){t.push({kind:"commit",start:s,body:o});continue}const a=o.match(Nu);if(a&&a[1]){t.push({kind:"patch",path:Tu(a[1].trim()),start:s,body:o});continue}const c=o.match(Pu);c&&c[1]&&t.push({kind:"full",path:Tu(c[1].trim()),start:s,body:o})}return t},Hu=e=>{const t=/^diff --git a\/(.+?) b\/(.+?)\s*$/gm,n=[];let r;for(;r=t.exec(e);)n.push({a:Tu(r[1]??""),b:Tu(r[2]??"")});return n},Bu=(e,t)=>{const n=(e=>{const t=Mu.exec(e);if(!t)return null;const n=(t.index??0)+t[0].length,r=e.slice(n).split(/\r?\n/);let s=0;for(;s<r.length&&""===r[s].trim();)s+=1;const i=[];for(;s<r.length;s+=1){const e=r[s];if(/^#{2,3}\s+/.test(e))break;i.push(e)}const o=i.join("\n").trimEnd();return o.length?o:null})(e);if(!n)return;const r=n.split(/\r?\n/);for(let e=0;e<r.length;e+=1){const n=r[e].trim();if(!n)continue;const s=n.split(/\s+/),i=s[0],o=s.slice(1),a=`File Ops line ${(e+1).toString()}`,c=e=>t.push(`${a}: ${e}`),u=e=>{if(!e||!e.trim())return null;const t=Tu(e.trim());if(Du(t))return null;const n=ju(t);return n?n.split("/").some(e=>".."===e)?null:n:null};if(!/^(mv|rm|rmdir|mkdirp)$/.test(i)){c(`unknown verb "${i}"`);continue}if("mv"===i){if(2!==o.length){c(`expected 2 paths, got ${o.length.toString()}`);continue}const e=u(o[0]),t=u(o[1]);e&&t||c("mv: invalid repo-relative path");continue}if(1!==o.length){c(`expected 1 path, got ${o.length.toString()}`);continue}u(o[0])||c(`${i}: invalid repo-relative path`)}},zu=e=>{const t=[];Bu(e,t);const n=Fu(e),r=n.filter(e=>"patch"===e.kind),s=n.filter(e=>"full"===e.kind),i=n.filter(e=>"commit"===e.kind);0===r.length&&t.push("No Patch blocks found");{const e=new Map;for(const n of r){const r=n.path??"(unknown)",s=e.get(r)??[];s.push(n),e.set(r,s);const i=Hu(n.body);0===i.length?t.push(`Patch for ${r} has no "diff --git a/<path> b/<path>" header; emit a plain unified diff with git-style headers (wrappers like "*** Begin Patch" are not allowed)`):1!==i.length&&t.push(`Patch for ${r} contains multiple "diff --git" headers (found ${i.length.toString()}; expected 1)`);const o=/(^|\n)\*{3,}\s*(Begin|End)\s+Patch\b|(^|\n)Index:\s|(^|\n)\*{3,}\s*Add\s+File:/i;try{o.test(n.body)&&t.push(`Patch for ${r} contains a forbidden wrapper ("*** Begin Patch", "*** Add File:", or "Index:"). Use plain unified diff only.`)}catch{}}for(const[n,r]of e.entries())r.length>1&&t.push(`Multiple Patch blocks found for ${n} (${r.length.toString()})`)}{const e=new Map;for(const t of s){const n=Tu(t.path??"(unknown)");e.set(n,t)}for(const n of r){const r=Tu(n.path??"(unknown)"),s=e.get(r);!s||n.start<s.start||t.push(`Ordering violation for ${r}: Full Listing appears before Patch`)}}if(0===i.length)t.push('Missing "## Commit Message" section');else{const e=n[n.length-1];e&&"commit"===e.kind||t.push("Commit Message is not last")}if(r.length>0){const e=[];for(const t of r){const n=Hu(t.body);if(n.length>0){const t=Tu(n[0].b??"");t&&e.push(t)}else{const n=Tu(t.path??"");n&&e.push(n)}}const n=e=>".stan/system/stan.todo.md"===Tu(e),s=e=>{const t=Tu(e);if(!t)return!1;const n=(t.split("/").pop()??t).toLowerCase();return"readme.md"===n||"changelog.md"===n||"contributing.md"===n||"license"===n||"license.md"===n||(t.startsWith("docs/")||t.startsWith("docs-src/")||t.startsWith("diagrams/"))},i=e.filter(e=>!n(e));if(!(i.length>0&&i.every(e=>s(e)))){e.some(e=>n(e))||t.push('Doc cadence violation: Patch present but no Patch for ".stan/system/stan.todo.md"')}}return{ok:0===t.length,errors:t,warnings:[]}},Ku=e=>{const t=zu(e);if(!t.ok){const e="Response-format validation failed:\n"+t.errors.map(e=>`- ${e}`).join("\n");throw new Error(e)}},Uu={extractBlocks:Fu,parseDiffHeaders:Hu,isCommitLast:e=>{if(!e.match(Lu))return!1;const t=e.search(Lu);if(t<0)return!1;const n=e.slice(t),r=n.match(/^`{3,}/m);if(!r)return!1;const s=(r[0].match(/`/g)??[]).length,i=new RegExp(`^\\\`{${s}{'}'}\\s*$`,"m");if(!n.match(i))return!1;const o=n.search(i);if(o<0)return!1;return 0===n.slice(o+s).trim().length}},qu=/[\u200B-\u200D\uFEFF]/g,Zu=e=>{const t=e.replace(qu,"").replace(/\r\n/g,"\n").replace(/\r/g,"\n");return t.endsWith("\n")?t:t+"\n"},Gu=e=>e.endsWith("\n")?e:e+"\n",Wu=e=>!!/^diff --git /m.test(e)||(!(!/^---\s+(?:a\/|\S)/m.test(e)||!/^\+\+\+\s+(?:b\/|\S)/m.test(e))||!!/^@@\s+-\d+(?:,\d+)?\s+\+\d+(?:,\d+)?\s+@@/m.test(e)),Vu=e=>{const t=(e=>{const t=e.split(/\r?\n/);let n=0;for(;n<t.length&&""===t[n].trim();)n+=1;let r=t.length-1;for(;r>=0&&""===t[r].trim();)r-=1;if(n>r)return e;const s=t[n].trim(),i=t[r].trim(),o=e=>/^```/.test(e),a=e=>{const s=t.slice(n+1,r);return[...t.slice(0,n),...s,...t.slice(r+1)].join("\n")};return o(s)&&o(i)||/^BEGIN[_ -]?PATCH/i.test(s)&&(c=i,/^END[_ -]?PATCH/i.test(c))||(e=>/^\*{3,}\s*BEGIN\s+PATCH/i.test(e)||/^\*{3,}\s*Begin\s+Patch/i.test(e))(s)&&(e=>/^\*{3,}\s*END\s+PATCH/i.test(e)||/^\*{3,}\s*End\s+Patch/i.test(e))(i)?a():e;var c})(Zu(e.trim())),n=Zu(t),r=(e=>{const t=e.split("\n");for(let e=0;e<t.length;e+=1){const n=t[e];if(!n.match(/^`{3,}.*$/))continue;const r=(n.match(/^`+/)??[""])[0].length;for(let n=e+1;n<t.length;n+=1)if(new RegExp(`^\\\`{${r}{'}'}\\s*$`).test(t[n])){const r=t.slice(e+1,n).join("\n");if(Wu(r))return r;e=n;break}}return null})(n);if(r)return Gu(Zu(r).trimEnd());const s=(e=>{let t=e.search(/^diff --git /m);return t<0&&(t=e.search(/^---\s+(?:a\/|\S)/m)),t<0?null:e.slice(t).replace(/\n`{3,}\s*$/m,"\n")})(n);return Gu(s?Zu(s).trimEnd():n)},Yu=e=>/^[/\\]/.test(e),Qu=e=>{const t=p.posix.normalize((e=>e.replace(/\\/g,"/").replace(/^\.\/+/,""))(e));return"/"===t?t:t.replace(/\/+$/,"")},Ju=e=>{const t=[],n=[],r=(e=>{const t=/^###\s+File Ops\s*$/m.exec(e);if(!t)return null;const n=(t.index??0)+t[0].length,r=e.slice(n).split(/\r?\n/);let s=0;for(;s<r.length&&""===r[s].trim();)s+=1;const i=[];for(;s<r.length;s+=1){const e=r[s];if(/^#{2,3}\s+/.test(e))break;i.push(e)}return{body:i.join("\n").trimEnd()}})(e);if(!r)return{ops:t,errors:n};const s=r.body.split(/\r?\n/);let i=0;for(const e of s){i+=1;const r=e.trim();if(!r)continue;const s=r.split(/\s+/),o=s[0],a=s.slice(1),c=e=>{n.push(`file-ops line ${i.toString()}: ${e}`)},u=e=>{e||c(`expected 1 path, got ${a.length.toString()}`)},l=e=>{e||c(`expected 2 paths, got ${a.length.toString()}`)},f=e=>{if(!e||!e.trim())return null;const t=Qu(e);return!t||Yu(t)||t.split("/").some(e=>".."===e)?null:t};switch(o){case"mv":if(l(2===a.length),2===a.length){const e=f(a[0]),n=f(a[1]);e&&n?t.push({verb:"mv",src:e,dest:n}):c("mv: invalid repo-relative path")}break;case"rm":if(u(1===a.length),1===a.length){const e=f(a[0]);e?t.push({verb:"rm",src:e}):c("rm: invalid repo-relative path")}break;case"rmdir":if(u(1===a.length),1===a.length){const e=f(a[0]);e?t.push({verb:"rmdir",src:e}):c("rmdir: invalid repo-relative path")}break;case"mkdirp":if(u(1===a.length),1===a.length){const e=f(a[0]);e?t.push({verb:"mkdirp",src:e}):c("mkdirp: invalid repo-relative path")}break;default:c(`unknown verb "${o}"`)}}return{ops:t,errors:n}},Xu=async(e,t,n=!1)=>{const r=[],i=t=>((e,t)=>{const n=p.resolve(e,t),r=p.resolve(e)+p.sep,s=n===p.resolve(e)||n.startsWith(r);return{abs:n,ok:s}})(e,t);for(const e of t){const t={verb:e.verb,src:e.src,dest:e.dest,status:"ok"};try{if("mv"===e.verb){const{abs:t,ok:r}=i(e.src),{abs:s,ok:o}=i(e.dest);if(!r||!o)throw new Error("path escapes repo root");const a=await y(t),c=await y(s);if(!a)throw new Error("source does not exist");if(c)throw new Error("destination exists (no overwrite)");n||(await g(p.dirname(s)),await v(t,s,{overwrite:!1}))}else if("rm"===e.verb){const{abs:t,ok:r}=i(e.src);if(!r)throw new Error("path escapes repo root");if(!await y(t))throw new Error("path does not exist");n||await b(t)}else if("rmdir"===e.verb){const{abs:t,ok:r}=i(e.src);if(!r)throw new Error("path escapes repo root");let o=null;try{o=await s(t)}catch{o=null}if(!o)throw new Error("directory does not exist");if(!o.isDirectory())throw new Error("not a directory");if((await a(t)).length>0)throw new Error("directory not empty");n||await b(t)}else if("mkdirp"===e.verb){const{abs:t,ok:r}=i(e.src);if(!r)throw new Error("path escapes repo root");n||await g(t)}t.status="ok"}catch(e){t.status="failed";const n=e instanceof Error?e.message:String(e);t.message=n}if(r.push(t),"failed"===t.status&&!n)break}return{ok:r.every(e=>"ok"===e.status),results:r}};function el(e){return Array.isArray(e)?e.map(e=>el(e)):Object.assign(Object.assign({},e),{hunks:e.hunks.map(e=>Object.assign(Object.assign({},e),{lines:e.lines.map((t,n)=>{var r;return t.startsWith("\\")||t.endsWith("\r")||(null===(r=e.lines[n+1])||void 0===r?void 0:r.startsWith("\\"))?t:t+"\r"})}))})}function tl(e){return Array.isArray(e)?e.map(e=>tl(e)):Object.assign(Object.assign({},e),{hunks:e.hunks.map(e=>Object.assign(Object.assign({},e),{lines:e.lines.map(e=>e.endsWith("\r")?e.substring(0,e.length-1):e)}))})}function nl(e){const t=e.split(/\n/),n=[];let r=0;function s(){const e={};for(n.push(e);r<t.length;){const n=t[r];if(/^(---|\+\+\+|@@)\s/.test(n))break;const s=/^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(n);s&&(e.index=s[1]),r++}for(i(e),i(e),e.hunks=[];r<t.length;){const n=t[r];if(/^(Index:\s|diff\s|---\s|\+\+\+\s|===================================================================)/.test(n))break;if(/^@@/.test(n))e.hunks.push(o());else{if(n)throw new Error("Unknown line "+(r+1)+" "+JSON.stringify(n));r++}}}function i(e){const n=/^(---|\+\+\+)\s+(.*)\r?$/.exec(t[r]);if(n){const t=n[2].split("\t",2),s=(t[1]||"").trim();let i=t[0].replace(/\\\\/g,"\\");/^".*"$/.test(i)&&(i=i.substr(1,i.length-2)),"---"===n[1]?(e.oldFileName=i,e.oldHeader=s):(e.newFileName=i,e.newHeader=s),r++}}function o(){var e;const n=r,s=t[r++].split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),i={oldStart:+s[1],oldLines:void 0===s[2]?1:+s[2],newStart:+s[3],newLines:void 0===s[4]?1:+s[4],lines:[]};0===i.oldLines&&(i.oldStart+=1),0===i.newLines&&(i.newStart+=1);let o=0,a=0;for(;r<t.length&&(a<i.oldLines||o<i.newLines||(null===(e=t[r])||void 0===e?void 0:e.startsWith("\\")));r++){const e=0==t[r].length&&r!=t.length-1?" ":t[r][0];if("+"!==e&&"-"!==e&&" "!==e&&"\\"!==e)throw new Error(`Hunk at line ${n+1} contained invalid line ${t[r]}`);i.lines.push(t[r]),"+"===e?o++:"-"===e?a++:" "===e&&(o++,a++)}if(o||1!==i.newLines||(i.newLines=0),a||1!==i.oldLines||(i.oldLines=0),o!==i.newLines)throw new Error("Added line count did not match for hunk at line "+(n+1));if(a!==i.oldLines)throw new Error("Removed line count did not match for hunk at line "+(n+1));return i}for(;r<t.length;)s();return n}function rl(e,t,n){let r=!0,s=!1,i=!1,o=1;return function a(){if(r&&!i){if(s?o++:r=!1,e+o<=n)return e+o;i=!0}if(!s)return i||(r=!0),t<=e-o?e-o++:(s=!0,a())}}function sl(e,t,n={}){let r;if(r="string"==typeof t?nl(t):Array.isArray(t)?t:[t],r.length>1)throw new Error("applyPatch only works with a single input.");return function(e,t,n={}){(n.autoConvertLineEndings||null==n.autoConvertLineEndings)&&(function(e){return e.includes("\r\n")&&!e.startsWith("\n")&&!e.match(/[^\r]\n/)}(e)&&function(e){return Array.isArray(e)||(e=[e]),!e.some(e=>e.hunks.some(e=>e.lines.some(e=>!e.startsWith("\\")&&e.endsWith("\r"))))}(t)?t=el(t):function(e){return!e.includes("\r\n")&&e.includes("\n")}(e)&&function(e){return Array.isArray(e)||(e=[e]),e.some(e=>e.hunks.some(e=>e.lines.some(e=>e.endsWith("\r"))))&&e.every(e=>e.hunks.every(e=>e.lines.every((t,n)=>{var r;return t.startsWith("\\")||t.endsWith("\r")||(null===(r=e.lines[n+1])||void 0===r?void 0:r.startsWith("\\"))})))}(t)&&(t=tl(t)));const r=e.split("\n"),s=t.hunks,i=n.compareLine||((e,t,n,r)=>t===r),o=n.fuzzFactor||0;let a=0;if(o<0||!Number.isInteger(o))throw new Error("fuzzFactor must be a non-negative integer");if(!s.length)return e;let c="",u=!1,l=!1;for(let e=0;e<s[s.length-1].lines.length;e++){const t=s[s.length-1].lines[e];"\\"==t[0]&&("+"==c[0]?u=!0:"-"==c[0]&&(l=!0)),c=t}if(u){if(l){if(!o&&""==r[r.length-1])return!1}else if(""==r[r.length-1])r.pop();else if(!o)return!1}else if(l)if(""!=r[r.length-1])r.push("");else if(!o)return!1;function f(e,t,n,s=0,o=!0,a=[],c=0){let u=0,l=!1;for(;s<e.length;s++){const p=e[s],h=p.length>0?p[0]:" ",d=p.length>0?p.substr(1):p;if("-"===h){if(!i(t+1,r[t],h,d))return n&&null!=r[t]?(a[c]=r[t],f(e,t+1,n-1,s,!1,a,c+1)):null;t++,u=0}if("+"===h){if(!o)return null;a[c]=d,c++,u=0,l=!0}if(" "===h){if(u++,a[c]=r[t],!i(t+1,r[t],h,d))return l||!n?null:r[t]&&(f(e,t+1,n-1,s+1,!1,a,c+1)||f(e,t+1,n-1,s,!1,a,c+1))||f(e,t,n-1,s+1,!1,a,c);c++,o=!0,l=!1,t++}}return c-=u,t-=u,a.length=c,{patchedLines:a,oldLineLastI:t-1}}const p=[];let h=0;for(let e=0;e<s.length;e++){const t=s[e];let n;const i=r.length-t.oldLines+o;let c;for(let e=0;e<=o;e++){c=t.oldStart+h-1;const r=rl(c,a,i);for(;void 0!==c&&(n=f(t.lines,c,e),!n);c=r());if(n)break}if(!n)return!1;for(let e=a;e<c;e++)p.push(r[e]);for(let e=0;e<n.patchedLines.length;e++){const t=n.patchedLines[e];p.push(t)}a=n.oldLineLastI+1,h=c+1-t.oldStart}for(let e=a;e<r.length;e++)p.push(r[e]);return p.join("\n")}(e,r[0],n)}const il=e=>{if(!e)return null;const t=e.replace(/^a\//,"").replace(/^b\//,"").trim();return t.length?t:null},ol=e=>"string"==typeof e&&"/dev/null"===e.trim(),al=e=>e.replace(/\r/g,"").replace(/[ \t]+$/g,""),cl=e=>e.replace(/\n/g,"\r\n"),ul=async e=>{const{cwd:t,cleaned:n,check:r,sandboxRoot:s}=e;let o;try{o=nl(n)}catch{return{okFiles:[],failed:[{path:"(patch)",reason:"invalid unified diff"}],sandboxRoot:s}}const a=o.some(e=>{const t=il(e.oldFileName),n=il(e.newFileName);return Boolean(t&&t.length||n&&n.length)});if(!o.length||!a)return{okFiles:[],failed:[{path:"(patch)",reason:"invalid unified diff"}],sandboxRoot:s};const c=[],f=[];for(const e of o){const n=il(e.newFileName)??il(e.oldFileName);if(!n){f.push({path:"(unknown)",reason:"no file name in patch header"});continue}const o=n.replace(/^[./]+/,""),a=p.resolve(t,o),h=/\.md$/i.test(o);let d="",m=!1,g=!0;try{const e=await i(a,"utf8");d=e,m=/\r\n/.test(e)}catch{g=!1}const y=ol(e.oldFileName);if(!g&&!y){f.push({path:o,reason:"target file not found"});continue}let v;!g&&y&&(d="",m=!1);try{v=sl(d,e,{compareLine:(e,t,n,r)=>al(t)===al(r),fuzzFactor:h?1:0})}catch{f.push({path:o,reason:"unable to parse or place hunk(s)"});continue}if(!1===v||"string"!=typeof v){f.push({path:o,reason:"unable to place hunk(s)"});continue}const b=m?cl(v.replace(/\r/g,"")):v.replace(/\r/g,"");try{if(r){const e=s??p.join(t,".stan","patch",".sandbox"),n=p.resolve(e,o);await l(p.dirname(n),{recursive:!0}),await u(n,b,"utf8")}else{try{await l(p.dirname(a),{recursive:!0})}catch{}await u(a,b,"utf8")}c.push(o)}catch{f.push({path:o,reason:"write failed"})}}return{okFiles:c,failed:f,sandboxRoot:s}},ll=async e=>{const{cwd:t,patchAbs:n,cleaned:r,check:s,stripOrder:i=[1,0]}=e,o=i.flatMap(e=>((e,t)=>{const n=e?["--check"]:[];return[{args:[...n,"--3way","--whitespace=nowarn","--recount","--inaccurate-eof",`-p${t.toString()}`],strip:t,label:`3way+nowarn-p${t.toString()}`},{args:[...n,"--3way","--ignore-whitespace","--recount","--inaccurate-eof",`-p${t.toString()}`],strip:t,label:`3way+ignore-p${t.toString()}`},{args:[...n,"--whitespace=nowarn","--recount","--inaccurate-eof",`-p${t.toString()}`],strip:t,label:`2way+nowarn-p${t.toString()}`},{args:[...n,"--ignore-whitespace","--recount","--inaccurate-eof",`-p${t.toString()}`],strip:t,label:`2way+ignore-p${t.toString()}`}]})(s,e)),a=await(async(e,t,n,r="1"===process.env.STAN_DEBUG)=>{const s=[],i=[];for(const o of n){s.push(o.label);const n=await new Promise(n=>{const s=E("git",["apply",...o.args,t],{cwd:e,shell:!1,windowsHide:!0});let a="",c="";const u=s;u.stderr?.on("data",e=>{const t=e.toString("utf8");c+=t,r&&process.stderr.write(t)}),u.stdout?.on("data",e=>{const t=e.toString("utf8");a+=t,r&&process.stdout.write(t)}),s.on("close",e=>{i.push({label:o.label,code:e??0,stdout:a,stderr:c}),n(e??0)})});if(0===n)return{ok:!0,tried:s,lastCode:0,captures:i};r&&console.error(`stan: git apply failed for ${o.label} (exit ${n})`)}return{ok:!1,tried:s,lastCode:1,captures:i}})(t,n,o);if(a.ok)return{ok:!0,result:a,js:null};const c=await ul({cwd:t,cleaned:r,check:s});if(c.okFiles.length>0&&0===c.failed.length)return{ok:!0,result:a,js:c};try{const e=await(async(e,t,n)=>{const r=t.replace(/\r\n/g,"\n").split("\n");let s=-1,i=null;for(let e=0;e<r.length-1;e+=1)if(/^---\s+\/dev\/null\s*$/.test(r[e])){const t=r[e+1].match(/^\+\+\+\s+b\/(.+)\s*$/);if(t&&t[1]){s=e+1,i=String(t[1]).trim().replace(/^[./]+/,"");break}}if(!i||!i.length)return null;const o=r.slice(s+1).join("\n");if(/^---\s+\/dev\/null/m.test(o))return null;const a=[];let c=!1;for(let e=s+1;e<r.length;e+=1){const t=r[e];if(/^diff --git /.test(t))break;if(/^@@ /.test(t))c=!0;else if(c&&/^[ +-]/.test(t)){const e=t[0];"+"!==e&&" "!==e||a.push(t.slice(1))}}let f=a.join("\n");f.endsWith("\n")||(f+="\n");const h=n?p.join(e,".stan","patch",".sandbox","F"):e,d=p.resolve(h,i);return await l(p.dirname(d),{recursive:!0}),await u(d,f,"utf8"),{okFiles:[i],failed:[],sandboxRoot:n?h:void 0}})(t,r,s);if(e)return{ok:!0,result:a,js:e}}catch{}return{ok:!1,result:a,js:c}};var fl,pl={},hl={},dl={};function ml(){if(fl)return dl;return fl=1,Object.defineProperty(dl,"__esModule",{value:!0}),dl.splitWhen=dl.flatten=void 0,dl.flatten=function(e){return e.reduce((e,t)=>[].concat(e,t),[])},dl.splitWhen=function(e,t){const n=[[]];let r=0;for(const s of e)t(s)?(r++,n[r]=[]):n[r].push(s);return n},dl}var gl,yl={};function vl(){if(gl)return yl;return gl=1,Object.defineProperty(yl,"__esModule",{value:!0}),yl.isEnoentCodeError=void 0,yl.isEnoentCodeError=function(e){return"ENOENT"===e.code},yl}var bl,_l={};var wl,Sl={};function Al(){if(wl)return Sl;wl=1,Object.defineProperty(Sl,"__esModule",{value:!0}),Sl.convertPosixPathToPattern=Sl.convertWindowsPathToPattern=Sl.convertPathToPattern=Sl.escapePosixPath=Sl.escapeWindowsPath=Sl.escape=Sl.removeLeadingDotSegment=Sl.makeAbsolute=Sl.unixify=void 0;const e=$,t="win32"===x.platform(),n=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,r=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,s=/^\\\\([.?])/,i=/\\(?![!()+@[\]{}])/g;function o(e){return e.replace(r,"\\$2")}function a(e){return e.replace(n,"\\$2")}function c(e){return o(e).replace(s,"//$1").replace(i,"/")}function u(e){return a(e)}return Sl.unixify=function(e){return e.replace(/\\/g,"/")},Sl.makeAbsolute=function(t,n){return e.resolve(t,n)},Sl.removeLeadingDotSegment=function(e){if("."===e.charAt(0)){const t=e.charAt(1);if("/"===t||"\\"===t)return e.slice(2)}return e},Sl.escape=t?o:a,Sl.escapeWindowsPath=o,Sl.escapePosixPath=a,Sl.convertPathToPattern=t?c:u,Sl.convertWindowsPathToPattern=c,Sl.convertPosixPathToPattern=u,Sl}var kl,El,xl,$l,Ol,Rl,Cl={};function Tl(){return El?kl:(El=1,kl=function(e){if("string"!=typeof e||""===e)return!1;for(var t;t=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(t[2])return!0;e=e.slice(t.index+t[0].length)}return!1})}function Nl(){if($l)return xl;$l=1;var e=Tl(),t={"{":"}","(":")","[":"]"},n=function(e){if("!"===e[0])return!0;for(var n=0,r=-2,s=-2,i=-2,o=-2,a=-2;n<e.length;){if("*"===e[n])return!0;if("?"===e[n+1]&&/[\].+)]/.test(e[n]))return!0;if(-1!==s&&"["===e[n]&&"]"!==e[n+1]&&(s<n&&(s=e.indexOf("]",n)),s>n)){if(-1===a||a>s)return!0;if(-1===(a=e.indexOf("\\",n))||a>s)return!0}if(-1!==i&&"{"===e[n]&&"}"!==e[n+1]&&(i=e.indexOf("}",n))>n&&(-1===(a=e.indexOf("\\",n))||a>i))return!0;if(-1!==o&&"("===e[n]&&"?"===e[n+1]&&/[:!=]/.test(e[n+2])&&")"!==e[n+3]&&(o=e.indexOf(")",n))>n&&(-1===(a=e.indexOf("\\",n))||a>o))return!0;if(-1!==r&&"("===e[n]&&"|"!==e[n+1]&&(r<n&&(r=e.indexOf("|",n)),-1!==r&&")"!==e[r+1]&&(o=e.indexOf(")",r))>r&&(-1===(a=e.indexOf("\\",r))||a>o)))return!0;if("\\"===e[n]){var c=e[n+1];n+=2;var u=t[c];if(u){var l=e.indexOf(u,n);-1!==l&&(n=l+1)}if("!"===e[n])return!0}else n++}return!1},r=function(e){if("!"===e[0])return!0;for(var n=0;n<e.length;){if(/[*?{}()[\]]/.test(e[n]))return!0;if("\\"===e[n]){var r=e[n+1];n+=2;var s=t[r];if(s){var i=e.indexOf(s,n);-1!==i&&(n=i+1)}if("!"===e[n])return!0}else n++}return!1};return xl=function(t,s){if("string"!=typeof t||""===t)return!1;if(e(t))return!0;var i=n;return s&&!1===s.strict&&(i=r),i(t)}}var Pl,Ll,Il,Ml,Dl,jl,Fl,Hl,Bl,zl,Kl,Ul,ql,Zl,Gl,Wl,Vl,Yl,Ql,Jl={};function Xl(){return Pl||(Pl=1,(e=Jl).isInteger=e=>"number"==typeof e?Number.isInteger(e):"string"==typeof e&&""!==e.trim()&&Number.isInteger(Number(e)),e.find=(e,t)=>e.nodes.find(e=>e.type===t),e.exceedsLimit=(t,n,r=1,s)=>!1!==s&&!(!e.isInteger(t)||!e.isInteger(n))&&(Number(n)-Number(t))/Number(r)>=s,e.escapeNode=(e,t=0,n)=>{const r=e.nodes[t];r&&(n&&r.type===n||"open"===r.type||"close"===r.type)&&!0!==r.escaped&&(r.value="\\"+r.value,r.escaped=!0)},e.encloseBrace=e=>!("brace"!==e.type||e.commas>>0+e.ranges|0||(e.invalid=!0,0)),e.isInvalidBrace=e=>!("brace"!==e.type||!0!==e.invalid&&!e.dollar&&(e.commas>>0+e.ranges|0&&!0===e.open&&!0===e.close||(e.invalid=!0,0))),e.isOpenOrClose=e=>"open"===e.type||"close"===e.type||!0===e.open||!0===e.close,e.reduce=e=>e.reduce((e,t)=>("text"===t.type&&e.push(t.value),"range"===t.type&&(t.type="text"),e),[]),e.flatten=(...e)=>{const t=[],n=e=>{for(let r=0;r<e.length;r++){const s=e[r];Array.isArray(s)?n(s):void 0!==s&&t.push(s)}return t};return n(e),t}),Jl;var e}function ef(){if(Il)return Ll;Il=1;const e=Xl();return Ll=(t,n={})=>{const r=(t,s={})=>{const i=n.escapeInvalid&&e.isInvalidBrace(s),o=!0===t.invalid&&!0===n.escapeInvalid;let a="";if(t.value)return(i||o)&&e.isOpenOrClose(t)?"\\"+t.value:t.value;if(t.value)return t.value;if(t.nodes)for(const e of t.nodes)a+=r(e);return a};return r(t)}}function tf(){return Dl?Ml:(Dl=1,Ml=function(e){return"number"==typeof e?e-e===0:"string"==typeof e&&""!==e.trim()&&(Number.isFinite?Number.isFinite(+e):isFinite(+e))})}function nf(){if(Fl)return jl;Fl=1;const e=tf(),t=(n,i,o)=>{if(!1===e(n))throw new TypeError("toRegexRange: expected the first argument to be a number");if(void 0===i||n===i)return String(n);if(!1===e(i))throw new TypeError("toRegexRange: expected the second argument to be a number.");let a={relaxZeros:!0,...o};"boolean"==typeof a.strictZeros&&(a.relaxZeros=!1===a.strictZeros);let c=n+":"+i+"="+String(a.relaxZeros)+String(a.shorthand)+String(a.capture)+String(a.wrap);if(t.cache.hasOwnProperty(c))return t.cache[c].result;let u=Math.min(n,i),l=Math.max(n,i);if(1===Math.abs(u-l)){let e=n+"|"+i;return a.capture?`(${e})`:!1===a.wrap?e:`(?:${e})`}let p=f(n)||f(i),h={min:n,max:i,a:u,b:l},d=[],m=[];if(p&&(h.isPadded=p,h.maxLen=String(h.max).length),u<0){m=r(l<0?Math.abs(l):1,Math.abs(u),h,a),u=h.a=0}return l>=0&&(d=r(u,l,h,a)),h.negatives=m,h.positives=d,h.result=function(e,t){let n=s(e,t,"-",!1)||[],r=s(t,e,"",!1)||[],i=s(e,t,"-?",!0)||[];return n.concat(i).concat(r).join("|")}(m,d),!0===a.capture?h.result=`(${h.result})`:!1!==a.wrap&&d.length+m.length>1&&(h.result=`(?:${h.result})`),t.cache[c]=h,h.result};function n(e,t,n){if(e===t)return{pattern:e,count:[],digits:0};let r=function(e,t){let n=[];for(let r=0;r<e.length;r++)n.push([e[r],t[r]]);return n}(e,t),s=r.length,i="",o=0;for(let e=0;e<s;e++){let[t,n]=r[e];t===n?i+=t:"0"!==t||"9"!==n?i+=l(t,n):o++}return o&&(i+=!0===n.shorthand?"\\d":"[0-9]"),{pattern:i,count:[o],digits:s}}function r(e,t,r,s){let o,l=function(e,t){let n=1,r=1,s=a(e,n),o=new Set([t]);for(;e<=s&&s<=t;)o.add(s),n+=1,s=a(e,n);for(s=c(t+1,r)-1;e<s&&s<=t;)o.add(s),r+=1,s=c(t+1,r)-1;return o=[...o],o.sort(i),o}(e,t),f=[],h=e;for(let e=0;e<l.length;e++){let t=l[e],i=n(String(h),String(t),s),a="";r.isPadded||!o||o.pattern!==i.pattern?(r.isPadded&&(a=p(t,r,s)),i.string=a+i.pattern+u(i.count),f.push(i),h=t+1,o=i):(o.count.length>1&&o.count.pop(),o.count.push(i.count[0]),o.string=o.pattern+u(o.count),h=t+1)}return f}function s(e,t,n,r,s){let i=[];for(let s of e){let{string:e}=s;r||o(t,"string",e)||i.push(n+e),r&&o(t,"string",e)&&i.push(n+e)}return i}function i(e,t){return e>t?1:t>e?-1:0}function o(e,t,n){return e.some(e=>e[t]===n)}function a(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function c(e,t){return e-e%Math.pow(10,t)}function u(e){let[t=0,n=""]=e;return n||t>1?`{${t+(n?","+n:"")}}`:""}function l(e,t,n){return`[${e}${t-e===1?"":"-"}${t}]`}function f(e){return/^-?(0+)\d/.test(e)}function p(e,t,n){if(!t.isPadded)return e;let r=Math.abs(t.maxLen-String(e).length),s=!1!==n.relaxZeros;switch(r){case 0:return"";case 1:return s?"0?":"0";case 2:return s?"0{0,2}":"00";default:return s?`0{0,${r}}`:`0{${r}}`}}return t.cache={},t.clearCache=()=>t.cache={},jl=t}function rf(){if(Bl)return Hl;Bl=1;const e=O,t=nf(),n=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),r=e=>"number"==typeof e||"string"==typeof e&&""!==e,s=e=>Number.isInteger(+e),i=e=>{let t=`${e}`,n=-1;if("-"===t[0]&&(t=t.slice(1)),"0"===t)return!1;for(;"0"===t[++n];);return n>0},o=(e,t,n)=>{if(t>0){let n="-"===e[0]?"-":"";n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,"0")}return!1===n?String(e):e},a=(e,t)=>{let n="-"===e[0]?"-":"";for(n&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return n?"-"+e:e},c=(e,n,r,s)=>{if(r)return t(e,n,{wrap:!1,...s});let i=String.fromCharCode(e);return e===n?i:`[${i}-${String.fromCharCode(n)}]`},u=(e,n,r)=>{if(Array.isArray(e)){let t=!0===r.wrap,n=r.capture?"":"?:";return t?`(${n}${e.join("|")})`:e.join("|")}return t(e,n,r)},l=(...t)=>new RangeError("Invalid range arguments: "+e.inspect(...t)),f=(e,t,n)=>{if(!0===n.strictRanges)throw l([e,t]);return[]},p=(e,t,n=1,r={})=>{let s=Number(e),f=Number(t);if(!Number.isInteger(s)||!Number.isInteger(f)){if(!0===r.strictRanges)throw l([e,t]);return[]}0===s&&(s=0),0===f&&(f=0);let p=s>f,h=String(e),d=String(t),m=String(n);n=Math.max(Math.abs(n),1);let g=i(h)||i(d)||i(m),y=g?Math.max(h.length,d.length,m.length):0,v=!1===g&&!1===((e,t,n)=>"string"==typeof e||"string"==typeof t||!0===n.stringify)(e,t,r),b=r.transform||(e=>t=>!0===e?Number(t):String(t))(v);if(r.toRegex&&1===n)return c(a(e,y),a(t,y),!0,r);let _={negatives:[],positives:[]},w=e=>_[e<0?"negatives":"positives"].push(Math.abs(e)),S=[],A=0;for(;p?s>=f:s<=f;)!0===r.toRegex&&n>1?w(s):S.push(o(b(s,A),y,v)),s=p?s-n:s+n,A++;return!0===r.toRegex?n>1?((e,t,n)=>{e.negatives.sort((e,t)=>e<t?-1:e>t?1:0),e.positives.sort((e,t)=>e<t?-1:e>t?1:0);let r,s=t.capture?"":"?:",i="",o="";return e.positives.length&&(i=e.positives.map(e=>a(String(e),n)).join("|")),e.negatives.length&&(o=`-(${s}${e.negatives.map(e=>a(String(e),n)).join("|")})`),r=i&&o?`${i}|${o}`:i||o,t.wrap?`(${s}${r})`:r})(_,r,y):u(S,null,{wrap:!1,...r}):S},h=(e,t,i,o={})=>{if(null==t&&r(e))return[e];if(!r(e)||!r(t))return f(e,t,o);if("function"==typeof i)return h(e,t,1,{transform:i});if(n(i))return h(e,t,0,i);let a={...o};return!0===a.capture&&(a.wrap=!0),i=i||a.step||1,s(i)?s(e)&&s(t)?p(e,t,i,a):((e,t,n=1,r={})=>{if(!s(e)&&e.length>1||!s(t)&&t.length>1)return f(e,t,r);let i=r.transform||(e=>String.fromCharCode(e)),o=`${e}`.charCodeAt(0),a=`${t}`.charCodeAt(0),l=o>a,p=Math.min(o,a),h=Math.max(o,a);if(r.toRegex&&1===n)return c(p,h,!1,r);let d=[],m=0;for(;l?o>=a:o<=a;)d.push(i(o,m)),o=l?o-n:o+n,m++;return!0===r.toRegex?u(d,null,{wrap:!1,options:r}):d})(e,t,Math.max(Math.abs(i),1),a):null==i||n(i)?h(e,t,1,i):((e,t)=>{if(!0===t.strictRanges)throw new TypeError(`Expected step "${e}" to be a number`);return[]})(i,a)};return Hl=h}function sf(){if(Vl)return Wl;Vl=1;const e=ef(),{MAX_LENGTH:t,CHAR_BACKSLASH:n,CHAR_BACKTICK:r,CHAR_COMMA:s,CHAR_DOT:i,CHAR_LEFT_PARENTHESES:o,CHAR_RIGHT_PARENTHESES:a,CHAR_LEFT_CURLY_BRACE:c,CHAR_RIGHT_CURLY_BRACE:u,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_RIGHT_SQUARE_BRACKET:f,CHAR_DOUBLE_QUOTE:p,CHAR_SINGLE_QUOTE:h,CHAR_NO_BREAK_SPACE:d,CHAR_ZERO_WIDTH_NOBREAK_SPACE:m}=Gl?Zl:(Gl=1,Zl={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:"\n",CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\ufeff"});return Wl=(g,y={})=>{if("string"!=typeof g)throw new TypeError("Expected a string");const v=y||{},b="number"==typeof v.maxLength?Math.min(t,v.maxLength):t;if(g.length>b)throw new SyntaxError(`Input length (${g.length}), exceeds max characters (${b})`);const _={type:"root",input:g,nodes:[]},w=[_];let S=_,A=_,k=0;const E=g.length;let x,$=0,O=0;const R=()=>g[$++],C=e=>{if("text"===e.type&&"dot"===A.type&&(A.type="text"),!A||"text"!==A.type||"text"!==e.type)return S.nodes.push(e),e.parent=S,e.prev=A,A=e,e;A.value+=e.value};for(C({type:"bos"});$<E;)if(S=w[w.length-1],x=R(),x!==m&&x!==d)if(x!==n)if(x!==f){if(x===l){let e;for(k++;$<E&&(e=R());)if(x+=e,e!==l)if(e!==n){if(e===f&&(k--,0===k))break}else x+=R();else k++;C({type:"text",value:x});continue}if(x!==o)if(x!==a){if(x===p||x===h||x===r){const e=x;let t;for(!0!==y.keepQuotes&&(x="");$<E&&(t=R());)if(t!==n){if(t===e){!0===y.keepQuotes&&(x+=t);break}x+=t}else x+=t+R();C({type:"text",value:x});continue}if(x===c){O++;const e=A.value&&"$"===A.value.slice(-1)||!0===S.dollar;S=C({type:"brace",open:!0,close:!1,dollar:e,depth:O,commas:0,ranges:0,nodes:[]}),w.push(S),C({type:"open",value:x});continue}if(x===u){if("brace"!==S.type){C({type:"text",value:x});continue}const e="close";S=w.pop(),S.close=!0,C({type:e,value:x}),O--,S=w[w.length-1];continue}if(x===s&&O>0){if(S.ranges>0){S.ranges=0;const t=S.nodes.shift();S.nodes=[t,{type:"text",value:e(S)}]}C({type:"comma",value:x}),S.commas++}else{if(x===i&&O>0&&0===S.commas){const e=S.nodes;if(0===O||0===e.length){C({type:"text",value:x});continue}if("dot"===A.type){if(S.range=[],A.value+=x,A.type="range",3!==S.nodes.length&&5!==S.nodes.length){S.invalid=!0,S.ranges=0,A.type="text";continue}S.ranges++,S.args=[];continue}if("range"===A.type){e.pop();const t=e[e.length-1];t.value+=A.value+x,A=t,S.ranges--;continue}C({type:"dot",value:x});continue}C({type:"text",value:x})}}else{if("paren"!==S.type){C({type:"text",value:x});continue}S=w.pop(),C({type:"text",value:x}),S=w[w.length-1]}else S=C({type:"paren",nodes:[]}),w.push(S),C({type:"text",value:x})}else C({type:"text",value:"\\"+x});else C({type:"text",value:(y.keepEscaping?x:"")+R()});do{if(S=w.pop(),"root"!==S.type){S.nodes.forEach(e=>{e.nodes||("open"===e.type&&(e.isOpen=!0),"close"===e.type&&(e.isClose=!0),e.nodes||(e.type="text"),e.invalid=!0)});const e=w[w.length-1],t=e.nodes.indexOf(S);e.nodes.splice(t,1,...S.nodes)}}while(w.length>0);return C({type:"eos"}),_},Wl}function of(){if(Ql)return Yl;Ql=1;const e=ef(),t=function(){if(Kl)return zl;Kl=1;const e=rf(),t=Xl();return zl=(n,r={})=>{const s=(n,i={})=>{const o=t.isInvalidBrace(i),a=!0===n.invalid&&!0===r.escapeInvalid,c=!0===o||!0===a,u=!0===r.escapeInvalid?"\\":"";let l="";if(!0===n.isOpen)return u+n.value;if(!0===n.isClose)return console.log("node.isClose",u,n.value),u+n.value;if("open"===n.type)return c?u+n.value:"(";if("close"===n.type)return c?u+n.value:")";if("comma"===n.type)return"comma"===n.prev.type?"":c?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){const s=t.reduce(n.nodes),i=e(...s,{...r,wrap:!1,toRegex:!0,strictZeros:!0});if(0!==i.length)return s.length>1&&i.length>1?`(${i})`:i}if(n.nodes)for(const e of n.nodes)l+=s(e,n);return l};return s(n)}}(),n=function(){if(ql)return Ul;ql=1;const e=rf(),t=ef(),n=Xl(),r=(e="",t="",s=!1)=>{const i=[];if(e=[].concat(e),!(t=[].concat(t)).length)return e;if(!e.length)return s?n.flatten(t).map(e=>`{${e}}`):t;for(const n of e)if(Array.isArray(n))for(const e of n)i.push(r(e,t,s));else for(let e of t)!0===s&&"string"==typeof e&&(e=`{${e}}`),i.push(Array.isArray(e)?r(n,e,s):n+e);return n.flatten(i)};return Ul=(s,i={})=>{const o=void 0===i.rangeLimit?1e3:i.rangeLimit,a=(s,c={})=>{s.queue=[];let u=c,l=c.queue;for(;"brace"!==u.type&&"root"!==u.type&&u.parent;)u=u.parent,l=u.queue;if(s.invalid||s.dollar)return void l.push(r(l.pop(),t(s,i)));if("brace"===s.type&&!0!==s.invalid&&2===s.nodes.length)return void l.push(r(l.pop(),["{}"]));if(s.nodes&&s.ranges>0){const a=n.reduce(s.nodes);if(n.exceedsLimit(...a,i.step,o))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let c=e(...a,i);return 0===c.length&&(c=t(s,i)),l.push(r(l.pop(),c)),void(s.nodes=[])}const f=n.encloseBrace(s);let p=s.queue,h=s;for(;"brace"!==h.type&&"root"!==h.type&&h.parent;)h=h.parent,p=h.queue;for(let e=0;e<s.nodes.length;e++){const t=s.nodes[e];"comma"!==t.type||"brace"!==s.type?"close"!==t.type?t.value&&"open"!==t.type?p.push(r(p.pop(),t.value)):t.nodes&&a(t,s):l.push(r(l.pop(),p,f)):(1===e&&p.push(""),p.push(""))}return p};return n.flatten(a(s))},Ul}(),r=sf(),s=(e,t={})=>{let n=[];if(Array.isArray(e))for(const r of e){const e=s.create(r,t);Array.isArray(e)?n.push(...e):n.push(e)}else n=[].concat(s.create(e,t));return t&&!0===t.expand&&!0===t.nodupes&&(n=[...new Set(n)]),n};return s.parse=(e,t={})=>r(e,t),s.stringify=(t,n={})=>e("string"==typeof t?s.parse(t,n):t,n),s.compile=(e,n={})=>("string"==typeof e&&(e=s.parse(e,n)),t(e,n)),s.expand=(e,t={})=>{"string"==typeof e&&(e=s.parse(e,t));let r=n(e,t);return!0===t.noempty&&(r=r.filter(Boolean)),!0===t.nodupes&&(r=[...new Set(r)]),r},s.create=(e,t={})=>""===e||e.length<3?[e]:!0!==t.expand?s.compile(e,t):s.expand(e,t),Yl=s}var af,cf,uf,lf,ff,pf,hf,df,mf,gf,yf,vf,bf,_f,wf={};function Sf(){if(cf)return af;cf=1;const e=$,t="\\\\/",n=`[^${t}]`,r="\\.",s="\\/",i="[^/]",o=`(?:${s}|$)`,a=`(?:^|${s})`,c=`${r}{1,2}${o}`,u={DOT_LITERAL:r,PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:s,ONE_CHAR:"(?=.)",QMARK:i,END_ANCHOR:o,DOTS_SLASH:c,NO_DOT:`(?!${r})`,NO_DOTS:`(?!${a}${c})`,NO_DOT_SLASH:`(?!${r}{0,1}${o})`,NO_DOTS_SLASH:`(?!${c})`,QMARK_NO_DOT:`[^.${s}]`,STAR:`${i}*?`,START_ANCHOR:a},l={...u,SLASH_LITERAL:`[${t}]`,QMARK:n,STAR:`${n}*?`,DOTS_SLASH:`${r}{1,2}(?:[${t}]|$)`,NO_DOT:`(?!${r})`,NO_DOTS:`(?!(?:^|[${t}])${r}{1,2}(?:[${t}]|$))`,NO_DOT_SLASH:`(?!${r}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${r}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`};return af={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{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"},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:{"***":"*","**/**":"**","**/**/**":"**"},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,SEP:e.sep,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?l:u}}function Af(){return uf||(uf=1,function(e){const t=$,n="win32"===process.platform,{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:s,REGEX_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_GLOBAL:o}=Sf();e.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),e.hasRegexChars=e=>i.test(e),e.isRegexChar=t=>1===t.length&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(o,"\\$1"),e.toPosixSlashes=e=>e.replace(r,"/"),e.removeBackslashes=e=>e.replace(s,e=>"\\"===e?"":e),e.supportsLookbehinds=()=>{const e=process.version.slice(1).split(".").map(Number);return 3===e.length&&e[0]>=9||8===e[0]&&e[1]>=10},e.isWindows=e=>e&&"boolean"==typeof e.windows?e.windows:!0===n||"\\"===t.sep,e.escapeLast=(t,n,r)=>{const s=t.lastIndexOf(n,r);return-1===s?t:"\\"===t[s-1]?e.escapeLast(t,n,s-1):`${t.slice(0,s)}\\${t.slice(s)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith("./")&&(n=n.slice(2),t.prefix="./"),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?"":"^"}(?:${e})${n.contains?"":"$"}`;return!0===t.negated&&(r=`(?:^(?!${r}).*$)`),r}}(wf)),wf}function kf(){if(mf)return df;mf=1;const e=$,t=function(){if(ff)return lf;ff=1;const e=Af(),{CHAR_ASTERISK:t,CHAR_AT:n,CHAR_BACKWARD_SLASH:r,CHAR_COMMA:s,CHAR_DOT:i,CHAR_EXCLAMATION_MARK:o,CHAR_FORWARD_SLASH:a,CHAR_LEFT_CURLY_BRACE:c,CHAR_LEFT_PARENTHESES:u,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:f,CHAR_QUESTION_MARK:p,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:d,CHAR_RIGHT_SQUARE_BRACKET:m}=Sf(),g=e=>e===a||e===r,y=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};return lf=(v,b)=>{const _=b||{},w=v.length-1,S=!0===_.parts||!0===_.scanToEnd,A=[],k=[],E=[];let x,$,O=v,R=-1,C=0,T=0,N=!1,P=!1,L=!1,I=!1,M=!1,D=!1,j=!1,F=!1,H=!1,B=!1,z=0,K={value:"",depth:0,isGlob:!1};const U=()=>R>=w,q=()=>O.charCodeAt(R+1),Z=()=>(x=$,O.charCodeAt(++R));for(;R<w;){let e;if($=Z(),$!==r){if(!0===D||$===c){for(z++;!0!==U()&&($=Z());)if($!==r)if($!==c){if(!0!==D&&$===i&&($=Z())===i){if(N=K.isBrace=!0,L=K.isGlob=!0,B=!0,!0===S)continue;break}if(!0!==D&&$===s){if(N=K.isBrace=!0,L=K.isGlob=!0,B=!0,!0===S)continue;break}if($===h&&(z--,0===z)){D=!1,N=K.isBrace=!0,B=!0;break}}else z++;else j=K.backslashes=!0,Z();if(!0===S)continue;break}if($!==a){if(!0!==_.noext&&!0==($===f||$===n||$===t||$===p||$===o)&&q()===u){if(L=K.isGlob=!0,I=K.isExtglob=!0,B=!0,$===o&&R===C&&(H=!0),!0===S){for(;!0!==U()&&($=Z());)if($!==r){if($===d){L=K.isGlob=!0,B=!0;break}}else j=K.backslashes=!0,$=Z();continue}break}if($===t){if(x===t&&(M=K.isGlobstar=!0),L=K.isGlob=!0,B=!0,!0===S)continue;break}if($===p){if(L=K.isGlob=!0,B=!0,!0===S)continue;break}if($===l){for(;!0!==U()&&(e=Z());)if(e!==r){if(e===m){P=K.isBracket=!0,L=K.isGlob=!0,B=!0;break}}else j=K.backslashes=!0,Z();if(!0===S)continue;break}if(!0===_.nonegate||$!==o||R!==C){if(!0!==_.noparen&&$===u){if(L=K.isGlob=!0,!0===S){for(;!0!==U()&&($=Z());)if($!==u){if($===d){B=!0;break}}else j=K.backslashes=!0,$=Z();continue}break}if(!0===L){if(B=!0,!0===S)continue;break}}else F=K.negated=!0,C++}else{if(A.push(R),k.push(K),K={value:"",depth:0,isGlob:!1},!0===B)continue;if(x===i&&R===C+1){C+=2;continue}T=R+1}}else j=K.backslashes=!0,$=Z(),$===c&&(D=!0)}!0===_.noext&&(I=!1,L=!1);let G=O,W="",V="";C>0&&(W=O.slice(0,C),O=O.slice(C),T-=C),G&&!0===L&&T>0?(G=O.slice(0,T),V=O.slice(T)):!0===L?(G="",V=O):G=O,G&&""!==G&&"/"!==G&&G!==O&&g(G.charCodeAt(G.length-1))&&(G=G.slice(0,-1)),!0===_.unescape&&(V&&(V=e.removeBackslashes(V)),G&&!0===j&&(G=e.removeBackslashes(G)));const Y={prefix:W,input:v,start:C,base:G,glob:V,isBrace:N,isBracket:P,isGlob:L,isExtglob:I,isGlobstar:M,negated:F,negatedExtglob:H};if(!0===_.tokens&&(Y.maxDepth=0,g($)||k.push(K),Y.tokens=k),!0===_.parts||!0===_.tokens){let e;for(let t=0;t<A.length;t++){const n=e?e+1:C,r=A[t],s=v.slice(n,r);_.tokens&&(0===t&&0!==C?(k[t].isPrefix=!0,k[t].value=W):k[t].value=s,y(k[t]),Y.maxDepth+=k[t].depth),0===t&&""===s||E.push(s),e=r}if(e&&e+1<v.length){const t=v.slice(e+1);E.push(t),_.tokens&&(k[k.length-1].value=t,y(k[k.length-1]),Y.maxDepth+=k[k.length-1].depth)}Y.slashes=A,Y.parts=E}return Y},lf}(),n=function(){if(hf)return pf;hf=1;const e=Sf(),t=Af(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_BACKREF:i,REPLACEMENTS:o}=e,a=(e,n)=>{if("function"==typeof n.expandRange)return n.expandRange(...e,n);e.sort();const r=`[${e.join("-")}]`;try{new RegExp(r)}catch(n){return e.map(e=>t.escapeRegex(e)).join("..")}return r},c=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,u=(l,f)=>{if("string"!=typeof l)throw new TypeError("Expected a string");l=o[l]||l;const p={...f},h="number"==typeof p.maxLength?Math.min(n,p.maxLength):n;let d=l.length;if(d>h)throw new SyntaxError(`Input length: ${d}, exceeds maximum allowed length: ${h}`);const m={type:"bos",value:"",output:p.prepend||""},g=[m],y=p.capture?"":"?:",v=t.isWindows(f),b=e.globChars(v),_=e.extglobChars(b),{DOT_LITERAL:w,PLUS_LITERAL:S,SLASH_LITERAL:A,ONE_CHAR:k,DOTS_SLASH:E,NO_DOT:x,NO_DOT_SLASH:$,NO_DOTS_SLASH:O,QMARK:R,QMARK_NO_DOT:C,STAR:T,START_ANCHOR:N}=b,P=e=>`(${y}(?:(?!${N}${e.dot?E:w}).)*?)`,L=p.dot?"":x,I=p.dot?R:C;let M=!0===p.bash?P(p):T;p.capture&&(M=`(${M})`),"boolean"==typeof p.noext&&(p.noextglob=p.noext);const D={input:l,index:-1,start:0,dot:!0===p.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:g};l=t.removePrefix(l,D),d=l.length;const j=[],F=[],H=[];let B,z=m;const K=()=>D.index===d-1,U=D.peek=(e=1)=>l[D.index+e],q=D.advance=()=>l[++D.index]||"",Z=()=>l.slice(D.index+1),G=(e="",t=0)=>{D.consumed+=e,D.index+=t},W=e=>{D.output+=null!=e.output?e.output:e.value,G(e.value)},V=()=>{let e=1;for(;"!"===U()&&("("!==U(2)||"?"===U(3));)q(),D.start++,e++;return e%2!=0&&(D.negated=!0,D.start++,!0)},Y=e=>{D[e]++,H.push(e)},Q=e=>{D[e]--,H.pop()},J=e=>{if("globstar"===z.type){const t=D.braces>0&&("comma"===e.type||"brace"===e.type),n=!0===e.extglob||j.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||n||(D.output=D.output.slice(0,-z.output.length),z.type="star",z.value="*",z.output=M,D.output+=z.output)}if(j.length&&"paren"!==e.type&&(j[j.length-1].inner+=e.value),(e.value||e.output)&&W(e),z&&"text"===z.type&&"text"===e.type)return z.value+=e.value,void(z.output=(z.output||"")+e.value);e.prev=z,g.push(e),z=e},X=(e,t)=>{const n={..._[t],conditions:1,inner:""};n.prev=z,n.parens=D.parens,n.output=D.output;const r=(p.capture?"(":"")+n.open;Y("parens"),J({type:e,value:t,output:D.output?"":k}),J({type:"paren",extglob:!0,value:q(),output:r}),j.push(n)},ee=e=>{let t,n=e.close+(p.capture?")":"");if("negate"===e.type){let r=M;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(r=P(p)),(r!==M||K()||/^\)+$/.test(Z()))&&(n=e.close=`)$))${r}`),e.inner.includes("*")&&(t=Z())&&/^\.[^\\/.]+$/.test(t)){const s=u(t,{...f,fastpaths:!1}).output;n=e.close=`)${s})${r})`}"bos"===e.prev.type&&(D.negatedExtglob=!0)}J({type:"paren",extglob:!0,value:B,output:n}),Q("parens")};if(!1!==p.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(l)){let e=!1,n=l.replace(i,(t,n,r,s,i,o)=>"\\"===s?(e=!0,t):"?"===s?n?n+s+(i?R.repeat(i.length):""):0===o?I+(i?R.repeat(i.length):""):R.repeat(r.length):"."===s?w.repeat(r.length):"*"===s?n?n+s+(i?M:""):M:n?t:`\\${t}`);return!0===e&&(n=!0===p.unescape?n.replace(/\\/g,""):n.replace(/\\+/g,e=>e.length%2==0?"\\\\":e?"\\":"")),n===l&&!0===p.contains?(D.output=l,D):(D.output=t.wrapOutput(n,D,f),D)}for(;!K();){if(B=q(),"\0"===B)continue;if("\\"===B){const e=U();if("/"===e&&!0!==p.bash)continue;if("."===e||";"===e)continue;if(!e){B+="\\",J({type:"text",value:B});continue}const t=/^\\+/.exec(Z());let n=0;if(t&&t[0].length>2&&(n=t[0].length,D.index+=n,n%2!=0&&(B+="\\")),!0===p.unescape?B=q():B+=q(),0===D.brackets){J({type:"text",value:B});continue}}if(D.brackets>0&&("]"!==B||"["===z.value||"[^"===z.value)){if(!1!==p.posix&&":"===B){const e=z.value.slice(1);if(e.includes("[")&&(z.posix=!0,e.includes(":"))){const e=z.value.lastIndexOf("["),t=z.value.slice(0,e),n=z.value.slice(e+2),s=r[n];if(s){z.value=t+s,D.backtrack=!0,q(),m.output||1!==g.indexOf(z)||(m.output=k);continue}}}("["===B&&":"!==U()||"-"===B&&"]"===U())&&(B=`\\${B}`),"]"!==B||"["!==z.value&&"[^"!==z.value||(B=`\\${B}`),!0===p.posix&&"!"===B&&"["===z.value&&(B="^"),z.value+=B,W({value:B});continue}if(1===D.quotes&&'"'!==B){B=t.escapeRegex(B),z.value+=B,W({value:B});continue}if('"'===B){D.quotes=1===D.quotes?0:1,!0===p.keepQuotes&&J({type:"text",value:B});continue}if("("===B){Y("parens"),J({type:"paren",value:B});continue}if(")"===B){if(0===D.parens&&!0===p.strictBrackets)throw new SyntaxError(c("opening","("));const e=j[j.length-1];if(e&&D.parens===e.parens+1){ee(j.pop());continue}J({type:"paren",value:B,output:D.parens?")":"\\)"}),Q("parens");continue}if("["===B){if(!0!==p.nobracket&&Z().includes("]"))Y("brackets");else{if(!0!==p.nobracket&&!0===p.strictBrackets)throw new SyntaxError(c("closing","]"));B=`\\${B}`}J({type:"bracket",value:B});continue}if("]"===B){if(!0===p.nobracket||z&&"bracket"===z.type&&1===z.value.length){J({type:"text",value:B,output:`\\${B}`});continue}if(0===D.brackets){if(!0===p.strictBrackets)throw new SyntaxError(c("opening","["));J({type:"text",value:B,output:`\\${B}`});continue}Q("brackets");const e=z.value.slice(1);if(!0===z.posix||"^"!==e[0]||e.includes("/")||(B=`/${B}`),z.value+=B,W({value:B}),!1===p.literalBrackets||t.hasRegexChars(e))continue;const n=t.escapeRegex(z.value);if(D.output=D.output.slice(0,-z.value.length),!0===p.literalBrackets){D.output+=n,z.value=n;continue}z.value=`(${y}${n}|${z.value})`,D.output+=z.value;continue}if("{"===B&&!0!==p.nobrace){Y("braces");const e={type:"brace",value:B,output:"(",outputIndex:D.output.length,tokensIndex:D.tokens.length};F.push(e),J(e);continue}if("}"===B){const e=F[F.length-1];if(!0===p.nobrace||!e){J({type:"text",value:B,output:B});continue}let t=")";if(!0===e.dots){const e=g.slice(),n=[];for(let t=e.length-1;t>=0&&(g.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&n.unshift(e[t].value);t=a(n,p),D.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const n=D.output.slice(0,e.outputIndex),r=D.tokens.slice(e.tokensIndex);e.value=e.output="\\{",B=t="\\}",D.output=n;for(const e of r)D.output+=e.output||e.value}J({type:"brace",value:B,output:t}),Q("braces"),F.pop();continue}if("|"===B){j.length>0&&j[j.length-1].conditions++,J({type:"text",value:B});continue}if(","===B){let e=B;const t=F[F.length-1];t&&"braces"===H[H.length-1]&&(t.comma=!0,e="|"),J({type:"comma",value:B,output:e});continue}if("/"===B){if("dot"===z.type&&D.index===D.start+1){D.start=D.index+1,D.consumed="",D.output="",g.pop(),z=m;continue}J({type:"slash",value:B,output:A});continue}if("."===B){if(D.braces>0&&"dot"===z.type){"."===z.value&&(z.output=w);const e=F[F.length-1];z.type="dots",z.output+=B,z.value+=B,e.dots=!0;continue}if(D.braces+D.parens===0&&"bos"!==z.type&&"slash"!==z.type){J({type:"text",value:B,output:w});continue}J({type:"dot",value:B,output:w});continue}if("?"===B){if((!z||"("!==z.value)&&!0!==p.noextglob&&"("===U()&&"?"!==U(2)){X("qmark",B);continue}if(z&&"paren"===z.type){const e=U();let n=B;if("<"===e&&!t.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");("("===z.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(Z()))&&(n=`\\${B}`),J({type:"text",value:B,output:n});continue}if(!0!==p.dot&&("slash"===z.type||"bos"===z.type)){J({type:"qmark",value:B,output:C});continue}J({type:"qmark",value:B,output:R});continue}if("!"===B){if(!0!==p.noextglob&&"("===U()&&("?"!==U(2)||!/[!=<:]/.test(U(3)))){X("negate",B);continue}if(!0!==p.nonegate&&0===D.index){V();continue}}if("+"===B){if(!0!==p.noextglob&&"("===U()&&"?"!==U(2)){X("plus",B);continue}if(z&&"("===z.value||!1===p.regex){J({type:"plus",value:B,output:S});continue}if(z&&("bracket"===z.type||"paren"===z.type||"brace"===z.type)||D.parens>0){J({type:"plus",value:B});continue}J({type:"plus",value:S});continue}if("@"===B){if(!0!==p.noextglob&&"("===U()&&"?"!==U(2)){J({type:"at",extglob:!0,value:B,output:""});continue}J({type:"text",value:B});continue}if("*"!==B){"$"!==B&&"^"!==B||(B=`\\${B}`);const e=s.exec(Z());e&&(B+=e[0],D.index+=e[0].length),J({type:"text",value:B});continue}if(z&&("globstar"===z.type||!0===z.star)){z.type="star",z.star=!0,z.value+=B,z.output=M,D.backtrack=!0,D.globstar=!0,G(B);continue}let e=Z();if(!0!==p.noextglob&&/^\([^?]/.test(e)){X("star",B);continue}if("star"===z.type){if(!0===p.noglobstar){G(B);continue}const t=z.prev,n=t.prev,r="slash"===t.type||"bos"===t.type,s=n&&("star"===n.type||"globstar"===n.type);if(!0===p.bash&&(!r||e[0]&&"/"!==e[0])){J({type:"star",value:B,output:""});continue}const i=D.braces>0&&("comma"===t.type||"brace"===t.type),o=j.length&&("pipe"===t.type||"paren"===t.type);if(!r&&"paren"!==t.type&&!i&&!o){J({type:"star",value:B,output:""});continue}for(;"/**"===e.slice(0,3);){const t=l[D.index+4];if(t&&"/"!==t)break;e=e.slice(3),G("/**",3)}if("bos"===t.type&&K()){z.type="globstar",z.value+=B,z.output=P(p),D.output=z.output,D.globstar=!0,G(B);continue}if("slash"===t.type&&"bos"!==t.prev.type&&!s&&K()){D.output=D.output.slice(0,-(t.output+z.output).length),t.output=`(?:${t.output}`,z.type="globstar",z.output=P(p)+(p.strictSlashes?")":"|$)"),z.value+=B,D.globstar=!0,D.output+=t.output+z.output,G(B);continue}if("slash"===t.type&&"bos"!==t.prev.type&&"/"===e[0]){const n=void 0!==e[1]?"|$":"";D.output=D.output.slice(0,-(t.output+z.output).length),t.output=`(?:${t.output}`,z.type="globstar",z.output=`${P(p)}${A}|${A}${n})`,z.value+=B,D.output+=t.output+z.output,D.globstar=!0,G(B+q()),J({type:"slash",value:"/",output:""});continue}if("bos"===t.type&&"/"===e[0]){z.type="globstar",z.value+=B,z.output=`(?:^|${A}|${P(p)}${A})`,D.output=z.output,D.globstar=!0,G(B+q()),J({type:"slash",value:"/",output:""});continue}D.output=D.output.slice(0,-z.output.length),z.type="globstar",z.output=P(p),z.value+=B,D.output+=z.output,D.globstar=!0,G(B);continue}const n={type:"star",value:B,output:M};!0!==p.bash?!z||"bracket"!==z.type&&"paren"!==z.type||!0!==p.regex?(D.index!==D.start&&"slash"!==z.type&&"dot"!==z.type||("dot"===z.type?(D.output+=$,z.output+=$):!0===p.dot?(D.output+=O,z.output+=O):(D.output+=L,z.output+=L),"*"!==U()&&(D.output+=k,z.output+=k)),J(n)):(n.output=B,J(n)):(n.output=".*?","bos"!==z.type&&"slash"!==z.type||(n.output=L+n.output),J(n))}for(;D.brackets>0;){if(!0===p.strictBrackets)throw new SyntaxError(c("closing","]"));D.output=t.escapeLast(D.output,"["),Q("brackets")}for(;D.parens>0;){if(!0===p.strictBrackets)throw new SyntaxError(c("closing",")"));D.output=t.escapeLast(D.output,"("),Q("parens")}for(;D.braces>0;){if(!0===p.strictBrackets)throw new SyntaxError(c("closing","}"));D.output=t.escapeLast(D.output,"{"),Q("braces")}if(!0===p.strictSlashes||"star"!==z.type&&"bracket"!==z.type||J({type:"maybe_slash",value:"",output:`${A}?`}),!0===D.backtrack){D.output="";for(const e of D.tokens)D.output+=null!=e.output?e.output:e.value,e.suffix&&(D.output+=e.suffix)}return D};return u.fastpaths=(r,s)=>{const i={...s},a="number"==typeof i.maxLength?Math.min(n,i.maxLength):n,c=r.length;if(c>a)throw new SyntaxError(`Input length: ${c}, exceeds maximum allowed length: ${a}`);r=o[r]||r;const u=t.isWindows(s),{DOT_LITERAL:l,SLASH_LITERAL:f,ONE_CHAR:p,DOTS_SLASH:h,NO_DOT:d,NO_DOTS:m,NO_DOTS_SLASH:g,STAR:y,START_ANCHOR:v}=e.globChars(u),b=i.dot?m:d,_=i.dot?g:d,w=i.capture?"":"?:";let S=!0===i.bash?".*?":y;i.capture&&(S=`(${S})`);const A=e=>!0===e.noglobstar?S:`(${w}(?:(?!${v}${e.dot?h:l}).)*?)`,k=e=>{switch(e){case"*":return`${b}${p}${S}`;case".*":return`${l}${p}${S}`;case"*.*":return`${b}${S}${l}${p}${S}`;case"*/*":return`${b}${S}${f}${p}${_}${S}`;case"**":return b+A(i);case"**/*":return`(?:${b}${A(i)}${f})?${_}${p}${S}`;case"**/*.*":return`(?:${b}${A(i)}${f})?${_}${S}${l}${p}${S}`;case"**/.*":return`(?:${b}${A(i)}${f})?${l}${p}${S}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const n=k(t[1]);if(!n)return;return n+l+t[2]}}},E=t.removePrefix(r,{negated:!1,prefix:""});let x=k(E);return x&&!0!==i.strictSlashes&&(x+=`${f}?`),x},pf=u}(),r=Af(),s=Sf(),i=(e,t,n=!1)=>{if(Array.isArray(e)){const r=e.map(e=>i(e,t,n)),s=e=>{for(const t of r){const n=t(e);if(n)return n}return!1};return s}const s=(o=e)&&"object"==typeof o&&!Array.isArray(o)&&e.tokens&&e.input;var o;if(""===e||"string"!=typeof e&&!s)throw new TypeError("Expected pattern to be a non-empty string");const a=t||{},c=r.isWindows(t),u=s?i.compileRe(e,t):i.makeRe(e,t,!1,!0),l=u.state;delete u.state;let f=()=>!1;if(a.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};f=i(a.ignore,e,n)}const p=(n,r=!1)=>{const{isMatch:s,match:o,output:p}=i.test(n,u,t,{glob:e,posix:c}),h={glob:e,state:l,regex:u,posix:c,input:n,output:p,match:o,isMatch:s};return"function"==typeof a.onResult&&a.onResult(h),!1===s?(h.isMatch=!1,!!r&&h):f(n)?("function"==typeof a.onIgnore&&a.onIgnore(h),h.isMatch=!1,!!r&&h):("function"==typeof a.onMatch&&a.onMatch(h),!r||h)};return n&&(p.state=l),p};return i.test=(e,t,n,{glob:s,posix:o}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};const a=n||{},c=a.format||(o?r.toPosixSlashes:null);let u=e===s,l=u&&c?c(e):e;return!1===u&&(l=c?c(e):e,u=l===s),!1!==u&&!0!==a.capture||(u=!0===a.matchBase||!0===a.basename?i.matchBase(e,t,n,o):t.exec(l)),{isMatch:Boolean(u),match:u,output:l}},i.matchBase=(t,n,s,o=r.isWindows(s))=>(n instanceof RegExp?n:i.makeRe(n,s)).test(e.basename(t)),i.isMatch=(e,t,n)=>i(t,n)(e),i.parse=(e,t)=>Array.isArray(e)?e.map(e=>i.parse(e,t)):n(e,{...t,fastpaths:!1}),i.scan=(e,n)=>t(e,n),i.compileRe=(e,t,n=!1,r=!1)=>{if(!0===n)return e.output;const s=t||{},o=s.contains?"":"^",a=s.contains?"":"$";let c=`${o}(?:${e.output})${a}`;e&&!0===e.negated&&(c=`^(?!${c}).*$`);const u=i.toRegex(c,t);return!0===r&&(u.state=e),u},i.makeRe=(e,t={},r=!1,s=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let o={negated:!1,fastpaths:!0};return!1===t.fastpaths||"."!==e[0]&&"*"!==e[0]||(o.output=n.fastpaths(e,t)),o.output||(o=n(e,t)),i.compileRe(o,t,r,s)},i.toRegex=(e,t)=>{try{const n=t||{};return new RegExp(e,n.flags||(n.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},i.constants=s,df=i}function Ef(){return yf?gf:(yf=1,gf=kf())}function xf(){if(_f)return Cl;_f=1,Object.defineProperty(Cl,"__esModule",{value:!0}),Cl.isAbsolute=Cl.partitionAbsoluteAndRelative=Cl.removeDuplicateSlashes=Cl.matchAny=Cl.convertPatternsToRe=Cl.makeRe=Cl.getPatternParts=Cl.expandBraceExpansion=Cl.expandPatternsWithBraceExpansion=Cl.isAffectDepthOfReadingPattern=Cl.endsWithSlashGlobStar=Cl.hasGlobStar=Cl.getBaseDirectory=Cl.isPatternRelatedToParentDirectory=Cl.getPatternsOutsideCurrentDirectory=Cl.getPatternsInsideCurrentDirectory=Cl.getPositivePatterns=Cl.getNegativePatterns=Cl.isPositivePattern=Cl.isNegativePattern=Cl.convertToNegativePattern=Cl.convertToPositivePattern=Cl.isDynamicPattern=Cl.isStaticPattern=void 0;const e=$,t=function(){if(Rl)return Ol;Rl=1;var e=Nl(),t=$.posix.dirname,n="win32"===x.platform(),r=/\\/g,s=/[\{\[].*[\}\]]$/,i=/(^|[^\\])([\{\[]|\([^\)]+$)/,o=/\\([\!\*\?\|\[\]\(\)\{\}])/g;return Ol=function(a,c){Object.assign({flipBackslashes:!0},c).flipBackslashes&&n&&a.indexOf("/")<0&&(a=a.replace(r,"/")),s.test(a)&&(a+="/"),a+="a";do{a=t(a)}while(e(a)||i.test(a));return a.replace(o,"$1")}}(),n=function(){if(bf)return vf;bf=1;const e=O,t=of(),n=Ef(),r=Af(),s=e=>""===e||"./"===e,i=e=>{const t=e.indexOf("{");return t>-1&&e.indexOf("}",t)>-1},o=(e,t,r)=>{t=[].concat(t),e=[].concat(e);let s=new Set,i=new Set,o=new Set,a=0,c=e=>{o.add(e.output),r&&r.onResult&&r.onResult(e)};for(let o=0;o<t.length;o++){let u=n(String(t[o]),{...r,onResult:c},!0),l=u.state.negated||u.state.negatedExtglob;l&&a++;for(let t of e){let e=u(t,!0);(l?!e.isMatch:e.isMatch)&&(l?s.add(e.output):(s.delete(e.output),i.add(e.output)))}}let u=(a===t.length?[...o]:[...i]).filter(e=>!s.has(e));if(r&&0===u.length){if(!0===r.failglob)throw new Error(`No matches found for "${t.join(", ")}"`);if(!0===r.nonull||!0===r.nullglob)return r.unescape?t.map(e=>e.replace(/\\/g,"")):t}return u};return o.match=o,o.matcher=(e,t)=>n(e,t),o.any=o.isMatch=(e,t,r)=>n(t,r)(e),o.not=(e,t,n={})=>{t=[].concat(t).map(String);let r=new Set,s=[],i=new Set(o(e,t,{...n,onResult:e=>{n.onResult&&n.onResult(e),s.push(e.output)}}));for(let e of s)i.has(e)||r.add(e);return[...r]},o.contains=(t,n,r)=>{if("string"!=typeof t)throw new TypeError(`Expected a string: "${e.inspect(t)}"`);if(Array.isArray(n))return n.some(e=>o.contains(t,e,r));if("string"==typeof n){if(s(t)||s(n))return!1;if(t.includes(n)||t.startsWith("./")&&t.slice(2).includes(n))return!0}return o.isMatch(t,n,{...r,contains:!0})},o.matchKeys=(e,t,n)=>{if(!r.isObject(e))throw new TypeError("Expected the first argument to be an object");let s=o(Object.keys(e),t,n),i={};for(let t of s)i[t]=e[t];return i},o.some=(e,t,r)=>{let s=[].concat(e);for(let e of[].concat(t)){let t=n(String(e),r);if(s.some(e=>t(e)))return!0}return!1},o.every=(e,t,r)=>{let s=[].concat(e);for(let e of[].concat(t)){let t=n(String(e),r);if(!s.every(e=>t(e)))return!1}return!0},o.all=(t,r,s)=>{if("string"!=typeof t)throw new TypeError(`Expected a string: "${e.inspect(t)}"`);return[].concat(r).every(e=>n(e,s)(t))},o.capture=(e,t,s)=>{let i=r.isWindows(s),o=n.makeRe(String(e),{...s,capture:!0}).exec(i?r.toPosixSlashes(t):t);if(o)return o.slice(1).map(e=>void 0===e?"":e)},o.makeRe=(...e)=>n.makeRe(...e),o.scan=(...e)=>n.scan(...e),o.parse=(e,r)=>{let s=[];for(let i of[].concat(e||[]))for(let e of t(String(i),r))s.push(n.parse(e,r));return s},o.braces=(e,n)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return n&&!0===n.nobrace||!i(e)?[e]:t(e,n)},o.braceExpand=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return o.braces(e,{...t,expand:!0})},o.hasBraces=i,vf=o}(),r=/[*?]|^!/,s=/\[[^[]*]/,i=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,o=/[!*+?@]\([^(]*\)/,a=/,|\.\./,c=/(?!^)\/{2,}/g;function u(e,t={}){return!l(e,t)}function l(e,t={}){return""!==e&&(!(!1!==t.caseSensitiveMatch&&!e.includes("\\"))||(!!(r.test(e)||s.test(e)||i.test(e))||(!(!1===t.extglob||!o.test(e))||!(!1===t.braceExpansion||!function(e){const t=e.indexOf("{");if(-1===t)return!1;const n=e.indexOf("}",t+1);if(-1===n)return!1;const r=e.slice(t,n);return a.test(r)}(e)))))}function f(e){return e.startsWith("!")&&"("!==e[1]}function p(e){return!f(e)}function h(e){return e.startsWith("..")||e.startsWith("./..")}function d(e){return e.endsWith("/**")}function m(e){const t=n.braces(e,{expand:!0,nodupes:!0,keepEscaping:!0});return t.sort((e,t)=>e.length-t.length),t.filter(e=>""!==e)}function g(e,t){return n.makeRe(e,t)}function y(t){return e.isAbsolute(t)}return Cl.isStaticPattern=u,Cl.isDynamicPattern=l,Cl.convertToPositivePattern=function(e){return f(e)?e.slice(1):e},Cl.convertToNegativePattern=function(e){return"!"+e},Cl.isNegativePattern=f,Cl.isPositivePattern=p,Cl.getNegativePatterns=function(e){return e.filter(f)},Cl.getPositivePatterns=function(e){return e.filter(p)},Cl.getPatternsInsideCurrentDirectory=function(e){return e.filter(e=>!h(e))},Cl.getPatternsOutsideCurrentDirectory=function(e){return e.filter(h)},Cl.isPatternRelatedToParentDirectory=h,Cl.getBaseDirectory=function(e){return t(e,{flipBackslashes:!1})},Cl.hasGlobStar=function(e){return e.includes("**")},Cl.endsWithSlashGlobStar=d,Cl.isAffectDepthOfReadingPattern=function(t){const n=e.basename(t);return d(t)||u(n)},Cl.expandPatternsWithBraceExpansion=function(e){return e.reduce((e,t)=>e.concat(m(t)),[])},Cl.expandBraceExpansion=m,Cl.getPatternParts=function(e,t){let{parts:r}=n.scan(e,Object.assign(Object.assign({},t),{parts:!0}));return 0===r.length&&(r=[e]),r[0].startsWith("/")&&(r[0]=r[0].slice(1),r.unshift("")),r},Cl.makeRe=g,Cl.convertPatternsToRe=function(e,t){return e.map(e=>g(e,t))},Cl.matchAny=function(e,t){return t.some(t=>t.test(e))},Cl.removeDuplicateSlashes=function(e){return e.replace(c,"/")},Cl.partitionAbsoluteAndRelative=function(e){const t=[],n=[];for(const r of e)y(r)?t.push(r):n.push(r);return[t,n]},Cl.isAbsolute=y,Cl}var $f,Of,Rf,Cf={};function Tf(){if(Of)return $f;Of=1;const e=R.PassThrough,t=Array.prototype.slice;function n(t,r){if(Array.isArray(t))for(let e=0,s=t.length;e<s;e++)t[e]=n(t[e],r);else{if(!t._readableState&&t.pipe&&(t=t.pipe(e(r))),!t._readableState||!t.pause||!t.pipe)throw new Error("Only readable stream can be merged.");t.pause()}return t}return $f=function(){const r=[],s=t.call(arguments);let i=!1,o=s[s.length-1];o&&!Array.isArray(o)&&null==o.pipe?s.pop():o={};const a=!1!==o.end,c=!0===o.pipeError;null==o.objectMode&&(o.objectMode=!0);null==o.highWaterMark&&(o.highWaterMark=65536);const u=e(o);function l(){for(let e=0,t=arguments.length;e<t;e++)r.push(n(arguments[e],o));return f(),this}function f(){if(i)return;i=!0;let e=r.shift();if(!e)return void process.nextTick(p);Array.isArray(e)||(e=[e]);let t=e.length+1;function n(){--t>0||(i=!1,f())}function s(e){function t(){e.removeListener("merge2UnpipeEnd",t),e.removeListener("end",t),c&&e.removeListener("error",r),n()}function r(e){u.emit("error",e)}if(e._readableState.endEmitted)return n();e.on("merge2UnpipeEnd",t),e.on("end",t),c&&e.on("error",r),e.pipe(u,{end:!1}),e.resume()}for(let t=0;t<e.length;t++)s(e[t]);n()}function p(){i=!1,u.emit("queueDrain"),a&&u.end()}u.setMaxListeners(0),u.add=l,u.on("unpipe",function(e){e.emit("merge2UnpipeEnd")}),s.length&&l.apply(null,s);return u},$f}var Nf,Pf,Lf,If={};function Mf(){if(Nf)return If;return Nf=1,Object.defineProperty(If,"__esModule",{value:!0}),If.isEmpty=If.isString=void 0,If.isString=function(e){return"string"==typeof e},If.isEmpty=function(e){return""===e},If}function Df(){if(Pf)return hl;Pf=1,Object.defineProperty(hl,"__esModule",{value:!0}),hl.string=hl.stream=hl.pattern=hl.path=hl.fs=hl.errno=hl.array=void 0;const e=ml();hl.array=e;const t=vl();hl.errno=t;const n=function(){if(bl)return _l;bl=1,Object.defineProperty(_l,"__esModule",{value:!0}),_l.createDirentFromStats=void 0;class e{constructor(e,t){this.name=e,this.isBlockDevice=t.isBlockDevice.bind(t),this.isCharacterDevice=t.isCharacterDevice.bind(t),this.isDirectory=t.isDirectory.bind(t),this.isFIFO=t.isFIFO.bind(t),this.isFile=t.isFile.bind(t),this.isSocket=t.isSocket.bind(t),this.isSymbolicLink=t.isSymbolicLink.bind(t)}}return _l.createDirentFromStats=function(t,n){return new e(t,n)},_l}();hl.fs=n;const r=Al();hl.path=r;const s=xf();hl.pattern=s;const i=function(){if(Rf)return Cf;Rf=1,Object.defineProperty(Cf,"__esModule",{value:!0}),Cf.merge=void 0;const e=Tf();function t(e){e.forEach(e=>e.emit("close"))}return Cf.merge=function(n){const r=e(n);return n.forEach(e=>{e.once("error",e=>r.emit("error",e))}),r.once("close",()=>t(n)),r.once("end",()=>t(n)),r},Cf}();hl.stream=i;const o=Mf();return hl.string=o,hl}var jf,Ff={},Hf={},Bf={},zf={},Kf={},Uf={},qf={},Zf={},Gf={};function Wf(){if(jf)return Gf;function e(e,t){e(t)}function t(e,t){e(null,t)}return jf=1,Object.defineProperty(Gf,"__esModule",{value:!0}),Gf.read=void 0,Gf.read=function(n,r,s){r.fs.lstat(n,(i,o)=>{null===i?o.isSymbolicLink()&&r.followSymbolicLink?r.fs.stat(n,(n,i)=>{if(null!==n)return r.throwErrorOnBrokenSymbolicLink?void e(s,n):void t(s,o);r.markSymbolicLink&&(i.isSymbolicLink=()=>!0),t(s,i)}):t(s,o):e(s,i)})},Gf}var Vf,Yf={};var Qf,Jf,Xf,ep,tp,np,rp,sp={},ip={};function op(){if(Jf)return sp;Jf=1,Object.defineProperty(sp,"__esModule",{value:!0});const e=(Qf||(Qf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createFileSystemAdapter=e.FILE_SYSTEM_ADAPTER=void 0;const t=T;e.FILE_SYSTEM_ADAPTER={lstat:t.lstat,stat:t.stat,lstatSync:t.lstatSync,statSync:t.statSync},e.createFileSystemAdapter=function(t){return void 0===t?e.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},e.FILE_SYSTEM_ADAPTER),t)}}(ip)),ip);return sp.default=class{constructor(t={}){this._options=t,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=e.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(e,t){return null!=e?e:t}},sp}function ap(){if(Xf)return Zf;Xf=1,Object.defineProperty(Zf,"__esModule",{value:!0}),Zf.statSync=Zf.stat=Zf.Settings=void 0;const e=Wf(),t=(Vf||(Vf=1,Object.defineProperty(Yf,"__esModule",{value:!0}),Yf.read=void 0,Yf.read=function(e,t){const n=t.fs.lstatSync(e);if(!n.isSymbolicLink()||!t.followSymbolicLink)return n;try{const n=t.fs.statSync(e);return t.markSymbolicLink&&(n.isSymbolicLink=()=>!0),n}catch(e){if(!t.throwErrorOnBrokenSymbolicLink)return n;throw e}}),Yf),n=op();function r(e={}){return e instanceof n.default?e:new n.default(e)}return Zf.Settings=n.default,Zf.stat=function(t,n,s){"function"!=typeof n?e.read(t,r(n),s):e.read(t,r(),n)},Zf.statSync=function(e,n){const s=r(n);return t.read(e,s)},Zf}function cp(){if(tp)return ep;let e;return tp=1,ep="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:B):t=>(e||(e=Promise.resolve())).then(t).catch(e=>setTimeout(()=>{throw e},0))}var up,lp={};function fp(){if(up)return lp;up=1,Object.defineProperty(lp,"__esModule",{value:!0}),lp.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;const e=process.versions.node.split(".");if(void 0===e[0]||void 0===e[1])throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);const t=Number.parseInt(e[0],10),n=Number.parseInt(e[1],10),r=t>10,s=10===t&&n>=10;return lp.IS_SUPPORT_READDIR_WITH_FILE_TYPES=r||s,lp}var pp,hp,dp={},mp={};function gp(){if(hp)return dp;hp=1,Object.defineProperty(dp,"__esModule",{value:!0}),dp.fs=void 0;const e=function(){if(pp)return mp;pp=1,Object.defineProperty(mp,"__esModule",{value:!0}),mp.createDirentFromStats=void 0;class e{constructor(e,t){this.name=e,this.isBlockDevice=t.isBlockDevice.bind(t),this.isCharacterDevice=t.isCharacterDevice.bind(t),this.isDirectory=t.isDirectory.bind(t),this.isFIFO=t.isFIFO.bind(t),this.isFile=t.isFile.bind(t),this.isSocket=t.isSocket.bind(t),this.isSymbolicLink=t.isSymbolicLink.bind(t)}}return mp.createDirentFromStats=function(t,n){return new e(t,n)},mp}();return dp.fs=e,dp}var yp,vp,bp={};function _p(){if(yp)return bp;return yp=1,Object.defineProperty(bp,"__esModule",{value:!0}),bp.joinPathSegments=void 0,bp.joinPathSegments=function(e,t,n){return e.endsWith(n)?e+t:e+n+t},bp}function wp(){if(vp)return qf;vp=1,Object.defineProperty(qf,"__esModule",{value:!0}),qf.readdir=qf.readdirWithFileTypes=qf.read=void 0;const e=ap(),t=function(){if(rp)return np;rp=1,np=function(t,n){let r,s,i,o=!0;function a(t){function s(){n&&n(t,r),n=null}o?e(s):s()}function c(e,t,n){r[e]=n,(0===--s||t)&&a(t)}Array.isArray(t)?(r=[],s=t.length):(i=Object.keys(t),r={},s=i.length),s?i?i.forEach(function(e){t[e](function(t,n){c(e,t,n)})}):t.forEach(function(e,t){e(function(e,n){c(t,e,n)})}):a(null),o=!1};const e=cp();return np}(),n=fp(),r=gp(),s=_p();function i(e,n,i){n.fs.readdir(e,{withFileTypes:!0},(o,u)=>{if(null!==o)return void a(i,o);const l=u.map(t=>({dirent:t,name:t.name,path:s.joinPathSegments(e,t.name,n.pathSegmentSeparator)}));if(!n.followSymbolicLinks)return void c(i,l);const f=l.map(e=>function(e,t){return n=>{e.dirent.isSymbolicLink()?t.fs.stat(e.path,(s,i)=>{if(null!==s)return t.throwErrorOnBrokenSymbolicLink?void n(s):void n(null,e);e.dirent=r.fs.createDirentFromStats(e.name,i),n(null,e)}):n(null,e)}}(e,n));t(f,(e,t)=>{null===e?c(i,t):a(i,e)})})}function o(n,i,o){i.fs.readdir(n,(u,l)=>{if(null!==u)return void a(o,u);const f=l.map(t=>{const o=s.joinPathSegments(n,t,i.pathSegmentSeparator);return n=>{e.stat(o,i.fsStatSettings,(e,s)=>{if(null!==e)return void n(e);const a={name:t,path:o,dirent:r.fs.createDirentFromStats(t,s)};i.stats&&(a.stats=s),n(null,a)})}});t(f,(e,t)=>{null===e?c(o,t):a(o,e)})})}function a(e,t){e(t)}function c(e,t){e(null,t)}return qf.read=function(e,t,r){t.stats||!n.IS_SUPPORT_READDIR_WITH_FILE_TYPES?o(e,t,r):i(e,t,r)},qf.readdirWithFileTypes=i,qf.readdir=o,qf}var Sp,Ap={};var kp,Ep,xp,$p={},Op={};function Rp(){return kp||(kp=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createFileSystemAdapter=e.FILE_SYSTEM_ADAPTER=void 0;const t=T;e.FILE_SYSTEM_ADAPTER={lstat:t.lstat,stat:t.stat,lstatSync:t.lstatSync,statSync:t.statSync,readdir:t.readdir,readdirSync:t.readdirSync},e.createFileSystemAdapter=function(t){return void 0===t?e.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},e.FILE_SYSTEM_ADAPTER),t)}}(Op)),Op}function Cp(){if(xp)return Uf;xp=1,Object.defineProperty(Uf,"__esModule",{value:!0}),Uf.Settings=Uf.scandirSync=Uf.scandir=void 0;const e=wp(),t=function(){if(Sp)return Ap;Sp=1,Object.defineProperty(Ap,"__esModule",{value:!0}),Ap.readdir=Ap.readdirWithFileTypes=Ap.read=void 0;const e=ap(),t=fp(),n=gp(),r=_p();function s(e,t){return t.fs.readdirSync(e,{withFileTypes:!0}).map(s=>{const i={dirent:s,name:s.name,path:r.joinPathSegments(e,s.name,t.pathSegmentSeparator)};if(i.dirent.isSymbolicLink()&&t.followSymbolicLinks)try{const e=t.fs.statSync(i.path);i.dirent=n.fs.createDirentFromStats(i.name,e)}catch(e){if(t.throwErrorOnBrokenSymbolicLink)throw e}return i})}function i(t,s){return s.fs.readdirSync(t).map(i=>{const o=r.joinPathSegments(t,i,s.pathSegmentSeparator),a=e.statSync(o,s.fsStatSettings),c={name:i,path:o,dirent:n.fs.createDirentFromStats(i,a)};return s.stats&&(c.stats=a),c})}return Ap.read=function(e,n){return!n.stats&&t.IS_SUPPORT_READDIR_WITH_FILE_TYPES?s(e,n):i(e,n)},Ap.readdirWithFileTypes=s,Ap.readdir=i,Ap}(),n=function(){if(Ep)return $p;Ep=1,Object.defineProperty($p,"__esModule",{value:!0});const e=$,t=ap(),n=Rp();return $p.default=class{constructor(r={}){this._options=r,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=n.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,e.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new t.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(e,t){return null!=e?e:t}},$p}();function r(e={}){return e instanceof n.default?e:new n.default(e)}return Uf.Settings=n.default,Uf.scandir=function(t,n,s){"function"!=typeof n?e.read(t,r(n),s):e.read(t,r(),n)},Uf.scandirSync=function(e,n){const s=r(n);return t.read(e,s)},Uf}var Tp,Np,Pp,Lp={exports:{}};function Ip(){if(Pp)return Lp.exports;Pp=1;var e=Np?Tp:(Np=1,Tp=function(e){var t=new e,n=t;return{get:function(){var r=t;return r.next?t=r.next:(t=new e,n=t),r.next=null,r},release:function(e){n.next=e,n=e}}});function t(t,s,i){if("function"==typeof t&&(i=s,s=t,t=null),!(i>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");var o=e(r),a=null,c=null,u=0,l=null,f={push:function(e,r){var h=o.get();h.context=t,h.release=p,h.value=e,h.callback=r||n,h.errorHandler=l,u>=i||f.paused?c?(c.next=h,c=h):(a=h,c=h,f.saturated()):(u++,s.call(t,h.value,h.worked))},drain:n,saturated:n,pause:function(){f.paused=!0},paused:!1,get concurrency(){return i},set concurrency(e){if(!(e>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(i=e,!f.paused)for(;a&&u<i;)u++,p()},running:function(){return u},resume:function(){if(!f.paused)return;if(f.paused=!1,null===a)return u++,void p();for(;a&&u<i;)u++,p()},idle:function(){return 0===u&&0===f.length()},length:function(){var e=a,t=0;for(;e;)e=e.next,t++;return t},getQueue:function(){var e=a,t=[];for(;e;)t.push(e.value),e=e.next;return t},unshift:function(e,r){var h=o.get();h.context=t,h.release=p,h.value=e,h.callback=r||n,h.errorHandler=l,u>=i||f.paused?a?(h.next=a,a=h):(a=h,c=h,f.saturated()):(u++,s.call(t,h.value,h.worked))},empty:n,kill:function(){a=null,c=null,f.drain=n},killAndDrain:function(){a=null,c=null,f.drain(),f.drain=n},error:function(e){l=e}};return f;function p(e){e&&o.release(e);var n=a;n&&u<=i?f.paused?u--:(c===a&&(c=null),a=n.next,n.next=null,s.call(t,n.value,n.worked),null===c&&f.empty()):0===--u&&f.drain()}}function n(){}function r(){this.value=null,this.callback=n,this.next=null,this.release=n,this.context=null,this.errorHandler=null;var e=this;this.worked=function(t,r){var s=e.callback,i=e.errorHandler,o=e.value;e.value=null,e.callback=n,e.errorHandler&&i(t,o),s.call(e.context,t,r),e.release(e)}}return Lp.exports=t,Lp.exports.promise=function(e,r,s){"function"==typeof e&&(s=r,r=e,e=null);var i=t(e,function(e,t){r.call(this,e).then(function(e){t(null,e)},t)},s),o=i.push,a=i.unshift;return i.push=function(e){var t=new Promise(function(t,n){o(e,function(e,r){e?n(e):t(r)})});return t.catch(n),t},i.unshift=function(e){var t=new Promise(function(t,n){a(e,function(e,r){e?n(e):t(r)})});return t.catch(n),t},i.drained=function(){var e=new Promise(function(e){process.nextTick(function(){if(i.idle())e();else{var t=i.drain;i.drain=function(){"function"==typeof t&&t(),e(),i.drain=t}}})});return e},i},Lp.exports}var Mp,Dp={};function jp(){if(Mp)return Dp;return Mp=1,Object.defineProperty(Dp,"__esModule",{value:!0}),Dp.joinPathSegments=Dp.replacePathSegmentSeparator=Dp.isAppliedFilter=Dp.isFatalError=void 0,Dp.isFatalError=function(e,t){return null===e.errorFilter||!e.errorFilter(t)},Dp.isAppliedFilter=function(e,t){return null===e||e(t)},Dp.replacePathSegmentSeparator=function(e,t){return e.split(/[/\\]/).join(t)},Dp.joinPathSegments=function(e,t,n){return""===e?t:e.endsWith(n)?e+t:e+n+t},Dp}var Fp,Hp,Bp,zp={};function Kp(){if(Fp)return zp;Fp=1,Object.defineProperty(zp,"__esModule",{value:!0});const e=jp();return zp.default=class{constructor(t,n){this._root=t,this._settings=n,this._root=e.replacePathSegmentSeparator(t,n.pathSegmentSeparator)}},zp}function Up(){if(Hp)return Kf;Hp=1,Object.defineProperty(Kf,"__esModule",{value:!0});const e=C,t=Cp(),n=Ip(),r=jp(),s=Kp();class i extends s.default{constructor(r,s){super(r,s),this._settings=s,this._scandir=t.scandir,this._emitter=new e.EventEmitter,this._queue=n(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit("end")}}read(){return this._isFatalError=!1,this._isDestroyed=!1,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw new Error("The reader is already destroyed");this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(e){this._emitter.on("entry",e)}onError(e){this._emitter.once("error",e)}onEnd(e){this._emitter.once("end",e)}_pushToQueue(e,t){const n={directory:e,base:t};this._queue.push(n,e=>{null!==e&&this._handleError(e)})}_worker(e,t){this._scandir(e.directory,this._settings.fsScandirSettings,(n,r)=>{if(null===n){for(const t of r)this._handleEntry(t,e.base);t(null,void 0)}else t(n,void 0)})}_handleError(e){!this._isDestroyed&&r.isFatalError(this._settings,e)&&(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit("error",e))}_handleEntry(e,t){if(this._isDestroyed||this._isFatalError)return;const n=e.path;void 0!==t&&(e.path=r.joinPathSegments(t,e.name,this._settings.pathSegmentSeparator)),r.isAppliedFilter(this._settings.entryFilter,e)&&this._emitEntry(e),e.dirent.isDirectory()&&r.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,void 0===t?void 0:e.path)}_emitEntry(e){this._emitter.emit("entry",e)}}return Kf.default=i,Kf}var qp,Zp={};var Gp,Wp,Vp={},Yp={};function Qp(){if(Wp)return Vp;Wp=1,Object.defineProperty(Vp,"__esModule",{value:!0});const e=function(){if(Gp)return Yp;Gp=1,Object.defineProperty(Yp,"__esModule",{value:!0});const e=Cp(),t=jp(),n=Kp();class r extends n.default{constructor(){super(...arguments),this._scandir=e.scandirSync,this._storage=[],this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),this._storage}_pushToQueue(e,t){this._queue.add({directory:e,base:t})}_handleQueue(){for(const e of this._queue.values())this._handleDirectory(e.directory,e.base)}_handleDirectory(e,t){try{const n=this._scandir(e,this._settings.fsScandirSettings);for(const e of n)this._handleEntry(e,t)}catch(e){this._handleError(e)}}_handleError(e){if(t.isFatalError(this._settings,e))throw e}_handleEntry(e,n){const r=e.path;void 0!==n&&(e.path=t.joinPathSegments(n,e.name,this._settings.pathSegmentSeparator)),t.isAppliedFilter(this._settings.entryFilter,e)&&this._pushToStorage(e),e.dirent.isDirectory()&&t.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(r,void 0===n?void 0:e.path)}_pushToStorage(e){this._storage.push(e)}}return Yp.default=r,Yp}();return Vp.default=class{constructor(t,n){this._root=t,this._settings=n,this._reader=new e.default(this._root,this._settings)}read(){return this._reader.read()}},Vp}var Jp,Xp,eh={};function th(){if(Xp)return Bf;Xp=1,Object.defineProperty(Bf,"__esModule",{value:!0}),Bf.Settings=Bf.walkStream=Bf.walkSync=Bf.walk=void 0;const e=function(){if(Bp)return zf;Bp=1,Object.defineProperty(zf,"__esModule",{value:!0});const e=Up();return zf.default=class{constructor(t,n){this._root=t,this._settings=n,this._reader=new e.default(this._root,this._settings),this._storage=[]}read(e){this._reader.onError(t=>{!function(e,t){e(t)}(e,t)}),this._reader.onEntry(e=>{this._storage.push(e)}),this._reader.onEnd(()=>{!function(e,t){e(null,t)}(e,this._storage)}),this._reader.read()}},zf}(),t=function(){if(qp)return Zp;qp=1,Object.defineProperty(Zp,"__esModule",{value:!0});const e=R,t=Up();return Zp.default=class{constructor(n,r){this._root=n,this._settings=r,this._reader=new t.default(this._root,this._settings),this._stream=new e.Readable({objectMode:!0,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy()}})}read(){return this._reader.onError(e=>{this._stream.emit("error",e)}),this._reader.onEntry(e=>{this._stream.push(e)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}},Zp}(),n=Qp(),r=function(){if(Jp)return eh;Jp=1,Object.defineProperty(eh,"__esModule",{value:!0});const e=$,t=Cp();return eh.default=class{constructor(n={}){this._options=n,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,Number.POSITIVE_INFINITY),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,e.sep),this.fsScandirSettings=new t.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(e,t){return null!=e?e:t}},eh}();function s(e={}){return e instanceof r.default?e:new r.default(e)}return Bf.Settings=r.default,Bf.walk=function(t,n,r){"function"!=typeof n?new e.default(t,s(n)).read(r):new e.default(t,s()).read(n)},Bf.walkSync=function(e,t){const r=s(t);return new n.default(e,r).read()},Bf.walkStream=function(e,n){const r=s(n);return new t.default(e,r).read()},Bf}var nh,rh={};function sh(){if(nh)return rh;nh=1,Object.defineProperty(rh,"__esModule",{value:!0});const e=$,t=ap(),n=Df();return rh.default=class{constructor(e){this._settings=e,this._fsStatSettings=new t.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(t){return e.resolve(this._settings.cwd,t)}_makeEntry(e,t){const r={name:t,path:t,dirent:n.fs.createDirentFromStats(t,e)};return this._settings.stats&&(r.stats=e),r}_isFatalError(e){return!n.errno.isEnoentCodeError(e)&&!this._settings.suppressErrors}},rh}var ih,oh,ah={};function ch(){if(ih)return ah;ih=1,Object.defineProperty(ah,"__esModule",{value:!0});const e=R,t=ap(),n=th(),r=sh();class s extends r.default{constructor(){super(...arguments),this._walkStream=n.walkStream,this._stat=t.stat}dynamic(e,t){return this._walkStream(e,t)}static(t,n){const r=t.map(this._getFullEntryPath,this),s=new e.PassThrough({objectMode:!0});s._write=(e,i,o)=>this._getEntry(r[e],t[e],n).then(t=>{null!==t&&n.entryFilter(t)&&s.push(t),e===r.length-1&&s.end(),o()}).catch(o);for(let e=0;e<r.length;e++)s.write(e);return s}_getEntry(e,t,n){return this._getStat(e).then(e=>this._makeEntry(e,t)).catch(e=>{if(n.errorFilter(e))return null;throw e})}_getStat(e){return new Promise((t,n)=>{this._stat(e,this._fsStatSettings,(e,r)=>null===e?t(r):n(e))})}}return ah.default=s,ah}var uh,lh,fh,ph={},hh={},dh={},mh={};function gh(){if(lh)return dh;lh=1,Object.defineProperty(dh,"__esModule",{value:!0});const e=function(){if(uh)return mh;uh=1,Object.defineProperty(mh,"__esModule",{value:!0});const e=Df();return mh.default=class{constructor(e,t,n){this._patterns=e,this._settings=t,this._micromatchOptions=n,this._storage=[],this._fillStorage()}_fillStorage(){for(const e of this._patterns){const t=this._getPatternSegments(e),n=this._splitSegmentsIntoSections(t);this._storage.push({complete:n.length<=1,pattern:e,segments:t,sections:n})}}_getPatternSegments(t){return e.pattern.getPatternParts(t,this._micromatchOptions).map(t=>e.pattern.isDynamicPattern(t,this._settings)?{dynamic:!0,pattern:t,patternRe:e.pattern.makeRe(t,this._micromatchOptions)}:{dynamic:!1,pattern:t})}_splitSegmentsIntoSections(t){return e.array.splitWhen(t,t=>t.dynamic&&e.pattern.hasGlobStar(t.pattern))}},mh}();class t extends e.default{match(e){const t=e.split("/"),n=t.length,r=this._storage.filter(e=>!e.complete||e.segments.length>n);for(const e of r){const r=e.sections[0];if(!e.complete&&n>r.length)return!0;if(t.every((t,n)=>{const r=e.segments[n];return!(!r.dynamic||!r.patternRe.test(t))||!r.dynamic&&r.pattern===t}))return!0}return!1}}return dh.default=t,dh}var yh,vh={};var bh,_h={};var wh,Sh,Ah,kh={};function Eh(){if(Sh)return ph;Sh=1,Object.defineProperty(ph,"__esModule",{value:!0});const e=$,t=function(){if(fh)return hh;fh=1,Object.defineProperty(hh,"__esModule",{value:!0});const e=Df(),t=gh();return hh.default=class{constructor(e,t){this._settings=e,this._micromatchOptions=t}getFilter(e,t,n){const r=this._getMatcher(t),s=this._getNegativePatternsRe(n);return t=>this._filter(e,t,r,s)}_getMatcher(e){return new t.default(e,this._settings,this._micromatchOptions)}_getNegativePatternsRe(t){const n=t.filter(e.pattern.isAffectDepthOfReadingPattern);return e.pattern.convertPatternsToRe(n,this._micromatchOptions)}_filter(t,n,r,s){if(this._isSkippedByDeep(t,n.path))return!1;if(this._isSkippedSymbolicLink(n))return!1;const i=e.path.removeLeadingDotSegment(n.path);return!this._isSkippedByPositivePatterns(i,r)&&this._isSkippedByNegativePatterns(i,s)}_isSkippedByDeep(e,t){return this._settings.deep!==1/0&&this._getEntryLevel(e,t)>=this._settings.deep}_getEntryLevel(e,t){const n=t.split("/").length;return""===e?n:n-e.split("/").length}_isSkippedSymbolicLink(e){return!this._settings.followSymbolicLinks&&e.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(e,t){return!this._settings.baseNameMatch&&!t.match(e)}_isSkippedByNegativePatterns(t,n){return!e.pattern.matchAny(t,n)}},hh}(),n=function(){if(yh)return vh;yh=1,Object.defineProperty(vh,"__esModule",{value:!0});const e=Df();return vh.default=class{constructor(e,t){this._settings=e,this._micromatchOptions=t,this.index=new Map}getFilter(t,n){const[r,s]=e.pattern.partitionAbsoluteAndRelative(n),i={positive:{all:e.pattern.convertPatternsToRe(t,this._micromatchOptions)},negative:{absolute:e.pattern.convertPatternsToRe(r,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:e.pattern.convertPatternsToRe(s,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return e=>this._filter(e,i)}_filter(t,n){const r=e.path.removeLeadingDotSegment(t.path);if(this._settings.unique&&this._isDuplicateEntry(r))return!1;if(this._onlyFileFilter(t)||this._onlyDirectoryFilter(t))return!1;const s=this._isMatchToPatternsSet(r,n,t.dirent.isDirectory());return this._settings.unique&&s&&this._createIndexRecord(r),s}_isDuplicateEntry(e){return this.index.has(e)}_createIndexRecord(e){this.index.set(e,void 0)}_onlyFileFilter(e){return this._settings.onlyFiles&&!e.dirent.isFile()}_onlyDirectoryFilter(e){return this._settings.onlyDirectories&&!e.dirent.isDirectory()}_isMatchToPatternsSet(e,t,n){return!!this._isMatchToPatterns(e,t.positive.all,n)&&(!this._isMatchToPatterns(e,t.negative.relative,n)&&!this._isMatchToAbsoluteNegative(e,t.negative.absolute,n))}_isMatchToAbsoluteNegative(t,n,r){if(0===n.length)return!1;const s=e.path.makeAbsolute(this._settings.cwd,t);return this._isMatchToPatterns(s,n,r)}_isMatchToPatterns(t,n,r){if(0===n.length)return!1;const s=e.pattern.matchAny(t,n);return!s&&r?e.pattern.matchAny(t+"/",n):s}},vh}(),r=function(){if(bh)return _h;bh=1,Object.defineProperty(_h,"__esModule",{value:!0});const e=Df();return _h.default=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(t){return e.errno.isEnoentCodeError(t)||this._settings.suppressErrors}},_h}(),s=function(){if(wh)return kh;wh=1,Object.defineProperty(kh,"__esModule",{value:!0});const e=Df();return kh.default=class{constructor(e){this._settings=e}getTransformer(){return e=>this._transform(e)}_transform(t){let n=t.path;return this._settings.absolute&&(n=e.path.makeAbsolute(this._settings.cwd,n),n=e.path.unixify(n)),this._settings.markDirectories&&t.dirent.isDirectory()&&(n+="/"),this._settings.objectMode?Object.assign(Object.assign({},t),{path:n}):n}},kh}();return ph.default=class{constructor(e){this._settings=e,this.errorFilter=new r.default(this._settings),this.entryFilter=new n.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new t.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new s.default(this._settings)}_getRootDirectory(t){return e.resolve(this._settings.cwd,t.base)}_getReaderOptions(e){const t="."===e.base?"":e.base;return{basePath:t,pathSegmentSeparator:"/",concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(t,e.positive,e.negative),entryFilter:this.entryFilter.getFilter(e.positive,e.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0,strictSlashes:!1}}},ph}function xh(){if(Ah)return Ff;Ah=1,Object.defineProperty(Ff,"__esModule",{value:!0});const e=function(){if(oh)return Hf;oh=1,Object.defineProperty(Hf,"__esModule",{value:!0});const e=th(),t=sh(),n=ch();class r extends t.default{constructor(){super(...arguments),this._walkAsync=e.walk,this._readerStream=new n.default(this._settings)}dynamic(e,t){return new Promise((n,r)=>{this._walkAsync(e,t,(e,t)=>{null===e?n(t):r(e)})})}async static(e,t){const n=[],r=this._readerStream.static(e,t);return new Promise((e,t)=>{r.once("error",t),r.on("data",e=>n.push(e)),r.once("end",()=>e(n))})}}return Hf.default=r,Hf}(),t=Eh();class n extends t.default{constructor(){super(...arguments),this._reader=new e.default(this._settings)}async read(e){const t=this._getRootDirectory(e),n=this._getReaderOptions(e);return(await this.api(t,e,n)).map(e=>n.transform(e))}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}}return Ff.default=n,Ff}var $h,Oh={};var Rh,Ch,Th={},Nh={};function Ph(){if(Ch)return Th;Ch=1,Object.defineProperty(Th,"__esModule",{value:!0});const e=function(){if(Rh)return Nh;Rh=1,Object.defineProperty(Nh,"__esModule",{value:!0});const e=ap(),t=th(),n=sh();class r extends n.default{constructor(){super(...arguments),this._walkSync=t.walkSync,this._statSync=e.statSync}dynamic(e,t){return this._walkSync(e,t)}static(e,t){const n=[];for(const r of e){const e=this._getFullEntryPath(r),s=this._getEntry(e,r,t);null!==s&&t.entryFilter(s)&&n.push(s)}return n}_getEntry(e,t,n){try{const n=this._getStat(e);return this._makeEntry(n,t)}catch(e){if(n.errorFilter(e))return null;throw e}}_getStat(e){return this._statSync(e,this._fsStatSettings)}}return Nh.default=r,Nh}(),t=Eh();class n extends t.default{constructor(){super(...arguments),this._reader=new e.default(this._settings)}read(e){const t=this._getRootDirectory(e),n=this._getReaderOptions(e);return this.api(t,e,n).map(n.transform)}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}}return Th.default=n,Th}var Lh,Ih,Mh,Dh={};var jh,Fh,Hh=function(){if(Mh)return Ih;Mh=1;const e=function(){if(Lf)return pl;Lf=1,Object.defineProperty(pl,"__esModule",{value:!0}),pl.convertPatternGroupToTask=pl.convertPatternGroupsToTasks=pl.groupPatternsByBaseDirectory=pl.getNegativePatternsAsPositive=pl.getPositivePatterns=pl.convertPatternsToTasks=pl.generate=void 0;const e=Df();function t(t,n){let r=t;return n.braceExpansion&&(r=e.pattern.expandPatternsWithBraceExpansion(r)),n.baseNameMatch&&(r=r.map(e=>e.includes("/")?e:`**/${e}`)),r.map(t=>e.pattern.removeDuplicateSlashes(t))}function n(t,n,r){const s=[],c=e.pattern.getPatternsOutsideCurrentDirectory(t),u=e.pattern.getPatternsInsideCurrentDirectory(t),l=i(c),f=i(u);return s.push(...o(l,n,r)),"."in f?s.push(a(".",u,n,r)):s.push(...o(f,n,r)),s}function r(t){return e.pattern.getPositivePatterns(t)}function s(t,n){return e.pattern.getNegativePatterns(t).concat(n).map(e.pattern.convertToPositivePattern)}function i(t){return t.reduce((t,n)=>{const r=e.pattern.getBaseDirectory(n);return r in t?t[r].push(n):t[r]=[n],t},{})}function o(e,t,n){return Object.keys(e).map(r=>a(r,e[r],t,n))}function a(t,n,r,s){return{dynamic:s,positive:n,negative:r,base:t,patterns:[].concat(n,r.map(e.pattern.convertToNegativePattern))}}return pl.generate=function(i,o){const a=t(i,o),c=t(o.ignore,o),u=r(a),l=s(a,c),f=u.filter(t=>e.pattern.isStaticPattern(t,o)),p=u.filter(t=>e.pattern.isDynamicPattern(t,o)),h=n(f,l,!1),d=n(p,l,!0);return h.concat(d)},pl.convertPatternsToTasks=n,pl.getPositivePatterns=r,pl.getNegativePatternsAsPositive=s,pl.groupPatternsByBaseDirectory=i,pl.convertPatternGroupsToTasks=o,pl.convertPatternGroupToTask=a,pl}(),t=xh(),n=function(){if($h)return Oh;$h=1,Object.defineProperty(Oh,"__esModule",{value:!0});const e=R,t=ch(),n=Eh();class r extends n.default{constructor(){super(...arguments),this._reader=new t.default(this._settings)}read(t){const n=this._getRootDirectory(t),r=this._getReaderOptions(t),s=this.api(n,t,r),i=new e.Readable({objectMode:!0,read:()=>{}});return s.once("error",e=>i.emit("error",e)).on("data",e=>i.emit("data",r.transform(e))).once("end",()=>i.emit("end")),i.once("close",()=>s.destroy()),i}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}}return Oh.default=r,Oh}(),r=Ph(),s=(Lh||(Lh=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;const t=T,n=x,r=Math.max(n.cpus().length,1);e.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:t.lstat,lstatSync:t.lstatSync,stat:t.stat,statSync:t.statSync,readdir:t.readdir,readdirSync:t.readdirSync},e.default=class{constructor(e={}){this._options=e,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,r),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0),this.ignore=[].concat(this.ignore)}_getValue(e,t){return void 0===e?t:e}_getFileSystemMethods(t={}){return Object.assign(Object.assign({},e.DEFAULT_FILE_SYSTEM_ADAPTER),t)}}}(Dh)),Dh),i=Df();async function o(e,n){c(e);const r=a(e,t.default,n),s=await Promise.all(r);return i.array.flatten(s)}function a(t,n,r){const i=[].concat(t),o=new s.default(r),a=e.generate(i,o),c=new n(o);return a.map(c.read,c)}function c(e){if(![].concat(e).every(e=>i.string.isString(e)&&!i.string.isEmpty(e)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}return function(t){function o(e,t){c(e);const n=a(e,r.default,t);return i.array.flatten(n)}function u(e,t){c(e);const r=a(e,n.default,t);return i.stream.merge(r)}var l,f;t.glob=t,t.globSync=o,t.globStream=u,t.async=t,t.sync=o,t.stream=u,t.generateTasks=function(t,n){c(t);const r=[].concat(t),i=new s.default(n);return e.generate(r,i)},t.isDynamicPattern=function(e,t){c(e);const n=new s.default(t);return i.pattern.isDynamicPattern(e,n)},t.escapePath=function(e){return c(e),i.path.escape(e)},t.convertPathToPattern=function(e){return c(e),i.path.convertPathToPattern(e)},(l=t.posix||(t.posix={})).escapePath=function(e){return c(e),i.path.escapePosixPath(e)},l.convertPathToPattern=function(e){return c(e),i.path.convertPosixPathToPattern(e)},(f=t.win32||(t.win32={})).escapePath=function(e){return c(e),i.path.escapeWindowsPath(e)},f.convertPathToPattern=function(e){return c(e),i.path.convertWindowsPathToPattern(e)}}(o||(o={})),Ih=o}(),Bh=z(Hh);var zh=function(){if(Fh)return jh;Fh=1;var e=Nl(),t=$.posix.dirname,n="win32"===x.platform(),r="/",s=/\\/g,i=/\\([!*?|[\](){}])/g;function o(t){return!!/\([^()]+$/.test(t)||("{"===t[0]||"["===t[0]||(!!/[^\\][{[]/.test(t)||e(t)))}return jh=function(e,a){Object.assign({flipBackslashes:!0},a).flipBackslashes&&n&&e.indexOf(r)<0&&(e=e.replace(s,r)),function(e){var t;switch(e.slice(-1)){case"}":t="{";break;case"]":t="[";break;default:return!1}var n=e.indexOf(t);if(n<0)return!1;return e.slice(n+1,-1).includes(r)}(e)&&(e+=r),e+="a";do{e=t(e)}while(o(e));return e.replace(i,"$1")}}(),Kh=z(zh);const Uh=e=>""!==e&&".."!==e,qh=e=>{if("string"!=typeof e||!e.trim())return null;const t=e.trim().replace(/[^A-Za-z0-9@/_-]/g,"_").replace(/\/{2,}/g,"/").trim().split("/").filter(e=>e.length>0);if(0===t.length)return null;for(const e of t)if(!Uh(e))return null;return t.join("/")},Zh=async e=>{try{return(await s(e)).isFile()}catch{return!1}},Gh=async e=>{const{cwd:t,stanPath:n,map:r,onStage:s}=e;if(!r||"object"!=typeof r)return;const i=pe(t,n),o=p.join(i.rootAbs,"imports");await g(o);const a=Object.keys(r).sort();for(const e of a){const n=r[e]??[];if(!Array.isArray(n)||0===n.length)continue;const i=qh(e);if(!i)continue;const a=p.join(o,i);await f(a,{recursive:!0,force:!0}).catch(()=>{}),await g(a).catch(()=>{});const u=[];for(const e of n){const n=String(e??"").trim();if(!n)continue;const r=Kh(n.replace(/\\/g,"/"));try{const e=await Bh(n,{cwd:t,absolute:!0,dot:!0,onlyFiles:!1,followSymbolicLinks:!1});for(const n of e){if(!await Zh(n))continue;const e=p.relative(p.isAbsolute(r)?r:p.resolve(t,r),n).replace(/\\/g,"/");if(!e||e.includes(".."))continue;const s=p.join(a,e);await g(p.dirname(s)).catch(()=>{});try{await c(n,s),u.push(s)}catch{}}}catch{}}try{if("function"==typeof s){s(i,u.map(e=>p.relative(t,e).replace(/\\/g,"/")))}}catch{}}},Wh=()=>{const e=(()=>{try{const e=w(import.meta.url);return Ae({cwd:p.dirname(e)})??null}catch{return null}})();if(!e)return null;const n=p.join(e,"dist","stan.system.md");return t(n)?n:null},Vh=e=>e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),Yh=async(e,n)=>{const r=p.join(e,n,"system"),s=p.join(r,"parts"),o=p.join(r,"stan.system.md");if(await g(r),!t(s))return{target:o,action:"skipped-no-parts",partsDir:s};const c=(await a(s,{withFileTypes:!0})).filter(e=>e.isFile()&&e.name.toLowerCase().endsWith(".md")).map(e=>e.name).sort((e,t)=>e.localeCompare(t,void 0,{numeric:!0}));if(0===c.length)return{target:o,action:"skipped-no-md",partsDir:s};const l=[];for(const e of c){const t=p.join(s,e),n=Vh(await i(t,"utf8")).trimEnd();l.push(n)}const f=(e=>`\x3c!-- GENERATED: assembled from ${e}/system/parts; edit parts and run \`npm run gen:system\` --\x3e\n`)(n)+l.join("\n\n")+"\n";return await u(o,f,"utf8"),{target:o,action:"written"}};const Qh="0.1.2";export{Qh as CORE_VERSION,we as DEFAULT_OPEN_COMMAND,_e as DEFAULT_STAN_PATH,Uu as __internal,ll as applyPatchPipeline,ul as applyWithJsDiff,Yh as assembleSystemMonolith,be as createArchive,Cu as createArchiveDiff,Vu as detectAndCleanPatch,xu as ensureOutputDir,Xu as executeFileOps,xe as findConfigPathSync,Wh as getPackagedSystemPromptPath,Au as loadConfig,Su as loadConfigSync,Ju as parseFileOpsBlock,Gh as prepareImports,Eu as resolveStanPath,ku as resolveStanPathSync,Ku as validateOrThrow,zu as validateResponseMessage,Ru as writeArchiveSnapshot};
1
+ import e,{existsSync as t,readFileSync as n,rmSync as r}from"node:fs";import{stat as s,readFile as i,open as o,readdir as a,copyFile as c,writeFile as u,mkdir as l,rm as f}from"node:fs/promises";import p,{resolve as h,join as d,dirname as m}from"node:path";import{ensureDir as g,pathExists as y,move as v,remove as _}from"fs-extra";import b from"node:process";import{fileURLToPath as w}from"node:url";import S from"process";import A from"buffer";import{createHash as k}from"node:crypto";import{spawn as E}from"node:child_process";import x from"os";import $ from"path";import O from"util";import R from"stream";import C from"events";import T from"fs";const P="archive.tar",L="archive.prev.tar",N=e=>e.replace(/\\/g,"/"),I=(e,t)=>{const n=N(e).replace(/\/+$/,""),r=N(t);return r===n||r.startsWith(`${n}/`)},M=(e,t)=>{const n=N(e);return I(`${n}/diff`,t)||I(`${n}/patch`,t)},D=I,j=e=>{const t=e.replace(/\\/g,"/");return e=>!(M(t,e)||((e,t)=>{const n=N(e);return N(t)===`${n}/output/${P}`||N(t)===`${n}/output/archive.diff.tar`||N(t)===`${n}/output/archive.warnings.txt`})(t,e))},H=1048576,F=async(e,t)=>{const n=[],r=[],a=[];await Promise.all(t.map(async t=>{const c=t.replace(/\\/g,"/");const u=h(e,t);let l=null;try{l=await s(u)}catch{return}const f=l?.size??0;let p,d=!1;try{d=await(async e=>{try{const t=await o(e,"r");try{const e=Buffer.allocUnsafe(8192),{bytesRead:n}=await t.read(e,0,e.length,0);for(let t=0;t<n;t+=1)if(0===e[t])return!0;return!1}finally{await t.close().catch(()=>{})}}catch{return!1}})(u)}catch{d=!1}if(d)return void r.push({path:c,size:f});n.push(c);try{if(f<=H||f<5*H){p=(e=>{const t=e.replace(/\r\n/g,"\n");return 0===t.length?0:t.split("\n").length})(await i(u,"utf8"))}}catch{}(f>H||"number"==typeof p&&p>3e3)&&a.push({path:c,size:f,loc:p})}));const c=[];if(r.length>0){c.push(`Binary files excluded from archive (${r.length.toString()}):`);for(const e of r)c.push(` - ${e.path} (${e.size.toString()} bytes)`);c.push("")}if(a.length>0){c.push(`Large text files (included; consider excludes if unwanted) (${a.length.toString()}):`);for(const e of a){const t=[` - ${e.path}`,`(${e.size.toString()} bytes)`];"number"==typeof e.loc&&t.push(`${e.loc.toString()} LOC`),c.push(t.join(" "))}c.push(""),c.push(`Thresholds: size > ${H.toString()} bytes or LOC > ${3e3.toString()}`)}0===c.length&&c.push("No archive warnings.");const u=c.join("\n")+(c.length?"\n":"");return{textFiles:n,excludedBinaries:r,largeText:a,warningsBody:u}};var B="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function z(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var K,U={exports:{}};var q,Z,W,G,V,Y,Q,J,X,ee,te,ne=(K||(K=1,function(e){function t(e){return Array.isArray(e)?e:[e]}const n=/^\s+$/,r=/(?:[^\\]|^)\\$/,s=/^\\!/,i=/^\\#/,o=/\r?\n/g,a=/^\.{0,2}\/|^\.{1,2}$/,c=/\/$/,u="/";let l="node-ignore";"undefined"!=typeof Symbol&&(l=Symbol.for("node-ignore"));const f=l,p=(e,t,n)=>(Object.defineProperty(e,t,{value:n}),n),h=/([0-z])-([0-z])/g,d=()=>!1,m=[[/^\uFEFF/,()=>""],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,n)=>t+(0===n.indexOf("\\")?" ":"")],[/(\\+?)\s/g,(e,t)=>{const{length:n}=t;return t.slice(0,n-n%2)+" "}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,n)=>t+6<n.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,n)=>t+n.replace(/\\\*/g,"[^\\/]*")],[/\\\\\\(?=[$.|*+(){^])/g,()=>"\\"],[/\\\\/g,()=>"\\"],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,n,r,s)=>"\\"===t?`\\[${n}${(e=>{const{length:t}=e;return e.slice(0,t-t%2)})(r)}${s}`:"]"===s&&r.length%2==0?`[${(e=>e.replace(h,(e,t,n)=>t.charCodeAt(0)<=n.charCodeAt(0)?e:""))(n)}${r}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`]],g=/(^|\\\/)?\\\*$/,y="regex",v="checkRegex",_={[y]:(e,t)=>(t?`${t}[^/]+`:"[^/]*")+"(?=$|\\/$)",[v]:(e,t)=>(t?`${t}[^/]*`:"[^/]*")+"(?=$|\\/$)"},b=e=>"string"==typeof e;class w{constructor(e,t,n,r,s,i){this.pattern=e,this.mark=t,this.negative=s,p(this,"body",n),p(this,"ignoreCase",r),p(this,"regexPrefix",i)}get regex(){const e="_"+y;return this[e]?this[e]:this._make(y,e)}get checkRegex(){const e="_"+v;return this[e]?this[e]:this._make(v,e)}_make(e,t){const n=this.regexPrefix.replace(g,_[e]),r=this.ignoreCase?new RegExp(n,"i"):new RegExp(n);return p(this,t,r)}}const S=({pattern:e,mark:t},n)=>{let r=!1,o=e;0===o.indexOf("!")&&(r=!0,o=o.substr(1)),o=o.replace(s,"!").replace(i,"#");const a=(e=>m.reduce((t,[n,r])=>t.replace(n,r.bind(e)),e))(o);return new w(e,t,o,n,r,a)};class A{constructor(e){this._ignoreCase=e,this._rules=[]}_add(e){if(e&&e[f])return this._rules=this._rules.concat(e._rules._rules),void(this._added=!0);if(b(e)&&(e={pattern:e}),(e=>e&&b(e)&&!n.test(e)&&!r.test(e)&&0!==e.indexOf("#"))(e.pattern)){const t=S(e,this._ignoreCase);this._added=!0,this._rules.push(t)}}add(e){return this._added=!1,t(b(e)?(e=>e.split(o).filter(Boolean))(e):e).forEach(this._add,this),this._added}test(e,t,n){let r,s=!1,i=!1;this._rules.forEach(o=>{const{negative:a}=o;i===a&&s!==i||a&&!s&&!i&&!t||o[n].test(e)&&(s=!a,i=a,r=a?void 0:o)});const o={ignored:s,unignored:i};return r&&(o.rule=r),o}}const k=(e,t)=>{throw new t(e)},E=(e,t,n)=>b(e)?e?!E.isNotRelative(e)||n(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):n("path must not be empty",TypeError):n(`path must be a string, but got \`${t}\``,TypeError),x=e=>a.test(e);E.isNotRelative=x,E.convert=e=>e;class ${constructor({ignorecase:e=!0,ignoreCase:t=e,allowRelativePaths:n=!1}={}){p(this,f,!0),this._rules=new A(t),this._strictPathCheck=!n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(e){return this._rules.add(e)&&this._initCache(),this}addPattern(e){return this.add(e)}_test(e,t,n,r){const s=e&&E.convert(e);return E(s,e,this._strictPathCheck?k:d),this._t(s,t,n,r)}checkIgnore(e){if(!c.test(e))return this.test(e);const t=e.split(u).filter(Boolean);if(t.pop(),t.length){const e=this._t(t.join(u)+u,this._testCache,!0,t);if(e.ignored)return e}return this._rules.test(e,!1,v)}_t(e,t,n,r){if(e in t)return t[e];if(r||(r=e.split(u).filter(Boolean)),r.pop(),!r.length)return t[e]=this._rules.test(e,n,y);const s=this._t(r.join(u)+u,t,n,r);return t[e]=s.ignored?s:this._rules.test(e,n,y)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return t(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}}const O=e=>new $(e),R=()=>{E.convert=e=>/^\\\\\?\\/.test(e)||/["<>|\u0000-\u001F]+/u.test(e)?e:e.replace(/\\/g,"/");const e=/^[a-z]:\//i;E.isNotRelative=t=>e.test(t)||x(t)};"undefined"!=typeof process&&"win32"===process.platform&&R(),e.exports=O,O.default=O,e.exports.isPathValid=e=>E(e&&E.convert(e),e,d),p(e.exports,Symbol.for("setupWindows"),R)}(U)),U.exports),re=z(ne),se={};function ie(){if(Z)return q;Z=1;const e="\\\\/",t=`[^${e}]`,n="\\.",r="\\/",s="[^/]",i=`(?:${r}|$)`,o=`(?:^|${r})`,a=`${n}{1,2}${i}`,c={DOT_LITERAL:n,PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:r,ONE_CHAR:"(?=.)",QMARK:s,END_ANCHOR:i,DOTS_SLASH:a,NO_DOT:`(?!${n})`,NO_DOTS:`(?!${o}${a})`,NO_DOT_SLASH:`(?!${n}{0,1}${i})`,NO_DOTS_SLASH:`(?!${a})`,QMARK_NO_DOT:`[^.${r}]`,STAR:`${s}*?`,START_ANCHOR:o,SEP:"/"},u={...c,SLASH_LITERAL:`[${e}]`,QMARK:t,STAR:`${t}*?`,DOTS_SLASH:`${n}{1,2}(?:[${e}]|$)`,NO_DOT:`(?!${n})`,NO_DOTS:`(?!(?:^|[${e}])${n}{1,2}(?:[${e}]|$))`,NO_DOT_SLASH:`(?!${n}{0,1}(?:[${e}]|$))`,NO_DOTS_SLASH:`(?!${n}{1,2}(?:[${e}]|$))`,QMARK_NO_DOT:`[^.${e}]`,START_ANCHOR:`(?:^|[${e}])`,END_ANCHOR:`(?:[${e}]|$)`,SEP:"\\"};return q={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{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"},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:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?u:c}}function oe(){return W||(W=1,function(e){const{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:s}=ie();e.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),e.hasRegexChars=e=>r.test(e),e.isRegexChar=t=>1===t.length&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(s,"\\$1"),e.toPosixSlashes=e=>e.replace(t,"/"),e.isWindows=()=>{if("undefined"!=typeof navigator&&navigator.platform){const e=navigator.platform.toLowerCase();return"win32"===e||"windows"===e}return!("undefined"==typeof process||!process.platform)&&"win32"===process.platform},e.removeBackslashes=e=>e.replace(n,e=>"\\"===e?"":e),e.escapeLast=(t,n,r)=>{const s=t.lastIndexOf(n,r);return-1===s?t:"\\"===t[s-1]?e.escapeLast(t,n,s-1):`${t.slice(0,s)}\\${t.slice(s)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith("./")&&(n=n.slice(2),t.prefix="./"),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?"":"^"}(?:${e})${n.contains?"":"$"}`;return!0===t.negated&&(r=`(?:^(?!${r}).*$)`),r},e.basename=(e,{windows:t}={})=>{const n=e.split(t?/[\\/]/:"/"),r=n[n.length-1];return""===r?n[n.length-2]:r}}(se)),se}function ae(){if(V)return G;V=1;const e=oe(),{CHAR_ASTERISK:t,CHAR_AT:n,CHAR_BACKWARD_SLASH:r,CHAR_COMMA:s,CHAR_DOT:i,CHAR_EXCLAMATION_MARK:o,CHAR_FORWARD_SLASH:a,CHAR_LEFT_CURLY_BRACE:c,CHAR_LEFT_PARENTHESES:u,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:f,CHAR_QUESTION_MARK:p,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:d,CHAR_RIGHT_SQUARE_BRACKET:m}=ie(),g=e=>e===a||e===r,y=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};return G=(v,_)=>{const b=_||{},w=v.length-1,S=!0===b.parts||!0===b.scanToEnd,A=[],k=[],E=[];let x,$,O=v,R=-1,C=0,T=0,P=!1,L=!1,N=!1,I=!1,M=!1,D=!1,j=!1,H=!1,F=!1,B=!1,z=0,K={value:"",depth:0,isGlob:!1};const U=()=>R>=w,q=()=>O.charCodeAt(R+1),Z=()=>(x=$,O.charCodeAt(++R));for(;R<w;){let e;if($=Z(),$!==r){if(!0===D||$===c){for(z++;!0!==U()&&($=Z());)if($!==r)if($!==c){if(!0!==D&&$===i&&($=Z())===i){if(P=K.isBrace=!0,N=K.isGlob=!0,B=!0,!0===S)continue;break}if(!0!==D&&$===s){if(P=K.isBrace=!0,N=K.isGlob=!0,B=!0,!0===S)continue;break}if($===h&&(z--,0===z)){D=!1,P=K.isBrace=!0,B=!0;break}}else z++;else j=K.backslashes=!0,Z();if(!0===S)continue;break}if($!==a){if(!0!==b.noext){if(!0===($===f||$===n||$===t||$===p||$===o)&&q()===u){if(N=K.isGlob=!0,I=K.isExtglob=!0,B=!0,$===o&&R===C&&(F=!0),!0===S){for(;!0!==U()&&($=Z());)if($!==r){if($===d){N=K.isGlob=!0,B=!0;break}}else j=K.backslashes=!0,$=Z();continue}break}}if($===t){if(x===t&&(M=K.isGlobstar=!0),N=K.isGlob=!0,B=!0,!0===S)continue;break}if($===p){if(N=K.isGlob=!0,B=!0,!0===S)continue;break}if($===l){for(;!0!==U()&&(e=Z());)if(e!==r){if(e===m){L=K.isBracket=!0,N=K.isGlob=!0,B=!0;break}}else j=K.backslashes=!0,Z();if(!0===S)continue;break}if(!0===b.nonegate||$!==o||R!==C){if(!0!==b.noparen&&$===u){if(N=K.isGlob=!0,!0===S){for(;!0!==U()&&($=Z());)if($!==u){if($===d){B=!0;break}}else j=K.backslashes=!0,$=Z();continue}break}if(!0===N){if(B=!0,!0===S)continue;break}}else H=K.negated=!0,C++}else{if(A.push(R),k.push(K),K={value:"",depth:0,isGlob:!1},!0===B)continue;if(x===i&&R===C+1){C+=2;continue}T=R+1}}else j=K.backslashes=!0,$=Z(),$===c&&(D=!0)}!0===b.noext&&(I=!1,N=!1);let W=O,G="",V="";C>0&&(G=O.slice(0,C),O=O.slice(C),T-=C),W&&!0===N&&T>0?(W=O.slice(0,T),V=O.slice(T)):!0===N?(W="",V=O):W=O,W&&""!==W&&"/"!==W&&W!==O&&g(W.charCodeAt(W.length-1))&&(W=W.slice(0,-1)),!0===b.unescape&&(V&&(V=e.removeBackslashes(V)),W&&!0===j&&(W=e.removeBackslashes(W)));const Y={prefix:G,input:v,start:C,base:W,glob:V,isBrace:P,isBracket:L,isGlob:N,isExtglob:I,isGlobstar:M,negated:H,negatedExtglob:F};if(!0===b.tokens&&(Y.maxDepth=0,g($)||k.push(K),Y.tokens=k),!0===b.parts||!0===b.tokens){let e;for(let t=0;t<A.length;t++){const n=e?e+1:C,r=A[t],s=v.slice(n,r);b.tokens&&(0===t&&0!==C?(k[t].isPrefix=!0,k[t].value=G):k[t].value=s,y(k[t]),Y.maxDepth+=k[t].depth),0===t&&""===s||E.push(s),e=r}if(e&&e+1<v.length){const t=v.slice(e+1);E.push(t),b.tokens&&(k[k.length-1].value=t,y(k[k.length-1]),Y.maxDepth+=k[k.length-1].depth)}Y.slashes=A,Y.parts=E}return Y},G}function ce(){if(Q)return Y;Q=1;const e=ie(),t=oe(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_BACKREF:i,REPLACEMENTS:o}=e,a=(e,n)=>{if("function"==typeof n.expandRange)return n.expandRange(...e,n);e.sort();const r=`[${e.join("-")}]`;try{new RegExp(r)}catch(n){return e.map(e=>t.escapeRegex(e)).join("..")}return r},c=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,u=(l,f)=>{if("string"!=typeof l)throw new TypeError("Expected a string");l=o[l]||l;const p={...f},h="number"==typeof p.maxLength?Math.min(n,p.maxLength):n;let d=l.length;if(d>h)throw new SyntaxError(`Input length: ${d}, exceeds maximum allowed length: ${h}`);const m={type:"bos",value:"",output:p.prepend||""},g=[m],y=p.capture?"":"?:",v=e.globChars(p.windows),_=e.extglobChars(v),{DOT_LITERAL:b,PLUS_LITERAL:w,SLASH_LITERAL:S,ONE_CHAR:A,DOTS_SLASH:k,NO_DOT:E,NO_DOT_SLASH:x,NO_DOTS_SLASH:$,QMARK:O,QMARK_NO_DOT:R,STAR:C,START_ANCHOR:T}=v,P=e=>`(${y}(?:(?!${T}${e.dot?k:b}).)*?)`,L=p.dot?"":E,N=p.dot?O:R;let I=!0===p.bash?P(p):C;p.capture&&(I=`(${I})`),"boolean"==typeof p.noext&&(p.noextglob=p.noext);const M={input:l,index:-1,start:0,dot:!0===p.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:g};l=t.removePrefix(l,M),d=l.length;const D=[],j=[],H=[];let F,B=m;const z=()=>M.index===d-1,K=M.peek=(e=1)=>l[M.index+e],U=M.advance=()=>l[++M.index]||"",q=()=>l.slice(M.index+1),Z=(e="",t=0)=>{M.consumed+=e,M.index+=t},W=e=>{M.output+=null!=e.output?e.output:e.value,Z(e.value)},G=()=>{let e=1;for(;"!"===K()&&("("!==K(2)||"?"===K(3));)U(),M.start++,e++;return e%2!=0&&(M.negated=!0,M.start++,!0)},V=e=>{M[e]++,H.push(e)},Y=e=>{M[e]--,H.pop()},Q=e=>{if("globstar"===B.type){const t=M.braces>0&&("comma"===e.type||"brace"===e.type),n=!0===e.extglob||D.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||n||(M.output=M.output.slice(0,-B.output.length),B.type="star",B.value="*",B.output=I,M.output+=B.output)}if(D.length&&"paren"!==e.type&&(D[D.length-1].inner+=e.value),(e.value||e.output)&&W(e),B&&"text"===B.type&&"text"===e.type)return B.output=(B.output||B.value)+e.value,void(B.value+=e.value);e.prev=B,g.push(e),B=e},J=(e,t)=>{const n={..._[t],conditions:1,inner:""};n.prev=B,n.parens=M.parens,n.output=M.output;const r=(p.capture?"(":"")+n.open;V("parens"),Q({type:e,value:t,output:M.output?"":A}),Q({type:"paren",extglob:!0,value:U(),output:r}),D.push(n)},X=e=>{let t,n=e.close+(p.capture?")":"");if("negate"===e.type){let r=I;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(r=P(p)),(r!==I||z()||/^\)+$/.test(q()))&&(n=e.close=`)$))${r}`),e.inner.includes("*")&&(t=q())&&/^\.[^\\/.]+$/.test(t)){const s=u(t,{...f,fastpaths:!1}).output;n=e.close=`)${s})${r})`}"bos"===e.prev.type&&(M.negatedExtglob=!0)}Q({type:"paren",extglob:!0,value:F,output:n}),Y("parens")};if(!1!==p.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(l)){let e=!1,n=l.replace(i,(t,n,r,s,i,o)=>"\\"===s?(e=!0,t):"?"===s?n?n+s+(i?O.repeat(i.length):""):0===o?N+(i?O.repeat(i.length):""):O.repeat(r.length):"."===s?b.repeat(r.length):"*"===s?n?n+s+(i?I:""):I:n?t:`\\${t}`);return!0===e&&(n=!0===p.unescape?n.replace(/\\/g,""):n.replace(/\\+/g,e=>e.length%2==0?"\\\\":e?"\\":"")),n===l&&!0===p.contains?(M.output=l,M):(M.output=t.wrapOutput(n,M,f),M)}for(;!z();){if(F=U(),"\0"===F)continue;if("\\"===F){const e=K();if("/"===e&&!0!==p.bash)continue;if("."===e||";"===e)continue;if(!e){F+="\\",Q({type:"text",value:F});continue}const t=/^\\+/.exec(q());let n=0;if(t&&t[0].length>2&&(n=t[0].length,M.index+=n,n%2!=0&&(F+="\\")),!0===p.unescape?F=U():F+=U(),0===M.brackets){Q({type:"text",value:F});continue}}if(M.brackets>0&&("]"!==F||"["===B.value||"[^"===B.value)){if(!1!==p.posix&&":"===F){const e=B.value.slice(1);if(e.includes("[")&&(B.posix=!0,e.includes(":"))){const e=B.value.lastIndexOf("["),t=B.value.slice(0,e),n=B.value.slice(e+2),s=r[n];if(s){B.value=t+s,M.backtrack=!0,U(),m.output||1!==g.indexOf(B)||(m.output=A);continue}}}("["===F&&":"!==K()||"-"===F&&"]"===K())&&(F=`\\${F}`),"]"!==F||"["!==B.value&&"[^"!==B.value||(F=`\\${F}`),!0===p.posix&&"!"===F&&"["===B.value&&(F="^"),B.value+=F,W({value:F});continue}if(1===M.quotes&&'"'!==F){F=t.escapeRegex(F),B.value+=F,W({value:F});continue}if('"'===F){M.quotes=1===M.quotes?0:1,!0===p.keepQuotes&&Q({type:"text",value:F});continue}if("("===F){V("parens"),Q({type:"paren",value:F});continue}if(")"===F){if(0===M.parens&&!0===p.strictBrackets)throw new SyntaxError(c("opening","("));const e=D[D.length-1];if(e&&M.parens===e.parens+1){X(D.pop());continue}Q({type:"paren",value:F,output:M.parens?")":"\\)"}),Y("parens");continue}if("["===F){if(!0!==p.nobracket&&q().includes("]"))V("brackets");else{if(!0!==p.nobracket&&!0===p.strictBrackets)throw new SyntaxError(c("closing","]"));F=`\\${F}`}Q({type:"bracket",value:F});continue}if("]"===F){if(!0===p.nobracket||B&&"bracket"===B.type&&1===B.value.length){Q({type:"text",value:F,output:`\\${F}`});continue}if(0===M.brackets){if(!0===p.strictBrackets)throw new SyntaxError(c("opening","["));Q({type:"text",value:F,output:`\\${F}`});continue}Y("brackets");const e=B.value.slice(1);if(!0===B.posix||"^"!==e[0]||e.includes("/")||(F=`/${F}`),B.value+=F,W({value:F}),!1===p.literalBrackets||t.hasRegexChars(e))continue;const n=t.escapeRegex(B.value);if(M.output=M.output.slice(0,-B.value.length),!0===p.literalBrackets){M.output+=n,B.value=n;continue}B.value=`(${y}${n}|${B.value})`,M.output+=B.value;continue}if("{"===F&&!0!==p.nobrace){V("braces");const e={type:"brace",value:F,output:"(",outputIndex:M.output.length,tokensIndex:M.tokens.length};j.push(e),Q(e);continue}if("}"===F){const e=j[j.length-1];if(!0===p.nobrace||!e){Q({type:"text",value:F,output:F});continue}let t=")";if(!0===e.dots){const e=g.slice(),n=[];for(let t=e.length-1;t>=0&&(g.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&n.unshift(e[t].value);t=a(n,p),M.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const n=M.output.slice(0,e.outputIndex),r=M.tokens.slice(e.tokensIndex);e.value=e.output="\\{",F=t="\\}",M.output=n;for(const e of r)M.output+=e.output||e.value}Q({type:"brace",value:F,output:t}),Y("braces"),j.pop();continue}if("|"===F){D.length>0&&D[D.length-1].conditions++,Q({type:"text",value:F});continue}if(","===F){let e=F;const t=j[j.length-1];t&&"braces"===H[H.length-1]&&(t.comma=!0,e="|"),Q({type:"comma",value:F,output:e});continue}if("/"===F){if("dot"===B.type&&M.index===M.start+1){M.start=M.index+1,M.consumed="",M.output="",g.pop(),B=m;continue}Q({type:"slash",value:F,output:S});continue}if("."===F){if(M.braces>0&&"dot"===B.type){"."===B.value&&(B.output=b);const e=j[j.length-1];B.type="dots",B.output+=F,B.value+=F,e.dots=!0;continue}if(M.braces+M.parens===0&&"bos"!==B.type&&"slash"!==B.type){Q({type:"text",value:F,output:b});continue}Q({type:"dot",value:F,output:b});continue}if("?"===F){if(!(B&&"("===B.value)&&!0!==p.noextglob&&"("===K()&&"?"!==K(2)){J("qmark",F);continue}if(B&&"paren"===B.type){const e=K();let t=F;("("===B.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(q()))&&(t=`\\${F}`),Q({type:"text",value:F,output:t});continue}if(!0!==p.dot&&("slash"===B.type||"bos"===B.type)){Q({type:"qmark",value:F,output:R});continue}Q({type:"qmark",value:F,output:O});continue}if("!"===F){if(!0!==p.noextglob&&"("===K()&&("?"!==K(2)||!/[!=<:]/.test(K(3)))){J("negate",F);continue}if(!0!==p.nonegate&&0===M.index){G();continue}}if("+"===F){if(!0!==p.noextglob&&"("===K()&&"?"!==K(2)){J("plus",F);continue}if(B&&"("===B.value||!1===p.regex){Q({type:"plus",value:F,output:w});continue}if(B&&("bracket"===B.type||"paren"===B.type||"brace"===B.type)||M.parens>0){Q({type:"plus",value:F});continue}Q({type:"plus",value:w});continue}if("@"===F){if(!0!==p.noextglob&&"("===K()&&"?"!==K(2)){Q({type:"at",extglob:!0,value:F,output:""});continue}Q({type:"text",value:F});continue}if("*"!==F){"$"!==F&&"^"!==F||(F=`\\${F}`);const e=s.exec(q());e&&(F+=e[0],M.index+=e[0].length),Q({type:"text",value:F});continue}if(B&&("globstar"===B.type||!0===B.star)){B.type="star",B.star=!0,B.value+=F,B.output=I,M.backtrack=!0,M.globstar=!0,Z(F);continue}let e=q();if(!0!==p.noextglob&&/^\([^?]/.test(e)){J("star",F);continue}if("star"===B.type){if(!0===p.noglobstar){Z(F);continue}const t=B.prev,n=t.prev,r="slash"===t.type||"bos"===t.type,s=n&&("star"===n.type||"globstar"===n.type);if(!0===p.bash&&(!r||e[0]&&"/"!==e[0])){Q({type:"star",value:F,output:""});continue}const i=M.braces>0&&("comma"===t.type||"brace"===t.type),o=D.length&&("pipe"===t.type||"paren"===t.type);if(!r&&"paren"!==t.type&&!i&&!o){Q({type:"star",value:F,output:""});continue}for(;"/**"===e.slice(0,3);){const t=l[M.index+4];if(t&&"/"!==t)break;e=e.slice(3),Z("/**",3)}if("bos"===t.type&&z()){B.type="globstar",B.value+=F,B.output=P(p),M.output=B.output,M.globstar=!0,Z(F);continue}if("slash"===t.type&&"bos"!==t.prev.type&&!s&&z()){M.output=M.output.slice(0,-(t.output+B.output).length),t.output=`(?:${t.output}`,B.type="globstar",B.output=P(p)+(p.strictSlashes?")":"|$)"),B.value+=F,M.globstar=!0,M.output+=t.output+B.output,Z(F);continue}if("slash"===t.type&&"bos"!==t.prev.type&&"/"===e[0]){const n=void 0!==e[1]?"|$":"";M.output=M.output.slice(0,-(t.output+B.output).length),t.output=`(?:${t.output}`,B.type="globstar",B.output=`${P(p)}${S}|${S}${n})`,B.value+=F,M.output+=t.output+B.output,M.globstar=!0,Z(F+U()),Q({type:"slash",value:"/",output:""});continue}if("bos"===t.type&&"/"===e[0]){B.type="globstar",B.value+=F,B.output=`(?:^|${S}|${P(p)}${S})`,M.output=B.output,M.globstar=!0,Z(F+U()),Q({type:"slash",value:"/",output:""});continue}M.output=M.output.slice(0,-B.output.length),B.type="globstar",B.output=P(p),B.value+=F,M.output+=B.output,M.globstar=!0,Z(F);continue}const n={type:"star",value:F,output:I};!0!==p.bash?!B||"bracket"!==B.type&&"paren"!==B.type||!0!==p.regex?(M.index!==M.start&&"slash"!==B.type&&"dot"!==B.type||("dot"===B.type?(M.output+=x,B.output+=x):!0===p.dot?(M.output+=$,B.output+=$):(M.output+=L,B.output+=L),"*"!==K()&&(M.output+=A,B.output+=A)),Q(n)):(n.output=F,Q(n)):(n.output=".*?","bos"!==B.type&&"slash"!==B.type||(n.output=L+n.output),Q(n))}for(;M.brackets>0;){if(!0===p.strictBrackets)throw new SyntaxError(c("closing","]"));M.output=t.escapeLast(M.output,"["),Y("brackets")}for(;M.parens>0;){if(!0===p.strictBrackets)throw new SyntaxError(c("closing",")"));M.output=t.escapeLast(M.output,"("),Y("parens")}for(;M.braces>0;){if(!0===p.strictBrackets)throw new SyntaxError(c("closing","}"));M.output=t.escapeLast(M.output,"{"),Y("braces")}if(!0===p.strictSlashes||"star"!==B.type&&"bracket"!==B.type||Q({type:"maybe_slash",value:"",output:`${S}?`}),!0===M.backtrack){M.output="";for(const e of M.tokens)M.output+=null!=e.output?e.output:e.value,e.suffix&&(M.output+=e.suffix)}return M};return u.fastpaths=(r,s)=>{const i={...s},a="number"==typeof i.maxLength?Math.min(n,i.maxLength):n,c=r.length;if(c>a)throw new SyntaxError(`Input length: ${c}, exceeds maximum allowed length: ${a}`);r=o[r]||r;const{DOT_LITERAL:u,SLASH_LITERAL:l,ONE_CHAR:f,DOTS_SLASH:p,NO_DOT:h,NO_DOTS:d,NO_DOTS_SLASH:m,STAR:g,START_ANCHOR:y}=e.globChars(i.windows),v=i.dot?d:h,_=i.dot?m:h,b=i.capture?"":"?:";let w=!0===i.bash?".*?":g;i.capture&&(w=`(${w})`);const S=e=>!0===e.noglobstar?w:`(${b}(?:(?!${y}${e.dot?p:u}).)*?)`,A=e=>{switch(e){case"*":return`${v}${f}${w}`;case".*":return`${u}${f}${w}`;case"*.*":return`${v}${w}${u}${f}${w}`;case"*/*":return`${v}${w}${l}${f}${_}${w}`;case"**":return v+S(i);case"**/*":return`(?:${v}${S(i)}${l})?${_}${f}${w}`;case"**/*.*":return`(?:${v}${S(i)}${l})?${_}${w}${u}${f}${w}`;case"**/.*":return`(?:${v}${S(i)}${l})?${u}${f}${w}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const n=A(t[1]);if(!n)return;return n+u+t[2]}}},k=t.removePrefix(r,{negated:!1,prefix:""});let E=A(k);return E&&!0!==i.strictSlashes&&(E+=`${l}?`),E},Y=u}function ue(){if(X)return J;X=1;const e=ae(),t=ce(),n=oe(),r=ie(),s=(e,t,n=!1)=>{if(Array.isArray(e)){const r=e.map(e=>s(e,t,n)),i=e=>{for(const t of r){const n=t(e);if(n)return n}return!1};return i}const r=(i=e)&&"object"==typeof i&&!Array.isArray(i)&&e.tokens&&e.input;var i;if(""===e||"string"!=typeof e&&!r)throw new TypeError("Expected pattern to be a non-empty string");const o=t||{},a=o.windows,c=r?s.compileRe(e,t):s.makeRe(e,t,!1,!0),u=c.state;delete c.state;let l=()=>!1;if(o.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};l=s(o.ignore,e,n)}const f=(n,r=!1)=>{const{isMatch:i,match:f,output:p}=s.test(n,c,t,{glob:e,posix:a}),h={glob:e,state:u,regex:c,posix:a,input:n,output:p,match:f,isMatch:i};return"function"==typeof o.onResult&&o.onResult(h),!1===i?(h.isMatch=!1,!!r&&h):l(n)?("function"==typeof o.onIgnore&&o.onIgnore(h),h.isMatch=!1,!!r&&h):("function"==typeof o.onMatch&&o.onMatch(h),!r||h)};return n&&(f.state=u),f};return s.test=(e,t,r,{glob:i,posix:o}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};const a=r||{},c=a.format||(o?n.toPosixSlashes:null);let u=e===i,l=u&&c?c(e):e;return!1===u&&(l=c?c(e):e,u=l===i),!1!==u&&!0!==a.capture||(u=!0===a.matchBase||!0===a.basename?s.matchBase(e,t,r,o):t.exec(l)),{isMatch:Boolean(u),match:u,output:l}},s.matchBase=(e,t,r)=>(t instanceof RegExp?t:s.makeRe(t,r)).test(n.basename(e)),s.isMatch=(e,t,n)=>s(t,n)(e),s.parse=(e,n)=>Array.isArray(e)?e.map(e=>s.parse(e,n)):t(e,{...n,fastpaths:!1}),s.scan=(t,n)=>e(t,n),s.compileRe=(e,t,n=!1,r=!1)=>{if(!0===n)return e.output;const i=t||{},o=i.contains?"":"^",a=i.contains?"":"$";let c=`${o}(?:${e.output})${a}`;e&&!0===e.negated&&(c=`^(?!${c}).*$`);const u=s.toRegex(c,t);return!0===r&&(u.state=e),u},s.makeRe=(e,n={},r=!1,i=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let o={negated:!1,fastpaths:!0};return!1===n.fastpaths||"."!==e[0]&&"*"!==e[0]||(o.output=t.fastpaths(e,n)),o.output||(o=t(e,n)),s.compileRe(o,n,r,i)},s.toRegex=(e,t)=>{try{const n=t||{};return new RegExp(e,n.flags||(n.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},s.constants=r,J=s}function le(){if(te)return ee;te=1;const e=ue(),t=oe();function n(n,r,s=!1){return!r||null!==r.windows&&void 0!==r.windows||(r={...r,windows:t.isWindows()}),e(n,r,s)}return Object.assign(n,e),ee=n}var fe=z(le());const pe=(e,t)=>{const n=t.replace(/\\/g,"/").replace(/^\.\/+/,"");const r=`${n}/system`,s=`${n}/output`,i=`${n}/diff`,o=`${n}/dist`,a=`${n}/patch`,c=`${n}/imports`;return{rootRel:n,systemRel:r,outputRel:s,diffRel:i,distRel:o,patchRel:a,importsRel:c,rootAbs:h(e,n),systemAbs:h(e,r),outputAbs:h(e,s),diffAbs:h(e,i),distAbs:h(e,o),patchAbs:h(e,a),importsAbs:h(e,c)}},he=async e=>{const t=[],n=["."];for(;n.length;){const r=n.pop(),s=h(e,r),i=await a(s,{withFileTypes:!0});for(const e of i){const s="."===r?e.name:d(r,e.name);e.isDirectory()?n.push(s):t.push(s.replace(/\\/g,"/"))}}return t},de=(e,t)=>{const n=t.replace(/\\/g,"/").replace(/\/+$/,"");return e===n||e.startsWith(n+"/")},me=e=>{const t=e.replace(/\\/g,"/").replace(/^\.\/+/,"").replace(/\/+$/,"");if(!/[*?[\]{}()!]/.test(n=t)&&!n.includes("**"))return t?e=>de(e,t):()=>!1;var n;const r=fe(t,{dot:!0});return e=>r(e)},ge=async(e,{cwd:n,stanPath:r,includeOutputDir:s,includes:o=[],excludes:a=[]})=>{const c=r.replace(/\\/g,"/"),u=((e,t)=>{const n=new Set;for(const r of e){if("package.json"===r)continue;if(!r.endsWith("/package.json"))continue;const e=r.slice(0,-13);e.startsWith("node_modules/")||e.startsWith(".git/")||e===t||e.startsWith(`${t}/`)||e.length>0&&n.add(e)}return Array.from(n)})(e,c),l=await(async e=>{const n=h(e,".gitignore");if(!t(n))return null;try{const e=await i(n,"utf8"),t=re();return t.add(e),t}catch{return null}})(n),f=[e=>de(e,"node_modules"),e=>de(e,".git"),...l?[e=>l.ignores(e)]:[],...a.map(me),...u.map(e=>t=>de(t,e)),e=>M(c,e)];s||f.push(e=>D(`${c}/output`,e));const p=e.filter(e=>!f.some(t=>t(e)));if(o.length>0){const t=o.map(me),n=[e=>M(c,e),...s?[]:[e=>D(`${c}/output`,e)]],r=new Set(p);for(const n of e)t.some(e=>e(n))&&r.add(n);const i=a.map(me);return e.filter(e=>r.has(e)&&!n.some(t=>t(e))&&!i.some(t=>t(e)))}return p},ye=async(e,t)=>{const n=pe(e,t);return await g(n.rootAbs),await g(n.outputAbs),await g(n.diffAbs),await g(n.patchAbs),{rootAbs:n.rootAbs,outputAbs:n.outputAbs,diffAbs:n.diffAbs,patchAbs:n.patchAbs}},ve=async(e,t)=>{const n=await ye(e,t);return{outDir:n.outputAbs,diffDir:n.diffAbs}},_e=async(e,n,r={})=>{const{includeOutputDir:s=!1,fileName:i,includes:o=[],excludes:a=[]}=r;let u=i??"archive.tar";u.endsWith(".tar")||(u+=".tar");const{outDir:l,diffDir:f}=await ve(e,n),p=await he(e),d=await ge(p,{cwd:e,stanPath:n,includeOutputDir:s,includes:o,excludes:a}),m=h(l,u),g=h(f,L);if(t(m))try{await c(m,g)}catch{}const{textFiles:y,warningsBody:v}=await F(e,d),_=y,b=(v??"").trim();b&&"No archive warnings."!==b&&r.onArchiveWarnings?.(b);const w=await import("./index-ucZa1KMb.js");if(s){const t=Array.from(new Set([..._,`${n.replace(/\\/g,"/")}/output`]));await w.create({file:m,cwd:e,filter:j(n)},t)}else await w.create({file:m,cwd:e,filter:j(n)},_);if(!t(g))try{await c(m,g)}catch{}return m},be=".stan",we="code -g {file}",Se=e=>e instanceof URL?w(e):e;function Ae({cwd:t}={}){const n=function(t,{cwd:n=b.cwd(),type:r="file",stopAt:s}={}){let i=p.resolve(Se(n)??"");const{root:o}=p.parse(i);s=p.resolve(i,Se(s)??o);const a=p.isAbsolute(t);for(;i;){const n=a?t:p.join(i,t);try{const t=e.statSync(n,{throwIfNoEntry:!1});if("file"===r&&t?.isFile()||"directory"===r&&t?.isDirectory())return n}catch{}if(i===s||i===o)break;i=p.dirname(i)}}("package.json",{cwd:t});return n&&p.dirname(n)}const ke=["stan.config.yml","stan.config.yaml","stan.config.json"],Ee=e=>{for(const n of ke){const r=h(e,n);if(t(r))return r}return null},xe=e=>{const t=Ee(e);if(t)return t;const n=new Set;let r=e;for(;r;){const e=Ae({cwd:r});if(!e||n.has(e))break;n.add(e);const t=Ee(e);if(t)return t;const s=m(e);if(s===e||n.has(s))break;r=s}return null};var $e,Oe={},Re={},Ce={},Te={};function Pe(){if($e)return Te;$e=1;const e=Symbol.for("yaml.alias"),t=Symbol.for("yaml.document"),n=Symbol.for("yaml.map"),r=Symbol.for("yaml.pair"),s=Symbol.for("yaml.scalar"),i=Symbol.for("yaml.seq"),o=Symbol.for("yaml.node.type"),a=e=>!!e&&"object"==typeof e&&e[o]===s;function c(e){if(e&&"object"==typeof e)switch(e[o]){case n:case i:return!0}return!1}return Te.ALIAS=e,Te.DOC=t,Te.MAP=n,Te.NODE_TYPE=o,Te.PAIR=r,Te.SCALAR=s,Te.SEQ=i,Te.hasAnchor=e=>(a(e)||c(e))&&!!e.anchor,Te.isAlias=t=>!!t&&"object"==typeof t&&t[o]===e,Te.isCollection=c,Te.isDocument=e=>!!e&&"object"==typeof e&&e[o]===t,Te.isMap=e=>!!e&&"object"==typeof e&&e[o]===n,Te.isNode=function(t){if(t&&"object"==typeof t)switch(t[o]){case e:case n:case s:case i:return!0}return!1},Te.isPair=e=>!!e&&"object"==typeof e&&e[o]===r,Te.isScalar=a,Te.isSeq=e=>!!e&&"object"==typeof e&&e[o]===i,Te}var Le,Ne,Ie={};function Me(){if(Le)return Ie;Le=1;var e=Pe();const t=Symbol("break visit"),n=Symbol("skip children"),r=Symbol("remove node");function s(t,n){const s=c(n);if(e.isDocument(t)){i(null,t.contents,s,Object.freeze([t]))===r&&(t.contents=null)}else i(null,t,s,Object.freeze([]))}function i(n,s,o,a){const c=u(n,s,o,a);if(e.isNode(c)||e.isPair(c))return l(n,a,c),i(n,c,o,a);if("symbol"!=typeof c)if(e.isCollection(s)){a=Object.freeze(a.concat(s));for(let e=0;e<s.items.length;++e){const n=i(e,s.items[e],o,a);if("number"==typeof n)e=n-1;else{if(n===t)return t;n===r&&(s.items.splice(e,1),e-=1)}}}else if(e.isPair(s)){a=Object.freeze(a.concat(s));const e=i("key",s.key,o,a);if(e===t)return t;e===r&&(s.key=null);const n=i("value",s.value,o,a);if(n===t)return t;n===r&&(s.value=null)}return c}async function o(t,n){const s=c(n);if(e.isDocument(t)){await a(null,t.contents,s,Object.freeze([t]))===r&&(t.contents=null)}else await a(null,t,s,Object.freeze([]))}async function a(n,s,i,o){const c=await u(n,s,i,o);if(e.isNode(c)||e.isPair(c))return l(n,o,c),a(n,c,i,o);if("symbol"!=typeof c)if(e.isCollection(s)){o=Object.freeze(o.concat(s));for(let e=0;e<s.items.length;++e){const n=await a(e,s.items[e],i,o);if("number"==typeof n)e=n-1;else{if(n===t)return t;n===r&&(s.items.splice(e,1),e-=1)}}}else if(e.isPair(s)){o=Object.freeze(o.concat(s));const e=await a("key",s.key,i,o);if(e===t)return t;e===r&&(s.key=null);const n=await a("value",s.value,i,o);if(n===t)return t;n===r&&(s.value=null)}return c}function c(e){return"object"==typeof e&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function u(t,n,r,s){return"function"==typeof r?r(t,n,s):e.isMap(n)?r.Map?.(t,n,s):e.isSeq(n)?r.Seq?.(t,n,s):e.isPair(n)?r.Pair?.(t,n,s):e.isScalar(n)?r.Scalar?.(t,n,s):e.isAlias(n)?r.Alias?.(t,n,s):void 0}function l(t,n,r){const s=n[n.length-1];if(e.isCollection(s))s.items[t]=r;else if(e.isPair(s))"key"===t?s.key=r:s.value=r;else{if(!e.isDocument(s)){const t=e.isAlias(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${t} parent`)}s.contents=r}}return s.BREAK=t,s.SKIP=n,s.REMOVE=r,o.BREAK=t,o.SKIP=n,o.REMOVE=r,Ie.visit=s,Ie.visitAsync=o,Ie}function De(){if(Ne)return Ce;Ne=1;var e=Pe(),t=Me();const n={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},r=e=>e.replace(/[!,[\]{}]/g,e=>n[e]);class s{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},s.defaultYaml,e),this.tags=Object.assign({},s.defaultTags,t)}clone(){const e=new s(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new s(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:s.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},s.defaultTags)}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:s.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},s.defaultTags),this.atNextDocument=!1);const n=e.trim().split(/[ \t]+/),r=n.shift();switch(r){case"%TAG":{if(2!==n.length&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;const[e,r]=n;return this.tags[e]=r,!0}case"%YAML":{if(this.yaml.explicit=!0,1!==n.length)return t(0,"%YAML directive should contain exactly one part"),!1;const[e]=n;if("1.1"===e||"1.2"===e)return this.yaml.version=e,!0;return t(6,`Unsupported YAML version ${e}`,/^\d+\.\d+$/.test(e)),!1}default:return t(0,`Unknown directive ${r}`,!0),!1}}tagName(e,t){if("!"===e)return"!";if("!"!==e[0])return t(`Not a valid tag: ${e}`),null;if("<"===e[1]){const n=e.slice(2,-1);return"!"===n||"!!"===n?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(">"!==e[e.length-1]&&t("Verbatim tags must end with a >"),n)}const[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);const s=this.tags[n];if(s)try{return s+decodeURIComponent(r)}catch(e){return t(String(e)),null}return"!"===n?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+r(e.substring(n.length));return"!"===e[0]?e:`!<${e}>`}toString(n){const r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags);let i;if(n&&s.length>0&&e.isNode(n.contents)){const r={};t.visit(n.contents,(t,n)=>{e.isNode(n)&&n.tag&&(r[n.tag]=!0)}),i=Object.keys(r)}else i=[];for(const[e,t]of s)"!!"===e&&"tag:yaml.org,2002:"===t||n&&!i.some(e=>e.startsWith(t))||r.push(`%TAG ${e} ${t}`);return r.join("\n")}}return s.defaultYaml={explicit:!1,version:"1.2"},s.defaultTags={"!!":"tag:yaml.org,2002:"},Ce.Directives=s,Ce}var je,He={},Fe={},Be={};function ze(){if(je)return Be;je=1;var e=Pe(),t=Me();function n(e){const n=new Set;return t.visit(e,{Value(e,t){t.anchor&&n.add(t.anchor)}}),n}function r(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}return Be.anchorIsValid=function(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const t=JSON.stringify(e);throw new Error(`Anchor must not contain whitespace or control characters: ${t}`)}return!0},Be.anchorNames=n,Be.createNodeAnchors=function(t,s){const i=[],o=new Map;let a=null;return{onAnchor:e=>{i.push(e),a??(a=n(t));const o=r(s,a);return a.add(o),o},setAnchors:()=>{for(const t of i){const n=o.get(t);if("object"!=typeof n||!n.anchor||!e.isScalar(n.node)&&!e.isCollection(n.node)){const e=new Error("Failed to resolve repeated object (this should not happen)");throw e.source=t,e}n.node.anchor=n.anchor}},sourceObjects:o}},Be.findNewAnchor=r,Be}var Ke,Ue={},qe={};function Ze(){if(Ke)return qe;return Ke=1,qe.applyReviver=function e(t,n,r,s){if(s&&"object"==typeof s)if(Array.isArray(s))for(let n=0,r=s.length;n<r;++n){const r=s[n],i=e(t,s,String(n),r);void 0===i?delete s[n]:i!==r&&(s[n]=i)}else if(s instanceof Map)for(const n of Array.from(s.keys())){const r=s.get(n),i=e(t,s,n,r);void 0===i?s.delete(n):i!==r&&s.set(n,i)}else if(s instanceof Set)for(const n of Array.from(s)){const r=e(t,s,n,n);void 0===r?s.delete(n):r!==n&&(s.delete(n),s.add(r))}else for(const[n,r]of Object.entries(s)){const i=e(t,s,n,r);void 0===i?delete s[n]:i!==r&&(s[n]=i)}return t.call(n,r,s)},qe}var We,Ge,Ve,Ye={};function Qe(){if(We)return Ye;We=1;var e=Pe();return Ye.toJS=function t(n,r,s){if(Array.isArray(n))return n.map((e,n)=>t(e,String(n),s));if(n&&"function"==typeof n.toJSON){if(!s||!e.hasAnchor(n))return n.toJSON(r,s);const t={aliasCount:0,count:1,res:void 0};s.anchors.set(n,t),s.onCreate=e=>{t.res=e,delete s.onCreate};const i=n.toJSON(r,s);return s.onCreate&&s.onCreate(i),i}return"bigint"!=typeof n||s?.keep?n:Number(n)},Ye}function Je(){if(Ge)return Ue;Ge=1;var e=Ze(),t=Pe(),n=Qe();return Ue.NodeBase=class{constructor(e){Object.defineProperty(this,t.NODE_TYPE,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(r,{mapAsMap:s,maxAliasCount:i,onAnchor:o,reviver:a}={}){if(!t.isDocument(r))throw new TypeError("A document argument is required");const c={anchors:new Map,doc:r,keep:!0,mapAsMap:!0===s,mapKeyWarned:!1,maxAliasCount:"number"==typeof i?i:100},u=n.toJS(this,"",c);if("function"==typeof o)for(const{count:e,res:t}of c.anchors.values())o(t,e);return"function"==typeof a?e.applyReviver(a,{"":u},"",u):u}},Ue}function Xe(){if(Ve)return Fe;Ve=1;var e=ze(),t=Me(),n=Pe(),r=Je(),s=Qe();let i=class extends r.NodeBase{constructor(e){super(n.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){let s,i;r?.aliasResolveCache?s=r.aliasResolveCache:(s=[],t.visit(e,{Node:(e,t)=>{(n.isAlias(t)||n.hasAnchor(t))&&s.push(t)}}),r&&(r.aliasResolveCache=s));for(const e of s){if(e===this)break;e.anchor===this.source&&(i=e)}return i}toJSON(e,t){if(!t)return{source:this.source};const{anchors:n,doc:r,maxAliasCount:i}=t,a=this.resolve(r,t);if(!a){const e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(e)}let c=n.get(a);if(c||(s.toJS(a,null,t),c=n.get(a)),!c||void 0===c.res){throw new ReferenceError("This should not happen: Alias anchor was not resolved?")}if(i>=0&&(c.count+=1,0===c.aliasCount&&(c.aliasCount=o(r,a,n)),c.count*c.aliasCount>i)){throw new ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return c.res}toString(t,n,r){const s=`*${this.source}`;if(t){if(e.anchorIsValid(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(e)}if(t.implicitKey)return`${s} `}return s}};function o(e,t,r){if(n.isAlias(t)){const n=t.resolve(e),s=r&&n&&r.get(n);return s?s.count*s.aliasCount:0}if(n.isCollection(t)){let n=0;for(const s of t.items){const t=o(e,s,r);t>n&&(n=t)}return n}if(n.isPair(t)){const n=o(e,t.key,r),s=o(e,t.value,r);return Math.max(n,s)}return 1}return Fe.Alias=i,Fe}var et,tt,nt,rt={},st={},it={};function ot(){if(et)return it;et=1;var e=Pe(),t=Je(),n=Qe();let r=class extends t.NodeBase{constructor(t){super(e.SCALAR),this.value=t}toJSON(e,t){return t?.keep?this.value:n.toJS(this.value,e,t)}toString(){return String(this.value)}};return r.BLOCK_FOLDED="BLOCK_FOLDED",r.BLOCK_LITERAL="BLOCK_LITERAL",r.PLAIN="PLAIN",r.QUOTE_DOUBLE="QUOTE_DOUBLE",r.QUOTE_SINGLE="QUOTE_SINGLE",it.Scalar=r,it.isScalarValue=e=>!e||"function"!=typeof e&&"object"!=typeof e,it}function at(){if(tt)return st;tt=1;var e=Xe(),t=Pe(),n=ot();return st.createNode=function(r,s,i){if(t.isDocument(r)&&(r=r.contents),t.isNode(r))return r;if(t.isPair(r)){const e=i.schema[t.MAP].createNode?.(i.schema,null,i);return e.items.push(r),e}(r instanceof String||r instanceof Number||r instanceof Boolean||"undefined"!=typeof BigInt&&r instanceof BigInt)&&(r=r.valueOf());const{aliasDuplicateObjects:o,onAnchor:a,onTagObj:c,schema:u,sourceObjects:l}=i;let f;if(o&&r&&"object"==typeof r){if(f=l.get(r),f)return f.anchor??(f.anchor=a(r)),new e.Alias(f.anchor);f={anchor:null,node:null},l.set(r,f)}s?.startsWith("!!")&&(s="tag:yaml.org,2002:"+s.slice(2));let p=function(e,t,n){if(t){const e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}(r,s,u.tags);if(!p){if(r&&"function"==typeof r.toJSON&&(r=r.toJSON()),!r||"object"!=typeof r){const e=new n.Scalar(r);return f&&(f.node=e),e}p=r instanceof Map?u[t.MAP]:Symbol.iterator in Object(r)?u[t.SEQ]:u[t.MAP]}c&&(c(p),delete i.onTagObj);const h=p?.createNode?p.createNode(i.schema,r,i):"function"==typeof p?.nodeClass?.from?p.nodeClass.from(i.schema,r,i):new n.Scalar(r);return s?h.tag=s:p.default||(h.tag=p.tag),f&&(f.node=h),h},st}function ct(){if(nt)return rt;nt=1;var e=at(),t=Pe(),n=Je();function r(t,n,r){let s=r;for(let e=n.length-1;e>=0;--e){const t=n[e];if("number"==typeof t&&Number.isInteger(t)&&t>=0){const e=[];e[t]=s,s=e}else s=new Map([[t,s]])}return e.createNode(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}const s=e=>null==e||"object"==typeof e&&!!e[Symbol.iterator]().next().done;let i=class extends n.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(n=>t.isNode(n)||t.isPair(n)?n.clone(e):n),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(s(e))this.add(n);else{const[s,...i]=e,o=this.get(s,!0);if(t.isCollection(o))o.addIn(i,n);else{if(void 0!==o||!this.schema)throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`);this.set(s,r(this.schema,i,n))}}}deleteIn(e){const[n,...r]=e;if(0===r.length)return this.delete(n);const s=this.get(n,!0);if(t.isCollection(s))return s.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(e,n){const[r,...s]=e,i=this.get(r,!0);return 0===s.length?!n&&t.isScalar(i)?i.value:i:t.isCollection(i)?i.getIn(s,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!t.isPair(n))return!1;const r=n.value;return null==r||e&&t.isScalar(r)&&null==r.value&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){const[n,...r]=e;if(0===r.length)return this.has(n);const s=this.get(n,!0);return!!t.isCollection(s)&&s.hasIn(r)}setIn(e,n){const[s,...i]=e;if(0===i.length)this.set(s,n);else{const e=this.get(s,!0);if(t.isCollection(e))e.setIn(i,n);else{if(void 0!==e||!this.schema)throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`);this.set(s,r(this.schema,i,n))}}}};return rt.Collection=i,rt.collectionFromPath=r,rt.isEmptyPath=s,rt}var ut,lt={},ft={},pt={},ht={};function dt(){if(ut)return ht;ut=1;function e(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}return ht.indentComment=e,ht.lineComment=(t,n,r)=>t.endsWith("\n")?e(r,n):r.includes("\n")?"\n"+e(r,n):(t.endsWith(" ")?"":" ")+r,ht.stringifyComment=e=>e.replace(/^(?!$)(?: $)?/gm,"#"),ht}var mt,gt,yt,vt,_t={},bt={};function wt(){if(mt)return bt;mt=1;const e="block",t="quoted";function n(e,t,n){let r=t,s=t+1,i=e[s];for(;" "===i||"\t"===i;)if(t<s+n)i=e[++t];else{do{i=e[++t]}while(i&&"\n"!==i);r=t,s=t+1,i=e[s]}return r}return bt.FOLD_BLOCK=e,bt.FOLD_FLOW="flow",bt.FOLD_QUOTED=t,bt.foldFlowLines=function(r,s,i="flow",{indentAtStart:o,lineWidth:a=80,minContentWidth:c=20,onFold:u,onOverflow:l}={}){if(!a||a<0)return r;a<c&&(c=0);const f=Math.max(1+c,1+a-s.length);if(r.length<=f)return r;const p=[],h={};let d,m,g=a-s.length;"number"==typeof o&&(o>a-Math.max(2,c)?p.push(0):g=a-o);let y=!1,v=-1,_=-1,b=-1;i===e&&(v=n(r,v,s.length),-1!==v&&(g=v+f));for(let o;o=r[v+=1];){if(i===t&&"\\"===o){switch(_=v,r[v+1]){case"x":v+=3;break;case"u":v+=5;break;case"U":v+=9;break;default:v+=1}b=v}if("\n"===o)i===e&&(v=n(r,v,s.length)),g=v+s.length+f,d=void 0;else{if(" "===o&&m&&" "!==m&&"\n"!==m&&"\t"!==m){const e=r[v+1];e&&" "!==e&&"\n"!==e&&"\t"!==e&&(d=v)}if(v>=g)if(d)p.push(d),g=d+f,d=void 0;else if(i===t){for(;" "===m||"\t"===m;)m=o,o=r[v+=1],y=!0;const e=v>b+1?v-2:_-1;if(h[e])return r;p.push(e),h[e]=!0,g=e+f,d=void 0}else y=!0}m=o}if(y&&l&&l(),0===p.length)return r;u&&u();let w=r.slice(0,p[0]);for(let e=0;e<p.length;++e){const n=p[e],o=p[e+1]||r.length;0===n?w=`\n${s}${r.slice(0,o)}`:(i===t&&h[n]&&(w+=`${r[n]}\\`),w+=`\n${s}${r.slice(n+1,o)}`)}return w},bt}function St(){if(gt)return _t;gt=1;var e=ot(),t=wt();const n=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),r=e=>/^(%|---|\.\.\.)/m.test(e);function s(e,s){const i=JSON.stringify(e);if(s.options.doubleQuotedAsJSON)return i;const{implicitKey:o}=s,a=s.options.doubleQuotedMinMultiLineLength,c=s.indent||(r(e)?" ":"");let u="",l=0;for(let e=0,t=i[e];t;t=i[++e])if(" "===t&&"\\"===i[e+1]&&"n"===i[e+2]&&(u+=i.slice(l,e)+"\\ ",e+=1,l=e,t="\\"),"\\"===t)switch(i[e+1]){case"u":{u+=i.slice(l,e);const t=i.substr(e+2,4);switch(t){case"0000":u+="\\0";break;case"0007":u+="\\a";break;case"000b":u+="\\v";break;case"001b":u+="\\e";break;case"0085":u+="\\N";break;case"00a0":u+="\\_";break;case"2028":u+="\\L";break;case"2029":u+="\\P";break;default:"00"===t.substr(0,2)?u+="\\x"+t.substr(2):u+=i.substr(e,6)}e+=5,l=e+1}break;case"n":if(o||'"'===i[e+2]||i.length<a)e+=1;else{for(u+=i.slice(l,e)+"\n\n";"\\"===i[e+2]&&"n"===i[e+3]&&'"'!==i[e+4];)u+="\n",e+=2;u+=c," "===i[e+2]&&(u+="\\"),e+=1,l=e+1}break;default:e+=1}return u=l?u+i.slice(l):i,o?u:t.foldFlowLines(u,c,t.FOLD_QUOTED,n(s,!1))}function i(e,i){if(!1===i.options.singleQuote||i.implicitKey&&e.includes("\n")||/[ \t]\n|\n[ \t]/.test(e))return s(e,i);const o=i.indent||(r(e)?" ":""),a="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&\n${o}`)+"'";return i.implicitKey?a:t.foldFlowLines(a,o,t.FOLD_FLOW,n(i,!1))}function o(e,t){const{singleQuote:n}=t.options;let r;if(!1===n)r=s;else{const t=e.includes('"'),o=e.includes("'");r=t&&!o?i:o&&!t?s:n?i:s}return r(e,t)}let a;try{a=new RegExp("(^|(?<!\n))\n+(?!\n|$)","g")}catch{a=/\n+(?!\n|$)/g}function c({comment:s,type:i,value:c},u,l,f){const{blockQuote:p,commentString:h,lineWidth:d}=u.options;if(!p||/\n[\t ]+$/.test(c))return o(c,u);const m=u.indent||(u.forceBlockIndent||r(c)?" ":""),g="literal"===p||"folded"!==p&&i!==e.Scalar.BLOCK_FOLDED&&(i===e.Scalar.BLOCK_LITERAL||!function(e,t,n){if(!t||t<0)return!1;const r=t-n,s=e.length;if(s<=r)return!1;for(let t=0,n=0;t<s;++t)if("\n"===e[t]){if(t-n>r)return!0;if(n=t+1,s-n<=r)return!1}return!0}(c,d,m.length));if(!c)return g?"|\n":">\n";let y,v;for(v=c.length;v>0;--v){const e=c[v-1];if("\n"!==e&&"\t"!==e&&" "!==e)break}let _=c.substring(v);const b=_.indexOf("\n");-1===b?y="-":c===_||b!==_.length-1?(y="+",f&&f()):y="",_&&(c=c.slice(0,-_.length),"\n"===_[_.length-1]&&(_=_.slice(0,-1)),_=_.replace(a,`$&${m}`));let w,S=!1,A=-1;for(w=0;w<c.length;++w){const e=c[w];if(" "===e)S=!0;else{if("\n"!==e)break;A=w}}let k=c.substring(0,A<w?A+1:w);k&&(c=c.substring(k.length),k=k.replace(/\n+/g,`$&${m}`));let E=(S?m?"2":"1":"")+y;if(s&&(E+=" "+h(s.replace(/ ?[\r\n]+/g," ")),l&&l()),!g){const r=c.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${m}`);let s=!1;const o=n(u,!0);"folded"!==p&&i!==e.Scalar.BLOCK_FOLDED&&(o.onOverflow=()=>{s=!0});const a=t.foldFlowLines(`${k}${r}${_}`,m,t.FOLD_BLOCK,o);if(!s)return`>${E}\n${m}${a}`}return`|${E}\n${m}${k}${c=c.replace(/\n+/g,`$&${m}`)}${_}`}return _t.stringifyString=function(a,u,l,f){const{implicitKey:p,inFlow:h}=u,d="string"==typeof a.value?a:Object.assign({},a,{value:String(a.value)});let{type:m}=a;m!==e.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(d.value)&&(m=e.Scalar.QUOTE_DOUBLE);const g=a=>{switch(a){case e.Scalar.BLOCK_FOLDED:case e.Scalar.BLOCK_LITERAL:return p||h?o(d.value,u):c(d,u,l,f);case e.Scalar.QUOTE_DOUBLE:return s(d.value,u);case e.Scalar.QUOTE_SINGLE:return i(d.value,u);case e.Scalar.PLAIN:return function(s,i,a,u){const{type:l,value:f}=s,{actualString:p,implicitKey:h,indent:d,indentStep:m,inFlow:g}=i;if(h&&f.includes("\n")||g&&/[[\]{},]/.test(f))return o(f,i);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(f))return h||g||!f.includes("\n")?o(f,i):c(s,i,a,u);if(!h&&!g&&l!==e.Scalar.PLAIN&&f.includes("\n"))return c(s,i,a,u);if(r(f)){if(""===d)return i.forceBlockIndent=!0,c(s,i,a,u);if(h&&d===m)return o(f,i)}const y=f.replace(/\n+/g,`$&\n${d}`);if(p){const e=e=>e.default&&"tag:yaml.org,2002:str"!==e.tag&&e.test?.test(y),{compat:t,tags:n}=i.doc.schema;if(n.some(e)||t?.some(e))return o(f,i)}return h?y:t.foldFlowLines(y,d,t.FOLD_FLOW,n(i,!1))}(d,u,l,f);default:return null}};let y=g(m);if(null===y){const{defaultKeyType:e,defaultStringType:t}=u.options,n=p&&e||t;if(y=g(n),null===y)throw new Error(`Unsupported default string type ${n}`)}return y},_t}function At(){if(yt)return pt;yt=1;var e=ze(),t=Pe(),n=dt(),r=St();return pt.createStringifyContext=function(e,t){const r=Object.assign({blockQuote:!0,commentString:n.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},e.schema.toStringOptions,t);let s;switch(r.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:e,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:"number"==typeof r.indent?" ".repeat(r.indent):" ",inFlow:s,options:r}},pt.stringify=function(n,s,i,o){if(t.isPair(n))return n.toString(s,i,o);if(t.isAlias(n)){if(s.doc.directives)return n.toString(s);if(s.resolvedAliases?.has(n))throw new TypeError("Cannot stringify circular structure without alias nodes");s.resolvedAliases?s.resolvedAliases.add(n):s.resolvedAliases=new Set([n]),n=n.resolve(s.doc)}let a;const c=t.isNode(n)?n:s.doc.createNode(n,{onTagObj:e=>a=e});a??(a=function(e,n){if(n.tag){const t=e.filter(e=>e.tag===n.tag);if(t.length>0)return t.find(e=>e.format===n.format)??t[0]}let r,s;if(t.isScalar(n)){s=n.value;let t=e.filter(e=>e.identify?.(s));if(t.length>1){const e=t.filter(e=>e.test);e.length>0&&(t=e)}r=t.find(e=>e.format===n.format)??t.find(e=>!e.format)}else s=n,r=e.find(e=>e.nodeClass&&s instanceof e.nodeClass);if(!r)throw new Error(`Tag not resolved for ${s?.constructor?.name??(null===s?"null":typeof s)} value`);return r}(s.doc.schema.tags,c));const u=function(n,r,{anchors:s,doc:i}){if(!i.directives)return"";const o=[],a=(t.isScalar(n)||t.isCollection(n))&&n.anchor;a&&e.anchorIsValid(a)&&(s.add(a),o.push(`&${a}`));const c=n.tag??(r.default?null:r.tag);return c&&o.push(i.directives.tagString(c)),o.join(" ")}(c,a,s);u.length>0&&(s.indentAtStart=(s.indentAtStart??0)+u.length+1);const l="function"==typeof a.stringify?a.stringify(c,s,i,o):t.isScalar(c)?r.stringifyString(c,s,i,o):c.toString(s,i,o);return u?t.isScalar(c)||"{"===l[0]||"["===l[0]?`${u} ${l}`:`${u}\n${s.indent}${l}`:l},pt}function kt(){if(vt)return ft;vt=1;var e=Pe(),t=ot(),n=At(),r=dt();return ft.stringifyPair=function({key:s,value:i},o,a,c){const{allNullValues:u,doc:l,indent:f,indentStep:p,options:{commentString:h,indentSeq:d,simpleKeys:m}}=o;let g=e.isNode(s)&&s.comment||null;if(m){if(g)throw new Error("With simple keys, key nodes cannot have comments");if(e.isCollection(s)||!e.isNode(s)&&"object"==typeof s){throw new Error("With simple keys, collection cannot be used as a key value")}}let y=!m&&(!s||g&&null==i&&!o.inFlow||e.isCollection(s)||(e.isScalar(s)?s.type===t.Scalar.BLOCK_FOLDED||s.type===t.Scalar.BLOCK_LITERAL:"object"==typeof s));o=Object.assign({},o,{allNullValues:!1,implicitKey:!y&&(m||!u),indent:f+p});let v,_,b,w=!1,S=!1,A=n.stringify(s,o,()=>w=!0,()=>S=!0);if(!y&&!o.inFlow&&A.length>1024){if(m)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");y=!0}if(o.inFlow){if(u||null==i)return w&&a&&a(),""===A?"?":y?`? ${A}`:A}else if(u&&!m||null==i&&y)return A=`? ${A}`,g&&!w?A+=r.lineComment(A,o.indent,h(g)):S&&c&&c(),A;w&&(g=null),y?(g&&(A+=r.lineComment(A,o.indent,h(g))),A=`? ${A}\n${f}:`):(A=`${A}:`,g&&(A+=r.lineComment(A,o.indent,h(g)))),e.isNode(i)?(v=!!i.spaceBefore,_=i.commentBefore,b=i.comment):(v=!1,_=null,b=null,i&&"object"==typeof i&&(i=l.createNode(i))),o.implicitKey=!1,y||g||!e.isScalar(i)||(o.indentAtStart=A.length+1),S=!1,d||!(p.length>=2)||o.inFlow||y||!e.isSeq(i)||i.flow||i.tag||i.anchor||(o.indent=o.indent.substring(2));let k=!1;const E=n.stringify(i,o,()=>k=!0,()=>S=!0);let x=" ";if(g||v||_){if(x=v?"\n":"",_){const e=h(_);x+=`\n${r.indentComment(e,o.indent)}`}""!==E||o.inFlow?x+=`\n${o.indent}`:"\n"===x&&(x="\n\n")}else if(!y&&e.isCollection(i)){const e=E[0],t=E.indexOf("\n"),n=-1!==t,r=o.inFlow??i.flow??0===i.items.length;if(n||!r){let r=!1;if(n&&("&"===e||"!"===e)){let n=E.indexOf(" ");"&"===e&&-1!==n&&n<t&&"!"===E[n+1]&&(n=E.indexOf(" ",n+1)),(-1===n||t<n)&&(r=!0)}r||(x=`\n${o.indent}`)}}else""!==E&&"\n"!==E[0]||(x="");return A+=x+E,o.inFlow?k&&a&&a():b&&!k?A+=r.lineComment(A,o.indent,h(b)):S&&c&&c(),A},ft}var Et,xt={},$t={};function Ot(){if(Et)return $t;Et=1;var e=S;return $t.debug=function(e,...t){"debug"===e&&console.log(...t)},$t.warn=function(t,n){"debug"!==t&&"warn"!==t||("function"==typeof e.emitWarning?e.emitWarning(n):console.warn(n))},$t}var Rt,Ct,Tt,Pt={};function Lt(){if(Rt)return Pt;Rt=1;var e=Pe(),t=ot();const n="<<",r={identify:e=>e===n||"symbol"==typeof e&&e.description===n,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new t.Scalar(Symbol(n)),{addToJSMap:s}),stringify:()=>n};function s(t,n,r){if(r=t&&e.isAlias(r)?r.resolve(t.doc):r,e.isSeq(r))for(const e of r.items)i(t,n,e);else if(Array.isArray(r))for(const e of r)i(t,n,e);else i(t,n,r)}function i(t,n,r){const s=t&&e.isAlias(r)?r.resolve(t.doc):r;if(!e.isMap(s))throw new Error("Merge sources must be maps or map aliases");const i=s.toJSON(null,t,Map);for(const[e,t]of i)n instanceof Map?n.has(e)||n.set(e,t):n instanceof Set?n.add(e):Object.prototype.hasOwnProperty.call(n,e)||Object.defineProperty(n,e,{value:t,writable:!0,enumerable:!0,configurable:!0});return n}return Pt.addMergeToJSMap=s,Pt.isMergeKey=(n,s)=>(r.identify(s)||e.isScalar(s)&&(!s.type||s.type===t.Scalar.PLAIN)&&r.identify(s.value))&&n?.doc.schema.tags.some(e=>e.tag===r.tag&&e.default),Pt.merge=r,Pt}function Nt(){if(Ct)return xt;Ct=1;var e=Ot(),t=Lt(),n=At(),r=Pe(),s=Qe();return xt.addPairToJSMap=function(i,o,{key:a,value:c}){if(r.isNode(a)&&a.addToJSMap)a.addToJSMap(i,o,c);else if(t.isMergeKey(i,a))t.addMergeToJSMap(i,o,c);else{const t=s.toJS(a,"",i);if(o instanceof Map)o.set(t,s.toJS(c,t,i));else if(o instanceof Set)o.add(t);else{const u=function(t,s,i){if(null===s)return"";if("object"!=typeof s)return String(s);if(r.isNode(t)&&i?.doc){const r=n.createStringifyContext(i.doc,{});r.anchors=new Set;for(const e of i.anchors.keys())r.anchors.add(e.anchor);r.inFlow=!0,r.inStringifyKey=!0;const s=t.toString(r);if(!i.mapKeyWarned){let t=JSON.stringify(s);t.length>40&&(t=t.substring(0,36)+'..."'),e.warn(i.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${t}. Set mapAsMap: true to use object keys.`),i.mapKeyWarned=!0}return s}return JSON.stringify(s)}(a,t,i),l=s.toJS(c,u,i);u in o?Object.defineProperty(o,u,{value:l,writable:!0,enumerable:!0,configurable:!0}):o[u]=l}}return o},xt}function It(){if(Tt)return lt;Tt=1;var e=at(),t=kt(),n=Nt(),r=Pe();let s=class e{constructor(e,t=null){Object.defineProperty(this,r.NODE_TYPE,{value:r.PAIR}),this.key=e,this.value=t}clone(t){let{key:n,value:s}=this;return r.isNode(n)&&(n=n.clone(t)),r.isNode(s)&&(s=s.clone(t)),new e(n,s)}toJSON(e,t){const r=t?.mapAsMap?new Map:{};return n.addPairToJSMap(t,r,this)}toString(e,n,r){return e?.doc?t.stringifyPair(this,e,n,r):JSON.stringify(this)}};return lt.Pair=s,lt.createPair=function(t,n,r){const i=e.createNode(t,void 0,r),o=e.createNode(n,void 0,r);return new s(i,o)},lt}var Mt,Dt,jt,Ht={},Ft={},Bt={},zt={};function Kt(){if(Mt)return zt;Mt=1;var e=Pe(),t=At(),n=dt();function r({comment:r,items:s},o,{blockItemPrefix:a,flowChars:c,itemIndent:u,onChompKeep:l,onComment:f}){const{indent:p,options:{commentString:h}}=o,d=Object.assign({},o,{indent:u,type:null});let m=!1;const g=[];for(let r=0;r<s.length;++r){const c=s[r];let l=null;if(e.isNode(c))!m&&c.spaceBefore&&g.push(""),i(o,g,c.commentBefore,m),c.comment&&(l=c.comment);else if(e.isPair(c)){const t=e.isNode(c.key)?c.key:null;t&&(!m&&t.spaceBefore&&g.push(""),i(o,g,t.commentBefore,m))}m=!1;let f=t.stringify(c,d,()=>l=null,()=>m=!0);l&&(f+=n.lineComment(f,u,h(l))),m&&l&&(m=!1),g.push(a+f)}let y;if(0===g.length)y=c.start+c.end;else{y=g[0];for(let e=1;e<g.length;++e){const t=g[e];y+=t?`\n${p}${t}`:"\n"}}return r?(y+="\n"+n.indentComment(h(r),p),f&&f()):m&&l&&l(),y}function s({items:r},s,{flowChars:o,itemIndent:a}){const{indent:c,indentStep:u,flowCollectionPadding:l,options:{commentString:f}}=s;a+=u;const p=Object.assign({},s,{indent:a,inFlow:!0,type:null});let h=!1,d=0;const m=[];for(let o=0;o<r.length;++o){const c=r[o];let u=null;if(e.isNode(c))c.spaceBefore&&m.push(""),i(s,m,c.commentBefore,!1),c.comment&&(u=c.comment);else if(e.isPair(c)){const t=e.isNode(c.key)?c.key:null;t&&(t.spaceBefore&&m.push(""),i(s,m,t.commentBefore,!1),t.comment&&(h=!0));const n=e.isNode(c.value)?c.value:null;n?(n.comment&&(u=n.comment),n.commentBefore&&(h=!0)):null==c.value&&t?.comment&&(u=t.comment)}u&&(h=!0);let l=t.stringify(c,p,()=>u=null);o<r.length-1&&(l+=","),u&&(l+=n.lineComment(l,a,f(u))),!h&&(m.length>d||l.includes("\n"))&&(h=!0),m.push(l),d=m.length}const{start:g,end:y}=o;if(0===m.length)return g+y;if(!h){const e=m.reduce((e,t)=>e+t.length+2,2);h=s.options.lineWidth>0&&e>s.options.lineWidth}if(h){let e=g;for(const t of m)e+=t?`\n${u}${c}${t}`:"\n";return`${e}\n${c}${y}`}return`${g}${l}${m.join(" ")}${l}${y}`}function i({indent:e,options:{commentString:t}},r,s,i){if(s&&i&&(s=s.replace(/^\n+/,"")),s){const i=n.indentComment(t(s),e);r.push(i.trimStart())}}return zt.stringifyCollection=function(e,t,n){return(t.inFlow??e.flow?s:r)(e,t,n)},zt}function Ut(){if(Dt)return Bt;Dt=1;var e=Kt(),t=Nt(),n=ct(),r=Pe(),s=It(),i=ot();function o(e,t){const n=r.isScalar(t)?t.value:t;for(const s of e)if(r.isPair(s)){if(s.key===t||s.key===n)return s;if(r.isScalar(s.key)&&s.key.value===n)return s}}let a=class extends n.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(r.MAP,e),this.items=[]}static from(e,t,n){const{keepUndefined:r,replacer:i}=n,o=new this(e),a=(e,a)=>{if("function"==typeof i)a=i.call(t,e,a);else if(Array.isArray(i)&&!i.includes(e))return;(void 0!==a||r)&&o.items.push(s.createPair(e,a,n))};if(t instanceof Map)for(const[e,n]of t)a(e,n);else if(t&&"object"==typeof t)for(const e of Object.keys(t))a(e,t[e]);return"function"==typeof e.sortMapEntries&&o.items.sort(e.sortMapEntries),o}add(e,t){let n;n=r.isPair(e)?e:e&&"object"==typeof e&&"key"in e?new s.Pair(e.key,e.value):new s.Pair(e,e?.value);const a=o(this.items,n.key),c=this.schema?.sortMapEntries;if(a){if(!t)throw new Error(`Key ${n.key} already set`);r.isScalar(a.value)&&i.isScalarValue(n.value)?a.value.value=n.value:a.value=n.value}else if(c){const e=this.items.findIndex(e=>c(n,e)<0);-1===e?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){const t=o(this.items,e);if(!t)return!1;return this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){const n=o(this.items,e),s=n?.value;return(!t&&r.isScalar(s)?s.value:s)??void 0}has(e){return!!o(this.items,e)}set(e,t){this.add(new s.Pair(e,t),!0)}toJSON(e,n,r){const s=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(s);for(const e of this.items)t.addPairToJSMap(n,s,e);return s}toString(t,n,s){if(!t)return JSON.stringify(this);for(const e of this.items)if(!r.isPair(e))throw new Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),e.stringifyCollection(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:s,onComment:n})}};return Bt.YAMLMap=a,Bt.findPair=o,Bt}function qt(){if(jt)return Ft;jt=1;var e=Pe(),t=Ut();const n={collection:"map",default:!0,nodeClass:t.YAMLMap,tag:"tag:yaml.org,2002:map",resolve:(t,n)=>(e.isMap(t)||n("Expected a mapping for this tag"),t),createNode:(e,n,r)=>t.YAMLMap.from(e,n,r)};return Ft.map=n,Ft}var Zt,Wt,Gt={},Vt={};function Yt(){if(Zt)return Vt;Zt=1;var e=at(),t=Kt(),n=ct(),r=Pe(),s=ot(),i=Qe();let o=class extends n.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(r.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){const t=a(e);if("number"!=typeof t)return!1;return this.items.splice(t,1).length>0}get(e,t){const n=a(e);if("number"!=typeof n)return;const s=this.items[n];return!t&&r.isScalar(s)?s.value:s}has(e){const t=a(e);return"number"==typeof t&&t<this.items.length}set(e,t){const n=a(e);if("number"!=typeof n)throw new Error(`Expected a valid index, not ${e}.`);const i=this.items[n];r.isScalar(i)&&s.isScalarValue(t)?i.value=t:this.items[n]=t}toJSON(e,t){const n=[];t?.onCreate&&t.onCreate(n);let r=0;for(const e of this.items)n.push(i.toJS(e,String(r++),t));return n}toString(e,n,r){return e?t.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(t,n,r){const{replacer:s}=r,i=new this(t);if(n&&Symbol.iterator in Object(n)){let t=0;for(let o of n){if("function"==typeof s){const e=n instanceof Set?o:String(t++);o=s.call(n,e,o)}i.items.push(e.createNode(o,void 0,r))}}return i}};function a(e){let t=r.isScalar(e)?e.value:e;return t&&"string"==typeof t&&(t=Number(t)),"number"==typeof t&&Number.isInteger(t)&&t>=0?t:null}return Vt.YAMLSeq=o,Vt}function Qt(){if(Wt)return Gt;Wt=1;var e=Pe(),t=Yt();const n={collection:"seq",default:!0,nodeClass:t.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve:(t,n)=>(e.isSeq(t)||n("Expected a sequence for this tag"),t),createNode:(e,n,r)=>t.YAMLSeq.from(e,n,r)};return Gt.seq=n,Gt}var Jt,Xt={};function en(){if(Jt)return Xt;Jt=1;var e=St();const t={identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:(t,n,r,s)=>(n=Object.assign({actualString:!0},n),e.stringifyString(t,n,r,s))};return Xt.string=t,Xt}var tn,nn={},rn={};function sn(){if(tn)return rn;tn=1;var e=ot();const t={identify:e=>null==e,createNode:()=>new e.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new e.Scalar(null),stringify:({source:e},n)=>"string"==typeof e&&t.test.test(e)?e:n.options.nullStr};return rn.nullTag=t,rn}var on,an={};function cn(){if(on)return an;on=1;var e=ot();const t={identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new e.Scalar("t"===t[0]||"T"===t[0]),stringify({source:e,value:n},r){if(e&&t.test.test(e)){if(n===("t"===e[0]||"T"===e[0]))return e}return n?r.options.trueStr:r.options.falseStr}};return an.boolTag=t,an}var un,ln,fn={},pn={};function hn(){if(un)return pn;return un=1,pn.stringifyNumber=function({format:e,minFractionDigits:t,tag:n,value:r}){if("bigint"==typeof r)return String(r);const s="number"==typeof r?r:Number(r);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let i=JSON.stringify(r);if(!e&&t&&(!n||"tag:yaml.org,2002:float"===n)&&/^\d/.test(i)){let e=i.indexOf(".");e<0&&(e=i.length,i+=".");let n=t-(i.length-e-1);for(;n-- >0;)i+="0"}return i},pn}function dn(){if(ln)return fn;ln=1;var e=ot(),t=hn();const n={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?NaN:"-"===e[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:t.stringifyNumber},r={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const n=Number(e.value);return isFinite(n)?n.toExponential():t.stringifyNumber(e)}},s={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){const n=new e.Scalar(parseFloat(t)),r=t.indexOf(".");return-1!==r&&"0"===t[t.length-1]&&(n.minFractionDigits=t.length-r-1),n},stringify:t.stringifyNumber};return fn.float=s,fn.floatExp=r,fn.floatNaN=n,fn}var mn,gn={};function yn(){if(mn)return gn;mn=1;var e=hn();const t=e=>"bigint"==typeof e||Number.isInteger(e),n=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function r(n,r,s){const{value:i}=n;return t(i)&&i>=0?s+i.toString(r):e.stringifyNumber(n)}const s={identify:e=>t(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,r)=>n(e,2,8,r),stringify:e=>r(e,8,"0o")},i={identify:t,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,r)=>n(e,0,10,r),stringify:e.stringifyNumber},o={identify:e=>t(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,r)=>n(e,2,16,r),stringify:e=>r(e,16,"0x")};return gn.int=i,gn.intHex=o,gn.intOct=s,gn}var vn,_n={};function bn(){if(vn)return _n;vn=1;var e=qt(),t=sn(),n=Qt(),r=en(),s=cn(),i=dn(),o=yn();const a=[e.map,n.seq,r.string,t.nullTag,s.boolTag,o.intOct,o.int,o.intHex,i.floatNaN,i.floatExp,i.float];return _n.schema=a,_n}var wn,Sn={};function An(){if(wn)return Sn;wn=1;var e=ot(),t=qt(),n=Qt();function r(e){return"bigint"==typeof e||Number.isInteger(e)}const s=({value:e})=>JSON.stringify(e),i=[{identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:s},{identify:e=>null==e,createNode:()=>new e.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:s},{identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>"true"===e,stringify:s},{identify:r,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>r(e)?e.toString():JSON.stringify(e)},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:s}],o={default:!0,tag:"",test:/^/,resolve:(e,t)=>(t(`Unresolved plain scalar ${JSON.stringify(e)}`),e)},a=[t.map,n.seq].concat(i,o);return Sn.schema=a,Sn}var kn,En={};function xn(){if(kn)return En;kn=1;var e=A,t=ot(),n=St();const r={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,n){if("function"==typeof e.Buffer)return e.Buffer.from(t,"base64");if("function"==typeof atob){const e=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(e.length);for(let t=0;t<e.length;++t)n[t]=e.charCodeAt(t);return n}return n("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:r,type:s,value:i},o,a,c){if(!i)return"";const u=i;let l;if("function"==typeof e.Buffer)l=u instanceof e.Buffer?u.toString("base64"):e.Buffer.from(u.buffer).toString("base64");else{if("function"!=typeof btoa)throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");{let e="";for(let t=0;t<u.length;++t)e+=String.fromCharCode(u[t]);l=btoa(e)}}if(s??(s=t.Scalar.BLOCK_LITERAL),s!==t.Scalar.QUOTE_DOUBLE){const e=Math.max(o.options.lineWidth-o.indent.length,o.options.minContentWidth),n=Math.ceil(l.length/e),r=new Array(n);for(let t=0,s=0;t<n;++t,s+=e)r[t]=l.substr(s,e);l=r.join(s===t.Scalar.BLOCK_LITERAL?"\n":" ")}return n.stringifyString({comment:r,type:s,value:l},o,a,c)}};return En.binary=r,En}var $n,On,Rn={},Cn={};function Tn(){if($n)return Cn;$n=1;var e=Pe(),t=It(),n=ot(),r=Yt();function s(r,s){if(e.isSeq(r))for(let i=0;i<r.items.length;++i){let o=r.items[i];if(!e.isPair(o)){if(e.isMap(o)){o.items.length>1&&s("Each pair must have its own sequence indicator");const e=o.items[0]||new t.Pair(new n.Scalar(null));if(o.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${o.commentBefore}\n${e.key.commentBefore}`:o.commentBefore),o.comment){const t=e.value??e.key;t.comment=t.comment?`${o.comment}\n${t.comment}`:o.comment}o=e}r.items[i]=e.isPair(o)?o:new t.Pair(o)}}else s("Expected a sequence for this tag");return r}function i(e,n,s){const{replacer:i}=s,o=new r.YAMLSeq(e);o.tag="tag:yaml.org,2002:pairs";let a=0;if(n&&Symbol.iterator in Object(n))for(let e of n){let r,c;if("function"==typeof i&&(e=i.call(n,String(a++),e)),Array.isArray(e)){if(2!==e.length)throw new TypeError(`Expected [key, value] tuple: ${e}`);r=e[0],c=e[1]}else if(e&&e instanceof Object){const t=Object.keys(e);if(1!==t.length)throw new TypeError(`Expected tuple with one key, not ${t.length} keys`);r=t[0],c=e[r]}else r=e;o.items.push(t.createPair(r,c,s))}return o}const o={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:s,createNode:i};return Cn.createPairs=i,Cn.pairs=o,Cn.resolvePairs=s,Cn}function Pn(){if(On)return Rn;On=1;var e=Pe(),t=Qe(),n=Ut(),r=Yt(),s=Tn();class i extends r.YAMLSeq{constructor(){super(),this.add=n.YAMLMap.prototype.add.bind(this),this.delete=n.YAMLMap.prototype.delete.bind(this),this.get=n.YAMLMap.prototype.get.bind(this),this.has=n.YAMLMap.prototype.has.bind(this),this.set=n.YAMLMap.prototype.set.bind(this),this.tag=i.tag}toJSON(n,r){if(!r)return super.toJSON(n);const s=new Map;r?.onCreate&&r.onCreate(s);for(const n of this.items){let i,o;if(e.isPair(n)?(i=t.toJS(n.key,"",r),o=t.toJS(n.value,i,r)):i=t.toJS(n,"",r),s.has(i))throw new Error("Ordered maps must not include duplicate keys");s.set(i,o)}return s}static from(e,t,n){const r=s.createPairs(e,t,n),i=new this;return i.items=r.items,i}}i.tag="tag:yaml.org,2002:omap";const o={collection:"seq",identify:e=>e instanceof Map,nodeClass:i,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,n){const r=s.resolvePairs(t,n),o=[];for(const{key:t}of r.items)e.isScalar(t)&&(o.includes(t.value)?n(`Ordered maps must not include duplicate keys: ${t.value}`):o.push(t.value));return Object.assign(new i,r)},createNode:(e,t,n)=>i.from(e,t,n)};return Rn.YAMLOMap=i,Rn.omap=o,Rn}var Ln,Nn={},In={};function Mn(){if(Ln)return In;Ln=1;var e=ot();function t({value:e,source:t},s){return t&&(e?n:r).test.test(t)?t:e?s.options.trueStr:s.options.falseStr}const n={identify:e=>!0===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new e.Scalar(!0),stringify:t},r={identify:e=>!1===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new e.Scalar(!1),stringify:t};return In.falseTag=r,In.trueTag=n,In}var Dn,jn={};function Hn(){if(Dn)return jn;Dn=1;var e=ot(),t=hn();const n={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?NaN:"-"===e[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:t.stringifyNumber},r={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const n=Number(e.value);return isFinite(n)?n.toExponential():t.stringifyNumber(e)}},s={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){const n=new e.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(-1!==r){const e=t.substring(r+1).replace(/_/g,"");"0"===e[e.length-1]&&(n.minFractionDigits=e.length)}return n},stringify:t.stringifyNumber};return jn.float=s,jn.floatExp=r,jn.floatNaN=n,jn}var Fn,Bn={};function zn(){if(Fn)return Bn;Fn=1;var e=hn();const t=e=>"bigint"==typeof e||Number.isInteger(e);function n(e,t,n,{intAsBigInt:r}){const s=e[0];if("-"!==s&&"+"!==s||(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}const t=BigInt(e);return"-"===s?BigInt(-1)*t:t}const i=parseInt(e,n);return"-"===s?-1*i:i}function r(n,r,s){const{value:i}=n;if(t(i)){const e=i.toString(r);return i<0?"-"+s+e.substr(1):s+e}return e.stringifyNumber(n)}const s={identify:t,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,r)=>n(e,2,2,r),stringify:e=>r(e,2,"0b")},i={identify:t,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,r)=>n(e,1,8,r),stringify:e=>r(e,8,"0")},o={identify:t,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,r)=>n(e,0,10,r),stringify:e.stringifyNumber},a={identify:t,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,r)=>n(e,2,16,r),stringify:e=>r(e,16,"0x")};return Bn.int=o,Bn.intBin=s,Bn.intHex=a,Bn.intOct=i,Bn}var Kn,Un={};function qn(){if(Kn)return Un;Kn=1;var e=Pe(),t=It(),n=Ut();class r extends n.YAMLMap{constructor(e){super(e),this.tag=r.tag}add(r){let s;s=e.isPair(r)?r:r&&"object"==typeof r&&"key"in r&&"value"in r&&null===r.value?new t.Pair(r.key,null):new t.Pair(r,null);n.findPair(this.items,s.key)||this.items.push(s)}get(t,r){const s=n.findPair(this.items,t);return!r&&e.isPair(s)?e.isScalar(s.key)?s.key.value:s.key:s}set(e,r){if("boolean"!=typeof r)throw new Error("Expected boolean value for set(key, value) in a YAML set, not "+typeof r);const s=n.findPair(this.items,e);s&&!r?this.items.splice(this.items.indexOf(s),1):!s&&r&&this.items.push(new t.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,n,r){const{replacer:s}=r,i=new this(e);if(n&&Symbol.iterator in Object(n))for(let e of n)"function"==typeof s&&(e=s.call(n,e,e)),i.items.push(t.createPair(e,null,r));return i}}r.tag="tag:yaml.org,2002:set";const s={collection:"map",identify:e=>e instanceof Set,nodeClass:r,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>r.from(e,t,n),resolve(t,n){if(e.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new r,t);n("Set items must all have null values")}else n("Expected a mapping for this tag");return t}};return Un.YAMLSet=r,Un.set=s,Un}var Zn,Wn,Gn,Vn,Yn={};function Qn(){if(Zn)return Yn;Zn=1;var e=hn();function t(e,t){const n=e[0],r="-"===n||"+"===n?e.substring(1):e,s=e=>t?BigInt(e):Number(e),i=r.replace(/_/g,"").split(":").reduce((e,t)=>e*s(60)+s(t),s(0));return"-"===n?s(-1)*i:i}function n(t){let{value:n}=t,r=e=>e;if("bigint"==typeof n)r=e=>BigInt(e);else if(isNaN(n)||!isFinite(n))return e.stringifyNumber(t);let s="";n<0&&(s="-",n*=r(-1));const i=r(60),o=[n%i];return n<60?o.unshift(0):(n=(n-o[0])/i,o.unshift(n%i),n>=60&&(n=(n-o[0])/i,o.unshift(n))),s+o.map(e=>String(e).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const r={identify:e=>"bigint"==typeof e||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,n,{intAsBigInt:r})=>t(e,r),stringify:n},s={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>t(e,!1),stringify:n},i={identify:e=>e 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(e){const n=e.match(i.test);if(!n)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,r,s,o,a,c,u]=n.map(Number),l=n[7]?Number((n[7]+"00").substr(1,3)):0;let f=Date.UTC(r,s-1,o,a||0,c||0,u||0,l);const p=n[8];if(p&&"Z"!==p){let e=t(p,!1);Math.abs(e)<30&&(e*=60),f-=6e4*e}return new Date(f)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};return Yn.floatTime=s,Yn.intTime=r,Yn.timestamp=i,Yn}function Jn(){if(Wn)return Nn;Wn=1;var e=qt(),t=sn(),n=Qt(),r=en(),s=xn(),i=Mn(),o=Hn(),a=zn(),c=Lt(),u=Pn(),l=Tn(),f=qn(),p=Qn();const h=[e.map,n.seq,r.string,t.nullTag,i.trueTag,i.falseTag,a.intBin,a.intOct,a.int,a.intHex,o.floatNaN,o.floatExp,o.float,s.binary,c.merge,u.omap,l.pairs,f.set,p.intTime,p.floatTime,p.timestamp];return Nn.schema=h,Nn}function Xn(){if(Gn)return nn;Gn=1;var e=qt(),t=sn(),n=Qt(),r=en(),s=cn(),i=dn(),o=yn(),a=bn(),c=An(),u=xn(),l=Lt(),f=Pn(),p=Tn(),h=Jn(),d=qn(),m=Qn();const g=new Map([["core",a.schema],["failsafe",[e.map,n.seq,r.string]],["json",c.schema],["yaml11",h.schema],["yaml-1.1",h.schema]]),y={binary:u.binary,bool:s.boolTag,float:i.float,floatExp:i.floatExp,floatNaN:i.floatNaN,floatTime:m.floatTime,int:o.int,intHex:o.intHex,intOct:o.intOct,intTime:m.intTime,map:e.map,merge:l.merge,null:t.nullTag,omap:f.omap,pairs:p.pairs,seq:n.seq,set:d.set,timestamp:m.timestamp},v={"tag:yaml.org,2002:binary":u.binary,"tag:yaml.org,2002:merge":l.merge,"tag:yaml.org,2002:omap":f.omap,"tag:yaml.org,2002:pairs":p.pairs,"tag:yaml.org,2002:set":d.set,"tag:yaml.org,2002:timestamp":m.timestamp};return nn.coreKnownTags=v,nn.getTags=function(e,t,n){const r=g.get(t);if(r&&!e)return n&&!r.includes(l.merge)?r.concat(l.merge):r.slice();let s=r;if(!s){if(!Array.isArray(e)){const e=Array.from(g.keys()).filter(e=>"yaml11"!==e).map(e=>JSON.stringify(e)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}s=[]}if(Array.isArray(e))for(const t of e)s=s.concat(t);else"function"==typeof e&&(s=e(s.slice()));return n&&(s=s.concat(l.merge)),s.reduce((e,t)=>{const n="string"==typeof t?y[t]:t;if(!n){const e=JSON.stringify(t),n=Object.keys(y).map(e=>JSON.stringify(e)).join(", ");throw new Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])},nn}function er(){if(Vn)return Ht;Vn=1;var e=Pe(),t=qt(),n=Qt(),r=en(),s=Xn();const i=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;return Ht.Schema=class o{constructor({compat:o,customTags:a,merge:c,resolveKnownTags:u,schema:l,sortMapEntries:f,toStringDefaults:p}){this.compat=Array.isArray(o)?s.getTags(o,"compat"):o?s.getTags(null,o):null,this.name="string"==typeof l&&l||"core",this.knownTags=u?s.coreKnownTags:{},this.tags=s.getTags(a,this.name,c),this.toStringOptions=p??null,Object.defineProperty(this,e.MAP,{value:t.map}),Object.defineProperty(this,e.SCALAR,{value:r.string}),Object.defineProperty(this,e.SEQ,{value:n.seq}),this.sortMapEntries="function"==typeof f?f:!0===f?i:null}clone(){const e=Object.create(o.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}},Ht}var tr,nr,rr={};function sr(){if(tr)return rr;tr=1;var e=Pe(),t=At(),n=dt();return rr.stringifyDocument=function(r,s){const i=[];let o=!0===s.directives;if(!1!==s.directives&&r.directives){const e=r.directives.toString(r);e?(i.push(e),o=!0):r.directives.docStart&&(o=!0)}o&&i.push("---");const a=t.createStringifyContext(r,s),{commentString:c}=a.options;if(r.commentBefore){1!==i.length&&i.unshift("");const e=c(r.commentBefore);i.unshift(n.indentComment(e,""))}let u=!1,l=null;if(r.contents){if(e.isNode(r.contents)){if(r.contents.spaceBefore&&o&&i.push(""),r.contents.commentBefore){const e=c(r.contents.commentBefore);i.push(n.indentComment(e,""))}a.forceBlockIndent=!!r.comment,l=r.contents.comment}const s=l?void 0:()=>u=!0;let f=t.stringify(r.contents,a,()=>l=null,s);l&&(f+=n.lineComment(f,"",c(l))),"|"!==f[0]&&">"!==f[0]||"---"!==i[i.length-1]?i.push(f):i[i.length-1]=`--- ${f}`}else i.push(t.stringify(r.contents,a));if(r.directives?.docEnd)if(r.comment){const e=c(r.comment);e.includes("\n")?(i.push("..."),i.push(n.indentComment(e,""))):i.push(`... ${e}`)}else i.push("...");else{let e=r.comment;e&&u&&(e=e.replace(/^\n+/,"")),e&&(u&&!l||""===i[i.length-1]||i.push(""),i.push(n.indentComment(c(e),"")))}return i.join("\n")+"\n"},rr}function ir(){if(nr)return He;nr=1;var e=Xe(),t=ct(),n=Pe(),r=It(),s=Qe(),i=er(),o=sr(),a=ze(),c=Ze(),u=at(),l=De();function f(e){if(n.isCollection(e))return!0;throw new Error("Expected a YAML collection as document contents")}return He.Document=class p{constructor(e,t,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,n.NODE_TYPE,{value:n.DOC});let s=null;"function"==typeof t||Array.isArray(t)?s=t:void 0===r&&t&&(r=t,t=void 0);const i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=i;let{version:o}=i;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new l.Directives({version:o}),this.setSchema(o,r),this.contents=void 0===e?null:this.createNode(e,s,r)}clone(){const e=Object.create(p.prototype,{[n.NODE_TYPE]:{value:n.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=n.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){f(this.contents)&&this.contents.add(e)}addIn(e,t){f(this.contents)&&this.contents.addIn(e,t)}createAlias(t,n){if(!t.anchor){const e=a.anchorNames(this);t.anchor=!n||e.has(n)?a.findNewAnchor(n||"a",e):n}return new e.Alias(t.anchor)}createNode(e,t,r){let s;if("function"==typeof t)e=t.call({"":e},"",e),s=t;else if(Array.isArray(t)){const e=e=>"number"==typeof e||e instanceof String||e instanceof Number,n=t.filter(e).map(String);n.length>0&&(t=t.concat(n)),s=t}else void 0===r&&t&&(r=t,t=void 0);const{aliasDuplicateObjects:i,anchorPrefix:o,flow:c,keepUndefined:l,onTagObj:f,tag:p}=r??{},{onAnchor:h,setAnchors:d,sourceObjects:m}=a.createNodeAnchors(this,o||"a"),g={aliasDuplicateObjects:i??!0,keepUndefined:l??!1,onAnchor:h,onTagObj:f,replacer:s,schema:this.schema,sourceObjects:m},y=u.createNode(e,p,g);return c&&n.isCollection(y)&&(y.flow=!0),d(),y}createPair(e,t,n={}){const s=this.createNode(e,null,n),i=this.createNode(t,null,n);return new r.Pair(s,i)}delete(e){return!!f(this.contents)&&this.contents.delete(e)}deleteIn(e){return t.isEmptyPath(e)?null!=this.contents&&(this.contents=null,!0):!!f(this.contents)&&this.contents.deleteIn(e)}get(e,t){return n.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,r){return t.isEmptyPath(e)?!r&&n.isScalar(this.contents)?this.contents.value:this.contents:n.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return!!n.isCollection(this.contents)&&this.contents.has(e)}hasIn(e){return t.isEmptyPath(e)?void 0!==this.contents:!!n.isCollection(this.contents)&&this.contents.hasIn(e)}set(e,n){null==this.contents?this.contents=t.collectionFromPath(this.schema,[e],n):f(this.contents)&&this.contents.set(e,n)}setIn(e,n){t.isEmptyPath(e)?this.contents=n:null==this.contents?this.contents=t.collectionFromPath(this.schema,Array.from(e),n):f(this.contents)&&this.contents.setIn(e,n)}setSchema(e,t={}){let n;switch("number"==typeof e&&(e=String(e)),e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new l.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new l.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{const t=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else{if(!n)throw new Error("With a null YAML version, the { schema: Schema } option is required");this.schema=new i.Schema(Object.assign(n,t))}}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:o}={}){const a={anchors:new Map,doc:this,keep:!e,mapAsMap:!0===n,mapKeyWarned:!1,maxAliasCount:"number"==typeof r?r:100},u=s.toJS(this.contents,t??"",a);if("function"==typeof i)for(const{count:e,res:t}of a.anchors.values())i(t,e);return"function"==typeof o?c.applyReviver(o,{"":u},"",u):u}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return o.stringifyDocument(this,e)}},He}var or,ar={};function cr(){if(or)return ar;or=1;class e extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}}return ar.YAMLError=e,ar.YAMLParseError=class extends e{constructor(e,t,n){super("YAMLParseError",e,t,n)}},ar.YAMLWarning=class extends e{constructor(e,t,n){super("YAMLWarning",e,t,n)}},ar.prettifyError=(e,t)=>n=>{if(-1===n.pos[0])return;n.linePos=n.pos.map(e=>t.linePos(e));const{line:r,col:s}=n.linePos[0];n.message+=` at line ${r}, column ${s}`;let i=s-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(i>=60&&o.length>80){const e=Math.min(i-39,o.length-79);o="…"+o.substring(e),i-=e-1}if(o.length>80&&(o=o.substring(0,79)+"…"),r>1&&/^ *$/.test(o.substring(0,i))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+"…\n"),o=n+o}if(/[^ ]/.test(o)){let e=1;const t=n.linePos[1];t&&t.line===r&&t.col>s&&(e=Math.max(1,Math.min(t.col-s,80-i)));const a=" ".repeat(i)+"^".repeat(e);n.message+=`:\n\n${o}\n${a}\n`}},ar}var ur,lr={},fr={},pr={},hr={},dr={};function mr(){if(ur)return dr;return ur=1,dr.resolveProps=function(e,{flow:t,indicator:n,next:r,offset:s,onError:i,parentIndent:o,startOnNewline:a}){let c=!1,u=a,l=a,f="",p="",h=!1,d=!1,m=null,g=null,y=null,v=null,_=null,b=null,w=null;for(const s of e)switch(d&&("space"!==s.type&&"newline"!==s.type&&"comma"!==s.type&&i(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),d=!1),m&&(u&&"comment"!==s.type&&"newline"!==s.type&&i(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),m=null),s.type){case"space":t||"doc-start"===n&&"flow-collection"===r?.type||!s.source.includes("\t")||(m=s),l=!0;break;case"comment":{l||i(s,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const e=s.source.substring(1)||" ";f?f+=p+e:f=e,p="",u=!1;break}case"newline":u?f?f+=s.source:b&&"seq-item-ind"===n||(c=!0):p+=s.source,u=!0,h=!0,(g||y)&&(v=s),l=!0;break;case"anchor":g&&i(s,"MULTIPLE_ANCHORS","A node can have at most one anchor"),s.source.endsWith(":")&&i(s.offset+s.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=s,w??(w=s.offset),u=!1,l=!1,d=!0;break;case"tag":y&&i(s,"MULTIPLE_TAGS","A node can have at most one tag"),y=s,w??(w=s.offset),u=!1,l=!1,d=!0;break;case n:(g||y)&&i(s,"BAD_PROP_ORDER",`Anchors and tags must be after the ${s.source} indicator`),b&&i(s,"UNEXPECTED_TOKEN",`Unexpected ${s.source} in ${t??"collection"}`),b=s,u="seq-item-ind"===n||"explicit-key-ind"===n,l=!1;break;case"comma":if(t){_&&i(s,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),_=s,u=!1,l=!1;break}default:i(s,"UNEXPECTED_TOKEN",`Unexpected ${s.type} token`),u=!1,l=!1}const S=e[e.length-1],A=S?S.offset+S.source.length:s;return d&&r&&"space"!==r.type&&"newline"!==r.type&&"comma"!==r.type&&("scalar"!==r.type||""!==r.source)&&i(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m&&(u&&m.indent<=o||"block-map"===r?.type||"block-seq"===r?.type)&&i(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:_,found:b,spaceBefore:c,comment:f,hasNewline:h,anchor:g,tag:y,newlineAfterProp:v,end:A,start:w??A}},dr}var gr,yr={};function vr(){if(gr)return yr;return gr=1,yr.containsNewline=function e(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes("\n"))return!0;if(t.end)for(const e of t.end)if("newline"===e.type)return!0;return!1;case"flow-collection":for(const n of t.items){for(const e of n.start)if("newline"===e.type)return!0;if(n.sep)for(const e of n.sep)if("newline"===e.type)return!0;if(e(n.key)||e(n.value))return!0}return!1;default:return!0}},yr}var _r,br={};function wr(){if(_r)return br;_r=1;var e=vr();return br.flowIndentCheck=function(t,n,r){if("flow-collection"===n?.type){const s=n.end[0];if(s.indent===t&&("]"===s.source||"}"===s.source)&&e.containsNewline(n)){r(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}},br}var Sr,Ar,kr={};function Er(){if(Sr)return kr;Sr=1;var e=Pe();return kr.mapIncludes=function(t,n,r){const{uniqueKeys:s}=t.options;if(!1===s)return!1;const i="function"==typeof s?s:(t,n)=>t===n||e.isScalar(t)&&e.isScalar(n)&&t.value===n.value;return n.some(e=>i(e.key,r))},kr}function xr(){if(Ar)return hr;Ar=1;var e=It(),t=Ut(),n=mr(),r=vr(),s=wr(),i=Er();const o="All mapping items must start at the same column";return hr.resolveBlockMap=function({composeNode:a,composeEmptyNode:c},u,l,f,p){const h=new(p?.nodeClass??t.YAMLMap)(u.schema);u.atRoot&&(u.atRoot=!1);let d=l.offset,m=null;for(const t of l.items){const{start:p,key:g,sep:y,value:v}=t,_=n.resolveProps(p,{indicator:"explicit-key-ind",next:g??y?.[0],offset:d,onError:f,parentIndent:l.indent,startOnNewline:!0}),b=!_.found;if(b){if(g&&("block-seq"===g.type?f(d,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in g&&g.indent!==l.indent&&f(d,"BAD_INDENT",o)),!_.anchor&&!_.tag&&!y){m=_.end,_.comment&&(h.comment?h.comment+="\n"+_.comment:h.comment=_.comment);continue}(_.newlineAfterProp||r.containsNewline(g))&&f(g??p[p.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else _.found?.indent!==l.indent&&f(d,"BAD_INDENT",o);u.atKey=!0;const w=_.end,S=g?a(u,g,_,f):c(u,w,p,null,_,f);u.schema.compat&&s.flowIndentCheck(l.indent,g,f),u.atKey=!1,i.mapIncludes(u,h.items,S)&&f(w,"DUPLICATE_KEY","Map keys must be unique");const A=n.resolveProps(y??[],{indicator:"map-value-ind",next:v,offset:S.range[2],onError:f,parentIndent:l.indent,startOnNewline:!g||"block-scalar"===g.type});if(d=A.end,A.found){b&&("block-map"!==v?.type||A.hasNewline||f(d,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),u.options.strict&&_.start<A.found.offset-1024&&f(S.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const n=v?a(u,v,A,f):c(u,d,y,null,A,f);u.schema.compat&&s.flowIndentCheck(l.indent,v,f),d=n.range[2];const r=new e.Pair(S,n);u.options.keepSourceTokens&&(r.srcToken=t),h.items.push(r)}else{b&&f(S.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),A.comment&&(S.comment?S.comment+="\n"+A.comment:S.comment=A.comment);const n=new e.Pair(S);u.options.keepSourceTokens&&(n.srcToken=t),h.items.push(n)}}return m&&m<d&&f(m,"IMPOSSIBLE","Map comment with trailing content"),h.range=[l.offset,d,m??d],h},hr}var $r,Or={};function Rr(){if($r)return Or;$r=1;var e=Yt(),t=mr(),n=wr();return Or.resolveBlockSeq=function({composeNode:r,composeEmptyNode:s},i,o,a,c){const u=new(c?.nodeClass??e.YAMLSeq)(i.schema);i.atRoot&&(i.atRoot=!1),i.atKey&&(i.atKey=!1);let l=o.offset,f=null;for(const{start:e,value:c}of o.items){const p=t.resolveProps(e,{indicator:"seq-item-ind",next:c,offset:l,onError:a,parentIndent:o.indent,startOnNewline:!0});if(!p.found){if(!(p.anchor||p.tag||c)){f=p.end,p.comment&&(u.comment=p.comment);continue}c&&"block-seq"===c.type?a(p.end,"BAD_INDENT","All sequence items must start at the same column"):a(l,"MISSING_CHAR","Sequence item without - indicator")}const h=c?r(i,c,p,a):s(i,p.end,e,null,p,a);i.schema.compat&&n.flowIndentCheck(o.indent,c,a),l=h.range[2],u.items.push(h)}return u.range=[o.offset,l,f??l],u},Or}var Cr,Tr,Pr,Lr={},Nr={};function Ir(){if(Cr)return Nr;return Cr=1,Nr.resolveEnd=function(e,t,n,r){let s="";if(e){let i=!1,o="";for(const a of e){const{source:e,type:c}=a;switch(c){case"space":i=!0;break;case"comment":{n&&!i&&r(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const t=e.substring(1)||" ";s?s+=o+t:s=t,o="";break}case"newline":s&&(o+=e),i=!0;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}t+=e.length}}return{comment:s,offset:t}},Nr}function Mr(){if(Tr)return Lr;Tr=1;var e=Pe(),t=It(),n=Ut(),r=Yt(),s=Ir(),i=mr(),o=vr(),a=Er();const c="Block collections are not allowed within flow collections",u=e=>e&&("block-map"===e.type||"block-seq"===e.type);return Lr.resolveFlowCollection=function({composeNode:l,composeEmptyNode:f},p,h,d,m){const g="{"===h.start.source,y=g?"flow map":"flow sequence",v=new(m?.nodeClass??(g?n.YAMLMap:r.YAMLSeq))(p.schema);v.flow=!0;const _=p.atRoot;_&&(p.atRoot=!1),p.atKey&&(p.atKey=!1);let b=h.offset+h.start.source.length;for(let r=0;r<h.items.length;++r){const s=h.items[r],{start:m,key:_,sep:w,value:S}=s,A=i.resolveProps(m,{flow:y,indicator:"explicit-key-ind",next:_??w?.[0],offset:b,onError:d,parentIndent:h.indent,startOnNewline:!1});if(!A.found){if(!(A.anchor||A.tag||w||S)){0===r&&A.comma?d(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${y}`):r<h.items.length-1&&d(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${y}`),A.comment&&(v.comment?v.comment+="\n"+A.comment:v.comment=A.comment),b=A.end;continue}!g&&p.options.strict&&o.containsNewline(_)&&d(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(0===r)A.comma&&d(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${y}`);else if(A.comma||d(A.start,"MISSING_CHAR",`Missing , between ${y} items`),A.comment){let t="";e:for(const e of m)switch(e.type){case"comma":case"space":break;case"comment":t=e.source.substring(1);break e;default:break e}if(t){let n=v.items[v.items.length-1];e.isPair(n)&&(n=n.value??n.key),n.comment?n.comment+="\n"+t:n.comment=t,A.comment=A.comment.substring(t.length+1)}}if(g||w||A.found){p.atKey=!0;const e=A.end,r=_?l(p,_,A,d):f(p,e,m,null,A,d);u(_)&&d(r.range,"BLOCK_IN_FLOW",c),p.atKey=!1;const o=i.resolveProps(w??[],{flow:y,indicator:"map-value-ind",next:S,offset:r.range[2],onError:d,parentIndent:h.indent,startOnNewline:!1});if(o.found){if(!g&&!A.found&&p.options.strict){if(w)for(const e of w){if(e===o.found)break;if("newline"===e.type){d(e,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}A.start<o.found.offset-1024&&d(o.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else S&&("source"in S&&S.source&&":"===S.source[0]?d(S,"MISSING_CHAR",`Missing space after : in ${y}`):d(o.start,"MISSING_CHAR",`Missing , or : between ${y} items`));const k=S?l(p,S,o,d):o.found?f(p,o.end,w,null,o,d):null;k?u(S)&&d(k.range,"BLOCK_IN_FLOW",c):o.comment&&(r.comment?r.comment+="\n"+o.comment:r.comment=o.comment);const E=new t.Pair(r,k);if(p.options.keepSourceTokens&&(E.srcToken=s),g){const t=v;a.mapIncludes(p,t.items,r)&&d(e,"DUPLICATE_KEY","Map keys must be unique"),t.items.push(E)}else{const e=new n.YAMLMap(p.schema);e.flow=!0,e.items.push(E);const t=(k??r).range;e.range=[r.range[0],t[1],t[2]],v.items.push(e)}b=k?k.range[2]:o.end}else{const e=S?l(p,S,A,d):f(p,A.end,w,null,A,d);v.items.push(e),b=e.range[2],u(S)&&d(e.range,"BLOCK_IN_FLOW",c)}}const w=g?"}":"]",[S,...A]=h.end;let k=b;if(S&&S.source===w)k=S.offset+S.source.length;else{const e=y[0].toUpperCase()+y.substring(1);d(b,_?"MISSING_CHAR":"BAD_INDENT",_?`${e} must end with a ${w}`:`${e} in block collection must be sufficiently indented and end with a ${w}`),S&&1!==S.source.length&&A.unshift(S)}if(A.length>0){const e=s.resolveEnd(A,k,p.options.strict,d);e.comment&&(v.comment?v.comment+="\n"+e.comment:v.comment=e.comment),v.range=[h.offset,k,e.offset]}else v.range=[h.offset,k,k];return v},Lr}function Dr(){if(Pr)return pr;Pr=1;var e=Pe(),t=ot(),n=Ut(),r=Yt(),s=xr(),i=Rr(),o=Mr();function a(e,t,n,r,a,c){const u="block-map"===n.type?s.resolveBlockMap(e,t,n,r,c):"block-seq"===n.type?i.resolveBlockSeq(e,t,n,r,c):o.resolveFlowCollection(e,t,n,r,c),l=u.constructor;return"!"===a||a===l.tagName?(u.tag=l.tagName,u):(a&&(u.tag=a),u)}return pr.composeCollection=function(s,i,o,c,u){const l=c.tag,f=l?i.directives.tagName(l.source,e=>u(l,"TAG_RESOLVE_FAILED",e)):null;if("block-seq"===o.type){const{anchor:e,newlineAfterProp:t}=c,n=e&&l?e.offset>l.offset?e:l:e??l;if(n&&(!t||t.offset<n.offset)){u(n,"MISSING_CHAR","Missing newline after block sequence props")}}const p="block-map"===o.type?"map":"block-seq"===o.type?"seq":"{"===o.start.source?"map":"seq";if(!l||!f||"!"===f||f===n.YAMLMap.tagName&&"map"===p||f===r.YAMLSeq.tagName&&"seq"===p)return a(s,i,o,u,f);let h=i.schema.tags.find(e=>e.tag===f&&e.collection===p);if(!h){const e=i.schema.knownTags[f];if(!e||e.collection!==p)return e?u(l,"BAD_COLLECTION_TYPE",`${e.tag} used for ${p} collection, but expects ${e.collection??"scalar"}`,!0):u(l,"TAG_RESOLVE_FAILED",`Unresolved tag: ${f}`,!0),a(s,i,o,u,f);i.schema.tags.push(Object.assign({},e,{default:!1})),h=e}const d=a(s,i,o,u,f,h),m=h.resolve?.(d,e=>u(l,"TAG_RESOLVE_FAILED",e),i.options)??d,g=e.isNode(m)?m:new t.Scalar(m);return g.range=d.range,g.tag=f,h?.format&&(g.format=h.format),g},pr}var jr,Hr={},Fr={};function Br(){if(jr)return Fr;jr=1;var e=ot();return Fr.resolveBlockScalar=function(t,n,r){const s=n.offset,i=function({offset:e,props:t},n,r){if("block-scalar-header"!==t[0].type)return r(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:s}=t[0],i=s[0];let o=0,a="",c=-1;for(let t=1;t<s.length;++t){const n=s[t];if(a||"-"!==n&&"+"!==n){const r=Number(n);!o&&r?o=r:-1===c&&(c=e+t)}else a=n}-1!==c&&r(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${s}`);let u=!1,l="",f=s.length;for(let e=1;e<t.length;++e){const s=t[e];switch(s.type){case"space":u=!0;case"newline":f+=s.source.length;break;case"comment":if(n&&!u){r(s,"MISSING_CHAR","Comments must be separated from other tokens by white space characters")}f+=s.source.length,l=s.source.substring(1);break;case"error":r(s,"UNEXPECTED_TOKEN",s.message),f+=s.source.length;break;default:{r(s,"UNEXPECTED_TOKEN",`Unexpected token in block scalar header: ${s.type}`);const e=s.source;e&&"string"==typeof e&&(f+=e.length)}}}return{mode:i,indent:o,chomp:a,comment:l,length:f}}(n,t.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[s,s,s]};const o=">"===i.mode?e.Scalar.BLOCK_FOLDED:e.Scalar.BLOCK_LITERAL,a=n.source?function(e){const t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),s=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let e=1;e<t.length;e+=2)s.push([t[e],t[e+1]]);return s}(n.source):[];let c=a.length;for(let e=a.length-1;e>=0;--e){const t=a[e][1];if(""!==t&&"\r"!==t)break;c=e}if(0===c){const e="+"===i.chomp&&a.length>0?"\n".repeat(Math.max(1,a.length-1)):"";let t=s+i.length;return n.source&&(t+=n.source.length),{value:e,type:o,comment:i.comment,range:[s,t,t]}}let u=n.indent+i.indent,l=n.offset+i.length,f=0;for(let e=0;e<c;++e){const[n,s]=a[e];if(""!==s&&"\r"!==s){if(n.length<u){const e="Block scalars with more-indented leading empty lines must use an explicit indentation indicator";r(l+n.length,"MISSING_CHAR",e)}if(0===i.indent&&(u=n.length),f=e,0===u&&!t.atRoot){r(l,"BAD_INDENT","Block scalar values in collections must be indented")}break}0===i.indent&&n.length>u&&(u=n.length),l+=n.length+s.length+1}for(let e=a.length-1;e>=c;--e)a[e][0].length>u&&(c=e+1);let p="",h="",d=!1;for(let e=0;e<f;++e)p+=a[e][0].slice(u)+"\n";for(let t=f;t<c;++t){let[n,s]=a[t];l+=n.length+s.length+1;const c="\r"===s[s.length-1];if(c&&(s=s.slice(0,-1)),s&&n.length<u){const e=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;r(l-s.length-(c?2:1),"BAD_INDENT",e),n=""}o===e.Scalar.BLOCK_LITERAL?(p+=h+n.slice(u)+s,h="\n"):n.length>u||"\t"===s[0]?(" "===h?h="\n":d||"\n"!==h||(h="\n\n"),p+=h+n.slice(u)+s,h="\n",d=!0):""===s?"\n"===h?p+="\n":h="\n":(p+=h+s,h=" ",d=!1)}switch(i.chomp){case"-":break;case"+":for(let e=c;e<a.length;++e)p+="\n"+a[e][0].slice(u);"\n"!==p[p.length-1]&&(p+="\n");break;default:p+="\n"}const m=s+i.length+n.source.length;return{value:p,type:o,comment:i.comment,range:[s,m,m]}},Fr}var zr,Kr,Ur={};function qr(){if(zr)return Ur;zr=1;var e=ot(),t=Ir();function n(e){let t,n;try{t=new RegExp("(.*?)(?<![ \t])[ \t]*\r?\n","sy"),n=new RegExp("[ \t]*(.*?)(?:(?<![ \t])[ \t]*)?\r?\n","sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let s=r[1],i=" ",o=t.lastIndex;for(n.lastIndex=o;r=n.exec(e);)""===r[1]?"\n"===i?s+=i:i="\n":(s+=i+r[1],i=" "),o=n.lastIndex;const a=/[ \t]*(.*)/sy;return a.lastIndex=o,r=a.exec(e),s+i+(r?.[1]??"")}function r(e,t){let n="",r=e[t+1];for(;!(" "!==r&&"\t"!==r&&"\n"!==r&&"\r"!==r||"\r"===r&&"\n"!==e[t+2]);)"\n"===r&&(n+="\n"),r=e[(t+=1)+1];return n||(n=" "),{fold:n,offset:t}}const s={0:"\0",a:"",b:"\b",e:"",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function i(e,t,n,r){const s=e.substr(t,n),i=s.length===n&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;if(isNaN(i)){const s=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${s}`),s}return String.fromCodePoint(i)}return Ur.resolveFlowScalar=function(o,a,c){const{offset:u,type:l,source:f,end:p}=o;let h,d;const m=(e,t,n)=>c(u+e,t,n);switch(l){case"scalar":h=e.Scalar.PLAIN,d=function(e,t){let r="";switch(e[0]){case"\t":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":r=`block scalar indicator ${e[0]}`;break;case"@":case"`":r=`reserved character ${e[0]}`}r&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`);return n(e)}(f,m);break;case"single-quoted-scalar":h=e.Scalar.QUOTE_SINGLE,d=function(e,t){"'"===e[e.length-1]&&1!==e.length||t(e.length,"MISSING_CHAR","Missing closing 'quote");return n(e.slice(1,-1)).replace(/''/g,"'")}(f,m);break;case"double-quoted-scalar":h=e.Scalar.QUOTE_DOUBLE,d=function(e,t){let n="";for(let o=1;o<e.length-1;++o){const a=e[o];if("\r"!==a||"\n"!==e[o+1])if("\n"===a){const{fold:t,offset:s}=r(e,o);n+=t,o=s}else if("\\"===a){let r=e[++o];const a=s[r];if(a)n+=a;else if("\n"===r)for(r=e[o+1];" "===r||"\t"===r;)r=e[1+ ++o];else if("\r"===r&&"\n"===e[o+1])for(r=e[1+ ++o];" "===r||"\t"===r;)r=e[1+ ++o];else if("x"===r||"u"===r||"U"===r){const s={x:2,u:4,U:8}[r];n+=i(e,o+1,s,t),o+=s}else{const r=e.substr(o-1,2);t(o-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${r}`),n+=r}}else if(" "===a||"\t"===a){const t=o;let r=e[o+1];for(;" "===r||"\t"===r;)r=e[1+ ++o];"\n"===r||"\r"===r&&"\n"===e[o+2]||(n+=o>t?e.slice(t,o+1):a)}else n+=a}'"'===e[e.length-1]&&1!==e.length||t(e.length,"MISSING_CHAR",'Missing closing "quote');return n}(f,m);break;default:return c(o,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${l}`),{value:"",type:null,comment:"",range:[u,u+f.length,u+f.length]}}const g=u+f.length,y=t.resolveEnd(p,g,a,c);return{value:d,type:h,comment:y.comment,range:[u,g,y.offset]}},Ur}function Zr(){if(Kr)return Hr;Kr=1;var e=Pe(),t=ot(),n=Br(),r=qr();return Hr.composeScalar=function(s,i,o,a){const{value:c,type:u,comment:l,range:f}="block-scalar"===i.type?n.resolveBlockScalar(s,i,a):r.resolveFlowScalar(i,s.options.strict,a),p=o?s.directives.tagName(o.source,e=>a(o,"TAG_RESOLVE_FAILED",e)):null;let h,d;h=s.options.stringKeys&&s.atKey?s.schema[e.SCALAR]:p?function(t,n,r,s,i){if("!"===r)return t[e.SCALAR];const o=[];for(const e of t.tags)if(!e.collection&&e.tag===r){if(!e.default||!e.test)return e;o.push(e)}for(const e of o)if(e.test?.test(n))return e;const a=t.knownTags[r];if(a&&!a.collection)return t.tags.push(Object.assign({},a,{default:!1,test:void 0})),a;return i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,"tag:yaml.org,2002:str"!==r),t[e.SCALAR]}(s.schema,c,p,o,a):"scalar"===i.type?function({atKey:t,directives:n,schema:r},s,i,o){const a=r.tags.find(e=>(!0===e.default||t&&"key"===e.default)&&e.test?.test(s))||r[e.SCALAR];if(r.compat){const t=r.compat.find(e=>e.default&&e.test?.test(s))??r[e.SCALAR];if(a.tag!==t.tag){o(i,"TAG_RESOLVE_FAILED",`Value may be parsed as either ${n.tagString(a.tag)} or ${n.tagString(t.tag)}`,!0)}}return a}(s,c,i,a):s.schema[e.SCALAR];try{const n=h.resolve(c,e=>a(o??i,"TAG_RESOLVE_FAILED",e),s.options);d=e.isScalar(n)?n:new t.Scalar(n)}catch(e){const n=e instanceof Error?e.message:String(e);a(o??i,"TAG_RESOLVE_FAILED",n),d=new t.Scalar(c)}return d.range=f,d.source=c,u&&(d.type=u),p&&(d.tag=p),h.format&&(d.format=h.format),l&&(d.comment=l),d},Hr}var Wr,Gr,Vr,Yr,Qr={};function Jr(){if(Wr)return Qr;return Wr=1,Qr.emptyScalarPosition=function(e,t,n){if(t){n??(n=t.length);for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case"space":case"comment":case"newline":e-=n.source.length;continue}for(n=t[++r];"space"===n?.type;)e+=n.source.length,n=t[++r];break}}return e},Qr}function Xr(){if(Gr)return fr;Gr=1;var e=Xe(),t=Pe(),n=Dr(),r=Zr(),s=Ir(),i=Jr();const o={composeNode:a,composeEmptyNode:c};function a(i,a,u,l){const f=i.atKey,{spaceBefore:p,comment:h,anchor:d,tag:m}=u;let g,y=!0;switch(a.type){case"alias":g=function({options:t},{offset:n,source:r,end:i},o){const a=new e.Alias(r.substring(1));""===a.source&&o(n,"BAD_ALIAS","Alias cannot be an empty string");a.source.endsWith(":")&&o(n+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const c=n+r.length,u=s.resolveEnd(i,c,t.strict,o);a.range=[n,c,u.offset],u.comment&&(a.comment=u.comment);return a}(i,a,l),(d||m)&&l(a,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":g=r.composeScalar(i,a,m,l),d&&(g.anchor=d.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":g=n.composeCollection(o,i,a,u,l),d&&(g.anchor=d.source.substring(1));break;default:l(a,"UNEXPECTED_TOKEN","error"===a.type?a.message:`Unsupported token (type: ${a.type})`),g=c(i,a.offset,void 0,null,u,l),y=!1}if(d&&""===g.anchor&&l(d,"BAD_ALIAS","Anchor cannot be an empty string"),f&&i.options.stringKeys&&(!t.isScalar(g)||"string"!=typeof g.value||g.tag&&"tag:yaml.org,2002:str"!==g.tag)){l(m??a,"NON_STRING_KEY","With stringKeys, all keys must be strings")}return p&&(g.spaceBefore=!0),h&&("scalar"===a.type&&""===a.source?g.comment=h:g.commentBefore=h),i.options.keepSourceTokens&&y&&(g.srcToken=a),g}function c(e,t,n,s,{spaceBefore:o,comment:a,anchor:c,tag:u,end:l},f){const p={type:"scalar",offset:i.emptyScalarPosition(t,n,s),indent:-1,source:""},h=r.composeScalar(e,p,u,f);return c&&(h.anchor=c.source.substring(1),""===h.anchor&&f(c,"BAD_ALIAS","Anchor cannot be an empty string")),o&&(h.spaceBefore=!0),a&&(h.comment=a,h.range[2]=l),h}return fr.composeEmptyNode=c,fr.composeNode=a,fr}function es(){if(Vr)return lr;Vr=1;var e=ir(),t=Xr(),n=Ir(),r=mr();return lr.composeDoc=function(s,i,{offset:o,start:a,value:c,end:u},l){const f=Object.assign({_directives:i},s),p=new e.Document(void 0,f),h={atKey:!1,atRoot:!0,directives:p.directives,options:p.options,schema:p.schema},d=r.resolveProps(a,{indicator:"doc-start",next:c??u?.[0],offset:o,onError:l,parentIndent:0,startOnNewline:!0});d.found&&(p.directives.docStart=!0,!c||"block-map"!==c.type&&"block-seq"!==c.type||d.hasNewline||l(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),p.contents=c?t.composeNode(h,c,d,l):t.composeEmptyNode(h,d.end,a,null,d,l);const m=p.contents.range[2],g=n.resolveEnd(u,m,!1,l);return g.comment&&(p.comment=g.comment),p.range=[o,m,g.offset],p},lr}function ts(){if(Yr)return Re;Yr=1;var e=S,t=De(),n=ir(),r=cr(),s=Pe(),i=es(),o=Ir();function a(e){if("number"==typeof e)return[e,e+1];if(Array.isArray(e))return 2===e.length?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+("string"==typeof n?n.length:1)]}function c(e){let t="",n=!1,r=!1;for(let s=0;s<e.length;++s){const i=e[s];switch(i[0]){case"#":t+=(""===t?"":r?"\n\n":"\n")+(i.substring(1)||" "),n=!0,r=!1;break;case"%":"#"!==e[s+1]?.[0]&&(s+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}return Re.Composer=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,s)=>{const i=a(e);s?this.warnings.push(new r.YAMLWarning(i,t,n)):this.errors.push(new r.YAMLParseError(i,t,n))},this.directives=new t.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){const{comment:n,afterEmptyLine:r}=c(this.prelude);if(n){const i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(s.isCollection(i)&&!i.flow&&i.items.length>0){let e=i.items[0];s.isPair(e)&&(e=e.key);const t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{const e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:c(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(const t of e)yield*this.next(t);yield*this.end(t,n)}*next(t){switch(e.env.LOG_STREAM&&console.dir(t,{depth:null}),t.type){case"directive":this.directives.add(t.source,(e,n,r)=>{const s=a(t);s[0]+=e,this.onError(s,"BAD_DIRECTIVE",n,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const e=i.composeDoc(this.options,this.directives,t,this.onError);this.atDirectives&&!e.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(e,!1),this.doc&&(yield this.doc),this.doc=e,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const e=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,n=new r.YAMLParseError(a(t),"UNEXPECTED_TOKEN",e);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){const e="Unexpected doc-end without preceding document";this.errors.push(new r.YAMLParseError(a(t),"UNEXPECTED_TOKEN",e));break}this.doc.directives.docEnd=!0;const e=o.resolveEnd(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),e.comment){const t=this.doc.comment;this.doc.comment=t?`${t}\n${e.comment}`:e.comment}this.doc.range[2]=e.offset;break}default:this.errors.push(new r.YAMLParseError(a(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const e=Object.assign({_directives:this.directives},this.options),r=new n.Document(void 0,e);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,t,t],this.decorate(r,!1),yield r}}},Re}var ns,rs={},ss={};function is(){if(ns)return ss;ns=1;var e=Br(),t=qr(),n=cr(),r=St();function s(e,t){if(t)for(const n of t)switch(n.type){case"space":case"comment":e.push(n);break;case"newline":return e.push(n),!0}return!1}function i(e,t,n){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=n,e.source=t;break;case"block-scalar":{const r=e.props.slice(1);let s=t.length;"block-scalar-header"===e.props[0].type&&(s-=e.props[0].source.length);for(const e of r)e.offset+=s;delete e.props,Object.assign(e,{type:n,source:t,end:r});break}case"block-map":case"block-seq":{const r={type:"newline",offset:e.offset+t.length,indent:e.indent,source:"\n"};delete e.items,Object.assign(e,{type:n,source:t,end:[r]});break}default:{const r="indent"in e?e.indent:-1,s="end"in e&&Array.isArray(e.end)?e.end.filter(e=>"space"===e.type||"comment"===e.type||"newline"===e.type):[];for(const t of Object.keys(e))"type"!==t&&"offset"!==t&&delete e[t];Object.assign(e,{type:n,indent:r,source:t,end:s})}}}return ss.createScalarToken=function(e,t){const{implicitKey:n=!1,indent:i,inFlow:o=!1,offset:a=-1,type:c="PLAIN"}=t,u=r.stringifyString({type:c,value:e},{implicitKey:n,indent:i>0?" ".repeat(i):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}}),l=t.end??[{type:"newline",offset:-1,indent:i,source:"\n"}];switch(u[0]){case"|":case">":{const e=u.indexOf("\n"),t=u.substring(0,e),n=u.substring(e+1)+"\n",r=[{type:"block-scalar-header",offset:a,indent:i,source:t}];return s(r,l)||r.push({type:"newline",offset:-1,indent:i,source:"\n"}),{type:"block-scalar",offset:a,indent:i,props:r,source:n}}case'"':return{type:"double-quoted-scalar",offset:a,indent:i,source:u,end:l};case"'":return{type:"single-quoted-scalar",offset:a,indent:i,source:u,end:l};default:return{type:"scalar",offset:a,indent:i,source:u,end:l}}},ss.resolveAsScalar=function(r,s=!0,i){if(r){const o=(e,t,r)=>{const s="number"==typeof e?e:Array.isArray(e)?e[0]:e.offset;if(!i)throw new n.YAMLParseError([s,s+1],t,r);i(s,t,r)};switch(r.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return t.resolveFlowScalar(r,s,o);case"block-scalar":return e.resolveBlockScalar({options:{strict:s}},r,o)}}return null},ss.setScalarValue=function(e,t,n={}){let{afterKey:o=!1,implicitKey:a=!1,inFlow:c=!1,type:u}=n,l="indent"in e?e.indent:null;if(o&&"number"==typeof l&&(l+=2),!u)switch(e.type){case"single-quoted-scalar":u="QUOTE_SINGLE";break;case"double-quoted-scalar":u="QUOTE_DOUBLE";break;case"block-scalar":{const t=e.props[0];if("block-scalar-header"!==t.type)throw new Error("Invalid block scalar header");u=">"===t.source[0]?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:u="PLAIN"}const f=r.stringifyString({type:u,value:t},{implicitKey:a||null===l,indent:null!==l&&l>0?" ".repeat(l):"",inFlow:c,options:{blockQuote:!0,lineWidth:-1}});switch(f[0]){case"|":case">":!function(e,t){const n=t.indexOf("\n"),r=t.substring(0,n),i=t.substring(n+1)+"\n";if("block-scalar"===e.type){const t=e.props[0];if("block-scalar-header"!==t.type)throw new Error("Invalid block scalar header");t.source=r,e.source=i}else{const{offset:t}=e,n="indent"in e?e.indent:-1,o=[{type:"block-scalar-header",offset:t,indent:n,source:r}];s(o,"end"in e?e.end:void 0)||o.push({type:"newline",offset:-1,indent:n,source:"\n"});for(const t of Object.keys(e))"type"!==t&&"offset"!==t&&delete e[t];Object.assign(e,{type:"block-scalar",indent:n,props:o,source:i})}}(e,f);break;case'"':i(e,f,"double-quoted-scalar");break;case"'":i(e,f,"single-quoted-scalar");break;default:i(e,f,"scalar")}},ss}var os,as={};function cs(){if(os)return as;os=1;function e(n){switch(n.type){case"block-scalar":{let t="";for(const r of n.props)t+=e(r);return t+n.source}case"block-map":case"block-seq":{let e="";for(const r of n.items)e+=t(r);return e}case"flow-collection":{let e=n.start.source;for(const r of n.items)e+=t(r);for(const t of n.end)e+=t.source;return e}case"document":{let e=t(n);if(n.end)for(const t of n.end)e+=t.source;return e}default:{let e=n.source;if("end"in n&&n.end)for(const t of n.end)e+=t.source;return e}}}function t({start:t,key:n,sep:r,value:s}){let i="";for(const e of t)i+=e.source;if(n&&(i+=e(n)),r)for(const e of r)i+=e.source;return s&&(i+=e(s)),i}return as.stringify=n=>"type"in n?e(n):t(n),as}var us,ls,fs={};function ps(){if(us)return fs;us=1;const e=Symbol("break visit"),t=Symbol("skip children"),n=Symbol("remove item");function r(e,t){"type"in e&&"document"===e.type&&(e={start:e.start,value:e.value}),s(Object.freeze([]),e,t)}function s(t,r,i){let o=i(r,t);if("symbol"==typeof o)return o;for(const a of["key","value"]){const c=r[a];if(c&&"items"in c){for(let r=0;r<c.items.length;++r){const o=s(Object.freeze(t.concat([[a,r]])),c.items[r],i);if("number"==typeof o)r=o-1;else{if(o===e)return e;o===n&&(c.items.splice(r,1),r-=1)}}"function"==typeof o&&"key"===a&&(o=o(r,t))}}return"function"==typeof o?o(r,t):o}return r.BREAK=e,r.SKIP=t,r.REMOVE=n,r.itemAtPath=(e,t)=>{let n=e;for(const[e,r]of t){const t=n?.[e];if(!t||!("items"in t))return;n=t.items[r]}return n},r.parentCollection=(e,t)=>{const n=r.itemAtPath(e,t.slice(0,-1)),s=t[t.length-1][0],i=n?.[s];if(i&&"items"in i)return i;throw new Error("Parent collection not found")},fs.visit=r,fs}function hs(){if(ls)return rs;ls=1;var e=is(),t=cs(),n=ps();return rs.createScalarToken=e.createScalarToken,rs.resolveAsScalar=e.resolveAsScalar,rs.setScalarValue=e.setScalarValue,rs.stringify=t.stringify,rs.visit=n.visit,rs.BOM="\ufeff",rs.DOCUMENT="",rs.FLOW_END="",rs.SCALAR="",rs.isCollection=e=>!!e&&"items"in e,rs.isScalar=e=>!!e&&("scalar"===e.type||"single-quoted-scalar"===e.type||"double-quoted-scalar"===e.type||"block-scalar"===e.type),rs.prettyToken=function(e){switch(e){case"\ufeff":return"<BOM>";case"":return"<DOC>";case"":return"<FLOW_END>";case"":return"<SCALAR>";default:return JSON.stringify(e)}},rs.tokenType=function(e){switch(e){case"\ufeff":return"byte-order-mark";case"":return"doc-mode";case"":return"flow-error-end";case"":return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case"\n":case"\r\n":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(e[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},rs}var ds,ms={};function gs(){if(ds)return ms;ds=1;var e=hs();function t(e){switch(e){case void 0:case" ":case"\n":case"\r":case"\t":return!0;default:return!1}}const n=new Set("0123456789ABCDEFabcdef"),r=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),s=new Set(",[]{}"),i=new Set(" ,[]{}\n\r\t"),o=e=>!e||i.has(e);return ms.Lexer=class{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(e,t=!1){if(e){if("string"!=typeof e)throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??"stream";for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;" "===t||"\t"===t;)t=this.buffer[++e];return!t||"#"===t||"\n"===t||"\r"===t&&"\n"===this.buffer[e+1]}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let n=this.buffer[e];if(this.indentNext>0){let t=0;for(;" "===n;)n=this.buffer[++t+e];if("\r"===n){const n=this.buffer[t+e+1];if("\n"===n||!n&&!this.atEnd)return e+t+1}return"\n"===n||t>=this.indentNext||!n&&!this.atEnd?e+t:-1}if("-"===n||"."===n){const n=this.buffer.substr(e,3);if(("---"===n||"..."===n)&&t(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return("number"!=typeof e||-1!==e&&e<this.pos)&&(e=this.buffer.indexOf("\n",this.pos),this.lineEndPos=e),-1===e?this.atEnd?this.buffer.substring(this.pos):null:("\r"===this.buffer[e-1]&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){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 t=this.getLine();if(null===t)return this.setNext("stream");if(t[0]===e.BOM&&(yield*this.pushCount(1),t=t.substring(1)),"%"===t[0]){let e=t.length,n=t.indexOf("#");for(;-1!==n;){const r=t[n-1];if(" "===r||"\t"===r){e=n-1;break}n=t.indexOf("#",n+1)}for(;;){const n=t[e-1];if(" "!==n&&"\t"!==n)break;e-=1}const r=(yield*this.pushCount(e))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){const e=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-e),yield*this.pushNewline(),"stream"}return yield e.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){const e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if("-"===e||"."===e){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const e=this.peek(3);if(("---"===e||"..."===e)&&t(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,"---"===e?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!t(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if(("-"===e||"?"===e||":"===e)&&t(n)){const e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const e=this.getLine();if(null===e)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);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(o),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=(yield*this.parseBlockScalarHeader()),t+=(yield*this.pushSpaces(!0)),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let n,r,s=-1;do{n=yield*this.pushNewline(),n>0?(r=yield*this.pushSpaces(!1),this.indentValue=s=r):r=0,r+=(yield*this.pushSpaces(!0))}while(n+r>0);const i=this.getLine();if(null===i)return this.setNext("flow");if(-1!==s&&s<this.indentNext&&"#"!==i[0]||0===s&&(i.startsWith("---")||i.startsWith("..."))&&t(i[3])){if(!(s===this.indentNext-1&&1===this.flowLevel&&("]"===i[0]||"}"===i[0])))return this.flowLevel=0,yield e.FLOW_END,yield*this.parseLineStart()}let a=0;for(;","===i[a];)a+=(yield*this.pushCount(1)),a+=(yield*this.pushSpaces(!0)),this.flowKey=!1;switch(a+=(yield*this.pushIndicators()),i[a]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-a),"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(o),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const e=this.charAt(1);if(this.flowKey||t(e)||","===e)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const e=this.charAt(0);let t=this.buffer.indexOf(e,this.pos+1);if("'"===e)for(;-1!==t&&"'"===this.buffer[t+1];)t=this.buffer.indexOf("'",t+2);else for(;-1!==t;){let e=0;for(;"\\"===this.buffer[t-1-e];)e+=1;if(e%2==0)break;t=this.buffer.indexOf('"',t+1)}const n=this.buffer.substring(0,t);let r=n.indexOf("\n",this.pos);if(-1!==r){for(;-1!==r;){const e=this.continueScalar(r+1);if(-1===e)break;r=n.indexOf("\n",e)}-1!==r&&(t=r-("\r"===n[r-1]?2:1))}if(-1===t){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){const t=this.buffer[++e];if("+"===t)this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if("-"!==t)break}return yield*this.pushUntil(e=>t(e)||"#"===e)}*parseBlockScalar(){let t,n=this.pos-1,r=0;e:for(let e=this.pos;t=this.buffer[e];++e)switch(t){case" ":r+=1;break;case"\n":n=e,r=0;break;case"\r":{const t=this.buffer[e+1];if(!t&&!this.atEnd)return this.setNext("block-scalar");if("\n"===t)break}default:break e}if(!t&&!this.atEnd)return this.setNext("block-scalar");if(r>=this.indentNext){-1===this.blockScalarIndent?this.indentNext=r:this.indentNext=this.blockScalarIndent+(0===this.indentNext?1:this.indentNext);do{const e=this.continueScalar(n+1);if(-1===e)break;n=this.buffer.indexOf("\n",e)}while(-1!==n);if(-1===n){if(!this.atEnd)return this.setNext("block-scalar");n=this.buffer.length}}let s=n+1;for(t=this.buffer[s];" "===t;)t=this.buffer[++s];if("\t"===t){for(;"\t"===t||" "===t||"\r"===t||"\n"===t;)t=this.buffer[++s];n=s-1}else if(!this.blockScalarKeep)for(;;){let e=n-1,t=this.buffer[e];"\r"===t&&(t=this.buffer[--e]);const s=e;for(;" "===t;)t=this.buffer[--e];if(!("\n"===t&&e>=this.pos&&e+1+r>s))break;n=e}return yield e.SCALAR,yield*this.pushToIndex(n+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const n=this.flowLevel>0;let r,i=this.pos-1,o=this.pos-1;for(;r=this.buffer[++o];)if(":"===r){const e=this.buffer[o+1];if(t(e)||n&&s.has(e))break;i=o}else if(t(r)){let e=this.buffer[o+1];if("\r"===r&&("\n"===e?(o+=1,r="\n",e=this.buffer[o+1]):i=o),"#"===e||n&&s.has(e))break;if("\n"===r){const e=this.continueScalar(o+1);if(-1===e)break;o=Math.max(o,e-2)}}else{if(n&&s.has(r))break;i=o}return r||this.atEnd?(yield e.SCALAR,yield*this.pushToIndex(i+1,!0),n?"flow":"doc"):this.setNext("plain-scalar")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){const n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(o))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const e=this.flowLevel>0,n=this.charAt(1);if(t(n)||e&&s.has(n))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if("<"===this.charAt(1)){let e=this.pos+2,n=this.buffer[e];for(;!t(n)&&">"!==n;)n=this.buffer[++e];return yield*this.pushToIndex(">"===n?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(r.has(t))t=this.buffer[++e];else{if("%"!==t||!n.has(this.buffer[e+1])||!n.has(this.buffer[e+2]))break;t=this.buffer[e+=3]}return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return"\n"===e?yield*this.pushCount(1):"\r"===e&&"\n"===this.charAt(1)?yield*this.pushCount(2):0}*pushSpaces(e){let t,n=this.pos-1;do{t=this.buffer[++n]}while(" "===t||e&&"\t"===t);const r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},ms}var ys,vs={};function _s(){if(ys)return vs;ys=1;return vs.LineCounter=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){const r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(0===t)return{line:0,col:e};return{line:t,col:e-this.lineStarts[t-1]+1}}}},vs}var bs,ws={};function Ss(){if(bs)return ws;bs=1;var e=S,t=hs(),n=gs();function r(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function s(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function i(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function o(e){switch(e.type){case"document":return e.start;case"block-map":{const t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function a(e){if(0===e.length)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;"space"===e[++t]?.type;);return e.splice(t,e.length)}function c(e){if("flow-seq-start"===e.start.type)for(const t of e.items)!t.sep||t.value||r(t.start,"explicit-key-ind")||r(t.sep,"map-value-ind")||(t.key&&(t.value=t.key),delete t.key,i(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}return ws.Parser=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new n.Lexer,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&0===this.offset&&this.onNewLine(0);for(const n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(n){if(this.source=n,e.env.LOG_TOKENS&&console.log("|",t.prettyToken(n)),this.atScalar)return this.atScalar=!1,yield*this.step(),void(this.offset+=n.length);const r=t.tokenType(n);if(r)if("scalar"===r)this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=r,yield*this.step(),r){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+n.length);break;case"space":this.atNewLine&&" "===n[0]&&(this.indent+=n.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=n.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=n.length}else{const e=`Not a YAML token: ${n}`;yield*this.pop({type:"error",offset:this.offset,message:e,source:n}),this.offset+=n.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if("doc-end"!==this.type||e&&"doc-end"===e.type){if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}else{for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source})}}peek(e){return this.stack[this.stack.length-e]}*pop(e){const t=e??this.stack.pop();if(t)if(0===this.stack.length)yield t;else{const e=this.peek(1);switch("block-scalar"===t.type?t.indent="indent"in e?e.indent:0:"flow-collection"===t.type&&"document"===e.type&&(t.indent=0),"flow-collection"===t.type&&c(t),e.type){case"document":e.value=t;break;case"block-scalar":e.props.push(t);break;case"block-map":{const n=e.items[e.items.length-1];if(n.value)return e.items.push({start:[],key:t,sep:[]}),void(this.onKeyLine=!0);if(!n.sep)return Object.assign(n,{key:t,sep:[]}),void(this.onKeyLine=!n.explicitKey);n.value=t;break}case"block-seq":{const n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case"flow-collection":{const n=e.items[e.items.length-1];return void(!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]}))}default:yield*this.pop(),yield*this.pop(t)}if(!("document"!==e.type&&"block-map"!==e.type&&"block-seq"!==e.type||"block-map"!==t.type&&"block-seq"!==t.type)){const n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&-1===s(n.start)&&(0===t.indent||n.start.every(e=>"comment"!==e.type||e.indent<t.indent))&&("document"===e.type?e.end=n.start:e.items.push({start:n.start}),t.items.splice(-1,1))}}else{const e="Tried to pop an empty stack";yield{type:"error",offset:this.offset,source:"",message:e}}}*stream(){switch(this.type){case"directive-line":return void(yield{type:"directive",offset:this.offset,source:this.source});case"byte-order-mark":case"space":case"comment":case"newline":return void(yield this.sourceToken);case"doc-mode":case"doc-start":{const e={type:"document",offset:this.offset,start:[]};return"doc-start"===this.type&&e.start.push(this.sourceToken),void this.stack.push(e)}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":return void(-1!==s(e.start)?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken));case"anchor":case"tag":case"space":case"comment":case"newline":return void e.start.push(this.sourceToken)}const t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if("map-value-ind"===this.type){const t=a(o(this.peek(2)));let n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];const r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:t,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":return void e.props.push(this.sourceToken);case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){const n="end"in t.value?t.value.end:void 0,r=Array.isArray(n)?n[n.length-1]:void 0;"comment"===r?.type?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){const n=e.items[e.items.length-2],r=n?.value?.end;if(Array.isArray(r))return Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),void e.items.pop()}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const n=!this.onKeyLine&&this.indent===e.indent,s=n&&(t.sep||t.explicitKey)&&"seq-item-ind"!==this.type;let o=[];if(s&&t.sep&&!t.value){const n=[];for(let r=0;r<t.sep.length;++r){const s=t.sep[r];switch(s.type){case"newline":n.push(r);break;case"space":break;case"comment":s.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(o=t.sep.splice(n[1]))}switch(this.type){case"anchor":case"tag":return void(s||t.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken));case"explicit-key-ind":return t.sep||t.explicitKey?s||t.value?(o.push(this.sourceToken),e.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}):(t.start.push(this.sourceToken),t.explicitKey=!0),void(this.onKeyLine=!0);case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(r(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(i(t.key)&&!r(t.sep,"newline")){const e=a(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else o.length>0?t.sep=t.sep.concat(o,this.sourceToken):t.sep.push(this.sourceToken);else if(r(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{const e=a(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||s?e.items.push({start:o,key:null,sep:[this.sourceToken]}):r(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return void(this.onKeyLine=!0);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const n=this.flowScalar(this.type);return void(s||t.value?(e.items.push({start:o,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0))}default:{const s=this.startBlockValue(e);if(s){if("block-seq"===s.type){if(!t.explicitKey&&t.sep&&!r(t.sep,"newline"))return void(yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source}))}else n&&e.items.push({start:o});return void this.stack.push(s)}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){const n="end"in t.value?t.value.end:void 0,r=Array.isArray(n)?n[n.length-1]:void 0;"comment"===r?.type?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){const n=e.items[e.items.length-2],r=n?.value?.end;if(Array.isArray(r))return Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),void e.items.pop()}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;return void t.start.push(this.sourceToken);case"seq-item-ind":if(this.indent!==e.indent)break;return void(t.value||r(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken))}if(this.indent>e.indent){const t=this.startBlockValue(e);if(t)return void this.stack.push(t)}yield*this.pop(),yield*this.step()}*flowCollection(e){const t=e.items[e.items.length-1];if("flow-error-end"===this.type){let e;do{yield*this.pop(),e=this.peek(1)}while(e&&"flow-collection"===e.type)}else if(0===e.end.length){switch(this.type){case"comma":case"explicit-key-ind":return void(!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken));case"map-value-ind":return void(!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]}));case"space":case"comment":case"newline":case"anchor":case"tag":return void(!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken));case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const n=this.flowScalar(this.type);return void(!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]}))}case"flow-map-end":case"flow-seq-end":return void e.end.push(this.sourceToken)}const n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{const t=this.peek(2);if("block-map"===t.type&&("map-value-ind"===this.type&&t.indent===e.indent||"newline"===this.type&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if("map-value-ind"===this.type&&"flow-collection"!==t.type){const n=a(o(t));c(e);const r=e.end.splice(1,e.end.length);r.push(this.sourceToken);const s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){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;const t=a(o(e));return t.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const t=a(o(e));return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return"comment"===this.type&&(!(this.indent<=t)&&e.every(e=>"newline"===e.type||"space"===e.type))}*documentEnd(e){"doc-mode"!==this.type&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop()))}*lineEnd(e){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;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop())}}},ws}var As,ks,Es={};function xs(){if(As)return Es;As=1;var e=ts(),t=ir(),n=cr(),r=Ot(),s=Pe(),i=_s(),o=Ss();function a(e){const t=!1!==e.prettyErrors;return{lineCounter:e.lineCounter||t&&new i.LineCounter||null,prettyErrors:t}}function c(t,r={}){const{lineCounter:s,prettyErrors:i}=a(r),c=new o.Parser(s?.addNewLine),u=new e.Composer(r);let l=null;for(const e of u.compose(c.parse(t),!0,t.length))if(l){if("silent"!==l.options.logLevel){l.errors.push(new n.YAMLParseError(e.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}else l=e;return i&&s&&(l.errors.forEach(n.prettifyError(t,s)),l.warnings.forEach(n.prettifyError(t,s))),l}return Es.parse=function(e,t,n){let s;"function"==typeof t?s=t:void 0===n&&t&&"object"==typeof t&&(n=t);const i=c(e,n);if(!i)return null;if(i.warnings.forEach(e=>r.warn(i.options.logLevel,e)),i.errors.length>0){if("silent"!==i.options.logLevel)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:s},n))},Es.parseAllDocuments=function(t,r={}){const{lineCounter:s,prettyErrors:i}=a(r),c=new o.Parser(s?.addNewLine),u=new e.Composer(r),l=Array.from(u.compose(c.parse(t)));if(i&&s)for(const e of l)e.errors.forEach(n.prettifyError(t,s)),e.warnings.forEach(n.prettifyError(t,s));return l.length>0?l:Object.assign([],{empty:!0},u.streamInfo())},Es.parseDocument=c,Es.stringify=function(e,n,r){let i=null;if("function"==typeof n||Array.isArray(n)?i=n:void 0===r&&n&&(r=n),"string"==typeof r&&(r=r.length),"number"==typeof r){const e=Math.round(r);r=e<1?void 0:e>8?{indent:8}:{indent:e}}if(void 0===e){const{keepUndefined:e}=r??n??{};if(!e)return}return s.isDocument(e)&&!i?e.toString(r):new t.Document(e,i,r).toString(r)},Es}var $s=function(){if(ks)return Oe;ks=1;var e=ts(),t=ir(),n=er(),r=cr(),s=Xe(),i=Pe(),o=It(),a=ot(),c=Ut(),u=Yt(),l=hs(),f=gs(),p=_s(),h=Ss(),d=xs(),m=Me();return Oe.Composer=e.Composer,Oe.Document=t.Document,Oe.Schema=n.Schema,Oe.YAMLError=r.YAMLError,Oe.YAMLParseError=r.YAMLParseError,Oe.YAMLWarning=r.YAMLWarning,Oe.Alias=s.Alias,Oe.isAlias=i.isAlias,Oe.isCollection=i.isCollection,Oe.isDocument=i.isDocument,Oe.isMap=i.isMap,Oe.isNode=i.isNode,Oe.isPair=i.isPair,Oe.isScalar=i.isScalar,Oe.isSeq=i.isSeq,Oe.Pair=o.Pair,Oe.Scalar=a.Scalar,Oe.YAMLMap=c.YAMLMap,Oe.YAMLSeq=u.YAMLSeq,Oe.CST=l,Oe.Lexer=f.Lexer,Oe.LineCounter=p.LineCounter,Oe.Parser=h.Parser,Oe.parse=d.parse,Oe.parseAllDocuments=d.parseAllDocuments,Oe.parseDocument=d.parseDocument,Oe.stringify=d.stringify,Oe.visit=m.visit,Oe.visitAsync=m.visitAsync,Oe}(),Os=z($s);function Rs(e,t,n){function r(n,r){var s;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(s=n._zod).traits??(s.traits=new Set),n._zod.traits.add(e),t(n,r);for(const e in o.prototype)e in n||Object.defineProperty(n,e,{value:o.prototype[e].bind(n)});n._zod.constr=o,n._zod.def=r}const s=n?.Parent??Object;class i extends s{}function o(e){var t;const s=n?.Parent?new i:this;r(s,e),(t=s._zod).deferred??(t.deferred=[]);for(const e of s._zod.deferred)e();return s}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}class Cs extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Ts extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const Ps={};function Ls(e){return Ps}function Ns(e,t){return"bigint"==typeof t?t.toString():t}function Is(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ms(e){return null==e}function Ds(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const js=Symbol("evaluating");function Hs(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==js)return void 0===r&&(r=js,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Fs(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Bs(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function zs(e){return JSON.stringify(e)}const Ks="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Us(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const qs=Is(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Zs(e){if(!1===Us(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==Us(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function Ws(e){return Zs(e)?{...e}:Array.isArray(e)?[...e]:e}const Gs=new Set(["string","number","symbol"]);function Vs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ys(e,t,n){const r=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(r._zod.parent=e),r}function Qs(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}function Js(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function Xs(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function ei(e){return"string"==typeof e?e:e?.message}function ti(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const s=ei(e.inst?._zod.def?.error?.(e))??ei(t?.error?.(e))??ei(n.customError?.(e))??ei(n.localeError?.(e))??"Invalid input";r.message=s}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function ni(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function ri(...e){const[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}const si=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ns,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ii=Rs("$ZodError",si),oi=Rs("$ZodError",si,{Parent:Error});const ai=e=>(t,n,r,s)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new Cs;if(o.issues.length){const t=new(s?.Err??e)(o.issues.map(e=>ti(e,i,Ls())));throw Ks(t,s?.callee),t}return o.value},ci=e=>async(t,n,r,s)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise&&(o=await o),o.issues.length){const t=new(s?.Err??e)(o.issues.map(e=>ti(e,i,Ls())));throw Ks(t,s?.callee),t}return o.value},ui=e=>(t,n,r)=>{const s=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new Cs;return i.issues.length?{success:!1,error:new(e??ii)(i.issues.map(e=>ti(e,s,Ls())))}:{success:!0,data:i.value}},li=ui(oi),fi=e=>async(t,n,r)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},s);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(e=>ti(e,s,Ls())))}:{success:!0,data:i.value}},pi=fi(oi),hi=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ai(e)(t,n,s)},di=e=>(t,n,r)=>ai(e)(t,n,r),mi=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ci(e)(t,n,s)},gi=e=>async(t,n,r)=>ci(e)(t,n,r),yi=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ui(e)(t,n,s)},vi=e=>(t,n,r)=>ui(e)(t,n,r),_i=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return fi(e)(t,n,s)},bi=e=>async(t,n,r)=>fi(e)(t,n,r),wi=/^[cC][^\s-]{8,}$/,Si=/^[0-9a-z]+$/,Ai=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ki=/^[0-9a-vA-V]{20}$/,Ei=/^[A-Za-z0-9]{27}$/,xi=/^[a-zA-Z0-9_-]{21}$/,$i=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Oi=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ri=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Ci=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const Ti=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Pi=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Li=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Ni=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ii=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Mi=/^[A-Za-z0-9_-]*$/,Di=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,ji=/^\+(?:[0-9]){6,14}[0-9]$/,Hi="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Fi=new RegExp(`^${Hi}$`);function Bi(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const zi=/^[^A-Z]*$/,Ki=/^[^a-z]*$/,Ui=Rs("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),qi=Rs("$ZodCheckMaxLength",(e,t)=>{var n;Ui.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Ms(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const r=n.value;if(r.length<=t.maximum)return;const s=ni(r);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Zi=Rs("$ZodCheckMinLength",(e,t)=>{var n;Ui.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Ms(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const r=n.value;if(r.length>=t.minimum)return;const s=ni(r);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Wi=Rs("$ZodCheckLengthEquals",(e,t)=>{var n;Ui.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Ms(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{const r=n.value,s=r.length;if(s===t.length)return;const i=ni(r),o=s>t.length;n.issues.push({origin:i,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Gi=Rs("$ZodCheckStringFormat",(e,t)=>{var n,r;Ui.init(e,t),e._zod.onattach.push(e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Vi=Rs("$ZodCheckRegex",(e,t)=>{Gi.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Yi=Rs("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=zi),Gi.init(e,t)}),Qi=Rs("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Ki),Gi.init(e,t)}),Ji=Rs("$ZodCheckIncludes",(e,t)=>{Ui.init(e,t);const n=Vs(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Xi=Rs("$ZodCheckStartsWith",(e,t)=>{Ui.init(e,t);const n=new RegExp(`^${Vs(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),eo=Rs("$ZodCheckEndsWith",(e,t)=>{Ui.init(e,t);const n=new RegExp(`.*${Vs(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),to=Rs("$ZodCheckOverwrite",(e,t)=>{Ui.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class no{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e);for(const e of r)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}const ro={major:4,minor:1,patch:11},so=Rs("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ro;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const t of r)for(const n of t._zod.onattach)n(e);if(0===r.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,n)=>{let r,s=Js(e);for(const i of t){if(i._zod.def.when){if(!i._zod.def.when(e))continue}else if(s)continue;const t=e.issues.length,o=i._zod.check(e);if(o instanceof Promise&&!1===n?.async)throw new Cs;if(r||o instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await o;e.issues.length!==t&&(s||(s=Js(e,t)))});else{if(e.issues.length===t)continue;s||(s=Js(e,t))}}return r?r.then(()=>e):e},n=(n,s,i)=>{if(Js(n))return n.aborted=!0,n;const o=t(s,r,i);if(o instanceof Promise){if(!1===i.async)throw new Cs;return o.then(t=>e._zod.parse(t,i))}return e._zod.parse(o,i)};e._zod.run=(s,i)=>{if(i.skipChecks)return e._zod.parse(s,i);if("backward"===i.direction){const t=e._zod.parse({value:s.value,issues:[]},{...i,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,s,i)):n(t,s,i)}const o=e._zod.parse(s,i);if(o instanceof Promise){if(!1===i.async)throw new Cs;return o.then(e=>t(e,r,i))}return t(o,r,i)}}e["~standard"]={validate:t=>{try{const n=li(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return pi(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}}),io=Rs("$ZodString",(e,t)=>{var n;so.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=e._zod.bag,new RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(r){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),oo=Rs("$ZodStringFormat",(e,t)=>{Gi.init(e,t),io.init(e,t)}),ao=Rs("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Oi),oo.init(e,t)}),co=Rs("$ZodUUID",(e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Ri(e))}else t.pattern??(t.pattern=Ri());oo.init(e,t)}),uo=Rs("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Ci),oo.init(e,t)}),lo=Rs("$ZodURL",(e,t)=>{oo.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),s=new URL(r);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Di.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=s.href:n.value=r)}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),fo=Rs("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),oo.init(e,t)}),po=Rs("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=xi),oo.init(e,t)}),ho=Rs("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=wi),oo.init(e,t)}),mo=Rs("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Si),oo.init(e,t)}),go=Rs("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Ai),oo.init(e,t)}),yo=Rs("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ki),oo.init(e,t)}),vo=Rs("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Ei),oo.init(e,t)}),_o=Rs("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=Bi({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${Hi}T(?:${r})$`)}(t)),oo.init(e,t)}),bo=Rs("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Fi),oo.init(e,t)}),wo=Rs("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${Bi(t)}$`)),oo.init(e,t)}),So=Rs("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=$i),oo.init(e,t)}),Ao=Rs("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Ti),oo.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv4"})}),ko=Rs("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Pi),oo.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv6"}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),Eo=Rs("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Li),oo.init(e,t)}),xo=Rs("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Ni),oo.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(2!==r.length)throw new Error;const[e,t]=r;if(!t)throw new Error;const n=Number(t);if(`${n}`!==t)throw new Error;if(n<0||n>128)throw new Error;new URL(`http://[${e}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function $o(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Oo=Rs("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Ii),oo.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{$o(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});const Ro=Rs("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Mi),oo.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{(function(e){if(!Mi.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return $o(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Co=Rs("$ZodE164",(e,t)=>{t.pattern??(t.pattern=ji),oo.init(e,t)});const To=Rs("$ZodJWT",(e,t)=>{oo.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[r]=n;if(!r)return!1;const s=JSON.parse(atob(r));return!("typ"in s&&"JWT"!==s?.typ||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Po=Rs("$ZodUnknown",(e,t)=>{so.init(e,t),e._zod.parse=e=>e}),Lo=Rs("$ZodNever",(e,t)=>{so.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function No(e,t,n){e.issues.length&&t.issues.push(...Xs(n,e.issues)),t.value[n]=e.value}const Io=Rs("$ZodArray",(e,t)=>{so.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const i=[];for(let e=0;e<s.length;e++){const o=s[e],a=t.element._zod.run({value:o,issues:[]},r);a instanceof Promise?i.push(a.then(t=>No(t,n,e))):No(a,n,e)}return i.length?Promise.all(i).then(()=>n):n}});function Mo(e,t,n,r){e.issues.length&&t.issues.push(...Xs(n,e.issues)),void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function Do(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const n=(r=e.shape,Object.keys(r).filter(e=>"optional"===r[e]._zod.optin&&"optional"===r[e]._zod.optout));var r;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function jo(e,t,n,r,s,i){const o=[],a=s.keySet,c=s.catchall._zod,u=c.def.type;for(const s of Object.keys(t)){if(a.has(s))continue;if("never"===u){o.push(s);continue}const i=c.run({value:t[s],issues:[]},r);i instanceof Promise?e.push(i.then(e=>Mo(e,n,s,t))):Mo(i,n,s,t)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}const Ho=Rs("$ZodObject",(e,t)=>{so.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!n?.get){const e=t.shape;Object.defineProperty(t,"shape",{get:()=>{const n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}const r=Is(()=>Do(t));Hs(e._zod,"propValues",()=>{const e=t.shape,n={};for(const t in e){const r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(const e of r.values)n[t].add(e)}}return n});const s=Us,i=t.catchall;let o;e._zod.parse=(t,n)=>{o??(o=r.value);const a=t.value;if(!s(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const c=[],u=o.shape;for(const e of o.keys){const r=u[e]._zod.run({value:a[e],issues:[]},n);r instanceof Promise?c.push(r.then(n=>Mo(n,t,e,a))):Mo(r,t,e,a)}return i?jo(c,a,t,n,r.value,e):c.length?Promise.all(c).then(()=>t):t}}),Fo=Rs("$ZodObjectJIT",(e,t)=>{Ho.init(e,t);const n=e._zod.parse,r=Is(()=>Do(t));let s;const i=Us,o=!Ps.jitless,a=o&&qs.value,c=t.catchall;let u;e._zod.parse=(l,f)=>{u??(u=r.value);const p=l.value;return i(p)?o&&a&&!1===f?.async&&!0!==f.jitless?(s||(s=(e=>{const t=new no(["shape","payload","ctx"]),n=r.value,s=e=>{const t=zs(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const i=Object.create(null);let o=0;for(const e of n.keys)i[e]="key_"+o++;t.write("const newResult = {};");for(const e of n.keys){const n=i[e],r=zs(e);t.write(`const ${n} = ${s(e)};`),t.write(`\n if (${n}.issues.length) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${r}, ...iss.path] : [${r}]\n })));\n }\n \n \n if (${n}.value === undefined) {\n if (${r} in input) {\n newResult[${r}] = undefined;\n }\n } else {\n newResult[${r}] = ${n}.value;\n }\n \n `)}t.write("payload.value = newResult;"),t.write("return payload;");const a=t.compile();return(t,n)=>a(e,t,n)})(t.shape)),l=s(l,f),c?jo([],p,l,f,u,e):l):n(l,f):(l.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),l)}});function Bo(e,t,n,r){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const s=e.filter(e=>!Js(e));return 1===s.length?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ti(e,r,Ls())))}),t)}const zo=Rs("$ZodUnion",(e,t)=>{so.init(e,t),Hs(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),Hs(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),Hs(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Hs(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>Ds(e.source)).join("|")})$`)}});const n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=(s,i)=>{if(n)return r(s,i);let o=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:s.value,issues:[]},i);if(t instanceof Promise)a.push(t),o=!0;else{if(0===t.issues.length)return t;a.push(t)}}return o?Promise.all(a).then(t=>Bo(t,s,e,i)):Bo(a,s,e,i)}}),Ko=Rs("$ZodIntersection",(e,t)=>{so.init(e,t),e._zod.parse=(e,n)=>{const r=e.value,s=t.left._zod.run({value:r,issues:[]},n),i=t.right._zod.run({value:r,issues:[]},n);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([t,n])=>qo(e,t,n)):qo(e,s,i)}});function Uo(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(Zs(e)&&Zs(t)){const n=Object.keys(t),r=Object.keys(e).filter(e=>-1!==n.indexOf(e)),s={...e,...t};for(const n of r){const r=Uo(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};s[n]=r.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const s=Uo(e[r],t[r]);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function qo(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Js(e))return e;const r=Uo(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const Zo=Rs("$ZodRecord",(e,t)=>{so.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!Zs(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const i=[];if(t.keyType._zod.values){const o=t.keyType._zod.values;n.value={};for(const e of o)if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){const o=t.valueType._zod.run({value:s[e],issues:[]},r);o instanceof Promise?i.push(o.then(t=>{t.issues.length&&n.issues.push(...Xs(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...Xs(e,o.issues)),n.value[e]=o.value)}let a;for(const e in s)o.has(e)||(a=a??[],a.push(e));a&&a.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:a})}else{n.value={};for(const o of Reflect.ownKeys(s)){if("__proto__"===o)continue;const a=t.keyType._zod.run({value:o,issues:[]},r);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(a.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(e=>ti(e,r,Ls())),input:o,path:[o],inst:e}),n.value[a.value]=a.value;continue}const c=t.valueType._zod.run({value:s[o],issues:[]},r);c instanceof Promise?i.push(c.then(e=>{e.issues.length&&n.issues.push(...Xs(o,e.issues)),n.value[a.value]=e.value})):(c.issues.length&&n.issues.push(...Xs(o,c.issues)),n.value[a.value]=c.value)}}return i.length?Promise.all(i).then(()=>n):n}}),Wo=Rs("$ZodEnum",(e,t)=>{so.init(e,t);const n=function(e){const t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t)}(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(e=>Gs.has(typeof e)).map(e=>"string"==typeof e?Vs(e):e.toString()).join("|")})$`),e._zod.parse=(t,s)=>{const i=t.value;return r.has(i)||t.issues.push({code:"invalid_value",values:n,input:i,inst:e}),t}}),Go=Rs("$ZodTransform",(e,t)=>{so.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new Ts(e.constructor.name);const s=t.transform(n.value,n);if(r.async){return(s instanceof Promise?s:Promise.resolve(s)).then(e=>(n.value=e,n))}if(s instanceof Promise)throw new Cs;return n.value=s,n}});function Vo(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const Yo=Rs("$ZodOptional",(e,t)=>{so.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Hs(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Hs(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Ds(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>Vo(t,e.value)):Vo(r,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),Qo=Rs("$ZodNullable",(e,t)=>{so.init(e,t),Hs(e._zod,"optin",()=>t.innerType._zod.optin),Hs(e._zod,"optout",()=>t.innerType._zod.optout),Hs(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Ds(e.source)}|null)$`):void 0}),Hs(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),Jo=Rs("$ZodDefault",(e,t)=>{so.init(e,t),e._zod.optin="optional",Hs(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Xo(e,t)):Xo(r,t)}});function Xo(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const ea=Rs("$ZodPrefault",(e,t)=>{so.init(e,t),e._zod.optin="optional",Hs(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),ta=Rs("$ZodNonOptional",(e,t)=>{so.init(e,t),Hs(e._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(t=>na(t,e)):na(s,e)}});function na(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const ra=Rs("$ZodCatch",(e,t)=>{so.init(e,t),Hs(e._zod,"optin",()=>t.innerType._zod.optin),Hs(e._zod,"optout",()=>t.innerType._zod.optout),Hs(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ti(e,n,Ls()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ti(e,n,Ls()))},input:e.value}),e.issues=[]),e)}}),sa=Rs("$ZodPipe",(e,t)=>{so.init(e,t),Hs(e._zod,"values",()=>t.in._zod.values),Hs(e._zod,"optin",()=>t.in._zod.optin),Hs(e._zod,"optout",()=>t.out._zod.optout),Hs(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){const r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>ia(e,t.in,n)):ia(r,t.in,n)}const r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>ia(e,t.out,n)):ia(r,t.out,n)}});function ia(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const oa=Rs("$ZodReadonly",(e,t)=>{so.init(e,t),Hs(e._zod,"propValues",()=>t.innerType._zod.propValues),Hs(e._zod,"values",()=>t.innerType._zod.values),Hs(e._zod,"optin",()=>t.innerType._zod.optin),Hs(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(aa):aa(r)}});function aa(e){return e.value=Object.freeze(e.value),e}const ca=Rs("$ZodCustom",(e,t)=>{Ui.init(e,t),so.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const r=n.value,s=t.fn(r);if(s instanceof Promise)return s.then(t=>ua(t,n,r,e));ua(s,n,r,e)}});function ua(e,t,n,r){if(!e){const e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(ri(e))}}class la{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const n=t[0];if(this._map.set(e,n),n&&"object"==typeof n&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function fa(){return new la}const pa=fa();function ha(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Qs(t)})}function da(e,t){return new qi({check:"max_length",...Qs(t),maximum:e})}function ma(e,t){return new Zi({check:"min_length",...Qs(t),minimum:e})}function ga(e,t){return new Wi({check:"length_equals",...Qs(t),length:e})}function ya(e){return new to({check:"overwrite",tx:e})}function va(e){const t=function(e,t){const n=new Ui({check:"custom",...Qs(t)});return n._zod.check=e,n}(n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(ri(e,n.value,t._zod.def));else{const r=e;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),n.issues.push(ri(r))}},e(n.value,n)));return t}const _a=Rs("ZodISODateTime",(e,t)=>{_o.init(e,t),Za.init(e,t)});function ba(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Qs(t)})}(_a,e)}const wa=Rs("ZodISODate",(e,t)=>{bo.init(e,t),Za.init(e,t)});function Sa(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Qs(t)})}(wa,e)}const Aa=Rs("ZodISOTime",(e,t)=>{wo.init(e,t),Za.init(e,t)});function ka(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Qs(t)})}(Aa,e)}const Ea=Rs("ZodISODuration",(e,t)=>{So.init(e,t),Za.init(e,t)});function xa(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Qs(t)})}(Ea,e)}const $a=(e,t)=>{ii.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t){const n=t||function(e){return e.message},r={_errors:[]},s=e=>{for(const t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map(e=>s({issues:e}));else if("invalid_key"===t.code)s({issues:t.issues});else if("invalid_element"===t.code)s({issues:t.issues});else if(0===t.path.length)r._errors.push(n(t));else{let e=r,s=0;for(;s<t.path.length;){const r=t.path[s];s===t.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(n(t))):e[r]=e[r]||{_errors:[]},e=e[r],s++}}};return s(e),r}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const n={},r=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):r.push(t(s));return{formErrors:r,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Ns,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Ns,2)}},isEmpty:{get:()=>0===e.issues.length}})},Oa=Rs("ZodError",$a),Ra=Rs("ZodError",$a,{Parent:Error}),Ca=ai(Ra),Ta=ci(Ra),Pa=ui(Ra),La=fi(Ra),Na=hi(Ra),Ia=di(Ra),Ma=mi(Ra),Da=gi(Ra),ja=yi(Ra),Ha=vi(Ra),Fa=_i(Ra),Ba=bi(Ra),za=Rs("ZodType",(e,t)=>(so.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Bs(t,{checks:[...t.checks??[],...n.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]})),e.clone=(t,n)=>Ys(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>Ca(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Pa(e,t,n),e.parseAsync=async(t,n)=>Ta(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>La(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Na(e,t,n),e.decode=(t,n)=>Ia(e,t,n),e.encodeAsync=async(t,n)=>Ma(e,t,n),e.decodeAsync=async(t,n)=>Da(e,t,n),e.safeEncode=(t,n)=>ja(e,t,n),e.safeDecode=(t,n)=>Ha(e,t,n),e.safeEncodeAsync=async(t,n)=>Fa(e,t,n),e.safeDecodeAsync=async(t,n)=>Ba(e,t,n),e.refine=(t,n)=>e.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Qs(n)})}(Mc,e,t)}(t,n)),e.superRefine=t=>e.check(va(t)),e.overwrite=t=>e.check(ya(t)),e.optional=()=>xc(e),e.nullable=()=>Oc(e),e.nullish=()=>xc(Oc(e)),e.nonoptional=t=>function(e,t){return new Tc({type:"nonoptional",innerType:e,...Qs(t)})}(e,t),e.array=()=>yc(e),e.or=t=>bc([e,t]),e.and=t=>new wc({type:"intersection",left:e,right:t}),e.transform=t=>Nc(e,new kc({type:"transform",transform:t})),e.default=t=>{return n=t,new Rc({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():Ws(n)}});var n},e.prefault=t=>{return n=t,new Cc({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():Ws(n)}});var n},e.catch=t=>{return new Pc({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>Nc(e,t),e.readonly=()=>new Ic({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return pa.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>pa.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return pa.get(e);const n=e.clone();return pa.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Ka=Rs("_ZodString",(e,t)=>{io.init(e,t),za.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new Vi({check:"string_format",format:"regex",...Qs(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Ji({check:"string_format",format:"includes",...Qs(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new Xi({check:"string_format",format:"starts_with",...Qs(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new eo({check:"string_format",format:"ends_with",...Qs(t),suffix:e})}(...t)),e.min=(...t)=>e.check(ma(...t)),e.max=(...t)=>e.check(da(...t)),e.length=(...t)=>e.check(ga(...t)),e.nonempty=(...t)=>e.check(ma(1,...t)),e.lowercase=t=>e.check(function(e){return new Yi({check:"string_format",format:"lowercase",...Qs(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Qi({check:"string_format",format:"uppercase",...Qs(e)})}(t)),e.trim=()=>e.check(ya(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return ya(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(ya(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(ya(e=>e.toUpperCase()))}),Ua=Rs("ZodString",(e,t)=>{io.init(e,t),Ka.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Qs(t)})}(Wa,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Qs(t)})}(Ya,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Qs(t)})}(fc,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Qs(t)})}(Qa,t)),e.guid=t=>e.check(ha(Ga,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Qs(t)})}(Va,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Qs(t)})}(Va,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Qs(t)})}(Va,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Qs(t)})}(Va,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Qs(t)})}(Ja,t)),e.guid=t=>e.check(ha(Ga,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Qs(t)})}(Xa,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Qs(t)})}(ec,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Qs(t)})}(tc,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Qs(t)})}(cc,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Qs(t)})}(uc,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Qs(t)})}(nc,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Qs(t)})}(rc,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Qs(t)})}(sc,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Qs(t)})}(ic,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Qs(t)})}(oc,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Qs(t)})}(ac,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Qs(t)})}(lc,t)),e.datetime=t=>e.check(ba(t)),e.date=t=>e.check(Sa(t)),e.time=t=>e.check(ka(t)),e.duration=t=>e.check(xa(t))});function qa(e){return function(e,t){return new e({type:"string",...Qs(t)})}(Ua,e)}const Za=Rs("ZodStringFormat",(e,t)=>{oo.init(e,t),Ka.init(e,t)}),Wa=Rs("ZodEmail",(e,t)=>{uo.init(e,t),Za.init(e,t)}),Ga=Rs("ZodGUID",(e,t)=>{ao.init(e,t),Za.init(e,t)}),Va=Rs("ZodUUID",(e,t)=>{co.init(e,t),Za.init(e,t)}),Ya=Rs("ZodURL",(e,t)=>{lo.init(e,t),Za.init(e,t)}),Qa=Rs("ZodEmoji",(e,t)=>{fo.init(e,t),Za.init(e,t)}),Ja=Rs("ZodNanoID",(e,t)=>{po.init(e,t),Za.init(e,t)}),Xa=Rs("ZodCUID",(e,t)=>{ho.init(e,t),Za.init(e,t)}),ec=Rs("ZodCUID2",(e,t)=>{mo.init(e,t),Za.init(e,t)}),tc=Rs("ZodULID",(e,t)=>{go.init(e,t),Za.init(e,t)}),nc=Rs("ZodXID",(e,t)=>{yo.init(e,t),Za.init(e,t)}),rc=Rs("ZodKSUID",(e,t)=>{vo.init(e,t),Za.init(e,t)}),sc=Rs("ZodIPv4",(e,t)=>{Ao.init(e,t),Za.init(e,t)}),ic=Rs("ZodIPv6",(e,t)=>{ko.init(e,t),Za.init(e,t)}),oc=Rs("ZodCIDRv4",(e,t)=>{Eo.init(e,t),Za.init(e,t)}),ac=Rs("ZodCIDRv6",(e,t)=>{xo.init(e,t),Za.init(e,t)}),cc=Rs("ZodBase64",(e,t)=>{Oo.init(e,t),Za.init(e,t)}),uc=Rs("ZodBase64URL",(e,t)=>{Ro.init(e,t),Za.init(e,t)}),lc=Rs("ZodE164",(e,t)=>{Co.init(e,t),Za.init(e,t)}),fc=Rs("ZodJWT",(e,t)=>{To.init(e,t),Za.init(e,t)}),pc=Rs("ZodUnknown",(e,t)=>{Po.init(e,t),za.init(e,t)});function hc(){return new pc({type:"unknown"})}const dc=Rs("ZodNever",(e,t)=>{Lo.init(e,t),za.init(e,t)});function mc(e){return function(e,t){return new e({type:"never",...Qs(t)})}(dc,e)}const gc=Rs("ZodArray",(e,t)=>{Io.init(e,t),za.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(ma(t,n)),e.nonempty=t=>e.check(ma(1,t)),e.max=(t,n)=>e.check(da(t,n)),e.length=(t,n)=>e.check(ga(t,n)),e.unwrap=()=>e.element});function yc(e,t){return function(e,t,n){return new e({type:"array",element:t,...Qs(n)})}(gc,e,t)}const vc=Rs("ZodObject",(e,t)=>{Fo.init(e,t),za.init(e,t),Hs(e,"shape",()=>t.shape),e.keyof=()=>function(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new Ac({type:"enum",entries:n,...Qs(t)})}(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:hc()}),e.loose=()=>e.clone({...e._zod.def,catchall:hc()}),e.strict=()=>e.clone({...e._zod.def,catchall:mc()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Zs(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const r=Bs(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Fs(this,"shape",n),n},checks:[]});return Ys(e,r)}(e,t),e.safeExtend=t=>function(e,t){if(!Zs(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return Fs(this,"shape",n),n},checks:e._zod.def.checks};return Ys(e,n)}(e,t),e.merge=t=>function(e,t){const n=Bs(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Fs(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Ys(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def;return Ys(e,Bs(e._zod.def,{get shape(){const e={};for(const r in t){if(!(r in n.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Fs(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,r=Bs(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Fs(this,"shape",r),r},checks:[]});return Ys(e,r)}(e,t),e.partial=(...t)=>function(e,t,n){const r=Bs(t._zod.def,{get shape(){const r=t._zod.def.shape,s={...r};if(n)for(const t in n){if(!(t in r))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(s[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(const t in r)s[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return Fs(this,"shape",s),s},checks:[]});return Ys(t,r)}(Ec,e,t[0]),e.required=(...t)=>function(e,t,n){const r=Bs(t._zod.def,{get shape(){const r=t._zod.def.shape,s={...r};if(n)for(const t in n){if(!(t in s))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(s[t]=new e({type:"nonoptional",innerType:r[t]}))}else for(const t in r)s[t]=new e({type:"nonoptional",innerType:r[t]});return Fs(this,"shape",s),s},checks:[]});return Ys(t,r)}(Tc,e,t[0])});const _c=Rs("ZodUnion",(e,t)=>{zo.init(e,t),za.init(e,t),e.options=t.options});function bc(e,t){return new _c({type:"union",options:e,...Qs(t)})}const wc=Rs("ZodIntersection",(e,t)=>{Ko.init(e,t),za.init(e,t)});const Sc=Rs("ZodRecord",(e,t)=>{Zo.init(e,t),za.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});const Ac=Rs("ZodEnum",(e,t)=>{Wo.init(e,t),za.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{const s={};for(const r of e){if(!n.has(r))throw new Error(`Key ${r} not found in enum`);s[r]=t.entries[r]}return new Ac({...t,checks:[],...Qs(r),entries:s})},e.exclude=(e,r)=>{const s={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete s[t]}return new Ac({...t,checks:[],...Qs(r),entries:s})}});const kc=Rs("ZodTransform",(e,t)=>{Go.init(e,t),za.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new Ts(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(ri(r,n.value,t));else{const t=r;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(ri(t))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(e=>(n.value=e,n)):(n.value=s,n)}});const Ec=Rs("ZodOptional",(e,t)=>{Yo.init(e,t),za.init(e,t),e.unwrap=()=>e._zod.def.innerType});function xc(e){return new Ec({type:"optional",innerType:e})}const $c=Rs("ZodNullable",(e,t)=>{Qo.init(e,t),za.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Oc(e){return new $c({type:"nullable",innerType:e})}const Rc=Rs("ZodDefault",(e,t)=>{Jo.init(e,t),za.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});const Cc=Rs("ZodPrefault",(e,t)=>{ea.init(e,t),za.init(e,t),e.unwrap=()=>e._zod.def.innerType});const Tc=Rs("ZodNonOptional",(e,t)=>{ta.init(e,t),za.init(e,t),e.unwrap=()=>e._zod.def.innerType});const Pc=Rs("ZodCatch",(e,t)=>{ra.init(e,t),za.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});const Lc=Rs("ZodPipe",(e,t)=>{sa.init(e,t),za.init(e,t),e.in=t.in,e.out=t.out});function Nc(e,t){return new Lc({type:"pipe",in:e,out:t})}const Ic=Rs("ZodReadonly",(e,t)=>{oa.init(e,t),za.init(e,t),e.unwrap=()=>e._zod.def.innerType});const Mc=Rs("ZodCustom",(e,t)=>{ca.init(e,t),za.init(e,t)});const Dc=yc(qa()).default([]).optional(),jc=bc([qa(),yc(qa())]),Hc=(Fc=qa(),Bc=jc,new Sc({type:"record",keyType:Fc,valueType:Bc,...Qs(zc)})).optional();var Fc,Bc,zc;const Kc=function(e,t){const n={type:"object",shape:e??{},...Qs(t)};return new vc(n)}({stanPath:qa().min(1,{message:"stanPath must be a non-empty string"}),includes:Dc,excludes:Dc,imports:Hc}).strict(),Uc=e=>{if(!e||"object"!=typeof e)return;const t=e,n={};for(const e of Object.keys(t)){const r=t[e];if("string"==typeof r){const t=r.trim();t&&(n[e]=[t])}else if(Array.isArray(r)){const t=r.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0);t.length&&(n[e]=t)}}return Object.keys(n).length?n:void 0},qc=(e,t)=>{const n=t?JSON.parse(e):Os.parse(e);return n&&"object"==typeof n?n:{}},Zc=e=>{if(!e||"object"!=typeof e)throw new Error('stan-core: missing or invalid "stan-core" section');try{return Kc.parse(e)}catch(e){throw new Error((e=>e instanceof Oa?e.issues.map(e=>{const t=e.path.join(".")||"(root)";let n=e.message;return"stanPath"===t&&/Expected string/i.test(n)&&(n="stanPath must be a non-empty string"),`${t}: ${n}`}).join("\n"):String(e))(e))}},Wc=e=>{const t=xe(e);if(!t)throw new Error("stan config not found");const r=n(t,"utf8"),s=qc(r,t.endsWith(".json"));if(!Object.prototype.hasOwnProperty.call(s,"stan-core")){throw new Error(`stan-core: missing "stan-core" section in ${t}. Add a top-level "stan-core" object with stanPath/includes/excludes/imports.`)}const i=Zc(s["stan-core"]),o=Uc(i.imports);return{stanPath:i.stanPath,includes:i.includes??[],excludes:i.excludes??[],imports:o}},Gc=async e=>{const t=xe(e);if(!t)throw new Error("stan config not found");const n=t.replace(/\\/g,"/");return(async(e,t)=>{const n=await i(e,"utf8"),r=qc(n,e.endsWith(".json"));if(!Object.prototype.hasOwnProperty.call(r,"stan-core"))throw new Error(`stan-core: missing "stan-core" section in ${t??e}. Add a top-level "stan-core" object with stanPath/includes/excludes/imports.`);const s=Zc(r["stan-core"]),o=Uc(s.imports);return{stanPath:s.stanPath,includes:s.includes??[],excludes:s.excludes??[],imports:o}})(t,n)},Vc=e=>{try{return Wc(e).stanPath}catch{return be}},Yc=async e=>{try{return(await Gc(e)).stanPath}catch{return be}},Qc=async(e,n,s=!1)=>{const i=pe(e,n);if(await ye(e,n),!s){const e=h(i.outputAbs,P);if(t(e))try{await c(e,h(i.diffAbs,L))}catch{}const n=await a(i.outputAbs,{withFileTypes:!0});for(const e of n)r(h(i.outputAbs,e.name),{recursive:!0,force:!0})}return i.rootAbs},Jc=async(e,t)=>{const n={};for(const r of t){const t=h(e,r),s=await i(t),o=k("sha256").update(s).digest("hex");n[r]=o}return n},Xc=e=>d(e,".archive.snapshot.json"),eu=async({cwd:e,stanPath:t,includes:n,excludes:r})=>{const{diffDir:s}=await ve(e,t),i=await he(e),o=await ge(i,{cwd:e,stanPath:t,includeOutputDir:!1,includes:n??[],excludes:r??[]}),a=await Jc(e,o),c=Xc(s);return await u(c,JSON.stringify(a,null,2),"utf8"),c},tu=async({cwd:e,stanPath:n,baseName:r,includes:s,excludes:o,updateSnapshot:a="createIfMissing",includeOutputDirInDiff:c=!1,onArchiveWarnings:l})=>{const{outDir:f,diffDir:p}=await ve(e,n),h=await he(e),m=await ge(h,{cwd:e,stanPath:n,includeOutputDir:!1,includes:s??[],excludes:o??[]}),g=await Jc(e,m),y=Xc(p),v=t(y),_=v?JSON.parse(await i(y,"utf8")):{},b=v?m.filter(e=>!_[e]||_[e]!==g[e]):[...m],{textFiles:w,warningsBody:S}=await F(e,b),A=w,k=(S??"").trim();k&&"No archive warnings."!==k&&l?.(k);const E=d(f,`${r}.diff.tar`),x=await import("./index-ucZa1KMb.js");if(c){const t=Array.from(new Set([...A,`${n.replace(/\\/g,"/")}/output`]));await x.create({file:E,cwd:e,filter:j(n)},t)}else if(0===A.length){const t=(e=>d(e,".stan_no_changes"))(p);await u(t,"no changes","utf8");const r=[`${n.replace(/\\/g,"/")}/diff/.stan_no_changes`];await x.create({file:E,cwd:e},r)}else{const t=Array.from(new Set([...A]));await x.create({file:E,cwd:e},t)}return"replace"===a?await u(y,JSON.stringify(g,null,2),"utf8"):"createIfMissing"!==a||v||await u(y,JSON.stringify(g,null,2),"utf8"),{diffPath:E}},nu=e=>e.replace(/\\/g,"/"),ru=/^###\s+Patch:\s+(.+?)\s*$/m,su=/^###\s+Full Listing:\s+(.+?)\s*$/m,iu=/^##\s+Commit Message\s*$/m,ou=/^##\s+.*$|^###\s+.*$/m,au=/^###\s+File Ops\s*$/m,cu=e=>/^[/\\]/.test(e),uu=e=>(nu(e)||"").split("/").filter(Boolean).join("/").replace(/\/+$/,""),lu=e=>{const t=[],n=[];{const t=new RegExp(ou.source,"gm");let r;for(;r=t.exec(e);)n.push(r.index)}n.push(e.length);for(let r=0;r<n.length-1;r+=1){const s=n[r],i=n[r+1],o=e.slice(s,i);if(iu.test(o)){t.push({kind:"commit",start:s,body:o});continue}const a=o.match(ru);if(a&&a[1]){t.push({kind:"patch",path:nu(a[1].trim()),start:s,body:o});continue}const c=o.match(su);c&&c[1]&&t.push({kind:"full",path:nu(c[1].trim()),start:s,body:o})}return t},fu=e=>{const t=/^diff --git a\/(.+?) b\/(.+?)\s*$/gm,n=[];let r;for(;r=t.exec(e);)n.push({a:nu(r[1]??""),b:nu(r[2]??"")});return n},pu=(e,t)=>{const n=(e=>{const t=au.exec(e);if(!t)return null;const n=(t.index??0)+t[0].length,r=e.slice(n).split(/\r?\n/);let s=0;for(;s<r.length&&""===r[s].trim();)s+=1;const i=[];for(;s<r.length;s+=1){const e=r[s];if(/^#{2,3}\s+/.test(e))break;i.push(e)}const o=i.join("\n").trimEnd();return o.length?o:null})(e);if(!n)return;const r=n.split(/\r?\n/);for(let e=0;e<r.length;e+=1){const n=r[e].trim();if(!n)continue;const s=n.split(/\s+/),i=s[0],o=s.slice(1),a=`File Ops line ${(e+1).toString()}`,c=e=>t.push(`${a}: ${e}`),u=e=>{if(!e||!e.trim())return null;const t=nu(e.trim());if(cu(t))return null;const n=uu(t);return n?n.split("/").some(e=>".."===e)?null:n:null};if(!/^(mv|rm|rmdir|mkdirp)$/.test(i)){c(`unknown verb "${i}"`);continue}if("mv"===i){if(2!==o.length){c(`expected 2 paths, got ${o.length.toString()}`);continue}const e=u(o[0]),t=u(o[1]);e&&t||c("mv: invalid repo-relative path");continue}if(1!==o.length){c(`expected 1 path, got ${o.length.toString()}`);continue}u(o[0])||c(`${i}: invalid repo-relative path`)}},hu=e=>{const t=[];pu(e,t);const n=lu(e),r=n.filter(e=>"patch"===e.kind),s=n.filter(e=>"full"===e.kind),i=n.filter(e=>"commit"===e.kind);0===r.length&&t.push("No Patch blocks found");{const e=new Map;for(const n of r){const r=n.path??"(unknown)",s=e.get(r)??[];s.push(n),e.set(r,s);const i=fu(n.body);0===i.length?t.push(`Patch for ${r} has no "diff --git a/<path> b/<path>" header; emit a plain unified diff with git-style headers (wrappers like "*** Begin Patch" are not allowed)`):1!==i.length&&t.push(`Patch for ${r} contains multiple "diff --git" headers (found ${i.length.toString()}; expected 1)`);const o=/(^|\n)\*{3,}\s*(Begin|End)\s+Patch\b|(^|\n)Index:\s|(^|\n)\*{3,}\s*Add\s+File:/i;try{o.test(n.body)&&t.push(`Patch for ${r} contains a forbidden wrapper ("*** Begin Patch", "*** Add File:", or "Index:"). Use plain unified diff only.`)}catch{}}for(const[n,r]of e.entries())r.length>1&&t.push(`Multiple Patch blocks found for ${n} (${r.length.toString()})`)}{const e=new Map;for(const t of s){const n=nu(t.path??"(unknown)");e.set(n,t)}for(const n of r){const r=nu(n.path??"(unknown)"),s=e.get(r);!s||n.start<s.start||t.push(`Ordering violation for ${r}: Full Listing appears before Patch`)}}if(0===i.length)t.push('Missing "## Commit Message" section');else{const e=n[n.length-1];e&&"commit"===e.kind||t.push("Commit Message is not last")}if(r.length>0){const e=[];for(const t of r){const n=fu(t.body);if(n.length>0){const t=nu(n[0].b??"");t&&e.push(t)}else{const n=nu(t.path??"");n&&e.push(n)}}const n=e=>".stan/system/stan.todo.md"===nu(e),s=e=>{const t=nu(e);if(!t)return!1;const n=(t.split("/").pop()??t).toLowerCase();return"readme.md"===n||"changelog.md"===n||"contributing.md"===n||"license"===n||"license.md"===n||(t.startsWith("docs/")||t.startsWith("docs-src/")||t.startsWith("diagrams/"))},i=e.filter(e=>!n(e));if(!(i.length>0&&i.every(e=>s(e)))){e.some(e=>n(e))||t.push('Doc cadence violation: Patch present but no Patch for ".stan/system/stan.todo.md"')}}return{ok:0===t.length,errors:t,warnings:[]}},du=e=>{const t=hu(e);if(!t.ok){const e="Response-format validation failed:\n"+t.errors.map(e=>`- ${e}`).join("\n");throw new Error(e)}},mu={extractBlocks:lu,parseDiffHeaders:fu,isCommitLast:e=>{if(!e.match(iu))return!1;const t=e.search(iu);if(t<0)return!1;const n=e.slice(t),r=n.match(/^`{3,}/m);if(!r)return!1;const s=(r[0].match(/`/g)??[]).length,i=new RegExp(`^\\\`{${s}{'}'}\\s*$`,"m");if(!n.match(i))return!1;const o=n.search(i);if(o<0)return!1;return 0===n.slice(o+s).trim().length}},gu=/[\u200B-\u200D\uFEFF]/g,yu=e=>{const t=e.replace(gu,"").replace(/\r\n/g,"\n").replace(/\r/g,"\n");return t.endsWith("\n")?t:t+"\n"},vu=e=>e.endsWith("\n")?e:e+"\n",_u=e=>!!/^diff --git /m.test(e)||(!(!/^---\s+(?:a\/|\S)/m.test(e)||!/^\+\+\+\s+(?:b\/|\S)/m.test(e))||!!/^@@\s+-\d+(?:,\d+)?\s+\+\d+(?:,\d+)?\s+@@/m.test(e)),bu=e=>{const t=(e=>{const t=e.split(/\r?\n/);let n=0;for(;n<t.length&&""===t[n].trim();)n+=1;let r=t.length-1;for(;r>=0&&""===t[r].trim();)r-=1;if(n>r)return e;const s=t[n].trim(),i=t[r].trim(),o=e=>/^```/.test(e),a=e=>{const s=t.slice(n+1,r);return[...t.slice(0,n),...s,...t.slice(r+1)].join("\n")};return o(s)&&o(i)||/^BEGIN[_ -]?PATCH/i.test(s)&&(c=i,/^END[_ -]?PATCH/i.test(c))||(e=>/^\*{3,}\s*BEGIN\s+PATCH/i.test(e)||/^\*{3,}\s*Begin\s+Patch/i.test(e))(s)&&(e=>/^\*{3,}\s*END\s+PATCH/i.test(e)||/^\*{3,}\s*End\s+Patch/i.test(e))(i)?a():e;var c})(yu(e.trim())),n=yu(t),r=(e=>{const t=e.split("\n");for(let e=0;e<t.length;e+=1){const n=t[e];if(!n.match(/^`{3,}.*$/))continue;const r=(n.match(/^`+/)??[""])[0].length;for(let n=e+1;n<t.length;n+=1)if(new RegExp(`^\\\`{${r}{'}'}\\s*$`).test(t[n])){const r=t.slice(e+1,n).join("\n");if(_u(r))return r;e=n;break}}return null})(n);if(r)return vu(yu(r).trimEnd());const s=(e=>{let t=e.search(/^diff --git /m);return t<0&&(t=e.search(/^---\s+(?:a\/|\S)/m)),t<0?null:e.slice(t).replace(/\n`{3,}\s*$/m,"\n")})(n);return vu(s?yu(s).trimEnd():n)},wu=e=>/^[/\\]/.test(e),Su=e=>{const t=p.posix.normalize((e=>e.replace(/\\/g,"/").replace(/^\.\/+/,""))(e));return"/"===t?t:t.replace(/\/+$/,"")},Au=e=>{const t=[],n=[],r=(e=>{const t=/^###\s+File Ops\s*$/m.exec(e);if(!t)return null;const n=(t.index??0)+t[0].length,r=e.slice(n).split(/\r?\n/);let s=0;for(;s<r.length&&""===r[s].trim();)s+=1;const i=[];for(;s<r.length;s+=1){const e=r[s];if(/^#{2,3}\s+/.test(e))break;i.push(e)}return{body:i.join("\n").trimEnd()}})(e);if(!r)return{ops:t,errors:n};const s=r.body.split(/\r?\n/);let i=0;for(const e of s){i+=1;const r=e.trim();if(!r)continue;const s=r.split(/\s+/),o=s[0],a=s.slice(1),c=e=>{n.push(`file-ops line ${i.toString()}: ${e}`)},u=e=>{e||c(`expected 1 path, got ${a.length.toString()}`)},l=e=>{e||c(`expected 2 paths, got ${a.length.toString()}`)},f=e=>{if(!e||!e.trim())return null;const t=Su(e);return!t||wu(t)||t.split("/").some(e=>".."===e)?null:t};switch(o){case"mv":if(l(2===a.length),2===a.length){const e=f(a[0]),n=f(a[1]);e&&n?t.push({verb:"mv",src:e,dest:n}):c("mv: invalid repo-relative path")}break;case"rm":if(u(1===a.length),1===a.length){const e=f(a[0]);e?t.push({verb:"rm",src:e}):c("rm: invalid repo-relative path")}break;case"rmdir":if(u(1===a.length),1===a.length){const e=f(a[0]);e?t.push({verb:"rmdir",src:e}):c("rmdir: invalid repo-relative path")}break;case"mkdirp":if(u(1===a.length),1===a.length){const e=f(a[0]);e?t.push({verb:"mkdirp",src:e}):c("mkdirp: invalid repo-relative path")}break;default:c(`unknown verb "${o}"`)}}return{ops:t,errors:n}},ku=async(e,t,n=!1)=>{const r=[],i=t=>((e,t)=>{const n=p.resolve(e,t),r=p.resolve(e)+p.sep,s=n===p.resolve(e)||n.startsWith(r);return{abs:n,ok:s}})(e,t);for(const e of t){const t={verb:e.verb,src:e.src,dest:e.dest,status:"ok"};try{if("mv"===e.verb){const{abs:t,ok:r}=i(e.src),{abs:s,ok:o}=i(e.dest);if(!r||!o)throw new Error("path escapes repo root");const a=await y(t),c=await y(s);if(!a)throw new Error("source does not exist");if(c)throw new Error("destination exists (no overwrite)");n||(await g(p.dirname(s)),await v(t,s,{overwrite:!1}))}else if("rm"===e.verb){const{abs:t,ok:r}=i(e.src);if(!r)throw new Error("path escapes repo root");if(!await y(t))throw new Error("path does not exist");n||await _(t)}else if("rmdir"===e.verb){const{abs:t,ok:r}=i(e.src);if(!r)throw new Error("path escapes repo root");let o=null;try{o=await s(t)}catch{o=null}if(!o)throw new Error("directory does not exist");if(!o.isDirectory())throw new Error("not a directory");if((await a(t)).length>0)throw new Error("directory not empty");n||await _(t)}else if("mkdirp"===e.verb){const{abs:t,ok:r}=i(e.src);if(!r)throw new Error("path escapes repo root");n||await g(t)}t.status="ok"}catch(e){t.status="failed";const n=e instanceof Error?e.message:String(e);t.message=n}if(r.push(t),"failed"===t.status&&!n)break}return{ok:r.every(e=>"ok"===e.status),results:r}};function Eu(e){return Array.isArray(e)?e.map(e=>Eu(e)):Object.assign(Object.assign({},e),{hunks:e.hunks.map(e=>Object.assign(Object.assign({},e),{lines:e.lines.map((t,n)=>{var r;return t.startsWith("\\")||t.endsWith("\r")||(null===(r=e.lines[n+1])||void 0===r?void 0:r.startsWith("\\"))?t:t+"\r"})}))})}function xu(e){return Array.isArray(e)?e.map(e=>xu(e)):Object.assign(Object.assign({},e),{hunks:e.hunks.map(e=>Object.assign(Object.assign({},e),{lines:e.lines.map(e=>e.endsWith("\r")?e.substring(0,e.length-1):e)}))})}function $u(e){const t=e.split(/\n/),n=[];let r=0;function s(){const e={};for(n.push(e);r<t.length;){const n=t[r];if(/^(---|\+\+\+|@@)\s/.test(n))break;const s=/^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(n);s&&(e.index=s[1]),r++}for(i(e),i(e),e.hunks=[];r<t.length;){const n=t[r];if(/^(Index:\s|diff\s|---\s|\+\+\+\s|===================================================================)/.test(n))break;if(/^@@/.test(n))e.hunks.push(o());else{if(n)throw new Error("Unknown line "+(r+1)+" "+JSON.stringify(n));r++}}}function i(e){const n=/^(---|\+\+\+)\s+(.*)\r?$/.exec(t[r]);if(n){const t=n[2].split("\t",2),s=(t[1]||"").trim();let i=t[0].replace(/\\\\/g,"\\");/^".*"$/.test(i)&&(i=i.substr(1,i.length-2)),"---"===n[1]?(e.oldFileName=i,e.oldHeader=s):(e.newFileName=i,e.newHeader=s),r++}}function o(){var e;const n=r,s=t[r++].split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),i={oldStart:+s[1],oldLines:void 0===s[2]?1:+s[2],newStart:+s[3],newLines:void 0===s[4]?1:+s[4],lines:[]};0===i.oldLines&&(i.oldStart+=1),0===i.newLines&&(i.newStart+=1);let o=0,a=0;for(;r<t.length&&(a<i.oldLines||o<i.newLines||(null===(e=t[r])||void 0===e?void 0:e.startsWith("\\")));r++){const e=0==t[r].length&&r!=t.length-1?" ":t[r][0];if("+"!==e&&"-"!==e&&" "!==e&&"\\"!==e)throw new Error(`Hunk at line ${n+1} contained invalid line ${t[r]}`);i.lines.push(t[r]),"+"===e?o++:"-"===e?a++:" "===e&&(o++,a++)}if(o||1!==i.newLines||(i.newLines=0),a||1!==i.oldLines||(i.oldLines=0),o!==i.newLines)throw new Error("Added line count did not match for hunk at line "+(n+1));if(a!==i.oldLines)throw new Error("Removed line count did not match for hunk at line "+(n+1));return i}for(;r<t.length;)s();return n}function Ou(e,t,n){let r=!0,s=!1,i=!1,o=1;return function a(){if(r&&!i){if(s?o++:r=!1,e+o<=n)return e+o;i=!0}if(!s)return i||(r=!0),t<=e-o?e-o++:(s=!0,a())}}function Ru(e,t,n={}){let r;if(r="string"==typeof t?$u(t):Array.isArray(t)?t:[t],r.length>1)throw new Error("applyPatch only works with a single input.");return function(e,t,n={}){(n.autoConvertLineEndings||null==n.autoConvertLineEndings)&&(function(e){return e.includes("\r\n")&&!e.startsWith("\n")&&!e.match(/[^\r]\n/)}(e)&&function(e){return Array.isArray(e)||(e=[e]),!e.some(e=>e.hunks.some(e=>e.lines.some(e=>!e.startsWith("\\")&&e.endsWith("\r"))))}(t)?t=Eu(t):function(e){return!e.includes("\r\n")&&e.includes("\n")}(e)&&function(e){return Array.isArray(e)||(e=[e]),e.some(e=>e.hunks.some(e=>e.lines.some(e=>e.endsWith("\r"))))&&e.every(e=>e.hunks.every(e=>e.lines.every((t,n)=>{var r;return t.startsWith("\\")||t.endsWith("\r")||(null===(r=e.lines[n+1])||void 0===r?void 0:r.startsWith("\\"))})))}(t)&&(t=xu(t)));const r=e.split("\n"),s=t.hunks,i=n.compareLine||((e,t,n,r)=>t===r),o=n.fuzzFactor||0;let a=0;if(o<0||!Number.isInteger(o))throw new Error("fuzzFactor must be a non-negative integer");if(!s.length)return e;let c="",u=!1,l=!1;for(let e=0;e<s[s.length-1].lines.length;e++){const t=s[s.length-1].lines[e];"\\"==t[0]&&("+"==c[0]?u=!0:"-"==c[0]&&(l=!0)),c=t}if(u){if(l){if(!o&&""==r[r.length-1])return!1}else if(""==r[r.length-1])r.pop();else if(!o)return!1}else if(l)if(""!=r[r.length-1])r.push("");else if(!o)return!1;function f(e,t,n,s=0,o=!0,a=[],c=0){let u=0,l=!1;for(;s<e.length;s++){const p=e[s],h=p.length>0?p[0]:" ",d=p.length>0?p.substr(1):p;if("-"===h){if(!i(t+1,r[t],h,d))return n&&null!=r[t]?(a[c]=r[t],f(e,t+1,n-1,s,!1,a,c+1)):null;t++,u=0}if("+"===h){if(!o)return null;a[c]=d,c++,u=0,l=!0}if(" "===h){if(u++,a[c]=r[t],!i(t+1,r[t],h,d))return l||!n?null:r[t]&&(f(e,t+1,n-1,s+1,!1,a,c+1)||f(e,t+1,n-1,s,!1,a,c+1))||f(e,t,n-1,s+1,!1,a,c);c++,o=!0,l=!1,t++}}return c-=u,t-=u,a.length=c,{patchedLines:a,oldLineLastI:t-1}}const p=[];let h=0;for(let e=0;e<s.length;e++){const t=s[e];let n;const i=r.length-t.oldLines+o;let c;for(let e=0;e<=o;e++){c=t.oldStart+h-1;const r=Ou(c,a,i);for(;void 0!==c&&(n=f(t.lines,c,e),!n);c=r());if(n)break}if(!n)return!1;for(let e=a;e<c;e++)p.push(r[e]);for(let e=0;e<n.patchedLines.length;e++){const t=n.patchedLines[e];p.push(t)}a=n.oldLineLastI+1,h=c+1-t.oldStart}for(let e=a;e<r.length;e++)p.push(r[e]);return p.join("\n")}(e,r[0],n)}const Cu=e=>{if(!e)return null;const t=e.replace(/^a\//,"").replace(/^b\//,"").trim();return t.length?t:null},Tu=e=>"string"==typeof e&&"/dev/null"===e.trim(),Pu=e=>e.replace(/\r/g,"").replace(/[ \t]+$/g,""),Lu=e=>e.replace(/\n/g,"\r\n"),Nu=async e=>{const{cwd:t,cleaned:n,check:r,sandboxRoot:s}=e;let o;try{o=$u(n)}catch{return{okFiles:[],failed:[{path:"(patch)",reason:"invalid unified diff"}],sandboxRoot:s}}const a=o.some(e=>{const t=Cu(e.oldFileName),n=Cu(e.newFileName);return Boolean(t&&t.length||n&&n.length)});if(!o.length||!a)return{okFiles:[],failed:[{path:"(patch)",reason:"invalid unified diff"}],sandboxRoot:s};const c=[],f=[];for(const e of o){const n=Cu(e.newFileName)??Cu(e.oldFileName);if(!n){f.push({path:"(unknown)",reason:"no file name in patch header"});continue}const o=n.replace(/^[./]+/,""),a=p.resolve(t,o),h=/\.md$/i.test(o);let d="",m=!1,g=!0;try{const e=await i(a,"utf8");d=e,m=/\r\n/.test(e)}catch{g=!1}const y=Tu(e.oldFileName);if(!g&&!y){f.push({path:o,reason:"target file not found"});continue}let v;!g&&y&&(d="",m=!1);try{v=Ru(d,e,{compareLine:(e,t,n,r)=>Pu(t)===Pu(r),fuzzFactor:h?1:0})}catch{f.push({path:o,reason:"unable to parse or place hunk(s)"});continue}if(!1===v||"string"!=typeof v){f.push({path:o,reason:"unable to place hunk(s)"});continue}const _=m?Lu(v.replace(/\r/g,"")):v.replace(/\r/g,"");try{if(r){const e=s??p.join(t,".stan","patch",".sandbox"),n=p.resolve(e,o);await l(p.dirname(n),{recursive:!0}),await u(n,_,"utf8")}else{try{await l(p.dirname(a),{recursive:!0})}catch{}await u(a,_,"utf8")}c.push(o)}catch{f.push({path:o,reason:"write failed"})}}return{okFiles:c,failed:f,sandboxRoot:s}},Iu=async e=>{const{cwd:t,patchAbs:n,cleaned:r,check:s,stripOrder:i=[1,0]}=e,o=i.flatMap(e=>((e,t)=>{const n=e?["--check"]:[];return[{args:[...n,"--3way","--whitespace=nowarn","--recount","--inaccurate-eof",`-p${t.toString()}`],strip:t,label:`3way+nowarn-p${t.toString()}`},{args:[...n,"--3way","--ignore-whitespace","--recount","--inaccurate-eof",`-p${t.toString()}`],strip:t,label:`3way+ignore-p${t.toString()}`},{args:[...n,"--whitespace=nowarn","--recount","--inaccurate-eof",`-p${t.toString()}`],strip:t,label:`2way+nowarn-p${t.toString()}`},{args:[...n,"--ignore-whitespace","--recount","--inaccurate-eof",`-p${t.toString()}`],strip:t,label:`2way+ignore-p${t.toString()}`}]})(s,e)),a=await(async(e,t,n,r="1"===process.env.STAN_DEBUG)=>{const s=[],i=[];for(const o of n){s.push(o.label);const n=await new Promise(n=>{const s=E("git",["apply",...o.args,t],{cwd:e,shell:!1,windowsHide:!0});let a="",c="";const u=s;u.stderr?.on("data",e=>{const t=e.toString("utf8");c+=t,r&&process.stderr.write(t)}),u.stdout?.on("data",e=>{const t=e.toString("utf8");a+=t,r&&process.stdout.write(t)}),s.on("close",e=>{i.push({label:o.label,code:e??0,stdout:a,stderr:c}),n(e??0)})});if(0===n)return{ok:!0,tried:s,lastCode:0,captures:i};r&&console.error(`stan: git apply failed for ${o.label} (exit ${n})`)}return{ok:!1,tried:s,lastCode:1,captures:i}})(t,n,o);if(a.ok)return{ok:!0,result:a,js:null};const c=await Nu({cwd:t,cleaned:r,check:s});if(c.okFiles.length>0&&0===c.failed.length)return{ok:!0,result:a,js:c};try{const e=await(async(e,t,n)=>{const r=t.replace(/\r\n/g,"\n").split("\n");let s=-1,i=null;for(let e=0;e<r.length-1;e+=1)if(/^---\s+\/dev\/null\s*$/.test(r[e])){const t=r[e+1].match(/^\+\+\+\s+b\/(.+)\s*$/);if(t&&t[1]){s=e+1,i=String(t[1]).trim().replace(/^[./]+/,"");break}}if(!i||!i.length)return null;const o=r.slice(s+1).join("\n");if(/^---\s+\/dev\/null/m.test(o))return null;const a=[];let c=!1;for(let e=s+1;e<r.length;e+=1){const t=r[e];if(/^diff --git /.test(t))break;if(/^@@ /.test(t))c=!0;else if(c&&/^[ +-]/.test(t)){const e=t[0];"+"!==e&&" "!==e||a.push(t.slice(1))}}let f=a.join("\n");f.endsWith("\n")||(f+="\n");const h=n?p.join(e,".stan","patch",".sandbox","F"):e,d=p.resolve(h,i);return await l(p.dirname(d),{recursive:!0}),await u(d,f,"utf8"),{okFiles:[i],failed:[],sandboxRoot:n?h:void 0}})(t,r,s);if(e)return{ok:!0,result:a,js:e}}catch{}return{ok:!1,result:a,js:c}};var Mu,Du={},ju={},Hu={};function Fu(){if(Mu)return Hu;return Mu=1,Object.defineProperty(Hu,"__esModule",{value:!0}),Hu.splitWhen=Hu.flatten=void 0,Hu.flatten=function(e){return e.reduce((e,t)=>[].concat(e,t),[])},Hu.splitWhen=function(e,t){const n=[[]];let r=0;for(const s of e)t(s)?(r++,n[r]=[]):n[r].push(s);return n},Hu}var Bu,zu={};function Ku(){if(Bu)return zu;return Bu=1,Object.defineProperty(zu,"__esModule",{value:!0}),zu.isEnoentCodeError=void 0,zu.isEnoentCodeError=function(e){return"ENOENT"===e.code},zu}var Uu,qu={};var Zu,Wu={};function Gu(){if(Zu)return Wu;Zu=1,Object.defineProperty(Wu,"__esModule",{value:!0}),Wu.convertPosixPathToPattern=Wu.convertWindowsPathToPattern=Wu.convertPathToPattern=Wu.escapePosixPath=Wu.escapeWindowsPath=Wu.escape=Wu.removeLeadingDotSegment=Wu.makeAbsolute=Wu.unixify=void 0;const e=$,t="win32"===x.platform(),n=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,r=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,s=/^\\\\([.?])/,i=/\\(?![!()+@[\]{}])/g;function o(e){return e.replace(r,"\\$2")}function a(e){return e.replace(n,"\\$2")}function c(e){return o(e).replace(s,"//$1").replace(i,"/")}function u(e){return a(e)}return Wu.unixify=function(e){return e.replace(/\\/g,"/")},Wu.makeAbsolute=function(t,n){return e.resolve(t,n)},Wu.removeLeadingDotSegment=function(e){if("."===e.charAt(0)){const t=e.charAt(1);if("/"===t||"\\"===t)return e.slice(2)}return e},Wu.escape=t?o:a,Wu.escapeWindowsPath=o,Wu.escapePosixPath=a,Wu.convertPathToPattern=t?c:u,Wu.convertWindowsPathToPattern=c,Wu.convertPosixPathToPattern=u,Wu}var Vu,Yu,Qu,Ju,Xu,el,tl={};function nl(){return Yu?Vu:(Yu=1,Vu=function(e){if("string"!=typeof e||""===e)return!1;for(var t;t=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(t[2])return!0;e=e.slice(t.index+t[0].length)}return!1})}function rl(){if(Ju)return Qu;Ju=1;var e=nl(),t={"{":"}","(":")","[":"]"},n=function(e){if("!"===e[0])return!0;for(var n=0,r=-2,s=-2,i=-2,o=-2,a=-2;n<e.length;){if("*"===e[n])return!0;if("?"===e[n+1]&&/[\].+)]/.test(e[n]))return!0;if(-1!==s&&"["===e[n]&&"]"!==e[n+1]&&(s<n&&(s=e.indexOf("]",n)),s>n)){if(-1===a||a>s)return!0;if(-1===(a=e.indexOf("\\",n))||a>s)return!0}if(-1!==i&&"{"===e[n]&&"}"!==e[n+1]&&(i=e.indexOf("}",n))>n&&(-1===(a=e.indexOf("\\",n))||a>i))return!0;if(-1!==o&&"("===e[n]&&"?"===e[n+1]&&/[:!=]/.test(e[n+2])&&")"!==e[n+3]&&(o=e.indexOf(")",n))>n&&(-1===(a=e.indexOf("\\",n))||a>o))return!0;if(-1!==r&&"("===e[n]&&"|"!==e[n+1]&&(r<n&&(r=e.indexOf("|",n)),-1!==r&&")"!==e[r+1]&&(o=e.indexOf(")",r))>r&&(-1===(a=e.indexOf("\\",r))||a>o)))return!0;if("\\"===e[n]){var c=e[n+1];n+=2;var u=t[c];if(u){var l=e.indexOf(u,n);-1!==l&&(n=l+1)}if("!"===e[n])return!0}else n++}return!1},r=function(e){if("!"===e[0])return!0;for(var n=0;n<e.length;){if(/[*?{}()[\]]/.test(e[n]))return!0;if("\\"===e[n]){var r=e[n+1];n+=2;var s=t[r];if(s){var i=e.indexOf(s,n);-1!==i&&(n=i+1)}if("!"===e[n])return!0}else n++}return!1};return Qu=function(t,s){if("string"!=typeof t||""===t)return!1;if(e(t))return!0;var i=n;return s&&!1===s.strict&&(i=r),i(t)}}var sl,il,ol,al,cl,ul,ll,fl,pl,hl,dl,ml,gl,yl,vl,_l,bl,wl,Sl,Al={};function kl(){return sl||(sl=1,(e=Al).isInteger=e=>"number"==typeof e?Number.isInteger(e):"string"==typeof e&&""!==e.trim()&&Number.isInteger(Number(e)),e.find=(e,t)=>e.nodes.find(e=>e.type===t),e.exceedsLimit=(t,n,r=1,s)=>!1!==s&&!(!e.isInteger(t)||!e.isInteger(n))&&(Number(n)-Number(t))/Number(r)>=s,e.escapeNode=(e,t=0,n)=>{const r=e.nodes[t];r&&(n&&r.type===n||"open"===r.type||"close"===r.type)&&!0!==r.escaped&&(r.value="\\"+r.value,r.escaped=!0)},e.encloseBrace=e=>!("brace"!==e.type||e.commas>>0+e.ranges|0||(e.invalid=!0,0)),e.isInvalidBrace=e=>!("brace"!==e.type||!0!==e.invalid&&!e.dollar&&(e.commas>>0+e.ranges|0&&!0===e.open&&!0===e.close||(e.invalid=!0,0))),e.isOpenOrClose=e=>"open"===e.type||"close"===e.type||!0===e.open||!0===e.close,e.reduce=e=>e.reduce((e,t)=>("text"===t.type&&e.push(t.value),"range"===t.type&&(t.type="text"),e),[]),e.flatten=(...e)=>{const t=[],n=e=>{for(let r=0;r<e.length;r++){const s=e[r];Array.isArray(s)?n(s):void 0!==s&&t.push(s)}return t};return n(e),t}),Al;var e}function El(){if(ol)return il;ol=1;const e=kl();return il=(t,n={})=>{const r=(t,s={})=>{const i=n.escapeInvalid&&e.isInvalidBrace(s),o=!0===t.invalid&&!0===n.escapeInvalid;let a="";if(t.value)return(i||o)&&e.isOpenOrClose(t)?"\\"+t.value:t.value;if(t.value)return t.value;if(t.nodes)for(const e of t.nodes)a+=r(e);return a};return r(t)}}function xl(){return cl?al:(cl=1,al=function(e){return"number"==typeof e?e-e===0:"string"==typeof e&&""!==e.trim()&&(Number.isFinite?Number.isFinite(+e):isFinite(+e))})}function $l(){if(ll)return ul;ll=1;const e=xl(),t=(n,i,o)=>{if(!1===e(n))throw new TypeError("toRegexRange: expected the first argument to be a number");if(void 0===i||n===i)return String(n);if(!1===e(i))throw new TypeError("toRegexRange: expected the second argument to be a number.");let a={relaxZeros:!0,...o};"boolean"==typeof a.strictZeros&&(a.relaxZeros=!1===a.strictZeros);let c=n+":"+i+"="+String(a.relaxZeros)+String(a.shorthand)+String(a.capture)+String(a.wrap);if(t.cache.hasOwnProperty(c))return t.cache[c].result;let u=Math.min(n,i),l=Math.max(n,i);if(1===Math.abs(u-l)){let e=n+"|"+i;return a.capture?`(${e})`:!1===a.wrap?e:`(?:${e})`}let p=f(n)||f(i),h={min:n,max:i,a:u,b:l},d=[],m=[];if(p&&(h.isPadded=p,h.maxLen=String(h.max).length),u<0){m=r(l<0?Math.abs(l):1,Math.abs(u),h,a),u=h.a=0}return l>=0&&(d=r(u,l,h,a)),h.negatives=m,h.positives=d,h.result=function(e,t){let n=s(e,t,"-",!1)||[],r=s(t,e,"",!1)||[],i=s(e,t,"-?",!0)||[];return n.concat(i).concat(r).join("|")}(m,d),!0===a.capture?h.result=`(${h.result})`:!1!==a.wrap&&d.length+m.length>1&&(h.result=`(?:${h.result})`),t.cache[c]=h,h.result};function n(e,t,n){if(e===t)return{pattern:e,count:[],digits:0};let r=function(e,t){let n=[];for(let r=0;r<e.length;r++)n.push([e[r],t[r]]);return n}(e,t),s=r.length,i="",o=0;for(let e=0;e<s;e++){let[t,n]=r[e];t===n?i+=t:"0"!==t||"9"!==n?i+=l(t,n):o++}return o&&(i+=!0===n.shorthand?"\\d":"[0-9]"),{pattern:i,count:[o],digits:s}}function r(e,t,r,s){let o,l=function(e,t){let n=1,r=1,s=a(e,n),o=new Set([t]);for(;e<=s&&s<=t;)o.add(s),n+=1,s=a(e,n);for(s=c(t+1,r)-1;e<s&&s<=t;)o.add(s),r+=1,s=c(t+1,r)-1;return o=[...o],o.sort(i),o}(e,t),f=[],h=e;for(let e=0;e<l.length;e++){let t=l[e],i=n(String(h),String(t),s),a="";r.isPadded||!o||o.pattern!==i.pattern?(r.isPadded&&(a=p(t,r,s)),i.string=a+i.pattern+u(i.count),f.push(i),h=t+1,o=i):(o.count.length>1&&o.count.pop(),o.count.push(i.count[0]),o.string=o.pattern+u(o.count),h=t+1)}return f}function s(e,t,n,r,s){let i=[];for(let s of e){let{string:e}=s;r||o(t,"string",e)||i.push(n+e),r&&o(t,"string",e)&&i.push(n+e)}return i}function i(e,t){return e>t?1:t>e?-1:0}function o(e,t,n){return e.some(e=>e[t]===n)}function a(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function c(e,t){return e-e%Math.pow(10,t)}function u(e){let[t=0,n=""]=e;return n||t>1?`{${t+(n?","+n:"")}}`:""}function l(e,t,n){return`[${e}${t-e===1?"":"-"}${t}]`}function f(e){return/^-?(0+)\d/.test(e)}function p(e,t,n){if(!t.isPadded)return e;let r=Math.abs(t.maxLen-String(e).length),s=!1!==n.relaxZeros;switch(r){case 0:return"";case 1:return s?"0?":"0";case 2:return s?"0{0,2}":"00";default:return s?`0{0,${r}}`:`0{${r}}`}}return t.cache={},t.clearCache=()=>t.cache={},ul=t}function Ol(){if(pl)return fl;pl=1;const e=O,t=$l(),n=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),r=e=>"number"==typeof e||"string"==typeof e&&""!==e,s=e=>Number.isInteger(+e),i=e=>{let t=`${e}`,n=-1;if("-"===t[0]&&(t=t.slice(1)),"0"===t)return!1;for(;"0"===t[++n];);return n>0},o=(e,t,n)=>{if(t>0){let n="-"===e[0]?"-":"";n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,"0")}return!1===n?String(e):e},a=(e,t)=>{let n="-"===e[0]?"-":"";for(n&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return n?"-"+e:e},c=(e,n,r,s)=>{if(r)return t(e,n,{wrap:!1,...s});let i=String.fromCharCode(e);return e===n?i:`[${i}-${String.fromCharCode(n)}]`},u=(e,n,r)=>{if(Array.isArray(e)){let t=!0===r.wrap,n=r.capture?"":"?:";return t?`(${n}${e.join("|")})`:e.join("|")}return t(e,n,r)},l=(...t)=>new RangeError("Invalid range arguments: "+e.inspect(...t)),f=(e,t,n)=>{if(!0===n.strictRanges)throw l([e,t]);return[]},p=(e,t,n=1,r={})=>{let s=Number(e),f=Number(t);if(!Number.isInteger(s)||!Number.isInteger(f)){if(!0===r.strictRanges)throw l([e,t]);return[]}0===s&&(s=0),0===f&&(f=0);let p=s>f,h=String(e),d=String(t),m=String(n);n=Math.max(Math.abs(n),1);let g=i(h)||i(d)||i(m),y=g?Math.max(h.length,d.length,m.length):0,v=!1===g&&!1===((e,t,n)=>"string"==typeof e||"string"==typeof t||!0===n.stringify)(e,t,r),_=r.transform||(e=>t=>!0===e?Number(t):String(t))(v);if(r.toRegex&&1===n)return c(a(e,y),a(t,y),!0,r);let b={negatives:[],positives:[]},w=e=>b[e<0?"negatives":"positives"].push(Math.abs(e)),S=[],A=0;for(;p?s>=f:s<=f;)!0===r.toRegex&&n>1?w(s):S.push(o(_(s,A),y,v)),s=p?s-n:s+n,A++;return!0===r.toRegex?n>1?((e,t,n)=>{e.negatives.sort((e,t)=>e<t?-1:e>t?1:0),e.positives.sort((e,t)=>e<t?-1:e>t?1:0);let r,s=t.capture?"":"?:",i="",o="";return e.positives.length&&(i=e.positives.map(e=>a(String(e),n)).join("|")),e.negatives.length&&(o=`-(${s}${e.negatives.map(e=>a(String(e),n)).join("|")})`),r=i&&o?`${i}|${o}`:i||o,t.wrap?`(${s}${r})`:r})(b,r,y):u(S,null,{wrap:!1,...r}):S},h=(e,t,i,o={})=>{if(null==t&&r(e))return[e];if(!r(e)||!r(t))return f(e,t,o);if("function"==typeof i)return h(e,t,1,{transform:i});if(n(i))return h(e,t,0,i);let a={...o};return!0===a.capture&&(a.wrap=!0),i=i||a.step||1,s(i)?s(e)&&s(t)?p(e,t,i,a):((e,t,n=1,r={})=>{if(!s(e)&&e.length>1||!s(t)&&t.length>1)return f(e,t,r);let i=r.transform||(e=>String.fromCharCode(e)),o=`${e}`.charCodeAt(0),a=`${t}`.charCodeAt(0),l=o>a,p=Math.min(o,a),h=Math.max(o,a);if(r.toRegex&&1===n)return c(p,h,!1,r);let d=[],m=0;for(;l?o>=a:o<=a;)d.push(i(o,m)),o=l?o-n:o+n,m++;return!0===r.toRegex?u(d,null,{wrap:!1,options:r}):d})(e,t,Math.max(Math.abs(i),1),a):null==i||n(i)?h(e,t,1,i):((e,t)=>{if(!0===t.strictRanges)throw new TypeError(`Expected step "${e}" to be a number`);return[]})(i,a)};return fl=h}function Rl(){if(bl)return _l;bl=1;const e=El(),{MAX_LENGTH:t,CHAR_BACKSLASH:n,CHAR_BACKTICK:r,CHAR_COMMA:s,CHAR_DOT:i,CHAR_LEFT_PARENTHESES:o,CHAR_RIGHT_PARENTHESES:a,CHAR_LEFT_CURLY_BRACE:c,CHAR_RIGHT_CURLY_BRACE:u,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_RIGHT_SQUARE_BRACKET:f,CHAR_DOUBLE_QUOTE:p,CHAR_SINGLE_QUOTE:h,CHAR_NO_BREAK_SPACE:d,CHAR_ZERO_WIDTH_NOBREAK_SPACE:m}=vl?yl:(vl=1,yl={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:"\n",CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\ufeff"});return _l=(g,y={})=>{if("string"!=typeof g)throw new TypeError("Expected a string");const v=y||{},_="number"==typeof v.maxLength?Math.min(t,v.maxLength):t;if(g.length>_)throw new SyntaxError(`Input length (${g.length}), exceeds max characters (${_})`);const b={type:"root",input:g,nodes:[]},w=[b];let S=b,A=b,k=0;const E=g.length;let x,$=0,O=0;const R=()=>g[$++],C=e=>{if("text"===e.type&&"dot"===A.type&&(A.type="text"),!A||"text"!==A.type||"text"!==e.type)return S.nodes.push(e),e.parent=S,e.prev=A,A=e,e;A.value+=e.value};for(C({type:"bos"});$<E;)if(S=w[w.length-1],x=R(),x!==m&&x!==d)if(x!==n)if(x!==f){if(x===l){let e;for(k++;$<E&&(e=R());)if(x+=e,e!==l)if(e!==n){if(e===f&&(k--,0===k))break}else x+=R();else k++;C({type:"text",value:x});continue}if(x!==o)if(x!==a){if(x===p||x===h||x===r){const e=x;let t;for(!0!==y.keepQuotes&&(x="");$<E&&(t=R());)if(t!==n){if(t===e){!0===y.keepQuotes&&(x+=t);break}x+=t}else x+=t+R();C({type:"text",value:x});continue}if(x===c){O++;const e=A.value&&"$"===A.value.slice(-1)||!0===S.dollar;S=C({type:"brace",open:!0,close:!1,dollar:e,depth:O,commas:0,ranges:0,nodes:[]}),w.push(S),C({type:"open",value:x});continue}if(x===u){if("brace"!==S.type){C({type:"text",value:x});continue}const e="close";S=w.pop(),S.close=!0,C({type:e,value:x}),O--,S=w[w.length-1];continue}if(x===s&&O>0){if(S.ranges>0){S.ranges=0;const t=S.nodes.shift();S.nodes=[t,{type:"text",value:e(S)}]}C({type:"comma",value:x}),S.commas++}else{if(x===i&&O>0&&0===S.commas){const e=S.nodes;if(0===O||0===e.length){C({type:"text",value:x});continue}if("dot"===A.type){if(S.range=[],A.value+=x,A.type="range",3!==S.nodes.length&&5!==S.nodes.length){S.invalid=!0,S.ranges=0,A.type="text";continue}S.ranges++,S.args=[];continue}if("range"===A.type){e.pop();const t=e[e.length-1];t.value+=A.value+x,A=t,S.ranges--;continue}C({type:"dot",value:x});continue}C({type:"text",value:x})}}else{if("paren"!==S.type){C({type:"text",value:x});continue}S=w.pop(),C({type:"text",value:x}),S=w[w.length-1]}else S=C({type:"paren",nodes:[]}),w.push(S),C({type:"text",value:x})}else C({type:"text",value:"\\"+x});else C({type:"text",value:(y.keepEscaping?x:"")+R()});do{if(S=w.pop(),"root"!==S.type){S.nodes.forEach(e=>{e.nodes||("open"===e.type&&(e.isOpen=!0),"close"===e.type&&(e.isClose=!0),e.nodes||(e.type="text"),e.invalid=!0)});const e=w[w.length-1],t=e.nodes.indexOf(S);e.nodes.splice(t,1,...S.nodes)}}while(w.length>0);return C({type:"eos"}),b},_l}function Cl(){if(Sl)return wl;Sl=1;const e=El(),t=function(){if(dl)return hl;dl=1;const e=Ol(),t=kl();return hl=(n,r={})=>{const s=(n,i={})=>{const o=t.isInvalidBrace(i),a=!0===n.invalid&&!0===r.escapeInvalid,c=!0===o||!0===a,u=!0===r.escapeInvalid?"\\":"";let l="";if(!0===n.isOpen)return u+n.value;if(!0===n.isClose)return console.log("node.isClose",u,n.value),u+n.value;if("open"===n.type)return c?u+n.value:"(";if("close"===n.type)return c?u+n.value:")";if("comma"===n.type)return"comma"===n.prev.type?"":c?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){const s=t.reduce(n.nodes),i=e(...s,{...r,wrap:!1,toRegex:!0,strictZeros:!0});if(0!==i.length)return s.length>1&&i.length>1?`(${i})`:i}if(n.nodes)for(const e of n.nodes)l+=s(e,n);return l};return s(n)}}(),n=function(){if(gl)return ml;gl=1;const e=Ol(),t=El(),n=kl(),r=(e="",t="",s=!1)=>{const i=[];if(e=[].concat(e),!(t=[].concat(t)).length)return e;if(!e.length)return s?n.flatten(t).map(e=>`{${e}}`):t;for(const n of e)if(Array.isArray(n))for(const e of n)i.push(r(e,t,s));else for(let e of t)!0===s&&"string"==typeof e&&(e=`{${e}}`),i.push(Array.isArray(e)?r(n,e,s):n+e);return n.flatten(i)};return ml=(s,i={})=>{const o=void 0===i.rangeLimit?1e3:i.rangeLimit,a=(s,c={})=>{s.queue=[];let u=c,l=c.queue;for(;"brace"!==u.type&&"root"!==u.type&&u.parent;)u=u.parent,l=u.queue;if(s.invalid||s.dollar)return void l.push(r(l.pop(),t(s,i)));if("brace"===s.type&&!0!==s.invalid&&2===s.nodes.length)return void l.push(r(l.pop(),["{}"]));if(s.nodes&&s.ranges>0){const a=n.reduce(s.nodes);if(n.exceedsLimit(...a,i.step,o))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let c=e(...a,i);return 0===c.length&&(c=t(s,i)),l.push(r(l.pop(),c)),void(s.nodes=[])}const f=n.encloseBrace(s);let p=s.queue,h=s;for(;"brace"!==h.type&&"root"!==h.type&&h.parent;)h=h.parent,p=h.queue;for(let e=0;e<s.nodes.length;e++){const t=s.nodes[e];"comma"!==t.type||"brace"!==s.type?"close"!==t.type?t.value&&"open"!==t.type?p.push(r(p.pop(),t.value)):t.nodes&&a(t,s):l.push(r(l.pop(),p,f)):(1===e&&p.push(""),p.push(""))}return p};return n.flatten(a(s))},ml}(),r=Rl(),s=(e,t={})=>{let n=[];if(Array.isArray(e))for(const r of e){const e=s.create(r,t);Array.isArray(e)?n.push(...e):n.push(e)}else n=[].concat(s.create(e,t));return t&&!0===t.expand&&!0===t.nodupes&&(n=[...new Set(n)]),n};return s.parse=(e,t={})=>r(e,t),s.stringify=(t,n={})=>e("string"==typeof t?s.parse(t,n):t,n),s.compile=(e,n={})=>("string"==typeof e&&(e=s.parse(e,n)),t(e,n)),s.expand=(e,t={})=>{"string"==typeof e&&(e=s.parse(e,t));let r=n(e,t);return!0===t.noempty&&(r=r.filter(Boolean)),!0===t.nodupes&&(r=[...new Set(r)]),r},s.create=(e,t={})=>""===e||e.length<3?[e]:!0!==t.expand?s.compile(e,t):s.expand(e,t),wl=s}var Tl,Pl,Ll,Nl,Il,Ml,Dl,jl,Hl,Fl,Bl,zl,Kl,Ul,ql={};function Zl(){if(Pl)return Tl;Pl=1;const e=$,t="\\\\/",n=`[^${t}]`,r="\\.",s="\\/",i="[^/]",o=`(?:${s}|$)`,a=`(?:^|${s})`,c=`${r}{1,2}${o}`,u={DOT_LITERAL:r,PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:s,ONE_CHAR:"(?=.)",QMARK:i,END_ANCHOR:o,DOTS_SLASH:c,NO_DOT:`(?!${r})`,NO_DOTS:`(?!${a}${c})`,NO_DOT_SLASH:`(?!${r}{0,1}${o})`,NO_DOTS_SLASH:`(?!${c})`,QMARK_NO_DOT:`[^.${s}]`,STAR:`${i}*?`,START_ANCHOR:a},l={...u,SLASH_LITERAL:`[${t}]`,QMARK:n,STAR:`${n}*?`,DOTS_SLASH:`${r}{1,2}(?:[${t}]|$)`,NO_DOT:`(?!${r})`,NO_DOTS:`(?!(?:^|[${t}])${r}{1,2}(?:[${t}]|$))`,NO_DOT_SLASH:`(?!${r}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${r}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`};return Tl={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{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"},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:{"***":"*","**/**":"**","**/**/**":"**"},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,SEP:e.sep,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?l:u}}function Wl(){return Ll||(Ll=1,function(e){const t=$,n="win32"===process.platform,{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:s,REGEX_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_GLOBAL:o}=Zl();e.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),e.hasRegexChars=e=>i.test(e),e.isRegexChar=t=>1===t.length&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(o,"\\$1"),e.toPosixSlashes=e=>e.replace(r,"/"),e.removeBackslashes=e=>e.replace(s,e=>"\\"===e?"":e),e.supportsLookbehinds=()=>{const e=process.version.slice(1).split(".").map(Number);return 3===e.length&&e[0]>=9||8===e[0]&&e[1]>=10},e.isWindows=e=>e&&"boolean"==typeof e.windows?e.windows:!0===n||"\\"===t.sep,e.escapeLast=(t,n,r)=>{const s=t.lastIndexOf(n,r);return-1===s?t:"\\"===t[s-1]?e.escapeLast(t,n,s-1):`${t.slice(0,s)}\\${t.slice(s)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith("./")&&(n=n.slice(2),t.prefix="./"),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?"":"^"}(?:${e})${n.contains?"":"$"}`;return!0===t.negated&&(r=`(?:^(?!${r}).*$)`),r}}(ql)),ql}function Gl(){if(Hl)return jl;Hl=1;const e=$,t=function(){if(Il)return Nl;Il=1;const e=Wl(),{CHAR_ASTERISK:t,CHAR_AT:n,CHAR_BACKWARD_SLASH:r,CHAR_COMMA:s,CHAR_DOT:i,CHAR_EXCLAMATION_MARK:o,CHAR_FORWARD_SLASH:a,CHAR_LEFT_CURLY_BRACE:c,CHAR_LEFT_PARENTHESES:u,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:f,CHAR_QUESTION_MARK:p,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:d,CHAR_RIGHT_SQUARE_BRACKET:m}=Zl(),g=e=>e===a||e===r,y=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};return Nl=(v,_)=>{const b=_||{},w=v.length-1,S=!0===b.parts||!0===b.scanToEnd,A=[],k=[],E=[];let x,$,O=v,R=-1,C=0,T=0,P=!1,L=!1,N=!1,I=!1,M=!1,D=!1,j=!1,H=!1,F=!1,B=!1,z=0,K={value:"",depth:0,isGlob:!1};const U=()=>R>=w,q=()=>O.charCodeAt(R+1),Z=()=>(x=$,O.charCodeAt(++R));for(;R<w;){let e;if($=Z(),$!==r){if(!0===D||$===c){for(z++;!0!==U()&&($=Z());)if($!==r)if($!==c){if(!0!==D&&$===i&&($=Z())===i){if(P=K.isBrace=!0,N=K.isGlob=!0,B=!0,!0===S)continue;break}if(!0!==D&&$===s){if(P=K.isBrace=!0,N=K.isGlob=!0,B=!0,!0===S)continue;break}if($===h&&(z--,0===z)){D=!1,P=K.isBrace=!0,B=!0;break}}else z++;else j=K.backslashes=!0,Z();if(!0===S)continue;break}if($!==a){if(!0!==b.noext&&!0==($===f||$===n||$===t||$===p||$===o)&&q()===u){if(N=K.isGlob=!0,I=K.isExtglob=!0,B=!0,$===o&&R===C&&(F=!0),!0===S){for(;!0!==U()&&($=Z());)if($!==r){if($===d){N=K.isGlob=!0,B=!0;break}}else j=K.backslashes=!0,$=Z();continue}break}if($===t){if(x===t&&(M=K.isGlobstar=!0),N=K.isGlob=!0,B=!0,!0===S)continue;break}if($===p){if(N=K.isGlob=!0,B=!0,!0===S)continue;break}if($===l){for(;!0!==U()&&(e=Z());)if(e!==r){if(e===m){L=K.isBracket=!0,N=K.isGlob=!0,B=!0;break}}else j=K.backslashes=!0,Z();if(!0===S)continue;break}if(!0===b.nonegate||$!==o||R!==C){if(!0!==b.noparen&&$===u){if(N=K.isGlob=!0,!0===S){for(;!0!==U()&&($=Z());)if($!==u){if($===d){B=!0;break}}else j=K.backslashes=!0,$=Z();continue}break}if(!0===N){if(B=!0,!0===S)continue;break}}else H=K.negated=!0,C++}else{if(A.push(R),k.push(K),K={value:"",depth:0,isGlob:!1},!0===B)continue;if(x===i&&R===C+1){C+=2;continue}T=R+1}}else j=K.backslashes=!0,$=Z(),$===c&&(D=!0)}!0===b.noext&&(I=!1,N=!1);let W=O,G="",V="";C>0&&(G=O.slice(0,C),O=O.slice(C),T-=C),W&&!0===N&&T>0?(W=O.slice(0,T),V=O.slice(T)):!0===N?(W="",V=O):W=O,W&&""!==W&&"/"!==W&&W!==O&&g(W.charCodeAt(W.length-1))&&(W=W.slice(0,-1)),!0===b.unescape&&(V&&(V=e.removeBackslashes(V)),W&&!0===j&&(W=e.removeBackslashes(W)));const Y={prefix:G,input:v,start:C,base:W,glob:V,isBrace:P,isBracket:L,isGlob:N,isExtglob:I,isGlobstar:M,negated:H,negatedExtglob:F};if(!0===b.tokens&&(Y.maxDepth=0,g($)||k.push(K),Y.tokens=k),!0===b.parts||!0===b.tokens){let e;for(let t=0;t<A.length;t++){const n=e?e+1:C,r=A[t],s=v.slice(n,r);b.tokens&&(0===t&&0!==C?(k[t].isPrefix=!0,k[t].value=G):k[t].value=s,y(k[t]),Y.maxDepth+=k[t].depth),0===t&&""===s||E.push(s),e=r}if(e&&e+1<v.length){const t=v.slice(e+1);E.push(t),b.tokens&&(k[k.length-1].value=t,y(k[k.length-1]),Y.maxDepth+=k[k.length-1].depth)}Y.slashes=A,Y.parts=E}return Y},Nl}(),n=function(){if(Dl)return Ml;Dl=1;const e=Zl(),t=Wl(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_BACKREF:i,REPLACEMENTS:o}=e,a=(e,n)=>{if("function"==typeof n.expandRange)return n.expandRange(...e,n);e.sort();const r=`[${e.join("-")}]`;try{new RegExp(r)}catch(n){return e.map(e=>t.escapeRegex(e)).join("..")}return r},c=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,u=(l,f)=>{if("string"!=typeof l)throw new TypeError("Expected a string");l=o[l]||l;const p={...f},h="number"==typeof p.maxLength?Math.min(n,p.maxLength):n;let d=l.length;if(d>h)throw new SyntaxError(`Input length: ${d}, exceeds maximum allowed length: ${h}`);const m={type:"bos",value:"",output:p.prepend||""},g=[m],y=p.capture?"":"?:",v=t.isWindows(f),_=e.globChars(v),b=e.extglobChars(_),{DOT_LITERAL:w,PLUS_LITERAL:S,SLASH_LITERAL:A,ONE_CHAR:k,DOTS_SLASH:E,NO_DOT:x,NO_DOT_SLASH:$,NO_DOTS_SLASH:O,QMARK:R,QMARK_NO_DOT:C,STAR:T,START_ANCHOR:P}=_,L=e=>`(${y}(?:(?!${P}${e.dot?E:w}).)*?)`,N=p.dot?"":x,I=p.dot?R:C;let M=!0===p.bash?L(p):T;p.capture&&(M=`(${M})`),"boolean"==typeof p.noext&&(p.noextglob=p.noext);const D={input:l,index:-1,start:0,dot:!0===p.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:g};l=t.removePrefix(l,D),d=l.length;const j=[],H=[],F=[];let B,z=m;const K=()=>D.index===d-1,U=D.peek=(e=1)=>l[D.index+e],q=D.advance=()=>l[++D.index]||"",Z=()=>l.slice(D.index+1),W=(e="",t=0)=>{D.consumed+=e,D.index+=t},G=e=>{D.output+=null!=e.output?e.output:e.value,W(e.value)},V=()=>{let e=1;for(;"!"===U()&&("("!==U(2)||"?"===U(3));)q(),D.start++,e++;return e%2!=0&&(D.negated=!0,D.start++,!0)},Y=e=>{D[e]++,F.push(e)},Q=e=>{D[e]--,F.pop()},J=e=>{if("globstar"===z.type){const t=D.braces>0&&("comma"===e.type||"brace"===e.type),n=!0===e.extglob||j.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||n||(D.output=D.output.slice(0,-z.output.length),z.type="star",z.value="*",z.output=M,D.output+=z.output)}if(j.length&&"paren"!==e.type&&(j[j.length-1].inner+=e.value),(e.value||e.output)&&G(e),z&&"text"===z.type&&"text"===e.type)return z.value+=e.value,void(z.output=(z.output||"")+e.value);e.prev=z,g.push(e),z=e},X=(e,t)=>{const n={...b[t],conditions:1,inner:""};n.prev=z,n.parens=D.parens,n.output=D.output;const r=(p.capture?"(":"")+n.open;Y("parens"),J({type:e,value:t,output:D.output?"":k}),J({type:"paren",extglob:!0,value:q(),output:r}),j.push(n)},ee=e=>{let t,n=e.close+(p.capture?")":"");if("negate"===e.type){let r=M;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(r=L(p)),(r!==M||K()||/^\)+$/.test(Z()))&&(n=e.close=`)$))${r}`),e.inner.includes("*")&&(t=Z())&&/^\.[^\\/.]+$/.test(t)){const s=u(t,{...f,fastpaths:!1}).output;n=e.close=`)${s})${r})`}"bos"===e.prev.type&&(D.negatedExtglob=!0)}J({type:"paren",extglob:!0,value:B,output:n}),Q("parens")};if(!1!==p.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(l)){let e=!1,n=l.replace(i,(t,n,r,s,i,o)=>"\\"===s?(e=!0,t):"?"===s?n?n+s+(i?R.repeat(i.length):""):0===o?I+(i?R.repeat(i.length):""):R.repeat(r.length):"."===s?w.repeat(r.length):"*"===s?n?n+s+(i?M:""):M:n?t:`\\${t}`);return!0===e&&(n=!0===p.unescape?n.replace(/\\/g,""):n.replace(/\\+/g,e=>e.length%2==0?"\\\\":e?"\\":"")),n===l&&!0===p.contains?(D.output=l,D):(D.output=t.wrapOutput(n,D,f),D)}for(;!K();){if(B=q(),"\0"===B)continue;if("\\"===B){const e=U();if("/"===e&&!0!==p.bash)continue;if("."===e||";"===e)continue;if(!e){B+="\\",J({type:"text",value:B});continue}const t=/^\\+/.exec(Z());let n=0;if(t&&t[0].length>2&&(n=t[0].length,D.index+=n,n%2!=0&&(B+="\\")),!0===p.unescape?B=q():B+=q(),0===D.brackets){J({type:"text",value:B});continue}}if(D.brackets>0&&("]"!==B||"["===z.value||"[^"===z.value)){if(!1!==p.posix&&":"===B){const e=z.value.slice(1);if(e.includes("[")&&(z.posix=!0,e.includes(":"))){const e=z.value.lastIndexOf("["),t=z.value.slice(0,e),n=z.value.slice(e+2),s=r[n];if(s){z.value=t+s,D.backtrack=!0,q(),m.output||1!==g.indexOf(z)||(m.output=k);continue}}}("["===B&&":"!==U()||"-"===B&&"]"===U())&&(B=`\\${B}`),"]"!==B||"["!==z.value&&"[^"!==z.value||(B=`\\${B}`),!0===p.posix&&"!"===B&&"["===z.value&&(B="^"),z.value+=B,G({value:B});continue}if(1===D.quotes&&'"'!==B){B=t.escapeRegex(B),z.value+=B,G({value:B});continue}if('"'===B){D.quotes=1===D.quotes?0:1,!0===p.keepQuotes&&J({type:"text",value:B});continue}if("("===B){Y("parens"),J({type:"paren",value:B});continue}if(")"===B){if(0===D.parens&&!0===p.strictBrackets)throw new SyntaxError(c("opening","("));const e=j[j.length-1];if(e&&D.parens===e.parens+1){ee(j.pop());continue}J({type:"paren",value:B,output:D.parens?")":"\\)"}),Q("parens");continue}if("["===B){if(!0!==p.nobracket&&Z().includes("]"))Y("brackets");else{if(!0!==p.nobracket&&!0===p.strictBrackets)throw new SyntaxError(c("closing","]"));B=`\\${B}`}J({type:"bracket",value:B});continue}if("]"===B){if(!0===p.nobracket||z&&"bracket"===z.type&&1===z.value.length){J({type:"text",value:B,output:`\\${B}`});continue}if(0===D.brackets){if(!0===p.strictBrackets)throw new SyntaxError(c("opening","["));J({type:"text",value:B,output:`\\${B}`});continue}Q("brackets");const e=z.value.slice(1);if(!0===z.posix||"^"!==e[0]||e.includes("/")||(B=`/${B}`),z.value+=B,G({value:B}),!1===p.literalBrackets||t.hasRegexChars(e))continue;const n=t.escapeRegex(z.value);if(D.output=D.output.slice(0,-z.value.length),!0===p.literalBrackets){D.output+=n,z.value=n;continue}z.value=`(${y}${n}|${z.value})`,D.output+=z.value;continue}if("{"===B&&!0!==p.nobrace){Y("braces");const e={type:"brace",value:B,output:"(",outputIndex:D.output.length,tokensIndex:D.tokens.length};H.push(e),J(e);continue}if("}"===B){const e=H[H.length-1];if(!0===p.nobrace||!e){J({type:"text",value:B,output:B});continue}let t=")";if(!0===e.dots){const e=g.slice(),n=[];for(let t=e.length-1;t>=0&&(g.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&n.unshift(e[t].value);t=a(n,p),D.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const n=D.output.slice(0,e.outputIndex),r=D.tokens.slice(e.tokensIndex);e.value=e.output="\\{",B=t="\\}",D.output=n;for(const e of r)D.output+=e.output||e.value}J({type:"brace",value:B,output:t}),Q("braces"),H.pop();continue}if("|"===B){j.length>0&&j[j.length-1].conditions++,J({type:"text",value:B});continue}if(","===B){let e=B;const t=H[H.length-1];t&&"braces"===F[F.length-1]&&(t.comma=!0,e="|"),J({type:"comma",value:B,output:e});continue}if("/"===B){if("dot"===z.type&&D.index===D.start+1){D.start=D.index+1,D.consumed="",D.output="",g.pop(),z=m;continue}J({type:"slash",value:B,output:A});continue}if("."===B){if(D.braces>0&&"dot"===z.type){"."===z.value&&(z.output=w);const e=H[H.length-1];z.type="dots",z.output+=B,z.value+=B,e.dots=!0;continue}if(D.braces+D.parens===0&&"bos"!==z.type&&"slash"!==z.type){J({type:"text",value:B,output:w});continue}J({type:"dot",value:B,output:w});continue}if("?"===B){if((!z||"("!==z.value)&&!0!==p.noextglob&&"("===U()&&"?"!==U(2)){X("qmark",B);continue}if(z&&"paren"===z.type){const e=U();let n=B;if("<"===e&&!t.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");("("===z.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(Z()))&&(n=`\\${B}`),J({type:"text",value:B,output:n});continue}if(!0!==p.dot&&("slash"===z.type||"bos"===z.type)){J({type:"qmark",value:B,output:C});continue}J({type:"qmark",value:B,output:R});continue}if("!"===B){if(!0!==p.noextglob&&"("===U()&&("?"!==U(2)||!/[!=<:]/.test(U(3)))){X("negate",B);continue}if(!0!==p.nonegate&&0===D.index){V();continue}}if("+"===B){if(!0!==p.noextglob&&"("===U()&&"?"!==U(2)){X("plus",B);continue}if(z&&"("===z.value||!1===p.regex){J({type:"plus",value:B,output:S});continue}if(z&&("bracket"===z.type||"paren"===z.type||"brace"===z.type)||D.parens>0){J({type:"plus",value:B});continue}J({type:"plus",value:S});continue}if("@"===B){if(!0!==p.noextglob&&"("===U()&&"?"!==U(2)){J({type:"at",extglob:!0,value:B,output:""});continue}J({type:"text",value:B});continue}if("*"!==B){"$"!==B&&"^"!==B||(B=`\\${B}`);const e=s.exec(Z());e&&(B+=e[0],D.index+=e[0].length),J({type:"text",value:B});continue}if(z&&("globstar"===z.type||!0===z.star)){z.type="star",z.star=!0,z.value+=B,z.output=M,D.backtrack=!0,D.globstar=!0,W(B);continue}let e=Z();if(!0!==p.noextglob&&/^\([^?]/.test(e)){X("star",B);continue}if("star"===z.type){if(!0===p.noglobstar){W(B);continue}const t=z.prev,n=t.prev,r="slash"===t.type||"bos"===t.type,s=n&&("star"===n.type||"globstar"===n.type);if(!0===p.bash&&(!r||e[0]&&"/"!==e[0])){J({type:"star",value:B,output:""});continue}const i=D.braces>0&&("comma"===t.type||"brace"===t.type),o=j.length&&("pipe"===t.type||"paren"===t.type);if(!r&&"paren"!==t.type&&!i&&!o){J({type:"star",value:B,output:""});continue}for(;"/**"===e.slice(0,3);){const t=l[D.index+4];if(t&&"/"!==t)break;e=e.slice(3),W("/**",3)}if("bos"===t.type&&K()){z.type="globstar",z.value+=B,z.output=L(p),D.output=z.output,D.globstar=!0,W(B);continue}if("slash"===t.type&&"bos"!==t.prev.type&&!s&&K()){D.output=D.output.slice(0,-(t.output+z.output).length),t.output=`(?:${t.output}`,z.type="globstar",z.output=L(p)+(p.strictSlashes?")":"|$)"),z.value+=B,D.globstar=!0,D.output+=t.output+z.output,W(B);continue}if("slash"===t.type&&"bos"!==t.prev.type&&"/"===e[0]){const n=void 0!==e[1]?"|$":"";D.output=D.output.slice(0,-(t.output+z.output).length),t.output=`(?:${t.output}`,z.type="globstar",z.output=`${L(p)}${A}|${A}${n})`,z.value+=B,D.output+=t.output+z.output,D.globstar=!0,W(B+q()),J({type:"slash",value:"/",output:""});continue}if("bos"===t.type&&"/"===e[0]){z.type="globstar",z.value+=B,z.output=`(?:^|${A}|${L(p)}${A})`,D.output=z.output,D.globstar=!0,W(B+q()),J({type:"slash",value:"/",output:""});continue}D.output=D.output.slice(0,-z.output.length),z.type="globstar",z.output=L(p),z.value+=B,D.output+=z.output,D.globstar=!0,W(B);continue}const n={type:"star",value:B,output:M};!0!==p.bash?!z||"bracket"!==z.type&&"paren"!==z.type||!0!==p.regex?(D.index!==D.start&&"slash"!==z.type&&"dot"!==z.type||("dot"===z.type?(D.output+=$,z.output+=$):!0===p.dot?(D.output+=O,z.output+=O):(D.output+=N,z.output+=N),"*"!==U()&&(D.output+=k,z.output+=k)),J(n)):(n.output=B,J(n)):(n.output=".*?","bos"!==z.type&&"slash"!==z.type||(n.output=N+n.output),J(n))}for(;D.brackets>0;){if(!0===p.strictBrackets)throw new SyntaxError(c("closing","]"));D.output=t.escapeLast(D.output,"["),Q("brackets")}for(;D.parens>0;){if(!0===p.strictBrackets)throw new SyntaxError(c("closing",")"));D.output=t.escapeLast(D.output,"("),Q("parens")}for(;D.braces>0;){if(!0===p.strictBrackets)throw new SyntaxError(c("closing","}"));D.output=t.escapeLast(D.output,"{"),Q("braces")}if(!0===p.strictSlashes||"star"!==z.type&&"bracket"!==z.type||J({type:"maybe_slash",value:"",output:`${A}?`}),!0===D.backtrack){D.output="";for(const e of D.tokens)D.output+=null!=e.output?e.output:e.value,e.suffix&&(D.output+=e.suffix)}return D};return u.fastpaths=(r,s)=>{const i={...s},a="number"==typeof i.maxLength?Math.min(n,i.maxLength):n,c=r.length;if(c>a)throw new SyntaxError(`Input length: ${c}, exceeds maximum allowed length: ${a}`);r=o[r]||r;const u=t.isWindows(s),{DOT_LITERAL:l,SLASH_LITERAL:f,ONE_CHAR:p,DOTS_SLASH:h,NO_DOT:d,NO_DOTS:m,NO_DOTS_SLASH:g,STAR:y,START_ANCHOR:v}=e.globChars(u),_=i.dot?m:d,b=i.dot?g:d,w=i.capture?"":"?:";let S=!0===i.bash?".*?":y;i.capture&&(S=`(${S})`);const A=e=>!0===e.noglobstar?S:`(${w}(?:(?!${v}${e.dot?h:l}).)*?)`,k=e=>{switch(e){case"*":return`${_}${p}${S}`;case".*":return`${l}${p}${S}`;case"*.*":return`${_}${S}${l}${p}${S}`;case"*/*":return`${_}${S}${f}${p}${b}${S}`;case"**":return _+A(i);case"**/*":return`(?:${_}${A(i)}${f})?${b}${p}${S}`;case"**/*.*":return`(?:${_}${A(i)}${f})?${b}${S}${l}${p}${S}`;case"**/.*":return`(?:${_}${A(i)}${f})?${l}${p}${S}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const n=k(t[1]);if(!n)return;return n+l+t[2]}}},E=t.removePrefix(r,{negated:!1,prefix:""});let x=k(E);return x&&!0!==i.strictSlashes&&(x+=`${f}?`),x},Ml=u}(),r=Wl(),s=Zl(),i=(e,t,n=!1)=>{if(Array.isArray(e)){const r=e.map(e=>i(e,t,n)),s=e=>{for(const t of r){const n=t(e);if(n)return n}return!1};return s}const s=(o=e)&&"object"==typeof o&&!Array.isArray(o)&&e.tokens&&e.input;var o;if(""===e||"string"!=typeof e&&!s)throw new TypeError("Expected pattern to be a non-empty string");const a=t||{},c=r.isWindows(t),u=s?i.compileRe(e,t):i.makeRe(e,t,!1,!0),l=u.state;delete u.state;let f=()=>!1;if(a.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};f=i(a.ignore,e,n)}const p=(n,r=!1)=>{const{isMatch:s,match:o,output:p}=i.test(n,u,t,{glob:e,posix:c}),h={glob:e,state:l,regex:u,posix:c,input:n,output:p,match:o,isMatch:s};return"function"==typeof a.onResult&&a.onResult(h),!1===s?(h.isMatch=!1,!!r&&h):f(n)?("function"==typeof a.onIgnore&&a.onIgnore(h),h.isMatch=!1,!!r&&h):("function"==typeof a.onMatch&&a.onMatch(h),!r||h)};return n&&(p.state=l),p};return i.test=(e,t,n,{glob:s,posix:o}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};const a=n||{},c=a.format||(o?r.toPosixSlashes:null);let u=e===s,l=u&&c?c(e):e;return!1===u&&(l=c?c(e):e,u=l===s),!1!==u&&!0!==a.capture||(u=!0===a.matchBase||!0===a.basename?i.matchBase(e,t,n,o):t.exec(l)),{isMatch:Boolean(u),match:u,output:l}},i.matchBase=(t,n,s,o=r.isWindows(s))=>(n instanceof RegExp?n:i.makeRe(n,s)).test(e.basename(t)),i.isMatch=(e,t,n)=>i(t,n)(e),i.parse=(e,t)=>Array.isArray(e)?e.map(e=>i.parse(e,t)):n(e,{...t,fastpaths:!1}),i.scan=(e,n)=>t(e,n),i.compileRe=(e,t,n=!1,r=!1)=>{if(!0===n)return e.output;const s=t||{},o=s.contains?"":"^",a=s.contains?"":"$";let c=`${o}(?:${e.output})${a}`;e&&!0===e.negated&&(c=`^(?!${c}).*$`);const u=i.toRegex(c,t);return!0===r&&(u.state=e),u},i.makeRe=(e,t={},r=!1,s=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let o={negated:!1,fastpaths:!0};return!1===t.fastpaths||"."!==e[0]&&"*"!==e[0]||(o.output=n.fastpaths(e,t)),o.output||(o=n(e,t)),i.compileRe(o,t,r,s)},i.toRegex=(e,t)=>{try{const n=t||{};return new RegExp(e,n.flags||(n.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},i.constants=s,jl=i}function Vl(){return Bl?Fl:(Bl=1,Fl=Gl())}function Yl(){if(Ul)return tl;Ul=1,Object.defineProperty(tl,"__esModule",{value:!0}),tl.isAbsolute=tl.partitionAbsoluteAndRelative=tl.removeDuplicateSlashes=tl.matchAny=tl.convertPatternsToRe=tl.makeRe=tl.getPatternParts=tl.expandBraceExpansion=tl.expandPatternsWithBraceExpansion=tl.isAffectDepthOfReadingPattern=tl.endsWithSlashGlobStar=tl.hasGlobStar=tl.getBaseDirectory=tl.isPatternRelatedToParentDirectory=tl.getPatternsOutsideCurrentDirectory=tl.getPatternsInsideCurrentDirectory=tl.getPositivePatterns=tl.getNegativePatterns=tl.isPositivePattern=tl.isNegativePattern=tl.convertToNegativePattern=tl.convertToPositivePattern=tl.isDynamicPattern=tl.isStaticPattern=void 0;const e=$,t=function(){if(el)return Xu;el=1;var e=rl(),t=$.posix.dirname,n="win32"===x.platform(),r=/\\/g,s=/[\{\[].*[\}\]]$/,i=/(^|[^\\])([\{\[]|\([^\)]+$)/,o=/\\([\!\*\?\|\[\]\(\)\{\}])/g;return Xu=function(a,c){Object.assign({flipBackslashes:!0},c).flipBackslashes&&n&&a.indexOf("/")<0&&(a=a.replace(r,"/")),s.test(a)&&(a+="/"),a+="a";do{a=t(a)}while(e(a)||i.test(a));return a.replace(o,"$1")}}(),n=function(){if(Kl)return zl;Kl=1;const e=O,t=Cl(),n=Vl(),r=Wl(),s=e=>""===e||"./"===e,i=e=>{const t=e.indexOf("{");return t>-1&&e.indexOf("}",t)>-1},o=(e,t,r)=>{t=[].concat(t),e=[].concat(e);let s=new Set,i=new Set,o=new Set,a=0,c=e=>{o.add(e.output),r&&r.onResult&&r.onResult(e)};for(let o=0;o<t.length;o++){let u=n(String(t[o]),{...r,onResult:c},!0),l=u.state.negated||u.state.negatedExtglob;l&&a++;for(let t of e){let e=u(t,!0);(l?!e.isMatch:e.isMatch)&&(l?s.add(e.output):(s.delete(e.output),i.add(e.output)))}}let u=(a===t.length?[...o]:[...i]).filter(e=>!s.has(e));if(r&&0===u.length){if(!0===r.failglob)throw new Error(`No matches found for "${t.join(", ")}"`);if(!0===r.nonull||!0===r.nullglob)return r.unescape?t.map(e=>e.replace(/\\/g,"")):t}return u};return o.match=o,o.matcher=(e,t)=>n(e,t),o.any=o.isMatch=(e,t,r)=>n(t,r)(e),o.not=(e,t,n={})=>{t=[].concat(t).map(String);let r=new Set,s=[],i=new Set(o(e,t,{...n,onResult:e=>{n.onResult&&n.onResult(e),s.push(e.output)}}));for(let e of s)i.has(e)||r.add(e);return[...r]},o.contains=(t,n,r)=>{if("string"!=typeof t)throw new TypeError(`Expected a string: "${e.inspect(t)}"`);if(Array.isArray(n))return n.some(e=>o.contains(t,e,r));if("string"==typeof n){if(s(t)||s(n))return!1;if(t.includes(n)||t.startsWith("./")&&t.slice(2).includes(n))return!0}return o.isMatch(t,n,{...r,contains:!0})},o.matchKeys=(e,t,n)=>{if(!r.isObject(e))throw new TypeError("Expected the first argument to be an object");let s=o(Object.keys(e),t,n),i={};for(let t of s)i[t]=e[t];return i},o.some=(e,t,r)=>{let s=[].concat(e);for(let e of[].concat(t)){let t=n(String(e),r);if(s.some(e=>t(e)))return!0}return!1},o.every=(e,t,r)=>{let s=[].concat(e);for(let e of[].concat(t)){let t=n(String(e),r);if(!s.every(e=>t(e)))return!1}return!0},o.all=(t,r,s)=>{if("string"!=typeof t)throw new TypeError(`Expected a string: "${e.inspect(t)}"`);return[].concat(r).every(e=>n(e,s)(t))},o.capture=(e,t,s)=>{let i=r.isWindows(s),o=n.makeRe(String(e),{...s,capture:!0}).exec(i?r.toPosixSlashes(t):t);if(o)return o.slice(1).map(e=>void 0===e?"":e)},o.makeRe=(...e)=>n.makeRe(...e),o.scan=(...e)=>n.scan(...e),o.parse=(e,r)=>{let s=[];for(let i of[].concat(e||[]))for(let e of t(String(i),r))s.push(n.parse(e,r));return s},o.braces=(e,n)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return n&&!0===n.nobrace||!i(e)?[e]:t(e,n)},o.braceExpand=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return o.braces(e,{...t,expand:!0})},o.hasBraces=i,zl=o}(),r=/[*?]|^!/,s=/\[[^[]*]/,i=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,o=/[!*+?@]\([^(]*\)/,a=/,|\.\./,c=/(?!^)\/{2,}/g;function u(e,t={}){return!l(e,t)}function l(e,t={}){return""!==e&&(!(!1!==t.caseSensitiveMatch&&!e.includes("\\"))||(!!(r.test(e)||s.test(e)||i.test(e))||(!(!1===t.extglob||!o.test(e))||!(!1===t.braceExpansion||!function(e){const t=e.indexOf("{");if(-1===t)return!1;const n=e.indexOf("}",t+1);if(-1===n)return!1;const r=e.slice(t,n);return a.test(r)}(e)))))}function f(e){return e.startsWith("!")&&"("!==e[1]}function p(e){return!f(e)}function h(e){return e.startsWith("..")||e.startsWith("./..")}function d(e){return e.endsWith("/**")}function m(e){const t=n.braces(e,{expand:!0,nodupes:!0,keepEscaping:!0});return t.sort((e,t)=>e.length-t.length),t.filter(e=>""!==e)}function g(e,t){return n.makeRe(e,t)}function y(t){return e.isAbsolute(t)}return tl.isStaticPattern=u,tl.isDynamicPattern=l,tl.convertToPositivePattern=function(e){return f(e)?e.slice(1):e},tl.convertToNegativePattern=function(e){return"!"+e},tl.isNegativePattern=f,tl.isPositivePattern=p,tl.getNegativePatterns=function(e){return e.filter(f)},tl.getPositivePatterns=function(e){return e.filter(p)},tl.getPatternsInsideCurrentDirectory=function(e){return e.filter(e=>!h(e))},tl.getPatternsOutsideCurrentDirectory=function(e){return e.filter(h)},tl.isPatternRelatedToParentDirectory=h,tl.getBaseDirectory=function(e){return t(e,{flipBackslashes:!1})},tl.hasGlobStar=function(e){return e.includes("**")},tl.endsWithSlashGlobStar=d,tl.isAffectDepthOfReadingPattern=function(t){const n=e.basename(t);return d(t)||u(n)},tl.expandPatternsWithBraceExpansion=function(e){return e.reduce((e,t)=>e.concat(m(t)),[])},tl.expandBraceExpansion=m,tl.getPatternParts=function(e,t){let{parts:r}=n.scan(e,Object.assign(Object.assign({},t),{parts:!0}));return 0===r.length&&(r=[e]),r[0].startsWith("/")&&(r[0]=r[0].slice(1),r.unshift("")),r},tl.makeRe=g,tl.convertPatternsToRe=function(e,t){return e.map(e=>g(e,t))},tl.matchAny=function(e,t){return t.some(t=>t.test(e))},tl.removeDuplicateSlashes=function(e){return e.replace(c,"/")},tl.partitionAbsoluteAndRelative=function(e){const t=[],n=[];for(const r of e)y(r)?t.push(r):n.push(r);return[t,n]},tl.isAbsolute=y,tl}var Ql,Jl,Xl,ef={};function tf(){if(Jl)return Ql;Jl=1;const e=R.PassThrough,t=Array.prototype.slice;function n(t,r){if(Array.isArray(t))for(let e=0,s=t.length;e<s;e++)t[e]=n(t[e],r);else{if(!t._readableState&&t.pipe&&(t=t.pipe(e(r))),!t._readableState||!t.pause||!t.pipe)throw new Error("Only readable stream can be merged.");t.pause()}return t}return Ql=function(){const r=[],s=t.call(arguments);let i=!1,o=s[s.length-1];o&&!Array.isArray(o)&&null==o.pipe?s.pop():o={};const a=!1!==o.end,c=!0===o.pipeError;null==o.objectMode&&(o.objectMode=!0);null==o.highWaterMark&&(o.highWaterMark=65536);const u=e(o);function l(){for(let e=0,t=arguments.length;e<t;e++)r.push(n(arguments[e],o));return f(),this}function f(){if(i)return;i=!0;let e=r.shift();if(!e)return void process.nextTick(p);Array.isArray(e)||(e=[e]);let t=e.length+1;function n(){--t>0||(i=!1,f())}function s(e){function t(){e.removeListener("merge2UnpipeEnd",t),e.removeListener("end",t),c&&e.removeListener("error",r),n()}function r(e){u.emit("error",e)}if(e._readableState.endEmitted)return n();e.on("merge2UnpipeEnd",t),e.on("end",t),c&&e.on("error",r),e.pipe(u,{end:!1}),e.resume()}for(let t=0;t<e.length;t++)s(e[t]);n()}function p(){i=!1,u.emit("queueDrain"),a&&u.end()}u.setMaxListeners(0),u.add=l,u.on("unpipe",function(e){e.emit("merge2UnpipeEnd")}),s.length&&l.apply(null,s);return u},Ql}var nf,rf,sf,of={};function af(){if(nf)return of;return nf=1,Object.defineProperty(of,"__esModule",{value:!0}),of.isEmpty=of.isString=void 0,of.isString=function(e){return"string"==typeof e},of.isEmpty=function(e){return""===e},of}function cf(){if(rf)return ju;rf=1,Object.defineProperty(ju,"__esModule",{value:!0}),ju.string=ju.stream=ju.pattern=ju.path=ju.fs=ju.errno=ju.array=void 0;const e=Fu();ju.array=e;const t=Ku();ju.errno=t;const n=function(){if(Uu)return qu;Uu=1,Object.defineProperty(qu,"__esModule",{value:!0}),qu.createDirentFromStats=void 0;class e{constructor(e,t){this.name=e,this.isBlockDevice=t.isBlockDevice.bind(t),this.isCharacterDevice=t.isCharacterDevice.bind(t),this.isDirectory=t.isDirectory.bind(t),this.isFIFO=t.isFIFO.bind(t),this.isFile=t.isFile.bind(t),this.isSocket=t.isSocket.bind(t),this.isSymbolicLink=t.isSymbolicLink.bind(t)}}return qu.createDirentFromStats=function(t,n){return new e(t,n)},qu}();ju.fs=n;const r=Gu();ju.path=r;const s=Yl();ju.pattern=s;const i=function(){if(Xl)return ef;Xl=1,Object.defineProperty(ef,"__esModule",{value:!0}),ef.merge=void 0;const e=tf();function t(e){e.forEach(e=>e.emit("close"))}return ef.merge=function(n){const r=e(n);return n.forEach(e=>{e.once("error",e=>r.emit("error",e))}),r.once("close",()=>t(n)),r.once("end",()=>t(n)),r},ef}();ju.stream=i;const o=af();return ju.string=o,ju}var uf,lf={},ff={},pf={},hf={},df={},mf={},gf={},yf={},vf={};function _f(){if(uf)return vf;function e(e,t){e(t)}function t(e,t){e(null,t)}return uf=1,Object.defineProperty(vf,"__esModule",{value:!0}),vf.read=void 0,vf.read=function(n,r,s){r.fs.lstat(n,(i,o)=>{null===i?o.isSymbolicLink()&&r.followSymbolicLink?r.fs.stat(n,(n,i)=>{if(null!==n)return r.throwErrorOnBrokenSymbolicLink?void e(s,n):void t(s,o);r.markSymbolicLink&&(i.isSymbolicLink=()=>!0),t(s,i)}):t(s,o):e(s,i)})},vf}var bf,wf={};var Sf,Af,kf,Ef,xf,$f,Of,Rf={},Cf={};function Tf(){if(Af)return Rf;Af=1,Object.defineProperty(Rf,"__esModule",{value:!0});const e=(Sf||(Sf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createFileSystemAdapter=e.FILE_SYSTEM_ADAPTER=void 0;const t=T;e.FILE_SYSTEM_ADAPTER={lstat:t.lstat,stat:t.stat,lstatSync:t.lstatSync,statSync:t.statSync},e.createFileSystemAdapter=function(t){return void 0===t?e.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},e.FILE_SYSTEM_ADAPTER),t)}}(Cf)),Cf);return Rf.default=class{constructor(t={}){this._options=t,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=e.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(e,t){return null!=e?e:t}},Rf}function Pf(){if(kf)return yf;kf=1,Object.defineProperty(yf,"__esModule",{value:!0}),yf.statSync=yf.stat=yf.Settings=void 0;const e=_f(),t=(bf||(bf=1,Object.defineProperty(wf,"__esModule",{value:!0}),wf.read=void 0,wf.read=function(e,t){const n=t.fs.lstatSync(e);if(!n.isSymbolicLink()||!t.followSymbolicLink)return n;try{const n=t.fs.statSync(e);return t.markSymbolicLink&&(n.isSymbolicLink=()=>!0),n}catch(e){if(!t.throwErrorOnBrokenSymbolicLink)return n;throw e}}),wf),n=Tf();function r(e={}){return e instanceof n.default?e:new n.default(e)}return yf.Settings=n.default,yf.stat=function(t,n,s){"function"!=typeof n?e.read(t,r(n),s):e.read(t,r(),n)},yf.statSync=function(e,n){const s=r(n);return t.read(e,s)},yf}function Lf(){if(xf)return Ef;let e;return xf=1,Ef="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:B):t=>(e||(e=Promise.resolve())).then(t).catch(e=>setTimeout(()=>{throw e},0))}var Nf,If={};function Mf(){if(Nf)return If;Nf=1,Object.defineProperty(If,"__esModule",{value:!0}),If.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;const e=process.versions.node.split(".");if(void 0===e[0]||void 0===e[1])throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);const t=Number.parseInt(e[0],10),n=Number.parseInt(e[1],10),r=t>10,s=10===t&&n>=10;return If.IS_SUPPORT_READDIR_WITH_FILE_TYPES=r||s,If}var Df,jf,Hf={},Ff={};function Bf(){if(jf)return Hf;jf=1,Object.defineProperty(Hf,"__esModule",{value:!0}),Hf.fs=void 0;const e=function(){if(Df)return Ff;Df=1,Object.defineProperty(Ff,"__esModule",{value:!0}),Ff.createDirentFromStats=void 0;class e{constructor(e,t){this.name=e,this.isBlockDevice=t.isBlockDevice.bind(t),this.isCharacterDevice=t.isCharacterDevice.bind(t),this.isDirectory=t.isDirectory.bind(t),this.isFIFO=t.isFIFO.bind(t),this.isFile=t.isFile.bind(t),this.isSocket=t.isSocket.bind(t),this.isSymbolicLink=t.isSymbolicLink.bind(t)}}return Ff.createDirentFromStats=function(t,n){return new e(t,n)},Ff}();return Hf.fs=e,Hf}var zf,Kf,Uf={};function qf(){if(zf)return Uf;return zf=1,Object.defineProperty(Uf,"__esModule",{value:!0}),Uf.joinPathSegments=void 0,Uf.joinPathSegments=function(e,t,n){return e.endsWith(n)?e+t:e+n+t},Uf}function Zf(){if(Kf)return gf;Kf=1,Object.defineProperty(gf,"__esModule",{value:!0}),gf.readdir=gf.readdirWithFileTypes=gf.read=void 0;const e=Pf(),t=function(){if(Of)return $f;Of=1,$f=function(t,n){let r,s,i,o=!0;function a(t){function s(){n&&n(t,r),n=null}o?e(s):s()}function c(e,t,n){r[e]=n,(0===--s||t)&&a(t)}Array.isArray(t)?(r=[],s=t.length):(i=Object.keys(t),r={},s=i.length),s?i?i.forEach(function(e){t[e](function(t,n){c(e,t,n)})}):t.forEach(function(e,t){e(function(e,n){c(t,e,n)})}):a(null),o=!1};const e=Lf();return $f}(),n=Mf(),r=Bf(),s=qf();function i(e,n,i){n.fs.readdir(e,{withFileTypes:!0},(o,u)=>{if(null!==o)return void a(i,o);const l=u.map(t=>({dirent:t,name:t.name,path:s.joinPathSegments(e,t.name,n.pathSegmentSeparator)}));if(!n.followSymbolicLinks)return void c(i,l);const f=l.map(e=>function(e,t){return n=>{e.dirent.isSymbolicLink()?t.fs.stat(e.path,(s,i)=>{if(null!==s)return t.throwErrorOnBrokenSymbolicLink?void n(s):void n(null,e);e.dirent=r.fs.createDirentFromStats(e.name,i),n(null,e)}):n(null,e)}}(e,n));t(f,(e,t)=>{null===e?c(i,t):a(i,e)})})}function o(n,i,o){i.fs.readdir(n,(u,l)=>{if(null!==u)return void a(o,u);const f=l.map(t=>{const o=s.joinPathSegments(n,t,i.pathSegmentSeparator);return n=>{e.stat(o,i.fsStatSettings,(e,s)=>{if(null!==e)return void n(e);const a={name:t,path:o,dirent:r.fs.createDirentFromStats(t,s)};i.stats&&(a.stats=s),n(null,a)})}});t(f,(e,t)=>{null===e?c(o,t):a(o,e)})})}function a(e,t){e(t)}function c(e,t){e(null,t)}return gf.read=function(e,t,r){t.stats||!n.IS_SUPPORT_READDIR_WITH_FILE_TYPES?o(e,t,r):i(e,t,r)},gf.readdirWithFileTypes=i,gf.readdir=o,gf}var Wf,Gf={};var Vf,Yf,Qf,Jf={},Xf={};function ep(){return Vf||(Vf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createFileSystemAdapter=e.FILE_SYSTEM_ADAPTER=void 0;const t=T;e.FILE_SYSTEM_ADAPTER={lstat:t.lstat,stat:t.stat,lstatSync:t.lstatSync,statSync:t.statSync,readdir:t.readdir,readdirSync:t.readdirSync},e.createFileSystemAdapter=function(t){return void 0===t?e.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},e.FILE_SYSTEM_ADAPTER),t)}}(Xf)),Xf}function tp(){if(Qf)return mf;Qf=1,Object.defineProperty(mf,"__esModule",{value:!0}),mf.Settings=mf.scandirSync=mf.scandir=void 0;const e=Zf(),t=function(){if(Wf)return Gf;Wf=1,Object.defineProperty(Gf,"__esModule",{value:!0}),Gf.readdir=Gf.readdirWithFileTypes=Gf.read=void 0;const e=Pf(),t=Mf(),n=Bf(),r=qf();function s(e,t){return t.fs.readdirSync(e,{withFileTypes:!0}).map(s=>{const i={dirent:s,name:s.name,path:r.joinPathSegments(e,s.name,t.pathSegmentSeparator)};if(i.dirent.isSymbolicLink()&&t.followSymbolicLinks)try{const e=t.fs.statSync(i.path);i.dirent=n.fs.createDirentFromStats(i.name,e)}catch(e){if(t.throwErrorOnBrokenSymbolicLink)throw e}return i})}function i(t,s){return s.fs.readdirSync(t).map(i=>{const o=r.joinPathSegments(t,i,s.pathSegmentSeparator),a=e.statSync(o,s.fsStatSettings),c={name:i,path:o,dirent:n.fs.createDirentFromStats(i,a)};return s.stats&&(c.stats=a),c})}return Gf.read=function(e,n){return!n.stats&&t.IS_SUPPORT_READDIR_WITH_FILE_TYPES?s(e,n):i(e,n)},Gf.readdirWithFileTypes=s,Gf.readdir=i,Gf}(),n=function(){if(Yf)return Jf;Yf=1,Object.defineProperty(Jf,"__esModule",{value:!0});const e=$,t=Pf(),n=ep();return Jf.default=class{constructor(r={}){this._options=r,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=n.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,e.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new t.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(e,t){return null!=e?e:t}},Jf}();function r(e={}){return e instanceof n.default?e:new n.default(e)}return mf.Settings=n.default,mf.scandir=function(t,n,s){"function"!=typeof n?e.read(t,r(n),s):e.read(t,r(),n)},mf.scandirSync=function(e,n){const s=r(n);return t.read(e,s)},mf}var np,rp,sp,ip={exports:{}};function op(){if(sp)return ip.exports;sp=1;var e=rp?np:(rp=1,np=function(e){var t=new e,n=t;return{get:function(){var r=t;return r.next?t=r.next:(t=new e,n=t),r.next=null,r},release:function(e){n.next=e,n=e}}});function t(t,s,i){if("function"==typeof t&&(i=s,s=t,t=null),!(i>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");var o=e(r),a=null,c=null,u=0,l=null,f={push:function(e,r){var h=o.get();h.context=t,h.release=p,h.value=e,h.callback=r||n,h.errorHandler=l,u>=i||f.paused?c?(c.next=h,c=h):(a=h,c=h,f.saturated()):(u++,s.call(t,h.value,h.worked))},drain:n,saturated:n,pause:function(){f.paused=!0},paused:!1,get concurrency(){return i},set concurrency(e){if(!(e>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(i=e,!f.paused)for(;a&&u<i;)u++,p()},running:function(){return u},resume:function(){if(!f.paused)return;if(f.paused=!1,null===a)return u++,void p();for(;a&&u<i;)u++,p()},idle:function(){return 0===u&&0===f.length()},length:function(){var e=a,t=0;for(;e;)e=e.next,t++;return t},getQueue:function(){var e=a,t=[];for(;e;)t.push(e.value),e=e.next;return t},unshift:function(e,r){var h=o.get();h.context=t,h.release=p,h.value=e,h.callback=r||n,h.errorHandler=l,u>=i||f.paused?a?(h.next=a,a=h):(a=h,c=h,f.saturated()):(u++,s.call(t,h.value,h.worked))},empty:n,kill:function(){a=null,c=null,f.drain=n},killAndDrain:function(){a=null,c=null,f.drain(),f.drain=n},error:function(e){l=e}};return f;function p(e){e&&o.release(e);var n=a;n&&u<=i?f.paused?u--:(c===a&&(c=null),a=n.next,n.next=null,s.call(t,n.value,n.worked),null===c&&f.empty()):0===--u&&f.drain()}}function n(){}function r(){this.value=null,this.callback=n,this.next=null,this.release=n,this.context=null,this.errorHandler=null;var e=this;this.worked=function(t,r){var s=e.callback,i=e.errorHandler,o=e.value;e.value=null,e.callback=n,e.errorHandler&&i(t,o),s.call(e.context,t,r),e.release(e)}}return ip.exports=t,ip.exports.promise=function(e,r,s){"function"==typeof e&&(s=r,r=e,e=null);var i=t(e,function(e,t){r.call(this,e).then(function(e){t(null,e)},t)},s),o=i.push,a=i.unshift;return i.push=function(e){var t=new Promise(function(t,n){o(e,function(e,r){e?n(e):t(r)})});return t.catch(n),t},i.unshift=function(e){var t=new Promise(function(t,n){a(e,function(e,r){e?n(e):t(r)})});return t.catch(n),t},i.drained=function(){var e=new Promise(function(e){process.nextTick(function(){if(i.idle())e();else{var t=i.drain;i.drain=function(){"function"==typeof t&&t(),e(),i.drain=t}}})});return e},i},ip.exports}var ap,cp={};function up(){if(ap)return cp;return ap=1,Object.defineProperty(cp,"__esModule",{value:!0}),cp.joinPathSegments=cp.replacePathSegmentSeparator=cp.isAppliedFilter=cp.isFatalError=void 0,cp.isFatalError=function(e,t){return null===e.errorFilter||!e.errorFilter(t)},cp.isAppliedFilter=function(e,t){return null===e||e(t)},cp.replacePathSegmentSeparator=function(e,t){return e.split(/[/\\]/).join(t)},cp.joinPathSegments=function(e,t,n){return""===e?t:e.endsWith(n)?e+t:e+n+t},cp}var lp,fp,pp,hp={};function dp(){if(lp)return hp;lp=1,Object.defineProperty(hp,"__esModule",{value:!0});const e=up();return hp.default=class{constructor(t,n){this._root=t,this._settings=n,this._root=e.replacePathSegmentSeparator(t,n.pathSegmentSeparator)}},hp}function mp(){if(fp)return df;fp=1,Object.defineProperty(df,"__esModule",{value:!0});const e=C,t=tp(),n=op(),r=up(),s=dp();class i extends s.default{constructor(r,s){super(r,s),this._settings=s,this._scandir=t.scandir,this._emitter=new e.EventEmitter,this._queue=n(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit("end")}}read(){return this._isFatalError=!1,this._isDestroyed=!1,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw new Error("The reader is already destroyed");this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(e){this._emitter.on("entry",e)}onError(e){this._emitter.once("error",e)}onEnd(e){this._emitter.once("end",e)}_pushToQueue(e,t){const n={directory:e,base:t};this._queue.push(n,e=>{null!==e&&this._handleError(e)})}_worker(e,t){this._scandir(e.directory,this._settings.fsScandirSettings,(n,r)=>{if(null===n){for(const t of r)this._handleEntry(t,e.base);t(null,void 0)}else t(n,void 0)})}_handleError(e){!this._isDestroyed&&r.isFatalError(this._settings,e)&&(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit("error",e))}_handleEntry(e,t){if(this._isDestroyed||this._isFatalError)return;const n=e.path;void 0!==t&&(e.path=r.joinPathSegments(t,e.name,this._settings.pathSegmentSeparator)),r.isAppliedFilter(this._settings.entryFilter,e)&&this._emitEntry(e),e.dirent.isDirectory()&&r.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,void 0===t?void 0:e.path)}_emitEntry(e){this._emitter.emit("entry",e)}}return df.default=i,df}var gp,yp={};var vp,_p,bp={},wp={};function Sp(){if(_p)return bp;_p=1,Object.defineProperty(bp,"__esModule",{value:!0});const e=function(){if(vp)return wp;vp=1,Object.defineProperty(wp,"__esModule",{value:!0});const e=tp(),t=up(),n=dp();class r extends n.default{constructor(){super(...arguments),this._scandir=e.scandirSync,this._storage=[],this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),this._storage}_pushToQueue(e,t){this._queue.add({directory:e,base:t})}_handleQueue(){for(const e of this._queue.values())this._handleDirectory(e.directory,e.base)}_handleDirectory(e,t){try{const n=this._scandir(e,this._settings.fsScandirSettings);for(const e of n)this._handleEntry(e,t)}catch(e){this._handleError(e)}}_handleError(e){if(t.isFatalError(this._settings,e))throw e}_handleEntry(e,n){const r=e.path;void 0!==n&&(e.path=t.joinPathSegments(n,e.name,this._settings.pathSegmentSeparator)),t.isAppliedFilter(this._settings.entryFilter,e)&&this._pushToStorage(e),e.dirent.isDirectory()&&t.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(r,void 0===n?void 0:e.path)}_pushToStorage(e){this._storage.push(e)}}return wp.default=r,wp}();return bp.default=class{constructor(t,n){this._root=t,this._settings=n,this._reader=new e.default(this._root,this._settings)}read(){return this._reader.read()}},bp}var Ap,kp,Ep={};function xp(){if(kp)return pf;kp=1,Object.defineProperty(pf,"__esModule",{value:!0}),pf.Settings=pf.walkStream=pf.walkSync=pf.walk=void 0;const e=function(){if(pp)return hf;pp=1,Object.defineProperty(hf,"__esModule",{value:!0});const e=mp();return hf.default=class{constructor(t,n){this._root=t,this._settings=n,this._reader=new e.default(this._root,this._settings),this._storage=[]}read(e){this._reader.onError(t=>{!function(e,t){e(t)}(e,t)}),this._reader.onEntry(e=>{this._storage.push(e)}),this._reader.onEnd(()=>{!function(e,t){e(null,t)}(e,this._storage)}),this._reader.read()}},hf}(),t=function(){if(gp)return yp;gp=1,Object.defineProperty(yp,"__esModule",{value:!0});const e=R,t=mp();return yp.default=class{constructor(n,r){this._root=n,this._settings=r,this._reader=new t.default(this._root,this._settings),this._stream=new e.Readable({objectMode:!0,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy()}})}read(){return this._reader.onError(e=>{this._stream.emit("error",e)}),this._reader.onEntry(e=>{this._stream.push(e)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}},yp}(),n=Sp(),r=function(){if(Ap)return Ep;Ap=1,Object.defineProperty(Ep,"__esModule",{value:!0});const e=$,t=tp();return Ep.default=class{constructor(n={}){this._options=n,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,Number.POSITIVE_INFINITY),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,e.sep),this.fsScandirSettings=new t.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(e,t){return null!=e?e:t}},Ep}();function s(e={}){return e instanceof r.default?e:new r.default(e)}return pf.Settings=r.default,pf.walk=function(t,n,r){"function"!=typeof n?new e.default(t,s(n)).read(r):new e.default(t,s()).read(n)},pf.walkSync=function(e,t){const r=s(t);return new n.default(e,r).read()},pf.walkStream=function(e,n){const r=s(n);return new t.default(e,r).read()},pf}var $p,Op={};function Rp(){if($p)return Op;$p=1,Object.defineProperty(Op,"__esModule",{value:!0});const e=$,t=Pf(),n=cf();return Op.default=class{constructor(e){this._settings=e,this._fsStatSettings=new t.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(t){return e.resolve(this._settings.cwd,t)}_makeEntry(e,t){const r={name:t,path:t,dirent:n.fs.createDirentFromStats(t,e)};return this._settings.stats&&(r.stats=e),r}_isFatalError(e){return!n.errno.isEnoentCodeError(e)&&!this._settings.suppressErrors}},Op}var Cp,Tp,Pp={};function Lp(){if(Cp)return Pp;Cp=1,Object.defineProperty(Pp,"__esModule",{value:!0});const e=R,t=Pf(),n=xp(),r=Rp();class s extends r.default{constructor(){super(...arguments),this._walkStream=n.walkStream,this._stat=t.stat}dynamic(e,t){return this._walkStream(e,t)}static(t,n){const r=t.map(this._getFullEntryPath,this),s=new e.PassThrough({objectMode:!0});s._write=(e,i,o)=>this._getEntry(r[e],t[e],n).then(t=>{null!==t&&n.entryFilter(t)&&s.push(t),e===r.length-1&&s.end(),o()}).catch(o);for(let e=0;e<r.length;e++)s.write(e);return s}_getEntry(e,t,n){return this._getStat(e).then(e=>this._makeEntry(e,t)).catch(e=>{if(n.errorFilter(e))return null;throw e})}_getStat(e){return new Promise((t,n)=>{this._stat(e,this._fsStatSettings,(e,r)=>null===e?t(r):n(e))})}}return Pp.default=s,Pp}var Np,Ip,Mp,Dp={},jp={},Hp={},Fp={};function Bp(){if(Ip)return Hp;Ip=1,Object.defineProperty(Hp,"__esModule",{value:!0});const e=function(){if(Np)return Fp;Np=1,Object.defineProperty(Fp,"__esModule",{value:!0});const e=cf();return Fp.default=class{constructor(e,t,n){this._patterns=e,this._settings=t,this._micromatchOptions=n,this._storage=[],this._fillStorage()}_fillStorage(){for(const e of this._patterns){const t=this._getPatternSegments(e),n=this._splitSegmentsIntoSections(t);this._storage.push({complete:n.length<=1,pattern:e,segments:t,sections:n})}}_getPatternSegments(t){return e.pattern.getPatternParts(t,this._micromatchOptions).map(t=>e.pattern.isDynamicPattern(t,this._settings)?{dynamic:!0,pattern:t,patternRe:e.pattern.makeRe(t,this._micromatchOptions)}:{dynamic:!1,pattern:t})}_splitSegmentsIntoSections(t){return e.array.splitWhen(t,t=>t.dynamic&&e.pattern.hasGlobStar(t.pattern))}},Fp}();class t extends e.default{match(e){const t=e.split("/"),n=t.length,r=this._storage.filter(e=>!e.complete||e.segments.length>n);for(const e of r){const r=e.sections[0];if(!e.complete&&n>r.length)return!0;if(t.every((t,n)=>{const r=e.segments[n];return!(!r.dynamic||!r.patternRe.test(t))||!r.dynamic&&r.pattern===t}))return!0}return!1}}return Hp.default=t,Hp}var zp,Kp={};var Up,qp={};var Zp,Wp,Gp,Vp={};function Yp(){if(Wp)return Dp;Wp=1,Object.defineProperty(Dp,"__esModule",{value:!0});const e=$,t=function(){if(Mp)return jp;Mp=1,Object.defineProperty(jp,"__esModule",{value:!0});const e=cf(),t=Bp();return jp.default=class{constructor(e,t){this._settings=e,this._micromatchOptions=t}getFilter(e,t,n){const r=this._getMatcher(t),s=this._getNegativePatternsRe(n);return t=>this._filter(e,t,r,s)}_getMatcher(e){return new t.default(e,this._settings,this._micromatchOptions)}_getNegativePatternsRe(t){const n=t.filter(e.pattern.isAffectDepthOfReadingPattern);return e.pattern.convertPatternsToRe(n,this._micromatchOptions)}_filter(t,n,r,s){if(this._isSkippedByDeep(t,n.path))return!1;if(this._isSkippedSymbolicLink(n))return!1;const i=e.path.removeLeadingDotSegment(n.path);return!this._isSkippedByPositivePatterns(i,r)&&this._isSkippedByNegativePatterns(i,s)}_isSkippedByDeep(e,t){return this._settings.deep!==1/0&&this._getEntryLevel(e,t)>=this._settings.deep}_getEntryLevel(e,t){const n=t.split("/").length;return""===e?n:n-e.split("/").length}_isSkippedSymbolicLink(e){return!this._settings.followSymbolicLinks&&e.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(e,t){return!this._settings.baseNameMatch&&!t.match(e)}_isSkippedByNegativePatterns(t,n){return!e.pattern.matchAny(t,n)}},jp}(),n=function(){if(zp)return Kp;zp=1,Object.defineProperty(Kp,"__esModule",{value:!0});const e=cf();return Kp.default=class{constructor(e,t){this._settings=e,this._micromatchOptions=t,this.index=new Map}getFilter(t,n){const[r,s]=e.pattern.partitionAbsoluteAndRelative(n),i={positive:{all:e.pattern.convertPatternsToRe(t,this._micromatchOptions)},negative:{absolute:e.pattern.convertPatternsToRe(r,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:e.pattern.convertPatternsToRe(s,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return e=>this._filter(e,i)}_filter(t,n){const r=e.path.removeLeadingDotSegment(t.path);if(this._settings.unique&&this._isDuplicateEntry(r))return!1;if(this._onlyFileFilter(t)||this._onlyDirectoryFilter(t))return!1;const s=this._isMatchToPatternsSet(r,n,t.dirent.isDirectory());return this._settings.unique&&s&&this._createIndexRecord(r),s}_isDuplicateEntry(e){return this.index.has(e)}_createIndexRecord(e){this.index.set(e,void 0)}_onlyFileFilter(e){return this._settings.onlyFiles&&!e.dirent.isFile()}_onlyDirectoryFilter(e){return this._settings.onlyDirectories&&!e.dirent.isDirectory()}_isMatchToPatternsSet(e,t,n){return!!this._isMatchToPatterns(e,t.positive.all,n)&&(!this._isMatchToPatterns(e,t.negative.relative,n)&&!this._isMatchToAbsoluteNegative(e,t.negative.absolute,n))}_isMatchToAbsoluteNegative(t,n,r){if(0===n.length)return!1;const s=e.path.makeAbsolute(this._settings.cwd,t);return this._isMatchToPatterns(s,n,r)}_isMatchToPatterns(t,n,r){if(0===n.length)return!1;const s=e.pattern.matchAny(t,n);return!s&&r?e.pattern.matchAny(t+"/",n):s}},Kp}(),r=function(){if(Up)return qp;Up=1,Object.defineProperty(qp,"__esModule",{value:!0});const e=cf();return qp.default=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(t){return e.errno.isEnoentCodeError(t)||this._settings.suppressErrors}},qp}(),s=function(){if(Zp)return Vp;Zp=1,Object.defineProperty(Vp,"__esModule",{value:!0});const e=cf();return Vp.default=class{constructor(e){this._settings=e}getTransformer(){return e=>this._transform(e)}_transform(t){let n=t.path;return this._settings.absolute&&(n=e.path.makeAbsolute(this._settings.cwd,n),n=e.path.unixify(n)),this._settings.markDirectories&&t.dirent.isDirectory()&&(n+="/"),this._settings.objectMode?Object.assign(Object.assign({},t),{path:n}):n}},Vp}();return Dp.default=class{constructor(e){this._settings=e,this.errorFilter=new r.default(this._settings),this.entryFilter=new n.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new t.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new s.default(this._settings)}_getRootDirectory(t){return e.resolve(this._settings.cwd,t.base)}_getReaderOptions(e){const t="."===e.base?"":e.base;return{basePath:t,pathSegmentSeparator:"/",concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(t,e.positive,e.negative),entryFilter:this.entryFilter.getFilter(e.positive,e.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0,strictSlashes:!1}}},Dp}function Qp(){if(Gp)return lf;Gp=1,Object.defineProperty(lf,"__esModule",{value:!0});const e=function(){if(Tp)return ff;Tp=1,Object.defineProperty(ff,"__esModule",{value:!0});const e=xp(),t=Rp(),n=Lp();class r extends t.default{constructor(){super(...arguments),this._walkAsync=e.walk,this._readerStream=new n.default(this._settings)}dynamic(e,t){return new Promise((n,r)=>{this._walkAsync(e,t,(e,t)=>{null===e?n(t):r(e)})})}async static(e,t){const n=[],r=this._readerStream.static(e,t);return new Promise((e,t)=>{r.once("error",t),r.on("data",e=>n.push(e)),r.once("end",()=>e(n))})}}return ff.default=r,ff}(),t=Yp();class n extends t.default{constructor(){super(...arguments),this._reader=new e.default(this._settings)}async read(e){const t=this._getRootDirectory(e),n=this._getReaderOptions(e);return(await this.api(t,e,n)).map(e=>n.transform(e))}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}}return lf.default=n,lf}var Jp,Xp={};var eh,th,nh={},rh={};function sh(){if(th)return nh;th=1,Object.defineProperty(nh,"__esModule",{value:!0});const e=function(){if(eh)return rh;eh=1,Object.defineProperty(rh,"__esModule",{value:!0});const e=Pf(),t=xp(),n=Rp();class r extends n.default{constructor(){super(...arguments),this._walkSync=t.walkSync,this._statSync=e.statSync}dynamic(e,t){return this._walkSync(e,t)}static(e,t){const n=[];for(const r of e){const e=this._getFullEntryPath(r),s=this._getEntry(e,r,t);null!==s&&t.entryFilter(s)&&n.push(s)}return n}_getEntry(e,t,n){try{const n=this._getStat(e);return this._makeEntry(n,t)}catch(e){if(n.errorFilter(e))return null;throw e}}_getStat(e){return this._statSync(e,this._fsStatSettings)}}return rh.default=r,rh}(),t=Yp();class n extends t.default{constructor(){super(...arguments),this._reader=new e.default(this._settings)}read(e){const t=this._getRootDirectory(e),n=this._getReaderOptions(e);return this.api(t,e,n).map(n.transform)}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}}return nh.default=n,nh}var ih,oh,ah,ch={};var uh,lh,fh=function(){if(ah)return oh;ah=1;const e=function(){if(sf)return Du;sf=1,Object.defineProperty(Du,"__esModule",{value:!0}),Du.convertPatternGroupToTask=Du.convertPatternGroupsToTasks=Du.groupPatternsByBaseDirectory=Du.getNegativePatternsAsPositive=Du.getPositivePatterns=Du.convertPatternsToTasks=Du.generate=void 0;const e=cf();function t(t,n){let r=t;return n.braceExpansion&&(r=e.pattern.expandPatternsWithBraceExpansion(r)),n.baseNameMatch&&(r=r.map(e=>e.includes("/")?e:`**/${e}`)),r.map(t=>e.pattern.removeDuplicateSlashes(t))}function n(t,n,r){const s=[],c=e.pattern.getPatternsOutsideCurrentDirectory(t),u=e.pattern.getPatternsInsideCurrentDirectory(t),l=i(c),f=i(u);return s.push(...o(l,n,r)),"."in f?s.push(a(".",u,n,r)):s.push(...o(f,n,r)),s}function r(t){return e.pattern.getPositivePatterns(t)}function s(t,n){return e.pattern.getNegativePatterns(t).concat(n).map(e.pattern.convertToPositivePattern)}function i(t){return t.reduce((t,n)=>{const r=e.pattern.getBaseDirectory(n);return r in t?t[r].push(n):t[r]=[n],t},{})}function o(e,t,n){return Object.keys(e).map(r=>a(r,e[r],t,n))}function a(t,n,r,s){return{dynamic:s,positive:n,negative:r,base:t,patterns:[].concat(n,r.map(e.pattern.convertToNegativePattern))}}return Du.generate=function(i,o){const a=t(i,o),c=t(o.ignore,o),u=r(a),l=s(a,c),f=u.filter(t=>e.pattern.isStaticPattern(t,o)),p=u.filter(t=>e.pattern.isDynamicPattern(t,o)),h=n(f,l,!1),d=n(p,l,!0);return h.concat(d)},Du.convertPatternsToTasks=n,Du.getPositivePatterns=r,Du.getNegativePatternsAsPositive=s,Du.groupPatternsByBaseDirectory=i,Du.convertPatternGroupsToTasks=o,Du.convertPatternGroupToTask=a,Du}(),t=Qp(),n=function(){if(Jp)return Xp;Jp=1,Object.defineProperty(Xp,"__esModule",{value:!0});const e=R,t=Lp(),n=Yp();class r extends n.default{constructor(){super(...arguments),this._reader=new t.default(this._settings)}read(t){const n=this._getRootDirectory(t),r=this._getReaderOptions(t),s=this.api(n,t,r),i=new e.Readable({objectMode:!0,read:()=>{}});return s.once("error",e=>i.emit("error",e)).on("data",e=>i.emit("data",r.transform(e))).once("end",()=>i.emit("end")),i.once("close",()=>s.destroy()),i}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}}return Xp.default=r,Xp}(),r=sh(),s=(ih||(ih=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;const t=T,n=x,r=Math.max(n.cpus().length,1);e.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:t.lstat,lstatSync:t.lstatSync,stat:t.stat,statSync:t.statSync,readdir:t.readdir,readdirSync:t.readdirSync},e.default=class{constructor(e={}){this._options=e,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,r),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0),this.ignore=[].concat(this.ignore)}_getValue(e,t){return void 0===e?t:e}_getFileSystemMethods(t={}){return Object.assign(Object.assign({},e.DEFAULT_FILE_SYSTEM_ADAPTER),t)}}}(ch)),ch),i=cf();async function o(e,n){c(e);const r=a(e,t.default,n),s=await Promise.all(r);return i.array.flatten(s)}function a(t,n,r){const i=[].concat(t),o=new s.default(r),a=e.generate(i,o),c=new n(o);return a.map(c.read,c)}function c(e){if(![].concat(e).every(e=>i.string.isString(e)&&!i.string.isEmpty(e)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}return function(t){function o(e,t){c(e);const n=a(e,r.default,t);return i.array.flatten(n)}function u(e,t){c(e);const r=a(e,n.default,t);return i.stream.merge(r)}var l,f;t.glob=t,t.globSync=o,t.globStream=u,t.async=t,t.sync=o,t.stream=u,t.generateTasks=function(t,n){c(t);const r=[].concat(t),i=new s.default(n);return e.generate(r,i)},t.isDynamicPattern=function(e,t){c(e);const n=new s.default(t);return i.pattern.isDynamicPattern(e,n)},t.escapePath=function(e){return c(e),i.path.escape(e)},t.convertPathToPattern=function(e){return c(e),i.path.convertPathToPattern(e)},(l=t.posix||(t.posix={})).escapePath=function(e){return c(e),i.path.escapePosixPath(e)},l.convertPathToPattern=function(e){return c(e),i.path.convertPosixPathToPattern(e)},(f=t.win32||(t.win32={})).escapePath=function(e){return c(e),i.path.escapeWindowsPath(e)},f.convertPathToPattern=function(e){return c(e),i.path.convertWindowsPathToPattern(e)}}(o||(o={})),oh=o}(),ph=z(fh);var hh=function(){if(lh)return uh;lh=1;var e=rl(),t=$.posix.dirname,n="win32"===x.platform(),r="/",s=/\\/g,i=/\\([!*?|[\](){}])/g;function o(t){return!!/\([^()]+$/.test(t)||("{"===t[0]||"["===t[0]||(!!/[^\\][{[]/.test(t)||e(t)))}return uh=function(e,a){Object.assign({flipBackslashes:!0},a).flipBackslashes&&n&&e.indexOf(r)<0&&(e=e.replace(s,r)),function(e){var t;switch(e.slice(-1)){case"}":t="{";break;case"]":t="[";break;default:return!1}var n=e.indexOf(t);if(n<0)return!1;return e.slice(n+1,-1).includes(r)}(e)&&(e+=r),e+="a";do{e=t(e)}while(o(e));return e.replace(i,"$1")}}(),dh=z(hh);const mh=e=>""!==e&&".."!==e,gh=e=>{if("string"!=typeof e||!e.trim())return null;const t=e.trim().replace(/[^A-Za-z0-9@/_-]/g,"_").replace(/\/{2,}/g,"/").trim().split("/").filter(e=>e.length>0);if(0===t.length)return null;for(const e of t)if(!mh(e))return null;return t.join("/")},yh=async e=>{try{return(await s(e)).isFile()}catch{return!1}},vh=async e=>{const{cwd:t,stanPath:n,map:r,onStage:s}=e;if(!r||"object"!=typeof r)return;const i=pe(t,n),o=p.join(i.rootAbs,"imports");await g(o);const a=Object.keys(r).sort();for(const e of a){const n=r[e]??[];if(!Array.isArray(n)||0===n.length)continue;const i=gh(e);if(!i)continue;const a=p.join(o,i);await f(a,{recursive:!0,force:!0}).catch(()=>{}),await g(a).catch(()=>{});const u=[];for(const e of n){const n=String(e??"").trim();if(!n)continue;const r=dh(n.replace(/\\/g,"/"));try{const e=await ph(n,{cwd:t,absolute:!0,dot:!0,onlyFiles:!1,followSymbolicLinks:!1});for(const n of e){if(!await yh(n))continue;const e=p.relative(p.isAbsolute(r)?r:p.resolve(t,r),n).replace(/\\/g,"/");if(!e||e.includes(".."))continue;const s=p.join(a,e);await g(p.dirname(s)).catch(()=>{});try{await c(n,s),u.push(s)}catch{}}}catch{}}try{if("function"==typeof s){s(i,u.map(e=>p.relative(t,e).replace(/\\/g,"/")))}}catch{}}},_h=()=>{const e=(()=>{try{const e=w(import.meta.url);return Ae({cwd:p.dirname(e)})??null}catch{return null}})();if(!e)return null;const n=p.join(e,"dist","stan.system.md");return t(n)?n:null},bh=e=>e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),wh=async(e,n)=>{const r=p.join(e,n,"system"),s=p.join(r,"parts"),o=p.join(r,"stan.system.md");if(await g(r),!t(s))return{target:o,action:"skipped-no-parts",partsDir:s};const c=(await a(s,{withFileTypes:!0})).filter(e=>e.isFile()&&e.name.toLowerCase().endsWith(".md")).map(e=>e.name).sort((e,t)=>e.localeCompare(t,void 0,{numeric:!0}));if(0===c.length)return{target:o,action:"skipped-no-md",partsDir:s};const l=[];for(const e of c){const t=p.join(s,e),n=bh(await i(t,"utf8")).trimEnd();l.push(n)}const f=(e=>`\x3c!-- GENERATED: assembled from ${e}/system/parts; edit parts and run \`npm run gen:system\` --\x3e\n`)(n)+l.join("\n\n")+"\n";return await u(o,f,"utf8"),{target:o,action:"written"}};const Sh="0.2.0";export{Sh as CORE_VERSION,we as DEFAULT_OPEN_COMMAND,be as DEFAULT_STAN_PATH,mu as __internal,Iu as applyPatchPipeline,Nu as applyWithJsDiff,wh as assembleSystemMonolith,_e as createArchive,tu as createArchiveDiff,bu as detectAndCleanPatch,Qc as ensureOutputDir,ku as executeFileOps,xe as findConfigPathSync,_h as getPackagedSystemPromptPath,Gc as loadConfig,Wc as loadConfigSync,Au as parseFileOpsBlock,vh as prepareImports,Yc as resolveStanPath,Vc as resolveStanPathSync,du as validateOrThrow,hu as validateResponseMessage,eu as writeArchiveSnapshot};