@karmaniverous/stan-cli 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ import e,{readFileSync as t,existsSync as n,rmSync as r,createWriteStream as o}from"node:fs";import{copyFile as i,readdir as s,rm as a,readFile as u,writeFile as c,stat as l,open as p,realpath as f,mkdir as d,appendFile as h}from"node:fs/promises";import D,{resolve as g,dirname as m,join as y,relative as b}from"node:path";import{ensureDir as v}from"fs-extra";import E from"node:process";import{fileURLToPath as F}from"node:url";import C from"process";import w from"buffer";import{createHash as _}from"node:crypto";import{spawn as A}from"node:child_process";import S from"os";import k from"path";import P from"util";import R from"stream";import B from"events";import x from"fs";import O from"node:os";import T from"node:tty";import $ from"child_process";import{emitKeypressEvents as L}from"node:readline";const N="archive.tar",M="archive.prev.tar",j=e=>e.replace(/\\/g,"/"),I=(e,t)=>{const n=j(e).replace(/\/+$/,""),r=j(t);return r===n||r.startsWith(`${n}/`)},H=(e,t)=>{const n=j(e);return I(`${n}/diff`,t)||I(`${n}/patch`,t)},z=I,K=e=>{const t=e.replace(/\\/g,"/");return e=>!(H(t,e)||((e,t)=>{const n=j(e);return j(t)===`${n}/output/${N}`||j(t)===`${n}/output/archive.diff.tar`||j(t)===`${n}/output/archive.warnings.txt`})(t,e))},U=1048576,q=async(e,t)=>{const n=[],r=[],o=[];await Promise.all(t.map(async t=>{const i=t.replace(/\\/g,"/"),s=g(e,t);let a=null;try{a=await l(s)}catch{return}const c=a?.size??0;let f,d=!1;try{d=await(async e=>{try{const t=await p(e,"r");try{const e=Buffer.allocUnsafe(8192),{bytesRead:n}=await t.read(e,0,e.length,0);for(let t=0;t<n;t+=1)if(0===e[t])return!0;return!1}finally{await t.close().catch(()=>{})}}catch{return!1}})(s)}catch{d=!1}if(d)r.push({path:i,size:c});else{n.push(i);try{(c<=U||c<5*U)&&(f=(e=>{const t=e.replace(/\r\n/g,"\n");return 0===t.length?0:t.split("\n").length})(await u(s,"utf8")))}catch{}(c>U||"number"==typeof f&&f>3e3)&&o.push({path:i,size:c,loc:f})}}));const i=[];if(r.length>0){i.push(`Binary files excluded from archive (${r.length.toString()}):`);for(const e of r)i.push(` - ${e.path} (${e.size.toString()} bytes)`);i.push("")}if(o.length>0){i.push(`Large text files (included; consider excludes if unwanted) (${o.length.toString()}):`);for(const e of o){const t=[` - ${e.path}`,`(${e.size.toString()} bytes)`];"number"==typeof e.loc&&t.push(`${e.loc.toString()} LOC`),i.push(t.join(" "))}i.push(""),i.push(`Thresholds: size > ${U.toString()} bytes or LOC > ${3e3.toString()}`)}0===i.length&&i.push("No archive warnings.");const s=i.join("\n")+(i.length?"\n":"");return{textFiles:n,excludedBinaries:r,largeText:o,warningsBody:s}};var G="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function W(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Z,V,J,Y,Q,X,ee,te,ne,re,oe,ie,se={exports:{}},ae=(Z||(Z=1,function(e){function t(e){return Array.isArray(e)?e:[e]}const n=/^\s+$/,r=/(?:[^\\]|^)\\$/,o=/^\\!/,i=/^\\#/,s=/\r?\n/g,a=/^\.{0,2}\/|^\.{1,2}$/,u=/\/$/,c="/";let l="node-ignore";"undefined"!=typeof Symbol&&(l=Symbol.for("node-ignore"));const p=l,f=(e,t,n)=>(Object.defineProperty(e,t,{value:n}),n),d=/([0-z])-([0-z])/g,h=()=>!1,D=[[/^\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,o)=>"\\"===t?`\\[${n}${(e=>{const{length:t}=e;return e.slice(0,t-t%2)})(r)}${o}`:"]"===o&&r.length%2==0?`[${(e=>e.replace(d,(e,t,n)=>t.charCodeAt(0)<=n.charCodeAt(0)?e:""))(n)}${r}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`]],g=/(^|\\\/)?\\\*$/,m="regex",y="checkRegex",b={[m]:(e,t)=>(t?`${t}[^/]+`:"[^/]*")+"(?=$|\\/$)",[y]:(e,t)=>(t?`${t}[^/]*`:"[^/]*")+"(?=$|\\/$)"},v=e=>"string"==typeof e;class E{constructor(e,t,n,r,o,i){this.pattern=e,this.mark=t,this.negative=o,f(this,"body",n),f(this,"ignoreCase",r),f(this,"regexPrefix",i)}get regex(){const e="_"+m;return this[e]?this[e]:this._make(m,e)}get checkRegex(){const e="_"+y;return this[e]?this[e]:this._make(y,e)}_make(e,t){const n=this.regexPrefix.replace(g,b[e]),r=this.ignoreCase?new RegExp(n,"i"):new RegExp(n);return f(this,t,r)}}class F{constructor(e){this._ignoreCase=e,this._rules=[]}_add(e){if(e&&e[p])return this._rules=this._rules.concat(e._rules._rules),void(this._added=!0);if(v(e)&&(e={pattern:e}),(e=>e&&v(e)&&!n.test(e)&&!r.test(e)&&0!==e.indexOf("#"))(e.pattern)){const t=(({pattern:e,mark:t},n)=>{let r=!1,s=e;0===s.indexOf("!")&&(r=!0,s=s.substr(1)),s=s.replace(o,"!").replace(i,"#");const a=(e=>D.reduce((t,[n,r])=>t.replace(n,r.bind(e)),e))(s);return new E(e,t,s,n,r,a)})(e,this._ignoreCase);this._added=!0,this._rules.push(t)}}add(e){return this._added=!1,t(v(e)?(e=>e.split(s).filter(Boolean))(e):e).forEach(this._add,this),this._added}test(e,t,n){let r,o=!1,i=!1;this._rules.forEach(s=>{const{negative:a}=s;i===a&&o!==i||a&&!o&&!i&&!t||s[n].test(e)&&(o=!a,i=a,r=a?void 0:s)});const s={ignored:o,unignored:i};return r&&(s.rule=r),s}}const C=(e,t)=>{throw new t(e)},w=(e,t,n)=>v(e)?e?!w.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),_=e=>a.test(e);w.isNotRelative=_,w.convert=e=>e;class A{constructor({ignorecase:e=!0,ignoreCase:t=e,allowRelativePaths:n=!1}={}){f(this,p,!0),this._rules=new F(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 o=e&&w.convert(e);return w(o,e,this._strictPathCheck?C:h),this._t(o,t,n,r)}checkIgnore(e){if(!u.test(e))return this.test(e);const t=e.split(c).filter(Boolean);if(t.pop(),t.length){const e=this._t(t.join(c)+c,this._testCache,!0,t);if(e.ignored)return e}return this._rules.test(e,!1,y)}_t(e,t,n,r){if(e in t)return t[e];if(r||(r=e.split(c).filter(Boolean)),r.pop(),!r.length)return t[e]=this._rules.test(e,n,m);const o=this._t(r.join(c)+c,t,n,r);return t[e]=o.ignored?o:this._rules.test(e,n,m)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return t(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}}const S=e=>new A(e),k=()=>{w.convert=e=>/^\\\\\?\\/.test(e)||/["<>|\u0000-\u001F]+/u.test(e)?e:e.replace(/\\/g,"/");const e=/^[a-z]:\//i;w.isNotRelative=t=>e.test(t)||_(t)};"undefined"!=typeof process&&"win32"===process.platform&&k(),e.exports=S,S.default=S,e.exports.isPathValid=e=>w(e&&w.convert(e),e,h),f(e.exports,Symbol.for("setupWindows"),k)}(se)),se.exports),ue=W(ae),ce={};function le(){if(J)return V;J=1;const e="\\\\/",t=`[^${e}]`,n="\\.",r="\\/",o="[^/]",i=`(?:${r}|$)`,s=`(?:^|${r})`,a=`${n}{1,2}${i}`,u={DOT_LITERAL:n,PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:r,ONE_CHAR:"(?=.)",QMARK:o,END_ANCHOR:i,DOTS_SLASH:a,NO_DOT:`(?!${n})`,NO_DOTS:`(?!${s}${a})`,NO_DOT_SLASH:`(?!${n}{0,1}${i})`,NO_DOTS_SLASH:`(?!${a})`,QMARK_NO_DOT:`[^.${r}]`,STAR:`${o}*?`,START_ANCHOR:s,SEP:"/"},c={...u,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 V={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?c:u}}function pe(){return Y||(Y=1,function(e){const{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:o}=le();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(o,"\\$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 o=t.lastIndexOf(n,r);return-1===o?t:"\\"===t[o-1]?e.escapeLast(t,n,o-1):`${t.slice(0,o)}\\${t.slice(o)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith("./")&&(n=n.slice(2),t.prefix="./"),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?"":"^"}(?:${e})${n.contains?"":"$"}`;return!0===t.negated&&(r=`(?:^(?!${r}).*$)`),r},e.basename=(e,{windows:t}={})=>{const n=e.split(t?/[\\/]/:"/"),r=n[n.length-1];return""===r?n[n.length-2]:r}}(ce)),ce}function fe(){if(re)return ne;re=1;const e=function(){if(X)return Q;X=1;const e=pe(),{CHAR_ASTERISK:t,CHAR_AT:n,CHAR_BACKWARD_SLASH:r,CHAR_COMMA:o,CHAR_DOT:i,CHAR_EXCLAMATION_MARK:s,CHAR_FORWARD_SLASH:a,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:c,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:p,CHAR_QUESTION_MARK:f,CHAR_RIGHT_CURLY_BRACE:d,CHAR_RIGHT_PARENTHESES:h,CHAR_RIGHT_SQUARE_BRACKET:D}=le(),g=e=>e===a||e===r,m=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};return Q=(y,b)=>{const v=b||{},E=y.length-1,F=!0===v.parts||!0===v.scanToEnd,C=[],w=[],_=[];let A,S,k=y,P=-1,R=0,B=0,x=!1,O=!1,T=!1,$=!1,L=!1,N=!1,M=!1,j=!1,I=!1,H=!1,z=0,K={value:"",depth:0,isGlob:!1};const U=()=>P>=E,q=()=>k.charCodeAt(P+1),G=()=>(A=S,k.charCodeAt(++P));for(;P<E;){let e;if(S=G(),S!==r){if(!0===N||S===u){for(z++;!0!==U()&&(S=G());)if(S!==r)if(S!==u){if(!0!==N&&S===i&&(S=G())===i){if(x=K.isBrace=!0,T=K.isGlob=!0,H=!0,!0===F)continue;break}if(!0!==N&&S===o){if(x=K.isBrace=!0,T=K.isGlob=!0,H=!0,!0===F)continue;break}if(S===d&&(z--,0===z)){N=!1,x=K.isBrace=!0,H=!0;break}}else z++;else M=K.backslashes=!0,G();if(!0===F)continue;break}if(S!==a){if(!0!==v.noext&&1==(S===p||S===n||S===t||S===f||S===s)&&q()===c){if(T=K.isGlob=!0,$=K.isExtglob=!0,H=!0,S===s&&P===R&&(I=!0),!0===F){for(;!0!==U()&&(S=G());)if(S!==r){if(S===h){T=K.isGlob=!0,H=!0;break}}else M=K.backslashes=!0,S=G();continue}break}if(S===t){if(A===t&&(L=K.isGlobstar=!0),T=K.isGlob=!0,H=!0,!0===F)continue;break}if(S===f){if(T=K.isGlob=!0,H=!0,!0===F)continue;break}if(S===l){for(;!0!==U()&&(e=G());)if(e!==r){if(e===D){O=K.isBracket=!0,T=K.isGlob=!0,H=!0;break}}else M=K.backslashes=!0,G();if(!0===F)continue;break}if(!0===v.nonegate||S!==s||P!==R){if(!0!==v.noparen&&S===c){if(T=K.isGlob=!0,!0===F){for(;!0!==U()&&(S=G());)if(S!==c){if(S===h){H=!0;break}}else M=K.backslashes=!0,S=G();continue}break}if(!0===T){if(H=!0,!0===F)continue;break}}else j=K.negated=!0,R++}else{if(C.push(P),w.push(K),K={value:"",depth:0,isGlob:!1},!0===H)continue;if(A===i&&P===R+1){R+=2;continue}B=P+1}}else M=K.backslashes=!0,S=G(),S===u&&(N=!0)}!0===v.noext&&($=!1,T=!1);let W=k,Z="",V="";R>0&&(Z=k.slice(0,R),k=k.slice(R),B-=R),W&&!0===T&&B>0?(W=k.slice(0,B),V=k.slice(B)):!0===T?(W="",V=k):W=k,W&&""!==W&&"/"!==W&&W!==k&&g(W.charCodeAt(W.length-1))&&(W=W.slice(0,-1)),!0===v.unescape&&(V&&(V=e.removeBackslashes(V)),W&&!0===M&&(W=e.removeBackslashes(W)));const J={prefix:Z,input:y,start:R,base:W,glob:V,isBrace:x,isBracket:O,isGlob:T,isExtglob:$,isGlobstar:L,negated:j,negatedExtglob:I};if(!0===v.tokens&&(J.maxDepth=0,g(S)||w.push(K),J.tokens=w),!0===v.parts||!0===v.tokens){let e;for(let t=0;t<C.length;t++){const n=e?e+1:R,r=C[t],o=y.slice(n,r);v.tokens&&(0===t&&0!==R?(w[t].isPrefix=!0,w[t].value=Z):w[t].value=o,m(w[t]),J.maxDepth+=w[t].depth),0===t&&""===o||_.push(o),e=r}if(e&&e+1<y.length){const t=y.slice(e+1);_.push(t),v.tokens&&(w[w.length-1].value=t,m(w[w.length-1]),J.maxDepth+=w[w.length-1].depth)}J.slashes=C,J.parts=_}return J},Q}(),t=function(){if(te)return ee;te=1;const e=le(),t=pe(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:i,REPLACEMENTS:s}=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},u=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,c=(l,p)=>{if("string"!=typeof l)throw new TypeError("Expected a string");l=s[l]||l;const f={...p},d="number"==typeof f.maxLength?Math.min(n,f.maxLength):n;let h=l.length;if(h>d)throw new SyntaxError(`Input length: ${h}, exceeds maximum allowed length: ${d}`);const D={type:"bos",value:"",output:f.prepend||""},g=[D],m=f.capture?"":"?:",y=e.globChars(f.windows),b=e.extglobChars(y),{DOT_LITERAL:v,PLUS_LITERAL:E,SLASH_LITERAL:F,ONE_CHAR:C,DOTS_SLASH:w,NO_DOT:_,NO_DOT_SLASH:A,NO_DOTS_SLASH:S,QMARK:k,QMARK_NO_DOT:P,STAR:R,START_ANCHOR:B}=y,x=e=>`(${m}(?:(?!${B}${e.dot?w:v}).)*?)`,O=f.dot?"":_,T=f.dot?k:P;let $=!0===f.bash?x(f):R;f.capture&&($=`(${$})`),"boolean"==typeof f.noext&&(f.noextglob=f.noext);const L={input:l,index:-1,start:0,dot:!0===f.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:g};l=t.removePrefix(l,L),h=l.length;const N=[],M=[],j=[];let I,H=D;const z=()=>L.index===h-1,K=L.peek=(e=1)=>l[L.index+e],U=L.advance=()=>l[++L.index]||"",q=()=>l.slice(L.index+1),G=(e="",t=0)=>{L.consumed+=e,L.index+=t},W=e=>{L.output+=null!=e.output?e.output:e.value,G(e.value)},Z=()=>{let e=1;for(;"!"===K()&&("("!==K(2)||"?"===K(3));)U(),L.start++,e++;return e%2!=0&&(L.negated=!0,L.start++,!0)},V=e=>{L[e]++,j.push(e)},J=e=>{L[e]--,j.pop()},Y=e=>{if("globstar"===H.type){const t=L.braces>0&&("comma"===e.type||"brace"===e.type),n=!0===e.extglob||N.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||n||(L.output=L.output.slice(0,-H.output.length),H.type="star",H.value="*",H.output=$,L.output+=H.output)}if(N.length&&"paren"!==e.type&&(N[N.length-1].inner+=e.value),(e.value||e.output)&&W(e),H&&"text"===H.type&&"text"===e.type)return H.output=(H.output||H.value)+e.value,void(H.value+=e.value);e.prev=H,g.push(e),H=e},Q=(e,t)=>{const n={...b[t],conditions:1,inner:""};n.prev=H,n.parens=L.parens,n.output=L.output;const r=(f.capture?"(":"")+n.open;V("parens"),Y({type:e,value:t,output:L.output?"":C}),Y({type:"paren",extglob:!0,value:U(),output:r}),N.push(n)},X=e=>{let t,n=e.close+(f.capture?")":"");if("negate"===e.type){let r=$;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(r=x(f)),(r!==$||z()||/^\)+$/.test(q()))&&(n=e.close=`)$))${r}`),e.inner.includes("*")&&(t=q())&&/^\.[^\\/.]+$/.test(t)){const o=c(t,{...p,fastpaths:!1}).output;n=e.close=`)${o})${r})`}"bos"===e.prev.type&&(L.negatedExtglob=!0)}Y({type:"paren",extglob:!0,value:I,output:n}),J("parens")};if(!1!==f.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(l)){let e=!1,n=l.replace(i,(t,n,r,o,i,s)=>"\\"===o?(e=!0,t):"?"===o?n?n+o+(i?k.repeat(i.length):""):0===s?T+(i?k.repeat(i.length):""):k.repeat(r.length):"."===o?v.repeat(r.length):"*"===o?n?n+o+(i?$:""):$:n?t:`\\${t}`);return!0===e&&(n=!0===f.unescape?n.replace(/\\/g,""):n.replace(/\\+/g,e=>e.length%2==0?"\\\\":e?"\\":"")),n===l&&!0===f.contains?(L.output=l,L):(L.output=t.wrapOutput(n,L,p),L)}for(;!z();){if(I=U(),"\0"===I)continue;if("\\"===I){const e=K();if("/"===e&&!0!==f.bash)continue;if("."===e||";"===e)continue;if(!e){I+="\\",Y({type:"text",value:I});continue}const t=/^\\+/.exec(q());let n=0;if(t&&t[0].length>2&&(n=t[0].length,L.index+=n,n%2!=0&&(I+="\\")),!0===f.unescape?I=U():I+=U(),0===L.brackets){Y({type:"text",value:I});continue}}if(L.brackets>0&&("]"!==I||"["===H.value||"[^"===H.value)){if(!1!==f.posix&&":"===I){const e=H.value.slice(1);if(e.includes("[")&&(H.posix=!0,e.includes(":"))){const e=H.value.lastIndexOf("["),t=H.value.slice(0,e),n=H.value.slice(e+2),o=r[n];if(o){H.value=t+o,L.backtrack=!0,U(),D.output||1!==g.indexOf(H)||(D.output=C);continue}}}("["===I&&":"!==K()||"-"===I&&"]"===K())&&(I=`\\${I}`),"]"!==I||"["!==H.value&&"[^"!==H.value||(I=`\\${I}`),!0===f.posix&&"!"===I&&"["===H.value&&(I="^"),H.value+=I,W({value:I});continue}if(1===L.quotes&&'"'!==I){I=t.escapeRegex(I),H.value+=I,W({value:I});continue}if('"'===I){L.quotes=1===L.quotes?0:1,!0===f.keepQuotes&&Y({type:"text",value:I});continue}if("("===I){V("parens"),Y({type:"paren",value:I});continue}if(")"===I){if(0===L.parens&&!0===f.strictBrackets)throw new SyntaxError(u("opening","("));const e=N[N.length-1];if(e&&L.parens===e.parens+1){X(N.pop());continue}Y({type:"paren",value:I,output:L.parens?")":"\\)"}),J("parens");continue}if("["===I){if(!0!==f.nobracket&&q().includes("]"))V("brackets");else{if(!0!==f.nobracket&&!0===f.strictBrackets)throw new SyntaxError(u("closing","]"));I=`\\${I}`}Y({type:"bracket",value:I});continue}if("]"===I){if(!0===f.nobracket||H&&"bracket"===H.type&&1===H.value.length){Y({type:"text",value:I,output:`\\${I}`});continue}if(0===L.brackets){if(!0===f.strictBrackets)throw new SyntaxError(u("opening","["));Y({type:"text",value:I,output:`\\${I}`});continue}J("brackets");const e=H.value.slice(1);if(!0===H.posix||"^"!==e[0]||e.includes("/")||(I=`/${I}`),H.value+=I,W({value:I}),!1===f.literalBrackets||t.hasRegexChars(e))continue;const n=t.escapeRegex(H.value);if(L.output=L.output.slice(0,-H.value.length),!0===f.literalBrackets){L.output+=n,H.value=n;continue}H.value=`(${m}${n}|${H.value})`,L.output+=H.value;continue}if("{"===I&&!0!==f.nobrace){V("braces");const e={type:"brace",value:I,output:"(",outputIndex:L.output.length,tokensIndex:L.tokens.length};M.push(e),Y(e);continue}if("}"===I){const e=M[M.length-1];if(!0===f.nobrace||!e){Y({type:"text",value:I,output:I});continue}let t=")";if(!0===e.dots){const e=g.slice(),n=[];for(let t=e.length-1;t>=0&&(g.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&n.unshift(e[t].value);t=a(n,f),L.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const n=L.output.slice(0,e.outputIndex),r=L.tokens.slice(e.tokensIndex);e.value=e.output="\\{",I=t="\\}",L.output=n;for(const e of r)L.output+=e.output||e.value}Y({type:"brace",value:I,output:t}),J("braces"),M.pop();continue}if("|"===I){N.length>0&&N[N.length-1].conditions++,Y({type:"text",value:I});continue}if(","===I){let e=I;const t=M[M.length-1];t&&"braces"===j[j.length-1]&&(t.comma=!0,e="|"),Y({type:"comma",value:I,output:e});continue}if("/"===I){if("dot"===H.type&&L.index===L.start+1){L.start=L.index+1,L.consumed="",L.output="",g.pop(),H=D;continue}Y({type:"slash",value:I,output:F});continue}if("."===I){if(L.braces>0&&"dot"===H.type){"."===H.value&&(H.output=v);const e=M[M.length-1];H.type="dots",H.output+=I,H.value+=I,e.dots=!0;continue}if(L.braces+L.parens===0&&"bos"!==H.type&&"slash"!==H.type){Y({type:"text",value:I,output:v});continue}Y({type:"dot",value:I,output:v});continue}if("?"===I){if((!H||"("!==H.value)&&!0!==f.noextglob&&"("===K()&&"?"!==K(2)){Q("qmark",I);continue}if(H&&"paren"===H.type){const e=K();let t=I;("("===H.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(q()))&&(t=`\\${I}`),Y({type:"text",value:I,output:t});continue}if(!0!==f.dot&&("slash"===H.type||"bos"===H.type)){Y({type:"qmark",value:I,output:P});continue}Y({type:"qmark",value:I,output:k});continue}if("!"===I){if(!0!==f.noextglob&&"("===K()&&("?"!==K(2)||!/[!=<:]/.test(K(3)))){Q("negate",I);continue}if(!0!==f.nonegate&&0===L.index){Z();continue}}if("+"===I){if(!0!==f.noextglob&&"("===K()&&"?"!==K(2)){Q("plus",I);continue}if(H&&"("===H.value||!1===f.regex){Y({type:"plus",value:I,output:E});continue}if(H&&("bracket"===H.type||"paren"===H.type||"brace"===H.type)||L.parens>0){Y({type:"plus",value:I});continue}Y({type:"plus",value:E});continue}if("@"===I){if(!0!==f.noextglob&&"("===K()&&"?"!==K(2)){Y({type:"at",extglob:!0,value:I,output:""});continue}Y({type:"text",value:I});continue}if("*"!==I){"$"!==I&&"^"!==I||(I=`\\${I}`);const e=o.exec(q());e&&(I+=e[0],L.index+=e[0].length),Y({type:"text",value:I});continue}if(H&&("globstar"===H.type||!0===H.star)){H.type="star",H.star=!0,H.value+=I,H.output=$,L.backtrack=!0,L.globstar=!0,G(I);continue}let e=q();if(!0!==f.noextglob&&/^\([^?]/.test(e)){Q("star",I);continue}if("star"===H.type){if(!0===f.noglobstar){G(I);continue}const t=H.prev,n=t.prev,r="slash"===t.type||"bos"===t.type,o=n&&("star"===n.type||"globstar"===n.type);if(!0===f.bash&&(!r||e[0]&&"/"!==e[0])){Y({type:"star",value:I,output:""});continue}const i=L.braces>0&&("comma"===t.type||"brace"===t.type),s=N.length&&("pipe"===t.type||"paren"===t.type);if(!r&&"paren"!==t.type&&!i&&!s){Y({type:"star",value:I,output:""});continue}for(;"/**"===e.slice(0,3);){const t=l[L.index+4];if(t&&"/"!==t)break;e=e.slice(3),G("/**",3)}if("bos"===t.type&&z()){H.type="globstar",H.value+=I,H.output=x(f),L.output=H.output,L.globstar=!0,G(I);continue}if("slash"===t.type&&"bos"!==t.prev.type&&!o&&z()){L.output=L.output.slice(0,-(t.output+H.output).length),t.output=`(?:${t.output}`,H.type="globstar",H.output=x(f)+(f.strictSlashes?")":"|$)"),H.value+=I,L.globstar=!0,L.output+=t.output+H.output,G(I);continue}if("slash"===t.type&&"bos"!==t.prev.type&&"/"===e[0]){const n=void 0!==e[1]?"|$":"";L.output=L.output.slice(0,-(t.output+H.output).length),t.output=`(?:${t.output}`,H.type="globstar",H.output=`${x(f)}${F}|${F}${n})`,H.value+=I,L.output+=t.output+H.output,L.globstar=!0,G(I+U()),Y({type:"slash",value:"/",output:""});continue}if("bos"===t.type&&"/"===e[0]){H.type="globstar",H.value+=I,H.output=`(?:^|${F}|${x(f)}${F})`,L.output=H.output,L.globstar=!0,G(I+U()),Y({type:"slash",value:"/",output:""});continue}L.output=L.output.slice(0,-H.output.length),H.type="globstar",H.output=x(f),H.value+=I,L.output+=H.output,L.globstar=!0,G(I);continue}const n={type:"star",value:I,output:$};!0!==f.bash?!H||"bracket"!==H.type&&"paren"!==H.type||!0!==f.regex?(L.index!==L.start&&"slash"!==H.type&&"dot"!==H.type||("dot"===H.type?(L.output+=A,H.output+=A):!0===f.dot?(L.output+=S,H.output+=S):(L.output+=O,H.output+=O),"*"!==K()&&(L.output+=C,H.output+=C)),Y(n)):(n.output=I,Y(n)):(n.output=".*?","bos"!==H.type&&"slash"!==H.type||(n.output=O+n.output),Y(n))}for(;L.brackets>0;){if(!0===f.strictBrackets)throw new SyntaxError(u("closing","]"));L.output=t.escapeLast(L.output,"["),J("brackets")}for(;L.parens>0;){if(!0===f.strictBrackets)throw new SyntaxError(u("closing",")"));L.output=t.escapeLast(L.output,"("),J("parens")}for(;L.braces>0;){if(!0===f.strictBrackets)throw new SyntaxError(u("closing","}"));L.output=t.escapeLast(L.output,"{"),J("braces")}if(!0===f.strictSlashes||"star"!==H.type&&"bracket"!==H.type||Y({type:"maybe_slash",value:"",output:`${F}?`}),!0===L.backtrack){L.output="";for(const e of L.tokens)L.output+=null!=e.output?e.output:e.value,e.suffix&&(L.output+=e.suffix)}return L};return c.fastpaths=(r,o)=>{const i={...o},a="number"==typeof i.maxLength?Math.min(n,i.maxLength):n,u=r.length;if(u>a)throw new SyntaxError(`Input length: ${u}, exceeds maximum allowed length: ${a}`);r=s[r]||r;const{DOT_LITERAL:c,SLASH_LITERAL:l,ONE_CHAR:p,DOTS_SLASH:f,NO_DOT:d,NO_DOTS:h,NO_DOTS_SLASH:D,STAR:g,START_ANCHOR:m}=e.globChars(i.windows),y=i.dot?h:d,b=i.dot?D:d,v=i.capture?"":"?:";let E=!0===i.bash?".*?":g;i.capture&&(E=`(${E})`);const F=e=>!0===e.noglobstar?E:`(${v}(?:(?!${m}${e.dot?f:c}).)*?)`,C=e=>{switch(e){case"*":return`${y}${p}${E}`;case".*":return`${c}${p}${E}`;case"*.*":return`${y}${E}${c}${p}${E}`;case"*/*":return`${y}${E}${l}${p}${b}${E}`;case"**":return y+F(i);case"**/*":return`(?:${y}${F(i)}${l})?${b}${p}${E}`;case"**/*.*":return`(?:${y}${F(i)}${l})?${b}${E}${c}${p}${E}`;case"**/.*":return`(?:${y}${F(i)}${l})?${c}${p}${E}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const n=C(t[1]);if(!n)return;return n+c+t[2]}}},w=t.removePrefix(r,{negated:!1,prefix:""});let _=C(w);return _&&!0!==i.strictSlashes&&(_+=`${l}?`),_},ee=c}(),n=pe(),r=le(),o=(e,t,n=!1)=>{if(Array.isArray(e)){const r=e.map(e=>o(e,t,n)),i=e=>{for(const t of r){const n=t(e);if(n)return n}return!1};return i}const r=(i=e)&&"object"==typeof i&&!Array.isArray(i)&&e.tokens&&e.input;var i;if(""===e||"string"!=typeof e&&!r)throw new TypeError("Expected pattern to be a non-empty string");const s=t||{},a=s.windows,u=r?o.compileRe(e,t):o.makeRe(e,t,!1,!0),c=u.state;delete u.state;let l=()=>!1;if(s.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};l=o(s.ignore,e,n)}const p=(n,r=!1)=>{const{isMatch:i,match:p,output:f}=o.test(n,u,t,{glob:e,posix:a}),d={glob:e,state:c,regex:u,posix:a,input:n,output:f,match:p,isMatch:i};return"function"==typeof s.onResult&&s.onResult(d),!1===i?(d.isMatch=!1,!!r&&d):l(n)?("function"==typeof s.onIgnore&&s.onIgnore(d),d.isMatch=!1,!!r&&d):("function"==typeof s.onMatch&&s.onMatch(d),!r||d)};return n&&(p.state=c),p};return o.test=(e,t,r,{glob:i,posix:s}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};const a=r||{},u=a.format||(s?n.toPosixSlashes:null);let c=e===i,l=c&&u?u(e):e;return!1===c&&(l=u?u(e):e,c=l===i),!1!==c&&!0!==a.capture||(c=!0===a.matchBase||!0===a.basename?o.matchBase(e,t,r,s):t.exec(l)),{isMatch:Boolean(c),match:c,output:l}},o.matchBase=(e,t,r)=>(t instanceof RegExp?t:o.makeRe(t,r)).test(n.basename(e)),o.isMatch=(e,t,n)=>o(t,n)(e),o.parse=(e,n)=>Array.isArray(e)?e.map(e=>o.parse(e,n)):t(e,{...n,fastpaths:!1}),o.scan=(t,n)=>e(t,n),o.compileRe=(e,t,n=!1,r=!1)=>{if(!0===n)return e.output;const i=t||{},s=i.contains?"":"^",a=i.contains?"":"$";let u=`${s}(?:${e.output})${a}`;e&&!0===e.negated&&(u=`^(?!${u}).*$`);const c=o.toRegex(u,t);return!0===r&&(c.state=e),c},o.makeRe=(e,n={},r=!1,i=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let s={negated:!1,fastpaths:!0};return!1===n.fastpaths||"."!==e[0]&&"*"!==e[0]||(s.output=t.fastpaths(e,n)),s.output||(s=t(e,n)),o.compileRe(s,n,r,i)},o.toRegex=(e,t)=>{try{const n=t||{};return new RegExp(e,n.flags||(n.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},o.constants=r,ne=o}var de=W(function(){if(ie)return oe;ie=1;const e=fe(),t=pe();function n(n,r,o=!1){return!r||null!==r.windows&&void 0!==r.windows||(r={...r,windows:t.isWindows()}),e(n,r,o)}return Object.assign(n,e),oe=n}());const he=(e,t)=>{const n=t.replace(/\\/g,"/").replace(/^\.\/+/,""),r=`${n}/system`,o=`${n}/output`,i=`${n}/diff`,s=`${n}/dist`,a=`${n}/patch`,u=`${n}/imports`;return{rootRel:n,systemRel:r,outputRel:o,diffRel:i,distRel:s,patchRel:a,importsRel:u,rootAbs:g(e,n),systemAbs:g(e,r),outputAbs:g(e,o),diffAbs:g(e,i),distAbs:g(e,s),patchAbs:g(e,a),importsAbs:g(e,u)}},De=async e=>{const t=[],n=["."];for(;n.length;){const r=n.pop(),o=g(e,r),i=await s(o,{withFileTypes:!0});for(const e of i){const o="."===r?e.name:y(r,e.name);e.isDirectory()?n.push(o):t.push(o.replace(/\\/g,"/"))}}return t},ge=(e,t)=>{const n=t.replace(/\\/g,"/").replace(/\/+$/,"");return e===n||e.startsWith(n+"/")},me=e=>{const t=e.replace(/\\/g,"/").replace(/^\.\/+/,"").replace(/\/+$/,"");if(!/[*?[\]{}()!]/.test(n=t)&&!n.includes("**"))return t?e=>ge(e,t):()=>!1;var n;const r=de(t,{dot:!0});return e=>r(e)},ye=async(e,{cwd:t,stanPath:r,includeOutputDir:o,includes:i=[],excludes:s=[]})=>{const a=r.replace(/\\/g,"/"),c=((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,a),l=await(async e=>{const t=g(e,".gitignore");if(!n(t))return null;try{const e=await u(t,"utf8"),n=ue();return n.add(e),n}catch{return null}})(t),p=[e=>ge(e,"node_modules"),e=>ge(e,".git"),...l?[e=>l.ignores(e)]:[],...s.map(me),...c.map(e=>t=>ge(t,e)),e=>H(a,e)];o||p.push(e=>z(`${a}/output`,e));const f=e.filter(e=>!p.some(t=>t(e)));if(i.length>0){const t=i.map(me),n=[e=>H(a,e),...o?[]:[e=>z(`${a}/output`,e)]],r=new Set(f);for(const n of e)t.some(e=>e(n))&&r.add(n);const u=s.map(me);return e.filter(e=>r.has(e)&&!n.some(t=>t(e))&&!u.some(t=>t(e)))}return f},be=async(e,t)=>{const n=he(e,t);return await v(n.rootAbs),await v(n.outputAbs),await v(n.diffAbs),await v(n.patchAbs),{rootAbs:n.rootAbs,outputAbs:n.outputAbs,diffAbs:n.diffAbs,patchAbs:n.patchAbs}},ve=async(e,t)=>{const n=await be(e,t);return{outDir:n.outputAbs,diffDir:n.diffAbs}},Ee=e=>e instanceof URL?F(e):e;function Fe({cwd:t}={}){const n=function(t,{cwd:n=E.cwd(),type:r="file",stopAt:o}={}){let i=D.resolve(Ee(n)??"");const{root:s}=D.parse(i);o=D.resolve(i,Ee(o)??s);const a=D.isAbsolute(t);for(;i;){const n=a?t:D.join(i,t);try{const t=e.statSync(n,{throwIfNoEntry:!1});if("file"===r&&t?.isFile()||"directory"===r&&t?.isDirectory())return n}catch{}if(i===o||i===s)break;i=D.dirname(i)}}("package.json",{cwd:t});return n&&D.dirname(n)}const Ce=["stan.config.yml","stan.config.yaml","stan.config.json"],we=e=>{for(const t of Ce){const r=g(e,t);if(n(r))return r}return null};var _e,Ae={},Se={},ke={},Pe={};function Re(){if(_e)return Pe;_e=1;const e=Symbol.for("yaml.alias"),t=Symbol.for("yaml.document"),n=Symbol.for("yaml.map"),r=Symbol.for("yaml.pair"),o=Symbol.for("yaml.scalar"),i=Symbol.for("yaml.seq"),s=Symbol.for("yaml.node.type"),a=e=>!!e&&"object"==typeof e&&e[s]===o;function u(e){if(e&&"object"==typeof e)switch(e[s]){case n:case i:return!0}return!1}return Pe.ALIAS=e,Pe.DOC=t,Pe.MAP=n,Pe.NODE_TYPE=s,Pe.PAIR=r,Pe.SCALAR=o,Pe.SEQ=i,Pe.hasAnchor=e=>(a(e)||u(e))&&!!e.anchor,Pe.isAlias=t=>!!t&&"object"==typeof t&&t[s]===e,Pe.isCollection=u,Pe.isDocument=e=>!!e&&"object"==typeof e&&e[s]===t,Pe.isMap=e=>!!e&&"object"==typeof e&&e[s]===n,Pe.isNode=function(t){if(t&&"object"==typeof t)switch(t[s]){case e:case n:case o:case i:return!0}return!1},Pe.isPair=e=>!!e&&"object"==typeof e&&e[s]===r,Pe.isScalar=a,Pe.isSeq=e=>!!e&&"object"==typeof e&&e[s]===i,Pe}var Be,xe,Oe={};function Te(){if(Be)return Oe;Be=1;var e=Re();const t=Symbol("break visit"),n=Symbol("skip children"),r=Symbol("remove node");function o(t,n){const o=u(n);e.isDocument(t)?i(null,t.contents,o,Object.freeze([t]))===r&&(t.contents=null):i(null,t,o,Object.freeze([]))}function i(n,o,s,a){const u=c(n,o,s,a);if(e.isNode(u)||e.isPair(u))return l(n,a,u),i(n,u,s,a);if("symbol"!=typeof u)if(e.isCollection(o)){a=Object.freeze(a.concat(o));for(let e=0;e<o.items.length;++e){const n=i(e,o.items[e],s,a);if("number"==typeof n)e=n-1;else{if(n===t)return t;n===r&&(o.items.splice(e,1),e-=1)}}}else if(e.isPair(o)){a=Object.freeze(a.concat(o));const e=i("key",o.key,s,a);if(e===t)return t;e===r&&(o.key=null);const n=i("value",o.value,s,a);if(n===t)return t;n===r&&(o.value=null)}return u}async function s(t,n){const o=u(n);e.isDocument(t)?await a(null,t.contents,o,Object.freeze([t]))===r&&(t.contents=null):await a(null,t,o,Object.freeze([]))}async function a(n,o,i,s){const u=await c(n,o,i,s);if(e.isNode(u)||e.isPair(u))return l(n,s,u),a(n,u,i,s);if("symbol"!=typeof u)if(e.isCollection(o)){s=Object.freeze(s.concat(o));for(let e=0;e<o.items.length;++e){const n=await a(e,o.items[e],i,s);if("number"==typeof n)e=n-1;else{if(n===t)return t;n===r&&(o.items.splice(e,1),e-=1)}}}else if(e.isPair(o)){s=Object.freeze(s.concat(o));const e=await a("key",o.key,i,s);if(e===t)return t;e===r&&(o.key=null);const n=await a("value",o.value,i,s);if(n===t)return t;n===r&&(o.value=null)}return u}function u(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 c(t,n,r,o){return"function"==typeof r?r(t,n,o):e.isMap(n)?r.Map?.(t,n,o):e.isSeq(n)?r.Seq?.(t,n,o):e.isPair(n)?r.Pair?.(t,n,o):e.isScalar(n)?r.Scalar?.(t,n,o):e.isAlias(n)?r.Alias?.(t,n,o):void 0}function l(t,n,r){const o=n[n.length-1];if(e.isCollection(o))o.items[t]=r;else if(e.isPair(o))"key"===t?o.key=r:o.value=r;else{if(!e.isDocument(o)){const t=e.isAlias(o)?"alias":"scalar";throw new Error(`Cannot replace node with ${t} parent`)}o.contents=r}}return o.BREAK=t,o.SKIP=n,o.REMOVE=r,s.BREAK=t,s.SKIP=n,s.REMOVE=r,Oe.visit=o,Oe.visitAsync=s,Oe}function $e(){if(xe)return ke;xe=1;var e=Re(),t=Te();const n={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},r=e=>e.replace(/[!,[\]{}]/g,e=>n[e]);class o{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},o.defaultYaml,e),this.tags=Object.assign({},o.defaultTags,t)}clone(){const e=new o(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new o(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:o.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},o.defaultTags)}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:o.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},o.defaultTags),this.atNextDocument=!1);const n=e.trim().split(/[ \t]+/),r=n.shift();switch(r){case"%TAG":{if(2!==n.length&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;const[e,r]=n;return this.tags[e]=r,!0}case"%YAML":{if(this.yaml.explicit=!0,1!==n.length)return t(0,"%YAML directive should contain exactly one part"),!1;const[e]=n;return"1.1"===e||"1.2"===e?(this.yaml.version=e,!0):(t(6,`Unsupported YAML version ${e}`,/^\d+\.\d+$/.test(e)),!1)}default:return t(0,`Unknown directive ${r}`,!0),!1}}tagName(e,t){if("!"===e)return"!";if("!"!==e[0])return t(`Not a valid tag: ${e}`),null;if("<"===e[1]){const n=e.slice(2,-1);return"!"===n||"!!"===n?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(">"!==e[e.length-1]&&t("Verbatim tags must end with a >"),n)}const[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);const o=this.tags[n];if(o)try{return o+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"}`]:[],o=Object.entries(this.tags);let i;if(n&&o.length>0&&e.isNode(n.contents)){const r={};t.visit(n.contents,(t,n)=>{e.isNode(n)&&n.tag&&(r[n.tag]=!0)}),i=Object.keys(r)}else i=[];for(const[e,t]of o)"!!"===e&&"tag:yaml.org,2002:"===t||n&&!i.some(e=>e.startsWith(t))||r.push(`%TAG ${e} ${t}`);return r.join("\n")}}return o.defaultYaml={explicit:!1,version:"1.2"},o.defaultTags={"!!":"tag:yaml.org,2002:"},ke.Directives=o,ke}var Le,Ne={},Me={},je={};function Ie(){if(Le)return je;Le=1;var e=Re(),t=Te();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 je.anchorIsValid=function(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const t=JSON.stringify(e);throw new Error(`Anchor must not contain whitespace or control characters: ${t}`)}return!0},je.anchorNames=n,je.createNodeAnchors=function(t,o){const i=[],s=new Map;let a=null;return{onAnchor:e=>{i.push(e),a??(a=n(t));const s=r(o,a);return a.add(s),s},setAnchors:()=>{for(const t of i){const n=s.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:s}},je.findNewAnchor=r,je}var He,ze={},Ke={};function Ue(){return He||(He=1,Ke.applyReviver=function e(t,n,r,o){if(o&&"object"==typeof o)if(Array.isArray(o))for(let n=0,r=o.length;n<r;++n){const r=o[n],i=e(t,o,String(n),r);void 0===i?delete o[n]:i!==r&&(o[n]=i)}else if(o instanceof Map)for(const n of Array.from(o.keys())){const r=o.get(n),i=e(t,o,n,r);void 0===i?o.delete(n):i!==r&&o.set(n,i)}else if(o instanceof Set)for(const n of Array.from(o)){const r=e(t,o,n,n);void 0===r?o.delete(n):r!==n&&(o.delete(n),o.add(r))}else for(const[n,r]of Object.entries(o)){const i=e(t,o,n,r);void 0===i?delete o[n]:i!==r&&(o[n]=i)}return t.call(n,r,o)}),Ke}var qe,Ge,We,Ze={};function Ve(){if(qe)return Ze;qe=1;var e=Re();return Ze.toJS=function t(n,r,o){if(Array.isArray(n))return n.map((e,n)=>t(e,String(n),o));if(n&&"function"==typeof n.toJSON){if(!o||!e.hasAnchor(n))return n.toJSON(r,o);const t={aliasCount:0,count:1,res:void 0};o.anchors.set(n,t),o.onCreate=e=>{t.res=e,delete o.onCreate};const i=n.toJSON(r,o);return o.onCreate&&o.onCreate(i),i}return"bigint"!=typeof n||o?.keep?n:Number(n)},Ze}function Je(){if(Ge)return ze;Ge=1;var e=Ue(),t=Re(),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:o,maxAliasCount:i,onAnchor:s,reviver:a}={}){if(!t.isDocument(r))throw new TypeError("A document argument is required");const u={anchors:new Map,doc:r,keep:!0,mapAsMap:!0===o,mapKeyWarned:!1,maxAliasCount:"number"==typeof i?i:100},c=n.toJS(this,"",u);if("function"==typeof s)for(const{count:e,res:t}of u.anchors.values())s(t,e);return"function"==typeof a?e.applyReviver(a,{"":c},"",c):c}},ze}function Ye(){if(We)return Me;We=1;var e=Ie(),t=Te(),n=Re(),r=Je(),o=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 o,i;r?.aliasResolveCache?o=r.aliasResolveCache:(o=[],t.visit(e,{Node:(e,t)=>{(n.isAlias(t)||n.hasAnchor(t))&&o.push(t)}}),r&&(r.aliasResolveCache=o));for(const e of o){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 u=n.get(a);if(u||(o.toJS(a,null,t),u=n.get(a)),!u||void 0===u.res)throw new ReferenceError("This should not happen: Alias anchor was not resolved?");if(i>=0&&(u.count+=1,0===u.aliasCount&&(u.aliasCount=s(r,a,n)),u.count*u.aliasCount>i))throw new ReferenceError("Excessive alias count indicates a resource exhaustion attack");return u.res}toString(t,n,r){const o=`*${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`${o} `}return o}};function s(e,t,r){if(n.isAlias(t)){const n=t.resolve(e),o=r&&n&&r.get(n);return o?o.count*o.aliasCount:0}if(n.isCollection(t)){let n=0;for(const o of t.items){const t=s(e,o,r);t>n&&(n=t)}return n}if(n.isPair(t)){const n=s(e,t.key,r),o=s(e,t.value,r);return Math.max(n,o)}return 1}return Me.Alias=i,Me}var Qe,Xe,et,tt={},nt={},rt={};function ot(){if(Qe)return rt;Qe=1;var e=Re(),t=Je(),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=Ye(),t=Re(),n=ot();return nt.createNode=function(r,o,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:s,onAnchor:a,onTagObj:u,schema:c,sourceObjects:l}=i;let p;if(s&&r&&"object"==typeof r){if(p=l.get(r),p)return p.anchor??(p.anchor=a(r)),new e.Alias(p.anchor);p={anchor:null,node:null},l.set(r,p)}o?.startsWith("!!")&&(o="tag:yaml.org,2002:"+o.slice(2));let f=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,o,c.tags);if(!f){if(r&&"function"==typeof r.toJSON&&(r=r.toJSON()),!r||"object"!=typeof r){const e=new n.Scalar(r);return p&&(p.node=e),e}f=r instanceof Map?c[t.MAP]:Symbol.iterator in Object(r)?c[t.SEQ]:c[t.MAP]}u&&(u(f),delete i.onTagObj);const d=f?.createNode?f.createNode(i.schema,r,i):"function"==typeof f?.nodeClass?.from?f.nodeClass.from(i.schema,r,i):new n.Scalar(r);return o?d.tag=o:f.default||(d.tag=f.tag),p&&(p.node=d),d},nt}function st(){if(et)return tt;et=1;var e=it(),t=Re(),n=Je();function r(t,n,r){let o=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]=o,o=e}else o=new Map([[t,o]])}return e.createNode(o,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}const o=e=>null==e||"object"==typeof e&&!!e[Symbol.iterator]().next().done;let i=class extends n.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(n=>t.isNode(n)||t.isPair(n)?n.clone(e):n),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(o(e))this.add(n);else{const[o,...i]=e,s=this.get(o,!0);if(t.isCollection(s))s.addIn(i,n);else{if(void 0!==s||!this.schema)throw new Error(`Expected YAML collection at ${o}. Remaining path: ${i}`);this.set(o,r(this.schema,i,n))}}}deleteIn(e){const[n,...r]=e;if(0===r.length)return this.delete(n);const o=this.get(n,!0);if(t.isCollection(o))return o.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(e,n){const[r,...o]=e,i=this.get(r,!0);return 0===o.length?!n&&t.isScalar(i)?i.value:i:t.isCollection(i)?i.getIn(o,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!t.isPair(n))return!1;const r=n.value;return null==r||e&&t.isScalar(r)&&null==r.value&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){const[n,...r]=e;if(0===r.length)return this.has(n);const o=this.get(n,!0);return!!t.isCollection(o)&&o.hasIn(r)}setIn(e,n){const[o,...i]=e;if(0===i.length)this.set(o,n);else{const e=this.get(o,!0);if(t.isCollection(e))e.setIn(i,n);else{if(void 0!==e||!this.schema)throw new Error(`Expected YAML collection at ${o}. Remaining path: ${i}`);this.set(o,r(this.schema,i,n))}}}};return tt.Collection=i,tt.collectionFromPath=r,tt.isEmptyPath=o,tt}var at,ut={},ct={},lt={},pt={};function ft(){if(at)return pt;function e(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}return at=1,pt.indentComment=e,pt.lineComment=(t,n,r)=>t.endsWith("\n")?e(r,n):r.includes("\n")?"\n"+e(r,n):(t.endsWith(" ")?"":" ")+r,pt.stringifyComment=e=>e.replace(/^(?!$)(?: $)?/gm,"#"),pt}var dt,ht,Dt,gt,mt={},yt={};function bt(){if(ht)return mt;ht=1;var e=ot(),t=function(){if(dt)return yt;dt=1;const e="block",t="quoted";function n(e,t,n){let r=t,o=t+1,i=e[o];for(;" "===i||"\t"===i;)if(t<o+n)i=e[++t];else{do{i=e[++t]}while(i&&"\n"!==i);r=t,o=t+1,i=e[o]}return r}return yt.FOLD_BLOCK=e,yt.FOLD_FLOW="flow",yt.FOLD_QUOTED=t,yt.foldFlowLines=function(r,o,i="flow",{indentAtStart:s,lineWidth:a=80,minContentWidth:u=20,onFold:c,onOverflow:l}={}){if(!a||a<0)return r;a<u&&(u=0);const p=Math.max(1+u,1+a-o.length);if(r.length<=p)return r;const f=[],d={};let h,D,g=a-o.length;"number"==typeof s&&(s>a-Math.max(2,u)?f.push(0):g=a-s);let m=!1,y=-1,b=-1,v=-1;i===e&&(y=n(r,y,o.length),-1!==y&&(g=y+p));for(let s;s=r[y+=1];){if(i===t&&"\\"===s){switch(b=y,r[y+1]){case"x":y+=3;break;case"u":y+=5;break;case"U":y+=9;break;default:y+=1}v=y}if("\n"===s)i===e&&(y=n(r,y,o.length)),g=y+o.length+p,h=void 0;else{if(" "===s&&D&&" "!==D&&"\n"!==D&&"\t"!==D){const e=r[y+1];e&&" "!==e&&"\n"!==e&&"\t"!==e&&(h=y)}if(y>=g)if(h)f.push(h),g=h+p,h=void 0;else if(i===t){for(;" "===D||"\t"===D;)D=s,s=r[y+=1],m=!0;const e=y>v+1?y-2:b-1;if(d[e])return r;f.push(e),d[e]=!0,g=e+p,h=void 0}else m=!0}D=s}if(m&&l&&l(),0===f.length)return r;c&&c();let E=r.slice(0,f[0]);for(let e=0;e<f.length;++e){const n=f[e],s=f[e+1]||r.length;0===n?E=`\n${o}${r.slice(0,s)}`:(i===t&&d[n]&&(E+=`${r[n]}\\`),E+=`\n${o}${r.slice(n+1,s)}`)}return E},yt}();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 o(e,o){const i=JSON.stringify(e);if(o.options.doubleQuotedAsJSON)return i;const{implicitKey:s}=o,a=o.options.doubleQuotedMinMultiLineLength,u=o.indent||(r(e)?" ":"");let c="",l=0;for(let e=0,t=i[e];t;t=i[++e])if(" "===t&&"\\"===i[e+1]&&"n"===i[e+2]&&(c+=i.slice(l,e)+"\\ ",e+=1,l=e,t="\\"),"\\"===t)switch(i[e+1]){case"u":{c+=i.slice(l,e);const t=i.substr(e+2,4);switch(t){case"0000":c+="\\0";break;case"0007":c+="\\a";break;case"000b":c+="\\v";break;case"001b":c+="\\e";break;case"0085":c+="\\N";break;case"00a0":c+="\\_";break;case"2028":c+="\\L";break;case"2029":c+="\\P";break;default:"00"===t.substr(0,2)?c+="\\x"+t.substr(2):c+=i.substr(e,6)}e+=5,l=e+1}break;case"n":if(s||'"'===i[e+2]||i.length<a)e+=1;else{for(c+=i.slice(l,e)+"\n\n";"\\"===i[e+2]&&"n"===i[e+3]&&'"'!==i[e+4];)c+="\n",e+=2;c+=u," "===i[e+2]&&(c+="\\"),e+=1,l=e+1}break;default:e+=1}return c=l?c+i.slice(l):i,s?c:t.foldFlowLines(c,u,t.FOLD_QUOTED,n(o,!1))}function i(e,i){if(!1===i.options.singleQuote||i.implicitKey&&e.includes("\n")||/[ \t]\n|\n[ \t]/.test(e))return o(e,i);const s=i.indent||(r(e)?" ":""),a="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&\n${s}`)+"'";return i.implicitKey?a:t.foldFlowLines(a,s,t.FOLD_FLOW,n(i,!1))}function s(e,t){const{singleQuote:n}=t.options;let r;if(!1===n)r=o;else{const t=e.includes('"'),s=e.includes("'");r=t&&!s?i:s&&!t?o:n?i:o}return r(e,t)}let a;try{a=new RegExp("(^|(?<!\n))\n+(?!\n|$)","g")}catch{a=/\n+(?!\n|$)/g}function u({comment:o,type:i,value:u},c,l,p){const{blockQuote:f,commentString:d,lineWidth:h}=c.options;if(!f||/\n[\t ]+$/.test(u))return s(u,c);const D=c.indent||(c.forceBlockIndent||r(u)?" ":""),g="literal"===f||"folded"!==f&&i!==e.Scalar.BLOCK_FOLDED&&(i===e.Scalar.BLOCK_LITERAL||!function(e,t,n){if(!t||t<0)return!1;const r=t-n,o=e.length;if(o<=r)return!1;for(let t=0,n=0;t<o;++t)if("\n"===e[t]){if(t-n>r)return!0;if(n=t+1,o-n<=r)return!1}return!0}(u,h,D.length));if(!u)return g?"|\n":">\n";let m,y;for(y=u.length;y>0;--y){const e=u[y-1];if("\n"!==e&&"\t"!==e&&" "!==e)break}let b=u.substring(y);const v=b.indexOf("\n");-1===v?m="-":u===b||v!==b.length-1?(m="+",p&&p()):m="",b&&(u=u.slice(0,-b.length),"\n"===b[b.length-1]&&(b=b.slice(0,-1)),b=b.replace(a,`$&${D}`));let E,F=!1,C=-1;for(E=0;E<u.length;++E){const e=u[E];if(" "===e)F=!0;else{if("\n"!==e)break;C=E}}let w=u.substring(0,C<E?C+1:E);w&&(u=u.substring(w.length),w=w.replace(/\n+/g,`$&${D}`));let _=(F?D?"2":"1":"")+m;if(o&&(_+=" "+d(o.replace(/ ?[\r\n]+/g," ")),l&&l()),!g){const r=u.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${D}`);let o=!1;const s=n(c,!0);"folded"!==f&&i!==e.Scalar.BLOCK_FOLDED&&(s.onOverflow=()=>{o=!0});const a=t.foldFlowLines(`${w}${r}${b}`,D,t.FOLD_BLOCK,s);if(!o)return`>${_}\n${D}${a}`}return`|${_}\n${D}${w}${u=u.replace(/\n+/g,`$&${D}`)}${b}`}return mt.stringifyString=function(a,c,l,p){const{implicitKey:f,inFlow:d}=c,h="string"==typeof a.value?a:Object.assign({},a,{value:String(a.value)});let{type:D}=a;D!==e.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(h.value)&&(D=e.Scalar.QUOTE_DOUBLE);const g=a=>{switch(a){case e.Scalar.BLOCK_FOLDED:case e.Scalar.BLOCK_LITERAL:return f||d?s(h.value,c):u(h,c,l,p);case e.Scalar.QUOTE_DOUBLE:return o(h.value,c);case e.Scalar.QUOTE_SINGLE:return i(h.value,c);case e.Scalar.PLAIN:return function(o,i,a,c){const{type:l,value:p}=o,{actualString:f,implicitKey:d,indent:h,indentStep:D,inFlow:g}=i;if(d&&p.includes("\n")||g&&/[[\]{},]/.test(p))return s(p,i);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(p))return d||g||!p.includes("\n")?s(p,i):u(o,i,a,c);if(!d&&!g&&l!==e.Scalar.PLAIN&&p.includes("\n"))return u(o,i,a,c);if(r(p)){if(""===h)return i.forceBlockIndent=!0,u(o,i,a,c);if(d&&h===D)return s(p,i)}const m=p.replace(/\n+/g,`$&\n${h}`);if(f){const e=e=>e.default&&"tag:yaml.org,2002:str"!==e.tag&&e.test?.test(m),{compat:t,tags:n}=i.doc.schema;if(n.some(e)||t?.some(e))return s(p,i)}return d?m:t.foldFlowLines(m,h,t.FOLD_FLOW,n(i,!1))}(h,c,l,p);default:return null}};let m=g(D);if(null===m){const{defaultKeyType:e,defaultStringType:t}=c.options,n=f&&e||t;if(m=g(n),null===m)throw new Error(`Unsupported default string type ${n}`)}return m},mt}function vt(){if(Dt)return lt;Dt=1;var e=Ie(),t=Re(),n=ft(),r=bt();return lt.createStringifyContext=function(e,t){const r=Object.assign({blockQuote:!0,commentString:n.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let o;switch(r.collectionStyle){case"block":o=!1;break;case"flow":o=!0;break;default:o=null}return{anchors:new Set,doc:e,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:"number"==typeof r.indent?" ".repeat(r.indent):" ",inFlow:o,options:r}},lt.stringify=function(n,o,i,s){if(t.isPair(n))return n.toString(o,i,s);if(t.isAlias(n)){if(o.doc.directives)return n.toString(o);if(o.resolvedAliases?.has(n))throw new TypeError("Cannot stringify circular structure without alias nodes");o.resolvedAliases?o.resolvedAliases.add(n):o.resolvedAliases=new Set([n]),n=n.resolve(o.doc)}let a;const u=t.isNode(n)?n:o.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,o;if(t.isScalar(n)){o=n.value;let t=e.filter(e=>e.identify?.(o));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 o=n,r=e.find(e=>e.nodeClass&&o instanceof e.nodeClass);if(!r)throw new Error(`Tag not resolved for ${o?.constructor?.name??(null===o?"null":typeof o)} value`);return r}(o.doc.schema.tags,u));const c=function(n,r,{anchors:o,doc:i}){if(!i.directives)return"";const s=[],a=(t.isScalar(n)||t.isCollection(n))&&n.anchor;a&&e.anchorIsValid(a)&&(o.add(a),s.push(`&${a}`));const u=n.tag??(r.default?null:r.tag);return u&&s.push(i.directives.tagString(u)),s.join(" ")}(u,a,o);c.length>0&&(o.indentAtStart=(o.indentAtStart??0)+c.length+1);const l="function"==typeof a.stringify?a.stringify(u,o,i,s):t.isScalar(u)?r.stringifyString(u,o,i,s):u.toString(o,i,s);return c?t.isScalar(u)||"{"===l[0]||"["===l[0]?`${c} ${l}`:`${c}\n${o.indent}${l}`:l},lt}var Et,Ft={},Ct={};function wt(){if(Et)return Ct;Et=1;var e=C;return Ct.debug=function(e,...t){"debug"===e&&console.log(...t)},Ct.warn=function(t,n){"debug"!==t&&"warn"!==t||("function"==typeof e.emitWarning?e.emitWarning(n):console.warn(n))},Ct}var _t,At,St,kt={};function Pt(){if(_t)return kt;_t=1;var e=Re(),t=ot();const n="<<",r={identify:e=>e===n||"symbol"==typeof e&&e.description===n,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new t.Scalar(Symbol(n)),{addToJSMap:o}),stringify:()=>n};function o(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 o=t&&e.isAlias(r)?r.resolve(t.doc):r;if(!e.isMap(o))throw new Error("Merge sources must be maps or map aliases");const i=o.toJSON(null,t,Map);for(const[e,t]of i)n instanceof Map?n.has(e)||n.set(e,t):n instanceof Set?n.add(e):Object.prototype.hasOwnProperty.call(n,e)||Object.defineProperty(n,e,{value:t,writable:!0,enumerable:!0,configurable:!0});return n}return kt.addMergeToJSMap=o,kt.isMergeKey=(n,o)=>(r.identify(o)||e.isScalar(o)&&(!o.type||o.type===t.Scalar.PLAIN)&&r.identify(o.value))&&n?.doc.schema.tags.some(e=>e.tag===r.tag&&e.default),kt.merge=r,kt}function Rt(){if(At)return Ft;At=1;var e=wt(),t=Pt(),n=vt(),r=Re(),o=Ve();return Ft.addPairToJSMap=function(i,s,{key:a,value:u}){if(r.isNode(a)&&a.addToJSMap)a.addToJSMap(i,s,u);else if(t.isMergeKey(i,a))t.addMergeToJSMap(i,s,u);else{const t=o.toJS(a,"",i);if(s instanceof Map)s.set(t,o.toJS(u,t,i));else if(s instanceof Set)s.add(t);else{const c=function(t,o,i){if(null===o)return"";if("object"!=typeof o)return String(o);if(r.isNode(t)&&i?.doc){const r=n.createStringifyContext(i.doc,{});r.anchors=new Set;for(const e of i.anchors.keys())r.anchors.add(e.anchor);r.inFlow=!0,r.inStringifyKey=!0;const o=t.toString(r);if(!i.mapKeyWarned){let t=JSON.stringify(o);t.length>40&&(t=t.substring(0,36)+'..."'),e.warn(i.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${t}. Set mapAsMap: true to use object keys.`),i.mapKeyWarned=!0}return o}return JSON.stringify(o)}(a,t,i),l=o.toJS(u,c,i);c in s?Object.defineProperty(s,c,{value:l,writable:!0,enumerable:!0,configurable:!0}):s[c]=l}}return s},Ft}function Bt(){if(St)return ut;St=1;var e=it(),t=function(){if(gt)return ct;gt=1;var e=Re(),t=ot(),n=vt(),r=ft();return ct.stringifyPair=function({key:o,value:i},s,a,u){const{allNullValues:c,doc:l,indent:p,indentStep:f,options:{commentString:d,indentSeq:h,simpleKeys:D}}=s;let g=e.isNode(o)&&o.comment||null;if(D){if(g)throw new Error("With simple keys, key nodes cannot have comments");if(e.isCollection(o)||!e.isNode(o)&&"object"==typeof o)throw new Error("With simple keys, collection cannot be used as a key value")}let m=!D&&(!o||g&&null==i&&!s.inFlow||e.isCollection(o)||(e.isScalar(o)?o.type===t.Scalar.BLOCK_FOLDED||o.type===t.Scalar.BLOCK_LITERAL:"object"==typeof o));s=Object.assign({},s,{allNullValues:!1,implicitKey:!m&&(D||!c),indent:p+f});let y,b,v,E=!1,F=!1,C=n.stringify(o,s,()=>E=!0,()=>F=!0);if(!m&&!s.inFlow&&C.length>1024){if(D)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(s.inFlow){if(c||null==i)return E&&a&&a(),""===C?"?":m?`? ${C}`:C}else if(c&&!D||null==i&&m)return C=`? ${C}`,g&&!E?C+=r.lineComment(C,s.indent,d(g)):F&&u&&u(),C;E&&(g=null),m?(g&&(C+=r.lineComment(C,s.indent,d(g))),C=`? ${C}\n${p}:`):(C=`${C}:`,g&&(C+=r.lineComment(C,s.indent,d(g)))),e.isNode(i)?(y=!!i.spaceBefore,b=i.commentBefore,v=i.comment):(y=!1,b=null,v=null,i&&"object"==typeof i&&(i=l.createNode(i))),s.implicitKey=!1,m||g||!e.isScalar(i)||(s.indentAtStart=C.length+1),F=!1,h||!(f.length>=2)||s.inFlow||m||!e.isSeq(i)||i.flow||i.tag||i.anchor||(s.indent=s.indent.substring(2));let w=!1;const _=n.stringify(i,s,()=>w=!0,()=>F=!0);let A=" ";if(g||y||b){if(A=y?"\n":"",b){const e=d(b);A+=`\n${r.indentComment(e,s.indent)}`}""!==_||s.inFlow?A+=`\n${s.indent}`:"\n"===A&&(A="\n\n")}else if(!m&&e.isCollection(i)){const e=_[0],t=_.indexOf("\n"),n=-1!==t,r=s.inFlow??i.flow??0===i.items.length;if(n||!r){let r=!1;if(n&&("&"===e||"!"===e)){let n=_.indexOf(" ");"&"===e&&-1!==n&&n<t&&"!"===_[n+1]&&(n=_.indexOf(" ",n+1)),(-1===n||t<n)&&(r=!0)}r||(A=`\n${s.indent}`)}}else""!==_&&"\n"!==_[0]||(A="");return C+=A+_,s.inFlow?w&&a&&a():v&&!w?C+=r.lineComment(C,s.indent,d(v)):F&&u&&u(),C},ct}(),n=Rt(),r=Re();let o=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:o}=this;return r.isNode(n)&&(n=n.clone(t)),r.isNode(o)&&(o=o.clone(t)),new e(n,o)}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 ut.Pair=o,ut.createPair=function(t,n,r){const i=e.createNode(t,void 0,r),s=e.createNode(n,void 0,r);return new o(i,s)},ut}var xt,Ot,Tt,$t={},Lt={},Nt={},Mt={};function jt(){if(xt)return Mt;xt=1;var e=Re(),t=vt(),n=ft();function r({comment:r,items:o},s,{blockItemPrefix:a,flowChars:u,itemIndent:c,onChompKeep:l,onComment:p}){const{indent:f,options:{commentString:d}}=s,h=Object.assign({},s,{indent:c,type:null});let D=!1;const g=[];for(let r=0;r<o.length;++r){const u=o[r];let l=null;if(e.isNode(u))!D&&u.spaceBefore&&g.push(""),i(s,g,u.commentBefore,D),u.comment&&(l=u.comment);else if(e.isPair(u)){const t=e.isNode(u.key)?u.key:null;t&&(!D&&t.spaceBefore&&g.push(""),i(s,g,t.commentBefore,D))}D=!1;let p=t.stringify(u,h,()=>l=null,()=>D=!0);l&&(p+=n.lineComment(p,c,d(l))),D&&l&&(D=!1),g.push(a+p)}let m;if(0===g.length)m=u.start+u.end;else{m=g[0];for(let e=1;e<g.length;++e){const t=g[e];m+=t?`\n${f}${t}`:"\n"}}return r?(m+="\n"+n.indentComment(d(r),f),p&&p()):D&&l&&l(),m}function o({items:r},o,{flowChars:s,itemIndent:a}){const{indent:u,indentStep:c,flowCollectionPadding:l,options:{commentString:p}}=o;a+=c;const f=Object.assign({},o,{indent:a,inFlow:!0,type:null});let d=!1,h=0;const D=[];for(let s=0;s<r.length;++s){const u=r[s];let c=null;if(e.isNode(u))u.spaceBefore&&D.push(""),i(o,D,u.commentBefore,!1),u.comment&&(c=u.comment);else if(e.isPair(u)){const t=e.isNode(u.key)?u.key:null;t&&(t.spaceBefore&&D.push(""),i(o,D,t.commentBefore,!1),t.comment&&(d=!0));const n=e.isNode(u.value)?u.value:null;n?(n.comment&&(c=n.comment),n.commentBefore&&(d=!0)):null==u.value&&t?.comment&&(c=t.comment)}c&&(d=!0);let l=t.stringify(u,f,()=>c=null);s<r.length-1&&(l+=","),c&&(l+=n.lineComment(l,a,p(c))),!d&&(D.length>h||l.includes("\n"))&&(d=!0),D.push(l),h=D.length}const{start:g,end:m}=s;if(0===D.length)return g+m;if(!d){const e=D.reduce((e,t)=>e+t.length+2,2);d=o.options.lineWidth>0&&e>o.options.lineWidth}if(d){let e=g;for(const t of D)e+=t?`\n${c}${u}${t}`:"\n";return`${e}\n${u}${m}`}return`${g}${l}${D.join(" ")}${l}${m}`}function i({indent:e,options:{commentString:t}},r,o,i){if(o&&i&&(o=o.replace(/^\n+/,"")),o){const i=n.indentComment(t(o),e);r.push(i.trimStart())}}return Mt.stringifyCollection=function(e,t,n){return(t.inFlow??e.flow?o:r)(e,t,n)},Mt}function It(){if(Ot)return Nt;Ot=1;var e=jt(),t=Rt(),n=st(),r=Re(),o=Bt(),i=ot();function s(e,t){const n=r.isScalar(t)?t.value:t;for(const o of e)if(r.isPair(o)){if(o.key===t||o.key===n)return o;if(r.isScalar(o.key)&&o.key.value===n)return o}}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,s=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)&&s.items.push(o.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&&s.items.sort(e.sortMapEntries),s}add(e,t){let n;n=r.isPair(e)?e:e&&"object"==typeof e&&"key"in e?new o.Pair(e.key,e.value):new o.Pair(e,e?.value);const a=s(this.items,n.key),u=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(u){const e=this.items.findIndex(e=>u(n,e)<0);-1===e?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){const t=s(this.items,e);return!!t&&this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){const n=s(this.items,e),o=n?.value;return(!t&&r.isScalar(o)?o.value:o)??void 0}has(e){return!!s(this.items,e)}set(e,t){this.add(new o.Pair(e,t),!0)}toJSON(e,n,r){const o=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(o);for(const e of this.items)t.addPairToJSMap(n,o,e);return o}toString(t,n,o){if(!t)return JSON.stringify(this);for(const e of this.items)if(!r.isPair(e))throw new Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),e.stringifyCollection(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:o,onComment:n})}};return Nt.YAMLMap=a,Nt.findPair=s,Nt}function Ht(){if(Tt)return Lt;Tt=1;var e=Re(),t=It();const n={collection:"map",default:!0,nodeClass:t.YAMLMap,tag:"tag:yaml.org,2002:map",resolve:(t,n)=>(e.isMap(t)||n("Expected a mapping for this tag"),t),createNode:(e,n,r)=>t.YAMLMap.from(e,n,r)};return Lt.map=n,Lt}var zt,Kt,Ut={},qt={};function Gt(){if(zt)return qt;zt=1;var e=it(),t=jt(),n=st(),r=Re(),o=ot(),i=Ve();let s=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);return"number"==typeof t&&this.items.splice(t,1).length>0}get(e,t){const n=a(e);if("number"!=typeof n)return;const o=this.items[n];return!t&&r.isScalar(o)?o.value:o}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)&&o.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:o}=r,i=new this(t);if(n&&Symbol.iterator in Object(n)){let t=0;for(let s of n){if("function"==typeof o){const e=n instanceof Set?s:String(t++);s=o.call(n,e,s)}i.items.push(e.createNode(s,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 qt.YAMLSeq=s,qt}function Wt(){if(Kt)return Ut;Kt=1;var e=Re(),t=Gt();const n={collection:"seq",default:!0,nodeClass:t.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve:(t,n)=>(e.isSeq(t)||n("Expected a sequence for this tag"),t),createNode:(e,n,r)=>t.YAMLSeq.from(e,n,r)};return Ut.seq=n,Ut}var Zt,Vt={};function Jt(){if(Zt)return Vt;Zt=1;var e=bt();const t={identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:(t,n,r,o)=>(n=Object.assign({actualString:!0},n),e.stringifyString(t,n,r,o))};return Vt.string=t,Vt}var Yt,Qt={},Xt={};function en(){if(Yt)return Xt;Yt=1;var e=ot();const t={identify:e=>null==e,createNode:()=>new e.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new e.Scalar(null),stringify:({source:e},n)=>"string"==typeof e&&t.test.test(e)?e:n.options.nullStr};return Xt.nullTag=t,Xt}var tn,nn={};function rn(){if(tn)return nn;tn=1;var e=ot();const t={identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new e.Scalar("t"===t[0]||"T"===t[0]),stringify:({source:e,value:n},r)=>e&&t.test.test(e)&&n===("t"===e[0]||"T"===e[0])?e:n?r.options.trueStr:r.options.falseStr};return nn.boolTag=t,nn}var on,sn,an={},un={};function cn(){return on||(on=1,un.stringifyNumber=function({format:e,minFractionDigits:t,tag:n,value:r}){if("bigint"==typeof r)return String(r);const o="number"==typeof r?r:Number(r);if(!isFinite(o))return isNaN(o)?".nan":o<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}),un}function ln(){if(sn)return an;sn=1;var e=ot(),t=cn();const n={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?NaN:"-"===e[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:t.stringifyNumber},r={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const n=Number(e.value);return isFinite(n)?n.toExponential():t.stringifyNumber(e)}},o={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){const n=new e.Scalar(parseFloat(t)),r=t.indexOf(".");return-1!==r&&"0"===t[t.length-1]&&(n.minFractionDigits=t.length-r-1),n},stringify:t.stringifyNumber};return an.float=o,an.floatExp=r,an.floatNaN=n,an}var pn,fn={};function dn(){if(pn)return fn;pn=1;var e=cn();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,o){const{value:i}=n;return t(i)&&i>=0?o+i.toString(r):e.stringifyNumber(n)}const o={identify:e=>t(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,r)=>n(e,2,8,r),stringify:e=>r(e,8,"0o")},i={identify:t,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,r)=>n(e,0,10,r),stringify:e.stringifyNumber},s={identify:e=>t(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,r)=>n(e,2,16,r),stringify:e=>r(e,16,"0x")};return fn.int=i,fn.intHex=s,fn.intOct=o,fn}var hn,Dn={};var gn,mn={};var yn,bn={};function vn(){if(yn)return bn;yn=1;var e=w,t=ot(),n=bt();const r={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,n){if("function"==typeof e.Buffer)return e.Buffer.from(t,"base64");if("function"==typeof atob){const e=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(e.length);for(let t=0;t<e.length;++t)n[t]=e.charCodeAt(t);return n}return n("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:r,type:o,value:i},s,a,u){if(!i)return"";const c=i;let l;if("function"==typeof e.Buffer)l=c instanceof e.Buffer?c.toString("base64"):e.Buffer.from(c.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<c.length;++t)e+=String.fromCharCode(c[t]);l=btoa(e)}}if(o??(o=t.Scalar.BLOCK_LITERAL),o!==t.Scalar.QUOTE_DOUBLE){const e=Math.max(s.options.lineWidth-s.indent.length,s.options.minContentWidth),n=Math.ceil(l.length/e),r=new Array(n);for(let t=0,o=0;t<n;++t,o+=e)r[t]=l.substr(o,e);l=r.join(o===t.Scalar.BLOCK_LITERAL?"\n":" ")}return n.stringifyString({comment:r,type:o,value:l},s,a,u)}};return bn.binary=r,bn}var En,Fn,Cn={},wn={};function _n(){if(En)return wn;En=1;var e=Re(),t=Bt(),n=ot(),r=Gt();function o(r,o){if(e.isSeq(r))for(let i=0;i<r.items.length;++i){let s=r.items[i];if(!e.isPair(s)){if(e.isMap(s)){s.items.length>1&&o("Each pair must have its own sequence indicator");const e=s.items[0]||new t.Pair(new n.Scalar(null));if(s.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${s.commentBefore}\n${e.key.commentBefore}`:s.commentBefore),s.comment){const t=e.value??e.key;t.comment=t.comment?`${s.comment}\n${t.comment}`:s.comment}s=e}r.items[i]=e.isPair(s)?s:new t.Pair(s)}}else o("Expected a sequence for this tag");return r}function i(e,n,o){const{replacer:i}=o,s=new r.YAMLSeq(e);s.tag="tag:yaml.org,2002:pairs";let a=0;if(n&&Symbol.iterator in Object(n))for(let e of n){let r,u;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],u=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],u=e[r]}else r=e;s.items.push(t.createPair(r,u,o))}return s}const s={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:o,createNode:i};return wn.createPairs=i,wn.pairs=s,wn.resolvePairs=o,wn}function An(){if(Fn)return Cn;Fn=1;var e=Re(),t=Ve(),n=It(),r=Gt(),o=_n();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 o=new Map;r?.onCreate&&r.onCreate(o);for(const n of this.items){let i,s;if(e.isPair(n)?(i=t.toJS(n.key,"",r),s=t.toJS(n.value,i,r)):i=t.toJS(n,"",r),o.has(i))throw new Error("Ordered maps must not include duplicate keys");o.set(i,s)}return o}static from(e,t,n){const r=o.createPairs(e,t,n),i=new this;return i.items=r.items,i}}i.tag="tag:yaml.org,2002:omap";const s={collection:"seq",identify:e=>e instanceof Map,nodeClass:i,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,n){const r=o.resolvePairs(t,n),s=[];for(const{key:t}of r.items)e.isScalar(t)&&(s.includes(t.value)?n(`Ordered maps must not include duplicate keys: ${t.value}`):s.push(t.value));return Object.assign(new i,r)},createNode:(e,t,n)=>i.from(e,t,n)};return Cn.YAMLOMap=i,Cn.omap=s,Cn}var Sn,kn={},Pn={};var Rn,Bn={};var xn,On,Tn={},$n={};function Ln(){if(On)return $n;On=1;var e=Re(),t=Bt(),n=It();class r extends n.YAMLMap{constructor(e){super(e),this.tag=r.tag}add(r){let o;o=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,o.key)||this.items.push(o)}get(t,r){const o=n.findPair(this.items,t);return!r&&e.isPair(o)?e.isScalar(o.key)?o.key.value:o.key:o}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 o=n.findPair(this.items,e);o&&!r?this.items.splice(this.items.indexOf(o),1):!o&&r&&this.items.push(new t.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,n,r){const{replacer:o}=r,i=new this(e);if(n&&Symbol.iterator in Object(n))for(let e of n)"function"==typeof o&&(e=o.call(n,e,e)),i.items.push(t.createPair(e,null,r));return i}}r.tag="tag:yaml.org,2002:set";const o={collection:"map",identify:e=>e instanceof Set,nodeClass:r,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>r.from(e,t,n),resolve(t,n){if(e.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new r,t);n("Set items must all have null values")}else n("Expected a mapping for this tag");return t}};return $n.YAMLSet=r,$n.set=o,$n}var Nn,Mn,jn,In,Hn={};function zn(){if(Nn)return Hn;Nn=1;var e=cn();function t(e,t){const n=e[0],r="-"===n||"+"===n?e.substring(1):e,o=e=>t?BigInt(e):Number(e),i=r.replace(/_/g,"").split(":").reduce((e,t)=>e*o(60)+o(t),o(0));return"-"===n?o(-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 o="";n<0&&(o="-",n*=r(-1));const i=r(60),s=[n%i];return n<60?s.unshift(0):(n=(n-s[0])/i,s.unshift(n%i),n>=60&&(n=(n-s[0])/i,s.unshift(n))),o+s.map(e=>String(e).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const r={identify:e=>"bigint"==typeof e||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,n,{intAsBigInt:r})=>t(e,r),stringify:n},o={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>t(e,!1),stringify:n},i={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const n=e.match(i.test);if(!n)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,r,o,s,a,u,c]=n.map(Number),l=n[7]?Number((n[7]+"00").substr(1,3)):0;let p=Date.UTC(r,o-1,s,a||0,u||0,c||0,l);const f=n[8];if(f&&"Z"!==f){let e=t(f,!1);Math.abs(e)<30&&(e*=60),p-=6e4*e}return new Date(p)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};return Hn.floatTime=o,Hn.intTime=r,Hn.timestamp=i,Hn}function Kn(){if(Mn)return kn;Mn=1;var e=Ht(),t=en(),n=Wt(),r=Jt(),o=vn(),i=function(){if(Sn)return Pn;Sn=1;var e=ot();function t({value:e,source:t},o){return t&&(e?n:r).test.test(t)?t:e?o.options.trueStr:o.options.falseStr}const n={identify:e=>!0===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new e.Scalar(!0),stringify:t},r={identify:e=>!1===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new e.Scalar(!1),stringify:t};return Pn.falseTag=r,Pn.trueTag=n,Pn}(),s=function(){if(Rn)return Bn;Rn=1;var e=ot(),t=cn();const n={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?NaN:"-"===e[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:t.stringifyNumber},r={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const n=Number(e.value);return isFinite(n)?n.toExponential():t.stringifyNumber(e)}},o={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){const n=new e.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(-1!==r){const e=t.substring(r+1).replace(/_/g,"");"0"===e[e.length-1]&&(n.minFractionDigits=e.length)}return n},stringify:t.stringifyNumber};return Bn.float=o,Bn.floatExp=r,Bn.floatNaN=n,Bn}(),a=function(){if(xn)return Tn;xn=1;var e=cn();const t=e=>"bigint"==typeof e||Number.isInteger(e);function n(e,t,n,{intAsBigInt:r}){const o=e[0];if("-"!==o&&"+"!==o||(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"-"===o?BigInt(-1)*t:t}const i=parseInt(e,n);return"-"===o?-1*i:i}function r(n,r,o){const{value:i}=n;if(t(i)){const e=i.toString(r);return i<0?"-"+o+e.substr(1):o+e}return e.stringifyNumber(n)}const o={identify:t,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,r)=>n(e,2,2,r),stringify:e=>r(e,2,"0b")},i={identify:t,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,r)=>n(e,1,8,r),stringify:e=>r(e,8,"0")},s={identify:t,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,r)=>n(e,0,10,r),stringify:e.stringifyNumber},a={identify:t,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,r)=>n(e,2,16,r),stringify:e=>r(e,16,"0x")};return Tn.int=s,Tn.intBin=o,Tn.intHex=a,Tn.intOct=i,Tn}(),u=Pt(),c=An(),l=_n(),p=Ln(),f=zn();const d=[e.map,n.seq,r.string,t.nullTag,i.trueTag,i.falseTag,a.intBin,a.intOct,a.int,a.intHex,s.floatNaN,s.floatExp,s.float,o.binary,u.merge,c.omap,l.pairs,p.set,f.intTime,f.floatTime,f.timestamp];return kn.schema=d,kn}function Un(){if(jn)return Qt;jn=1;var e=Ht(),t=en(),n=Wt(),r=Jt(),o=rn(),i=ln(),s=dn(),a=function(){if(hn)return Dn;hn=1;var e=Ht(),t=en(),n=Wt(),r=Jt(),o=rn(),i=ln(),s=dn();const a=[e.map,n.seq,r.string,t.nullTag,o.boolTag,s.intOct,s.int,s.intHex,i.floatNaN,i.floatExp,i.float];return Dn.schema=a,Dn}(),u=function(){if(gn)return mn;gn=1;var e=ot(),t=Ht(),n=Wt();function r(e){return"bigint"==typeof e||Number.isInteger(e)}const o=({value:e})=>JSON.stringify(e),i=[{identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:o},{identify:e=>null==e,createNode:()=>new e.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:o},{identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>"true"===e,stringify:o},{identify:r,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>r(e)?e.toString():JSON.stringify(e)},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:o}],s={default:!0,tag:"",test:/^/,resolve:(e,t)=>(t(`Unresolved plain scalar ${JSON.stringify(e)}`),e)},a=[t.map,n.seq].concat(i,s);return mn.schema=a,mn}(),c=vn(),l=Pt(),p=An(),f=_n(),d=Kn(),h=Ln(),D=zn();const g=new Map([["core",a.schema],["failsafe",[e.map,n.seq,r.string]],["json",u.schema],["yaml11",d.schema],["yaml-1.1",d.schema]]),m={binary:c.binary,bool:o.boolTag,float:i.float,floatExp:i.floatExp,floatNaN:i.floatNaN,floatTime:D.floatTime,int:s.int,intHex:s.intHex,intOct:s.intOct,intTime:D.intTime,map:e.map,merge:l.merge,null:t.nullTag,omap:p.omap,pairs:f.pairs,seq:n.seq,set:h.set,timestamp:D.timestamp},y={"tag:yaml.org,2002:binary":c.binary,"tag:yaml.org,2002:merge":l.merge,"tag:yaml.org,2002:omap":p.omap,"tag:yaml.org,2002:pairs":f.pairs,"tag:yaml.org,2002:set":h.set,"tag:yaml.org,2002:timestamp":D.timestamp};return Qt.coreKnownTags=y,Qt.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 o=r;if(!o){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`)}o=[]}if(Array.isArray(e))for(const t of e)o=o.concat(t);else"function"==typeof e&&(o=e(o.slice()));return n&&(o=o.concat(l.merge)),o.reduce((e,t)=>{const n="string"==typeof t?m[t]:t;if(!n){const e=JSON.stringify(t),n=Object.keys(m).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},[])},Qt}function qn(){if(In)return $t;In=1;var e=Re(),t=Ht(),n=Wt(),r=Jt(),o=Un();const i=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;return $t.Schema=class s{constructor({compat:s,customTags:a,merge:u,resolveKnownTags:c,schema:l,sortMapEntries:p,toStringDefaults:f}){this.compat=Array.isArray(s)?o.getTags(s,"compat"):s?o.getTags(null,s):null,this.name="string"==typeof l&&l||"core",this.knownTags=c?o.coreKnownTags:{},this.tags=o.getTags(a,this.name,u),this.toStringOptions=f??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 p?p:!0===p?i:null}clone(){const e=Object.create(s.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}},$t}var Gn,Wn,Zn={};function Vn(){if(Wn)return Ne;Wn=1;var e=Ye(),t=st(),n=Re(),r=Bt(),o=Ve(),i=qn(),s=function(){if(Gn)return Zn;Gn=1;var e=Re(),t=vt(),n=ft();return Zn.stringifyDocument=function(r,o){const i=[];let s=!0===o.directives;if(!1!==o.directives&&r.directives){const e=r.directives.toString(r);e?(i.push(e),s=!0):r.directives.docStart&&(s=!0)}s&&i.push("---");const a=t.createStringifyContext(r,o),{commentString:u}=a.options;if(r.commentBefore){1!==i.length&&i.unshift("");const e=u(r.commentBefore);i.unshift(n.indentComment(e,""))}let c=!1,l=null;if(r.contents){if(e.isNode(r.contents)){if(r.contents.spaceBefore&&s&&i.push(""),r.contents.commentBefore){const e=u(r.contents.commentBefore);i.push(n.indentComment(e,""))}a.forceBlockIndent=!!r.comment,l=r.contents.comment}const o=l?void 0:()=>c=!0;let p=t.stringify(r.contents,a,()=>l=null,o);l&&(p+=n.lineComment(p,"",u(l))),"|"!==p[0]&&">"!==p[0]||"---"!==i[i.length-1]?i.push(p):i[i.length-1]=`--- ${p}`}else i.push(t.stringify(r.contents,a));if(r.directives?.docEnd)if(r.comment){const e=u(r.comment);e.includes("\n")?(i.push("..."),i.push(n.indentComment(e,""))):i.push(`... ${e}`)}else i.push("...");else{let e=r.comment;e&&c&&(e=e.replace(/^\n+/,"")),e&&(c&&!l||""===i[i.length-1]||i.push(""),i.push(n.indentComment(u(e),"")))}return i.join("\n")+"\n"},Zn}(),a=Ie(),u=Ue(),c=it(),l=$e();function p(e){if(n.isCollection(e))return!0;throw new Error("Expected a YAML collection as document contents")}return Ne.Document=class f{constructor(e,t,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,n.NODE_TYPE,{value:n.DOC});let o=null;"function"==typeof t||Array.isArray(t)?o=t:void 0===r&&t&&(r=t,t=void 0);const i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=i;let{version:s}=i;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new l.Directives({version:s}),this.setSchema(s,r),this.contents=void 0===e?null:this.createNode(e,o,r)}clone(){const e=Object.create(f.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){p(this.contents)&&this.contents.add(e)}addIn(e,t){p(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 o;if("function"==typeof t)e=t.call({"":e},"",e),o=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)),o=t}else void 0===r&&t&&(r=t,t=void 0);const{aliasDuplicateObjects:i,anchorPrefix:s,flow:u,keepUndefined:l,onTagObj:p,tag:f}=r??{},{onAnchor:d,setAnchors:h,sourceObjects:D}=a.createNodeAnchors(this,s||"a"),g={aliasDuplicateObjects:i??!0,keepUndefined:l??!1,onAnchor:d,onTagObj:p,replacer:o,schema:this.schema,sourceObjects:D},m=c.createNode(e,f,g);return u&&n.isCollection(m)&&(m.flow=!0),h(),m}createPair(e,t,n={}){const o=this.createNode(e,null,n),i=this.createNode(t,null,n);return new r.Pair(o,i)}delete(e){return!!p(this.contents)&&this.contents.delete(e)}deleteIn(e){return t.isEmptyPath(e)?null!=this.contents&&(this.contents=null,!0):!!p(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):p(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):p(this.contents)&&this.contents.setIn(e,n)}setSchema(e,t={}){let n;switch("number"==typeof e&&(e=String(e)),e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new l.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new l.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{const t=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else{if(!n)throw new Error("With a null YAML version, the { schema: Schema } option is required");this.schema=new i.Schema(Object.assign(n,t))}}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:s}={}){const a={anchors:new Map,doc:this,keep:!e,mapAsMap:!0===n,mapKeyWarned:!1,maxAliasCount:"number"==typeof r?r:100},c=o.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 s?u.applyReviver(s,{"":c},"",c):c}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return s.stringifyDocument(this,e)}},Ne}var Jn,Yn={};function Qn(){if(Jn)return Yn;Jn=1;class e extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}}return Yn.YAMLError=e,Yn.YAMLParseError=class extends e{constructor(e,t,n){super("YAMLParseError",e,t,n)}},Yn.YAMLWarning=class extends e{constructor(e,t,n){super("YAMLWarning",e,t,n)}},Yn.prettifyError=(e,t)=>n=>{if(-1===n.pos[0])return;n.linePos=n.pos.map(e=>t.linePos(e));const{line:r,col:o}=n.linePos[0];n.message+=` at line ${r}, column ${o}`;let i=o-1,s=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(i>=60&&s.length>80){const e=Math.min(i-39,s.length-79);s="…"+s.substring(e),i-=e-1}if(s.length>80&&(s=s.substring(0,79)+"…"),r>1&&/^ *$/.test(s.substring(0,i))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+"…\n"),s=n+s}if(/[^ ]/.test(s)){let e=1;const t=n.linePos[1];t&&t.line===r&&t.col>o&&(e=Math.max(1,Math.min(t.col-o,80-i)));const a=" ".repeat(i)+"^".repeat(e);n.message+=`:\n\n${s}\n${a}\n`}},Yn}var Xn,er={},tr={},nr={},rr={},or={};function ir(){return Xn||(Xn=1,or.resolveProps=function(e,{flow:t,indicator:n,next:r,offset:o,onError:i,parentIndent:s,startOnNewline:a}){let u=!1,c=a,l=a,p="",f="",d=!1,h=!1,D=null,g=null,m=null,y=null,b=null,v=null,E=null;for(const o of e)switch(h&&("space"!==o.type&&"newline"!==o.type&&"comma"!==o.type&&i(o.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h=!1),D&&(c&&"comment"!==o.type&&"newline"!==o.type&&i(D,"TAB_AS_INDENT","Tabs are not allowed as indentation"),D=null),o.type){case"space":t||"doc-start"===n&&"flow-collection"===r?.type||!o.source.includes("\t")||(D=o),l=!0;break;case"comment":{l||i(o,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const e=o.source.substring(1)||" ";p?p+=f+e:p=e,f="",c=!1;break}case"newline":c?p?p+=o.source:v&&"seq-item-ind"===n||(u=!0):f+=o.source,c=!0,d=!0,(g||m)&&(y=o),l=!0;break;case"anchor":g&&i(o,"MULTIPLE_ANCHORS","A node can have at most one anchor"),o.source.endsWith(":")&&i(o.offset+o.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=o,E??(E=o.offset),c=!1,l=!1,h=!0;break;case"tag":m&&i(o,"MULTIPLE_TAGS","A node can have at most one tag"),m=o,E??(E=o.offset),c=!1,l=!1,h=!0;break;case n:(g||m)&&i(o,"BAD_PROP_ORDER",`Anchors and tags must be after the ${o.source} indicator`),v&&i(o,"UNEXPECTED_TOKEN",`Unexpected ${o.source} in ${t??"collection"}`),v=o,c="seq-item-ind"===n||"explicit-key-ind"===n,l=!1;break;case"comma":if(t){b&&i(o,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),b=o,c=!1,l=!1;break}default:i(o,"UNEXPECTED_TOKEN",`Unexpected ${o.type} token`),c=!1,l=!1}const F=e[e.length-1],C=F?F.offset+F.source.length:o;return h&&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"),D&&(c&&D.indent<=s||"block-map"===r?.type||"block-seq"===r?.type)&&i(D,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:v,spaceBefore:u,comment:p,hasNewline:d,anchor:g,tag:m,newlineAfterProp:y,end:C,start:E??C}}),or}var sr,ar={};function ur(){return sr||(sr=1,ar.containsNewline=function e(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes("\n"))return!0;if(t.end)for(const e of t.end)if("newline"===e.type)return!0;return!1;case"flow-collection":for(const n of t.items){for(const e of n.start)if("newline"===e.type)return!0;if(n.sep)for(const e of n.sep)if("newline"===e.type)return!0;if(e(n.key)||e(n.value))return!0}return!1;default:return!0}}),ar}var cr,lr={};function pr(){if(cr)return lr;cr=1;var e=ur();return lr.flowIndentCheck=function(t,n,r){if("flow-collection"===n?.type){const o=n.end[0];o.indent!==t||"]"!==o.source&&"}"!==o.source||!e.containsNewline(n)||r(o,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}},lr}var fr,dr,hr={};function Dr(){if(fr)return hr;fr=1;var e=Re();return hr.mapIncludes=function(t,n,r){const{uniqueKeys:o}=t.options;if(!1===o)return!1;const i="function"==typeof o?o:(t,n)=>t===n||e.isScalar(t)&&e.isScalar(n)&&t.value===n.value;return n.some(e=>i(e.key,r))},hr}var gr,mr={};var yr,br,vr,Er={},Fr={};function Cr(){return yr||(yr=1,Fr.resolveEnd=function(e,t,n,r){let o="";if(e){let i=!1,s="";for(const a of e){const{source:e,type:u}=a;switch(u){case"space":i=!0;break;case"comment":{n&&!i&&r(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const t=e.substring(1)||" ";o?o+=s+t:o=t,s="";break}case"newline":o&&(s+=e),i=!0;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${u} at node end`)}t+=e.length}}return{comment:o,offset:t}}),Fr}function wr(){if(vr)return nr;vr=1;var e=Re(),t=ot(),n=It(),r=Gt(),o=function(){if(dr)return rr;dr=1;var e=Bt(),t=It(),n=ir(),r=ur(),o=pr(),i=Dr();const s="All mapping items must start at the same column";return rr.resolveBlockMap=function({composeNode:a,composeEmptyNode:u},c,l,p,f){const d=new(f?.nodeClass??t.YAMLMap)(c.schema);c.atRoot&&(c.atRoot=!1);let h=l.offset,D=null;for(const t of l.items){const{start:f,key:g,sep:m,value:y}=t,b=n.resolveProps(f,{indicator:"explicit-key-ind",next:g??m?.[0],offset:h,onError:p,parentIndent:l.indent,startOnNewline:!0}),v=!b.found;if(v){if(g&&("block-seq"===g.type?p(h,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in g&&g.indent!==l.indent&&p(h,"BAD_INDENT",s)),!b.anchor&&!b.tag&&!m){D=b.end,b.comment&&(d.comment?d.comment+="\n"+b.comment:d.comment=b.comment);continue}(b.newlineAfterProp||r.containsNewline(g))&&p(g??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else b.found?.indent!==l.indent&&p(h,"BAD_INDENT",s);c.atKey=!0;const E=b.end,F=g?a(c,g,b,p):u(c,E,f,null,b,p);c.schema.compat&&o.flowIndentCheck(l.indent,g,p),c.atKey=!1,i.mapIncludes(c,d.items,F)&&p(E,"DUPLICATE_KEY","Map keys must be unique");const C=n.resolveProps(m??[],{indicator:"map-value-ind",next:y,offset:F.range[2],onError:p,parentIndent:l.indent,startOnNewline:!g||"block-scalar"===g.type});if(h=C.end,C.found){v&&("block-map"!==y?.type||C.hasNewline||p(h,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),c.options.strict&&b.start<C.found.offset-1024&&p(F.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const n=y?a(c,y,C,p):u(c,h,m,null,C,p);c.schema.compat&&o.flowIndentCheck(l.indent,y,p),h=n.range[2];const r=new e.Pair(F,n);c.options.keepSourceTokens&&(r.srcToken=t),d.items.push(r)}else{v&&p(F.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),C.comment&&(F.comment?F.comment+="\n"+C.comment:F.comment=C.comment);const n=new e.Pair(F);c.options.keepSourceTokens&&(n.srcToken=t),d.items.push(n)}}return D&&D<h&&p(D,"IMPOSSIBLE","Map comment with trailing content"),d.range=[l.offset,h,D??h],d},rr}(),i=function(){if(gr)return mr;gr=1;var e=Gt(),t=ir(),n=pr();return mr.resolveBlockSeq=function({composeNode:r,composeEmptyNode:o},i,s,a,u){const c=new(u?.nodeClass??e.YAMLSeq)(i.schema);i.atRoot&&(i.atRoot=!1),i.atKey&&(i.atKey=!1);let l=s.offset,p=null;for(const{start:e,value:u}of s.items){const f=t.resolveProps(e,{indicator:"seq-item-ind",next:u,offset:l,onError:a,parentIndent:s.indent,startOnNewline:!0});if(!f.found){if(!(f.anchor||f.tag||u)){p=f.end,f.comment&&(c.comment=f.comment);continue}u&&"block-seq"===u.type?a(f.end,"BAD_INDENT","All sequence items must start at the same column"):a(l,"MISSING_CHAR","Sequence item without - indicator")}const d=u?r(i,u,f,a):o(i,f.end,e,null,f,a);i.schema.compat&&n.flowIndentCheck(s.indent,u,a),l=d.range[2],c.items.push(d)}return c.range=[s.offset,l,p??l],c},mr}(),s=function(){if(br)return Er;br=1;var e=Re(),t=Bt(),n=It(),r=Gt(),o=Cr(),i=ir(),s=ur(),a=Dr();const u="Block collections are not allowed within flow collections",c=e=>e&&("block-map"===e.type||"block-seq"===e.type);return Er.resolveFlowCollection=function({composeNode:l,composeEmptyNode:p},f,d,h,D){const g="{"===d.start.source,m=g?"flow map":"flow sequence",y=new(D?.nodeClass??(g?n.YAMLMap:r.YAMLSeq))(f.schema);y.flow=!0;const b=f.atRoot;b&&(f.atRoot=!1),f.atKey&&(f.atKey=!1);let v=d.offset+d.start.source.length;for(let r=0;r<d.items.length;++r){const o=d.items[r],{start:D,key:b,sep:E,value:F}=o,C=i.resolveProps(D,{flow:m,indicator:"explicit-key-ind",next:b??E?.[0],offset:v,onError:h,parentIndent:d.indent,startOnNewline:!1});if(!C.found){if(!(C.anchor||C.tag||E||F)){0===r&&C.comma?h(C.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${m}`):r<d.items.length-1&&h(C.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${m}`),C.comment&&(y.comment?y.comment+="\n"+C.comment:y.comment=C.comment),v=C.end;continue}!g&&f.options.strict&&s.containsNewline(b)&&h(b,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(0===r)C.comma&&h(C.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${m}`);else if(C.comma||h(C.start,"MISSING_CHAR",`Missing , between ${m} items`),C.comment){let t="";e:for(const e of D)switch(e.type){case"comma":case"space":break;case"comment":t=e.source.substring(1);break e;default:break e}if(t){let n=y.items[y.items.length-1];e.isPair(n)&&(n=n.value??n.key),n.comment?n.comment+="\n"+t:n.comment=t,C.comment=C.comment.substring(t.length+1)}}if(g||E||C.found){f.atKey=!0;const e=C.end,r=b?l(f,b,C,h):p(f,e,D,null,C,h);c(b)&&h(r.range,"BLOCK_IN_FLOW",u),f.atKey=!1;const s=i.resolveProps(E??[],{flow:m,indicator:"map-value-ind",next:F,offset:r.range[2],onError:h,parentIndent:d.indent,startOnNewline:!1});if(s.found){if(!g&&!C.found&&f.options.strict){if(E)for(const e of E){if(e===s.found)break;if("newline"===e.type){h(e,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}C.start<s.found.offset-1024&&h(s.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else F&&("source"in F&&F.source&&":"===F.source[0]?h(F,"MISSING_CHAR",`Missing space after : in ${m}`):h(s.start,"MISSING_CHAR",`Missing , or : between ${m} items`));const w=F?l(f,F,s,h):s.found?p(f,s.end,E,null,s,h):null;w?c(F)&&h(w.range,"BLOCK_IN_FLOW",u):s.comment&&(r.comment?r.comment+="\n"+s.comment:r.comment=s.comment);const _=new t.Pair(r,w);if(f.options.keepSourceTokens&&(_.srcToken=o),g){const t=y;a.mapIncludes(f,t.items,r)&&h(e,"DUPLICATE_KEY","Map keys must be unique"),t.items.push(_)}else{const e=new n.YAMLMap(f.schema);e.flow=!0,e.items.push(_);const t=(w??r).range;e.range=[r.range[0],t[1],t[2]],y.items.push(e)}v=w?w.range[2]:s.end}else{const e=F?l(f,F,C,h):p(f,C.end,E,null,C,h);y.items.push(e),v=e.range[2],c(F)&&h(e.range,"BLOCK_IN_FLOW",u)}}const E=g?"}":"]",[F,...C]=d.end;let w=v;if(F&&F.source===E)w=F.offset+F.source.length;else{const e=m[0].toUpperCase()+m.substring(1);h(v,b?"MISSING_CHAR":"BAD_INDENT",b?`${e} must end with a ${E}`:`${e} in block collection must be sufficiently indented and end with a ${E}`),F&&1!==F.source.length&&C.unshift(F)}if(C.length>0){const e=o.resolveEnd(C,w,f.options.strict,h);e.comment&&(y.comment?y.comment+="\n"+e.comment:y.comment=e.comment),y.range=[d.offset,w,e.offset]}else y.range=[d.offset,w,w];return y},Er}();function a(e,t,n,r,a,u){const c="block-map"===n.type?o.resolveBlockMap(e,t,n,r,u):"block-seq"===n.type?i.resolveBlockSeq(e,t,n,r,u):s.resolveFlowCollection(e,t,n,r,u),l=c.constructor;return"!"===a||a===l.tagName?(c.tag=l.tagName,c):(a&&(c.tag=a),c)}return nr.composeCollection=function(o,i,s,u,c){const l=u.tag,p=l?i.directives.tagName(l.source,e=>c(l,"TAG_RESOLVE_FAILED",e)):null;if("block-seq"===s.type){const{anchor:e,newlineAfterProp:t}=u,n=e&&l?e.offset>l.offset?e:l:e??l;n&&(!t||t.offset<n.offset)&&c(n,"MISSING_CHAR","Missing newline after block sequence props")}const f="block-map"===s.type?"map":"block-seq"===s.type?"seq":"{"===s.start.source?"map":"seq";if(!l||!p||"!"===p||p===n.YAMLMap.tagName&&"map"===f||p===r.YAMLSeq.tagName&&"seq"===f)return a(o,i,s,c,p);let d=i.schema.tags.find(e=>e.tag===p&&e.collection===f);if(!d){const e=i.schema.knownTags[p];if(!e||e.collection!==f)return e?c(l,"BAD_COLLECTION_TYPE",`${e.tag} used for ${f} collection, but expects ${e.collection??"scalar"}`,!0):c(l,"TAG_RESOLVE_FAILED",`Unresolved tag: ${p}`,!0),a(o,i,s,c,p);i.schema.tags.push(Object.assign({},e,{default:!1})),d=e}const h=a(o,i,s,c,p,d),D=d.resolve?.(h,e=>c(l,"TAG_RESOLVE_FAILED",e),i.options)??h,g=e.isNode(D)?D:new t.Scalar(D);return g.range=h.range,g.tag=p,d?.format&&(g.format=d.format),g},nr}var _r,Ar={},Sr={};function kr(){if(_r)return Sr;_r=1;var e=ot();return Sr.resolveBlockScalar=function(t,n,r){const o=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:o}=t[0],i=o[0];let s=0,a="",u=-1;for(let t=1;t<o.length;++t){const n=o[t];if(a||"-"!==n&&"+"!==n){const r=Number(n);!s&&r?s=r:-1===u&&(u=e+t)}else a=n}-1!==u&&r(u,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${o}`);let c=!1,l="",p=o.length;for(let e=1;e<t.length;++e){const o=t[e];switch(o.type){case"space":c=!0;case"newline":p+=o.source.length;break;case"comment":n&&!c&&r(o,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),p+=o.source.length,l=o.source.substring(1);break;case"error":r(o,"UNEXPECTED_TOKEN",o.message),p+=o.source.length;break;default:{r(o,"UNEXPECTED_TOKEN",`Unexpected token in block scalar header: ${o.type}`);const e=o.source;e&&"string"==typeof e&&(p+=e.length)}}}return{mode:i,indent:s,chomp:a,comment:l,length:p}}(n,t.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[o,o,o]};const s=">"===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(/^( *)/),o=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let e=1;e<t.length;e+=2)o.push([t[e],t[e+1]]);return o}(n.source):[];let u=a.length;for(let e=a.length-1;e>=0;--e){const t=a[e][1];if(""!==t&&"\r"!==t)break;u=e}if(0===u){const e="+"===i.chomp&&a.length>0?"\n".repeat(Math.max(1,a.length-1)):"";let t=o+i.length;return n.source&&(t+=n.source.length),{value:e,type:s,comment:i.comment,range:[o,t,t]}}let c=n.indent+i.indent,l=n.offset+i.length,p=0;for(let e=0;e<u;++e){const[n,o]=a[e];if(""!==o&&"\r"!==o){if(n.length<c){const e="Block scalars with more-indented leading empty lines must use an explicit indentation indicator";r(l+n.length,"MISSING_CHAR",e)}0===i.indent&&(c=n.length),p=e,0!==c||t.atRoot||r(l,"BAD_INDENT","Block scalar values in collections must be indented");break}0===i.indent&&n.length>c&&(c=n.length),l+=n.length+o.length+1}for(let e=a.length-1;e>=u;--e)a[e][0].length>c&&(u=e+1);let f="",d="",h=!1;for(let e=0;e<p;++e)f+=a[e][0].slice(c)+"\n";for(let t=p;t<u;++t){let[n,o]=a[t];l+=n.length+o.length+1;const u="\r"===o[o.length-1];if(u&&(o=o.slice(0,-1)),o&&n.length<c){const e="Block scalar lines must not be less indented than their "+(i.indent?"explicit indentation indicator":"first line");r(l-o.length-(u?2:1),"BAD_INDENT",e),n=""}s===e.Scalar.BLOCK_LITERAL?(f+=d+n.slice(c)+o,d="\n"):n.length>c||"\t"===o[0]?(" "===d?d="\n":h||"\n"!==d||(d="\n\n"),f+=d+n.slice(c)+o,d="\n",h=!0):""===o?"\n"===d?f+="\n":d="\n":(f+=d+o,d=" ",h=!1)}switch(i.chomp){case"-":break;case"+":for(let e=u;e<a.length;++e)f+="\n"+a[e][0].slice(c);"\n"!==f[f.length-1]&&(f+="\n");break;default:f+="\n"}const D=o+i.length+n.source.length;return{value:f,type:s,comment:i.comment,range:[o,D,D]}},Sr}var Pr,Rr,Br={};function xr(){if(Pr)return Br;Pr=1;var e=ot(),t=Cr();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 o=r[1],i=" ",s=t.lastIndex;for(n.lastIndex=s;r=n.exec(e);)""===r[1]?"\n"===i?o+=i:i="\n":(o+=i+r[1],i=" "),s=n.lastIndex;const a=/[ \t]*(.*)/sy;return a.lastIndex=s,r=a.exec(e),o+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 o={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 o=e.substr(t,n),i=o.length===n&&/^[0-9a-fA-F]+$/.test(o)?parseInt(o,16):NaN;if(isNaN(i)){const o=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),o}return String.fromCodePoint(i)}return Br.resolveFlowScalar=function(s,a,u){const{offset:c,type:l,source:p,end:f}=s;let d,h;const D=(e,t,n)=>u(c+e,t,n);switch(l){case"scalar":d=e.Scalar.PLAIN,h=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]}`}return r&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),n(e)}(p,D);break;case"single-quoted-scalar":d=e.Scalar.QUOTE_SINGLE,h=function(e,t){return"'"===e[e.length-1]&&1!==e.length||t(e.length,"MISSING_CHAR","Missing closing 'quote"),n(e.slice(1,-1)).replace(/''/g,"'")}(p,D);break;case"double-quoted-scalar":d=e.Scalar.QUOTE_DOUBLE,h=function(e,t){let n="";for(let s=1;s<e.length-1;++s){const a=e[s];if("\r"!==a||"\n"!==e[s+1])if("\n"===a){const{fold:t,offset:o}=r(e,s);n+=t,s=o}else if("\\"===a){let r=e[++s];const a=o[r];if(a)n+=a;else if("\n"===r)for(r=e[s+1];" "===r||"\t"===r;)r=e[1+ ++s];else if("\r"===r&&"\n"===e[s+1])for(r=e[1+ ++s];" "===r||"\t"===r;)r=e[1+ ++s];else if("x"===r||"u"===r||"U"===r){const o={x:2,u:4,U:8}[r];n+=i(e,s+1,o,t),s+=o}else{const r=e.substr(s-1,2);t(s-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${r}`),n+=r}}else if(" "===a||"\t"===a){const t=s;let r=e[s+1];for(;" "===r||"\t"===r;)r=e[1+ ++s];"\n"===r||"\r"===r&&"\n"===e[s+2]||(n+=s>t?e.slice(t,s+1):a)}else n+=a}return'"'===e[e.length-1]&&1!==e.length||t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}(p,D);break;default:return u(s,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${l}`),{value:"",type:null,comment:"",range:[c,c+p.length,c+p.length]}}const g=c+p.length,m=t.resolveEnd(f,g,a,u);return{value:h,type:d,comment:m.comment,range:[c,g,m.offset]}},Br}var Or,Tr,$r,Lr,Nr={};function Mr(){if(Tr)return tr;Tr=1;var e=Ye(),t=Re(),n=wr(),r=function(){if(Rr)return Ar;Rr=1;var e=Re(),t=ot(),n=kr(),r=xr();return Ar.composeScalar=function(o,i,s,a){const{value:u,type:c,comment:l,range:p}="block-scalar"===i.type?n.resolveBlockScalar(o,i,a):r.resolveFlowScalar(i,o.options.strict,a),f=s?o.directives.tagName(s.source,e=>a(s,"TAG_RESOLVE_FAILED",e)):null;let d,h;d=o.options.stringKeys&&o.atKey?o.schema[e.SCALAR]:f?function(t,n,r,o,i){if("!"===r)return t[e.SCALAR];const s=[];for(const e of t.tags)if(!e.collection&&e.tag===r){if(!e.default||!e.test)return e;s.push(e)}for(const e of s)if(e.test?.test(n))return e;const a=t.knownTags[r];return a&&!a.collection?(t.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(i(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,"tag:yaml.org,2002:str"!==r),t[e.SCALAR])}(o.schema,u,f,s,a):"scalar"===i.type?function({atKey:t,directives:n,schema:r},o,i,s){const a=r.tags.find(e=>(!0===e.default||t&&"key"===e.default)&&e.test?.test(o))||r[e.SCALAR];if(r.compat){const t=r.compat.find(e=>e.default&&e.test?.test(o))??r[e.SCALAR];a.tag!==t.tag&&s(i,"TAG_RESOLVE_FAILED",`Value may be parsed as either ${n.tagString(a.tag)} or ${n.tagString(t.tag)}`,!0)}return a}(o,u,i,a):o.schema[e.SCALAR];try{const n=d.resolve(u,e=>a(s??i,"TAG_RESOLVE_FAILED",e),o.options);h=e.isScalar(n)?n:new t.Scalar(n)}catch(e){const n=e instanceof Error?e.message:String(e);a(s??i,"TAG_RESOLVE_FAILED",n),h=new t.Scalar(u)}return h.range=p,h.source=u,c&&(h.type=c),f&&(h.tag=f),d.format&&(h.format=d.format),l&&(h.comment=l),h},Ar}(),o=Cr(),i=(Or||(Or=1,Nr.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}),Nr);const s={composeNode:a,composeEmptyNode:u};function a(i,a,c,l){const p=i.atKey,{spaceBefore:f,comment:d,anchor:h,tag:D}=c;let g,m=!0;switch(a.type){case"alias":g=function({options:t},{offset:n,source:r,end:i},s){const a=new e.Alias(r.substring(1));""===a.source&&s(n,"BAD_ALIAS","Alias cannot be an empty string"),a.source.endsWith(":")&&s(n+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const u=n+r.length,c=o.resolveEnd(i,u,t.strict,s);return a.range=[n,u,c.offset],c.comment&&(a.comment=c.comment),a}(i,a,l),(h||D)&&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,D,l),h&&(g.anchor=h.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":g=n.composeCollection(s,i,a,c,l),h&&(g.anchor=h.source.substring(1));break;default:l(a,"UNEXPECTED_TOKEN","error"===a.type?a.message:`Unsupported token (type: ${a.type})`),g=u(i,a.offset,void 0,null,c,l),m=!1}return h&&""===g.anchor&&l(h,"BAD_ALIAS","Anchor cannot be an empty string"),p&&i.options.stringKeys&&(!t.isScalar(g)||"string"!=typeof g.value||g.tag&&"tag:yaml.org,2002:str"!==g.tag)&&l(D??a,"NON_STRING_KEY","With stringKeys, all keys must be strings"),f&&(g.spaceBefore=!0),d&&("scalar"===a.type&&""===a.source?g.comment=d:g.commentBefore=d),i.options.keepSourceTokens&&m&&(g.srcToken=a),g}function u(e,t,n,o,{spaceBefore:s,comment:a,anchor:u,tag:c,end:l},p){const f={type:"scalar",offset:i.emptyScalarPosition(t,n,o),indent:-1,source:""},d=r.composeScalar(e,f,c,p);return u&&(d.anchor=u.source.substring(1),""===d.anchor&&p(u,"BAD_ALIAS","Anchor cannot be an empty string")),s&&(d.spaceBefore=!0),a&&(d.comment=a,d.range[2]=l),d}return tr.composeEmptyNode=u,tr.composeNode=a,tr}function jr(){if(Lr)return Se;Lr=1;var e=C,t=$e(),n=Vn(),r=Qn(),o=Re(),i=function(){if($r)return er;$r=1;var e=Vn(),t=Mr(),n=Cr(),r=ir();return er.composeDoc=function(o,i,{offset:s,start:a,value:u,end:c},l){const p=Object.assign({_directives:i},o),f=new e.Document(void 0,p),d={atKey:!1,atRoot:!0,directives:f.directives,options:f.options,schema:f.schema},h=r.resolveProps(a,{indicator:"doc-start",next:u??c?.[0],offset:s,onError:l,parentIndent:0,startOnNewline:!0});h.found&&(f.directives.docStart=!0,!u||"block-map"!==u.type&&"block-seq"!==u.type||h.hasNewline||l(h.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),f.contents=u?t.composeNode(d,u,h,l):t.composeEmptyNode(d,h.end,a,null,h,l);const D=f.contents.range[2],g=n.resolveEnd(c,D,!1,l);return g.comment&&(f.comment=g.comment),f.range=[s,D,g.offset],f},er}(),s=Cr();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 u(e){let t="",n=!1,r=!1;for(let o=0;o<e.length;++o){const i=e[o];switch(i[0]){case"#":t+=(""===t?"":r?"\n\n":"\n")+(i.substring(1)||" "),n=!0,r=!1;break;case"%":"#"!==e[o+1]?.[0]&&(o+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}return Se.Composer=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,o)=>{const i=a(e);o?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}=u(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(o.isCollection(i)&&!i.flow&&i.items.length>0){let e=i.items[0];o.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:u(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(const t of e)yield*this.next(t);yield*this.end(t,n)}*next(t){switch(e.env.LOG_STREAM&&console.dir(t,{depth:null}),t.type){case"directive":this.directives.add(t.source,(e,n,r)=>{const o=a(t);o[0]+=e,this.onError(o,"BAD_DIRECTIVE",n,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const e=i.composeDoc(this.options,this.directives,t,this.onError);this.atDirectives&&!e.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(e,!1),this.doc&&(yield this.doc),this.doc=e,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const e=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,n=new r.YAMLParseError(a(t),"UNEXPECTED_TOKEN",e);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){const e="Unexpected doc-end without preceding document";this.errors.push(new r.YAMLParseError(a(t),"UNEXPECTED_TOKEN",e));break}this.doc.directives.docEnd=!0;const e=s.resolveEnd(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),e.comment){const t=this.doc.comment;this.doc.comment=t?`${t}\n${e.comment}`:e.comment}this.doc.range[2]=e.offset;break}default:this.errors.push(new r.YAMLParseError(a(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const e=Object.assign({_directives:this.directives},this.options),r=new n.Document(void 0,e);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,t,t],this.decorate(r,!1),yield r}}},Se}var Ir,Hr={},zr={};var Kr,Ur={};var qr,Gr,Wr={};function Zr(){if(Gr)return Hr;Gr=1;var e=function(){if(Ir)return zr;Ir=1;var e=kr(),t=xr(),n=Qn(),r=bt();function o(e,t){if(t)for(const n of t)switch(n.type){case"space":case"comment":e.push(n);break;case"newline":return e.push(n),!0}return!1}function i(e,t,n){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=n,e.source=t;break;case"block-scalar":{const r=e.props.slice(1);let o=t.length;"block-scalar-header"===e.props[0].type&&(o-=e.props[0].source.length);for(const e of r)e.offset+=o;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,o="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:o})}}}return zr.createScalarToken=function(e,t){const{implicitKey:n=!1,indent:i,inFlow:s=!1,offset:a=-1,type:u="PLAIN"}=t,c=r.stringifyString({type:u,value:e},{implicitKey:n,indent:i>0?" ".repeat(i):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}}),l=t.end??[{type:"newline",offset:-1,indent:i,source:"\n"}];switch(c[0]){case"|":case">":{const e=c.indexOf("\n"),t=c.substring(0,e),n=c.substring(e+1)+"\n",r=[{type:"block-scalar-header",offset:a,indent:i,source:t}];return o(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:c,end:l};case"'":return{type:"single-quoted-scalar",offset:a,indent:i,source:c,end:l};default:return{type:"scalar",offset:a,indent:i,source:c,end:l}}},zr.resolveAsScalar=function(r,o=!0,i){if(r){const s=(e,t,r)=>{const o="number"==typeof e?e:Array.isArray(e)?e[0]:e.offset;if(!i)throw new n.YAMLParseError([o,o+1],t,r);i(o,t,r)};switch(r.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return t.resolveFlowScalar(r,o,s);case"block-scalar":return e.resolveBlockScalar({options:{strict:o}},r,s)}}return null},zr.setScalarValue=function(e,t,n={}){let{afterKey:s=!1,implicitKey:a=!1,inFlow:u=!1,type:c}=n,l="indent"in e?e.indent:null;if(s&&"number"==typeof l&&(l+=2),!c)switch(e.type){case"single-quoted-scalar":c="QUOTE_SINGLE";break;case"double-quoted-scalar":c="QUOTE_DOUBLE";break;case"block-scalar":{const t=e.props[0];if("block-scalar-header"!==t.type)throw new Error("Invalid block scalar header");c=">"===t.source[0]?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:c="PLAIN"}const p=r.stringifyString({type:c,value:t},{implicitKey:a||null===l,indent:null!==l&&l>0?" ".repeat(l):"",inFlow:u,options:{blockQuote:!0,lineWidth:-1}});switch(p[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,s=[{type:"block-scalar-header",offset:t,indent:n,source:r}];o(s,"end"in e?e.end:void 0)||s.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:s,source:i})}}(e,p);break;case'"':i(e,p,"double-quoted-scalar");break;case"'":i(e,p,"single-quoted-scalar");break;default:i(e,p,"scalar")}},zr}(),t=function(){if(Kr)return Ur;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:o}){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 o&&(i+=e(o)),i}return Kr=1,Ur.stringify=n=>"type"in n?e(n):t(n),Ur}(),n=function(){if(qr)return Wr;qr=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}),o(Object.freeze([]),e,t)}function o(t,r,i){let s=i(r,t);if("symbol"==typeof s)return s;for(const a of["key","value"]){const u=r[a];if(u&&"items"in u){for(let r=0;r<u.items.length;++r){const s=o(Object.freeze(t.concat([[a,r]])),u.items[r],i);if("number"==typeof s)r=s-1;else{if(s===e)return e;s===n&&(u.items.splice(r,1),r-=1)}}"function"==typeof s&&"key"===a&&(s=s(r,t))}}return"function"==typeof s?s(r,t):s}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)),o=t[t.length-1][0],i=n?.[o];if(i&&"items"in i)return i;throw new Error("Parent collection not found")},Wr.visit=r,Wr}();return Hr.createScalarToken=e.createScalarToken,Hr.resolveAsScalar=e.resolveAsScalar,Hr.setScalarValue=e.setScalarValue,Hr.stringify=t.stringify,Hr.visit=n.visit,Hr.BOM="\ufeff",Hr.DOCUMENT="",Hr.FLOW_END="",Hr.SCALAR="",Hr.isCollection=e=>!!e&&"items"in e,Hr.isScalar=e=>!!e&&("scalar"===e.type||"single-quoted-scalar"===e.type||"double-quoted-scalar"===e.type||"block-scalar"===e.type),Hr.prettyToken=function(e){switch(e){case"\ufeff":return"<BOM>";case"":return"<DOC>";case"":return"<FLOW_END>";case"":return"<SCALAR>";default:return JSON.stringify(e)}},Hr.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},Hr}var Vr,Jr={};function Yr(){if(Vr)return Jr;Vr=1;var e=Zr();function t(e){switch(e){case void 0:case" ":case"\n":case"\r":case"\t":return!0;default:return!1}}const n=new Set("0123456789ABCDEFabcdef"),r=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),o=new Set(",[]{}"),i=new Set(" ,[]{}\n\r\t"),s=e=>!e||i.has(e);return Jr.Lexer=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if("string"!=typeof e)throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??"stream";for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;" "===t||"\t"===t;)t=this.buffer[++e];return!t||"#"===t||"\n"===t||"\r"===t&&"\n"===this.buffer[e+1]}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let n=this.buffer[e];if(this.indentNext>0){let t=0;for(;" "===n;)n=this.buffer[++t+e];if("\r"===n){const n=this.buffer[t+e+1];if("\n"===n||!n&&!this.atEnd)return e+t+1}return"\n"===n||t>=this.indentNext||!n&&!this.atEnd?e+t:-1}if("-"===n||"."===n){const n=this.buffer.substr(e,3);if(("---"===n||"..."===n)&&t(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return("number"!=typeof e||-1!==e&&e<this.pos)&&(e=this.buffer.indexOf("\n",this.pos),this.lineEndPos=e),-1===e?this.atEnd?this.buffer.substring(this.pos):null:("\r"===this.buffer[e-1]&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(null===t)return this.setNext("stream");if(t[0]===e.BOM&&(yield*this.pushCount(1),t=t.substring(1)),"%"===t[0]){let e=t.length,n=t.indexOf("#");for(;-1!==n;){const r=t[n-1];if(" "===r||"\t"===r){e=n-1;break}n=t.indexOf("#",n+1)}for(;;){const n=t[e-1];if(" "!==n&&"\t"!==n)break;e-=1}const r=(yield*this.pushCount(e))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){const e=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-e),yield*this.pushNewline(),"stream"}return yield e.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){const e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if("-"===e||"."===e){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const e=this.peek(3);if(("---"===e||"..."===e)&&t(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,"---"===e?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!t(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if(("-"===e||"?"===e||":"===e)&&t(n)){const e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const e=this.getLine();if(null===e)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(s),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=(yield*this.parseBlockScalarHeader()),t+=(yield*this.pushSpaces(!0)),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let n,r,o=-1;do{n=yield*this.pushNewline(),n>0?(r=yield*this.pushSpaces(!1),this.indentValue=o=r):r=0,r+=(yield*this.pushSpaces(!0))}while(n+r>0);const i=this.getLine();if(null===i)return this.setNext("flow");if((-1!==o&&o<this.indentNext&&"#"!==i[0]||0===o&&(i.startsWith("---")||i.startsWith("..."))&&t(i[3]))&&(o!==this.indentNext-1||1!==this.flowLevel||"]"!==i[0]&&"}"!==i[0]))return this.flowLevel=0,yield e.FLOW_END,yield*this.parseLineStart();let a=0;for(;","===i[a];)a+=(yield*this.pushCount(1)),a+=(yield*this.pushSpaces(!0)),this.flowKey=!1;switch(a+=(yield*this.pushIndicators()),i[a]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-a),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(s),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const e=this.charAt(1);if(this.flowKey||t(e)||","===e)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const e=this.charAt(0);let t=this.buffer.indexOf(e,this.pos+1);if("'"===e)for(;-1!==t&&"'"===this.buffer[t+1];)t=this.buffer.indexOf("'",t+2);else for(;-1!==t;){let e=0;for(;"\\"===this.buffer[t-1-e];)e+=1;if(e%2==0)break;t=this.buffer.indexOf('"',t+1)}const n=this.buffer.substring(0,t);let r=n.indexOf("\n",this.pos);if(-1!==r){for(;-1!==r;){const e=this.continueScalar(r+1);if(-1===e)break;r=n.indexOf("\n",e)}-1!==r&&(t=r-("\r"===n[r-1]?2:1))}if(-1===t){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){const t=this.buffer[++e];if("+"===t)this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if("-"!==t)break}return yield*this.pushUntil(e=>t(e)||"#"===e)}*parseBlockScalar(){let t,n=this.pos-1,r=0;e:for(let e=this.pos;t=this.buffer[e];++e)switch(t){case" ":r+=1;break;case"\n":n=e,r=0;break;case"\r":{const t=this.buffer[e+1];if(!t&&!this.atEnd)return this.setNext("block-scalar");if("\n"===t)break}default:break e}if(!t&&!this.atEnd)return this.setNext("block-scalar");if(r>=this.indentNext){-1===this.blockScalarIndent?this.indentNext=r:this.indentNext=this.blockScalarIndent+(0===this.indentNext?1:this.indentNext);do{const e=this.continueScalar(n+1);if(-1===e)break;n=this.buffer.indexOf("\n",e)}while(-1!==n);if(-1===n){if(!this.atEnd)return this.setNext("block-scalar");n=this.buffer.length}}let o=n+1;for(t=this.buffer[o];" "===t;)t=this.buffer[++o];if("\t"===t){for(;"\t"===t||" "===t||"\r"===t||"\n"===t;)t=this.buffer[++o];n=o-1}else if(!this.blockScalarKeep)for(;;){let e=n-1,t=this.buffer[e];"\r"===t&&(t=this.buffer[--e]);const o=e;for(;" "===t;)t=this.buffer[--e];if(!("\n"===t&&e>=this.pos&&e+1+r>o))break;n=e}return yield e.SCALAR,yield*this.pushToIndex(n+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const n=this.flowLevel>0;let r,i=this.pos-1,s=this.pos-1;for(;r=this.buffer[++s];)if(":"===r){const e=this.buffer[s+1];if(t(e)||n&&o.has(e))break;i=s}else if(t(r)){let e=this.buffer[s+1];if("\r"===r&&("\n"===e?(s+=1,r="\n",e=this.buffer[s+1]):i=s),"#"===e||n&&o.has(e))break;if("\n"===r){const e=this.continueScalar(s+1);if(-1===e)break;s=Math.max(s,e-2)}}else{if(n&&o.has(r))break;i=s}return r||this.atEnd?(yield e.SCALAR,yield*this.pushToIndex(i+1,!0),n?"flow":"doc"):this.setNext("plain-scalar")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){const n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(s))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const e=this.flowLevel>0,n=this.charAt(1);if(t(n)||e&&o.has(n))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if("<"===this.charAt(1)){let e=this.pos+2,n=this.buffer[e];for(;!t(n)&&">"!==n;)n=this.buffer[++e];return yield*this.pushToIndex(">"===n?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(r.has(t))t=this.buffer[++e];else{if("%"!==t||!n.has(this.buffer[e+1])||!n.has(this.buffer[e+2]))break;t=this.buffer[e+=3]}return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return"\n"===e?yield*this.pushCount(1):"\r"===e&&"\n"===this.charAt(1)?yield*this.pushCount(2):0}*pushSpaces(e){let t,n=this.pos-1;do{t=this.buffer[++n]}while(" "===t||e&&"\t"===t);const r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},Jr}var Qr,Xr={};function eo(){return Qr||(Qr=1,Xr.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}return this.lineStarts[t]===e?{line:t+1,col:1}:0===t?{line:0,col:e}:{line:t,col:e-this.lineStarts[t-1]+1}}}}),Xr}var to,no={};function ro(){if(to)return no;to=1;var e=C,t=Zr(),n=Yr();function r(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function o(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function i(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function s(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 u(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 no.Parser=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new n.Lexer,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&0===this.offset&&this.onNewLine(0);for(const n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(n){if(this.source=n,e.env.LOG_TOKENS&&console.log("|",t.prettyToken(n)),this.atScalar)return this.atScalar=!1,yield*this.step(),void(this.offset+=n.length);const r=t.tokenType(n);if(r)if("scalar"===r)this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=r,yield*this.step(),r){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+n.length);break;case"space":this.atNewLine&&" "===n[0]&&(this.indent+=n.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=n.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=n.length}else{const e=`Not a YAML token: ${n}`;yield*this.pop({type:"error",offset:this.offset,message:e,source:n}),this.offset+=n.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if("doc-end"!==this.type||e&&"doc-end"===e.type){if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}else{for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source})}}peek(e){return this.stack[this.stack.length-e]}*pop(e){const t=e??this.stack.pop();if(t)if(0===this.stack.length)yield t;else{const e=this.peek(1);switch("block-scalar"===t.type?t.indent="indent"in e?e.indent:0:"flow-collection"===t.type&&"document"===e.type&&(t.indent=0),"flow-collection"===t.type&&u(t),e.type){case"document":e.value=t;break;case"block-scalar":e.props.push(t);break;case"block-map":{const n=e.items[e.items.length-1];if(n.value)return e.items.push({start:[],key:t,sep:[]}),void(this.onKeyLine=!0);if(!n.sep)return Object.assign(n,{key:t,sep:[]}),void(this.onKeyLine=!n.explicitKey);n.value=t;break}case"block-seq":{const n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case"flow-collection":{const n=e.items[e.items.length-1];return void(!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]}))}default:yield*this.pop(),yield*this.pop(t)}if(!("document"!==e.type&&"block-map"!==e.type&&"block-seq"!==e.type||"block-map"!==t.type&&"block-seq"!==t.type)){const n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&-1===o(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!==o(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(s(this.peek(2)));let n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];const r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:t,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":return void e.props.push(this.sourceToken);case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){const n="end"in t.value?t.value.end:void 0,r=Array.isArray(n)?n[n.length-1]:void 0;"comment"===r?.type?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){const n=e.items[e.items.length-2],r=n?.value?.end;if(Array.isArray(r))return Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),void e.items.pop()}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const n=!this.onKeyLine&&this.indent===e.indent,o=n&&(t.sep||t.explicitKey)&&"seq-item-ind"!==this.type;let s=[];if(o&&t.sep&&!t.value){const n=[];for(let r=0;r<t.sep.length;++r){const o=t.sep[r];switch(o.type){case"newline":n.push(r);break;case"space":break;case"comment":o.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(s=t.sep.splice(n[1]))}switch(this.type){case"anchor":case"tag":return void(o||t.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken));case"explicit-key-ind":return t.sep||t.explicitKey?o||t.value?(s.push(this.sourceToken),e.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}):(t.start.push(this.sourceToken),t.explicitKey=!0),void(this.onKeyLine=!0);case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(r(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,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 s.length>0?t.sep=t.sep.concat(s,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||o?e.items.push({start:s,key:null,sep:[this.sourceToken]}):r(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return void(this.onKeyLine=!0);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const n=this.flowScalar(this.type);return void(o||t.value?(e.items.push({start:s,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0))}default:{const o=this.startBlockValue(e);if(o){if("block-seq"===o.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:s});return void this.stack.push(o)}}}}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(s(t));u(e);const r=e.end.splice(1,e.end.length);r.push(this.sourceToken);const o={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const t=a(s(e));return t.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const t=a(s(e));return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return"comment"===this.type&&!(this.indent<=t)&&e.every(e=>"newline"===e.type||"space"===e.type)}*documentEnd(e){"doc-mode"!==this.type&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop())}}},no}var oo,io,so={};var ao=function(){if(io)return Ae;io=1;var e=jr(),t=Vn(),n=qn(),r=Qn(),o=Ye(),i=Re(),s=Bt(),a=ot(),u=It(),c=Gt(),l=Zr(),p=Yr(),f=eo(),d=ro(),h=function(){if(oo)return so;oo=1;var e=jr(),t=Vn(),n=Qn(),r=wt(),o=Re(),i=eo(),s=ro();function a(e){const t=!1!==e.prettyErrors;return{lineCounter:e.lineCounter||t&&new i.LineCounter||null,prettyErrors:t}}function u(t,r={}){const{lineCounter:o,prettyErrors:i}=a(r),u=new s.Parser(o?.addNewLine),c=new e.Composer(r);let l=null;for(const e of c.compose(u.parse(t),!0,t.length))if(l){if("silent"!==l.options.logLevel){l.errors.push(new n.YAMLParseError(e.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}else l=e;return i&&o&&(l.errors.forEach(n.prettifyError(t,o)),l.warnings.forEach(n.prettifyError(t,o))),l}return so.parse=function(e,t,n){let o;"function"==typeof t?o=t:void 0===n&&t&&"object"==typeof t&&(n=t);const i=u(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:o},n))},so.parseAllDocuments=function(t,r={}){const{lineCounter:o,prettyErrors:i}=a(r),u=new s.Parser(o?.addNewLine),c=new e.Composer(r),l=Array.from(c.compose(u.parse(t)));if(i&&o)for(const e of l)e.errors.forEach(n.prettifyError(t,o)),e.warnings.forEach(n.prettifyError(t,o));return l.length>0?l:Object.assign([],{empty:!0},c.streamInfo())},so.parseDocument=u,so.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 o.isDocument(e)&&!i?e.toString(r):new t.Document(e,i,r).toString(r)},so}(),D=Te();return Ae.Composer=e.Composer,Ae.Document=t.Document,Ae.Schema=n.Schema,Ae.YAMLError=r.YAMLError,Ae.YAMLParseError=r.YAMLParseError,Ae.YAMLWarning=r.YAMLWarning,Ae.Alias=o.Alias,Ae.isAlias=i.isAlias,Ae.isCollection=i.isCollection,Ae.isDocument=i.isDocument,Ae.isMap=i.isMap,Ae.isNode=i.isNode,Ae.isPair=i.isPair,Ae.isScalar=i.isScalar,Ae.isSeq=i.isSeq,Ae.Pair=s.Pair,Ae.Scalar=a.Scalar,Ae.YAMLMap=u.YAMLMap,Ae.YAMLSeq=c.YAMLSeq,Ae.CST=l,Ae.Lexer=p.Lexer,Ae.LineCounter=f.LineCounter,Ae.Parser=d.Parser,Ae.parse=h.parse,Ae.parseAllDocuments=h.parseAllDocuments,Ae.parseDocument=h.parseDocument,Ae.stringify=h.stringify,Ae.visit=D.visit,Ae.visitAsync=D.visitAsync,Ae}(),uo=W(ao);function co(e,t,n){function r(n,r){var o;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(o=n._zod).traits??(o.traits=new Set),n._zod.traits.add(e),t(n,r);for(const e in s.prototype)e in n||Object.defineProperty(n,e,{value:s.prototype[e].bind(n)});n._zod.constr=s,n._zod.def=r}const o=n?.Parent??Object;class i extends o{}function s(e){var t;const o=n?.Parent?new i:this;r(o,e),(t=o._zod).deferred??(t.deferred=[]);for(const e of o._zod.deferred)e();return o}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}class lo extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class po extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const fo={};function ho(e){return fo}function Do(e,t){return"bigint"==typeof t?t.toString():t}function go(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function mo(e){return null==e}function yo(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const bo=Symbol("evaluating");function vo(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==bo)return void 0===r&&(r=bo,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Eo(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Fo(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Co(e){return JSON.stringify(e)}const wo="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function _o(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Ao=go(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function So(e){if(!1===_o(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==_o(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function ko(e){return So(e)?{...e}:Array.isArray(e)?[...e]:e}const Po=new Set(["string","number","symbol"]);function Ro(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Bo(e,t,n){const r=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(r._zod.parent=e),r}function xo(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}const Oo={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function To(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function $o(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Lo(e){return"string"==typeof e?e:e?.message}function No(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=Lo(e.inst?._zod.def?.error?.(e))??Lo(t?.error?.(e))??Lo(n.customError?.(e))??Lo(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Mo(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function jo(...e){const[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}const Io=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Do,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ho=co("$ZodError",Io),zo=co("$ZodError",Io,{Parent:Error}),Ko=e=>(t,n,r,o)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new lo;if(s.issues.length){const t=new(o?.Err??e)(s.issues.map(e=>No(e,i,ho())));throw wo(t,o?.callee),t}return s.value},Uo=e=>async(t,n,r,o)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){const t=new(o?.Err??e)(s.issues.map(e=>No(e,i,ho())));throw wo(t,o?.callee),t}return s.value},qo=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new lo;return i.issues.length?{success:!1,error:new(e??Ho)(i.issues.map(e=>No(e,o,ho())))}:{success:!0,data:i.value}},Go=qo(zo),Wo=e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(e=>No(e,o,ho())))}:{success:!0,data:i.value}},Zo=Wo(zo),Vo=/^[cC][^\s-]{8,}$/,Jo=/^[0-9a-z]+$/,Yo=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Qo=/^[0-9a-vA-V]{20}$/,Xo=/^[A-Za-z0-9]{27}$/,ei=/^[a-zA-Z0-9_-]{21}$/,ti=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ni=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ri=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,oi=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ii=/^(?:(?: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])$/,si=/^(([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}|:))$/,ai=/^((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])$/,ui=/^(([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])$/,ci=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,li=/^[A-Za-z0-9_-]*$/,pi=/^(?=.{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])?)*\.?$/,fi=/^\+(?:[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])))",hi=new RegExp(`^${di}$`);function Di(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 gi=/^-?\d+$/,mi=/^-?\d+(?:\.\d+)?/,yi=/^(?:true|false)$/i,bi=/^[^A-Z]*$/,vi=/^[^a-z]*$/,Ei=co("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Fi={number:"number",bigint:"bigint",object:"date"},Ci=co("$ZodCheckLessThan",(e,t)=>{Ei.init(e,t);const n=Fi[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),wi=co("$ZodCheckGreaterThan",(e,t)=>{Ei.init(e,t);const n=Fi[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),_i=co("$ZodCheckMultipleOf",(e,t)=>{Ei.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let o=(r.split(".")[1]||"").length;if(0===o&&/\d?e-\d?/.test(r)){const e=r.match(/\d?e-(\d?)/);e?.[1]&&(o=Number.parseInt(e[1]))}const i=n>o?n:o;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/10**i}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Ai=co("$ZodCheckNumberFormat",(e,t)=>{Ei.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[o,i]=Oo[t.format];e._zod.onattach.push(e=>{const r=e._zod.bag;r.format=t.format,r.minimum=o,r.maximum=i,n&&(r.pattern=gi)}),e._zod.check=s=>{const a=s.value;if(n){if(!Number.isInteger(a))return void s.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort}))}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>i&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inst:e})}}),Si=co("$ZodCheckMaxLength",(e,t)=>{var n;Ei.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!mo(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 o=Mo(r);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ki=co("$ZodCheckMinLength",(e,t)=>{var n;Ei.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!mo(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 o=Mo(r);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Pi=co("$ZodCheckLengthEquals",(e,t)=>{var n;Ei.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!mo(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,o=r.length;if(o===t.length)return;const i=Mo(r),s=o>t.length;n.issues.push({origin:i,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Ri=co("$ZodCheckStringFormat",(e,t)=>{var n,r;Ei.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=()=>{})}),Bi=co("$ZodCheckRegex",(e,t)=>{Ri.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})}}),xi=co("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=bi),Ri.init(e,t)}),Oi=co("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=vi),Ri.init(e,t)}),Ti=co("$ZodCheckIncludes",(e,t)=>{Ei.init(e,t);const n=Ro(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})}}),$i=co("$ZodCheckStartsWith",(e,t)=>{Ei.init(e,t);const n=new RegExp(`^${Ro(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})}}),Li=co("$ZodCheckEndsWith",(e,t)=>{Ei.init(e,t);const n=new RegExp(`.*${Ro(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})}}),Ni=co("$ZodCheckOverwrite",(e,t)=>{Ei.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class Mi{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 ji={major:4,minor:1,patch:11},Ii=co("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ji;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,o=To(e);for(const i of t){if(i._zod.def.when){if(!i._zod.def.when(e))continue}else if(o)continue;const t=e.issues.length,s=i._zod.check(e);if(s instanceof Promise&&!1===n?.async)throw new lo;if(r||s instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await s,e.issues.length!==t&&(o||(o=To(e,t)))});else{if(e.issues.length===t)continue;o||(o=To(e,t))}}return r?r.then(()=>e):e},n=(n,o,i)=>{if(To(n))return n.aborted=!0,n;const s=t(o,r,i);if(s instanceof Promise){if(!1===i.async)throw new lo;return s.then(t=>e._zod.parse(t,i))}return e._zod.parse(s,i)};e._zod.run=(o,i)=>{if(i.skipChecks)return e._zod.parse(o,i);if("backward"===i.direction){const t=e._zod.parse({value:o.value,issues:[]},{...i,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,o,i)):n(t,o,i)}const s=e._zod.parse(o,i);if(s instanceof Promise){if(!1===i.async)throw new lo;return s.then(e=>t(e,r,i))}return t(s,r,i)}}e["~standard"]={validate:t=>{try{const n=Go(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return Zo(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}}),Hi=co("$ZodString",(e,t)=>{var n;Ii.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}}),zi=co("$ZodStringFormat",(e,t)=>{Ri.init(e,t),Hi.init(e,t)}),Ki=co("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=ni),zi.init(e,t)}),Ui=co("$ZodUUID",(e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ri(e))}else t.pattern??(t.pattern=ri());zi.init(e,t)}),qi=co("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=oi),zi.init(e,t)}),Gi=co("$ZodURL",(e,t)=>{zi.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),o=new URL(r);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:pi.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.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=o.href:n.value=r)}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Wi=co("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),zi.init(e,t)}),Zi=co("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=ei),zi.init(e,t)}),Vi=co("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Vo),zi.init(e,t)}),Ji=co("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Jo),zi.init(e,t)}),Yi=co("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Yo),zi.init(e,t)}),Qi=co("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Qo),zi.init(e,t)}),Xi=co("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Xo),zi.init(e,t)}),es=co("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=Di({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)),zi.init(e,t)}),ts=co("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=hi),zi.init(e,t)}),ns=co("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${Di(t)}$`)),zi.init(e,t)}),rs=co("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=ti),zi.init(e,t)}),os=co("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=ii),zi.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv4"})}),is=co("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=si),zi.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})}}}),ss=co("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=ai),zi.init(e,t)}),as=co("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=ui),zi.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 us(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const cs=co("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ci),zi.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{us(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),ls=co("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=li),zi.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{(function(e){if(!li.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return us(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})}}),ps=co("$ZodE164",(e,t)=>{t.pattern??(t.pattern=fi),zi.init(e,t)}),fs=co("$ZodJWT",(e,t)=>{zi.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 o=JSON.parse(atob(r));return!("typ"in o&&"JWT"!==o?.typ||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),ds=co("$ZodNumber",(e,t)=>{Ii.init(e,t),e._zod.pattern=e._zod.bag.pattern??mi,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const o=n.value;if("number"==typeof o&&!Number.isNaN(o)&&Number.isFinite(o))return n;const i="number"==typeof o?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),n}}),hs=co("$ZodNumber",(e,t)=>{Ai.init(e,t),ds.init(e,t)}),Ds=co("$ZodBoolean",(e,t)=>{Ii.init(e,t),e._zod.pattern=yi,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}const o=n.value;return"boolean"==typeof o||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),gs=co("$ZodUnknown",(e,t)=>{Ii.init(e,t),e._zod.parse=e=>e}),ms=co("$ZodNever",(e,t)=>{Ii.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function ys(e,t,n){e.issues.length&&t.issues.push(...$o(n,e.issues)),t.value[n]=e.value}const bs=co("$ZodArray",(e,t)=>{Ii.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const i=[];for(let e=0;e<o.length;e++){const s=o[e],a=t.element._zod.run({value:s,issues:[]},r);a instanceof Promise?i.push(a.then(t=>ys(t,n,e))):ys(a,n,e)}return i.length?Promise.all(i).then(()=>n):n}});function vs(e,t,n,r){e.issues.length&&t.issues.push(...$o(n,e.issues)),void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function Es(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 Fs(e,t,n,r,o,i){const s=[],a=o.keySet,u=o.catchall._zod,c=u.def.type;for(const o of Object.keys(t)){if(a.has(o))continue;if("never"===c){s.push(o);continue}const i=u.run({value:t[o],issues:[]},r);i instanceof Promise?e.push(i.then(e=>vs(e,n,o,t))):vs(i,n,o,t)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}const Cs=co("$ZodObject",(e,t)=>{Ii.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=go(()=>Es(t));vo(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 o=_o,i=t.catchall;let s;e._zod.parse=(t,n)=>{s??(s=r.value);const a=t.value;if(!o(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const u=[],c=s.shape;for(const e of s.keys){const r=c[e]._zod.run({value:a[e],issues:[]},n);r instanceof Promise?u.push(r.then(n=>vs(n,t,e,a))):vs(r,t,e,a)}return i?Fs(u,a,t,n,r.value,e):u.length?Promise.all(u).then(()=>t):t}}),ws=co("$ZodObjectJIT",(e,t)=>{Cs.init(e,t);const n=e._zod.parse,r=go(()=>Es(t));let o;const i=_o,s=!fo.jitless,a=s&&Ao.value,u=t.catchall;let c;e._zod.parse=(l,p)=>{c??(c=r.value);const f=l.value;return i(f)?s&&a&&!1===p?.async&&!0!==p.jitless?(o||(o=(e=>{const t=new Mi(["shape","payload","ctx"]),n=r.value,o=e=>{const t=Co(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const i=Object.create(null);let s=0;for(const e of n.keys)i[e]="key_"+s++;t.write("const newResult = {};");for(const e of n.keys){const n=i[e],r=Co(e);t.write(`const ${n} = ${o(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=o(l,p),u?Fs([],f,l,p,c,e):l):n(l,p):(l.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),l)}});function _s(e,t,n,r){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const o=e.filter(e=>!To(e));return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>No(e,r,ho())))}),t)}const As=co("$ZodUnion",(e,t)=>{Ii.init(e,t),vo(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),vo(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),vo(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),vo(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=>yo(e.source)).join("|")})$`)}});const n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=(o,i)=>{if(n)return r(o,i);let s=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:o.value,issues:[]},i);if(t instanceof Promise)a.push(t),s=!0;else{if(0===t.issues.length)return t;a.push(t)}}return s?Promise.all(a).then(t=>_s(t,o,e,i)):_s(a,o,e,i)}}),Ss=co("$ZodIntersection",(e,t)=>{Ii.init(e,t),e._zod.parse=(e,n)=>{const r=e.value,o=t.left._zod.run({value:r,issues:[]},n),i=t.right._zod.run({value:r,issues:[]},n);return o instanceof Promise||i instanceof Promise?Promise.all([o,i]).then(([t,n])=>Ps(e,t,n)):Ps(e,o,i)}});function ks(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(So(e)&&So(t)){const n=Object.keys(t),r=Object.keys(e).filter(e=>-1!==n.indexOf(e)),o={...e,...t};for(const n of r){const r=ks(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};o[n]=r.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=ks(e[r],t[r]);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Ps(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),To(e))return e;const r=ks(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 Rs=co("$ZodRecord",(e,t)=>{Ii.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!So(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const i=[];if(t.keyType._zod.values){const s=t.keyType._zod.values;n.value={};for(const e of s)if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){const s=t.valueType._zod.run({value:o[e],issues:[]},r);s instanceof Promise?i.push(s.then(t=>{t.issues.length&&n.issues.push(...$o(e,t.issues)),n.value[e]=t.value})):(s.issues.length&&n.issues.push(...$o(e,s.issues)),n.value[e]=s.value)}let a;for(const e in o)s.has(e)||(a=a??[],a.push(e));a&&a.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:a})}else{n.value={};for(const s of Reflect.ownKeys(o)){if("__proto__"===s)continue;const a=t.keyType._zod.run({value:s,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=>No(e,r,ho())),input:s,path:[s],inst:e}),n.value[a.value]=a.value;continue}const u=t.valueType._zod.run({value:o[s],issues:[]},r);u instanceof Promise?i.push(u.then(e=>{e.issues.length&&n.issues.push(...$o(s,e.issues)),n.value[a.value]=e.value})):(u.issues.length&&n.issues.push(...$o(s,u.issues)),n.value[a.value]=u.value)}}return i.length?Promise.all(i).then(()=>n):n}}),Bs=co("$ZodEnum",(e,t)=>{Ii.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=>Po.has(typeof e)).map(e=>"string"==typeof e?Ro(e):e.toString()).join("|")})$`),e._zod.parse=(t,o)=>{const i=t.value;return r.has(i)||t.issues.push({code:"invalid_value",values:n,input:i,inst:e}),t}}),xs=co("$ZodTransform",(e,t)=>{Ii.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new po(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(e=>(n.value=e,n));if(o instanceof Promise)throw new lo;return n.value=o,n}});function Os(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const Ts=co("$ZodOptional",(e,t)=>{Ii.init(e,t),e._zod.optin="optional",e._zod.optout="optional",vo(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),vo(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${yo(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=>Os(t,e.value)):Os(r,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),$s=co("$ZodNullable",(e,t)=>{Ii.init(e,t),vo(e._zod,"optin",()=>t.innerType._zod.optin),vo(e._zod,"optout",()=>t.innerType._zod.optout),vo(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${yo(e.source)}|null)$`):void 0}),vo(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)}),Ls=co("$ZodDefault",(e,t)=>{Ii.init(e,t),e._zod.optin="optional",vo(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=>Ns(e,t)):Ns(r,t)}});function Ns(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Ms=co("$ZodPrefault",(e,t)=>{Ii.init(e,t),e._zod.optin="optional",vo(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))}),js=co("$ZodNonOptional",(e,t)=>{Ii.init(e,t),vo(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 o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(t=>Is(t,e)):Is(o,e)}});function Is(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 Hs=co("$ZodCatch",(e,t)=>{Ii.init(e,t),vo(e._zod,"optin",()=>t.innerType._zod.optin),vo(e._zod,"optout",()=>t.innerType._zod.optout),vo(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=>No(e,n,ho()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>No(e,n,ho()))},input:e.value}),e.issues=[]),e)}}),zs=co("$ZodPipe",(e,t)=>{Ii.init(e,t),vo(e._zod,"values",()=>t.in._zod.values),vo(e._zod,"optin",()=>t.in._zod.optin),vo(e._zod,"optout",()=>t.out._zod.optout),vo(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=>Ks(e,t.in,n)):Ks(r,t.in,n)}const r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Ks(e,t.out,n)):Ks(r,t.out,n)}});function Ks(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Us=co("$ZodReadonly",(e,t)=>{Ii.init(e,t),vo(e._zod,"propValues",()=>t.innerType._zod.propValues),vo(e._zod,"values",()=>t.innerType._zod.values),vo(e._zod,"optin",()=>t.innerType._zod.optin),vo(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(qs):qs(r)}});function qs(e){return e.value=Object.freeze(e.value),e}const Gs=co("$ZodCustom",(e,t)=>{Ei.init(e,t),Ii.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(t=>Ws(t,n,r,e));Ws(o,n,r,e)}});function Ws(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(jo(e))}}class Zs{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)}}const Vs=new Zs;function Js(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...xo(t)})}function Ys(e,t){return new Ci({check:"less_than",...xo(t),value:e,inclusive:!1})}function Qs(e,t){return new Ci({check:"less_than",...xo(t),value:e,inclusive:!0})}function Xs(e,t){return new wi({check:"greater_than",...xo(t),value:e,inclusive:!1})}function ea(e,t){return new wi({check:"greater_than",...xo(t),value:e,inclusive:!0})}function ta(e,t){return new _i({check:"multiple_of",...xo(t),value:e})}function na(e,t){return new Si({check:"max_length",...xo(t),maximum:e})}function ra(e,t){return new ki({check:"min_length",...xo(t),minimum:e})}function oa(e,t){return new Pi({check:"length_equals",...xo(t),length:e})}function ia(e){return new Ni({check:"overwrite",tx:e})}const sa=co("ZodISODateTime",(e,t)=>{es.init(e,t),Ra.init(e,t)});const aa=co("ZodISODate",(e,t)=>{ts.init(e,t),Ra.init(e,t)});const ua=co("ZodISOTime",(e,t)=>{ns.init(e,t),Ra.init(e,t)});const ca=co("ZodISODuration",(e,t)=>{rs.init(e,t),Ra.init(e,t)});const la=(e,t)=>{Ho.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t){const n=t||function(e){return e.message},r={_errors:[]},o=e=>{for(const t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map(e=>o({issues:e}));else if("invalid_key"===t.code)o({issues:t.issues});else if("invalid_element"===t.code)o({issues:t.issues});else if(0===t.path.length)r._errors.push(n(t));else{let e=r,o=0;for(;o<t.path.length;){const r=t.path[o];o===t.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(n(t))):e[r]=e[r]||{_errors:[]},e=e[r],o++}}};return o(e),r}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Do,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Do,2)}},isEmpty:{get:()=>0===e.issues.length}})},pa=co("ZodError",la),fa=co("ZodError",la,{Parent:Error}),da=Ko(fa),ha=Uo(fa),Da=qo(fa),ga=Wo(fa),ma=(ka=fa,(e,t,n)=>{const r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Ko(ka)(e,t,r)}),ya=(e=>(t,n,r)=>Ko(e)(t,n,r))(fa),ba=(e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Uo(e)(t,n,o)})(fa),va=(e=>async(t,n,r)=>Uo(e)(t,n,r))(fa),Ea=(e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return qo(e)(t,n,o)})(fa),Fa=(e=>(t,n,r)=>qo(e)(t,n,r))(fa),Ca=(e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Wo(e)(t,n,o)})(fa),wa=(e=>async(t,n,r)=>Wo(e)(t,n,r))(fa),_a=co("ZodType",(e,t)=>(Ii.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Fo(t,{checks:[...t.checks??[],...n.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]})),e.clone=(t,n)=>Bo(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>da(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Da(e,t,n),e.parseAsync=async(t,n)=>ha(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>ga(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>ma(e,t,n),e.decode=(t,n)=>ya(e,t,n),e.encodeAsync=async(t,n)=>ba(e,t,n),e.decodeAsync=async(t,n)=>va(e,t,n),e.safeEncode=(t,n)=>Ea(e,t,n),e.safeDecode=(t,n)=>Fa(e,t,n),e.safeEncodeAsync=async(t,n)=>Ca(e,t,n),e.safeDecodeAsync=async(t,n)=>wa(e,t,n),e.refine=(t,n)=>e.check(function(e,t={}){return function(e,t,n){return new Su({type:"custom",check:"custom",fn:t,...xo(n)})}(0,e,t)}(t,n)),e.superRefine=t=>e.check(function(e){const t=function(e){const t=new Ei({check:"custom",...xo(void 0)});return t._zod.check=e,t}(n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(jo(e,n.value,t._zod.def));else{const r=e;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),n.issues.push(jo(r))}},e(n.value,n)));return t}(t)),e.overwrite=t=>e.check(ia(t)),e.optional=()=>mu(e),e.nullable=()=>bu(e),e.nullish=()=>mu(bu(e)),e.nonoptional=t=>function(e,t){return new Fu({type:"nonoptional",innerType:e,...xo(t)})}(e,t),e.array=()=>su(e),e.or=t=>lu([e,t]),e.and=t=>new pu({type:"intersection",left:e,right:t}),e.transform=t=>_u(e,new Du({type:"transform",transform:t})),e.default=t=>{return n=t,new vu({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():ko(n)}});var n},e.prefault=t=>{return n=t,new Eu({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():ko(n)}});var n},e.catch=t=>{return new Cu({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>_u(e,t),e.readonly=()=>new Au({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return Vs.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>Vs.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Vs.get(e);const n=e.clone();return Vs.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Aa=co("_ZodString",(e,t)=>{Hi.init(e,t),_a.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 Bi({check:"string_format",format:"regex",...xo(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Ti({check:"string_format",format:"includes",...xo(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new $i({check:"string_format",format:"starts_with",...xo(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new Li({check:"string_format",format:"ends_with",...xo(t),suffix:e})}(...t)),e.min=(...t)=>e.check(ra(...t)),e.max=(...t)=>e.check(na(...t)),e.length=(...t)=>e.check(oa(...t)),e.nonempty=(...t)=>e.check(ra(1,...t)),e.lowercase=t=>e.check(function(e){return new xi({check:"string_format",format:"lowercase",...xo(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Oi({check:"string_format",format:"uppercase",...xo(e)})}(t)),e.trim=()=>e.check(ia(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return ia(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(ia(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(ia(e=>e.toUpperCase()))}),Sa=co("ZodString",(e,t)=>{Hi.init(e,t),Aa.init(e,t),e.email=t=>e.check(function(e,t){return new Ba({type:"string",format:"email",check:"string_format",abort:!1,...xo(t)})}(0,t)),e.url=t=>e.check(function(e,t){return new Ta({type:"string",format:"url",check:"string_format",abort:!1,...xo(t)})}(0,t)),e.jwt=t=>e.check(function(e,t){return new Va({type:"string",format:"jwt",check:"string_format",abort:!1,...xo(t)})}(0,t)),e.emoji=t=>e.check(function(e,t){return new $a({type:"string",format:"emoji",check:"string_format",abort:!1,...xo(t)})}(0,t)),e.guid=t=>e.check(Js(xa,t)),e.uuid=t=>e.check(function(e,t){return new Oa({type:"string",format:"uuid",check:"string_format",abort:!1,...xo(t)})}(0,t)),e.uuidv4=t=>e.check(function(e,t){return new Oa({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...xo(t)})}(0,t)),e.uuidv6=t=>e.check(function(e,t){return new Oa({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...xo(t)})}(0,t)),e.uuidv7=t=>e.check(function(e,t){return new Oa({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...xo(t)})}(0,t)),e.nanoid=t=>e.check(function(e,t){return new La({type:"string",format:"nanoid",check:"string_format",abort:!1,...xo(t)})}(0,t)),e.guid=t=>e.check(Js(xa,t)),e.cuid=t=>e.check(function(e,t){return new Na({type:"string",format:"cuid",check:"string_format",abort:!1,...xo(t)})}(0,t)),e.cuid2=t=>e.check(function(e,t){return new Ma({type:"string",format:"cuid2",check:"string_format",abort:!1,...xo(t)})}(0,t)),e.ulid=t=>e.check(function(e,t){return new ja({type:"string",format:"ulid",check:"string_format",abort:!1,...xo(t)})}(0,t)),e.base64=t=>e.check(function(e,t){return new Ga({type:"string",format:"base64",check:"string_format",abort:!1,...xo(t)})}(0,t)),e.base64url=t=>e.check(function(e,t){return new Wa({type:"string",format:"base64url",check:"string_format",abort:!1,...xo(t)})}(0,t)),e.xid=t=>e.check(function(e,t){return new Ia({type:"string",format:"xid",check:"string_format",abort:!1,...xo(t)})}(0,t)),e.ksuid=t=>e.check(function(e,t){return new Ha({type:"string",format:"ksuid",check:"string_format",abort:!1,...xo(t)})}(0,t)),e.ipv4=t=>e.check(function(e,t){return new za({type:"string",format:"ipv4",check:"string_format",abort:!1,...xo(t)})}(0,t)),e.ipv6=t=>e.check(function(e,t){return new Ka({type:"string",format:"ipv6",check:"string_format",abort:!1,...xo(t)})}(0,t)),e.cidrv4=t=>e.check(function(e,t){return new Ua({type:"string",format:"cidrv4",check:"string_format",abort:!1,...xo(t)})}(0,t)),e.cidrv6=t=>e.check(function(e,t){return new qa({type:"string",format:"cidrv6",check:"string_format",abort:!1,...xo(t)})}(0,t)),e.e164=t=>e.check(function(e,t){return new Za({type:"string",format:"e164",check:"string_format",abort:!1,...xo(t)})}(0,t)),e.datetime=t=>e.check(function(e){return new sa({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...xo(e)})}(t)),e.date=t=>e.check(function(e){return new aa({type:"string",format:"date",check:"string_format",...xo(e)})}(t)),e.time=t=>e.check(function(e){return new ua({type:"string",format:"time",check:"string_format",precision:null,...xo(e)})}(t)),e.duration=t=>e.check(function(e){return new ca({type:"string",format:"duration",check:"string_format",...xo(e)})}(t))});var ka;function Pa(e){return new Sa({type:"string",...xo(e)})}const Ra=co("ZodStringFormat",(e,t)=>{zi.init(e,t),Aa.init(e,t)}),Ba=co("ZodEmail",(e,t)=>{qi.init(e,t),Ra.init(e,t)}),xa=co("ZodGUID",(e,t)=>{Ki.init(e,t),Ra.init(e,t)}),Oa=co("ZodUUID",(e,t)=>{Ui.init(e,t),Ra.init(e,t)}),Ta=co("ZodURL",(e,t)=>{Gi.init(e,t),Ra.init(e,t)}),$a=co("ZodEmoji",(e,t)=>{Wi.init(e,t),Ra.init(e,t)}),La=co("ZodNanoID",(e,t)=>{Zi.init(e,t),Ra.init(e,t)}),Na=co("ZodCUID",(e,t)=>{Vi.init(e,t),Ra.init(e,t)}),Ma=co("ZodCUID2",(e,t)=>{Ji.init(e,t),Ra.init(e,t)}),ja=co("ZodULID",(e,t)=>{Yi.init(e,t),Ra.init(e,t)}),Ia=co("ZodXID",(e,t)=>{Qi.init(e,t),Ra.init(e,t)}),Ha=co("ZodKSUID",(e,t)=>{Xi.init(e,t),Ra.init(e,t)}),za=co("ZodIPv4",(e,t)=>{os.init(e,t),Ra.init(e,t)}),Ka=co("ZodIPv6",(e,t)=>{is.init(e,t),Ra.init(e,t)}),Ua=co("ZodCIDRv4",(e,t)=>{ss.init(e,t),Ra.init(e,t)}),qa=co("ZodCIDRv6",(e,t)=>{as.init(e,t),Ra.init(e,t)}),Ga=co("ZodBase64",(e,t)=>{cs.init(e,t),Ra.init(e,t)}),Wa=co("ZodBase64URL",(e,t)=>{ls.init(e,t),Ra.init(e,t)}),Za=co("ZodE164",(e,t)=>{ps.init(e,t),Ra.init(e,t)}),Va=co("ZodJWT",(e,t)=>{fs.init(e,t),Ra.init(e,t)}),Ja=co("ZodNumber",(e,t)=>{ds.init(e,t),_a.init(e,t),e.gt=(t,n)=>e.check(Xs(t,n)),e.gte=(t,n)=>e.check(ea(t,n)),e.min=(t,n)=>e.check(ea(t,n)),e.lt=(t,n)=>e.check(Ys(t,n)),e.lte=(t,n)=>e.check(Qs(t,n)),e.max=(t,n)=>e.check(Qs(t,n)),e.int=t=>e.check(Qa(t)),e.safe=t=>e.check(Qa(t)),e.positive=t=>e.check(Xs(0,t)),e.nonnegative=t=>e.check(ea(0,t)),e.negative=t=>e.check(Ys(0,t)),e.nonpositive=t=>e.check(Qs(0,t)),e.multipleOf=(t,n)=>e.check(ta(t,n)),e.step=(t,n)=>e.check(ta(t,n)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null}),Ya=co("ZodNumberFormat",(e,t)=>{hs.init(e,t),Ja.init(e,t)});function Qa(e){return new Ya({type:"number",check:"number_format",abort:!1,format:"safeint",...xo(e)})}const Xa=co("ZodBoolean",(e,t)=>{Ds.init(e,t),_a.init(e,t)});function eu(e){return new Xa({type:"boolean",...xo(e)})}const tu=co("ZodUnknown",(e,t)=>{gs.init(e,t),_a.init(e,t)});function nu(){return new tu({type:"unknown"})}const ru=co("ZodNever",(e,t)=>{ms.init(e,t),_a.init(e,t)});function ou(e){return new ru({type:"never",...xo(e)})}const iu=co("ZodArray",(e,t)=>{bs.init(e,t),_a.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(ra(t,n)),e.nonempty=t=>e.check(ra(1,t)),e.max=(t,n)=>e.check(na(t,n)),e.length=(t,n)=>e.check(oa(t,n)),e.unwrap=()=>e.element});function su(e,t){return function(e,t,n){return new iu({type:"array",element:t,...xo(n)})}(0,e,t)}const au=co("ZodObject",(e,t)=>{ws.init(e,t),_a.init(e,t),vo(e,"shape",()=>t.shape),e.keyof=()=>function(e){const t=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new hu({type:"enum",entries:t,...xo(void 0)})}(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:nu()}),e.loose=()=>e.clone({...e._zod.def,catchall:nu()}),e.strict=()=>e.clone({...e._zod.def,catchall:ou()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!So(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=Fo(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Eo(this,"shape",n),n},checks:[]});return Bo(e,r)}(e,t),e.safeExtend=t=>function(e,t){if(!So(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 Eo(this,"shape",n),n},checks:e._zod.def.checks};return Bo(e,n)}(e,t),e.merge=t=>function(e,t){const n=Fo(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Eo(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Bo(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def;return Bo(e,Fo(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 Eo(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,r=Fo(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 Eo(this,"shape",r),r},checks:[]});return Bo(e,r)}(e,t),e.partial=(...t)=>function(e,t,n){const r=Fo(t._zod.def,{get shape(){const r=t._zod.def.shape,o={...r};if(n)for(const t in n){if(!(t in r))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(const t in r)o[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return Eo(this,"shape",o),o},checks:[]});return Bo(t,r)}(gu,e,t[0]),e.required=(...t)=>function(e,t,n){const r=Fo(t._zod.def,{get shape(){const r=t._zod.def.shape,o={...r};if(n)for(const t in n){if(!(t in o))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=new e({type:"nonoptional",innerType:r[t]}))}else for(const t in r)o[t]=new e({type:"nonoptional",innerType:r[t]});return Eo(this,"shape",o),o},checks:[]});return Bo(t,r)}(Fu,e,t[0])});function uu(e,t){const n={type:"object",shape:e??{},...xo(t)};return new au(n)}const cu=co("ZodUnion",(e,t)=>{As.init(e,t),_a.init(e,t),e.options=t.options});function lu(e,t){return new cu({type:"union",options:e,...xo(t)})}const pu=co("ZodIntersection",(e,t)=>{Ss.init(e,t),_a.init(e,t)}),fu=co("ZodRecord",(e,t)=>{Rs.init(e,t),_a.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function du(e,t,n){return new fu({type:"record",keyType:e,valueType:t,...xo(n)})}const hu=co("ZodEnum",(e,t)=>{Bs.init(e,t),_a.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 o={};for(const r of e){if(!n.has(r))throw new Error(`Key ${r} not found in enum`);o[r]=t.entries[r]}return new hu({...t,checks:[],...xo(r),entries:o})},e.exclude=(e,r)=>{const o={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete o[t]}return new hu({...t,checks:[],...xo(r),entries:o})}}),Du=co("ZodTransform",(e,t)=>{xs.init(e,t),_a.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new po(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(jo(r,n.value,t));else{const t=r;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(jo(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(e=>(n.value=e,n)):(n.value=o,n)}}),gu=co("ZodOptional",(e,t)=>{Ts.init(e,t),_a.init(e,t),e.unwrap=()=>e._zod.def.innerType});function mu(e){return new gu({type:"optional",innerType:e})}const yu=co("ZodNullable",(e,t)=>{$s.init(e,t),_a.init(e,t),e.unwrap=()=>e._zod.def.innerType});function bu(e){return new yu({type:"nullable",innerType:e})}const vu=co("ZodDefault",(e,t)=>{Ls.init(e,t),_a.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),Eu=co("ZodPrefault",(e,t)=>{Ms.init(e,t),_a.init(e,t),e.unwrap=()=>e._zod.def.innerType}),Fu=co("ZodNonOptional",(e,t)=>{js.init(e,t),_a.init(e,t),e.unwrap=()=>e._zod.def.innerType}),Cu=co("ZodCatch",(e,t)=>{Hs.init(e,t),_a.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),wu=co("ZodPipe",(e,t)=>{zs.init(e,t),_a.init(e,t),e.in=t.in,e.out=t.out});function _u(e,t){return new wu({type:"pipe",in:e,out:t})}const Au=co("ZodReadonly",(e,t)=>{Us.init(e,t),_a.init(e,t),e.unwrap=()=>e._zod.def.innerType}),Su=co("ZodCustom",(e,t)=>{Gs.init(e,t),_a.init(e,t)});function ku(e){return new Ja({type:"number",coerce:!0,checks:[],...xo(e)})}const Pu=su(Pa()).default([]).optional(),Ru=lu([Pa(),su(Pa())]),Bu=du(Pa(),Ru).optional(),xu=uu({script:Pa().min(1,{message:"script must be a non-empty string"}),warnPattern:Pa().min(1,{message:"warnPattern must be a non-empty string"}).optional().refine(e=>"string"!=typeof e||(e=>{try{return new RegExp(e),!0}catch{return!1}})(e),{message:"warnPattern: invalid regular expression"})}).strict(),Ou=du(Pa(),lu([Pa().min(1),xu])).default({}),Tu=lu([eu(),Pa(),new Ja({type:"number",checks:[],...xo(undefined)})]).transform(e=>{if("boolean"==typeof e)return e;if("number"==typeof e)return 1===e;const t=String(e).trim().toLowerCase();return"1"===t||"true"===t||"0"!==t&&"false"!==t&&void 0}).optional();const $u=uu({archive:Tu,combine:Tu,keep:Tu,sequential:Tu,live:Tu,plan:Tu,hangWarn:ku().int().positive().optional(),hangKill:ku().int().positive().optional(),hangKillGrace:ku().int().positive().optional(),scripts:lu([eu(),su(Pa())]).optional()}).strict().optional(),Lu=uu({file:Pa().optional()}).strict().optional(),Nu=uu({stash:Tu}).strict().optional(),Mu=uu({debug:Tu,boring:Tu,patch:Lu,run:$u,snap:Nu}).strict().optional(),ju=uu({stanPath:Pa().min(1,{message:"stanPath must be a non-empty string"}),scripts:Ou,includes:Pu,excludes:Pu,imports:Bu,maxUndos:ku().int().positive().optional(),devMode:Tu,cliDefaults:Mu,patchOpenCommand:Pa().optional()}).strict(),Iu=e=>{const n=(e=>{const t=we(e);if(t)return t;const n=new Set;let r=e;for(;r;){const e=Fe({cwd:r});if(!e||n.has(e))break;n.add(e);const t=we(e);if(t)return t;const o=m(e);if(o===e||n.has(o))break;r=o}return null})(e);if(!n)throw new Error("stan config not found");const r=t(n,"utf8"),o=n.endsWith(".json")?JSON.parse(r):uo.parse(r);try{const e=ju.parse(o);(e=>{if(["archive","init"].filter(t=>Object.prototype.hasOwnProperty.call(e??{},t)).length>0)throw new Error('scripts: keys "archive" and "init" not allowed')})(e.scripts??{});const t=(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})(e.imports);return{stanPath:e.stanPath,scripts:e.scripts,includes:e.includes??[],excludes:e.excludes??[],imports:t,maxUndos:e.maxUndos,devMode:e.devMode,patchOpenCommand:e.patchOpenCommand??"code -g {file}",cliDefaults:e.cliDefaults}}catch(e){throw new Error((e=>e instanceof pa?e.issues.map(e=>{const t=e.path.join(".")||"(root)";let n=e.message;return"stanPath"===t&&/Expected string/i.test(n)&&(n="stanPath must be a non-empty string"),"scripts"===t&&/expected\s+(record|object)/i.test(n)&&(n="scripts must be an object"),`${t}: ${n}`}).join("\n"):String(e))(e))}},Hu=async({cwd:e,stanPath:t,baseName:r,includes:o,excludes:i,updateSnapshot:s="createIfMissing",includeOutputDirInDiff:a=!1,onArchiveWarnings:l})=>{const{outDir:p,diffDir:f}=await ve(e,t),d=await De(e),h=await ye(d,{cwd:e,stanPath:t,includeOutputDir:!1,includes:o??[],excludes:i??[]}),D=await(async(e,t)=>{const n={};for(const r of t){const t=g(e,r),o=await u(t),i=_("sha256").update(o).digest("hex");n[r]=i}return n})(e,h),m=(e=>y(e,".archive.snapshot.json"))(f),b=n(m),v=b?JSON.parse(await u(m,"utf8")):{},E=b?h.filter(e=>!v[e]||v[e]!==D[e]):[...h],{textFiles:F,warningsBody:C}=await q(e,E),w=F,A=(C??"").trim();A&&"No archive warnings."!==A&&l?.(A);const S=y(p,`${r}.diff.tar`),k=await import("./index-ucZa1KMb-DZqceYU7.js");if(a){const n=Array.from(new Set([...w,`${t.replace(/\\/g,"/")}/output`]));await k.create({file:S,cwd:e,filter:K(t)},n)}else if(0===w.length){const n=(e=>y(e,".stan_no_changes"))(f);await c(n,"no changes","utf8");const r=[`${t.replace(/\\/g,"/")}/diff/.stan_no_changes`];await k.create({file:S,cwd:e},r)}else{const t=Array.from(new Set([...w]));await k.create({file:S,cwd:e},t)}return"replace"===s?await c(m,JSON.stringify(D,null,2),"utf8"):"createIfMissing"!==s||b||await c(m,JSON.stringify(D,null,2),"utf8"),{diffPath:S}};var zu,Ku={},Uu={},qu={};var Gu,Wu={};var Zu,Vu,Ju={},Yu={};var Qu,Xu,ec,tc,nc,rc,oc={};function ic(){if(tc)return ec;tc=1;var e=Xu?Qu:(Xu=1,Qu=function(e){if("string"!=typeof e||""===e)return!1;for(var t;t=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(t[2])return!0;e=e.slice(t.index+t[0].length)}return!1}),t={"{":"}","(":")","[":"]"},n=function(e){if("!"===e[0])return!0;for(var n=0,r=-2,o=-2,i=-2,s=-2,a=-2;n<e.length;){if("*"===e[n])return!0;if("?"===e[n+1]&&/[\].+)]/.test(e[n]))return!0;if(-1!==o&&"["===e[n]&&"]"!==e[n+1]&&(o<n&&(o=e.indexOf("]",n)),o>n)){if(-1===a||a>o)return!0;if(-1===(a=e.indexOf("\\",n))||a>o)return!0}if(-1!==i&&"{"===e[n]&&"}"!==e[n+1]&&(i=e.indexOf("}",n))>n&&(-1===(a=e.indexOf("\\",n))||a>i))return!0;if(-1!==s&&"("===e[n]&&"?"===e[n+1]&&/[:!=]/.test(e[n+2])&&")"!==e[n+3]&&(s=e.indexOf(")",n))>n&&(-1===(a=e.indexOf("\\",n))||a>s))return!0;if(-1!==r&&"("===e[n]&&"|"!==e[n+1]&&(r<n&&(r=e.indexOf("|",n)),-1!==r&&")"!==e[r+1]&&(s=e.indexOf(")",r))>r&&(-1===(a=e.indexOf("\\",r))||a>s)))return!0;if("\\"===e[n]){var u=e[n+1];n+=2;var c=t[u];if(c){var l=e.indexOf(c,n);-1!==l&&(n=l+1)}if("!"===e[n])return!0}else n++}return!1},r=function(e){if("!"===e[0])return!0;for(var n=0;n<e.length;){if(/[*?{}()[\]]/.test(e[n]))return!0;if("\\"===e[n]){var r=e[n+1];n+=2;var o=t[r];if(o){var i=e.indexOf(o,n);-1!==i&&(n=i+1)}if("!"===e[n])return!0}else n++}return!1};return ec=function(t,o){if("string"!=typeof t||""===t)return!1;if(e(t))return!0;var i=n;return o&&!1===o.strict&&(i=r),i(t)}}var sc,ac,uc,cc,lc,pc,fc,dc,hc,Dc,gc,mc,yc,bc,vc,Ec,Fc,Cc,wc,_c={};function Ac(){return sc||(sc=1,(e=_c).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,o)=>!1!==o&&!(!e.isInteger(t)||!e.isInteger(n))&&(Number(n)-Number(t))/Number(r)>=o,e.escapeNode=(e,t=0,n)=>{const r=e.nodes[t];r&&(n&&r.type===n||"open"===r.type||"close"===r.type)&&!0!==r.escaped&&(r.value="\\"+r.value,r.escaped=!0)},e.encloseBrace=e=>!("brace"!==e.type||e.commas>>0+e.ranges|0||(e.invalid=!0,0)),e.isInvalidBrace=e=>!("brace"!==e.type||!0!==e.invalid&&!e.dollar&&(e.commas>>0+e.ranges|0&&!0===e.open&&!0===e.close||(e.invalid=!0,0))),e.isOpenOrClose=e=>"open"===e.type||"close"===e.type||!0===e.open||!0===e.close,e.reduce=e=>e.reduce((e,t)=>("text"===t.type&&e.push(t.value),"range"===t.type&&(t.type="text"),e),[]),e.flatten=(...e)=>{const t=[],n=e=>{for(let r=0;r<e.length;r++){const o=e[r];Array.isArray(o)?n(o):void 0!==o&&t.push(o)}return t};return n(e),t}),_c;var e}function Sc(){if(uc)return ac;uc=1;const e=Ac();return ac=(t,n={})=>{const r=(t,o={})=>{const i=n.escapeInvalid&&e.isInvalidBrace(o),s=!0===t.invalid&&!0===n.escapeInvalid;let a="";if(t.value)return(i||s)&&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 kc(){if(fc)return pc;fc=1;const e=lc?cc:(lc=1,cc=function(e){return"number"==typeof e?e-e===0:"string"==typeof e&&""!==e.trim()&&(Number.isFinite?Number.isFinite(+e):isFinite(+e))}),t=(n,i,s)=>{if(!1===e(n))throw new TypeError("toRegexRange: expected the first argument to be a number");if(void 0===i||n===i)return String(n);if(!1===e(i))throw new TypeError("toRegexRange: expected the second argument to be a number.");let a={relaxZeros:!0,...s};"boolean"==typeof a.strictZeros&&(a.relaxZeros=!1===a.strictZeros);let u=n+":"+i+"="+String(a.relaxZeros)+String(a.shorthand)+String(a.capture)+String(a.wrap);if(t.cache.hasOwnProperty(u))return t.cache[u].result;let c=Math.min(n,i),l=Math.max(n,i);if(1===Math.abs(c-l)){let e=n+"|"+i;return a.capture?`(${e})`:!1===a.wrap?e:`(?:${e})`}let f=p(n)||p(i),d={min:n,max:i,a:c,b:l},h=[],D=[];return f&&(d.isPadded=f,d.maxLen=String(d.max).length),c<0&&(D=r(l<0?Math.abs(l):1,Math.abs(c),d,a),c=d.a=0),l>=0&&(h=r(c,l,d,a)),d.negatives=D,d.positives=h,d.result=function(e,t){let n=o(e,t,"-",!1)||[],r=o(t,e,"",!1)||[],i=o(e,t,"-?",!0)||[];return n.concat(i).concat(r).join("|")}(D,h),!0===a.capture?d.result=`(${d.result})`:!1!==a.wrap&&h.length+D.length>1&&(d.result=`(?:${d.result})`),t.cache[u]=d,d.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),o=r.length,i="",s=0;for(let e=0;e<o;e++){let[t,n]=r[e];t===n?i+=t:"0"!==t||"9"!==n?i+=l(t,n):s++}return s&&(i+=!0===n.shorthand?"\\d":"[0-9]"),{pattern:i,count:[s],digits:o}}function r(e,t,r,o){let s,l=function(e,t){let n=1,r=1,o=a(e,n),s=new Set([t]);for(;e<=o&&o<=t;)s.add(o),n+=1,o=a(e,n);for(o=u(t+1,r)-1;e<o&&o<=t;)s.add(o),r+=1,o=u(t+1,r)-1;return s=[...s],s.sort(i),s}(e,t),p=[],d=e;for(let e=0;e<l.length;e++){let t=l[e],i=n(String(d),String(t),o),a="";r.isPadded||!s||s.pattern!==i.pattern?(r.isPadded&&(a=f(t,r,o)),i.string=a+i.pattern+c(i.count),p.push(i),d=t+1,s=i):(s.count.length>1&&s.count.pop(),s.count.push(i.count[0]),s.string=s.pattern+c(s.count),d=t+1)}return p}function o(e,t,n,r,o){let i=[];for(let o of e){let{string:e}=o;r||s(t,"string",e)||i.push(n+e),r&&s(t,"string",e)&&i.push(n+e)}return i}function i(e,t){return e>t?1:t>e?-1:0}function s(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 u(e,t){return e-e%Math.pow(10,t)}function c(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 p(e){return/^-?(0+)\d/.test(e)}function f(e,t,n){if(!t.isPadded)return e;let r=Math.abs(t.maxLen-String(e).length),o=!1!==n.relaxZeros;switch(r){case 0:return"";case 1:return o?"0?":"0";case 2:return o?"0{0,2}":"00";default:return o?`0{0,${r}}`:`0{${r}}`}}return t.cache={},t.clearCache=()=>t.cache={},pc=t}function Pc(){if(hc)return dc;hc=1;const e=P,t=kc(),n=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),r=e=>"number"==typeof e||"string"==typeof e&&""!==e,o=e=>Number.isInteger(+e),i=e=>{let t=`${e}`,n=-1;if("-"===t[0]&&(t=t.slice(1)),"0"===t)return!1;for(;"0"===t[++n];);return n>0},s=(e,t,n)=>{if(t>0){let n="-"===e[0]?"-":"";n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,"0")}return!1===n?String(e):e},a=(e,t)=>{let n="-"===e[0]?"-":"";for(n&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return n?"-"+e:e},u=(e,n,r,o)=>{if(r)return t(e,n,{wrap:!1,...o});let i=String.fromCharCode(e);return e===n?i:`[${i}-${String.fromCharCode(n)}]`},c=(e,n,r)=>{if(Array.isArray(e)){let t=!0===r.wrap,n=r.capture?"":"?:";return t?`(${n}${e.join("|")})`:e.join("|")}return t(e,n,r)},l=(...t)=>new RangeError("Invalid range arguments: "+e.inspect(...t)),p=(e,t,n)=>{if(!0===n.strictRanges)throw l([e,t]);return[]},f=(e,t,n=1,r={})=>{let o=Number(e),p=Number(t);if(!Number.isInteger(o)||!Number.isInteger(p)){if(!0===r.strictRanges)throw l([e,t]);return[]}0===o&&(o=0),0===p&&(p=0);let f=o>p,d=String(e),h=String(t),D=String(n);n=Math.max(Math.abs(n),1);let g=i(d)||i(h)||i(D),m=g?Math.max(d.length,h.length,D.length):0,y=!1===g&&!1===((e,t,n)=>"string"==typeof e||"string"==typeof t||!0===n.stringify)(e,t,r),b=r.transform||(e=>t=>!0===e?Number(t):String(t))(y);if(r.toRegex&&1===n)return u(a(e,m),a(t,m),!0,r);let v={negatives:[],positives:[]},E=e=>v[e<0?"negatives":"positives"].push(Math.abs(e)),F=[],C=0;for(;f?o>=p:o<=p;)!0===r.toRegex&&n>1?E(o):F.push(s(b(o,C),m,y)),o=f?o-n:o+n,C++;return!0===r.toRegex?n>1?((e,t,n)=>{e.negatives.sort((e,t)=>e<t?-1:e>t?1:0),e.positives.sort((e,t)=>e<t?-1:e>t?1:0);let r,o=t.capture?"":"?:",i="",s="";return e.positives.length&&(i=e.positives.map(e=>a(String(e),n)).join("|")),e.negatives.length&&(s=`-(${o}${e.negatives.map(e=>a(String(e),n)).join("|")})`),r=i&&s?`${i}|${s}`:i||s,t.wrap?`(${o}${r})`:r})(v,r,m):c(F,null,{wrap:!1,...r}):F},d=(e,t,i,s={})=>{if(null==t&&r(e))return[e];if(!r(e)||!r(t))return p(e,t,s);if("function"==typeof i)return d(e,t,1,{transform:i});if(n(i))return d(e,t,0,i);let a={...s};return!0===a.capture&&(a.wrap=!0),i=i||a.step||1,o(i)?o(e)&&o(t)?f(e,t,i,a):((e,t,n=1,r={})=>{if(!o(e)&&e.length>1||!o(t)&&t.length>1)return p(e,t,r);let i=r.transform||(e=>String.fromCharCode(e)),s=`${e}`.charCodeAt(0),a=`${t}`.charCodeAt(0),l=s>a,f=Math.min(s,a),d=Math.max(s,a);if(r.toRegex&&1===n)return u(f,d,!1,r);let h=[],D=0;for(;l?s>=a:s<=a;)h.push(i(s,D)),s=l?s-n:s+n,D++;return!0===r.toRegex?c(h,null,{wrap:!1,options:r}):h})(e,t,Math.max(Math.abs(i),1),a):null==i||n(i)?d(e,t,1,i):((e,t)=>{if(!0===t.strictRanges)throw new TypeError(`Expected step "${e}" to be a number`);return[]})(i,a)};return dc=d}function Rc(){if(wc)return Cc;wc=1;const e=Sc(),t=function(){if(gc)return Dc;gc=1;const e=Pc(),t=Ac();return Dc=(n,r={})=>{const o=(n,i={})=>{const s=t.isInvalidBrace(i),a=!0===n.invalid&&!0===r.escapeInvalid,u=!0===s||!0===a,c=!0===r.escapeInvalid?"\\":"";let l="";if(!0===n.isOpen)return c+n.value;if(!0===n.isClose)return console.log("node.isClose",c,n.value),c+n.value;if("open"===n.type)return u?c+n.value:"(";if("close"===n.type)return u?c+n.value:")";if("comma"===n.type)return"comma"===n.prev.type?"":u?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){const o=t.reduce(n.nodes),i=e(...o,{...r,wrap:!1,toRegex:!0,strictZeros:!0});if(0!==i.length)return o.length>1&&i.length>1?`(${i})`:i}if(n.nodes)for(const e of n.nodes)l+=o(e,n);return l};return o(n)}}(),n=function(){if(yc)return mc;yc=1;const e=Pc(),t=Sc(),n=Ac(),r=(e="",t="",o=!1)=>{const i=[];if(e=[].concat(e),!(t=[].concat(t)).length)return e;if(!e.length)return o?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,o));else for(let e of t)!0===o&&"string"==typeof e&&(e=`{${e}}`),i.push(Array.isArray(e)?r(n,e,o):n+e);return n.flatten(i)};return mc=(o,i={})=>{const s=void 0===i.rangeLimit?1e3:i.rangeLimit,a=(o,u={})=>{o.queue=[];let c=u,l=u.queue;for(;"brace"!==c.type&&"root"!==c.type&&c.parent;)c=c.parent,l=c.queue;if(o.invalid||o.dollar)return void l.push(r(l.pop(),t(o,i)));if("brace"===o.type&&!0!==o.invalid&&2===o.nodes.length)return void l.push(r(l.pop(),["{}"]));if(o.nodes&&o.ranges>0){const a=n.reduce(o.nodes);if(n.exceedsLimit(...a,i.step,s))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let u=e(...a,i);return 0===u.length&&(u=t(o,i)),l.push(r(l.pop(),u)),void(o.nodes=[])}const p=n.encloseBrace(o);let f=o.queue,d=o;for(;"brace"!==d.type&&"root"!==d.type&&d.parent;)d=d.parent,f=d.queue;for(let e=0;e<o.nodes.length;e++){const t=o.nodes[e];"comma"!==t.type||"brace"!==o.type?"close"!==t.type?t.value&&"open"!==t.type?f.push(r(f.pop(),t.value)):t.nodes&&a(t,o):l.push(r(l.pop(),f,p)):(1===e&&f.push(""),f.push(""))}return f};return n.flatten(a(o))},mc}(),r=function(){if(Fc)return Ec;Fc=1;const e=Sc(),{MAX_LENGTH:t,CHAR_BACKSLASH:n,CHAR_BACKTICK:r,CHAR_COMMA:o,CHAR_DOT:i,CHAR_LEFT_PARENTHESES:s,CHAR_RIGHT_PARENTHESES:a,CHAR_LEFT_CURLY_BRACE:u,CHAR_RIGHT_CURLY_BRACE:c,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_RIGHT_SQUARE_BRACKET:p,CHAR_DOUBLE_QUOTE:f,CHAR_SINGLE_QUOTE:d,CHAR_NO_BREAK_SPACE:h,CHAR_ZERO_WIDTH_NOBREAK_SPACE:D}=vc?bc:(vc=1,bc={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 Ec=(g,m={})=>{if("string"!=typeof g)throw new TypeError("Expected a string");const y=m||{},b="number"==typeof y.maxLength?Math.min(t,y.maxLength):t;if(g.length>b)throw new SyntaxError(`Input length (${g.length}), exceeds max characters (${b})`);const v={type:"root",input:g,nodes:[]},E=[v];let F=v,C=v,w=0;const _=g.length;let A,S=0,k=0;const P=()=>g[S++],R=e=>{if("text"===e.type&&"dot"===C.type&&(C.type="text"),!C||"text"!==C.type||"text"!==e.type)return F.nodes.push(e),e.parent=F,e.prev=C,C=e,e;C.value+=e.value};for(R({type:"bos"});S<_;)if(F=E[E.length-1],A=P(),A!==D&&A!==h)if(A!==n)if(A!==p){if(A===l){let e;for(w++;S<_&&(e=P());)if(A+=e,e!==l)if(e!==n){if(e===p&&(w--,0===w))break}else A+=P();else w++;R({type:"text",value:A});continue}if(A!==s)if(A!==a){if(A===f||A===d||A===r){const e=A;let t;for(!0!==m.keepQuotes&&(A="");S<_&&(t=P());)if(t!==n){if(t===e){!0===m.keepQuotes&&(A+=t);break}A+=t}else A+=t+P();R({type:"text",value:A});continue}if(A===u){k++;const e=C.value&&"$"===C.value.slice(-1)||!0===F.dollar;F=R({type:"brace",open:!0,close:!1,dollar:e,depth:k,commas:0,ranges:0,nodes:[]}),E.push(F),R({type:"open",value:A});continue}if(A===c){if("brace"!==F.type){R({type:"text",value:A});continue}const e="close";F=E.pop(),F.close=!0,R({type:e,value:A}),k--,F=E[E.length-1];continue}if(A===o&&k>0){if(F.ranges>0){F.ranges=0;const t=F.nodes.shift();F.nodes=[t,{type:"text",value:e(F)}]}R({type:"comma",value:A}),F.commas++}else{if(A===i&&k>0&&0===F.commas){const e=F.nodes;if(0===k||0===e.length){R({type:"text",value:A});continue}if("dot"===C.type){if(F.range=[],C.value+=A,C.type="range",3!==F.nodes.length&&5!==F.nodes.length){F.invalid=!0,F.ranges=0,C.type="text";continue}F.ranges++,F.args=[];continue}if("range"===C.type){e.pop();const t=e[e.length-1];t.value+=C.value+A,C=t,F.ranges--;continue}R({type:"dot",value:A});continue}R({type:"text",value:A})}}else{if("paren"!==F.type){R({type:"text",value:A});continue}F=E.pop(),R({type:"text",value:A}),F=E[E.length-1]}else F=R({type:"paren",nodes:[]}),E.push(F),R({type:"text",value:A})}else R({type:"text",value:"\\"+A});else R({type:"text",value:(m.keepEscaping?A:"")+P()});do{if(F=E.pop(),"root"!==F.type){F.nodes.forEach(e=>{e.nodes||("open"===e.type&&(e.isOpen=!0),"close"===e.type&&(e.isClose=!0),e.nodes||(e.type="text"),e.invalid=!0)});const e=E[E.length-1],t=e.nodes.indexOf(F);e.nodes.splice(t,1,...F.nodes)}}while(E.length>0);return R({type:"eos"}),v},Ec}(),o=(e,t={})=>{let n=[];if(Array.isArray(e))for(const r of e){const e=o.create(r,t);Array.isArray(e)?n.push(...e):n.push(e)}else n=[].concat(o.create(e,t));return t&&!0===t.expand&&!0===t.nodupes&&(n=[...new Set(n)]),n};return o.parse=(e,t={})=>r(e,t),o.stringify=(t,n={})=>e("string"==typeof t?o.parse(t,n):t,n),o.compile=(e,n={})=>("string"==typeof e&&(e=o.parse(e,n)),t(e,n)),o.expand=(e,t={})=>{"string"==typeof e&&(e=o.parse(e,t));let r=n(e,t);return!0===t.noempty&&(r=r.filter(Boolean)),!0===t.nodupes&&(r=[...new Set(r)]),r},o.create=(e,t={})=>""===e||e.length<3?[e]:!0!==t.expand?o.compile(e,t):o.expand(e,t),Cc=o}var Bc,xc,Oc,Tc,$c,Lc,Nc,Mc,jc,Ic,Hc,zc,Kc,Uc,qc={};function Gc(){if(xc)return Bc;xc=1;const e=k,t="\\\\/",n=`[^${t}]`,r="\\.",o="\\/",i="[^/]",s=`(?:${o}|$)`,a=`(?:^|${o})`,u=`${r}{1,2}${s}`,c={DOT_LITERAL:r,PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:o,ONE_CHAR:"(?=.)",QMARK:i,END_ANCHOR:s,DOTS_SLASH:u,NO_DOT:`(?!${r})`,NO_DOTS:`(?!${a}${u})`,NO_DOT_SLASH:`(?!${r}{0,1}${s})`,NO_DOTS_SLASH:`(?!${u})`,QMARK_NO_DOT:`[^.${o}]`,STAR:`${i}*?`,START_ANCHOR:a},l={...c,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 Bc={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:e.sep,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?l:c}}function Wc(){return Oc||(Oc=1,function(e){const t=k,n="win32"===process.platform,{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:o,REGEX_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_GLOBAL:s}=Gc();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(s,"\\$1"),e.toPosixSlashes=e=>e.replace(r,"/"),e.removeBackslashes=e=>e.replace(o,e=>"\\"===e?"":e),e.supportsLookbehinds=()=>{const e=process.version.slice(1).split(".").map(Number);return 3===e.length&&e[0]>=9||8===e[0]&&e[1]>=10},e.isWindows=e=>e&&"boolean"==typeof e.windows?e.windows:!0===n||"\\"===t.sep,e.escapeLast=(t,n,r)=>{const o=t.lastIndexOf(n,r);return-1===o?t:"\\"===t[o-1]?e.escapeLast(t,n,o-1):`${t.slice(0,o)}\\${t.slice(o)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith("./")&&(n=n.slice(2),t.prefix="./"),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?"":"^"}(?:${e})${n.contains?"":"$"}`;return!0===t.negated&&(r=`(?:^(?!${r}).*$)`),r}}(qc)),qc}function Zc(){return Hc?Ic:(Hc=1,Ic=function(){if(jc)return Mc;jc=1;const e=k,t=function(){if($c)return Tc;$c=1;const e=Wc(),{CHAR_ASTERISK:t,CHAR_AT:n,CHAR_BACKWARD_SLASH:r,CHAR_COMMA:o,CHAR_DOT:i,CHAR_EXCLAMATION_MARK:s,CHAR_FORWARD_SLASH:a,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:c,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:p,CHAR_QUESTION_MARK:f,CHAR_RIGHT_CURLY_BRACE:d,CHAR_RIGHT_PARENTHESES:h,CHAR_RIGHT_SQUARE_BRACKET:D}=Gc(),g=e=>e===a||e===r,m=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};return Tc=(y,b)=>{const v=b||{},E=y.length-1,F=!0===v.parts||!0===v.scanToEnd,C=[],w=[],_=[];let A,S,k=y,P=-1,R=0,B=0,x=!1,O=!1,T=!1,$=!1,L=!1,N=!1,M=!1,j=!1,I=!1,H=!1,z=0,K={value:"",depth:0,isGlob:!1};const U=()=>P>=E,q=()=>k.charCodeAt(P+1),G=()=>(A=S,k.charCodeAt(++P));for(;P<E;){let e;if(S=G(),S!==r){if(!0===N||S===u){for(z++;!0!==U()&&(S=G());)if(S!==r)if(S!==u){if(!0!==N&&S===i&&(S=G())===i){if(x=K.isBrace=!0,T=K.isGlob=!0,H=!0,!0===F)continue;break}if(!0!==N&&S===o){if(x=K.isBrace=!0,T=K.isGlob=!0,H=!0,!0===F)continue;break}if(S===d&&(z--,0===z)){N=!1,x=K.isBrace=!0,H=!0;break}}else z++;else M=K.backslashes=!0,G();if(!0===F)continue;break}if(S!==a){if(!0!==v.noext&&1==(S===p||S===n||S===t||S===f||S===s)&&q()===c){if(T=K.isGlob=!0,$=K.isExtglob=!0,H=!0,S===s&&P===R&&(I=!0),!0===F){for(;!0!==U()&&(S=G());)if(S!==r){if(S===h){T=K.isGlob=!0,H=!0;break}}else M=K.backslashes=!0,S=G();continue}break}if(S===t){if(A===t&&(L=K.isGlobstar=!0),T=K.isGlob=!0,H=!0,!0===F)continue;break}if(S===f){if(T=K.isGlob=!0,H=!0,!0===F)continue;break}if(S===l){for(;!0!==U()&&(e=G());)if(e!==r){if(e===D){O=K.isBracket=!0,T=K.isGlob=!0,H=!0;break}}else M=K.backslashes=!0,G();if(!0===F)continue;break}if(!0===v.nonegate||S!==s||P!==R){if(!0!==v.noparen&&S===c){if(T=K.isGlob=!0,!0===F){for(;!0!==U()&&(S=G());)if(S!==c){if(S===h){H=!0;break}}else M=K.backslashes=!0,S=G();continue}break}if(!0===T){if(H=!0,!0===F)continue;break}}else j=K.negated=!0,R++}else{if(C.push(P),w.push(K),K={value:"",depth:0,isGlob:!1},!0===H)continue;if(A===i&&P===R+1){R+=2;continue}B=P+1}}else M=K.backslashes=!0,S=G(),S===u&&(N=!0)}!0===v.noext&&($=!1,T=!1);let W=k,Z="",V="";R>0&&(Z=k.slice(0,R),k=k.slice(R),B-=R),W&&!0===T&&B>0?(W=k.slice(0,B),V=k.slice(B)):!0===T?(W="",V=k):W=k,W&&""!==W&&"/"!==W&&W!==k&&g(W.charCodeAt(W.length-1))&&(W=W.slice(0,-1)),!0===v.unescape&&(V&&(V=e.removeBackslashes(V)),W&&!0===M&&(W=e.removeBackslashes(W)));const J={prefix:Z,input:y,start:R,base:W,glob:V,isBrace:x,isBracket:O,isGlob:T,isExtglob:$,isGlobstar:L,negated:j,negatedExtglob:I};if(!0===v.tokens&&(J.maxDepth=0,g(S)||w.push(K),J.tokens=w),!0===v.parts||!0===v.tokens){let e;for(let t=0;t<C.length;t++){const n=e?e+1:R,r=C[t],o=y.slice(n,r);v.tokens&&(0===t&&0!==R?(w[t].isPrefix=!0,w[t].value=Z):w[t].value=o,m(w[t]),J.maxDepth+=w[t].depth),0===t&&""===o||_.push(o),e=r}if(e&&e+1<y.length){const t=y.slice(e+1);_.push(t),v.tokens&&(w[w.length-1].value=t,m(w[w.length-1]),J.maxDepth+=w[w.length-1].depth)}J.slashes=C,J.parts=_}return J},Tc}(),n=function(){if(Nc)return Lc;Nc=1;const e=Gc(),t=Wc(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:i,REPLACEMENTS:s}=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},u=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,c=(l,p)=>{if("string"!=typeof l)throw new TypeError("Expected a string");l=s[l]||l;const f={...p},d="number"==typeof f.maxLength?Math.min(n,f.maxLength):n;let h=l.length;if(h>d)throw new SyntaxError(`Input length: ${h}, exceeds maximum allowed length: ${d}`);const D={type:"bos",value:"",output:f.prepend||""},g=[D],m=f.capture?"":"?:",y=t.isWindows(p),b=e.globChars(y),v=e.extglobChars(b),{DOT_LITERAL:E,PLUS_LITERAL:F,SLASH_LITERAL:C,ONE_CHAR:w,DOTS_SLASH:_,NO_DOT:A,NO_DOT_SLASH:S,NO_DOTS_SLASH:k,QMARK:P,QMARK_NO_DOT:R,STAR:B,START_ANCHOR:x}=b,O=e=>`(${m}(?:(?!${x}${e.dot?_:E}).)*?)`,T=f.dot?"":A,$=f.dot?P:R;let L=!0===f.bash?O(f):B;f.capture&&(L=`(${L})`),"boolean"==typeof f.noext&&(f.noextglob=f.noext);const N={input:l,index:-1,start:0,dot:!0===f.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:g};l=t.removePrefix(l,N),h=l.length;const M=[],j=[],I=[];let H,z=D;const K=()=>N.index===h-1,U=N.peek=(e=1)=>l[N.index+e],q=N.advance=()=>l[++N.index]||"",G=()=>l.slice(N.index+1),W=(e="",t=0)=>{N.consumed+=e,N.index+=t},Z=e=>{N.output+=null!=e.output?e.output:e.value,W(e.value)},V=()=>{let e=1;for(;"!"===U()&&("("!==U(2)||"?"===U(3));)q(),N.start++,e++;return e%2!=0&&(N.negated=!0,N.start++,!0)},J=e=>{N[e]++,I.push(e)},Y=e=>{N[e]--,I.pop()},Q=e=>{if("globstar"===z.type){const t=N.braces>0&&("comma"===e.type||"brace"===e.type),n=!0===e.extglob||M.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||n||(N.output=N.output.slice(0,-z.output.length),z.type="star",z.value="*",z.output=L,N.output+=z.output)}if(M.length&&"paren"!==e.type&&(M[M.length-1].inner+=e.value),(e.value||e.output)&&Z(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={...v[t],conditions:1,inner:""};n.prev=z,n.parens=N.parens,n.output=N.output;const r=(f.capture?"(":"")+n.open;J("parens"),Q({type:e,value:t,output:N.output?"":w}),Q({type:"paren",extglob:!0,value:q(),output:r}),M.push(n)},ee=e=>{let t,n=e.close+(f.capture?")":"");if("negate"===e.type){let r=L;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(r=O(f)),(r!==L||K()||/^\)+$/.test(G()))&&(n=e.close=`)$))${r}`),e.inner.includes("*")&&(t=G())&&/^\.[^\\/.]+$/.test(t)){const o=c(t,{...p,fastpaths:!1}).output;n=e.close=`)${o})${r})`}"bos"===e.prev.type&&(N.negatedExtglob=!0)}Q({type:"paren",extglob:!0,value:H,output:n}),Y("parens")};if(!1!==f.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(l)){let e=!1,n=l.replace(i,(t,n,r,o,i,s)=>"\\"===o?(e=!0,t):"?"===o?n?n+o+(i?P.repeat(i.length):""):0===s?$+(i?P.repeat(i.length):""):P.repeat(r.length):"."===o?E.repeat(r.length):"*"===o?n?n+o+(i?L:""):L:n?t:`\\${t}`);return!0===e&&(n=!0===f.unescape?n.replace(/\\/g,""):n.replace(/\\+/g,e=>e.length%2==0?"\\\\":e?"\\":"")),n===l&&!0===f.contains?(N.output=l,N):(N.output=t.wrapOutput(n,N,p),N)}for(;!K();){if(H=q(),"\0"===H)continue;if("\\"===H){const e=U();if("/"===e&&!0!==f.bash)continue;if("."===e||";"===e)continue;if(!e){H+="\\",Q({type:"text",value:H});continue}const t=/^\\+/.exec(G());let n=0;if(t&&t[0].length>2&&(n=t[0].length,N.index+=n,n%2!=0&&(H+="\\")),!0===f.unescape?H=q():H+=q(),0===N.brackets){Q({type:"text",value:H});continue}}if(N.brackets>0&&("]"!==H||"["===z.value||"[^"===z.value)){if(!1!==f.posix&&":"===H){const e=z.value.slice(1);if(e.includes("[")&&(z.posix=!0,e.includes(":"))){const e=z.value.lastIndexOf("["),t=z.value.slice(0,e),n=z.value.slice(e+2),o=r[n];if(o){z.value=t+o,N.backtrack=!0,q(),D.output||1!==g.indexOf(z)||(D.output=w);continue}}}("["===H&&":"!==U()||"-"===H&&"]"===U())&&(H=`\\${H}`),"]"!==H||"["!==z.value&&"[^"!==z.value||(H=`\\${H}`),!0===f.posix&&"!"===H&&"["===z.value&&(H="^"),z.value+=H,Z({value:H});continue}if(1===N.quotes&&'"'!==H){H=t.escapeRegex(H),z.value+=H,Z({value:H});continue}if('"'===H){N.quotes=1===N.quotes?0:1,!0===f.keepQuotes&&Q({type:"text",value:H});continue}if("("===H){J("parens"),Q({type:"paren",value:H});continue}if(")"===H){if(0===N.parens&&!0===f.strictBrackets)throw new SyntaxError(u("opening","("));const e=M[M.length-1];if(e&&N.parens===e.parens+1){ee(M.pop());continue}Q({type:"paren",value:H,output:N.parens?")":"\\)"}),Y("parens");continue}if("["===H){if(!0!==f.nobracket&&G().includes("]"))J("brackets");else{if(!0!==f.nobracket&&!0===f.strictBrackets)throw new SyntaxError(u("closing","]"));H=`\\${H}`}Q({type:"bracket",value:H});continue}if("]"===H){if(!0===f.nobracket||z&&"bracket"===z.type&&1===z.value.length){Q({type:"text",value:H,output:`\\${H}`});continue}if(0===N.brackets){if(!0===f.strictBrackets)throw new SyntaxError(u("opening","["));Q({type:"text",value:H,output:`\\${H}`});continue}Y("brackets");const e=z.value.slice(1);if(!0===z.posix||"^"!==e[0]||e.includes("/")||(H=`/${H}`),z.value+=H,Z({value:H}),!1===f.literalBrackets||t.hasRegexChars(e))continue;const n=t.escapeRegex(z.value);if(N.output=N.output.slice(0,-z.value.length),!0===f.literalBrackets){N.output+=n,z.value=n;continue}z.value=`(${m}${n}|${z.value})`,N.output+=z.value;continue}if("{"===H&&!0!==f.nobrace){J("braces");const e={type:"brace",value:H,output:"(",outputIndex:N.output.length,tokensIndex:N.tokens.length};j.push(e),Q(e);continue}if("}"===H){const e=j[j.length-1];if(!0===f.nobrace||!e){Q({type:"text",value:H,output:H});continue}let t=")";if(!0===e.dots){const e=g.slice(),n=[];for(let t=e.length-1;t>=0&&(g.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&n.unshift(e[t].value);t=a(n,f),N.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const n=N.output.slice(0,e.outputIndex),r=N.tokens.slice(e.tokensIndex);e.value=e.output="\\{",H=t="\\}",N.output=n;for(const e of r)N.output+=e.output||e.value}Q({type:"brace",value:H,output:t}),Y("braces"),j.pop();continue}if("|"===H){M.length>0&&M[M.length-1].conditions++,Q({type:"text",value:H});continue}if(","===H){let e=H;const t=j[j.length-1];t&&"braces"===I[I.length-1]&&(t.comma=!0,e="|"),Q({type:"comma",value:H,output:e});continue}if("/"===H){if("dot"===z.type&&N.index===N.start+1){N.start=N.index+1,N.consumed="",N.output="",g.pop(),z=D;continue}Q({type:"slash",value:H,output:C});continue}if("."===H){if(N.braces>0&&"dot"===z.type){"."===z.value&&(z.output=E);const e=j[j.length-1];z.type="dots",z.output+=H,z.value+=H,e.dots=!0;continue}if(N.braces+N.parens===0&&"bos"!==z.type&&"slash"!==z.type){Q({type:"text",value:H,output:E});continue}Q({type:"dot",value:H,output:E});continue}if("?"===H){if((!z||"("!==z.value)&&!0!==f.noextglob&&"("===U()&&"?"!==U(2)){X("qmark",H);continue}if(z&&"paren"===z.type){const e=U();let n=H;if("<"===e&&!t.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");("("===z.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(G()))&&(n=`\\${H}`),Q({type:"text",value:H,output:n});continue}if(!0!==f.dot&&("slash"===z.type||"bos"===z.type)){Q({type:"qmark",value:H,output:R});continue}Q({type:"qmark",value:H,output:P});continue}if("!"===H){if(!0!==f.noextglob&&"("===U()&&("?"!==U(2)||!/[!=<:]/.test(U(3)))){X("negate",H);continue}if(!0!==f.nonegate&&0===N.index){V();continue}}if("+"===H){if(!0!==f.noextglob&&"("===U()&&"?"!==U(2)){X("plus",H);continue}if(z&&"("===z.value||!1===f.regex){Q({type:"plus",value:H,output:F});continue}if(z&&("bracket"===z.type||"paren"===z.type||"brace"===z.type)||N.parens>0){Q({type:"plus",value:H});continue}Q({type:"plus",value:F});continue}if("@"===H){if(!0!==f.noextglob&&"("===U()&&"?"!==U(2)){Q({type:"at",extglob:!0,value:H,output:""});continue}Q({type:"text",value:H});continue}if("*"!==H){"$"!==H&&"^"!==H||(H=`\\${H}`);const e=o.exec(G());e&&(H+=e[0],N.index+=e[0].length),Q({type:"text",value:H});continue}if(z&&("globstar"===z.type||!0===z.star)){z.type="star",z.star=!0,z.value+=H,z.output=L,N.backtrack=!0,N.globstar=!0,W(H);continue}let e=G();if(!0!==f.noextglob&&/^\([^?]/.test(e)){X("star",H);continue}if("star"===z.type){if(!0===f.noglobstar){W(H);continue}const t=z.prev,n=t.prev,r="slash"===t.type||"bos"===t.type,o=n&&("star"===n.type||"globstar"===n.type);if(!0===f.bash&&(!r||e[0]&&"/"!==e[0])){Q({type:"star",value:H,output:""});continue}const i=N.braces>0&&("comma"===t.type||"brace"===t.type),s=M.length&&("pipe"===t.type||"paren"===t.type);if(!r&&"paren"!==t.type&&!i&&!s){Q({type:"star",value:H,output:""});continue}for(;"/**"===e.slice(0,3);){const t=l[N.index+4];if(t&&"/"!==t)break;e=e.slice(3),W("/**",3)}if("bos"===t.type&&K()){z.type="globstar",z.value+=H,z.output=O(f),N.output=z.output,N.globstar=!0,W(H);continue}if("slash"===t.type&&"bos"!==t.prev.type&&!o&&K()){N.output=N.output.slice(0,-(t.output+z.output).length),t.output=`(?:${t.output}`,z.type="globstar",z.output=O(f)+(f.strictSlashes?")":"|$)"),z.value+=H,N.globstar=!0,N.output+=t.output+z.output,W(H);continue}if("slash"===t.type&&"bos"!==t.prev.type&&"/"===e[0]){const n=void 0!==e[1]?"|$":"";N.output=N.output.slice(0,-(t.output+z.output).length),t.output=`(?:${t.output}`,z.type="globstar",z.output=`${O(f)}${C}|${C}${n})`,z.value+=H,N.output+=t.output+z.output,N.globstar=!0,W(H+q()),Q({type:"slash",value:"/",output:""});continue}if("bos"===t.type&&"/"===e[0]){z.type="globstar",z.value+=H,z.output=`(?:^|${C}|${O(f)}${C})`,N.output=z.output,N.globstar=!0,W(H+q()),Q({type:"slash",value:"/",output:""});continue}N.output=N.output.slice(0,-z.output.length),z.type="globstar",z.output=O(f),z.value+=H,N.output+=z.output,N.globstar=!0,W(H);continue}const n={type:"star",value:H,output:L};!0!==f.bash?!z||"bracket"!==z.type&&"paren"!==z.type||!0!==f.regex?(N.index!==N.start&&"slash"!==z.type&&"dot"!==z.type||("dot"===z.type?(N.output+=S,z.output+=S):!0===f.dot?(N.output+=k,z.output+=k):(N.output+=T,z.output+=T),"*"!==U()&&(N.output+=w,z.output+=w)),Q(n)):(n.output=H,Q(n)):(n.output=".*?","bos"!==z.type&&"slash"!==z.type||(n.output=T+n.output),Q(n))}for(;N.brackets>0;){if(!0===f.strictBrackets)throw new SyntaxError(u("closing","]"));N.output=t.escapeLast(N.output,"["),Y("brackets")}for(;N.parens>0;){if(!0===f.strictBrackets)throw new SyntaxError(u("closing",")"));N.output=t.escapeLast(N.output,"("),Y("parens")}for(;N.braces>0;){if(!0===f.strictBrackets)throw new SyntaxError(u("closing","}"));N.output=t.escapeLast(N.output,"{"),Y("braces")}if(!0===f.strictSlashes||"star"!==z.type&&"bracket"!==z.type||Q({type:"maybe_slash",value:"",output:`${C}?`}),!0===N.backtrack){N.output="";for(const e of N.tokens)N.output+=null!=e.output?e.output:e.value,e.suffix&&(N.output+=e.suffix)}return N};return c.fastpaths=(r,o)=>{const i={...o},a="number"==typeof i.maxLength?Math.min(n,i.maxLength):n,u=r.length;if(u>a)throw new SyntaxError(`Input length: ${u}, exceeds maximum allowed length: ${a}`);r=s[r]||r;const c=t.isWindows(o),{DOT_LITERAL:l,SLASH_LITERAL:p,ONE_CHAR:f,DOTS_SLASH:d,NO_DOT:h,NO_DOTS:D,NO_DOTS_SLASH:g,STAR:m,START_ANCHOR:y}=e.globChars(c),b=i.dot?D:h,v=i.dot?g:h,E=i.capture?"":"?:";let F=!0===i.bash?".*?":m;i.capture&&(F=`(${F})`);const C=e=>!0===e.noglobstar?F:`(${E}(?:(?!${y}${e.dot?d:l}).)*?)`,w=e=>{switch(e){case"*":return`${b}${f}${F}`;case".*":return`${l}${f}${F}`;case"*.*":return`${b}${F}${l}${f}${F}`;case"*/*":return`${b}${F}${p}${f}${v}${F}`;case"**":return b+C(i);case"**/*":return`(?:${b}${C(i)}${p})?${v}${f}${F}`;case"**/*.*":return`(?:${b}${C(i)}${p})?${v}${F}${l}${f}${F}`;case"**/.*":return`(?:${b}${C(i)}${p})?${l}${f}${F}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const n=w(t[1]);if(!n)return;return n+l+t[2]}}},_=t.removePrefix(r,{negated:!1,prefix:""});let A=w(_);return A&&!0!==i.strictSlashes&&(A+=`${p}?`),A},Lc=c}(),r=Wc(),o=Gc(),i=(e,t,n=!1)=>{if(Array.isArray(e)){const r=e.map(e=>i(e,t,n)),o=e=>{for(const t of r){const n=t(e);if(n)return n}return!1};return o}const o=(s=e)&&"object"==typeof s&&!Array.isArray(s)&&e.tokens&&e.input;var s;if(""===e||"string"!=typeof e&&!o)throw new TypeError("Expected pattern to be a non-empty string");const a=t||{},u=r.isWindows(t),c=o?i.compileRe(e,t):i.makeRe(e,t,!1,!0),l=c.state;delete c.state;let p=()=>!1;if(a.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};p=i(a.ignore,e,n)}const f=(n,r=!1)=>{const{isMatch:o,match:s,output:f}=i.test(n,c,t,{glob:e,posix:u}),d={glob:e,state:l,regex:c,posix:u,input:n,output:f,match:s,isMatch:o};return"function"==typeof a.onResult&&a.onResult(d),!1===o?(d.isMatch=!1,!!r&&d):p(n)?("function"==typeof a.onIgnore&&a.onIgnore(d),d.isMatch=!1,!!r&&d):("function"==typeof a.onMatch&&a.onMatch(d),!r||d)};return n&&(f.state=l),f};return i.test=(e,t,n,{glob:o,posix:s}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};const a=n||{},u=a.format||(s?r.toPosixSlashes:null);let c=e===o,l=c&&u?u(e):e;return!1===c&&(l=u?u(e):e,c=l===o),!1!==c&&!0!==a.capture||(c=!0===a.matchBase||!0===a.basename?i.matchBase(e,t,n,s):t.exec(l)),{isMatch:Boolean(c),match:c,output:l}},i.matchBase=(t,n,o,s=r.isWindows(o))=>(n instanceof RegExp?n:i.makeRe(n,o)).test(e.basename(t)),i.isMatch=(e,t,n)=>i(t,n)(e),i.parse=(e,t)=>Array.isArray(e)?e.map(e=>i.parse(e,t)):n(e,{...t,fastpaths:!1}),i.scan=(e,n)=>t(e,n),i.compileRe=(e,t,n=!1,r=!1)=>{if(!0===n)return e.output;const o=t||{},s=o.contains?"":"^",a=o.contains?"":"$";let u=`${s}(?:${e.output})${a}`;e&&!0===e.negated&&(u=`^(?!${u}).*$`);const c=i.toRegex(u,t);return!0===r&&(c.state=e),c},i.makeRe=(e,t={},r=!1,o=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let s={negated:!1,fastpaths:!0};return!1===t.fastpaths||"."!==e[0]&&"*"!==e[0]||(s.output=n.fastpaths(e,t)),s.output||(s=n(e,t)),i.compileRe(s,t,r,o)},i.toRegex=(e,t)=>{try{const n=t||{};return new RegExp(e,n.flags||(n.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},i.constants=o,Mc=i}())}var Vc,Jc,Yc,Qc={};function Xc(){if(Jc)return Vc;Jc=1;const e=R.PassThrough,t=Array.prototype.slice;function n(t,r){if(Array.isArray(t))for(let e=0,o=t.length;e<o;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 Vc=function(){const r=[],o=t.call(arguments);let i=!1,s=o[o.length-1];s&&!Array.isArray(s)&&null==s.pipe?o.pop():s={};const a=!1!==s.end,u=!0===s.pipeError;null==s.objectMode&&(s.objectMode=!0),null==s.highWaterMark&&(s.highWaterMark=65536);const c=e(s);function l(){for(let e=0,t=arguments.length;e<t;e++)r.push(n(arguments[e],s));return p(),this}function p(){if(i)return;i=!0;let e=r.shift();if(!e)return void process.nextTick(f);Array.isArray(e)||(e=[e]);let t=e.length+1;function n(){--t>0||(i=!1,p())}function o(e){function t(){e.removeListener("merge2UnpipeEnd",t),e.removeListener("end",t),u&&e.removeListener("error",r),n()}function r(e){c.emit("error",e)}if(e._readableState.endEmitted)return n();e.on("merge2UnpipeEnd",t),e.on("end",t),u&&e.on("error",r),e.pipe(c,{end:!1}),e.resume()}for(let t=0;t<e.length;t++)o(e[t]);n()}function f(){i=!1,c.emit("queueDrain"),a&&c.end()}return c.setMaxListeners(0),c.add=l,c.on("unpipe",function(e){e.emit("merge2UnpipeEnd")}),o.length&&l.apply(null,o),c},Vc}var el,tl,nl,rl={};function ol(){if(tl)return Uu;tl=1,Object.defineProperty(Uu,"__esModule",{value:!0}),Uu.string=Uu.stream=Uu.pattern=Uu.path=Uu.fs=Uu.errno=Uu.array=void 0;const e=(zu||(zu=1,Object.defineProperty(qu,"__esModule",{value:!0}),qu.splitWhen=qu.flatten=void 0,qu.flatten=function(e){return e.reduce((e,t)=>[].concat(e,t),[])},qu.splitWhen=function(e,t){const n=[[]];let r=0;for(const o of e)t(o)?(r++,n[r]=[]):n[r].push(o);return n}),qu);Uu.array=e;const t=(Gu||(Gu=1,Object.defineProperty(Wu,"__esModule",{value:!0}),Wu.isEnoentCodeError=void 0,Wu.isEnoentCodeError=function(e){return"ENOENT"===e.code}),Wu);Uu.errno=t;const n=function(){if(Zu)return Ju;Zu=1,Object.defineProperty(Ju,"__esModule",{value:!0}),Ju.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 Ju.createDirentFromStats=function(t,n){return new e(t,n)},Ju}();Uu.fs=n;const r=function(){if(Vu)return Yu;Vu=1,Object.defineProperty(Yu,"__esModule",{value:!0}),Yu.convertPosixPathToPattern=Yu.convertWindowsPathToPattern=Yu.convertPathToPattern=Yu.escapePosixPath=Yu.escapeWindowsPath=Yu.escape=Yu.removeLeadingDotSegment=Yu.makeAbsolute=Yu.unixify=void 0;const e=k,t="win32"===S.platform(),n=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,r=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,o=/^\\\\([.?])/,i=/\\(?![!()+@[\]{}])/g;function s(e){return e.replace(r,"\\$2")}function a(e){return e.replace(n,"\\$2")}function u(e){return s(e).replace(o,"//$1").replace(i,"/")}function c(e){return a(e)}return Yu.unixify=function(e){return e.replace(/\\/g,"/")},Yu.makeAbsolute=function(t,n){return e.resolve(t,n)},Yu.removeLeadingDotSegment=function(e){if("."===e.charAt(0)){const t=e.charAt(1);if("/"===t||"\\"===t)return e.slice(2)}return e},Yu.escape=t?s:a,Yu.escapeWindowsPath=s,Yu.escapePosixPath=a,Yu.convertPathToPattern=t?u:c,Yu.convertWindowsPathToPattern=u,Yu.convertPosixPathToPattern=c,Yu}();Uu.path=r;const o=function(){if(Uc)return oc;Uc=1,Object.defineProperty(oc,"__esModule",{value:!0}),oc.isAbsolute=oc.partitionAbsoluteAndRelative=oc.removeDuplicateSlashes=oc.matchAny=oc.convertPatternsToRe=oc.makeRe=oc.getPatternParts=oc.expandBraceExpansion=oc.expandPatternsWithBraceExpansion=oc.isAffectDepthOfReadingPattern=oc.endsWithSlashGlobStar=oc.hasGlobStar=oc.getBaseDirectory=oc.isPatternRelatedToParentDirectory=oc.getPatternsOutsideCurrentDirectory=oc.getPatternsInsideCurrentDirectory=oc.getPositivePatterns=oc.getNegativePatterns=oc.isPositivePattern=oc.isNegativePattern=oc.convertToNegativePattern=oc.convertToPositivePattern=oc.isDynamicPattern=oc.isStaticPattern=void 0;const e=k,t=function(){if(rc)return nc;rc=1;var e=ic(),t=k.posix.dirname,n="win32"===S.platform(),r=/\\/g,o=/[\{\[].*[\}\]]$/,i=/(^|[^\\])([\{\[]|\([^\)]+$)/,s=/\\([\!\*\?\|\[\]\(\)\{\}])/g;return nc=function(a,u){Object.assign({flipBackslashes:!0},u).flipBackslashes&&n&&a.indexOf("/")<0&&(a=a.replace(r,"/")),o.test(a)&&(a+="/"),a+="a";do{a=t(a)}while(e(a)||i.test(a));return a.replace(s,"$1")}}(),n=function(){if(Kc)return zc;Kc=1;const e=P,t=Rc(),n=Zc(),r=Wc(),o=e=>""===e||"./"===e,i=e=>{const t=e.indexOf("{");return t>-1&&e.indexOf("}",t)>-1},s=(e,t,r)=>{t=[].concat(t),e=[].concat(e);let o=new Set,i=new Set,s=new Set,a=0,u=e=>{s.add(e.output),r&&r.onResult&&r.onResult(e)};for(let s=0;s<t.length;s++){let c=n(String(t[s]),{...r,onResult:u},!0),l=c.state.negated||c.state.negatedExtglob;l&&a++;for(let t of e){let e=c(t,!0);(l?!e.isMatch:e.isMatch)&&(l?o.add(e.output):(o.delete(e.output),i.add(e.output)))}}let c=(a===t.length?[...s]:[...i]).filter(e=>!o.has(e));if(r&&0===c.length){if(!0===r.failglob)throw new Error(`No matches found for "${t.join(", ")}"`);if(!0===r.nonull||!0===r.nullglob)return r.unescape?t.map(e=>e.replace(/\\/g,"")):t}return c};return s.match=s,s.matcher=(e,t)=>n(e,t),s.any=s.isMatch=(e,t,r)=>n(t,r)(e),s.not=(e,t,n={})=>{t=[].concat(t).map(String);let r=new Set,o=[],i=new Set(s(e,t,{...n,onResult:e=>{n.onResult&&n.onResult(e),o.push(e.output)}}));for(let e of o)i.has(e)||r.add(e);return[...r]},s.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=>s.contains(t,e,r));if("string"==typeof n){if(o(t)||o(n))return!1;if(t.includes(n)||t.startsWith("./")&&t.slice(2).includes(n))return!0}return s.isMatch(t,n,{...r,contains:!0})},s.matchKeys=(e,t,n)=>{if(!r.isObject(e))throw new TypeError("Expected the first argument to be an object");let o=s(Object.keys(e),t,n),i={};for(let t of o)i[t]=e[t];return i},s.some=(e,t,r)=>{let o=[].concat(e);for(let e of[].concat(t)){let t=n(String(e),r);if(o.some(e=>t(e)))return!0}return!1},s.every=(e,t,r)=>{let o=[].concat(e);for(let e of[].concat(t)){let t=n(String(e),r);if(!o.every(e=>t(e)))return!1}return!0},s.all=(t,r,o)=>{if("string"!=typeof t)throw new TypeError(`Expected a string: "${e.inspect(t)}"`);return[].concat(r).every(e=>n(e,o)(t))},s.capture=(e,t,o)=>{let i=r.isWindows(o),s=n.makeRe(String(e),{...o,capture:!0}).exec(i?r.toPosixSlashes(t):t);if(s)return s.slice(1).map(e=>void 0===e?"":e)},s.makeRe=(...e)=>n.makeRe(...e),s.scan=(...e)=>n.scan(...e),s.parse=(e,r)=>{let o=[];for(let i of[].concat(e||[]))for(let e of t(String(i),r))o.push(n.parse(e,r));return o},s.braces=(e,n)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return n&&!0===n.nobrace||!i(e)?[e]:t(e,n)},s.braceExpand=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return s.braces(e,{...t,expand:!0})},s.hasBraces=i,zc=s}(),r=/[*?]|^!/,o=/\[[^[]*]/,i=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,s=/[!*+?@]\([^(]*\)/,a=/,|\.\./,u=/(?!^)\/{2,}/g;function c(e,t={}){return!l(e,t)}function l(e,t={}){return!(""===e||!(!1===t.caseSensitiveMatch||e.includes("\\")||r.test(e)||o.test(e)||i.test(e)||!1!==t.extglob&&s.test(e)||!1!==t.braceExpansion&&function(e){const t=e.indexOf("{");if(-1===t)return!1;const n=e.indexOf("}",t+1);if(-1===n)return!1;const r=e.slice(t,n);return a.test(r)}(e)))}function p(e){return e.startsWith("!")&&"("!==e[1]}function f(e){return!p(e)}function d(e){return e.startsWith("..")||e.startsWith("./..")}function h(e){return e.endsWith("/**")}function D(e){const t=n.braces(e,{expand:!0,nodupes:!0,keepEscaping:!0});return t.sort((e,t)=>e.length-t.length),t.filter(e=>""!==e)}function g(e,t){return n.makeRe(e,t)}function m(t){return e.isAbsolute(t)}return oc.isStaticPattern=c,oc.isDynamicPattern=l,oc.convertToPositivePattern=function(e){return p(e)?e.slice(1):e},oc.convertToNegativePattern=function(e){return"!"+e},oc.isNegativePattern=p,oc.isPositivePattern=f,oc.getNegativePatterns=function(e){return e.filter(p)},oc.getPositivePatterns=function(e){return e.filter(f)},oc.getPatternsInsideCurrentDirectory=function(e){return e.filter(e=>!d(e))},oc.getPatternsOutsideCurrentDirectory=function(e){return e.filter(d)},oc.isPatternRelatedToParentDirectory=d,oc.getBaseDirectory=function(e){return t(e,{flipBackslashes:!1})},oc.hasGlobStar=function(e){return e.includes("**")},oc.endsWithSlashGlobStar=h,oc.isAffectDepthOfReadingPattern=function(t){const n=e.basename(t);return h(t)||c(n)},oc.expandPatternsWithBraceExpansion=function(e){return e.reduce((e,t)=>e.concat(D(t)),[])},oc.expandBraceExpansion=D,oc.getPatternParts=function(e,t){let{parts:r}=n.scan(e,Object.assign(Object.assign({},t),{parts:!0}));return 0===r.length&&(r=[e]),r[0].startsWith("/")&&(r[0]=r[0].slice(1),r.unshift("")),r},oc.makeRe=g,oc.convertPatternsToRe=function(e,t){return e.map(e=>g(e,t))},oc.matchAny=function(e,t){return t.some(t=>t.test(e))},oc.removeDuplicateSlashes=function(e){return e.replace(u,"/")},oc.partitionAbsoluteAndRelative=function(e){const t=[],n=[];for(const r of e)m(r)?t.push(r):n.push(r);return[t,n]},oc.isAbsolute=m,oc}();Uu.pattern=o;const i=function(){if(Yc)return Qc;Yc=1,Object.defineProperty(Qc,"__esModule",{value:!0}),Qc.merge=void 0;const e=Xc();function t(e){e.forEach(e=>e.emit("close"))}return Qc.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},Qc}();Uu.stream=i;const s=(el||(el=1,Object.defineProperty(rl,"__esModule",{value:!0}),rl.isEmpty=rl.isString=void 0,rl.isString=function(e){return"string"==typeof e},rl.isEmpty=function(e){return""===e}),rl);return Uu.string=s,Uu}var il,sl={},al={},ul={},cl={},ll={},pl={},fl={},dl={},hl={};var Dl,gl,ml,yl,bl,vl,El,Fl,Cl={},wl={},_l={};function Al(){if(yl)return dl;yl=1,Object.defineProperty(dl,"__esModule",{value:!0}),dl.statSync=dl.stat=dl.Settings=void 0;const e=function(){if(il)return hl;function e(e,t){e(t)}function t(e,t){e(null,t)}return il=1,Object.defineProperty(hl,"__esModule",{value:!0}),hl.read=void 0,hl.read=function(n,r,o){r.fs.lstat(n,(i,s)=>{null===i?s.isSymbolicLink()&&r.followSymbolicLink?r.fs.stat(n,(n,i)=>{if(null!==n)return r.throwErrorOnBrokenSymbolicLink?void e(o,n):void t(o,s);r.markSymbolicLink&&(i.isSymbolicLink=()=>!0),t(o,i)}):t(o,s):e(o,i)})},hl}(),t=(Dl||(Dl=1,Object.defineProperty(Cl,"__esModule",{value:!0}),Cl.read=void 0,Cl.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}}),Cl),n=function(){if(ml)return wl;ml=1,Object.defineProperty(wl,"__esModule",{value:!0});const e=(gl||(gl=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createFileSystemAdapter=e.FILE_SYSTEM_ADAPTER=void 0;const t=x;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)}}(_l)),_l);return wl.default=class{constructor(t={}){this._options=t,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=e.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(e,t){return null!=e?e:t}},wl}();function r(e={}){return e instanceof n.default?e:new n.default(e)}return dl.Settings=n.default,dl.stat=function(t,n,o){"function"!=typeof n?e.read(t,r(n),o):e.read(t,r(),n)},dl.statSync=function(e,n){const o=r(n);return t.read(e,o)},dl}var Sl,kl={};function Pl(){if(Sl)return kl;Sl=1,Object.defineProperty(kl,"__esModule",{value:!0}),kl.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,o=10===t&&n>=10;return kl.IS_SUPPORT_READDIR_WITH_FILE_TYPES=r||o,kl}var Rl,Bl,xl={},Ol={};function Tl(){if(Bl)return xl;Bl=1,Object.defineProperty(xl,"__esModule",{value:!0}),xl.fs=void 0;const e=function(){if(Rl)return Ol;Rl=1,Object.defineProperty(Ol,"__esModule",{value:!0}),Ol.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 Ol.createDirentFromStats=function(t,n){return new e(t,n)},Ol}();return xl.fs=e,xl}var $l,Ll,Nl={};function Ml(){return $l||($l=1,Object.defineProperty(Nl,"__esModule",{value:!0}),Nl.joinPathSegments=void 0,Nl.joinPathSegments=function(e,t,n){return e.endsWith(n)?e+t:e+n+t}),Nl}function jl(){if(Ll)return fl;Ll=1,Object.defineProperty(fl,"__esModule",{value:!0}),fl.readdir=fl.readdirWithFileTypes=fl.read=void 0;const e=Al(),t=function(){if(Fl)return El;Fl=1,El=function(t,n){let r,o,i,s=!0;function a(t){function o(){n&&n(t,r),n=null}s?e(o):o()}function u(e,t,n){r[e]=n,(0===--o||t)&&a(t)}Array.isArray(t)?(r=[],o=t.length):(i=Object.keys(t),r={},o=i.length),o?i?i.forEach(function(e){t[e](function(t,n){u(e,t,n)})}):t.forEach(function(e,t){e(function(e,n){u(t,e,n)})}):a(null),s=!1};const e=function(){if(vl)return bl;let e;return vl=1,bl="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:G):t=>(e||(e=Promise.resolve())).then(t).catch(e=>setTimeout(()=>{throw e},0))}();return El}(),n=Pl(),r=Tl(),o=Ml();function i(e,n,i){n.fs.readdir(e,{withFileTypes:!0},(s,c)=>{if(null!==s)return void a(i,s);const l=c.map(t=>({dirent:t,name:t.name,path:o.joinPathSegments(e,t.name,n.pathSegmentSeparator)}));if(!n.followSymbolicLinks)return void u(i,l);const p=l.map(e=>function(e,t){return n=>{e.dirent.isSymbolicLink()?t.fs.stat(e.path,(o,i)=>{if(null!==o)return t.throwErrorOnBrokenSymbolicLink?void n(o):void n(null,e);e.dirent=r.fs.createDirentFromStats(e.name,i),n(null,e)}):n(null,e)}}(e,n));t(p,(e,t)=>{null===e?u(i,t):a(i,e)})})}function s(n,i,s){i.fs.readdir(n,(c,l)=>{if(null!==c)return void a(s,c);const p=l.map(t=>{const s=o.joinPathSegments(n,t,i.pathSegmentSeparator);return n=>{e.stat(s,i.fsStatSettings,(e,o)=>{if(null!==e)return void n(e);const a={name:t,path:s,dirent:r.fs.createDirentFromStats(t,o)};i.stats&&(a.stats=o),n(null,a)})}});t(p,(e,t)=>{null===e?u(s,t):a(s,e)})})}function a(e,t){e(t)}function u(e,t){e(null,t)}return fl.read=function(e,t,r){t.stats||!n.IS_SUPPORT_READDIR_WITH_FILE_TYPES?s(e,t,r):i(e,t,r)},fl.readdirWithFileTypes=i,fl.readdir=s,fl}var Il,Hl,zl,Kl,Ul={},ql={},Gl={};function Wl(){if(Kl)return pl;Kl=1,Object.defineProperty(pl,"__esModule",{value:!0}),pl.Settings=pl.scandirSync=pl.scandir=void 0;const e=jl(),t=function(){if(Il)return Ul;Il=1,Object.defineProperty(Ul,"__esModule",{value:!0}),Ul.readdir=Ul.readdirWithFileTypes=Ul.read=void 0;const e=Al(),t=Pl(),n=Tl(),r=Ml();function o(e,t){return t.fs.readdirSync(e,{withFileTypes:!0}).map(o=>{const i={dirent:o,name:o.name,path:r.joinPathSegments(e,o.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,o){return o.fs.readdirSync(t).map(i=>{const s=r.joinPathSegments(t,i,o.pathSegmentSeparator),a=e.statSync(s,o.fsStatSettings),u={name:i,path:s,dirent:n.fs.createDirentFromStats(i,a)};return o.stats&&(u.stats=a),u})}return Ul.read=function(e,n){return!n.stats&&t.IS_SUPPORT_READDIR_WITH_FILE_TYPES?o(e,n):i(e,n)},Ul.readdirWithFileTypes=o,Ul.readdir=i,Ul}(),n=function(){if(zl)return ql;zl=1,Object.defineProperty(ql,"__esModule",{value:!0});const e=k,t=Al(),n=(Hl||(Hl=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createFileSystemAdapter=e.FILE_SYSTEM_ADAPTER=void 0;const t=x;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)}}(Gl)),Gl);return ql.default=class{constructor(r={}){this._options=r,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=n.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,e.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new t.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(e,t){return null!=e?e:t}},ql}();function r(e={}){return e instanceof n.default?e:new n.default(e)}return pl.Settings=n.default,pl.scandir=function(t,n,o){"function"!=typeof n?e.read(t,r(n),o):e.read(t,r(),n)},pl.scandirSync=function(e,n){const o=r(n);return t.read(e,o)},pl}var Zl,Vl,Jl,Yl={exports:{}};var Ql,Xl={};function ep(){return Ql||(Ql=1,Object.defineProperty(Xl,"__esModule",{value:!0}),Xl.joinPathSegments=Xl.replacePathSegmentSeparator=Xl.isAppliedFilter=Xl.isFatalError=void 0,Xl.isFatalError=function(e,t){return null===e.errorFilter||!e.errorFilter(t)},Xl.isAppliedFilter=function(e,t){return null===e||e(t)},Xl.replacePathSegmentSeparator=function(e,t){return e.split(/[/\\]/).join(t)},Xl.joinPathSegments=function(e,t,n){return""===e?t:e.endsWith(n)?e+t:e+n+t}),Xl}var tp,np,rp,op={};function ip(){if(tp)return op;tp=1,Object.defineProperty(op,"__esModule",{value:!0});const e=ep();return op.default=class{constructor(t,n){this._root=t,this._settings=n,this._root=e.replacePathSegmentSeparator(t,n.pathSegmentSeparator)}},op}function sp(){if(np)return ll;np=1,Object.defineProperty(ll,"__esModule",{value:!0});const e=B,t=Wl(),n=function(){if(Jl)return Yl.exports;Jl=1;var e=Vl?Zl:(Vl=1,Zl=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,o,i){if("function"==typeof t&&(i=o,o=t,t=null),!(i>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");var s=e(r),a=null,u=null,c=0,l=null,p={push:function(e,r){var d=s.get();d.context=t,d.release=f,d.value=e,d.callback=r||n,d.errorHandler=l,c>=i||p.paused?u?(u.next=d,u=d):(a=d,u=d,p.saturated()):(c++,o.call(t,d.value,d.worked))},drain:n,saturated:n,pause:function(){p.paused=!0},paused:!1,get concurrency(){return i},set concurrency(e){if(!(e>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(i=e,!p.paused)for(;a&&c<i;)c++,f()},running:function(){return c},resume:function(){if(p.paused){if(p.paused=!1,null===a)return c++,void f();for(;a&&c<i;)c++,f()}},idle:function(){return 0===c&&0===p.length()},length:function(){for(var e=a,t=0;e;)e=e.next,t++;return t},getQueue:function(){for(var e=a,t=[];e;)t.push(e.value),e=e.next;return t},unshift:function(e,r){var d=s.get();d.context=t,d.release=f,d.value=e,d.callback=r||n,d.errorHandler=l,c>=i||p.paused?a?(d.next=a,a=d):(a=d,u=d,p.saturated()):(c++,o.call(t,d.value,d.worked))},empty:n,kill:function(){a=null,u=null,p.drain=n},killAndDrain:function(){a=null,u=null,p.drain(),p.drain=n},error:function(e){l=e}};return p;function f(e){e&&s.release(e);var n=a;n&&c<=i?p.paused?c--:(u===a&&(u=null),a=n.next,n.next=null,o.call(t,n.value,n.worked),null===u&&p.empty()):0===--c&&p.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 o=e.callback,i=e.errorHandler,s=e.value;e.value=null,e.callback=n,e.errorHandler&&i(t,s),o.call(e.context,t,r),e.release(e)}}return Yl.exports=t,Yl.exports.promise=function(e,r,o){"function"==typeof e&&(o=r,r=e,e=null);var i=t(e,function(e,t){r.call(this,e).then(function(e){t(null,e)},t)},o),s=i.push,a=i.unshift;return i.push=function(e){var t=new Promise(function(t,n){s(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},Yl.exports}(),r=ep(),o=ip();class i extends o.default{constructor(r,o){super(r,o),this._settings=o,this._scandir=t.scandir,this._emitter=new e.EventEmitter,this._queue=n(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit("end")}}read(){return this._isFatalError=!1,this._isDestroyed=!1,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw new Error("The reader is already destroyed");this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(e){this._emitter.on("entry",e)}onError(e){this._emitter.once("error",e)}onEnd(e){this._emitter.once("end",e)}_pushToQueue(e,t){const n={directory:e,base:t};this._queue.push(n,e=>{null!==e&&this._handleError(e)})}_worker(e,t){this._scandir(e.directory,this._settings.fsScandirSettings,(n,r)=>{if(null===n){for(const t of r)this._handleEntry(t,e.base);t(null,void 0)}else t(n,void 0)})}_handleError(e){!this._isDestroyed&&r.isFatalError(this._settings,e)&&(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit("error",e))}_handleEntry(e,t){if(this._isDestroyed||this._isFatalError)return;const n=e.path;void 0!==t&&(e.path=r.joinPathSegments(t,e.name,this._settings.pathSegmentSeparator)),r.isAppliedFilter(this._settings.entryFilter,e)&&this._emitEntry(e),e.dirent.isDirectory()&&r.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,void 0===t?void 0:e.path)}_emitEntry(e){this._emitter.emit("entry",e)}}return ll.default=i,ll}var ap,up,cp,lp={},pp={},fp={};var dp,hp,Dp={};function gp(){if(hp)return ul;hp=1,Object.defineProperty(ul,"__esModule",{value:!0}),ul.Settings=ul.walkStream=ul.walkSync=ul.walk=void 0;const e=function(){if(rp)return cl;rp=1,Object.defineProperty(cl,"__esModule",{value:!0});const e=sp();return cl.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()}},cl}(),t=function(){if(ap)return lp;ap=1,Object.defineProperty(lp,"__esModule",{value:!0});const e=R,t=sp();return lp.default=class{constructor(n,r){this._root=n,this._settings=r,this._reader=new t.default(this._root,this._settings),this._stream=new e.Readable({objectMode:!0,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy()}})}read(){return this._reader.onError(e=>{this._stream.emit("error",e)}),this._reader.onEntry(e=>{this._stream.push(e)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}},lp}(),n=function(){if(cp)return pp;cp=1,Object.defineProperty(pp,"__esModule",{value:!0});const e=function(){if(up)return fp;up=1,Object.defineProperty(fp,"__esModule",{value:!0});const e=Wl(),t=ep(),n=ip();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 fp.default=r,fp}();return pp.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()}},pp}(),r=function(){if(dp)return Dp;dp=1,Object.defineProperty(Dp,"__esModule",{value:!0});const e=k,t=Wl();return Dp.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}},Dp}();function o(e={}){return e instanceof r.default?e:new r.default(e)}return ul.Settings=r.default,ul.walk=function(t,n,r){"function"!=typeof n?new e.default(t,o(n)).read(r):new e.default(t,o()).read(n)},ul.walkSync=function(e,t){const r=o(t);return new n.default(e,r).read()},ul.walkStream=function(e,n){const r=o(n);return new t.default(e,r).read()},ul}var mp,yp={};function bp(){if(mp)return yp;mp=1,Object.defineProperty(yp,"__esModule",{value:!0});const e=k,t=Al(),n=ol();return yp.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}},yp}var vp,Ep,Fp={};function Cp(){if(vp)return Fp;vp=1,Object.defineProperty(Fp,"__esModule",{value:!0});const e=R,t=Al(),n=gp(),r=bp();class o 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),o=new e.PassThrough({objectMode:!0});o._write=(e,i,s)=>this._getEntry(r[e],t[e],n).then(t=>{null!==t&&n.entryFilter(t)&&o.push(t),e===r.length-1&&o.end(),s()}).catch(s);for(let e=0;e<r.length;e++)o.write(e);return o}_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 Fp.default=o,Fp}var wp,_p,Ap,Sp={},kp={},Pp={},Rp={};var Bp,xp,Op,Tp,$p,Lp={},Np={},Mp={};function jp(){if(Tp)return Sp;Tp=1,Object.defineProperty(Sp,"__esModule",{value:!0});const e=k,t=function(){if(Ap)return kp;Ap=1,Object.defineProperty(kp,"__esModule",{value:!0});const e=ol(),t=function(){if(_p)return Pp;_p=1,Object.defineProperty(Pp,"__esModule",{value:!0});const e=function(){if(wp)return Rp;wp=1,Object.defineProperty(Rp,"__esModule",{value:!0});const e=ol();return Rp.default=class{constructor(e,t,n){this._patterns=e,this._settings=t,this._micromatchOptions=n,this._storage=[],this._fillStorage()}_fillStorage(){for(const e of this._patterns){const t=this._getPatternSegments(e),n=this._splitSegmentsIntoSections(t);this._storage.push({complete:n.length<=1,pattern:e,segments:t,sections:n})}}_getPatternSegments(t){return e.pattern.getPatternParts(t,this._micromatchOptions).map(t=>e.pattern.isDynamicPattern(t,this._settings)?{dynamic:!0,pattern:t,patternRe:e.pattern.makeRe(t,this._micromatchOptions)}:{dynamic:!1,pattern:t})}_splitSegmentsIntoSections(t){return e.array.splitWhen(t,t=>t.dynamic&&e.pattern.hasGlobStar(t.pattern))}},Rp}();class t extends e.default{match(e){const t=e.split("/"),n=t.length,r=this._storage.filter(e=>!e.complete||e.segments.length>n);for(const e of r){const r=e.sections[0];if(!e.complete&&n>r.length)return!0;if(t.every((t,n)=>{const r=e.segments[n];return!(!r.dynamic||!r.patternRe.test(t))||!r.dynamic&&r.pattern===t}))return!0}return!1}}return Pp.default=t,Pp}();return kp.default=class{constructor(e,t){this._settings=e,this._micromatchOptions=t}getFilter(e,t,n){const r=this._getMatcher(t),o=this._getNegativePatternsRe(n);return t=>this._filter(e,t,r,o)}_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,o){if(this._isSkippedByDeep(t,n.path))return!1;if(this._isSkippedSymbolicLink(n))return!1;const i=e.path.removeLeadingDotSegment(n.path);return!this._isSkippedByPositivePatterns(i,r)&&this._isSkippedByNegativePatterns(i,o)}_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)}},kp}(),n=function(){if(Bp)return Lp;Bp=1,Object.defineProperty(Lp,"__esModule",{value:!0});const e=ol();return Lp.default=class{constructor(e,t){this._settings=e,this._micromatchOptions=t,this.index=new Map}getFilter(t,n){const[r,o]=e.pattern.partitionAbsoluteAndRelative(n),i={positive:{all:e.pattern.convertPatternsToRe(t,this._micromatchOptions)},negative:{absolute:e.pattern.convertPatternsToRe(r,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:e.pattern.convertPatternsToRe(o,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return e=>this._filter(e,i)}_filter(t,n){const r=e.path.removeLeadingDotSegment(t.path);if(this._settings.unique&&this._isDuplicateEntry(r))return!1;if(this._onlyFileFilter(t)||this._onlyDirectoryFilter(t))return!1;const o=this._isMatchToPatternsSet(r,n,t.dirent.isDirectory());return this._settings.unique&&o&&this._createIndexRecord(r),o}_isDuplicateEntry(e){return this.index.has(e)}_createIndexRecord(e){this.index.set(e,void 0)}_onlyFileFilter(e){return this._settings.onlyFiles&&!e.dirent.isFile()}_onlyDirectoryFilter(e){return this._settings.onlyDirectories&&!e.dirent.isDirectory()}_isMatchToPatternsSet(e,t,n){return!!this._isMatchToPatterns(e,t.positive.all,n)&&!this._isMatchToPatterns(e,t.negative.relative,n)&&!this._isMatchToAbsoluteNegative(e,t.negative.absolute,n)}_isMatchToAbsoluteNegative(t,n,r){if(0===n.length)return!1;const o=e.path.makeAbsolute(this._settings.cwd,t);return this._isMatchToPatterns(o,n,r)}_isMatchToPatterns(t,n,r){if(0===n.length)return!1;const o=e.pattern.matchAny(t,n);return!o&&r?e.pattern.matchAny(t+"/",n):o}},Lp}(),r=function(){if(xp)return Np;xp=1,Object.defineProperty(Np,"__esModule",{value:!0});const e=ol();return Np.default=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(t){return e.errno.isEnoentCodeError(t)||this._settings.suppressErrors}},Np}(),o=function(){if(Op)return Mp;Op=1,Object.defineProperty(Mp,"__esModule",{value:!0});const e=ol();return Mp.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}},Mp}();return Sp.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 o.default(this._settings)}_getRootDirectory(t){return e.resolve(this._settings.cwd,t.base)}_getReaderOptions(e){const t="."===e.base?"":e.base;return{basePath:t,pathSegmentSeparator:"/",concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(t,e.positive,e.negative),entryFilter:this.entryFilter.getFilter(e.positive,e.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0,strictSlashes:!1}}},Sp}var Ip,Hp,zp,Kp={},Up={},qp={};var Gp,Wp,Zp,Vp,Jp,Yp={},Qp=function(){if(Zp)return Wp;Zp=1;const e=function(){if(nl)return Ku;nl=1,Object.defineProperty(Ku,"__esModule",{value:!0}),Ku.convertPatternGroupToTask=Ku.convertPatternGroupsToTasks=Ku.groupPatternsByBaseDirectory=Ku.getNegativePatternsAsPositive=Ku.getPositivePatterns=Ku.convertPatternsToTasks=Ku.generate=void 0;const e=ol();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 o=[],u=e.pattern.getPatternsOutsideCurrentDirectory(t),c=e.pattern.getPatternsInsideCurrentDirectory(t),l=i(u),p=i(c);return o.push(...s(l,n,r)),"."in p?o.push(a(".",c,n,r)):o.push(...s(p,n,r)),o}function r(t){return e.pattern.getPositivePatterns(t)}function o(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 s(e,t,n){return Object.keys(e).map(r=>a(r,e[r],t,n))}function a(t,n,r,o){return{dynamic:o,positive:n,negative:r,base:t,patterns:[].concat(n,r.map(e.pattern.convertToNegativePattern))}}return Ku.generate=function(i,s){const a=t(i,s),u=t(s.ignore,s),c=r(a),l=o(a,u),p=c.filter(t=>e.pattern.isStaticPattern(t,s)),f=c.filter(t=>e.pattern.isDynamicPattern(t,s)),d=n(p,l,!1),h=n(f,l,!0);return d.concat(h)},Ku.convertPatternsToTasks=n,Ku.getPositivePatterns=r,Ku.getNegativePatternsAsPositive=o,Ku.groupPatternsByBaseDirectory=i,Ku.convertPatternGroupsToTasks=s,Ku.convertPatternGroupToTask=a,Ku}(),t=function(){if($p)return sl;$p=1,Object.defineProperty(sl,"__esModule",{value:!0});const e=function(){if(Ep)return al;Ep=1,Object.defineProperty(al,"__esModule",{value:!0});const e=gp(),t=bp(),n=Cp();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 al.default=r,al}(),t=jp();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 sl.default=n,sl}(),n=function(){if(Ip)return Kp;Ip=1,Object.defineProperty(Kp,"__esModule",{value:!0});const e=R,t=Cp(),n=jp();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),o=this.api(n,t,r),i=new e.Readable({objectMode:!0,read:()=>{}});return o.once("error",e=>i.emit("error",e)).on("data",e=>i.emit("data",r.transform(e))).once("end",()=>i.emit("end")),i.once("close",()=>o.destroy()),i}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}}return Kp.default=r,Kp}(),r=function(){if(zp)return Up;zp=1,Object.defineProperty(Up,"__esModule",{value:!0});const e=function(){if(Hp)return qp;Hp=1,Object.defineProperty(qp,"__esModule",{value:!0});const e=Al(),t=gp(),n=bp();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),o=this._getEntry(e,r,t);null!==o&&t.entryFilter(o)&&n.push(o)}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 qp.default=r,qp}(),t=jp();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 Up.default=n,Up}(),o=(Gp||(Gp=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;const t=x,n=S,r=Math.max(n.cpus().length,1);e.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:t.lstat,lstatSync:t.lstatSync,stat:t.stat,statSync:t.statSync,readdir:t.readdir,readdirSync:t.readdirSync},e.default=class{constructor(e={}){this._options=e,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,r),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0),this.ignore=[].concat(this.ignore)}_getValue(e,t){return void 0===e?t:e}_getFileSystemMethods(t={}){return Object.assign(Object.assign({},e.DEFAULT_FILE_SYSTEM_ADAPTER),t)}}}(Yp)),Yp),i=ol();async function s(e,n){u(e);const r=a(e,t.default,n),o=await Promise.all(r);return i.array.flatten(o)}function a(t,n,r){const i=[].concat(t),s=new o.default(r),a=e.generate(i,s),u=new n(s);return a.map(u.read,u)}function u(e){if(![].concat(e).every(e=>i.string.isString(e)&&!i.string.isEmpty(e)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}return function(t){function s(e,t){u(e);const n=a(e,r.default,t);return i.array.flatten(n)}function c(e,t){u(e);const r=a(e,n.default,t);return i.stream.merge(r)}var l,p;t.glob=t,t.globSync=s,t.globStream=c,t.async=t,t.sync=s,t.stream=c,t.generateTasks=function(t,n){u(t);const r=[].concat(t),i=new o.default(n);return e.generate(r,i)},t.isDynamicPattern=function(e,t){u(e);const n=new o.default(t);return i.pattern.isDynamicPattern(e,n)},t.escapePath=function(e){return u(e),i.path.escape(e)},t.convertPathToPattern=function(e){return u(e),i.path.convertPathToPattern(e)},(l=t.posix||(t.posix={})).escapePath=function(e){return u(e),i.path.escapePosixPath(e)},l.convertPathToPattern=function(e){return u(e),i.path.convertPosixPathToPattern(e)},(p=t.win32||(t.win32={})).escapePath=function(e){return u(e),i.path.escapeWindowsPath(e)},p.convertPathToPattern=function(e){return u(e),i.path.convertWindowsPathToPattern(e)}}(s||(s={})),Wp=s}(),Xp=W(Qp),ef=function(){if(Jp)return Vp;Jp=1;var e=ic(),t=k.posix.dirname,n="win32"===S.platform(),r="/",o=/\\/g,i=/\\([!*?|[\](){}])/g;function s(t){return!!/\([^()]+$/.test(t)||"{"===t[0]||"["===t[0]||!!/[^\\][{[]/.test(t)||e(t)}return Vp=function(e,a){Object.assign({flipBackslashes:!0},a).flipBackslashes&&n&&e.indexOf(r)<0&&(e=e.replace(o,r)),function(e){var t;switch(e.slice(-1)){case"}":t="{";break;case"]":t="[";break;default:return!1}var n=e.indexOf(t);return!(n<0)&&e.slice(n+1,-1).includes(r)}(e)&&(e+=r),e+="a";do{e=t(e)}while(s(e));return e.replace(i,"$1")}}(),tf=W(ef);const nf=e=>""!==e&&".."!==e,rf=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(!nf(e))return null;return t.join("/")},of=async e=>{try{return(await l(e)).isFile()}catch{return!1}},sf=e=>e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),af=e=>{try{const t=Iu(e),n=Object.keys(t.scripts);if(!n.length)return"";const r=n[0]??"lint";return["","Default: runs all scripts and writes archives.","","Available script keys:",` ${n.join(", ")}`,"","Examples:"," stan run # all scripts, with archives",` stan run -s ${r}`,` stan run -q -x ${r}`," stan run -A # no archives"," stan run -S -A -p # plan only, no scripts, no archives",` stan run -c -s ${r}`,""].join("\n")}catch(e){return"1"===process.env.STAN_DEBUG&&console.error("stan: unable to load config for help footer",e),""}},uf=(e=0)=>t=>`[${t+e}m`,cf=(e=0)=>t=>`[${38+e};5;${t}m`,lf=(e=0)=>(t,n,r)=>`[${38+e};2;${t};${n};${r}m`,pf={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(pf.modifier);Object.keys(pf.color),Object.keys(pf.bgColor);const ff=function(){const e=new Map;for(const[t,n]of Object.entries(pf)){for(const[t,r]of Object.entries(n))pf[t]={open:`[${r[0]}m`,close:`[${r[1]}m`},n[t]=pf[t],e.set(r[0],r[1]);Object.defineProperty(pf,t,{value:n,enumerable:!1})}return Object.defineProperty(pf,"codes",{value:e,enumerable:!1}),pf.color.close="",pf.bgColor.close="",pf.color.ansi=uf(),pf.color.ansi256=cf(),pf.color.ansi16m=lf(),pf.bgColor.ansi=uf(10),pf.bgColor.ansi256=cf(10),pf.bgColor.ansi16m=lf(10),Object.defineProperties(pf,{rgbToAnsi256:{value:(e,t,n)=>e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value(e){const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;3===n.length&&(n=[...n].map(e=>e+e).join(""));const r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},enumerable:!1},hexToAnsi256:{value:e=>pf.rgbToAnsi256(...pf.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return e-8+90;let t,n,r;if(e>=232)t=(10*(e-232)+8)/255,n=t,r=t;else{const o=(e-=16)%36;t=Math.floor(e/36)/5,n=Math.floor(o/6)/5,r=o%6/5}const o=2*Math.max(t,n,r);if(0===o)return 30;let i=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return 2===o&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>pf.ansi256ToAnsi(pf.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>pf.ansi256ToAnsi(pf.hexToAnsi256(e)),enumerable:!1}}),pf}();function df(e,t=(globalThis.Deno?globalThis.Deno.args:E.argv)){const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),o=t.indexOf("--");return-1!==r&&(-1===o||r<o)}const{env:hf}=E;let Df;function gf(e,{streamIsTTY:t,sniffFlags:n=!0}={}){const r=function(){if("FORCE_COLOR"in hf)return"true"===hf.FORCE_COLOR?1:"false"===hf.FORCE_COLOR?0:0===hf.FORCE_COLOR.length?1:Math.min(Number.parseInt(hf.FORCE_COLOR,10),3)}();void 0!==r&&(Df=r);const o=n?Df:r;if(0===o)return 0;if(n){if(df("color=16m")||df("color=full")||df("color=truecolor"))return 3;if(df("color=256"))return 2}if("TF_BUILD"in hf&&"AGENT_NAME"in hf)return 1;if(e&&!t&&void 0===o)return 0;const i=o||0;if("dumb"===hf.TERM)return i;if("win32"===E.platform){const e=O.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in hf)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(e=>e in hf)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(e=>e in hf)||"codeship"===hf.CI_NAME?1:i;if("TEAMCITY_VERSION"in hf)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(hf.TEAMCITY_VERSION)?1:0;if("truecolor"===hf.COLORTERM)return 3;if("xterm-kitty"===hf.TERM)return 3;if("xterm-ghostty"===hf.TERM)return 3;if("wezterm"===hf.TERM)return 3;if("TERM_PROGRAM"in hf){const e=Number.parseInt((hf.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(hf.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(hf.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(hf.TERM)||"COLORTERM"in hf?1:i}function mf(e,t={}){return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(gf(e,{streamIsTTY:e&&e.isTTY,...t}))}df("no-color")||df("no-colors")||df("color=false")||df("color=never")?Df=0:(df("color")||df("colors")||df("color=true")||df("color=always"))&&(Df=1);const yf={stdout:mf({isTTY:T.isatty(1)}),stderr:mf({isTTY:T.isatty(2)})};function bf(e,t,n){let r=e.indexOf(t);if(-1===r)return e;const o=t.length;let i=0,s="";do{s+=e.slice(i,r)+t+n,i=r+o,r=e.indexOf(t,i)}while(-1!==r);return s+=e.slice(i),s}const{stdout:vf,stderr:Ef}=yf,Ff=Symbol("GENERATOR"),Cf=Symbol("STYLER"),wf=Symbol("IS_EMPTY"),_f=["ansi","ansi","ansi256","ansi16m"],Af=Object.create(null),Sf=e=>{const t=(...e)=>e.join(" ");return((e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const n=vf?vf.level:0;e.level=void 0===t.level?n:t.level})(t,e),Object.setPrototypeOf(t,kf.prototype),t};function kf(e){return Sf(e)}Object.setPrototypeOf(kf.prototype,Function.prototype);for(const[e,t]of Object.entries(ff))Af[e]={get(){const n=Of(this,xf(t.open,t.close,this[Cf]),this[wf]);return Object.defineProperty(this,e,{value:n}),n}};Af.visible={get(){const e=Of(this,this[Cf],!0);return Object.defineProperty(this,"visible",{value:e}),e}};const Pf=(e,t,n,...r)=>"rgb"===e?"ansi16m"===t?ff[n].ansi16m(...r):"ansi256"===t?ff[n].ansi256(ff.rgbToAnsi256(...r)):ff[n].ansi(ff.rgbToAnsi(...r)):"hex"===e?Pf("rgb",t,n,...ff.hexToRgb(...r)):ff[n][e](...r),Rf=["rgb","hex","ansi256"];for(const e of Rf){Af[e]={get(){const{level:t}=this;return function(...n){const r=xf(Pf(e,_f[t],"color",...n),ff.color.close,this[Cf]);return Of(this,r,this[wf])}}};Af["bg"+e[0].toUpperCase()+e.slice(1)]={get(){const{level:t}=this;return function(...n){const r=xf(Pf(e,_f[t],"bgColor",...n),ff.bgColor.close,this[Cf]);return Of(this,r,this[wf])}}}}const Bf=Object.defineProperties(()=>{},{...Af,level:{enumerable:!0,get(){return this[Ff].level},set(e){this[Ff].level=e}}}),xf=(e,t,n)=>{let r,o;return void 0===n?(r=e,o=t):(r=n.openAll+e,o=t+n.closeAll),{open:e,close:t,openAll:r,closeAll:o,parent:n}},Of=(e,t,n)=>{const r=(...e)=>Tf(r,1===e.length?""+e[0]:e.join(" "));return Object.setPrototypeOf(r,Bf),r[Ff]=e,r[Cf]=t,r[wf]=n,r},Tf=(e,t)=>{if(e.level<=0||!t)return e[wf]?"":t;let n=e[Cf];if(void 0===n)return t;const{openAll:r,closeAll:o}=n;if(t.includes(""))for(;void 0!==n;)t=bf(t,n.close,n.open),n=n.parent;const i=t.indexOf("\n");return-1!==i&&(t=function(e,t,n,r){let o=0,i="";do{const s="\r"===e[r-1];i+=e.slice(o,s?r-1:r)+t+(s?"\r\n":"\n")+n,o=r+1,r=e.indexOf("\n",o)}while(-1!==r);return i+=e.slice(o),i}(t,o,r,i)),r+t+o};Object.defineProperties(kf.prototype,Af);const $f=kf();kf({level:Ef?Ef.level:0});const Lf=Boolean(process.stdout?.isTTY),Nf=()=>"1"===process.env.STAN_BORING||"1"===process.env.NO_COLOR||"0"===process.env.FORCE_COLOR||!Lf,Mf=e=>Nf()?e:$f.green(e),jf=e=>Nf()?e:$f.cyan(e),If=e=>Nf()?e:$f.blue(e),Hf=e=>Nf()?e:$f.red(e),zf=e=>Nf()?e:$f.black(e),Kf=e=>Nf()?e:$f.gray(e),Uf=e=>Nf()?e:$f.hex("#FFA500")(e),qf=e=>Nf()?e:$f.bold(e),Gf=e=>Nf()?e:$f.dim(e),Wf=e=>e instanceof URL?F(e):e;function Zf({cwd:t}={}){const n=function(t,{cwd:n=E.cwd(),type:r="file",stopAt:o}={}){let i=D.resolve(Wf(n)??"");const{root:s}=D.parse(i);o=D.resolve(i,Wf(o)??s);const a=D.isAbsolute(t);for(;i;){const n=a?t:D.join(i,t);try{const t=e.statSync(n,{throwIfNoEntry:!1});if("file"===r&&t?.isFile()||"directory"===r&&t?.isDirectory())return n}catch{}if(i===o||i===s)break;i=D.dirname(i)}}("package.json",{cwd:t});return n&&D.dirname(n)}const Vf=async e=>{const t=await u(e);return _("sha256").update(t).digest("hex")},Jf=async e=>{if(!e)return null;try{return await f(e)}catch{return e?D.resolve(e):null}},Yf=async e=>{try{const t=await u(e,"utf8");return JSON.parse(t)}catch{return null}},Qf=async e=>{let t=e;try{const n=Zf({cwd:e})??e;t=n}catch{}const r=(()=>{try{return Iu(t).stanPath}catch{return(e=>{try{return Iu(e).stanPath}catch{return".stan"}})(t)}})();let o;try{const e=Iu(t);o="boolean"==typeof e.devMode?e.devMode:void 0}catch{o=void 0}const i=((e,t)=>({systemAbs:D.join(e,t,"system")}))(t,r),s=D.join(i.systemAbs,"stan.system.md"),a=D.join(i.systemAbs,".docs.meta.json");let u=null;const c=Zf({cwd:m(F(import.meta.url))})??null;if(c)try{const e=await Yf(D.join(c,"package.json"));u=e?.version??null}catch{u=null}const l=c&&n(D.join(c,"dist","stan.system.md"))?D.join(c,"dist","stan.system.md"):null,p=n(s),f=!!l&&n(l),[d,h]=await Promise.all([p?Vf(s):Promise.resolve(void 0),f&&l?Vf(l):Promise.resolve(void 0)]),g=!(!d||!h)&&d===h,y=await Yf(a),[b,v]=await Promise.all([Jf(c),Jf(t)]),E=!!b&&!!v&&b===v,C=process.env.STAN_DEV_MODE?.trim().toLowerCase(),w="1"===C||"true"===C||"0"!==C&&"false"!==C&&void 0,_="boolean"==typeof w?w:"boolean"==typeof o?o:E;return{packageVersion:u,nodeVersion:process.version,repoRoot:t,stanPath:r,isDevModuleRepo:_,systemPrompt:{localExists:p,baselineExists:f,inSync:g,localHash:d,baselineHash:h},docsMeta:y??null}},Xf=()=>(()=>{const e=(()=>{try{const e=F(import.meta.url);return Fe({cwd:D.dirname(e)})??null}catch{return null}})();if(!e)return null;const t=D.join(e,"dist","stan.system.md");return n(t)?t:null})(),ed=(e,t)=>({outputAbs:D.join(e,t,"output"),patchAbs:D.join(e,t,"patch")}),td=async(e,t)=>{try{await(async(e,t)=>{const r=D.join(e,t,"system"),o=D.join(r,"parts"),i=D.join(r,"stan.system.md");if(await v(r),!n(o))return{target:i,action:"skipped-no-parts",partsDir:o};const a=(await s(o,{withFileTypes:!0})).filter(e=>e.isFile()&&e.name.toLowerCase().endsWith(".md")).map(e=>e.name).sort((e,t)=>e.localeCompare(t,void 0,{numeric:!0}));if(0===a.length)return{target:i,action:"skipped-no-md",partsDir:o};const l=[];for(const e of a){const t=D.join(o,e),n=sf(await u(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`)(t)+l.join("\n\n")+"\n";return await c(i,p,"utf8"),{target:i,action:"written"}})(e,t)}catch{}},nd=async(e,t)=>{const{cwd:r,config:o,includeOutputs:l}=e,p=Boolean(t?.silent),f=ed(r,o.stanPath);p||console.log(`stan: start "${jf("archive")}"`);let h=async()=>{};if((await Qf(r)).isDevModuleRepo)try{await td(r,o.stanPath)}catch{}else h=await(async(e,t)=>{const r=Xf();if(!r)return async()=>{};const o=D.resolve(e,t,"system");await d(o,{recursive:!0});const i=D.join(o,"stan.system.md"),s=n(i);let l=null;if(s)try{l=await u(i,"utf8")}catch{l=null}const p=await u(r,"utf8");return await c(i,p,"utf8"),async()=>{try{s?null!==l&&await c(i,l,"utf8"):await a(i,{force:!0})}catch{}}})(r,o.stanPath);let m="",y="";try{try{o.imports&&"object"==typeof o.imports&&await(async e=>{const{cwd:t,stanPath:n,map:r,onStage:o}=e;if(!r||"object"!=typeof r)return;const s=he(t,n),u=D.join(s.rootAbs,"imports");await v(u);const c=Object.keys(r).sort();for(const e of c){const n=r[e]??[];if(!Array.isArray(n)||0===n.length)continue;const s=rf(e);if(!s)continue;const c=D.join(u,s);await a(c,{recursive:!0,force:!0}).catch(()=>{}),await v(c).catch(()=>{});const l=[];for(const e of n){const n=String(e??"").trim();if(!n)continue;const r=tf(n.replace(/\\/g,"/"));try{const e=await Xp(n,{cwd:t,absolute:!0,dot:!0,onlyFiles:!1,followSymbolicLinks:!1});for(const n of e){if(!await of(n))continue;const e=D.relative(D.isAbsolute(r)?r:D.resolve(t,r),n).replace(/\\/g,"/");if(!e||e.includes(".."))continue;const o=D.join(c,e);await v(D.dirname(o)).catch(()=>{});try{await i(n,o),l.push(o)}catch{}}}catch{}}try{"function"==typeof o&&o(s,l.map(e=>D.relative(t,e).replace(/\\/g,"/")))}catch{}}})({cwd:r,stanPath:o.stanPath,map:o.imports})}catch{}t?.progress?.start?.("full");const e=Date.now();m=await(async(e,t,r={})=>{const{includeOutputDir:o=!1,fileName:s,includes:a=[],excludes:u=[]}=r;let c=s??"archive.tar";c.endsWith(".tar")||(c+=".tar");const{outDir:l,diffDir:p}=await ve(e,t),f=await De(e),d=await ye(f,{cwd:e,stanPath:t,includeOutputDir:o,includes:a,excludes:u}),h=g(l,c),D=g(p,M);if(n(h))try{await i(h,D)}catch{}const{textFiles:m,warningsBody:y}=await q(e,d),b=m,v=(y??"").trim();v&&"No archive warnings."!==v&&r.onArchiveWarnings?.(v);const E=await import("./index-ucZa1KMb-DZqceYU7.js");if(o){const n=Array.from(new Set([...b,`${t.replace(/\\/g,"/")}/output`]));await E.create({file:h,cwd:e,filter:K(t)},n)}else await E.create({file:h,cwd:e,filter:K(t)},b);if(!n(D))try{await i(h,D)}catch{}return h})(r,o.stanPath,{includeOutputDir:l,includes:o.includes??[],excludes:o.excludes??[]}),t?.progress?.done?.("full",m,e,Date.now()),p||console.log(`stan: ${Mf("done")} "${jf("archive")}" -> ${jf(m.replace(/\\/g,"/"))}`),await h(),h=async()=>{},p||console.log(`stan: start "${jf("archive (diff)")}"`),t?.progress?.start?.("diff");const s=Date.now();({diffPath:y}=await Hu({cwd:r,stanPath:o.stanPath,baseName:"archive",includes:o.includes??[],excludes:o.excludes??[],updateSnapshot:"createIfMissing",includeOutputDirInDiff:l})),t?.progress?.done?.("diff",y,s,Date.now()),p||console.log(`stan: ${Mf("done")} "${jf("archive (diff)")}" -> ${jf(y.replace(/\\/g,"/"))}`)}finally{await h()}return l&&await(async e=>{const t=await s(e,{withFileTypes:!0}),n=new Set(["archive.tar","archive.diff.tar"]);await Promise.all(t.map(async t=>{n.has(t.name)||await a(g(e,t.name),{recursive:!0,force:!0})}))})(f.outputAbs),await(async(e,t)=>{const n=ed(e,t);try{const e=await s(n.patchAbs,{withFileTypes:!0});await Promise.all(e.map(e=>a(g(n.patchAbs,e.name),{recursive:!0,force:!0})))}catch{}})(r,o.stanPath),{archivePath:m,diffPath:y}};var rd,od,id="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function sd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ad=function(){if(od)return rd;od=1;var e=$,t=e.spawn,n=e.exec;function r(e,t,n){var r={};try{Object.keys(e).forEach(function(n){e[n].forEach(function(e){r[e]||(o(e,t),r[e]=1)}),r[n]||(o(n,t),r[n]=1)})}catch(e){if(n)return n(e);throw e}if(n)return n()}function o(e,t){try{process.kill(parseInt(e,10),t)}catch(e){if("ESRCH"!==e.code)throw e}}function i(e,t,n,r,o){var s=r(e),a="";s.stdout.on("data",function(e){e=e.toString("ascii");a+=e});s.on("close",function(s){delete n[e],0==s?a.match(/\d+/g).forEach(function(s){s=parseInt(s,10),t[e].push(s),t[s]=[],n[s]=1,i(s,t,n,r,o)}):0==Object.keys(n).length&&o()})}return rd=function(e,o,s){if("function"==typeof o&&void 0===s&&(s=o,o=void 0),e=parseInt(e),Number.isNaN(e)){if(s)return s(new Error("pid must be a number"));throw new Error("pid must be a number")}var a={},u={};switch(a[e]=[],u[e]=1,process.platform){case"win32":n("taskkill /pid "+e+" /T /F",s);break;case"darwin":i(e,a,u,function(e){return t("pgrep",["-P",e])},function(){r(a,o,s)});break;default:i(e,a,u,function(e){return t("ps",["-o","pid","--no-headers","--ppid",e])},function(){r(a,o,s)})}}}(),ud=sd(ad);const cd=()=>new Promise(e=>setImmediate(e)),ld=async(e,t,n,r,i,s,a,c,l)=>{const p=g(t,`${r}.txt`),f=Date.now();a?.onStart?.(r);const d=A(i,{cwd:e,shell:!0,windowsHide:!0}),D="1"===process.env.STAN_DEBUG;let m="";const y="number"==typeof c?.hangWarn&&c.hangWarn>0?c.hangWarn:0,b="number"==typeof c?.hangKill&&c.hangKill>0?c.hangKill:0,v="number"==typeof c?.hangKillGrace&&c.hangKillGrace>0?c.hangKillGrace:10;let E,F,C=Date.now(),w=!1,_=!1;try{"number"==typeof d.pid&&l&&l.track(`script:${r}`,d.pid)}catch{}const S=o(p,{encoding:"utf8"});d.stdout.on("data",e=>{S.write(e),m+=e.toString("utf8"),D&&process.stdout.write(e),C=Date.now()}),d.stderr.on("data",e=>{S.write(e),m+=e.toString("utf8"),D&&process.stderr.write(e),C=Date.now()}),(y>0||b>0)&&(E=setInterval(()=>{const e=Date.now()-C;if(!w&&y>0&&e>=1e3*y&&(w=!0,a?.onHangWarn?.(r,y)),!_&&b>0&&e>=1e3*b){_=!0;try{"number"==typeof d.pid&&process.kill(d.pid,"SIGTERM")}catch{}a?.onHangTimeout?.(r,b);const e=Math.max(0,1e3*v);F=setTimeout(()=>{try{"number"==typeof d.pid&&ud(d.pid,"SIGKILL")}catch{}a?.onHangKilled?.(r,v)},e)}},1e3));const k=await new Promise((e,t)=>{d.on("error",e=>t(e instanceof Error?e:new Error(String(e)))),d.on("close",t=>e(t??0))});E&&clearInterval(E),F&&clearTimeout(F),S.end(),await(e=>new Promise((t,n)=>{e.on("close",()=>t()),e.on("error",e=>n(e instanceof Error?e:new Error(String(e))))}))(S);let P="ok";if("number"==typeof k&&0!==k)P="error";else if(c?.warnPatterns&&c.warnPatterns.length>0){const e=(e,t)=>e.some(e=>{try{return e.lastIndex=0,e.test(t)}catch{return!1}});let t=!1;if(m.length>0&&e(c.warnPatterns,m))t=!0;else try{const n=await u(p,"utf8");e(c.warnPatterns,n)&&(t=!0)}catch{}t&&(P="warn")}return a?.onEnd?.(r,p,f,Date.now(),k,P),s&&await h(s,r.slice(0,1).toUpperCase(),"utf8"),p},pd=[];pd.push("SIGHUP","SIGINT","SIGTERM"),"win32"!==process.platform&&pd.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===process.platform&&pd.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");const fd=e=>!!e&&"object"==typeof e&&"function"==typeof e.removeListener&&"function"==typeof e.emit&&"function"==typeof e.reallyExit&&"function"==typeof e.listeners&&"function"==typeof e.kill&&"number"==typeof e.pid&&"function"==typeof e.on,dd=Symbol.for("signal-exit emitter"),hd=globalThis,Dd=Object.defineProperty.bind(Object);class gd{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(hd[dd])return hd[dd];Dd(hd,dd,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){const n=this.listeners[e],r=n.indexOf(t);-1!==r&&(0===r&&1===n.length?n.length=0:n.splice(r,1))}emit(e,t,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let r=!1;for(const o of this.listeners[e])r=!0===o(t,n)||r;return"exit"===e&&(r=this.emit("afterExit",t,n)||r),r}}class md{}const yd=globalThis.process,{onExit:bd}=(vd=fd(yd)?new class extends md{#e="win32"===yd.platform?"SIGINT":"SIGHUP";#t=new gd;#n;#r;#o;#i={};#s=!1;constructor(e){super(),this.#n=e,this.#i={};for(const t of pd)this.#i[t]=()=>{const n=this.#n.listeners(t);let{count:r}=this.#t;const o=e;if("object"==typeof o.__signal_exit_emitter__&&"number"==typeof o.__signal_exit_emitter__.count&&(r+=o.__signal_exit_emitter__.count),n.length===r){this.unload();const n=this.#t.emit("exit",null,t),r="SIGHUP"===t?this.#e:t;n||e.kill(e.pid,r)}};this.#o=e.reallyExit,this.#r=e.emit}onExit(e,t){if(!fd(this.#n))return()=>{};!1===this.#s&&this.load();const n=t?.alwaysLast?"afterExit":"exit";return this.#t.on(n,e),()=>{this.#t.removeListener(n,e),0===this.#t.listeners.exit.length&&0===this.#t.listeners.afterExit.length&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#t.count+=1;for(const e of pd)try{const t=this.#i[e];t&&this.#n.on(e,t)}catch(e){}this.#n.emit=(e,...t)=>this.#a(e,...t),this.#n.reallyExit=e=>this.#u(e)}}unload(){this.#s&&(this.#s=!1,pd.forEach(e=>{const t=this.#i[e];if(!t)throw new Error("Listener not defined for signal: "+e);try{this.#n.removeListener(e,t)}catch(e){}}),this.#n.emit=this.#r,this.#n.reallyExit=this.#o,this.#t.count-=1)}#u(e){return fd(this.#n)?(this.#n.exitCode=e||0,this.#t.emit("exit",this.#n.exitCode,null),this.#o.call(this.#n,this.#n.exitCode)):0}#a(e,...t){const n=this.#r;if("exit"===e&&fd(this.#n)){"number"==typeof t[0]&&(this.#n.exitCode=t[0]);const r=n.call(this.#n,e,...t);return this.#t.emit("exit",this.#n.exitCode,null),r}return n.call(this.#n,e,...t)}}(yd):new class extends md{onExit(){return()=>{}}load(){}unload(){}},{onExit:(e,t)=>vd.onExit(e,t),load:()=>vd.load(),unload:()=>vd.unload()});var vd;class Ed{behavior;constructor(e){this.behavior=e}pids=new Map;lastCancelled=[];track(e,t){this.pids.set(e,t)}cancelAll(e){const t="number"==typeof this.behavior.hangKillGrace?this.behavior.hangKillGrace:10,n=e?.immediate?0:Math.max(0,1e3*t),r=Array.from(this.pids.entries()),o=Array.from(this.pids.values());this.lastCancelled=o;for(const[,e]of r)try{Number.isFinite(e)&&process.kill(e,"SIGTERM")}catch{}const i=()=>{for(const[,e]of r)try{Number.isFinite(e)&&ud(e,"SIGKILL")}catch{}};n<=0?setTimeout(i,0):setTimeout(i,n),this.pids.clear()}async waitAll(e=2e3){const t=this.lastCancelled.length>0?[...this.lastCancelled]:Array.from(this.pids.values());if(0===t.length)return;const n=Date.now()+Math.max(0,e),r=e=>{try{return process.kill(e,0)}catch{return!1}};for(;Date.now()<n;){if(0===t.filter(e=>r(e)).length)break;await new Promise(e=>setTimeout(e,50))}this.lastCancelled=[]}}class Fd{onCancel;onRestart;attached=!1;keyHandler;dataHandler;constructor(e){this.onCancel=e.onCancel,this.onRestart=e.onRestart}attach(){if(this.attached)return;this.attached=!0;const e=process.stdin,t=Boolean(process.stdout.isTTY),n=Boolean(e.isTTY);if(t&&n){try{L(e),e.setRawMode?.(!0),e.resume?.()}catch{}this.keyHandler=(e,t)=>{const n=((t??{}).name??"").toLowerCase();"q"!==n?"r"===n&&this.onRestart?.():this.onCancel()},this.dataHandler=e=>{try{if("string"==typeof e){const t=e.toLowerCase();return void(""===t||"q"===t?this.onCancel():"r"===t&&this.onRestart?.())}if(Buffer.isBuffer(e)){if(e.includes(3))return void this.onCancel();const t=e.toString("utf8").toLowerCase();"q"===t?this.onCancel():"r"===t&&this.onRestart?.()}}catch{}},e.on?.("keypress",this.keyHandler),e.on?.("data",this.dataHandler)}}detach(){if(!this.attached)return;this.attached=!1;const e=process.stdin,t=e.off?.bind(e)??e.removeListener?.bind(e);try{t&&this.keyHandler&&t("keypress",this.keyHandler),t&&this.dataHandler&&t("data",this.dataHandler)}catch{}try{e.setRawMode?.(!1),e.pause?.()}catch{}}}class Cd{rows=new Map;listeners=new Set;subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}update(e,t,n){const r=this.rows.get(e),o=n??r?.meta;if(!o){const n=e.startsWith("archive:")?{type:"archive",item:e.slice(8)||"(unnamed)"}:{type:"script",item:e.replace(/^script:/,"")||"(unnamed)"};return this.rows.set(e,{meta:n,state:t}),void this.emit(e,n,t)}this.rows.set(e,{meta:o,state:t}),this.emit(e,o,t)}emit(e,t,n){for(const r of this.listeners)try{r({key:e,meta:t,state:n})}catch{}}counts(){let e=0,t=0,n=0,r=0,o=0,i=0,s=0,a=0,u=0;for(const[,c]of this.rows){switch(c.state.kind){case"warn":e+=1;break;case"waiting":t+=1;break;case"running":n+=1;break;case"quiet":r+=1;break;case"stalled":o+=1;break;case"done":i+=1;break;case"timedout":u+=1;break;case"cancelled":s+=1;break;case"error":case"killed":a+=1}}return{warn:e,waiting:t,running:n,quiet:r,stalled:o,ok:i,cancelled:s,fail:a,timeout:u}}}const wd=void 0!==globalThis.window?.document;globalThis.process,globalThis.process,globalThis.Deno,globalThis.process,globalThis.navigator?.userAgent?.includes("jsdom"),"undefined"!=typeof WorkerGlobalScope&&(globalThis,WorkerGlobalScope),"undefined"!=typeof DedicatedWorkerGlobalScope&&(globalThis,DedicatedWorkerGlobalScope),"undefined"!=typeof SharedWorkerGlobalScope&&(globalThis,SharedWorkerGlobalScope),"undefined"!=typeof ServiceWorkerGlobalScope&&(globalThis,ServiceWorkerGlobalScope);const _d=globalThis.navigator?.userAgentData?.platform;"macOS"===_d||"MacIntel"===globalThis.navigator?.platform||!0===globalThis.navigator?.userAgent?.includes(" Mac ")||globalThis.process,"Windows"===_d||"Win32"===globalThis.navigator?.platform||globalThis.process,"Linux"===_d||!0===globalThis.navigator?.platform?.startsWith("Linux")||!0===globalThis.navigator?.userAgent?.includes(" Linux ")||globalThis.process,"Android"===_d||"Android"===globalThis.navigator?.platform||!0===globalThis.navigator?.userAgent?.includes(" Android ")||globalThis.process;const Ad="[";!wd&&E.env.TERM_PROGRAM,!wd&&E.platform,wd||E.cwd;const Sd=(e=1)=>Ad+e+"A",kd=(e=1)=>Ad+e+"B",Pd="",Rd=e=>{let t="";for(let n=0;n<e;n++)t+=Bd+(n<e-1?Sd():"");return e&&(t+=Pd),t},Bd="",xd=(e,t,n,r)=>{if("length"===n||"prototype"===n)return;if("arguments"===n||"caller"===n)return;const o=Object.getOwnPropertyDescriptor(e,n),i=Object.getOwnPropertyDescriptor(t,n);!Od(o,i)&&r||Object.defineProperty(e,n,i)},Od=function(e,t){return void 0===e||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},Td=(e,t)=>`/* Wrapped ${e}*/\n${t}`,$d=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Ld=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name");function Nd(e,t,{ignoreNonConfigurable:n=!1}={}){const{name:r}=e;for(const r of Reflect.ownKeys(t))xd(e,t,r,n);return((e,t)=>{const n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)})(e,t),((e,t,n)=>{const r=""===n?"":`with ${n.trim()}() `,o=Td.bind(null,r,t.toString());Object.defineProperty(o,"name",Ld);const{writable:i,enumerable:s,configurable:a}=$d;Object.defineProperty(e,"toString",{value:o,writable:i,enumerable:s,configurable:a})})(e,t,r),e}const Md=new WeakMap,jd=(e,t={})=>{if("function"!=typeof e)throw new TypeError("Expected a function");let n,r=0;const o=e.displayName||e.name||"<anonymous>",i=function(...s){if(Md.set(i,++r),1===r)n=e.apply(this,s),e=void 0;else if(!0===t.throw)throw new Error(`Function \`${o}\` can only be called once`);return n};return Nd(i,e),Md.set(i,r),i};jd.callCount=e=>{if(!Md.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return Md.get(e)};const Id=E.stderr.isTTY?E.stderr:E.stdout.isTTY?E.stdout:void 0,Hd=Id?jd(()=>{bd(()=>{Id.write("[?25h")},{alwaysLast:!0})}):()=>{};let zd=!1;const Kd={};Kd.show=(e=E.stderr)=>{e.isTTY&&(zd=!1,e.write("[?25h"))},Kd.hide=(e=E.stderr)=>{e.isTTY&&(Hd(),zd=!0,e.write("[?25l"))},Kd.toggle=(e,t)=>{void 0!==e&&(zd=e),zd?Kd.show(t):Kd.hide(t)};const Ud=function({onlyFirst:e=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",e?void 0:"g")}();function qd(e){if("string"!=typeof e)throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(Ud,"")}function Gd(e){return 12288===e||e>=65281&&e<=65376||e>=65504&&e<=65510}function Wd(e){return e>=4352&&e<=4447||8986===e||8987===e||9001===e||9002===e||e>=9193&&e<=9196||9200===e||9203===e||9725===e||9726===e||9748===e||9749===e||e>=9776&&e<=9783||e>=9800&&e<=9811||9855===e||e>=9866&&e<=9871||9875===e||9889===e||9898===e||9899===e||9917===e||9918===e||9924===e||9925===e||9934===e||9940===e||9962===e||9970===e||9971===e||9973===e||9978===e||9981===e||9989===e||9994===e||9995===e||10024===e||10060===e||10062===e||e>=10067&&e<=10069||10071===e||e>=10133&&e<=10135||10160===e||10175===e||11035===e||11036===e||11088===e||11093===e||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e>=94192&&e<=94198||e>=94208&&e<=101589||e>=101631&&e<=101662||e>=101760&&e<=101874||e>=110576&&e<=110579||e>=110581&&e<=110587||110589===e||110590===e||e>=110592&&e<=110882||110898===e||e>=110928&&e<=110930||110933===e||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||126980===e||127183===e||127374===e||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||127568===e||127569===e||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||127988===e||e>=127992&&e<=128062||128064===e||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||128378===e||128405===e||128406===e||128420===e||e>=128507&&e<=128591||e>=128640&&e<=128709||128716===e||e>=128720&&e<=128722||e>=128725&&e<=128728||e>=128732&&e<=128735||128747===e||128748===e||e>=128756&&e<=128764||e>=128992&&e<=129003||129008===e||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129674||e>=129678&&e<=129734||129736===e||e>=129741&&e<=129756||e>=129759&&e<=129770||e>=129775&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}function Zd(e,{ambiguousAsWide:t=!1}={}){return function(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}(e),Gd(e)||Wd(e)||t&&function(e){return 161===e||164===e||167===e||168===e||170===e||173===e||174===e||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||198===e||208===e||215===e||216===e||e>=222&&e<=225||230===e||e>=232&&e<=234||236===e||237===e||240===e||242===e||243===e||e>=247&&e<=250||252===e||254===e||257===e||273===e||275===e||283===e||294===e||295===e||299===e||e>=305&&e<=307||312===e||e>=319&&e<=322||324===e||e>=328&&e<=331||333===e||338===e||339===e||358===e||359===e||363===e||462===e||464===e||466===e||468===e||470===e||472===e||474===e||476===e||593===e||609===e||708===e||711===e||e>=713&&e<=715||717===e||720===e||e>=728&&e<=731||733===e||735===e||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||1025===e||e>=1040&&e<=1103||1105===e||8208===e||e>=8211&&e<=8214||8216===e||8217===e||8220===e||8221===e||e>=8224&&e<=8226||e>=8228&&e<=8231||8240===e||8242===e||8243===e||8245===e||8251===e||8254===e||8308===e||8319===e||e>=8321&&e<=8324||8364===e||8451===e||8453===e||8457===e||8467===e||8470===e||8481===e||8482===e||8486===e||8491===e||8531===e||8532===e||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||8585===e||e>=8592&&e<=8601||8632===e||8633===e||8658===e||8660===e||8679===e||8704===e||8706===e||8707===e||8711===e||8712===e||8715===e||8719===e||8721===e||8725===e||8730===e||e>=8733&&e<=8736||8739===e||8741===e||e>=8743&&e<=8748||8750===e||e>=8756&&e<=8759||8764===e||8765===e||8776===e||8780===e||8786===e||8800===e||8801===e||e>=8804&&e<=8807||8810===e||8811===e||8814===e||8815===e||8834===e||8835===e||8838===e||8839===e||8853===e||8857===e||8869===e||8895===e||8978===e||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||9632===e||9633===e||e>=9635&&e<=9641||9650===e||9651===e||9654===e||9655===e||9660===e||9661===e||9664===e||9665===e||e>=9670&&e<=9672||9675===e||e>=9678&&e<=9681||e>=9698&&e<=9701||9711===e||9733===e||9734===e||9737===e||9742===e||9743===e||9756===e||9758===e||9792===e||9794===e||9824===e||9825===e||e>=9827&&e<=9829||e>=9831&&e<=9834||9836===e||9837===e||9839===e||9886===e||9887===e||9919===e||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||9955===e||9960===e||9961===e||e>=9963&&e<=9969||9972===e||e>=9974&&e<=9977||9979===e||9980===e||9982===e||9983===e||10045===e||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||65533===e||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||127375===e||127376===e||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}(e)?2:1}var Vd=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;const Jd=new Intl.Segmenter,Yd=/^\p{Default_Ignorable_Code_Point}$/u;function Qd(e,t={}){if("string"!=typeof e||0===e.length)return 0;const{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=t;if(r||(e=qd(e)),0===e.length)return 0;let o=0;const i={ambiguousAsWide:!n};for(const{segment:t}of Jd.segment(e)){const e=t.codePointAt(0);e<=31||e>=127&&e<=159||(e>=8203&&e<=8207||65279===e||e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=55296&&e<=57343||e>=65024&&e<=65039||Yd.test(t)||(Vd().test(t)?o+=2:o+=Zd(e,i)))}return o}const Xd=(e=0)=>t=>`[${t+e}m`,eh=(e=0)=>t=>`[${38+e};5;${t}m`,th=(e=0)=>(t,n,r)=>`[${38+e};2;${t};${n};${r}m`,nh={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(nh.modifier);Object.keys(nh.color),Object.keys(nh.bgColor);const rh=function(){const e=new Map;for(const[t,n]of Object.entries(nh)){for(const[t,r]of Object.entries(n))nh[t]={open:`[${r[0]}m`,close:`[${r[1]}m`},n[t]=nh[t],e.set(r[0],r[1]);Object.defineProperty(nh,t,{value:n,enumerable:!1})}return Object.defineProperty(nh,"codes",{value:e,enumerable:!1}),nh.color.close="",nh.bgColor.close="",nh.color.ansi=Xd(),nh.color.ansi256=eh(),nh.color.ansi16m=th(),nh.bgColor.ansi=Xd(10),nh.bgColor.ansi256=eh(10),nh.bgColor.ansi16m=th(10),Object.defineProperties(nh,{rgbToAnsi256:{value:(e,t,n)=>e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value(e){const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;3===n.length&&(n=[...n].map(e=>e+e).join(""));const r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},enumerable:!1},hexToAnsi256:{value:e=>nh.rgbToAnsi256(...nh.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return e-8+90;let t,n,r;if(e>=232)t=(10*(e-232)+8)/255,n=t,r=t;else{const o=(e-=16)%36;t=Math.floor(e/36)/5,n=Math.floor(o/6)/5,r=o%6/5}const o=2*Math.max(t,n,r);if(0===o)return 30;let i=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return 2===o&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>nh.ansi256ToAnsi(nh.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>nh.ansi256ToAnsi(nh.hexToAnsi256(e)),enumerable:!1}}),nh}(),oh=new Set(["","›"]),ih="]8;;",sh=e=>`${oh.values().next().value}[${e}m`,ah=e=>`${oh.values().next().value}${ih}${e}`,uh=(e,t,n)=>{const r=[...t];let o=!1,i=!1,s=Qd(qd(e.at(-1)));for(const[t,a]of r.entries()){const u=Qd(a);if(s+u<=n?e[e.length-1]+=a:(e.push(a),s=0),oh.has(a)){o=!0;i=r.slice(t+1,t+1+4).join("")===ih}o?i?""===a&&(o=!1,i=!1):"m"===a&&(o=!1):(s+=u,s===n&&t<r.length-1&&(e.push(""),s=0))}!s&&e.at(-1).length>0&&e.length>1&&(e[e.length-2]+=e.pop())},ch=(e,t,n={})=>{if(!1!==n.trim&&""===e.trim())return"";let r,o,i="";const s=(e=>e.split(" ").map(e=>Qd(e)))(e);let a=[""];for(const[r,o]of e.split(" ").entries()){!1!==n.trim&&(a[a.length-1]=a.at(-1).trimStart());let e=Qd(a.at(-1));if(0!==r&&(e>=t&&(!1===n.wordWrap||!1===n.trim)&&(a.push(""),e=0),(e>0||!1===n.trim)&&(a[a.length-1]+=" ",e++)),n.hard&&s[r]>t){const n=t-e,i=1+Math.floor((s[r]-n-1)/t);Math.floor((s[r]-1)/t)<i&&a.push(""),uh(a,o,t);continue}if(e+s[r]>t&&e>0&&s[r]>0){if(!1===n.wordWrap&&e<t){uh(a,o,t);continue}a.push("")}e+s[r]>t&&!1===n.wordWrap?uh(a,o,t):a[a.length-1]+=o}!1!==n.trim&&(a=a.map(e=>(e=>{const t=e.split(" ");let n=t.length;for(;n>0&&!(Qd(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(" ")+t.slice(n).join("")})(e)));const u=a.join("\n"),c=[...u];let l=0;for(const[e,t]of c.entries()){if(i+=t,oh.has(t)){const{groups:e}=new RegExp(`(?:\\[(?<code>\\d+)m|\\${ih}(?<uri>.*))`).exec(u.slice(l))||{groups:{}};if(void 0!==e.code){const t=Number.parseFloat(e.code);r=39===t?void 0:t}else void 0!==e.uri&&(o=0===e.uri.length?void 0:e.uri)}const n=rh.codes.get(Number(r));"\n"===c[e+1]?(o&&(i+=ah("")),r&&n&&(i+=sh(n))):"\n"===t&&(r&&n&&(i+=sh(r)),o&&(i+=ah(o))),l+=t.length}return i};function lh(e){return!!Number.isInteger(e)&&(Gd(e)||Wd(e))}const ph=new Set([27,155]),fh="0".codePointAt(0),dh="9".codePointAt(0),hh=new Set,Dh=new Map;for(const[e,t]of rh.codes)hh.add(rh.color.ansi(t)),Dh.set(rh.color.ansi(e),rh.color.ansi(t));function gh(e){if(hh.has(e))return e;if(Dh.has(e))return Dh.get(e);(e=e.slice(2)).includes(";")&&(e=e[0]+"0");const t=rh.codes.get(Number.parseInt(e,10));return t?rh.color.ansi(t):rh.reset.open}function mh(e,t){const n=function(e){for(let t=0;t<e.length;t++){const n=e.codePointAt(t);if(n>=fh&&n<=dh)return t}return-1}(e=e.slice(t,t+19));if(-1!==n){let t=e.indexOf("m",n);return-1===t&&(t=e.length),e.slice(0,t+1)}}function yh(e){let t=[];for(const n of e)n.code===rh.reset.open?t=[]:hh.has(n.code)?t=t.filter(e=>e.endCode!==n.code):(t=t.filter(e=>e.endCode!==n.endCode),t.push(n));return t}function bh(e,t,n){const r=function(e,t=Number.POSITIVE_INFINITY){const n=[];let r=0,o=0;for(;r<e.length;){const i=e.codePointAt(r);if(ph.has(i)){const t=mh(e,r);if(t){n.push({type:"ansi",code:t,endCode:gh(t)}),r+=t.length;continue}}const s=lh(i),a=String.fromCodePoint(i);if(n.push({type:"character",value:a,isFullWidth:s}),r+=a.length,o+=s?2:a.length,o>=t)break}return n}(e,n);let o=[],i=0,s="",a=!1;for(const e of r)"ansi"===e.type?(o.push(e),a&&(s+=e.code)):(!a&&i>=t&&(a=!0,o=yh(o),s=o.map(({code:e})=>e).join("")),a&&(s+=e.value),i+=e.isFullWidth?2:e.value.length);return s+=yh(o).map(({endCode:e})=>e).reverse().join(""),s}const vh=(e,t)=>e.columns??t??80;function Eh(e,{showCursor:t=!1,defaultWidth:n,defaultHeight:r}={}){let o=0,i=vh(e,n),s="";const a=(t,n)=>{const o=String(t),i=o.endsWith("\n")?o:`${o}\n`,s=(a=n,u={trim:!1,hard:!0,wordWrap:!1},String(i).normalize().replaceAll("\r\n","\n").split("\n").map(e=>ch(e,a,u)).join("\n"));var a,u;const{text:c,wasClipped:l}=((e,t,n)=>{const r=e.rows??n??24;if(void 0===r)return{text:t,wasClipped:!1};if(0===r)return{text:"",wasClipped:""!==t};const o=qd(t),i=[...o].filter(e=>"\n"===e).length+1,s=Math.max(0,i-r);if(0===s)return{text:t,wasClipped:!1};let a=0,u=0;for(const[e,t]of[...o].entries())if("\n"===t&&(a++,a===s)){u=e+1;break}return{text:bh(t,u),wasClipped:!0}})(e,s,r),p=""===c?[]:c.split("\n");return{wrapped:c,lines:p,wasClipped:l}},u=()=>{s="",i=vh(e,n),o=0},c=(...r)=>{t||Kd.hide();const u=vh(e,n),{wrapped:c,lines:l,wasClipped:p}=a(r.join(" "),u);if(0===l.length)return s=c,i=u,void(o=0);if(c===s&&i===u)return;if(0===o)return e.write(c),s=c,i=u,void(o=l.length);if(i!==u||p)return e.write(Rd(o)+c),s=c,i=u,void(o=l.length);const f=""===s?[]:s.split("\n"),{start:d,endPrevious:h,endNext:D}=((e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);let r=e.length-1,o=t.length-1;for(;r>=n&&o>=n&&e[r]===t[o];)r--,o--;return{start:n,endPrevious:r,endNext:o}})(f,l);if(d===l.length&&o===l.length)return;if(0===d)return e.write(Rd(o)+c),s=c,i=u,void(o=l.length);const g=(({prevCount:e,start:t,endPrevious:n,endNext:r,nextLines:o,nextWrappedEndsWithNewline:i})=>{let s="";const a=Math.max(0,e-1-t);a>0&&(s+=Sd(a)),s+=Pd;const u=Math.max(0,n-t+1);for(let e=0;e<u;e++)s+=Bd,e<u-1&&(s+=kd());u>1&&(s+=Sd(u-1)),s+=Pd;const c=o.slice(t,r+1);if(c.length>0){let e=c.join("\n");i&&!e.endsWith("\n")&&(e+="\n"),s+=e,s+=""}const l=t+c.length,p=o.length-1-l;return p>0&&(s+=kd(p)),s})({prevCount:o,start:d,endPrevious:h,endNext:D,nextLines:l,nextWrappedEndsWithNewline:c.endsWith("\n")});e.write(g),s=c,i=u,o=l.length};return c.clear=()=>{e.write(Rd(o)),u()},c.done=()=>{u(),t||Kd.show()},c.persist=(...t)=>{o>0&&(e.write(Rd(o)),o=0);const r=`${t.join(" ")}`,i=vh(e,n),{wrapped:s}=a(r,i);e.write(s),u()},c}const Fh=Eh(E.stdout);Eh(E.stderr);var Ch,wh,_h,Ah,Sh={},kh={},Ph={},Rh={},Bh={exports:{}};function xh(){return wh?Ch:(wh=1,Ch=({onlyFirst:e=!1}={})=>{const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")})}function Oh(){if(Ah)return _h;Ah=1;const e=xh();return _h=t=>"string"==typeof t?t.replace(e(),""):t}var Th,$h,Lh,Nh,Mh={exports:{}};function jh(){if(Th)return Mh.exports;Th=1;const e=e=>!Number.isNaN(e)&&(e>=4352&&(e<=4447||9001===e||9002===e||11904<=e&&e<=12871&&12351!==e||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141));return Mh.exports=e,Mh.exports.default=e,Mh.exports}function Ih(){return Lh?$h:(Lh=1,$h=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g})}function Hh(){if(Nh)return Bh.exports;Nh=1;const e=Oh(),t=jh(),n=Ih(),r=r=>{if("string"!=typeof r||0===r.length)return 0;if(0===(r=e(r)).length)return 0;r=r.replace(n()," ");let o=0;for(let e=0;e<r.length;e++){const n=r.codePointAt(e);n<=31||n>=127&&n<=159||(n>=768&&n<=879||(n>65535&&e++,o+=t(n)?2:1))}return o};return Bh.exports=r,Bh.exports.default=r,Bh.exports}var zh,Kh,Uh={};var qh,Gh,Wh,Zh,Vh,Jh,Yh,Qh,Xh,eD,tD,nD={exports:{}};function rD(){if(Zh)return Wh;Zh=1;const e=Gh?qh:(Gh=1,qh={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}),t={};for(const n of Object.keys(e))t[e[n]]=n;const n={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};Wh=n;for(const e of Object.keys(n)){if(!("channels"in n[e]))throw new Error("missing channels property: "+e);if(!("labels"in n[e]))throw new Error("missing channel labels property: "+e);if(n[e].labels.length!==n[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:r}=n[e];delete n[e].channels,delete n[e].labels,Object.defineProperty(n[e],"channels",{value:t}),Object.defineProperty(n[e],"labels",{value:r})}function r(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}return n.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.min(t,n,r),i=Math.max(t,n,r),s=i-o;let a,u;i===o?a=0:t===i?a=(n-r)/s:n===i?a=2+(r-t)/s:r===i&&(a=4+(t-n)/s),a=Math.min(60*a,360),a<0&&(a+=360);const c=(o+i)/2;return u=i===o?0:c<=.5?s/(i+o):s/(2-i-o),[a,100*u,100*c]},n.rgb.hsv=function(e){let t,n,r,o,i;const s=e[0]/255,a=e[1]/255,u=e[2]/255,c=Math.max(s,a,u),l=c-Math.min(s,a,u),p=function(e){return(c-e)/6/l+.5};return 0===l?(o=0,i=0):(i=l/c,t=p(s),n=p(a),r=p(u),s===c?o=r-n:a===c?o=1/3+t-r:u===c&&(o=2/3+n-t),o<0?o+=1:o>1&&(o-=1)),[360*o,100*i,100*c]},n.rgb.hwb=function(e){const t=e[0],r=e[1];let o=e[2];const i=n.rgb.hsl(e)[0],s=1/255*Math.min(t,Math.min(r,o));return o=1-1/255*Math.max(t,Math.max(r,o)),[i,100*s,100*o]},n.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.min(1-t,1-n,1-r);return[100*((1-t-o)/(1-o)||0),100*((1-n-o)/(1-o)||0),100*((1-r-o)/(1-o)||0),100*o]},n.rgb.keyword=function(n){const o=t[n];if(o)return o;let i,s=1/0;for(const t of Object.keys(e)){const o=r(n,e[t]);o<s&&(s=o,i=t)}return i},n.keyword.rgb=function(t){return e[t]},n.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;return[100*(.4124*t+.3576*n+.1805*r),100*(.2126*t+.7152*n+.0722*r),100*(.0193*t+.1192*n+.9505*r)]},n.rgb.lab=function(e){const t=n.rgb.xyz(e);let r=t[0],o=t[1],i=t[2];r/=95.047,o/=100,i/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,o=o>.008856?o**(1/3):7.787*o+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;return[116*o-16,500*(r-o),200*(o-i)]},n.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;let o,i,s;if(0===n)return s=255*r,[s,s,s];o=r<.5?r*(1+n):r+n-r*n;const a=2*r-o,u=[0,0,0];for(let e=0;e<3;e++)i=t+1/3*-(e-1),i<0&&i++,i>1&&i--,s=6*i<1?a+6*(o-a)*i:2*i<1?o:3*i<2?a+(o-a)*(2/3-i)*6:a,u[e]=255*s;return u},n.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,r=e[2]/100,o=n;const i=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,o*=i<=1?i:2-i;return[t,100*(0===r?2*o/(i+o):2*n/(r+n)),100*((r+n)/2)]},n.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let r=e[2]/100;const o=Math.floor(t)%6,i=t-Math.floor(t),s=255*r*(1-n),a=255*r*(1-n*i),u=255*r*(1-n*(1-i));switch(r*=255,o){case 0:return[r,u,s];case 1:return[a,r,s];case 2:return[s,r,u];case 3:return[s,a,r];case 4:return[u,s,r];case 5:return[r,s,a]}},n.hsv.hsl=function(e){const t=e[0],n=e[1]/100,r=e[2]/100,o=Math.max(r,.01);let i,s;s=(2-n)*r;const a=(2-n)*o;return i=n*o,i/=a<=1?a:2-a,i=i||0,s/=2,[t,100*i,100*s]},n.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,r=e[2]/100;const o=n+r;let i;o>1&&(n/=o,r/=o);const s=Math.floor(6*t),a=1-r;i=6*t-s,1&s&&(i=1-i);const u=n+i*(a-n);let c,l,p;switch(s){default:case 6:case 0:c=a,l=u,p=n;break;case 1:c=u,l=a,p=n;break;case 2:c=n,l=a,p=u;break;case 3:c=n,l=u,p=a;break;case 4:c=u,l=n,p=a;break;case 5:c=a,l=n,p=u}return[255*c,255*l,255*p]},n.cmyk.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,o=e[3]/100;return[255*(1-Math.min(1,t*(1-o)+o)),255*(1-Math.min(1,n*(1-o)+o)),255*(1-Math.min(1,r*(1-o)+o))]},n.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100;let o,i,s;return o=3.2406*t+-1.5372*n+-.4986*r,i=-.9689*t+1.8758*n+.0415*r,s=.0557*t+-.204*n+1.057*r,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,i=i>.0031308?1.055*i**(1/2.4)-.055:12.92*i,s=s>.0031308?1.055*s**(1/2.4)-.055:12.92*s,o=Math.min(Math.max(0,o),1),i=Math.min(Math.max(0,i),1),s=Math.min(Math.max(0,s),1),[255*o,255*i,255*s]},n.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;return[116*n-16,500*(t-n),200*(n-r)]},n.lab.xyz=function(e){let t,n,r;n=(e[0]+16)/116,t=e[1]/500+n,r=n-e[2]/200;const o=n**3,i=t**3,s=r**3;return n=o>.008856?o:(n-16/116)/7.787,t=i>.008856?i:(t-16/116)/7.787,r=s>.008856?s:(r-16/116)/7.787,t*=95.047,n*=100,r*=108.883,[t,n,r]},n.lab.lch=function(e){const t=e[0],n=e[1],r=e[2];let o;o=360*Math.atan2(r,n)/2/Math.PI,o<0&&(o+=360);return[t,Math.sqrt(n*n+r*r),o]},n.lch.lab=function(e){const t=e[0],n=e[1],r=e[2]/360*2*Math.PI;return[t,n*Math.cos(r),n*Math.sin(r)]},n.rgb.ansi16=function(e,t=null){const[r,o,i]=e;let s=null===t?n.rgb.hsv(e)[2]:t;if(s=Math.round(s/50),0===s)return 30;let a=30+(Math.round(i/255)<<2|Math.round(o/255)<<1|Math.round(r/255));return 2===s&&(a+=60),a},n.hsv.ansi16=function(e){return n.rgb.ansi16(n.hsv.rgb(e),e[2])},n.rgb.ansi256=function(e){const t=e[0],n=e[1],r=e[2];if(t===n&&n===r)return t<8?16:t>248?231:Math.round((t-8)/247*24)+232;return 16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},n.ansi16.rgb=function(e){let t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const n=.5*(1+~~(e>50));return[(1&t)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},n.ansi256.rgb=function(e){if(e>=232){const t=10*(e-232)+8;return[t,t,t]}let t;e-=16;return[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},n.rgb.hex=function(e){const t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},n.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];3===t[0].length&&(n=n.split("").map(e=>e+e).join(""));const r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},n.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.max(Math.max(t,n),r),i=Math.min(Math.min(t,n),r),s=o-i;let a,u;return a=s<1?i/(1-s):0,u=s<=0?0:o===t?(n-r)/s%6:o===n?2+(r-t)/s:4+(t-n)/s,u/=6,u%=1,[360*u,100*s,100*a]},n.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n);let o=0;return r<1&&(o=(n-.5*r)/(1-r)),[e[0],100*r,100*o]},n.hsv.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=t*n;let o=0;return r<1&&(o=(n-r)/(1-r)),[e[0],100*r,100*o]},n.hcg.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;if(0===n)return[255*r,255*r,255*r];const o=[0,0,0],i=t%1*6,s=i%1,a=1-s;let u=0;switch(Math.floor(i)){case 0:o[0]=1,o[1]=s,o[2]=0;break;case 1:o[0]=a,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=s;break;case 3:o[0]=0,o[1]=a,o[2]=1;break;case 4:o[0]=s,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=a}return u=(1-n)*r,[255*(n*o[0]+u),255*(n*o[1]+u),255*(n*o[2]+u)]},n.hcg.hsv=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);let r=0;return n>0&&(r=t/n),[e[0],100*r,100*n]},n.hcg.hsl=function(e){const t=e[1]/100,n=e[2]/100*(1-t)+.5*t;let r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],100*r,100*n]},n.hcg.hwb=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],100*(n-t),100*(1-n)]},n.hwb.hcg=function(e){const t=e[1]/100,n=1-e[2]/100,r=n-t;let o=0;return r<1&&(o=(n-r)/(1-r)),[e[0],100*r,100*o]},n.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},n.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},n.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},n.gray.hsl=function(e){return[0,0,e[0]]},n.gray.hsv=n.gray.hsl,n.gray.hwb=function(e){return[0,100,e[0]]},n.gray.cmyk=function(e){return[0,0,0,e[0]]},n.gray.lab=function(e){return[e[0],0,0]},n.gray.hex=function(e){const t=255&Math.round(e[0]/100*255),n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n},n.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]},Wh}function oD(){if(Jh)return Vh;Jh=1;const e=rD();function t(t){const n=function(){const t={},n=Object.keys(e);for(let e=n.length,r=0;r<e;r++)t[n[r]]={distance:-1,parent:null};return t}(),r=[t];for(n[t].distance=0;r.length;){const t=r.pop(),o=Object.keys(e[t]);for(let e=o.length,i=0;i<e;i++){const e=o[i],s=n[e];-1===s.distance&&(s.distance=n[t].distance+1,s.parent=t,r.unshift(e))}}return n}function n(e,t){return function(n){return t(e(n))}}function r(t,r){const o=[r[t].parent,t];let i=e[r[t].parent][t],s=r[t].parent;for(;r[s].parent;)o.unshift(r[s].parent),i=n(e[r[s].parent][s],i),s=r[s].parent;return i.conversion=o,i}return Vh=function(e){const n=t(e),o={},i=Object.keys(n);for(let e=i.length,t=0;t<e;t++){const e=i[t];null!==n[e].parent&&(o[e]=r(e,n))}return o},Vh}function iD(){if(Qh)return Yh;Qh=1;const e=rD(),t=oD(),n={};return Object.keys(e).forEach(r=>{n[r]={},Object.defineProperty(n[r],"channels",{value:e[r].channels}),Object.defineProperty(n[r],"labels",{value:e[r].labels});const o=t(r);Object.keys(o).forEach(e=>{const t=o[e];n[r][e]=function(e){const t=function(...t){const n=t[0];if(null==n)return n;n.length>1&&(t=n);const r=e(t);if("object"==typeof r)for(let e=r.length,t=0;t<e;t++)r[t]=Math.round(r[t]);return r};return"conversion"in e&&(t.conversion=e.conversion),t}(t),n[r][e].raw=function(e){const t=function(...t){const n=t[0];return null==n?n:(n.length>1&&(t=n),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(t)})}),Yh=n}function sD(){return Xh||(Xh=1,function(e){const t=(e,t)=>(...n)=>`[${e(...n)+t}m`,n=(e,t)=>(...n)=>{const r=e(...n);return`[${38+t};5;${r}m`},r=(e,t)=>(...n)=>{const r=e(...n);return`[${38+t};2;${r[0]};${r[1]};${r[2]}m`},o=e=>e,i=(e,t,n)=>[e,t,n],s=(e,t,n)=>{Object.defineProperty(e,t,{get:()=>{const r=n();return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0}),r},enumerable:!0,configurable:!0})};let a;const u=(e,t,n,r)=>{void 0===a&&(a=iD());const o=r?10:0,i={};for(const[r,s]of Object.entries(a)){const a="ansi16"===r?"ansi":r;r===t?i[a]=e(n,o):"object"==typeof s&&(i[a]=e(s[t],o))}return i};Object.defineProperty(e,"exports",{enumerable:!0,get:function(){const e=new Map,a={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};a.color.gray=a.color.blackBright,a.bgColor.bgGray=a.bgColor.bgBlackBright,a.color.grey=a.color.blackBright,a.bgColor.bgGrey=a.bgColor.bgBlackBright;for(const[t,n]of Object.entries(a)){for(const[t,r]of Object.entries(n))a[t]={open:`[${r[0]}m`,close:`[${r[1]}m`},n[t]=a[t],e.set(r[0],r[1]);Object.defineProperty(a,t,{value:n,enumerable:!1})}return Object.defineProperty(a,"codes",{value:e,enumerable:!1}),a.color.close="",a.bgColor.close="",s(a.color,"ansi",()=>u(t,"ansi16",o,!1)),s(a.color,"ansi256",()=>u(n,"ansi256",o,!1)),s(a.color,"ansi16m",()=>u(r,"rgb",i,!1)),s(a.bgColor,"ansi",()=>u(t,"ansi16",o,!0)),s(a.bgColor,"ansi256",()=>u(n,"ansi256",o,!0)),s(a.bgColor,"ansi16m",()=>u(r,"rgb",i,!0)),a}})}(nD)),nD.exports}function aD(){if(tD)return eD;tD=1;const e=jh(),t=function(){if(Kh)return zh;Kh=1;const e="[\ud800-\udbff][\udc00-\udfff]";return zh=t=>t&&t.exact?new RegExp(`^${e}$`):new RegExp(e,"g")}(),n=sD(),r=["","›"],o=e=>`${r[0]}[${e}m`,i=(e,t,r)=>{let i=[];e=[...e];for(let r of e){const s=r;r.includes(";")&&(r=r.split(";")[0][0]+"0");const a=n.codes.get(Number.parseInt(r,10));if(a){const n=e.indexOf(a.toString());-1===n?i.push(o(t?a:s)):e.splice(n,1)}else{if(t){i.push(o(0));break}i.push(o(s))}}if(t&&(i=i.filter((e,t)=>i.indexOf(e)===t),void 0!==r)){const e=o(n.codes.get(Number.parseInt(r,10)));i=i.reduce((t,n)=>n===e?[n,...t]:[...t,n],[])}return i.join("")};return eD=(n,o,s)=>{const a=[...n],u=[];let c,l="number"==typeof s?s:a.length,p=!1,f=0,d="";for(const[h,D]of a.entries()){let a=!1;if(r.includes(D)){const e=/\d[^m]*/.exec(n.slice(h,h+18));c=e&&e.length>0?e[0]:void 0,f<l&&(p=!0,void 0!==c&&u.push(c))}else p&&"m"===D&&(p=!1,a=!0);if(p||a||f++,!t({exact:!0}).test(D)&&e(D.codePointAt())&&(f++,"number"!=typeof s&&l++),f>o&&f<=l)d+=D;else if(f!==o||p||void 0===c){if(f>=l){d+=i(u,!0,c);break}}else d=i(u)}return d}}var uD,cD,lD,pD,fD={};function dD(){if(uD)return fD;uD=1,Object.defineProperty(fD,"__esModule",{value:!0}),fD.getBorderCharacters=void 0;return fD.getBorderCharacters=e=>{if("honeywell"===e)return{topBody:"═",topJoin:"╤",topLeft:"╔",topRight:"╗",bottomBody:"═",bottomJoin:"╧",bottomLeft:"╚",bottomRight:"╝",bodyLeft:"║",bodyRight:"║",bodyJoin:"│",headerJoin:"┬",joinBody:"─",joinLeft:"╟",joinRight:"╢",joinJoin:"┼",joinMiddleDown:"┬",joinMiddleUp:"┴",joinMiddleLeft:"┤",joinMiddleRight:"├"};if("norc"===e)return{topBody:"─",topJoin:"┬",topLeft:"┌",topRight:"┐",bottomBody:"─",bottomJoin:"┴",bottomLeft:"└",bottomRight:"┘",bodyLeft:"│",bodyRight:"│",bodyJoin:"│",headerJoin:"┬",joinBody:"─",joinLeft:"├",joinRight:"┤",joinJoin:"┼",joinMiddleDown:"┬",joinMiddleUp:"┴",joinMiddleLeft:"┤",joinMiddleRight:"├"};if("ramac"===e)return{topBody:"-",topJoin:"+",topLeft:"+",topRight:"+",bottomBody:"-",bottomJoin:"+",bottomLeft:"+",bottomRight:"+",bodyLeft:"|",bodyRight:"|",bodyJoin:"|",headerJoin:"+",joinBody:"-",joinLeft:"|",joinRight:"|",joinJoin:"|",joinMiddleDown:"+",joinMiddleUp:"+",joinMiddleLeft:"+",joinMiddleRight:"+"};if("void"===e)return{topBody:"",topJoin:"",topLeft:"",topRight:"",bottomBody:"",bottomJoin:"",bottomLeft:"",bottomRight:"",bodyLeft:"",bodyRight:"",bodyJoin:"",headerJoin:"",joinBody:"",joinLeft:"",joinRight:"",joinJoin:"",joinMiddleDown:"",joinMiddleUp:"",joinMiddleLeft:"",joinMiddleRight:""};throw new Error('Unknown border template "'+e+'".')},fD}function hD(){if(cD)return Uh;cD=1;var e=Uh&&Uh.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Uh,"__esModule",{value:!0}),Uh.isCellInRange=Uh.areCellEqual=Uh.calculateRangeCoordinate=Uh.flatten=Uh.extractTruncates=Uh.sumArray=Uh.sequence=Uh.distributeUnevenly=Uh.countSpaceSequence=Uh.groupBySizes=Uh.makeBorderConfig=Uh.splitAnsi=Uh.normalizeString=void 0;const t=e(aD()),n=e(Hh()),r=e(Oh()),o=dD();Uh.normalizeString=e=>e.replace(/\r\n/g,"\n");Uh.splitAnsi=e=>{const o=(0,r.default)(e).split("\n").map(n.default),i=[];let s=0;return o.forEach(n=>{i.push(0===n?"":(0,t.default)(e,s,s+n)),s+=n+1}),i};Uh.makeBorderConfig=e=>({...(0,o.getBorderCharacters)("honeywell"),...e});Uh.groupBySizes=(e,t)=>{let n=0;return t.map(t=>{const r=e.slice(n,n+t);return n+=t,r})};Uh.countSpaceSequence=e=>{var t,n;return null!==(n=null===(t=e.match(/\s+/g))||void 0===t?void 0:t.length)&&void 0!==n?n:0};Uh.distributeUnevenly=(e,t)=>Array.from({length:t}).fill(Math.floor(e/t)).map((n,r)=>n+(r<e%t?1:0));Uh.sequence=(e,t)=>Array.from({length:t-e+1},(t,n)=>n+e);Uh.sumArray=e=>e.reduce((e,t)=>e+t,0);Uh.extractTruncates=e=>e.columns.map(({truncate:e})=>e);Uh.flatten=e=>[].concat(...e);Uh.calculateRangeCoordinate=e=>{const{row:t,col:n,colSpan:r=1,rowSpan:o=1}=e;return{bottomRight:{col:n+r-1,row:t+o-1},topLeft:{col:n,row:t}}};Uh.areCellEqual=(e,t)=>e.row===t.row&&e.col===t.col;return Uh.isCellInRange=(e,{topLeft:t,bottomRight:n})=>t.row<=e.row&&e.row<=n.row&&t.col<=e.col&&e.col<=n.col,Uh}function DD(){if(lD)return Rh;lD=1;var e=Rh&&Rh.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Rh,"__esModule",{value:!0}),Rh.alignString=void 0;const t=e(Hh()),n=hD(),r=(e,t)=>e+" ".repeat(t);return Rh.alignString=(e,o,i)=>{const s=(0,t.default)(e);if(s===o)return e;if(s>o)throw new Error("Subject parameter value width cannot be greater than the container width.");if(0===s)return" ".repeat(o);const a=o-s;return"left"===i?r(e,a):"right"===i?((e,t)=>" ".repeat(t)+e)(e,a):"justify"===i?((e,t)=>{const o=(0,n.countSpaceSequence)(e);if(0===o)return r(e,t);const i=(0,n.distributeUnevenly)(t,o);if(Math.max(...i)>3)return r(e,t);let s=0;return e.replace(/\s+/g,e=>e+" ".repeat(i[s++]))})(e,a):((e,t)=>" ".repeat(Math.floor(t/2))+e+" ".repeat(Math.ceil(t/2)))(e,a)},Rh}function gD(){if(pD)return Ph;pD=1,Object.defineProperty(Ph,"__esModule",{value:!0}),Ph.alignTableData=void 0;const e=DD();return Ph.alignTableData=(t,n)=>t.map((t,r)=>t.map((t,o)=>{var i;const{width:s,alignment:a}=n.columns[o];return(null===(i=n.spanningCellManager)||void 0===i?void 0:i.getContainingRange({col:o,row:r},{mapped:!0}))?t:(0,e.alignString)(t,s,a)})),Ph}var mD,yD={},bD={},vD={},ED={};function FD(){if(mD)return ED;mD=1;var e=ED&&ED.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ED,"__esModule",{value:!0}),ED.wrapString=void 0;const t=e(aD()),n=e(Hh());return ED.wrapString=(e,r)=>{let o=e;const i=[];do{i.push((0,t.default)(o,0,r)),o=(0,t.default)(o,r).trim()}while((0,n.default)(o));return i},ED}var CD,wD,_D,AD,SD={};function kD(){if(CD)return SD;CD=1;var e=SD&&SD.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(SD,"__esModule",{value:!0}),SD.wrapWord=void 0;const t=e(aD()),n=e(Oh());return SD.wrapWord=(e,r)=>{const o=[];let i=0;return((e,t)=>{let r=(0,n.default)(e);const o=[],i=new RegExp("(^.{1,"+String(Math.max(t,1))+"}(\\s+|$))|(^.{1,"+String(Math.max(t-1,1))+"}(\\\\|/|_|\\.|,|;|-))");do{let e;const n=i.exec(r);if(n){e=n[0],r=r.slice(e.length);const t=e.trim().length,i=e.length-t;o.push([t,i])}else e=r.slice(0,t),r=r.slice(t),o.push([e.length,0])}while(r.length);return o})(e,r).forEach(([n,r])=>{o.push((0,t.default)(e,i,i+n)),i+=n+r}),o},SD}function PD(){if(wD)return vD;wD=1,Object.defineProperty(vD,"__esModule",{value:!0}),vD.wrapCell=void 0;const e=hD(),t=FD(),n=kD();return vD.wrapCell=(r,o,i)=>{const s=(0,e.splitAnsi)(r);for(let e=0;e<s.length;){let r;r=i?(0,n.wrapWord)(s[e],o):(0,t.wrapString)(s[e],o),s.splice(e,1,...r),e+=r.length}return s},vD}function RD(){if(_D)return bD;_D=1,Object.defineProperty(bD,"__esModule",{value:!0}),bD.calculateCellHeight=void 0;const e=PD();return bD.calculateCellHeight=(t,n,r=!1)=>(0,e.wrapCell)(t,n,r).length,bD}function BD(){if(AD)return yD;AD=1,Object.defineProperty(yD,"__esModule",{value:!0}),yD.calculateRowHeights=void 0;const e=RD(),t=hD();return yD.calculateRowHeights=(n,r)=>{const o=[];for(const[i,s]of n.entries()){let a=1;s.forEach((s,u)=>{var c;const l=null===(c=r.spanningCellManager)||void 0===c?void 0:c.getContainingRange({col:u,row:i});if(!l){const t=(0,e.calculateCellHeight)(s,r.columns[u].width,r.columns[u].wrapWord);return void(a=Math.max(a,t))}const{topLeft:p,bottomRight:f,height:d}=l;if(i===f.row){const e=(0,t.sumArray)(o.slice(p.row)),i=f.row-p.row,s=(0,t.sequence)(p.row+1,f.row).filter(e=>{var t;return!(null===(t=r.drawHorizontalLine)||void 0===t?void 0:t.call(r,e,n.length))}).length,u=d-e-i+s;a=Math.max(a,u)}}),o.push(a)}return o},yD}var xD,OD,TD={},$D={};function LD(){if(xD)return $D;xD=1,Object.defineProperty($D,"__esModule",{value:!0}),$D.drawContent=void 0;return $D.drawContent=e=>{const{contents:t,separatorGetter:n,drawSeparator:r,spanningCellManager:o,rowIndex:i,elementType:s}=e,a=t.length,u=[];return r(0,a)&&u.push(n(0,a)),t.forEach((e,t)=>{if(s&&"border"!==s&&"row"!==s||u.push(e),"cell"===s&&void 0===i&&u.push(e),"cell"===s&&void 0!==i){const n=null==o?void 0:o.getContainingRange({col:t,row:i});n&&t!==n.topLeft.col||u.push(e)}if(t+1<a&&r(t+1,a)){const e=n(t+1,a);if("cell"===s&&void 0!==i){const n={col:t+1,row:i},r=null==o?void 0:o.getContainingRange(n);r&&r.topLeft.col!==n.col||u.push(e)}else u.push(e)}}),r(a,a)&&u.push(n(a,a)),u.join("")},$D}function ND(){return OD||(OD=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createTableBorderGetter=e.drawBorderBottom=e.drawBorderJoin=e.drawBorderTop=e.drawBorder=e.createSeparatorGetter=e.drawBorderSegments=void 0;const t=LD();e.drawBorderSegments=(e,t)=>{const{separator:n,horizontalBorderIndex:r,spanningCellManager:o}=t;return e.map((e,t)=>{const i=n.body.repeat(e);if(void 0===r)return i;const s=null==o?void 0:o.getContainingRange({col:t,row:r});if(!s)return i;const{topLeft:a}=s;return r===a.row?i:t!==a.col?"":s.extractBorderContent(r)})};e.createSeparatorGetter=e=>{const{separator:t,spanningCellManager:n,horizontalBorderIndex:r,rowCount:o}=e;return(e,i)=>{const s=null==n?void 0:n.inSameRange;if(void 0!==r&&s){const n={col:e,row:r-1},a={col:e-1,row:r},u={col:e-1,row:r-1},c={col:e,row:r},l=[[u,n],[n,c],[c,a],[a,u]];if(0===e)return s(c,n)&&t.bodyJoinOuter?t.bodyJoinOuter:t.left;if(e===i)return s(u,a)&&t.bodyJoinOuter?t.bodyJoinOuter:t.right;if(0===r)return s(c,a)?t.body:t.join;if(r===o)return s(n,u)?t.body:t.join;const p=l.map(e=>s(...e)).filter(Boolean).length;if(0===p)return t.join;if(4===p)return"";if(2===p)return s(...l[1])&&s(...l[3])&&t.bodyJoinInner?t.bodyJoinInner:t.body;if(1===p){if(!(t.joinRight&&t.joinLeft&&t.joinUp&&t.joinDown))throw new Error(`Can not get border separator for position [${r}, ${e}]`);return s(...l[0])?t.joinDown:s(...l[1])?t.joinLeft:s(...l[2])?t.joinUp:t.joinRight}throw new Error("Invalid case")}return 0===e?t.left:e===i?t.right:t.join}};e.drawBorder=(n,r)=>{const o=(0,e.drawBorderSegments)(n,r),{drawVerticalLine:i,horizontalBorderIndex:s,spanningCellManager:a}=r;return(0,t.drawContent)({contents:o,drawSeparator:i,elementType:"border",rowIndex:s,separatorGetter:(0,e.createSeparatorGetter)(r),spanningCellManager:a})+"\n"};e.drawBorderTop=(t,n)=>{const{border:r}=n,o=(0,e.drawBorder)(t,{...n,separator:{body:r.topBody,join:r.topJoin,left:r.topLeft,right:r.topRight}});return"\n"===o?"":o};e.drawBorderJoin=(t,n)=>{const{border:r}=n;return(0,e.drawBorder)(t,{...n,separator:{body:r.joinBody,bodyJoinInner:r.bodyJoin,bodyJoinOuter:r.bodyLeft,join:r.joinJoin,joinDown:r.joinMiddleDown,joinLeft:r.joinMiddleLeft,joinRight:r.joinMiddleRight,joinUp:r.joinMiddleUp,left:r.joinLeft,right:r.joinRight}})};e.drawBorderBottom=(t,n)=>{const{border:r}=n;return(0,e.drawBorder)(t,{...n,separator:{body:r.bottomBody,join:r.bottomJoin,left:r.bottomLeft,right:r.bottomRight}})};e.createTableBorderGetter=(t,n)=>(r,o)=>{const i={...n,horizontalBorderIndex:r};return 0===r?(0,e.drawBorderTop)(t,i):r===o?(0,e.drawBorderBottom)(t,i):(0,e.drawBorderJoin)(t,i)}}(TD)),TD}var MD,jD={};function ID(){if(MD)return jD;MD=1,Object.defineProperty(jD,"__esModule",{value:!0}),jD.drawRow=void 0;const e=LD();return jD.drawRow=(t,n)=>{const{border:r,drawVerticalLine:o,rowIndex:i,spanningCellManager:s}=n;return(0,e.drawContent)({contents:t,drawSeparator:o,elementType:"cell",rowIndex:i,separatorGetter:(e,t)=>0===e?r.bodyLeft:e===t?r.bodyRight:r.bodyJoin,spanningCellManager:s})+"\n"},jD}var HD,zD,KD,UD,qD,GD,WD={},ZD={},VD={},JD={};function YD(){if(KD)return JD;KD=1,Object.defineProperty(JD,"__esModule",{value:!0});const e=(zD||(zD=1,HD=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(o=r;0!==o--;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!==o--;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;0!==o--;){var s=i[o];if(!e(t[s],n[s]))return!1}return!0}return t!=t&&n!=n}),HD);return e.code='require("ajv/dist/runtime/equal").default',JD.default=e,JD}function QD(){return UD||(UD=1,function(e){e["config.json"]=function e(n,{instancePath:o="",parentData:s,parentDataProperty:u,rootData:c=n}={}){let l=null,p=0;if(n&&"object"==typeof n&&!Array.isArray(n)){for(const e in n)if("border"!==e&&"header"!==e&&"columns"!==e&&"columnDefault"!==e&&"drawVerticalLine"!==e&&"drawHorizontalLine"!==e&&"singleLine"!==e&&"spanningCells"!==e){const t={instancePath:o,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:e},message:"must NOT have additional properties"};null===l?l=[t]:l.push(t),p++}if(void 0!==n.border&&(i(n.border,{instancePath:o+"/border",parentData:n,parentDataProperty:"border",rootData:c})||(l=null===l?i.errors:l.concat(i.errors),p=l.length)),void 0!==n.header){let e=n.header;if(e&&"object"==typeof e&&!Array.isArray(e)){if(void 0===e.content){const e={instancePath:o+"/header",schemaPath:"#/properties/header/required",keyword:"required",params:{missingProperty:"content"},message:"must have required property 'content'"};null===l?l=[e]:l.push(e),p++}for(const t in e)if("content"!==t&&"alignment"!==t&&"wrapWord"!==t&&"truncate"!==t&&"paddingLeft"!==t&&"paddingRight"!==t){const e={instancePath:o+"/header",schemaPath:"#/properties/header/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:t},message:"must NOT have additional properties"};null===l?l=[e]:l.push(e),p++}if(void 0!==e.content&&"string"!=typeof e.content){const e={instancePath:o+"/header/content",schemaPath:"#/properties/header/properties/content/type",keyword:"type",params:{type:"string"},message:"must be string"};null===l?l=[e]:l.push(e),p++}if(void 0!==e.alignment&&(a(e.alignment,{instancePath:o+"/header/alignment",parentData:e,parentDataProperty:"alignment",rootData:c})||(l=null===l?a.errors:l.concat(a.errors),p=l.length)),void 0!==e.wrapWord&&"boolean"!=typeof e.wrapWord){const e={instancePath:o+"/header/wrapWord",schemaPath:"#/properties/header/properties/wrapWord/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};null===l?l=[e]:l.push(e),p++}if(void 0!==e.truncate){let t=e.truncate;if("number"!=typeof t||t%1||isNaN(t)||!isFinite(t)){const e={instancePath:o+"/header/truncate",schemaPath:"#/properties/header/properties/truncate/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===l?l=[e]:l.push(e),p++}}if(void 0!==e.paddingLeft){let t=e.paddingLeft;if("number"!=typeof t||t%1||isNaN(t)||!isFinite(t)){const e={instancePath:o+"/header/paddingLeft",schemaPath:"#/properties/header/properties/paddingLeft/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===l?l=[e]:l.push(e),p++}}if(void 0!==e.paddingRight){let t=e.paddingRight;if("number"!=typeof t||t%1||isNaN(t)||!isFinite(t)){const e={instancePath:o+"/header/paddingRight",schemaPath:"#/properties/header/properties/paddingRight/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===l?l=[e]:l.push(e),p++}}}else{const e={instancePath:o+"/header",schemaPath:"#/properties/header/type",keyword:"type",params:{type:"object"},message:"must be object"};null===l?l=[e]:l.push(e),p++}}if(void 0!==n.columns&&(d(n.columns,{instancePath:o+"/columns",parentData:n,parentDataProperty:"columns",rootData:c})||(l=null===l?d.errors:l.concat(d.errors),p=l.length)),void 0!==n.columnDefault&&(h(n.columnDefault,{instancePath:o+"/columnDefault",parentData:n,parentDataProperty:"columnDefault",rootData:c})||(l=null===l?h.errors:l.concat(h.errors),p=l.length)),void 0!==n.drawVerticalLine&&"function"!=typeof n.drawVerticalLine){const e={instancePath:o+"/drawVerticalLine",schemaPath:"#/properties/drawVerticalLine/typeof",keyword:"typeof",params:{},message:'must pass "typeof" keyword validation'};null===l?l=[e]:l.push(e),p++}if(void 0!==n.drawHorizontalLine&&"function"!=typeof n.drawHorizontalLine){const e={instancePath:o+"/drawHorizontalLine",schemaPath:"#/properties/drawHorizontalLine/typeof",keyword:"typeof",params:{},message:'must pass "typeof" keyword validation'};null===l?l=[e]:l.push(e),p++}if(void 0!==n.singleLine&&"boolean"!=typeof n.singleLine){const e={instancePath:o+"/singleLine",schemaPath:"#/properties/singleLine/typeof",keyword:"typeof",params:{},message:'must pass "typeof" keyword validation'};null===l?l=[e]:l.push(e),p++}if(void 0!==n.spanningCells){let e=n.spanningCells;if(Array.isArray(e)){const n=e.length;for(let i=0;i<n;i++){let n=e[i];if(n&&"object"==typeof n&&!Array.isArray(n)){if(void 0===n.row){const e={instancePath:o+"/spanningCells/"+i,schemaPath:"#/properties/spanningCells/items/required",keyword:"required",params:{missingProperty:"row"},message:"must have required property 'row'"};null===l?l=[e]:l.push(e),p++}if(void 0===n.col){const e={instancePath:o+"/spanningCells/"+i,schemaPath:"#/properties/spanningCells/items/required",keyword:"required",params:{missingProperty:"col"},message:"must have required property 'col'"};null===l?l=[e]:l.push(e),p++}for(const e in n)if(!r.call(t.properties.spanningCells.items.properties,e)){const t={instancePath:o+"/spanningCells/"+i,schemaPath:"#/properties/spanningCells/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:e},message:"must NOT have additional properties"};null===l?l=[t]:l.push(t),p++}if(void 0!==n.col){let e=n.col;if("number"!=typeof e||e%1||isNaN(e)||!isFinite(e)){const e={instancePath:o+"/spanningCells/"+i+"/col",schemaPath:"#/properties/spanningCells/items/properties/col/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===l?l=[e]:l.push(e),p++}if("number"==typeof e&&isFinite(e)&&(e<0||isNaN(e))){const e={instancePath:o+"/spanningCells/"+i+"/col",schemaPath:"#/properties/spanningCells/items/properties/col/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};null===l?l=[e]:l.push(e),p++}}if(void 0!==n.row){let e=n.row;if("number"!=typeof e||e%1||isNaN(e)||!isFinite(e)){const e={instancePath:o+"/spanningCells/"+i+"/row",schemaPath:"#/properties/spanningCells/items/properties/row/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===l?l=[e]:l.push(e),p++}if("number"==typeof e&&isFinite(e)&&(e<0||isNaN(e))){const e={instancePath:o+"/spanningCells/"+i+"/row",schemaPath:"#/properties/spanningCells/items/properties/row/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};null===l?l=[e]:l.push(e),p++}}if(void 0!==n.colSpan){let e=n.colSpan;if("number"!=typeof e||e%1||isNaN(e)||!isFinite(e)){const e={instancePath:o+"/spanningCells/"+i+"/colSpan",schemaPath:"#/properties/spanningCells/items/properties/colSpan/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===l?l=[e]:l.push(e),p++}if("number"==typeof e&&isFinite(e)&&(e<1||isNaN(e))){const e={instancePath:o+"/spanningCells/"+i+"/colSpan",schemaPath:"#/properties/spanningCells/items/properties/colSpan/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};null===l?l=[e]:l.push(e),p++}}if(void 0!==n.rowSpan){let e=n.rowSpan;if("number"!=typeof e||e%1||isNaN(e)||!isFinite(e)){const e={instancePath:o+"/spanningCells/"+i+"/rowSpan",schemaPath:"#/properties/spanningCells/items/properties/rowSpan/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===l?l=[e]:l.push(e),p++}if("number"==typeof e&&isFinite(e)&&(e<1||isNaN(e))){const e={instancePath:o+"/spanningCells/"+i+"/rowSpan",schemaPath:"#/properties/spanningCells/items/properties/rowSpan/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};null===l?l=[e]:l.push(e),p++}}if(void 0!==n.alignment&&(a(n.alignment,{instancePath:o+"/spanningCells/"+i+"/alignment",parentData:n,parentDataProperty:"alignment",rootData:c})||(l=null===l?a.errors:l.concat(a.errors),p=l.length)),void 0!==n.verticalAlignment&&(D(n.verticalAlignment,{instancePath:o+"/spanningCells/"+i+"/verticalAlignment",parentData:n,parentDataProperty:"verticalAlignment",rootData:c})||(l=null===l?D.errors:l.concat(D.errors),p=l.length)),void 0!==n.wrapWord&&"boolean"!=typeof n.wrapWord){const e={instancePath:o+"/spanningCells/"+i+"/wrapWord",schemaPath:"#/properties/spanningCells/items/properties/wrapWord/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};null===l?l=[e]:l.push(e),p++}if(void 0!==n.truncate){let e=n.truncate;if("number"!=typeof e||e%1||isNaN(e)||!isFinite(e)){const e={instancePath:o+"/spanningCells/"+i+"/truncate",schemaPath:"#/properties/spanningCells/items/properties/truncate/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===l?l=[e]:l.push(e),p++}}if(void 0!==n.paddingLeft){let e=n.paddingLeft;if("number"!=typeof e||e%1||isNaN(e)||!isFinite(e)){const e={instancePath:o+"/spanningCells/"+i+"/paddingLeft",schemaPath:"#/properties/spanningCells/items/properties/paddingLeft/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===l?l=[e]:l.push(e),p++}}if(void 0!==n.paddingRight){let e=n.paddingRight;if("number"!=typeof e||e%1||isNaN(e)||!isFinite(e)){const e={instancePath:o+"/spanningCells/"+i+"/paddingRight",schemaPath:"#/properties/spanningCells/items/properties/paddingRight/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===l?l=[e]:l.push(e),p++}}}else{const e={instancePath:o+"/spanningCells/"+i,schemaPath:"#/properties/spanningCells/items/type",keyword:"type",params:{type:"object"},message:"must be object"};null===l?l=[e]:l.push(e),p++}}}else{const e={instancePath:o+"/spanningCells",schemaPath:"#/properties/spanningCells/type",keyword:"type",params:{type:"array"},message:"must be array"};null===l?l=[e]:l.push(e),p++}}}else{const e={instancePath:o,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};null===l?l=[e]:l.push(e),p++}return e.errors=l,0===p};const t={properties:{spanningCells:{items:{properties:{col:{type:"integer",minimum:0},row:{type:"integer",minimum:0},colSpan:{type:"integer",minimum:1},rowSpan:{type:"integer",minimum:1},alignment:{$ref:"shared.json#/definitions/alignment"},verticalAlignment:{$ref:"shared.json#/definitions/verticalAlignment"},wrapWord:{type:"boolean"},truncate:{type:"integer"},paddingLeft:{type:"integer"},paddingRight:{type:"integer"}}}}}},n={properties:{topBody:{$ref:"#/definitions/border"},topJoin:{$ref:"#/definitions/border"},topLeft:{$ref:"#/definitions/border"},topRight:{$ref:"#/definitions/border"},bottomBody:{$ref:"#/definitions/border"},bottomJoin:{$ref:"#/definitions/border"},bottomLeft:{$ref:"#/definitions/border"},bottomRight:{$ref:"#/definitions/border"},bodyLeft:{$ref:"#/definitions/border"},bodyRight:{$ref:"#/definitions/border"},bodyJoin:{$ref:"#/definitions/border"},headerJoin:{$ref:"#/definitions/border"},joinBody:{$ref:"#/definitions/border"},joinLeft:{$ref:"#/definitions/border"},joinRight:{$ref:"#/definitions/border"},joinJoin:{$ref:"#/definitions/border"},joinMiddleUp:{$ref:"#/definitions/border"},joinMiddleDown:{$ref:"#/definitions/border"},joinMiddleLeft:{$ref:"#/definitions/border"},joinMiddleRight:{$ref:"#/definitions/border"}}},r=Object.prototype.hasOwnProperty;function o(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:i=e}={}){let s=null,a=0;if("string"!=typeof e){const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"string"},message:"must be string"};null===s?s=[e]:s.push(e),a++}return o.errors=s,0===a}function i(e,{instancePath:t="",parentData:s,parentDataProperty:a,rootData:u=e}={}){let c=null,l=0;if(e&&"object"==typeof e&&!Array.isArray(e)){for(const o in e)if(!r.call(n.properties,o)){const e={instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:o},message:"must NOT have additional properties"};null===c?c=[e]:c.push(e),l++}void 0!==e.topBody&&(o(e.topBody,{instancePath:t+"/topBody",parentData:e,parentDataProperty:"topBody",rootData:u})||(c=null===c?o.errors:c.concat(o.errors),l=c.length)),void 0!==e.topJoin&&(o(e.topJoin,{instancePath:t+"/topJoin",parentData:e,parentDataProperty:"topJoin",rootData:u})||(c=null===c?o.errors:c.concat(o.errors),l=c.length)),void 0!==e.topLeft&&(o(e.topLeft,{instancePath:t+"/topLeft",parentData:e,parentDataProperty:"topLeft",rootData:u})||(c=null===c?o.errors:c.concat(o.errors),l=c.length)),void 0!==e.topRight&&(o(e.topRight,{instancePath:t+"/topRight",parentData:e,parentDataProperty:"topRight",rootData:u})||(c=null===c?o.errors:c.concat(o.errors),l=c.length)),void 0!==e.bottomBody&&(o(e.bottomBody,{instancePath:t+"/bottomBody",parentData:e,parentDataProperty:"bottomBody",rootData:u})||(c=null===c?o.errors:c.concat(o.errors),l=c.length)),void 0!==e.bottomJoin&&(o(e.bottomJoin,{instancePath:t+"/bottomJoin",parentData:e,parentDataProperty:"bottomJoin",rootData:u})||(c=null===c?o.errors:c.concat(o.errors),l=c.length)),void 0!==e.bottomLeft&&(o(e.bottomLeft,{instancePath:t+"/bottomLeft",parentData:e,parentDataProperty:"bottomLeft",rootData:u})||(c=null===c?o.errors:c.concat(o.errors),l=c.length)),void 0!==e.bottomRight&&(o(e.bottomRight,{instancePath:t+"/bottomRight",parentData:e,parentDataProperty:"bottomRight",rootData:u})||(c=null===c?o.errors:c.concat(o.errors),l=c.length)),void 0!==e.bodyLeft&&(o(e.bodyLeft,{instancePath:t+"/bodyLeft",parentData:e,parentDataProperty:"bodyLeft",rootData:u})||(c=null===c?o.errors:c.concat(o.errors),l=c.length)),void 0!==e.bodyRight&&(o(e.bodyRight,{instancePath:t+"/bodyRight",parentData:e,parentDataProperty:"bodyRight",rootData:u})||(c=null===c?o.errors:c.concat(o.errors),l=c.length)),void 0!==e.bodyJoin&&(o(e.bodyJoin,{instancePath:t+"/bodyJoin",parentData:e,parentDataProperty:"bodyJoin",rootData:u})||(c=null===c?o.errors:c.concat(o.errors),l=c.length)),void 0!==e.headerJoin&&(o(e.headerJoin,{instancePath:t+"/headerJoin",parentData:e,parentDataProperty:"headerJoin",rootData:u})||(c=null===c?o.errors:c.concat(o.errors),l=c.length)),void 0!==e.joinBody&&(o(e.joinBody,{instancePath:t+"/joinBody",parentData:e,parentDataProperty:"joinBody",rootData:u})||(c=null===c?o.errors:c.concat(o.errors),l=c.length)),void 0!==e.joinLeft&&(o(e.joinLeft,{instancePath:t+"/joinLeft",parentData:e,parentDataProperty:"joinLeft",rootData:u})||(c=null===c?o.errors:c.concat(o.errors),l=c.length)),void 0!==e.joinRight&&(o(e.joinRight,{instancePath:t+"/joinRight",parentData:e,parentDataProperty:"joinRight",rootData:u})||(c=null===c?o.errors:c.concat(o.errors),l=c.length)),void 0!==e.joinJoin&&(o(e.joinJoin,{instancePath:t+"/joinJoin",parentData:e,parentDataProperty:"joinJoin",rootData:u})||(c=null===c?o.errors:c.concat(o.errors),l=c.length)),void 0!==e.joinMiddleUp&&(o(e.joinMiddleUp,{instancePath:t+"/joinMiddleUp",parentData:e,parentDataProperty:"joinMiddleUp",rootData:u})||(c=null===c?o.errors:c.concat(o.errors),l=c.length)),void 0!==e.joinMiddleDown&&(o(e.joinMiddleDown,{instancePath:t+"/joinMiddleDown",parentData:e,parentDataProperty:"joinMiddleDown",rootData:u})||(c=null===c?o.errors:c.concat(o.errors),l=c.length)),void 0!==e.joinMiddleLeft&&(o(e.joinMiddleLeft,{instancePath:t+"/joinMiddleLeft",parentData:e,parentDataProperty:"joinMiddleLeft",rootData:u})||(c=null===c?o.errors:c.concat(o.errors),l=c.length)),void 0!==e.joinMiddleRight&&(o(e.joinMiddleRight,{instancePath:t+"/joinMiddleRight",parentData:e,parentDataProperty:"joinMiddleRight",rootData:u})||(c=null===c?o.errors:c.concat(o.errors),l=c.length))}else{const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};null===c?c=[e]:c.push(e),l++}return i.errors=c,0===l}const s={enum:["left","right","center","justify"]};function a(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:o=e}={}){let i=null,u=0;if("string"!=typeof e){const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"string"},message:"must be string"};null===i?i=[e]:i.push(e),u++}if("left"!==e&&"right"!==e&&"center"!==e&&"justify"!==e){const e={instancePath:t,schemaPath:"#/enum",keyword:"enum",params:{allowedValues:s.enum},message:"must be equal to one of the allowed values"};null===i?i=[e]:i.push(e),u++}return a.errors=i,0===u}YD().default;const u=new RegExp("^[0-9]+$","u");function c(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:o=e}={}){let i=null,a=0;if("string"!=typeof e){const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"string"},message:"must be string"};null===i?i=[e]:i.push(e),a++}if("left"!==e&&"right"!==e&&"center"!==e&&"justify"!==e){const e={instancePath:t,schemaPath:"#/enum",keyword:"enum",params:{allowedValues:s.enum},message:"must be equal to one of the allowed values"};null===i?i=[e]:i.push(e),a++}return c.errors=i,0===a}const l={enum:["top","middle","bottom"]};function p(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:o=e}={}){let i=null,s=0;if("string"!=typeof e){const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"string"},message:"must be string"};null===i?i=[e]:i.push(e),s++}if("top"!==e&&"middle"!==e&&"bottom"!==e){const e={instancePath:t,schemaPath:"#/enum",keyword:"enum",params:{allowedValues:l.enum},message:"must be equal to one of the allowed values"};null===i?i=[e]:i.push(e),s++}return p.errors=i,0===s}function f(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:o=e}={}){let i=null,s=0;if(e&&"object"==typeof e&&!Array.isArray(e)){for(const n in e)if("alignment"!==n&&"verticalAlignment"!==n&&"width"!==n&&"wrapWord"!==n&&"truncate"!==n&&"paddingLeft"!==n&&"paddingRight"!==n){const e={instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"};null===i?i=[e]:i.push(e),s++}if(void 0!==e.alignment&&(c(e.alignment,{instancePath:t+"/alignment",parentData:e,parentDataProperty:"alignment",rootData:o})||(i=null===i?c.errors:i.concat(c.errors),s=i.length)),void 0!==e.verticalAlignment&&(p(e.verticalAlignment,{instancePath:t+"/verticalAlignment",parentData:e,parentDataProperty:"verticalAlignment",rootData:o})||(i=null===i?p.errors:i.concat(p.errors),s=i.length)),void 0!==e.width){let n=e.width;if("number"!=typeof n||n%1||isNaN(n)||!isFinite(n)){const e={instancePath:t+"/width",schemaPath:"#/properties/width/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===i?i=[e]:i.push(e),s++}if("number"==typeof n&&isFinite(n)&&(n<1||isNaN(n))){const e={instancePath:t+"/width",schemaPath:"#/properties/width/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};null===i?i=[e]:i.push(e),s++}}if(void 0!==e.wrapWord&&"boolean"!=typeof e.wrapWord){const e={instancePath:t+"/wrapWord",schemaPath:"#/properties/wrapWord/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};null===i?i=[e]:i.push(e),s++}if(void 0!==e.truncate){let n=e.truncate;if("number"!=typeof n||n%1||isNaN(n)||!isFinite(n)){const e={instancePath:t+"/truncate",schemaPath:"#/properties/truncate/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===i?i=[e]:i.push(e),s++}}if(void 0!==e.paddingLeft){let n=e.paddingLeft;if("number"!=typeof n||n%1||isNaN(n)||!isFinite(n)){const e={instancePath:t+"/paddingLeft",schemaPath:"#/properties/paddingLeft/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===i?i=[e]:i.push(e),s++}}if(void 0!==e.paddingRight){let n=e.paddingRight;if("number"!=typeof n||n%1||isNaN(n)||!isFinite(n)){const e={instancePath:t+"/paddingRight",schemaPath:"#/properties/paddingRight/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===i?i=[e]:i.push(e),s++}}}else{const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};null===i?i=[e]:i.push(e),s++}return f.errors=i,0===s}function d(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:o=e}={}){let i=null,s=0;const a=s;let c=!1,l=null;const p=s;if(e&&"object"==typeof e&&!Array.isArray(e)){for(const n in e)if(!u.test(n)){const e={instancePath:t,schemaPath:"#/oneOf/0/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"};null===i?i=[e]:i.push(e),s++}for(const n in e)u.test(n)&&(f(e[n],{instancePath:t+"/"+n.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:e,parentDataProperty:n,rootData:o})||(i=null===i?f.errors:i.concat(f.errors),s=i.length))}else{const e={instancePath:t,schemaPath:"#/oneOf/0/type",keyword:"type",params:{type:"object"},message:"must be object"};null===i?i=[e]:i.push(e),s++}(D=p===s)&&(c=!0,l=0);const h=s;if(Array.isArray(e)){const n=e.length;for(let r=0;r<n;r++)f(e[r],{instancePath:t+"/"+r,parentData:e,parentDataProperty:r,rootData:o})||(i=null===i?f.errors:i.concat(f.errors),s=i.length)}else{const e={instancePath:t,schemaPath:"#/oneOf/1/type",keyword:"type",params:{type:"array"},message:"must be array"};null===i?i=[e]:i.push(e),s++}var D;if((D=h===s)&&c?(c=!1,l=[l,1]):D&&(c=!0,l=1),c)s=a,null!==i&&(a?i.length=a:i=null);else{const e={instancePath:t,schemaPath:"#/oneOf",keyword:"oneOf",params:{passingSchemas:l},message:"must match exactly one schema in oneOf"};null===i?i=[e]:i.push(e),s++}return d.errors=i,0===s}function h(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:o=e}={}){let i=null,s=0;if(e&&"object"==typeof e&&!Array.isArray(e)){for(const n in e)if("alignment"!==n&&"verticalAlignment"!==n&&"width"!==n&&"wrapWord"!==n&&"truncate"!==n&&"paddingLeft"!==n&&"paddingRight"!==n){const e={instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"};null===i?i=[e]:i.push(e),s++}if(void 0!==e.alignment&&(c(e.alignment,{instancePath:t+"/alignment",parentData:e,parentDataProperty:"alignment",rootData:o})||(i=null===i?c.errors:i.concat(c.errors),s=i.length)),void 0!==e.verticalAlignment&&(p(e.verticalAlignment,{instancePath:t+"/verticalAlignment",parentData:e,parentDataProperty:"verticalAlignment",rootData:o})||(i=null===i?p.errors:i.concat(p.errors),s=i.length)),void 0!==e.width){let n=e.width;if("number"!=typeof n||n%1||isNaN(n)||!isFinite(n)){const e={instancePath:t+"/width",schemaPath:"#/properties/width/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===i?i=[e]:i.push(e),s++}if("number"==typeof n&&isFinite(n)&&(n<1||isNaN(n))){const e={instancePath:t+"/width",schemaPath:"#/properties/width/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};null===i?i=[e]:i.push(e),s++}}if(void 0!==e.wrapWord&&"boolean"!=typeof e.wrapWord){const e={instancePath:t+"/wrapWord",schemaPath:"#/properties/wrapWord/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};null===i?i=[e]:i.push(e),s++}if(void 0!==e.truncate){let n=e.truncate;if("number"!=typeof n||n%1||isNaN(n)||!isFinite(n)){const e={instancePath:t+"/truncate",schemaPath:"#/properties/truncate/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===i?i=[e]:i.push(e),s++}}if(void 0!==e.paddingLeft){let n=e.paddingLeft;if("number"!=typeof n||n%1||isNaN(n)||!isFinite(n)){const e={instancePath:t+"/paddingLeft",schemaPath:"#/properties/paddingLeft/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===i?i=[e]:i.push(e),s++}}if(void 0!==e.paddingRight){let n=e.paddingRight;if("number"!=typeof n||n%1||isNaN(n)||!isFinite(n)){const e={instancePath:t+"/paddingRight",schemaPath:"#/properties/paddingRight/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===i?i=[e]:i.push(e),s++}}}else{const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};null===i?i=[e]:i.push(e),s++}return h.errors=i,0===s}function D(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:o=e}={}){let i=null,s=0;if("string"!=typeof e){const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"string"},message:"must be string"};null===i?i=[e]:i.push(e),s++}if("top"!==e&&"middle"!==e&&"bottom"!==e){const e={instancePath:t,schemaPath:"#/enum",keyword:"enum",params:{allowedValues:l.enum},message:"must be equal to one of the allowed values"};null===i?i=[e]:i.push(e),s++}return D.errors=i,0===s}function g(e,{instancePath:t="",parentData:i,parentDataProperty:s,rootData:a=e}={}){let u=null,c=0;if(e&&"object"==typeof e&&!Array.isArray(e)){for(const o in e)if(!r.call(n.properties,o)){const e={instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:o},message:"must NOT have additional properties"};null===u?u=[e]:u.push(e),c++}void 0!==e.topBody&&(o(e.topBody,{instancePath:t+"/topBody",parentData:e,parentDataProperty:"topBody",rootData:a})||(u=null===u?o.errors:u.concat(o.errors),c=u.length)),void 0!==e.topJoin&&(o(e.topJoin,{instancePath:t+"/topJoin",parentData:e,parentDataProperty:"topJoin",rootData:a})||(u=null===u?o.errors:u.concat(o.errors),c=u.length)),void 0!==e.topLeft&&(o(e.topLeft,{instancePath:t+"/topLeft",parentData:e,parentDataProperty:"topLeft",rootData:a})||(u=null===u?o.errors:u.concat(o.errors),c=u.length)),void 0!==e.topRight&&(o(e.topRight,{instancePath:t+"/topRight",parentData:e,parentDataProperty:"topRight",rootData:a})||(u=null===u?o.errors:u.concat(o.errors),c=u.length)),void 0!==e.bottomBody&&(o(e.bottomBody,{instancePath:t+"/bottomBody",parentData:e,parentDataProperty:"bottomBody",rootData:a})||(u=null===u?o.errors:u.concat(o.errors),c=u.length)),void 0!==e.bottomJoin&&(o(e.bottomJoin,{instancePath:t+"/bottomJoin",parentData:e,parentDataProperty:"bottomJoin",rootData:a})||(u=null===u?o.errors:u.concat(o.errors),c=u.length)),void 0!==e.bottomLeft&&(o(e.bottomLeft,{instancePath:t+"/bottomLeft",parentData:e,parentDataProperty:"bottomLeft",rootData:a})||(u=null===u?o.errors:u.concat(o.errors),c=u.length)),void 0!==e.bottomRight&&(o(e.bottomRight,{instancePath:t+"/bottomRight",parentData:e,parentDataProperty:"bottomRight",rootData:a})||(u=null===u?o.errors:u.concat(o.errors),c=u.length)),void 0!==e.bodyLeft&&(o(e.bodyLeft,{instancePath:t+"/bodyLeft",parentData:e,parentDataProperty:"bodyLeft",rootData:a})||(u=null===u?o.errors:u.concat(o.errors),c=u.length)),void 0!==e.bodyRight&&(o(e.bodyRight,{instancePath:t+"/bodyRight",parentData:e,parentDataProperty:"bodyRight",rootData:a})||(u=null===u?o.errors:u.concat(o.errors),c=u.length)),void 0!==e.bodyJoin&&(o(e.bodyJoin,{instancePath:t+"/bodyJoin",parentData:e,parentDataProperty:"bodyJoin",rootData:a})||(u=null===u?o.errors:u.concat(o.errors),c=u.length)),void 0!==e.headerJoin&&(o(e.headerJoin,{instancePath:t+"/headerJoin",parentData:e,parentDataProperty:"headerJoin",rootData:a})||(u=null===u?o.errors:u.concat(o.errors),c=u.length)),void 0!==e.joinBody&&(o(e.joinBody,{instancePath:t+"/joinBody",parentData:e,parentDataProperty:"joinBody",rootData:a})||(u=null===u?o.errors:u.concat(o.errors),c=u.length)),void 0!==e.joinLeft&&(o(e.joinLeft,{instancePath:t+"/joinLeft",parentData:e,parentDataProperty:"joinLeft",rootData:a})||(u=null===u?o.errors:u.concat(o.errors),c=u.length)),void 0!==e.joinRight&&(o(e.joinRight,{instancePath:t+"/joinRight",parentData:e,parentDataProperty:"joinRight",rootData:a})||(u=null===u?o.errors:u.concat(o.errors),c=u.length)),void 0!==e.joinJoin&&(o(e.joinJoin,{instancePath:t+"/joinJoin",parentData:e,parentDataProperty:"joinJoin",rootData:a})||(u=null===u?o.errors:u.concat(o.errors),c=u.length)),void 0!==e.joinMiddleUp&&(o(e.joinMiddleUp,{instancePath:t+"/joinMiddleUp",parentData:e,parentDataProperty:"joinMiddleUp",rootData:a})||(u=null===u?o.errors:u.concat(o.errors),c=u.length)),void 0!==e.joinMiddleDown&&(o(e.joinMiddleDown,{instancePath:t+"/joinMiddleDown",parentData:e,parentDataProperty:"joinMiddleDown",rootData:a})||(u=null===u?o.errors:u.concat(o.errors),c=u.length)),void 0!==e.joinMiddleLeft&&(o(e.joinMiddleLeft,{instancePath:t+"/joinMiddleLeft",parentData:e,parentDataProperty:"joinMiddleLeft",rootData:a})||(u=null===u?o.errors:u.concat(o.errors),c=u.length)),void 0!==e.joinMiddleRight&&(o(e.joinMiddleRight,{instancePath:t+"/joinMiddleRight",parentData:e,parentDataProperty:"joinMiddleRight",rootData:a})||(u=null===u?o.errors:u.concat(o.errors),c=u.length))}else{const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};null===u?u=[e]:u.push(e),c++}return g.errors=u,0===c}function m(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:o=e}={}){let i=null,s=0;const a=s;let c=!1,l=null;const p=s;if(e&&"object"==typeof e&&!Array.isArray(e)){for(const n in e)if(!u.test(n)){const e={instancePath:t,schemaPath:"#/oneOf/0/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"};null===i?i=[e]:i.push(e),s++}for(const n in e)u.test(n)&&(f(e[n],{instancePath:t+"/"+n.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:e,parentDataProperty:n,rootData:o})||(i=null===i?f.errors:i.concat(f.errors),s=i.length))}else{const e={instancePath:t,schemaPath:"#/oneOf/0/type",keyword:"type",params:{type:"object"},message:"must be object"};null===i?i=[e]:i.push(e),s++}(h=p===s)&&(c=!0,l=0);const d=s;if(Array.isArray(e)){const n=e.length;for(let r=0;r<n;r++)f(e[r],{instancePath:t+"/"+r,parentData:e,parentDataProperty:r,rootData:o})||(i=null===i?f.errors:i.concat(f.errors),s=i.length)}else{const e={instancePath:t,schemaPath:"#/oneOf/1/type",keyword:"type",params:{type:"array"},message:"must be array"};null===i?i=[e]:i.push(e),s++}var h;if((h=d===s)&&c?(c=!1,l=[l,1]):h&&(c=!0,l=1),c)s=a,null!==i&&(a?i.length=a:i=null);else{const e={instancePath:t,schemaPath:"#/oneOf",keyword:"oneOf",params:{passingSchemas:l},message:"must match exactly one schema in oneOf"};null===i?i=[e]:i.push(e),s++}return m.errors=i,0===s}function y(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:o=e}={}){let i=null,s=0;if(e&&"object"==typeof e&&!Array.isArray(e)){for(const n in e)if("alignment"!==n&&"verticalAlignment"!==n&&"width"!==n&&"wrapWord"!==n&&"truncate"!==n&&"paddingLeft"!==n&&"paddingRight"!==n){const e={instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"};null===i?i=[e]:i.push(e),s++}if(void 0!==e.alignment&&(c(e.alignment,{instancePath:t+"/alignment",parentData:e,parentDataProperty:"alignment",rootData:o})||(i=null===i?c.errors:i.concat(c.errors),s=i.length)),void 0!==e.verticalAlignment&&(p(e.verticalAlignment,{instancePath:t+"/verticalAlignment",parentData:e,parentDataProperty:"verticalAlignment",rootData:o})||(i=null===i?p.errors:i.concat(p.errors),s=i.length)),void 0!==e.width){let n=e.width;if("number"!=typeof n||n%1||isNaN(n)||!isFinite(n)){const e={instancePath:t+"/width",schemaPath:"#/properties/width/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===i?i=[e]:i.push(e),s++}if("number"==typeof n&&isFinite(n)&&(n<1||isNaN(n))){const e={instancePath:t+"/width",schemaPath:"#/properties/width/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};null===i?i=[e]:i.push(e),s++}}if(void 0!==e.wrapWord&&"boolean"!=typeof e.wrapWord){const e={instancePath:t+"/wrapWord",schemaPath:"#/properties/wrapWord/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};null===i?i=[e]:i.push(e),s++}if(void 0!==e.truncate){let n=e.truncate;if("number"!=typeof n||n%1||isNaN(n)||!isFinite(n)){const e={instancePath:t+"/truncate",schemaPath:"#/properties/truncate/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===i?i=[e]:i.push(e),s++}}if(void 0!==e.paddingLeft){let n=e.paddingLeft;if("number"!=typeof n||n%1||isNaN(n)||!isFinite(n)){const e={instancePath:t+"/paddingLeft",schemaPath:"#/properties/paddingLeft/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===i?i=[e]:i.push(e),s++}}if(void 0!==e.paddingRight){let n=e.paddingRight;if("number"!=typeof n||n%1||isNaN(n)||!isFinite(n)){const e={instancePath:t+"/paddingRight",schemaPath:"#/properties/paddingRight/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===i?i=[e]:i.push(e),s++}}}else{const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};null===i?i=[e]:i.push(e),s++}return y.errors=i,0===s}e["streamConfig.json"]=function e(t,{instancePath:n="",parentData:r,parentDataProperty:o,rootData:i=t}={}){let s=null,a=0;if(t&&"object"==typeof t&&!Array.isArray(t)){if(void 0===t.columnDefault){const e={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"columnDefault"},message:"must have required property 'columnDefault'"};null===s?s=[e]:s.push(e),a++}if(void 0===t.columnCount){const e={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"columnCount"},message:"must have required property 'columnCount'"};null===s?s=[e]:s.push(e),a++}for(const e in t)if("border"!==e&&"columns"!==e&&"columnDefault"!==e&&"columnCount"!==e&&"drawVerticalLine"!==e){const t={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:e},message:"must NOT have additional properties"};null===s?s=[t]:s.push(t),a++}if(void 0!==t.border&&(g(t.border,{instancePath:n+"/border",parentData:t,parentDataProperty:"border",rootData:i})||(s=null===s?g.errors:s.concat(g.errors),a=s.length)),void 0!==t.columns&&(m(t.columns,{instancePath:n+"/columns",parentData:t,parentDataProperty:"columns",rootData:i})||(s=null===s?m.errors:s.concat(m.errors),a=s.length)),void 0!==t.columnDefault&&(y(t.columnDefault,{instancePath:n+"/columnDefault",parentData:t,parentDataProperty:"columnDefault",rootData:i})||(s=null===s?y.errors:s.concat(y.errors),a=s.length)),void 0!==t.columnCount){let e=t.columnCount;if("number"!=typeof e||e%1||isNaN(e)||!isFinite(e)){const e={instancePath:n+"/columnCount",schemaPath:"#/properties/columnCount/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===s?s=[e]:s.push(e),a++}if("number"==typeof e&&isFinite(e)&&(e<1||isNaN(e))){const e={instancePath:n+"/columnCount",schemaPath:"#/properties/columnCount/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};null===s?s=[e]:s.push(e),a++}}if(void 0!==t.drawVerticalLine&&"function"!=typeof t.drawVerticalLine){const e={instancePath:n+"/drawVerticalLine",schemaPath:"#/properties/drawVerticalLine/typeof",keyword:"typeof",params:{},message:'must pass "typeof" keyword validation'};null===s?s=[e]:s.push(e),a++}}else{const e={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};null===s?s=[e]:s.push(e),a++}return e.errors=s,0===a}}(VD)),VD}function XD(){if(qD)return ZD;qD=1;var e=ZD&&ZD.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ZD,"__esModule",{value:!0}),ZD.validateConfig=void 0;const t=e(QD());return ZD.validateConfig=(e,n)=>{const r=t.default[e];if(!r(n)&&r.errors){const e=r.errors.map(e=>({message:e.message,params:e.params,schemaPath:e.schemaPath}));throw console.log("config",n),console.log("errors",e),new Error("Invalid config.")}},ZD}function eg(){if(GD)return WD;GD=1,Object.defineProperty(WD,"__esModule",{value:!0}),WD.makeStreamConfig=void 0;const e=hD(),t=XD(),n=(e,t={},n)=>Array.from({length:e}).map((e,r)=>({alignment:"left",paddingLeft:1,paddingRight:1,truncate:Number.POSITIVE_INFINITY,verticalAlignment:"top",wrapWord:!1,...n,...t[r]}));return WD.makeStreamConfig=r=>{if((0,t.validateConfig)("streamConfig.json",r),void 0===r.columnDefault.width)throw new Error("Must provide config.columnDefault.width when creating a stream.");return{drawVerticalLine:()=>!0,...r,border:(0,e.makeBorderConfig)(r.border),columns:n(r.columnCount,r.columns,r.columnDefault)}},WD}var tg,ng={};function rg(){return tg||(tg=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.mapDataUsingRowHeights=e.padCellVertically=void 0;const t=hD(),n=PD(),r=e=>new Array(e).fill("");e.padCellVertically=(e,t,n)=>{const o=t-e.length;return"top"===n?[...e,...r(o)]:"bottom"===n?[...r(o),...e]:[...r(Math.floor(o/2)),...e,...r(Math.ceil(o/2))]};e.mapDataUsingRowHeights=(r,o,i)=>{const s=r[0].length,a=r.map((t,r)=>{const a=o[r],u=Array.from({length:a},()=>new Array(s).fill(""));return t.forEach((t,o)=>{var s;const c=null===(s=i.spanningCellManager)||void 0===s?void 0:s.getContainingRange({col:o,row:r});if(c)return void c.extractCellContent(r).forEach((e,t)=>{u[t][o]=e});const l=(0,n.wrapCell)(t,i.columns[o].width,i.columns[o].wrapWord);(0,e.padCellVertically)(l,a,i.columns[o].verticalAlignment).forEach((e,t)=>{u[t][o]=e})}),u});return(0,t.flatten)(a)}}(ng)),ng}var og,ig={};function sg(){return og||(og=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.padTableData=e.padString=void 0;e.padString=(e,t,n)=>" ".repeat(t)+e+" ".repeat(n);e.padTableData=(t,n)=>t.map((t,r)=>t.map((t,o)=>{var i;if(null===(i=n.spanningCellManager)||void 0===i?void 0:i.getContainingRange({col:o,row:r},{mapped:!0}))return t;const{paddingLeft:s,paddingRight:a}=n.columns[o];return(0,e.padString)(t,s,a)}))}(ig)),ig}var ag,ug={};function cg(){if(ag)return ug;ag=1,Object.defineProperty(ug,"__esModule",{value:!0}),ug.stringifyTableData=void 0;const e=hD();return ug.stringifyTableData=t=>t.map(t=>t.map(t=>(0,e.normalizeString)(String(t)))),ug}var lg,pg,fg,dg={},hg={exports:{}};function Dg(){return lg||(lg=1,function(e,t){var n,r=1/0,o=NaN,i=/^\s+|\s+$/g,s=/\w*$/,a=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l="\\ud800-\\udfff",p="\\u0300-\\u036f\\ufe20-\\ufe23",f="\\u20d0-\\u20f0",d="\\ufe0e\\ufe0f",h="["+l+"]",D="["+p+f+"]",g="\\ud83c[\\udffb-\\udfff]",m="[^"+l+"]",y="(?:\\ud83c[\\udde6-\\uddff]){2}",b="[\\ud800-\\udbff][\\udc00-\\udfff]",v="\\u200d",E="(?:"+D+"|"+g+")"+"?",F="["+d+"]?",C=F+E+("(?:"+v+"(?:"+[m,y,b].join("|")+")"+F+E+")*"),w="(?:"+[m+D+"?",D,y,b,h].join("|")+")",_=RegExp(g+"(?="+g+")|"+w+C,"g"),A=RegExp("["+v+l+p+f+d+"]"),S=parseInt,k="object"==typeof id&&id&&id.Object===Object&&id,P="object"==typeof self&&self&&self.Object===Object&&self,R=k||P||Function("return this")(),B=t&&!t.nodeType&&t,x=B&&e&&!e.nodeType&&e,O=x&&x.exports===B&&k.process,T=function(){try{return O&&O.binding("util")}catch(e){}}(),$=T&&T.isRegExp,L=(n="length",function(e){return null==e?void 0:e[n]});function N(e){return A.test(e)}function M(e){return N(e)?function(e){var t=_.lastIndex=0;for(;_.test(e);)t++;return t}(e):L(e)}function j(e){return N(e)?function(e){return e.match(_)||[]}(e):function(e){return e.split("")}(e)}var I=Object.prototype.toString,H=R.Symbol,z=H?H.prototype:void 0,K=z?z.toString:void 0;function U(e){if("string"==typeof e)return e;if(V(e))return K?K.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function q(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i}(e,t,n)}function G(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var W,Z=$?(W=$,function(e){return W(e)}):function(e){return G(e)&&"[object RegExp]"==I.call(e)};function V(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==I.call(e)}function J(e){return e?(e=function(e){if("number"==typeof e)return e;if(V(e))return o;if(G(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=G(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var n=u.test(e);return n||c.test(e)?S(e.slice(2),n?2:8):a.test(e)?o:+e}(e))===r||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function Y(e){return null==e?"":U(e)}e.exports=function(e,t){var n=30,r="...";if(G(t)){var o="separator"in t?t.separator:o;n="length"in t?function(e){var t=J(e),n=t%1;return t==t?n?t-n:t:0}(t.length):n,r="omission"in t?U(t.omission):r}var i=(e=Y(e)).length;if(N(e)){var a=j(e);i=a.length}if(n>=i)return e;var u=n-M(r);if(u<1)return r;var c=a?q(a,0,u).join(""):e.slice(0,u);if(void 0===o)return c+r;if(a&&(u+=c.length-u),Z(o)){if(e.slice(u).search(o)){var l,p=c;for(o.global||(o=RegExp(o.source,Y(s.exec(o))+"g")),o.lastIndex=0;l=o.exec(p);)var f=l.index;c=c.slice(0,void 0===f?u:f)}}else if(e.indexOf(U(o),u)!=u){var d=c.lastIndexOf(o);d>-1&&(c=c.slice(0,d))}return c+r}}(hg,hg.exports)),hg.exports}function gg(){return pg||(pg=1,function(e){var t=dg&&dg.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.truncateTableData=e.truncateString=void 0;const n=t(Dg());e.truncateString=(e,t)=>(0,n.default)(e,{length:t,omission:"…"});e.truncateTableData=(t,n)=>t.map(t=>t.map((t,r)=>(0,e.truncateString)(t,n[r])))}(dg)),dg}function mg(){if(fg)return kh;fg=1,Object.defineProperty(kh,"__esModule",{value:!0}),kh.createStream=void 0;const e=gD(),t=BD(),n=ND(),r=ID(),o=eg(),i=rg(),s=sg(),a=cg(),u=gg(),c=hD(),l=(n,r)=>{let o=(0,a.stringifyTableData)(n);o=(0,u.truncateTableData)(o,(0,c.extractTruncates)(r));const l=(0,t.calculateRowHeights)(o,r);return o=(0,i.mapDataUsingRowHeights)(o,l,r),o=(0,e.alignTableData)(o,r),o=(0,s.padTableData)(o,r),o};return kh.createStream=e=>{const t=(0,o.makeStreamConfig)(e),i=Object.values(t.columns).map(e=>e.width+e.paddingLeft+e.paddingRight);let s=!0;return{write:e=>{if(e.length!==t.columnCount)throw new Error("Row cell count does not match the config.columnCount.");s?(s=!1,((e,t,o)=>{const i=l([e],o).map(e=>(0,r.drawRow)(e,o)).join("");let s;s="",s+=(0,n.drawBorderTop)(t,o),s+=i,s+=(0,n.drawBorderBottom)(t,o),s=s.trimEnd(),process.stdout.write(s)})(e,i,t)):((e,t,o)=>{const i=l([e],o).map(e=>(0,r.drawRow)(e,o)).join("");let s="";const a=(0,n.drawBorderBottom)(t,o);"\n"!==a&&(s="\r"),s+=(0,n.drawBorderJoin)(t,o),s+=i,s+=a,s=s.trimEnd(),process.stdout.write(s)})(e,i,t)}}},kh}var yg,bg={},vg={};function Eg(){if(yg)return vg;yg=1,Object.defineProperty(vg,"__esModule",{value:!0}),vg.calculateOutputColumnWidths=void 0;return vg.calculateOutputColumnWidths=e=>e.columns.map(e=>e.paddingLeft+e.width+e.paddingRight),vg}var Fg,Cg={};function wg(){if(Fg)return Cg;Fg=1,Object.defineProperty(Cg,"__esModule",{value:!0}),Cg.drawTable=void 0;const e=ND(),t=LD(),n=ID(),r=hD();return Cg.drawTable=(o,i,s,a)=>{const{drawHorizontalLine:u,singleLine:c}=a,l=(0,r.groupBySizes)(o,s).map((e,t)=>e.map(e=>(0,n.drawRow)(e,{...a,rowIndex:t})).join(""));return(0,t.drawContent)({contents:l,drawSeparator:(e,t)=>(0===e||e===t||!c)&&u(e,t),elementType:"row",rowIndex:-1,separatorGetter:(0,e.createTableBorderGetter)(i,{...a,rowCount:l.length}),spanningCellManager:a.spanningCellManager})},Cg}var _g,Ag={};function Sg(){if(_g)return Ag;_g=1,Object.defineProperty(Ag,"__esModule",{value:!0}),Ag.injectHeaderConfig=void 0;return Ag.injectHeaderConfig=(e,t)=>{var n;let r=null!==(n=t.spanningCells)&&void 0!==n?n:[];const o=t.header,i=[...e];if(o){r=r.map(({row:e,...t})=>({...t,row:e+1}));const{content:t,...n}=o;r.unshift({alignment:"center",col:0,colSpan:e[0].length,paddingLeft:1,paddingRight:1,row:0,wrapWord:!1,...n}),i.unshift([t,...Array.from({length:e[0].length-1}).fill("")])}return[i,r]},Ag}var kg,Pg={},Rg={};function Bg(){return kg||(kg=1,function(e){var t=Rg&&Rg.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.calculateMaximumColumnWidths=e.calculateMaximumCellWidth=void 0;const n=t(Hh()),r=hD();e.calculateMaximumCellWidth=e=>Math.max(...e.split("\n").map(n.default));e.calculateMaximumColumnWidths=(t,n=[])=>{const o=new Array(t[0].length).fill(0),i=n.map(r.calculateRangeCoordinate);return t.forEach((t,n)=>{t.forEach((t,s)=>{((e,t)=>i.some(n=>(0,r.isCellInRange)({col:t,row:e},n)))(n,s)||(o[s]=Math.max(o[s],(0,e.calculateMaximumCellWidth)(t)))})}),o}}(Rg)),Rg}var xg,Og={},Tg={};function $g(){if(xg)return Tg;xg=1;var e=Tg&&Tg.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Tg,"__esModule",{value:!0}),Tg.alignVerticalRangeContent=Tg.wrapRangeContent=void 0;const t=e(Hh()),n=DD(),r=rg(),o=sg(),i=gg(),s=hD(),a=PD();Tg.wrapRangeContent=(e,t,r)=>{const{topLeft:s,paddingRight:u,paddingLeft:c,truncate:l,wrapWord:p,alignment:f}=e,d=r.rows[s.row][s.col],h=t-c-u;return(0,a.wrapCell)((0,i.truncateString)(d,l),h,p).map(e=>{const t=(0,n.alignString)(e,h,f);return(0,o.padString)(t,c,u)})};return Tg.alignVerticalRangeContent=(e,n,o)=>{const{rows:i,drawHorizontalLine:a,rowHeights:u}=o,{topLeft:c,bottomRight:l,verticalAlignment:p}=e;if(0===u.length)return[];const f=(0,s.sumArray)(u.slice(c.row,l.row+1))+(l.row-c.row)-(0,s.sequence)(c.row+1,l.row).filter(e=>!a(e,i.length)).length;return(0,r.padCellVertically)(n,f,p).map(e=>0===e.length?" ".repeat((0,t.default)(n[0])):e)},Tg}var Lg,Ng={};function Mg(){if(Lg)return Ng;Lg=1,Object.defineProperty(Ng,"__esModule",{value:!0}),Ng.calculateSpanningCellWidth=void 0;const e=hD();return Ng.calculateSpanningCellWidth=(t,n)=>{const{columnsConfig:r,drawVerticalLine:o}=n,{topLeft:i,bottomRight:s}=t;return(0,e.sumArray)(r.slice(i.col,s.col+1).map(({width:e})=>e))+(i.col===s.col?r[i.col].paddingRight+r[s.col].paddingLeft:(0,e.sumArray)(r.slice(i.col,s.col+1).map(({paddingLeft:e,paddingRight:t})=>e+t)))+(s.col-i.col)-(0,e.sequence)(i.col+1,s.col).filter(e=>!o(e,r.length)).length},Ng}var jg,Ig,Hg={};function zg(){if(jg)return Hg;jg=1,Object.defineProperty(Hg,"__esModule",{value:!0}),Hg.makeRangeConfig=void 0;const e=hD();return Hg.makeRangeConfig=(t,n)=>{var r;const{topLeft:o,bottomRight:i}=(0,e.calculateRangeCoordinate)(t);return{...{...n[o.col],...t,paddingRight:null!==(r=t.paddingRight)&&void 0!==r?r:n[i.col].paddingRight},bottomRight:i,topLeft:o}},Hg}function Kg(){if(Ig)return Og;Ig=1,Object.defineProperty(Og,"__esModule",{value:!0}),Og.createSpanningCellManager=void 0;const e=$g(),t=Mg(),n=zg(),r=hD(),o=(e,t)=>t.find(t=>(0,r.isCellInRange)(e,t)),i=(n,o)=>{const i=(0,t.calculateSpanningCellWidth)(n,o),s=(0,e.wrapRangeContent)(n,i,o),a=(0,e.alignVerticalRangeContent)(n,s,o);return{...n,extractBorderContent:e=>{const{topLeft:t}=n,i=(0,r.sumArray)(o.rowHeights.slice(t.row,e))+(e-t.row-1);return a[i]},extractCellContent:e=>{const{topLeft:t}=n,{drawHorizontalLine:i,rowHeights:s}=o,u=e-t.row,c=(0,r.sequence)(t.row+1,e).filter(e=>!(null==i?void 0:i(e,s.length))).length,l=(0,r.sumArray)(s.slice(t.row,e))+u-c;return a.slice(l,l+s[e])},height:s.length,width:i}};return Og.createSpanningCellManager=e=>{const{spanningCellConfigs:t,columnsConfig:s}=e,a=t.map(e=>(0,n.makeRangeConfig)(e,s)),u={};let c=[],l=[];return{getContainingRange:(t,n)=>{var r;const s=(null==n?void 0:n.mapped)?l[t.row]:t.row,p=o({...t,row:s},a);if(!p)return;if(0===c.length)return i(p,{...e,rowHeights:c});const f=(e=>{const{row:t,col:n}=e.topLeft;return`${t}/${n}`})(p);return null!==(r=u[f])&&void 0!==r||(u[f]=i(p,{...e,rowHeights:c})),u[f]},inSameRange:(e,t)=>((e,t,n)=>{const i=o(e,n),s=o(t,n);return!(!i||!s)&&(0,r.areCellEqual)(i.topLeft,s.topLeft)})(e,t,a),rowHeights:c,rowIndexMapping:l,setRowHeights:e=>{c=e},setRowIndexMapping:e=>{l=(0,r.flatten)(e.map((e,t)=>Array.from({length:e},()=>t)))}}},Og}var Ug,qg,Gg={};function Wg(){if(Ug)return Gg;Ug=1,Object.defineProperty(Gg,"__esModule",{value:!0}),Gg.validateSpanningCellConfig=void 0;const e=hD(),t=(e,t,n)=>e<=n&&n<=t;return Gg.validateSpanningCellConfig=(n,r)=>{const[o,i]=[n.length,n[0].length];r.forEach((e,t)=>{const{colSpan:n,rowSpan:r}=e;if(void 0===n&&void 0===r)throw new Error(`Expect at least colSpan or rowSpan is provided in config.spanningCells[${t}]`);if(void 0!==n&&n<1)throw new Error(`Expect colSpan is not equal zero, instead got: ${n} in config.spanningCells[${t}]`);if(void 0!==r&&r<1)throw new Error(`Expect rowSpan is not equal zero, instead got: ${r} in config.spanningCells[${t}]`)});const s=r.map(e.calculateRangeCoordinate);s.forEach(({topLeft:e,bottomRight:n},r)=>{if(!(t(0,i-1,e.col)&&t(0,o-1,e.row)&&t(0,i-1,n.col)&&t(0,o-1,n.row)))throw new Error(`Some cells in config.spanningCells[${r}] are out of the table`)});const a=Array.from({length:o},()=>Array.from({length:i}));s.forEach(({topLeft:t,bottomRight:n},r)=>{(0,e.sequence)(t.row,n.row).forEach(o=>{(0,e.sequence)(t.col,n.col).forEach(e=>{if(void 0!==a[o][e])throw new Error(`Spanning cells in config.spanningCells[${a[o][e]}] and config.spanningCells[${r}] are overlap each other`);a[o][e]=r})})})},Gg}function Zg(){if(qg)return Pg;qg=1,Object.defineProperty(Pg,"__esModule",{value:!0}),Pg.makeTableConfig=void 0;const e=Bg(),t=Kg(),n=hD(),r=XD(),o=Wg();return Pg.makeTableConfig=(i,s={},a)=>{var u,c,l,p,f;(0,r.validateConfig)("config.json",s),(0,o.validateSpanningCellConfig)(i,null!==(u=s.spanningCells)&&void 0!==u?u:[]);const d=null!==(c=null!=a?a:s.spanningCells)&&void 0!==c?c:[],h=((t,n,r,o)=>{const i=(0,e.calculateMaximumColumnWidths)(t,o);return t[0].map((e,t)=>({alignment:"left",paddingLeft:1,paddingRight:1,truncate:Number.POSITIVE_INFINITY,verticalAlignment:"top",width:i[t],wrapWord:!1,...r,...null==n?void 0:n[t]}))})(i,s.columns,s.columnDefault,d),D=null!==(l=s.drawVerticalLine)&&void 0!==l?l:()=>!0,g=null!==(p=s.drawHorizontalLine)&&void 0!==p?p:()=>!0;return{...s,border:(0,n.makeBorderConfig)(s.border),columns:h,drawHorizontalLine:g,drawVerticalLine:D,singleLine:null!==(f=s.singleLine)&&void 0!==f&&f,spanningCellManager:(0,t.createSpanningCellManager)({columnsConfig:h,drawHorizontalLine:g,drawVerticalLine:D,rows:i,spanningCellConfigs:d})}},Pg}var Vg,Jg,Yg={};function Qg(){if(Vg)return Yg;Vg=1,Object.defineProperty(Yg,"__esModule",{value:!0}),Yg.validateTableData=void 0;const e=hD();return Yg.validateTableData=t=>{if(!Array.isArray(t))throw new TypeError("Table data must be an array.");if(0===t.length)throw new Error("Table must define at least one row.");if(0===t[0].length)throw new Error("Table must define at least one column.");const n=t[0].length;for(const r of t){if(!Array.isArray(r))throw new TypeError("Table row data must be an array.");if(r.length!==n)throw new Error("Table must have a consistent number of cells.");for(const t of r)if(/[\u0001-\u0006\u0008\u0009\u000B-\u001A]/.test((0,e.normalizeString)(String(t))))throw new Error("Table data must not contain control characters.")}},Yg}function Xg(){if(Jg)return bg;Jg=1,Object.defineProperty(bg,"__esModule",{value:!0}),bg.table=void 0;const e=gD(),t=Eg(),n=BD(),r=wg(),o=Sg(),i=Zg(),s=rg(),a=sg(),u=cg(),c=gg(),l=hD(),p=Qg();return bg.table=(f,d={})=>{(0,p.validateTableData)(f);let h=(0,u.stringifyTableData)(f);const[D,g]=(0,o.injectHeaderConfig)(h,d),m=(0,i.makeTableConfig)(D,d,g);h=(0,c.truncateTableData)(D,(0,l.extractTruncates)(m));const y=(0,n.calculateRowHeights)(h,m);m.spanningCellManager.setRowHeights(y),m.spanningCellManager.setRowIndexMapping(y),h=(0,s.mapDataUsingRowHeights)(h,y,m),h=(0,e.alignTableData)(h,m),h=(0,a.padTableData)(h,m);const b=(0,t.calculateOutputColumnWidths)(m);return(0,r.drawTable)(h,b,y,m)},bg}var em,tm,nm={};function rm(){return em||(em=1,Object.defineProperty(nm,"__esModule",{value:!0})),nm}function om(){return tm||(tm=1,function(e){var t=Sh&&Sh.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=Sh&&Sh.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.getBorderCharacters=e.createStream=e.table=void 0;const r=mg();Object.defineProperty(e,"createStream",{enumerable:!0,get:function(){return r.createStream}});const o=dD();Object.defineProperty(e,"getBorderCharacters",{enumerable:!0,get:function(){return o.getBorderCharacters}});const i=Xg();Object.defineProperty(e,"table",{enumerable:!0,get:function(){return i.table}}),n(rm(),e)}(Sh)),Sh}var im=om();const sm=Boolean(process.stdout?.isTTY),am=e=>{if("1"===process.env.STAN_BORING||"1"===process.env.NO_COLOR||"0"===process.env.FORCE_COLOR||!sm){if("warn"===e)return"[WARN]";switch(e){case"waiting":return"[WAIT]";case"run":return"[RUN]";case"ok":return"[OK]";case"error":return"[FAIL]";case"cancelled":return"[CANCELLED]";case"timeout":return"[TIMEOUT]";case"quiet":return"[QUIET]";case"stalled":return"[STALLED]";case"killed":return"[KILLED]";default:return""}}switch(e){case"warn":return Uf("⚠ warn");case"waiting":return Kf("⏸ waiting");case"run":return If("▶ run");case"ok":return Mf("✔ ok");case"error":return Hf("✖ fail");case"cancelled":return zf("◼ cancelled");case"timeout":return Hf("⏱ timeout");case"quiet":return jf("⏱ quiet");case"stalled":return Uf("⏱ stalled");case"killed":return Hf("◼ killed");default:return""}},um=()=>Date.now(),cm=e=>e.toString().padStart(2,"0"),lm=e=>{e<0&&(e=0);const t=Math.floor(e/1e3),n=Math.floor(t/60),r=t%60;return`${cm(n)}:${cm(r)}`};class pm{rows=new Map;opts;timer;startedAt=um();constructor(e){this.opts={boring:Boolean(e?.boring),refreshMs:e?.refreshMs??1e3}}flush(){this.render()}start(){this.timer||(this.timer=setInterval(()=>this.render(),this.opts.refreshMs))}clear(){try{Fh.clear?.()}catch{}}stop(){this.timer&&clearInterval(this.timer),this.timer=void 0;try{Fh.done?.()}catch{}}update(e,t,n){const r=this.rows.get(e),o=n??this.deriveMetaFromKey(e)??(r?.type?{type:r.type,item:r.item}:void 0);if(!o){const n={type:"script",item:e};return void this.rows.set(e,{...n,state:{...r?.state??{},...t}})}this.rows.set(e,{...o,state:{...r?.state??{},...t}})}cancelPending(){const e=um();for(const[t,n]of this.rows.entries()){const r=n.state;switch(r.kind){case"waiting":this.update(t,{kind:"cancelled"});break;case"running":case"quiet":case"stalled":{const n="number"==typeof r.startedAt?r.startedAt:void 0,o="number"==typeof n?Math.max(0,e-n):0;this.update(t,{kind:"cancelled",durationMs:o});break}}}}deriveMetaFromKey(e){return e.startsWith("script:")?{type:"script",item:e.slice(7)||"(unnamed)"}:e.startsWith("archive:")?{type:"archive",item:e.slice(8)||"(unnamed)"}:void 0}render(){const e=["Type","Item","Status","Time","Output"].map(e=>qf(e)),t=[];if(t.push(e),0===this.rows.size){const e=lm(um()-this.startedAt);t.push([Gf("—"),Gf("—"),Gf(this.opts.boring?"[IDLE]":"idle"),Gf(e),Gf("")])}else{const e=Array.from(this.rows.values()),n=[...e.filter(e=>"script"===e.type),...e.filter(e=>"archive"===e.type)];for(const e of n){const n=e.state;let r="";r="running"===n.kind||"quiet"===n.kind||"stalled"===n.kind?lm(um()-n.startedAt):"durationMs"in n&&"number"==typeof n.durationMs?lm(n.durationMs):"";const o="done"===n.kind||"error"===n.kind||"timedout"===n.kind||"cancelled"===n.kind||"killed"===n.kind?n.outputPath??"":"",i="warn"===n.kind?"warn":"waiting"===n.kind?"waiting":"running"===n.kind?"run":"quiet"===n.kind?"quiet":"stalled"===n.kind?"stalled":"done"===n.kind?"ok":"error"===n.kind?"error":"timedout"===n.kind?"timeout":"cancelled"===n.kind?"cancelled":"killed";t.push([e.type,e.item,am(i),r,o??""])}}const n=im.table(t,{border:{topBody:"",topJoin:"",topLeft:"",topRight:"",bottomBody:"",bottomJoin:"",bottomLeft:"",bottomRight:"",bodyLeft:"",bodyRight:"",bodyJoin:"",joinBody:"",joinLeft:"",joinRight:"",joinJoin:""},drawHorizontalLine:()=>!1,columns:{2:{alignment:"left"},3:{alignment:"right"}}}).split("\n").map(e=>e.startsWith(" ")?e.slice(1):e).join("\n"),r=((e,t,n)=>n?[`${e}`,`waiting ${t.waiting.toString()}`,`running ${t.running.toString()}`,`quiet ${t.quiet.toString()}`,`stalled ${t.stalled.toString()}`,`TIMEOUT ${t.timeout.toString()}`,`OK ${t.ok.toString()}`,`WARN ${t.warn.toString()}`,`FAIL ${t.fail.toString()}`,`CANCELLED ${t.cancelled.toString()}`].join(" • "):[`${e}`,Kf(`⏸ ${t.waiting.toString()}`),If(`▶ ${t.running.toString()}`),jf(`⏱ ${t.quiet.toString()}`),Uf(`⏱ ${t.stalled.toString()}`),Hf(`⏱ ${t.timeout.toString()}`),Mf(`✔ ${t.ok.toString()}`),Uf(`⚠ ${t.warn.toString()}`),Hf(`✖ ${t.fail.toString()}`),zf(`◼ ${t.cancelled.toString()}`)].join(" • "))(lm(um()-this.startedAt),this.counts(),this.opts.boring),o=`${Gf("Press")} ${qf("q")} ${Gf("to cancel,")} ${qf("r")} ${Gf("to restart")}`,i=`${n.trimEnd()}\n\n${r}\n${o}`.split("\n").map(e=>` ${e}`).join("\n");try{Fh(i)}catch{}}counts(){let e=0,t=0,n=0,r=0,o=0,i=0,s=0,a=0,u=0;for(const[,c]of this.rows.entries()){switch(c.state.kind){case"warn":e+=1;break;case"waiting":t+=1;break;case"running":n+=1;break;case"quiet":r+=1;break;case"stalled":o+=1;break;case"done":i+=1;break;case"timedout":u+=1;break;case"cancelled":s+=1;break;case"error":case"killed":a+=1}}return{warn:e,waiting:t,running:n,quiet:r,stalled:o,ok:i,cancelled:s,fail:a,timeout:u}}}class fm{model;opts;renderer=null;unsubscribe;constructor(e,t){this.model=e,this.opts=t}start(){this.renderer||(this.renderer=new pm({boring:Boolean(this.opts?.boring)}),this.renderer.start(),this.unsubscribe=this.model.subscribe(e=>this.onUpdate(e.key,e.meta,e.state)))}stop(){try{this.renderer?.flush(),this.renderer?.stop()}catch{}this.unsubscribe&&this.unsubscribe(),this.unsubscribe=void 0}clear(){try{this.renderer?.clear?.(),this.renderer?.stop()}catch{}}cancelPending(){this.renderer?.cancelPending?.()}onUpdate(e,t,n){this.renderer?.update(`${t.type}:${t.item}`,n,t)}}class dm{model;cwd;unsubscribe;constructor(e,t){this.model=e,this.cwd=t}start(){this.unsubscribe=this.model.subscribe(e=>this.onUpdate(e.meta,e.state))}stop(){this.unsubscribe&&this.unsubscribe(),this.unsubscribe=void 0}onUpdate(e,t){const n=e.item,r="archive"===e.type?"diff"===n?"archive (diff)":"archive":n;if("waiting"!==t.kind)if("running"!==t.kind){if("warn"===t.kind){const e=(t.outputPath??"").replace(/\\/g,"/");return void console.log(`stan: ${am("warn")} "${r}" -> ${e}`)}if("done"===t.kind||"error"===t.kind){const e="done"===t.kind,n=(t.outputPath??"").replace(/\\/g,"/"),o=am(e?"ok":"error"),i=e?"":" (exit 1)",s=n||"";return void console.log(`stan: ${o} "${r}" -> ${s}${i}`)}}else console.log(`stan: ${am("run")} "${r}"`);else console.log(`stan: ${am("waiting")} "${r}"`)}}class hm{model=new Cd;sink;constructor(){this.sink=new dm(this.model,process.cwd())}start(){this.sink.start()}onPlan(e){console.log(e)}onScriptQueued(e){this.model.update(`script:${e}`,{kind:"waiting"},{type:"script",item:e})}onScriptStart(e){this.model.update(`script:${e}`,{kind:"running",startedAt:Date.now()},{type:"script",item:e})}onScriptEnd(e,t,n,r,o,i,s){const a=b(n,t).replace(/\\/g,"/"),u="error"===s?{kind:"error",durationMs:0,outputPath:a}:"warn"===s?{kind:"warn",durationMs:0,outputPath:a}:{kind:"done",durationMs:0,outputPath:a};this.model.update(`script:${e}`,u,{type:"script",item:e})}onArchiveQueued(){}onArchiveStart(e){const t="full"===e?"full":"diff";this.model.update(`archive:${t}`,{kind:"running",startedAt:Date.now()},{type:"archive",item:t})}onArchiveEnd(e,t,n){const r=b(n,t).replace(/\\/g,"/"),o="full"===e?"full":"diff";this.model.update(`archive:${o}`,{kind:"done",durationMs:0,outputPath:r},{type:"archive",item:o})}onCancelled(e){}installCancellation(e){}stop(){this.sink.stop()}}class Dm{opts;renderer=null;control=null;model=new Cd;sink;constructor(e){this.opts=e,this.sink=new fm(this.model,{boring:Boolean(e?.boring)})}start(){this.renderer||(this.sink.start(),this.renderer=this.sink.renderer??null)}onPlan(e){console.log(e)}onScriptQueued(e){this.model.update(`script:${e}`,{kind:"waiting"},{type:"script",item:e})}onScriptStart(e){this.model.update(`script:${e}`,{kind:"running",startedAt:Date.now()},{type:"script",item:e})}onScriptEnd(e,t,n,r,o,i,s){const a=b(n,t).replace(/\\/g,"/"),u="error"===s||"number"==typeof i&&0!==i?{kind:"error",durationMs:Math.max(0,o-r),outputPath:a}:"warn"===s?{kind:"warn",durationMs:Math.max(0,o-r),outputPath:a}:{kind:"done",durationMs:Math.max(0,o-r),outputPath:a};this.model.update(`script:${e}`,u,{type:"script",item:e})}onArchiveQueued(e){const t="full"===e?"full":"diff";this.model.update(`archive:${t}`,{kind:"waiting"},{type:"archive",item:t})}onArchiveStart(e){const t="full"===e?"full":"diff";this.model.update(`archive:${t}`,{kind:"running",startedAt:Date.now()},{type:"archive",item:t})}onArchiveEnd(e,t,n,r,o){const i="full"===e?"full":"diff",s=b(n,t).replace(/\\/g,"/");this.model.update(`archive:${i}`,{kind:"done",durationMs:Math.max(0,o-r),outputPath:s},{type:"archive",item:i})}onCancelled(e="cancel"){try{this.sink?.cancelPending?.()}catch{}try{"restart"===e?this.sink?.clear?.():this.sink.stop()}catch{}try{this.control?.detach()}catch{}this.control=null,this.renderer=null}installCancellation(e,t){try{this.control=new Fd({onCancel:e,onRestart:t}),this.control.attach()}catch{this.control=null}}stop(){try{this.sink.stop()}catch{}try{this.control?.detach()}catch{}this.control=null}}const gm="test"===process.env.NODE_ENV||"1"===process.env.STAN_WRITE_ORDER,mm=async e=>{const{cwd:t,config:n,selection:r,mode:o,behavior:i,liveEnabled:s,planBody:a,printPlan:u}=e,l={outputAbs:g(t,n.stanPath,"output"),outputRel:g(n.stanPath,"output").replace(/\\/g,"/")},p=l.outputAbs,f=s?new Dm({boring:"1"===process.env.STAN_BORING}):new hm;let d;gm&&(d=g(p,"order.txt"),i.keep||await c(d,"","utf8")),u&&a&&(f.onPlan(a),console.log("")),f.start();const h=(r??[]).filter(e=>Object.prototype.hasOwnProperty.call(n.scripts,e));for(const e of h)f.onScriptQueued(e);i.archive&&(f.onArchiveQueued("full"),f.onArchiveQueued("diff"));const D=new Ed({hangWarn:i.hangWarn,hangKill:i.hangKill,hangKillGrace:i.hangKillGrace});let m=!1,y=!1;const b=new Set;let v=null;const E=new Promise(e=>{v=e}),F=()=>{if(!m){m=!0;for(const e of h)b.add(`script:${e}`);try{f.onCancelled("cancel")}catch{}try{D.cancelAll({immediate:!0})}catch{}try{process.exitCode=1,"test"!==process.env.NODE_ENV&&process.exit(1)}catch{}try{v?.()}catch{}}},C=()=>F();try{process.on("SIGINT",C)}catch{}f.installCancellation(F,s?()=>{if(!y){y=!0,m=!0;try{f.onCancelled("restart")}catch{}try{D.cancelAll({immediate:!0})}catch{}try{v?.()}catch{}}}:void 0);const w=(_=async()=>{try{f.stop()}catch{}try{D.cancelAll({immediate:!0})}catch{}try{await D.waitAll(3e3)}catch{}try{process.stdin.pause?.()}catch{}},bd(()=>{try{const e=_();e&&"function"==typeof e.then&&e.catch(()=>{})}catch{}}));var _;const A=()=>{try{process.off("SIGINT",C)}catch{}try{w()}catch{}},S=[];let k=null;if(h.length>0&&(k=(async(e,t,n,r,o,i,s,a,u,c,l)=>{const p=[],f=async n=>{try{if("function"==typeof c&&!c())return}catch{}const o=r.scripts[n],i="string"==typeof o?o:"object"==typeof o&&o&&"script"in o?String(o.script):"",f=[];if(o&&"object"==typeof o&&"warnPattern"in o){const e=o.warnPattern;if("string"==typeof e&&e.trim().length){const t=e.trim();try{f.push(new RegExp(t))}catch{}try{const e=t.replace(/\\\\/g,"\\");e!==t&&f.push(new RegExp(e))}catch{}try{f.push(new RegExp(t,"i"))}catch{}}}const d=await ld(e,t,0,n,i,s,a,{silent:a.silent,hangWarn:u?.hangWarn,hangKill:u?.hangKill,hangKillGrace:u?.hangKillGrace,warnPatterns:f},l);p.push(d)};if("sequential"===i)for(const e of o){const t=e=>new Promise(t=>setTimeout(t,e));if("function"==typeof c){if(!c())break;if(await cd(),!c())break;if(await t(25),!c())break}if(await f(e),"function"==typeof c&&(await cd(),!c()))break}else{const e="function"==typeof c?o.filter(()=>c()):o;await Promise.all(e.map(e=>f(e).then(()=>{})))}return p})(t,p,0,n,h,o,d,{onStart:e=>f.onScriptStart(e),onEnd:(e,n,r,o,i,s)=>{m&&b.has(`script:${e}`)||(f.onScriptEnd(e,n,t,r,o,i,s),("error"===s||"number"==typeof i&&0!==i)&&(process.exitCode=1))},silent:!0,onHangWarn:(e,t)=>{s||console.log(`stan: ⏱ stalled "${e}" after ${t}s of inactivity`)},onHangTimeout:(e,t)=>{s||console.log(`stan: ⏱ timeout "${e}" after ${t}s; sending SIGTERM`)},onHangKilled:(e,t)=>{s||console.log(`stan: ◼ killed "${e}" after ${t}s grace`)}},{hangWarn:i.hangWarn,hangKill:i.hangKill,hangKillGrace:i.hangKillGrace},()=>!m,D).then(e=>{S.push(...e)}),k.catch?.(()=>{}),await Promise.race([k,E])),m){try{f.stop()}catch{}s&&console.log("");try{k&&await Promise.race([k,new Promise(e=>setTimeout(e,2500))])}catch{}try{await D.waitAll(3e3)}catch{}try{process.stdin.pause?.()}catch{}try{const e="win32"===process.platform?1600:400;await new Promise(t=>setTimeout(t,e))}catch{}return{created:S,cancelled:!0,restartRequested:y}}try{await new Promise(e=>setImmediate(e))}catch{}if(m)return A(),{created:S,cancelled:!0,restartRequested:y};if(i.archive){const e=Boolean(i.combine),{archivePath:r,diffPath:o}=await nd({cwd:t,config:n,includeOutputs:e},{silent:!0,progress:{start:e=>f.onArchiveStart(e),done:(e,n,r,o)=>f.onArchiveEnd(e,n,t,r,o)}});S.push(r,o)}return f.stop(),s&&console.log(""),A(),{created:S,cancelled:!1,restartRequested:y}},ym=async(e,t,o=null,a="concurrent",u)=>{const c=u??{};try{await(async e=>{const t=await Qf(e),n=Boolean(process.stdout?.isTTY);if(!t.systemPrompt.localExists||t.systemPrompt.inSync||t.isDevModuleRepo||"1"===process.env.STAN_SUPPRESS_DRIFT||"test"===process.env.NODE_ENV&&"1"!==process.env.STAN_FORCE_DRIFT_WARN||(n?(console.warn(jf("stan: warning: local system prompt differs from packaged baseline.")),console.warn(Gf(" Edits in downstream repos will be overwritten by `stan init`.")),console.warn(Gf(" Move customizations to <stanPath>/system/stan.project.md instead."))):console.warn("stan: warning: system prompt drift detected; run `stan init` to update (non‑TTY)")),!t.isDevModuleRepo&&t.packageVersion&&t.docsMeta?.version){const e=t.docsMeta.version,r=t.packageVersion;e!==r&&(n?(console.log(`stan: docs baseline has changed since last install (${e} -> ${r}).`),console.log(Gf(" Run `stan init` to update prompts in your repo."))):console.log(`stan: docs baseline changed ${e} -> ${r}; run \`stan init\` to update`))}})(e)}catch(e){if("1"===process.env.STAN_DEBUG){const t=e instanceof Error?e.message:String(e);console.error("stan: preflight failed",t)}}await(async(e,t,o=!1)=>{const a=he(e,t);if(await be(e,t),!o){const e=g(a.outputAbs,N);if(n(e))try{await i(e,g(a.diffAbs,M))}catch{}const t=await s(a.outputAbs,{withFileTypes:!0});for(const e of t)r(g(a.outputAbs,e.name),{recursive:!0,force:!0})}return a.rootAbs})(e,t.stanPath,Boolean(c.keep));const l=((e,t)=>{const{selection:n,config:r,mode:o,behavior:i}=t,s=(null==n?Object.keys(r.scripts):n)??[],a=D.join(r.stanPath,"output").replace(/\\/g,"/");return`stan:\n ${[qf("STAN run plan"),"mode: "+("sequential"===o?"sequential":"concurrent"),`output: ${a}/`,`scripts: ${s.length?s.join(", "):"none"}`,"archive: "+(i.archive?"yes":"no"),"combine: "+(i.combine?"yes":"no"),"keep output dir: "+(i.keep?"yes":"no"),"live: "+(i.live?"yes":"no"),`hang warn: ${"number"==typeof i.hangWarn?i.hangWarn.toString():"n/a"}s`,`hang kill: ${"number"==typeof i.hangKill?i.hangKill.toString():"n/a"}s`,`hang kill grace: ${"number"==typeof i.hangKillGrace?i.hangKillGrace.toString():"n/a"}s`].join("\n ")}`})(0,{selection:o,config:t,mode:a,behavior:c}),p=process.stdout,f=Boolean(p?.isTTY),d=(c.live??!0)&&f,h=null==o?Object.keys(t.scripts):o;let m=!1;for(;;){const{created:n,cancelled:r,restartRequested:o}=await mm({cwd:e,config:t,selection:h,mode:a,behavior:c,liveEnabled:d,planBody:l,printPlan:!m&&!1!==c.plan});if(m=!0,!o)return n}};export{af as renderAvailableScriptsHelp,ym as runSelected};