@5minds/processcube_app_sdk 6.2.0-develop-32452d-m2ee0twu → 6.2.0-develop-9025fa-m2ensenw

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.
@@ -1,5 +1,5 @@
1
- var Hn=Object.create;var ds=Object.defineProperty;var Dn=Object.getOwnPropertyDescriptor;var Fn=Object.getOwnPropertyNames;var $n=Object.getPrototypeOf,Mn=Object.prototype.hasOwnProperty;var L=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,s)=>(typeof require<"u"?require:e)[s]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var b=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Un=(t,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Fn(e))!Mn.call(t,n)&&n!==s&&ds(t,n,{get:()=>e[n],enumerable:!(r=Dn(e,n))||r.enumerable});return t};var Bn=(t,e,s)=>(s=t!=null?Hn($n(t)):{},Un(e||!t||!t.__esModule?ds(s,"default",{value:t,enumerable:!0}):s,t));var Re=b((Tc,Es)=>{"use strict";var Wn=L("path"),re="\\\\/",hs=`[^${re}]`,ne="\\.",Gn="\\+",qn="\\?",Me="\\/",Kn="(?=.)",ps="[^/]",lt=`(?:${Me}|$)`,_s=`(?:^|${Me})`,ut=`${ne}{1,2}${lt}`,jn=`(?!${ne})`,Vn=`(?!${_s}${ut})`,Yn=`(?!${ne}{0,1}${lt})`,zn=`(?!${ut})`,Xn=`[^.${Me}]`,Qn=`${ps}*?`,gs={DOT_LITERAL:ne,PLUS_LITERAL:Gn,QMARK_LITERAL:qn,SLASH_LITERAL:Me,ONE_CHAR:Kn,QMARK:ps,END_ANCHOR:lt,DOTS_SLASH:ut,NO_DOT:jn,NO_DOTS:Vn,NO_DOT_SLASH:Yn,NO_DOTS_SLASH:zn,QMARK_NO_DOT:Xn,STAR:Qn,START_ANCHOR:_s},Zn={...gs,SLASH_LITERAL:`[${re}]`,QMARK:hs,STAR:`${hs}*?`,DOTS_SLASH:`${ne}{1,2}(?:[${re}]|$)`,NO_DOT:`(?!${ne})`,NO_DOTS:`(?!(?:^|[${re}])${ne}{1,2}(?:[${re}]|$))`,NO_DOT_SLASH:`(?!${ne}{0,1}(?:[${re}]|$))`,NO_DOTS_SLASH:`(?!${ne}{1,2}(?:[${re}]|$))`,QMARK_NO_DOT:`[^.${re}]`,START_ANCHOR:`(?:^|[${re}])`,END_ANCHOR:`(?:[${re}]|$)`},Jn={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"};Es.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Jn,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:Wn.sep,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?Zn:gs}}});var Ue=b(Y=>{"use strict";var ei=L("path"),ti=process.platform==="win32",{REGEX_BACKSLASH:si,REGEX_REMOVE_BACKSLASH:ri,REGEX_SPECIAL_CHARS:ni,REGEX_SPECIAL_CHARS_GLOBAL:ii}=Re();Y.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Y.hasRegexChars=t=>ni.test(t);Y.isRegexChar=t=>t.length===1&&Y.hasRegexChars(t);Y.escapeRegex=t=>t.replace(ii,"\\$1");Y.toPosixSlashes=t=>t.replace(si,"/");Y.removeBackslashes=t=>t.replace(ri,e=>e==="\\"?"":e);Y.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};Y.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:ti===!0||ei.sep==="\\";Y.escapeLast=(t,e,s)=>{let r=t.lastIndexOf(e,s);return r===-1?t:t[r-1]==="\\"?Y.escapeLast(t,e,r-1):`${t.slice(0,r)}\\${t.slice(r)}`};Y.removePrefix=(t,e={})=>{let s=t;return s.startsWith("./")&&(s=s.slice(2),e.prefix="./"),s};Y.wrapOutput=(t,e={},s={})=>{let r=s.contains?"":"^",n=s.contains?"":"$",o=`${r}(?:${t})${n}`;return e.negated===!0&&(o=`(?:^(?!${o}).*$)`),o}});var Cs=b((Cc,Ss)=>{"use strict";var ms=Ue(),{CHAR_ASTERISK:ft,CHAR_AT:oi,CHAR_BACKWARD_SLASH:Ae,CHAR_COMMA:ai,CHAR_DOT:dt,CHAR_EXCLAMATION_MARK:ht,CHAR_FORWARD_SLASH:Ts,CHAR_LEFT_CURLY_BRACE:pt,CHAR_LEFT_PARENTHESES:_t,CHAR_LEFT_SQUARE_BRACKET:ci,CHAR_PLUS:li,CHAR_QUESTION_MARK:ys,CHAR_RIGHT_CURLY_BRACE:ui,CHAR_RIGHT_PARENTHESES:ws,CHAR_RIGHT_SQUARE_BRACKET:fi}=Re(),Rs=t=>t===Ts||t===Ae,As=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},di=(t,e)=>{let s=e||{},r=t.length-1,n=s.parts===!0||s.scanToEnd===!0,o=[],i=[],a=[],c=t,u=-1,f=0,d=0,l=!1,m=!1,E=!1,w=!1,v=!1,D=!1,V=!1,F=!1,ee=!1,G=!1,ae=0,q,A,x={value:"",depth:0,isGlob:!1},W=()=>u>=r,_=()=>c.charCodeAt(u+1),O=()=>(q=A,c.charCodeAt(++u));for(;u<r;){A=O();let K;if(A===Ae){V=x.backslashes=!0,A=O(),A===pt&&(D=!0);continue}if(D===!0||A===pt){for(ae++;W()!==!0&&(A=O());){if(A===Ae){V=x.backslashes=!0,O();continue}if(A===pt){ae++;continue}if(D!==!0&&A===dt&&(A=O())===dt){if(l=x.isBrace=!0,E=x.isGlob=!0,G=!0,n===!0)continue;break}if(D!==!0&&A===ai){if(l=x.isBrace=!0,E=x.isGlob=!0,G=!0,n===!0)continue;break}if(A===ui&&(ae--,ae===0)){D=!1,l=x.isBrace=!0,G=!0;break}}if(n===!0)continue;break}if(A===Ts){if(o.push(u),i.push(x),x={value:"",depth:0,isGlob:!1},G===!0)continue;if(q===dt&&u===f+1){f+=2;continue}d=u+1;continue}if(s.noext!==!0&&(A===li||A===oi||A===ft||A===ys||A===ht)===!0&&_()===_t){if(E=x.isGlob=!0,w=x.isExtglob=!0,G=!0,A===ht&&u===f&&(ee=!0),n===!0){for(;W()!==!0&&(A=O());){if(A===Ae){V=x.backslashes=!0,A=O();continue}if(A===ws){E=x.isGlob=!0,G=!0;break}}continue}break}if(A===ft){if(q===ft&&(v=x.isGlobstar=!0),E=x.isGlob=!0,G=!0,n===!0)continue;break}if(A===ys){if(E=x.isGlob=!0,G=!0,n===!0)continue;break}if(A===ci){for(;W()!==!0&&(K=O());){if(K===Ae){V=x.backslashes=!0,O();continue}if(K===fi){m=x.isBracket=!0,E=x.isGlob=!0,G=!0;break}}if(n===!0)continue;break}if(s.nonegate!==!0&&A===ht&&u===f){F=x.negated=!0,f++;continue}if(s.noparen!==!0&&A===_t){if(E=x.isGlob=!0,n===!0){for(;W()!==!0&&(A=O());){if(A===_t){V=x.backslashes=!0,A=O();continue}if(A===ws){G=!0;break}}continue}break}if(E===!0){if(G=!0,n===!0)continue;break}}s.noext===!0&&(w=!1,E=!1);let P=c,ce="",h="";f>0&&(ce=c.slice(0,f),c=c.slice(f),d-=f),P&&E===!0&&d>0?(P=c.slice(0,d),h=c.slice(d)):E===!0?(P="",h=c):P=c,P&&P!==""&&P!=="/"&&P!==c&&Rs(P.charCodeAt(P.length-1))&&(P=P.slice(0,-1)),s.unescape===!0&&(h&&(h=ms.removeBackslashes(h)),P&&V===!0&&(P=ms.removeBackslashes(P)));let p={prefix:ce,input:t,start:f,base:P,glob:h,isBrace:l,isBracket:m,isGlob:E,isExtglob:w,isGlobstar:v,negated:F,negatedExtglob:ee};if(s.tokens===!0&&(p.maxDepth=0,Rs(A)||i.push(x),p.tokens=i),s.parts===!0||s.tokens===!0){let K;for(let I=0;I<o.length;I++){let te=K?K+1:f,se=o[I],z=t.slice(te,se);s.tokens&&(I===0&&f!==0?(i[I].isPrefix=!0,i[I].value=ce):i[I].value=z,As(i[I]),p.maxDepth+=i[I].depth),(I!==0||z!=="")&&a.push(z),K=se}if(K&&K+1<t.length){let I=t.slice(K+1);a.push(I),s.tokens&&(i[i.length-1].value=I,As(i[i.length-1]),p.maxDepth+=i[i.length-1].depth)}p.slashes=o,p.parts=a}return p};Ss.exports=di});var bs=b((Ic,xs)=>{"use strict";var Be=Re(),X=Ue(),{MAX_LENGTH:We,POSIX_REGEX_SOURCE:hi,REGEX_NON_SPECIAL_CHARS:pi,REGEX_SPECIAL_CHARS_BACKREF:_i,REPLACEMENTS:Is}=Be,gi=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let s=`[${t.join("-")}]`;try{new RegExp(s)}catch{return t.map(n=>X.escapeRegex(n)).join("..")}return s},ge=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,gt=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=Is[t]||t;let s={...e},r=typeof s.maxLength=="number"?Math.min(We,s.maxLength):We,n=t.length;if(n>r)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${r}`);let o={type:"bos",value:"",output:s.prepend||""},i=[o],a=s.capture?"":"?:",c=X.isWindows(e),u=Be.globChars(c),f=Be.extglobChars(u),{DOT_LITERAL:d,PLUS_LITERAL:l,SLASH_LITERAL:m,ONE_CHAR:E,DOTS_SLASH:w,NO_DOT:v,NO_DOT_SLASH:D,NO_DOTS_SLASH:V,QMARK:F,QMARK_NO_DOT:ee,STAR:G,START_ANCHOR:ae}=u,q=y=>`(${a}(?:(?!${ae}${y.dot?w:d}).)*?)`,A=s.dot?"":v,x=s.dot?F:ee,W=s.bash===!0?q(s):G;s.capture&&(W=`(${W})`),typeof s.noext=="boolean"&&(s.noextglob=s.noext);let _={input:t,index:-1,start:0,dot:s.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:i};t=X.removePrefix(t,_),n=t.length;let O=[],P=[],ce=[],h=o,p,K=()=>_.index===n-1,I=_.peek=(y=1)=>t[_.index+y],te=_.advance=()=>t[++_.index]||"",se=()=>t.slice(_.index+1),z=(y="",N=0)=>{_.consumed+=y,_.index+=N},He=y=>{_.output+=y.output!=null?y.output:y.value,z(y.value)},On=()=>{let y=1;for(;I()==="!"&&(I(2)!=="("||I(3)==="?");)te(),_.start++,y++;return y%2===0?!1:(_.negated=!0,_.start++,!0)},De=y=>{_[y]++,ce.push(y)},le=y=>{_[y]--,ce.pop()},C=y=>{if(h.type==="globstar"){let N=_.braces>0&&(y.type==="comma"||y.type==="brace"),g=y.extglob===!0||O.length&&(y.type==="pipe"||y.type==="paren");y.type!=="slash"&&y.type!=="paren"&&!N&&!g&&(_.output=_.output.slice(0,-h.output.length),h.type="star",h.value="*",h.output=W,_.output+=h.output)}if(O.length&&y.type!=="paren"&&(O[O.length-1].inner+=y.value),(y.value||y.output)&&He(y),h&&h.type==="text"&&y.type==="text"){h.value+=y.value,h.output=(h.output||"")+y.value;return}y.prev=h,i.push(y),h=y},Fe=(y,N)=>{let g={...f[N],conditions:1,inner:""};g.prev=h,g.parens=_.parens,g.output=_.output;let S=(s.capture?"(":"")+g.open;De("parens"),C({type:y,value:N,output:_.output?"":E}),C({type:"paren",extglob:!0,value:te(),output:S}),O.push(g)},Ln=y=>{let N=y.close+(s.capture?")":""),g;if(y.type==="negate"){let S=W;if(y.inner&&y.inner.length>1&&y.inner.includes("/")&&(S=q(s)),(S!==W||K()||/^\)+$/.test(se()))&&(N=y.close=`)$))${S}`),y.inner.includes("*")&&(g=se())&&/^\.[^\\/.]+$/.test(g)){let H=gt(g,{...e,fastpaths:!1}).output;N=y.close=`)${H})${S})`}y.prev.type==="bos"&&(_.negatedExtglob=!0)}C({type:"paren",extglob:!0,value:p,output:N}),le("parens")};if(s.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let y=!1,N=t.replace(_i,(g,S,H,j,M,ct)=>j==="\\"?(y=!0,g):j==="?"?S?S+j+(M?F.repeat(M.length):""):ct===0?x+(M?F.repeat(M.length):""):F.repeat(H.length):j==="."?d.repeat(H.length):j==="*"?S?S+j+(M?W:""):W:S?g:`\\${g}`);return y===!0&&(s.unescape===!0?N=N.replace(/\\/g,""):N=N.replace(/\\+/g,g=>g.length%2===0?"\\\\":g?"\\":"")),N===t&&s.contains===!0?(_.output=t,_):(_.output=X.wrapOutput(N,_,e),_)}for(;!K();){if(p=te(),p==="\0")continue;if(p==="\\"){let g=I();if(g==="/"&&s.bash!==!0||g==="."||g===";")continue;if(!g){p+="\\",C({type:"text",value:p});continue}let S=/^\\+/.exec(se()),H=0;if(S&&S[0].length>2&&(H=S[0].length,_.index+=H,H%2!==0&&(p+="\\")),s.unescape===!0?p=te():p+=te(),_.brackets===0){C({type:"text",value:p});continue}}if(_.brackets>0&&(p!=="]"||h.value==="["||h.value==="[^")){if(s.posix!==!1&&p===":"){let g=h.value.slice(1);if(g.includes("[")&&(h.posix=!0,g.includes(":"))){let S=h.value.lastIndexOf("["),H=h.value.slice(0,S),j=h.value.slice(S+2),M=hi[j];if(M){h.value=H+M,_.backtrack=!0,te(),!o.output&&i.indexOf(h)===1&&(o.output=E);continue}}}(p==="["&&I()!==":"||p==="-"&&I()==="]")&&(p=`\\${p}`),p==="]"&&(h.value==="["||h.value==="[^")&&(p=`\\${p}`),s.posix===!0&&p==="!"&&h.value==="["&&(p="^"),h.value+=p,He({value:p});continue}if(_.quotes===1&&p!=='"'){p=X.escapeRegex(p),h.value+=p,He({value:p});continue}if(p==='"'){_.quotes=_.quotes===1?0:1,s.keepQuotes===!0&&C({type:"text",value:p});continue}if(p==="("){De("parens"),C({type:"paren",value:p});continue}if(p===")"){if(_.parens===0&&s.strictBrackets===!0)throw new SyntaxError(ge("opening","("));let g=O[O.length-1];if(g&&_.parens===g.parens+1){Ln(O.pop());continue}C({type:"paren",value:p,output:_.parens?")":"\\)"}),le("parens");continue}if(p==="["){if(s.nobracket===!0||!se().includes("]")){if(s.nobracket!==!0&&s.strictBrackets===!0)throw new SyntaxError(ge("closing","]"));p=`\\${p}`}else De("brackets");C({type:"bracket",value:p});continue}if(p==="]"){if(s.nobracket===!0||h&&h.type==="bracket"&&h.value.length===1){C({type:"text",value:p,output:`\\${p}`});continue}if(_.brackets===0){if(s.strictBrackets===!0)throw new SyntaxError(ge("opening","["));C({type:"text",value:p,output:`\\${p}`});continue}le("brackets");let g=h.value.slice(1);if(h.posix!==!0&&g[0]==="^"&&!g.includes("/")&&(p=`/${p}`),h.value+=p,He({value:p}),s.literalBrackets===!1||X.hasRegexChars(g))continue;let S=X.escapeRegex(h.value);if(_.output=_.output.slice(0,-h.value.length),s.literalBrackets===!0){_.output+=S,h.value=S;continue}h.value=`(${a}${S}|${h.value})`,_.output+=h.value;continue}if(p==="{"&&s.nobrace!==!0){De("braces");let g={type:"brace",value:p,output:"(",outputIndex:_.output.length,tokensIndex:_.tokens.length};P.push(g),C(g);continue}if(p==="}"){let g=P[P.length-1];if(s.nobrace===!0||!g){C({type:"text",value:p,output:p});continue}let S=")";if(g.dots===!0){let H=i.slice(),j=[];for(let M=H.length-1;M>=0&&(i.pop(),H[M].type!=="brace");M--)H[M].type!=="dots"&&j.unshift(H[M].value);S=gi(j,s),_.backtrack=!0}if(g.comma!==!0&&g.dots!==!0){let H=_.output.slice(0,g.outputIndex),j=_.tokens.slice(g.tokensIndex);g.value=g.output="\\{",p=S="\\}",_.output=H;for(let M of j)_.output+=M.output||M.value}C({type:"brace",value:p,output:S}),le("braces"),P.pop();continue}if(p==="|"){O.length>0&&O[O.length-1].conditions++,C({type:"text",value:p});continue}if(p===","){let g=p,S=P[P.length-1];S&&ce[ce.length-1]==="braces"&&(S.comma=!0,g="|"),C({type:"comma",value:p,output:g});continue}if(p==="/"){if(h.type==="dot"&&_.index===_.start+1){_.start=_.index+1,_.consumed="",_.output="",i.pop(),h=o;continue}C({type:"slash",value:p,output:m});continue}if(p==="."){if(_.braces>0&&h.type==="dot"){h.value==="."&&(h.output=d);let g=P[P.length-1];h.type="dots",h.output+=p,h.value+=p,g.dots=!0;continue}if(_.braces+_.parens===0&&h.type!=="bos"&&h.type!=="slash"){C({type:"text",value:p,output:d});continue}C({type:"dot",value:p,output:d});continue}if(p==="?"){if(!(h&&h.value==="(")&&s.noextglob!==!0&&I()==="("&&I(2)!=="?"){Fe("qmark",p);continue}if(h&&h.type==="paren"){let S=I(),H=p;if(S==="<"&&!X.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(h.value==="("&&!/[!=<:]/.test(S)||S==="<"&&!/<([!=]|\w+>)/.test(se()))&&(H=`\\${p}`),C({type:"text",value:p,output:H});continue}if(s.dot!==!0&&(h.type==="slash"||h.type==="bos")){C({type:"qmark",value:p,output:ee});continue}C({type:"qmark",value:p,output:F});continue}if(p==="!"){if(s.noextglob!==!0&&I()==="("&&(I(2)!=="?"||!/[!=<:]/.test(I(3)))){Fe("negate",p);continue}if(s.nonegate!==!0&&_.index===0){On();continue}}if(p==="+"){if(s.noextglob!==!0&&I()==="("&&I(2)!=="?"){Fe("plus",p);continue}if(h&&h.value==="("||s.regex===!1){C({type:"plus",value:p,output:l});continue}if(h&&(h.type==="bracket"||h.type==="paren"||h.type==="brace")||_.parens>0){C({type:"plus",value:p});continue}C({type:"plus",value:l});continue}if(p==="@"){if(s.noextglob!==!0&&I()==="("&&I(2)!=="?"){C({type:"at",extglob:!0,value:p,output:""});continue}C({type:"text",value:p});continue}if(p!=="*"){(p==="$"||p==="^")&&(p=`\\${p}`);let g=pi.exec(se());g&&(p+=g[0],_.index+=g[0].length),C({type:"text",value:p});continue}if(h&&(h.type==="globstar"||h.star===!0)){h.type="star",h.star=!0,h.value+=p,h.output=W,_.backtrack=!0,_.globstar=!0,z(p);continue}let y=se();if(s.noextglob!==!0&&/^\([^?]/.test(y)){Fe("star",p);continue}if(h.type==="star"){if(s.noglobstar===!0){z(p);continue}let g=h.prev,S=g.prev,H=g.type==="slash"||g.type==="bos",j=S&&(S.type==="star"||S.type==="globstar");if(s.bash===!0&&(!H||y[0]&&y[0]!=="/")){C({type:"star",value:p,output:""});continue}let M=_.braces>0&&(g.type==="comma"||g.type==="brace"),ct=O.length&&(g.type==="pipe"||g.type==="paren");if(!H&&g.type!=="paren"&&!M&&!ct){C({type:"star",value:p,output:""});continue}for(;y.slice(0,3)==="/**";){let $e=t[_.index+4];if($e&&$e!=="/")break;y=y.slice(3),z("/**",3)}if(g.type==="bos"&&K()){h.type="globstar",h.value+=p,h.output=q(s),_.output=h.output,_.globstar=!0,z(p);continue}if(g.type==="slash"&&g.prev.type!=="bos"&&!j&&K()){_.output=_.output.slice(0,-(g.output+h.output).length),g.output=`(?:${g.output}`,h.type="globstar",h.output=q(s)+(s.strictSlashes?")":"|$)"),h.value+=p,_.globstar=!0,_.output+=g.output+h.output,z(p);continue}if(g.type==="slash"&&g.prev.type!=="bos"&&y[0]==="/"){let $e=y[1]!==void 0?"|$":"";_.output=_.output.slice(0,-(g.output+h.output).length),g.output=`(?:${g.output}`,h.type="globstar",h.output=`${q(s)}${m}|${m}${$e})`,h.value+=p,_.output+=g.output+h.output,_.globstar=!0,z(p+te()),C({type:"slash",value:"/",output:""});continue}if(g.type==="bos"&&y[0]==="/"){h.type="globstar",h.value+=p,h.output=`(?:^|${m}|${q(s)}${m})`,_.output=h.output,_.globstar=!0,z(p+te()),C({type:"slash",value:"/",output:""});continue}_.output=_.output.slice(0,-h.output.length),h.type="globstar",h.output=q(s),h.value+=p,_.output+=h.output,_.globstar=!0,z(p);continue}let N={type:"star",value:p,output:W};if(s.bash===!0){N.output=".*?",(h.type==="bos"||h.type==="slash")&&(N.output=A+N.output),C(N);continue}if(h&&(h.type==="bracket"||h.type==="paren")&&s.regex===!0){N.output=p,C(N);continue}(_.index===_.start||h.type==="slash"||h.type==="dot")&&(h.type==="dot"?(_.output+=D,h.output+=D):s.dot===!0?(_.output+=V,h.output+=V):(_.output+=A,h.output+=A),I()!=="*"&&(_.output+=E,h.output+=E)),C(N)}for(;_.brackets>0;){if(s.strictBrackets===!0)throw new SyntaxError(ge("closing","]"));_.output=X.escapeLast(_.output,"["),le("brackets")}for(;_.parens>0;){if(s.strictBrackets===!0)throw new SyntaxError(ge("closing",")"));_.output=X.escapeLast(_.output,"("),le("parens")}for(;_.braces>0;){if(s.strictBrackets===!0)throw new SyntaxError(ge("closing","}"));_.output=X.escapeLast(_.output,"{"),le("braces")}if(s.strictSlashes!==!0&&(h.type==="star"||h.type==="bracket")&&C({type:"maybe_slash",value:"",output:`${m}?`}),_.backtrack===!0){_.output="";for(let y of _.tokens)_.output+=y.output!=null?y.output:y.value,y.suffix&&(_.output+=y.suffix)}return _};gt.fastpaths=(t,e)=>{let s={...e},r=typeof s.maxLength=="number"?Math.min(We,s.maxLength):We,n=t.length;if(n>r)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${r}`);t=Is[t]||t;let o=X.isWindows(e),{DOT_LITERAL:i,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:u,NO_DOT:f,NO_DOTS:d,NO_DOTS_SLASH:l,STAR:m,START_ANCHOR:E}=Be.globChars(o),w=s.dot?d:f,v=s.dot?l:f,D=s.capture?"":"?:",V={negated:!1,prefix:""},F=s.bash===!0?".*?":m;s.capture&&(F=`(${F})`);let ee=A=>A.noglobstar===!0?F:`(${D}(?:(?!${E}${A.dot?u:i}).)*?)`,G=A=>{switch(A){case"*":return`${w}${c}${F}`;case".*":return`${i}${c}${F}`;case"*.*":return`${w}${F}${i}${c}${F}`;case"*/*":return`${w}${F}${a}${c}${v}${F}`;case"**":return w+ee(s);case"**/*":return`(?:${w}${ee(s)}${a})?${v}${c}${F}`;case"**/*.*":return`(?:${w}${ee(s)}${a})?${v}${F}${i}${c}${F}`;case"**/.*":return`(?:${w}${ee(s)}${a})?${i}${c}${F}`;default:{let x=/^(.*?)\.(\w+)$/.exec(A);if(!x)return;let W=G(x[1]);return W?W+i+x[2]:void 0}}},ae=X.removePrefix(t,V),q=G(ae);return q&&s.strictSlashes!==!0&&(q+=`${a}?`),q};xs.exports=gt});var vs=b((xc,ks)=>{"use strict";var Ei=L("path"),mi=Cs(),Et=bs(),mt=Ue(),yi=Re(),wi=t=>t&&typeof t=="object"&&!Array.isArray(t),$=(t,e,s=!1)=>{if(Array.isArray(t)){let f=t.map(l=>$(l,e,s));return l=>{for(let m of f){let E=m(l);if(E)return E}return!1}}let r=wi(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!r)throw new TypeError("Expected pattern to be a non-empty string");let n=e||{},o=mt.isWindows(e),i=r?$.compileRe(t,e):$.makeRe(t,e,!1,!0),a=i.state;delete i.state;let c=()=>!1;if(n.ignore){let f={...e,ignore:null,onMatch:null,onResult:null};c=$(n.ignore,f,s)}let u=(f,d=!1)=>{let{isMatch:l,match:m,output:E}=$.test(f,i,e,{glob:t,posix:o}),w={glob:t,state:a,regex:i,posix:o,input:f,output:E,match:m,isMatch:l};return typeof n.onResult=="function"&&n.onResult(w),l===!1?(w.isMatch=!1,d?w:!1):c(f)?(typeof n.onIgnore=="function"&&n.onIgnore(w),w.isMatch=!1,d?w:!1):(typeof n.onMatch=="function"&&n.onMatch(w),d?w:!0)};return s&&(u.state=a),u};$.test=(t,e,s,{glob:r,posix:n}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let o=s||{},i=o.format||(n?mt.toPosixSlashes:null),a=t===r,c=a&&i?i(t):t;return a===!1&&(c=i?i(t):t,a=c===r),(a===!1||o.capture===!0)&&(o.matchBase===!0||o.basename===!0?a=$.matchBase(t,e,s,n):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};$.matchBase=(t,e,s,r=mt.isWindows(s))=>(e instanceof RegExp?e:$.makeRe(e,s)).test(Ei.basename(t));$.isMatch=(t,e,s)=>$(e,s)(t);$.parse=(t,e)=>Array.isArray(t)?t.map(s=>$.parse(s,e)):Et(t,{...e,fastpaths:!1});$.scan=(t,e)=>mi(t,e);$.compileRe=(t,e,s=!1,r=!1)=>{if(s===!0)return t.output;let n=e||{},o=n.contains?"":"^",i=n.contains?"":"$",a=`${o}(?:${t.output})${i}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let c=$.toRegex(a,e);return r===!0&&(c.state=t),c};$.makeRe=(t,e={},s=!1,r=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let n={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(n.output=Et.fastpaths(t,e)),n.output||(n=Et(t,e)),$.compileRe(n,e,s,r)};$.toRegex=(t,e)=>{try{let s=e||{};return new RegExp(t,s.flags||(s.nocase?"i":""))}catch(s){if(e&&e.debug===!0)throw s;return/$^/}};$.constants=yi;ks.exports=$});var yt=b((bc,Ps)=>{"use strict";Ps.exports=vs()});var Ms=b((kc,$s)=>{"use strict";var Se=L("fs"),{Readable:Ri}=L("stream"),Te=L("path"),{promisify:je}=L("util"),wt=yt(),Ai=je(Se.readdir),Ti=je(Se.stat),Ns=je(Se.lstat),Si=je(Se.realpath),Ci="!",Ds="READDIRP_RECURSIVE_ERROR",Ii=new Set(["ENOENT","EPERM","EACCES","ELOOP",Ds]),Rt="files",Fs="directories",qe="files_directories",Ge="all",Os=[Rt,Fs,qe,Ge],xi=t=>Ii.has(t.code),[Ls,bi]=process.versions.node.split(".").slice(0,2).map(t=>Number.parseInt(t,10)),ki=process.platform==="win32"&&(Ls>10||Ls===10&&bi>=5),Hs=t=>{if(t!==void 0){if(typeof t=="function")return t;if(typeof t=="string"){let e=wt(t.trim());return s=>e(s.basename)}if(Array.isArray(t)){let e=[],s=[];for(let r of t){let n=r.trim();n.charAt(0)===Ci?s.push(wt(n.slice(1))):e.push(wt(n))}return s.length>0?e.length>0?r=>e.some(n=>n(r.basename))&&!s.some(n=>n(r.basename)):r=>!s.some(n=>n(r.basename)):r=>e.some(n=>n(r.basename))}}},Ke=class t extends Ri{static get defaultOptions(){return{root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:Rt,lstat:!1,depth:2147483648,alwaysStat:!1}}constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark||4096});let s={...t.defaultOptions,...e},{root:r,type:n}=s;this._fileFilter=Hs(s.fileFilter),this._directoryFilter=Hs(s.directoryFilter);let o=s.lstat?Ns:Ti;ki?this._stat=i=>o(i,{bigint:!0}):this._stat=o,this._maxDepth=s.depth,this._wantsDir=[Fs,qe,Ge].includes(n),this._wantsFile=[Rt,qe,Ge].includes(n),this._wantsEverything=n===Ge,this._root=Te.resolve(r),this._isDirent="Dirent"in Se&&!s.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(r,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let{path:s,depth:r,files:n=[]}=this.parent||{};if(n.length>0){let o=n.splice(0,e).map(i=>this._formatEntry(i,s));for(let i of await Promise.all(o)){if(this.destroyed)return;let a=await this._getEntryType(i);a==="directory"&&this._directoryFilter(i)?(r<=this._maxDepth&&this.parents.push(this._exploreDir(i.fullPath,r+1)),this._wantsDir&&(this.push(i),e--)):(a==="file"||this._includeAsFile(i))&&this._fileFilter(i)&&this._wantsFile&&(this.push(i),e--)}}else{let o=this.parents.pop();if(!o){this.push(null);break}if(this.parent=await o,this.destroyed)return}}}catch(s){this.destroy(s)}finally{this.reading=!1}}}async _exploreDir(e,s){let r;try{r=await Ai(e,this._rdOptions)}catch(n){this._onError(n)}return{files:r,depth:s,path:e}}async _formatEntry(e,s){let r;try{let n=this._isDirent?e.name:e,o=Te.resolve(Te.join(s,n));r={path:Te.relative(this._root,o),fullPath:o,basename:n},r[this._statsProp]=this._isDirent?e:await this._stat(o)}catch(n){this._onError(n)}return r}_onError(e){xi(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}async _getEntryType(e){let s=e&&e[this._statsProp];if(s){if(s.isFile())return"file";if(s.isDirectory())return"directory";if(s&&s.isSymbolicLink()){let r=e.fullPath;try{let n=await Si(r),o=await Ns(n);if(o.isFile())return"file";if(o.isDirectory()){let i=n.length;if(r.startsWith(n)&&r.substr(i,1)===Te.sep){let a=new Error(`Circular symlink detected: "${r}" points to "${n}"`);return a.code=Ds,this._onError(a)}return"directory"}}catch(n){this._onError(n)}}}}_includeAsFile(e){let s=e&&e[this._statsProp];return s&&this._wantsEverything&&!s.isDirectory()}},Ee=(t,e={})=>{let s=e.entryType||e.type;if(s==="both"&&(s=qe),s&&(e.type=s),t){if(typeof t!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(s&&!Os.includes(s))throw new Error(`readdirp: Invalid type passed. Use one of ${Os.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=t,new Ke(e)},vi=(t,e={})=>new Promise((s,r)=>{let n=[];Ee(t,e).on("data",o=>n.push(o)).on("end",()=>s(n)).on("error",o=>r(o))});Ee.promise=vi;Ee.ReaddirpStream=Ke;Ee.default=Ee;$s.exports=Ee});var At=b((vc,Us)=>{Us.exports=function(t,e){if(typeof t!="string")throw new TypeError("expected path to be a string");if(t==="\\"||t==="/")return"/";var s=t.length;if(s<=1)return t;var r="";if(s>4&&t[3]==="\\"){var n=t[2];(n==="?"||n===".")&&t.slice(0,2)==="\\\\"&&(t=t.slice(2),r="//")}var o=t.split(/[/\\]+/);return e!==!1&&o[o.length-1]===""&&o.pop(),r+o.join("/")}});var js=b((qs,Ks)=>{"use strict";Object.defineProperty(qs,"__esModule",{value:!0});var Gs=yt(),Pi=At(),Bs="!",Ni={returnIndex:!1},Oi=t=>Array.isArray(t)?t:[t],Li=(t,e)=>{if(typeof t=="function")return t;if(typeof t=="string"){let s=Gs(t,e);return r=>t===r||s(r)}return t instanceof RegExp?s=>t.test(s):s=>!1},Ws=(t,e,s,r)=>{let n=Array.isArray(s),o=n?s[0]:s;if(!n&&typeof o!="string")throw new TypeError("anymatch: second argument must be a string: got "+Object.prototype.toString.call(o));let i=Pi(o,!1);for(let c=0;c<e.length;c++){let u=e[c];if(u(i))return r?-1:!1}let a=n&&[i].concat(s.slice(1));for(let c=0;c<t.length;c++){let u=t[c];if(n?u(...a):u(i))return r?c:!0}return r?-1:!1},Tt=(t,e,s=Ni)=>{if(t==null)throw new TypeError("anymatch: specify first argument");let r=typeof s=="boolean"?{returnIndex:s}:s,n=r.returnIndex||!1,o=Oi(t),i=o.filter(c=>typeof c=="string"&&c.charAt(0)===Bs).map(c=>c.slice(1)).map(c=>Gs(c,r)),a=o.filter(c=>typeof c!="string"||typeof c=="string"&&c.charAt(0)!==Bs).map(c=>Li(c,r));return e==null?(c,u=!1)=>Ws(a,i,c,typeof u=="boolean"?u:!1):Ws(a,i,e,n)};Tt.default=Tt;Ks.exports=Tt});var Ys=b((Pc,Vs)=>{Vs.exports=function(e){if(typeof e!="string"||e==="")return!1;for(var s;s=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(s[2])return!0;e=e.slice(s.index+s[0].length)}return!1}});var St=b((Nc,Xs)=>{var Hi=Ys(),zs={"{":"}","(":")","[":"]"},Di=function(t){if(t[0]==="!")return!0;for(var e=0,s=-2,r=-2,n=-2,o=-2,i=-2;e<t.length;){if(t[e]==="*"||t[e+1]==="?"&&/[\].+)]/.test(t[e])||r!==-1&&t[e]==="["&&t[e+1]!=="]"&&(r<e&&(r=t.indexOf("]",e)),r>e&&(i===-1||i>r||(i=t.indexOf("\\",e),i===-1||i>r)))||n!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(n=t.indexOf("}",e),n>e&&(i=t.indexOf("\\",e),i===-1||i>n))||o!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(o=t.indexOf(")",e),o>e&&(i=t.indexOf("\\",e),i===-1||i>o))||s!==-1&&t[e]==="("&&t[e+1]!=="|"&&(s<e&&(s=t.indexOf("|",e)),s!==-1&&t[s+1]!==")"&&(o=t.indexOf(")",s),o>s&&(i=t.indexOf("\\",s),i===-1||i>o))))return!0;if(t[e]==="\\"){var a=t[e+1];e+=2;var c=zs[a];if(c){var u=t.indexOf(c,e);u!==-1&&(e=u+1)}if(t[e]==="!")return!0}else e++}return!1},Fi=function(t){if(t[0]==="!")return!0;for(var e=0;e<t.length;){if(/[*?{}()[\]]/.test(t[e]))return!0;if(t[e]==="\\"){var s=t[e+1];e+=2;var r=zs[s];if(r){var n=t.indexOf(r,e);n!==-1&&(e=n+1)}if(t[e]==="!")return!0}else e++}return!1};Xs.exports=function(e,s){if(typeof e!="string"||e==="")return!1;if(Hi(e))return!0;var r=Di;return s&&s.strict===!1&&(r=Fi),r(e)}});var Zs=b((Oc,Qs)=>{"use strict";var $i=St(),Mi=L("path").posix.dirname,Ui=L("os").platform()==="win32",Ct="/",Bi=/\\/g,Wi=/[\{\[].*[\}\]]$/,Gi=/(^|[^\\])([\{\[]|\([^\)]+$)/,qi=/\\([\!\*\?\|\[\]\(\)\{\}])/g;Qs.exports=function(e,s){var r=Object.assign({flipBackslashes:!0},s);r.flipBackslashes&&Ui&&e.indexOf(Ct)<0&&(e=e.replace(Bi,Ct)),Wi.test(e)&&(e+=Ct),e+="a";do e=Mi(e);while($i(e)||Gi.test(e));return e.replace(qi,"$1")}});var Ve=b(Z=>{"use strict";Z.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1;Z.find=(t,e)=>t.nodes.find(s=>s.type===e);Z.exceedsLimit=(t,e,s=1,r)=>r===!1||!Z.isInteger(t)||!Z.isInteger(e)?!1:(Number(e)-Number(t))/Number(s)>=r;Z.escapeNode=(t,e=0,s)=>{let r=t.nodes[e];r&&(s&&r.type===s||r.type==="open"||r.type==="close")&&r.escaped!==!0&&(r.value="\\"+r.value,r.escaped=!0)};Z.encloseBrace=t=>t.type!=="brace"||t.commas>>0+t.ranges>>0?!1:(t.invalid=!0,!0);Z.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:!(t.commas>>0+t.ranges>>0)||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1;Z.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0;Z.reduce=t=>t.reduce((e,s)=>(s.type==="text"&&e.push(s.value),s.type==="range"&&(s.type="text"),e),[]);Z.flatten=(...t)=>{let e=[],s=r=>{for(let n=0;n<r.length;n++){let o=r[n];if(Array.isArray(o)){s(o);continue}o!==void 0&&e.push(o)}return e};return s(t),e}});var Ye=b((Hc,er)=>{"use strict";var Js=Ve();er.exports=(t,e={})=>{let s=(r,n={})=>{let o=e.escapeInvalid&&Js.isInvalidBrace(n),i=r.invalid===!0&&e.escapeInvalid===!0,a="";if(r.value)return(o||i)&&Js.isOpenOrClose(r)?"\\"+r.value:r.value;if(r.value)return r.value;if(r.nodes)for(let c of r.nodes)a+=s(c);return a};return s(t)}});var sr=b((Dc,tr)=>{"use strict";tr.exports=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1}});var fr=b((Fc,ur)=>{"use strict";var rr=sr(),ue=(t,e,s)=>{if(rr(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(rr(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let r={relaxZeros:!0,...s};typeof r.strictZeros=="boolean"&&(r.relaxZeros=r.strictZeros===!1);let n=String(r.relaxZeros),o=String(r.shorthand),i=String(r.capture),a=String(r.wrap),c=t+":"+e+"="+n+o+i+a;if(ue.cache.hasOwnProperty(c))return ue.cache[c].result;let u=Math.min(t,e),f=Math.max(t,e);if(Math.abs(u-f)===1){let w=t+"|"+e;return r.capture?`(${w})`:r.wrap===!1?w:`(?:${w})`}let d=lr(t)||lr(e),l={min:t,max:e,a:u,b:f},m=[],E=[];if(d&&(l.isPadded=d,l.maxLen=String(l.max).length),u<0){let w=f<0?Math.abs(f):1;E=nr(w,Math.abs(u),l,r),u=l.a=0}return f>=0&&(m=nr(u,f,l,r)),l.negatives=E,l.positives=m,l.result=Ki(E,m,r),r.capture===!0?l.result=`(${l.result})`:r.wrap!==!1&&m.length+E.length>1&&(l.result=`(?:${l.result})`),ue.cache[c]=l,l.result};function Ki(t,e,s){let r=It(t,e,"-",!1,s)||[],n=It(e,t,"",!1,s)||[],o=It(t,e,"-?",!0,s)||[];return r.concat(o).concat(n).join("|")}function ji(t,e){let s=1,r=1,n=or(t,s),o=new Set([e]);for(;t<=n&&n<=e;)o.add(n),s+=1,n=or(t,s);for(n=ar(e+1,r)-1;t<n&&n<=e;)o.add(n),r+=1,n=ar(e+1,r)-1;return o=[...o],o.sort(zi),o}function Vi(t,e,s){if(t===e)return{pattern:t,count:[],digits:0};let r=Yi(t,e),n=r.length,o="",i=0;for(let a=0;a<n;a++){let[c,u]=r[a];c===u?o+=c:c!=="0"||u!=="9"?o+=Xi(c,u,s):i++}return i&&(o+=s.shorthand===!0?"\\d":"[0-9]"),{pattern:o,count:[i],digits:n}}function nr(t,e,s,r){let n=ji(t,e),o=[],i=t,a;for(let c=0;c<n.length;c++){let u=n[c],f=Vi(String(i),String(u),r),d="";if(!s.isPadded&&a&&a.pattern===f.pattern){a.count.length>1&&a.count.pop(),a.count.push(f.count[0]),a.string=a.pattern+cr(a.count),i=u+1;continue}s.isPadded&&(d=Qi(u,s,r)),f.string=d+f.pattern+cr(f.count),o.push(f),i=u+1,a=f}return o}function It(t,e,s,r,n){let o=[];for(let i of t){let{string:a}=i;!r&&!ir(e,"string",a)&&o.push(s+a),r&&ir(e,"string",a)&&o.push(s+a)}return o}function Yi(t,e){let s=[];for(let r=0;r<t.length;r++)s.push([t[r],e[r]]);return s}function zi(t,e){return t>e?1:e>t?-1:0}function ir(t,e,s){return t.some(r=>r[e]===s)}function or(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function ar(t,e){return t-t%Math.pow(10,e)}function cr(t){let[e=0,s=""]=t;return s||e>1?`{${e+(s?","+s:"")}}`:""}function Xi(t,e,s){return`[${t}${e-t===1?"":"-"}${e}]`}function lr(t){return/^-?(0+)\d/.test(t)}function Qi(t,e,s){if(!e.isPadded)return t;let r=Math.abs(e.maxLen-String(t).length),n=s.relaxZeros!==!1;switch(r){case 0:return"";case 1:return n?"0?":"0";case 2:return n?"0{0,2}":"00";default:return n?`0{0,${r}}`:`0{${r}}`}}ue.cache={};ue.clearCache=()=>ue.cache={};ur.exports=ue});var kt=b(($c,mr)=>{"use strict";var Zi=L("util"),hr=fr(),dr=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),Ji=t=>e=>t===!0?Number(e):String(e),xt=t=>typeof t=="number"||typeof t=="string"&&t!=="",Ce=t=>Number.isInteger(+t),bt=t=>{let e=`${t}`,s=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++s]==="0";);return s>0},eo=(t,e,s)=>typeof t=="string"||typeof e=="string"?!0:s.stringify===!0,to=(t,e,s)=>{if(e>0){let r=t[0]==="-"?"-":"";r&&(t=t.slice(1)),t=r+t.padStart(r?e-1:e,"0")}return s===!1?String(t):t},Xe=(t,e)=>{let s=t[0]==="-"?"-":"";for(s&&(t=t.slice(1),e--);t.length<e;)t="0"+t;return s?"-"+t:t},so=(t,e,s)=>{t.negatives.sort((a,c)=>a<c?-1:a>c?1:0),t.positives.sort((a,c)=>a<c?-1:a>c?1:0);let r=e.capture?"":"?:",n="",o="",i;return t.positives.length&&(n=t.positives.map(a=>Xe(String(a),s)).join("|")),t.negatives.length&&(o=`-(${r}${t.negatives.map(a=>Xe(String(a),s)).join("|")})`),n&&o?i=`${n}|${o}`:i=n||o,e.wrap?`(${r}${i})`:i},pr=(t,e,s,r)=>{if(s)return hr(t,e,{wrap:!1,...r});let n=String.fromCharCode(t);if(t===e)return n;let o=String.fromCharCode(e);return`[${n}-${o}]`},_r=(t,e,s)=>{if(Array.isArray(t)){let r=s.wrap===!0,n=s.capture?"":"?:";return r?`(${n}${t.join("|")})`:t.join("|")}return hr(t,e,s)},gr=(...t)=>new RangeError("Invalid range arguments: "+Zi.inspect(...t)),Er=(t,e,s)=>{if(s.strictRanges===!0)throw gr([t,e]);return[]},ro=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return[]},no=(t,e,s=1,r={})=>{let n=Number(t),o=Number(e);if(!Number.isInteger(n)||!Number.isInteger(o)){if(r.strictRanges===!0)throw gr([t,e]);return[]}n===0&&(n=0),o===0&&(o=0);let i=n>o,a=String(t),c=String(e),u=String(s);s=Math.max(Math.abs(s),1);let f=bt(a)||bt(c)||bt(u),d=f?Math.max(a.length,c.length,u.length):0,l=f===!1&&eo(t,e,r)===!1,m=r.transform||Ji(l);if(r.toRegex&&s===1)return pr(Xe(t,d),Xe(e,d),!0,r);let E={negatives:[],positives:[]},w=V=>E[V<0?"negatives":"positives"].push(Math.abs(V)),v=[],D=0;for(;i?n>=o:n<=o;)r.toRegex===!0&&s>1?w(n):v.push(to(m(n,D),d,l)),n=i?n-s:n+s,D++;return r.toRegex===!0?s>1?so(E,r,d):_r(v,null,{wrap:!1,...r}):v},io=(t,e,s=1,r={})=>{if(!Ce(t)&&t.length>1||!Ce(e)&&e.length>1)return Er(t,e,r);let n=r.transform||(l=>String.fromCharCode(l)),o=`${t}`.charCodeAt(0),i=`${e}`.charCodeAt(0),a=o>i,c=Math.min(o,i),u=Math.max(o,i);if(r.toRegex&&s===1)return pr(c,u,!1,r);let f=[],d=0;for(;a?o>=i:o<=i;)f.push(n(o,d)),o=a?o-s:o+s,d++;return r.toRegex===!0?_r(f,null,{wrap:!1,options:r}):f},ze=(t,e,s,r={})=>{if(e==null&&xt(t))return[t];if(!xt(t)||!xt(e))return Er(t,e,r);if(typeof s=="function")return ze(t,e,1,{transform:s});if(dr(s))return ze(t,e,0,s);let n={...r};return n.capture===!0&&(n.wrap=!0),s=s||n.step||1,Ce(s)?Ce(t)&&Ce(e)?no(t,e,s,n):io(t,e,Math.max(Math.abs(s),1),n):s!=null&&!dr(s)?ro(s,n):ze(t,e,1,s)};mr.exports=ze});var Rr=b((Mc,wr)=>{"use strict";var oo=kt(),yr=Ve(),ao=(t,e={})=>{let s=(r,n={})=>{let o=yr.isInvalidBrace(n),i=r.invalid===!0&&e.escapeInvalid===!0,a=o===!0||i===!0,c=e.escapeInvalid===!0?"\\":"",u="";if(r.isOpen===!0)return c+r.value;if(r.isClose===!0)return console.log("node.isClose",c,r.value),c+r.value;if(r.type==="open")return a?c+r.value:"(";if(r.type==="close")return a?c+r.value:")";if(r.type==="comma")return r.prev.type==="comma"?"":a?r.value:"|";if(r.value)return r.value;if(r.nodes&&r.ranges>0){let f=yr.reduce(r.nodes),d=oo(...f,{...e,wrap:!1,toRegex:!0,strictZeros:!0});if(d.length!==0)return f.length>1&&d.length>1?`(${d})`:d}if(r.nodes)for(let f of r.nodes)u+=s(f,r);return u};return s(t)};wr.exports=ao});var Sr=b((Uc,Tr)=>{"use strict";var co=kt(),Ar=Ye(),me=Ve(),fe=(t="",e="",s=!1)=>{let r=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return s?me.flatten(e).map(n=>`{${n}}`):e;for(let n of t)if(Array.isArray(n))for(let o of n)r.push(fe(o,e,s));else for(let o of e)s===!0&&typeof o=="string"&&(o=`{${o}}`),r.push(Array.isArray(o)?fe(n,o,s):n+o);return me.flatten(r)},lo=(t,e={})=>{let s=e.rangeLimit===void 0?1e3:e.rangeLimit,r=(n,o={})=>{n.queue=[];let i=o,a=o.queue;for(;i.type!=="brace"&&i.type!=="root"&&i.parent;)i=i.parent,a=i.queue;if(n.invalid||n.dollar){a.push(fe(a.pop(),Ar(n,e)));return}if(n.type==="brace"&&n.invalid!==!0&&n.nodes.length===2){a.push(fe(a.pop(),["{}"]));return}if(n.nodes&&n.ranges>0){let d=me.reduce(n.nodes);if(me.exceedsLimit(...d,e.step,s))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let l=co(...d,e);l.length===0&&(l=Ar(n,e)),a.push(fe(a.pop(),l)),n.nodes=[];return}let c=me.encloseBrace(n),u=n.queue,f=n;for(;f.type!=="brace"&&f.type!=="root"&&f.parent;)f=f.parent,u=f.queue;for(let d=0;d<n.nodes.length;d++){let l=n.nodes[d];if(l.type==="comma"&&n.type==="brace"){d===1&&u.push(""),u.push("");continue}if(l.type==="close"){a.push(fe(a.pop(),u,c));continue}if(l.value&&l.type!=="open"){u.push(fe(u.pop(),l.value));continue}l.nodes&&r(l,n)}return u};return me.flatten(r(t))};Tr.exports=lo});var Ir=b((Bc,Cr)=>{"use strict";Cr.exports={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:`
2
- `,CHAR_NO_BREAK_SPACE:"\xA0",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:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var Pr=b((Wc,vr)=>{"use strict";var uo=Ye(),{MAX_LENGTH:xr,CHAR_BACKSLASH:vt,CHAR_BACKTICK:fo,CHAR_COMMA:ho,CHAR_DOT:po,CHAR_LEFT_PARENTHESES:_o,CHAR_RIGHT_PARENTHESES:go,CHAR_LEFT_CURLY_BRACE:Eo,CHAR_RIGHT_CURLY_BRACE:mo,CHAR_LEFT_SQUARE_BRACKET:br,CHAR_RIGHT_SQUARE_BRACKET:kr,CHAR_DOUBLE_QUOTE:yo,CHAR_SINGLE_QUOTE:wo,CHAR_NO_BREAK_SPACE:Ro,CHAR_ZERO_WIDTH_NOBREAK_SPACE:Ao}=Ir(),To=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let s=e||{},r=typeof s.maxLength=="number"?Math.min(xr,s.maxLength):xr;if(t.length>r)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${r})`);let n={type:"root",input:t,nodes:[]},o=[n],i=n,a=n,c=0,u=t.length,f=0,d=0,l,m=()=>t[f++],E=w=>{if(w.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&w.type==="text"){a.value+=w.value;return}return i.nodes.push(w),w.parent=i,w.prev=a,a=w,w};for(E({type:"bos"});f<u;)if(i=o[o.length-1],l=m(),!(l===Ao||l===Ro)){if(l===vt){E({type:"text",value:(e.keepEscaping?l:"")+m()});continue}if(l===kr){E({type:"text",value:"\\"+l});continue}if(l===br){c++;let w;for(;f<u&&(w=m());){if(l+=w,w===br){c++;continue}if(w===vt){l+=m();continue}if(w===kr&&(c--,c===0))break}E({type:"text",value:l});continue}if(l===_o){i=E({type:"paren",nodes:[]}),o.push(i),E({type:"text",value:l});continue}if(l===go){if(i.type!=="paren"){E({type:"text",value:l});continue}i=o.pop(),E({type:"text",value:l}),i=o[o.length-1];continue}if(l===yo||l===wo||l===fo){let w=l,v;for(e.keepQuotes!==!0&&(l="");f<u&&(v=m());){if(v===vt){l+=v+m();continue}if(v===w){e.keepQuotes===!0&&(l+=v);break}l+=v}E({type:"text",value:l});continue}if(l===Eo){d++;let v={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||i.dollar===!0,depth:d,commas:0,ranges:0,nodes:[]};i=E(v),o.push(i),E({type:"open",value:l});continue}if(l===mo){if(i.type!=="brace"){E({type:"text",value:l});continue}let w="close";i=o.pop(),i.close=!0,E({type:w,value:l}),d--,i=o[o.length-1];continue}if(l===ho&&d>0){if(i.ranges>0){i.ranges=0;let w=i.nodes.shift();i.nodes=[w,{type:"text",value:uo(i)}]}E({type:"comma",value:l}),i.commas++;continue}if(l===po&&d>0&&i.commas===0){let w=i.nodes;if(d===0||w.length===0){E({type:"text",value:l});continue}if(a.type==="dot"){if(i.range=[],a.value+=l,a.type="range",i.nodes.length!==3&&i.nodes.length!==5){i.invalid=!0,i.ranges=0,a.type="text";continue}i.ranges++,i.args=[];continue}if(a.type==="range"){w.pop();let v=w[w.length-1];v.value+=a.value+l,a=v,i.ranges--;continue}E({type:"dot",value:l});continue}E({type:"text",value:l})}do if(i=o.pop(),i.type!=="root"){i.nodes.forEach(D=>{D.nodes||(D.type==="open"&&(D.isOpen=!0),D.type==="close"&&(D.isClose=!0),D.nodes||(D.type="text"),D.invalid=!0)});let w=o[o.length-1],v=w.nodes.indexOf(i);w.nodes.splice(v,1,...i.nodes)}while(o.length>0);return E({type:"eos"}),n};vr.exports=To});var Lr=b((Gc,Or)=>{"use strict";var Nr=Ye(),So=Rr(),Co=Sr(),Io=Pr(),Q=(t,e={})=>{let s=[];if(Array.isArray(t))for(let r of t){let n=Q.create(r,e);Array.isArray(n)?s.push(...n):s.push(n)}else s=[].concat(Q.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(s=[...new Set(s)]),s};Q.parse=(t,e={})=>Io(t,e);Q.stringify=(t,e={})=>Nr(typeof t=="string"?Q.parse(t,e):t,e);Q.compile=(t,e={})=>(typeof t=="string"&&(t=Q.parse(t,e)),So(t,e));Q.expand=(t,e={})=>{typeof t=="string"&&(t=Q.parse(t,e));let s=Co(t,e);return e.noempty===!0&&(s=s.filter(Boolean)),e.nodupes===!0&&(s=[...new Set(s)]),s};Q.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?Q.compile(t,e):Q.expand(t,e);Or.exports=Q});var Hr=b((qc,xo)=>{xo.exports=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]});var Fr=b((Kc,Dr)=>{Dr.exports=Hr()});var Mr=b((jc,$r)=>{"use strict";var bo=L("path"),ko=Fr(),vo=new Set(ko);$r.exports=t=>vo.has(bo.extname(t).slice(1).toLowerCase())});var Qe=b(R=>{"use strict";var{sep:Po}=L("path"),{platform:Pt}=process,No=L("os");R.EV_ALL="all";R.EV_READY="ready";R.EV_ADD="add";R.EV_CHANGE="change";R.EV_ADD_DIR="addDir";R.EV_UNLINK="unlink";R.EV_UNLINK_DIR="unlinkDir";R.EV_RAW="raw";R.EV_ERROR="error";R.STR_DATA="data";R.STR_END="end";R.STR_CLOSE="close";R.FSEVENT_CREATED="created";R.FSEVENT_MODIFIED="modified";R.FSEVENT_DELETED="deleted";R.FSEVENT_MOVED="moved";R.FSEVENT_CLONED="cloned";R.FSEVENT_UNKNOWN="unknown";R.FSEVENT_FLAG_MUST_SCAN_SUBDIRS=1;R.FSEVENT_TYPE_FILE="file";R.FSEVENT_TYPE_DIRECTORY="directory";R.FSEVENT_TYPE_SYMLINK="symlink";R.KEY_LISTENERS="listeners";R.KEY_ERR="errHandlers";R.KEY_RAW="rawEmitters";R.HANDLER_KEYS=[R.KEY_LISTENERS,R.KEY_ERR,R.KEY_RAW];R.DOT_SLASH=`.${Po}`;R.BACK_SLASH_RE=/\\/g;R.DOUBLE_SLASH_RE=/\/\//;R.SLASH_OR_BACK_SLASH_RE=/[/\\]/;R.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/;R.REPLACER_RE=/^\.[/\\]/;R.SLASH="/";R.SLASH_SLASH="//";R.BRACE_START="{";R.BANG="!";R.ONE_DOT=".";R.TWO_DOTS="..";R.STAR="*";R.GLOBSTAR="**";R.ROOT_GLOBSTAR="/**/*";R.SLASH_GLOBSTAR="/**";R.DIR_SUFFIX="Dir";R.ANYMATCH_OPTS={dot:!0};R.STRING_TYPE="string";R.FUNCTION_TYPE="function";R.EMPTY_STR="";R.EMPTY_FN=()=>{};R.IDENTITY_FN=t=>t;R.isWindows=Pt==="win32";R.isMacos=Pt==="darwin";R.isLinux=Pt==="linux";R.isIBMi=No.type()==="OS400"});var Kr=b((Yc,qr)=>{"use strict";var ie=L("fs"),U=L("path"),{promisify:ke}=L("util"),Oo=Mr(),{isWindows:Lo,isLinux:Ho,EMPTY_FN:Do,EMPTY_STR:Fo,KEY_LISTENERS:ye,KEY_ERR:Nt,KEY_RAW:Ie,HANDLER_KEYS:$o,EV_CHANGE:Je,EV_ADD:Ze,EV_ADD_DIR:Mo,EV_ERROR:Br,STR_DATA:Uo,STR_END:Bo,BRACE_START:Wo,STAR:Go}=Qe(),qo="watch",Ko=ke(ie.open),Wr=ke(ie.stat),jo=ke(ie.lstat),Vo=ke(ie.close),Ot=ke(ie.realpath),Yo={lstat:jo,stat:Wr},Ht=(t,e)=>{t instanceof Set?t.forEach(e):e(t)},xe=(t,e,s)=>{let r=t[e];r instanceof Set||(t[e]=r=new Set([r])),r.add(s)},zo=t=>e=>{let s=t[e];s instanceof Set?s.clear():delete t[e]},be=(t,e,s)=>{let r=t[e];r instanceof Set?r.delete(s):r===s&&delete t[e]},Gr=t=>t instanceof Set?t.size===0:!t,et=new Map;function Ur(t,e,s,r,n){let o=(i,a)=>{s(t),n(i,a,{watchedPath:t}),a&&t!==a&&tt(U.resolve(t,a),ye,U.join(t,a))};try{return ie.watch(t,e,o)}catch(i){r(i)}}var tt=(t,e,s,r,n)=>{let o=et.get(t);o&&Ht(o[e],i=>{i(s,r,n)})},Xo=(t,e,s,r)=>{let{listener:n,errHandler:o,rawEmitter:i}=r,a=et.get(e),c;if(!s.persistent)return c=Ur(t,s,n,o,i),c.close.bind(c);if(a)xe(a,ye,n),xe(a,Nt,o),xe(a,Ie,i);else{if(c=Ur(t,s,tt.bind(null,e,ye),o,tt.bind(null,e,Ie)),!c)return;c.on(Br,async u=>{let f=tt.bind(null,e,Nt);if(a.watcherUnusable=!0,Lo&&u.code==="EPERM")try{let d=await Ko(t,"r");await Vo(d),f(u)}catch{}else f(u)}),a={listeners:n,errHandlers:o,rawEmitters:i,watcher:c},et.set(e,a)}return()=>{be(a,ye,n),be(a,Nt,o),be(a,Ie,i),Gr(a.listeners)&&(a.watcher.close(),et.delete(e),$o.forEach(zo(a)),a.watcher=void 0,Object.freeze(a))}},Lt=new Map,Qo=(t,e,s,r)=>{let{listener:n,rawEmitter:o}=r,i=Lt.get(e),a=new Set,c=new Set,u=i&&i.options;return u&&(u.persistent<s.persistent||u.interval>s.interval)&&(a=i.listeners,c=i.rawEmitters,ie.unwatchFile(e),i=void 0),i?(xe(i,ye,n),xe(i,Ie,o)):(i={listeners:n,rawEmitters:o,options:s,watcher:ie.watchFile(e,s,(f,d)=>{Ht(i.rawEmitters,m=>{m(Je,e,{curr:f,prev:d})});let l=f.mtimeMs;(f.size!==d.size||l>d.mtimeMs||l===0)&&Ht(i.listeners,m=>m(t,f))})},Lt.set(e,i)),()=>{be(i,ye,n),be(i,Ie,o),Gr(i.listeners)&&(Lt.delete(e),ie.unwatchFile(e),i.options=i.watcher=void 0,Object.freeze(i))}},Dt=class{constructor(e){this.fsw=e,this._boundHandleError=s=>e._handleError(s)}_watchWithNodeFs(e,s){let r=this.fsw.options,n=U.dirname(e),o=U.basename(e);this.fsw._getWatchedDir(n).add(o);let a=U.resolve(e),c={persistent:r.persistent};s||(s=Do);let u;return r.usePolling?(c.interval=r.enableBinaryInterval&&Oo(o)?r.binaryInterval:r.interval,u=Qo(e,a,c,{listener:s,rawEmitter:this.fsw._emitRaw})):u=Xo(e,a,c,{listener:s,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),u}_handleFile(e,s,r){if(this.fsw.closed)return;let n=U.dirname(e),o=U.basename(e),i=this.fsw._getWatchedDir(n),a=s;if(i.has(o))return;let c=async(f,d)=>{if(this.fsw._throttle(qo,e,5)){if(!d||d.mtimeMs===0)try{let l=await Wr(e);if(this.fsw.closed)return;let m=l.atimeMs,E=l.mtimeMs;(!m||m<=E||E!==a.mtimeMs)&&this.fsw._emit(Je,e,l),Ho&&a.ino!==l.ino?(this.fsw._closeFile(f),a=l,this.fsw._addPathCloser(f,this._watchWithNodeFs(e,c))):a=l}catch{this.fsw._remove(n,o)}else if(i.has(o)){let l=d.atimeMs,m=d.mtimeMs;(!l||l<=m||m!==a.mtimeMs)&&this.fsw._emit(Je,e,d),a=d}}},u=this._watchWithNodeFs(e,c);if(!(r&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(Ze,e,0))return;this.fsw._emit(Ze,e,s)}return u}async _handleSymlink(e,s,r,n){if(this.fsw.closed)return;let o=e.fullPath,i=this.fsw._getWatchedDir(s);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let a;try{a=await Ot(r)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(i.has(n)?this.fsw._symlinkPaths.get(o)!==a&&(this.fsw._symlinkPaths.set(o,a),this.fsw._emit(Je,r,e.stats)):(i.add(n),this.fsw._symlinkPaths.set(o,a),this.fsw._emit(Ze,r,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(o))return!0;this.fsw._symlinkPaths.set(o,!0)}_handleRead(e,s,r,n,o,i,a){if(e=U.join(e,Fo),!r.hasGlob&&(a=this.fsw._throttle("readdir",e,1e3),!a))return;let c=this.fsw._getWatchedDir(r.path),u=new Set,f=this.fsw._readdirp(e,{fileFilter:d=>r.filterPath(d),directoryFilter:d=>r.filterDir(d),depth:0}).on(Uo,async d=>{if(this.fsw.closed){f=void 0;return}let l=d.path,m=U.join(e,l);if(u.add(l),!(d.stats.isSymbolicLink()&&await this._handleSymlink(d,e,m,l))){if(this.fsw.closed){f=void 0;return}(l===n||!n&&!c.has(l))&&(this.fsw._incrReadyCount(),m=U.join(o,U.relative(o,m)),this._addToNodeFs(m,s,r,i+1))}}).on(Br,this._boundHandleError);return new Promise(d=>f.once(Bo,()=>{if(this.fsw.closed){f=void 0;return}let l=a?a.clear():!1;d(),c.getChildren().filter(m=>m!==e&&!u.has(m)&&(!r.hasGlob||r.filterPath({fullPath:U.resolve(e,m)}))).forEach(m=>{this.fsw._remove(e,m)}),f=void 0,l&&this._handleRead(e,!1,r,n,o,i,a)}))}async _handleDir(e,s,r,n,o,i,a){let c=this.fsw._getWatchedDir(U.dirname(e)),u=c.has(U.basename(e));!(r&&this.fsw.options.ignoreInitial)&&!o&&!u&&(!i.hasGlob||i.globFilter(e))&&this.fsw._emit(Mo,e,s),c.add(U.basename(e)),this.fsw._getWatchedDir(e);let f,d,l=this.fsw.options.depth;if((l==null||n<=l)&&!this.fsw._symlinkPaths.has(a)){if(!o&&(await this._handleRead(e,r,i,o,e,n,f),this.fsw.closed))return;d=this._watchWithNodeFs(e,(m,E)=>{E&&E.mtimeMs===0||this._handleRead(m,!1,i,o,e,n,f)})}return d}async _addToNodeFs(e,s,r,n,o){let i=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return i(),!1;let a=this.fsw._getWatchHelpers(e,n);!a.hasGlob&&r&&(a.hasGlob=r.hasGlob,a.globFilter=r.globFilter,a.filterPath=c=>r.filterPath(c),a.filterDir=c=>r.filterDir(c));try{let c=await Yo[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))return i(),!1;let u=this.fsw.options.followSymlinks&&!e.includes(Go)&&!e.includes(Wo),f;if(c.isDirectory()){let d=U.resolve(e),l=u?await Ot(e):e;if(this.fsw.closed||(f=await this._handleDir(a.watchPath,c,s,n,o,a,l),this.fsw.closed))return;d!==l&&l!==void 0&&this.fsw._symlinkPaths.set(d,l)}else if(c.isSymbolicLink()){let d=u?await Ot(e):e;if(this.fsw.closed)return;let l=U.dirname(a.watchPath);if(this.fsw._getWatchedDir(l).add(a.watchPath),this.fsw._emit(Ze,a.watchPath,c),f=await this._handleDir(l,c,s,n,e,a,d),this.fsw.closed)return;d!==void 0&&this.fsw._symlinkPaths.set(U.resolve(e),d)}else f=this._handleFile(a.watchPath,c,s);return i(),this.fsw._addPathCloser(e,f),!1}catch(c){if(this.fsw._handleError(c))return i(),e}}};qr.exports=Dt});var Zr=b((zc,qt)=>{"use strict";var Wt=L("fs"),B=L("path"),{promisify:Gt}=L("util"),we;try{we=L("fsevents")}catch(t){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(t)}if(we){let t=process.version.match(/v(\d+)\.(\d+)/);if(t&&t[1]&&t[2]){let e=Number.parseInt(t[1],10),s=Number.parseInt(t[2],10);e===8&&s<16&&(we=void 0)}}var{EV_ADD:Ft,EV_CHANGE:Zo,EV_ADD_DIR:jr,EV_UNLINK:st,EV_ERROR:Jo,STR_DATA:ea,STR_END:ta,FSEVENT_CREATED:sa,FSEVENT_MODIFIED:ra,FSEVENT_DELETED:na,FSEVENT_MOVED:ia,FSEVENT_UNKNOWN:oa,FSEVENT_FLAG_MUST_SCAN_SUBDIRS:aa,FSEVENT_TYPE_FILE:ca,FSEVENT_TYPE_DIRECTORY:ve,FSEVENT_TYPE_SYMLINK:Qr,ROOT_GLOBSTAR:Vr,DIR_SUFFIX:la,DOT_SLASH:Yr,FUNCTION_TYPE:$t,EMPTY_FN:ua,IDENTITY_FN:fa}=Qe(),da=t=>isNaN(t)?{}:{depth:t},Ut=Gt(Wt.stat),ha=Gt(Wt.lstat),zr=Gt(Wt.realpath),pa={stat:Ut,lstat:ha},de=new Map,_a=10,ga=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),Ea=(t,e)=>({stop:we.watch(t,e)});function ma(t,e,s,r){let n=B.extname(e)?B.dirname(e):e,o=B.dirname(n),i=de.get(n);ya(o)&&(n=o);let a=B.resolve(t),c=a!==e,u=(d,l,m)=>{c&&(d=d.replace(e,a)),(d===a||!d.indexOf(a+B.sep))&&s(d,l,m)},f=!1;for(let d of de.keys())if(e.indexOf(B.resolve(d)+B.sep)===0){n=d,i=de.get(n),f=!0;break}return i||f?i.listeners.add(u):(i={listeners:new Set([u]),rawEmitter:r,watcher:Ea(n,(d,l)=>{if(!i.listeners.size||l&aa)return;let m=we.getInfo(d,l);i.listeners.forEach(E=>{E(d,l,m)}),i.rawEmitter(m.event,d,m)})},de.set(n,i)),()=>{let d=i.listeners;if(d.delete(u),!d.size&&(de.delete(n),i.watcher))return i.watcher.stop().then(()=>{i.rawEmitter=i.watcher=void 0,Object.freeze(i)})}}var ya=t=>{let e=0;for(let s of de.keys())if(s.indexOf(t)===0&&(e++,e>=_a))return!0;return!1},wa=()=>we&&de.size<128,Mt=(t,e)=>{let s=0;for(;!t.indexOf(e)&&(t=B.dirname(t))!==e;)s++;return s},Xr=(t,e)=>t.type===ve&&e.isDirectory()||t.type===Qr&&e.isSymbolicLink()||t.type===ca&&e.isFile(),Bt=class{constructor(e){this.fsw=e}checkIgnored(e,s){let r=this.fsw._ignoredPaths;if(this.fsw._isIgnored(e,s))return r.add(e),s&&s.isDirectory()&&r.add(e+Vr),!0;r.delete(e),r.delete(e+Vr)}addOrChange(e,s,r,n,o,i,a,c){let u=o.has(i)?Zo:Ft;this.handleEvent(u,e,s,r,n,o,i,a,c)}async checkExists(e,s,r,n,o,i,a,c){try{let u=await Ut(e);if(this.fsw.closed)return;Xr(a,u)?this.addOrChange(e,s,r,n,o,i,a,c):this.handleEvent(st,e,s,r,n,o,i,a,c)}catch(u){u.code==="EACCES"?this.addOrChange(e,s,r,n,o,i,a,c):this.handleEvent(st,e,s,r,n,o,i,a,c)}}handleEvent(e,s,r,n,o,i,a,c,u){if(!(this.fsw.closed||this.checkIgnored(s)))if(e===st){let f=c.type===ve;(f||i.has(a))&&this.fsw._remove(o,a,f)}else{if(e===Ft){if(c.type===ve&&this.fsw._getWatchedDir(s),c.type===Qr&&u.followSymlinks){let d=u.depth===void 0?void 0:Mt(r,n)+1;return this._addToFsEvents(s,!1,!0,d)}this.fsw._getWatchedDir(o).add(a)}let f=c.type===ve?e+la:e;this.fsw._emit(f,s),f===jr&&this._addToFsEvents(s,!1,!0)}}_watchWithFsEvents(e,s,r,n){if(this.fsw.closed||this.fsw._isIgnored(e))return;let o=this.fsw.options,a=ma(e,s,async(c,u,f)=>{if(this.fsw.closed||o.depth!==void 0&&Mt(c,s)>o.depth)return;let d=r(B.join(e,B.relative(e,c)));if(n&&!n(d))return;let l=B.dirname(d),m=B.basename(d),E=this.fsw._getWatchedDir(f.type===ve?d:l);if(ga.has(u)||f.event===oa)if(typeof o.ignored===$t){let w;try{w=await Ut(d)}catch{}if(this.fsw.closed||this.checkIgnored(d,w))return;Xr(f,w)?this.addOrChange(d,c,s,l,E,m,f,o):this.handleEvent(st,d,c,s,l,E,m,f,o)}else this.checkExists(d,c,s,l,E,m,f,o);else switch(f.event){case sa:case ra:return this.addOrChange(d,c,s,l,E,m,f,o);case na:case ia:return this.checkExists(d,c,s,l,E,m,f,o)}},this.fsw._emitRaw);return this.fsw._emitReady(),a}async _handleFsEventsSymlink(e,s,r,n){if(!(this.fsw.closed||this.fsw._symlinkPaths.has(s))){this.fsw._symlinkPaths.set(s,!0),this.fsw._incrReadyCount();try{let o=await zr(e);if(this.fsw.closed)return;if(this.fsw._isIgnored(o))return this.fsw._emitReady();this.fsw._incrReadyCount(),this._addToFsEvents(o||e,i=>{let a=e;return o&&o!==Yr?a=i.replace(o,e):i!==Yr&&(a=B.join(e,i)),r(a)},!1,n)}catch(o){if(this.fsw._handleError(o))return this.fsw._emitReady()}}}emitAdd(e,s,r,n,o){let i=r(e),a=s.isDirectory(),c=this.fsw._getWatchedDir(B.dirname(i)),u=B.basename(i);a&&this.fsw._getWatchedDir(i),!c.has(u)&&(c.add(u),(!n.ignoreInitial||o===!0)&&this.fsw._emit(a?jr:Ft,i,s))}initWatch(e,s,r,n){if(this.fsw.closed)return;let o=this._watchWithFsEvents(r.watchPath,B.resolve(e||r.watchPath),n,r.globFilter);this.fsw._addPathCloser(s,o)}async _addToFsEvents(e,s,r,n){if(this.fsw.closed)return;let o=this.fsw.options,i=typeof s===$t?s:fa,a=this.fsw._getWatchHelpers(e);try{let c=await pa[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))throw null;if(c.isDirectory()){if(a.globFilter||this.emitAdd(i(e),c,i,o,r),n&&n>o.depth)return;this.fsw._readdirp(a.watchPath,{fileFilter:u=>a.filterPath(u),directoryFilter:u=>a.filterDir(u),...da(o.depth-(n||0))}).on(ea,u=>{if(this.fsw.closed||u.stats.isDirectory()&&!a.filterPath(u))return;let f=B.join(a.watchPath,u.path),{fullPath:d}=u;if(a.followSymlinks&&u.stats.isSymbolicLink()){let l=o.depth===void 0?void 0:Mt(f,B.resolve(a.watchPath))+1;this._handleFsEventsSymlink(f,d,i,l)}else this.emitAdd(f,u.stats,i,o,r)}).on(Jo,ua).on(ta,()=>{this.fsw._emitReady()})}else this.emitAdd(a.watchPath,c,i,o,r),this.fsw._emitReady()}catch(c){(!c||this.fsw._handleError(c))&&(this.fsw._emitReady(),this.fsw._emitReady())}if(o.persistent&&r!==!0)if(typeof s===$t)this.initWatch(void 0,e,a,i);else{let c;try{c=await zr(a.watchPath)}catch{}this.initWatch(c,e,a,i)}}};qt.exports=Bt;qt.exports.canUse=wa});var un=b(is=>{"use strict";var{EventEmitter:Ra}=L("events"),rs=L("fs"),k=L("path"),{promisify:on}=L("util"),Aa=Ms(),Xt=js().default,Ta=Zs(),Kt=St(),Sa=Lr(),Ca=At(),Ia=Kr(),Jr=Zr(),{EV_ALL:jt,EV_READY:xa,EV_ADD:rt,EV_CHANGE:Pe,EV_UNLINK:en,EV_ADD_DIR:ba,EV_UNLINK_DIR:ka,EV_RAW:va,EV_ERROR:Vt,STR_CLOSE:Pa,STR_END:Na,BACK_SLASH_RE:Oa,DOUBLE_SLASH_RE:tn,SLASH_OR_BACK_SLASH_RE:La,DOT_RE:Ha,REPLACER_RE:Da,SLASH:Yt,SLASH_SLASH:Fa,BRACE_START:$a,BANG:Qt,ONE_DOT:an,TWO_DOTS:Ma,GLOBSTAR:Ua,SLASH_GLOBSTAR:zt,ANYMATCH_OPTS:Zt,STRING_TYPE:ns,FUNCTION_TYPE:Ba,EMPTY_STR:Jt,EMPTY_FN:Wa,isWindows:Ga,isMacos:qa,isIBMi:Ka}=Qe(),ja=on(rs.stat),Va=on(rs.readdir),es=(t=[])=>Array.isArray(t)?t:[t],cn=(t,e=[])=>(t.forEach(s=>{Array.isArray(s)?cn(s,e):e.push(s)}),e),sn=t=>{let e=cn(es(t));if(!e.every(s=>typeof s===ns))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(ln)},rn=t=>{let e=t.replace(Oa,Yt),s=!1;for(e.startsWith(Fa)&&(s=!0);e.match(tn);)e=e.replace(tn,Yt);return s&&(e=Yt+e),e},ln=t=>rn(k.normalize(rn(t))),nn=(t=Jt)=>e=>typeof e!==ns?e:ln(k.isAbsolute(e)?e:k.join(t,e)),Ya=(t,e)=>k.isAbsolute(t)?t:t.startsWith(Qt)?Qt+k.join(e,t.slice(1)):k.join(e,t),J=(t,e)=>t[e]===void 0,ts=class{constructor(e,s){this.path=e,this._removeWatcher=s,this.items=new Set}add(e){let{items:s}=this;s&&e!==an&&e!==Ma&&s.add(e)}async remove(e){let{items:s}=this;if(!s||(s.delete(e),s.size>0))return;let r=this.path;try{await Va(r)}catch{this._removeWatcher&&this._removeWatcher(k.dirname(r),k.basename(r))}}has(e){let{items:s}=this;if(s)return s.has(e)}getChildren(){let{items:e}=this;if(e)return[...e.values()]}dispose(){this.items.clear(),delete this.path,delete this._removeWatcher,delete this.items,Object.freeze(this)}},za="stat",Xa="lstat",ss=class{constructor(e,s,r,n){this.fsw=n,this.path=e=e.replace(Da,Jt),this.watchPath=s,this.fullWatchPath=k.resolve(s),this.hasGlob=s!==e,e===Jt&&(this.hasGlob=!1),this.globSymlink=this.hasGlob&&r?void 0:!1,this.globFilter=this.hasGlob?Xt(e,void 0,Zt):!1,this.dirParts=this.getDirParts(e),this.dirParts.forEach(o=>{o.length>1&&o.pop()}),this.followSymlinks=r,this.statMethod=r?za:Xa}checkGlobSymlink(e){return this.globSymlink===void 0&&(this.globSymlink=e.fullParentDir===this.fullWatchPath?!1:{realPath:e.fullParentDir,linkPath:this.fullWatchPath}),this.globSymlink?e.fullPath.replace(this.globSymlink.realPath,this.globSymlink.linkPath):e.fullPath}entryPath(e){return k.join(this.watchPath,k.relative(this.watchPath,this.checkGlobSymlink(e)))}filterPath(e){let{stats:s}=e;if(s&&s.isSymbolicLink())return this.filterDir(e);let r=this.entryPath(e);return(this.hasGlob&&typeof this.globFilter===Ba?this.globFilter(r):!0)&&this.fsw._isntIgnored(r,s)&&this.fsw._hasReadPermissions(s)}getDirParts(e){if(!this.hasGlob)return[];let s=[];return(e.includes($a)?Sa.expand(e):[e]).forEach(n=>{s.push(k.relative(this.watchPath,n).split(La))}),s}filterDir(e){if(this.hasGlob){let s=this.getDirParts(this.checkGlobSymlink(e)),r=!1;this.unmatchedGlob=!this.dirParts.some(n=>n.every((o,i)=>(o===Ua&&(r=!0),r||!s[0][i]||Xt(o,s[0][i],Zt))))}return!this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}},nt=class extends Ra{constructor(e){super();let s={};e&&Object.assign(s,e),this._watched=new Map,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._symlinkPaths=new Map,this._streams=new Set,this.closed=!1,J(s,"persistent")&&(s.persistent=!0),J(s,"ignoreInitial")&&(s.ignoreInitial=!1),J(s,"ignorePermissionErrors")&&(s.ignorePermissionErrors=!1),J(s,"interval")&&(s.interval=100),J(s,"binaryInterval")&&(s.binaryInterval=300),J(s,"disableGlobbing")&&(s.disableGlobbing=!1),s.enableBinaryInterval=s.binaryInterval!==s.interval,J(s,"useFsEvents")&&(s.useFsEvents=!s.usePolling),Jr.canUse()||(s.useFsEvents=!1),J(s,"usePolling")&&!s.useFsEvents&&(s.usePolling=qa),Ka&&(s.usePolling=!0);let n=process.env.CHOKIDAR_USEPOLLING;if(n!==void 0){let c=n.toLowerCase();c==="false"||c==="0"?s.usePolling=!1:c==="true"||c==="1"?s.usePolling=!0:s.usePolling=!!c}let o=process.env.CHOKIDAR_INTERVAL;o&&(s.interval=Number.parseInt(o,10)),J(s,"atomic")&&(s.atomic=!s.usePolling&&!s.useFsEvents),s.atomic&&(this._pendingUnlinks=new Map),J(s,"followSymlinks")&&(s.followSymlinks=!0),J(s,"awaitWriteFinish")&&(s.awaitWriteFinish=!1),s.awaitWriteFinish===!0&&(s.awaitWriteFinish={});let i=s.awaitWriteFinish;i&&(i.stabilityThreshold||(i.stabilityThreshold=2e3),i.pollInterval||(i.pollInterval=100),this._pendingWrites=new Map),s.ignored&&(s.ignored=es(s.ignored));let a=0;this._emitReady=()=>{a++,a>=this._readyCount&&(this._emitReady=Wa,this._readyEmitted=!0,process.nextTick(()=>this.emit(xa)))},this._emitRaw=(...c)=>this.emit(va,...c),this._readyEmitted=!1,this.options=s,s.useFsEvents?this._fsEventsHandler=new Jr(this):this._nodeFsHandler=new Ia(this),Object.freeze(s)}add(e,s,r){let{cwd:n,disableGlobbing:o}=this.options;this.closed=!1;let i=sn(e);return n&&(i=i.map(a=>{let c=Ya(a,n);return o||!Kt(a)?c:Ca(c)})),i=i.filter(a=>a.startsWith(Qt)?(this._ignoredPaths.add(a.slice(1)),!1):(this._ignoredPaths.delete(a),this._ignoredPaths.delete(a+zt),this._userIgnored=void 0,!0)),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=i.length),this.options.persistent&&(this._readyCount+=i.length),i.forEach(a=>this._fsEventsHandler._addToFsEvents(a))):(this._readyCount||(this._readyCount=0),this._readyCount+=i.length,Promise.all(i.map(async a=>{let c=await this._nodeFsHandler._addToNodeFs(a,!r,0,0,s);return c&&this._emitReady(),c})).then(a=>{this.closed||a.filter(c=>c).forEach(c=>{this.add(k.dirname(c),k.basename(s||c))})})),this}unwatch(e){if(this.closed)return this;let s=sn(e),{cwd:r}=this.options;return s.forEach(n=>{!k.isAbsolute(n)&&!this._closers.has(n)&&(r&&(n=k.join(r,n)),n=k.resolve(n)),this._closePath(n),this._ignoredPaths.add(n),this._watched.has(n)&&this._ignoredPaths.add(n+zt),this._userIgnored=void 0}),this}close(){if(this.closed)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(s=>s.forEach(r=>{let n=r();n instanceof Promise&&e.push(n)})),this._streams.forEach(s=>s.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(s=>s.dispose()),["closers","watched","streams","symlinkPaths","throttled"].forEach(s=>{this[`_${s}`].clear()}),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((s,r)=>{let n=this.options.cwd?k.relative(this.options.cwd,r):r;e[n||an]=s.getChildren().sort()}),e}emitWithAll(e,s){this.emit(...s),e!==Vt&&this.emit(jt,...s)}async _emit(e,s,r,n,o){if(this.closed)return;let i=this.options;Ga&&(s=k.normalize(s)),i.cwd&&(s=k.relative(i.cwd,s));let a=[e,s];o!==void 0?a.push(r,n,o):n!==void 0?a.push(r,n):r!==void 0&&a.push(r);let c=i.awaitWriteFinish,u;if(c&&(u=this._pendingWrites.get(s)))return u.lastChange=new Date,this;if(i.atomic){if(e===en)return this._pendingUnlinks.set(s,a),setTimeout(()=>{this._pendingUnlinks.forEach((f,d)=>{this.emit(...f),this.emit(jt,...f),this._pendingUnlinks.delete(d)})},typeof i.atomic=="number"?i.atomic:100),this;e===rt&&this._pendingUnlinks.has(s)&&(e=a[0]=Pe,this._pendingUnlinks.delete(s))}if(c&&(e===rt||e===Pe)&&this._readyEmitted){let f=(d,l)=>{d?(e=a[0]=Vt,a[1]=d,this.emitWithAll(e,a)):l&&(a.length>2?a[2]=l:a.push(l),this.emitWithAll(e,a))};return this._awaitWriteFinish(s,c.stabilityThreshold,e,f),this}if(e===Pe&&!this._throttle(Pe,s,50))return this;if(i.alwaysStat&&r===void 0&&(e===rt||e===ba||e===Pe)){let f=i.cwd?k.join(i.cwd,s):s,d;try{d=await ja(f)}catch{}if(!d||this.closed)return;a.push(d)}return this.emitWithAll(e,a),this}_handleError(e){let s=e&&e.code;return e&&s!=="ENOENT"&&s!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||s!=="EPERM"&&s!=="EACCES")&&this.emit(Vt,e),e||this.closed}_throttle(e,s,r){this._throttled.has(e)||this._throttled.set(e,new Map);let n=this._throttled.get(e),o=n.get(s);if(o)return o.count++,!1;let i,a=()=>{let u=n.get(s),f=u?u.count:0;return n.delete(s),clearTimeout(i),u&&clearTimeout(u.timeoutObject),f};i=setTimeout(a,r);let c={timeoutObject:i,clear:a,count:0};return n.set(s,c),c}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,s,r,n){let o,i=e;this.options.cwd&&!k.isAbsolute(e)&&(i=k.join(this.options.cwd,e));let a=new Date,c=u=>{rs.stat(i,(f,d)=>{if(f||!this._pendingWrites.has(e)){f&&f.code!=="ENOENT"&&n(f);return}let l=Number(new Date);u&&d.size!==u.size&&(this._pendingWrites.get(e).lastChange=l);let m=this._pendingWrites.get(e);l-m.lastChange>=s?(this._pendingWrites.delete(e),n(void 0,d)):o=setTimeout(c,this.options.awaitWriteFinish.pollInterval,d)})};this._pendingWrites.has(e)||(this._pendingWrites.set(e,{lastChange:a,cancelWait:()=>(this._pendingWrites.delete(e),clearTimeout(o),r)}),o=setTimeout(c,this.options.awaitWriteFinish.pollInterval))}_getGlobIgnored(){return[...this._ignoredPaths.values()]}_isIgnored(e,s){if(this.options.atomic&&Ha.test(e))return!0;if(!this._userIgnored){let{cwd:r}=this.options,n=this.options.ignored,o=n&&n.map(nn(r)),i=es(o).filter(c=>typeof c===ns&&!Kt(c)).map(c=>c+zt),a=this._getGlobIgnored().map(nn(r)).concat(o,i);this._userIgnored=Xt(a,void 0,Zt)}return this._userIgnored([e,s])}_isntIgnored(e,s){return!this._isIgnored(e,s)}_getWatchHelpers(e,s){let r=s||this.options.disableGlobbing||!Kt(e)?e:Ta(e),n=this.options.followSymlinks;return new ss(e,r,n,this)}_getWatchedDir(e){this._boundRemove||(this._boundRemove=this._remove.bind(this));let s=k.resolve(e);return this._watched.has(s)||this._watched.set(s,new ts(s,this._boundRemove)),this._watched.get(s)}_hasReadPermissions(e){if(this.options.ignorePermissionErrors)return!0;let r=(e&&Number.parseInt(e.mode,10))&511;return!!(4&Number.parseInt(r.toString(8)[0],10))}_remove(e,s,r){let n=k.join(e,s),o=k.resolve(n);if(r=r??(this._watched.has(n)||this._watched.has(o)),!this._throttle("remove",n,100))return;!r&&!this.options.useFsEvents&&this._watched.size===1&&this.add(e,s,!0),this._getWatchedDir(n).getChildren().forEach(l=>this._remove(n,l));let c=this._getWatchedDir(e),u=c.has(s);c.remove(s),this._symlinkPaths.has(o)&&this._symlinkPaths.delete(o);let f=n;if(this.options.cwd&&(f=k.relative(this.options.cwd,n)),this.options.awaitWriteFinish&&this._pendingWrites.has(f)&&this._pendingWrites.get(f).cancelWait()===rt)return;this._watched.delete(n),this._watched.delete(o);let d=r?ka:en;u&&!this._isIgnored(n)&&this._emit(d,n),this.options.useFsEvents||this._closePath(n)}_closePath(e){this._closeFile(e);let s=k.dirname(e);this._getWatchedDir(s).remove(k.basename(e))}_closeFile(e){let s=this._closers.get(e);s&&(s.forEach(r=>r()),this._closers.delete(e))}_addPathCloser(e,s){if(!s)return;let r=this._closers.get(e);r||(r=[],this._closers.set(e,r)),r.push(s)}_readdirp(e,s){if(this.closed)return;let r={type:jt,alwaysStat:!0,lstat:!0,...s},n=Aa(e,r);return this._streams.add(n),n.once(Pa,()=>{n=void 0}),n.once(Na,()=>{n&&(this._streams.delete(n),n=void 0)}),n}};is.FSWatcher=nt;var Qa=(t,e)=>{let s=new nt(e);return s.add(t),s};is.watch=Qa});import"only-server";import"../common/index.mjs";var hn=Bn(un(),1);import{fork as Ja}from"node:child_process";import{existsSync as fn,promises as ec}from"node:fs";import{basename as as,dirname as ls,join as cs,relative as dn}from"node:path";import{build as tc}from"esbuild";import{jwtDecode as sc}from"jwt-decode";import{Issuer as rc,custom as nc}from"openid-client";import{Logger as ic}from"@5minds/processcube_engine_sdk";import{EngineClient as Za}from"@5minds/processcube_engine_client";var os=process.env.PROCESSCUBE_ENGINE_URL??"http://localhost:10560",T=new Za(os);var oc={token:"ZHVtbXlfdG9rZW4=",userId:"dummy_token"},ac=.85,it=["external_task.ts","external_task.js"],us=process.env.PROCESSCUBE_AUTHORITY_URL!==void 0,pe=new ic("processcube_app_sdk:external_task_adapter"),he={},Ne;async function pn(t){if(t&&!fn(t))throw new Error(`Invalid customExternalTasksDirPath. The given path '${t}' does not exist`);nc.setHttpOptionsDefaults({timeout:1e5});let e=await En();Ne=await mn(e),await lc(e);let s=fc(t);(0,hn.watch)(s).on("add",async r=>{if(it.includes(as(r)))return _n(r,s)}).on("change",async r=>{if(it.includes(as(r)))return cc(r,s)}).on("unlink",async r=>{it.includes(as(r))&&gn(r)}).on("error",r=>pe.error(`Watcher error: ${r}`))}async function _n(t,e){let s=ls(t);if((await ec.readdir(s)).filter(f=>it.includes(f)).length>1){pe.error(`Multiple external task files found in directory ${s}. Stopping all external task workers for this directory.`),he[s]&&gn(t);return}let o=await yn(t),i=dn(e,s),a=wn(i),c=cs(__dirname,"lib/ExternalTaskWorkerProcess.cjs"),u=Ja(c,{env:{...process.env,PROCESSCUBE_ENGINE_URL:os}});he[s]=u,u.once("disconnect",()=>{delete he[s]}),u.send({action:"create",payload:{topic:a,identity:Ne,moduleString:o,workerPath:t}})}async function cc(t,e){let s=ls(t),r=he[s];if(!r)return _n(t,e);let n=await yn(t),o=dn(e,s),i=wn(o);r.send({action:"restart",payload:{topic:i,identity:Ne,moduleString:n,workerPath:t}})}function gn(t){let e=ls(t),s=he[e];s&&s.kill()}async function En(){if(!us)return null;if(!process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID||!process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET){let r=new Error("Required environment variables PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID and PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET are missing. For help, please refer to our documentation on environment variables at: https://processcube.io/docs/app-sdk/samples/nextjs/external-task-adapter-with-nextjs#authority");throw pe.error("Required environment variables PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID and PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET are missing",{err:r}),r}let t=await rc.discover(process.env.PROCESSCUBE_AUTHORITY_URL);return await new t.Client({client_id:process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID,client_secret:process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET}).grant({grant_type:"client_credentials",scope:"engine_etw"})}function mn(t){if(!us||t===null)return oc;let e=t.access_token,s=sc(e);return{token:t.access_token,userId:s.sub}}async function lc(t){let e=5;if(!us||t===null)return;let r=await uc(t)*ac*1e3,n=async()=>{try{let o=await En();Ne=mn(o);for(let i of Object.values(he))i.send({action:"updateIdentity",payload:{identity:Ne}});e=5,setTimeout(n,r)}catch(o){if(e===0){pe.error("Could not refresh identity for external task worker processes. Stopping all external task workers.",{error:o});for(let a of Object.values(he))a.kill();return}pe.error("Could not refresh identity for external task worker processes.",{error:o,retryCount:e}),e--;let i=2*1e3;setTimeout(n,i)}};setTimeout(n,r)}async function yn(t){let e=await tc({entryPoints:[t],write:!1,bundle:!0,platform:"node",target:"node18",format:"cjs",external:["@opentelemetry/api"]});if(e.errors.length>0)throw pe.error(`Could not transpile file at '${t}'`,{errors:e.errors}),new Error(`Could not transpile file at '${t}'`);return e.warnings.length>0&&pe.warn(`Transpiled file at '${t}' with warnings`,{warnings:e.warnings}),e.outputFiles[0].text}async function uc(t){let e=t.expires_in;if(!e&&t.expires_at&&(e=Math.floor(t.expires_at-Date.now()/1e3)),e===void 0)throw new Error("Could not determine the time until the access token for external task workers expires");return e}function wn(t){return t.replace(/^\.\/+|\([^)]+\)|^\/*|\/*$/g,"").replace(/[\/]{2,}/g,"/")}function fc(t){let e,s=[t,cs(process.cwd(),"app"),cs(process.cwd(),"src","app")];for(let r of s)if(r&&fn(r)){e=r;break}if(!e)throw new Error("Could not find external tasks directory");return e}function dl(){return T}import{getToken as Rn}from"next-auth/jwt";import{ResponseCookies as dc}from"next/dist/compiled/@edge-runtime/cookies";import{cookies as ot,headers as An}from"next/headers";async function at(){let t=await Rn({req:{cookies:ot(),headers:An()}});if(t?.expiresAt&&Date.now()>=t.expiresAt*1e3){let s=await fetch(`${process.env.NEXTAUTH_URL}/api/auth/session`,{method:"GET",headers:{"Content-Type":"application/json",cookie:ot().toString()}}),r=new dc(s.headers);if(r.getAll().length){let n=!1;try{for(let o of r.getAll())ot().set(o.name,o.value,{...o})}catch{n=!0}if(t=await Rn({req:{cookies:n?r:ot(),headers:An()}}),t?.error)throw t.error}}if(!t?.accessToken||!t?.sub)throw new Error("AccessToken or Sub could not be determined!");return{token:t?.accessToken,userId:t?.sub}}import{DataModels as Oe}from"@5minds/processcube_engine_client";async function Le(){try{return at()}catch{return}}async function Tn(t){let e=await Le();return(await T.processInstances.query({processInstanceId:t},{identity:e})).processInstances[0]}async function Sn(t,e={sortSettings:{sortBy:Oe.FlowNodeInstances.FlowNodeInstanceSortableColumns.createdAt,sortDir:"ASC"}}){return(await T.flowNodeInstances.query({processInstanceId:t},{...e,identity:e.identity??await Le()})).flowNodeInstances}async function Cn(t){let e=await Le();return(await T.flowNodeInstances.query({triggeredByFlowNodeInstance:t},{identity:e})).flowNodeInstances}async function In(t,e,s){let r=await Le();await T.processInstances.retryProcessInstance(t,{flowNodeInstanceId:e,newStartToken:s,identity:r})}async function xn(t){let e=await Le();await T.processInstances.terminateProcessInstance(t,e)}async function Rl(t){return await T.processInstances.query({...t?.query,state:Oe.ProcessInstances.ProcessInstanceState.running},t?.options)}async function Al(t,e){let{processInstanceId:s}=t;return new Promise(async(r,n)=>{let o=[],i=async a=>{if(s!==void 0&&a.processInstanceId!==s)return;let u=await T.processInstances.query({processInstanceId:a.processInstanceId},{identity:e});for(let f of o)T.notification.removeSubscription(f,e);return u.totalCount===0?n(new Error(`Process with instance ID "${a.processInstanceId}" does not exist.`)):r(u.processInstances[0])};if(o.push(await T.notification.onProcessEnded(i,{identity:e})),o.push(await T.notification.onProcessError(i,{identity:e})),o.push(await T.notification.onProcessTerminated(i,{identity:e})),s){let a=await T.processInstances.query({processInstanceId:s,state:[Oe.ProcessInstances.ProcessInstanceState.finished,Oe.ProcessInstances.ProcessInstanceState.terminated,Oe.ProcessInstances.ProcessInstanceState.error]},{identity:e});if(a.totalCount>0){for(let c of o)T.notification.removeSubscription(c,e);r(a.processInstances[0])}}})}import{DataModels as oe}from"@5minds/processcube_engine_client";import{mapUserTask as bn,mapUserTaskList as _e}from"../common/index.mjs";async function kl(t={},e){let{correlationId:s,processInstanceId:r,flowNodeId:n}=t;return new Promise(async(o,i)=>{let a=await T.userTasks.onUserTaskWaiting(async u=>{let f=s!==void 0&&u.correlationId!==s,d=u.flowNodeInstanceId===void 0,l=r!==void 0&&u.processInstanceId!==r,m=n!==void 0&&u.flowNodeId!==n;if(f||d||l||m)return;let E=await pc(u.flowNodeInstanceId,{identity:e});return T.notification.removeSubscription(a,e),E===null?i(new Error(`UserTask with instance ID "${u.flowNodeInstanceId}" does not exist.`)):o(E)},{identity:e}),c=await hc({correlationId:s,processInstanceId:r,flowNodeId:n,state:oe.FlowNodeInstances.FlowNodeInstanceState.suspended},{identity:e});c.userTasks.length>0&&(T.notification.removeSubscription(a,e),o(c.userTasks[0]))})}async function vl(t,e={},s={},r){await T.userTasks.finishUserTask(t,s,r);let n={state:oe.FlowNodeInstances.FlowNodeInstanceState.suspended,...e},o=await T.userTasks.query(n,{identity:r});return bn(o.userTasks[0])}async function hc(...t){let e=await T.userTasks.query(...t);return _e(e)}async function Pl(t){let e=await T.userTasks.query({state:oe.FlowNodeInstances.FlowNodeInstanceState.suspended},t);return _e(e)}async function Nl(t,e){let s=await T.userTasks.query({processInstanceId:t,state:oe.FlowNodeInstances.FlowNodeInstanceState.suspended},e);return _e(s)}async function Ol(t,e){let s=await T.userTasks.query({flowNodeId:t,state:oe.FlowNodeInstances.FlowNodeInstanceState.suspended},e);return _e(s)}async function pc(t,e){let s=await T.userTasks.query({flowNodeInstanceId:t,state:oe.FlowNodeInstances.FlowNodeInstanceState.suspended},{...e,limit:1});return s.userTasks.length===0?null:bn(s.userTasks[0])}async function Ll(t,e){let s=await T.userTasks.query({correlationId:t,state:oe.FlowNodeInstances.FlowNodeInstanceState.suspended},e);return _e(s)}async function Hl(t,e){let s=await T.userTasks.query({state:oe.FlowNodeInstances.FlowNodeInstanceState.suspended},{identity:t,...e}),r=s.userTasks.filter(n=>n.actualOwnerId===t.userId);return s.userTasks=r,_e(s)}async function Dl(t,e,s){await T.userTasks.reserveUserTaskInstance(t,e,s||t.userId)}async function Fl(t,e){await T.userTasks.cancelUserTaskInstanceReservation(t,e)}async function $l(t,e){let s=await T.userTasks.query({state:oe.FlowNodeInstances.FlowNodeInstanceState.suspended},{identity:t,...e}),r=s.userTasks.filter(n=>n.assignedUserIds?.includes(t.userId));return s.userTasks=r,_e(s)}import{PHASE_DEVELOPMENT_SERVER as _c,PHASE_PRODUCTION_BUILD as gc,PHASE_PRODUCTION_SERVER as Ec}from"next/dist/shared/lib/constants";var kn=!1,fs=!1;function Wl(t={}){let{applicationSdk:e,...s}=t;return async(r,n)=>{fs=fs||r===gc;let o=r===_c||r===Ec;return e?.useExternalTasks&&o&&!kn&&!fs&&(kn=!0,await pn(e?.customExternalTasksDirPath)),{...s,experimental:{...s.experimental,serverComponentsExternalPackages:[...s.experimental?.serverComponentsExternalPackages||[],"esbuild"]}}}}import{revalidatePath as mc}from"next/cache";import{redirect as yc}from"next/navigation";function jl(t){mc(t),yc(t)}async function zl(...t){return await T.processModels.startProcessInstance(...t)}async function vn(...t){await T.manualTasks.finishManualTask(...t)}async function Pn(...t){await T.userTasks.finishUserTask(...t)}async function Nn(...t){await T.untypedTasks.finishTask(...t)}import{DataModels as wc}from"@5minds/processcube_engine_client";async function Rc(){try{return at()}catch{return}}var au=async(t,e)=>{let s=await Rc();e==="bpmn:UserTask"?await Pn(t,{},s):e==="bpmn:ManualTask"?await vn(t,s):e==="bpmn:Task"?await Nn(t,s):console.error(`[@5minds/processcube_app_sdk:handlePlay] Unsupported flow node type: ${e}`)},cu=async t=>{await xn(t)},lu=async(t,e,s)=>{await In(t,e,s)},uu=async t=>Tn(t),fu=async t=>Sn(t,{sortSettings:{sortBy:wc.FlowNodeInstances.FlowNodeInstanceSortableColumns.createdAt,sortDir:"DESC"}}),du=async t=>Cn(t);export{Fl as cancelReservedUserTask,vn as finishManualTask,au as finishTask,Nn as finishUntypedTask,Pn as finishUserTask,vl as finishUserTaskAndGetNext,Rl as getActiveProcessInstances,$l as getAssignedUserTasksByIdentity,dl as getEngineClient,fu as getFlowNodeInstances,Sn as getFlowNodeInstancesByProcessInstanceId,Cn as getFlowNodeInstancesTriggeredByFlowNodeInstanceIds,at as getIdentity,uu as getProcessInstance,Tn as getProcessInstanceById,Hl as getReservedUserTasksByIdentity,du as getTriggeredFlowNodeInstances,hc as getUserTasks,pc as getWaitingUserTaskByFlowNodeInstanceId,Pl as getWaitingUserTasks,Ll as getWaitingUserTasksByCorrelationId,Ol as getWaitingUserTasksByFlowNodeId,Nl as getWaitingUserTasksByProcessInstanceId,jl as navigateToUrl,Dl as reserveUserTask,lu as retryProcess,In as retryProcessInstance,zl as startProcess,cu as terminateProcess,xn as terminateProcessInstance,Al as waitForProcessEnd,kl as waitForUserTask,Wl as withApplicationSdk};
1
+ var Hn=Object.create;var ds=Object.defineProperty;var Dn=Object.getOwnPropertyDescriptor;var Fn=Object.getOwnPropertyNames;var $n=Object.getPrototypeOf,Mn=Object.prototype.hasOwnProperty;var L=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,s)=>(typeof require<"u"?require:e)[s]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var x=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Un=(t,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Fn(e))!Mn.call(t,n)&&n!==s&&ds(t,n,{get:()=>e[n],enumerable:!(r=Dn(e,n))||r.enumerable});return t};var Bn=(t,e,s)=>(s=t!=null?Hn($n(t)):{},Un(e||!t||!t.__esModule?ds(s,"default",{value:t,enumerable:!0}):s,t));var Ae=x((Tc,Es)=>{"use strict";var Wn=L("path"),ne="\\\\/",hs=`[^${ne}]`,ie="\\.",Gn="\\+",qn="\\?",Ue="\\/",Kn="(?=.)",ps="[^/]",lt=`(?:${Ue}|$)`,_s=`(?:^|${Ue})`,ut=`${ie}{1,2}${lt}`,jn=`(?!${ie})`,Vn=`(?!${_s}${ut})`,Yn=`(?!${ie}{0,1}${lt})`,zn=`(?!${ut})`,Xn=`[^.${Ue}]`,Qn=`${ps}*?`,gs={DOT_LITERAL:ie,PLUS_LITERAL:Gn,QMARK_LITERAL:qn,SLASH_LITERAL:Ue,ONE_CHAR:Kn,QMARK:ps,END_ANCHOR:lt,DOTS_SLASH:ut,NO_DOT:jn,NO_DOTS:Vn,NO_DOT_SLASH:Yn,NO_DOTS_SLASH:zn,QMARK_NO_DOT:Xn,STAR:Qn,START_ANCHOR:_s},Zn={...gs,SLASH_LITERAL:`[${ne}]`,QMARK:hs,STAR:`${hs}*?`,DOTS_SLASH:`${ie}{1,2}(?:[${ne}]|$)`,NO_DOT:`(?!${ie})`,NO_DOTS:`(?!(?:^|[${ne}])${ie}{1,2}(?:[${ne}]|$))`,NO_DOT_SLASH:`(?!${ie}{0,1}(?:[${ne}]|$))`,NO_DOTS_SLASH:`(?!${ie}{1,2}(?:[${ne}]|$))`,QMARK_NO_DOT:`[^.${ne}]`,START_ANCHOR:`(?:^|[${ne}])`,END_ANCHOR:`(?:[${ne}]|$)`},Jn={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"};Es.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Jn,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:Wn.sep,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?Zn:gs}}});var Be=x(z=>{"use strict";var ei=L("path"),ti=process.platform==="win32",{REGEX_BACKSLASH:si,REGEX_REMOVE_BACKSLASH:ri,REGEX_SPECIAL_CHARS:ni,REGEX_SPECIAL_CHARS_GLOBAL:ii}=Ae();z.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);z.hasRegexChars=t=>ni.test(t);z.isRegexChar=t=>t.length===1&&z.hasRegexChars(t);z.escapeRegex=t=>t.replace(ii,"\\$1");z.toPosixSlashes=t=>t.replace(si,"/");z.removeBackslashes=t=>t.replace(ri,e=>e==="\\"?"":e);z.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};z.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:ti===!0||ei.sep==="\\";z.escapeLast=(t,e,s)=>{let r=t.lastIndexOf(e,s);return r===-1?t:t[r-1]==="\\"?z.escapeLast(t,e,r-1):`${t.slice(0,r)}\\${t.slice(r)}`};z.removePrefix=(t,e={})=>{let s=t;return s.startsWith("./")&&(s=s.slice(2),e.prefix="./"),s};z.wrapOutput=(t,e={},s={})=>{let r=s.contains?"":"^",n=s.contains?"":"$",o=`${r}(?:${t})${n}`;return e.negated===!0&&(o=`(?:^(?!${o}).*$)`),o}});var Is=x((Ic,Ss)=>{"use strict";var ys=Be(),{CHAR_ASTERISK:ft,CHAR_AT:oi,CHAR_BACKWARD_SLASH:Te,CHAR_COMMA:ai,CHAR_DOT:dt,CHAR_EXCLAMATION_MARK:ht,CHAR_FORWARD_SLASH:Ts,CHAR_LEFT_CURLY_BRACE:pt,CHAR_LEFT_PARENTHESES:_t,CHAR_LEFT_SQUARE_BRACKET:ci,CHAR_PLUS:li,CHAR_QUESTION_MARK:ms,CHAR_RIGHT_CURLY_BRACE:ui,CHAR_RIGHT_PARENTHESES:ws,CHAR_RIGHT_SQUARE_BRACKET:fi}=Ae(),Rs=t=>t===Ts||t===Te,As=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},di=(t,e)=>{let s=e||{},r=t.length-1,n=s.parts===!0||s.scanToEnd===!0,o=[],i=[],a=[],c=t,f=-1,u=0,d=0,l=!1,y=!1,E=!1,w=!1,v=!1,F=!1,Y=!1,$=!1,te=!1,q=!1,ce=0,K,A,b={value:"",depth:0,isGlob:!1},G=()=>f>=r,_=()=>c.charCodeAt(f+1),O=()=>(K=A,c.charCodeAt(++f));for(;f<r;){A=O();let j;if(A===Te){Y=b.backslashes=!0,A=O(),A===pt&&(F=!0);continue}if(F===!0||A===pt){for(ce++;G()!==!0&&(A=O());){if(A===Te){Y=b.backslashes=!0,O();continue}if(A===pt){ce++;continue}if(F!==!0&&A===dt&&(A=O())===dt){if(l=b.isBrace=!0,E=b.isGlob=!0,q=!0,n===!0)continue;break}if(F!==!0&&A===ai){if(l=b.isBrace=!0,E=b.isGlob=!0,q=!0,n===!0)continue;break}if(A===ui&&(ce--,ce===0)){F=!1,l=b.isBrace=!0,q=!0;break}}if(n===!0)continue;break}if(A===Ts){if(o.push(f),i.push(b),b={value:"",depth:0,isGlob:!1},q===!0)continue;if(K===dt&&f===u+1){u+=2;continue}d=f+1;continue}if(s.noext!==!0&&(A===li||A===oi||A===ft||A===ms||A===ht)===!0&&_()===_t){if(E=b.isGlob=!0,w=b.isExtglob=!0,q=!0,A===ht&&f===u&&(te=!0),n===!0){for(;G()!==!0&&(A=O());){if(A===Te){Y=b.backslashes=!0,A=O();continue}if(A===ws){E=b.isGlob=!0,q=!0;break}}continue}break}if(A===ft){if(K===ft&&(v=b.isGlobstar=!0),E=b.isGlob=!0,q=!0,n===!0)continue;break}if(A===ms){if(E=b.isGlob=!0,q=!0,n===!0)continue;break}if(A===ci){for(;G()!==!0&&(j=O());){if(j===Te){Y=b.backslashes=!0,O();continue}if(j===fi){y=b.isBracket=!0,E=b.isGlob=!0,q=!0;break}}if(n===!0)continue;break}if(s.nonegate!==!0&&A===ht&&f===u){$=b.negated=!0,u++;continue}if(s.noparen!==!0&&A===_t){if(E=b.isGlob=!0,n===!0){for(;G()!==!0&&(A=O());){if(A===_t){Y=b.backslashes=!0,A=O();continue}if(A===ws){q=!0;break}}continue}break}if(E===!0){if(q=!0,n===!0)continue;break}}s.noext===!0&&(w=!1,E=!1);let P=c,le="",h="";u>0&&(le=c.slice(0,u),c=c.slice(u),d-=u),P&&E===!0&&d>0?(P=c.slice(0,d),h=c.slice(d)):E===!0?(P="",h=c):P=c,P&&P!==""&&P!=="/"&&P!==c&&Rs(P.charCodeAt(P.length-1))&&(P=P.slice(0,-1)),s.unescape===!0&&(h&&(h=ys.removeBackslashes(h)),P&&Y===!0&&(P=ys.removeBackslashes(P)));let p={prefix:le,input:t,start:u,base:P,glob:h,isBrace:l,isBracket:y,isGlob:E,isExtglob:w,isGlobstar:v,negated:$,negatedExtglob:te};if(s.tokens===!0&&(p.maxDepth=0,Rs(A)||i.push(b),p.tokens=i),s.parts===!0||s.tokens===!0){let j;for(let C=0;C<o.length;C++){let se=j?j+1:u,re=o[C],X=t.slice(se,re);s.tokens&&(C===0&&u!==0?(i[C].isPrefix=!0,i[C].value=le):i[C].value=X,As(i[C]),p.maxDepth+=i[C].depth),(C!==0||X!=="")&&a.push(X),j=re}if(j&&j+1<t.length){let C=t.slice(j+1);a.push(C),s.tokens&&(i[i.length-1].value=C,As(i[i.length-1]),p.maxDepth+=i[i.length-1].depth)}p.slashes=o,p.parts=a}return p};Ss.exports=di});var xs=x((Cc,bs)=>{"use strict";var We=Ae(),Q=Be(),{MAX_LENGTH:Ge,POSIX_REGEX_SOURCE:hi,REGEX_NON_SPECIAL_CHARS:pi,REGEX_SPECIAL_CHARS_BACKREF:_i,REPLACEMENTS:Cs}=We,gi=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let s=`[${t.join("-")}]`;try{new RegExp(s)}catch{return t.map(n=>Q.escapeRegex(n)).join("..")}return s},Ee=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,gt=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=Cs[t]||t;let s={...e},r=typeof s.maxLength=="number"?Math.min(Ge,s.maxLength):Ge,n=t.length;if(n>r)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${r}`);let o={type:"bos",value:"",output:s.prepend||""},i=[o],a=s.capture?"":"?:",c=Q.isWindows(e),f=We.globChars(c),u=We.extglobChars(f),{DOT_LITERAL:d,PLUS_LITERAL:l,SLASH_LITERAL:y,ONE_CHAR:E,DOTS_SLASH:w,NO_DOT:v,NO_DOT_SLASH:F,NO_DOTS_SLASH:Y,QMARK:$,QMARK_NO_DOT:te,STAR:q,START_ANCHOR:ce}=f,K=m=>`(${a}(?:(?!${ce}${m.dot?w:d}).)*?)`,A=s.dot?"":v,b=s.dot?$:te,G=s.bash===!0?K(s):q;s.capture&&(G=`(${G})`),typeof s.noext=="boolean"&&(s.noextglob=s.noext);let _={input:t,index:-1,start:0,dot:s.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:i};t=Q.removePrefix(t,_),n=t.length;let O=[],P=[],le=[],h=o,p,j=()=>_.index===n-1,C=_.peek=(m=1)=>t[_.index+m],se=_.advance=()=>t[++_.index]||"",re=()=>t.slice(_.index+1),X=(m="",N=0)=>{_.consumed+=m,_.index+=N},De=m=>{_.output+=m.output!=null?m.output:m.value,X(m.value)},On=()=>{let m=1;for(;C()==="!"&&(C(2)!=="("||C(3)==="?");)se(),_.start++,m++;return m%2===0?!1:(_.negated=!0,_.start++,!0)},Fe=m=>{_[m]++,le.push(m)},ue=m=>{_[m]--,le.pop()},I=m=>{if(h.type==="globstar"){let N=_.braces>0&&(m.type==="comma"||m.type==="brace"),g=m.extglob===!0||O.length&&(m.type==="pipe"||m.type==="paren");m.type!=="slash"&&m.type!=="paren"&&!N&&!g&&(_.output=_.output.slice(0,-h.output.length),h.type="star",h.value="*",h.output=G,_.output+=h.output)}if(O.length&&m.type!=="paren"&&(O[O.length-1].inner+=m.value),(m.value||m.output)&&De(m),h&&h.type==="text"&&m.type==="text"){h.value+=m.value,h.output=(h.output||"")+m.value;return}m.prev=h,i.push(m),h=m},$e=(m,N)=>{let g={...u[N],conditions:1,inner:""};g.prev=h,g.parens=_.parens,g.output=_.output;let S=(s.capture?"(":"")+g.open;Fe("parens"),I({type:m,value:N,output:_.output?"":E}),I({type:"paren",extglob:!0,value:se(),output:S}),O.push(g)},Ln=m=>{let N=m.close+(s.capture?")":""),g;if(m.type==="negate"){let S=G;if(m.inner&&m.inner.length>1&&m.inner.includes("/")&&(S=K(s)),(S!==G||j()||/^\)+$/.test(re()))&&(N=m.close=`)$))${S}`),m.inner.includes("*")&&(g=re())&&/^\.[^\\/.]+$/.test(g)){let D=gt(g,{...e,fastpaths:!1}).output;N=m.close=`)${D})${S})`}m.prev.type==="bos"&&(_.negatedExtglob=!0)}I({type:"paren",extglob:!0,value:p,output:N}),ue("parens")};if(s.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let m=!1,N=t.replace(_i,(g,S,D,V,U,ct)=>V==="\\"?(m=!0,g):V==="?"?S?S+V+(U?$.repeat(U.length):""):ct===0?b+(U?$.repeat(U.length):""):$.repeat(D.length):V==="."?d.repeat(D.length):V==="*"?S?S+V+(U?G:""):G:S?g:`\\${g}`);return m===!0&&(s.unescape===!0?N=N.replace(/\\/g,""):N=N.replace(/\\+/g,g=>g.length%2===0?"\\\\":g?"\\":"")),N===t&&s.contains===!0?(_.output=t,_):(_.output=Q.wrapOutput(N,_,e),_)}for(;!j();){if(p=se(),p==="\0")continue;if(p==="\\"){let g=C();if(g==="/"&&s.bash!==!0||g==="."||g===";")continue;if(!g){p+="\\",I({type:"text",value:p});continue}let S=/^\\+/.exec(re()),D=0;if(S&&S[0].length>2&&(D=S[0].length,_.index+=D,D%2!==0&&(p+="\\")),s.unescape===!0?p=se():p+=se(),_.brackets===0){I({type:"text",value:p});continue}}if(_.brackets>0&&(p!=="]"||h.value==="["||h.value==="[^")){if(s.posix!==!1&&p===":"){let g=h.value.slice(1);if(g.includes("[")&&(h.posix=!0,g.includes(":"))){let S=h.value.lastIndexOf("["),D=h.value.slice(0,S),V=h.value.slice(S+2),U=hi[V];if(U){h.value=D+U,_.backtrack=!0,se(),!o.output&&i.indexOf(h)===1&&(o.output=E);continue}}}(p==="["&&C()!==":"||p==="-"&&C()==="]")&&(p=`\\${p}`),p==="]"&&(h.value==="["||h.value==="[^")&&(p=`\\${p}`),s.posix===!0&&p==="!"&&h.value==="["&&(p="^"),h.value+=p,De({value:p});continue}if(_.quotes===1&&p!=='"'){p=Q.escapeRegex(p),h.value+=p,De({value:p});continue}if(p==='"'){_.quotes=_.quotes===1?0:1,s.keepQuotes===!0&&I({type:"text",value:p});continue}if(p==="("){Fe("parens"),I({type:"paren",value:p});continue}if(p===")"){if(_.parens===0&&s.strictBrackets===!0)throw new SyntaxError(Ee("opening","("));let g=O[O.length-1];if(g&&_.parens===g.parens+1){Ln(O.pop());continue}I({type:"paren",value:p,output:_.parens?")":"\\)"}),ue("parens");continue}if(p==="["){if(s.nobracket===!0||!re().includes("]")){if(s.nobracket!==!0&&s.strictBrackets===!0)throw new SyntaxError(Ee("closing","]"));p=`\\${p}`}else Fe("brackets");I({type:"bracket",value:p});continue}if(p==="]"){if(s.nobracket===!0||h&&h.type==="bracket"&&h.value.length===1){I({type:"text",value:p,output:`\\${p}`});continue}if(_.brackets===0){if(s.strictBrackets===!0)throw new SyntaxError(Ee("opening","["));I({type:"text",value:p,output:`\\${p}`});continue}ue("brackets");let g=h.value.slice(1);if(h.posix!==!0&&g[0]==="^"&&!g.includes("/")&&(p=`/${p}`),h.value+=p,De({value:p}),s.literalBrackets===!1||Q.hasRegexChars(g))continue;let S=Q.escapeRegex(h.value);if(_.output=_.output.slice(0,-h.value.length),s.literalBrackets===!0){_.output+=S,h.value=S;continue}h.value=`(${a}${S}|${h.value})`,_.output+=h.value;continue}if(p==="{"&&s.nobrace!==!0){Fe("braces");let g={type:"brace",value:p,output:"(",outputIndex:_.output.length,tokensIndex:_.tokens.length};P.push(g),I(g);continue}if(p==="}"){let g=P[P.length-1];if(s.nobrace===!0||!g){I({type:"text",value:p,output:p});continue}let S=")";if(g.dots===!0){let D=i.slice(),V=[];for(let U=D.length-1;U>=0&&(i.pop(),D[U].type!=="brace");U--)D[U].type!=="dots"&&V.unshift(D[U].value);S=gi(V,s),_.backtrack=!0}if(g.comma!==!0&&g.dots!==!0){let D=_.output.slice(0,g.outputIndex),V=_.tokens.slice(g.tokensIndex);g.value=g.output="\\{",p=S="\\}",_.output=D;for(let U of V)_.output+=U.output||U.value}I({type:"brace",value:p,output:S}),ue("braces"),P.pop();continue}if(p==="|"){O.length>0&&O[O.length-1].conditions++,I({type:"text",value:p});continue}if(p===","){let g=p,S=P[P.length-1];S&&le[le.length-1]==="braces"&&(S.comma=!0,g="|"),I({type:"comma",value:p,output:g});continue}if(p==="/"){if(h.type==="dot"&&_.index===_.start+1){_.start=_.index+1,_.consumed="",_.output="",i.pop(),h=o;continue}I({type:"slash",value:p,output:y});continue}if(p==="."){if(_.braces>0&&h.type==="dot"){h.value==="."&&(h.output=d);let g=P[P.length-1];h.type="dots",h.output+=p,h.value+=p,g.dots=!0;continue}if(_.braces+_.parens===0&&h.type!=="bos"&&h.type!=="slash"){I({type:"text",value:p,output:d});continue}I({type:"dot",value:p,output:d});continue}if(p==="?"){if(!(h&&h.value==="(")&&s.noextglob!==!0&&C()==="("&&C(2)!=="?"){$e("qmark",p);continue}if(h&&h.type==="paren"){let S=C(),D=p;if(S==="<"&&!Q.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(h.value==="("&&!/[!=<:]/.test(S)||S==="<"&&!/<([!=]|\w+>)/.test(re()))&&(D=`\\${p}`),I({type:"text",value:p,output:D});continue}if(s.dot!==!0&&(h.type==="slash"||h.type==="bos")){I({type:"qmark",value:p,output:te});continue}I({type:"qmark",value:p,output:$});continue}if(p==="!"){if(s.noextglob!==!0&&C()==="("&&(C(2)!=="?"||!/[!=<:]/.test(C(3)))){$e("negate",p);continue}if(s.nonegate!==!0&&_.index===0){On();continue}}if(p==="+"){if(s.noextglob!==!0&&C()==="("&&C(2)!=="?"){$e("plus",p);continue}if(h&&h.value==="("||s.regex===!1){I({type:"plus",value:p,output:l});continue}if(h&&(h.type==="bracket"||h.type==="paren"||h.type==="brace")||_.parens>0){I({type:"plus",value:p});continue}I({type:"plus",value:l});continue}if(p==="@"){if(s.noextglob!==!0&&C()==="("&&C(2)!=="?"){I({type:"at",extglob:!0,value:p,output:""});continue}I({type:"text",value:p});continue}if(p!=="*"){(p==="$"||p==="^")&&(p=`\\${p}`);let g=pi.exec(re());g&&(p+=g[0],_.index+=g[0].length),I({type:"text",value:p});continue}if(h&&(h.type==="globstar"||h.star===!0)){h.type="star",h.star=!0,h.value+=p,h.output=G,_.backtrack=!0,_.globstar=!0,X(p);continue}let m=re();if(s.noextglob!==!0&&/^\([^?]/.test(m)){$e("star",p);continue}if(h.type==="star"){if(s.noglobstar===!0){X(p);continue}let g=h.prev,S=g.prev,D=g.type==="slash"||g.type==="bos",V=S&&(S.type==="star"||S.type==="globstar");if(s.bash===!0&&(!D||m[0]&&m[0]!=="/")){I({type:"star",value:p,output:""});continue}let U=_.braces>0&&(g.type==="comma"||g.type==="brace"),ct=O.length&&(g.type==="pipe"||g.type==="paren");if(!D&&g.type!=="paren"&&!U&&!ct){I({type:"star",value:p,output:""});continue}for(;m.slice(0,3)==="/**";){let Me=t[_.index+4];if(Me&&Me!=="/")break;m=m.slice(3),X("/**",3)}if(g.type==="bos"&&j()){h.type="globstar",h.value+=p,h.output=K(s),_.output=h.output,_.globstar=!0,X(p);continue}if(g.type==="slash"&&g.prev.type!=="bos"&&!V&&j()){_.output=_.output.slice(0,-(g.output+h.output).length),g.output=`(?:${g.output}`,h.type="globstar",h.output=K(s)+(s.strictSlashes?")":"|$)"),h.value+=p,_.globstar=!0,_.output+=g.output+h.output,X(p);continue}if(g.type==="slash"&&g.prev.type!=="bos"&&m[0]==="/"){let Me=m[1]!==void 0?"|$":"";_.output=_.output.slice(0,-(g.output+h.output).length),g.output=`(?:${g.output}`,h.type="globstar",h.output=`${K(s)}${y}|${y}${Me})`,h.value+=p,_.output+=g.output+h.output,_.globstar=!0,X(p+se()),I({type:"slash",value:"/",output:""});continue}if(g.type==="bos"&&m[0]==="/"){h.type="globstar",h.value+=p,h.output=`(?:^|${y}|${K(s)}${y})`,_.output=h.output,_.globstar=!0,X(p+se()),I({type:"slash",value:"/",output:""});continue}_.output=_.output.slice(0,-h.output.length),h.type="globstar",h.output=K(s),h.value+=p,_.output+=h.output,_.globstar=!0,X(p);continue}let N={type:"star",value:p,output:G};if(s.bash===!0){N.output=".*?",(h.type==="bos"||h.type==="slash")&&(N.output=A+N.output),I(N);continue}if(h&&(h.type==="bracket"||h.type==="paren")&&s.regex===!0){N.output=p,I(N);continue}(_.index===_.start||h.type==="slash"||h.type==="dot")&&(h.type==="dot"?(_.output+=F,h.output+=F):s.dot===!0?(_.output+=Y,h.output+=Y):(_.output+=A,h.output+=A),C()!=="*"&&(_.output+=E,h.output+=E)),I(N)}for(;_.brackets>0;){if(s.strictBrackets===!0)throw new SyntaxError(Ee("closing","]"));_.output=Q.escapeLast(_.output,"["),ue("brackets")}for(;_.parens>0;){if(s.strictBrackets===!0)throw new SyntaxError(Ee("closing",")"));_.output=Q.escapeLast(_.output,"("),ue("parens")}for(;_.braces>0;){if(s.strictBrackets===!0)throw new SyntaxError(Ee("closing","}"));_.output=Q.escapeLast(_.output,"{"),ue("braces")}if(s.strictSlashes!==!0&&(h.type==="star"||h.type==="bracket")&&I({type:"maybe_slash",value:"",output:`${y}?`}),_.backtrack===!0){_.output="";for(let m of _.tokens)_.output+=m.output!=null?m.output:m.value,m.suffix&&(_.output+=m.suffix)}return _};gt.fastpaths=(t,e)=>{let s={...e},r=typeof s.maxLength=="number"?Math.min(Ge,s.maxLength):Ge,n=t.length;if(n>r)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${r}`);t=Cs[t]||t;let o=Q.isWindows(e),{DOT_LITERAL:i,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:f,NO_DOT:u,NO_DOTS:d,NO_DOTS_SLASH:l,STAR:y,START_ANCHOR:E}=We.globChars(o),w=s.dot?d:u,v=s.dot?l:u,F=s.capture?"":"?:",Y={negated:!1,prefix:""},$=s.bash===!0?".*?":y;s.capture&&($=`(${$})`);let te=A=>A.noglobstar===!0?$:`(${F}(?:(?!${E}${A.dot?f:i}).)*?)`,q=A=>{switch(A){case"*":return`${w}${c}${$}`;case".*":return`${i}${c}${$}`;case"*.*":return`${w}${$}${i}${c}${$}`;case"*/*":return`${w}${$}${a}${c}${v}${$}`;case"**":return w+te(s);case"**/*":return`(?:${w}${te(s)}${a})?${v}${c}${$}`;case"**/*.*":return`(?:${w}${te(s)}${a})?${v}${$}${i}${c}${$}`;case"**/.*":return`(?:${w}${te(s)}${a})?${i}${c}${$}`;default:{let b=/^(.*?)\.(\w+)$/.exec(A);if(!b)return;let G=q(b[1]);return G?G+i+b[2]:void 0}}},ce=Q.removePrefix(t,Y),K=q(ce);return K&&s.strictSlashes!==!0&&(K+=`${a}?`),K};bs.exports=gt});var vs=x((bc,ks)=>{"use strict";var Ei=L("path"),yi=Is(),Et=xs(),yt=Be(),mi=Ae(),wi=t=>t&&typeof t=="object"&&!Array.isArray(t),M=(t,e,s=!1)=>{if(Array.isArray(t)){let u=t.map(l=>M(l,e,s));return l=>{for(let y of u){let E=y(l);if(E)return E}return!1}}let r=wi(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!r)throw new TypeError("Expected pattern to be a non-empty string");let n=e||{},o=yt.isWindows(e),i=r?M.compileRe(t,e):M.makeRe(t,e,!1,!0),a=i.state;delete i.state;let c=()=>!1;if(n.ignore){let u={...e,ignore:null,onMatch:null,onResult:null};c=M(n.ignore,u,s)}let f=(u,d=!1)=>{let{isMatch:l,match:y,output:E}=M.test(u,i,e,{glob:t,posix:o}),w={glob:t,state:a,regex:i,posix:o,input:u,output:E,match:y,isMatch:l};return typeof n.onResult=="function"&&n.onResult(w),l===!1?(w.isMatch=!1,d?w:!1):c(u)?(typeof n.onIgnore=="function"&&n.onIgnore(w),w.isMatch=!1,d?w:!1):(typeof n.onMatch=="function"&&n.onMatch(w),d?w:!0)};return s&&(f.state=a),f};M.test=(t,e,s,{glob:r,posix:n}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let o=s||{},i=o.format||(n?yt.toPosixSlashes:null),a=t===r,c=a&&i?i(t):t;return a===!1&&(c=i?i(t):t,a=c===r),(a===!1||o.capture===!0)&&(o.matchBase===!0||o.basename===!0?a=M.matchBase(t,e,s,n):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};M.matchBase=(t,e,s,r=yt.isWindows(s))=>(e instanceof RegExp?e:M.makeRe(e,s)).test(Ei.basename(t));M.isMatch=(t,e,s)=>M(e,s)(t);M.parse=(t,e)=>Array.isArray(t)?t.map(s=>M.parse(s,e)):Et(t,{...e,fastpaths:!1});M.scan=(t,e)=>yi(t,e);M.compileRe=(t,e,s=!1,r=!1)=>{if(s===!0)return t.output;let n=e||{},o=n.contains?"":"^",i=n.contains?"":"$",a=`${o}(?:${t.output})${i}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let c=M.toRegex(a,e);return r===!0&&(c.state=t),c};M.makeRe=(t,e={},s=!1,r=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let n={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(n.output=Et.fastpaths(t,e)),n.output||(n=Et(t,e)),M.compileRe(n,e,s,r)};M.toRegex=(t,e)=>{try{let s=e||{};return new RegExp(t,s.flags||(s.nocase?"i":""))}catch(s){if(e&&e.debug===!0)throw s;return/$^/}};M.constants=mi;ks.exports=M});var mt=x((xc,Ps)=>{"use strict";Ps.exports=vs()});var Ms=x((kc,$s)=>{"use strict";var Ie=L("fs"),{Readable:Ri}=L("stream"),Se=L("path"),{promisify:Ve}=L("util"),wt=mt(),Ai=Ve(Ie.readdir),Ti=Ve(Ie.stat),Ns=Ve(Ie.lstat),Si=Ve(Ie.realpath),Ii="!",Ds="READDIRP_RECURSIVE_ERROR",Ci=new Set(["ENOENT","EPERM","EACCES","ELOOP",Ds]),Rt="files",Fs="directories",Ke="files_directories",qe="all",Os=[Rt,Fs,Ke,qe],bi=t=>Ci.has(t.code),[Ls,xi]=process.versions.node.split(".").slice(0,2).map(t=>Number.parseInt(t,10)),ki=process.platform==="win32"&&(Ls>10||Ls===10&&xi>=5),Hs=t=>{if(t!==void 0){if(typeof t=="function")return t;if(typeof t=="string"){let e=wt(t.trim());return s=>e(s.basename)}if(Array.isArray(t)){let e=[],s=[];for(let r of t){let n=r.trim();n.charAt(0)===Ii?s.push(wt(n.slice(1))):e.push(wt(n))}return s.length>0?e.length>0?r=>e.some(n=>n(r.basename))&&!s.some(n=>n(r.basename)):r=>!s.some(n=>n(r.basename)):r=>e.some(n=>n(r.basename))}}},je=class t extends Ri{static get defaultOptions(){return{root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:Rt,lstat:!1,depth:2147483648,alwaysStat:!1}}constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark||4096});let s={...t.defaultOptions,...e},{root:r,type:n}=s;this._fileFilter=Hs(s.fileFilter),this._directoryFilter=Hs(s.directoryFilter);let o=s.lstat?Ns:Ti;ki?this._stat=i=>o(i,{bigint:!0}):this._stat=o,this._maxDepth=s.depth,this._wantsDir=[Fs,Ke,qe].includes(n),this._wantsFile=[Rt,Ke,qe].includes(n),this._wantsEverything=n===qe,this._root=Se.resolve(r),this._isDirent="Dirent"in Ie&&!s.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(r,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let{path:s,depth:r,files:n=[]}=this.parent||{};if(n.length>0){let o=n.splice(0,e).map(i=>this._formatEntry(i,s));for(let i of await Promise.all(o)){if(this.destroyed)return;let a=await this._getEntryType(i);a==="directory"&&this._directoryFilter(i)?(r<=this._maxDepth&&this.parents.push(this._exploreDir(i.fullPath,r+1)),this._wantsDir&&(this.push(i),e--)):(a==="file"||this._includeAsFile(i))&&this._fileFilter(i)&&this._wantsFile&&(this.push(i),e--)}}else{let o=this.parents.pop();if(!o){this.push(null);break}if(this.parent=await o,this.destroyed)return}}}catch(s){this.destroy(s)}finally{this.reading=!1}}}async _exploreDir(e,s){let r;try{r=await Ai(e,this._rdOptions)}catch(n){this._onError(n)}return{files:r,depth:s,path:e}}async _formatEntry(e,s){let r;try{let n=this._isDirent?e.name:e,o=Se.resolve(Se.join(s,n));r={path:Se.relative(this._root,o),fullPath:o,basename:n},r[this._statsProp]=this._isDirent?e:await this._stat(o)}catch(n){this._onError(n)}return r}_onError(e){bi(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}async _getEntryType(e){let s=e&&e[this._statsProp];if(s){if(s.isFile())return"file";if(s.isDirectory())return"directory";if(s&&s.isSymbolicLink()){let r=e.fullPath;try{let n=await Si(r),o=await Ns(n);if(o.isFile())return"file";if(o.isDirectory()){let i=n.length;if(r.startsWith(n)&&r.substr(i,1)===Se.sep){let a=new Error(`Circular symlink detected: "${r}" points to "${n}"`);return a.code=Ds,this._onError(a)}return"directory"}}catch(n){this._onError(n)}}}}_includeAsFile(e){let s=e&&e[this._statsProp];return s&&this._wantsEverything&&!s.isDirectory()}},ye=(t,e={})=>{let s=e.entryType||e.type;if(s==="both"&&(s=Ke),s&&(e.type=s),t){if(typeof t!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(s&&!Os.includes(s))throw new Error(`readdirp: Invalid type passed. Use one of ${Os.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=t,new je(e)},vi=(t,e={})=>new Promise((s,r)=>{let n=[];ye(t,e).on("data",o=>n.push(o)).on("end",()=>s(n)).on("error",o=>r(o))});ye.promise=vi;ye.ReaddirpStream=je;ye.default=ye;$s.exports=ye});var At=x((vc,Us)=>{Us.exports=function(t,e){if(typeof t!="string")throw new TypeError("expected path to be a string");if(t==="\\"||t==="/")return"/";var s=t.length;if(s<=1)return t;var r="";if(s>4&&t[3]==="\\"){var n=t[2];(n==="?"||n===".")&&t.slice(0,2)==="\\\\"&&(t=t.slice(2),r="//")}var o=t.split(/[/\\]+/);return e!==!1&&o[o.length-1]===""&&o.pop(),r+o.join("/")}});var js=x((qs,Ks)=>{"use strict";Object.defineProperty(qs,"__esModule",{value:!0});var Gs=mt(),Pi=At(),Bs="!",Ni={returnIndex:!1},Oi=t=>Array.isArray(t)?t:[t],Li=(t,e)=>{if(typeof t=="function")return t;if(typeof t=="string"){let s=Gs(t,e);return r=>t===r||s(r)}return t instanceof RegExp?s=>t.test(s):s=>!1},Ws=(t,e,s,r)=>{let n=Array.isArray(s),o=n?s[0]:s;if(!n&&typeof o!="string")throw new TypeError("anymatch: second argument must be a string: got "+Object.prototype.toString.call(o));let i=Pi(o,!1);for(let c=0;c<e.length;c++){let f=e[c];if(f(i))return r?-1:!1}let a=n&&[i].concat(s.slice(1));for(let c=0;c<t.length;c++){let f=t[c];if(n?f(...a):f(i))return r?c:!0}return r?-1:!1},Tt=(t,e,s=Ni)=>{if(t==null)throw new TypeError("anymatch: specify first argument");let r=typeof s=="boolean"?{returnIndex:s}:s,n=r.returnIndex||!1,o=Oi(t),i=o.filter(c=>typeof c=="string"&&c.charAt(0)===Bs).map(c=>c.slice(1)).map(c=>Gs(c,r)),a=o.filter(c=>typeof c!="string"||typeof c=="string"&&c.charAt(0)!==Bs).map(c=>Li(c,r));return e==null?(c,f=!1)=>Ws(a,i,c,typeof f=="boolean"?f:!1):Ws(a,i,e,n)};Tt.default=Tt;Ks.exports=Tt});var Ys=x((Pc,Vs)=>{Vs.exports=function(e){if(typeof e!="string"||e==="")return!1;for(var s;s=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(s[2])return!0;e=e.slice(s.index+s[0].length)}return!1}});var St=x((Nc,Xs)=>{var Hi=Ys(),zs={"{":"}","(":")","[":"]"},Di=function(t){if(t[0]==="!")return!0;for(var e=0,s=-2,r=-2,n=-2,o=-2,i=-2;e<t.length;){if(t[e]==="*"||t[e+1]==="?"&&/[\].+)]/.test(t[e])||r!==-1&&t[e]==="["&&t[e+1]!=="]"&&(r<e&&(r=t.indexOf("]",e)),r>e&&(i===-1||i>r||(i=t.indexOf("\\",e),i===-1||i>r)))||n!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(n=t.indexOf("}",e),n>e&&(i=t.indexOf("\\",e),i===-1||i>n))||o!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(o=t.indexOf(")",e),o>e&&(i=t.indexOf("\\",e),i===-1||i>o))||s!==-1&&t[e]==="("&&t[e+1]!=="|"&&(s<e&&(s=t.indexOf("|",e)),s!==-1&&t[s+1]!==")"&&(o=t.indexOf(")",s),o>s&&(i=t.indexOf("\\",s),i===-1||i>o))))return!0;if(t[e]==="\\"){var a=t[e+1];e+=2;var c=zs[a];if(c){var f=t.indexOf(c,e);f!==-1&&(e=f+1)}if(t[e]==="!")return!0}else e++}return!1},Fi=function(t){if(t[0]==="!")return!0;for(var e=0;e<t.length;){if(/[*?{}()[\]]/.test(t[e]))return!0;if(t[e]==="\\"){var s=t[e+1];e+=2;var r=zs[s];if(r){var n=t.indexOf(r,e);n!==-1&&(e=n+1)}if(t[e]==="!")return!0}else e++}return!1};Xs.exports=function(e,s){if(typeof e!="string"||e==="")return!1;if(Hi(e))return!0;var r=Di;return s&&s.strict===!1&&(r=Fi),r(e)}});var Zs=x((Oc,Qs)=>{"use strict";var $i=St(),Mi=L("path").posix.dirname,Ui=L("os").platform()==="win32",It="/",Bi=/\\/g,Wi=/[\{\[].*[\}\]]$/,Gi=/(^|[^\\])([\{\[]|\([^\)]+$)/,qi=/\\([\!\*\?\|\[\]\(\)\{\}])/g;Qs.exports=function(e,s){var r=Object.assign({flipBackslashes:!0},s);r.flipBackslashes&&Ui&&e.indexOf(It)<0&&(e=e.replace(Bi,It)),Wi.test(e)&&(e+=It),e+="a";do e=Mi(e);while($i(e)||Gi.test(e));return e.replace(qi,"$1")}});var Ye=x(J=>{"use strict";J.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1;J.find=(t,e)=>t.nodes.find(s=>s.type===e);J.exceedsLimit=(t,e,s=1,r)=>r===!1||!J.isInteger(t)||!J.isInteger(e)?!1:(Number(e)-Number(t))/Number(s)>=r;J.escapeNode=(t,e=0,s)=>{let r=t.nodes[e];r&&(s&&r.type===s||r.type==="open"||r.type==="close")&&r.escaped!==!0&&(r.value="\\"+r.value,r.escaped=!0)};J.encloseBrace=t=>t.type!=="brace"||t.commas>>0+t.ranges>>0?!1:(t.invalid=!0,!0);J.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:!(t.commas>>0+t.ranges>>0)||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1;J.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0;J.reduce=t=>t.reduce((e,s)=>(s.type==="text"&&e.push(s.value),s.type==="range"&&(s.type="text"),e),[]);J.flatten=(...t)=>{let e=[],s=r=>{for(let n=0;n<r.length;n++){let o=r[n];if(Array.isArray(o)){s(o);continue}o!==void 0&&e.push(o)}return e};return s(t),e}});var ze=x((Hc,er)=>{"use strict";var Js=Ye();er.exports=(t,e={})=>{let s=(r,n={})=>{let o=e.escapeInvalid&&Js.isInvalidBrace(n),i=r.invalid===!0&&e.escapeInvalid===!0,a="";if(r.value)return(o||i)&&Js.isOpenOrClose(r)?"\\"+r.value:r.value;if(r.value)return r.value;if(r.nodes)for(let c of r.nodes)a+=s(c);return a};return s(t)}});var sr=x((Dc,tr)=>{"use strict";tr.exports=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1}});var fr=x((Fc,ur)=>{"use strict";var rr=sr(),fe=(t,e,s)=>{if(rr(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(rr(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let r={relaxZeros:!0,...s};typeof r.strictZeros=="boolean"&&(r.relaxZeros=r.strictZeros===!1);let n=String(r.relaxZeros),o=String(r.shorthand),i=String(r.capture),a=String(r.wrap),c=t+":"+e+"="+n+o+i+a;if(fe.cache.hasOwnProperty(c))return fe.cache[c].result;let f=Math.min(t,e),u=Math.max(t,e);if(Math.abs(f-u)===1){let w=t+"|"+e;return r.capture?`(${w})`:r.wrap===!1?w:`(?:${w})`}let d=lr(t)||lr(e),l={min:t,max:e,a:f,b:u},y=[],E=[];if(d&&(l.isPadded=d,l.maxLen=String(l.max).length),f<0){let w=u<0?Math.abs(u):1;E=nr(w,Math.abs(f),l,r),f=l.a=0}return u>=0&&(y=nr(f,u,l,r)),l.negatives=E,l.positives=y,l.result=Ki(E,y,r),r.capture===!0?l.result=`(${l.result})`:r.wrap!==!1&&y.length+E.length>1&&(l.result=`(?:${l.result})`),fe.cache[c]=l,l.result};function Ki(t,e,s){let r=Ct(t,e,"-",!1,s)||[],n=Ct(e,t,"",!1,s)||[],o=Ct(t,e,"-?",!0,s)||[];return r.concat(o).concat(n).join("|")}function ji(t,e){let s=1,r=1,n=or(t,s),o=new Set([e]);for(;t<=n&&n<=e;)o.add(n),s+=1,n=or(t,s);for(n=ar(e+1,r)-1;t<n&&n<=e;)o.add(n),r+=1,n=ar(e+1,r)-1;return o=[...o],o.sort(zi),o}function Vi(t,e,s){if(t===e)return{pattern:t,count:[],digits:0};let r=Yi(t,e),n=r.length,o="",i=0;for(let a=0;a<n;a++){let[c,f]=r[a];c===f?o+=c:c!=="0"||f!=="9"?o+=Xi(c,f,s):i++}return i&&(o+=s.shorthand===!0?"\\d":"[0-9]"),{pattern:o,count:[i],digits:n}}function nr(t,e,s,r){let n=ji(t,e),o=[],i=t,a;for(let c=0;c<n.length;c++){let f=n[c],u=Vi(String(i),String(f),r),d="";if(!s.isPadded&&a&&a.pattern===u.pattern){a.count.length>1&&a.count.pop(),a.count.push(u.count[0]),a.string=a.pattern+cr(a.count),i=f+1;continue}s.isPadded&&(d=Qi(f,s,r)),u.string=d+u.pattern+cr(u.count),o.push(u),i=f+1,a=u}return o}function Ct(t,e,s,r,n){let o=[];for(let i of t){let{string:a}=i;!r&&!ir(e,"string",a)&&o.push(s+a),r&&ir(e,"string",a)&&o.push(s+a)}return o}function Yi(t,e){let s=[];for(let r=0;r<t.length;r++)s.push([t[r],e[r]]);return s}function zi(t,e){return t>e?1:e>t?-1:0}function ir(t,e,s){return t.some(r=>r[e]===s)}function or(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function ar(t,e){return t-t%Math.pow(10,e)}function cr(t){let[e=0,s=""]=t;return s||e>1?`{${e+(s?","+s:"")}}`:""}function Xi(t,e,s){return`[${t}${e-t===1?"":"-"}${e}]`}function lr(t){return/^-?(0+)\d/.test(t)}function Qi(t,e,s){if(!e.isPadded)return t;let r=Math.abs(e.maxLen-String(t).length),n=s.relaxZeros!==!1;switch(r){case 0:return"";case 1:return n?"0?":"0";case 2:return n?"0{0,2}":"00";default:return n?`0{0,${r}}`:`0{${r}}`}}fe.cache={};fe.clearCache=()=>fe.cache={};ur.exports=fe});var kt=x(($c,yr)=>{"use strict";var Zi=L("util"),hr=fr(),dr=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),Ji=t=>e=>t===!0?Number(e):String(e),bt=t=>typeof t=="number"||typeof t=="string"&&t!=="",Ce=t=>Number.isInteger(+t),xt=t=>{let e=`${t}`,s=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++s]==="0";);return s>0},eo=(t,e,s)=>typeof t=="string"||typeof e=="string"?!0:s.stringify===!0,to=(t,e,s)=>{if(e>0){let r=t[0]==="-"?"-":"";r&&(t=t.slice(1)),t=r+t.padStart(r?e-1:e,"0")}return s===!1?String(t):t},Qe=(t,e)=>{let s=t[0]==="-"?"-":"";for(s&&(t=t.slice(1),e--);t.length<e;)t="0"+t;return s?"-"+t:t},so=(t,e,s)=>{t.negatives.sort((a,c)=>a<c?-1:a>c?1:0),t.positives.sort((a,c)=>a<c?-1:a>c?1:0);let r=e.capture?"":"?:",n="",o="",i;return t.positives.length&&(n=t.positives.map(a=>Qe(String(a),s)).join("|")),t.negatives.length&&(o=`-(${r}${t.negatives.map(a=>Qe(String(a),s)).join("|")})`),n&&o?i=`${n}|${o}`:i=n||o,e.wrap?`(${r}${i})`:i},pr=(t,e,s,r)=>{if(s)return hr(t,e,{wrap:!1,...r});let n=String.fromCharCode(t);if(t===e)return n;let o=String.fromCharCode(e);return`[${n}-${o}]`},_r=(t,e,s)=>{if(Array.isArray(t)){let r=s.wrap===!0,n=s.capture?"":"?:";return r?`(${n}${t.join("|")})`:t.join("|")}return hr(t,e,s)},gr=(...t)=>new RangeError("Invalid range arguments: "+Zi.inspect(...t)),Er=(t,e,s)=>{if(s.strictRanges===!0)throw gr([t,e]);return[]},ro=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return[]},no=(t,e,s=1,r={})=>{let n=Number(t),o=Number(e);if(!Number.isInteger(n)||!Number.isInteger(o)){if(r.strictRanges===!0)throw gr([t,e]);return[]}n===0&&(n=0),o===0&&(o=0);let i=n>o,a=String(t),c=String(e),f=String(s);s=Math.max(Math.abs(s),1);let u=xt(a)||xt(c)||xt(f),d=u?Math.max(a.length,c.length,f.length):0,l=u===!1&&eo(t,e,r)===!1,y=r.transform||Ji(l);if(r.toRegex&&s===1)return pr(Qe(t,d),Qe(e,d),!0,r);let E={negatives:[],positives:[]},w=Y=>E[Y<0?"negatives":"positives"].push(Math.abs(Y)),v=[],F=0;for(;i?n>=o:n<=o;)r.toRegex===!0&&s>1?w(n):v.push(to(y(n,F),d,l)),n=i?n-s:n+s,F++;return r.toRegex===!0?s>1?so(E,r,d):_r(v,null,{wrap:!1,...r}):v},io=(t,e,s=1,r={})=>{if(!Ce(t)&&t.length>1||!Ce(e)&&e.length>1)return Er(t,e,r);let n=r.transform||(l=>String.fromCharCode(l)),o=`${t}`.charCodeAt(0),i=`${e}`.charCodeAt(0),a=o>i,c=Math.min(o,i),f=Math.max(o,i);if(r.toRegex&&s===1)return pr(c,f,!1,r);let u=[],d=0;for(;a?o>=i:o<=i;)u.push(n(o,d)),o=a?o-s:o+s,d++;return r.toRegex===!0?_r(u,null,{wrap:!1,options:r}):u},Xe=(t,e,s,r={})=>{if(e==null&&bt(t))return[t];if(!bt(t)||!bt(e))return Er(t,e,r);if(typeof s=="function")return Xe(t,e,1,{transform:s});if(dr(s))return Xe(t,e,0,s);let n={...r};return n.capture===!0&&(n.wrap=!0),s=s||n.step||1,Ce(s)?Ce(t)&&Ce(e)?no(t,e,s,n):io(t,e,Math.max(Math.abs(s),1),n):s!=null&&!dr(s)?ro(s,n):Xe(t,e,1,s)};yr.exports=Xe});var Rr=x((Mc,wr)=>{"use strict";var oo=kt(),mr=Ye(),ao=(t,e={})=>{let s=(r,n={})=>{let o=mr.isInvalidBrace(n),i=r.invalid===!0&&e.escapeInvalid===!0,a=o===!0||i===!0,c=e.escapeInvalid===!0?"\\":"",f="";if(r.isOpen===!0)return c+r.value;if(r.isClose===!0)return console.log("node.isClose",c,r.value),c+r.value;if(r.type==="open")return a?c+r.value:"(";if(r.type==="close")return a?c+r.value:")";if(r.type==="comma")return r.prev.type==="comma"?"":a?r.value:"|";if(r.value)return r.value;if(r.nodes&&r.ranges>0){let u=mr.reduce(r.nodes),d=oo(...u,{...e,wrap:!1,toRegex:!0,strictZeros:!0});if(d.length!==0)return u.length>1&&d.length>1?`(${d})`:d}if(r.nodes)for(let u of r.nodes)f+=s(u,r);return f};return s(t)};wr.exports=ao});var Sr=x((Uc,Tr)=>{"use strict";var co=kt(),Ar=ze(),me=Ye(),de=(t="",e="",s=!1)=>{let r=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return s?me.flatten(e).map(n=>`{${n}}`):e;for(let n of t)if(Array.isArray(n))for(let o of n)r.push(de(o,e,s));else for(let o of e)s===!0&&typeof o=="string"&&(o=`{${o}}`),r.push(Array.isArray(o)?de(n,o,s):n+o);return me.flatten(r)},lo=(t,e={})=>{let s=e.rangeLimit===void 0?1e3:e.rangeLimit,r=(n,o={})=>{n.queue=[];let i=o,a=o.queue;for(;i.type!=="brace"&&i.type!=="root"&&i.parent;)i=i.parent,a=i.queue;if(n.invalid||n.dollar){a.push(de(a.pop(),Ar(n,e)));return}if(n.type==="brace"&&n.invalid!==!0&&n.nodes.length===2){a.push(de(a.pop(),["{}"]));return}if(n.nodes&&n.ranges>0){let d=me.reduce(n.nodes);if(me.exceedsLimit(...d,e.step,s))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let l=co(...d,e);l.length===0&&(l=Ar(n,e)),a.push(de(a.pop(),l)),n.nodes=[];return}let c=me.encloseBrace(n),f=n.queue,u=n;for(;u.type!=="brace"&&u.type!=="root"&&u.parent;)u=u.parent,f=u.queue;for(let d=0;d<n.nodes.length;d++){let l=n.nodes[d];if(l.type==="comma"&&n.type==="brace"){d===1&&f.push(""),f.push("");continue}if(l.type==="close"){a.push(de(a.pop(),f,c));continue}if(l.value&&l.type!=="open"){f.push(de(f.pop(),l.value));continue}l.nodes&&r(l,n)}return f};return me.flatten(r(t))};Tr.exports=lo});var Cr=x((Bc,Ir)=>{"use strict";Ir.exports={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:`
2
+ `,CHAR_NO_BREAK_SPACE:"\xA0",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:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var Pr=x((Wc,vr)=>{"use strict";var uo=ze(),{MAX_LENGTH:br,CHAR_BACKSLASH:vt,CHAR_BACKTICK:fo,CHAR_COMMA:ho,CHAR_DOT:po,CHAR_LEFT_PARENTHESES:_o,CHAR_RIGHT_PARENTHESES:go,CHAR_LEFT_CURLY_BRACE:Eo,CHAR_RIGHT_CURLY_BRACE:yo,CHAR_LEFT_SQUARE_BRACKET:xr,CHAR_RIGHT_SQUARE_BRACKET:kr,CHAR_DOUBLE_QUOTE:mo,CHAR_SINGLE_QUOTE:wo,CHAR_NO_BREAK_SPACE:Ro,CHAR_ZERO_WIDTH_NOBREAK_SPACE:Ao}=Cr(),To=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let s=e||{},r=typeof s.maxLength=="number"?Math.min(br,s.maxLength):br;if(t.length>r)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${r})`);let n={type:"root",input:t,nodes:[]},o=[n],i=n,a=n,c=0,f=t.length,u=0,d=0,l,y=()=>t[u++],E=w=>{if(w.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&w.type==="text"){a.value+=w.value;return}return i.nodes.push(w),w.parent=i,w.prev=a,a=w,w};for(E({type:"bos"});u<f;)if(i=o[o.length-1],l=y(),!(l===Ao||l===Ro)){if(l===vt){E({type:"text",value:(e.keepEscaping?l:"")+y()});continue}if(l===kr){E({type:"text",value:"\\"+l});continue}if(l===xr){c++;let w;for(;u<f&&(w=y());){if(l+=w,w===xr){c++;continue}if(w===vt){l+=y();continue}if(w===kr&&(c--,c===0))break}E({type:"text",value:l});continue}if(l===_o){i=E({type:"paren",nodes:[]}),o.push(i),E({type:"text",value:l});continue}if(l===go){if(i.type!=="paren"){E({type:"text",value:l});continue}i=o.pop(),E({type:"text",value:l}),i=o[o.length-1];continue}if(l===mo||l===wo||l===fo){let w=l,v;for(e.keepQuotes!==!0&&(l="");u<f&&(v=y());){if(v===vt){l+=v+y();continue}if(v===w){e.keepQuotes===!0&&(l+=v);break}l+=v}E({type:"text",value:l});continue}if(l===Eo){d++;let v={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||i.dollar===!0,depth:d,commas:0,ranges:0,nodes:[]};i=E(v),o.push(i),E({type:"open",value:l});continue}if(l===yo){if(i.type!=="brace"){E({type:"text",value:l});continue}let w="close";i=o.pop(),i.close=!0,E({type:w,value:l}),d--,i=o[o.length-1];continue}if(l===ho&&d>0){if(i.ranges>0){i.ranges=0;let w=i.nodes.shift();i.nodes=[w,{type:"text",value:uo(i)}]}E({type:"comma",value:l}),i.commas++;continue}if(l===po&&d>0&&i.commas===0){let w=i.nodes;if(d===0||w.length===0){E({type:"text",value:l});continue}if(a.type==="dot"){if(i.range=[],a.value+=l,a.type="range",i.nodes.length!==3&&i.nodes.length!==5){i.invalid=!0,i.ranges=0,a.type="text";continue}i.ranges++,i.args=[];continue}if(a.type==="range"){w.pop();let v=w[w.length-1];v.value+=a.value+l,a=v,i.ranges--;continue}E({type:"dot",value:l});continue}E({type:"text",value:l})}do if(i=o.pop(),i.type!=="root"){i.nodes.forEach(F=>{F.nodes||(F.type==="open"&&(F.isOpen=!0),F.type==="close"&&(F.isClose=!0),F.nodes||(F.type="text"),F.invalid=!0)});let w=o[o.length-1],v=w.nodes.indexOf(i);w.nodes.splice(v,1,...i.nodes)}while(o.length>0);return E({type:"eos"}),n};vr.exports=To});var Lr=x((Gc,Or)=>{"use strict";var Nr=ze(),So=Rr(),Io=Sr(),Co=Pr(),Z=(t,e={})=>{let s=[];if(Array.isArray(t))for(let r of t){let n=Z.create(r,e);Array.isArray(n)?s.push(...n):s.push(n)}else s=[].concat(Z.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(s=[...new Set(s)]),s};Z.parse=(t,e={})=>Co(t,e);Z.stringify=(t,e={})=>Nr(typeof t=="string"?Z.parse(t,e):t,e);Z.compile=(t,e={})=>(typeof t=="string"&&(t=Z.parse(t,e)),So(t,e));Z.expand=(t,e={})=>{typeof t=="string"&&(t=Z.parse(t,e));let s=Io(t,e);return e.noempty===!0&&(s=s.filter(Boolean)),e.nodupes===!0&&(s=[...new Set(s)]),s};Z.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?Z.compile(t,e):Z.expand(t,e);Or.exports=Z});var Hr=x((qc,bo)=>{bo.exports=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]});var Fr=x((Kc,Dr)=>{Dr.exports=Hr()});var Mr=x((jc,$r)=>{"use strict";var xo=L("path"),ko=Fr(),vo=new Set(ko);$r.exports=t=>vo.has(xo.extname(t).slice(1).toLowerCase())});var Ze=x(R=>{"use strict";var{sep:Po}=L("path"),{platform:Pt}=process,No=L("os");R.EV_ALL="all";R.EV_READY="ready";R.EV_ADD="add";R.EV_CHANGE="change";R.EV_ADD_DIR="addDir";R.EV_UNLINK="unlink";R.EV_UNLINK_DIR="unlinkDir";R.EV_RAW="raw";R.EV_ERROR="error";R.STR_DATA="data";R.STR_END="end";R.STR_CLOSE="close";R.FSEVENT_CREATED="created";R.FSEVENT_MODIFIED="modified";R.FSEVENT_DELETED="deleted";R.FSEVENT_MOVED="moved";R.FSEVENT_CLONED="cloned";R.FSEVENT_UNKNOWN="unknown";R.FSEVENT_FLAG_MUST_SCAN_SUBDIRS=1;R.FSEVENT_TYPE_FILE="file";R.FSEVENT_TYPE_DIRECTORY="directory";R.FSEVENT_TYPE_SYMLINK="symlink";R.KEY_LISTENERS="listeners";R.KEY_ERR="errHandlers";R.KEY_RAW="rawEmitters";R.HANDLER_KEYS=[R.KEY_LISTENERS,R.KEY_ERR,R.KEY_RAW];R.DOT_SLASH=`.${Po}`;R.BACK_SLASH_RE=/\\/g;R.DOUBLE_SLASH_RE=/\/\//;R.SLASH_OR_BACK_SLASH_RE=/[/\\]/;R.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/;R.REPLACER_RE=/^\.[/\\]/;R.SLASH="/";R.SLASH_SLASH="//";R.BRACE_START="{";R.BANG="!";R.ONE_DOT=".";R.TWO_DOTS="..";R.STAR="*";R.GLOBSTAR="**";R.ROOT_GLOBSTAR="/**/*";R.SLASH_GLOBSTAR="/**";R.DIR_SUFFIX="Dir";R.ANYMATCH_OPTS={dot:!0};R.STRING_TYPE="string";R.FUNCTION_TYPE="function";R.EMPTY_STR="";R.EMPTY_FN=()=>{};R.IDENTITY_FN=t=>t;R.isWindows=Pt==="win32";R.isMacos=Pt==="darwin";R.isLinux=Pt==="linux";R.isIBMi=No.type()==="OS400"});var Kr=x((Yc,qr)=>{"use strict";var oe=L("fs"),B=L("path"),{promisify:ve}=L("util"),Oo=Mr(),{isWindows:Lo,isLinux:Ho,EMPTY_FN:Do,EMPTY_STR:Fo,KEY_LISTENERS:we,KEY_ERR:Nt,KEY_RAW:be,HANDLER_KEYS:$o,EV_CHANGE:et,EV_ADD:Je,EV_ADD_DIR:Mo,EV_ERROR:Br,STR_DATA:Uo,STR_END:Bo,BRACE_START:Wo,STAR:Go}=Ze(),qo="watch",Ko=ve(oe.open),Wr=ve(oe.stat),jo=ve(oe.lstat),Vo=ve(oe.close),Ot=ve(oe.realpath),Yo={lstat:jo,stat:Wr},Ht=(t,e)=>{t instanceof Set?t.forEach(e):e(t)},xe=(t,e,s)=>{let r=t[e];r instanceof Set||(t[e]=r=new Set([r])),r.add(s)},zo=t=>e=>{let s=t[e];s instanceof Set?s.clear():delete t[e]},ke=(t,e,s)=>{let r=t[e];r instanceof Set?r.delete(s):r===s&&delete t[e]},Gr=t=>t instanceof Set?t.size===0:!t,tt=new Map;function Ur(t,e,s,r,n){let o=(i,a)=>{s(t),n(i,a,{watchedPath:t}),a&&t!==a&&st(B.resolve(t,a),we,B.join(t,a))};try{return oe.watch(t,e,o)}catch(i){r(i)}}var st=(t,e,s,r,n)=>{let o=tt.get(t);o&&Ht(o[e],i=>{i(s,r,n)})},Xo=(t,e,s,r)=>{let{listener:n,errHandler:o,rawEmitter:i}=r,a=tt.get(e),c;if(!s.persistent)return c=Ur(t,s,n,o,i),c.close.bind(c);if(a)xe(a,we,n),xe(a,Nt,o),xe(a,be,i);else{if(c=Ur(t,s,st.bind(null,e,we),o,st.bind(null,e,be)),!c)return;c.on(Br,async f=>{let u=st.bind(null,e,Nt);if(a.watcherUnusable=!0,Lo&&f.code==="EPERM")try{let d=await Ko(t,"r");await Vo(d),u(f)}catch{}else u(f)}),a={listeners:n,errHandlers:o,rawEmitters:i,watcher:c},tt.set(e,a)}return()=>{ke(a,we,n),ke(a,Nt,o),ke(a,be,i),Gr(a.listeners)&&(a.watcher.close(),tt.delete(e),$o.forEach(zo(a)),a.watcher=void 0,Object.freeze(a))}},Lt=new Map,Qo=(t,e,s,r)=>{let{listener:n,rawEmitter:o}=r,i=Lt.get(e),a=new Set,c=new Set,f=i&&i.options;return f&&(f.persistent<s.persistent||f.interval>s.interval)&&(a=i.listeners,c=i.rawEmitters,oe.unwatchFile(e),i=void 0),i?(xe(i,we,n),xe(i,be,o)):(i={listeners:n,rawEmitters:o,options:s,watcher:oe.watchFile(e,s,(u,d)=>{Ht(i.rawEmitters,y=>{y(et,e,{curr:u,prev:d})});let l=u.mtimeMs;(u.size!==d.size||l>d.mtimeMs||l===0)&&Ht(i.listeners,y=>y(t,u))})},Lt.set(e,i)),()=>{ke(i,we,n),ke(i,be,o),Gr(i.listeners)&&(Lt.delete(e),oe.unwatchFile(e),i.options=i.watcher=void 0,Object.freeze(i))}},Dt=class{constructor(e){this.fsw=e,this._boundHandleError=s=>e._handleError(s)}_watchWithNodeFs(e,s){let r=this.fsw.options,n=B.dirname(e),o=B.basename(e);this.fsw._getWatchedDir(n).add(o);let a=B.resolve(e),c={persistent:r.persistent};s||(s=Do);let f;return r.usePolling?(c.interval=r.enableBinaryInterval&&Oo(o)?r.binaryInterval:r.interval,f=Qo(e,a,c,{listener:s,rawEmitter:this.fsw._emitRaw})):f=Xo(e,a,c,{listener:s,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),f}_handleFile(e,s,r){if(this.fsw.closed)return;let n=B.dirname(e),o=B.basename(e),i=this.fsw._getWatchedDir(n),a=s;if(i.has(o))return;let c=async(u,d)=>{if(this.fsw._throttle(qo,e,5)){if(!d||d.mtimeMs===0)try{let l=await Wr(e);if(this.fsw.closed)return;let y=l.atimeMs,E=l.mtimeMs;(!y||y<=E||E!==a.mtimeMs)&&this.fsw._emit(et,e,l),Ho&&a.ino!==l.ino?(this.fsw._closeFile(u),a=l,this.fsw._addPathCloser(u,this._watchWithNodeFs(e,c))):a=l}catch{this.fsw._remove(n,o)}else if(i.has(o)){let l=d.atimeMs,y=d.mtimeMs;(!l||l<=y||y!==a.mtimeMs)&&this.fsw._emit(et,e,d),a=d}}},f=this._watchWithNodeFs(e,c);if(!(r&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(Je,e,0))return;this.fsw._emit(Je,e,s)}return f}async _handleSymlink(e,s,r,n){if(this.fsw.closed)return;let o=e.fullPath,i=this.fsw._getWatchedDir(s);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let a;try{a=await Ot(r)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(i.has(n)?this.fsw._symlinkPaths.get(o)!==a&&(this.fsw._symlinkPaths.set(o,a),this.fsw._emit(et,r,e.stats)):(i.add(n),this.fsw._symlinkPaths.set(o,a),this.fsw._emit(Je,r,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(o))return!0;this.fsw._symlinkPaths.set(o,!0)}_handleRead(e,s,r,n,o,i,a){if(e=B.join(e,Fo),!r.hasGlob&&(a=this.fsw._throttle("readdir",e,1e3),!a))return;let c=this.fsw._getWatchedDir(r.path),f=new Set,u=this.fsw._readdirp(e,{fileFilter:d=>r.filterPath(d),directoryFilter:d=>r.filterDir(d),depth:0}).on(Uo,async d=>{if(this.fsw.closed){u=void 0;return}let l=d.path,y=B.join(e,l);if(f.add(l),!(d.stats.isSymbolicLink()&&await this._handleSymlink(d,e,y,l))){if(this.fsw.closed){u=void 0;return}(l===n||!n&&!c.has(l))&&(this.fsw._incrReadyCount(),y=B.join(o,B.relative(o,y)),this._addToNodeFs(y,s,r,i+1))}}).on(Br,this._boundHandleError);return new Promise(d=>u.once(Bo,()=>{if(this.fsw.closed){u=void 0;return}let l=a?a.clear():!1;d(),c.getChildren().filter(y=>y!==e&&!f.has(y)&&(!r.hasGlob||r.filterPath({fullPath:B.resolve(e,y)}))).forEach(y=>{this.fsw._remove(e,y)}),u=void 0,l&&this._handleRead(e,!1,r,n,o,i,a)}))}async _handleDir(e,s,r,n,o,i,a){let c=this.fsw._getWatchedDir(B.dirname(e)),f=c.has(B.basename(e));!(r&&this.fsw.options.ignoreInitial)&&!o&&!f&&(!i.hasGlob||i.globFilter(e))&&this.fsw._emit(Mo,e,s),c.add(B.basename(e)),this.fsw._getWatchedDir(e);let u,d,l=this.fsw.options.depth;if((l==null||n<=l)&&!this.fsw._symlinkPaths.has(a)){if(!o&&(await this._handleRead(e,r,i,o,e,n,u),this.fsw.closed))return;d=this._watchWithNodeFs(e,(y,E)=>{E&&E.mtimeMs===0||this._handleRead(y,!1,i,o,e,n,u)})}return d}async _addToNodeFs(e,s,r,n,o){let i=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return i(),!1;let a=this.fsw._getWatchHelpers(e,n);!a.hasGlob&&r&&(a.hasGlob=r.hasGlob,a.globFilter=r.globFilter,a.filterPath=c=>r.filterPath(c),a.filterDir=c=>r.filterDir(c));try{let c=await Yo[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))return i(),!1;let f=this.fsw.options.followSymlinks&&!e.includes(Go)&&!e.includes(Wo),u;if(c.isDirectory()){let d=B.resolve(e),l=f?await Ot(e):e;if(this.fsw.closed||(u=await this._handleDir(a.watchPath,c,s,n,o,a,l),this.fsw.closed))return;d!==l&&l!==void 0&&this.fsw._symlinkPaths.set(d,l)}else if(c.isSymbolicLink()){let d=f?await Ot(e):e;if(this.fsw.closed)return;let l=B.dirname(a.watchPath);if(this.fsw._getWatchedDir(l).add(a.watchPath),this.fsw._emit(Je,a.watchPath,c),u=await this._handleDir(l,c,s,n,e,a,d),this.fsw.closed)return;d!==void 0&&this.fsw._symlinkPaths.set(B.resolve(e),d)}else u=this._handleFile(a.watchPath,c,s);return i(),this.fsw._addPathCloser(e,u),!1}catch(c){if(this.fsw._handleError(c))return i(),e}}};qr.exports=Dt});var Zr=x((zc,qt)=>{"use strict";var Wt=L("fs"),W=L("path"),{promisify:Gt}=L("util"),Re;try{Re=L("fsevents")}catch(t){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(t)}if(Re){let t=process.version.match(/v(\d+)\.(\d+)/);if(t&&t[1]&&t[2]){let e=Number.parseInt(t[1],10),s=Number.parseInt(t[2],10);e===8&&s<16&&(Re=void 0)}}var{EV_ADD:Ft,EV_CHANGE:Zo,EV_ADD_DIR:jr,EV_UNLINK:rt,EV_ERROR:Jo,STR_DATA:ea,STR_END:ta,FSEVENT_CREATED:sa,FSEVENT_MODIFIED:ra,FSEVENT_DELETED:na,FSEVENT_MOVED:ia,FSEVENT_UNKNOWN:oa,FSEVENT_FLAG_MUST_SCAN_SUBDIRS:aa,FSEVENT_TYPE_FILE:ca,FSEVENT_TYPE_DIRECTORY:Pe,FSEVENT_TYPE_SYMLINK:Qr,ROOT_GLOBSTAR:Vr,DIR_SUFFIX:la,DOT_SLASH:Yr,FUNCTION_TYPE:$t,EMPTY_FN:ua,IDENTITY_FN:fa}=Ze(),da=t=>isNaN(t)?{}:{depth:t},Ut=Gt(Wt.stat),ha=Gt(Wt.lstat),zr=Gt(Wt.realpath),pa={stat:Ut,lstat:ha},he=new Map,_a=10,ga=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),Ea=(t,e)=>({stop:Re.watch(t,e)});function ya(t,e,s,r){let n=W.extname(e)?W.dirname(e):e,o=W.dirname(n),i=he.get(n);ma(o)&&(n=o);let a=W.resolve(t),c=a!==e,f=(d,l,y)=>{c&&(d=d.replace(e,a)),(d===a||!d.indexOf(a+W.sep))&&s(d,l,y)},u=!1;for(let d of he.keys())if(e.indexOf(W.resolve(d)+W.sep)===0){n=d,i=he.get(n),u=!0;break}return i||u?i.listeners.add(f):(i={listeners:new Set([f]),rawEmitter:r,watcher:Ea(n,(d,l)=>{if(!i.listeners.size||l&aa)return;let y=Re.getInfo(d,l);i.listeners.forEach(E=>{E(d,l,y)}),i.rawEmitter(y.event,d,y)})},he.set(n,i)),()=>{let d=i.listeners;if(d.delete(f),!d.size&&(he.delete(n),i.watcher))return i.watcher.stop().then(()=>{i.rawEmitter=i.watcher=void 0,Object.freeze(i)})}}var ma=t=>{let e=0;for(let s of he.keys())if(s.indexOf(t)===0&&(e++,e>=_a))return!0;return!1},wa=()=>Re&&he.size<128,Mt=(t,e)=>{let s=0;for(;!t.indexOf(e)&&(t=W.dirname(t))!==e;)s++;return s},Xr=(t,e)=>t.type===Pe&&e.isDirectory()||t.type===Qr&&e.isSymbolicLink()||t.type===ca&&e.isFile(),Bt=class{constructor(e){this.fsw=e}checkIgnored(e,s){let r=this.fsw._ignoredPaths;if(this.fsw._isIgnored(e,s))return r.add(e),s&&s.isDirectory()&&r.add(e+Vr),!0;r.delete(e),r.delete(e+Vr)}addOrChange(e,s,r,n,o,i,a,c){let f=o.has(i)?Zo:Ft;this.handleEvent(f,e,s,r,n,o,i,a,c)}async checkExists(e,s,r,n,o,i,a,c){try{let f=await Ut(e);if(this.fsw.closed)return;Xr(a,f)?this.addOrChange(e,s,r,n,o,i,a,c):this.handleEvent(rt,e,s,r,n,o,i,a,c)}catch(f){f.code==="EACCES"?this.addOrChange(e,s,r,n,o,i,a,c):this.handleEvent(rt,e,s,r,n,o,i,a,c)}}handleEvent(e,s,r,n,o,i,a,c,f){if(!(this.fsw.closed||this.checkIgnored(s)))if(e===rt){let u=c.type===Pe;(u||i.has(a))&&this.fsw._remove(o,a,u)}else{if(e===Ft){if(c.type===Pe&&this.fsw._getWatchedDir(s),c.type===Qr&&f.followSymlinks){let d=f.depth===void 0?void 0:Mt(r,n)+1;return this._addToFsEvents(s,!1,!0,d)}this.fsw._getWatchedDir(o).add(a)}let u=c.type===Pe?e+la:e;this.fsw._emit(u,s),u===jr&&this._addToFsEvents(s,!1,!0)}}_watchWithFsEvents(e,s,r,n){if(this.fsw.closed||this.fsw._isIgnored(e))return;let o=this.fsw.options,a=ya(e,s,async(c,f,u)=>{if(this.fsw.closed||o.depth!==void 0&&Mt(c,s)>o.depth)return;let d=r(W.join(e,W.relative(e,c)));if(n&&!n(d))return;let l=W.dirname(d),y=W.basename(d),E=this.fsw._getWatchedDir(u.type===Pe?d:l);if(ga.has(f)||u.event===oa)if(typeof o.ignored===$t){let w;try{w=await Ut(d)}catch{}if(this.fsw.closed||this.checkIgnored(d,w))return;Xr(u,w)?this.addOrChange(d,c,s,l,E,y,u,o):this.handleEvent(rt,d,c,s,l,E,y,u,o)}else this.checkExists(d,c,s,l,E,y,u,o);else switch(u.event){case sa:case ra:return this.addOrChange(d,c,s,l,E,y,u,o);case na:case ia:return this.checkExists(d,c,s,l,E,y,u,o)}},this.fsw._emitRaw);return this.fsw._emitReady(),a}async _handleFsEventsSymlink(e,s,r,n){if(!(this.fsw.closed||this.fsw._symlinkPaths.has(s))){this.fsw._symlinkPaths.set(s,!0),this.fsw._incrReadyCount();try{let o=await zr(e);if(this.fsw.closed)return;if(this.fsw._isIgnored(o))return this.fsw._emitReady();this.fsw._incrReadyCount(),this._addToFsEvents(o||e,i=>{let a=e;return o&&o!==Yr?a=i.replace(o,e):i!==Yr&&(a=W.join(e,i)),r(a)},!1,n)}catch(o){if(this.fsw._handleError(o))return this.fsw._emitReady()}}}emitAdd(e,s,r,n,o){let i=r(e),a=s.isDirectory(),c=this.fsw._getWatchedDir(W.dirname(i)),f=W.basename(i);a&&this.fsw._getWatchedDir(i),!c.has(f)&&(c.add(f),(!n.ignoreInitial||o===!0)&&this.fsw._emit(a?jr:Ft,i,s))}initWatch(e,s,r,n){if(this.fsw.closed)return;let o=this._watchWithFsEvents(r.watchPath,W.resolve(e||r.watchPath),n,r.globFilter);this.fsw._addPathCloser(s,o)}async _addToFsEvents(e,s,r,n){if(this.fsw.closed)return;let o=this.fsw.options,i=typeof s===$t?s:fa,a=this.fsw._getWatchHelpers(e);try{let c=await pa[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))throw null;if(c.isDirectory()){if(a.globFilter||this.emitAdd(i(e),c,i,o,r),n&&n>o.depth)return;this.fsw._readdirp(a.watchPath,{fileFilter:f=>a.filterPath(f),directoryFilter:f=>a.filterDir(f),...da(o.depth-(n||0))}).on(ea,f=>{if(this.fsw.closed||f.stats.isDirectory()&&!a.filterPath(f))return;let u=W.join(a.watchPath,f.path),{fullPath:d}=f;if(a.followSymlinks&&f.stats.isSymbolicLink()){let l=o.depth===void 0?void 0:Mt(u,W.resolve(a.watchPath))+1;this._handleFsEventsSymlink(u,d,i,l)}else this.emitAdd(u,f.stats,i,o,r)}).on(Jo,ua).on(ta,()=>{this.fsw._emitReady()})}else this.emitAdd(a.watchPath,c,i,o,r),this.fsw._emitReady()}catch(c){(!c||this.fsw._handleError(c))&&(this.fsw._emitReady(),this.fsw._emitReady())}if(o.persistent&&r!==!0)if(typeof s===$t)this.initWatch(void 0,e,a,i);else{let c;try{c=await zr(a.watchPath)}catch{}this.initWatch(c,e,a,i)}}};qt.exports=Bt;qt.exports.canUse=wa});var un=x(is=>{"use strict";var{EventEmitter:Ra}=L("events"),rs=L("fs"),k=L("path"),{promisify:on}=L("util"),Aa=Ms(),Xt=js().default,Ta=Zs(),Kt=St(),Sa=Lr(),Ia=At(),Ca=Kr(),Jr=Zr(),{EV_ALL:jt,EV_READY:ba,EV_ADD:nt,EV_CHANGE:Ne,EV_UNLINK:en,EV_ADD_DIR:xa,EV_UNLINK_DIR:ka,EV_RAW:va,EV_ERROR:Vt,STR_CLOSE:Pa,STR_END:Na,BACK_SLASH_RE:Oa,DOUBLE_SLASH_RE:tn,SLASH_OR_BACK_SLASH_RE:La,DOT_RE:Ha,REPLACER_RE:Da,SLASH:Yt,SLASH_SLASH:Fa,BRACE_START:$a,BANG:Qt,ONE_DOT:an,TWO_DOTS:Ma,GLOBSTAR:Ua,SLASH_GLOBSTAR:zt,ANYMATCH_OPTS:Zt,STRING_TYPE:ns,FUNCTION_TYPE:Ba,EMPTY_STR:Jt,EMPTY_FN:Wa,isWindows:Ga,isMacos:qa,isIBMi:Ka}=Ze(),ja=on(rs.stat),Va=on(rs.readdir),es=(t=[])=>Array.isArray(t)?t:[t],cn=(t,e=[])=>(t.forEach(s=>{Array.isArray(s)?cn(s,e):e.push(s)}),e),sn=t=>{let e=cn(es(t));if(!e.every(s=>typeof s===ns))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(ln)},rn=t=>{let e=t.replace(Oa,Yt),s=!1;for(e.startsWith(Fa)&&(s=!0);e.match(tn);)e=e.replace(tn,Yt);return s&&(e=Yt+e),e},ln=t=>rn(k.normalize(rn(t))),nn=(t=Jt)=>e=>typeof e!==ns?e:ln(k.isAbsolute(e)?e:k.join(t,e)),Ya=(t,e)=>k.isAbsolute(t)?t:t.startsWith(Qt)?Qt+k.join(e,t.slice(1)):k.join(e,t),ee=(t,e)=>t[e]===void 0,ts=class{constructor(e,s){this.path=e,this._removeWatcher=s,this.items=new Set}add(e){let{items:s}=this;s&&e!==an&&e!==Ma&&s.add(e)}async remove(e){let{items:s}=this;if(!s||(s.delete(e),s.size>0))return;let r=this.path;try{await Va(r)}catch{this._removeWatcher&&this._removeWatcher(k.dirname(r),k.basename(r))}}has(e){let{items:s}=this;if(s)return s.has(e)}getChildren(){let{items:e}=this;if(e)return[...e.values()]}dispose(){this.items.clear(),delete this.path,delete this._removeWatcher,delete this.items,Object.freeze(this)}},za="stat",Xa="lstat",ss=class{constructor(e,s,r,n){this.fsw=n,this.path=e=e.replace(Da,Jt),this.watchPath=s,this.fullWatchPath=k.resolve(s),this.hasGlob=s!==e,e===Jt&&(this.hasGlob=!1),this.globSymlink=this.hasGlob&&r?void 0:!1,this.globFilter=this.hasGlob?Xt(e,void 0,Zt):!1,this.dirParts=this.getDirParts(e),this.dirParts.forEach(o=>{o.length>1&&o.pop()}),this.followSymlinks=r,this.statMethod=r?za:Xa}checkGlobSymlink(e){return this.globSymlink===void 0&&(this.globSymlink=e.fullParentDir===this.fullWatchPath?!1:{realPath:e.fullParentDir,linkPath:this.fullWatchPath}),this.globSymlink?e.fullPath.replace(this.globSymlink.realPath,this.globSymlink.linkPath):e.fullPath}entryPath(e){return k.join(this.watchPath,k.relative(this.watchPath,this.checkGlobSymlink(e)))}filterPath(e){let{stats:s}=e;if(s&&s.isSymbolicLink())return this.filterDir(e);let r=this.entryPath(e);return(this.hasGlob&&typeof this.globFilter===Ba?this.globFilter(r):!0)&&this.fsw._isntIgnored(r,s)&&this.fsw._hasReadPermissions(s)}getDirParts(e){if(!this.hasGlob)return[];let s=[];return(e.includes($a)?Sa.expand(e):[e]).forEach(n=>{s.push(k.relative(this.watchPath,n).split(La))}),s}filterDir(e){if(this.hasGlob){let s=this.getDirParts(this.checkGlobSymlink(e)),r=!1;this.unmatchedGlob=!this.dirParts.some(n=>n.every((o,i)=>(o===Ua&&(r=!0),r||!s[0][i]||Xt(o,s[0][i],Zt))))}return!this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}},it=class extends Ra{constructor(e){super();let s={};e&&Object.assign(s,e),this._watched=new Map,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._symlinkPaths=new Map,this._streams=new Set,this.closed=!1,ee(s,"persistent")&&(s.persistent=!0),ee(s,"ignoreInitial")&&(s.ignoreInitial=!1),ee(s,"ignorePermissionErrors")&&(s.ignorePermissionErrors=!1),ee(s,"interval")&&(s.interval=100),ee(s,"binaryInterval")&&(s.binaryInterval=300),ee(s,"disableGlobbing")&&(s.disableGlobbing=!1),s.enableBinaryInterval=s.binaryInterval!==s.interval,ee(s,"useFsEvents")&&(s.useFsEvents=!s.usePolling),Jr.canUse()||(s.useFsEvents=!1),ee(s,"usePolling")&&!s.useFsEvents&&(s.usePolling=qa),Ka&&(s.usePolling=!0);let n=process.env.CHOKIDAR_USEPOLLING;if(n!==void 0){let c=n.toLowerCase();c==="false"||c==="0"?s.usePolling=!1:c==="true"||c==="1"?s.usePolling=!0:s.usePolling=!!c}let o=process.env.CHOKIDAR_INTERVAL;o&&(s.interval=Number.parseInt(o,10)),ee(s,"atomic")&&(s.atomic=!s.usePolling&&!s.useFsEvents),s.atomic&&(this._pendingUnlinks=new Map),ee(s,"followSymlinks")&&(s.followSymlinks=!0),ee(s,"awaitWriteFinish")&&(s.awaitWriteFinish=!1),s.awaitWriteFinish===!0&&(s.awaitWriteFinish={});let i=s.awaitWriteFinish;i&&(i.stabilityThreshold||(i.stabilityThreshold=2e3),i.pollInterval||(i.pollInterval=100),this._pendingWrites=new Map),s.ignored&&(s.ignored=es(s.ignored));let a=0;this._emitReady=()=>{a++,a>=this._readyCount&&(this._emitReady=Wa,this._readyEmitted=!0,process.nextTick(()=>this.emit(ba)))},this._emitRaw=(...c)=>this.emit(va,...c),this._readyEmitted=!1,this.options=s,s.useFsEvents?this._fsEventsHandler=new Jr(this):this._nodeFsHandler=new Ca(this),Object.freeze(s)}add(e,s,r){let{cwd:n,disableGlobbing:o}=this.options;this.closed=!1;let i=sn(e);return n&&(i=i.map(a=>{let c=Ya(a,n);return o||!Kt(a)?c:Ia(c)})),i=i.filter(a=>a.startsWith(Qt)?(this._ignoredPaths.add(a.slice(1)),!1):(this._ignoredPaths.delete(a),this._ignoredPaths.delete(a+zt),this._userIgnored=void 0,!0)),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=i.length),this.options.persistent&&(this._readyCount+=i.length),i.forEach(a=>this._fsEventsHandler._addToFsEvents(a))):(this._readyCount||(this._readyCount=0),this._readyCount+=i.length,Promise.all(i.map(async a=>{let c=await this._nodeFsHandler._addToNodeFs(a,!r,0,0,s);return c&&this._emitReady(),c})).then(a=>{this.closed||a.filter(c=>c).forEach(c=>{this.add(k.dirname(c),k.basename(s||c))})})),this}unwatch(e){if(this.closed)return this;let s=sn(e),{cwd:r}=this.options;return s.forEach(n=>{!k.isAbsolute(n)&&!this._closers.has(n)&&(r&&(n=k.join(r,n)),n=k.resolve(n)),this._closePath(n),this._ignoredPaths.add(n),this._watched.has(n)&&this._ignoredPaths.add(n+zt),this._userIgnored=void 0}),this}close(){if(this.closed)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(s=>s.forEach(r=>{let n=r();n instanceof Promise&&e.push(n)})),this._streams.forEach(s=>s.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(s=>s.dispose()),["closers","watched","streams","symlinkPaths","throttled"].forEach(s=>{this[`_${s}`].clear()}),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((s,r)=>{let n=this.options.cwd?k.relative(this.options.cwd,r):r;e[n||an]=s.getChildren().sort()}),e}emitWithAll(e,s){this.emit(...s),e!==Vt&&this.emit(jt,...s)}async _emit(e,s,r,n,o){if(this.closed)return;let i=this.options;Ga&&(s=k.normalize(s)),i.cwd&&(s=k.relative(i.cwd,s));let a=[e,s];o!==void 0?a.push(r,n,o):n!==void 0?a.push(r,n):r!==void 0&&a.push(r);let c=i.awaitWriteFinish,f;if(c&&(f=this._pendingWrites.get(s)))return f.lastChange=new Date,this;if(i.atomic){if(e===en)return this._pendingUnlinks.set(s,a),setTimeout(()=>{this._pendingUnlinks.forEach((u,d)=>{this.emit(...u),this.emit(jt,...u),this._pendingUnlinks.delete(d)})},typeof i.atomic=="number"?i.atomic:100),this;e===nt&&this._pendingUnlinks.has(s)&&(e=a[0]=Ne,this._pendingUnlinks.delete(s))}if(c&&(e===nt||e===Ne)&&this._readyEmitted){let u=(d,l)=>{d?(e=a[0]=Vt,a[1]=d,this.emitWithAll(e,a)):l&&(a.length>2?a[2]=l:a.push(l),this.emitWithAll(e,a))};return this._awaitWriteFinish(s,c.stabilityThreshold,e,u),this}if(e===Ne&&!this._throttle(Ne,s,50))return this;if(i.alwaysStat&&r===void 0&&(e===nt||e===xa||e===Ne)){let u=i.cwd?k.join(i.cwd,s):s,d;try{d=await ja(u)}catch{}if(!d||this.closed)return;a.push(d)}return this.emitWithAll(e,a),this}_handleError(e){let s=e&&e.code;return e&&s!=="ENOENT"&&s!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||s!=="EPERM"&&s!=="EACCES")&&this.emit(Vt,e),e||this.closed}_throttle(e,s,r){this._throttled.has(e)||this._throttled.set(e,new Map);let n=this._throttled.get(e),o=n.get(s);if(o)return o.count++,!1;let i,a=()=>{let f=n.get(s),u=f?f.count:0;return n.delete(s),clearTimeout(i),f&&clearTimeout(f.timeoutObject),u};i=setTimeout(a,r);let c={timeoutObject:i,clear:a,count:0};return n.set(s,c),c}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,s,r,n){let o,i=e;this.options.cwd&&!k.isAbsolute(e)&&(i=k.join(this.options.cwd,e));let a=new Date,c=f=>{rs.stat(i,(u,d)=>{if(u||!this._pendingWrites.has(e)){u&&u.code!=="ENOENT"&&n(u);return}let l=Number(new Date);f&&d.size!==f.size&&(this._pendingWrites.get(e).lastChange=l);let y=this._pendingWrites.get(e);l-y.lastChange>=s?(this._pendingWrites.delete(e),n(void 0,d)):o=setTimeout(c,this.options.awaitWriteFinish.pollInterval,d)})};this._pendingWrites.has(e)||(this._pendingWrites.set(e,{lastChange:a,cancelWait:()=>(this._pendingWrites.delete(e),clearTimeout(o),r)}),o=setTimeout(c,this.options.awaitWriteFinish.pollInterval))}_getGlobIgnored(){return[...this._ignoredPaths.values()]}_isIgnored(e,s){if(this.options.atomic&&Ha.test(e))return!0;if(!this._userIgnored){let{cwd:r}=this.options,n=this.options.ignored,o=n&&n.map(nn(r)),i=es(o).filter(c=>typeof c===ns&&!Kt(c)).map(c=>c+zt),a=this._getGlobIgnored().map(nn(r)).concat(o,i);this._userIgnored=Xt(a,void 0,Zt)}return this._userIgnored([e,s])}_isntIgnored(e,s){return!this._isIgnored(e,s)}_getWatchHelpers(e,s){let r=s||this.options.disableGlobbing||!Kt(e)?e:Ta(e),n=this.options.followSymlinks;return new ss(e,r,n,this)}_getWatchedDir(e){this._boundRemove||(this._boundRemove=this._remove.bind(this));let s=k.resolve(e);return this._watched.has(s)||this._watched.set(s,new ts(s,this._boundRemove)),this._watched.get(s)}_hasReadPermissions(e){if(this.options.ignorePermissionErrors)return!0;let r=(e&&Number.parseInt(e.mode,10))&511;return!!(4&Number.parseInt(r.toString(8)[0],10))}_remove(e,s,r){let n=k.join(e,s),o=k.resolve(n);if(r=r??(this._watched.has(n)||this._watched.has(o)),!this._throttle("remove",n,100))return;!r&&!this.options.useFsEvents&&this._watched.size===1&&this.add(e,s,!0),this._getWatchedDir(n).getChildren().forEach(l=>this._remove(n,l));let c=this._getWatchedDir(e),f=c.has(s);c.remove(s),this._symlinkPaths.has(o)&&this._symlinkPaths.delete(o);let u=n;if(this.options.cwd&&(u=k.relative(this.options.cwd,n)),this.options.awaitWriteFinish&&this._pendingWrites.has(u)&&this._pendingWrites.get(u).cancelWait()===nt)return;this._watched.delete(n),this._watched.delete(o);let d=r?ka:en;f&&!this._isIgnored(n)&&this._emit(d,n),this.options.useFsEvents||this._closePath(n)}_closePath(e){this._closeFile(e);let s=k.dirname(e);this._getWatchedDir(s).remove(k.basename(e))}_closeFile(e){let s=this._closers.get(e);s&&(s.forEach(r=>r()),this._closers.delete(e))}_addPathCloser(e,s){if(!s)return;let r=this._closers.get(e);r||(r=[],this._closers.set(e,r)),r.push(s)}_readdirp(e,s){if(this.closed)return;let r={type:jt,alwaysStat:!0,lstat:!0,...s},n=Aa(e,r);return this._streams.add(n),n.once(Pa,()=>{n=void 0}),n.once(Na,()=>{n&&(this._streams.delete(n),n=void 0)}),n}};is.FSWatcher=it;var Qa=(t,e)=>{let s=new it(e);return s.add(t),s};is.watch=Qa});import"only-server";import"../common/index.mjs";var hn=Bn(un(),1);import{fork as Ja}from"node:child_process";import{existsSync as fn,promises as ec}from"node:fs";import{basename as as,dirname as ls,join as cs,relative as dn}from"node:path";import{build as tc}from"esbuild";import{jwtDecode as sc}from"jwt-decode";import{Issuer as rc,custom as nc}from"openid-client";import{Logger as ic}from"@5minds/processcube_engine_sdk";import{EngineClient as Za}from"@5minds/processcube_engine_client";var os=process.env.PROCESSCUBE_ENGINE_URL??"http://localhost:10560",T=new Za(os);var oc={token:"ZHVtbXlfdG9rZW4=",userId:"dummy_token"},ac=.85,ot=["external_task.ts","external_task.js"],us=process.env.PROCESSCUBE_AUTHORITY_URL!==void 0,_e=new ic("processcube_app_sdk:external_task_adapter"),pe={},Oe;async function pn(t){if(t&&!fn(t))throw new Error(`Invalid customExternalTasksDirPath. The given path '${t}' does not exist`);nc.setHttpOptionsDefaults({timeout:1e5});let e=await En();Oe=await yn(e),await lc(e);let s=fc(t);(0,hn.watch)(s).on("add",async r=>{if(ot.includes(as(r)))return _n(r,s)}).on("change",async r=>{if(ot.includes(as(r)))return cc(r,s)}).on("unlink",async r=>{ot.includes(as(r))&&gn(r)}).on("error",r=>_e.error(`Watcher error: ${r}`))}async function _n(t,e){let s=ls(t);if((await ec.readdir(s)).filter(u=>ot.includes(u)).length>1){_e.error(`Multiple external task files found in directory ${s}. Stopping all external task workers for this directory.`),pe[s]&&gn(t);return}let o=await mn(t),i=dn(e,s),a=wn(i),c=cs(__dirname,"lib/ExternalTaskWorkerProcess.cjs"),f=Ja(c,{env:{...process.env,PROCESSCUBE_ENGINE_URL:os}});pe[s]=f,f.once("disconnect",()=>{delete pe[s]}),f.send({action:"create",payload:{topic:a,identity:Oe,moduleString:o,workerPath:t}})}async function cc(t,e){let s=ls(t),r=pe[s];if(!r)return _n(t,e);let n=await mn(t),o=dn(e,s),i=wn(o);r.send({action:"restart",payload:{topic:i,identity:Oe,moduleString:n,workerPath:t}})}function gn(t){let e=ls(t),s=pe[e];s&&s.kill()}async function En(){if(!us)return null;if(!process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID||!process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET){let r=new Error("Required environment variables PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID and PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET are missing. For help, please refer to our documentation on environment variables at: https://processcube.io/docs/app-sdk/samples/nextjs/external-task-adapter-with-nextjs#authority");throw _e.error("Required environment variables PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID and PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET are missing",{err:r}),r}let t=await rc.discover(process.env.PROCESSCUBE_AUTHORITY_URL);return await new t.Client({client_id:process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID,client_secret:process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET}).grant({grant_type:"client_credentials",scope:"engine_etw"})}function yn(t){if(!us||t===null)return oc;let e=t.access_token,s=sc(e);return{token:t.access_token,userId:s.sub}}async function lc(t){let e=5;if(!us||t===null)return;let r=await uc(t)*ac*1e3,n=async()=>{try{let o=await En();Oe=yn(o);for(let i of Object.values(pe))i.send({action:"updateIdentity",payload:{identity:Oe}});e=5,setTimeout(n,r)}catch(o){if(e===0){_e.error("Could not refresh identity for external task worker processes. Stopping all external task workers.",{error:o});for(let a of Object.values(pe))a.kill();return}_e.error("Could not refresh identity for external task worker processes.",{error:o,retryCount:e}),e--;let i=2*1e3;setTimeout(n,i)}};setTimeout(n,r)}async function mn(t){let e=await tc({entryPoints:[t],write:!1,bundle:!0,platform:"node",target:"node18",format:"cjs",external:["@opentelemetry/api"]});if(e.errors.length>0)throw _e.error(`Could not transpile file at '${t}'`,{errors:e.errors}),new Error(`Could not transpile file at '${t}'`);return e.warnings.length>0&&_e.warn(`Transpiled file at '${t}' with warnings`,{warnings:e.warnings}),e.outputFiles[0].text}async function uc(t){let e=t.expires_in;if(!e&&t.expires_at&&(e=Math.floor(t.expires_at-Date.now()/1e3)),e===void 0)throw new Error("Could not determine the time until the access token for external task workers expires");return e}function wn(t){return t.replace(/^\.\/+|\([^)]+\)|^\/*|\/*$/g,"").replace(/[\/]{2,}/g,"/")}function fc(t){let e,s=[t,cs(process.cwd(),"app"),cs(process.cwd(),"src","app")];for(let r of s)if(r&&fn(r)){e=r;break}if(!e)throw new Error("Could not find external tasks directory");return e}function dl(){return T}import{getToken as Rn}from"next-auth/jwt";import{ResponseCookies as dc}from"next/dist/compiled/@edge-runtime/cookies";import{cookies as at,headers as An}from"next/headers";async function H(){let t=await Rn({req:{cookies:at(),headers:An()}});if(t?.expiresAt&&Date.now()>=t.expiresAt*1e3){let s=await fetch(`${process.env.NEXTAUTH_URL}/api/auth/session`,{method:"GET",headers:{"Content-Type":"application/json",cookie:at().toString()}}),r=new dc(s.headers);if(r.getAll().length){let n=!1;try{for(let o of r.getAll())at().set(o.name,o.value,{...o})}catch{n=!0}if(t=await Rn({req:{cookies:n?r:at(),headers:An()}}),t?.error)throw t.error}}if(!t?.accessToken||!t?.sub)throw new Error("AccessToken or Sub could not be determined!");return{token:t?.accessToken,userId:t?.sub}}import{DataModels as Le}from"@5minds/processcube_engine_client";async function He(){try{return H()}catch{return}}async function Tn(t){let e=await He();return(await T.processInstances.query({processInstanceId:t},{identity:e})).processInstances[0]}async function Sn(t,e={sortSettings:{sortBy:Le.FlowNodeInstances.FlowNodeInstanceSortableColumns.createdAt,sortDir:"ASC"}}){return(await T.flowNodeInstances.query({processInstanceId:t},{...e,identity:e.identity??await He()})).flowNodeInstances}async function In(t){let e=await He();return(await T.flowNodeInstances.query({triggeredByFlowNodeInstance:t},{identity:e})).flowNodeInstances}async function Cn(t,e,s){let r=await He();await T.processInstances.retryProcessInstance(t,{flowNodeInstanceId:e,newStartToken:s,identity:r})}async function bn(t){let e=await He();await T.processInstances.terminateProcessInstance(t,e)}async function Rl(t={options:{identity:!0}}){switch(t.options.identity){case!0:t.options.identity=await H();break;case!1:t.options.identity=void 0;break;case void 0:t.options.identity=await H();break}return await T.processInstances.query({...t?.query,state:Le.ProcessInstances.ProcessInstanceState.running},t?.options)}async function Al(t={},e=!0){let{processInstanceId:s}=t,r=typeof e=="boolean"?e==!0?await H():void 0:e;return new Promise(async(n,o)=>{let i=[],a=async c=>{if(s!==void 0&&c.processInstanceId!==s)return;let u=await T.processInstances.query({processInstanceId:c.processInstanceId},{identity:r});for(let d of i)T.notification.removeSubscription(d,r);return u.totalCount===0?o(new Error(`Process with instance ID "${c.processInstanceId}" does not exist.`)):n(u.processInstances[0])};if(i.push(await T.notification.onProcessEnded(a,{identity:r})),i.push(await T.notification.onProcessError(a,{identity:r})),i.push(await T.notification.onProcessTerminated(a,{identity:r})),s){let c=await T.processInstances.query({processInstanceId:s,state:[Le.ProcessInstances.ProcessInstanceState.finished,Le.ProcessInstances.ProcessInstanceState.terminated,Le.ProcessInstances.ProcessInstanceState.error]},{identity:r});if(c.totalCount>0){for(let f of i)T.notification.removeSubscription(f,r);n(c.processInstances[0])}}})}import{DataModels as ae}from"@5minds/processcube_engine_client";import{mapUserTask as xn,mapUserTaskList as ge}from"../common/index.mjs";async function vl(t={},e=!0){let{correlationId:s,processInstanceId:r,flowNodeId:n}=t,o=typeof e=="boolean"?e==!0?await H():void 0:e;return new Promise(async(i,a)=>{let c=await T.userTasks.onUserTaskWaiting(async u=>{let d=s!==void 0&&u.correlationId!==s,l=u.flowNodeInstanceId===void 0,y=r!==void 0&&u.processInstanceId!==r,E=n!==void 0&&u.flowNodeId!==n;if(d||l||y||E)return;let w=await pc(u.flowNodeInstanceId,{identity:o});return T.notification.removeSubscription(c,o),w===null?a(new Error(`UserTask with instance ID "${u.flowNodeInstanceId}" does not exist.`)):i(w)},{identity:o}),f=await hc({correlationId:s,processInstanceId:r,flowNodeId:n,state:ae.FlowNodeInstances.FlowNodeInstanceState.suspended},{identity:o});f.userTasks.length>0&&(T.notification.removeSubscription(c,o),i(f.userTasks[0]))})}async function Pl(t,e={},s={},r=!0){let n=typeof r=="boolean"?r==!0?await H():void 0:r;await T.userTasks.finishUserTask(t,s,n);let o={state:ae.FlowNodeInstances.FlowNodeInstanceState.suspended,...e},i=await T.userTasks.query(o,{identity:n});return xn(i.userTasks[0])}async function hc(t,e={identity:!0}){switch(e?.identity){case!0:e.identity=await H();break;case!1:e.identity=void 0;break;case void 0:e.identity=await H();break}let s=await T.userTasks.query(t,e);return ge(s)}async function Nl(t={identity:!0}){switch(t?.identity){case!0:t.identity=await H();break;case!1:t.identity=void 0;break;case void 0:t.identity=await H();break}let e=await T.userTasks.query({state:ae.FlowNodeInstances.FlowNodeInstanceState.suspended},t);return ge(e)}async function Ol(t,e={identity:!0}){switch(e?.identity){case!0:e.identity=await H();break;case!1:e.identity=void 0;break;case void 0:e.identity=await H();break}let s=await T.userTasks.query({processInstanceId:t,state:ae.FlowNodeInstances.FlowNodeInstanceState.suspended},e);return ge(s)}async function Ll(t,e={identity:!0}){switch(e?.identity){case!0:e.identity=await H();break;case!1:e.identity=void 0;break;case void 0:e.identity=await H();break}let s=await T.userTasks.query({flowNodeId:t,state:ae.FlowNodeInstances.FlowNodeInstanceState.suspended},e);return ge(s)}async function pc(t,e={identity:!0}){switch(e?.identity){case!0:e.identity=await H();break;case!1:e.identity=void 0;break;case void 0:e.identity=await H();break}let s=await T.userTasks.query({flowNodeInstanceId:t,state:ae.FlowNodeInstances.FlowNodeInstanceState.suspended},{...e,limit:1});return s.userTasks.length===0?null:xn(s.userTasks[0])}async function Hl(t,e={identity:!0}){switch(e?.identity){case!0:e.identity=await H();break;case!1:e.identity=void 0;break;case void 0:e.identity=await H();break}let s=await T.userTasks.query({correlationId:t,state:ae.FlowNodeInstances.FlowNodeInstanceState.suspended},e);return ge(s)}async function Dl(t,e){let s=t||await H(),r=await T.userTasks.query({state:ae.FlowNodeInstances.FlowNodeInstanceState.suspended},{identity:s,...e}),n=r.userTasks.filter(o=>o.actualOwnerId===s.userId);return r.userTasks=n,ge(r)}async function Fl(t,e,s){await T.userTasks.reserveUserTaskInstance(t,e,s||t.userId)}async function $l(t,e){await T.userTasks.cancelUserTaskInstanceReservation(t,e)}async function Ml(t,e){let s=t||await H(),r=await T.userTasks.query({state:ae.FlowNodeInstances.FlowNodeInstanceState.suspended},{identity:s,...e}),n=r.userTasks.filter(o=>o.assignedUserIds?.includes(s.userId));return r.userTasks=n,ge(r)}import{PHASE_DEVELOPMENT_SERVER as _c,PHASE_PRODUCTION_BUILD as gc,PHASE_PRODUCTION_SERVER as Ec}from"next/dist/shared/lib/constants";var kn=!1,fs=!1;function Gl(t={}){let{applicationSdk:e,...s}=t;return async(r,n)=>{fs=fs||r===gc;let o=r===_c||r===Ec;return e?.useExternalTasks&&o&&!kn&&!fs&&(kn=!0,await pn(e?.customExternalTasksDirPath)),{...s,experimental:{...s.experimental,serverComponentsExternalPackages:[...s.experimental?.serverComponentsExternalPackages||[],"esbuild"]}}}}import{revalidatePath as yc}from"next/cache";import{redirect as mc}from"next/navigation";function Vl(t){yc(t),mc(t)}async function Xl(...t){return await T.processModels.startProcessInstance(...t)}async function vn(...t){await T.manualTasks.finishManualTask(...t)}async function Pn(...t){await T.userTasks.finishUserTask(...t)}async function Nn(...t){await T.untypedTasks.finishTask(...t)}import{DataModels as wc}from"@5minds/processcube_engine_client";async function Rc(){try{return H()}catch{return}}var cu=async(t,e)=>{let s=await Rc();e==="bpmn:UserTask"?await Pn(t,{},s):e==="bpmn:ManualTask"?await vn(t,s):e==="bpmn:Task"?await Nn(t,s):console.error(`[@5minds/processcube_app_sdk:handlePlay] Unsupported flow node type: ${e}`)},lu=async t=>{await bn(t)},uu=async(t,e,s)=>{await Cn(t,e,s)},fu=async t=>Tn(t),du=async t=>Sn(t,{sortSettings:{sortBy:wc.FlowNodeInstances.FlowNodeInstanceSortableColumns.createdAt,sortDir:"DESC"}}),hu=async t=>In(t);export{$l as cancelReservedUserTask,vn as finishManualTask,cu as finishTask,Nn as finishUntypedTask,Pn as finishUserTask,Pl as finishUserTaskAndGetNext,Rl as getActiveProcessInstances,Ml as getAssignedUserTasksByIdentity,dl as getEngineClient,du as getFlowNodeInstances,Sn as getFlowNodeInstancesByProcessInstanceId,In as getFlowNodeInstancesTriggeredByFlowNodeInstanceIds,H as getIdentity,fu as getProcessInstance,Tn as getProcessInstanceById,Dl as getReservedUserTasksByIdentity,hu as getTriggeredFlowNodeInstances,hc as getUserTasks,pc as getWaitingUserTaskByFlowNodeInstanceId,Nl as getWaitingUserTasks,Hl as getWaitingUserTasksByCorrelationId,Ll as getWaitingUserTasksByFlowNodeId,Ol as getWaitingUserTasksByProcessInstanceId,Vl as navigateToUrl,Fl as reserveUserTask,uu as retryProcess,Cn as retryProcessInstance,Xl as startProcess,lu as terminateProcess,bn as terminateProcessInstance,Al as waitForProcessEnd,vl as waitForUserTask,Gl as withApplicationSdk};
3
3
  /*! Bundled license information:
4
4
 
5
5
  normalize-path/index.js:
@@ -47,11 +47,14 @@ export declare function terminateProcessInstance(processInstanceId: string): Pro
47
47
  *
48
48
  * @param query.query The query of {@link Client.processInstances.query}
49
49
  * @param query.options The options of {@link Client.processInstances.query}
50
+ * @param indentity The Identity fo the User
50
51
  * @returns The list of active process instances as promise {@link DataModels.ProcessInstances.ProcessInstanceList}
51
52
  */
52
53
  export declare function getActiveProcessInstances(query?: {
53
54
  query?: Omit<DataModels.ProcessInstances.ProcessInstanceQuery, 'state'>;
54
- options?: Parameters<typeof Client.processInstances.query>[1];
55
+ options: Omit<Parameters<typeof Client.processInstances.query>[1], 'identity'> & {
56
+ identity?: Identity | boolean;
57
+ };
55
58
  }): Promise<DataModels.ProcessInstances.ProcessInstanceList>;
56
59
  /**
57
60
  * This function will wait until a ProcessInstance is finished, terminated or errored.
@@ -62,6 +65,6 @@ export declare function getActiveProcessInstances(query?: {
62
65
  * @param identity The Identity to use for the request
63
66
  * @returns {Promise<DataModels.ProcessInstances.ProcessInstance>} The {@link DataModels.ProcessInstances.ProcessInstance}
64
67
  */
65
- export declare function waitForProcessEnd(filterBy: {
68
+ export declare function waitForProcessEnd(filterBy?: {
66
69
  processInstanceId?: string;
67
- }, identity?: Identity): Promise<DataModels.ProcessInstances.ProcessInstance>;
70
+ }, identity?: Identity | boolean): Promise<DataModels.ProcessInstances.ProcessInstance>;
@@ -2,6 +2,9 @@ import { DataModels } from '@5minds/processcube_engine_client';
2
2
  import type { Identity, UserTaskResult } from '@5minds/processcube_engine_sdk';
3
3
  import { UserTaskInstance, UserTaskList } from '../../common';
4
4
  import { Client } from './internal/EngineClient';
5
+ type OptionsWithBoolIdentity = Omit<Parameters<typeof Client.userTasks.query>[1], 'identity'> & {
6
+ identity?: Identity | boolean;
7
+ };
5
8
  /**
6
9
  * If there is no UserTask waiting, this function will wait for the next UserTask to be created.
7
10
  * If there is already a UserTask waiting, this function will return it.
@@ -10,14 +13,14 @@ import { Client } from './internal/EngineClient';
10
13
  * @param filterBy.correlationId The ID of the correlation which contains the UserTask
11
14
  * @param filterBy.processInstanceId The ID of the ProcessInstance the UserTask belongs to
12
15
  * @param filterBy.flowNodeId The UserTask FlowNode ID (BPMN)
13
- * @param identity The Identity of the User
16
+ * @param identity The Identity of the User or true if the implied identity should be used
14
17
  * @returns {Promise<UserTaskInstance>} The created UserTask.
15
18
  */
16
19
  export declare function waitForUserTask(filterBy?: {
17
20
  correlationId?: string;
18
21
  processInstanceId?: string;
19
22
  flowNodeId?: string;
20
- }, identity?: Identity): Promise<UserTaskInstance>;
23
+ }, identity?: Identity | boolean): Promise<UserTaskInstance>;
21
24
  /**
22
25
  * The FilterBy object can be used to filter the result set of the finishUserTaskAndGetNext function.
23
26
  * The next UserTask will be returned based on the given filter options.
@@ -34,50 +37,50 @@ export type FilterBy = {
34
37
  * @param flowNodeInstanceId The ID of the flowNodeInstance to finish
35
38
  * @param FilterBy Additional filter options for the next UserTask
36
39
  * @param result The result of the UserTask
37
- * @param identity The Identity of the User
40
+ * @param identity The Identity of the User or true if the implied identity should be used
38
41
  * @returns {Promise<UserTaskInstance>} The next UserTask based on the given filter options.
39
42
  */
40
- export declare function finishUserTaskAndGetNext(flowNodeInstanceId: string, filterBy?: FilterBy, result?: UserTaskResult, identity?: Identity): Promise<UserTaskInstance | null>;
41
- export declare function getUserTasks(...args: Parameters<typeof Client.userTasks.query>): Promise<UserTaskList>;
43
+ export declare function finishUserTaskAndGetNext(flowNodeInstanceId: string, filterBy?: FilterBy, result?: UserTaskResult, identity?: Identity | boolean): Promise<UserTaskInstance | null>;
44
+ export declare function getUserTasks(query: DataModels.FlowNodeInstances.UserTaskQuery, options?: OptionsWithBoolIdentity): Promise<UserTaskList>;
42
45
  /**
43
46
  *
44
47
  * @param options Additional options for the query e.g. {@link DataModels.Iam.Identity} or {@link DataModels.FlowNodeInstances.FlowNodeInstanceSortSettings}
45
48
  * @returns {Promise<UserTaskList>}
46
49
  */
47
- export declare function getWaitingUserTasks(options?: Parameters<typeof Client.userTasks.query>[1]): Promise<UserTaskList>;
50
+ export declare function getWaitingUserTasks(options?: OptionsWithBoolIdentity): Promise<UserTaskList>;
48
51
  /**
49
52
  *
50
53
  * @param processInstanceId The Process Instance ID
51
54
  * @param options Additional options for the query e.g. {@link DataModels.Iam.Identity} or {@link DataModels.FlowNodeInstances.FlowNodeInstanceSortSettings}
52
55
  * @returns {Promise<UserTaskList>}
53
56
  */
54
- export declare function getWaitingUserTasksByProcessInstanceId(processInstanceId: string | Array<string>, options?: Parameters<typeof Client.userTasks.query>[1]): Promise<UserTaskList>;
57
+ export declare function getWaitingUserTasksByProcessInstanceId(processInstanceId: string | Array<string>, options?: OptionsWithBoolIdentity): Promise<UserTaskList>;
55
58
  /**
56
59
  *
57
60
  * @param flowNodeId The UserTasks ID (BPMN)
58
61
  * @param options Additional options for the query e.g. {@link DataModels.Iam.Identity} or {@link DataModels.FlowNodeInstances.FlowNodeInstanceSortSettings}
59
62
  * @returns {Promise<UserTaskList>}
60
63
  */
61
- export declare function getWaitingUserTasksByFlowNodeId(flowNodeId: string | string[], options?: Parameters<typeof Client.userTasks.query>[1]): Promise<UserTaskList>;
64
+ export declare function getWaitingUserTasksByFlowNodeId(flowNodeId: string | string[], options?: OptionsWithBoolIdentity): Promise<UserTaskList>;
62
65
  /**
63
66
  *
64
67
  * @param flowNodeInstanceId The UserTask Instance ID
65
68
  * @param options Additional options for the query e.g. {@link DataModels.Iam.Identity}
66
69
  * @returns {Promise<UserTaskInstance | null>}
67
70
  */
68
- export declare function getWaitingUserTaskByFlowNodeInstanceId(flowNodeInstanceId: string, options?: Parameters<typeof Client.userTasks.query>[1]): Promise<UserTaskInstance | null>;
71
+ export declare function getWaitingUserTaskByFlowNodeInstanceId(flowNodeInstanceId: string, options?: OptionsWithBoolIdentity): Promise<UserTaskInstance | null>;
69
72
  /**
70
73
  * @param correlationId The Correlation ID
71
74
  * @param options Additional options for the query e.g. {@link DataModels.Iam.Identity}
72
75
  * @returns {Promise<UserTaskList>}
73
76
  */
74
- export declare function getWaitingUserTasksByCorrelationId(correlationId: string, options?: Parameters<typeof Client.userTasks.query>[1]): Promise<UserTaskList>;
77
+ export declare function getWaitingUserTasksByCorrelationId(correlationId: string, options?: OptionsWithBoolIdentity): Promise<UserTaskList>;
75
78
  /**
76
79
  * @param identity The identity of the user
77
80
  * @param options Additional options for the query e.g. {@link DataModels.FlowNodeInstances.FlowNodeInstanceSortSettings}
78
81
  * @returns {Promise<UserTaskList>}
79
82
  */
80
- export declare function getReservedUserTasksByIdentity(identity: DataModels.Iam.Identity, options?: {
83
+ export declare function getReservedUserTasksByIdentity(identity?: Identity, options?: {
81
84
  offset?: number;
82
85
  limit?: number;
83
86
  sortSettings?: DataModels.FlowNodeInstances.FlowNodeInstanceSortSettings;
@@ -97,8 +100,9 @@ export declare function cancelReservedUserTask(identity: DataModels.Iam.Identity
97
100
  * @param options Additional options for the query e.g. {@link DataModels.FlowNodeInstances.FlowNodeInstanceSortSettings}
98
101
  * @returns {Promise<UserTaskList>}
99
102
  */
100
- export declare function getAssignedUserTasksByIdentity(identity: DataModels.Iam.Identity, options?: {
103
+ export declare function getAssignedUserTasksByIdentity(identity?: Identity, options?: {
101
104
  offset?: number;
102
105
  limit?: number;
103
106
  sortSettings?: DataModels.FlowNodeInstances.FlowNodeInstanceSortSettings;
104
107
  }): Promise<UserTaskList>;
108
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@5minds/processcube_app_sdk",
3
- "version": "6.2.0-develop-32452d-m2ee0twu",
3
+ "version": "6.2.0-develop-9025fa-m2ensenw",
4
4
  "description": "The SDK for ProcessCube Apps",
5
5
  "type": "module",
6
6
  "main": "build/common/index.cjs",
@@ -1 +0,0 @@
1
- "use server";import{DataModels as b}from"@5minds/processcube_engine_client";import{DataModels as C}from"@5minds/processcube_engine_client";import{getToken as d}from"next-auth/jwt";import{ResponseCookies as k}from"next/dist/compiled/@edge-runtime/cookies";import{cookies as a,headers as u}from"next/headers";async function i(){let e=await d({req:{cookies:a(),headers:u()}});if(e?.expiresAt&&Date.now()>=e.expiresAt*1e3){let n=await fetch(`${process.env.NEXTAUTH_URL}/api/auth/session`,{method:"GET",headers:{"Content-Type":"application/json",cookie:a().toString()}}),o=new k(n.headers);if(o.getAll().length){let p=!1;try{for(let c of o.getAll())a().set(c.name,c.value,{...c})}catch{p=!0}if(e=await d({req:{cookies:p?o:a(),headers:u()}}),e?.error)throw e.error}}if(!e?.accessToken||!e?.sub)throw new Error("AccessToken or Sub could not be determined!");return{token:e?.accessToken,userId:e?.sub}}import{EngineClient as T}from"@5minds/processcube_engine_client";var h=process.env.PROCESSCUBE_ENGINE_URL??"http://localhost:10560",t=new T(h);async function r(){try{return i()}catch{return}}async function I(e){let s=await r();return(await t.processInstances.query({processInstanceId:e},{identity:s})).processInstances[0]}async function y(e,s={sortSettings:{sortBy:C.FlowNodeInstances.FlowNodeInstanceSortableColumns.createdAt,sortDir:"ASC"}}){return(await t.flowNodeInstances.query({processInstanceId:e},{...s,identity:s.identity??await r()})).flowNodeInstances}async function l(e){let s=await r();return(await t.flowNodeInstances.query({triggeredByFlowNodeInstance:e},{identity:s})).flowNodeInstances}async function f(e,s,n){let o=await r();await t.processInstances.retryProcessInstance(e,{flowNodeInstanceId:s,newStartToken:n,identity:o})}async function m(e){let s=await r();await t.processInstances.terminateProcessInstance(e,s)}async function g(...e){await t.manualTasks.finishManualTask(...e)}async function w(...e){await t.userTasks.finishUserTask(...e)}async function P(...e){await t.untypedTasks.finishTask(...e)}async function E(){try{return i()}catch{return}}var X=async(e,s)=>{let n=await E();s==="bpmn:UserTask"?await w(e,{},n):s==="bpmn:ManualTask"?await g(e,n):s==="bpmn:Task"?await P(e,n):console.error(`[@5minds/processcube_app_sdk:handlePlay] Unsupported flow node type: ${s}`)},z=async e=>{await m(e)},J=async(e,s,n)=>{await f(e,s,n)},K=async e=>I(e),V=async e=>y(e,{sortSettings:{sortBy:b.FlowNodeInstances.FlowNodeInstanceSortableColumns.createdAt,sortDir:"DESC"}}),W=async e=>l(e);export{X as finishTask,V as getFlowNodeInstances,K as getProcessInstance,W as getTriggeredFlowNodeInstances,J as retryProcess,z as terminateProcess};