jiek 1.0.15 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cli.cjs +15 -6
- package/dist/cli.js +15 -6
- package/dist/cli.min.cjs +4 -4
- package/dist/cli.min.js +4 -4
- package/dist/rollup/index.cjs +1 -1
- package/dist/rollup/index.js +1 -1
- package/dist/rollup/index.min.cjs +1 -1
- package/dist/rollup/index.min.js +1 -1
- package/package.json +2 -3
- package/src/commands/build.ts +13 -1
- package/src/rollup/index.ts +1 -1
package/dist/rollup/index.min.js
CHANGED
@@ -16,4 +16,4 @@ import e from"node:fs";import t,{resolve as n,relative as r,dirname as o,extname
|
|
16
16
|
*
|
17
17
|
* Copyright (c) 2014-present, Jon Schlinkert.
|
18
18
|
* Licensed under the MIT License.
|
19
|
-
*/function z(){if(I)return N;I=1;const e=E,t=Y(),n=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),r=e=>"number"==typeof e||"string"==typeof e&&""!==e,o=e=>Number.isInteger(+e),s=e=>{let t=`${e}`,n=-1;if("-"===t[0]&&(t=t.slice(1)),"0"===t)return!1;for(;"0"===t[++n];);return n>0},i=(e,t,n)=>{if(t>0){let n="-"===e[0]?"-":"";n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,"0")}return!1===n?String(e):e},a=(e,t)=>{let n="-"===e[0]?"-":"";for(n&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return n?"-"+e:e},u=(e,n,r,o)=>{if(r)return t(e,n,{wrap:!1,...o});let s=String.fromCharCode(e);return e===n?s:`[${s}-${String.fromCharCode(n)}]`},p=(e,n,r)=>{if(Array.isArray(e)){let t=!0===r.wrap,n=r.capture?"":"?:";return t?`(${n}${e.join("|")})`:e.join("|")}return t(e,n,r)},l=(...t)=>new RangeError("Invalid range arguments: "+e.inspect(...t)),c=(e,t,n)=>{if(!0===n.strictRanges)throw l([e,t]);return[]},f=(e,t,n=1,r={})=>{let o=Number(e),c=Number(t);if(!Number.isInteger(o)||!Number.isInteger(c)){if(!0===r.strictRanges)throw l([e,t]);return[]}0===o&&(o=0),0===c&&(c=0);let f=o>c,d=String(e),g=String(t),h=String(n);n=Math.max(Math.abs(n),1);let A=s(d)||s(g)||s(h),R=A?Math.max(d.length,g.length,h.length):0,y=!1===A&&!1===((e,t,n)=>"string"==typeof e||"string"==typeof t||!0===n.stringify)(e,t,r),E=r.transform||(e=>t=>!0===e?Number(t):String(t))(y);if(r.toRegex&&1===n)return u(a(e,R),a(t,R),!0,r);let m={negatives:[],positives:[]},_=[],C=0;for(;f?o>=c:o<=c;)!0===r.toRegex&&n>1?m[(S=o)<0?"negatives":"positives"].push(Math.abs(S)):_.push(i(E(o,C),R,y)),o=f?o-n:o+n,C++;var S;return!0===r.toRegex?n>1?((e,t)=>{e.negatives.sort(((e,t)=>e<t?-1:e>t?1:0)),e.positives.sort(((e,t)=>e<t?-1:e>t?1:0));let n,r=t.capture?"":"?:",o="",s="";return e.positives.length&&(o=e.positives.join("|")),e.negatives.length&&(s=`-(${r}${e.negatives.join("|")})`),n=o&&s?`${o}|${s}`:o||s,t.wrap?`(${r}${n})`:n})(m,r):p(_,null,{wrap:!1,...r}):_},d=(e,t,s,i={})=>{if(null==t&&r(e))return[e];if(!r(e)||!r(t))return c(e,t,i);if("function"==typeof s)return d(e,t,1,{transform:s});if(n(s))return d(e,t,0,s);let a={...i};return!0===a.capture&&(a.wrap=!0),s=s||a.step||1,o(s)?o(e)&&o(t)?f(e,t,s,a):((e,t,n=1,r={})=>{if(!o(e)&&e.length>1||!o(t)&&t.length>1)return c(e,t,r);let s=r.transform||(e=>String.fromCharCode(e)),i=`${e}`.charCodeAt(0),a=`${t}`.charCodeAt(0),l=i>a,f=Math.min(i,a),d=Math.max(i,a);if(r.toRegex&&1===n)return u(f,d,!1,r);let g=[],h=0;for(;l?i>=a:i<=a;)g.push(s(i,h)),i=l?i-n:i+n,h++;return!0===r.toRegex?p(g,null,{wrap:!1,options:r}):g})(e,t,Math.max(Math.abs(s),1),a):null==s||n(s)?d(e,t,1,s):((e,t)=>{if(!0===t.strictRanges)throw new TypeError(`Expected step "${e}" to be a number`);return[]})(s,a)};return N=d}function V(){if(F)return K;F=1;const e=q(),{MAX_LENGTH:t,CHAR_BACKSLASH:n,CHAR_BACKTICK:r,CHAR_COMMA:o,CHAR_DOT:s,CHAR_LEFT_PARENTHESES:i,CHAR_RIGHT_PARENTHESES:a,CHAR_LEFT_CURLY_BRACE:u,CHAR_RIGHT_CURLY_BRACE:p,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_RIGHT_SQUARE_BRACKET:c,CHAR_DOUBLE_QUOTE:f,CHAR_SINGLE_QUOTE:d,CHAR_NO_BREAK_SPACE:g,CHAR_ZERO_WIDTH_NOBREAK_SPACE:h}=D?G:(D=1,G={MAX_LENGTH:65536,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:"\n",CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\ufeff"});return K=(A,R={})=>{if("string"!=typeof A)throw new TypeError("Expected a string");let y=R||{},E="number"==typeof y.maxLength?Math.min(t,y.maxLength):t;if(A.length>E)throw new SyntaxError(`Input length (${A.length}), exceeds max characters (${E})`);let m,_={type:"root",input:A,nodes:[]},C=[_],S=_,b=_,v=0,x=A.length,$=0,H=0;const w=()=>A[$++],T=e=>{if("text"===e.type&&"dot"===b.type&&(b.type="text"),!b||"text"!==b.type||"text"!==e.type)return S.nodes.push(e),e.parent=S,e.prev=b,b=e,e;b.value+=e.value};for(T({type:"bos"});$<x;)if(S=C[C.length-1],m=w(),m!==h&&m!==g)if(m!==n)if(m!==c)if(m!==l)if(m!==i)if(m!==a)if(m!==f&&m!==d&&m!==r)if(m!==u)if(m!==p)if(m===o&&H>0){if(S.ranges>0){S.ranges=0;let t=S.nodes.shift();S.nodes=[t,{type:"text",value:e(S)}]}T({type:"comma",value:m}),S.commas++}else if(m===s&&H>0&&0===S.commas){let e=S.nodes;if(0===H||0===e.length){T({type:"text",value:m});continue}if("dot"===b.type){if(S.range=[],b.value+=m,b.type="range",3!==S.nodes.length&&5!==S.nodes.length){S.invalid=!0,S.ranges=0,b.type="text";continue}S.ranges++,S.args=[];continue}if("range"===b.type){e.pop();let t=e[e.length-1];t.value+=b.value+m,b=t,S.ranges--;continue}T({type:"dot",value:m})}else T({type:"text",value:m});else{if("brace"!==S.type){T({type:"text",value:m});continue}let e="close";S=C.pop(),S.close=!0,T({type:e,value:m}),H--,S=C[C.length-1]}else{H++;let e=b.value&&"$"===b.value.slice(-1)||!0===S.dollar;S=T({type:"brace",open:!0,close:!1,dollar:e,depth:H,commas:0,ranges:0,nodes:[]}),C.push(S),T({type:"open",value:m})}else{let e,t=m;for(!0!==R.keepQuotes&&(m="");$<x&&(e=w());)if(e!==n){if(e===t){!0===R.keepQuotes&&(m+=e);break}m+=e}else m+=e+w();T({type:"text",value:m})}else{if("paren"!==S.type){T({type:"text",value:m});continue}S=C.pop(),T({type:"text",value:m}),S=C[C.length-1]}else S=T({type:"paren",nodes:[]}),C.push(S),T({type:"text",value:m});else{let e;for(v++;$<x&&(e=w());)if(m+=e,e!==l)if(e!==n){if(e===c&&(v--,0===v))break}else m+=w();else v++;T({type:"text",value:m})}else T({type:"text",value:"\\"+m});else T({type:"text",value:(R.keepEscaping?m:"")+w()});do{if(S=C.pop(),"root"!==S.type){S.nodes.forEach((e=>{e.nodes||("open"===e.type&&(e.isOpen=!0),"close"===e.type&&(e.isClose=!0),e.nodes||(e.type="text"),e.invalid=!0)}));let e=C[C.length-1],t=e.nodes.indexOf(S);e.nodes.splice(t,1,...S.nodes)}}while(C.length>0);return T({type:"eos"}),_},K}function J(){if(Q)return U;Q=1;const e=q(),t=function(){if(j)return M;j=1;const e=z(),t=X();return M=(n,r={})=>{let o=(n,s={})=>{let i=t.isInvalidBrace(s),a=!0===n.invalid&&!0===r.escapeInvalid,u=!0===i||!0===a,p=!0===r.escapeInvalid?"\\":"",l="";if(!0===n.isOpen)return p+n.value;if(!0===n.isClose)return p+n.value;if("open"===n.type)return u?p+n.value:"(";if("close"===n.type)return u?p+n.value:")";if("comma"===n.type)return"comma"===n.prev.type?"":u?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let o=t.reduce(n.nodes),s=e(...o,{...r,wrap:!1,toRegex:!0});if(0!==s.length)return o.length>1&&s.length>1?`(${s})`:s}if(n.nodes)for(let e of n.nodes)l+=o(e,n);return l};return o(n)}}(),n=function(){if(P)return B;P=1;const e=z(),t=q(),n=X(),r=(e="",t="",o=!1)=>{let s=[];if(e=[].concat(e),!(t=[].concat(t)).length)return e;if(!e.length)return o?n.flatten(t).map((e=>`{${e}}`)):t;for(let n of e)if(Array.isArray(n))for(let e of n)s.push(r(e,t,o));else for(let e of t)!0===o&&"string"==typeof e&&(e=`{${e}}`),s.push(Array.isArray(e)?r(n,e,o):n+e);return n.flatten(s)};return B=(o,s={})=>{let i=void 0===s.rangeLimit?1e3:s.rangeLimit,a=(o,u={})=>{o.queue=[];let p=u,l=u.queue;for(;"brace"!==p.type&&"root"!==p.type&&p.parent;)p=p.parent,l=p.queue;if(o.invalid||o.dollar)return void l.push(r(l.pop(),t(o,s)));if("brace"===o.type&&!0!==o.invalid&&2===o.nodes.length)return void l.push(r(l.pop(),["{}"]));if(o.nodes&&o.ranges>0){let a=n.reduce(o.nodes);if(n.exceedsLimit(...a,s.step,i))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let u=e(...a,s);return 0===u.length&&(u=t(o,s)),l.push(r(l.pop(),u)),void(o.nodes=[])}let c=n.encloseBrace(o),f=o.queue,d=o;for(;"brace"!==d.type&&"root"!==d.type&&d.parent;)d=d.parent,f=d.queue;for(let e=0;e<o.nodes.length;e++){let t=o.nodes[e];"comma"!==t.type||"brace"!==o.type?"close"!==t.type?t.value&&"open"!==t.type?f.push(r(f.pop(),t.value)):t.nodes&&a(t,o):l.push(r(l.pop(),f,c)):(1===e&&f.push(""),f.push(""))}return f};return n.flatten(a(o))}}(),r=V(),o=(e,t={})=>{let n=[];if(Array.isArray(e))for(let r of e){let e=o.create(r,t);Array.isArray(e)?n.push(...e):n.push(e)}else n=[].concat(o.create(e,t));return t&&!0===t.expand&&!0===t.nodupes&&(n=[...new Set(n)]),n};return o.parse=(e,t={})=>r(e,t),o.stringify=(t,n={})=>e("string"==typeof t?o.parse(t,n):t,n),o.compile=(e,n={})=>("string"==typeof e&&(e=o.parse(e,n)),t(e,n)),o.expand=(e,t={})=>{"string"==typeof e&&(e=o.parse(e,t));let r=n(e,t);return!0===t.noempty&&(r=r.filter(Boolean)),!0===t.nodupes&&(r=[...new Set(r)]),r},o.create=(e,t={})=>""===e||e.length<3?[e]:!0!==t.expand?o.compile(e,t):o.expand(e,t),U=o}var ee,te,ne,re,oe,se,ie,ae,ue,pe,le,ce,fe,de={};function ge(){if(te)return ee;te=1;const e=m,t="\\\\/",n=`[^${t}]`,r="\\.",o="\\/",s="[^/]",i=`(?:${o}|$)`,a=`(?:^|${o})`,u=`${r}{1,2}${i}`,p={DOT_LITERAL:r,PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:o,ONE_CHAR:"(?=.)",QMARK:s,END_ANCHOR:i,DOTS_SLASH:u,NO_DOT:`(?!${r})`,NO_DOTS:`(?!${a}${u})`,NO_DOT_SLASH:`(?!${r}{0,1}${i})`,NO_DOTS_SLASH:`(?!${u})`,QMARK_NO_DOT:`[^.${o}]`,STAR:`${s}*?`,START_ANCHOR:a},l={...p,SLASH_LITERAL:`[${t}]`,QMARK:n,STAR:`${n}*?`,DOTS_SLASH:`${r}{1,2}(?:[${t}]|$)`,NO_DOT:`(?!${r})`,NO_DOTS:`(?!(?:^|[${t}])${r}{1,2}(?:[${t}]|$))`,NO_DOT_SLASH:`(?!${r}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${r}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`};return ee={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:e.sep,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?l:p}}function he(){return ne||(ne=1,function(e){const t=m,n="win32"===process.platform,{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:o,REGEX_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_GLOBAL:i}=ge();e.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),e.hasRegexChars=e=>s.test(e),e.isRegexChar=t=>1===t.length&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(i,"\\$1"),e.toPosixSlashes=e=>e.replace(r,"/"),e.removeBackslashes=e=>e.replace(o,(e=>"\\"===e?"":e)),e.supportsLookbehinds=()=>{const e=process.version.slice(1).split(".").map(Number);return 3===e.length&&e[0]>=9||8===e[0]&&e[1]>=10},e.isWindows=e=>e&&"boolean"==typeof e.windows?e.windows:!0===n||"\\"===t.sep,e.escapeLast=(t,n,r)=>{const o=t.lastIndexOf(n,r);return-1===o?t:"\\"===t[o-1]?e.escapeLast(t,n,o-1):`${t.slice(0,o)}\\${t.slice(o)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith("./")&&(n=n.slice(2),t.prefix="./"),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?"":"^"}(?:${e})${n.contains?"":"$"}`;return!0===t.negated&&(r=`(?:^(?!${r}).*$)`),r}}(de)),de}function Ae(){if(ue)return ae;ue=1;const e=m,t=function(){if(oe)return re;oe=1;const e=he(),{CHAR_ASTERISK:t,CHAR_AT:n,CHAR_BACKWARD_SLASH:r,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:i,CHAR_FORWARD_SLASH:a,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:p,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:c,CHAR_QUESTION_MARK:f,CHAR_RIGHT_CURLY_BRACE:d,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:h}=ge(),A=e=>e===a||e===r,R=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};return re=(y,E)=>{const m=E||{},_=y.length-1,C=!0===m.parts||!0===m.scanToEnd,S=[],b=[],v=[];let x,$,H=y,w=-1,T=0,L=0,O=!1,k=!1,N=!1,I=!1,M=!1,j=!1,B=!1,P=!1,G=!1,D=!1,K=0,F={value:"",depth:0,isGlob:!1};const U=()=>w>=_,Q=()=>(x=$,H.charCodeAt(++w));for(;w<_;){let e;if($=Q(),$!==r){if(!0===j||$===u){for(K++;!0!==U()&&($=Q());)if($!==r)if($!==u){if(!0!==j&&$===s&&($=Q())===s){if(O=F.isBrace=!0,N=F.isGlob=!0,D=!0,!0===C)continue;break}if(!0!==j&&$===o){if(O=F.isBrace=!0,N=F.isGlob=!0,D=!0,!0===C)continue;break}if($===d&&(K--,0===K)){j=!1,O=F.isBrace=!0,D=!0;break}}else K++;else B=F.backslashes=!0,Q();if(!0===C)continue;break}if($!==a){if(!0!==m.noext&&!0==($===c||$===n||$===t||$===f||$===i)&&H.charCodeAt(w+1)===p){if(N=F.isGlob=!0,I=F.isExtglob=!0,D=!0,$===i&&w===T&&(G=!0),!0===C){for(;!0!==U()&&($=Q());)if($!==r){if($===g){N=F.isGlob=!0,D=!0;break}}else B=F.backslashes=!0,$=Q();continue}break}if($===t){if(x===t&&(M=F.isGlobstar=!0),N=F.isGlob=!0,D=!0,!0===C)continue;break}if($===f){if(N=F.isGlob=!0,D=!0,!0===C)continue;break}if($===l){for(;!0!==U()&&(e=Q());)if(e!==r){if(e===h){k=F.isBracket=!0,N=F.isGlob=!0,D=!0;break}}else B=F.backslashes=!0,Q();if(!0===C)continue;break}if(!0===m.nonegate||$!==i||w!==T){if(!0!==m.noparen&&$===p){if(N=F.isGlob=!0,!0===C){for(;!0!==U()&&($=Q());)if($!==p){if($===g){D=!0;break}}else B=F.backslashes=!0,$=Q();continue}break}if(!0===N){if(D=!0,!0===C)continue;break}}else P=F.negated=!0,T++}else{if(S.push(w),b.push(F),F={value:"",depth:0,isGlob:!1},!0===D)continue;if(x===s&&w===T+1){T+=2;continue}L=w+1}}else B=F.backslashes=!0,$=Q(),$===u&&(j=!0)}!0===m.noext&&(I=!1,N=!1);let W=H,X="",q="";T>0&&(X=H.slice(0,T),H=H.slice(T),L-=T),W&&!0===N&&L>0?(W=H.slice(0,L),q=H.slice(L)):!0===N?(W="",q=H):W=H,W&&""!==W&&"/"!==W&&W!==H&&A(W.charCodeAt(W.length-1))&&(W=W.slice(0,-1)),!0===m.unescape&&(q&&(q=e.removeBackslashes(q)),W&&!0===B&&(W=e.removeBackslashes(W)));const Z={prefix:X,input:y,start:T,base:W,glob:q,isBrace:O,isBracket:k,isGlob:N,isExtglob:I,isGlobstar:M,negated:P,negatedExtglob:G};if(!0===m.tokens&&(Z.maxDepth=0,A($)||b.push(F),Z.tokens=b),!0===m.parts||!0===m.tokens){let e;for(let t=0;t<S.length;t++){const n=e?e+1:T,r=S[t],o=y.slice(n,r);m.tokens&&(0===t&&0!==T?(b[t].isPrefix=!0,b[t].value=X):b[t].value=o,R(b[t]),Z.maxDepth+=b[t].depth),0===t&&""===o||v.push(o),e=r}if(e&&e+1<y.length){const t=y.slice(e+1);v.push(t),m.tokens&&(b[b.length-1].value=t,R(b[b.length-1]),Z.maxDepth+=b[b.length-1].depth)}Z.slashes=S,Z.parts=v}return Z}}(),n=function(){if(ie)return se;ie=1;const e=ge(),t=he(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:i}=e,a=(e,n)=>{if("function"==typeof n.expandRange)return n.expandRange(...e,n);e.sort();const r=`[${e.join("-")}]`;try{new RegExp(r)}catch(n){return e.map((e=>t.escapeRegex(e))).join("..")}return r},u=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,p=(l,c)=>{if("string"!=typeof l)throw new TypeError("Expected a string");l=i[l]||l;const f={...c},d="number"==typeof f.maxLength?Math.min(n,f.maxLength):n;let g=l.length;if(g>d)throw new SyntaxError(`Input length: ${g}, exceeds maximum allowed length: ${d}`);const h={type:"bos",value:"",output:f.prepend||""},A=[h],R=f.capture?"":"?:",y=t.isWindows(c),E=e.globChars(y),m=e.extglobChars(E),{DOT_LITERAL:_,PLUS_LITERAL:C,SLASH_LITERAL:S,ONE_CHAR:b,DOTS_SLASH:v,NO_DOT:x,NO_DOT_SLASH:$,NO_DOTS_SLASH:H,QMARK:w,QMARK_NO_DOT:T,STAR:L,START_ANCHOR:O}=E,k=e=>`(${R}(?:(?!${O}${e.dot?v:_}).)*?)`,N=f.dot?"":x,I=f.dot?w:T;let M=!0===f.bash?k(f):L;f.capture&&(M=`(${M})`),"boolean"==typeof f.noext&&(f.noextglob=f.noext);const j={input:l,index:-1,start:0,dot:!0===f.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:A};l=t.removePrefix(l,j),g=l.length;const B=[],P=[],G=[];let D,K=h;const F=()=>j.index===g-1,U=j.peek=(e=1)=>l[j.index+e],Q=j.advance=()=>l[++j.index]||"",W=()=>l.slice(j.index+1),X=(e="",t=0)=>{j.consumed+=e,j.index+=t},q=e=>{j.output+=null!=e.output?e.output:e.value,X(e.value)},Z=()=>{let e=1;for(;"!"===U()&&("("!==U(2)||"?"===U(3));)Q(),j.start++,e++;return e%2!=0&&(j.negated=!0,j.start++,!0)},Y=e=>{j[e]++,G.push(e)},z=e=>{j[e]--,G.pop()},V=e=>{if("globstar"===K.type){const t=j.braces>0&&("comma"===e.type||"brace"===e.type),n=!0===e.extglob||B.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||n||(j.output=j.output.slice(0,-K.output.length),K.type="star",K.value="*",K.output=M,j.output+=K.output)}if(B.length&&"paren"!==e.type&&(B[B.length-1].inner+=e.value),(e.value||e.output)&&q(e),K&&"text"===K.type&&"text"===e.type)return K.value+=e.value,void(K.output=(K.output||"")+e.value);e.prev=K,A.push(e),K=e},J=(e,t)=>{const n={...m[t],conditions:1,inner:""};n.prev=K,n.parens=j.parens,n.output=j.output;const r=(f.capture?"(":"")+n.open;Y("parens"),V({type:e,value:t,output:j.output?"":b}),V({type:"paren",extglob:!0,value:Q(),output:r}),B.push(n)},ee=e=>{let t,n=e.close+(f.capture?")":"");if("negate"===e.type){let r=M;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(r=k(f)),(r!==M||F()||/^\)+$/.test(W()))&&(n=e.close=`)$))${r}`),e.inner.includes("*")&&(t=W())&&/^\.[^\\/.]+$/.test(t)){const o=p(t,{...c,fastpaths:!1}).output;n=e.close=`)${o})${r})`}"bos"===e.prev.type&&(j.negatedExtglob=!0)}V({type:"paren",extglob:!0,value:D,output:n}),z("parens")};if(!1!==f.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(l)){let e=!1,n=l.replace(s,((t,n,r,o,s,i)=>"\\"===o?(e=!0,t):"?"===o?n?n+o+(s?w.repeat(s.length):""):0===i?I+(s?w.repeat(s.length):""):w.repeat(r.length):"."===o?_.repeat(r.length):"*"===o?n?n+o+(s?M:""):M:n?t:`\\${t}`));return!0===e&&(n=!0===f.unescape?n.replace(/\\/g,""):n.replace(/\\+/g,(e=>e.length%2==0?"\\\\":e?"\\":""))),n===l&&!0===f.contains?(j.output=l,j):(j.output=t.wrapOutput(n,j,c),j)}for(;!F();){if(D=Q(),"\0"===D)continue;if("\\"===D){const e=U();if("/"===e&&!0!==f.bash)continue;if("."===e||";"===e)continue;if(!e){D+="\\",V({type:"text",value:D});continue}const t=/^\\+/.exec(W());let n=0;if(t&&t[0].length>2&&(n=t[0].length,j.index+=n,n%2!=0&&(D+="\\")),!0===f.unescape?D=Q():D+=Q(),0===j.brackets){V({type:"text",value:D});continue}}if(j.brackets>0&&("]"!==D||"["===K.value||"[^"===K.value)){if(!1!==f.posix&&":"===D){const e=K.value.slice(1);if(e.includes("[")&&(K.posix=!0,e.includes(":"))){const e=K.value.lastIndexOf("["),t=K.value.slice(0,e),n=K.value.slice(e+2),o=r[n];if(o){K.value=t+o,j.backtrack=!0,Q(),h.output||1!==A.indexOf(K)||(h.output=b);continue}}}("["===D&&":"!==U()||"-"===D&&"]"===U())&&(D=`\\${D}`),"]"!==D||"["!==K.value&&"[^"!==K.value||(D=`\\${D}`),!0===f.posix&&"!"===D&&"["===K.value&&(D="^"),K.value+=D,q({value:D});continue}if(1===j.quotes&&'"'!==D){D=t.escapeRegex(D),K.value+=D,q({value:D});continue}if('"'===D){j.quotes=1===j.quotes?0:1,!0===f.keepQuotes&&V({type:"text",value:D});continue}if("("===D){Y("parens"),V({type:"paren",value:D});continue}if(")"===D){if(0===j.parens&&!0===f.strictBrackets)throw new SyntaxError(u("opening","("));const e=B[B.length-1];if(e&&j.parens===e.parens+1){ee(B.pop());continue}V({type:"paren",value:D,output:j.parens?")":"\\)"}),z("parens");continue}if("["===D){if(!0!==f.nobracket&&W().includes("]"))Y("brackets");else{if(!0!==f.nobracket&&!0===f.strictBrackets)throw new SyntaxError(u("closing","]"));D=`\\${D}`}V({type:"bracket",value:D});continue}if("]"===D){if(!0===f.nobracket||K&&"bracket"===K.type&&1===K.value.length){V({type:"text",value:D,output:`\\${D}`});continue}if(0===j.brackets){if(!0===f.strictBrackets)throw new SyntaxError(u("opening","["));V({type:"text",value:D,output:`\\${D}`});continue}z("brackets");const e=K.value.slice(1);if(!0===K.posix||"^"!==e[0]||e.includes("/")||(D=`/${D}`),K.value+=D,q({value:D}),!1===f.literalBrackets||t.hasRegexChars(e))continue;const n=t.escapeRegex(K.value);if(j.output=j.output.slice(0,-K.value.length),!0===f.literalBrackets){j.output+=n,K.value=n;continue}K.value=`(${R}${n}|${K.value})`,j.output+=K.value;continue}if("{"===D&&!0!==f.nobrace){Y("braces");const e={type:"brace",value:D,output:"(",outputIndex:j.output.length,tokensIndex:j.tokens.length};P.push(e),V(e);continue}if("}"===D){const e=P[P.length-1];if(!0===f.nobrace||!e){V({type:"text",value:D,output:D});continue}let t=")";if(!0===e.dots){const e=A.slice(),n=[];for(let t=e.length-1;t>=0&&(A.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&n.unshift(e[t].value);t=a(n,f),j.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const n=j.output.slice(0,e.outputIndex),r=j.tokens.slice(e.tokensIndex);e.value=e.output="\\{",D=t="\\}",j.output=n;for(const e of r)j.output+=e.output||e.value}V({type:"brace",value:D,output:t}),z("braces"),P.pop();continue}if("|"===D){B.length>0&&B[B.length-1].conditions++,V({type:"text",value:D});continue}if(","===D){let e=D;const t=P[P.length-1];t&&"braces"===G[G.length-1]&&(t.comma=!0,e="|"),V({type:"comma",value:D,output:e});continue}if("/"===D){if("dot"===K.type&&j.index===j.start+1){j.start=j.index+1,j.consumed="",j.output="",A.pop(),K=h;continue}V({type:"slash",value:D,output:S});continue}if("."===D){if(j.braces>0&&"dot"===K.type){"."===K.value&&(K.output=_);const e=P[P.length-1];K.type="dots",K.output+=D,K.value+=D,e.dots=!0;continue}if(j.braces+j.parens===0&&"bos"!==K.type&&"slash"!==K.type){V({type:"text",value:D,output:_});continue}V({type:"dot",value:D,output:_});continue}if("?"===D){if((!K||"("!==K.value)&&!0!==f.noextglob&&"("===U()&&"?"!==U(2)){J("qmark",D);continue}if(K&&"paren"===K.type){const e=U();let n=D;if("<"===e&&!t.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");("("===K.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(W()))&&(n=`\\${D}`),V({type:"text",value:D,output:n});continue}if(!0!==f.dot&&("slash"===K.type||"bos"===K.type)){V({type:"qmark",value:D,output:T});continue}V({type:"qmark",value:D,output:w});continue}if("!"===D){if(!0!==f.noextglob&&"("===U()&&("?"!==U(2)||!/[!=<:]/.test(U(3)))){J("negate",D);continue}if(!0!==f.nonegate&&0===j.index){Z();continue}}if("+"===D){if(!0!==f.noextglob&&"("===U()&&"?"!==U(2)){J("plus",D);continue}if(K&&"("===K.value||!1===f.regex){V({type:"plus",value:D,output:C});continue}if(K&&("bracket"===K.type||"paren"===K.type||"brace"===K.type)||j.parens>0){V({type:"plus",value:D});continue}V({type:"plus",value:C});continue}if("@"===D){if(!0!==f.noextglob&&"("===U()&&"?"!==U(2)){V({type:"at",extglob:!0,value:D,output:""});continue}V({type:"text",value:D});continue}if("*"!==D){"$"!==D&&"^"!==D||(D=`\\${D}`);const e=o.exec(W());e&&(D+=e[0],j.index+=e[0].length),V({type:"text",value:D});continue}if(K&&("globstar"===K.type||!0===K.star)){K.type="star",K.star=!0,K.value+=D,K.output=M,j.backtrack=!0,j.globstar=!0,X(D);continue}let e=W();if(!0!==f.noextglob&&/^\([^?]/.test(e)){J("star",D);continue}if("star"===K.type){if(!0===f.noglobstar){X(D);continue}const t=K.prev,n=t.prev,r="slash"===t.type||"bos"===t.type,o=n&&("star"===n.type||"globstar"===n.type);if(!0===f.bash&&(!r||e[0]&&"/"!==e[0])){V({type:"star",value:D,output:""});continue}const s=j.braces>0&&("comma"===t.type||"brace"===t.type),i=B.length&&("pipe"===t.type||"paren"===t.type);if(!r&&"paren"!==t.type&&!s&&!i){V({type:"star",value:D,output:""});continue}for(;"/**"===e.slice(0,3);){const t=l[j.index+4];if(t&&"/"!==t)break;e=e.slice(3),X("/**",3)}if("bos"===t.type&&F()){K.type="globstar",K.value+=D,K.output=k(f),j.output=K.output,j.globstar=!0,X(D);continue}if("slash"===t.type&&"bos"!==t.prev.type&&!o&&F()){j.output=j.output.slice(0,-(t.output+K.output).length),t.output=`(?:${t.output}`,K.type="globstar",K.output=k(f)+(f.strictSlashes?")":"|$)"),K.value+=D,j.globstar=!0,j.output+=t.output+K.output,X(D);continue}if("slash"===t.type&&"bos"!==t.prev.type&&"/"===e[0]){const n=void 0!==e[1]?"|$":"";j.output=j.output.slice(0,-(t.output+K.output).length),t.output=`(?:${t.output}`,K.type="globstar",K.output=`${k(f)}${S}|${S}${n})`,K.value+=D,j.output+=t.output+K.output,j.globstar=!0,X(D+Q()),V({type:"slash",value:"/",output:""});continue}if("bos"===t.type&&"/"===e[0]){K.type="globstar",K.value+=D,K.output=`(?:^|${S}|${k(f)}${S})`,j.output=K.output,j.globstar=!0,X(D+Q()),V({type:"slash",value:"/",output:""});continue}j.output=j.output.slice(0,-K.output.length),K.type="globstar",K.output=k(f),K.value+=D,j.output+=K.output,j.globstar=!0,X(D);continue}const n={type:"star",value:D,output:M};!0!==f.bash?!K||"bracket"!==K.type&&"paren"!==K.type||!0!==f.regex?(j.index!==j.start&&"slash"!==K.type&&"dot"!==K.type||("dot"===K.type?(j.output+=$,K.output+=$):!0===f.dot?(j.output+=H,K.output+=H):(j.output+=N,K.output+=N),"*"!==U()&&(j.output+=b,K.output+=b)),V(n)):(n.output=D,V(n)):(n.output=".*?","bos"!==K.type&&"slash"!==K.type||(n.output=N+n.output),V(n))}for(;j.brackets>0;){if(!0===f.strictBrackets)throw new SyntaxError(u("closing","]"));j.output=t.escapeLast(j.output,"["),z("brackets")}for(;j.parens>0;){if(!0===f.strictBrackets)throw new SyntaxError(u("closing",")"));j.output=t.escapeLast(j.output,"("),z("parens")}for(;j.braces>0;){if(!0===f.strictBrackets)throw new SyntaxError(u("closing","}"));j.output=t.escapeLast(j.output,"{"),z("braces")}if(!0===f.strictSlashes||"star"!==K.type&&"bracket"!==K.type||V({type:"maybe_slash",value:"",output:`${S}?`}),!0===j.backtrack){j.output="";for(const e of j.tokens)j.output+=null!=e.output?e.output:e.value,e.suffix&&(j.output+=e.suffix)}return j};return p.fastpaths=(r,o)=>{const s={...o},a="number"==typeof s.maxLength?Math.min(n,s.maxLength):n,u=r.length;if(u>a)throw new SyntaxError(`Input length: ${u}, exceeds maximum allowed length: ${a}`);r=i[r]||r;const p=t.isWindows(o),{DOT_LITERAL:l,SLASH_LITERAL:c,ONE_CHAR:f,DOTS_SLASH:d,NO_DOT:g,NO_DOTS:h,NO_DOTS_SLASH:A,STAR:R,START_ANCHOR:y}=e.globChars(p),E=s.dot?h:g,m=s.dot?A:g,_=s.capture?"":"?:";let C=!0===s.bash?".*?":R;s.capture&&(C=`(${C})`);const S=e=>!0===e.noglobstar?C:`(${_}(?:(?!${y}${e.dot?d:l}).)*?)`,b=e=>{switch(e){case"*":return`${E}${f}${C}`;case".*":return`${l}${f}${C}`;case"*.*":return`${E}${C}${l}${f}${C}`;case"*/*":return`${E}${C}${c}${f}${m}${C}`;case"**":return E+S(s);case"**/*":return`(?:${E}${S(s)}${c})?${m}${f}${C}`;case"**/*.*":return`(?:${E}${S(s)}${c})?${m}${C}${l}${f}${C}`;case"**/.*":return`(?:${E}${S(s)}${c})?${l}${f}${C}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const n=b(t[1]);if(!n)return;return n+l+t[2]}}},v=t.removePrefix(r,{negated:!1,prefix:""});let x=b(v);return x&&!0!==s.strictSlashes&&(x+=`${c}?`),x},se=p}(),r=he(),o=ge(),s=(e,t,n=!1)=>{if(Array.isArray(e)){const r=e.map((e=>s(e,t,n))),o=e=>{for(const t of r){const n=t(e);if(n)return n}return!1};return o}const o=(i=e)&&"object"==typeof i&&!Array.isArray(i)&&e.tokens&&e.input;var i;if(""===e||"string"!=typeof e&&!o)throw new TypeError("Expected pattern to be a non-empty string");const a=t||{},u=r.isWindows(t),p=o?s.compileRe(e,t):s.makeRe(e,t,!1,!0),l=p.state;delete p.state;let c=()=>!1;if(a.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};c=s(a.ignore,e,n)}const f=(n,r=!1)=>{const{isMatch:o,match:i,output:f}=s.test(n,p,t,{glob:e,posix:u}),d={glob:e,state:l,regex:p,posix:u,input:n,output:f,match:i,isMatch:o};return"function"==typeof a.onResult&&a.onResult(d),!1===o?(d.isMatch=!1,!!r&&d):c(n)?("function"==typeof a.onIgnore&&a.onIgnore(d),d.isMatch=!1,!!r&&d):("function"==typeof a.onMatch&&a.onMatch(d),!r||d)};return n&&(f.state=l),f};return s.test=(e,t,n,{glob:o,posix:i}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};const a=n||{},u=a.format||(i?r.toPosixSlashes:null);let p=e===o,l=p&&u?u(e):e;return!1===p&&(l=u?u(e):e,p=l===o),!1!==p&&!0!==a.capture||(p=!0===a.matchBase||!0===a.basename?s.matchBase(e,t,n,i):t.exec(l)),{isMatch:Boolean(p),match:p,output:l}},s.matchBase=(t,n,o,i=r.isWindows(o))=>(n instanceof RegExp?n:s.makeRe(n,o)).test(e.basename(t)),s.isMatch=(e,t,n)=>s(t,n)(e),s.parse=(e,t)=>Array.isArray(e)?e.map((e=>s.parse(e,t))):n(e,{...t,fastpaths:!1}),s.scan=(e,n)=>t(e,n),s.compileRe=(e,t,n=!1,r=!1)=>{if(!0===n)return e.output;const o=t||{},i=o.contains?"":"^",a=o.contains?"":"$";let u=`${i}(?:${e.output})${a}`;e&&!0===e.negated&&(u=`^(?!${u}).*$`);const p=s.toRegex(u,t);return!0===r&&(p.state=e),p},s.makeRe=(e,t={},r=!1,o=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return!1===t.fastpaths||"."!==e[0]&&"*"!==e[0]||(i.output=n.fastpaths(e,t)),i.output||(i=n(e,t)),s.compileRe(i,t,r,o)},s.toRegex=(e,t)=>{try{const n=t||{};return new RegExp(e,n.flags||(n.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},s.constants=o,ae=s}function Re(){return le?pe:(le=1,pe=Ae())}var ye=function(){if(fe)return ce;fe=1;const e=E,t=J(),n=Re(),r=he(),o=e=>""===e||"./"===e,s=(e,t,r)=>{t=[].concat(t),e=[].concat(e);let o=new Set,s=new Set,i=new Set,a=0,u=e=>{i.add(e.output),r&&r.onResult&&r.onResult(e)};for(let i=0;i<t.length;i++){let p=n(String(t[i]),{...r,onResult:u},!0),l=p.state.negated||p.state.negatedExtglob;l&&a++;for(let t of e){let e=p(t,!0);(l?!e.isMatch:e.isMatch)&&(l?o.add(e.output):(o.delete(e.output),s.add(e.output)))}}let p=(a===t.length?[...i]:[...s]).filter((e=>!o.has(e)));if(r&&0===p.length){if(!0===r.failglob)throw new Error(`No matches found for "${t.join(", ")}"`);if(!0===r.nonull||!0===r.nullglob)return r.unescape?t.map((e=>e.replace(/\\/g,""))):t}return p};return s.match=s,s.matcher=(e,t)=>n(e,t),s.any=s.isMatch=(e,t,r)=>n(t,r)(e),s.not=(e,t,n={})=>{t=[].concat(t).map(String);let r=new Set,o=[],i=new Set(s(e,t,{...n,onResult:e=>{n.onResult&&n.onResult(e),o.push(e.output)}}));for(let e of o)i.has(e)||r.add(e);return[...r]},s.contains=(t,n,r)=>{if("string"!=typeof t)throw new TypeError(`Expected a string: "${e.inspect(t)}"`);if(Array.isArray(n))return n.some((e=>s.contains(t,e,r)));if("string"==typeof n){if(o(t)||o(n))return!1;if(t.includes(n)||t.startsWith("./")&&t.slice(2).includes(n))return!0}return s.isMatch(t,n,{...r,contains:!0})},s.matchKeys=(e,t,n)=>{if(!r.isObject(e))throw new TypeError("Expected the first argument to be an object");let o=s(Object.keys(e),t,n),i={};for(let t of o)i[t]=e[t];return i},s.some=(e,t,r)=>{let o=[].concat(e);for(let e of[].concat(t)){let t=n(String(e),r);if(o.some((e=>t(e))))return!0}return!1},s.every=(e,t,r)=>{let o=[].concat(e);for(let e of[].concat(t)){let t=n(String(e),r);if(!o.every((e=>t(e))))return!1}return!0},s.all=(t,r,o)=>{if("string"!=typeof t)throw new TypeError(`Expected a string: "${e.inspect(t)}"`);return[].concat(r).every((e=>n(e,o)(t)))},s.capture=(e,t,o)=>{let s=r.isWindows(o),i=n.makeRe(String(e),{...o,capture:!0}).exec(s?r.toPosixSlashes(t):t);if(i)return i.slice(1).map((e=>void 0===e?"":e))},s.makeRe=(...e)=>n.makeRe(...e),s.scan=(...e)=>n.scan(...e),s.parse=(e,r)=>{let o=[];for(let s of[].concat(e||[]))for(let e of t(String(s),r))o.push(n.parse(e,r));return o},s.braces=(e,n)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return n&&!0===n.nobrace||!/\{.*\}/.test(e)?[e]:t(e,n)},s.braceExpand=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return s.braces(e,{...t,expand:!0})},ce=s}();const Ee=t=>e.readdirSync(t).reduce(((r,o)=>{const s=n(t,o);return e.statSync(s).isDirectory()?s.endsWith("/node_modules")?r:[...r,...Ee(s)]:[...r,s]}),[]),me=(e,t)=>new Set([...e].filter((e=>t.has(e))));let _e;function Ce(){if(_e)return _e;const e=b.getOptionValue("root");return _e=e?t.isAbsolute(e)?e:t.resolve(process.cwd(),e):void 0,_e}let Se,be="";try{S(import.meta.url).resolve("@pnpm/filter-workspace-packages"),be="pnpm"}catch{}""!==be&&b.option("-f, --filter <filter>","filter packages");let ve=!1;const xe=S(import.meta.url);function $e(e){try{return xe.resolve(e),!0}catch(e){return!1}}let He;const we=[process.env.JIEK_TS_REGISTER,"esbuild-register","@swc-node/register","ts-node/register"].filter(Boolean);for(const e of we)if($e(e)){He=e;break}const Te=S(import.meta.url);let Le="jiek.config";const Oe=t=>{t=n(t);const r=o(t),{extends:s,...i}=(a=t,e.existsSync(a)&&e.statSync(a).isFile()?x(e.readFileSync(a,"utf-8"),[],{allowTrailingComma:!0,allowEmptyContent:!0}):{});var a;const u=(p=s?Array.isArray(s)?s:[s]:[],p?.map((e=>n(r,e)))??[]);var p;return 0===u.length?i:u.map(Oe).concat(i).reduce(((e,{compilerOptions:t={},references:n,...r})=>({...e,...r,compilerOptions:{...e.compilerOptions,...t}})),{})},ke=(e,t)=>{e=n(e),t=n(t);const r=o(e),s=Oe(e),[i,a,u,p]=[s.references?.map((({path:e})=>e)),s.files,s.include,s.exclude].map((e=>e?.map((e=>n(r,e)))??[]));if(p.length>0&&p.some((e=>ye.isMatch(t,e))))return;if(0===s.files?.length&&0===s.include?.length)return;let l=!1;if(l||(l=a.length>0&&a.includes(t)),l||(l=u.length>0&&u.some((e=>ye.isMatch(t,e)))),l)return s.compilerOptions??{};if(!(s.files&&s.files.length>0||s.include&&s.include.length>0)){i.reverse();for(const e of i){const n=ke(e,t);if(n)return n}return s.compilerOptions}};var Ne=(e={})=>{const{onEvent:t}=e;return{name:"progress",buildStart:()=>t?.("start","Start building..."),buildEnd:()=>t?.("end","Build completed!"),resolveId:{order:"post",handler:e=>t?.("resolve",`Resolving ${e}...`)},load:{order:"post",handler:e=>t?.("load",`Loading ${e}...`)},transform:{order:"post",handler:(e,n)=>t?.("transform",`Transforming ${n}...`)}}},Ie=(e={})=>({name:"skip",load(t){if(e.patterns?.some((e=>"string"==typeof e?t.includes(e):e.test(t))))return""}});const Me=["te?xt","json","(css|s[ac]ss|less|styl)"];const{JIEK_ROOT:je,JIEK_ENTRIES:Be}=process.env,Pe=je??d(),Ge={},De=[h()],Ke=function(n){const{wd:r}=function(){if(Se)return{wd:Se,notWorkspace:ve};const e=Ce();if(void 0!==e){const t=f(e,be);return ve=!t,Se=e,{wd:Se,notWorkspace:ve}}try{Se=d(be)}catch(t){if(!("message"in t)||"workspace root not found"!==t.message)throw t;Se=e,ve=!0}return{wd:Se,notWorkspace:ve}}();let o=b.getOptionValue("configPath");if(o){if(!e.existsSync(o))throw new Error(`config file not found: ${o}`);t.isAbsolute(o)||(o=t.resolve(r,o))}else o=function(n,r){const o=!!He;function s(o){const s=[t.resolve(process.cwd(),`${Le}.${o}`),t.resolve(process.cwd(),`.${Le}.${o}`),t.resolve(n,`${Le}.${o}`),t.resolve(n,`.${Le}.${o}`)];r&&s.unshift(t.resolve(r,`${Le}.${o}`),t.resolve(r,`.${Le}.${o}`));for(const t of s)if(e.existsSync(t)&&e.lstatSync(t).isFile())return t}return Le=s("js")??Le,Le=s("json")??Le,Le=s("yaml")??Le,o&&(Le=s("ts")??Le),t.resolve(n,Le)}(r,n);const s=t.extname(o);let i;switch(s){case".js":i=Te(o);break;case".json":return Te(o);case".yaml":return v(e.readFileSync(o,"utf-8"));case".ts":if(He){Te(He),i=Te(o);break}throw new Error("ts config file is not supported without ts register, please install esbuild-register or set JIEK_TS_REGISTER env for custom ts register");case".config":i={};break;default:throw new Error(`unsupported config file type: ${s}`)}if(!i)throw new Error("config file is empty");return i.default??i}()??{},{build:Fe={}}=Ke,Ue=`./${r(process.cwd(),n(("object"==typeof Fe?.output?.dir?Fe.output.dir.js:Fe?.output?.dir)??"dist"))}`,Qe=/\.(css|s[ac]ss|less|styl)$/,We=e=>n(Pe,e),Xe=e=>e.replace(/[@|/-](\w)/g,((e,t)=>t.toUpperCase())).replace(/(?:^|-)(\w)/g,((e,t)=>t.toUpperCase())),qe=(e,t=Fe?.output?.minify)=>!1===t?[e]:"only-minify"===t?[{...e,entryFileNames:t=>"function"==typeof e.entryFileNames?e.entryFileNames(t):(()=>{throw new Error("entryFileNames must be a function")})(),plugins:[...e.plugins??[],R()]}]:[e,{...e,entryFileNames:t=>"function"==typeof e.entryFileNames?e.entryFileNames(t).replace(/(\.[cm]?js)$/,".min$1"):(()=>{throw new Error("entryFileNames must be a function")})(),file:e.file?.replace(/(\.[cm]?js)$/,".min$1"),plugins:[...e.plugins??[],R()]}],Ze=(t,i={})=>{const{path:a,name:u,input:p,output:l,external:f,pkgIsModule:d,conditionals:h}=t,R=h.includes("import"),E=h.includes("require"),m=h.includes("browser");let S;[We("tsconfig.json"),We("tsconfig.dts.json")].forEach((t=>{e.existsSync(t)&&e.statSync(t).isFile()&&(S=t)}));let b={};if(S){const e=ke(S,n(p)),{options:t,errors:r}=C.convertCompilerOptionsFromJson(e,o(S));if(r.length>0)throw new Error(r.map((e=>e.messageText)).join("\n"));b=t,delete b.composite}const v=[...h,...b.customConditions??[]],x={type:"progress",data:{name:u,path:a,exportConditions:v,input:p}},$=i?.output?.dir,{js:H,dts:w}=((e,t)=>{if(!1===t||null==t)return{js:[],dts:[]};let n=[],r=[];switch(typeof t){case"function":n=t("js",e),r=t("dts",e);break;case"object":"js"in t||"dts"in t?(n=t.js??[],r=t.dts??[]):(n=t,r=t)}return{js:n,dts:r}})(t,Fe.plugins);if(p.includes("**"))throw new Error('input should not include "**", please read the [documentation](https://nodejs.org/api/packages.html#subpath-patterns).');const T=p.includes("*")?Ee(process.cwd()).filter((e=>/(?<!\.d)\.[cm]?tsx?$/.test(e))).map((e=>r(process.cwd(),e))).filter((e=>ye.isMatch(e,p.slice(2)))):p,L=p.includes("*")?p.split("*")[0].replace("./",""):"",O=a.includes("*")?a.split("*")[0].replace("./",""):"";if(L.length>0&&0===O.length||0===L.length&&O.length>0)throw new Error('input and path should both include "*" or not include "*"');const k=s(l),N=k.replace(/(\.[cm]?)js$/,".d$1ts");return[{input:T,external:f,output:[...qe({dir:Ue,name:u,interop:"auto",entryFileNames:e=>Array.isArray(T)?e.facadeModuleId.replace(`${process.cwd()}/`,"").replace(L,O).replace(/(\.[cm]?)ts$/,k):l.replace(`${Ue}/`,""),sourcemap:"object"==typeof i?.output?.sourcemap?i.output.sourcemap.js:i?.output?.sourcemap,format:R?"esm":E?"cjs":m?"umd":d?"esm":"cjs",strict:"object"==typeof i?.output?.strict?i.output.strict.js:i?.output?.strict})],plugins:[A({exportConditions:v}),import("rollup-plugin-postcss").then((({default:e})=>e({extract:n(l.replace(/\.[cm]?js$/,".css")),minimize:!0}))).catch((()=>{})),_({tsconfig:S}),g(),Ne({onEvent:(e,t)=>y({...x,data:{...x.data,event:e,message:t,tags:["js"]}})}),H]},{input:T,external:f,output:[{dir:n(("object"==typeof $?$.dts:$)??"dist"),sourcemap:"object"==typeof i?.output?.sourcemap?i.output.sourcemap.dts:i?.output?.sourcemap,entryFileNames:e=>Array.isArray(T)?e.facadeModuleId.replace(`${process.cwd()}/`,"").replace(L,O).replace(/(\.[cm]?)ts$/,N):l.replace(`${Ue}/`,"").replace(/(\.[cm]?)js$/,N),strict:"object"==typeof i?.output?.strict?i.output.strict.dts:i?.output?.strict}],plugins:[A({exportConditions:v}),Ie({patterns:[Qe]}),c({respectExternal:!0,compilerOptions:{...b,outDir:"dist",declaration:!0}}),Ne({onEvent:(e,t)=>y({...x,data:{...x.data,event:e,message:t,tags:["dts"]}})}),w]}]};function Ye(t){const{name:o,type:s,exports:c}=t,f="module"===s;if(!o)throw new Error("package.json name is required");if(!c)throw new Error("package.json exports is required");const d=Be?.split(",").map((e=>e.trim())).map((e=>({index:"."}[e]??e))),g=Xe(o),h=function(t=process.cwd()){const n="string"==typeof t?e.existsSync(`${t}/package.json`)?JSON.parse(e.readFileSync(`${t}/package.json`,"utf-8")):{}:t,{name:r,dependencies:o={},peerDependencies:s={},optionalDependencies:i={}}=n;if(!r)throw new Error("package.json must have a name field");return Object.keys(o).concat(Object.keys(s)).concat(Object.keys(i)).map((e=>new RegExp(`^${e}(/.*)?$`))).concat([new RegExp(`^${r}(/.*)?(?<!${Me.map((e=>`\\.${e}`)).join("|")})$`),/^node:/])}(t),[A,R]=function({entrypoints:e,pkgIsModule:t,entries:o,config:s,dir:l,noFilter:c,isPublish:f}){const{build:d={},publish:{withSuffix:g=!1,withSource:h=!0}={}}=s??{},{crossModuleConvertor:A=!0}=d,R=`./${(e=>r(l??process.cwd(),e))(((...e)=>n(l??process.cwd(),...e))(("object"==typeof d?.output?.dir?d.output.dir.js:d?.output?.dir)??"dist"))}`,[,y]=i(e);o&&Object.entries(y).forEach((([e])=>{o.some((t=>ye.isMatch(e,t,{matchBase:!0})))||delete y[e]}));const E=c?y:a(y,{skipValue:[/(^|\/)\.jk-noentry/,...u]});return[E,p(E,{outdir:R,withSuffix:f?g:void 0,withSource:f?h:void 0,withConditional:{...A?{import:e=>!t&&0===me(new Set(e.conditionals),new Set(["import","module"])).size&&e.dist.replace(/\.js$/,".mjs"),require:e=>!(!t||0!==me(new Set(e.conditionals),new Set(["require","node"])).size)&&e.dist.replace(/\.js$/,".cjs")}:{}}})]}({entrypoints:c,pkgIsModule:f,entries:d,config:Ke}),E=new Map;l(A,(({keys:e,value:t})=>{if("string"==typeof t){const n=E.get(t)??[];E.set(t,n),n.push(e)}return!1}));const m=[];return E.forEach(((e,t)=>e.forEach((e=>{const[n,...r]=e,o=g+("."===n?"":Xe(n)),s=((e,t)=>t.reduce(((e,t)=>{if("string"==typeof e)throw new Error("key not found in exports");if(!(t in e))throw new Error(`key ${t} not found in exports`);return e[t]}),e))(R,e),i={path:n,name:o,input:t,external:h,pkgIsModule:f};switch(typeof s){case"string":m.push(...Ze({...i,output:s,conditionals:r},Fe));break;case"object":l(s,(({keys:e,value:t})=>{const n=[...new Set([...r,...e])];return"string"==typeof t&&m.push(...Ze({...i,output:t,conditionals:n},Fe)),!1}))}})))),y({type:"init",data:{leafMap:E,targetsLength:m.length}}),m.map((e=>({...Ge,...e,plugins:[...De,e.plugins]})))}export{Ye as template};
|
19
|
+
*/function z(){if(I)return N;I=1;const e=E,t=Y(),n=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),r=e=>"number"==typeof e||"string"==typeof e&&""!==e,o=e=>Number.isInteger(+e),s=e=>{let t=`${e}`,n=-1;if("-"===t[0]&&(t=t.slice(1)),"0"===t)return!1;for(;"0"===t[++n];);return n>0},i=(e,t,n)=>{if(t>0){let n="-"===e[0]?"-":"";n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,"0")}return!1===n?String(e):e},a=(e,t)=>{let n="-"===e[0]?"-":"";for(n&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return n?"-"+e:e},u=(e,n,r,o)=>{if(r)return t(e,n,{wrap:!1,...o});let s=String.fromCharCode(e);return e===n?s:`[${s}-${String.fromCharCode(n)}]`},p=(e,n,r)=>{if(Array.isArray(e)){let t=!0===r.wrap,n=r.capture?"":"?:";return t?`(${n}${e.join("|")})`:e.join("|")}return t(e,n,r)},l=(...t)=>new RangeError("Invalid range arguments: "+e.inspect(...t)),c=(e,t,n)=>{if(!0===n.strictRanges)throw l([e,t]);return[]},f=(e,t,n=1,r={})=>{let o=Number(e),c=Number(t);if(!Number.isInteger(o)||!Number.isInteger(c)){if(!0===r.strictRanges)throw l([e,t]);return[]}0===o&&(o=0),0===c&&(c=0);let f=o>c,d=String(e),g=String(t),h=String(n);n=Math.max(Math.abs(n),1);let A=s(d)||s(g)||s(h),R=A?Math.max(d.length,g.length,h.length):0,y=!1===A&&!1===((e,t,n)=>"string"==typeof e||"string"==typeof t||!0===n.stringify)(e,t,r),E=r.transform||(e=>t=>!0===e?Number(t):String(t))(y);if(r.toRegex&&1===n)return u(a(e,R),a(t,R),!0,r);let m={negatives:[],positives:[]},_=[],C=0;for(;f?o>=c:o<=c;)!0===r.toRegex&&n>1?m[(S=o)<0?"negatives":"positives"].push(Math.abs(S)):_.push(i(E(o,C),R,y)),o=f?o-n:o+n,C++;var S;return!0===r.toRegex?n>1?((e,t)=>{e.negatives.sort(((e,t)=>e<t?-1:e>t?1:0)),e.positives.sort(((e,t)=>e<t?-1:e>t?1:0));let n,r=t.capture?"":"?:",o="",s="";return e.positives.length&&(o=e.positives.join("|")),e.negatives.length&&(s=`-(${r}${e.negatives.join("|")})`),n=o&&s?`${o}|${s}`:o||s,t.wrap?`(${r}${n})`:n})(m,r):p(_,null,{wrap:!1,...r}):_},d=(e,t,s,i={})=>{if(null==t&&r(e))return[e];if(!r(e)||!r(t))return c(e,t,i);if("function"==typeof s)return d(e,t,1,{transform:s});if(n(s))return d(e,t,0,s);let a={...i};return!0===a.capture&&(a.wrap=!0),s=s||a.step||1,o(s)?o(e)&&o(t)?f(e,t,s,a):((e,t,n=1,r={})=>{if(!o(e)&&e.length>1||!o(t)&&t.length>1)return c(e,t,r);let s=r.transform||(e=>String.fromCharCode(e)),i=`${e}`.charCodeAt(0),a=`${t}`.charCodeAt(0),l=i>a,f=Math.min(i,a),d=Math.max(i,a);if(r.toRegex&&1===n)return u(f,d,!1,r);let g=[],h=0;for(;l?i>=a:i<=a;)g.push(s(i,h)),i=l?i-n:i+n,h++;return!0===r.toRegex?p(g,null,{wrap:!1,options:r}):g})(e,t,Math.max(Math.abs(s),1),a):null==s||n(s)?d(e,t,1,s):((e,t)=>{if(!0===t.strictRanges)throw new TypeError(`Expected step "${e}" to be a number`);return[]})(s,a)};return N=d}function V(){if(F)return K;F=1;const e=q(),{MAX_LENGTH:t,CHAR_BACKSLASH:n,CHAR_BACKTICK:r,CHAR_COMMA:o,CHAR_DOT:s,CHAR_LEFT_PARENTHESES:i,CHAR_RIGHT_PARENTHESES:a,CHAR_LEFT_CURLY_BRACE:u,CHAR_RIGHT_CURLY_BRACE:p,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_RIGHT_SQUARE_BRACKET:c,CHAR_DOUBLE_QUOTE:f,CHAR_SINGLE_QUOTE:d,CHAR_NO_BREAK_SPACE:g,CHAR_ZERO_WIDTH_NOBREAK_SPACE:h}=D?G:(D=1,G={MAX_LENGTH:65536,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:"\n",CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\ufeff"});return K=(A,R={})=>{if("string"!=typeof A)throw new TypeError("Expected a string");let y=R||{},E="number"==typeof y.maxLength?Math.min(t,y.maxLength):t;if(A.length>E)throw new SyntaxError(`Input length (${A.length}), exceeds max characters (${E})`);let m,_={type:"root",input:A,nodes:[]},C=[_],S=_,b=_,v=0,x=A.length,$=0,H=0;const w=()=>A[$++],T=e=>{if("text"===e.type&&"dot"===b.type&&(b.type="text"),!b||"text"!==b.type||"text"!==e.type)return S.nodes.push(e),e.parent=S,e.prev=b,b=e,e;b.value+=e.value};for(T({type:"bos"});$<x;)if(S=C[C.length-1],m=w(),m!==h&&m!==g)if(m!==n)if(m!==c)if(m!==l)if(m!==i)if(m!==a)if(m!==f&&m!==d&&m!==r)if(m!==u)if(m!==p)if(m===o&&H>0){if(S.ranges>0){S.ranges=0;let t=S.nodes.shift();S.nodes=[t,{type:"text",value:e(S)}]}T({type:"comma",value:m}),S.commas++}else if(m===s&&H>0&&0===S.commas){let e=S.nodes;if(0===H||0===e.length){T({type:"text",value:m});continue}if("dot"===b.type){if(S.range=[],b.value+=m,b.type="range",3!==S.nodes.length&&5!==S.nodes.length){S.invalid=!0,S.ranges=0,b.type="text";continue}S.ranges++,S.args=[];continue}if("range"===b.type){e.pop();let t=e[e.length-1];t.value+=b.value+m,b=t,S.ranges--;continue}T({type:"dot",value:m})}else T({type:"text",value:m});else{if("brace"!==S.type){T({type:"text",value:m});continue}let e="close";S=C.pop(),S.close=!0,T({type:e,value:m}),H--,S=C[C.length-1]}else{H++;let e=b.value&&"$"===b.value.slice(-1)||!0===S.dollar;S=T({type:"brace",open:!0,close:!1,dollar:e,depth:H,commas:0,ranges:0,nodes:[]}),C.push(S),T({type:"open",value:m})}else{let e,t=m;for(!0!==R.keepQuotes&&(m="");$<x&&(e=w());)if(e!==n){if(e===t){!0===R.keepQuotes&&(m+=e);break}m+=e}else m+=e+w();T({type:"text",value:m})}else{if("paren"!==S.type){T({type:"text",value:m});continue}S=C.pop(),T({type:"text",value:m}),S=C[C.length-1]}else S=T({type:"paren",nodes:[]}),C.push(S),T({type:"text",value:m});else{let e;for(v++;$<x&&(e=w());)if(m+=e,e!==l)if(e!==n){if(e===c&&(v--,0===v))break}else m+=w();else v++;T({type:"text",value:m})}else T({type:"text",value:"\\"+m});else T({type:"text",value:(R.keepEscaping?m:"")+w()});do{if(S=C.pop(),"root"!==S.type){S.nodes.forEach((e=>{e.nodes||("open"===e.type&&(e.isOpen=!0),"close"===e.type&&(e.isClose=!0),e.nodes||(e.type="text"),e.invalid=!0)}));let e=C[C.length-1],t=e.nodes.indexOf(S);e.nodes.splice(t,1,...S.nodes)}}while(C.length>0);return T({type:"eos"}),_},K}function J(){if(Q)return U;Q=1;const e=q(),t=function(){if(j)return M;j=1;const e=z(),t=X();return M=(n,r={})=>{let o=(n,s={})=>{let i=t.isInvalidBrace(s),a=!0===n.invalid&&!0===r.escapeInvalid,u=!0===i||!0===a,p=!0===r.escapeInvalid?"\\":"",l="";if(!0===n.isOpen)return p+n.value;if(!0===n.isClose)return p+n.value;if("open"===n.type)return u?p+n.value:"(";if("close"===n.type)return u?p+n.value:")";if("comma"===n.type)return"comma"===n.prev.type?"":u?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let o=t.reduce(n.nodes),s=e(...o,{...r,wrap:!1,toRegex:!0});if(0!==s.length)return o.length>1&&s.length>1?`(${s})`:s}if(n.nodes)for(let e of n.nodes)l+=o(e,n);return l};return o(n)}}(),n=function(){if(P)return B;P=1;const e=z(),t=q(),n=X(),r=(e="",t="",o=!1)=>{let s=[];if(e=[].concat(e),!(t=[].concat(t)).length)return e;if(!e.length)return o?n.flatten(t).map((e=>`{${e}}`)):t;for(let n of e)if(Array.isArray(n))for(let e of n)s.push(r(e,t,o));else for(let e of t)!0===o&&"string"==typeof e&&(e=`{${e}}`),s.push(Array.isArray(e)?r(n,e,o):n+e);return n.flatten(s)};return B=(o,s={})=>{let i=void 0===s.rangeLimit?1e3:s.rangeLimit,a=(o,u={})=>{o.queue=[];let p=u,l=u.queue;for(;"brace"!==p.type&&"root"!==p.type&&p.parent;)p=p.parent,l=p.queue;if(o.invalid||o.dollar)return void l.push(r(l.pop(),t(o,s)));if("brace"===o.type&&!0!==o.invalid&&2===o.nodes.length)return void l.push(r(l.pop(),["{}"]));if(o.nodes&&o.ranges>0){let a=n.reduce(o.nodes);if(n.exceedsLimit(...a,s.step,i))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let u=e(...a,s);return 0===u.length&&(u=t(o,s)),l.push(r(l.pop(),u)),void(o.nodes=[])}let c=n.encloseBrace(o),f=o.queue,d=o;for(;"brace"!==d.type&&"root"!==d.type&&d.parent;)d=d.parent,f=d.queue;for(let e=0;e<o.nodes.length;e++){let t=o.nodes[e];"comma"!==t.type||"brace"!==o.type?"close"!==t.type?t.value&&"open"!==t.type?f.push(r(f.pop(),t.value)):t.nodes&&a(t,o):l.push(r(l.pop(),f,c)):(1===e&&f.push(""),f.push(""))}return f};return n.flatten(a(o))}}(),r=V(),o=(e,t={})=>{let n=[];if(Array.isArray(e))for(let r of e){let e=o.create(r,t);Array.isArray(e)?n.push(...e):n.push(e)}else n=[].concat(o.create(e,t));return t&&!0===t.expand&&!0===t.nodupes&&(n=[...new Set(n)]),n};return o.parse=(e,t={})=>r(e,t),o.stringify=(t,n={})=>e("string"==typeof t?o.parse(t,n):t,n),o.compile=(e,n={})=>("string"==typeof e&&(e=o.parse(e,n)),t(e,n)),o.expand=(e,t={})=>{"string"==typeof e&&(e=o.parse(e,t));let r=n(e,t);return!0===t.noempty&&(r=r.filter(Boolean)),!0===t.nodupes&&(r=[...new Set(r)]),r},o.create=(e,t={})=>""===e||e.length<3?[e]:!0!==t.expand?o.compile(e,t):o.expand(e,t),U=o}var ee,te,ne,re,oe,se,ie,ae,ue,pe,le,ce,fe,de={};function ge(){if(te)return ee;te=1;const e=m,t="\\\\/",n=`[^${t}]`,r="\\.",o="\\/",s="[^/]",i=`(?:${o}|$)`,a=`(?:^|${o})`,u=`${r}{1,2}${i}`,p={DOT_LITERAL:r,PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:o,ONE_CHAR:"(?=.)",QMARK:s,END_ANCHOR:i,DOTS_SLASH:u,NO_DOT:`(?!${r})`,NO_DOTS:`(?!${a}${u})`,NO_DOT_SLASH:`(?!${r}{0,1}${i})`,NO_DOTS_SLASH:`(?!${u})`,QMARK_NO_DOT:`[^.${o}]`,STAR:`${s}*?`,START_ANCHOR:a},l={...p,SLASH_LITERAL:`[${t}]`,QMARK:n,STAR:`${n}*?`,DOTS_SLASH:`${r}{1,2}(?:[${t}]|$)`,NO_DOT:`(?!${r})`,NO_DOTS:`(?!(?:^|[${t}])${r}{1,2}(?:[${t}]|$))`,NO_DOT_SLASH:`(?!${r}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${r}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`};return ee={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:e.sep,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?l:p}}function he(){return ne||(ne=1,function(e){const t=m,n="win32"===process.platform,{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:o,REGEX_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_GLOBAL:i}=ge();e.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),e.hasRegexChars=e=>s.test(e),e.isRegexChar=t=>1===t.length&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(i,"\\$1"),e.toPosixSlashes=e=>e.replace(r,"/"),e.removeBackslashes=e=>e.replace(o,(e=>"\\"===e?"":e)),e.supportsLookbehinds=()=>{const e=process.version.slice(1).split(".").map(Number);return 3===e.length&&e[0]>=9||8===e[0]&&e[1]>=10},e.isWindows=e=>e&&"boolean"==typeof e.windows?e.windows:!0===n||"\\"===t.sep,e.escapeLast=(t,n,r)=>{const o=t.lastIndexOf(n,r);return-1===o?t:"\\"===t[o-1]?e.escapeLast(t,n,o-1):`${t.slice(0,o)}\\${t.slice(o)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith("./")&&(n=n.slice(2),t.prefix="./"),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?"":"^"}(?:${e})${n.contains?"":"$"}`;return!0===t.negated&&(r=`(?:^(?!${r}).*$)`),r}}(de)),de}function Ae(){if(ue)return ae;ue=1;const e=m,t=function(){if(oe)return re;oe=1;const e=he(),{CHAR_ASTERISK:t,CHAR_AT:n,CHAR_BACKWARD_SLASH:r,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:i,CHAR_FORWARD_SLASH:a,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:p,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:c,CHAR_QUESTION_MARK:f,CHAR_RIGHT_CURLY_BRACE:d,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:h}=ge(),A=e=>e===a||e===r,R=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};return re=(y,E)=>{const m=E||{},_=y.length-1,C=!0===m.parts||!0===m.scanToEnd,S=[],b=[],v=[];let x,$,H=y,w=-1,T=0,L=0,O=!1,k=!1,N=!1,I=!1,M=!1,j=!1,B=!1,P=!1,G=!1,D=!1,K=0,F={value:"",depth:0,isGlob:!1};const U=()=>w>=_,Q=()=>(x=$,H.charCodeAt(++w));for(;w<_;){let e;if($=Q(),$!==r){if(!0===j||$===u){for(K++;!0!==U()&&($=Q());)if($!==r)if($!==u){if(!0!==j&&$===s&&($=Q())===s){if(O=F.isBrace=!0,N=F.isGlob=!0,D=!0,!0===C)continue;break}if(!0!==j&&$===o){if(O=F.isBrace=!0,N=F.isGlob=!0,D=!0,!0===C)continue;break}if($===d&&(K--,0===K)){j=!1,O=F.isBrace=!0,D=!0;break}}else K++;else B=F.backslashes=!0,Q();if(!0===C)continue;break}if($!==a){if(!0!==m.noext&&!0==($===c||$===n||$===t||$===f||$===i)&&H.charCodeAt(w+1)===p){if(N=F.isGlob=!0,I=F.isExtglob=!0,D=!0,$===i&&w===T&&(G=!0),!0===C){for(;!0!==U()&&($=Q());)if($!==r){if($===g){N=F.isGlob=!0,D=!0;break}}else B=F.backslashes=!0,$=Q();continue}break}if($===t){if(x===t&&(M=F.isGlobstar=!0),N=F.isGlob=!0,D=!0,!0===C)continue;break}if($===f){if(N=F.isGlob=!0,D=!0,!0===C)continue;break}if($===l){for(;!0!==U()&&(e=Q());)if(e!==r){if(e===h){k=F.isBracket=!0,N=F.isGlob=!0,D=!0;break}}else B=F.backslashes=!0,Q();if(!0===C)continue;break}if(!0===m.nonegate||$!==i||w!==T){if(!0!==m.noparen&&$===p){if(N=F.isGlob=!0,!0===C){for(;!0!==U()&&($=Q());)if($!==p){if($===g){D=!0;break}}else B=F.backslashes=!0,$=Q();continue}break}if(!0===N){if(D=!0,!0===C)continue;break}}else P=F.negated=!0,T++}else{if(S.push(w),b.push(F),F={value:"",depth:0,isGlob:!1},!0===D)continue;if(x===s&&w===T+1){T+=2;continue}L=w+1}}else B=F.backslashes=!0,$=Q(),$===u&&(j=!0)}!0===m.noext&&(I=!1,N=!1);let W=H,X="",q="";T>0&&(X=H.slice(0,T),H=H.slice(T),L-=T),W&&!0===N&&L>0?(W=H.slice(0,L),q=H.slice(L)):!0===N?(W="",q=H):W=H,W&&""!==W&&"/"!==W&&W!==H&&A(W.charCodeAt(W.length-1))&&(W=W.slice(0,-1)),!0===m.unescape&&(q&&(q=e.removeBackslashes(q)),W&&!0===B&&(W=e.removeBackslashes(W)));const Z={prefix:X,input:y,start:T,base:W,glob:q,isBrace:O,isBracket:k,isGlob:N,isExtglob:I,isGlobstar:M,negated:P,negatedExtglob:G};if(!0===m.tokens&&(Z.maxDepth=0,A($)||b.push(F),Z.tokens=b),!0===m.parts||!0===m.tokens){let e;for(let t=0;t<S.length;t++){const n=e?e+1:T,r=S[t],o=y.slice(n,r);m.tokens&&(0===t&&0!==T?(b[t].isPrefix=!0,b[t].value=X):b[t].value=o,R(b[t]),Z.maxDepth+=b[t].depth),0===t&&""===o||v.push(o),e=r}if(e&&e+1<y.length){const t=y.slice(e+1);v.push(t),m.tokens&&(b[b.length-1].value=t,R(b[b.length-1]),Z.maxDepth+=b[b.length-1].depth)}Z.slashes=S,Z.parts=v}return Z}}(),n=function(){if(ie)return se;ie=1;const e=ge(),t=he(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:i}=e,a=(e,n)=>{if("function"==typeof n.expandRange)return n.expandRange(...e,n);e.sort();const r=`[${e.join("-")}]`;try{new RegExp(r)}catch(n){return e.map((e=>t.escapeRegex(e))).join("..")}return r},u=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,p=(l,c)=>{if("string"!=typeof l)throw new TypeError("Expected a string");l=i[l]||l;const f={...c},d="number"==typeof f.maxLength?Math.min(n,f.maxLength):n;let g=l.length;if(g>d)throw new SyntaxError(`Input length: ${g}, exceeds maximum allowed length: ${d}`);const h={type:"bos",value:"",output:f.prepend||""},A=[h],R=f.capture?"":"?:",y=t.isWindows(c),E=e.globChars(y),m=e.extglobChars(E),{DOT_LITERAL:_,PLUS_LITERAL:C,SLASH_LITERAL:S,ONE_CHAR:b,DOTS_SLASH:v,NO_DOT:x,NO_DOT_SLASH:$,NO_DOTS_SLASH:H,QMARK:w,QMARK_NO_DOT:T,STAR:L,START_ANCHOR:O}=E,k=e=>`(${R}(?:(?!${O}${e.dot?v:_}).)*?)`,N=f.dot?"":x,I=f.dot?w:T;let M=!0===f.bash?k(f):L;f.capture&&(M=`(${M})`),"boolean"==typeof f.noext&&(f.noextglob=f.noext);const j={input:l,index:-1,start:0,dot:!0===f.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:A};l=t.removePrefix(l,j),g=l.length;const B=[],P=[],G=[];let D,K=h;const F=()=>j.index===g-1,U=j.peek=(e=1)=>l[j.index+e],Q=j.advance=()=>l[++j.index]||"",W=()=>l.slice(j.index+1),X=(e="",t=0)=>{j.consumed+=e,j.index+=t},q=e=>{j.output+=null!=e.output?e.output:e.value,X(e.value)},Z=()=>{let e=1;for(;"!"===U()&&("("!==U(2)||"?"===U(3));)Q(),j.start++,e++;return e%2!=0&&(j.negated=!0,j.start++,!0)},Y=e=>{j[e]++,G.push(e)},z=e=>{j[e]--,G.pop()},V=e=>{if("globstar"===K.type){const t=j.braces>0&&("comma"===e.type||"brace"===e.type),n=!0===e.extglob||B.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||n||(j.output=j.output.slice(0,-K.output.length),K.type="star",K.value="*",K.output=M,j.output+=K.output)}if(B.length&&"paren"!==e.type&&(B[B.length-1].inner+=e.value),(e.value||e.output)&&q(e),K&&"text"===K.type&&"text"===e.type)return K.value+=e.value,void(K.output=(K.output||"")+e.value);e.prev=K,A.push(e),K=e},J=(e,t)=>{const n={...m[t],conditions:1,inner:""};n.prev=K,n.parens=j.parens,n.output=j.output;const r=(f.capture?"(":"")+n.open;Y("parens"),V({type:e,value:t,output:j.output?"":b}),V({type:"paren",extglob:!0,value:Q(),output:r}),B.push(n)},ee=e=>{let t,n=e.close+(f.capture?")":"");if("negate"===e.type){let r=M;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(r=k(f)),(r!==M||F()||/^\)+$/.test(W()))&&(n=e.close=`)$))${r}`),e.inner.includes("*")&&(t=W())&&/^\.[^\\/.]+$/.test(t)){const o=p(t,{...c,fastpaths:!1}).output;n=e.close=`)${o})${r})`}"bos"===e.prev.type&&(j.negatedExtglob=!0)}V({type:"paren",extglob:!0,value:D,output:n}),z("parens")};if(!1!==f.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(l)){let e=!1,n=l.replace(s,((t,n,r,o,s,i)=>"\\"===o?(e=!0,t):"?"===o?n?n+o+(s?w.repeat(s.length):""):0===i?I+(s?w.repeat(s.length):""):w.repeat(r.length):"."===o?_.repeat(r.length):"*"===o?n?n+o+(s?M:""):M:n?t:`\\${t}`));return!0===e&&(n=!0===f.unescape?n.replace(/\\/g,""):n.replace(/\\+/g,(e=>e.length%2==0?"\\\\":e?"\\":""))),n===l&&!0===f.contains?(j.output=l,j):(j.output=t.wrapOutput(n,j,c),j)}for(;!F();){if(D=Q(),"\0"===D)continue;if("\\"===D){const e=U();if("/"===e&&!0!==f.bash)continue;if("."===e||";"===e)continue;if(!e){D+="\\",V({type:"text",value:D});continue}const t=/^\\+/.exec(W());let n=0;if(t&&t[0].length>2&&(n=t[0].length,j.index+=n,n%2!=0&&(D+="\\")),!0===f.unescape?D=Q():D+=Q(),0===j.brackets){V({type:"text",value:D});continue}}if(j.brackets>0&&("]"!==D||"["===K.value||"[^"===K.value)){if(!1!==f.posix&&":"===D){const e=K.value.slice(1);if(e.includes("[")&&(K.posix=!0,e.includes(":"))){const e=K.value.lastIndexOf("["),t=K.value.slice(0,e),n=K.value.slice(e+2),o=r[n];if(o){K.value=t+o,j.backtrack=!0,Q(),h.output||1!==A.indexOf(K)||(h.output=b);continue}}}("["===D&&":"!==U()||"-"===D&&"]"===U())&&(D=`\\${D}`),"]"!==D||"["!==K.value&&"[^"!==K.value||(D=`\\${D}`),!0===f.posix&&"!"===D&&"["===K.value&&(D="^"),K.value+=D,q({value:D});continue}if(1===j.quotes&&'"'!==D){D=t.escapeRegex(D),K.value+=D,q({value:D});continue}if('"'===D){j.quotes=1===j.quotes?0:1,!0===f.keepQuotes&&V({type:"text",value:D});continue}if("("===D){Y("parens"),V({type:"paren",value:D});continue}if(")"===D){if(0===j.parens&&!0===f.strictBrackets)throw new SyntaxError(u("opening","("));const e=B[B.length-1];if(e&&j.parens===e.parens+1){ee(B.pop());continue}V({type:"paren",value:D,output:j.parens?")":"\\)"}),z("parens");continue}if("["===D){if(!0!==f.nobracket&&W().includes("]"))Y("brackets");else{if(!0!==f.nobracket&&!0===f.strictBrackets)throw new SyntaxError(u("closing","]"));D=`\\${D}`}V({type:"bracket",value:D});continue}if("]"===D){if(!0===f.nobracket||K&&"bracket"===K.type&&1===K.value.length){V({type:"text",value:D,output:`\\${D}`});continue}if(0===j.brackets){if(!0===f.strictBrackets)throw new SyntaxError(u("opening","["));V({type:"text",value:D,output:`\\${D}`});continue}z("brackets");const e=K.value.slice(1);if(!0===K.posix||"^"!==e[0]||e.includes("/")||(D=`/${D}`),K.value+=D,q({value:D}),!1===f.literalBrackets||t.hasRegexChars(e))continue;const n=t.escapeRegex(K.value);if(j.output=j.output.slice(0,-K.value.length),!0===f.literalBrackets){j.output+=n,K.value=n;continue}K.value=`(${R}${n}|${K.value})`,j.output+=K.value;continue}if("{"===D&&!0!==f.nobrace){Y("braces");const e={type:"brace",value:D,output:"(",outputIndex:j.output.length,tokensIndex:j.tokens.length};P.push(e),V(e);continue}if("}"===D){const e=P[P.length-1];if(!0===f.nobrace||!e){V({type:"text",value:D,output:D});continue}let t=")";if(!0===e.dots){const e=A.slice(),n=[];for(let t=e.length-1;t>=0&&(A.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&n.unshift(e[t].value);t=a(n,f),j.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const n=j.output.slice(0,e.outputIndex),r=j.tokens.slice(e.tokensIndex);e.value=e.output="\\{",D=t="\\}",j.output=n;for(const e of r)j.output+=e.output||e.value}V({type:"brace",value:D,output:t}),z("braces"),P.pop();continue}if("|"===D){B.length>0&&B[B.length-1].conditions++,V({type:"text",value:D});continue}if(","===D){let e=D;const t=P[P.length-1];t&&"braces"===G[G.length-1]&&(t.comma=!0,e="|"),V({type:"comma",value:D,output:e});continue}if("/"===D){if("dot"===K.type&&j.index===j.start+1){j.start=j.index+1,j.consumed="",j.output="",A.pop(),K=h;continue}V({type:"slash",value:D,output:S});continue}if("."===D){if(j.braces>0&&"dot"===K.type){"."===K.value&&(K.output=_);const e=P[P.length-1];K.type="dots",K.output+=D,K.value+=D,e.dots=!0;continue}if(j.braces+j.parens===0&&"bos"!==K.type&&"slash"!==K.type){V({type:"text",value:D,output:_});continue}V({type:"dot",value:D,output:_});continue}if("?"===D){if((!K||"("!==K.value)&&!0!==f.noextglob&&"("===U()&&"?"!==U(2)){J("qmark",D);continue}if(K&&"paren"===K.type){const e=U();let n=D;if("<"===e&&!t.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");("("===K.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(W()))&&(n=`\\${D}`),V({type:"text",value:D,output:n});continue}if(!0!==f.dot&&("slash"===K.type||"bos"===K.type)){V({type:"qmark",value:D,output:T});continue}V({type:"qmark",value:D,output:w});continue}if("!"===D){if(!0!==f.noextglob&&"("===U()&&("?"!==U(2)||!/[!=<:]/.test(U(3)))){J("negate",D);continue}if(!0!==f.nonegate&&0===j.index){Z();continue}}if("+"===D){if(!0!==f.noextglob&&"("===U()&&"?"!==U(2)){J("plus",D);continue}if(K&&"("===K.value||!1===f.regex){V({type:"plus",value:D,output:C});continue}if(K&&("bracket"===K.type||"paren"===K.type||"brace"===K.type)||j.parens>0){V({type:"plus",value:D});continue}V({type:"plus",value:C});continue}if("@"===D){if(!0!==f.noextglob&&"("===U()&&"?"!==U(2)){V({type:"at",extglob:!0,value:D,output:""});continue}V({type:"text",value:D});continue}if("*"!==D){"$"!==D&&"^"!==D||(D=`\\${D}`);const e=o.exec(W());e&&(D+=e[0],j.index+=e[0].length),V({type:"text",value:D});continue}if(K&&("globstar"===K.type||!0===K.star)){K.type="star",K.star=!0,K.value+=D,K.output=M,j.backtrack=!0,j.globstar=!0,X(D);continue}let e=W();if(!0!==f.noextglob&&/^\([^?]/.test(e)){J("star",D);continue}if("star"===K.type){if(!0===f.noglobstar){X(D);continue}const t=K.prev,n=t.prev,r="slash"===t.type||"bos"===t.type,o=n&&("star"===n.type||"globstar"===n.type);if(!0===f.bash&&(!r||e[0]&&"/"!==e[0])){V({type:"star",value:D,output:""});continue}const s=j.braces>0&&("comma"===t.type||"brace"===t.type),i=B.length&&("pipe"===t.type||"paren"===t.type);if(!r&&"paren"!==t.type&&!s&&!i){V({type:"star",value:D,output:""});continue}for(;"/**"===e.slice(0,3);){const t=l[j.index+4];if(t&&"/"!==t)break;e=e.slice(3),X("/**",3)}if("bos"===t.type&&F()){K.type="globstar",K.value+=D,K.output=k(f),j.output=K.output,j.globstar=!0,X(D);continue}if("slash"===t.type&&"bos"!==t.prev.type&&!o&&F()){j.output=j.output.slice(0,-(t.output+K.output).length),t.output=`(?:${t.output}`,K.type="globstar",K.output=k(f)+(f.strictSlashes?")":"|$)"),K.value+=D,j.globstar=!0,j.output+=t.output+K.output,X(D);continue}if("slash"===t.type&&"bos"!==t.prev.type&&"/"===e[0]){const n=void 0!==e[1]?"|$":"";j.output=j.output.slice(0,-(t.output+K.output).length),t.output=`(?:${t.output}`,K.type="globstar",K.output=`${k(f)}${S}|${S}${n})`,K.value+=D,j.output+=t.output+K.output,j.globstar=!0,X(D+Q()),V({type:"slash",value:"/",output:""});continue}if("bos"===t.type&&"/"===e[0]){K.type="globstar",K.value+=D,K.output=`(?:^|${S}|${k(f)}${S})`,j.output=K.output,j.globstar=!0,X(D+Q()),V({type:"slash",value:"/",output:""});continue}j.output=j.output.slice(0,-K.output.length),K.type="globstar",K.output=k(f),K.value+=D,j.output+=K.output,j.globstar=!0,X(D);continue}const n={type:"star",value:D,output:M};!0!==f.bash?!K||"bracket"!==K.type&&"paren"!==K.type||!0!==f.regex?(j.index!==j.start&&"slash"!==K.type&&"dot"!==K.type||("dot"===K.type?(j.output+=$,K.output+=$):!0===f.dot?(j.output+=H,K.output+=H):(j.output+=N,K.output+=N),"*"!==U()&&(j.output+=b,K.output+=b)),V(n)):(n.output=D,V(n)):(n.output=".*?","bos"!==K.type&&"slash"!==K.type||(n.output=N+n.output),V(n))}for(;j.brackets>0;){if(!0===f.strictBrackets)throw new SyntaxError(u("closing","]"));j.output=t.escapeLast(j.output,"["),z("brackets")}for(;j.parens>0;){if(!0===f.strictBrackets)throw new SyntaxError(u("closing",")"));j.output=t.escapeLast(j.output,"("),z("parens")}for(;j.braces>0;){if(!0===f.strictBrackets)throw new SyntaxError(u("closing","}"));j.output=t.escapeLast(j.output,"{"),z("braces")}if(!0===f.strictSlashes||"star"!==K.type&&"bracket"!==K.type||V({type:"maybe_slash",value:"",output:`${S}?`}),!0===j.backtrack){j.output="";for(const e of j.tokens)j.output+=null!=e.output?e.output:e.value,e.suffix&&(j.output+=e.suffix)}return j};return p.fastpaths=(r,o)=>{const s={...o},a="number"==typeof s.maxLength?Math.min(n,s.maxLength):n,u=r.length;if(u>a)throw new SyntaxError(`Input length: ${u}, exceeds maximum allowed length: ${a}`);r=i[r]||r;const p=t.isWindows(o),{DOT_LITERAL:l,SLASH_LITERAL:c,ONE_CHAR:f,DOTS_SLASH:d,NO_DOT:g,NO_DOTS:h,NO_DOTS_SLASH:A,STAR:R,START_ANCHOR:y}=e.globChars(p),E=s.dot?h:g,m=s.dot?A:g,_=s.capture?"":"?:";let C=!0===s.bash?".*?":R;s.capture&&(C=`(${C})`);const S=e=>!0===e.noglobstar?C:`(${_}(?:(?!${y}${e.dot?d:l}).)*?)`,b=e=>{switch(e){case"*":return`${E}${f}${C}`;case".*":return`${l}${f}${C}`;case"*.*":return`${E}${C}${l}${f}${C}`;case"*/*":return`${E}${C}${c}${f}${m}${C}`;case"**":return E+S(s);case"**/*":return`(?:${E}${S(s)}${c})?${m}${f}${C}`;case"**/*.*":return`(?:${E}${S(s)}${c})?${m}${C}${l}${f}${C}`;case"**/.*":return`(?:${E}${S(s)}${c})?${l}${f}${C}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const n=b(t[1]);if(!n)return;return n+l+t[2]}}},v=t.removePrefix(r,{negated:!1,prefix:""});let x=b(v);return x&&!0!==s.strictSlashes&&(x+=`${c}?`),x},se=p}(),r=he(),o=ge(),s=(e,t,n=!1)=>{if(Array.isArray(e)){const r=e.map((e=>s(e,t,n))),o=e=>{for(const t of r){const n=t(e);if(n)return n}return!1};return o}const o=(i=e)&&"object"==typeof i&&!Array.isArray(i)&&e.tokens&&e.input;var i;if(""===e||"string"!=typeof e&&!o)throw new TypeError("Expected pattern to be a non-empty string");const a=t||{},u=r.isWindows(t),p=o?s.compileRe(e,t):s.makeRe(e,t,!1,!0),l=p.state;delete p.state;let c=()=>!1;if(a.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};c=s(a.ignore,e,n)}const f=(n,r=!1)=>{const{isMatch:o,match:i,output:f}=s.test(n,p,t,{glob:e,posix:u}),d={glob:e,state:l,regex:p,posix:u,input:n,output:f,match:i,isMatch:o};return"function"==typeof a.onResult&&a.onResult(d),!1===o?(d.isMatch=!1,!!r&&d):c(n)?("function"==typeof a.onIgnore&&a.onIgnore(d),d.isMatch=!1,!!r&&d):("function"==typeof a.onMatch&&a.onMatch(d),!r||d)};return n&&(f.state=l),f};return s.test=(e,t,n,{glob:o,posix:i}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};const a=n||{},u=a.format||(i?r.toPosixSlashes:null);let p=e===o,l=p&&u?u(e):e;return!1===p&&(l=u?u(e):e,p=l===o),!1!==p&&!0!==a.capture||(p=!0===a.matchBase||!0===a.basename?s.matchBase(e,t,n,i):t.exec(l)),{isMatch:Boolean(p),match:p,output:l}},s.matchBase=(t,n,o,i=r.isWindows(o))=>(n instanceof RegExp?n:s.makeRe(n,o)).test(e.basename(t)),s.isMatch=(e,t,n)=>s(t,n)(e),s.parse=(e,t)=>Array.isArray(e)?e.map((e=>s.parse(e,t))):n(e,{...t,fastpaths:!1}),s.scan=(e,n)=>t(e,n),s.compileRe=(e,t,n=!1,r=!1)=>{if(!0===n)return e.output;const o=t||{},i=o.contains?"":"^",a=o.contains?"":"$";let u=`${i}(?:${e.output})${a}`;e&&!0===e.negated&&(u=`^(?!${u}).*$`);const p=s.toRegex(u,t);return!0===r&&(p.state=e),p},s.makeRe=(e,t={},r=!1,o=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return!1===t.fastpaths||"."!==e[0]&&"*"!==e[0]||(i.output=n.fastpaths(e,t)),i.output||(i=n(e,t)),s.compileRe(i,t,r,o)},s.toRegex=(e,t)=>{try{const n=t||{};return new RegExp(e,n.flags||(n.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},s.constants=o,ae=s}function Re(){return le?pe:(le=1,pe=Ae())}var ye=function(){if(fe)return ce;fe=1;const e=E,t=J(),n=Re(),r=he(),o=e=>""===e||"./"===e,s=(e,t,r)=>{t=[].concat(t),e=[].concat(e);let o=new Set,s=new Set,i=new Set,a=0,u=e=>{i.add(e.output),r&&r.onResult&&r.onResult(e)};for(let i=0;i<t.length;i++){let p=n(String(t[i]),{...r,onResult:u},!0),l=p.state.negated||p.state.negatedExtglob;l&&a++;for(let t of e){let e=p(t,!0);(l?!e.isMatch:e.isMatch)&&(l?o.add(e.output):(o.delete(e.output),s.add(e.output)))}}let p=(a===t.length?[...i]:[...s]).filter((e=>!o.has(e)));if(r&&0===p.length){if(!0===r.failglob)throw new Error(`No matches found for "${t.join(", ")}"`);if(!0===r.nonull||!0===r.nullglob)return r.unescape?t.map((e=>e.replace(/\\/g,""))):t}return p};return s.match=s,s.matcher=(e,t)=>n(e,t),s.any=s.isMatch=(e,t,r)=>n(t,r)(e),s.not=(e,t,n={})=>{t=[].concat(t).map(String);let r=new Set,o=[],i=new Set(s(e,t,{...n,onResult:e=>{n.onResult&&n.onResult(e),o.push(e.output)}}));for(let e of o)i.has(e)||r.add(e);return[...r]},s.contains=(t,n,r)=>{if("string"!=typeof t)throw new TypeError(`Expected a string: "${e.inspect(t)}"`);if(Array.isArray(n))return n.some((e=>s.contains(t,e,r)));if("string"==typeof n){if(o(t)||o(n))return!1;if(t.includes(n)||t.startsWith("./")&&t.slice(2).includes(n))return!0}return s.isMatch(t,n,{...r,contains:!0})},s.matchKeys=(e,t,n)=>{if(!r.isObject(e))throw new TypeError("Expected the first argument to be an object");let o=s(Object.keys(e),t,n),i={};for(let t of o)i[t]=e[t];return i},s.some=(e,t,r)=>{let o=[].concat(e);for(let e of[].concat(t)){let t=n(String(e),r);if(o.some((e=>t(e))))return!0}return!1},s.every=(e,t,r)=>{let o=[].concat(e);for(let e of[].concat(t)){let t=n(String(e),r);if(!o.every((e=>t(e))))return!1}return!0},s.all=(t,r,o)=>{if("string"!=typeof t)throw new TypeError(`Expected a string: "${e.inspect(t)}"`);return[].concat(r).every((e=>n(e,o)(t)))},s.capture=(e,t,o)=>{let s=r.isWindows(o),i=n.makeRe(String(e),{...o,capture:!0}).exec(s?r.toPosixSlashes(t):t);if(i)return i.slice(1).map((e=>void 0===e?"":e))},s.makeRe=(...e)=>n.makeRe(...e),s.scan=(...e)=>n.scan(...e),s.parse=(e,r)=>{let o=[];for(let s of[].concat(e||[]))for(let e of t(String(s),r))o.push(n.parse(e,r));return o},s.braces=(e,n)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return n&&!0===n.nobrace||!/\{.*\}/.test(e)?[e]:t(e,n)},s.braceExpand=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return s.braces(e,{...t,expand:!0})},ce=s}();const Ee=t=>e.readdirSync(t).reduce(((r,o)=>{const s=n(t,o);return e.statSync(s).isDirectory()?s.endsWith("/node_modules")?r:[...r,...Ee(s)]:[...r,s]}),[]),me=(e,t)=>new Set([...e].filter((e=>t.has(e))));let _e;function Ce(){if(_e)return _e;const e=b.getOptionValue("root");return _e=e?t.isAbsolute(e)?e:t.resolve(process.cwd(),e):void 0,_e}let Se,be="";try{S(import.meta.url).resolve("@pnpm/filter-workspace-packages"),be="pnpm"}catch{}""!==be&&b.option("-f, --filter <filter>","filter packages");let ve=!1;const xe=S(import.meta.url);function $e(e){try{return xe.resolve(e),!0}catch(e){return!1}}let He;const we=[process.env.JIEK_TS_REGISTER,"esbuild-register","@swc-node/register","ts-node/register"].filter(Boolean);for(const e of we)if($e(e)){He=e;break}const Te=S(import.meta.url);let Le="jiek.config";const Oe=t=>{t=n(t);const r=o(t),{extends:s,...i}=(a=t,e.existsSync(a)&&e.statSync(a).isFile()?x(e.readFileSync(a,"utf-8"),[],{allowTrailingComma:!0,allowEmptyContent:!0}):{});var a;const u=(p=s?Array.isArray(s)?s:[s]:[],p?.map((e=>n(r,e)))??[]);var p;return 0===u.length?i:u.map(Oe).concat(i).reduce(((e,{compilerOptions:t={},references:n,...r})=>({...e,...r,compilerOptions:{...e.compilerOptions,...t}})),{})},ke=(e,t)=>{e=n(e),t=n(t);const r=o(e),s=Oe(e),[i,a,u,p]=[s.references?.map((({path:e})=>e)),s.files,s.include,s.exclude].map((e=>e?.map((e=>n(r,e)))??[]));if(p.length>0&&p.some((e=>ye.isMatch(t,e))))return;if(0===s.files?.length&&0===s.include?.length)return;let l=!1;if(l||(l=a.length>0&&a.includes(t)),l||(l=u.length>0&&u.some((e=>ye.isMatch(t,e)))),l)return s.compilerOptions??{};if(!(s.files&&s.files.length>0||s.include&&s.include.length>0)){i.reverse();for(const e of i){const n=ke(e,t);if(n)return n}return s.compilerOptions}};var Ne=(e={})=>{const{onEvent:t}=e;return{name:"progress",buildStart:()=>t?.("start","Start building..."),buildEnd:()=>t?.("end","Build completed!"),resolveId:{order:"post",handler:e=>t?.("resolve",`Resolving ${e}...`)},load:{order:"post",handler:e=>t?.("load",`Loading ${e}...`)},transform:{order:"post",handler:(e,n)=>t?.("transform",`Transforming ${n}...`)}}},Ie=(e={})=>({name:"skip",load(t){if(e.patterns?.some((e=>"string"==typeof e?t.includes(e):e.test(t))))return""}});const Me=["te?xt","json","(css|s[ac]ss|less|styl)"];const{JIEK_ROOT:je,JIEK_ENTRIES:Be}=process.env,Pe=je??d(),Ge={},De=[h()],Ke=function(n){const{wd:r}=function(){if(Se)return{wd:Se,notWorkspace:ve};const e=Ce();if(void 0!==e){const t=f(e,be);return ve=!t,Se=e,{wd:Se,notWorkspace:ve}}try{Se=d(be)}catch(t){if(!("message"in t)||"workspace root not found"!==t.message)throw t;Se=e,ve=!0}return{wd:Se,notWorkspace:ve}}();let o=b.getOptionValue("configPath");if(o){if(!e.existsSync(o))throw new Error(`config file not found: ${o}`);t.isAbsolute(o)||(o=t.resolve(r,o))}else o=function(n,r){const o=!!He;function s(o){const s=[t.resolve(process.cwd(),`${Le}.${o}`),t.resolve(process.cwd(),`.${Le}.${o}`),t.resolve(n,`${Le}.${o}`),t.resolve(n,`.${Le}.${o}`)];r&&s.unshift(t.resolve(r,`${Le}.${o}`),t.resolve(r,`.${Le}.${o}`));for(const t of s)if(e.existsSync(t)&&e.lstatSync(t).isFile())return t}return Le=s("js")??Le,Le=s("json")??Le,Le=s("yaml")??Le,o&&(Le=s("ts")??Le),t.resolve(n,Le)}(r,n);const s=t.extname(o);let i;switch(s){case".js":i=Te(o);break;case".json":return Te(o);case".yaml":return v(e.readFileSync(o,"utf-8"));case".ts":if(He){Te(He),i=Te(o);break}throw new Error("ts config file is not supported without ts register, please install esbuild-register or set JIEK_TS_REGISTER env for custom ts register");case".config":i={};break;default:throw new Error(`unsupported config file type: ${s}`)}if(!i)throw new Error("config file is empty");return i.default??i}()??{},{build:Fe={}}=Ke,Ue=`./${r(process.cwd(),n(("object"==typeof Fe?.output?.dir?Fe.output.dir.js:Fe?.output?.dir)??"dist"))}`,Qe=/\.(css|s[ac]ss|less|styl)$/,We=e=>n(Pe,e),Xe=e=>e.replace(/[@|/-](\w)/g,((e,t)=>t.toUpperCase())).replace(/(?:^|-)(\w)/g,((e,t)=>t.toUpperCase())),qe=(e,t=Fe?.output?.minify)=>!1===t?[e]:"only-minify"===t?[{...e,entryFileNames:t=>"function"==typeof e.entryFileNames?e.entryFileNames(t).replace(/(\.[cm]?js)$/,".min$1"):(()=>{throw new Error("entryFileNames must be a function")})(),plugins:[...e.plugins??[],R()]}]:[e,{...e,entryFileNames:t=>"function"==typeof e.entryFileNames?e.entryFileNames(t).replace(/(\.[cm]?js)$/,".min$1"):(()=>{throw new Error("entryFileNames must be a function")})(),file:e.file?.replace(/(\.[cm]?js)$/,".min$1"),plugins:[...e.plugins??[],R()]}],Ze=(t,i={})=>{const{path:a,name:u,input:p,output:l,external:f,pkgIsModule:d,conditionals:h}=t,R=h.includes("import"),E=h.includes("require"),m=h.includes("browser");let S;[We("tsconfig.json"),We("tsconfig.dts.json")].forEach((t=>{e.existsSync(t)&&e.statSync(t).isFile()&&(S=t)}));let b={};if(S){const e=ke(S,n(p)),{options:t,errors:r}=C.convertCompilerOptionsFromJson(e,o(S));if(r.length>0)throw new Error(r.map((e=>e.messageText)).join("\n"));b=t,delete b.composite}const v=[...h,...b.customConditions??[]],x={type:"progress",data:{name:u,path:a,exportConditions:v,input:p}},$=i?.output?.dir,{js:H,dts:w}=((e,t)=>{if(!1===t||null==t)return{js:[],dts:[]};let n=[],r=[];switch(typeof t){case"function":n=t("js",e),r=t("dts",e);break;case"object":"js"in t||"dts"in t?(n=t.js??[],r=t.dts??[]):(n=t,r=t)}return{js:n,dts:r}})(t,Fe.plugins);if(p.includes("**"))throw new Error('input should not include "**", please read the [documentation](https://nodejs.org/api/packages.html#subpath-patterns).');const T=p.includes("*")?Ee(process.cwd()).filter((e=>/(?<!\.d)\.[cm]?tsx?$/.test(e))).map((e=>r(process.cwd(),e))).filter((e=>ye.isMatch(e,p.slice(2)))):p,L=p.includes("*")?p.split("*")[0].replace("./",""):"",O=a.includes("*")?a.split("*")[0].replace("./",""):"";if(L.length>0&&0===O.length||0===L.length&&O.length>0)throw new Error('input and path should both include "*" or not include "*"');const k=s(l),N=k.replace(/(\.[cm]?)js$/,".d$1ts");return[{input:T,external:f,output:[...qe({dir:Ue,name:u,interop:"auto",entryFileNames:e=>Array.isArray(T)?e.facadeModuleId.replace(`${process.cwd()}/`,"").replace(L,O).replace(/(\.[cm]?)ts$/,k):l.replace(`${Ue}/`,""),sourcemap:"object"==typeof i?.output?.sourcemap?i.output.sourcemap.js:i?.output?.sourcemap,format:R?"esm":E?"cjs":m?"umd":d?"esm":"cjs",strict:"object"==typeof i?.output?.strict?i.output.strict.js:i?.output?.strict})],plugins:[A({exportConditions:v}),import("rollup-plugin-postcss").then((({default:e})=>e({extract:n(l.replace(/\.[cm]?js$/,".css")),minimize:!0}))).catch((()=>{})),_({tsconfig:S}),g(),Ne({onEvent:(e,t)=>y({...x,data:{...x.data,event:e,message:t,tags:["js"]}})}),H]},{input:T,external:f,output:[{dir:n(("object"==typeof $?$.dts:$)??"dist"),sourcemap:"object"==typeof i?.output?.sourcemap?i.output.sourcemap.dts:i?.output?.sourcemap,entryFileNames:e=>Array.isArray(T)?e.facadeModuleId.replace(`${process.cwd()}/`,"").replace(L,O).replace(/(\.[cm]?)ts$/,N):l.replace(`${Ue}/`,"").replace(/(\.[cm]?)js$/,N),strict:"object"==typeof i?.output?.strict?i.output.strict.dts:i?.output?.strict}],plugins:[A({exportConditions:v}),Ie({patterns:[Qe]}),c({respectExternal:!0,compilerOptions:{...b,outDir:"dist",declaration:!0}}),Ne({onEvent:(e,t)=>y({...x,data:{...x.data,event:e,message:t,tags:["dts"]}})}),w]}]};function Ye(t){const{name:o,type:s,exports:c}=t,f="module"===s;if(!o)throw new Error("package.json name is required");if(!c)throw new Error("package.json exports is required");const d=Be?.split(",").map((e=>e.trim())).map((e=>({index:"."}[e]??e))),g=Xe(o),h=function(t=process.cwd()){const n="string"==typeof t?e.existsSync(`${t}/package.json`)?JSON.parse(e.readFileSync(`${t}/package.json`,"utf-8")):{}:t,{name:r,dependencies:o={},peerDependencies:s={},optionalDependencies:i={}}=n;if(!r)throw new Error("package.json must have a name field");return Object.keys(o).concat(Object.keys(s)).concat(Object.keys(i)).map((e=>new RegExp(`^${e}(/.*)?$`))).concat([new RegExp(`^${r}(/.*)?(?<!${Me.map((e=>`\\.${e}`)).join("|")})$`),/^node:/])}(t),[A,R]=function({entrypoints:e,pkgIsModule:t,entries:o,config:s,dir:l,noFilter:c,isPublish:f}){const{build:d={},publish:{withSuffix:g=!1,withSource:h=!0}={}}=s??{},{crossModuleConvertor:A=!0}=d,R=`./${(e=>r(l??process.cwd(),e))(((...e)=>n(l??process.cwd(),...e))(("object"==typeof d?.output?.dir?d.output.dir.js:d?.output?.dir)??"dist"))}`,[,y]=i(e);o&&Object.entries(y).forEach((([e])=>{o.some((t=>ye.isMatch(e,t,{matchBase:!0})))||delete y[e]}));const E=c?y:a(y,{skipValue:[/(^|\/)\.jk-noentry/,...u]});return[E,p(E,{outdir:R,withSuffix:f?g:void 0,withSource:f?h:void 0,withConditional:{...A?{import:e=>!t&&0===me(new Set(e.conditionals),new Set(["import","module"])).size&&e.dist.replace(/\.js$/,".mjs"),require:e=>!(!t||0!==me(new Set(e.conditionals),new Set(["require","node"])).size)&&e.dist.replace(/\.js$/,".cjs")}:{}}})]}({entrypoints:c,pkgIsModule:f,entries:d,config:Ke}),E=new Map;l(A,(({keys:e,value:t})=>{if("string"==typeof t){const n=E.get(t)??[];E.set(t,n),n.push(e)}return!1}));const m=[];return E.forEach(((e,t)=>e.forEach((e=>{const[n,...r]=e,o=g+("."===n?"":Xe(n)),s=((e,t)=>t.reduce(((e,t)=>{if("string"==typeof e)throw new Error("key not found in exports");if(!(t in e))throw new Error(`key ${t} not found in exports`);return e[t]}),e))(R,e),i={path:n,name:o,input:t,external:h,pkgIsModule:f};switch(typeof s){case"string":m.push(...Ze({...i,output:s,conditionals:r},Fe));break;case"object":l(s,(({keys:e,value:t})=>{const n=[...new Set([...r,...e])];return"string"==typeof t&&m.push(...Ze({...i,output:t,conditionals:n},Fe)),!1}))}})))),y({type:"init",data:{leafMap:E,targetsLength:m.length}}),m.map((e=>({...Ge,...e,plugins:[...De,e.plugins]})))}export{Ye as template};
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "jiek",
|
3
3
|
"type": "module",
|
4
|
-
"version": "1.0
|
4
|
+
"version": "1.1.0",
|
5
5
|
"description": "YiJie's personal kits.",
|
6
6
|
"bin": {
|
7
7
|
"jiek": "bin/jiek.js",
|
@@ -59,11 +59,10 @@
|
|
59
59
|
"js-yaml": "^4.1.0",
|
60
60
|
"jsonc-parser": "^3.2.1",
|
61
61
|
"rollup": "^4.1.5",
|
62
|
-
"rollup-plugin-copy": "^3.5.0",
|
63
62
|
"rollup-plugin-esbuild": "^6.1.0",
|
64
63
|
"typescript": "^5.0.0",
|
65
64
|
"@jiek/pkger": "^0.2.0",
|
66
|
-
"@jiek/utils": "^0.2.
|
65
|
+
"@jiek/utils": "^0.2.2"
|
67
66
|
},
|
68
67
|
"optionalDependencies": {
|
69
68
|
"@pnpm/filter-workspace-packages": "^7.2.13",
|
package/src/commands/build.ts
CHANGED
@@ -31,8 +31,13 @@ module.exports = require('jiek/rollup').template(${JSON.stringify(manifest, null
|
|
31
31
|
|
32
32
|
const require = createRequire(import.meta.url)
|
33
33
|
|
34
|
+
const description = `
|
35
|
+
Build the package according to the 'exports' field in the package.json.
|
36
|
+
`.trim()
|
37
|
+
|
34
38
|
program
|
35
39
|
.command('build')
|
40
|
+
.description(description)
|
36
41
|
.option('-s, --silent', "Don't display logs.")
|
37
42
|
.option('-e, --entries <ENTRIES>', "Specify the entries of the package.json's 'exports' field.(support glob)")
|
38
43
|
.option('-v, --verbose', 'Display debug logs.')
|
@@ -86,7 +91,14 @@ program
|
|
86
91
|
prefix = `node -r ${tsRegisterName} `
|
87
92
|
}
|
88
93
|
// TODO replace with `spawn` to support watch mode
|
89
|
-
const
|
94
|
+
const argv: string[] = []
|
95
|
+
for (const key in program.opts()) {
|
96
|
+
const value = program.opts()[key]
|
97
|
+
if (value) {
|
98
|
+
argv.push(`--${key} ${value}`)
|
99
|
+
}
|
100
|
+
}
|
101
|
+
const command = `${prefix}${rollupBinaryPath} --silent ${argv.join(' ')} -c ${configFile}`
|
90
102
|
const child = execaCommand(command, {
|
91
103
|
ipc: true,
|
92
104
|
cwd: dir,
|
package/src/rollup/index.ts
CHANGED
@@ -115,7 +115,7 @@ const withMinify = (
|
|
115
115
|
// TODO resolve dts output file name
|
116
116
|
entryFileNames: chunkInfo =>
|
117
117
|
typeof output.entryFileNames === 'function'
|
118
|
-
? output.entryFileNames(chunkInfo)
|
118
|
+
? output.entryFileNames(chunkInfo).replace(/(\.[cm]?js)$/, '.min$1')
|
119
119
|
: (() => {
|
120
120
|
throw new Error('entryFileNames must be a function')
|
121
121
|
})(),
|