@karmaniverous/stan-cli 0.11.3 → 0.11.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/stan.js CHANGED
@@ -8,21 +8,22 @@ import { fileURLToPath } from 'node:url';
8
8
  import w from 'process';
9
9
  import require$$0 from 'buffer';
10
10
  import { createHash } from 'node:crypto';
11
- import { spawn } from 'node:child_process';
11
+ import require$$1, { spawn } from 'node:child_process';
12
12
  import E from 'os';
13
13
  import x from 'path';
14
14
  import O from 'util';
15
15
  import $ from 'stream';
16
16
  import R from 'events';
17
17
  import i from 'fs';
18
- import { createRequire } from 'node:module';
18
+ import require$$0$1 from 'node:events';
19
19
  import os$1 from 'node:os';
20
20
  import tty from 'node:tty';
21
21
  import readline__default, { emitKeypressEvents } from 'node:readline';
22
22
  import clipboardy from 'clipboardy';
23
- import require$$0$1 from 'child_process';
23
+ import require$$0$2 from 'child_process';
24
+ import { createRequire } from 'node:module';
24
25
 
25
- const T="archive.tar",P="archive.prev.tar",L=e=>e.replace(/\\/g,"/"),N=(e,t)=>{const n=L(e).replace(/\/+$/,""),r=L(t);return r===n||r.startsWith(`${n}/`)},I=(e,t)=>{const n=L(e);return N(`${n}/diff`,t)||N(`${n}/patch`,t)},M=N,D=e=>{const t=e.replace(/\\/g,"/");return e=>!(I(t,e)||((e,t)=>{const n=L(e);return L(t)===`${n}/output/${T}`||L(t)===`${n}/output/archive.diff.tar`||L(t)===`${n}/output/archive.warnings.txt`})(t,e))},j=(e,t)=>{const n=`${t.replace(/\\/g,"/")}/output`;return Array.from(new Set([...e,n]))},H=(e,t)=>{const n=(e??"").trim();n&&"No archive warnings."!==n&&t?.(n);};var F="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function B(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var z,K={exports:{}};var U,q,Z,W,G,V,Y,Q,J,X,ee,te=(z||(z=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=()=>false,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=false,o=e;0===o.indexOf("!")&&(r=true,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=true);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=true,this._rules.push(t);}}add(e){return this._added=false,t(b(e)?(e=>e.split(o).filter(Boolean))(e):e).forEach(this._add,this),this._added}test(e,t,n){let r,s=false,i=false;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 O{constructor({ignorecase:e=true,ignoreCase:t=e,allowRelativePaths:n=false}={}){p(this,f,true),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,true,t);if(e.ignored)return e}return this._rules.test(e,false,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,false).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return t(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,true)}}const $=e=>new O(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=$,$.default=$,e.exports.isPathValid=e=>E(e&&E.convert(e),e,d),p(e.exports,Symbol.for("setupWindows"),R);}(K)),K.exports),ne=B(te),re={};function se(){if(q)return U;q=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 U={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=>true===e?u:c}}function ie(){return Z||(Z=1,function(e){const{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:s}=se();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 true===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};}(re)),re}function oe(){if(G)return W;G=1;const e=ie(),{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}=se(),g=e=>e===a||e===r,y=e=>{ true!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1);};return W=(v,_)=>{const b=_||{},w=v.length-1,S=true===b.parts||true===b.scanToEnd,A=[],k=[],E=[];let x,O,$=v,R=-1,C=0,T=0,P=false,L=false,N=false,I=false,M=false,D=false,j=false,H=false,F=false,B=false,z=0,K={value:"",depth:0,isGlob:false};const U=()=>R>=w,q=()=>$.charCodeAt(R+1),Z=()=>(x=O,$.charCodeAt(++R));for(;R<w;){let e;if(O=Z(),O!==r){if(true===D||O===c){for(z++;true!==U()&&(O=Z());)if(O!==r)if(O!==c){if(true!==D&&O===i&&(O=Z())===i){if(P=K.isBrace=true,N=K.isGlob=true,B=true,true===S)continue;break}if(true!==D&&O===s){if(P=K.isBrace=true,N=K.isGlob=true,B=true,true===S)continue;break}if(O===h&&(z--,0===z)){D=false,P=K.isBrace=true,B=true;break}}else z++;else j=K.backslashes=true,Z();if(true===S)continue;break}if(O!==a){if(true!==b.noext){if(true===(O===f||O===n||O===t||O===p||O===o)&&q()===u){if(N=K.isGlob=true,I=K.isExtglob=true,B=true,O===o&&R===C&&(F=true),true===S){for(;true!==U()&&(O=Z());)if(O!==r){if(O===d){N=K.isGlob=true,B=true;break}}else j=K.backslashes=true,O=Z();continue}break}}if(O===t){if(x===t&&(M=K.isGlobstar=true),N=K.isGlob=true,B=true,true===S)continue;break}if(O===p){if(N=K.isGlob=true,B=true,true===S)continue;break}if(O===l){for(;true!==U()&&(e=Z());)if(e!==r){if(e===m){L=K.isBracket=true,N=K.isGlob=true,B=true;break}}else j=K.backslashes=true,Z();if(true===S)continue;break}if(true===b.nonegate||O!==o||R!==C){if(true!==b.noparen&&O===u){if(N=K.isGlob=true,true===S){for(;true!==U()&&(O=Z());)if(O!==u){if(O===d){B=true;break}}else j=K.backslashes=true,O=Z();continue}break}if(true===N){if(B=true,true===S)continue;break}}else H=K.negated=true,C++;}else {if(A.push(R),k.push(K),K={value:"",depth:0,isGlob:false},true===B)continue;if(x===i&&R===C+1){C+=2;continue}T=R+1;}}else j=K.backslashes=true,O=Z(),O===c&&(D=true);} true===b.noext&&(I=false,N=false);let W=$,G="",V="";C>0&&(G=$.slice(0,C),$=$.slice(C),T-=C),W&&true===N&&T>0?(W=$.slice(0,T),V=$.slice(T)):true===N?(W="",V=$):W=$,W&&""!==W&&"/"!==W&&W!==$&&g(W.charCodeAt(W.length-1))&&(W=W.slice(0,-1)),true===b.unescape&&(V&&(V=e.removeBackslashes(V)),W&&true===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(true===b.tokens&&(Y.maxDepth=0,g(O)||k.push(K),Y.tokens=k),true===b.parts||true===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=true,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},W}function ae(){if(Y)return V;Y=1;const e=se(),t=ie(),{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:O,QMARK:$,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?$:R;let I=true===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:true===p.dot,consumed:"",output:"",prefix:"",backtrack:false,negated:false,brackets:0,braces:0,parens:0,quotes:0,globstar:false,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=true,M.start++,true)},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=true===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:true,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:false}).output;n=e.close=`)${s})${r})`;}"bos"===e.prev.type&&(M.negatedExtglob=true);}Q({type:"paren",extglob:true,value:F,output:n}),Y("parens");};if(false!==p.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(l)){let e=false,n=l.replace(i,(t,n,r,s,i,o)=>"\\"===s?(e=true,t):"?"===s?n?n+s+(i?$.repeat(i.length):""):0===o?N+(i?$.repeat(i.length):""):$.repeat(r.length):"."===s?b.repeat(r.length):"*"===s?n?n+s+(i?I:""):I:n?t:`\\${t}`);return true===e&&(n=true===p.unescape?n.replace(/\\/g,""):n.replace(/\\+/g,e=>e.length%2==0?"\\\\":e?"\\":"")),n===l&&true===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&&true!==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+="\\")),true===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(false!==p.posix&&":"===F){const e=B.value.slice(1);if(e.includes("[")&&(B.posix=true,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=true,U(),m.output||1!==g.indexOf(B)||(m.output=A);continue}}}("["===F&&":"!==K()||"-"===F&&"]"===K())&&(F=`\\${F}`),"]"!==F||"["!==B.value&&"[^"!==B.value||(F=`\\${F}`),true===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,true===p.keepQuotes&&Q({type:"text",value:F});continue}if("("===F){V("parens"),Q({type:"paren",value:F});continue}if(")"===F){if(0===M.parens&&true===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(true!==p.nobracket&&q().includes("]"))V("brackets");else {if(true!==p.nobracket&&true===p.strictBrackets)throw new SyntaxError(c("closing","]"));F=`\\${F}`;}Q({type:"bracket",value:F});continue}if("]"===F){if(true===p.nobracket||B&&"bracket"===B.type&&1===B.value.length){Q({type:"text",value:F,output:`\\${F}`});continue}if(0===M.brackets){if(true===p.strictBrackets)throw new SyntaxError(c("opening","["));Q({type:"text",value:F,output:`\\${F}`});continue}Y("brackets");const e=B.value.slice(1);if(true===B.posix||"^"!==e[0]||e.includes("/")||(F=`/${F}`),B.value+=F,W({value:F}),false===p.literalBrackets||t.hasRegexChars(e))continue;const n=t.escapeRegex(B.value);if(M.output=M.output.slice(0,-B.value.length),true===p.literalBrackets){M.output+=n,B.value=n;continue}B.value=`(${y}${n}|${B.value})`,M.output+=B.value;continue}if("{"===F&&true!==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(true===p.nobrace||!e){Q({type:"text",value:F,output:F});continue}let t=")";if(true===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=true;}if(true!==e.comma&&true!==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=true,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=true;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)&&true!==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(true!==p.dot&&("slash"===B.type||"bos"===B.type)){Q({type:"qmark",value:F,output:R});continue}Q({type:"qmark",value:F,output:$});continue}if("!"===F){if(true!==p.noextglob&&"("===K()&&("?"!==K(2)||!/[!=<:]/.test(K(3)))){J("negate",F);continue}if(true!==p.nonegate&&0===M.index){G();continue}}if("+"===F){if(true!==p.noextglob&&"("===K()&&"?"!==K(2)){J("plus",F);continue}if(B&&"("===B.value||false===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(true!==p.noextglob&&"("===K()&&"?"!==K(2)){Q({type:"at",extglob:true,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||true===B.star)){B.type="star",B.star=true,B.value+=F,B.output=I,M.backtrack=true,M.globstar=true,Z(F);continue}let e=q();if(true!==p.noextglob&&/^\([^?]/.test(e)){J("star",F);continue}if("star"===B.type){if(true===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(true===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=true,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=true,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=true,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=true,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=true,Z(F);continue}const n={type:"star",value:F,output:I};true!==p.bash?!B||"bracket"!==B.type&&"paren"!==B.type||true!==p.regex?(M.index!==M.start&&"slash"!==B.type&&"dot"!==B.type||("dot"===B.type?(M.output+=x,B.output+=x):true===p.dot?(M.output+=O,B.output+=O):(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(true===p.strictBrackets)throw new SyntaxError(c("closing","]"));M.output=t.escapeLast(M.output,"["),Y("brackets");}for(;M.parens>0;){if(true===p.strictBrackets)throw new SyntaxError(c("closing",")"));M.output=t.escapeLast(M.output,"("),Y("parens");}for(;M.braces>0;){if(true===p.strictBrackets)throw new SyntaxError(c("closing","}"));M.output=t.escapeLast(M.output,"{"),Y("braces");}if(true===p.strictSlashes||"star"!==B.type&&"bracket"!==B.type||Q({type:"maybe_slash",value:"",output:`${S}?`}),true===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=true===i.bash?".*?":g;i.capture&&(w=`(${w})`);const S=e=>true===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:false,prefix:""});let E=A(k);return E&&true!==i.strictSlashes&&(E+=`${l}?`),E},V=u}function ce(){if(J)return Q;J=1;const e=oe(),t=ae(),n=ie(),r=se(),s=(e,t,n=false)=>{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 false};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,false,true),u=c.state;delete c.state;let l=()=>false;if(o.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};l=s(o.ignore,e,n);}const f=(n,r=false)=>{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),false===i?(h.isMatch=false,!!r&&h):l(n)?("function"==typeof o.onIgnore&&o.onIgnore(h),h.isMatch=false,!!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:false,output:""};const a=r||{},c=a.format||(o?n.toPosixSlashes:null);let u=e===i,l=u&&c?c(e):e;return false===u&&(l=c?c(e):e,u=l===i),false!==u&&true!==a.capture||(u=true===a.matchBase||true===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:false}),s.scan=(t,n)=>e(t,n),s.compileRe=(e,t,n=false,r=false)=>{if(true===n)return e.output;const i=t||{},o=i.contains?"":"^",a=i.contains?"":"$";let c=`${o}(?:${e.output})${a}`;e&&true===e.negated&&(c=`^(?!${c}).*$`);const u=s.toRegex(c,t);return true===r&&(u.state=e),u},s.makeRe=(e,n={},r=false,i=false)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let o={negated:false,fastpaths:true};return false===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&&true===t.debug)throw e;return /$^/}},s.constants=r,Q=s}function ue(){if(ee)return X;ee=1;const e=ce(),t=ie();function n(n,r,s=false){return !r||null!==r.windows&&void 0!==r.windows||(r={...r,windows:t.isWindows()}),e(n,r,s)}return Object.assign(n,e),X=n}var le=B(ue());const fe=async e=>{const t=[],n=["."];for(;n.length;){const r=n.pop(),i=resolve(e,r),o=await readdir(i,{withFileTypes:true});for(const e of o){const s="."===r?e.name:join(r,e.name);e.isDirectory()?n.push(s):t.push(s.replace(/\\/g,"/"));}}return t},pe=(e,t)=>{const n=t.replace(/\\/g,"/").replace(/\/+$/,"");return e===n||e.startsWith(n+"/")},he=e=>{const t=e.replace(/\\/g,"/").replace(/^\.\/+/,"").replace(/\/+$/,"");if(!/[*?[\]{}()!]/.test(n=t)&&!n.includes("**"))return t?e=>pe(e,t):()=>false;var n;const r=le(t,{dot:true});return e=>r(e)},de=async(e,{cwd:n,stanPath:r,includeOutputDir:s,includes:o=[],excludes:a=[],anchors:c=[]})=>{const u=r.replace(/\\/g,"/"),l=((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,u),f=await(async e=>{const n=resolve(e,".gitignore");if(!existsSync(n))return null;try{const e=await readFile(n,"utf8"),t=ne();return t.add(e),t}catch{return null}})(n),h=[e=>pe(e,"node_modules"),e=>pe(e,".git"),...f?[e=>f.ignores(e)]:[],...a.map(he),...l.map(e=>t=>pe(t,e)),e=>I(u,e)];s||h.push(e=>M(`${u}/output`,e));const d=e.filter(e=>!h.some(t=>t(e)));if(o.length>0){const t=o.map(he),n=[e=>I(u,e),...s?[]:[e=>M(`${u}/output`,e)]],r=new Set(d);for(const n of e)t.some(e=>e(n))&&r.add(n);const i=a.map(he),l=new Set(e.filter(e=>r.has(e)&&!n.some(t=>t(e))&&!i.some(t=>t(e))));if(c.length>0){const t=c.map(he);for(const n of e){!(I(u,n)||!s&&M(`${u}/output`,n))&&t.some(e=>e(n))&&l.add(n);}}return e.filter(e=>l.has(e))}if(c.length>0){const t=c.map(he),n=new Set(d);for(const r of e){!(I(u,r)||!s&&M(`${u}/output`,r))&&t.some(e=>e(r))&&n.add(r);}return e.filter(e=>n.has(e))}return d},me=async(e,t)=>{const n=(await(async()=>{try{const e=await Promise.resolve().then(function(){return Qc}),t=e.makeStanDirs,n=e.default?.makeStanDirs,r="function"==typeof t?t:n;if("function"==typeof r)return r}catch{}throw new Error("makeStanDirs export not found in ./paths")})())(e,t);return await ensureDir(n.rootAbs),await ensureDir(n.outputAbs),await ensureDir(n.diffAbs),await ensureDir(n.patchAbs),{rootAbs:n.rootAbs,outputAbs:n.outputAbs,diffAbs:n.diffAbs,patchAbs:n.patchAbs}},ge=async(e,t)=>{const n=await me(e,t);return {outDir:n.outputAbs,diffDir:n.diffAbs}},ye=async(e,n,r={})=>{const{includeOutputDir:s=false,fileName:i,includes:a=[],excludes:c=[],anchors:u=[]}=r;let l=i??"archive.tar";l.endsWith(".tar")||(l+=".tar");const{outDir:f,diffDir:h}=await ge(e,n),d=await fe(e),m=await de(d,{cwd:e,stanPath:n,includeOutputDir:s,includes:a,excludes:c,anchors:u}),g=resolve(f,l),y=resolve(h,P);if(existsSync(g))try{await copyFile(g,y);}catch{}const v=await(async()=>{try{const e=await import('./classifier-DeYwffC_-DftahF7h.js'),t=e.classifyForArchive,n=e.default?.classifyForArchive,r="function"==typeof t?t:n;if("function"==typeof r)return r}catch{}throw new Error("classifyForArchive export not found in ./classifier")})(),{textFiles:_,warningsBody:b}=await v(e,m),w=_;H(b,r.onArchiveWarnings);const S=await import('./index-ucZa1KMb-CNGeWGvV.js');if(s?await S.create({file:g,cwd:e,filter:D(n)},j(w,n)):await S.create({file:g,cwd:e,filter:D(n)},w),!existsSync(y))try{await copyFile(g,y);}catch{}return g},ve=".stan",_e="code -g {file}",be=e=>e instanceof URL?fileURLToPath(e):e;function we({cwd:t}={}){const n=function(t,{cwd:n=process$2.cwd(),type:r="file",stopAt:s}={}){let i=path.resolve(be(n)??"");const{root:o}=path.parse(i);s=path.resolve(i,be(s)??o);const a=path.isAbsolute(t);for(;i;){const n=a?t:path.join(i,t);try{const t=c.statSync(n,{throwIfNoEntry:!1});if("file"===r&&t?.isFile()||"directory"===r&&t?.isDirectory())return n}catch{}if(i===s||i===o)break;i=path.dirname(i);}}("package.json",{cwd:t});return n&&path.dirname(n)}const Se=["stan.config.yml","stan.config.yaml","stan.config.json"],Ae=e=>{for(const n of Se){const r=resolve(e,n);if(existsSync(r))return r}return null},ke=e=>{const t=Ae(e);if(t)return t;const n=new Set;let r=e;for(;r;){const e=we({cwd:r});if(!e||n.has(e))break;n.add(e);const t=Ae(e);if(t)return t;const s=dirname(e);if(s===e||n.has(s))break;r=s;}return null};var Ee,xe={},Oe={},$e={},Re={};function Ce(){if(Ee)return Re;Ee=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 true}return false}return Re.ALIAS=e,Re.DOC=t,Re.MAP=n,Re.NODE_TYPE=o,Re.PAIR=r,Re.SCALAR=s,Re.SEQ=i,Re.hasAnchor=e=>(a(e)||c(e))&&!!e.anchor,Re.isAlias=t=>!!t&&"object"==typeof t&&t[o]===e,Re.isCollection=c,Re.isDocument=e=>!!e&&"object"==typeof e&&e[o]===t,Re.isMap=e=>!!e&&"object"==typeof e&&e[o]===n,Re.isNode=function(t){if(t&&"object"==typeof t)switch(t[o]){case e:case n:case s:case i:return true}return false},Re.isPair=e=>!!e&&"object"==typeof e&&e[o]===r,Re.isScalar=a,Re.isSeq=e=>!!e&&"object"==typeof e&&e[o]===i,Re}var Te,Pe,Le={};function Ne(){if(Te)return Le;Te=1;var e=Ce();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,Le.visit=s,Le.visitAsync=o,Le}function Ie(){if(Pe)return $e;Pe=1;var e=Ce(),t=Ne();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=false,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=true;break;case "1.2":this.atNextDocument=false,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=false);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 false;const[e,r]=n;return this.tags[e]=r,true}case "%YAML":{if(this.yaml.explicit=true,1!==n.length)return t(0,"%YAML directive should contain exactly one part"),false;const[e]=n;if("1.1"===e||"1.2"===e)return this.yaml.version=e,true;return t(6,`Unsupported YAML version ${e}`,/^\d+\.\d+$/.test(e)),false}default:return t(0,`Unknown directive ${r}`,true),false}}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]=true);}),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:false,version:"1.2"},s.defaultTags={"!!":"tag:yaml.org,2002:"},$e.Directives=s,$e}var Me,De={},je={},He={};function Fe(){if(Me)return He;Me=1;var e=Ce(),t=Ne();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 He.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 true},He.anchorNames=n,He.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}},He.findNewAnchor=r,He}var Be,ze={},Ke={};function Ue(){if(Be)return Ke;return Be=1,Ke.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)},Ke}var qe,Ze,We,Ge={};function Ve(){if(qe)return Ge;qe=1;var e=Ce();return Ge.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)},Ge}function Ye(){if(Ze)return ze;Ze=1;var e=Ue(),t=Ce(),n=Ve();return ze.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:true,mapAsMap:true===s,mapKeyWarned:false,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}},ze}function Qe(){if(We)return je;We=1;var e=Fe(),t=Ne(),n=Ce(),r=Ye(),s=Ve();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 je.Alias=i,je}var Je,Xe,et,tt={},nt={},rt={};function st(){if(Je)return rt;Je=1;var e=Ce(),t=Ye(),n=Ve();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",rt.Scalar=r,rt.isScalarValue=e=>!e||"function"!=typeof e&&"object"!=typeof e,rt}function it(){if(Xe)return nt;Xe=1;var e=Qe(),t=Ce(),n=st();return nt.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},nt}function ot(){if(et)return tt;et=1;var e=it(),t=Ce(),n=Ye();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:false,keepUndefined:false,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:true,enumerable:false,writable:true});}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,true);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,true);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,true);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 false;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,true);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,true);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 tt.Collection=i,tt.collectionFromPath=r,tt.isEmptyPath=s,tt}var at,ct={},ut={},lt={},ft={};function pt(){if(at)return ft;at=1;function e(e,t){return /^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}return ft.indentComment=e,ft.lineComment=(t,n,r)=>t.endsWith("\n")?e(r,n):r.includes("\n")?"\n"+e(r,n):(t.endsWith(" ")?"":" ")+r,ft.stringifyComment=e=>e.replace(/^(?!$)(?: $)?/gm,"#"),ft}var ht,dt,mt,gt,yt={},vt={};function _t(){if(ht)return vt;ht=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 vt.FOLD_BLOCK=e,vt.FOLD_FLOW="flow",vt.FOLD_QUOTED=t,vt.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=false,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=true;const e=v>b+1?v-2:_-1;if(h[e])return r;p.push(e),h[e]=true,g=e+f,d=void 0;}else y=true;}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},vt}function bt(){if(dt)return yt;dt=1;var e=st(),t=_t();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,false))}function i(e,i){if(false===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,false))}function o(e,t){const{singleQuote:n}=t.options;let r;if(false===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 false;const r=t-n,s=e.length;if(s<=r)return false;for(let t=0,n=0;t<s;++t)if("\n"===e[t]){if(t-n>r)return true;if(n=t+1,s-n<=r)return false}return true}(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=false,A=-1;for(w=0;w<c.length;++w){const e=c[w];if(" "===e)S=true;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=false;const o=n(u,true);"folded"!==p&&i!==e.Scalar.BLOCK_FOLDED&&(o.onOverflow=()=>{s=true;});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 yt.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=true,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,false))}(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},yt}function wt(){if(mt)return lt;mt=1;var e=Fe(),t=Ce(),n=pt(),r=bt();return lt.createStringifyContext=function(e,t){const r=Object.assign({blockQuote:true,commentString:n.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:false,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:true,indentSeq:true,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:false,singleQuote:null,trueStr:"true",verifyAliasOrder:true},e.schema.toStringOptions,t);let s;switch(r.collectionStyle){case "block":s=false;break;case "flow":s=true;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}},lt.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},lt}function St(){if(gt)return ut;gt=1;var e=Ce(),t=st(),n=wt(),r=pt();return ut.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:false,implicitKey:!y&&(m||!u),indent:f+p});let v,_,b,w=false,S=false,A=n.stringify(s,o,()=>w=true,()=>S=true);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=true;}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=false,_=null,b=null,i&&"object"==typeof i&&(i=l.createNode(i))),o.implicitKey=false,y||g||!e.isScalar(i)||(o.indentAtStart=A.length+1),S=false,d||!(p.length>=2)||o.inFlow||y||!e.isSeq(i)||i.flow||i.tag||i.anchor||(o.indent=o.indent.substring(2));let k=false;const E=n.stringify(i,o,()=>k=true,()=>S=true);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=false;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=true);}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},ut}var At,kt={},Et={};function xt(){if(At)return Et;At=1;var e=w;return Et.debug=function(e,...t){"debug"===e&&console.log(...t);},Et.warn=function(t,n){"debug"!==t&&"warn"!==t||("function"==typeof e.emitWarning?e.emitWarning(n):console.warn(n));},Et}var Ot,$t,Rt,Ct={};function Tt(){if(Ot)return Ct;Ot=1;var e=Ce(),t=st();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:true,enumerable:true,configurable:true});return n}return Ct.addMergeToJSMap=s,Ct.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),Ct.merge=r,Ct}function Pt(){if($t)return kt;$t=1;var e=xt(),t=Tt(),n=wt(),r=Ce(),s=Ve();return kt.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=true,r.inStringifyKey=true;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=true;}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:true,enumerable:true,configurable:true}):o[u]=l;}}return o},kt}function Lt(){if(Rt)return ct;Rt=1;var e=it(),t=St(),n=Pt(),r=Ce();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 ct.Pair=s,ct.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)},ct}var Nt,It,Mt,Dt={},jt={},Ht={},Ft={};function Bt(){if(Nt)return Ft;Nt=1;var e=Ce(),t=wt(),n=pt();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=false;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=false;let f=t.stringify(c,d,()=>l=null,()=>m=true);l&&(f+=n.lineComment(f,u,h(l))),m&&l&&(m=false),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:true,type:null});let h=false,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,false),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,false),t.comment&&(h=true));const n=e.isNode(c.value)?c.value:null;n?(n.comment&&(u=n.comment),n.commentBefore&&(h=true)):null==c.value&&t?.comment&&(u=t.comment);}u&&(h=true);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=true),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 Ft.stringifyCollection=function(e,t,n){return (t.inFlow??e.flow?s:r)(e,t,n)},Ft}function zt(){if(It)return Ht;It=1;var e=Bt(),t=Pt(),n=ot(),r=Ce(),s=Lt(),i=st();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 false;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),true);}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(false)&&(t=Object.assign({},t,{allNullValues:true})),e.stringifyCollection(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:s,onComment:n})}};return Ht.YAMLMap=a,Ht.findPair=o,Ht}function Kt(){if(Mt)return jt;Mt=1;var e=Ce(),t=zt();const n={collection:"map",default:true,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 jt.map=n,jt}var Ut,qt,Zt={},Wt={};function Gt(){if(Ut)return Wt;Ut=1;var e=it(),t=Bt(),n=ot(),r=Ce(),s=st(),i=Ve();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 false;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 Wt.YAMLSeq=o,Wt}function Vt(){if(qt)return Zt;qt=1;var e=Ce(),t=Gt();const n={collection:"seq",default:true,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 Zt.seq=n,Zt}var Yt,Qt={};function Jt(){if(Yt)return Qt;Yt=1;var e=bt();const t={identify:e=>"string"==typeof e,default:true,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:(t,n,r,s)=>(n=Object.assign({actualString:true},n),e.stringifyString(t,n,r,s))};return Qt.string=t,Qt}var Xt,en={},tn={};function nn(){if(Xt)return tn;Xt=1;var e=st();const t={identify:e=>null==e,createNode:()=>new e.Scalar(null),default:true,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 tn.nullTag=t,tn}var rn,sn={};function on$1(){if(rn)return sn;rn=1;var e=st();const t={identify:e=>"boolean"==typeof e,default:true,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 sn.boolTag=t,sn}var an,cn,un={},ln={};function fn(){if(an)return ln;return an=1,ln.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},ln}function pn(){if(cn)return un;cn=1;var e=st(),t=fn();const n={identify:e=>"number"==typeof e,default:true,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:true,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:true,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 un.float=s,un.floatExp=r,un.floatNaN=n,un}var hn,dn={};function mn(){if(hn)return dn;hn=1;var e=fn();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:true,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:true,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:true,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 dn.int=i,dn.intHex=o,dn.intOct=s,dn}var gn,yn={};function vn(){if(gn)return yn;gn=1;var e=Kt(),t=nn(),n=Vt(),r=Jt(),s=on$1(),i=pn(),o=mn();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 yn.schema=a,yn}var _n,bn={};function wn(){if(_n)return bn;_n=1;var e=st(),t=Kt(),n=Vt();function r(e){return "bigint"==typeof e||Number.isInteger(e)}const s=({value:e})=>JSON.stringify(e),i=[{identify:e=>"string"==typeof e,default:true,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:s},{identify:e=>null==e,createNode:()=>new e.Scalar(null),default:true,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:s},{identify:e=>"boolean"==typeof e,default:true,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>"true"===e,stringify:s},{identify:r,default:true,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:true,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:true,tag:"",test:/^/,resolve:(e,t)=>(t(`Unresolved plain scalar ${JSON.stringify(e)}`),e)},a=[t.map,n.seq].concat(i,o);return bn.schema=a,bn}var Sn,An={};function kn(){if(Sn)return An;Sn=1;var e=require$$0,t=st(),n=bt();const r={identify:e=>e instanceof Uint8Array,default:false,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 An.binary=r,An}var En,xn,On={},$n={};function Rn(){if(En)return $n;En=1;var e=Ce(),t=Lt(),n=st(),r=Gt();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:false,tag:"tag:yaml.org,2002:pairs",resolve:s,createNode:i};return $n.createPairs=i,$n.pairs=o,$n.resolvePairs=s,$n}function Cn(){if(xn)return On;xn=1;var e=Ce(),t=Ve(),n=zt(),r=Gt(),s=Rn();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:false,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 On.YAMLOMap=i,On.omap=o,On}var Tn,Pn={},Ln={};function Nn(){if(Tn)return Ln;Tn=1;var e=st();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=>true===e,default:true,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new e.Scalar(true),stringify:t},r={identify:e=>false===e,default:true,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new e.Scalar(false),stringify:t};return Ln.falseTag=r,Ln.trueTag=n,Ln}var In,Mn={};function Dn(){if(In)return Mn;In=1;var e=st(),t=fn();const n={identify:e=>"number"==typeof e,default:true,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:true,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:true,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 Mn.float=s,Mn.floatExp=r,Mn.floatNaN=n,Mn}var jn,Hn={};function Fn(){if(jn)return Hn;jn=1;var e=fn();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:true,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:true,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:true,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:true,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 Hn.int=o,Hn.intBin=s,Hn.intHex=a,Hn.intOct=i,Hn}var Bn,zn={};function Kn(){if(Bn)return zn;Bn=1;var e=Ce(),t=Lt(),n=zt();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(true))return super.toString(Object.assign({},e,{allNullValues:true}),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:false,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(true))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 zn.YAMLSet=r,zn.set=s,zn}var Un,qn,Zn,Wn,Gn={};function Vn(){if(Un)return Gn;Un=1;var e=fn();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:true,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:true,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>t(e,false),stringify:n},i={identify:e=>e instanceof Date,default:true,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,false);Math.abs(e)<30&&(e*=60),f-=6e4*e;}return new Date(f)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};return Gn.floatTime=s,Gn.intTime=r,Gn.timestamp=i,Gn}function Yn(){if(qn)return Pn;qn=1;var e=Kt(),t=nn(),n=Vt(),r=Jt(),s=kn(),i=Nn(),o=Dn(),a=Fn(),c=Tt(),u=Cn(),l=Rn(),f=Kn(),p=Vn();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 Pn.schema=h,Pn}function Qn(){if(Zn)return en;Zn=1;var e=Kt(),t=nn(),n=Vt(),r=Jt(),s=on$1(),i=pn(),o=mn(),a=vn(),c=wn(),u=kn(),l=Tt(),f=Cn(),p=Rn(),h=Yn(),d=Kn(),m=Vn();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 en.coreKnownTags=v,en.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},[])},en}function Jn(){if(Wn)return Dt;Wn=1;var e=Ce(),t=Kt(),n=Vt(),r=Jt(),s=Qn();const i=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;return Dt.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:true===f?i:null;}clone(){const e=Object.create(o.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}},Dt}var Xn,er,tr={};function nr(){if(Xn)return tr;Xn=1;var e=Ce(),t=wt(),n=pt();return tr.stringifyDocument=function(r,s){const i=[];let o=true===s.directives;if(false!==s.directives&&r.directives){const e=r.directives.toString(r);e?(i.push(e),o=true):r.directives.docStart&&(o=true);}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=false,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=true;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"},tr}function rr(){if(er)return De;er=1;var e=Qe(),t=ot(),n=Ce(),r=Lt(),s=Ve(),i=Jn(),o=nr(),a=Fe(),c=Ue(),u=it(),l=Ie();function f(e){if(n.isCollection(e))return true;throw new Error("Expected a YAML collection as document contents")}return De.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:false,keepSourceTokens:false,logLevel:"warn",prettyErrors:true,strict:true,stringKeys:false,uniqueKeys:true,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??true,keepUndefined:l??false,onAnchor:h,onTagObj:f,replacer:s,schema:this.schema,sourceObjects:m},y=u.createNode(e,p,g);return c&&n.isCollection(y)&&(y.flow=true),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,true):!!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:false,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:true,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:true===n,mapKeyWarned:false,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:true,jsonArg:e,mapAsMap:false,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)}},De}var sr,ir={};function or(){if(sr)return ir;sr=1;class e extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t;}}return ir.YAMLError=e,ir.YAMLParseError=class extends e{constructor(e,t,n){super("YAMLParseError",e,t,n);}},ir.YAMLWarning=class extends e{constructor(e,t,n){super("YAMLWarning",e,t,n);}},ir.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`;}},ir}var ar,cr={},ur={},lr={},fr={},pr={};function hr(){if(ar)return pr;return ar=1,pr.resolveProps=function(e,{flow:t,indicator:n,next:r,offset:s,onError:i,parentIndent:o,startOnNewline:a}){let c=false,u=a,l=a,f="",p="",h=false,d=false,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=false),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=true;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=false;break}case "newline":u?f?f+=s.source:b&&"seq-item-ind"===n||(c=true):p+=s.source,u=true,h=true,(g||y)&&(v=s),l=true;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",true),g=s,w??(w=s.offset),u=false,l=false,d=true;break;case "tag":y&&i(s,"MULTIPLE_TAGS","A node can have at most one tag"),y=s,w??(w=s.offset),u=false,l=false,d=true;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=false;break;case "comma":if(t){_&&i(s,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),_=s,u=false,l=false;break}default:i(s,"UNEXPECTED_TOKEN",`Unexpected ${s.type} token`),u=false,l=false;}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}},pr}var dr,mr={};function gr(){if(dr)return mr;return dr=1,mr.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 true;if(t.end)for(const e of t.end)if("newline"===e.type)return true;return false;case "flow-collection":for(const n of t.items){for(const e of n.start)if("newline"===e.type)return true;if(n.sep)for(const e of n.sep)if("newline"===e.type)return true;if(e(n.key)||e(n.value))return true}return false;default:return true}},mr}var yr,vr={};function _r(){if(yr)return vr;yr=1;var e=gr();return vr.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",true);}}},vr}var br,wr,Sr={};function Ar(){if(br)return Sr;br=1;var e=Ce();return Sr.mapIncludes=function(t,n,r){const{uniqueKeys:s}=t.options;if(false===s)return false;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))},Sr}function kr(){if(wr)return fr;wr=1;var e=Lt(),t=zt(),n=hr(),r=gr(),s=_r(),i=Ar();const o="All mapping items must start at the same column";return fr.resolveBlockMap=function({composeNode:a,composeEmptyNode:c},u,l,f,p){const h=new(p?.nodeClass??t.YAMLMap)(u.schema);u.atRoot&&(u.atRoot=false);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:true}),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=true;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=false,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},fr}var Er,xr={};function Or(){if(Er)return xr;Er=1;var e=Gt(),t=hr(),n=_r();return xr.resolveBlockSeq=function({composeNode:r,composeEmptyNode:s},i,o,a,c){const u=new(c?.nodeClass??e.YAMLSeq)(i.schema);i.atRoot&&(i.atRoot=false),i.atKey&&(i.atKey=false);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:true});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},xr}var $r,Rr,Cr,Tr={},Pr={};function Lr(){if($r)return Pr;return $r=1,Pr.resolveEnd=function(e,t,n,r){let s="";if(e){let i=false,o="";for(const a of e){const{source:e,type:c}=a;switch(c){case "space":i=true;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=true;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`);}t+=e.length;}}return {comment:s,offset:t}},Pr}function Nr(){if(Rr)return Tr;Rr=1;var e=Ce(),t=Lt(),n=zt(),r=Gt(),s=Lr(),i=hr(),o=gr(),a=Ar();const c="Block collections are not allowed within flow collections",u=e=>e&&("block-map"===e.type||"block-seq"===e.type);return Tr.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=true;const _=p.atRoot;_&&(p.atRoot=false),p.atKey&&(p.atKey=false);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:false});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=true;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=false;const o=i.resolveProps(w??[],{flow:y,indicator:"map-value-ind",next:S,offset:r.range[2],onError:d,parentIndent:h.indent,startOnNewline:false});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=true,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},Tr}function Ir(){if(Cr)return lr;Cr=1;var e=Ce(),t=st(),n=zt(),r=Gt(),s=kr(),i=Or(),o=Nr();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 lr.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"}`,true):u(l,"TAG_RESOLVE_FAILED",`Unresolved tag: ${f}`,true),a(s,i,o,u,f);i.schema.tags.push(Object.assign({},e,{default:false})),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},lr}var Mr,Dr={},jr={};function Hr(){if(Mr)return jr;Mr=1;var e=st();return jr.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=false,l="",f=s.length;for(let e=1;e<t.length;++e){const s=t[e];switch(s.type){case "space":u=true;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=false;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=true):""===s?"\n"===h?p+="\n":h="\n":(p+=h+s,h=" ",d=false);}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]}},jr}var Fr,Br,zr={};function Kr(){if(Fr)return zr;Fr=1;var e=st(),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 zr.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]}},zr}function Ur(){if(Br)return Dr;Br=1;var e=Ce(),t=st(),n=Hr(),r=Kr();return Dr.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:false,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=>(true===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)}`,true);}}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},Dr}var qr,Zr,Wr,Gr,Vr={};function Yr(){if(qr)return Vr;return qr=1,Vr.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},Vr}function Qr(){if(Zr)return ur;Zr=1;var e=Qe(),t=Ce(),n=Ir(),r=Ur(),s=Lr(),i=Yr();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=true;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",true);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=false;}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=true),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=true),a&&(h.comment=a,h.range[2]=l),h}return ur.composeEmptyNode=c,ur.composeNode=a,ur}function Jr(){if(Wr)return cr;Wr=1;var e=rr(),t=Qr(),n=Lr(),r=hr();return cr.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:false,atRoot:true,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:true});d.found&&(p.directives.docStart=true,!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,false,l);return g.comment&&(p.comment=g.comment),p.range=[o,m,g.offset],p},cr}function Xr(){if(Gr)return Oe;Gr=1;var e=w,t=Ie(),n=rr(),r=or(),s=Ce(),i=Jr(),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=false,r=false;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=true,r=false;break;case "%":"#"!==e[s+1]?.[0]&&(s+=1),n=false;break;default:n||(r=true),n=false;}}return {comment:t,afterEmptyLine:r}}return Oe.Composer=class{constructor(e={}){this.doc=null,this.atDirectives=false,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=false,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=true;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,false),this.doc&&(yield this.doc),this.doc=e,this.atDirectives=false;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=true;const e=o.resolveEnd(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,true),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=false,t=-1){if(this.doc)this.decorate(this.doc,true),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,false),yield r;}}},Oe}var es,ts={},ns={};function rs(){if(es)return ns;es=1;var e=Hr(),t=Kr(),n=or(),r=bt();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),true}return false}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 ns.createScalarToken=function(e,t){const{implicitKey:n=false,indent:i,inFlow:o=false,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:true,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}}},ns.resolveAsScalar=function(r,s=true,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},ns.setScalarValue=function(e,t,n={}){let{afterKey:o=false,implicitKey:a=false,inFlow:c=false,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:true,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");}},ns}var ss,is={};function os(){if(ss)return is;ss=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 is.stringify=n=>"type"in n?e(n):t(n),is}var as,cs,us={};function ls(){if(as)return us;as=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")},us.visit=r,us}function fs(){if(cs)return ts;cs=1;var e=rs(),t=os(),n=ls();return ts.createScalarToken=e.createScalarToken,ts.resolveAsScalar=e.resolveAsScalar,ts.setScalarValue=e.setScalarValue,ts.stringify=t.stringify,ts.visit=n.visit,ts.BOM="\ufeff",ts.DOCUMENT="",ts.FLOW_END="",ts.SCALAR="",ts.isCollection=e=>!!e&&"items"in e,ts.isScalar=e=>!!e&&("scalar"===e.type||"single-quoted-scalar"===e.type||"double-quoted-scalar"===e.type||"block-scalar"===e.type),ts.prettyToken=function(e){switch(e){case "\ufeff":return "<BOM>";case "":return "<DOC>";case "":return "<FLOW_END>";case "":return "<SCALAR>";default:return JSON.stringify(e)}},ts.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},ts}var ps,hs={};function ds(){if(ps)return hs;ps=1;var e=fs();function t(e){switch(e){case void 0:case " ":case "\n":case "\r":case "\t":return true;default:return false}}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 hs.Lexer=class{constructor(){this.atEnd=false,this.blockScalarIndent=-1,this.blockScalarKeep=false,this.buffer="",this.flowKey=false,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0;}*lex(e,t=false){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(true));return yield*this.pushCount(t.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){const e=yield*this.pushSpaces(true);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(false),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(true));return this.indentNext=this.indentValue+1,this.indentValue+=e,yield*this.parseBlockStart()}return "doc"}*parseDocument(){yield*this.pushSpaces(true);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=false,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(true)),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(false),this.indentValue=s=r):r=0,r+=(yield*this.pushSpaces(true));}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(true)),this.flowKey=false;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=false,this.flowLevel+=1,"flow";case "}":case "]":return yield*this.pushCount(1),this.flowKey=true,this.flowLevel-=1,this.flowLevel?"flow":"doc";case "*":return yield*this.pushUntil(o),"flow";case '"':case "'":return this.flowKey=true,yield*this.parseQuotedScalar();case ":":{const e=this.charAt(1);if(this.flowKey||t(e)||","===e)return this.flowKey=false,yield*this.pushCount(1),yield*this.pushSpaces(true),"flow"}default:return this.flowKey=false,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,false),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=false;let e=this.pos;for(;;){const t=this.buffer[++e];if("+"===t)this.blockScalarKeep=true;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,true),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,true),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(true))+(yield*this.pushIndicators());case "&":return (yield*this.pushUntil(o))+(yield*this.pushSpaces(true))+(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=false):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(true))+(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,false)}{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,false)}}*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,false)}},hs}var ms,gs={};function ys(){if(ms)return gs;ms=1;return gs.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}};}},gs}var vs,_s={};function bs(){if(vs)return _s;vs=1;var e=w,t=fs(),n=ds();function r(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return true;return false}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 true;default:return false}}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=true,this.atScalar=false,this.indent=0,this.offset=0,this.onKeyLine=false,this.stack=[],this.source="",this.type="",this.lexer=new n.Lexer,this.onNewLine=e;}*parse(e,t=false){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=false,yield*this.step(),void(this.offset+=n.length);const r=t.tokenType(n);if(r)if("scalar"===r)this.atNewLine=false,this.atScalar=true,this.type="scalar";else {switch(this.type=r,yield*this.step(),r){case "newline":this.atNewLine=true,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=false;}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=true);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=true,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=true,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=false,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=true):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:true})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:true}]}):(t.start.push(this.sourceToken),t.explicitKey=true),void(this.onKeyLine=true);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=true);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=true):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=true))}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=true,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=true;const t=a(o(e));return t.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:true}]}}case "map-value-ind":{this.onKeyLine=true;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=false;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop());}}},_s}var ws,Ss,As={};function ks(){if(ws)return As;ws=1;var e=Xr(),t=rr(),n=or(),r=xt(),s=Ce(),i=ys(),o=bs();function a(e){const t=false!==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),true,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 As.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))},As.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:true},u.streamInfo())},As.parseDocument=c,As.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)},As}var Es=function(){if(Ss)return xe;Ss=1;var e=Xr(),t=rr(),n=Jn(),r=or(),s=Qe(),i=Ce(),o=Lt(),a=st(),c=zt(),u=Gt(),l=fs(),f=ds(),p=ys(),h=bs(),d=ks(),m=Ne();return xe.Composer=e.Composer,xe.Document=t.Document,xe.Schema=n.Schema,xe.YAMLError=r.YAMLError,xe.YAMLParseError=r.YAMLParseError,xe.YAMLWarning=r.YAMLWarning,xe.Alias=s.Alias,xe.isAlias=i.isAlias,xe.isCollection=i.isCollection,xe.isDocument=i.isDocument,xe.isMap=i.isMap,xe.isNode=i.isNode,xe.isPair=i.isPair,xe.isScalar=i.isScalar,xe.isSeq=i.isSeq,xe.Pair=o.Pair,xe.Scalar=a.Scalar,xe.YAMLMap=c.YAMLMap,xe.YAMLSeq=u.YAMLSeq,xe.CST=l,xe.Lexer=f.Lexer,xe.LineCounter=p.LineCounter,xe.Parser=h.Parser,xe.parse=d.parse,xe.parseAllDocuments=d.parseAllDocuments,xe.parseDocument=d.parseDocument,xe.stringify=d.stringify,xe.visit=m.visit,xe.visitAsync=m.visitAsync,xe}(),xs=B(Es);function Os(e,t,n){function r(n,r){var s;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:false}),(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 $s extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");}}class Rs extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError";}}const Cs={};function Ts(e){return Cs}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 Ns(e){return null==e}function Is(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const Ms=Symbol("evaluating");function Ds(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Ms)return void 0===r&&(r=Ms,r=n()),r},set(n){Object.defineProperty(e,t,{value:n});},configurable:true});}function js(e,t,n){Object.defineProperty(e,t,{value:n,writable:true,enumerable:true,configurable:true});}function Hs(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e);}return Object.defineProperties({},t)}function Fs(e){return JSON.stringify(e)}const Bs="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function zs(e){return "object"==typeof e&&null!==e&&!Array.isArray(e)}const Ks=Ls(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return false;try{return new Function(""),!0}catch(e){return false}});function Us(e){if(false===zs(e))return false;const t=e.constructor;if(void 0===t)return true;const n=t.prototype;return false!==zs(n)&&false!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function qs(e){return Us(e)?{...e}:Array.isArray(e)?[...e]:e}const Zs=new Set(["string","number","symbol"]);function Ws(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Gs(e,t,n){const r=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(r._zod.parent=e),r}function Vs(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 Ys(e,t=0){if(true===e.aborted)return true;for(let n=t;n<e.issues.length;n++)if(true!==e.issues[n]?.continue)return true;return false}function Qs(e,t){return t.map(t=>{var n;return (n=t).path??(n.path=[]),t.path.unshift(e),t})}function Js(e){return "string"==typeof e?e:e?.message}function Xs(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const s=Js(e.inst?._zod.def?.error?.(e))??Js(t?.error?.(e))??Js(n.customError?.(e))??Js(n.localeError?.(e))??"Invalid input";r.message=s;}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function ei(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function ti(...e){const[t,n,r]=e;return "string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}const ni=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:false}),Object.defineProperty(e,"issues",{value:t,enumerable:false}),e.message=JSON.stringify(t,Ps,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:false});},ri=Os("$ZodError",ni),si=Os("$ZodError",ni,{Parent:Error});const ii=e=>(t,n,r,s)=>{const i=r?Object.assign(r,{async:false}):{async:false},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new $s;if(o.issues.length){const t=new(s?.Err??e)(o.issues.map(e=>Xs(e,i,Ts())));throw Bs(t,s?.callee),t}return o.value},oi=e=>async(t,n,r,s)=>{const i=r?Object.assign(r,{async:true}):{async:true};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=>Xs(e,i,Ts())));throw Bs(t,s?.callee),t}return o.value},ai=e=>(t,n,r)=>{const s=r?{...r,async:false}:{async:false},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new $s;return i.issues.length?{success:false,error:new(e??ri)(i.issues.map(e=>Xs(e,s,Ts())))}:{success:true,data:i.value}},ci=ai(si),ui=e=>async(t,n,r)=>{const s=r?Object.assign(r,{async:true}):{async:true};let i=t._zod.run({value:n,issues:[]},s);return i instanceof Promise&&(i=await i),i.issues.length?{success:false,error:new e(i.issues.map(e=>Xs(e,s,Ts())))}:{success:true,data:i.value}},li=ui(si),fi=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ii(e)(t,n,s)},pi=e=>(t,n,r)=>ii(e)(t,n,r),hi=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return oi(e)(t,n,s)},di=e=>async(t,n,r)=>oi(e)(t,n,r),mi=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ai(e)(t,n,s)},gi=e=>(t,n,r)=>ai(e)(t,n,r),yi=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ui(e)(t,n,s)},vi=e=>async(t,n,r)=>ui(e)(t,n,r),_i=/^[cC][^\s-]{8,}$/,bi=/^[0-9a-z]+$/,wi=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Si=/^[0-9a-vA-V]{20}$/,Ai=/^[A-Za-z0-9]{27}$/,ki=/^[a-zA-Z0-9_-]{21}$/,Ei=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,xi=/^([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})$/,Oi=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)$/,$i=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const Ri=/^(?:(?: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])$/,Ci=/^(([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}|:))$/,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])\/([0-9]|[1-2][0-9]|3[0-2])$/,Pi=/^(([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])$/,Li=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ni=/^[A-Za-z0-9_-]*$/,Ii=/^(?=.{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])?)*\.?$/,Mi=/^\+(?:[0-9]){6,14}[0-9]$/,Di="(?:(?:\\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])))",ji=new RegExp(`^${Di}$`);function Hi(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 Fi=/^[^A-Z]*$/,Bi=/^[^a-z]*$/,zi=Os("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[]);}),Ki=Os("$ZodCheckMaxLength",(e,t)=>{var n;zi.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return !Ns(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=ei(r);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:true,input:r,inst:e,continue:!t.abort});};}),Ui=Os("$ZodCheckMinLength",(e,t)=>{var n;zi.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return !Ns(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=ei(r);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:true,input:r,inst:e,continue:!t.abort});};}),qi=Os("$ZodCheckLengthEquals",(e,t)=>{var n;zi.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return !Ns(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=ei(r),o=s>t.length;n.issues.push({origin:i,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:true,exact:true,input:n.value,inst:e,continue:!t.abort});};}),Zi=Os("$ZodCheckStringFormat",(e,t)=>{var n,r;zi.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=()=>{});}),Wi=Os("$ZodCheckRegex",(e,t)=>{Zi.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});};}),Gi=Os("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Fi),Zi.init(e,t);}),Vi=Os("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Bi),Zi.init(e,t);}),Yi=Os("$ZodCheckIncludes",(e,t)=>{zi.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});};}),Qi=Os("$ZodCheckStartsWith",(e,t)=>{zi.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});};}),Ji=Os("$ZodCheckEndsWith",(e,t)=>{zi.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});};}),Xi=Os("$ZodCheckOverwrite",(e,t)=>{zi.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value);};});class eo{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 to={major:4,minor:1,patch:12},no=Os("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=to;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=Ys(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&&false===n?.async)throw new $s;if(r||o instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await o;e.issues.length!==t&&(s||(s=Ys(e,t)));});else {if(e.issues.length===t)continue;s||(s=Ys(e,t));}}return r?r.then(()=>e):e},n=(n,s,i)=>{if(Ys(n))return n.aborted=true,n;const o=t(s,r,i);if(o instanceof Promise){if(false===i.async)throw new $s;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:true});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(false===i.async)throw new $s;return o.then(e=>t(e,r,i))}return t(o,r,i)};}e["~standard"]={validate:t=>{try{const n=ci(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return li(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1};}),ro=Os("$ZodString",(e,t)=>{var n;no.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};}),so=Os("$ZodStringFormat",(e,t)=>{Zi.init(e,t),ro.init(e,t);}),io=Os("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=xi),so.init(e,t);}),oo=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=Oi(e));}else t.pattern??(t.pattern=Oi());so.init(e,t);}),ao=Os("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=$i),so.init(e,t);}),co=Os("$ZodURL",(e,t)=>{so.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:Ii.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});}};}),uo=Os("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),so.init(e,t);}),lo=Os("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=ki),so.init(e,t);}),fo=Os("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=_i),so.init(e,t);}),po=Os("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=bi),so.init(e,t);}),ho=Os("$ZodULID",(e,t)=>{t.pattern??(t.pattern=wi),so.init(e,t);}),mo=Os("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Si),so.init(e,t);}),go$1=Os("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Ai),so.init(e,t);}),yo=Os("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=Hi({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(`^${Di}T(?:${r})$`)}(t)),so.init(e,t);}),vo=Os("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=ji),so.init(e,t);}),_o=Os("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${Hi(t)}$`)),so.init(e,t);}),bo=Os("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ei),so.init(e,t);}),wo=Os("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Ri),so.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv4";});}),So=Os("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Ci),so.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});}};}),Ao=Os("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Ti),so.init(e,t);}),ko=Os("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Pi),so.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 Eo(e){if(""===e)return true;if(e.length%4!=0)return false;try{return atob(e),!0}catch{return false}}const xo=Os("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Li),so.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64";}),e._zod.check=n=>{Eo(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort});};});const Oo=Os("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ni),so.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64url";}),e._zod.check=n=>{(function(e){if(!Ni.test(e))return false;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return Eo(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});};}),$o=Os("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Mi),so.init(e,t);});const Ro=Os("$ZodJWT",(e,t)=>{so.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 false}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort});};}),Co=Os("$ZodUnknown",(e,t)=>{no.init(e,t),e._zod.parse=e=>e;}),To=Os("$ZodNever",(e,t)=>{no.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t);});function Po(e,t,n){e.issues.length&&t.issues.push(...Qs(n,e.issues)),t.value[n]=e.value;}const Lo=Os("$ZodArray",(e,t)=>{no.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=>Po(t,n,e))):Po(a,n,e);}return i.length?Promise.all(i).then(()=>n):n};});function No(e,t,n,r){e.issues.length&&t.issues.push(...Qs(n,e.issues)),void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value;}function Io(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 Mo(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=>No(e,n,s,t))):No(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 Do=Os("$ZodObject",(e,t)=>{no.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(()=>Io(t));Ds(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=zs,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=>No(n,t,e,a))):No(r,t,e,a);}return i?Mo(c,a,t,n,r.value,e):c.length?Promise.all(c).then(()=>t):t};}),jo=Os("$ZodObjectJIT",(e,t)=>{Do.init(e,t);const n=e._zod.parse,r=Ls(()=>Io(t));let s;const i=zs,o=!Cs.jitless,a=o&&Ks.value,c=t.catchall;let u;e._zod.parse=(l,f)=>{u??(u=r.value);const p=l.value;return i(p)?o&&a&&false===f?.async&&true!==f.jitless?(s||(s=(e=>{const t=new eo(["shape","payload","ctx"]),n=r.value,s=e=>{const t=Fs(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=Fs(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?Mo([],p,l,f,u,e):l):n(l,f):(l.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),l)};});function Ho(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=>!Ys(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=>Xs(e,r,Ts())))}),t)}const Fo=Os("$ZodUnion",(e,t)=>{no.init(e,t),Ds(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),Ds(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),Ds(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Ds(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=>Is(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=false;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=true;else {if(0===t.issues.length)return t;a.push(t);}}return o?Promise.all(a).then(t=>Ho(t,s,e,i)):Ho(a,s,e,i)};}),Bo=Os("$ZodIntersection",(e,t)=>{no.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])=>Ko(e,t,n)):Ko(e,s,i)};});function zo(e,t){if(e===t)return {valid:true,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return {valid:true,data:e};if(Us(e)&&Us(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=zo(e[n],t[n]);if(!r.valid)return {valid:false,mergeErrorPath:[n,...r.mergeErrorPath]};s[n]=r.data;}return {valid:true,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return {valid:false,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const s=zo(e[r],t[r]);if(!s.valid)return {valid:false,mergeErrorPath:[r,...s.mergeErrorPath]};n.push(s.data);}return {valid:true,data:n}}return {valid:false,mergeErrorPath:[]}}function Ko(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Ys(e))return e;const r=zo(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 Uo=Os("$ZodRecord",(e,t)=>{no.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!Us(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(...Qs(e,t.issues)),n.value[e]=t.value;})):(o.issues.length&&n.issues.push(...Qs(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=>Xs(e,r,Ts())),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(...Qs(o,e.issues)),n.value[a.value]=e.value;})):(c.issues.length&&n.issues.push(...Qs(o,c.issues)),n.value[a.value]=c.value);}}return i.length?Promise.all(i).then(()=>n):n};}),qo=Os("$ZodEnum",(e,t)=>{no.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=>Zs.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};}),Zo=Os("$ZodTransform",(e,t)=>{no.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new Rs(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 $s;return n.value=s,n};});function Wo(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const Go=Os("$ZodOptional",(e,t)=>{no.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ds(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ds(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Is(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=>Wo(t,e.value)):Wo(r,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)};}),Vo=Os("$ZodNullable",(e,t)=>{no.init(e,t),Ds(e._zod,"optin",()=>t.innerType._zod.optin),Ds(e._zod,"optout",()=>t.innerType._zod.optout),Ds(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Is(e.source)}|null)$`):void 0}),Ds(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);}),Yo=Os("$ZodDefault",(e,t)=>{no.init(e,t),e._zod.optin="optional",Ds(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=>Qo(e,t)):Qo(r,t)};});function Qo(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Jo=Os("$ZodPrefault",(e,t)=>{no.init(e,t),e._zod.optin="optional",Ds(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));}),Xo=Os("$ZodNonOptional",(e,t)=>{no.init(e,t),Ds(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=>ea(t,e)):ea(s,e)};});function ea(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 ta=Os("$ZodCatch",(e,t)=>{no.init(e,t),Ds(e._zod,"optin",()=>t.innerType._zod.optin),Ds(e._zod,"optout",()=>t.innerType._zod.optout),Ds(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=>Xs(e,n,Ts()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Xs(e,n,Ts()))},input:e.value}),e.issues=[]),e)};}),na=Os("$ZodPipe",(e,t)=>{no.init(e,t),Ds(e._zod,"values",()=>t.in._zod.values),Ds(e._zod,"optin",()=>t.in._zod.optin),Ds(e._zod,"optout",()=>t.out._zod.optout),Ds(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=>ra(e,t.in,n)):ra(r,t.in,n)}const r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>ra(e,t.out,n)):ra(r,t.out,n)};});function ra(e,t,n){return e.issues.length?(e.aborted=true,e):t._zod.run({value:e.value,issues:e.issues},n)}const sa=Os("$ZodReadonly",(e,t)=>{no.init(e,t),Ds(e._zod,"propValues",()=>t.innerType._zod.propValues),Ds(e._zod,"values",()=>t.innerType._zod.values),Ds(e._zod,"optin",()=>t.innerType._zod.optin),Ds(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(ia):ia(r)};});function ia(e){return e.value=Object.freeze(e.value),e}const oa=Os("$ZodCustom",(e,t)=>{zi.init(e,t),no.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=>aa(t,n,r,e));aa(s,n,r,e);};});function aa(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(ti(e));}}class ca{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 ua(){return new ca}const la=ua();function fa(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:false,...Vs(t)})}function pa(e,t){return new Ki({check:"max_length",...Vs(t),maximum:e})}function ha(e,t){return new Ui({check:"min_length",...Vs(t),minimum:e})}function da(e,t){return new qi({check:"length_equals",...Vs(t),length:e})}function ma(e){return new Xi({check:"overwrite",tx:e})}function ga(e){const t=function(e,t){const n=new zi({check:"custom",...Vs(t)});return n._zod.check=e,n}(n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(ti(e,n.value,t._zod.def));else {const r=e;r.fatal&&(r.continue=false),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(ti(r));}},e(n.value,n)));return t}const ya=Os("ZodISODateTime",(e,t)=>{yo.init(e,t),Ua.init(e,t);});function va(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:false,local:false,precision:null,...Vs(t)})}(ya,e)}const _a=Os("ZodISODate",(e,t)=>{vo.init(e,t),Ua.init(e,t);});function ba(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Vs(t)})}(_a,e)}const wa=Os("ZodISOTime",(e,t)=>{_o.init(e,t),Ua.init(e,t);});function Sa(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Vs(t)})}(wa,e)}const Aa=Os("ZodISODuration",(e,t)=>{bo.init(e,t),Ua.init(e,t);});function ka(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Vs(t)})}(Aa,e)}const Ea=(e,t)=>{ri.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t=e=>e.message){const n={_errors:[]},r=e=>{for(const s of e.issues)if("invalid_union"===s.code&&s.errors.length)s.errors.map(e=>r({issues:e}));else if("invalid_key"===s.code)r({issues:s.issues});else if("invalid_element"===s.code)r({issues:s.issues});else if(0===s.path.length)n._errors.push(t(s));else {let e=n,r=0;for(;r<s.path.length;){const n=s.path[r];r===s.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(s))):e[n]=e[n]||{_errors:[]},e=e[n],r++;}}};return r(e),n}(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}});},xa=Os("ZodError",Ea),Oa=Os("ZodError",Ea,{Parent:Error}),$a=ii(Oa),Ra=oi(Oa),Ca=ai(Oa),Ta=ui(Oa),Pa=fi(Oa),La=pi(Oa),Na=hi(Oa),Ia=di(Oa),Ma=mi(Oa),Da=gi(Oa),ja=yi(Oa),Ha=vi(Oa),Fa=Os("ZodType",(e,t)=>(no.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)=>Gs(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>$a(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Ca(e,t,n),e.parseAsync=async(t,n)=>Ra(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Ta(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Pa(e,t,n),e.decode=(t,n)=>La(e,t,n),e.encodeAsync=async(t,n)=>Na(e,t,n),e.decodeAsync=async(t,n)=>Ia(e,t,n),e.safeEncode=(t,n)=>Ma(e,t,n),e.safeDecode=(t,n)=>Da(e,t,n),e.safeEncodeAsync=async(t,n)=>ja(e,t,n),e.safeDecodeAsync=async(t,n)=>Ha(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,...Vs(n)})}(Nc,e,t)}(t,n)),e.superRefine=t=>e.check(ga(t)),e.overwrite=t=>e.check(ma(t)),e.optional=()=>kc(e),e.nullable=()=>xc(e),e.nullish=()=>kc(xc(e)),e.nonoptional=t=>function(e,t){return new Rc({type:"nonoptional",innerType:e,...Vs(t)})}(e,t),e.array=()=>mc(e),e.or=t=>vc([e,t]),e.and=t=>new _c({type:"intersection",left:e,right:t}),e.transform=t=>Pc(e,new Sc({type:"transform",transform:t})),e.default=t=>{return n=t,new Oc({type:"default",innerType:e,get defaultValue(){return "function"==typeof n?n():qs(n)}});var n;},e.prefault=t=>{return n=t,new $c({type:"prefault",innerType:e,get defaultValue(){return "function"==typeof n?n():qs(n)}});var n;},e.catch=t=>{return new Cc({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n;},e.pipe=t=>Pc(e,t),e.readonly=()=>new Lc({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return la.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>la.get(e)?.description,configurable:true}),e.meta=(...t)=>{if(0===t.length)return la.get(e);const n=e.clone();return la.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Ba=Os("_ZodString",(e,t)=>{ro.init(e,t),Fa.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 Wi({check:"string_format",format:"regex",...Vs(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Yi({check:"string_format",format:"includes",...Vs(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new Qi({check:"string_format",format:"starts_with",...Vs(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new Ji({check:"string_format",format:"ends_with",...Vs(t),suffix:e})}(...t)),e.min=(...t)=>e.check(ha(...t)),e.max=(...t)=>e.check(pa(...t)),e.length=(...t)=>e.check(da(...t)),e.nonempty=(...t)=>e.check(ha(1,...t)),e.lowercase=t=>e.check(function(e){return new Gi({check:"string_format",format:"lowercase",...Vs(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Vi({check:"string_format",format:"uppercase",...Vs(e)})}(t)),e.trim=()=>e.check(ma(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return ma(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(ma(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(ma(e=>e.toUpperCase()));}),za=Os("ZodString",(e,t)=>{ro.init(e,t),Ba.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:false,...Vs(t)})}(qa,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:false,...Vs(t)})}(Ga,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:false,...Vs(t)})}(uc,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:false,...Vs(t)})}(Va,t)),e.guid=t=>e.check(fa(Za,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,...Vs(t)})}(Wa,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v4",...Vs(t)})}(Wa,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v6",...Vs(t)})}(Wa,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v7",...Vs(t)})}(Wa,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:false,...Vs(t)})}(Ya,t)),e.guid=t=>e.check(fa(Za,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:false,...Vs(t)})}(Qa,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:false,...Vs(t)})}(Ja,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:false,...Vs(t)})}(Xa,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:false,...Vs(t)})}(oc,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:false,...Vs(t)})}(ac,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:false,...Vs(t)})}(ec,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:false,...Vs(t)})}(tc,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:false,...Vs(t)})}(nc,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:false,...Vs(t)})}(rc,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:false,...Vs(t)})}(sc,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:false,...Vs(t)})}(ic,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:false,...Vs(t)})}(cc,t)),e.datetime=t=>e.check(va(t)),e.date=t=>e.check(ba(t)),e.time=t=>e.check(Sa(t)),e.duration=t=>e.check(ka(t));});function Ka(e){return function(e,t){return new e({type:"string",...Vs(t)})}(za,e)}const Ua=Os("ZodStringFormat",(e,t)=>{so.init(e,t),Ba.init(e,t);}),qa=Os("ZodEmail",(e,t)=>{ao.init(e,t),Ua.init(e,t);}),Za=Os("ZodGUID",(e,t)=>{io.init(e,t),Ua.init(e,t);}),Wa=Os("ZodUUID",(e,t)=>{oo.init(e,t),Ua.init(e,t);}),Ga=Os("ZodURL",(e,t)=>{co.init(e,t),Ua.init(e,t);}),Va=Os("ZodEmoji",(e,t)=>{uo.init(e,t),Ua.init(e,t);}),Ya=Os("ZodNanoID",(e,t)=>{lo.init(e,t),Ua.init(e,t);}),Qa=Os("ZodCUID",(e,t)=>{fo.init(e,t),Ua.init(e,t);}),Ja=Os("ZodCUID2",(e,t)=>{po.init(e,t),Ua.init(e,t);}),Xa=Os("ZodULID",(e,t)=>{ho.init(e,t),Ua.init(e,t);}),ec=Os("ZodXID",(e,t)=>{mo.init(e,t),Ua.init(e,t);}),tc=Os("ZodKSUID",(e,t)=>{go$1.init(e,t),Ua.init(e,t);}),nc=Os("ZodIPv4",(e,t)=>{wo.init(e,t),Ua.init(e,t);}),rc=Os("ZodIPv6",(e,t)=>{So.init(e,t),Ua.init(e,t);}),sc=Os("ZodCIDRv4",(e,t)=>{Ao.init(e,t),Ua.init(e,t);}),ic=Os("ZodCIDRv6",(e,t)=>{ko.init(e,t),Ua.init(e,t);}),oc=Os("ZodBase64",(e,t)=>{xo.init(e,t),Ua.init(e,t);}),ac=Os("ZodBase64URL",(e,t)=>{Oo.init(e,t),Ua.init(e,t);}),cc=Os("ZodE164",(e,t)=>{$o.init(e,t),Ua.init(e,t);}),uc=Os("ZodJWT",(e,t)=>{Ro.init(e,t),Ua.init(e,t);}),lc=Os("ZodUnknown",(e,t)=>{Co.init(e,t),Fa.init(e,t);});function fc(){return new lc({type:"unknown"})}const pc=Os("ZodNever",(e,t)=>{To.init(e,t),Fa.init(e,t);});function hc(e){return function(e,t){return new e({type:"never",...Vs(t)})}(pc,e)}const dc=Os("ZodArray",(e,t)=>{Lo.init(e,t),Fa.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(ha(t,n)),e.nonempty=t=>e.check(ha(1,t)),e.max=(t,n)=>e.check(pa(t,n)),e.length=(t,n)=>e.check(da(t,n)),e.unwrap=()=>e.element;});function mc(e,t){return function(e,t,n){return new e({type:"array",element:t,...Vs(n)})}(dc,e,t)}const gc=Os("ZodObject",(e,t)=>{jo.init(e,t),Fa.init(e,t),Ds(e,"shape",()=>t.shape),e.keyof=()=>function(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new wc({type:"enum",entries:n,...Vs(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:fc()}),e.loose=()=>e.clone({...e._zod.def,catchall:fc()}),e.strict=()=>e.clone({...e._zod.def,catchall:hc()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Us(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 js(this,"shape",n),n},checks:[]});return Gs(e,r)}(e,t),e.safeExtend=t=>function(e,t){if(!Us(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 js(this,"shape",n),n},checks:e._zod.def.checks};return Gs(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 js(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Gs(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def;return Gs(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 js(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 js(this,"shape",r),r},checks:[]});return Gs(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 js(this,"shape",s),s},checks:[]});return Gs(t,r)}(Ac,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 js(this,"shape",s),s},checks:[]});return Gs(t,r)}(Rc,e,t[0]);});const yc=Os("ZodUnion",(e,t)=>{Fo.init(e,t),Fa.init(e,t),e.options=t.options;});function vc(e,t){return new yc({type:"union",options:e,...Vs(t)})}const _c=Os("ZodIntersection",(e,t)=>{Bo.init(e,t),Fa.init(e,t);});const bc=Os("ZodRecord",(e,t)=>{Uo.init(e,t),Fa.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType;});const wc=Os("ZodEnum",(e,t)=>{qo.init(e,t),Fa.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 wc({...t,checks:[],...Vs(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 wc({...t,checks:[],...Vs(r),entries:s})};});const Sc=Os("ZodTransform",(e,t)=>{Zo.init(e,t),Fa.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new Rs(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(ti(r,n.value,t));else {const t=r;t.fatal&&(t.continue=false),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(ti(t));}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(e=>(n.value=e,n)):(n.value=s,n)};});const Ac=Os("ZodOptional",(e,t)=>{Go.init(e,t),Fa.init(e,t),e.unwrap=()=>e._zod.def.innerType;});function kc(e){return new Ac({type:"optional",innerType:e})}const Ec=Os("ZodNullable",(e,t)=>{Vo.init(e,t),Fa.init(e,t),e.unwrap=()=>e._zod.def.innerType;});function xc(e){return new Ec({type:"nullable",innerType:e})}const Oc=Os("ZodDefault",(e,t)=>{Yo.init(e,t),Fa.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap;});const $c=Os("ZodPrefault",(e,t)=>{Jo.init(e,t),Fa.init(e,t),e.unwrap=()=>e._zod.def.innerType;});const Rc=Os("ZodNonOptional",(e,t)=>{Xo.init(e,t),Fa.init(e,t),e.unwrap=()=>e._zod.def.innerType;});const Cc=Os("ZodCatch",(e,t)=>{ta.init(e,t),Fa.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap;});const Tc=Os("ZodPipe",(e,t)=>{na.init(e,t),Fa.init(e,t),e.in=t.in,e.out=t.out;});function Pc(e,t){return new Tc({type:"pipe",in:e,out:t})}const Lc=Os("ZodReadonly",(e,t)=>{sa.init(e,t),Fa.init(e,t),e.unwrap=()=>e._zod.def.innerType;});const Nc=Os("ZodCustom",(e,t)=>{oa.init(e,t),Fa.init(e,t);});const Ic=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},Mc=(e,t)=>{const n=t?JSON.parse(e):xs.parse(e);return n&&"object"==typeof n?n:{}},Dc=mc(Ka()).default([]).optional(),jc=vc([Ka(),mc(Ka())]),Hc=(Fc=Ka(),Bc=jc,new bc({type:"record",keyType:Fc,valueType:Bc,...Vs(zc)})).optional();var Fc,Bc,zc;const Kc=function(e,t){const n={type:"object",shape:e??{},...Vs(t)};return new gc(n)}({stanPath:Ka().min(1,{message:"stanPath must be a non-empty string"}),includes:Dc,excludes:Dc,imports:Hc}).strict(),Uc=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 xa?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))}},qc=e=>{const t=ke(e);if(!t)throw new Error("stan config not found");const r=readFileSync(t,"utf8"),s=Mc(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=Uc(s["stan-core"]),o=Ic(i.imports);return {stanPath:i.stanPath,includes:i.includes??[],excludes:i.excludes??[],imports:o}},Zc=async e=>{const t=ke(e);if(!t)throw new Error("stan config not found");const n=t.replace(/\\/g,"/");return (async(e,t)=>{const n=await readFile(e,"utf8"),r=Mc(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=Uc(r["stan-core"]),o=Ic(s.imports);return {stanPath:s.stanPath,includes:s.includes??[],excludes:s.excludes??[],imports:o}})(t,n)},Wc=e=>{try{return qc(e).stanPath}catch{return ve}},Gc=async e=>{try{return (await Zc(e)).stanPath}catch{return ve}},Vc=(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:resolve(e,n),systemAbs:resolve(e,r),outputAbs:resolve(e,s),diffAbs:resolve(e,i),distAbs:resolve(e,o),patchAbs:resolve(e,a),importsAbs:resolve(e,c)}};var Yc={makeStanDirs:Vc},Qc=Object.freeze({__proto__:null,default:Yc,makeStanDirs:Vc});const Jc=async(e,n,i=false)=>{const a=Vc(e,n);if(await me(e,n),!i){const e=resolve(a.outputAbs,T);if(existsSync(e))try{await copyFile(e,resolve(a.diffAbs,P));}catch{}const n=await readdir(a.outputAbs,{withFileTypes:true});for(const e of n)rmSync(resolve(a.outputAbs,e.name),{recursive:true,force:true});}return a.rootAbs},Xc=async(e,t)=>{const n={};for(const r of t){const t=resolve(e,r),s=await readFile(t),o=createHash("sha256").update(s).digest("hex");n[r]=o;}return n},eu=e=>join(e,".archive.snapshot.json"),tu=async({cwd:e,stanPath:t,includes:n,excludes:r,anchors:s})=>{const{diffDir:i}=await ge(e,t),o=await fe(e),c=await de(o,{cwd:e,stanPath:t,includeOutputDir:false,includes:n??[],excludes:r??[],anchors:s??[]}),u=await Xc(e,c),l=eu(i);return await writeFile(l,JSON.stringify(u,null,2),"utf8"),l},nu=async({cwd:e,stanPath:n,baseName:r,includes:s,excludes:o,updateSnapshot:c="createIfMissing",includeOutputDirInDiff:u=false,anchors:l,onArchiveWarnings:f})=>{const{outDir:p,diffDir:d}=await ge(e,n),m=await fe(e),g=await de(m,{cwd:e,stanPath:n,includeOutputDir:false,includes:s??[],excludes:o??[],anchors:l??[]}),y=await Xc(e,g),v=eu(d),_=existsSync(v),b=_?JSON.parse(await readFile(v,"utf8")):{},w=_?g.filter(e=>!b[e]||b[e]!==y[e]):[...g],S=await(async()=>{try{const e=await import('./classifier-DeYwffC_-DftahF7h.js'),t=e.classifyForArchive,n=e.default?.classifyForArchive,r="function"==typeof t?t:n;if("function"==typeof r)return r}catch{}throw new Error("classifyForArchive export not found in ./classifier")})(),{textFiles:A,warningsBody:k}=await S(e,w),E=A;H(k,f);const x=join(p,`${r}.diff.tar`),O=await import('./index-ucZa1KMb-CNGeWGvV.js');if(u)await O.create({file:x,cwd:e,filter:D(n)},j(E,n));else if(0===E.length){const t=(e=>join(e,".stan_no_changes"))(d);await writeFile(t,"no changes","utf8");const r=[`${n.replace(/\\/g,"/")}/diff/.stan_no_changes`];await O.create({file:x,cwd:e},r);}else {const t=Array.from(new Set([...E]));await O.create({file:x,cwd:e},t);}return "replace"===c?await writeFile(v,JSON.stringify(y,null,2),"utf8"):"createIfMissing"!==c||_||await writeFile(v,JSON.stringify(y,null,2),"utf8"),{diffPath:x}},ru=e=>e.replace(/\\/g,"/").replace(/^\.\/+/,""),su=e=>{if("string"!=typeof e||!e.trim())return null;const t=ru(e.trim());if(/^[/\\]/.test(t))return null;const n=t.split("/").filter(Boolean);if(n.some(e=>".."===e))return null;const r=n.join("/");return r.length?r:null},iu=e=>{const t=/^###\s+File Ops\s*$/m.exec(e);if(!t)return null;const n=t.index+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},ou=/^###\s+Patch:\s+(.+?)\s*$/m,au=/^###\s+Full Listing:\s+(.+?)\s*$/m,cu=/^##\s+Commit Message\s*$/m,uu=/^##\s+.*$|^###\s+.*$/m,lu=e=>{const t=[],n=[];{const t=new RegExp(uu.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(cu.test(o)){t.push({kind:"commit",start:s,body:o});continue}const a=o.match(ou);if(a&&a[1]){t.push({kind:"patch",path:ru(a[1].trim()),start:s,body:o});continue}const c=o.match(au);c&&c[1]&&t.push({kind:"full",path:ru(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:ru(r[1]),b:ru(r[2])});return n},pu=e=>{const t=[];((e,t)=>{const n=iu(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=>su(e);if(/^(mv|rm|rmdir|mkdirp)$/.test(i)){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}1===o.length?u(o[0])||c(`${i}: invalid repo-relative path`):c(`expected 1 path, got ${o.length.toString()}`);}else c(`unknown verb "${i}"`);}})(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=ru("string"==typeof t.path?t.path:"(unknown)");e.set(n,t);}for(const n of r){const r=ru(n.path),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 {"commit"!==n[n.length-1].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=n[0]?.b,r="string"==typeof t?ru(t):"";r.length&&e.push(r);}else {const n=t.path?ru(t.path):"";n.length&&e.push(n);}}const n=e=>".stan/system/stan.todo.md"===ru(e),s=e=>{const t=ru(e);if(!t)return false;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:[]}},hu=e=>{const t=pu(e);if(!t.ok){const e="Response-format validation failed:\n"+t.errors.map(e=>`- ${e}`).join("\n");throw new Error(e)}},du={extractBlocks:lu,parseDiffHeaders:fu,isCommitLast:e=>{if(!e.match(cu))return false;const t=e.search(cu);if(t<0)return false;const n=e.slice(t),r=n.match(/^`{3,}/m);if(!r)return false;const s=(r[0].match(/`/g)??[]).length,i=new RegExp(`^\\\`{${String(s)}{'}}\\s*$`,"m");if(!n.match(i))return false;const o=n.search(i);if(o<0)return false;return 0===n.slice(o+s).trim().length}},mu=e=>e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),gu=e=>e.endsWith("\n")?e:e+"\n",yu=/[\u200B-\u200D\uFEFF]/g,vu=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)),_u=e=>{const t=mu(e).replace(yu,"");return gu(t)},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;})(_u(e.trim())),n=_u(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(t[n].trimEnd()==="`".repeat(r)){const r=t.slice(e+1,n).join("\n");if(vu(r))return r;e=n;break}}let n=e.search(/^diff --git /m);return n<0&&(n=e.search(/^---\s+(?:a\/|\S)/m)),n<0?null:e.slice(n).replace(/\n`{3,}\s*$/m,"\n")})(n);return gu(r?_u(r).trimEnd():n)},wu=e=>{const t=[],n=[],r=iu(e),s=r?{body:r}:null;if(!s)return {ops:t,errors:n};const i=s.body.split(/\r?\n/);let o=0;for(const e of i){o+=1;const r=e.trim();if(!r)continue;const s=r.split(/\s+/),i=s[0],a=s.slice(1),c=e=>{n.push(`file-ops line ${o.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=>su(e);switch(i){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 "${i}"`);}}return {ops:t,errors:n}},Su=async(e,t,n=false)=>{const r=[],i=t=>((e,t)=>{const n=path.resolve(e,t),r=path.resolve(e)+path.sep,s=n===path.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 pathExists(t),c=await pathExists(s);if(!a)throw new Error("source does not exist");if(c)throw new Error("destination exists (no overwrite)");n||(await ensureDir(path.dirname(s)),await move(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 pathExists(t))throw new Error("path does not exist");n||await remove(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 stat(t);}catch{o=null;}if(!o)throw new Error("directory does not exist");if(!o.isDirectory())throw new Error("not a directory");if((await readdir(t)).length>0)throw new Error("directory not empty");n||await remove(t);}else {const{abs:t,ok:r}=i(e.src);if(!r)throw new Error("path escapes repo root");n||await ensureDir(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 Au(e){return Array.isArray(e)?e.map(e=>Au(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 ku(e){return Array.isArray(e)?e.map(e=>ku(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 Eu(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 xu(e,t,n){let r=true,s=false,i=false,o=1;return function a(){if(r&&!i){if(s?o++:r=false,e+o<=n)return e+o;i=true;}if(!s)return i||(r=true),t<=e-o?e-o++:(s=true,a())}}function Ou(e,t,n={}){let r;if(r="string"==typeof t?Eu(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=Au(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=ku(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=false,l=false;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=true:"-"==c[0]&&(l=true)),c=t;}if(u){if(l){if(!o&&""==r[r.length-1])return false}else if(""==r[r.length-1])r.pop();else if(!o)return false}else if(l)if(""!=r[r.length-1])r.push("");else if(!o)return false;function f(e,t,n,s=0,o=true,a=[],c=0){let u=0,l=false;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,false,a,c+1)):null;t++,u=0;}if("+"===h){if(!o)return null;a[c]=d,c++,u=0,l=true;}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,false,a,c+1)||f(e,t+1,n-1,s,false,a,c+1))||f(e,t,n-1,s+1,false,a,c);c++,o=true,l=false,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=xu(c,a,i);for(;void 0!==c&&(n=f(t.lines,c,e),!n);c=r());if(n)break}if(!n)return false;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 $u=async e=>{const t=path.dirname(e);try{await ensureDir(t);}catch{}},Ru=e=>{if(!e)return null;const t=e.replace(/^a\//,"").replace(/^b\//,"").trim();return t.length?t:null},Cu=e=>"string"==typeof e&&"/dev/null"===e.trim(),Tu=e=>e.replace(/\r/g,"").replace(/[ \t]+$/g,""),Pu=e=>e.replace(/\n/g,"\r\n"),Lu=async e=>{const{cwd:t,cleaned:n,check:r,sandboxRoot:s}=e;let o;try{o=Eu(n);}catch{return {okFiles:[],failed:[{path:"(patch)",reason:"invalid unified diff"}],sandboxRoot:s}}const c=o.some(e=>{const t=Ru(e.oldFileName),n=Ru(e.newFileName);return Boolean(t&&t.length||n&&n.length)});if(!o.length||!c)return {okFiles:[],failed:[{path:"(patch)",reason:"invalid unified diff"}],sandboxRoot:s};const u=[],l=[];for(const e of o){const n=Ru(e.newFileName)??Ru(e.oldFileName);if(!n){l.push({path:"(unknown)",reason:"no file name in patch header"});continue}const o=n.replace(/^\.\//,"").replace(/\\/g,"/"),c=path.resolve(t,o),p=/\.md$/i.test(o);let h="",d=false,m=true;try{const e=await readFile(c,"utf8");h=e,d=/\r\n/.test(e);}catch{m=false;}const g=Cu(e.oldFileName);if(!m&&!g){l.push({path:o,reason:"target file not found"});continue}let y;!m&&g&&(h="",d=false);try{y=Ou(h,e,{compareLine:(e,t,n,r)=>Tu(t)===Tu(r),fuzzFactor:p?1:0});}catch{l.push({path:o,reason:"unable to parse or place hunk(s)"});continue}if(false===y||"string"!=typeof y){l.push({path:o,reason:"unable to place hunk(s)"});continue}const v=d?Pu(y.replace(/\r/g,"")):y.replace(/\r/g,"");try{if(r){const e=s??path.join(t,".stan","patch",".sandbox"),n=path.resolve(e,o);await $u(n),await writeFile(n,v,"utf8");}else {try{await $u(c);}catch{}await writeFile(c,v,"utf8");}u.push(o);}catch{l.push({path:o,reason:"write failed"});}}return {okFiles:u,failed:l,sandboxRoot:s}},Nu=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)),c=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=spawn("git",["apply",...o.args,t],{cwd:e,shell:false,windowsHide:true});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:true,tried:s,lastCode:0,captures:i};r&&console.error(`stan: git apply failed for ${o.label} (exit ${String(n)})`);}return {ok:false,tried:s,lastCode:1,captures:i}})(t,n,o);if(c.ok)return {ok:true,result:c,js:null};const l=await Lu({cwd:t,cleaned:r,check:s});if(l.okFiles.length>0&&0===l.failed.length)return {ok:true,result:c,js:l};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=t[1].trim().replace(/^\.\//,"").replace(/\\/g,"/");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 c=[];let l=!1;for(let e=s+1;e<r.length;e+=1){const t=r[e];if(/^diff --git /.test(t))break;if(/^@@ /.test(t))l=!0;else if(l&&/^[ +-]/.test(t)){const e=t[0];"+"!==e&&" "!==e||c.push(t.slice(1));}}let p=c.join("\n");p.endsWith("\n")||(p+="\n");const h=n?path.join(e,".stan","patch",".sandbox","F"):e,d=path.resolve(h,i);return await mkdir(path.dirname(d),{recursive:!0}),await writeFile(d,p,"utf8"),{okFiles:[i],failed:[],sandboxRoot:n?h:void 0}})(t,r,s);if(e)return {ok:!0,result:c,js:e}}catch{}return {ok:false,result:c,js:l}};var Iu,Mu={},Du={},ju={};function Hu(){if(Iu)return ju;return Iu=1,Object.defineProperty(ju,"__esModule",{value:true}),ju.splitWhen=ju.flatten=void 0,ju.flatten=function(e){return e.reduce((e,t)=>[].concat(e,t),[])},ju.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},ju}var Fu,Bu={};function zu(){if(Fu)return Bu;return Fu=1,Object.defineProperty(Bu,"__esModule",{value:true}),Bu.isEnoentCodeError=void 0,Bu.isEnoentCodeError=function(e){return "ENOENT"===e.code},Bu}var Ku,Uu={};var qu,Zu={};function Wu(){if(qu)return Zu;qu=1,Object.defineProperty(Zu,"__esModule",{value:true}),Zu.convertPosixPathToPattern=Zu.convertWindowsPathToPattern=Zu.convertPathToPattern=Zu.escapePosixPath=Zu.escapeWindowsPath=Zu.escape=Zu.removeLeadingDotSegment=Zu.makeAbsolute=Zu.unixify=void 0;const e=x,t="win32"===E.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 Zu.unixify=function(e){return e.replace(/\\/g,"/")},Zu.makeAbsolute=function(t,n){return e.resolve(t,n)},Zu.removeLeadingDotSegment=function(e){if("."===e.charAt(0)){const t=e.charAt(1);if("/"===t||"\\"===t)return e.slice(2)}return e},Zu.escape=t?o:a,Zu.escapeWindowsPath=o,Zu.escapePosixPath=a,Zu.convertPathToPattern=t?c:u,Zu.convertWindowsPathToPattern=c,Zu.convertPosixPathToPattern=u,Zu}var Gu,Vu,Yu,Qu,Ju,Xu,el={};function tl(){return Vu?Gu:(Vu=1,Gu=function(e){if("string"!=typeof e||""===e)return false;for(var t;t=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(t[2])return true;e=e.slice(t.index+t[0].length);}return false})}function nl(){if(Qu)return Yu;Qu=1;var e=tl(),t={"{":"}","(":")","[":"]"},n=function(e){if("!"===e[0])return true;for(var n=0,r=-2,s=-2,i=-2,o=-2,a=-2;n<e.length;){if("*"===e[n])return true;if("?"===e[n+1]&&/[\].+)]/.test(e[n]))return true;if(-1!==s&&"["===e[n]&&"]"!==e[n+1]&&(s<n&&(s=e.indexOf("]",n)),s>n)){if(-1===a||a>s)return true;if(-1===(a=e.indexOf("\\",n))||a>s)return true}if(-1!==i&&"{"===e[n]&&"}"!==e[n+1]&&(i=e.indexOf("}",n))>n&&(-1===(a=e.indexOf("\\",n))||a>i))return true;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 true;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 true;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 true}else n++;}return false},r=function(e){if("!"===e[0])return true;for(var n=0;n<e.length;){if(/[*?{}()[\]]/.test(e[n]))return true;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 true}else n++;}return false};return Yu=function(t,s){if("string"!=typeof t||""===t)return false;if(e(t))return true;var i=n;return s&&false===s.strict&&(i=r),i(t)}}var rl,sl,il,ol,al,cl,ul,ll,fl,pl,hl,dl,ml,gl,yl,vl,_l,bl,wl,Sl={};function Al(){return rl||(rl=1,(e=Sl).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)=>false!==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)&&true!==r.escaped&&(r.value="\\"+r.value,r.escaped=true);},e.encloseBrace=e=>!("brace"!==e.type||e.commas>>0+e.ranges|0||(e.invalid=true,0)),e.isInvalidBrace=e=>!("brace"!==e.type||true!==e.invalid&&!e.dollar&&(e.commas>>0+e.ranges|0&&true===e.open&&true===e.close||(e.invalid=true,0))),e.isOpenOrClose=e=>"open"===e.type||"close"===e.type||true===e.open||true===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}),Sl;var e;}function kl(){if(il)return sl;il=1;const e=Al();return sl=(t,n={})=>{const r=(t,s={})=>{const i=n.escapeInvalid&&e.isInvalidBrace(s),o=true===t.invalid&&true===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 El(){return al?ol:(al=1,ol=function(e){return "number"==typeof e?e-e===0:"string"==typeof e&&""!==e.trim()&&(Number.isFinite?Number.isFinite(+e):isFinite(+e))})}function xl(){if(ul)return cl;ul=1;const e=El(),t=(n,i,o)=>{if(false===e(n))throw new TypeError("toRegexRange: expected the first argument to be a number");if(void 0===i||n===i)return String(n);if(false===e(i))throw new TypeError("toRegexRange: expected the second argument to be a number.");let a={relaxZeros:true,...o};"boolean"==typeof a.strictZeros&&(a.relaxZeros=false===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})`:false===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,"-",false)||[],r=s(t,e,"",false)||[],i=s(e,t,"-?",true)||[];return n.concat(i).concat(r).join("|")}(m,d),true===a.capture?h.result=`(${h.result})`:false!==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+=true===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=false!==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={},cl=t}function Ol(){if(fl)return ll;fl=1;const e=O,t=xl(),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 false;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 false===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:false,...s});let i=String.fromCharCode(e);return e===n?i:`[${i}-${String.fromCharCode(n)}]`},u=(e,n,r)=>{if(Array.isArray(e)){let t=true===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(true===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(true===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=false===g&&false===((e,t,n)=>"string"==typeof e||"string"==typeof t||true===n.stringify)(e,t,r),_=r.transform||(e=>t=>true===e?Number(t):String(t))(v);if(r.toRegex&&1===n)return c(a(e,y),a(t,y),true,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;) true===r.toRegex&&n>1?w(s):S.push(o(_(s,A),y,v)),s=p?s-n:s+n,A++;return true===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:false,...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 true===a.capture&&(a.wrap=true),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,false,r);let d=[],m=0;for(;l?o>=a:o<=a;)d.push(i(o,m)),o=l?o-n:o+n,m++;return true===r.toRegex?u(d,null,{wrap:false,options:r}):d})(e,t,Math.max(Math.abs(i),1),a):null==i||n(i)?h(e,t,1,i):((e,t)=>{if(true===t.strictRanges)throw new TypeError(`Expected step "${e}" to be a number`);return []})(i,a)};return ll=h}function $l(){if(_l)return vl;_l=1;const e=kl(),{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}=yl?gl:(yl=1,gl={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 vl=(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,O=0,$=0;const R=()=>g[O++],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"});O<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++;O<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(true!==y.keepQuotes&&(x="");O<E&&(t=R());)if(t!==n){if(t===e){ true===y.keepQuotes&&(x+=t);break}x+=t;}else x+=t+R();C({type:"text",value:x});continue}if(x===c){$++;const e=A.value&&"$"===A.value.slice(-1)||true===S.dollar;S=C({type:"brace",open:true,close:false,dollar:e,depth:$,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=true,C({type:e,value:x}),$--,S=w[w.length-1];continue}if(x===s&&$>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&&$>0&&0===S.commas){const e=S.nodes;if(0===$||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=true,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=true),"close"===e.type&&(e.isClose=true),e.nodes||(e.type="text"),e.invalid=true);});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}}function Rl(){if(wl)return bl;wl=1;const e=kl(),t=function(){if(hl)return pl;hl=1;const e=Ol(),t=Al();return pl=(n,r={})=>{const s=(n,i={})=>{const o=t.isInvalidBrace(i),a=true===n.invalid&&true===r.escapeInvalid,c=true===o||true===a,u=true===r.escapeInvalid?"\\":"";let l="";if(true===n.isOpen)return u+n.value;if(true===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:false,toRegex:true,strictZeros:true});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(ml)return dl;ml=1;const e=Ol(),t=kl(),n=Al(),r=(e="",t="",s=false)=>{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) true===s&&"string"==typeof e&&(e=`{${e}}`),i.push(Array.isArray(e)?r(n,e,s):n+e);return n.flatten(i)};return dl=(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&&true!==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))},dl}(),r=$l(),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&&true===t.expand&&true===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 true===t.noempty&&(r=r.filter(Boolean)),true===t.nodupes&&(r=[...new Set(r)]),r},s.create=(e,t={})=>""===e||e.length<3?[e]:true!==t.expand?s.compile(e,t):s.expand(e,t),bl=s}var Cl,Tl,Pl,Ll,Nl,Il,Ml,Dl,jl,Hl,Fl,Bl,zl,Kl,Ul={};function ql(){if(Tl)return Cl;Tl=1;const e=x,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 Cl={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=>true===e?l:u}}function Zl(){return Pl||(Pl=1,function(e){const t=x,n="win32"===process.platform,{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:s,REGEX_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_GLOBAL:o}=ql();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:true===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 true===t.negated&&(r=`(?:^(?!${r}).*$)`),r};}(Ul)),Ul}function Wl(){if(jl)return Dl;jl=1;const e=x,t=function(){if(Nl)return Ll;Nl=1;const e=Zl(),{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}=ql(),g=e=>e===a||e===r,y=e=>{ true!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1);};return Ll=(v,_)=>{const b=_||{},w=v.length-1,S=true===b.parts||true===b.scanToEnd,A=[],k=[],E=[];let x,O,$=v,R=-1,C=0,T=0,P=false,L=false,N=false,I=false,M=false,D=false,j=false,H=false,F=false,B=false,z=0,K={value:"",depth:0,isGlob:false};const U=()=>R>=w,q=()=>$.charCodeAt(R+1),Z=()=>(x=O,$.charCodeAt(++R));for(;R<w;){let e;if(O=Z(),O!==r){if(true===D||O===c){for(z++;true!==U()&&(O=Z());)if(O!==r)if(O!==c){if(true!==D&&O===i&&(O=Z())===i){if(P=K.isBrace=true,N=K.isGlob=true,B=true,true===S)continue;break}if(true!==D&&O===s){if(P=K.isBrace=true,N=K.isGlob=true,B=true,true===S)continue;break}if(O===h&&(z--,0===z)){D=false,P=K.isBrace=true,B=true;break}}else z++;else j=K.backslashes=true,Z();if(true===S)continue;break}if(O!==a){if(true!==b.noext&&true==(O===f||O===n||O===t||O===p||O===o)&&q()===u){if(N=K.isGlob=true,I=K.isExtglob=true,B=true,O===o&&R===C&&(F=true),true===S){for(;true!==U()&&(O=Z());)if(O!==r){if(O===d){N=K.isGlob=true,B=true;break}}else j=K.backslashes=true,O=Z();continue}break}if(O===t){if(x===t&&(M=K.isGlobstar=true),N=K.isGlob=true,B=true,true===S)continue;break}if(O===p){if(N=K.isGlob=true,B=true,true===S)continue;break}if(O===l){for(;true!==U()&&(e=Z());)if(e!==r){if(e===m){L=K.isBracket=true,N=K.isGlob=true,B=true;break}}else j=K.backslashes=true,Z();if(true===S)continue;break}if(true===b.nonegate||O!==o||R!==C){if(true!==b.noparen&&O===u){if(N=K.isGlob=true,true===S){for(;true!==U()&&(O=Z());)if(O!==u){if(O===d){B=true;break}}else j=K.backslashes=true,O=Z();continue}break}if(true===N){if(B=true,true===S)continue;break}}else H=K.negated=true,C++;}else {if(A.push(R),k.push(K),K={value:"",depth:0,isGlob:false},true===B)continue;if(x===i&&R===C+1){C+=2;continue}T=R+1;}}else j=K.backslashes=true,O=Z(),O===c&&(D=true);} true===b.noext&&(I=false,N=false);let W=$,G="",V="";C>0&&(G=$.slice(0,C),$=$.slice(C),T-=C),W&&true===N&&T>0?(W=$.slice(0,T),V=$.slice(T)):true===N?(W="",V=$):W=$,W&&""!==W&&"/"!==W&&W!==$&&g(W.charCodeAt(W.length-1))&&(W=W.slice(0,-1)),true===b.unescape&&(V&&(V=e.removeBackslashes(V)),W&&true===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(true===b.tokens&&(Y.maxDepth=0,g(O)||k.push(K),Y.tokens=k),true===b.parts||true===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=true,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},Ll}(),n=function(){if(Ml)return Il;Ml=1;const e=ql(),t=Zl(),{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:O,NO_DOTS_SLASH:$,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=true===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:true===p.dot,consumed:"",output:"",prefix:"",backtrack:false,negated:false,brackets:0,braces:0,parens:0,quotes:0,globstar:false,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=true,D.start++,true)},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=true===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:true,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:false}).output;n=e.close=`)${s})${r})`;}"bos"===e.prev.type&&(D.negatedExtglob=true);}J({type:"paren",extglob:true,value:B,output:n}),Q("parens");};if(false!==p.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(l)){let e=false,n=l.replace(i,(t,n,r,s,i,o)=>"\\"===s?(e=true,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 true===e&&(n=true===p.unescape?n.replace(/\\/g,""):n.replace(/\\+/g,e=>e.length%2==0?"\\\\":e?"\\":"")),n===l&&true===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&&true!==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+="\\")),true===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(false!==p.posix&&":"===B){const e=z.value.slice(1);if(e.includes("[")&&(z.posix=true,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=true,q(),m.output||1!==g.indexOf(z)||(m.output=k);continue}}}("["===B&&":"!==U()||"-"===B&&"]"===U())&&(B=`\\${B}`),"]"!==B||"["!==z.value&&"[^"!==z.value||(B=`\\${B}`),true===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,true===p.keepQuotes&&J({type:"text",value:B});continue}if("("===B){Y("parens"),J({type:"paren",value:B});continue}if(")"===B){if(0===D.parens&&true===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(true!==p.nobracket&&Z().includes("]"))Y("brackets");else {if(true!==p.nobracket&&true===p.strictBrackets)throw new SyntaxError(c("closing","]"));B=`\\${B}`;}J({type:"bracket",value:B});continue}if("]"===B){if(true===p.nobracket||z&&"bracket"===z.type&&1===z.value.length){J({type:"text",value:B,output:`\\${B}`});continue}if(0===D.brackets){if(true===p.strictBrackets)throw new SyntaxError(c("opening","["));J({type:"text",value:B,output:`\\${B}`});continue}Q("brackets");const e=z.value.slice(1);if(true===z.posix||"^"!==e[0]||e.includes("/")||(B=`/${B}`),z.value+=B,G({value:B}),false===p.literalBrackets||t.hasRegexChars(e))continue;const n=t.escapeRegex(z.value);if(D.output=D.output.slice(0,-z.value.length),true===p.literalBrackets){D.output+=n,z.value=n;continue}z.value=`(${y}${n}|${z.value})`,D.output+=z.value;continue}if("{"===B&&true!==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(true===p.nobrace||!e){J({type:"text",value:B,output:B});continue}let t=")";if(true===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=true;}if(true!==e.comma&&true!==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=true,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=true;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)&&true!==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(true!==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(true!==p.noextglob&&"("===U()&&("?"!==U(2)||!/[!=<:]/.test(U(3)))){X("negate",B);continue}if(true!==p.nonegate&&0===D.index){V();continue}}if("+"===B){if(true!==p.noextglob&&"("===U()&&"?"!==U(2)){X("plus",B);continue}if(z&&"("===z.value||false===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(true!==p.noextglob&&"("===U()&&"?"!==U(2)){J({type:"at",extglob:true,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||true===z.star)){z.type="star",z.star=true,z.value+=B,z.output=M,D.backtrack=true,D.globstar=true,W(B);continue}let e=Z();if(true!==p.noextglob&&/^\([^?]/.test(e)){X("star",B);continue}if("star"===z.type){if(true===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(true===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=true,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=true,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=true,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=true,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=true,W(B);continue}const n={type:"star",value:B,output:M};true!==p.bash?!z||"bracket"!==z.type&&"paren"!==z.type||true!==p.regex?(D.index!==D.start&&"slash"!==z.type&&"dot"!==z.type||("dot"===z.type?(D.output+=O,z.output+=O):true===p.dot?(D.output+=$,z.output+=$):(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(true===p.strictBrackets)throw new SyntaxError(c("closing","]"));D.output=t.escapeLast(D.output,"["),Q("brackets");}for(;D.parens>0;){if(true===p.strictBrackets)throw new SyntaxError(c("closing",")"));D.output=t.escapeLast(D.output,"("),Q("parens");}for(;D.braces>0;){if(true===p.strictBrackets)throw new SyntaxError(c("closing","}"));D.output=t.escapeLast(D.output,"{"),Q("braces");}if(true===p.strictSlashes||"star"!==z.type&&"bracket"!==z.type||J({type:"maybe_slash",value:"",output:`${A}?`}),true===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=true===i.bash?".*?":y;i.capture&&(S=`(${S})`);const A=e=>true===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:false,prefix:""});let x=k(E);return x&&true!==i.strictSlashes&&(x+=`${f}?`),x},Il=u}(),r=Zl(),s=ql(),i=(e,t,n=false)=>{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 false};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,false,true),l=u.state;delete u.state;let f=()=>false;if(a.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};f=i(a.ignore,e,n);}const p=(n,r=false)=>{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),false===s?(h.isMatch=false,!!r&&h):f(n)?("function"==typeof a.onIgnore&&a.onIgnore(h),h.isMatch=false,!!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:false,output:""};const a=n||{},c=a.format||(o?r.toPosixSlashes:null);let u=e===s,l=u&&c?c(e):e;return false===u&&(l=c?c(e):e,u=l===s),false!==u&&true!==a.capture||(u=true===a.matchBase||true===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:false}),i.scan=(e,n)=>t(e,n),i.compileRe=(e,t,n=false,r=false)=>{if(true===n)return e.output;const s=t||{},o=s.contains?"":"^",a=s.contains?"":"$";let c=`${o}(?:${e.output})${a}`;e&&true===e.negated&&(c=`^(?!${c}).*$`);const u=i.toRegex(c,t);return true===r&&(u.state=e),u},i.makeRe=(e,t={},r=false,s=false)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let o={negated:false,fastpaths:true};return false===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&&true===t.debug)throw e;return /$^/}},i.constants=s,Dl=i}function Gl(){return Fl?Hl:(Fl=1,Hl=Wl())}function Vl(){if(Kl)return el;Kl=1,Object.defineProperty(el,"__esModule",{value:true}),el.isAbsolute=el.partitionAbsoluteAndRelative=el.removeDuplicateSlashes=el.matchAny=el.convertPatternsToRe=el.makeRe=el.getPatternParts=el.expandBraceExpansion=el.expandPatternsWithBraceExpansion=el.isAffectDepthOfReadingPattern=el.endsWithSlashGlobStar=el.hasGlobStar=el.getBaseDirectory=el.isPatternRelatedToParentDirectory=el.getPatternsOutsideCurrentDirectory=el.getPatternsInsideCurrentDirectory=el.getPositivePatterns=el.getNegativePatterns=el.isPositivePattern=el.isNegativePattern=el.convertToNegativePattern=el.convertToPositivePattern=el.isDynamicPattern=el.isStaticPattern=void 0;const e=x,t=function(){if(Xu)return Ju;Xu=1;var e=nl(),t=x.posix.dirname,n="win32"===E.platform(),r=/\\/g,s=/[\{\[].*[\}\]]$/,i=/(^|[^\\])([\{\[]|\([^\)]+$)/,o=/\\([\!\*\?\|\[\]\(\)\{\}])/g;return Ju=function(a,c){Object.assign({flipBackslashes:true},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(zl)return Bl;zl=1;const e=O,t=Rl(),n=Gl(),r=Zl(),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},true),l=u.state.negated||u.state.negatedExtglob;l&&a++;for(let t of e){let e=u(t,true);(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(true===r.failglob)throw new Error(`No matches found for "${t.join(", ")}"`);if(true===r.nonull||true===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 false;if(t.includes(n)||t.startsWith("./")&&t.slice(2).includes(n))return true}return o.isMatch(t,n,{...r,contains:true})},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 true}return false},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 false}return true},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:true}).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&&true===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:true})},o.hasBraces=i,Bl=o}(),r=/[*?]|^!/,s=/\[[^[]*]/,i=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,o=/[!*+?@]\([^(]*\)/,a=/,|\.\./,c=/(?!^)\/{2,}/g;function u(e,t={}){return !l(e,t)}function l(e,t={}){return ""!==e&&(!(false!==t.caseSensitiveMatch&&!e.includes("\\"))||(!!(r.test(e)||s.test(e)||i.test(e))||(!(false===t.extglob||!o.test(e))||!(false===t.braceExpansion||!function(e){const t=e.indexOf("{");if(-1===t)return false;const n=e.indexOf("}",t+1);if(-1===n)return false;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:true,nodupes:true,keepEscaping:true});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 el.isStaticPattern=u,el.isDynamicPattern=l,el.convertToPositivePattern=function(e){return f(e)?e.slice(1):e},el.convertToNegativePattern=function(e){return "!"+e},el.isNegativePattern=f,el.isPositivePattern=p,el.getNegativePatterns=function(e){return e.filter(f)},el.getPositivePatterns=function(e){return e.filter(p)},el.getPatternsInsideCurrentDirectory=function(e){return e.filter(e=>!h(e))},el.getPatternsOutsideCurrentDirectory=function(e){return e.filter(h)},el.isPatternRelatedToParentDirectory=h,el.getBaseDirectory=function(e){return t(e,{flipBackslashes:false})},el.hasGlobStar=function(e){return e.includes("**")},el.endsWithSlashGlobStar=d,el.isAffectDepthOfReadingPattern=function(t){const n=e.basename(t);return d(t)||u(n)},el.expandPatternsWithBraceExpansion=function(e){return e.reduce((e,t)=>e.concat(m(t)),[])},el.expandBraceExpansion=m,el.getPatternParts=function(e,t){let{parts:r}=n.scan(e,Object.assign(Object.assign({},t),{parts:true}));return 0===r.length&&(r=[e]),r[0].startsWith("/")&&(r[0]=r[0].slice(1),r.unshift("")),r},el.makeRe=g,el.convertPatternsToRe=function(e,t){return e.map(e=>g(e,t))},el.matchAny=function(e,t){return t.some(t=>t.test(e))},el.removeDuplicateSlashes=function(e){return e.replace(c,"/")},el.partitionAbsoluteAndRelative=function(e){const t=[],n=[];for(const r of e)y(r)?t.push(r):n.push(r);return [t,n]},el.isAbsolute=y,el}var Yl,Ql,Jl,Xl={};function ef(){if(Ql)return Yl;Ql=1;const e=$.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 Yl=function(){const r=[],s=t.call(arguments);let i=false,o=s[s.length-1];o&&!Array.isArray(o)&&null==o.pipe?s.pop():o={};const a=false!==o.end,c=true===o.pipeError;null==o.objectMode&&(o.objectMode=true);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=true;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=false,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:false}),e.resume();}for(let t=0;t<e.length;t++)s(e[t]);n();}function p(){i=false,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},Yl}var tf,nf,rf,sf={};function of(){if(tf)return sf;return tf=1,Object.defineProperty(sf,"__esModule",{value:true}),sf.isEmpty=sf.isString=void 0,sf.isString=function(e){return "string"==typeof e},sf.isEmpty=function(e){return ""===e},sf}function af(){if(nf)return Du;nf=1,Object.defineProperty(Du,"__esModule",{value:true}),Du.string=Du.stream=Du.pattern=Du.path=Du.fs=Du.errno=Du.array=void 0;const e=Hu();Du.array=e;const t=zu();Du.errno=t;const n=function(){if(Ku)return Uu;Ku=1,Object.defineProperty(Uu,"__esModule",{value:true}),Uu.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 Uu.createDirentFromStats=function(t,n){return new e(t,n)},Uu}();Du.fs=n;const r=Wu();Du.path=r;const s=Vl();Du.pattern=s;const i=function(){if(Jl)return Xl;Jl=1,Object.defineProperty(Xl,"__esModule",{value:true}),Xl.merge=void 0;const e=ef();function t(e){e.forEach(e=>e.emit("close"));}return Xl.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},Xl}();Du.stream=i;const o=of();return Du.string=o,Du}var cf,uf={},lf={},ff={},pf={},hf={},df={},mf={},gf={},yf={};function vf(){if(cf)return yf;function e(e,t){e(t);}function t(e,t){e(null,t);}return cf=1,Object.defineProperty(yf,"__esModule",{value:true}),yf.read=void 0,yf.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=()=>true),t(s,i);}):t(s,o):e(s,i);});},yf}var _f,bf={};var wf,Sf,Af,kf,Ef,xf,Of,$f={},Rf={};function Cf(){if(Sf)return $f;Sf=1,Object.defineProperty($f,"__esModule",{value:true});const e=(wf||(wf=1,function(e){Object.defineProperty(e,"__esModule",{value:true}),e.createFileSystemAdapter=e.FILE_SYSTEM_ADAPTER=void 0;const t=i;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)};}(Rf)),Rf);return $f.default=class{constructor(t={}){this._options=t,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,true),this.fs=e.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,false),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,true);}_getValue(e,t){return null!=e?e:t}},$f}function Tf(){if(Af)return gf;Af=1,Object.defineProperty(gf,"__esModule",{value:true}),gf.statSync=gf.stat=gf.Settings=void 0;const e=vf(),t=(_f||(_f=1,Object.defineProperty(bf,"__esModule",{value:true}),bf.read=void 0,bf.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}}),bf),n=Cf();function r(e={}){return e instanceof n.default?e:new n.default(e)}return gf.Settings=n.default,gf.stat=function(t,n,s){"function"!=typeof n?e.read(t,r(n),s):e.read(t,r(),n);},gf.statSync=function(e,n){const s=r(n);return t.read(e,s)},gf}function Pf(){if(Ef)return kf;let e;return Ef=1,kf="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:F):t=>(e||(e=Promise.resolve())).then(t).catch(e=>setTimeout(()=>{throw e},0))}var Lf,Nf={};function If(){if(Lf)return Nf;Lf=1,Object.defineProperty(Nf,"__esModule",{value:true}),Nf.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 Nf.IS_SUPPORT_READDIR_WITH_FILE_TYPES=r||s,Nf}var Mf,Df,jf={},Hf={};function Ff(){if(Df)return jf;Df=1,Object.defineProperty(jf,"__esModule",{value:true}),jf.fs=void 0;const e=function(){if(Mf)return Hf;Mf=1,Object.defineProperty(Hf,"__esModule",{value:true}),Hf.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 Hf.createDirentFromStats=function(t,n){return new e(t,n)},Hf}();return jf.fs=e,jf}var Bf,zf,Kf={};function Uf(){if(Bf)return Kf;return Bf=1,Object.defineProperty(Kf,"__esModule",{value:true}),Kf.joinPathSegments=void 0,Kf.joinPathSegments=function(e,t,n){return e.endsWith(n)?e+t:e+n+t},Kf}function qf(){if(zf)return mf;zf=1,Object.defineProperty(mf,"__esModule",{value:true}),mf.readdir=mf.readdirWithFileTypes=mf.read=void 0;const e=Tf(),t=function(){if(Of)return xf;Of=1,xf=function(t,n){let r,s,i,o=true;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=false;};const e=Pf();return xf}(),n=If(),r=Ff(),s=Uf();function i(e,n,i){n.fs.readdir(e,{withFileTypes:true},(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 mf.read=function(e,t,r){t.stats||!n.IS_SUPPORT_READDIR_WITH_FILE_TYPES?o(e,t,r):i(e,t,r);},mf.readdirWithFileTypes=i,mf.readdir=o,mf}var Zf,Wf={};var Gf,Vf,Yf,Qf={},Jf={};function Xf(){return Gf||(Gf=1,function(e){Object.defineProperty(e,"__esModule",{value:true}),e.createFileSystemAdapter=e.FILE_SYSTEM_ADAPTER=void 0;const t=i;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)};}(Jf)),Jf}function ep(){if(Yf)return df;Yf=1,Object.defineProperty(df,"__esModule",{value:true}),df.Settings=df.scandirSync=df.scandir=void 0;const e=qf(),t=function(){if(Zf)return Wf;Zf=1,Object.defineProperty(Wf,"__esModule",{value:true}),Wf.readdir=Wf.readdirWithFileTypes=Wf.read=void 0;const e=Tf(),t=If(),n=Ff(),r=Uf();function s(e,t){return t.fs.readdirSync(e,{withFileTypes:true}).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 Wf.read=function(e,n){return !n.stats&&t.IS_SUPPORT_READDIR_WITH_FILE_TYPES?s(e,n):i(e,n)},Wf.readdirWithFileTypes=s,Wf.readdir=i,Wf}(),n=function(){if(Vf)return Qf;Vf=1,Object.defineProperty(Qf,"__esModule",{value:true});const e=x,t=Tf(),n=Xf();return Qf.default=class{constructor(r={}){this._options=r,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,false),this.fs=n.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,e.sep),this.stats=this._getValue(this._options.stats,false),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,true),this.fsStatSettings=new t.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink});}_getValue(e,t){return null!=e?e:t}},Qf}();function r(e={}){return e instanceof n.default?e:new n.default(e)}return df.Settings=n.default,df.scandir=function(t,n,s){"function"!=typeof n?e.read(t,r(n),s):e.read(t,r(),n);},df.scandirSync=function(e,n){const s=r(n);return t.read(e,s)},df}var tp,np,rp,sp={exports:{}};function ip(){if(rp)return sp.exports;rp=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=true;},paused:false,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=false,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 sp.exports=t,sp.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},sp.exports}var op,ap={};function cp(){if(op)return ap;return op=1,Object.defineProperty(ap,"__esModule",{value:true}),ap.joinPathSegments=ap.replacePathSegmentSeparator=ap.isAppliedFilter=ap.isFatalError=void 0,ap.isFatalError=function(e,t){return null===e.errorFilter||!e.errorFilter(t)},ap.isAppliedFilter=function(e,t){return null===e||e(t)},ap.replacePathSegmentSeparator=function(e,t){return e.split(/[/\\]/).join(t)},ap.joinPathSegments=function(e,t,n){return ""===e?t:e.endsWith(n)?e+t:e+n+t},ap}var up,lp,fp,pp={};function hp(){if(up)return pp;up=1,Object.defineProperty(pp,"__esModule",{value:true});const e=cp();return pp.default=class{constructor(t,n){this._root=t,this._settings=n,this._root=e.replacePathSegmentSeparator(t,n.pathSegmentSeparator);}},pp}function dp(){if(lp)return hf;lp=1,Object.defineProperty(hf,"__esModule",{value:true});const e=R,t=ep(),n=ip(),r=cp(),s=hp();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=false,this._isDestroyed=false,this._queue.drain=()=>{this._isFatalError||this._emitter.emit("end");};}read(){return this._isFatalError=false,this._isDestroyed=false,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=true,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=true,this._isDestroyed=true,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 hf.default=i,hf}var mp,gp={};var yp,vp,_p={},bp={};function wp(){if(vp)return _p;vp=1,Object.defineProperty(_p,"__esModule",{value:true});const e=function(){if(yp)return bp;yp=1,Object.defineProperty(bp,"__esModule",{value:true});const e=ep(),t=cp(),n=hp();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 bp.default=r,bp}();return _p.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()}},_p}var Sp,Ap,kp={};function Ep(){if(Ap)return ff;Ap=1,Object.defineProperty(ff,"__esModule",{value:true}),ff.Settings=ff.walkStream=ff.walkSync=ff.walk=void 0;const e=function(){if(fp)return pf;fp=1,Object.defineProperty(pf,"__esModule",{value:true});const e=dp();return pf.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();}},pf}(),t=function(){if(mp)return gp;mp=1,Object.defineProperty(gp,"__esModule",{value:true});const e=$,t=dp();return gp.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:true,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}},gp}(),n=wp(),r=function(){if(Sp)return kp;Sp=1,Object.defineProperty(kp,"__esModule",{value:true});const e=x,t=ep();return kp.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}},kp}();function s(e={}){return e instanceof r.default?e:new r.default(e)}return ff.Settings=r.default,ff.walk=function(t,n,r){"function"!=typeof n?new e.default(t,s(n)).read(r):new e.default(t,s()).read(n);},ff.walkSync=function(e,t){const r=s(t);return new n.default(e,r).read()},ff.walkStream=function(e,n){const r=s(n);return new t.default(e,r).read()},ff}var xp,Op={};function $p(){if(xp)return Op;xp=1,Object.defineProperty(Op,"__esModule",{value:true});const e=x,t=Tf(),n=af();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 Rp,Cp,Tp={};function Pp(){if(Rp)return Tp;Rp=1,Object.defineProperty(Tp,"__esModule",{value:true});const e=$,t=Tf(),n=Ep(),r=$p();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:true});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 Tp.default=s,Tp}var Lp,Np,Ip,Mp={},Dp={},jp={},Hp={};function Fp(){if(Np)return jp;Np=1,Object.defineProperty(jp,"__esModule",{value:true});const e=function(){if(Lp)return Hp;Lp=1,Object.defineProperty(Hp,"__esModule",{value:true});const e=af();return Hp.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:true,pattern:t,patternRe:e.pattern.makeRe(t,this._micromatchOptions)}:{dynamic:false,pattern:t})}_splitSegmentsIntoSections(t){return e.array.splitWhen(t,t=>t.dynamic&&e.pattern.hasGlobStar(t.pattern))}},Hp}();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 true;if(t.every((t,n)=>{const r=e.segments[n];return !(!r.dynamic||!r.patternRe.test(t))||!r.dynamic&&r.pattern===t}))return true}return false}}return jp.default=t,jp}var Bp,zp={};var Kp,Up={};var qp,Zp,Wp,Gp={};function Vp(){if(Zp)return Mp;Zp=1,Object.defineProperty(Mp,"__esModule",{value:true});const e=x,t=function(){if(Ip)return Dp;Ip=1,Object.defineProperty(Dp,"__esModule",{value:true});const e=af(),t=Fp();return Dp.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 false;if(this._isSkippedSymbolicLink(n))return false;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)}},Dp}(),n=function(){if(Bp)return zp;Bp=1,Object.defineProperty(zp,"__esModule",{value:true});const e=af();return zp.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:true})),relative:e.pattern.convertPatternsToRe(s,Object.assign(Object.assign({},this._micromatchOptions),{dot:true}))}};return e=>this._filter(e,i)}_filter(t,n){const r=e.path.removeLeadingDotSegment(t.path);if(this._settings.unique&&this._isDuplicateEntry(r))return false;if(this._onlyFileFilter(t)||this._onlyDirectoryFilter(t))return false;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 false;const s=e.path.makeAbsolute(this._settings.cwd,t);return this._isMatchToPatterns(s,n,r)}_isMatchToPatterns(t,n,r){if(0===n.length)return false;const s=e.pattern.matchAny(t,n);return !s&&r?e.pattern.matchAny(t+"/",n):s}},zp}(),r=function(){if(Kp)return Up;Kp=1,Object.defineProperty(Up,"__esModule",{value:true});const e=af();return Up.default=class{constructor(e){this._settings=e;}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(t){return e.errno.isEnoentCodeError(t)||this._settings.suppressErrors}},Up}(),s=function(){if(qp)return Gp;qp=1,Object.defineProperty(Gp,"__esModule",{value:true});const e=af();return Gp.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}},Gp}();return Mp.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:true,strictSlashes:false}}},Mp}function Yp(){if(Wp)return uf;Wp=1,Object.defineProperty(uf,"__esModule",{value:true});const e=function(){if(Cp)return lf;Cp=1,Object.defineProperty(lf,"__esModule",{value:true});const e=Ep(),t=$p(),n=Pp();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 lf.default=r,lf}(),t=Vp();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 uf.default=n,uf}var Qp,Jp={};var Xp,eh,th={},nh={};function rh(){if(eh)return th;eh=1,Object.defineProperty(th,"__esModule",{value:true});const e=function(){if(Xp)return nh;Xp=1,Object.defineProperty(nh,"__esModule",{value:true});const e=Tf(),t=Ep(),n=$p();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=Vp();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 sh,ih,oh,ah={};var ch,uh,lh=function(){if(oh)return ih;oh=1;const e=function(){if(rf)return Mu;rf=1,Object.defineProperty(Mu,"__esModule",{value:true}),Mu.convertPatternGroupToTask=Mu.convertPatternGroupsToTasks=Mu.groupPatternsByBaseDirectory=Mu.getNegativePatternsAsPositive=Mu.getPositivePatterns=Mu.convertPatternsToTasks=Mu.generate=void 0;const e=af();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 Mu.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,false),d=n(p,l,true);return h.concat(d)},Mu.convertPatternsToTasks=n,Mu.getPositivePatterns=r,Mu.getNegativePatternsAsPositive=s,Mu.groupPatternsByBaseDirectory=i,Mu.convertPatternGroupsToTasks=o,Mu.convertPatternGroupToTask=a,Mu}(),t=Yp(),n=function(){if(Qp)return Jp;Qp=1,Object.defineProperty(Jp,"__esModule",{value:true});const e=$,t=Pp(),n=Vp();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:true,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 Jp.default=r,Jp}(),r=rh(),s=(sh||(sh=1,function(e){Object.defineProperty(e,"__esModule",{value:true}),e.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;const t=i,n=E,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,false),this.baseNameMatch=this._getValue(this._options.baseNameMatch,false),this.braceExpansion=this._getValue(this._options.braceExpansion,true),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,true),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,false),this.extglob=this._getValue(this._options.extglob,true),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,true),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,true),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,false),this.objectMode=this._getValue(this._options.objectMode,false),this.onlyDirectories=this._getValue(this._options.onlyDirectories,false),this.onlyFiles=this._getValue(this._options.onlyFiles,true),this.stats=this._getValue(this._options.stats,false),this.suppressErrors=this._getValue(this._options.suppressErrors,false),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,false),this.unique=this._getValue(this._options.unique,true),this.onlyDirectories&&(this.onlyFiles=false),this.stats&&(this.objectMode=true),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)}};}(ah)),ah),i$1=af();async function o(e,n){c(e);const r=a(e,t.default,n),s=await Promise.all(r);return i$1.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$1.string.isString(e)&&!i$1.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$1.array.flatten(n)}function u(e,t){c(e);const r=a(e,n.default,t);return i$1.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$1.pattern.isDynamicPattern(e,n)},t.escapePath=function(e){return c(e),i$1.path.escape(e)},t.convertPathToPattern=function(e){return c(e),i$1.path.convertPathToPattern(e)},(l=t.posix||(t.posix={})).escapePath=function(e){return c(e),i$1.path.escapePosixPath(e)},l.convertPathToPattern=function(e){return c(e),i$1.path.convertPosixPathToPattern(e)},(f=t.win32||(t.win32={})).escapePath=function(e){return c(e),i$1.path.escapeWindowsPath(e)},f.convertPathToPattern=function(e){return c(e),i$1.path.convertWindowsPathToPattern(e)};}(o||(o={})),ih=o}(),fh=B(lh);var ph=function(){if(uh)return ch;uh=1;var e=nl(),t=x.posix.dirname,n="win32"===E.platform(),r="/",s=/\\/g,i=/\\([!*?|[\](){}])/g;function o(t){return !!/\([^()]+$/.test(t)||("{"===t[0]||"["===t[0]||(!!/[^\\][{[]/.test(t)||e(t)))}return ch=function(e,a){Object.assign({flipBackslashes:true},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 false}var n=e.indexOf(t);if(n<0)return false;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")}}(),hh=B(ph);const dh=e=>""!==e&&".."!==e,mh=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(!dh(e))return null;return t.join("/")},gh=async e=>{try{return (await stat(e)).isFile()}catch{return false}},yh=async e=>{const{cwd:t,stanPath:n,map:r,onStage:s}=e;if(!r||"object"!=typeof r)return;const i=Vc(t,n),a=path.join(i.rootAbs,"imports");await ensureDir(a);const c=Object.keys(r).sort();for(const e of c){const n=r[e]??[];if(!Array.isArray(n)||0===n.length)continue;const i=mh(e);if(!i)continue;const c=path.join(a,i);await rm(c,{recursive:true,force:true}).catch(()=>{}),await ensureDir(c).catch(()=>{});const u=[];for(const e of n){const n=e.trim();if(!n)continue;const r=hh(n.replace(/\\/g,"/"));try{const e=await fh(n,{cwd:t,absolute:!0,dot:!0,onlyFiles:!1,followSymbolicLinks:!1});for(const n of e){if(!await gh(n))continue;const e=path.relative(path.isAbsolute(r)?r:path.resolve(t,r),n).replace(/\\/g,"/");if(!e||e.includes(".."))continue;const s=path.join(c,e);await ensureDir(path.dirname(s)).catch(()=>{});try{await copyFile(n,s),u.push(s);}catch{}}}catch{}}try{if("function"==typeof s){s(i,u.map(e=>path.relative(t,e).replace(/\\/g,"/")));}}catch{}}},vh=e=>e.replace(/\\/g,"/").replace(/^\.\/+/,"").replace(/\/+$/,""),_h=e=>{const t=vh(e);if(!/[*?[\]{}()!]/.test(n=t)&&!n.includes("**"))return t?e=>((e,t)=>{const n=vh(t);return e===n||e.startsWith(n+"/")})(vh(e),t):()=>false;var n;const r=le(t,{dot:true});return e=>r(vh(e))},bh=e=>{const t=e.map(_h);return 0===t.length?()=>false:e=>{const n=vh(e);for(const e of t)if(e(n))return true;return false}},wh=()=>{const e=(()=>{try{const e=fileURLToPath(import.meta.url);return we({cwd:path.dirname(e)})??null}catch{return null}})();if(!e)return null;const n=path.join(e,"dist","stan.system.md");return existsSync(n)?n:null},Sh=async(e,n)=>{const r=path.join(e,n,"system"),o=path.join(r,"parts"),c=path.join(r,"stan.system.md");if(await ensureDir(r),!existsSync(o))return {target:c,action:"skipped-no-parts",partsDir:o};const u=(await readdir(o,{withFileTypes:true})).filter(e=>e.isFile()&&e.name.toLowerCase().endsWith(".md")).map(e=>e.name).sort((e,t)=>e.localeCompare(t,void 0,{numeric:true}));if(0===u.length)return {target:c,action:"skipped-no-md",partsDir:o};const l=[];for(const e of u){const t=path.join(o,e),n=mu(await readFile(t,"utf8")).trimEnd();l.push(n);}const p=(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 writeFile(c,p,"utf8"),{target:c,action:"written"}};const Ah="0.4.4";
26
+ const T="archive.tar",P="archive.prev.tar",L=e=>e.replace(/\\/g,"/"),N=(e,t)=>{const n=L(e).replace(/\/+$/,""),r=L(t);return r===n||r.startsWith(`${n}/`)},I=(e,t)=>{const n=L(e);return N(`${n}/diff`,t)||N(`${n}/patch`,t)},M=N,D=e=>{const t=e.replace(/\\/g,"/");return e=>!(I(t,e)||((e,t)=>{const n=L(e);return L(t)===`${n}/output/${T}`||L(t)===`${n}/output/archive.diff.tar`||L(t)===`${n}/output/archive.warnings.txt`})(t,e))},j=(e,t)=>{const n=`${t.replace(/\\/g,"/")}/output`;return Array.from(new Set([...e,n]))},H=(e,t)=>{const n=(e??"").trim();n&&"No archive warnings."!==n&&t?.(n);};var F="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function B(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var z,K={exports:{}};var U,q,Z,W,G,V,Y,Q,J,X,ee,te=(z||(z=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=()=>false,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=false,o=e;0===o.indexOf("!")&&(r=true,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=true);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=true,this._rules.push(t);}}add(e){return this._added=false,t(b(e)?(e=>e.split(o).filter(Boolean))(e):e).forEach(this._add,this),this._added}test(e,t,n){let r,s=false,i=false;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 O{constructor({ignorecase:e=true,ignoreCase:t=e,allowRelativePaths:n=false}={}){p(this,f,true),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,true,t);if(e.ignored)return e}return this._rules.test(e,false,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,false).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return t(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,true)}}const $=e=>new O(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=$,$.default=$,e.exports.isPathValid=e=>E(e&&E.convert(e),e,d),p(e.exports,Symbol.for("setupWindows"),R);}(K)),K.exports),ne=B(te),re={};function se(){if(q)return U;q=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 U={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=>true===e?u:c}}function ie(){return Z||(Z=1,function(e){const{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:s}=se();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 true===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};}(re)),re}function oe(){if(G)return W;G=1;const e=ie(),{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}=se(),g=e=>e===a||e===r,y=e=>{ true!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1);};return W=(v,_)=>{const b=_||{},w=v.length-1,S=true===b.parts||true===b.scanToEnd,A=[],k=[],E=[];let x,O,$=v,R=-1,C=0,T=0,P=false,L=false,N=false,I=false,M=false,D=false,j=false,H=false,F=false,B=false,z=0,K={value:"",depth:0,isGlob:false};const U=()=>R>=w,q=()=>$.charCodeAt(R+1),Z=()=>(x=O,$.charCodeAt(++R));for(;R<w;){let e;if(O=Z(),O!==r){if(true===D||O===c){for(z++;true!==U()&&(O=Z());)if(O!==r)if(O!==c){if(true!==D&&O===i&&(O=Z())===i){if(P=K.isBrace=true,N=K.isGlob=true,B=true,true===S)continue;break}if(true!==D&&O===s){if(P=K.isBrace=true,N=K.isGlob=true,B=true,true===S)continue;break}if(O===h&&(z--,0===z)){D=false,P=K.isBrace=true,B=true;break}}else z++;else j=K.backslashes=true,Z();if(true===S)continue;break}if(O!==a){if(true!==b.noext){if(true===(O===f||O===n||O===t||O===p||O===o)&&q()===u){if(N=K.isGlob=true,I=K.isExtglob=true,B=true,O===o&&R===C&&(F=true),true===S){for(;true!==U()&&(O=Z());)if(O!==r){if(O===d){N=K.isGlob=true,B=true;break}}else j=K.backslashes=true,O=Z();continue}break}}if(O===t){if(x===t&&(M=K.isGlobstar=true),N=K.isGlob=true,B=true,true===S)continue;break}if(O===p){if(N=K.isGlob=true,B=true,true===S)continue;break}if(O===l){for(;true!==U()&&(e=Z());)if(e!==r){if(e===m){L=K.isBracket=true,N=K.isGlob=true,B=true;break}}else j=K.backslashes=true,Z();if(true===S)continue;break}if(true===b.nonegate||O!==o||R!==C){if(true!==b.noparen&&O===u){if(N=K.isGlob=true,true===S){for(;true!==U()&&(O=Z());)if(O!==u){if(O===d){B=true;break}}else j=K.backslashes=true,O=Z();continue}break}if(true===N){if(B=true,true===S)continue;break}}else H=K.negated=true,C++;}else {if(A.push(R),k.push(K),K={value:"",depth:0,isGlob:false},true===B)continue;if(x===i&&R===C+1){C+=2;continue}T=R+1;}}else j=K.backslashes=true,O=Z(),O===c&&(D=true);} true===b.noext&&(I=false,N=false);let W=$,G="",V="";C>0&&(G=$.slice(0,C),$=$.slice(C),T-=C),W&&true===N&&T>0?(W=$.slice(0,T),V=$.slice(T)):true===N?(W="",V=$):W=$,W&&""!==W&&"/"!==W&&W!==$&&g(W.charCodeAt(W.length-1))&&(W=W.slice(0,-1)),true===b.unescape&&(V&&(V=e.removeBackslashes(V)),W&&true===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(true===b.tokens&&(Y.maxDepth=0,g(O)||k.push(K),Y.tokens=k),true===b.parts||true===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=true,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},W}function ae(){if(Y)return V;Y=1;const e=se(),t=ie(),{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:O,QMARK:$,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?$:R;let I=true===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:true===p.dot,consumed:"",output:"",prefix:"",backtrack:false,negated:false,brackets:0,braces:0,parens:0,quotes:0,globstar:false,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=true,M.start++,true)},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=true===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:true,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:false}).output;n=e.close=`)${s})${r})`;}"bos"===e.prev.type&&(M.negatedExtglob=true);}Q({type:"paren",extglob:true,value:F,output:n}),Y("parens");};if(false!==p.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(l)){let e=false,n=l.replace(i,(t,n,r,s,i,o)=>"\\"===s?(e=true,t):"?"===s?n?n+s+(i?$.repeat(i.length):""):0===o?N+(i?$.repeat(i.length):""):$.repeat(r.length):"."===s?b.repeat(r.length):"*"===s?n?n+s+(i?I:""):I:n?t:`\\${t}`);return true===e&&(n=true===p.unescape?n.replace(/\\/g,""):n.replace(/\\+/g,e=>e.length%2==0?"\\\\":e?"\\":"")),n===l&&true===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&&true!==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+="\\")),true===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(false!==p.posix&&":"===F){const e=B.value.slice(1);if(e.includes("[")&&(B.posix=true,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=true,U(),m.output||1!==g.indexOf(B)||(m.output=A);continue}}}("["===F&&":"!==K()||"-"===F&&"]"===K())&&(F=`\\${F}`),"]"!==F||"["!==B.value&&"[^"!==B.value||(F=`\\${F}`),true===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,true===p.keepQuotes&&Q({type:"text",value:F});continue}if("("===F){V("parens"),Q({type:"paren",value:F});continue}if(")"===F){if(0===M.parens&&true===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(true!==p.nobracket&&q().includes("]"))V("brackets");else {if(true!==p.nobracket&&true===p.strictBrackets)throw new SyntaxError(c("closing","]"));F=`\\${F}`;}Q({type:"bracket",value:F});continue}if("]"===F){if(true===p.nobracket||B&&"bracket"===B.type&&1===B.value.length){Q({type:"text",value:F,output:`\\${F}`});continue}if(0===M.brackets){if(true===p.strictBrackets)throw new SyntaxError(c("opening","["));Q({type:"text",value:F,output:`\\${F}`});continue}Y("brackets");const e=B.value.slice(1);if(true===B.posix||"^"!==e[0]||e.includes("/")||(F=`/${F}`),B.value+=F,W({value:F}),false===p.literalBrackets||t.hasRegexChars(e))continue;const n=t.escapeRegex(B.value);if(M.output=M.output.slice(0,-B.value.length),true===p.literalBrackets){M.output+=n,B.value=n;continue}B.value=`(${y}${n}|${B.value})`,M.output+=B.value;continue}if("{"===F&&true!==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(true===p.nobrace||!e){Q({type:"text",value:F,output:F});continue}let t=")";if(true===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=true;}if(true!==e.comma&&true!==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=true,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=true;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)&&true!==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(true!==p.dot&&("slash"===B.type||"bos"===B.type)){Q({type:"qmark",value:F,output:R});continue}Q({type:"qmark",value:F,output:$});continue}if("!"===F){if(true!==p.noextglob&&"("===K()&&("?"!==K(2)||!/[!=<:]/.test(K(3)))){J("negate",F);continue}if(true!==p.nonegate&&0===M.index){G();continue}}if("+"===F){if(true!==p.noextglob&&"("===K()&&"?"!==K(2)){J("plus",F);continue}if(B&&"("===B.value||false===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(true!==p.noextglob&&"("===K()&&"?"!==K(2)){Q({type:"at",extglob:true,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||true===B.star)){B.type="star",B.star=true,B.value+=F,B.output=I,M.backtrack=true,M.globstar=true,Z(F);continue}let e=q();if(true!==p.noextglob&&/^\([^?]/.test(e)){J("star",F);continue}if("star"===B.type){if(true===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(true===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=true,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=true,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=true,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=true,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=true,Z(F);continue}const n={type:"star",value:F,output:I};true!==p.bash?!B||"bracket"!==B.type&&"paren"!==B.type||true!==p.regex?(M.index!==M.start&&"slash"!==B.type&&"dot"!==B.type||("dot"===B.type?(M.output+=x,B.output+=x):true===p.dot?(M.output+=O,B.output+=O):(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(true===p.strictBrackets)throw new SyntaxError(c("closing","]"));M.output=t.escapeLast(M.output,"["),Y("brackets");}for(;M.parens>0;){if(true===p.strictBrackets)throw new SyntaxError(c("closing",")"));M.output=t.escapeLast(M.output,"("),Y("parens");}for(;M.braces>0;){if(true===p.strictBrackets)throw new SyntaxError(c("closing","}"));M.output=t.escapeLast(M.output,"{"),Y("braces");}if(true===p.strictSlashes||"star"!==B.type&&"bracket"!==B.type||Q({type:"maybe_slash",value:"",output:`${S}?`}),true===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=true===i.bash?".*?":g;i.capture&&(w=`(${w})`);const S=e=>true===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:false,prefix:""});let E=A(k);return E&&true!==i.strictSlashes&&(E+=`${l}?`),E},V=u}function ce(){if(J)return Q;J=1;const e=oe(),t=ae(),n=ie(),r=se(),s=(e,t,n=false)=>{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 false};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,false,true),u=c.state;delete c.state;let l=()=>false;if(o.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};l=s(o.ignore,e,n);}const f=(n,r=false)=>{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),false===i?(h.isMatch=false,!!r&&h):l(n)?("function"==typeof o.onIgnore&&o.onIgnore(h),h.isMatch=false,!!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:false,output:""};const a=r||{},c=a.format||(o?n.toPosixSlashes:null);let u=e===i,l=u&&c?c(e):e;return false===u&&(l=c?c(e):e,u=l===i),false!==u&&true!==a.capture||(u=true===a.matchBase||true===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:false}),s.scan=(t,n)=>e(t,n),s.compileRe=(e,t,n=false,r=false)=>{if(true===n)return e.output;const i=t||{},o=i.contains?"":"^",a=i.contains?"":"$";let c=`${o}(?:${e.output})${a}`;e&&true===e.negated&&(c=`^(?!${c}).*$`);const u=s.toRegex(c,t);return true===r&&(u.state=e),u},s.makeRe=(e,n={},r=false,i=false)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let o={negated:false,fastpaths:true};return false===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&&true===t.debug)throw e;return /$^/}},s.constants=r,Q=s}function ue(){if(ee)return X;ee=1;const e=ce(),t=ie();function n(n,r,s=false){return !r||null!==r.windows&&void 0!==r.windows||(r={...r,windows:t.isWindows()}),e(n,r,s)}return Object.assign(n,e),X=n}var le=B(ue());const fe=async e=>{const t=[],n=["."];for(;n.length;){const r=n.pop(),i=resolve(e,r),o=await readdir(i,{withFileTypes:true});for(const e of o){const s="."===r?e.name:join(r,e.name);e.isDirectory()?n.push(s):t.push(s.replace(/\\/g,"/"));}}return t},pe=(e,t)=>{const n=t.replace(/\\/g,"/").replace(/\/+$/,"");return e===n||e.startsWith(n+"/")},he=e=>{const t=e.replace(/\\/g,"/").replace(/^\.\/+/,"").replace(/\/+$/,"");if(!/[*?[\]{}()!]/.test(n=t)&&!n.includes("**"))return t?e=>pe(e,t):()=>false;var n;const r=le(t,{dot:true});return e=>r(e)},de=async(e,{cwd:n,stanPath:r,includeOutputDir:s,includes:o=[],excludes:a=[],anchors:c=[]})=>{const u=r.replace(/\\/g,"/"),l=((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,u),f=await(async e=>{const n=resolve(e,".gitignore");if(!existsSync(n))return null;try{const e=await readFile(n,"utf8"),t=ne();return t.add(e),t}catch{return null}})(n),h=[e=>pe(e,"node_modules"),e=>pe(e,".git"),...f?[e=>f.ignores(e)]:[],...a.map(he),...l.map(e=>t=>pe(t,e)),e=>I(u,e)];s||h.push(e=>M(`${u}/output`,e));const d=e.filter(e=>!h.some(t=>t(e)));if(o.length>0){const t=o.map(he),n=[e=>I(u,e),...s?[]:[e=>M(`${u}/output`,e)]],r=new Set(d);for(const n of e)t.some(e=>e(n))&&r.add(n);const i=a.map(he),l=new Set(e.filter(e=>r.has(e)&&!n.some(t=>t(e))&&!i.some(t=>t(e))));if(c.length>0){const t=c.map(he);for(const n of e){!(I(u,n)||!s&&M(`${u}/output`,n))&&t.some(e=>e(n))&&l.add(n);}}return e.filter(e=>l.has(e))}if(c.length>0){const t=c.map(he),n=new Set(d);for(const r of e){!(I(u,r)||!s&&M(`${u}/output`,r))&&t.some(e=>e(r))&&n.add(r);}return e.filter(e=>n.has(e))}return d},me=async(e,t)=>{const n=(await(async()=>{try{const e=await Promise.resolve().then(function(){return Qc}),t=e.makeStanDirs,n=e.default?.makeStanDirs,r="function"==typeof t?t:n;if("function"==typeof r)return r}catch{}throw new Error("makeStanDirs export not found in ./paths")})())(e,t);return await ensureDir(n.rootAbs),await ensureDir(n.outputAbs),await ensureDir(n.diffAbs),await ensureDir(n.patchAbs),{rootAbs:n.rootAbs,outputAbs:n.outputAbs,diffAbs:n.diffAbs,patchAbs:n.patchAbs}},ge=async(e,t)=>{const n=await me(e,t);return {outDir:n.outputAbs,diffDir:n.diffAbs}},ye=async(e,n,r={})=>{const{includeOutputDir:s=false,fileName:i,includes:a=[],excludes:c=[],anchors:u=[]}=r;let l=i??"archive.tar";l.endsWith(".tar")||(l+=".tar");const{outDir:f,diffDir:h}=await ge(e,n),d=await fe(e),m=await de(d,{cwd:e,stanPath:n,includeOutputDir:s,includes:a,excludes:c,anchors:u}),g=resolve(f,l),y=resolve(h,P);if(existsSync(g))try{await copyFile(g,y);}catch{}const v=await(async()=>{try{const e=await import('./classifier-DeYwffC_-DftahF7h.js'),t=e.classifyForArchive,n=e.default?.classifyForArchive,r="function"==typeof t?t:n;if("function"==typeof r)return r}catch{}throw new Error("classifyForArchive export not found in ./classifier")})(),{textFiles:_,warningsBody:b}=await v(e,m),w=_;H(b,r.onArchiveWarnings);const S=await import('./index-ucZa1KMb-CNGeWGvV.js');if(s?await S.create({file:g,cwd:e,filter:D(n)},j(w,n)):await S.create({file:g,cwd:e,filter:D(n)},w),!existsSync(y))try{await copyFile(g,y);}catch{}return g},ve=".stan",_e="code -g {file}",be=e=>e instanceof URL?fileURLToPath(e):e;function we({cwd:t}={}){const n=function(t,{cwd:n=process$2.cwd(),type:r="file",stopAt:s}={}){let i=path.resolve(be(n)??"");const{root:o}=path.parse(i);s=path.resolve(i,be(s)??o);const a=path.isAbsolute(t);for(;i;){const n=a?t:path.join(i,t);try{const t=c.statSync(n,{throwIfNoEntry:!1});if("file"===r&&t?.isFile()||"directory"===r&&t?.isDirectory())return n}catch{}if(i===s||i===o)break;i=path.dirname(i);}}("package.json",{cwd:t});return n&&path.dirname(n)}const Se=["stan.config.yml","stan.config.yaml","stan.config.json"],Ae=e=>{for(const n of Se){const r=resolve(e,n);if(existsSync(r))return r}return null},ke=e=>{const t=Ae(e);if(t)return t;const n=new Set;let r=e;for(;r;){const e=we({cwd:r});if(!e||n.has(e))break;n.add(e);const t=Ae(e);if(t)return t;const s=dirname(e);if(s===e||n.has(s))break;r=s;}return null};var Ee,xe={},Oe={},$e={},Re={};function Ce(){if(Ee)return Re;Ee=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 true}return false}return Re.ALIAS=e,Re.DOC=t,Re.MAP=n,Re.NODE_TYPE=o,Re.PAIR=r,Re.SCALAR=s,Re.SEQ=i,Re.hasAnchor=e=>(a(e)||c(e))&&!!e.anchor,Re.isAlias=t=>!!t&&"object"==typeof t&&t[o]===e,Re.isCollection=c,Re.isDocument=e=>!!e&&"object"==typeof e&&e[o]===t,Re.isMap=e=>!!e&&"object"==typeof e&&e[o]===n,Re.isNode=function(t){if(t&&"object"==typeof t)switch(t[o]){case e:case n:case s:case i:return true}return false},Re.isPair=e=>!!e&&"object"==typeof e&&e[o]===r,Re.isScalar=a,Re.isSeq=e=>!!e&&"object"==typeof e&&e[o]===i,Re}var Te,Pe,Le={};function Ne(){if(Te)return Le;Te=1;var e=Ce();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,Le.visit=s,Le.visitAsync=o,Le}function Ie(){if(Pe)return $e;Pe=1;var e=Ce(),t=Ne();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=false,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=true;break;case "1.2":this.atNextDocument=false,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=false);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 false;const[e,r]=n;return this.tags[e]=r,true}case "%YAML":{if(this.yaml.explicit=true,1!==n.length)return t(0,"%YAML directive should contain exactly one part"),false;const[e]=n;if("1.1"===e||"1.2"===e)return this.yaml.version=e,true;return t(6,`Unsupported YAML version ${e}`,/^\d+\.\d+$/.test(e)),false}default:return t(0,`Unknown directive ${r}`,true),false}}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]=true);}),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:false,version:"1.2"},s.defaultTags={"!!":"tag:yaml.org,2002:"},$e.Directives=s,$e}var Me,De={},je={},He={};function Fe(){if(Me)return He;Me=1;var e=Ce(),t=Ne();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 He.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 true},He.anchorNames=n,He.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}},He.findNewAnchor=r,He}var Be,ze={},Ke={};function Ue(){if(Be)return Ke;return Be=1,Ke.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)},Ke}var qe,Ze,We,Ge={};function Ve(){if(qe)return Ge;qe=1;var e=Ce();return Ge.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)},Ge}function Ye(){if(Ze)return ze;Ze=1;var e=Ue(),t=Ce(),n=Ve();return ze.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:true,mapAsMap:true===s,mapKeyWarned:false,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}},ze}function Qe(){if(We)return je;We=1;var e=Fe(),t=Ne(),n=Ce(),r=Ye(),s=Ve();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 je.Alias=i,je}var Je,Xe,et,tt={},nt={},rt={};function st(){if(Je)return rt;Je=1;var e=Ce(),t=Ye(),n=Ve();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",rt.Scalar=r,rt.isScalarValue=e=>!e||"function"!=typeof e&&"object"!=typeof e,rt}function it(){if(Xe)return nt;Xe=1;var e=Qe(),t=Ce(),n=st();return nt.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},nt}function ot(){if(et)return tt;et=1;var e=it(),t=Ce(),n=Ye();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:false,keepUndefined:false,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:true,enumerable:false,writable:true});}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,true);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,true);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,true);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 false;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,true);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,true);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 tt.Collection=i,tt.collectionFromPath=r,tt.isEmptyPath=s,tt}var at,ct={},ut={},lt={},ft={};function pt(){if(at)return ft;at=1;function e(e,t){return /^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}return ft.indentComment=e,ft.lineComment=(t,n,r)=>t.endsWith("\n")?e(r,n):r.includes("\n")?"\n"+e(r,n):(t.endsWith(" ")?"":" ")+r,ft.stringifyComment=e=>e.replace(/^(?!$)(?: $)?/gm,"#"),ft}var ht,dt,mt,gt,yt={},vt={};function _t(){if(ht)return vt;ht=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 vt.FOLD_BLOCK=e,vt.FOLD_FLOW="flow",vt.FOLD_QUOTED=t,vt.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=false,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=true;const e=v>b+1?v-2:_-1;if(h[e])return r;p.push(e),h[e]=true,g=e+f,d=void 0;}else y=true;}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},vt}function bt(){if(dt)return yt;dt=1;var e=st(),t=_t();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,false))}function i(e,i){if(false===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,false))}function o(e,t){const{singleQuote:n}=t.options;let r;if(false===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 false;const r=t-n,s=e.length;if(s<=r)return false;for(let t=0,n=0;t<s;++t)if("\n"===e[t]){if(t-n>r)return true;if(n=t+1,s-n<=r)return false}return true}(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=false,A=-1;for(w=0;w<c.length;++w){const e=c[w];if(" "===e)S=true;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=false;const o=n(u,true);"folded"!==p&&i!==e.Scalar.BLOCK_FOLDED&&(o.onOverflow=()=>{s=true;});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 yt.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=true,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,false))}(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},yt}function wt(){if(mt)return lt;mt=1;var e=Fe(),t=Ce(),n=pt(),r=bt();return lt.createStringifyContext=function(e,t){const r=Object.assign({blockQuote:true,commentString:n.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:false,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:true,indentSeq:true,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:false,singleQuote:null,trueStr:"true",verifyAliasOrder:true},e.schema.toStringOptions,t);let s;switch(r.collectionStyle){case "block":s=false;break;case "flow":s=true;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}},lt.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},lt}function St(){if(gt)return ut;gt=1;var e=Ce(),t=st(),n=wt(),r=pt();return ut.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:false,implicitKey:!y&&(m||!u),indent:f+p});let v,_,b,w=false,S=false,A=n.stringify(s,o,()=>w=true,()=>S=true);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=true;}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=false,_=null,b=null,i&&"object"==typeof i&&(i=l.createNode(i))),o.implicitKey=false,y||g||!e.isScalar(i)||(o.indentAtStart=A.length+1),S=false,d||!(p.length>=2)||o.inFlow||y||!e.isSeq(i)||i.flow||i.tag||i.anchor||(o.indent=o.indent.substring(2));let k=false;const E=n.stringify(i,o,()=>k=true,()=>S=true);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=false;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=true);}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},ut}var At,kt={},Et={};function xt(){if(At)return Et;At=1;var e=w;return Et.debug=function(e,...t){"debug"===e&&console.log(...t);},Et.warn=function(t,n){"debug"!==t&&"warn"!==t||("function"==typeof e.emitWarning?e.emitWarning(n):console.warn(n));},Et}var Ot,$t,Rt,Ct={};function Tt(){if(Ot)return Ct;Ot=1;var e=Ce(),t=st();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:true,enumerable:true,configurable:true});return n}return Ct.addMergeToJSMap=s,Ct.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),Ct.merge=r,Ct}function Pt(){if($t)return kt;$t=1;var e=xt(),t=Tt(),n=wt(),r=Ce(),s=Ve();return kt.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=true,r.inStringifyKey=true;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=true;}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:true,enumerable:true,configurable:true}):o[u]=l;}}return o},kt}function Lt(){if(Rt)return ct;Rt=1;var e=it(),t=St(),n=Pt(),r=Ce();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 ct.Pair=s,ct.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)},ct}var Nt,It,Mt,Dt={},jt={},Ht={},Ft={};function Bt(){if(Nt)return Ft;Nt=1;var e=Ce(),t=wt(),n=pt();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=false;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=false;let f=t.stringify(c,d,()=>l=null,()=>m=true);l&&(f+=n.lineComment(f,u,h(l))),m&&l&&(m=false),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:true,type:null});let h=false,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,false),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,false),t.comment&&(h=true));const n=e.isNode(c.value)?c.value:null;n?(n.comment&&(u=n.comment),n.commentBefore&&(h=true)):null==c.value&&t?.comment&&(u=t.comment);}u&&(h=true);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=true),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 Ft.stringifyCollection=function(e,t,n){return (t.inFlow??e.flow?s:r)(e,t,n)},Ft}function zt(){if(It)return Ht;It=1;var e=Bt(),t=Pt(),n=ot(),r=Ce(),s=Lt(),i=st();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 false;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),true);}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(false)&&(t=Object.assign({},t,{allNullValues:true})),e.stringifyCollection(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:s,onComment:n})}};return Ht.YAMLMap=a,Ht.findPair=o,Ht}function Kt(){if(Mt)return jt;Mt=1;var e=Ce(),t=zt();const n={collection:"map",default:true,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 jt.map=n,jt}var Ut,qt,Zt={},Wt={};function Gt(){if(Ut)return Wt;Ut=1;var e=it(),t=Bt(),n=ot(),r=Ce(),s=st(),i=Ve();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 false;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 Wt.YAMLSeq=o,Wt}function Vt(){if(qt)return Zt;qt=1;var e=Ce(),t=Gt();const n={collection:"seq",default:true,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 Zt.seq=n,Zt}var Yt,Qt={};function Jt(){if(Yt)return Qt;Yt=1;var e=bt();const t={identify:e=>"string"==typeof e,default:true,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:(t,n,r,s)=>(n=Object.assign({actualString:true},n),e.stringifyString(t,n,r,s))};return Qt.string=t,Qt}var Xt,en={},tn={};function nn(){if(Xt)return tn;Xt=1;var e=st();const t={identify:e=>null==e,createNode:()=>new e.Scalar(null),default:true,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 tn.nullTag=t,tn}var rn,sn={};function on$1(){if(rn)return sn;rn=1;var e=st();const t={identify:e=>"boolean"==typeof e,default:true,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 sn.boolTag=t,sn}var an,cn,un={},ln={};function fn(){if(an)return ln;return an=1,ln.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},ln}function pn(){if(cn)return un;cn=1;var e=st(),t=fn();const n={identify:e=>"number"==typeof e,default:true,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:true,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:true,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 un.float=s,un.floatExp=r,un.floatNaN=n,un}var hn,dn={};function mn(){if(hn)return dn;hn=1;var e=fn();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:true,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:true,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:true,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 dn.int=i,dn.intHex=o,dn.intOct=s,dn}var gn,yn={};function vn(){if(gn)return yn;gn=1;var e=Kt(),t=nn(),n=Vt(),r=Jt(),s=on$1(),i=pn(),o=mn();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 yn.schema=a,yn}var _n,bn={};function wn(){if(_n)return bn;_n=1;var e=st(),t=Kt(),n=Vt();function r(e){return "bigint"==typeof e||Number.isInteger(e)}const s=({value:e})=>JSON.stringify(e),i=[{identify:e=>"string"==typeof e,default:true,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:s},{identify:e=>null==e,createNode:()=>new e.Scalar(null),default:true,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:s},{identify:e=>"boolean"==typeof e,default:true,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>"true"===e,stringify:s},{identify:r,default:true,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:true,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:true,tag:"",test:/^/,resolve:(e,t)=>(t(`Unresolved plain scalar ${JSON.stringify(e)}`),e)},a=[t.map,n.seq].concat(i,o);return bn.schema=a,bn}var Sn,An={};function kn(){if(Sn)return An;Sn=1;var e=require$$0,t=st(),n=bt();const r={identify:e=>e instanceof Uint8Array,default:false,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 An.binary=r,An}var En,xn,On={},$n={};function Rn(){if(En)return $n;En=1;var e=Ce(),t=Lt(),n=st(),r=Gt();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:false,tag:"tag:yaml.org,2002:pairs",resolve:s,createNode:i};return $n.createPairs=i,$n.pairs=o,$n.resolvePairs=s,$n}function Cn(){if(xn)return On;xn=1;var e=Ce(),t=Ve(),n=zt(),r=Gt(),s=Rn();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:false,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 On.YAMLOMap=i,On.omap=o,On}var Tn,Pn={},Ln={};function Nn(){if(Tn)return Ln;Tn=1;var e=st();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=>true===e,default:true,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new e.Scalar(true),stringify:t},r={identify:e=>false===e,default:true,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new e.Scalar(false),stringify:t};return Ln.falseTag=r,Ln.trueTag=n,Ln}var In,Mn={};function Dn(){if(In)return Mn;In=1;var e=st(),t=fn();const n={identify:e=>"number"==typeof e,default:true,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:true,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:true,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 Mn.float=s,Mn.floatExp=r,Mn.floatNaN=n,Mn}var jn,Hn={};function Fn(){if(jn)return Hn;jn=1;var e=fn();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:true,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:true,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:true,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:true,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 Hn.int=o,Hn.intBin=s,Hn.intHex=a,Hn.intOct=i,Hn}var Bn,zn={};function Kn(){if(Bn)return zn;Bn=1;var e=Ce(),t=Lt(),n=zt();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(true))return super.toString(Object.assign({},e,{allNullValues:true}),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:false,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(true))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 zn.YAMLSet=r,zn.set=s,zn}var Un,qn,Zn,Wn,Gn={};function Vn(){if(Un)return Gn;Un=1;var e=fn();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:true,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:true,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>t(e,false),stringify:n},i={identify:e=>e instanceof Date,default:true,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,false);Math.abs(e)<30&&(e*=60),f-=6e4*e;}return new Date(f)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};return Gn.floatTime=s,Gn.intTime=r,Gn.timestamp=i,Gn}function Yn(){if(qn)return Pn;qn=1;var e=Kt(),t=nn(),n=Vt(),r=Jt(),s=kn(),i=Nn(),o=Dn(),a=Fn(),c=Tt(),u=Cn(),l=Rn(),f=Kn(),p=Vn();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 Pn.schema=h,Pn}function Qn(){if(Zn)return en;Zn=1;var e=Kt(),t=nn(),n=Vt(),r=Jt(),s=on$1(),i=pn(),o=mn(),a=vn(),c=wn(),u=kn(),l=Tt(),f=Cn(),p=Rn(),h=Yn(),d=Kn(),m=Vn();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 en.coreKnownTags=v,en.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},[])},en}function Jn(){if(Wn)return Dt;Wn=1;var e=Ce(),t=Kt(),n=Vt(),r=Jt(),s=Qn();const i=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;return Dt.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:true===f?i:null;}clone(){const e=Object.create(o.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}},Dt}var Xn,er,tr={};function nr(){if(Xn)return tr;Xn=1;var e=Ce(),t=wt(),n=pt();return tr.stringifyDocument=function(r,s){const i=[];let o=true===s.directives;if(false!==s.directives&&r.directives){const e=r.directives.toString(r);e?(i.push(e),o=true):r.directives.docStart&&(o=true);}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=false,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=true;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"},tr}function rr(){if(er)return De;er=1;var e=Qe(),t=ot(),n=Ce(),r=Lt(),s=Ve(),i=Jn(),o=nr(),a=Fe(),c=Ue(),u=it(),l=Ie();function f(e){if(n.isCollection(e))return true;throw new Error("Expected a YAML collection as document contents")}return De.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:false,keepSourceTokens:false,logLevel:"warn",prettyErrors:true,strict:true,stringKeys:false,uniqueKeys:true,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??true,keepUndefined:l??false,onAnchor:h,onTagObj:f,replacer:s,schema:this.schema,sourceObjects:m},y=u.createNode(e,p,g);return c&&n.isCollection(y)&&(y.flow=true),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,true):!!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:false,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:true,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:true===n,mapKeyWarned:false,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:true,jsonArg:e,mapAsMap:false,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)}},De}var sr,ir={};function or(){if(sr)return ir;sr=1;class e extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t;}}return ir.YAMLError=e,ir.YAMLParseError=class extends e{constructor(e,t,n){super("YAMLParseError",e,t,n);}},ir.YAMLWarning=class extends e{constructor(e,t,n){super("YAMLWarning",e,t,n);}},ir.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`;}},ir}var ar,cr={},ur={},lr={},fr={},pr={};function hr(){if(ar)return pr;return ar=1,pr.resolveProps=function(e,{flow:t,indicator:n,next:r,offset:s,onError:i,parentIndent:o,startOnNewline:a}){let c=false,u=a,l=a,f="",p="",h=false,d=false,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=false),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=true;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=false;break}case "newline":u?f?f+=s.source:b&&"seq-item-ind"===n||(c=true):p+=s.source,u=true,h=true,(g||y)&&(v=s),l=true;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",true),g=s,w??(w=s.offset),u=false,l=false,d=true;break;case "tag":y&&i(s,"MULTIPLE_TAGS","A node can have at most one tag"),y=s,w??(w=s.offset),u=false,l=false,d=true;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=false;break;case "comma":if(t){_&&i(s,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),_=s,u=false,l=false;break}default:i(s,"UNEXPECTED_TOKEN",`Unexpected ${s.type} token`),u=false,l=false;}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}},pr}var dr,mr={};function gr(){if(dr)return mr;return dr=1,mr.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 true;if(t.end)for(const e of t.end)if("newline"===e.type)return true;return false;case "flow-collection":for(const n of t.items){for(const e of n.start)if("newline"===e.type)return true;if(n.sep)for(const e of n.sep)if("newline"===e.type)return true;if(e(n.key)||e(n.value))return true}return false;default:return true}},mr}var yr,vr={};function _r(){if(yr)return vr;yr=1;var e=gr();return vr.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",true);}}},vr}var br,wr,Sr={};function Ar(){if(br)return Sr;br=1;var e=Ce();return Sr.mapIncludes=function(t,n,r){const{uniqueKeys:s}=t.options;if(false===s)return false;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))},Sr}function kr(){if(wr)return fr;wr=1;var e=Lt(),t=zt(),n=hr(),r=gr(),s=_r(),i=Ar();const o="All mapping items must start at the same column";return fr.resolveBlockMap=function({composeNode:a,composeEmptyNode:c},u,l,f,p){const h=new(p?.nodeClass??t.YAMLMap)(u.schema);u.atRoot&&(u.atRoot=false);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:true}),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=true;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=false,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},fr}var Er,xr={};function Or(){if(Er)return xr;Er=1;var e=Gt(),t=hr(),n=_r();return xr.resolveBlockSeq=function({composeNode:r,composeEmptyNode:s},i,o,a,c){const u=new(c?.nodeClass??e.YAMLSeq)(i.schema);i.atRoot&&(i.atRoot=false),i.atKey&&(i.atKey=false);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:true});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},xr}var $r,Rr,Cr,Tr={},Pr={};function Lr(){if($r)return Pr;return $r=1,Pr.resolveEnd=function(e,t,n,r){let s="";if(e){let i=false,o="";for(const a of e){const{source:e,type:c}=a;switch(c){case "space":i=true;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=true;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`);}t+=e.length;}}return {comment:s,offset:t}},Pr}function Nr(){if(Rr)return Tr;Rr=1;var e=Ce(),t=Lt(),n=zt(),r=Gt(),s=Lr(),i=hr(),o=gr(),a=Ar();const c="Block collections are not allowed within flow collections",u=e=>e&&("block-map"===e.type||"block-seq"===e.type);return Tr.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=true;const _=p.atRoot;_&&(p.atRoot=false),p.atKey&&(p.atKey=false);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:false});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=true;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=false;const o=i.resolveProps(w??[],{flow:y,indicator:"map-value-ind",next:S,offset:r.range[2],onError:d,parentIndent:h.indent,startOnNewline:false});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=true,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},Tr}function Ir(){if(Cr)return lr;Cr=1;var e=Ce(),t=st(),n=zt(),r=Gt(),s=kr(),i=Or(),o=Nr();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 lr.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"}`,true):u(l,"TAG_RESOLVE_FAILED",`Unresolved tag: ${f}`,true),a(s,i,o,u,f);i.schema.tags.push(Object.assign({},e,{default:false})),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},lr}var Mr,Dr={},jr={};function Hr(){if(Mr)return jr;Mr=1;var e=st();return jr.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=false,l="",f=s.length;for(let e=1;e<t.length;++e){const s=t[e];switch(s.type){case "space":u=true;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=false;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=true):""===s?"\n"===h?p+="\n":h="\n":(p+=h+s,h=" ",d=false);}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]}},jr}var Fr,Br,zr={};function Kr(){if(Fr)return zr;Fr=1;var e=st(),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 zr.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]}},zr}function Ur(){if(Br)return Dr;Br=1;var e=Ce(),t=st(),n=Hr(),r=Kr();return Dr.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:false,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=>(true===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)}`,true);}}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},Dr}var qr,Zr,Wr,Gr,Vr={};function Yr(){if(qr)return Vr;return qr=1,Vr.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},Vr}function Qr(){if(Zr)return ur;Zr=1;var e=Qe(),t=Ce(),n=Ir(),r=Ur(),s=Lr(),i=Yr();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=true;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",true);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=false;}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=true),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=true),a&&(h.comment=a,h.range[2]=l),h}return ur.composeEmptyNode=c,ur.composeNode=a,ur}function Jr(){if(Wr)return cr;Wr=1;var e=rr(),t=Qr(),n=Lr(),r=hr();return cr.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:false,atRoot:true,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:true});d.found&&(p.directives.docStart=true,!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,false,l);return g.comment&&(p.comment=g.comment),p.range=[o,m,g.offset],p},cr}function Xr(){if(Gr)return Oe;Gr=1;var e=w,t=Ie(),n=rr(),r=or(),s=Ce(),i=Jr(),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=false,r=false;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=true,r=false;break;case "%":"#"!==e[s+1]?.[0]&&(s+=1),n=false;break;default:n||(r=true),n=false;}}return {comment:t,afterEmptyLine:r}}return Oe.Composer=class{constructor(e={}){this.doc=null,this.atDirectives=false,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=false,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=true;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,false),this.doc&&(yield this.doc),this.doc=e,this.atDirectives=false;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=true;const e=o.resolveEnd(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,true),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=false,t=-1){if(this.doc)this.decorate(this.doc,true),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,false),yield r;}}},Oe}var es,ts={},ns={};function rs(){if(es)return ns;es=1;var e=Hr(),t=Kr(),n=or(),r=bt();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),true}return false}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 ns.createScalarToken=function(e,t){const{implicitKey:n=false,indent:i,inFlow:o=false,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:true,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}}},ns.resolveAsScalar=function(r,s=true,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},ns.setScalarValue=function(e,t,n={}){let{afterKey:o=false,implicitKey:a=false,inFlow:c=false,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:true,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");}},ns}var ss,is={};function os(){if(ss)return is;ss=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 is.stringify=n=>"type"in n?e(n):t(n),is}var as,cs,us={};function ls(){if(as)return us;as=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")},us.visit=r,us}function fs(){if(cs)return ts;cs=1;var e=rs(),t=os(),n=ls();return ts.createScalarToken=e.createScalarToken,ts.resolveAsScalar=e.resolveAsScalar,ts.setScalarValue=e.setScalarValue,ts.stringify=t.stringify,ts.visit=n.visit,ts.BOM="\ufeff",ts.DOCUMENT="",ts.FLOW_END="",ts.SCALAR="",ts.isCollection=e=>!!e&&"items"in e,ts.isScalar=e=>!!e&&("scalar"===e.type||"single-quoted-scalar"===e.type||"double-quoted-scalar"===e.type||"block-scalar"===e.type),ts.prettyToken=function(e){switch(e){case "\ufeff":return "<BOM>";case "":return "<DOC>";case "":return "<FLOW_END>";case "":return "<SCALAR>";default:return JSON.stringify(e)}},ts.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},ts}var ps,hs={};function ds(){if(ps)return hs;ps=1;var e=fs();function t(e){switch(e){case void 0:case " ":case "\n":case "\r":case "\t":return true;default:return false}}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 hs.Lexer=class{constructor(){this.atEnd=false,this.blockScalarIndent=-1,this.blockScalarKeep=false,this.buffer="",this.flowKey=false,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0;}*lex(e,t=false){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(true));return yield*this.pushCount(t.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){const e=yield*this.pushSpaces(true);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(false),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(true));return this.indentNext=this.indentValue+1,this.indentValue+=e,yield*this.parseBlockStart()}return "doc"}*parseDocument(){yield*this.pushSpaces(true);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=false,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(true)),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(false),this.indentValue=s=r):r=0,r+=(yield*this.pushSpaces(true));}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(true)),this.flowKey=false;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=false,this.flowLevel+=1,"flow";case "}":case "]":return yield*this.pushCount(1),this.flowKey=true,this.flowLevel-=1,this.flowLevel?"flow":"doc";case "*":return yield*this.pushUntil(o),"flow";case '"':case "'":return this.flowKey=true,yield*this.parseQuotedScalar();case ":":{const e=this.charAt(1);if(this.flowKey||t(e)||","===e)return this.flowKey=false,yield*this.pushCount(1),yield*this.pushSpaces(true),"flow"}default:return this.flowKey=false,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,false),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=false;let e=this.pos;for(;;){const t=this.buffer[++e];if("+"===t)this.blockScalarKeep=true;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,true),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,true),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(true))+(yield*this.pushIndicators());case "&":return (yield*this.pushUntil(o))+(yield*this.pushSpaces(true))+(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=false):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(true))+(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,false)}{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,false)}}*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,false)}},hs}var ms,gs={};function ys(){if(ms)return gs;ms=1;return gs.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}};}},gs}var vs,_s={};function bs(){if(vs)return _s;vs=1;var e=w,t=fs(),n=ds();function r(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return true;return false}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 true;default:return false}}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=true,this.atScalar=false,this.indent=0,this.offset=0,this.onKeyLine=false,this.stack=[],this.source="",this.type="",this.lexer=new n.Lexer,this.onNewLine=e;}*parse(e,t=false){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=false,yield*this.step(),void(this.offset+=n.length);const r=t.tokenType(n);if(r)if("scalar"===r)this.atNewLine=false,this.atScalar=true,this.type="scalar";else {switch(this.type=r,yield*this.step(),r){case "newline":this.atNewLine=true,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=false;}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=true);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=true,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=true,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=false,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=true):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:true})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:true}]}):(t.start.push(this.sourceToken),t.explicitKey=true),void(this.onKeyLine=true);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=true);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=true):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=true))}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=true,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=true;const t=a(o(e));return t.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:true}]}}case "map-value-ind":{this.onKeyLine=true;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=false;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop());}}},_s}var ws,Ss,As={};function ks(){if(ws)return As;ws=1;var e=Xr(),t=rr(),n=or(),r=xt(),s=Ce(),i=ys(),o=bs();function a(e){const t=false!==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),true,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 As.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))},As.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:true},u.streamInfo())},As.parseDocument=c,As.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)},As}var Es=function(){if(Ss)return xe;Ss=1;var e=Xr(),t=rr(),n=Jn(),r=or(),s=Qe(),i=Ce(),o=Lt(),a=st(),c=zt(),u=Gt(),l=fs(),f=ds(),p=ys(),h=bs(),d=ks(),m=Ne();return xe.Composer=e.Composer,xe.Document=t.Document,xe.Schema=n.Schema,xe.YAMLError=r.YAMLError,xe.YAMLParseError=r.YAMLParseError,xe.YAMLWarning=r.YAMLWarning,xe.Alias=s.Alias,xe.isAlias=i.isAlias,xe.isCollection=i.isCollection,xe.isDocument=i.isDocument,xe.isMap=i.isMap,xe.isNode=i.isNode,xe.isPair=i.isPair,xe.isScalar=i.isScalar,xe.isSeq=i.isSeq,xe.Pair=o.Pair,xe.Scalar=a.Scalar,xe.YAMLMap=c.YAMLMap,xe.YAMLSeq=u.YAMLSeq,xe.CST=l,xe.Lexer=f.Lexer,xe.LineCounter=p.LineCounter,xe.Parser=h.Parser,xe.parse=d.parse,xe.parseAllDocuments=d.parseAllDocuments,xe.parseDocument=d.parseDocument,xe.stringify=d.stringify,xe.visit=m.visit,xe.visitAsync=m.visitAsync,xe}(),xs=B(Es);function Os(e,t,n){function r(n,r){var s;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:false}),(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 $s extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");}}class Rs extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError";}}const Cs={};function Ts(e){return Cs}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 Ns(e){return null==e}function Is(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const Ms=Symbol("evaluating");function Ds(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Ms)return void 0===r&&(r=Ms,r=n()),r},set(n){Object.defineProperty(e,t,{value:n});},configurable:true});}function js(e,t,n){Object.defineProperty(e,t,{value:n,writable:true,enumerable:true,configurable:true});}function Hs(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e);}return Object.defineProperties({},t)}function Fs(e){return JSON.stringify(e)}const Bs="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function zs(e){return "object"==typeof e&&null!==e&&!Array.isArray(e)}const Ks=Ls(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return false;try{return new Function(""),!0}catch(e){return false}});function Us(e){if(false===zs(e))return false;const t=e.constructor;if(void 0===t)return true;const n=t.prototype;return false!==zs(n)&&false!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function qs(e){return Us(e)?{...e}:Array.isArray(e)?[...e]:e}const Zs=new Set(["string","number","symbol"]);function Ws(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Gs(e,t,n){const r=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(r._zod.parent=e),r}function Vs(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 Ys(e,t=0){if(true===e.aborted)return true;for(let n=t;n<e.issues.length;n++)if(true!==e.issues[n]?.continue)return true;return false}function Qs(e,t){return t.map(t=>{var n;return (n=t).path??(n.path=[]),t.path.unshift(e),t})}function Js(e){return "string"==typeof e?e:e?.message}function Xs(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const s=Js(e.inst?._zod.def?.error?.(e))??Js(t?.error?.(e))??Js(n.customError?.(e))??Js(n.localeError?.(e))??"Invalid input";r.message=s;}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function ei(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function ti(...e){const[t,n,r]=e;return "string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}const ni=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:false}),Object.defineProperty(e,"issues",{value:t,enumerable:false}),e.message=JSON.stringify(t,Ps,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:false});},ri=Os("$ZodError",ni),si=Os("$ZodError",ni,{Parent:Error});const ii=e=>(t,n,r,s)=>{const i=r?Object.assign(r,{async:false}):{async:false},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new $s;if(o.issues.length){const t=new(s?.Err??e)(o.issues.map(e=>Xs(e,i,Ts())));throw Bs(t,s?.callee),t}return o.value},oi=e=>async(t,n,r,s)=>{const i=r?Object.assign(r,{async:true}):{async:true};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=>Xs(e,i,Ts())));throw Bs(t,s?.callee),t}return o.value},ai=e=>(t,n,r)=>{const s=r?{...r,async:false}:{async:false},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new $s;return i.issues.length?{success:false,error:new(e??ri)(i.issues.map(e=>Xs(e,s,Ts())))}:{success:true,data:i.value}},ci=ai(si),ui=e=>async(t,n,r)=>{const s=r?Object.assign(r,{async:true}):{async:true};let i=t._zod.run({value:n,issues:[]},s);return i instanceof Promise&&(i=await i),i.issues.length?{success:false,error:new e(i.issues.map(e=>Xs(e,s,Ts())))}:{success:true,data:i.value}},li=ui(si),fi=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ii(e)(t,n,s)},pi=e=>(t,n,r)=>ii(e)(t,n,r),hi=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return oi(e)(t,n,s)},di=e=>async(t,n,r)=>oi(e)(t,n,r),mi=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ai(e)(t,n,s)},gi=e=>(t,n,r)=>ai(e)(t,n,r),yi=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ui(e)(t,n,s)},vi=e=>async(t,n,r)=>ui(e)(t,n,r),_i=/^[cC][^\s-]{8,}$/,bi=/^[0-9a-z]+$/,wi=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Si=/^[0-9a-vA-V]{20}$/,Ai=/^[A-Za-z0-9]{27}$/,ki=/^[a-zA-Z0-9_-]{21}$/,Ei=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,xi=/^([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})$/,Oi=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)$/,$i=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const Ri=/^(?:(?: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])$/,Ci=/^(([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}|:))$/,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])\/([0-9]|[1-2][0-9]|3[0-2])$/,Pi=/^(([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])$/,Li=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ni=/^[A-Za-z0-9_-]*$/,Ii=/^(?=.{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])?)*\.?$/,Mi=/^\+(?:[0-9]){6,14}[0-9]$/,Di="(?:(?:\\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])))",ji=new RegExp(`^${Di}$`);function Hi(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 Fi=/^[^A-Z]*$/,Bi=/^[^a-z]*$/,zi=Os("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[]);}),Ki=Os("$ZodCheckMaxLength",(e,t)=>{var n;zi.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return !Ns(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=ei(r);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:true,input:r,inst:e,continue:!t.abort});};}),Ui=Os("$ZodCheckMinLength",(e,t)=>{var n;zi.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return !Ns(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=ei(r);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:true,input:r,inst:e,continue:!t.abort});};}),qi=Os("$ZodCheckLengthEquals",(e,t)=>{var n;zi.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return !Ns(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=ei(r),o=s>t.length;n.issues.push({origin:i,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:true,exact:true,input:n.value,inst:e,continue:!t.abort});};}),Zi=Os("$ZodCheckStringFormat",(e,t)=>{var n,r;zi.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=()=>{});}),Wi=Os("$ZodCheckRegex",(e,t)=>{Zi.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});};}),Gi=Os("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Fi),Zi.init(e,t);}),Vi=Os("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Bi),Zi.init(e,t);}),Yi=Os("$ZodCheckIncludes",(e,t)=>{zi.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});};}),Qi=Os("$ZodCheckStartsWith",(e,t)=>{zi.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});};}),Ji=Os("$ZodCheckEndsWith",(e,t)=>{zi.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});};}),Xi=Os("$ZodCheckOverwrite",(e,t)=>{zi.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value);};});class eo{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 to={major:4,minor:1,patch:12},no=Os("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=to;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=Ys(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&&false===n?.async)throw new $s;if(r||o instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await o;e.issues.length!==t&&(s||(s=Ys(e,t)));});else {if(e.issues.length===t)continue;s||(s=Ys(e,t));}}return r?r.then(()=>e):e},n=(n,s,i)=>{if(Ys(n))return n.aborted=true,n;const o=t(s,r,i);if(o instanceof Promise){if(false===i.async)throw new $s;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:true});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(false===i.async)throw new $s;return o.then(e=>t(e,r,i))}return t(o,r,i)};}e["~standard"]={validate:t=>{try{const n=ci(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return li(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1};}),ro=Os("$ZodString",(e,t)=>{var n;no.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};}),so=Os("$ZodStringFormat",(e,t)=>{Zi.init(e,t),ro.init(e,t);}),io=Os("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=xi),so.init(e,t);}),oo=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=Oi(e));}else t.pattern??(t.pattern=Oi());so.init(e,t);}),ao=Os("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=$i),so.init(e,t);}),co=Os("$ZodURL",(e,t)=>{so.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:Ii.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});}};}),uo=Os("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),so.init(e,t);}),lo=Os("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=ki),so.init(e,t);}),fo=Os("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=_i),so.init(e,t);}),po=Os("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=bi),so.init(e,t);}),ho=Os("$ZodULID",(e,t)=>{t.pattern??(t.pattern=wi),so.init(e,t);}),mo=Os("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Si),so.init(e,t);}),go$1=Os("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Ai),so.init(e,t);}),yo=Os("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=Hi({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(`^${Di}T(?:${r})$`)}(t)),so.init(e,t);}),vo=Os("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=ji),so.init(e,t);}),_o=Os("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${Hi(t)}$`)),so.init(e,t);}),bo=Os("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ei),so.init(e,t);}),wo=Os("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Ri),so.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv4";});}),So=Os("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Ci),so.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});}};}),Ao=Os("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Ti),so.init(e,t);}),ko=Os("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Pi),so.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 Eo(e){if(""===e)return true;if(e.length%4!=0)return false;try{return atob(e),!0}catch{return false}}const xo=Os("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Li),so.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64";}),e._zod.check=n=>{Eo(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort});};});const Oo=Os("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ni),so.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64url";}),e._zod.check=n=>{(function(e){if(!Ni.test(e))return false;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return Eo(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});};}),$o=Os("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Mi),so.init(e,t);});const Ro=Os("$ZodJWT",(e,t)=>{so.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 false}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort});};}),Co=Os("$ZodUnknown",(e,t)=>{no.init(e,t),e._zod.parse=e=>e;}),To=Os("$ZodNever",(e,t)=>{no.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t);});function Po(e,t,n){e.issues.length&&t.issues.push(...Qs(n,e.issues)),t.value[n]=e.value;}const Lo=Os("$ZodArray",(e,t)=>{no.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=>Po(t,n,e))):Po(a,n,e);}return i.length?Promise.all(i).then(()=>n):n};});function No(e,t,n,r){e.issues.length&&t.issues.push(...Qs(n,e.issues)),void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value;}function Io(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 Mo(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=>No(e,n,s,t))):No(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 Do=Os("$ZodObject",(e,t)=>{no.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(()=>Io(t));Ds(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=zs,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=>No(n,t,e,a))):No(r,t,e,a);}return i?Mo(c,a,t,n,r.value,e):c.length?Promise.all(c).then(()=>t):t};}),jo=Os("$ZodObjectJIT",(e,t)=>{Do.init(e,t);const n=e._zod.parse,r=Ls(()=>Io(t));let s;const i=zs,o=!Cs.jitless,a=o&&Ks.value,c=t.catchall;let u;e._zod.parse=(l,f)=>{u??(u=r.value);const p=l.value;return i(p)?o&&a&&false===f?.async&&true!==f.jitless?(s||(s=(e=>{const t=new eo(["shape","payload","ctx"]),n=r.value,s=e=>{const t=Fs(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=Fs(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?Mo([],p,l,f,u,e):l):n(l,f):(l.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),l)};});function Ho(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=>!Ys(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=>Xs(e,r,Ts())))}),t)}const Fo=Os("$ZodUnion",(e,t)=>{no.init(e,t),Ds(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),Ds(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),Ds(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Ds(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=>Is(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=false;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=true;else {if(0===t.issues.length)return t;a.push(t);}}return o?Promise.all(a).then(t=>Ho(t,s,e,i)):Ho(a,s,e,i)};}),Bo=Os("$ZodIntersection",(e,t)=>{no.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])=>Ko(e,t,n)):Ko(e,s,i)};});function zo(e,t){if(e===t)return {valid:true,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return {valid:true,data:e};if(Us(e)&&Us(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=zo(e[n],t[n]);if(!r.valid)return {valid:false,mergeErrorPath:[n,...r.mergeErrorPath]};s[n]=r.data;}return {valid:true,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return {valid:false,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const s=zo(e[r],t[r]);if(!s.valid)return {valid:false,mergeErrorPath:[r,...s.mergeErrorPath]};n.push(s.data);}return {valid:true,data:n}}return {valid:false,mergeErrorPath:[]}}function Ko(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Ys(e))return e;const r=zo(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 Uo=Os("$ZodRecord",(e,t)=>{no.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!Us(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(...Qs(e,t.issues)),n.value[e]=t.value;})):(o.issues.length&&n.issues.push(...Qs(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=>Xs(e,r,Ts())),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(...Qs(o,e.issues)),n.value[a.value]=e.value;})):(c.issues.length&&n.issues.push(...Qs(o,c.issues)),n.value[a.value]=c.value);}}return i.length?Promise.all(i).then(()=>n):n};}),qo=Os("$ZodEnum",(e,t)=>{no.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=>Zs.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};}),Zo=Os("$ZodTransform",(e,t)=>{no.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new Rs(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 $s;return n.value=s,n};});function Wo(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const Go=Os("$ZodOptional",(e,t)=>{no.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ds(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ds(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Is(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=>Wo(t,e.value)):Wo(r,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)};}),Vo=Os("$ZodNullable",(e,t)=>{no.init(e,t),Ds(e._zod,"optin",()=>t.innerType._zod.optin),Ds(e._zod,"optout",()=>t.innerType._zod.optout),Ds(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Is(e.source)}|null)$`):void 0}),Ds(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);}),Yo=Os("$ZodDefault",(e,t)=>{no.init(e,t),e._zod.optin="optional",Ds(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=>Qo(e,t)):Qo(r,t)};});function Qo(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Jo=Os("$ZodPrefault",(e,t)=>{no.init(e,t),e._zod.optin="optional",Ds(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));}),Xo=Os("$ZodNonOptional",(e,t)=>{no.init(e,t),Ds(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=>ea(t,e)):ea(s,e)};});function ea(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 ta=Os("$ZodCatch",(e,t)=>{no.init(e,t),Ds(e._zod,"optin",()=>t.innerType._zod.optin),Ds(e._zod,"optout",()=>t.innerType._zod.optout),Ds(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=>Xs(e,n,Ts()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Xs(e,n,Ts()))},input:e.value}),e.issues=[]),e)};}),na=Os("$ZodPipe",(e,t)=>{no.init(e,t),Ds(e._zod,"values",()=>t.in._zod.values),Ds(e._zod,"optin",()=>t.in._zod.optin),Ds(e._zod,"optout",()=>t.out._zod.optout),Ds(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=>ra(e,t.in,n)):ra(r,t.in,n)}const r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>ra(e,t.out,n)):ra(r,t.out,n)};});function ra(e,t,n){return e.issues.length?(e.aborted=true,e):t._zod.run({value:e.value,issues:e.issues},n)}const sa=Os("$ZodReadonly",(e,t)=>{no.init(e,t),Ds(e._zod,"propValues",()=>t.innerType._zod.propValues),Ds(e._zod,"values",()=>t.innerType._zod.values),Ds(e._zod,"optin",()=>t.innerType._zod.optin),Ds(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(ia):ia(r)};});function ia(e){return e.value=Object.freeze(e.value),e}const oa=Os("$ZodCustom",(e,t)=>{zi.init(e,t),no.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=>aa(t,n,r,e));aa(s,n,r,e);};});function aa(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(ti(e));}}class ca{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 ua(){return new ca}const la=ua();function fa(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:false,...Vs(t)})}function pa(e,t){return new Ki({check:"max_length",...Vs(t),maximum:e})}function ha(e,t){return new Ui({check:"min_length",...Vs(t),minimum:e})}function da(e,t){return new qi({check:"length_equals",...Vs(t),length:e})}function ma(e){return new Xi({check:"overwrite",tx:e})}function ga(e){const t=function(e,t){const n=new zi({check:"custom",...Vs(t)});return n._zod.check=e,n}(n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(ti(e,n.value,t._zod.def));else {const r=e;r.fatal&&(r.continue=false),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(ti(r));}},e(n.value,n)));return t}const ya=Os("ZodISODateTime",(e,t)=>{yo.init(e,t),Ua.init(e,t);});function va(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:false,local:false,precision:null,...Vs(t)})}(ya,e)}const _a=Os("ZodISODate",(e,t)=>{vo.init(e,t),Ua.init(e,t);});function ba(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Vs(t)})}(_a,e)}const wa=Os("ZodISOTime",(e,t)=>{_o.init(e,t),Ua.init(e,t);});function Sa(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Vs(t)})}(wa,e)}const Aa=Os("ZodISODuration",(e,t)=>{bo.init(e,t),Ua.init(e,t);});function ka(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Vs(t)})}(Aa,e)}const Ea=(e,t)=>{ri.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t=e=>e.message){const n={_errors:[]},r=e=>{for(const s of e.issues)if("invalid_union"===s.code&&s.errors.length)s.errors.map(e=>r({issues:e}));else if("invalid_key"===s.code)r({issues:s.issues});else if("invalid_element"===s.code)r({issues:s.issues});else if(0===s.path.length)n._errors.push(t(s));else {let e=n,r=0;for(;r<s.path.length;){const n=s.path[r];r===s.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(s))):e[n]=e[n]||{_errors:[]},e=e[n],r++;}}};return r(e),n}(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}});},xa=Os("ZodError",Ea),Oa=Os("ZodError",Ea,{Parent:Error}),$a=ii(Oa),Ra=oi(Oa),Ca=ai(Oa),Ta=ui(Oa),Pa=fi(Oa),La=pi(Oa),Na=hi(Oa),Ia=di(Oa),Ma=mi(Oa),Da=gi(Oa),ja=yi(Oa),Ha=vi(Oa),Fa=Os("ZodType",(e,t)=>(no.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)=>Gs(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>$a(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Ca(e,t,n),e.parseAsync=async(t,n)=>Ra(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Ta(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Pa(e,t,n),e.decode=(t,n)=>La(e,t,n),e.encodeAsync=async(t,n)=>Na(e,t,n),e.decodeAsync=async(t,n)=>Ia(e,t,n),e.safeEncode=(t,n)=>Ma(e,t,n),e.safeDecode=(t,n)=>Da(e,t,n),e.safeEncodeAsync=async(t,n)=>ja(e,t,n),e.safeDecodeAsync=async(t,n)=>Ha(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,...Vs(n)})}(Nc,e,t)}(t,n)),e.superRefine=t=>e.check(ga(t)),e.overwrite=t=>e.check(ma(t)),e.optional=()=>kc(e),e.nullable=()=>xc(e),e.nullish=()=>kc(xc(e)),e.nonoptional=t=>function(e,t){return new Rc({type:"nonoptional",innerType:e,...Vs(t)})}(e,t),e.array=()=>mc(e),e.or=t=>vc([e,t]),e.and=t=>new _c({type:"intersection",left:e,right:t}),e.transform=t=>Pc(e,new Sc({type:"transform",transform:t})),e.default=t=>{return n=t,new Oc({type:"default",innerType:e,get defaultValue(){return "function"==typeof n?n():qs(n)}});var n;},e.prefault=t=>{return n=t,new $c({type:"prefault",innerType:e,get defaultValue(){return "function"==typeof n?n():qs(n)}});var n;},e.catch=t=>{return new Cc({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n;},e.pipe=t=>Pc(e,t),e.readonly=()=>new Lc({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return la.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>la.get(e)?.description,configurable:true}),e.meta=(...t)=>{if(0===t.length)return la.get(e);const n=e.clone();return la.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Ba=Os("_ZodString",(e,t)=>{ro.init(e,t),Fa.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 Wi({check:"string_format",format:"regex",...Vs(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Yi({check:"string_format",format:"includes",...Vs(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new Qi({check:"string_format",format:"starts_with",...Vs(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new Ji({check:"string_format",format:"ends_with",...Vs(t),suffix:e})}(...t)),e.min=(...t)=>e.check(ha(...t)),e.max=(...t)=>e.check(pa(...t)),e.length=(...t)=>e.check(da(...t)),e.nonempty=(...t)=>e.check(ha(1,...t)),e.lowercase=t=>e.check(function(e){return new Gi({check:"string_format",format:"lowercase",...Vs(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Vi({check:"string_format",format:"uppercase",...Vs(e)})}(t)),e.trim=()=>e.check(ma(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return ma(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(ma(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(ma(e=>e.toUpperCase()));}),za=Os("ZodString",(e,t)=>{ro.init(e,t),Ba.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:false,...Vs(t)})}(qa,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:false,...Vs(t)})}(Ga,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:false,...Vs(t)})}(uc,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:false,...Vs(t)})}(Va,t)),e.guid=t=>e.check(fa(Za,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,...Vs(t)})}(Wa,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v4",...Vs(t)})}(Wa,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v6",...Vs(t)})}(Wa,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v7",...Vs(t)})}(Wa,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:false,...Vs(t)})}(Ya,t)),e.guid=t=>e.check(fa(Za,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:false,...Vs(t)})}(Qa,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:false,...Vs(t)})}(Ja,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:false,...Vs(t)})}(Xa,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:false,...Vs(t)})}(oc,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:false,...Vs(t)})}(ac,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:false,...Vs(t)})}(ec,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:false,...Vs(t)})}(tc,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:false,...Vs(t)})}(nc,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:false,...Vs(t)})}(rc,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:false,...Vs(t)})}(sc,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:false,...Vs(t)})}(ic,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:false,...Vs(t)})}(cc,t)),e.datetime=t=>e.check(va(t)),e.date=t=>e.check(ba(t)),e.time=t=>e.check(Sa(t)),e.duration=t=>e.check(ka(t));});function Ka(e){return function(e,t){return new e({type:"string",...Vs(t)})}(za,e)}const Ua=Os("ZodStringFormat",(e,t)=>{so.init(e,t),Ba.init(e,t);}),qa=Os("ZodEmail",(e,t)=>{ao.init(e,t),Ua.init(e,t);}),Za=Os("ZodGUID",(e,t)=>{io.init(e,t),Ua.init(e,t);}),Wa=Os("ZodUUID",(e,t)=>{oo.init(e,t),Ua.init(e,t);}),Ga=Os("ZodURL",(e,t)=>{co.init(e,t),Ua.init(e,t);}),Va=Os("ZodEmoji",(e,t)=>{uo.init(e,t),Ua.init(e,t);}),Ya=Os("ZodNanoID",(e,t)=>{lo.init(e,t),Ua.init(e,t);}),Qa=Os("ZodCUID",(e,t)=>{fo.init(e,t),Ua.init(e,t);}),Ja=Os("ZodCUID2",(e,t)=>{po.init(e,t),Ua.init(e,t);}),Xa=Os("ZodULID",(e,t)=>{ho.init(e,t),Ua.init(e,t);}),ec=Os("ZodXID",(e,t)=>{mo.init(e,t),Ua.init(e,t);}),tc=Os("ZodKSUID",(e,t)=>{go$1.init(e,t),Ua.init(e,t);}),nc=Os("ZodIPv4",(e,t)=>{wo.init(e,t),Ua.init(e,t);}),rc=Os("ZodIPv6",(e,t)=>{So.init(e,t),Ua.init(e,t);}),sc=Os("ZodCIDRv4",(e,t)=>{Ao.init(e,t),Ua.init(e,t);}),ic=Os("ZodCIDRv6",(e,t)=>{ko.init(e,t),Ua.init(e,t);}),oc=Os("ZodBase64",(e,t)=>{xo.init(e,t),Ua.init(e,t);}),ac=Os("ZodBase64URL",(e,t)=>{Oo.init(e,t),Ua.init(e,t);}),cc=Os("ZodE164",(e,t)=>{$o.init(e,t),Ua.init(e,t);}),uc=Os("ZodJWT",(e,t)=>{Ro.init(e,t),Ua.init(e,t);}),lc=Os("ZodUnknown",(e,t)=>{Co.init(e,t),Fa.init(e,t);});function fc(){return new lc({type:"unknown"})}const pc=Os("ZodNever",(e,t)=>{To.init(e,t),Fa.init(e,t);});function hc(e){return function(e,t){return new e({type:"never",...Vs(t)})}(pc,e)}const dc=Os("ZodArray",(e,t)=>{Lo.init(e,t),Fa.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(ha(t,n)),e.nonempty=t=>e.check(ha(1,t)),e.max=(t,n)=>e.check(pa(t,n)),e.length=(t,n)=>e.check(da(t,n)),e.unwrap=()=>e.element;});function mc(e,t){return function(e,t,n){return new e({type:"array",element:t,...Vs(n)})}(dc,e,t)}const gc=Os("ZodObject",(e,t)=>{jo.init(e,t),Fa.init(e,t),Ds(e,"shape",()=>t.shape),e.keyof=()=>function(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new wc({type:"enum",entries:n,...Vs(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:fc()}),e.loose=()=>e.clone({...e._zod.def,catchall:fc()}),e.strict=()=>e.clone({...e._zod.def,catchall:hc()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Us(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 js(this,"shape",n),n},checks:[]});return Gs(e,r)}(e,t),e.safeExtend=t=>function(e,t){if(!Us(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 js(this,"shape",n),n},checks:e._zod.def.checks};return Gs(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 js(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Gs(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def;return Gs(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 js(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 js(this,"shape",r),r},checks:[]});return Gs(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 js(this,"shape",s),s},checks:[]});return Gs(t,r)}(Ac,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 js(this,"shape",s),s},checks:[]});return Gs(t,r)}(Rc,e,t[0]);});const yc=Os("ZodUnion",(e,t)=>{Fo.init(e,t),Fa.init(e,t),e.options=t.options;});function vc(e,t){return new yc({type:"union",options:e,...Vs(t)})}const _c=Os("ZodIntersection",(e,t)=>{Bo.init(e,t),Fa.init(e,t);});const bc=Os("ZodRecord",(e,t)=>{Uo.init(e,t),Fa.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType;});const wc=Os("ZodEnum",(e,t)=>{qo.init(e,t),Fa.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 wc({...t,checks:[],...Vs(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 wc({...t,checks:[],...Vs(r),entries:s})};});const Sc=Os("ZodTransform",(e,t)=>{Zo.init(e,t),Fa.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new Rs(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(ti(r,n.value,t));else {const t=r;t.fatal&&(t.continue=false),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(ti(t));}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(e=>(n.value=e,n)):(n.value=s,n)};});const Ac=Os("ZodOptional",(e,t)=>{Go.init(e,t),Fa.init(e,t),e.unwrap=()=>e._zod.def.innerType;});function kc(e){return new Ac({type:"optional",innerType:e})}const Ec=Os("ZodNullable",(e,t)=>{Vo.init(e,t),Fa.init(e,t),e.unwrap=()=>e._zod.def.innerType;});function xc(e){return new Ec({type:"nullable",innerType:e})}const Oc=Os("ZodDefault",(e,t)=>{Yo.init(e,t),Fa.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap;});const $c=Os("ZodPrefault",(e,t)=>{Jo.init(e,t),Fa.init(e,t),e.unwrap=()=>e._zod.def.innerType;});const Rc=Os("ZodNonOptional",(e,t)=>{Xo.init(e,t),Fa.init(e,t),e.unwrap=()=>e._zod.def.innerType;});const Cc=Os("ZodCatch",(e,t)=>{ta.init(e,t),Fa.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap;});const Tc=Os("ZodPipe",(e,t)=>{na.init(e,t),Fa.init(e,t),e.in=t.in,e.out=t.out;});function Pc(e,t){return new Tc({type:"pipe",in:e,out:t})}const Lc=Os("ZodReadonly",(e,t)=>{sa.init(e,t),Fa.init(e,t),e.unwrap=()=>e._zod.def.innerType;});const Nc=Os("ZodCustom",(e,t)=>{oa.init(e,t),Fa.init(e,t);});const Ic=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},Mc=(e,t)=>{const n=t?JSON.parse(e):xs.parse(e);return n&&"object"==typeof n?n:{}},Dc=mc(Ka()).default([]).optional(),jc=vc([Ka(),mc(Ka())]),Hc=(Fc=Ka(),Bc=jc,new bc({type:"record",keyType:Fc,valueType:Bc,...Vs(zc)})).optional();var Fc,Bc,zc;const Kc=function(e,t){const n={type:"object",shape:e??{},...Vs(t)};return new gc(n)}({stanPath:Ka().min(1,{message:"stanPath must be a non-empty string"}),includes:Dc,excludes:Dc,imports:Hc}).strict(),Uc=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 xa?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))}},qc=e=>{const t=ke(e);if(!t)throw new Error("stan config not found");const r=readFileSync(t,"utf8"),s=Mc(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=Uc(s["stan-core"]),o=Ic(i.imports);return {stanPath:i.stanPath,includes:i.includes??[],excludes:i.excludes??[],imports:o}},Zc=async e=>{const t=ke(e);if(!t)throw new Error("stan config not found");const n=t.replace(/\\/g,"/");return (async(e,t)=>{const n=await readFile(e,"utf8"),r=Mc(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=Uc(r["stan-core"]),o=Ic(s.imports);return {stanPath:s.stanPath,includes:s.includes??[],excludes:s.excludes??[],imports:o}})(t,n)},Wc=e=>{try{return qc(e).stanPath}catch{return ve}},Gc=async e=>{try{return (await Zc(e)).stanPath}catch{return ve}},Vc=(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:resolve(e,n),systemAbs:resolve(e,r),outputAbs:resolve(e,s),diffAbs:resolve(e,i),distAbs:resolve(e,o),patchAbs:resolve(e,a),importsAbs:resolve(e,c)}};var Yc={makeStanDirs:Vc},Qc=Object.freeze({__proto__:null,default:Yc,makeStanDirs:Vc});const Jc=async(e,n,i=false)=>{const a=Vc(e,n);if(await me(e,n),!i){const e=resolve(a.outputAbs,T);if(existsSync(e))try{await copyFile(e,resolve(a.diffAbs,P));}catch{}const n=await readdir(a.outputAbs,{withFileTypes:true});for(const e of n)rmSync(resolve(a.outputAbs,e.name),{recursive:true,force:true});}return a.rootAbs},Xc=async(e,t)=>{const n={};for(const r of t){const t=resolve(e,r),s=await readFile(t),o=createHash("sha256").update(s).digest("hex");n[r]=o;}return n},eu=e=>join(e,".archive.snapshot.json"),tu=async({cwd:e,stanPath:t,includes:n,excludes:r,anchors:s})=>{const{diffDir:i}=await ge(e,t),o=await fe(e),c=await de(o,{cwd:e,stanPath:t,includeOutputDir:false,includes:n??[],excludes:r??[],anchors:s??[]}),u=await Xc(e,c),l=eu(i);return await writeFile(l,JSON.stringify(u,null,2),"utf8"),l},nu=async({cwd:e,stanPath:n,baseName:r,includes:s,excludes:o,updateSnapshot:c="createIfMissing",includeOutputDirInDiff:u=false,anchors:l,onArchiveWarnings:f})=>{const{outDir:p,diffDir:d}=await ge(e,n),m=await fe(e),g=await de(m,{cwd:e,stanPath:n,includeOutputDir:false,includes:s??[],excludes:o??[],anchors:l??[]}),y=await Xc(e,g),v=eu(d),_=existsSync(v),b=_?JSON.parse(await readFile(v,"utf8")):{},w=_?g.filter(e=>!b[e]||b[e]!==y[e]):[...g],S=await(async()=>{try{const e=await import('./classifier-DeYwffC_-DftahF7h.js'),t=e.classifyForArchive,n=e.default?.classifyForArchive,r="function"==typeof t?t:n;if("function"==typeof r)return r}catch{}throw new Error("classifyForArchive export not found in ./classifier")})(),{textFiles:A,warningsBody:k}=await S(e,w),E=A;H(k,f);const x=join(p,`${r}.diff.tar`),O=await import('./index-ucZa1KMb-CNGeWGvV.js');if(u)await O.create({file:x,cwd:e,filter:D(n)},j(E,n));else if(0===E.length){const t=(e=>join(e,".stan_no_changes"))(d);await writeFile(t,"no changes","utf8");const r=[`${n.replace(/\\/g,"/")}/diff/.stan_no_changes`];await O.create({file:x,cwd:e},r);}else {const t=Array.from(new Set([...E]));await O.create({file:x,cwd:e},t);}return "replace"===c?await writeFile(v,JSON.stringify(y,null,2),"utf8"):"createIfMissing"!==c||_||await writeFile(v,JSON.stringify(y,null,2),"utf8"),{diffPath:x}},ru=e=>e.replace(/\\/g,"/").replace(/^\.\/+/,""),su=e=>{if("string"!=typeof e||!e.trim())return null;const t=ru(e.trim());if(/^[/\\]/.test(t))return null;const n=t.split("/").filter(Boolean);if(n.some(e=>".."===e))return null;const r=n.join("/");return r.length?r:null},iu=e=>{const t=/^###\s+File Ops\s*$/m.exec(e);if(!t)return null;const n=t.index+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},ou=/^###\s+Patch:\s+(.+?)\s*$/m,au=/^###\s+Full Listing:\s+(.+?)\s*$/m,cu=/^##\s+Commit Message\s*$/m,uu=/^##\s+.*$|^###\s+.*$/m,lu=e=>{const t=[],n=[];{const t=new RegExp(uu.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(cu.test(o)){t.push({kind:"commit",start:s,body:o});continue}const a=o.match(ou);if(a&&a[1]){t.push({kind:"patch",path:ru(a[1].trim()),start:s,body:o});continue}const c=o.match(au);c&&c[1]&&t.push({kind:"full",path:ru(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:ru(r[1]),b:ru(r[2])});return n},pu=e=>{const t=[];((e,t)=>{const n=iu(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=>su(e);if(/^(mv|rm|rmdir|mkdirp)$/.test(i)){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}1===o.length?u(o[0])||c(`${i}: invalid repo-relative path`):c(`expected 1 path, got ${o.length.toString()}`);}else c(`unknown verb "${i}"`);}})(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=ru("string"==typeof t.path?t.path:"(unknown)");e.set(n,t);}for(const n of r){const r=ru(n.path),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 {"commit"!==n[n.length-1].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=n[0]?.b,r="string"==typeof t?ru(t):"";r.length&&e.push(r);}else {const n=t.path?ru(t.path):"";n.length&&e.push(n);}}const n=e=>".stan/system/stan.todo.md"===ru(e),s=e=>{const t=ru(e);if(!t)return false;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:[]}},hu=e=>{const t=pu(e);if(!t.ok){const e="Response-format validation failed:\n"+t.errors.map(e=>`- ${e}`).join("\n");throw new Error(e)}},du={extractBlocks:lu,parseDiffHeaders:fu,isCommitLast:e=>{if(!e.match(cu))return false;const t=e.search(cu);if(t<0)return false;const n=e.slice(t),r=n.match(/^`{3,}/m);if(!r)return false;const s=(r[0].match(/`/g)??[]).length,i=new RegExp(`^\\\`{${String(s)}{'}}\\s*$`,"m");if(!n.match(i))return false;const o=n.search(i);if(o<0)return false;return 0===n.slice(o+s).trim().length}},mu=e=>e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),gu=e=>e.endsWith("\n")?e:e+"\n",yu=/[\u200B-\u200D\uFEFF]/g,vu=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)),_u=e=>{const t=mu(e).replace(yu,"");return gu(t)},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;})(_u(e.trim())),n=_u(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(t[n].trimEnd()==="`".repeat(r)){const r=t.slice(e+1,n).join("\n");if(vu(r))return r;e=n;break}}let n=e.search(/^diff --git /m);return n<0&&(n=e.search(/^---\s+(?:a\/|\S)/m)),n<0?null:e.slice(n).replace(/\n`{3,}\s*$/m,"\n")})(n);return gu(r?_u(r).trimEnd():n)},wu=e=>{const t=[],n=[],r=iu(e),s=r?{body:r}:null;if(!s)return {ops:t,errors:n};const i=s.body.split(/\r?\n/);let o=0;for(const e of i){o+=1;const r=e.trim();if(!r)continue;const s=r.split(/\s+/),i=s[0],a=s.slice(1),c=e=>{n.push(`file-ops line ${o.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=>su(e);switch(i){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 "${i}"`);}}return {ops:t,errors:n}},Su=async(e,t,n=false)=>{const r=[],i=t=>((e,t)=>{const n=path.resolve(e,t),r=path.resolve(e)+path.sep,s=n===path.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 pathExists(t),c=await pathExists(s);if(!a)throw new Error("source does not exist");if(c)throw new Error("destination exists (no overwrite)");n||(await ensureDir(path.dirname(s)),await move(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 pathExists(t))throw new Error("path does not exist");n||await remove(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 stat(t);}catch{o=null;}if(!o)throw new Error("directory does not exist");if(!o.isDirectory())throw new Error("not a directory");if((await readdir(t)).length>0)throw new Error("directory not empty");n||await remove(t);}else {const{abs:t,ok:r}=i(e.src);if(!r)throw new Error("path escapes repo root");n||await ensureDir(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 Au(e){return Array.isArray(e)?e.map(e=>Au(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 ku(e){return Array.isArray(e)?e.map(e=>ku(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 Eu(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 xu(e,t,n){let r=true,s=false,i=false,o=1;return function a(){if(r&&!i){if(s?o++:r=false,e+o<=n)return e+o;i=true;}if(!s)return i||(r=true),t<=e-o?e-o++:(s=true,a())}}function Ou(e,t,n={}){let r;if(r="string"==typeof t?Eu(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=Au(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=ku(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=false,l=false;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=true:"-"==c[0]&&(l=true)),c=t;}if(u){if(l){if(!o&&""==r[r.length-1])return false}else if(""==r[r.length-1])r.pop();else if(!o)return false}else if(l)if(""!=r[r.length-1])r.push("");else if(!o)return false;function f(e,t,n,s=0,o=true,a=[],c=0){let u=0,l=false;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,false,a,c+1)):null;t++,u=0;}if("+"===h){if(!o)return null;a[c]=d,c++,u=0,l=true;}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,false,a,c+1)||f(e,t+1,n-1,s,false,a,c+1))||f(e,t,n-1,s+1,false,a,c);c++,o=true,l=false,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=xu(c,a,i);for(;void 0!==c&&(n=f(t.lines,c,e),!n);c=r());if(n)break}if(!n)return false;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 $u=async e=>{const t=path.dirname(e);try{await ensureDir(t);}catch{}},Ru=e=>{if(!e)return null;const t=e.replace(/^a\//,"").replace(/^b\//,"").trim();return t.length?t:null},Cu=e=>"string"==typeof e&&"/dev/null"===e.trim(),Tu=e=>e.replace(/\r/g,"").replace(/[ \t]+$/g,""),Pu=e=>e.replace(/\n/g,"\r\n"),Lu=async e=>{const{cwd:t,cleaned:n,check:r,sandboxRoot:s}=e;let o;try{o=Eu(n);}catch{return {okFiles:[],failed:[{path:"(patch)",reason:"invalid unified diff"}],sandboxRoot:s}}const c=o.some(e=>{const t=Ru(e.oldFileName),n=Ru(e.newFileName);return Boolean(t&&t.length||n&&n.length)});if(!o.length||!c)return {okFiles:[],failed:[{path:"(patch)",reason:"invalid unified diff"}],sandboxRoot:s};const u=[],l=[];for(const e of o){const n=Ru(e.newFileName)??Ru(e.oldFileName);if(!n){l.push({path:"(unknown)",reason:"no file name in patch header"});continue}const o=n.replace(/^\.\//,"").replace(/\\/g,"/"),c=path.resolve(t,o),p=/\.md$/i.test(o);let h="",d=false,m=true;try{const e=await readFile(c,"utf8");h=e,d=/\r\n/.test(e);}catch{m=false;}const g=Cu(e.oldFileName);if(!m&&!g){l.push({path:o,reason:"target file not found"});continue}let y;!m&&g&&(h="",d=false);try{y=Ou(h,e,{compareLine:(e,t,n,r)=>Tu(t)===Tu(r),fuzzFactor:p?1:0});}catch{l.push({path:o,reason:"unable to parse or place hunk(s)"});continue}if(false===y||"string"!=typeof y){l.push({path:o,reason:"unable to place hunk(s)"});continue}const v=d?Pu(y.replace(/\r/g,"")):y.replace(/\r/g,"");try{if(r){const e=s??path.join(t,".stan","patch",".sandbox"),n=path.resolve(e,o);await $u(n),await writeFile(n,v,"utf8");}else {try{await $u(c);}catch{}await writeFile(c,v,"utf8");}u.push(o);}catch{l.push({path:o,reason:"write failed"});}}return {okFiles:u,failed:l,sandboxRoot:s}},Nu=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)),c=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=spawn("git",["apply",...o.args,t],{cwd:e,shell:false,windowsHide:true});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:true,tried:s,lastCode:0,captures:i};r&&console.error(`stan: git apply failed for ${o.label} (exit ${String(n)})`);}return {ok:false,tried:s,lastCode:1,captures:i}})(t,n,o);if(c.ok)return {ok:true,result:c,js:null};const l=await Lu({cwd:t,cleaned:r,check:s});if(l.okFiles.length>0&&0===l.failed.length)return {ok:true,result:c,js:l};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=t[1].trim().replace(/^\.\//,"").replace(/\\/g,"/");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 c=[];let l=!1;for(let e=s+1;e<r.length;e+=1){const t=r[e];if(/^diff --git /.test(t))break;if(/^@@ /.test(t))l=!0;else if(l&&/^[ +-]/.test(t)){const e=t[0];"+"!==e&&" "!==e||c.push(t.slice(1));}}let p=c.join("\n");p.endsWith("\n")||(p+="\n");const h=n?path.join(e,".stan","patch",".sandbox","F"):e,d=path.resolve(h,i);return await mkdir(path.dirname(d),{recursive:!0}),await writeFile(d,p,"utf8"),{okFiles:[i],failed:[],sandboxRoot:n?h:void 0}})(t,r,s);if(e)return {ok:!0,result:c,js:e}}catch{}return {ok:false,result:c,js:l}};var Iu,Mu={},Du={},ju={};function Hu(){if(Iu)return ju;return Iu=1,Object.defineProperty(ju,"__esModule",{value:true}),ju.splitWhen=ju.flatten=void 0,ju.flatten=function(e){return e.reduce((e,t)=>[].concat(e,t),[])},ju.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},ju}var Fu,Bu={};function zu(){if(Fu)return Bu;return Fu=1,Object.defineProperty(Bu,"__esModule",{value:true}),Bu.isEnoentCodeError=void 0,Bu.isEnoentCodeError=function(e){return "ENOENT"===e.code},Bu}var Ku,Uu={};var qu,Zu={};function Wu(){if(qu)return Zu;qu=1,Object.defineProperty(Zu,"__esModule",{value:true}),Zu.convertPosixPathToPattern=Zu.convertWindowsPathToPattern=Zu.convertPathToPattern=Zu.escapePosixPath=Zu.escapeWindowsPath=Zu.escape=Zu.removeLeadingDotSegment=Zu.makeAbsolute=Zu.unixify=void 0;const e=x,t="win32"===E.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 Zu.unixify=function(e){return e.replace(/\\/g,"/")},Zu.makeAbsolute=function(t,n){return e.resolve(t,n)},Zu.removeLeadingDotSegment=function(e){if("."===e.charAt(0)){const t=e.charAt(1);if("/"===t||"\\"===t)return e.slice(2)}return e},Zu.escape=t?o:a,Zu.escapeWindowsPath=o,Zu.escapePosixPath=a,Zu.convertPathToPattern=t?c:u,Zu.convertWindowsPathToPattern=c,Zu.convertPosixPathToPattern=u,Zu}var Gu,Vu,Yu,Qu,Ju,Xu,el={};function tl(){return Vu?Gu:(Vu=1,Gu=function(e){if("string"!=typeof e||""===e)return false;for(var t;t=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(t[2])return true;e=e.slice(t.index+t[0].length);}return false})}function nl(){if(Qu)return Yu;Qu=1;var e=tl(),t={"{":"}","(":")","[":"]"},n=function(e){if("!"===e[0])return true;for(var n=0,r=-2,s=-2,i=-2,o=-2,a=-2;n<e.length;){if("*"===e[n])return true;if("?"===e[n+1]&&/[\].+)]/.test(e[n]))return true;if(-1!==s&&"["===e[n]&&"]"!==e[n+1]&&(s<n&&(s=e.indexOf("]",n)),s>n)){if(-1===a||a>s)return true;if(-1===(a=e.indexOf("\\",n))||a>s)return true}if(-1!==i&&"{"===e[n]&&"}"!==e[n+1]&&(i=e.indexOf("}",n))>n&&(-1===(a=e.indexOf("\\",n))||a>i))return true;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 true;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 true;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 true}else n++;}return false},r=function(e){if("!"===e[0])return true;for(var n=0;n<e.length;){if(/[*?{}()[\]]/.test(e[n]))return true;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 true}else n++;}return false};return Yu=function(t,s){if("string"!=typeof t||""===t)return false;if(e(t))return true;var i=n;return s&&false===s.strict&&(i=r),i(t)}}var rl,sl,il,ol,al,cl,ul,ll,fl,pl,hl,dl,ml,gl,yl,vl,_l,bl,wl,Sl={};function Al(){return rl||(rl=1,(e=Sl).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)=>false!==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)&&true!==r.escaped&&(r.value="\\"+r.value,r.escaped=true);},e.encloseBrace=e=>!("brace"!==e.type||e.commas>>0+e.ranges|0||(e.invalid=true,0)),e.isInvalidBrace=e=>!("brace"!==e.type||true!==e.invalid&&!e.dollar&&(e.commas>>0+e.ranges|0&&true===e.open&&true===e.close||(e.invalid=true,0))),e.isOpenOrClose=e=>"open"===e.type||"close"===e.type||true===e.open||true===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}),Sl;var e;}function kl(){if(il)return sl;il=1;const e=Al();return sl=(t,n={})=>{const r=(t,s={})=>{const i=n.escapeInvalid&&e.isInvalidBrace(s),o=true===t.invalid&&true===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 El(){return al?ol:(al=1,ol=function(e){return "number"==typeof e?e-e===0:"string"==typeof e&&""!==e.trim()&&(Number.isFinite?Number.isFinite(+e):isFinite(+e))})}function xl(){if(ul)return cl;ul=1;const e=El(),t=(n,i,o)=>{if(false===e(n))throw new TypeError("toRegexRange: expected the first argument to be a number");if(void 0===i||n===i)return String(n);if(false===e(i))throw new TypeError("toRegexRange: expected the second argument to be a number.");let a={relaxZeros:true,...o};"boolean"==typeof a.strictZeros&&(a.relaxZeros=false===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})`:false===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,"-",false)||[],r=s(t,e,"",false)||[],i=s(e,t,"-?",true)||[];return n.concat(i).concat(r).join("|")}(m,d),true===a.capture?h.result=`(${h.result})`:false!==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+=true===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=false!==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={},cl=t}function Ol(){if(fl)return ll;fl=1;const e=O,t=xl(),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 false;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 false===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:false,...s});let i=String.fromCharCode(e);return e===n?i:`[${i}-${String.fromCharCode(n)}]`},u=(e,n,r)=>{if(Array.isArray(e)){let t=true===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(true===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(true===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=false===g&&false===((e,t,n)=>"string"==typeof e||"string"==typeof t||true===n.stringify)(e,t,r),_=r.transform||(e=>t=>true===e?Number(t):String(t))(v);if(r.toRegex&&1===n)return c(a(e,y),a(t,y),true,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;) true===r.toRegex&&n>1?w(s):S.push(o(_(s,A),y,v)),s=p?s-n:s+n,A++;return true===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:false,...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 true===a.capture&&(a.wrap=true),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,false,r);let d=[],m=0;for(;l?o>=a:o<=a;)d.push(i(o,m)),o=l?o-n:o+n,m++;return true===r.toRegex?u(d,null,{wrap:false,options:r}):d})(e,t,Math.max(Math.abs(i),1),a):null==i||n(i)?h(e,t,1,i):((e,t)=>{if(true===t.strictRanges)throw new TypeError(`Expected step "${e}" to be a number`);return []})(i,a)};return ll=h}function $l(){if(_l)return vl;_l=1;const e=kl(),{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}=yl?gl:(yl=1,gl={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 vl=(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,O=0,$=0;const R=()=>g[O++],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"});O<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++;O<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(true!==y.keepQuotes&&(x="");O<E&&(t=R());)if(t!==n){if(t===e){ true===y.keepQuotes&&(x+=t);break}x+=t;}else x+=t+R();C({type:"text",value:x});continue}if(x===c){$++;const e=A.value&&"$"===A.value.slice(-1)||true===S.dollar;S=C({type:"brace",open:true,close:false,dollar:e,depth:$,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=true,C({type:e,value:x}),$--,S=w[w.length-1];continue}if(x===s&&$>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&&$>0&&0===S.commas){const e=S.nodes;if(0===$||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=true,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=true),"close"===e.type&&(e.isClose=true),e.nodes||(e.type="text"),e.invalid=true);});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}}function Rl(){if(wl)return bl;wl=1;const e=kl(),t=function(){if(hl)return pl;hl=1;const e=Ol(),t=Al();return pl=(n,r={})=>{const s=(n,i={})=>{const o=t.isInvalidBrace(i),a=true===n.invalid&&true===r.escapeInvalid,c=true===o||true===a,u=true===r.escapeInvalid?"\\":"";let l="";if(true===n.isOpen)return u+n.value;if(true===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:false,toRegex:true,strictZeros:true});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(ml)return dl;ml=1;const e=Ol(),t=kl(),n=Al(),r=(e="",t="",s=false)=>{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) true===s&&"string"==typeof e&&(e=`{${e}}`),i.push(Array.isArray(e)?r(n,e,s):n+e);return n.flatten(i)};return dl=(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&&true!==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))},dl}(),r=$l(),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&&true===t.expand&&true===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 true===t.noempty&&(r=r.filter(Boolean)),true===t.nodupes&&(r=[...new Set(r)]),r},s.create=(e,t={})=>""===e||e.length<3?[e]:true!==t.expand?s.compile(e,t):s.expand(e,t),bl=s}var Cl,Tl,Pl,Ll,Nl,Il,Ml,Dl,jl,Hl,Fl,Bl,zl,Kl,Ul={};function ql(){if(Tl)return Cl;Tl=1;const e=x,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 Cl={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=>true===e?l:u}}function Zl(){return Pl||(Pl=1,function(e){const t=x,n="win32"===process.platform,{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:s,REGEX_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_GLOBAL:o}=ql();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:true===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 true===t.negated&&(r=`(?:^(?!${r}).*$)`),r};}(Ul)),Ul}function Wl(){if(jl)return Dl;jl=1;const e=x,t=function(){if(Nl)return Ll;Nl=1;const e=Zl(),{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}=ql(),g=e=>e===a||e===r,y=e=>{ true!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1);};return Ll=(v,_)=>{const b=_||{},w=v.length-1,S=true===b.parts||true===b.scanToEnd,A=[],k=[],E=[];let x,O,$=v,R=-1,C=0,T=0,P=false,L=false,N=false,I=false,M=false,D=false,j=false,H=false,F=false,B=false,z=0,K={value:"",depth:0,isGlob:false};const U=()=>R>=w,q=()=>$.charCodeAt(R+1),Z=()=>(x=O,$.charCodeAt(++R));for(;R<w;){let e;if(O=Z(),O!==r){if(true===D||O===c){for(z++;true!==U()&&(O=Z());)if(O!==r)if(O!==c){if(true!==D&&O===i&&(O=Z())===i){if(P=K.isBrace=true,N=K.isGlob=true,B=true,true===S)continue;break}if(true!==D&&O===s){if(P=K.isBrace=true,N=K.isGlob=true,B=true,true===S)continue;break}if(O===h&&(z--,0===z)){D=false,P=K.isBrace=true,B=true;break}}else z++;else j=K.backslashes=true,Z();if(true===S)continue;break}if(O!==a){if(true!==b.noext&&true==(O===f||O===n||O===t||O===p||O===o)&&q()===u){if(N=K.isGlob=true,I=K.isExtglob=true,B=true,O===o&&R===C&&(F=true),true===S){for(;true!==U()&&(O=Z());)if(O!==r){if(O===d){N=K.isGlob=true,B=true;break}}else j=K.backslashes=true,O=Z();continue}break}if(O===t){if(x===t&&(M=K.isGlobstar=true),N=K.isGlob=true,B=true,true===S)continue;break}if(O===p){if(N=K.isGlob=true,B=true,true===S)continue;break}if(O===l){for(;true!==U()&&(e=Z());)if(e!==r){if(e===m){L=K.isBracket=true,N=K.isGlob=true,B=true;break}}else j=K.backslashes=true,Z();if(true===S)continue;break}if(true===b.nonegate||O!==o||R!==C){if(true!==b.noparen&&O===u){if(N=K.isGlob=true,true===S){for(;true!==U()&&(O=Z());)if(O!==u){if(O===d){B=true;break}}else j=K.backslashes=true,O=Z();continue}break}if(true===N){if(B=true,true===S)continue;break}}else H=K.negated=true,C++;}else {if(A.push(R),k.push(K),K={value:"",depth:0,isGlob:false},true===B)continue;if(x===i&&R===C+1){C+=2;continue}T=R+1;}}else j=K.backslashes=true,O=Z(),O===c&&(D=true);} true===b.noext&&(I=false,N=false);let W=$,G="",V="";C>0&&(G=$.slice(0,C),$=$.slice(C),T-=C),W&&true===N&&T>0?(W=$.slice(0,T),V=$.slice(T)):true===N?(W="",V=$):W=$,W&&""!==W&&"/"!==W&&W!==$&&g(W.charCodeAt(W.length-1))&&(W=W.slice(0,-1)),true===b.unescape&&(V&&(V=e.removeBackslashes(V)),W&&true===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(true===b.tokens&&(Y.maxDepth=0,g(O)||k.push(K),Y.tokens=k),true===b.parts||true===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=true,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},Ll}(),n=function(){if(Ml)return Il;Ml=1;const e=ql(),t=Zl(),{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:O,NO_DOTS_SLASH:$,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=true===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:true===p.dot,consumed:"",output:"",prefix:"",backtrack:false,negated:false,brackets:0,braces:0,parens:0,quotes:0,globstar:false,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=true,D.start++,true)},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=true===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:true,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:false}).output;n=e.close=`)${s})${r})`;}"bos"===e.prev.type&&(D.negatedExtglob=true);}J({type:"paren",extglob:true,value:B,output:n}),Q("parens");};if(false!==p.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(l)){let e=false,n=l.replace(i,(t,n,r,s,i,o)=>"\\"===s?(e=true,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 true===e&&(n=true===p.unescape?n.replace(/\\/g,""):n.replace(/\\+/g,e=>e.length%2==0?"\\\\":e?"\\":"")),n===l&&true===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&&true!==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+="\\")),true===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(false!==p.posix&&":"===B){const e=z.value.slice(1);if(e.includes("[")&&(z.posix=true,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=true,q(),m.output||1!==g.indexOf(z)||(m.output=k);continue}}}("["===B&&":"!==U()||"-"===B&&"]"===U())&&(B=`\\${B}`),"]"!==B||"["!==z.value&&"[^"!==z.value||(B=`\\${B}`),true===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,true===p.keepQuotes&&J({type:"text",value:B});continue}if("("===B){Y("parens"),J({type:"paren",value:B});continue}if(")"===B){if(0===D.parens&&true===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(true!==p.nobracket&&Z().includes("]"))Y("brackets");else {if(true!==p.nobracket&&true===p.strictBrackets)throw new SyntaxError(c("closing","]"));B=`\\${B}`;}J({type:"bracket",value:B});continue}if("]"===B){if(true===p.nobracket||z&&"bracket"===z.type&&1===z.value.length){J({type:"text",value:B,output:`\\${B}`});continue}if(0===D.brackets){if(true===p.strictBrackets)throw new SyntaxError(c("opening","["));J({type:"text",value:B,output:`\\${B}`});continue}Q("brackets");const e=z.value.slice(1);if(true===z.posix||"^"!==e[0]||e.includes("/")||(B=`/${B}`),z.value+=B,G({value:B}),false===p.literalBrackets||t.hasRegexChars(e))continue;const n=t.escapeRegex(z.value);if(D.output=D.output.slice(0,-z.value.length),true===p.literalBrackets){D.output+=n,z.value=n;continue}z.value=`(${y}${n}|${z.value})`,D.output+=z.value;continue}if("{"===B&&true!==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(true===p.nobrace||!e){J({type:"text",value:B,output:B});continue}let t=")";if(true===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=true;}if(true!==e.comma&&true!==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=true,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=true;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)&&true!==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(true!==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(true!==p.noextglob&&"("===U()&&("?"!==U(2)||!/[!=<:]/.test(U(3)))){X("negate",B);continue}if(true!==p.nonegate&&0===D.index){V();continue}}if("+"===B){if(true!==p.noextglob&&"("===U()&&"?"!==U(2)){X("plus",B);continue}if(z&&"("===z.value||false===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(true!==p.noextglob&&"("===U()&&"?"!==U(2)){J({type:"at",extglob:true,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||true===z.star)){z.type="star",z.star=true,z.value+=B,z.output=M,D.backtrack=true,D.globstar=true,W(B);continue}let e=Z();if(true!==p.noextglob&&/^\([^?]/.test(e)){X("star",B);continue}if("star"===z.type){if(true===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(true===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=true,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=true,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=true,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=true,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=true,W(B);continue}const n={type:"star",value:B,output:M};true!==p.bash?!z||"bracket"!==z.type&&"paren"!==z.type||true!==p.regex?(D.index!==D.start&&"slash"!==z.type&&"dot"!==z.type||("dot"===z.type?(D.output+=O,z.output+=O):true===p.dot?(D.output+=$,z.output+=$):(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(true===p.strictBrackets)throw new SyntaxError(c("closing","]"));D.output=t.escapeLast(D.output,"["),Q("brackets");}for(;D.parens>0;){if(true===p.strictBrackets)throw new SyntaxError(c("closing",")"));D.output=t.escapeLast(D.output,"("),Q("parens");}for(;D.braces>0;){if(true===p.strictBrackets)throw new SyntaxError(c("closing","}"));D.output=t.escapeLast(D.output,"{"),Q("braces");}if(true===p.strictSlashes||"star"!==z.type&&"bracket"!==z.type||J({type:"maybe_slash",value:"",output:`${A}?`}),true===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=true===i.bash?".*?":y;i.capture&&(S=`(${S})`);const A=e=>true===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:false,prefix:""});let x=k(E);return x&&true!==i.strictSlashes&&(x+=`${f}?`),x},Il=u}(),r=Zl(),s=ql(),i=(e,t,n=false)=>{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 false};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,false,true),l=u.state;delete u.state;let f=()=>false;if(a.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};f=i(a.ignore,e,n);}const p=(n,r=false)=>{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),false===s?(h.isMatch=false,!!r&&h):f(n)?("function"==typeof a.onIgnore&&a.onIgnore(h),h.isMatch=false,!!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:false,output:""};const a=n||{},c=a.format||(o?r.toPosixSlashes:null);let u=e===s,l=u&&c?c(e):e;return false===u&&(l=c?c(e):e,u=l===s),false!==u&&true!==a.capture||(u=true===a.matchBase||true===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:false}),i.scan=(e,n)=>t(e,n),i.compileRe=(e,t,n=false,r=false)=>{if(true===n)return e.output;const s=t||{},o=s.contains?"":"^",a=s.contains?"":"$";let c=`${o}(?:${e.output})${a}`;e&&true===e.negated&&(c=`^(?!${c}).*$`);const u=i.toRegex(c,t);return true===r&&(u.state=e),u},i.makeRe=(e,t={},r=false,s=false)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let o={negated:false,fastpaths:true};return false===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&&true===t.debug)throw e;return /$^/}},i.constants=s,Dl=i}function Gl(){return Fl?Hl:(Fl=1,Hl=Wl())}function Vl(){if(Kl)return el;Kl=1,Object.defineProperty(el,"__esModule",{value:true}),el.isAbsolute=el.partitionAbsoluteAndRelative=el.removeDuplicateSlashes=el.matchAny=el.convertPatternsToRe=el.makeRe=el.getPatternParts=el.expandBraceExpansion=el.expandPatternsWithBraceExpansion=el.isAffectDepthOfReadingPattern=el.endsWithSlashGlobStar=el.hasGlobStar=el.getBaseDirectory=el.isPatternRelatedToParentDirectory=el.getPatternsOutsideCurrentDirectory=el.getPatternsInsideCurrentDirectory=el.getPositivePatterns=el.getNegativePatterns=el.isPositivePattern=el.isNegativePattern=el.convertToNegativePattern=el.convertToPositivePattern=el.isDynamicPattern=el.isStaticPattern=void 0;const e=x,t=function(){if(Xu)return Ju;Xu=1;var e=nl(),t=x.posix.dirname,n="win32"===E.platform(),r=/\\/g,s=/[\{\[].*[\}\]]$/,i=/(^|[^\\])([\{\[]|\([^\)]+$)/,o=/\\([\!\*\?\|\[\]\(\)\{\}])/g;return Ju=function(a,c){Object.assign({flipBackslashes:true},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(zl)return Bl;zl=1;const e=O,t=Rl(),n=Gl(),r=Zl(),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},true),l=u.state.negated||u.state.negatedExtglob;l&&a++;for(let t of e){let e=u(t,true);(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(true===r.failglob)throw new Error(`No matches found for "${t.join(", ")}"`);if(true===r.nonull||true===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 false;if(t.includes(n)||t.startsWith("./")&&t.slice(2).includes(n))return true}return o.isMatch(t,n,{...r,contains:true})},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 true}return false},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 false}return true},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:true}).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&&true===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:true})},o.hasBraces=i,Bl=o}(),r=/[*?]|^!/,s=/\[[^[]*]/,i=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,o=/[!*+?@]\([^(]*\)/,a=/,|\.\./,c=/(?!^)\/{2,}/g;function u(e,t={}){return !l(e,t)}function l(e,t={}){return ""!==e&&(!(false!==t.caseSensitiveMatch&&!e.includes("\\"))||(!!(r.test(e)||s.test(e)||i.test(e))||(!(false===t.extglob||!o.test(e))||!(false===t.braceExpansion||!function(e){const t=e.indexOf("{");if(-1===t)return false;const n=e.indexOf("}",t+1);if(-1===n)return false;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:true,nodupes:true,keepEscaping:true});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 el.isStaticPattern=u,el.isDynamicPattern=l,el.convertToPositivePattern=function(e){return f(e)?e.slice(1):e},el.convertToNegativePattern=function(e){return "!"+e},el.isNegativePattern=f,el.isPositivePattern=p,el.getNegativePatterns=function(e){return e.filter(f)},el.getPositivePatterns=function(e){return e.filter(p)},el.getPatternsInsideCurrentDirectory=function(e){return e.filter(e=>!h(e))},el.getPatternsOutsideCurrentDirectory=function(e){return e.filter(h)},el.isPatternRelatedToParentDirectory=h,el.getBaseDirectory=function(e){return t(e,{flipBackslashes:false})},el.hasGlobStar=function(e){return e.includes("**")},el.endsWithSlashGlobStar=d,el.isAffectDepthOfReadingPattern=function(t){const n=e.basename(t);return d(t)||u(n)},el.expandPatternsWithBraceExpansion=function(e){return e.reduce((e,t)=>e.concat(m(t)),[])},el.expandBraceExpansion=m,el.getPatternParts=function(e,t){let{parts:r}=n.scan(e,Object.assign(Object.assign({},t),{parts:true}));return 0===r.length&&(r=[e]),r[0].startsWith("/")&&(r[0]=r[0].slice(1),r.unshift("")),r},el.makeRe=g,el.convertPatternsToRe=function(e,t){return e.map(e=>g(e,t))},el.matchAny=function(e,t){return t.some(t=>t.test(e))},el.removeDuplicateSlashes=function(e){return e.replace(c,"/")},el.partitionAbsoluteAndRelative=function(e){const t=[],n=[];for(const r of e)y(r)?t.push(r):n.push(r);return [t,n]},el.isAbsolute=y,el}var Yl,Ql,Jl,Xl={};function ef(){if(Ql)return Yl;Ql=1;const e=$.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 Yl=function(){const r=[],s=t.call(arguments);let i=false,o=s[s.length-1];o&&!Array.isArray(o)&&null==o.pipe?s.pop():o={};const a=false!==o.end,c=true===o.pipeError;null==o.objectMode&&(o.objectMode=true);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=true;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=false,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:false}),e.resume();}for(let t=0;t<e.length;t++)s(e[t]);n();}function p(){i=false,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},Yl}var tf,nf,rf,sf={};function of(){if(tf)return sf;return tf=1,Object.defineProperty(sf,"__esModule",{value:true}),sf.isEmpty=sf.isString=void 0,sf.isString=function(e){return "string"==typeof e},sf.isEmpty=function(e){return ""===e},sf}function af(){if(nf)return Du;nf=1,Object.defineProperty(Du,"__esModule",{value:true}),Du.string=Du.stream=Du.pattern=Du.path=Du.fs=Du.errno=Du.array=void 0;const e=Hu();Du.array=e;const t=zu();Du.errno=t;const n=function(){if(Ku)return Uu;Ku=1,Object.defineProperty(Uu,"__esModule",{value:true}),Uu.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 Uu.createDirentFromStats=function(t,n){return new e(t,n)},Uu}();Du.fs=n;const r=Wu();Du.path=r;const s=Vl();Du.pattern=s;const i=function(){if(Jl)return Xl;Jl=1,Object.defineProperty(Xl,"__esModule",{value:true}),Xl.merge=void 0;const e=ef();function t(e){e.forEach(e=>e.emit("close"));}return Xl.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},Xl}();Du.stream=i;const o=of();return Du.string=o,Du}var cf,uf={},lf={},ff={},pf={},hf={},df={},mf={},gf={},yf={};function vf(){if(cf)return yf;function e(e,t){e(t);}function t(e,t){e(null,t);}return cf=1,Object.defineProperty(yf,"__esModule",{value:true}),yf.read=void 0,yf.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=()=>true),t(s,i);}):t(s,o):e(s,i);});},yf}var _f,bf={};var wf,Sf,Af,kf,Ef,xf,Of,$f={},Rf={};function Cf(){if(Sf)return $f;Sf=1,Object.defineProperty($f,"__esModule",{value:true});const e=(wf||(wf=1,function(e){Object.defineProperty(e,"__esModule",{value:true}),e.createFileSystemAdapter=e.FILE_SYSTEM_ADAPTER=void 0;const t=i;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)};}(Rf)),Rf);return $f.default=class{constructor(t={}){this._options=t,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,true),this.fs=e.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,false),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,true);}_getValue(e,t){return null!=e?e:t}},$f}function Tf(){if(Af)return gf;Af=1,Object.defineProperty(gf,"__esModule",{value:true}),gf.statSync=gf.stat=gf.Settings=void 0;const e=vf(),t=(_f||(_f=1,Object.defineProperty(bf,"__esModule",{value:true}),bf.read=void 0,bf.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}}),bf),n=Cf();function r(e={}){return e instanceof n.default?e:new n.default(e)}return gf.Settings=n.default,gf.stat=function(t,n,s){"function"!=typeof n?e.read(t,r(n),s):e.read(t,r(),n);},gf.statSync=function(e,n){const s=r(n);return t.read(e,s)},gf}function Pf(){if(Ef)return kf;let e;return Ef=1,kf="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:F):t=>(e||(e=Promise.resolve())).then(t).catch(e=>setTimeout(()=>{throw e},0))}var Lf,Nf={};function If(){if(Lf)return Nf;Lf=1,Object.defineProperty(Nf,"__esModule",{value:true}),Nf.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 Nf.IS_SUPPORT_READDIR_WITH_FILE_TYPES=r||s,Nf}var Mf,Df,jf={},Hf={};function Ff(){if(Df)return jf;Df=1,Object.defineProperty(jf,"__esModule",{value:true}),jf.fs=void 0;const e=function(){if(Mf)return Hf;Mf=1,Object.defineProperty(Hf,"__esModule",{value:true}),Hf.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 Hf.createDirentFromStats=function(t,n){return new e(t,n)},Hf}();return jf.fs=e,jf}var Bf,zf,Kf={};function Uf(){if(Bf)return Kf;return Bf=1,Object.defineProperty(Kf,"__esModule",{value:true}),Kf.joinPathSegments=void 0,Kf.joinPathSegments=function(e,t,n){return e.endsWith(n)?e+t:e+n+t},Kf}function qf(){if(zf)return mf;zf=1,Object.defineProperty(mf,"__esModule",{value:true}),mf.readdir=mf.readdirWithFileTypes=mf.read=void 0;const e=Tf(),t=function(){if(Of)return xf;Of=1,xf=function(t,n){let r,s,i,o=true;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=false;};const e=Pf();return xf}(),n=If(),r=Ff(),s=Uf();function i(e,n,i){n.fs.readdir(e,{withFileTypes:true},(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 mf.read=function(e,t,r){t.stats||!n.IS_SUPPORT_READDIR_WITH_FILE_TYPES?o(e,t,r):i(e,t,r);},mf.readdirWithFileTypes=i,mf.readdir=o,mf}var Zf,Wf={};var Gf,Vf,Yf,Qf={},Jf={};function Xf(){return Gf||(Gf=1,function(e){Object.defineProperty(e,"__esModule",{value:true}),e.createFileSystemAdapter=e.FILE_SYSTEM_ADAPTER=void 0;const t=i;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)};}(Jf)),Jf}function ep(){if(Yf)return df;Yf=1,Object.defineProperty(df,"__esModule",{value:true}),df.Settings=df.scandirSync=df.scandir=void 0;const e=qf(),t=function(){if(Zf)return Wf;Zf=1,Object.defineProperty(Wf,"__esModule",{value:true}),Wf.readdir=Wf.readdirWithFileTypes=Wf.read=void 0;const e=Tf(),t=If(),n=Ff(),r=Uf();function s(e,t){return t.fs.readdirSync(e,{withFileTypes:true}).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 Wf.read=function(e,n){return !n.stats&&t.IS_SUPPORT_READDIR_WITH_FILE_TYPES?s(e,n):i(e,n)},Wf.readdirWithFileTypes=s,Wf.readdir=i,Wf}(),n=function(){if(Vf)return Qf;Vf=1,Object.defineProperty(Qf,"__esModule",{value:true});const e=x,t=Tf(),n=Xf();return Qf.default=class{constructor(r={}){this._options=r,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,false),this.fs=n.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,e.sep),this.stats=this._getValue(this._options.stats,false),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,true),this.fsStatSettings=new t.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink});}_getValue(e,t){return null!=e?e:t}},Qf}();function r(e={}){return e instanceof n.default?e:new n.default(e)}return df.Settings=n.default,df.scandir=function(t,n,s){"function"!=typeof n?e.read(t,r(n),s):e.read(t,r(),n);},df.scandirSync=function(e,n){const s=r(n);return t.read(e,s)},df}var tp,np,rp,sp={exports:{}};function ip(){if(rp)return sp.exports;rp=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=true;},paused:false,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=false,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 sp.exports=t,sp.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},sp.exports}var op,ap={};function cp(){if(op)return ap;return op=1,Object.defineProperty(ap,"__esModule",{value:true}),ap.joinPathSegments=ap.replacePathSegmentSeparator=ap.isAppliedFilter=ap.isFatalError=void 0,ap.isFatalError=function(e,t){return null===e.errorFilter||!e.errorFilter(t)},ap.isAppliedFilter=function(e,t){return null===e||e(t)},ap.replacePathSegmentSeparator=function(e,t){return e.split(/[/\\]/).join(t)},ap.joinPathSegments=function(e,t,n){return ""===e?t:e.endsWith(n)?e+t:e+n+t},ap}var up,lp,fp,pp={};function hp(){if(up)return pp;up=1,Object.defineProperty(pp,"__esModule",{value:true});const e=cp();return pp.default=class{constructor(t,n){this._root=t,this._settings=n,this._root=e.replacePathSegmentSeparator(t,n.pathSegmentSeparator);}},pp}function dp(){if(lp)return hf;lp=1,Object.defineProperty(hf,"__esModule",{value:true});const e=R,t=ep(),n=ip(),r=cp(),s=hp();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=false,this._isDestroyed=false,this._queue.drain=()=>{this._isFatalError||this._emitter.emit("end");};}read(){return this._isFatalError=false,this._isDestroyed=false,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=true,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=true,this._isDestroyed=true,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 hf.default=i,hf}var mp,gp={};var yp,vp,_p={},bp={};function wp(){if(vp)return _p;vp=1,Object.defineProperty(_p,"__esModule",{value:true});const e=function(){if(yp)return bp;yp=1,Object.defineProperty(bp,"__esModule",{value:true});const e=ep(),t=cp(),n=hp();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 bp.default=r,bp}();return _p.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()}},_p}var Sp,Ap,kp={};function Ep(){if(Ap)return ff;Ap=1,Object.defineProperty(ff,"__esModule",{value:true}),ff.Settings=ff.walkStream=ff.walkSync=ff.walk=void 0;const e=function(){if(fp)return pf;fp=1,Object.defineProperty(pf,"__esModule",{value:true});const e=dp();return pf.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();}},pf}(),t=function(){if(mp)return gp;mp=1,Object.defineProperty(gp,"__esModule",{value:true});const e=$,t=dp();return gp.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:true,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}},gp}(),n=wp(),r=function(){if(Sp)return kp;Sp=1,Object.defineProperty(kp,"__esModule",{value:true});const e=x,t=ep();return kp.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}},kp}();function s(e={}){return e instanceof r.default?e:new r.default(e)}return ff.Settings=r.default,ff.walk=function(t,n,r){"function"!=typeof n?new e.default(t,s(n)).read(r):new e.default(t,s()).read(n);},ff.walkSync=function(e,t){const r=s(t);return new n.default(e,r).read()},ff.walkStream=function(e,n){const r=s(n);return new t.default(e,r).read()},ff}var xp,Op={};function $p(){if(xp)return Op;xp=1,Object.defineProperty(Op,"__esModule",{value:true});const e=x,t=Tf(),n=af();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 Rp,Cp,Tp={};function Pp(){if(Rp)return Tp;Rp=1,Object.defineProperty(Tp,"__esModule",{value:true});const e=$,t=Tf(),n=Ep(),r=$p();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:true});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 Tp.default=s,Tp}var Lp,Np,Ip,Mp={},Dp={},jp={},Hp={};function Fp(){if(Np)return jp;Np=1,Object.defineProperty(jp,"__esModule",{value:true});const e=function(){if(Lp)return Hp;Lp=1,Object.defineProperty(Hp,"__esModule",{value:true});const e=af();return Hp.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:true,pattern:t,patternRe:e.pattern.makeRe(t,this._micromatchOptions)}:{dynamic:false,pattern:t})}_splitSegmentsIntoSections(t){return e.array.splitWhen(t,t=>t.dynamic&&e.pattern.hasGlobStar(t.pattern))}},Hp}();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 true;if(t.every((t,n)=>{const r=e.segments[n];return !(!r.dynamic||!r.patternRe.test(t))||!r.dynamic&&r.pattern===t}))return true}return false}}return jp.default=t,jp}var Bp,zp={};var Kp,Up={};var qp,Zp,Wp,Gp={};function Vp(){if(Zp)return Mp;Zp=1,Object.defineProperty(Mp,"__esModule",{value:true});const e=x,t=function(){if(Ip)return Dp;Ip=1,Object.defineProperty(Dp,"__esModule",{value:true});const e=af(),t=Fp();return Dp.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 false;if(this._isSkippedSymbolicLink(n))return false;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)}},Dp}(),n=function(){if(Bp)return zp;Bp=1,Object.defineProperty(zp,"__esModule",{value:true});const e=af();return zp.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:true})),relative:e.pattern.convertPatternsToRe(s,Object.assign(Object.assign({},this._micromatchOptions),{dot:true}))}};return e=>this._filter(e,i)}_filter(t,n){const r=e.path.removeLeadingDotSegment(t.path);if(this._settings.unique&&this._isDuplicateEntry(r))return false;if(this._onlyFileFilter(t)||this._onlyDirectoryFilter(t))return false;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 false;const s=e.path.makeAbsolute(this._settings.cwd,t);return this._isMatchToPatterns(s,n,r)}_isMatchToPatterns(t,n,r){if(0===n.length)return false;const s=e.pattern.matchAny(t,n);return !s&&r?e.pattern.matchAny(t+"/",n):s}},zp}(),r=function(){if(Kp)return Up;Kp=1,Object.defineProperty(Up,"__esModule",{value:true});const e=af();return Up.default=class{constructor(e){this._settings=e;}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(t){return e.errno.isEnoentCodeError(t)||this._settings.suppressErrors}},Up}(),s=function(){if(qp)return Gp;qp=1,Object.defineProperty(Gp,"__esModule",{value:true});const e=af();return Gp.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}},Gp}();return Mp.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:true,strictSlashes:false}}},Mp}function Yp(){if(Wp)return uf;Wp=1,Object.defineProperty(uf,"__esModule",{value:true});const e=function(){if(Cp)return lf;Cp=1,Object.defineProperty(lf,"__esModule",{value:true});const e=Ep(),t=$p(),n=Pp();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 lf.default=r,lf}(),t=Vp();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 uf.default=n,uf}var Qp,Jp={};var Xp,eh,th={},nh={};function rh(){if(eh)return th;eh=1,Object.defineProperty(th,"__esModule",{value:true});const e=function(){if(Xp)return nh;Xp=1,Object.defineProperty(nh,"__esModule",{value:true});const e=Tf(),t=Ep(),n=$p();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=Vp();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 sh,ih,oh,ah={};var ch,uh,lh=function(){if(oh)return ih;oh=1;const e=function(){if(rf)return Mu;rf=1,Object.defineProperty(Mu,"__esModule",{value:true}),Mu.convertPatternGroupToTask=Mu.convertPatternGroupsToTasks=Mu.groupPatternsByBaseDirectory=Mu.getNegativePatternsAsPositive=Mu.getPositivePatterns=Mu.convertPatternsToTasks=Mu.generate=void 0;const e=af();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 Mu.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,false),d=n(p,l,true);return h.concat(d)},Mu.convertPatternsToTasks=n,Mu.getPositivePatterns=r,Mu.getNegativePatternsAsPositive=s,Mu.groupPatternsByBaseDirectory=i,Mu.convertPatternGroupsToTasks=o,Mu.convertPatternGroupToTask=a,Mu}(),t=Yp(),n=function(){if(Qp)return Jp;Qp=1,Object.defineProperty(Jp,"__esModule",{value:true});const e=$,t=Pp(),n=Vp();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:true,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 Jp.default=r,Jp}(),r=rh(),s=(sh||(sh=1,function(e){Object.defineProperty(e,"__esModule",{value:true}),e.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;const t=i,n=E,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,false),this.baseNameMatch=this._getValue(this._options.baseNameMatch,false),this.braceExpansion=this._getValue(this._options.braceExpansion,true),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,true),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,false),this.extglob=this._getValue(this._options.extglob,true),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,true),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,true),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,false),this.objectMode=this._getValue(this._options.objectMode,false),this.onlyDirectories=this._getValue(this._options.onlyDirectories,false),this.onlyFiles=this._getValue(this._options.onlyFiles,true),this.stats=this._getValue(this._options.stats,false),this.suppressErrors=this._getValue(this._options.suppressErrors,false),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,false),this.unique=this._getValue(this._options.unique,true),this.onlyDirectories&&(this.onlyFiles=false),this.stats&&(this.objectMode=true),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)}};}(ah)),ah),i$1=af();async function o(e,n){c(e);const r=a(e,t.default,n),s=await Promise.all(r);return i$1.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$1.string.isString(e)&&!i$1.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$1.array.flatten(n)}function u(e,t){c(e);const r=a(e,n.default,t);return i$1.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$1.pattern.isDynamicPattern(e,n)},t.escapePath=function(e){return c(e),i$1.path.escape(e)},t.convertPathToPattern=function(e){return c(e),i$1.path.convertPathToPattern(e)},(l=t.posix||(t.posix={})).escapePath=function(e){return c(e),i$1.path.escapePosixPath(e)},l.convertPathToPattern=function(e){return c(e),i$1.path.convertPosixPathToPattern(e)},(f=t.win32||(t.win32={})).escapePath=function(e){return c(e),i$1.path.escapeWindowsPath(e)},f.convertPathToPattern=function(e){return c(e),i$1.path.convertWindowsPathToPattern(e)};}(o||(o={})),ih=o}(),fh=B(lh);var ph=function(){if(uh)return ch;uh=1;var e=nl(),t=x.posix.dirname,n="win32"===E.platform(),r="/",s=/\\/g,i=/\\([!*?|[\](){}])/g;function o(t){return !!/\([^()]+$/.test(t)||("{"===t[0]||"["===t[0]||(!!/[^\\][{[]/.test(t)||e(t)))}return ch=function(e,a){Object.assign({flipBackslashes:true},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 false}var n=e.indexOf(t);if(n<0)return false;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")}}(),hh=B(ph);const dh=e=>""!==e&&".."!==e,mh=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(!dh(e))return null;return t.join("/")},gh=async e=>{try{return (await stat(e)).isFile()}catch{return false}},yh=async e=>{const{cwd:t,stanPath:n,map:r,onStage:s}=e;if(!r||"object"!=typeof r)return;const i=Vc(t,n),a=path.join(i.rootAbs,"imports");await ensureDir(a);const c=Object.keys(r).sort();for(const e of c){const n=r[e]??[];if(!Array.isArray(n)||0===n.length)continue;const i=mh(e);if(!i)continue;const c=path.join(a,i);await rm(c,{recursive:true,force:true}).catch(()=>{}),await ensureDir(c).catch(()=>{});const u=[];for(const e of n){const n=e.trim();if(!n)continue;const r=hh(n.replace(/\\/g,"/"));try{const e=await fh(n,{cwd:t,absolute:!0,dot:!0,onlyFiles:!1,followSymbolicLinks:!1});for(const n of e){if(!await gh(n))continue;const e=path.relative(path.isAbsolute(r)?r:path.resolve(t,r),n).replace(/\\/g,"/");if(!e||e.includes(".."))continue;const s=path.join(c,e);await ensureDir(path.dirname(s)).catch(()=>{});try{await copyFile(n,s),u.push(s);}catch{}}}catch{}}try{if("function"==typeof s){s(i,u.map(e=>path.relative(t,e).replace(/\\/g,"/")));}}catch{}}},vh=e=>e.replace(/\\/g,"/").replace(/^\.\/+/,"").replace(/\/+$/,""),_h=e=>{const t=vh(e);if(!/[*?[\]{}()!]/.test(n=t)&&!n.includes("**"))return t?e=>((e,t)=>{const n=vh(t);return e===n||e.startsWith(n+"/")})(vh(e),t):()=>false;var n;const r=le(t,{dot:true});return e=>r(vh(e))},bh=e=>{const t=e.map(_h);return 0===t.length?()=>false:e=>{const n=vh(e);for(const e of t)if(e(n))return true;return false}},wh=()=>{const e=(()=>{try{const e=fileURLToPath(import.meta.url);return we({cwd:path.dirname(e)})??null}catch{return null}})();if(!e)return null;const n=path.join(e,"dist","stan.system.md");return existsSync(n)?n:null},Sh=async(e,n)=>{const r=path.join(e,n,"system"),o=path.join(r,"parts"),c=path.join(r,"stan.system.md");if(await ensureDir(r),!existsSync(o))return {target:c,action:"skipped-no-parts",partsDir:o};const u=(await readdir(o,{withFileTypes:true})).filter(e=>e.isFile()&&e.name.toLowerCase().endsWith(".md")).map(e=>e.name).sort((e,t)=>e.localeCompare(t,void 0,{numeric:true}));if(0===u.length)return {target:c,action:"skipped-no-md",partsDir:o};const l=[];for(const e of u){const t=path.join(o,e),n=mu(await readFile(t,"utf8")).trimEnd();l.push(n);}const p=(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 writeFile(c,p,"utf8"),{target:c,action:"written"}};const Ah="0.4.5";
26
27
 
27
28
  var index = /*#__PURE__*/Object.freeze({
28
29
  __proto__: null,
@@ -272,21 +273,6 @@ function requireArgument () {
272
273
 
273
274
  var command = {};
274
275
 
275
- const require$4 = createRequire(import.meta.url);
276
- function __require$4() { return require$4("node:events"); }
277
-
278
- const require$3 = createRequire(import.meta.url);
279
- function __require$3() { return require$3("node:child_process"); }
280
-
281
- const require$2 = createRequire(import.meta.url);
282
- function __require$2() { return require$2("node:path"); }
283
-
284
- const require$1 = createRequire(import.meta.url);
285
- function __require$1() { return require$1("node:fs"); }
286
-
287
- const require = createRequire(import.meta.url);
288
- function __require() { return require("node:process"); }
289
-
290
276
  var help = {};
291
277
 
292
278
  var hasRequiredHelp;
@@ -1550,11 +1536,11 @@ var hasRequiredCommand;
1550
1536
  function requireCommand () {
1551
1537
  if (hasRequiredCommand) return command;
1552
1538
  hasRequiredCommand = 1;
1553
- const EventEmitter = __require$4().EventEmitter;
1554
- const childProcess = __require$3();
1555
- const path = __require$2();
1556
- const fs = __require$1();
1557
- const process = __require();
1539
+ const EventEmitter = require$$0$1.EventEmitter;
1540
+ const childProcess = require$$1;
1541
+ const path$1 = path;
1542
+ const fs = c;
1543
+ const process = process$2;
1558
1544
 
1559
1545
  const { Argument, humanReadableArgName } = requireArgument();
1560
1546
  const { CommanderError } = requireError();
@@ -2756,11 +2742,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
2756
2742
 
2757
2743
  function findFile(baseDir, baseName) {
2758
2744
  // Look for specified file
2759
- const localBin = path.resolve(baseDir, baseName);
2745
+ const localBin = path$1.resolve(baseDir, baseName);
2760
2746
  if (fs.existsSync(localBin)) return localBin;
2761
2747
 
2762
2748
  // Stop looking if candidate already has an expected extension.
2763
- if (sourceExt.includes(path.extname(baseName))) return undefined;
2749
+ if (sourceExt.includes(path$1.extname(baseName))) return undefined;
2764
2750
 
2765
2751
  // Try all the extensions.
2766
2752
  const foundExt = sourceExt.find((ext) =>
@@ -2786,8 +2772,8 @@ Expecting one of '${allowedValues.join("', '")}'`);
2786
2772
  } catch {
2787
2773
  resolvedScriptPath = this._scriptPath;
2788
2774
  }
2789
- executableDir = path.resolve(
2790
- path.dirname(resolvedScriptPath),
2775
+ executableDir = path$1.resolve(
2776
+ path$1.dirname(resolvedScriptPath),
2791
2777
  executableDir,
2792
2778
  );
2793
2779
  }
@@ -2798,9 +2784,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
2798
2784
 
2799
2785
  // Legacy search using prefix of script name instead of command name
2800
2786
  if (!localFile && !subcommand._executableFile && this._scriptPath) {
2801
- const legacyName = path.basename(
2787
+ const legacyName = path$1.basename(
2802
2788
  this._scriptPath,
2803
- path.extname(this._scriptPath),
2789
+ path$1.extname(this._scriptPath),
2804
2790
  );
2805
2791
  if (legacyName !== this._name) {
2806
2792
  localFile = findFile(
@@ -2812,7 +2798,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
2812
2798
  executableFile = localFile || executableFile;
2813
2799
  }
2814
2800
 
2815
- launchWithNode = sourceExt.includes(path.extname(executableFile));
2801
+ launchWithNode = sourceExt.includes(path$1.extname(executableFile));
2816
2802
 
2817
2803
  let proc;
2818
2804
  if (process.platform !== 'win32') {
@@ -3967,7 +3953,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
3967
3953
  */
3968
3954
 
3969
3955
  nameFromFilename(filename) {
3970
- this._name = path.basename(filename, path.extname(filename));
3956
+ this._name = path$1.basename(filename, path$1.extname(filename));
3971
3957
 
3972
3958
  return this;
3973
3959
  }
@@ -17700,7 +17686,7 @@ async function readPackageJsonScripts(cwd) {
17700
17686
  }
17701
17687
  /** Ask user for config values; preserve script set optionally. */
17702
17688
  async function promptForConfig(cwd, pkgScripts, defaults, preserveScriptsFromDefaults) {
17703
- const { default: inquirer } = (await import('./index-Dy6XnoRx.js'));
17689
+ const { default: inquirer } = (await import('./index-Cq8YEju6.js'));
17704
17690
  const scriptKeys = Object.keys(pkgScripts);
17705
17691
  const defaultSelected = defaults?.scripts
17706
17692
  ? Object.keys(defaults.scripts).filter((k) => scriptKeys.includes(k))
@@ -17898,7 +17884,7 @@ async function maybeMigrateLegacyToNamespaced(base, existingPath, opts) {
17898
17884
  let proceed = Boolean(opts?.force);
17899
17885
  if (!proceed && legacyPresent) {
17900
17886
  try {
17901
- const { default: inquirer } = (await import('./index-Dy6XnoRx.js'));
17887
+ const { default: inquirer } = (await import('./index-Cq8YEju6.js'));
17902
17888
  const ans = (await inquirer.prompt([
17903
17889
  {
17904
17890
  type: 'confirm',
@@ -18010,7 +17996,7 @@ const handleSnapshot = async (args) => {
18010
17996
  }
18011
17997
  try {
18012
17998
  if (!dryRun) {
18013
- const { default: inquirer } = (await import('./index-Dy6XnoRx.js'));
17999
+ const { default: inquirer } = (await import('./index-Cq8YEju6.js'));
18014
18000
  const ans = (await inquirer.prompt([
18015
18001
  {
18016
18002
  type: 'confirm',
@@ -18149,6 +18135,7 @@ const writeConfigToDisk = async (args) => {
18149
18135
  // src/runner/init/service/service.main.ts
18150
18136
  const performInitService = async ({ cwd = process.cwd(), force = false, preserveScripts = false, dryRun = false, }) => {
18151
18137
  const existingPath = ke(cwd);
18138
+ const hasExisting = Boolean(existingPath);
18152
18139
  const defaultStanPath = '.stan';
18153
18140
  // Load existing config (raw) preserving key order; fallback to empty object.
18154
18141
  let base = await readExistingConfig(existingPath);
@@ -18158,6 +18145,7 @@ const performInitService = async ({ cwd = process.cwd(), force = false, preserve
18158
18145
  force: force || dryRun,
18159
18146
  });
18160
18147
  const namespaced = isObj$2(base['stan-core']) || isObj$2(base['stan-cli']);
18148
+ const namespacedTarget = namespaced || !hasExisting;
18161
18149
  // UI seeds (best-effort) for interactive mode
18162
18150
  const uiSeeds = await deriveUiSeeds(cwd, base, defaultStanPath);
18163
18151
  // Idempotency guard: under --force with an existing, already namespaced config,
@@ -18180,7 +18168,7 @@ const performInitService = async ({ cwd = process.cwd(), force = false, preserve
18180
18168
  await applyInteractiveChoices({
18181
18169
  cwd,
18182
18170
  base,
18183
- namespaced,
18171
+ namespaced: namespacedTarget,
18184
18172
  uiSeeds: {
18185
18173
  stanPath: uiSeeds.stanPath,
18186
18174
  includes: uiSeeds.includes,
@@ -18194,7 +18182,7 @@ const performInitService = async ({ cwd = process.cwd(), force = false, preserve
18194
18182
  const poc = cliCfg?.patchOpenCommand && typeof cliCfg.patchOpenCommand === 'string'
18195
18183
  ? cliCfg.patchOpenCommand
18196
18184
  : 'code -g {file}';
18197
- if (namespaced) {
18185
+ if (namespacedTarget) {
18198
18186
  const cli = ensureNsNode(base, 'stan-cli');
18199
18187
  if (!hasOwn$2(cli, 'patchOpenCommand'))
18200
18188
  cli.patchOpenCommand = poc;
@@ -18215,15 +18203,20 @@ const performInitService = async ({ cwd = process.cwd(), force = false, preserve
18215
18203
  cliCfg = undefined;
18216
18204
  }
18217
18205
  if (!existingPath) {
18206
+ // First-time creation: seed a namespaced config immediately.
18218
18207
  base = {
18219
- excludes: [],
18220
- includes: [],
18221
- patchOpenCommand: 'code -g {file}',
18222
- // Narrow safely instead of relying on a cast + “?? {}” (lints as unnecessary).
18223
- scripts: cliCfg && typeof cliCfg.scripts === 'object'
18224
- ? cliCfg.scripts
18225
- : {},
18226
- stanPath: defaultStanPath,
18208
+ 'stan-core': {
18209
+ stanPath: defaultStanPath,
18210
+ includes: [],
18211
+ excludes: [],
18212
+ },
18213
+ 'stan-cli': {
18214
+ // Narrow safely instead of relying on a cast + “?? {}”.
18215
+ scripts: cliCfg && typeof cliCfg.scripts === 'object'
18216
+ ? cliCfg.scripts
18217
+ : {},
18218
+ patchOpenCommand: cliCfg?.patchOpenCommand ?? 'code -g {file}',
18219
+ },
18227
18220
  };
18228
18221
  }
18229
18222
  else if (!namespaced) {
@@ -19528,7 +19521,7 @@ const applyUnifiedDiffLocally = async (cwd, cleaned, check) => {
19528
19521
  const firstTarget = parseFirstTarget(cleaned);
19529
19522
  // Try git‑apply via local shim (mockable)
19530
19523
  try {
19531
- const modUnknown = await import('./apply-BpKTYoHV.js');
19524
+ const modUnknown = await import('./apply-2mlYJk5r.js');
19532
19525
  const runGitApply = pickRunGitApply(modUnknown);
19533
19526
  if (runGitApply) {
19534
19527
  const gitOut = await runGitApply({
@@ -27777,7 +27770,7 @@ function requireTreeKill () {
27777
27770
  if (hasRequiredTreeKill) return treeKill$1;
27778
27771
  hasRequiredTreeKill = 1;
27779
27772
 
27780
- var childProcess = require$$0$1;
27773
+ var childProcess = require$$0$2;
27781
27774
  var spawn = childProcess.spawn;
27782
27775
  var exec = childProcess.exec;
27783
27776
 
@@ -31653,7 +31646,7 @@ const resolveScriptsForRun = async (args) => {
31653
31646
  let scriptsMap = cliCfg.scripts || {};
31654
31647
  if (Object.keys(scriptsMap).length === 0) {
31655
31648
  try {
31656
- const { readCliScriptsFallback } = await import('./config-fallback-S2V_I40B.js');
31649
+ const { readCliScriptsFallback } = await import('./config-fallback-CV720XTz.js');
31657
31650
  scriptsMap = readCliScriptsFallback(cwd);
31658
31651
  }
31659
31652
  catch {
@@ -31667,7 +31660,7 @@ const resolveScriptsForRun = async (args) => {
31667
31660
  })();
31668
31661
  if (typeof scriptsDefaultCfg === 'undefined') {
31669
31662
  try {
31670
- const { readRunScriptsDefaultFallback } = await import('./config-fallback-S2V_I40B.js');
31663
+ const { readRunScriptsDefaultFallback } = await import('./config-fallback-CV720XTz.js');
31671
31664
  scriptsDefaultCfg = readRunScriptsDefaultFallback(cwd);
31672
31665
  }
31673
31666
  catch {
@@ -32151,7 +32144,7 @@ function utcStamp() {
32151
32144
  * named/default export shape differences under Vitest SSR/bundlers.
32152
32145
  */
32153
32146
  const resolveCaptureSnapshotAndArchives = async () => {
32154
- const modUnknown = await import('./capture-qFIjLi_h.js');
32147
+ const modUnknown = await import('./capture-DKrVoDyl.js');
32155
32148
  // 1) named export
32156
32149
  try {
32157
32150
  const named = modUnknown
@@ -32277,7 +32270,7 @@ async function handleSnap(opts) {
32277
32270
  maxUndos: 10,
32278
32271
  };
32279
32272
  try {
32280
- const ctxMod = (await import('./context-D1XMoxMA.js'));
32273
+ const ctxMod = (await import('./context-PS5ukh8q.js'));
32281
32274
  if (typeof ctxMod.resolveContext === 'function') {
32282
32275
  ctx = await ctxMod.resolveContext(cwd);
32283
32276
  }