@aventusjs/cli 0.0.8 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@aventusjs/cli",
3
3
  "displayName": "Aventus CLI",
4
4
  "description": "This official CLI to compile Aventus Framework",
5
- "version": "0.0.8",
5
+ "version": "0.0.10",
6
6
  "icon": "icons/logo.png",
7
7
  "bin": {
8
8
  "aventus": "./out/cli.js"
@@ -1,27 +0,0 @@
1
- "use strict";exports.id=940,exports.ids=[940],exports.modules={8940:(t,e,s)=>{s.d(e,{Watcher:()=>ki});var i=s(9411),r=s(7742),n=s(3713),a=s(612),o=s(7147),h=s(3837),l=s(2781),c=s(1017),d=s(2037),u=s(2361),f=(s(8846),s(6005),s(3977),s(6224),{});const p=o,{Readable:_}=l,m=c,{promisify:w}=h,g=n.ZS,E=w(p.readdir),y=w(p.stat),v=w(p.lstat),R=w(p.realpath),A="READDIRP_RECURSIVE_ERROR",b=new Set(["ENOENT","EPERM","EACCES","ELOOP",A]),S="files",T="directories",C="files_directories",P="all",D=[S,T,C,P],[x,I]=process.versions.node.split(".").slice(0,2).map((t=>Number.parseInt(t,10))),N="win32"===process.platform&&(x>10||10===x&&I>=5),F=t=>{if(void 0!==t){if("function"==typeof t)return t;if("string"==typeof t){const e=g(t.trim());return t=>e(t.basename)}if(Array.isArray(t)){const e=[],s=[];for(const i of t){const t=i.trim();"!"===t.charAt(0)?s.push(g(t.slice(1))):e.push(g(t))}return s.length>0?e.length>0?t=>e.some((e=>e(t.basename)))&&!s.some((e=>e(t.basename))):t=>!s.some((e=>e(t.basename))):t=>e.some((e=>e(t.basename)))}}};class O extends _{static get defaultOptions(){return{root:".",fileFilter:t=>!0,directoryFilter:t=>!0,type:S,lstat:!1,depth:2147483648,alwaysStat:!1}}constructor(t={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:t.highWaterMark||4096});const e={...O.defaultOptions,...t},{root:s,type:i}=e;this._fileFilter=F(e.fileFilter),this._directoryFilter=F(e.directoryFilter);const r=e.lstat?v:y;this._stat=N?t=>r(t,{bigint:!0}):r,this._maxDepth=e.depth,this._wantsDir=[T,C,P].includes(i),this._wantsFile=[S,C,P].includes(i),this._wantsEverything=i===P,this._root=m.resolve(s),this._isDirent="Dirent"in p&&!e.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(s,1)],this.reading=!1,this.parent=void 0}async _read(t){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&t>0;){const{path:e,depth:s,files:i=[]}=this.parent||{};if(i.length>0){const r=i.splice(0,t).map((t=>this._formatEntry(t,e)));for(const e of await Promise.all(r)){if(this.destroyed)return;const i=await this._getEntryType(e);"directory"===i&&this._directoryFilter(e)?(s<=this._maxDepth&&this.parents.push(this._exploreDir(e.fullPath,s+1)),this._wantsDir&&(this.push(e),t--)):("file"===i||this._includeAsFile(e))&&this._fileFilter(e)&&this._wantsFile&&(this.push(e),t--)}}else{const t=this.parents.pop();if(!t){this.push(null);break}if(this.parent=await t,this.destroyed)return}}}catch(t){this.destroy(t)}finally{this.reading=!1}}}async _exploreDir(t,e){let s;try{s=await E(t,this._rdOptions)}catch(t){this._onError(t)}return{files:s,depth:e,path:t}}async _formatEntry(t,e){let s;try{const i=this._isDirent?t.name:t,r=m.resolve(m.join(e,i));s={path:m.relative(this._root,r),fullPath:r,basename:i},s[this._statsProp]=this._isDirent?t:await this._stat(r)}catch(t){this._onError(t)}return s}_onError(t){var e;e=t,b.has(e.code)&&!this.destroyed?this.emit("warn",t):this.destroy(t)}async _getEntryType(t){const e=t&&t[this._statsProp];if(e){if(e.isFile())return"file";if(e.isDirectory())return"directory";if(e&&e.isSymbolicLink()){const e=t.fullPath;try{const t=await R(e),s=await v(t);if(s.isFile())return"file";if(s.isDirectory()){const s=t.length;if(e.startsWith(t)&&e.substr(s,1)===m.sep){const s=new Error(`Circular symlink detected: "${e}" points to "${t}"`);return s.code=A,this._onError(s)}return"directory"}}catch(t){this._onError(t)}}}}_includeAsFile(t){const e=t&&t[this._statsProp];return e&&this._wantsEverything&&!e.isDirectory()}}const H=(t,e={})=>{let s=e.entryType||e.type;if("both"===s&&(s=C),s&&(e.type=s),!t)throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");if("string"!=typeof t)throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(s&&!D.includes(s))throw new Error(`readdirp: Invalid type passed. Use one of ${D.join(", ")}`);return e.root=t,new O(e)};H.promise=(t,e={})=>new Promise(((s,i)=>{const r=[];H(t,e).on("data",(t=>r.push(t))).on("end",(()=>s(r))).on("error",(t=>i(t)))})),H.ReaddirpStream=O,H.default=H;var L=H,W={exports:{}},k=function(t,e){if("string"!=typeof t)throw new TypeError("expected path to be a string");if("\\"===t||"/"===t)return"/";var s=t.length;if(s<=1)return t;var i="";if(s>4&&"\\"===t[3]){var r=t[2];"?"!==r&&"."!==r||"\\\\"!==t.slice(0,2)||(t=t.slice(2),i="//")}var n=t.split(/[/\\]+/);return!1!==e&&""===n[n.length-1]&&n.pop(),i+n.join("/")},M=W.exports;Object.defineProperty(M,"__esModule",{value:!0});const U=n.ZS,B=k,G={returnIndex:!1},V=(t,e,s,i)=>{const r=Array.isArray(s),n=r?s[0]:s;if(!r&&"string"!=typeof n)throw new TypeError("anymatch: second argument must be a string: got "+Object.prototype.toString.call(n));const a=B(n,!1);for(let t=0;t<e.length;t++){if((0,e[t])(a))return!!i&&-1}const o=r&&[a].concat(s.slice(1));for(let e=0;e<t.length;e++){const s=t[e];if(r?s(...o):s(a))return!i||e}return!!i&&-1},j=(t,e,s=G)=>{if(null==t)throw new TypeError("anymatch: specify first argument");const i="boolean"==typeof s?{returnIndex:s}:s,r=i.returnIndex||!1,n=(a=t,Array.isArray(a)?a:[a]);var a;const o=n.filter((t=>"string"==typeof t&&"!"===t.charAt(0))).map((t=>t.slice(1))).map((t=>U(t,i))),h=n.filter((t=>"string"!=typeof t||"string"==typeof t&&"!"!==t.charAt(0))).map((t=>((t,e)=>{if("function"==typeof t)return t;if("string"==typeof t){const s=U(t,e);return e=>t===e||s(e)}return t instanceof RegExp?e=>t.test(e):t=>!1})(t,i)));return null==e?(t,e=!1)=>V(h,o,t,"boolean"==typeof e&&e):V(h,o,e,r)};j.default=j,W.exports=j;var K=W.exports,Y=function(t){if("string"!=typeof t||""===t)return!1;for(var e;e=/(\\).|([@?!+*]\(.*\))/g.exec(t);){if(e[2])return!0;t=t.slice(e.index+e[0].length)}return!1},$={"{":"}","(":")","[":"]"},z=function(t){if("!"===t[0])return!0;for(var e=0,s=-2,i=-2,r=-2,n=-2,a=-2;e<t.length;){if("*"===t[e])return!0;if("?"===t[e+1]&&/[\].+)]/.test(t[e]))return!0;if(-1!==i&&"["===t[e]&&"]"!==t[e+1]&&(i<e&&(i=t.indexOf("]",e)),i>e)){if(-1===a||a>i)return!0;if(-1===(a=t.indexOf("\\",e))||a>i)return!0}if(-1!==r&&"{"===t[e]&&"}"!==t[e+1]&&(r=t.indexOf("}",e))>e&&(-1===(a=t.indexOf("\\",e))||a>r))return!0;if(-1!==n&&"("===t[e]&&"?"===t[e+1]&&/[:!=]/.test(t[e+2])&&")"!==t[e+3]&&(n=t.indexOf(")",e))>e&&(-1===(a=t.indexOf("\\",e))||a>n))return!0;if(-1!==s&&"("===t[e]&&"|"!==t[e+1]&&(s<e&&(s=t.indexOf("|",e)),-1!==s&&")"!==t[s+1]&&(n=t.indexOf(")",s))>s&&(-1===(a=t.indexOf("\\",s))||a>n)))return!0;if("\\"===t[e]){var o=t[e+1];e+=2;var h=$[o];if(h){var l=t.indexOf(h,e);-1!==l&&(e=l+1)}if("!"===t[e])return!0}else e++}return!1},Q=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 i=$[s];if(i){var r=t.indexOf(i,e);-1!==r&&(e=r+1)}if("!"===t[e])return!0}else e++}return!1},Z=function(t,e){if("string"!=typeof t||""===t)return!1;if(Y(t))return!0;var s=z;return e&&!1===e.strict&&(s=Q),s(t)},q=Z,X=c.posix.dirname,J="win32"===d.platform(),tt=/\\/g,et=/[\{\[].*[\}\]]$/,st=/(^|[^\\])([\{\[]|\([^\)]+$)/,it=/\\([\!\*\?\|\[\]\(\)\{\}])/g,rt={};
2
- /*!
3
- * is-extglob <https://github.com/jonschlinkert/is-extglob>
4
- *
5
- * Copyright (c) 2014-2016, Jon Schlinkert.
6
- * Licensed under the MIT License.
7
- */!function(t){t.isInteger=t=>"number"==typeof t?Number.isInteger(t):"string"==typeof t&&""!==t.trim()&&Number.isInteger(Number(t)),t.find=(t,e)=>t.nodes.find((t=>t.type===e)),t.exceedsLimit=(e,s,i=1,r)=>!1!==r&&(!(!t.isInteger(e)||!t.isInteger(s))&&(Number(s)-Number(e))/Number(i)>=r),t.escapeNode=(t,e=0,s)=>{let i=t.nodes[e];i&&(s&&i.type===s||"open"===i.type||"close"===i.type)&&!0!==i.escaped&&(i.value="\\"+i.value,i.escaped=!0)},t.encloseBrace=t=>"brace"===t.type&&(t.commas>>0+t.ranges>>0==0&&(t.invalid=!0,!0)),t.isInvalidBrace=t=>"brace"===t.type&&(!(!0!==t.invalid&&!t.dollar)||(t.commas>>0+t.ranges>>0==0||!0!==t.open||!0!==t.close)&&(t.invalid=!0,!0)),t.isOpenOrClose=t=>"open"===t.type||"close"===t.type||(!0===t.open||!0===t.close),t.reduce=t=>t.reduce(((t,e)=>("text"===e.type&&t.push(e.value),"range"===e.type&&(e.type="text"),t)),[]),t.flatten=(...t)=>{const e=[],s=t=>{for(let i=0;i<t.length;i++){let r=t[i];Array.isArray(r)?s(r):void 0!==r&&e.push(r)}return e};return s(t),e}}(rt);const nt=rt;var at=(t,e={})=>{let s=(t,i={})=>{let r=e.escapeInvalid&&nt.isInvalidBrace(i),n=!0===t.invalid&&!0===e.escapeInvalid,a="";if(t.value)return(r||n)&&nt.isOpenOrClose(t)?"\\"+t.value:t.value;if(t.value)return t.value;if(t.nodes)for(let e of t.nodes)a+=s(e);return a};return s(t)};
8
- /*!
9
- * is-number <https://github.com/jonschlinkert/is-number>
10
- *
11
- * Copyright (c) 2014-present, Jon Schlinkert.
12
- * Released under the MIT License.
13
- */
14
- /*!
15
- * to-regex-range <https://github.com/micromatch/to-regex-range>
16
- *
17
- * Copyright (c) 2015-present, Jon Schlinkert.
18
- * Released under the MIT License.
19
- */
20
- const ot=function(t){return"number"==typeof t?t-t==0:"string"==typeof t&&""!==t.trim()&&(Number.isFinite?Number.isFinite(+t):isFinite(+t))},ht=(t,e,s)=>{if(!1===ot(t))throw new TypeError("toRegexRange: expected the first argument to be a number");if(void 0===e||t===e)return String(t);if(!1===ot(e))throw new TypeError("toRegexRange: expected the second argument to be a number.");let i={relaxZeros:!0,...s};"boolean"==typeof i.strictZeros&&(i.relaxZeros=!1===i.strictZeros);let r=t+":"+e+"="+String(i.relaxZeros)+String(i.shorthand)+String(i.capture)+String(i.wrap);if(ht.cache.hasOwnProperty(r))return ht.cache[r].result;let n=Math.min(t,e),a=Math.max(t,e);if(1===Math.abs(n-a)){let s=t+"|"+e;return i.capture?`(${s})`:!1===i.wrap?s:`(?:${s})`}let o=gt(t)||gt(e),h={min:t,max:e,a:n,b:a},l=[],c=[];if(o&&(h.isPadded=o,h.maxLen=String(h.max).length),n<0){c=ct(a<0?Math.abs(a):1,Math.abs(n),h,i),n=h.a=0}return a>=0&&(l=ct(n,a,h,i)),h.negatives=c,h.positives=l,h.result=function(t,e,s){let i=dt(t,e,"-",!1)||[],r=dt(e,t,"",!1)||[],n=dt(t,e,"-?",!0)||[];return i.concat(n).concat(r).join("|")}(c,l),!0===i.capture?h.result=`(${h.result})`:!1!==i.wrap&&l.length+c.length>1&&(h.result=`(?:${h.result})`),ht.cache[r]=h,h.result};function lt(t,e,s){if(t===e)return{pattern:t,count:[],digits:0};let i=function(t,e){let s=[];for(let i=0;i<t.length;i++)s.push([t[i],e[i]]);return s}(t,e),r=i.length,n="",a=0;for(let t=0;t<r;t++){let[e,s]=i[t];e===s?n+=e:"0"!==e||"9"!==s?n+=wt(e,s):a++}return a&&(n+=!0===s.shorthand?"\\d":"[0-9]"),{pattern:n,count:[a],digits:r}}function ct(t,e,s,i){let r,n=function(t,e){let s=1,i=1,r=pt(t,s),n=new Set([e]);for(;t<=r&&r<=e;)n.add(r),s+=1,r=pt(t,s);for(r=_t(e+1,i)-1;t<r&&r<=e;)n.add(r),i+=1,r=_t(e+1,i)-1;return n=[...n],n.sort(ut),n}(t,e),a=[],o=t;for(let t=0;t<n.length;t++){let e=n[t],h=lt(String(o),String(e),i),l="";s.isPadded||!r||r.pattern!==h.pattern?(s.isPadded&&(l=Et(e,s,i)),h.string=l+h.pattern+mt(h.count),a.push(h),o=e+1,r=h):(r.count.length>1&&r.count.pop(),r.count.push(h.count[0]),r.string=r.pattern+mt(r.count),o=e+1)}return a}function dt(t,e,s,i,r){let n=[];for(let r of t){let{string:t}=r;i||ft(e,"string",t)||n.push(s+t),i&&ft(e,"string",t)&&n.push(s+t)}return n}function ut(t,e){return t>e?1:e>t?-1:0}function ft(t,e,s){return t.some((t=>t[e]===s))}function pt(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function _t(t,e){return t-t%Math.pow(10,e)}function mt(t){let[e=0,s=""]=t;return s||e>1?`{${e+(s?","+s:"")}}`:""}function wt(t,e,s){return`[${t}${e-t==1?"":"-"}${e}]`}function gt(t){return/^-?(0+)\d/.test(t)}function Et(t,e,s){if(!e.isPadded)return t;let i=Math.abs(e.maxLen-String(t).length),r=!1!==s.relaxZeros;switch(i){case 0:return"";case 1:return r?"0?":"0";case 2:return r?"0{0,2}":"00";default:return r?`0{0,${i}}`:`0{${i}}`}}ht.cache={},ht.clearCache=()=>ht.cache={};
21
- /*!
22
- * fill-range <https://github.com/jonschlinkert/fill-range>
23
- *
24
- * Copyright (c) 2014-present, Jon Schlinkert.
25
- * Licensed under the MIT License.
26
- */
27
- const yt=h,vt=ht,Rt=t=>null!==t&&"object"==typeof t&&!Array.isArray(t),At=t=>"number"==typeof t||"string"==typeof t&&""!==t,bt=t=>Number.isInteger(+t),St=t=>{let e=`${t}`,s=-1;if("-"===e[0]&&(e=e.slice(1)),"0"===e)return!1;for(;"0"===e[++s];);return s>0},Tt=(t,e,s)=>{if(e>0){let s="-"===t[0]?"-":"";s&&(t=t.slice(1)),t=s+t.padStart(s?e-1:e,"0")}return!1===s?String(t):t},Ct=(t,e)=>{let s="-"===t[0]?"-":"";for(s&&(t=t.slice(1),e--);t.length<e;)t="0"+t;return s?"-"+t:t},Pt=(t,e,s,i)=>{if(s)return vt(t,e,{wrap:!1,...i});let r=String.fromCharCode(t);return t===e?r:`[${r}-${String.fromCharCode(e)}]`},Dt=(t,e,s)=>{if(Array.isArray(t)){let e=!0===s.wrap,i=s.capture?"":"?:";return e?`(${i}${t.join("|")})`:t.join("|")}return vt(t,e,s)},xt=(...t)=>new RangeError("Invalid range arguments: "+yt.inspect(...t)),It=(t,e,s)=>{if(!0===s.strictRanges)throw xt([t,e]);return[]},Nt=(t,e,s=1,i={})=>{let r=Number(t),n=Number(e);if(!Number.isInteger(r)||!Number.isInteger(n)){if(!0===i.strictRanges)throw xt([t,e]);return[]}0===r&&(r=0),0===n&&(n=0);let a=r>n,o=String(t),h=String(e),l=String(s);s=Math.max(Math.abs(s),1);let c=St(o)||St(h)||St(l),d=c?Math.max(o.length,h.length,l.length):0,u=!1===c&&!1===((t,e,s)=>"string"==typeof t||"string"==typeof e||!0===s.stringify)(t,e,i),f=i.transform||(t=>e=>!0===t?Number(e):String(e))(u);if(i.toRegex&&1===s)return Pt(Ct(t,d),Ct(e,d),!0,i);let p={negatives:[],positives:[]},_=[],m=0;for(;a?r>=n:r<=n;)!0===i.toRegex&&s>1?p[(w=r)<0?"negatives":"positives"].push(Math.abs(w)):_.push(Tt(f(r,m),d,u)),r=a?r-s:r+s,m++;var w;return!0===i.toRegex?s>1?((t,e)=>{t.negatives.sort(((t,e)=>t<e?-1:t>e?1:0)),t.positives.sort(((t,e)=>t<e?-1:t>e?1:0));let s,i=e.capture?"":"?:",r="",n="";return t.positives.length&&(r=t.positives.join("|")),t.negatives.length&&(n=`-(${i}${t.negatives.join("|")})`),s=r&&n?`${r}|${n}`:r||n,e.wrap?`(${i}${s})`:s})(p,i):Dt(_,null,{wrap:!1,...i}):_},Ft=(t,e,s,i={})=>{if(null==e&&At(t))return[t];if(!At(t)||!At(e))return It(t,e,i);if("function"==typeof s)return Ft(t,e,1,{transform:s});if(Rt(s))return Ft(t,e,0,s);let r={...i};return!0===r.capture&&(r.wrap=!0),s=s||r.step||1,bt(s)?bt(t)&&bt(e)?Nt(t,e,s,r):((t,e,s=1,i={})=>{if(!bt(t)&&t.length>1||!bt(e)&&e.length>1)return It(t,e,i);let r=i.transform||(t=>String.fromCharCode(t)),n=`${t}`.charCodeAt(0),a=`${e}`.charCodeAt(0),o=n>a,h=Math.min(n,a),l=Math.max(n,a);if(i.toRegex&&1===s)return Pt(h,l,!1,i);let c=[],d=0;for(;o?n>=a:n<=a;)c.push(r(n,d)),n=o?n-s:n+s,d++;return!0===i.toRegex?Dt(c,null,{wrap:!1,options:i}):c})(t,e,Math.max(Math.abs(s),1),r):null==s||Rt(s)?Ft(t,e,1,s):((t,e)=>{if(!0===e.strictRanges)throw new TypeError(`Expected step "${t}" to be a number`);return[]})(s,r)};const Ot=Ft,Ht=rt;var Lt=(t,e={})=>{let s=(t,i={})=>{let r=Ht.isInvalidBrace(i),n=!0===t.invalid&&!0===e.escapeInvalid,a=!0===r||!0===n,o=!0===e.escapeInvalid?"\\":"",h="";if(!0===t.isOpen)return o+t.value;if(!0===t.isClose)return o+t.value;if("open"===t.type)return a?o+t.value:"(";if("close"===t.type)return a?o+t.value:")";if("comma"===t.type)return"comma"===t.prev.type?"":a?t.value:"|";if(t.value)return t.value;if(t.nodes&&t.ranges>0){let s=Ht.reduce(t.nodes),i=Ot(...s,{...e,wrap:!1,toRegex:!0});if(0!==i.length)return s.length>1&&i.length>1?`(${i})`:i}if(t.nodes)for(let e of t.nodes)h+=s(e,t);return h};return s(t)};const Wt=Ft,kt=at,Mt=rt,Ut=(t="",e="",s=!1)=>{let i=[];if(t=[].concat(t),!(e=[].concat(e)).length)return t;if(!t.length)return s?Mt.flatten(e).map((t=>`{${t}}`)):e;for(let r of t)if(Array.isArray(r))for(let t of r)i.push(Ut(t,e,s));else for(let t of e)!0===s&&"string"==typeof t&&(t=`{${t}}`),i.push(Array.isArray(t)?Ut(r,t,s):r+t);return Mt.flatten(i)};var Bt=(t,e={})=>{let s=void 0===e.rangeLimit?1e3:e.rangeLimit,i=(t,r={})=>{t.queue=[];let n=r,a=r.queue;for(;"brace"!==n.type&&"root"!==n.type&&n.parent;)n=n.parent,a=n.queue;if(t.invalid||t.dollar)return void a.push(Ut(a.pop(),kt(t,e)));if("brace"===t.type&&!0!==t.invalid&&2===t.nodes.length)return void a.push(Ut(a.pop(),["{}"]));if(t.nodes&&t.ranges>0){let i=Mt.reduce(t.nodes);if(Mt.exceedsLimit(...i,e.step,s))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let r=Wt(...i,e);return 0===r.length&&(r=kt(t,e)),a.push(Ut(a.pop(),r)),void(t.nodes=[])}let o=Mt.encloseBrace(t),h=t.queue,l=t;for(;"brace"!==l.type&&"root"!==l.type&&l.parent;)l=l.parent,h=l.queue;for(let e=0;e<t.nodes.length;e++){let s=t.nodes[e];"comma"!==s.type||"brace"!==t.type?"close"!==s.type?s.value&&"open"!==s.type?h.push(Ut(h.pop(),s.value)):s.nodes&&i(s,t):a.push(Ut(a.pop(),h,o)):(1===e&&h.push(""),h.push(""))}return h};return Mt.flatten(i(t))};const Gt=at,{MAX_LENGTH:Vt,CHAR_BACKSLASH:jt,CHAR_BACKTICK:Kt,CHAR_COMMA:Yt,CHAR_DOT:$t,CHAR_LEFT_PARENTHESES:zt,CHAR_RIGHT_PARENTHESES:Qt,CHAR_LEFT_CURLY_BRACE:Zt,CHAR_RIGHT_CURLY_BRACE:qt,CHAR_LEFT_SQUARE_BRACKET:Xt,CHAR_RIGHT_SQUARE_BRACKET:Jt,CHAR_DOUBLE_QUOTE:te,CHAR_SINGLE_QUOTE:ee,CHAR_NO_BREAK_SPACE:se,CHAR_ZERO_WIDTH_NOBREAK_SPACE:ie}={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"};var re=(t,e={})=>{if("string"!=typeof t)throw new TypeError("Expected a string");let s=e||{},i="number"==typeof s.maxLength?Math.min(Vt,s.maxLength):Vt;if(t.length>i)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${i})`);let r,n={type:"root",input:t,nodes:[]},a=[n],o=n,h=n,l=0,c=t.length,d=0,u=0;const f=()=>t[d++],p=t=>{if("text"===t.type&&"dot"===h.type&&(h.type="text"),!h||"text"!==h.type||"text"!==t.type)return o.nodes.push(t),t.parent=o,t.prev=h,h=t,t;h.value+=t.value};for(p({type:"bos"});d<c;)if(o=a[a.length-1],r=f(),r!==ie&&r!==se)if(r!==jt)if(r!==Jt)if(r!==Xt)if(r!==zt)if(r!==Qt)if(r!==te&&r!==ee&&r!==Kt)if(r!==Zt)if(r!==qt)if(r===Yt&&u>0){if(o.ranges>0){o.ranges=0;let t=o.nodes.shift();o.nodes=[t,{type:"text",value:Gt(o)}]}p({type:"comma",value:r}),o.commas++}else if(r===$t&&u>0&&0===o.commas){let t=o.nodes;if(0===u||0===t.length){p({type:"text",value:r});continue}if("dot"===h.type){if(o.range=[],h.value+=r,h.type="range",3!==o.nodes.length&&5!==o.nodes.length){o.invalid=!0,o.ranges=0,h.type="text";continue}o.ranges++,o.args=[];continue}if("range"===h.type){t.pop();let e=t[t.length-1];e.value+=h.value+r,h=e,o.ranges--;continue}p({type:"dot",value:r})}else p({type:"text",value:r});else{if("brace"!==o.type){p({type:"text",value:r});continue}let t="close";o=a.pop(),o.close=!0,p({type:t,value:r}),u--,o=a[a.length-1]}else{u++;let t=h.value&&"$"===h.value.slice(-1)||!0===o.dollar;o=p({type:"brace",open:!0,close:!1,dollar:t,depth:u,commas:0,ranges:0,nodes:[]}),a.push(o),p({type:"open",value:r})}else{let t,s=r;for(!0!==e.keepQuotes&&(r="");d<c&&(t=f());)if(t!==jt){if(t===s){!0===e.keepQuotes&&(r+=t);break}r+=t}else r+=t+f();p({type:"text",value:r})}else{if("paren"!==o.type){p({type:"text",value:r});continue}o=a.pop(),p({type:"text",value:r}),o=a[a.length-1]}else o=p({type:"paren",nodes:[]}),a.push(o),p({type:"text",value:r});else{let t;for(l++;d<c&&(t=f());)if(r+=t,t!==Xt)if(t!==jt){if(t===Jt&&(l--,0===l))break}else r+=f();else l++;p({type:"text",value:r})}else p({type:"text",value:"\\"+r});else p({type:"text",value:(e.keepEscaping?r:"")+f()});do{if(o=a.pop(),"root"!==o.type){o.nodes.forEach((t=>{t.nodes||("open"===t.type&&(t.isOpen=!0),"close"===t.type&&(t.isClose=!0),t.nodes||(t.type="text"),t.invalid=!0)}));let t=a[a.length-1],e=t.nodes.indexOf(o);t.nodes.splice(e,1,...o.nodes)}}while(a.length>0);return p({type:"eos"}),n};const ne=at,ae=Lt,oe=Bt,he=re,le=(t,e={})=>{let s=[];if(Array.isArray(t))for(let i of t){let t=le.create(i,e);Array.isArray(t)?s.push(...t):s.push(t)}else s=[].concat(le.create(t,e));return e&&!0===e.expand&&!0===e.nodupes&&(s=[...new Set(s)]),s};le.parse=(t,e={})=>he(t,e),le.stringify=(t,e={})=>ne("string"==typeof t?le.parse(t,e):t,e),le.compile=(t,e={})=>("string"==typeof t&&(t=le.parse(t,e)),ae(t,e)),le.expand=(t,e={})=>{"string"==typeof t&&(t=le.parse(t,e));let s=oe(t,e);return!0===e.noempty&&(s=s.filter(Boolean)),!0===e.nodupes&&(s=[...new Set(s)]),s},le.create=(t,e={})=>""===t||t.length<3?[t]:!0!==e.expand?le.compile(t,e):le.expand(t,e);var ce=le;const de=c,ue=new Set(["3dm","3ds","3g2","3gp","7z","a","aac","adp","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 fe={};!function(t){const{sep:e}=c,{platform:s}=process,i=d;t.EV_ALL="all",t.EV_READY="ready",t.EV_ADD="add",t.EV_CHANGE="change",t.EV_ADD_DIR="addDir",t.EV_UNLINK="unlink",t.EV_UNLINK_DIR="unlinkDir",t.EV_RAW="raw",t.EV_ERROR="error",t.STR_DATA="data",t.STR_END="end",t.STR_CLOSE="close",t.FSEVENT_CREATED="created",t.FSEVENT_MODIFIED="modified",t.FSEVENT_DELETED="deleted",t.FSEVENT_MOVED="moved",t.FSEVENT_CLONED="cloned",t.FSEVENT_UNKNOWN="unknown",t.FSEVENT_TYPE_FILE="file",t.FSEVENT_TYPE_DIRECTORY="directory",t.FSEVENT_TYPE_SYMLINK="symlink",t.KEY_LISTENERS="listeners",t.KEY_ERR="errHandlers",t.KEY_RAW="rawEmitters",t.HANDLER_KEYS=[t.KEY_LISTENERS,t.KEY_ERR,t.KEY_RAW],t.DOT_SLASH=`.${e}`,t.BACK_SLASH_RE=/\\/g,t.DOUBLE_SLASH_RE=/\/\//,t.SLASH_OR_BACK_SLASH_RE=/[/\\]/,t.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,t.REPLACER_RE=/^\.[/\\]/,t.SLASH="/",t.SLASH_SLASH="//",t.BRACE_START="{",t.BANG="!",t.ONE_DOT=".",t.TWO_DOTS="..",t.STAR="*",t.GLOBSTAR="**",t.ROOT_GLOBSTAR="/**/*",t.SLASH_GLOBSTAR="/**",t.DIR_SUFFIX="Dir",t.ANYMATCH_OPTS={dot:!0},t.STRING_TYPE="string",t.FUNCTION_TYPE="function",t.EMPTY_STR="",t.EMPTY_FN=()=>{},t.IDENTITY_FN=t=>t,t.isWindows="win32"===s,t.isMacos="darwin"===s,t.isLinux="linux"===s,t.isIBMi="OS400"===i.type()}(fe);const pe=o,_e=c,{promisify:me}=h,we=t=>ue.has(de.extname(t).slice(1).toLowerCase()),{isWindows:ge,isLinux:Ee,EMPTY_FN:ye,EMPTY_STR:ve,KEY_LISTENERS:Re,KEY_ERR:Ae,KEY_RAW:be,HANDLER_KEYS:Se,EV_CHANGE:Te,EV_ADD:Ce,EV_ADD_DIR:Pe,EV_ERROR:De,STR_DATA:xe,STR_END:Ie,BRACE_START:Ne,STAR:Fe}=fe,Oe=me(pe.open),He=me(pe.stat),Le=me(pe.lstat),We=me(pe.close),ke=me(pe.realpath),Me={lstat:Le,stat:He},Ue=(t,e)=>{t instanceof Set?t.forEach(e):e(t)},Be=(t,e,s)=>{let i=t[e];i instanceof Set||(t[e]=i=new Set([i])),i.add(s)},Ge=(t,e,s)=>{const i=t[e];i instanceof Set?i.delete(s):i===s&&delete t[e]},Ve=t=>t instanceof Set?0===t.size:!t,je=new Map;function Ke(t,e,s,i,r){const n=(e,i)=>{s(t),r(e,i,{watchedPath:t}),i&&t!==i&&Ye(_e.resolve(t,i),Re,_e.join(t,i))};try{return pe.watch(t,e,n)}catch(t){i(t)}}const Ye=(t,e,s,i,r)=>{const n=je.get(t);n&&Ue(n[e],(t=>{t(s,i,r)}))},$e=(t,e,s,i)=>{const{listener:r,errHandler:n,rawEmitter:a}=i;let o,h=je.get(e);if(!s.persistent)return o=Ke(t,s,r,n,a),o.close.bind(o);if(h)Be(h,Re,r),Be(h,Ae,n),Be(h,be,a);else{if(o=Ke(t,s,Ye.bind(null,e,Re),n,Ye.bind(null,e,be)),!o)return;o.on(De,(async s=>{const i=Ye.bind(null,e,Ae);if(h.watcherUnusable=!0,ge&&"EPERM"===s.code)try{const e=await Oe(t,"r");await We(e),i(s)}catch(t){}else i(s)})),h={listeners:r,errHandlers:n,rawEmitters:a,watcher:o},je.set(e,h)}return()=>{Ge(h,Re,r),Ge(h,Ae,n),Ge(h,be,a),Ve(h.listeners)&&(h.watcher.close(),je.delete(e),Se.forEach((t=>e=>{const s=t[e];s instanceof Set?s.clear():delete t[e]})(h)),h.watcher=void 0,Object.freeze(h))}},ze=new Map;var Qe=class{constructor(t){this.fsw=t,this._boundHandleError=e=>t._handleError(e)}_watchWithNodeFs(t,e){const s=this.fsw.options,i=_e.dirname(t),r=_e.basename(t);this.fsw._getWatchedDir(i).add(r);const n=_e.resolve(t),a={persistent:s.persistent};let o;return e||(e=ye),s.usePolling?(a.interval=s.enableBinaryInterval&&we(r)?s.binaryInterval:s.interval,o=((t,e,s,i)=>{const{listener:r,rawEmitter:n}=i;let a=ze.get(e);const o=a&&a.options;return o&&(o.persistent<s.persistent||o.interval>s.interval)&&(pe.unwatchFile(e),a=void 0),a?(Be(a,Re,r),Be(a,be,n)):(a={listeners:r,rawEmitters:n,options:s,watcher:pe.watchFile(e,s,((s,i)=>{Ue(a.rawEmitters,(t=>{t(Te,e,{curr:s,prev:i})}));const r=s.mtimeMs;(s.size!==i.size||r>i.mtimeMs||0===r)&&Ue(a.listeners,(e=>e(t,s)))}))},ze.set(e,a)),()=>{Ge(a,Re,r),Ge(a,be,n),Ve(a.listeners)&&(ze.delete(e),pe.unwatchFile(e),a.options=a.watcher=void 0,Object.freeze(a))}})(t,n,a,{listener:e,rawEmitter:this.fsw._emitRaw})):o=$e(t,n,a,{listener:e,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),o}_handleFile(t,e,s){if(this.fsw.closed)return;const i=_e.dirname(t),r=_e.basename(t),n=this.fsw._getWatchedDir(i);let a=e;if(n.has(r))return;const o=async(e,s)=>{if(this.fsw._throttle("watch",t,5))if(s&&0!==s.mtimeMs){if(n.has(r)){const e=s.atimeMs,i=s.mtimeMs;(!e||e<=i||i!==a.mtimeMs)&&this.fsw._emit(Te,t,s),a=s}}else try{const s=await He(t);if(this.fsw.closed)return;const i=s.atimeMs,r=s.mtimeMs;(!i||i<=r||r!==a.mtimeMs)&&this.fsw._emit(Te,t,s),Ee&&a.ino!==s.ino?(this.fsw._closeFile(e),a=s,this.fsw._addPathCloser(e,this._watchWithNodeFs(t,o))):a=s}catch(t){this.fsw._remove(i,r)}},h=this._watchWithNodeFs(t,o);if((!s||!this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(t)){if(!this.fsw._throttle(Ce,t,0))return;this.fsw._emit(Ce,t,e)}return h}async _handleSymlink(t,e,s,i){if(this.fsw.closed)return;const r=t.fullPath,n=this.fsw._getWatchedDir(e);if(!this.fsw.options.followSymlinks){let e;this.fsw._incrReadyCount();try{e=await ke(s)}catch(t){return this.fsw._emitReady(),!0}if(this.fsw.closed)return;return n.has(i)?this.fsw._symlinkPaths.get(r)!==e&&(this.fsw._symlinkPaths.set(r,e),this.fsw._emit(Te,s,t.stats)):(n.add(i),this.fsw._symlinkPaths.set(r,e),this.fsw._emit(Ce,s,t.stats)),this.fsw._emitReady(),!0}if(this.fsw._symlinkPaths.has(r))return!0;this.fsw._symlinkPaths.set(r,!0)}_handleRead(t,e,s,i,r,n,a){if(t=_e.join(t,ve),!s.hasGlob&&!(a=this.fsw._throttle("readdir",t,1e3)))return;const o=this.fsw._getWatchedDir(s.path),h=new Set;let l=this.fsw._readdirp(t,{fileFilter:t=>s.filterPath(t),directoryFilter:t=>s.filterDir(t),depth:0}).on(xe,(async a=>{if(this.fsw.closed)return void(l=void 0);const c=a.path;let d=_e.join(t,c);h.add(c),a.stats.isSymbolicLink()&&await this._handleSymlink(a,t,d,c)||(this.fsw.closed?l=void 0:c!==i&&(i||o.has(c))||(this.fsw._incrReadyCount(),d=_e.join(r,_e.relative(r,d)),this._addToNodeFs(d,e,s,n+1)))})).on(De,this._boundHandleError);return new Promise((e=>l.once(Ie,(()=>{if(this.fsw.closed)return void(l=void 0);const c=!!a&&a.clear();e(),o.getChildren().filter((e=>e!==t&&!h.has(e)&&(!s.hasGlob||s.filterPath({fullPath:_e.resolve(t,e)})))).forEach((e=>{this.fsw._remove(t,e)})),l=void 0,c&&this._handleRead(t,!1,s,i,r,n,a)}))))}async _handleDir(t,e,s,i,r,n,a){const o=this.fsw._getWatchedDir(_e.dirname(t)),h=o.has(_e.basename(t));let l,c;s&&this.fsw.options.ignoreInitial||r||h||n.hasGlob&&!n.globFilter(t)||this.fsw._emit(Pe,t,e),o.add(_e.basename(t)),this.fsw._getWatchedDir(t);const d=this.fsw.options.depth;if((null==d||i<=d)&&!this.fsw._symlinkPaths.has(a)){if(!r&&(await this._handleRead(t,s,n,r,t,i,l),this.fsw.closed))return;c=this._watchWithNodeFs(t,((e,s)=>{s&&0===s.mtimeMs||this._handleRead(e,!1,n,r,t,i,l)}))}return c}async _addToNodeFs(t,e,s,i,r){const n=this.fsw._emitReady;if(this.fsw._isIgnored(t)||this.fsw.closed)return n(),!1;const a=this.fsw._getWatchHelpers(t,i);!a.hasGlob&&s&&(a.hasGlob=s.hasGlob,a.globFilter=s.globFilter,a.filterPath=t=>s.filterPath(t),a.filterDir=t=>s.filterDir(t));try{const s=await Me[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,s))return n(),!1;const o=this.fsw.options.followSymlinks&&!t.includes(Fe)&&!t.includes(Ne);let h;if(s.isDirectory()){const n=_e.resolve(t),l=o?await ke(t):t;if(this.fsw.closed)return;if(h=await this._handleDir(a.watchPath,s,e,i,r,a,l),this.fsw.closed)return;n!==l&&void 0!==l&&this.fsw._symlinkPaths.set(n,l)}else if(s.isSymbolicLink()){const r=o?await ke(t):t;if(this.fsw.closed)return;const n=_e.dirname(a.watchPath);if(this.fsw._getWatchedDir(n).add(a.watchPath),this.fsw._emit(Ce,a.watchPath,s),h=await this._handleDir(n,s,e,i,t,a,r),this.fsw.closed)return;void 0!==r&&this.fsw._symlinkPaths.set(_e.resolve(t),r)}else h=this._handleFile(a.watchPath,s,e);return n(),this.fsw._addPathCloser(t,h),!1}catch(e){if(this.fsw._handleError(e))return n(),t}}},Ze={exports:{}};const qe=(0,n.RL)(n.Yw),Xe=o,Je=c,{promisify:ts}=h;let es;try{es=qe.getFsEvents()}catch(t){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(t)}if(es){const t=process.version.match(/v(\d+)\.(\d+)/);if(t&&t[1]&&t[2]){const e=Number.parseInt(t[1],10),s=Number.parseInt(t[2],10);8===e&&s<16&&(es=void 0)}}const{EV_ADD:ss,EV_CHANGE:is,EV_ADD_DIR:rs,EV_UNLINK:ns,EV_ERROR:as,STR_DATA:os,STR_END:hs,FSEVENT_CREATED:ls,FSEVENT_MODIFIED:cs,FSEVENT_DELETED:ds,FSEVENT_MOVED:us,FSEVENT_UNKNOWN:fs,FSEVENT_TYPE_FILE:ps,FSEVENT_TYPE_DIRECTORY:_s,FSEVENT_TYPE_SYMLINK:ms,ROOT_GLOBSTAR:ws,DIR_SUFFIX:gs,DOT_SLASH:Es,FUNCTION_TYPE:ys,EMPTY_FN:vs,IDENTITY_FN:Rs}=fe,As=ts(Xe.stat),bs=ts(Xe.lstat),Ss=ts(Xe.realpath),Ts={stat:As,lstat:bs},Cs=new Map,Ps=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),Ds=(t,e)=>({stop:es.watch(t,e)});const xs=t=>{let e=0;for(const s of Cs.keys())if(0===s.indexOf(t)&&(e++,e>=10))return!0;return!1},Is=(t,e)=>{let s=0;for(;!t.indexOf(e)&&(t=Je.dirname(t))!==e;)s++;return s},Ns=(t,e)=>t.type===_s&&e.isDirectory()||t.type===ms&&e.isSymbolicLink()||t.type===ps&&e.isFile();Ze.exports=class{constructor(t){this.fsw=t}checkIgnored(t,e){const s=this.fsw._ignoredPaths;if(this.fsw._isIgnored(t,e))return s.add(t),e&&e.isDirectory()&&s.add(t+ws),!0;s.delete(t),s.delete(t+ws)}addOrChange(t,e,s,i,r,n,a,o){const h=r.has(n)?is:ss;this.handleEvent(h,t,e,s,i,r,n,a,o)}async checkExists(t,e,s,i,r,n,a,o){try{const h=await As(t);if(this.fsw.closed)return;Ns(a,h)?this.addOrChange(t,e,s,i,r,n,a,o):this.handleEvent(ns,t,e,s,i,r,n,a,o)}catch(h){"EACCES"===h.code?this.addOrChange(t,e,s,i,r,n,a,o):this.handleEvent(ns,t,e,s,i,r,n,a,o)}}handleEvent(t,e,s,i,r,n,a,o,h){if(!this.fsw.closed&&!this.checkIgnored(e))if(t===ns){const t=o.type===_s;(t||n.has(a))&&this.fsw._remove(r,a,t)}else{if(t===ss){if(o.type===_s&&this.fsw._getWatchedDir(e),o.type===ms&&h.followSymlinks){const t=void 0===h.depth?void 0:Is(s,i)+1;return this._addToFsEvents(e,!1,!0,t)}this.fsw._getWatchedDir(r).add(a)}const n=o.type===_s?t+gs:t;this.fsw._emit(n,e),n===rs&&this._addToFsEvents(e,!1,!0)}}_watchWithFsEvents(t,e,s,i){if(this.fsw.closed||this.fsw._isIgnored(t))return;const r=this.fsw.options,n=function(t,e,s,i){let r=Je.extname(e)?Je.dirname(e):e;const n=Je.dirname(r);let a=Cs.get(r);xs(n)&&(r=n);const o=Je.resolve(t),h=o!==e,l=(t,i,r)=>{h&&(t=t.replace(e,o)),t!==o&&t.indexOf(o+Je.sep)||s(t,i,r)};let c=!1;for(const t of Cs.keys())if(0===e.indexOf(Je.resolve(t)+Je.sep)){r=t,a=Cs.get(r),c=!0;break}return a||c?a.listeners.add(l):(a={listeners:new Set([l]),rawEmitter:i,watcher:Ds(r,((t,e)=>{if(!a.listeners.size)return;const s=es.getInfo(t,e);a.listeners.forEach((i=>{i(t,e,s)})),a.rawEmitter(s.event,t,s)}))},Cs.set(r,a)),()=>{const t=a.listeners;if(t.delete(l),!t.size&&(Cs.delete(r),a.watcher))return a.watcher.stop().then((()=>{a.rawEmitter=a.watcher=void 0,Object.freeze(a)}))}}(t,e,(async(n,a,o)=>{if(this.fsw.closed)return;if(void 0!==r.depth&&Is(n,e)>r.depth)return;const h=s(Je.join(t,Je.relative(t,n)));if(i&&!i(h))return;const l=Je.dirname(h),c=Je.basename(h),d=this.fsw._getWatchedDir(o.type===_s?h:l);if(Ps.has(a)||o.event===fs)if(typeof r.ignored===ys){let t;try{t=await As(h)}catch(t){}if(this.fsw.closed)return;if(this.checkIgnored(h,t))return;Ns(o,t)?this.addOrChange(h,n,e,l,d,c,o,r):this.handleEvent(ns,h,n,e,l,d,c,o,r)}else this.checkExists(h,n,e,l,d,c,o,r);else switch(o.event){case ls:case cs:return this.addOrChange(h,n,e,l,d,c,o,r);case ds:case us:return this.checkExists(h,n,e,l,d,c,o,r)}}),this.fsw._emitRaw);return this.fsw._emitReady(),n}async _handleFsEventsSymlink(t,e,s,i){if(!this.fsw.closed&&!this.fsw._symlinkPaths.has(e)){this.fsw._symlinkPaths.set(e,!0),this.fsw._incrReadyCount();try{const e=await Ss(t);if(this.fsw.closed)return;if(this.fsw._isIgnored(e))return this.fsw._emitReady();this.fsw._incrReadyCount(),this._addToFsEvents(e||t,(i=>{let r=t;return e&&e!==Es?r=i.replace(e,t):i!==Es&&(r=Je.join(t,i)),s(r)}),!1,i)}catch(t){if(this.fsw._handleError(t))return this.fsw._emitReady()}}}emitAdd(t,e,s,i,r){const n=s(t),a=e.isDirectory(),o=this.fsw._getWatchedDir(Je.dirname(n)),h=Je.basename(n);a&&this.fsw._getWatchedDir(n),o.has(h)||(o.add(h),i.ignoreInitial&&!0!==r||this.fsw._emit(a?rs:ss,n,e))}initWatch(t,e,s,i){if(this.fsw.closed)return;const r=this._watchWithFsEvents(s.watchPath,Je.resolve(t||s.watchPath),i,s.globFilter);this.fsw._addPathCloser(e,r)}async _addToFsEvents(t,e,s,i){if(this.fsw.closed)return;const r=this.fsw.options,n=typeof e===ys?e:Rs,a=this.fsw._getWatchHelpers(t);try{const e=await Ts[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,e))throw null;if(e.isDirectory()){if(a.globFilter||this.emitAdd(n(t),e,n,r,s),i&&i>r.depth)return;this.fsw._readdirp(a.watchPath,{fileFilter:t=>a.filterPath(t),directoryFilter:t=>a.filterDir(t),...(o=r.depth-(i||0),isNaN(o)?{}:{depth:o})}).on(os,(t=>{if(this.fsw.closed)return;if(t.stats.isDirectory()&&!a.filterPath(t))return;const e=Je.join(a.watchPath,t.path),{fullPath:i}=t;if(a.followSymlinks&&t.stats.isSymbolicLink()){const t=void 0===r.depth?void 0:Is(e,Je.resolve(a.watchPath))+1;this._handleFsEventsSymlink(e,i,n,t)}else this.emitAdd(e,t.stats,n,r,s)})).on(as,vs).on(hs,(()=>{this.fsw._emitReady()}))}else this.emitAdd(a.watchPath,e,n,r,s),this.fsw._emitReady()}catch(t){t&&!this.fsw._handleError(t)||(this.fsw._emitReady(),this.fsw._emitReady())}var o;if(r.persistent&&!0!==s)if(typeof e===ys)this.initWatch(void 0,t,a,n);else{let e;try{e=await Ss(a.watchPath)}catch(t){}this.initWatch(e,t,a,n)}}},Ze.exports.canUse=()=>es&&Cs.size<128;var Fs=Ze.exports;const{EventEmitter:Os}=u,Hs=o,Ls=c,{promisify:Ws}=h,ks=L,Ms=K.default,Us=function(t,e){Object.assign({flipBackslashes:!0},e).flipBackslashes&&J&&t.indexOf("/")<0&&(t=t.replace(tt,"/")),et.test(t)&&(t+="/"),t+="a";do{t=X(t)}while(q(t)||st.test(t));return t.replace(it,"$1")},Bs=Z,Gs=ce,Vs=k,js=Qe,Ks=Fs,{EV_ALL:Ys,EV_READY:$s,EV_ADD:zs,EV_CHANGE:Qs,EV_UNLINK:Zs,EV_ADD_DIR:qs,EV_UNLINK_DIR:Xs,EV_RAW:Js,EV_ERROR:ti,STR_CLOSE:ei,STR_END:si,BACK_SLASH_RE:ii,DOUBLE_SLASH_RE:ri,SLASH_OR_BACK_SLASH_RE:ni,DOT_RE:ai,REPLACER_RE:oi,SLASH:hi,SLASH_SLASH:li,BRACE_START:ci,BANG:di,ONE_DOT:ui,TWO_DOTS:fi,GLOBSTAR:pi,SLASH_GLOBSTAR:_i,ANYMATCH_OPTS:mi,STRING_TYPE:wi,FUNCTION_TYPE:gi,EMPTY_STR:Ei,EMPTY_FN:yi,isWindows:vi,isMacos:Ri,isIBMi:Ai}=fe,bi=Ws(Hs.stat),Si=Ws(Hs.readdir),Ti=(t=[])=>Array.isArray(t)?t:[t],Ci=(t,e=[])=>(t.forEach((t=>{Array.isArray(t)?Ci(t,e):e.push(t)})),e),Pi=t=>{const e=Ci(Ti(t));if(!e.every((t=>typeof t===wi)))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(xi)},Di=t=>{let e=t.replace(ii,hi),s=!1;for(e.startsWith(li)&&(s=!0);e.match(ri);)e=e.replace(ri,hi);return s&&(e=hi+e),e},xi=t=>Di(Ls.normalize(Di(t))),Ii=(t=Ei)=>e=>typeof e!==wi?e:xi(Ls.isAbsolute(e)?e:Ls.join(t,e)),Ni=(t,e)=>void 0===t[e];class Fi{constructor(t,e){this.path=t,this._removeWatcher=e,this.items=new Set}add(t){const{items:e}=this;e&&t!==ui&&t!==fi&&e.add(t)}async remove(t){const{items:e}=this;if(!e)return;if(e.delete(t),e.size>0)return;const s=this.path;try{await Si(s)}catch(t){this._removeWatcher&&this._removeWatcher(Ls.dirname(s),Ls.basename(s))}}has(t){const{items:e}=this;if(e)return e.has(t)}getChildren(){const{items:t}=this;if(t)return[...t.values()]}dispose(){this.items.clear(),delete this.path,delete this._removeWatcher,delete this.items,Object.freeze(this)}}class Oi{constructor(t,e,s,i){this.fsw=i,this.path=t=t.replace(oi,Ei),this.watchPath=e,this.fullWatchPath=Ls.resolve(e),this.hasGlob=e!==t,t===Ei&&(this.hasGlob=!1),this.globSymlink=!(!this.hasGlob||!s)&&void 0,this.globFilter=!!this.hasGlob&&Ms(t,void 0,mi),this.dirParts=this.getDirParts(t),this.dirParts.forEach((t=>{t.length>1&&t.pop()})),this.followSymlinks=s,this.statMethod=s?"stat":"lstat"}checkGlobSymlink(t){return void 0===this.globSymlink&&(this.globSymlink=t.fullParentDir!==this.fullWatchPath&&{realPath:t.fullParentDir,linkPath:this.fullWatchPath}),this.globSymlink?t.fullPath.replace(this.globSymlink.realPath,this.globSymlink.linkPath):t.fullPath}entryPath(t){return Ls.join(this.watchPath,Ls.relative(this.watchPath,this.checkGlobSymlink(t)))}filterPath(t){const{stats:e}=t;if(e&&e.isSymbolicLink())return this.filterDir(t);const s=this.entryPath(t);return(!this.hasGlob||typeof this.globFilter!==gi||this.globFilter(s))&&this.fsw._isntIgnored(s,e)&&this.fsw._hasReadPermissions(e)}getDirParts(t){if(!this.hasGlob)return[];const e=[];return(t.includes(ci)?Gs.expand(t):[t]).forEach((t=>{e.push(Ls.relative(this.watchPath,t).split(ni))})),e}filterDir(t){if(this.hasGlob){const e=this.getDirParts(this.checkGlobSymlink(t));let s=!1;this.unmatchedGlob=!this.dirParts.some((t=>t.every(((t,i)=>(t===pi&&(s=!0),s||!e[0][i]||Ms(t,e[0][i],mi))))))}return!this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(t),t.stats)}}class Hi extends Os{constructor(t){super();const e={};t&&Object.assign(e,t),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,Ni(e,"persistent")&&(e.persistent=!0),Ni(e,"ignoreInitial")&&(e.ignoreInitial=!1),Ni(e,"ignorePermissionErrors")&&(e.ignorePermissionErrors=!1),Ni(e,"interval")&&(e.interval=100),Ni(e,"binaryInterval")&&(e.binaryInterval=300),Ni(e,"disableGlobbing")&&(e.disableGlobbing=!1),e.enableBinaryInterval=e.binaryInterval!==e.interval,Ni(e,"useFsEvents")&&(e.useFsEvents=!e.usePolling);Ks.canUse()||(e.useFsEvents=!1),Ni(e,"usePolling")&&!e.useFsEvents&&(e.usePolling=Ri),Ai&&(e.usePolling=!0);const s=process.env.CHOKIDAR_USEPOLLING;if(void 0!==s){const t=s.toLowerCase();e.usePolling="false"!==t&&"0"!==t&&("true"===t||"1"===t||!!t)}const i=process.env.CHOKIDAR_INTERVAL;i&&(e.interval=Number.parseInt(i,10)),Ni(e,"atomic")&&(e.atomic=!e.usePolling&&!e.useFsEvents),e.atomic&&(this._pendingUnlinks=new Map),Ni(e,"followSymlinks")&&(e.followSymlinks=!0),Ni(e,"awaitWriteFinish")&&(e.awaitWriteFinish=!1),!0===e.awaitWriteFinish&&(e.awaitWriteFinish={});const r=e.awaitWriteFinish;r&&(r.stabilityThreshold||(r.stabilityThreshold=2e3),r.pollInterval||(r.pollInterval=100),this._pendingWrites=new Map),e.ignored&&(e.ignored=Ti(e.ignored));let n=0;this._emitReady=()=>{n++,n>=this._readyCount&&(this._emitReady=yi,this._readyEmitted=!0,process.nextTick((()=>this.emit($s))))},this._emitRaw=(...t)=>this.emit(Js,...t),this._readyEmitted=!1,this.options=e,e.useFsEvents?this._fsEventsHandler=new Ks(this):this._nodeFsHandler=new js(this),Object.freeze(e)}add(t,e,s){const{cwd:i,disableGlobbing:r}=this.options;this.closed=!1;let n=Pi(t);return i&&(n=n.map((t=>{const e=((t,e)=>Ls.isAbsolute(t)?t:t.startsWith(di)?di+Ls.join(e,t.slice(1)):Ls.join(e,t))(t,i);return r||!Bs(t)?e:Vs(e)}))),n=n.filter((t=>t.startsWith(di)?(this._ignoredPaths.add(t.slice(1)),!1):(this._ignoredPaths.delete(t),this._ignoredPaths.delete(t+_i),this._userIgnored=void 0,!0))),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=n.length),this.options.persistent&&(this._readyCount*=2),n.forEach((t=>this._fsEventsHandler._addToFsEvents(t)))):(this._readyCount||(this._readyCount=0),this._readyCount+=n.length,Promise.all(n.map((async t=>{const i=await this._nodeFsHandler._addToNodeFs(t,!s,0,0,e);return i&&this._emitReady(),i}))).then((t=>{this.closed||t.filter((t=>t)).forEach((t=>{this.add(Ls.dirname(t),Ls.basename(e||t))}))}))),this}unwatch(t){if(this.closed)return this;const e=Pi(t),{cwd:s}=this.options;return e.forEach((t=>{Ls.isAbsolute(t)||this._closers.has(t)||(s&&(t=Ls.join(s,t)),t=Ls.resolve(t)),this._closePath(t),this._ignoredPaths.add(t),this._watched.has(t)&&this._ignoredPaths.add(t+_i),this._userIgnored=void 0})),this}close(){if(this.closed)return this._closePromise;this.closed=!0,this.removeAllListeners();const t=[];return this._closers.forEach((e=>e.forEach((e=>{const s=e();s instanceof Promise&&t.push(s)})))),this._streams.forEach((t=>t.destroy())),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach((t=>t.dispose())),["closers","watched","streams","symlinkPaths","throttled"].forEach((t=>{this[`_${t}`].clear()})),this._closePromise=t.length?Promise.all(t).then((()=>{})):Promise.resolve(),this._closePromise}getWatched(){const t={};return this._watched.forEach(((e,s)=>{const i=this.options.cwd?Ls.relative(this.options.cwd,s):s;t[i||ui]=e.getChildren().sort()})),t}emitWithAll(t,e){this.emit(...e),t!==ti&&this.emit(Ys,...e)}async _emit(t,e,s,i,r){if(this.closed)return;const n=this.options;vi&&(e=Ls.normalize(e)),n.cwd&&(e=Ls.relative(n.cwd,e));const a=[t,e];void 0!==r?a.push(s,i,r):void 0!==i?a.push(s,i):void 0!==s&&a.push(s);const o=n.awaitWriteFinish;let h;if(o&&(h=this._pendingWrites.get(e)))return h.lastChange=new Date,this;if(n.atomic){if(t===Zs)return this._pendingUnlinks.set(e,a),setTimeout((()=>{this._pendingUnlinks.forEach(((t,e)=>{this.emit(...t),this.emit(Ys,...t),this._pendingUnlinks.delete(e)}))}),"number"==typeof n.atomic?n.atomic:100),this;t===zs&&this._pendingUnlinks.has(e)&&(t=a[0]=Qs,this._pendingUnlinks.delete(e))}if(o&&(t===zs||t===Qs)&&this._readyEmitted){const s=(e,s)=>{e?(t=a[0]=ti,a[1]=e,this.emitWithAll(t,a)):s&&(a.length>2?a[2]=s:a.push(s),this.emitWithAll(t,a))};return this._awaitWriteFinish(e,o.stabilityThreshold,t,s),this}if(t===Qs){if(!this._throttle(Qs,e,50))return this}if(n.alwaysStat&&void 0===s&&(t===zs||t===qs||t===Qs)){const t=n.cwd?Ls.join(n.cwd,e):e;let s;try{s=await bi(t)}catch(t){}if(!s||this.closed)return;a.push(s)}return this.emitWithAll(t,a),this}_handleError(t){const e=t&&t.code;return t&&"ENOENT"!==e&&"ENOTDIR"!==e&&(!this.options.ignorePermissionErrors||"EPERM"!==e&&"EACCES"!==e)&&this.emit(ti,t),t||this.closed}_throttle(t,e,s){this._throttled.has(t)||this._throttled.set(t,new Map);const i=this._throttled.get(t),r=i.get(e);if(r)return r.count++,!1;let n;const a=()=>{const t=i.get(e),s=t?t.count:0;return i.delete(e),clearTimeout(n),t&&clearTimeout(t.timeoutObject),s};n=setTimeout(a,s);const o={timeoutObject:n,clear:a,count:0};return i.set(e,o),o}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(t,e,s,i){let r,n=t;this.options.cwd&&!Ls.isAbsolute(t)&&(n=Ls.join(this.options.cwd,t));const a=new Date,o=s=>{Hs.stat(n,((n,a)=>{if(n||!this._pendingWrites.has(t))return void(n&&"ENOENT"!==n.code&&i(n));const h=Number(new Date);s&&a.size!==s.size&&(this._pendingWrites.get(t).lastChange=h);h-this._pendingWrites.get(t).lastChange>=e?(this._pendingWrites.delete(t),i(void 0,a)):r=setTimeout(o,this.options.awaitWriteFinish.pollInterval,a)}))};this._pendingWrites.has(t)||(this._pendingWrites.set(t,{lastChange:a,cancelWait:()=>(this._pendingWrites.delete(t),clearTimeout(r),s)}),r=setTimeout(o,this.options.awaitWriteFinish.pollInterval))}_getGlobIgnored(){return[...this._ignoredPaths.values()]}_isIgnored(t,e){if(this.options.atomic&&ai.test(t))return!0;if(!this._userIgnored){const{cwd:t}=this.options,e=this.options.ignored,s=e&&e.map(Ii(t)),i=Ti(s).filter((t=>typeof t===wi&&!Bs(t))).map((t=>t+_i)),r=this._getGlobIgnored().map(Ii(t)).concat(s,i);this._userIgnored=Ms(r,void 0,mi)}return this._userIgnored([t,e])}_isntIgnored(t,e){return!this._isIgnored(t,e)}_getWatchHelpers(t,e){const s=e||this.options.disableGlobbing||!Bs(t)?t:Us(t),i=this.options.followSymlinks;return new Oi(t,s,i,this)}_getWatchedDir(t){this._boundRemove||(this._boundRemove=this._remove.bind(this));const e=Ls.resolve(t);return this._watched.has(e)||this._watched.set(e,new Fi(e,this._boundRemove)),this._watched.get(e)}_hasReadPermissions(t){if(this.options.ignorePermissionErrors)return!0;const e=511&(t&&Number.parseInt(t.mode,10)),s=Number.parseInt(e.toString(8)[0],10);return Boolean(4&s)}_remove(t,e,s){const i=Ls.join(t,e),r=Ls.resolve(i);if(s=null!=s?s:this._watched.has(i)||this._watched.has(r),!this._throttle("remove",i,100))return;s||this.options.useFsEvents||1!==this._watched.size||this.add(t,e,!0);this._getWatchedDir(i).getChildren().forEach((t=>this._remove(i,t)));const n=this._getWatchedDir(t),a=n.has(e);n.remove(e),this._symlinkPaths.has(r)&&this._symlinkPaths.delete(r);let o=i;if(this.options.cwd&&(o=Ls.relative(this.options.cwd,i)),this.options.awaitWriteFinish&&this._pendingWrites.has(o)){if(this._pendingWrites.get(o).cancelWait()===zs)return}this._watched.delete(i),this._watched.delete(r);const h=s?Xs:Zs;a&&!this._isIgnored(i)&&this._emit(h,i),this.options.useFsEvents||this._closePath(i)}_closePath(t){this._closeFile(t);const e=Ls.dirname(t);this._getWatchedDir(e).remove(Ls.basename(t))}_closeFile(t){const e=this._closers.get(t);e&&(e.forEach((t=>t())),this._closers.delete(t))}_addPathCloser(t,e){if(!e)return;let s=this._closers.get(t);s||(s=[],this._closers.set(t,s)),s.push(e)}_readdirp(t,e){if(this.closed)return;const s={type:Ys,alwaysStat:!0,lstat:!0,...e};let i=ks(t,s);return this._streams.add(i),i.once(ei,(()=>{i=void 0})),i.once(si,(()=>{i&&(this._streams.delete(i),i=void 0)})),i}}f.FSWatcher=Hi;f.watch=(t,e)=>{const s=new Hi(e);return s.add(t),s};class Li{constructor(t,e){this.transformWatchers=new Map,this.chokidarOptions=e,this.task=t,this.watcher=this.createWatcher(null)}close(){this.watcher.close();for(const t of this.transformWatchers.values())t.close()}unwatch(t){this.watcher.unwatch(t);const e=this.transformWatchers.get(t);e&&(this.transformWatchers.delete(t),e.close())}watch(t,e){if(e){const e=this.transformWatchers.get(t)??this.createWatcher(t);e.add(t),this.transformWatchers.set(t,e)}else this.watcher.add(t)}createWatcher(t){const e=this.task,s="linux"===(0,a.platform)(),i=null!==t,r=(r,a)=>{const o=t||r;s&&(n.unwatch(o),n.add(o)),e.invalidate(o,{event:a,isTransformDependency:i})},n=f.watch([],this.chokidarOptions).on("add",(t=>r(t,"create"))).on("change",(t=>r(t,"update"))).on("unlink",(t=>r(t,"delete")));return n}}const Wi={create:{create:"buggy",delete:null,update:"create"},delete:{create:"update",delete:"buggy",update:"buggy"},update:{create:"buggy",delete:"delete",update:"update"}};class ki{constructor(t,e){this.buildDelay=0,this.buildTimeout=null,this.closed=!1,this.invalidatedIds=new Map,this.rerun=!1,this.running=!0,this.emitter=e,e.close=this.close.bind(this),this.tasks=t.map((t=>new Mi(this,t)));for(const{watch:e}of t)e&&"number"==typeof e.buildDelay&&(this.buildDelay=Math.max(this.buildDelay,e.buildDelay));r.nextTick((()=>this.run()))}async close(){if(!this.closed){this.closed=!0,this.buildTimeout&&clearTimeout(this.buildTimeout);for(const t of this.tasks)t.close();await this.emitter.emit("close"),this.emitter.removeAllListeners()}}invalidate(t){if(t){const e=this.invalidatedIds.get(t.id),s=e?Wi[e][t.event]:t.event;"buggy"===s?this.invalidatedIds.set(t.id,t.event):null===s?this.invalidatedIds.delete(t.id):this.invalidatedIds.set(t.id,s)}this.running?this.rerun=!0:(this.buildTimeout&&clearTimeout(this.buildTimeout),this.buildTimeout=setTimeout((async()=>{this.buildTimeout=null;try{await Promise.all([...this.invalidatedIds].map((([t,e])=>this.emitter.emit("change",t,{event:e})))),this.invalidatedIds.clear(),await this.emitter.emit("restart"),this.emitter.removeListenersForCurrentRun(),this.run()}catch(t){this.invalidatedIds.clear(),await this.emitter.emit("event",{code:"ERROR",error:t,result:null}),await this.emitter.emit("event",{code:"END"})}}),this.buildDelay))}async run(){this.running=!0,await this.emitter.emit("event",{code:"START"});for(const t of this.tasks)await t.run();this.running=!1,await this.emitter.emit("event",{code:"END"}),this.rerun&&(this.rerun=!1,this.invalidate())}}class Mi{constructor(t,e){this.cache={modules:[]},this.watchFiles=[],this.closed=!1,this.invalidated=!0,this.watched=new Set,this.watcher=t,this.options=e,this.skipWrite=Boolean(e.watch&&e.watch.skipWrite),this.outputs=this.options.output,this.outputFiles=this.outputs.map((t=>{if(t.file||t.dir)return(0,i.resolve)(t.file||t.dir)}));const s=this.options.watch||{};this.filter=(0,n.cj)(s.include,s.exclude),this.fileWatcher=new Li(this,{...s.chokidar,disableGlobbing:!0,ignoreInitial:!0})}close(){this.closed=!0,this.fileWatcher.close()}invalidate(t,e){if(this.invalidated=!0,e.isTransformDependency)for(const e of this.cache.modules)e.transformDependencies.includes(t)&&(e.originalCode=null);this.watcher.invalidate({event:e.event,id:t})}async run(){if(!this.invalidated)return;this.invalidated=!1;const t={...this.options,cache:this.cache},e=Date.now();await this.watcher.emitter.emit("event",{code:"BUNDLE_START",input:this.options.input,output:this.outputFiles});let s=null;try{if(s=await(0,n.iX)(t,this.watcher.emitter),this.closed)return;this.updateWatchedFiles(s),this.skipWrite||await Promise.all(this.outputs.map((t=>s.write(t)))),await this.watcher.emitter.emit("event",{code:"BUNDLE_END",duration:Date.now()-e,input:this.options.input,output:this.outputFiles,result:s})}catch(t){if(!this.closed){if(Array.isArray(t.watchFiles))for(const e of t.watchFiles)this.watchFile(e);t.id&&(this.cache.modules=this.cache.modules.filter((e=>e.id!==t.id)))}await this.watcher.emitter.emit("event",{code:"ERROR",error:t,result:s})}}updateWatchedFiles(t){const e=this.watched;this.watched=new Set,this.watchFiles=t.watchFiles,this.cache=t.cache;for(const t of this.watchFiles)this.watchFile(t);for(const t of this.cache.modules)for(const e of t.transformDependencies)this.watchFile(e,!0);for(const t of e)this.watched.has(t)||this.fileWatcher.unwatch(t)}watchFile(t,e=!1){if(this.filter(t)){if(this.watched.add(t),this.outputFiles.includes(t))throw new Error("Cannot import the generated bundle");this.fileWatcher.watch(t,e)}}}}};