@modern-js/module-tools 2.45.0-beta.0 → 2.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiled/@rollup/plugin-json/index.js +1 -1
- package/compiled/@rollup/plugin-json/rollup/dist/rollup.d.ts +63 -16
- package/compiled/rollup/{249.index.js → 846.index.js} +6 -5
- package/compiled/rollup/fsevents.node +0 -0
- package/compiled/rollup/index.js +20 -20
- package/compiled/rollup/package.json +1 -1
- package/compiled/rollup/types/rollup.d.ts +63 -16
- package/compiled/rollup-plugin-dts/{dist/rollup-plugin-dts.d.ts → index.d.ts} +1 -1
- package/compiled/rollup-plugin-dts/index.js +1 -1
- package/compiled/rollup-plugin-dts/package.json +1 -1
- package/compiled/rollup-plugin-dts/{rollup/dist/rollup.d.ts → rollup.d.ts} +63 -16
- package/dist/builder/build.js +4 -0
- package/dist/builder/esbuild/index.js +8 -0
- package/dist/error.d.ts +0 -1
- package/dist/error.js +4 -9
- package/dist/types/config/index.d.ts +1 -1
- package/dist/types/config/transform-import.d.ts +13 -0
- package/dist/types/config/transform-import.js +16 -0
- package/package.json +16 -16
package/compiled/rollup/index.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
(()=>{"use strict";var e={
|
|
1
|
+
(()=>{"use strict";var e={142:(e,t,i)=>{
|
|
2
2
|
/*
|
|
3
3
|
@license
|
|
4
|
-
Rollup.js v3.
|
|
5
|
-
|
|
4
|
+
Rollup.js v3.29.4
|
|
5
|
+
Thu, 28 Sep 2023 04:54:30 GMT - commit 4e92d60fa90cead39481e3703d26e5d812f43bd1
|
|
6
6
|
|
|
7
7
|
https://github.com/rollup/rollup
|
|
8
8
|
|
|
9
9
|
Released under the MIT License.
|
|
10
10
|
*/
|
|
11
|
-
Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=i(
|
|
11
|
+
Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=i(425);const n=i(262);i(742);i(224);i(411);i(17);i(846);i(5);i(977);i(967);t.VERSION=s.version;t.defineConfig=s.defineConfig;t.rollup=s.rollup;t.watch=n.watch},967:(e,t,i)=>{
|
|
12
12
|
/*
|
|
13
13
|
@license
|
|
14
|
-
Rollup.js v3.
|
|
15
|
-
|
|
14
|
+
Rollup.js v3.29.4
|
|
15
|
+
Thu, 28 Sep 2023 04:54:30 GMT - commit 4e92d60fa90cead39481e3703d26e5d812f43bd1
|
|
16
16
|
|
|
17
17
|
https://github.com/rollup/rollup
|
|
18
18
|
|
|
19
19
|
Released under the MIT License.
|
|
20
20
|
*/
|
|
21
|
-
let s;let n;async function loadFsEvents(){try{({default:s}=await i.e(
|
|
21
|
+
let s;let n;async function loadFsEvents(){try{({default:s}=await i.e(846).then(i.t.bind(i,640,19)))}catch(e){n=e}}function getFsEvents(){if(n)throw n;return s}const r=Object.defineProperty({__proto__:null,getFsEvents:getFsEvents,loadFsEvents:loadFsEvents},Symbol.toStringTag,{value:"Module"});t.fseventsImporter=r;t.loadFsEvents=loadFsEvents},466:(e,t,i)=>{
|
|
22
22
|
/*
|
|
23
23
|
@license
|
|
24
|
-
Rollup.js v3.
|
|
25
|
-
|
|
24
|
+
Rollup.js v3.29.4
|
|
25
|
+
Thu, 28 Sep 2023 04:54:30 GMT - commit 4e92d60fa90cead39481e3703d26e5d812f43bd1
|
|
26
26
|
|
|
27
27
|
https://github.com/rollup/rollup
|
|
28
28
|
|
|
29
29
|
Released under the MIT License.
|
|
30
30
|
*/
|
|
31
|
-
const s=i(
|
|
31
|
+
const s=i(425);const n=i(147);const r=i(837);const o=i(781);const l=i(17);const c=i(37);const u=i(967);const h=i(361);var d={};const p=n;const{Readable:f}=o;const m=l;const{promisify:g}=r;const y=s.picomatch;const E=g(p.readdir);const x=g(p.stat);const b=g(p.lstat);const v=g(p.realpath);const S="!";const A="READDIRP_RECURSIVE_ERROR";const w=new Set(["ENOENT","EPERM","EACCES","ELOOP",A]);const I="files";const C="directories";const k="files_directories";const _="all";const P=[I,C,k,_];const isNormalFlowError=e=>w.has(e.code);const[N,R]=process.versions.node.split(".").slice(0,2).map((e=>Number.parseInt(e,10)));const $=process.platform==="win32"&&(N>10||N===10&&R>=5);const normalizeFilter=e=>{if(e===undefined)return;if(typeof e==="function")return e;if(typeof e==="string"){const t=y(e.trim());return e=>t(e.basename)}if(Array.isArray(e)){const t=[];const i=[];for(const s of e){const e=s.trim();if(e.charAt(0)===S){i.push(y(e.slice(1)))}else{t.push(y(e))}}if(i.length>0){if(t.length>0){return e=>t.some((t=>t(e.basename)))&&!i.some((t=>t(e.basename)))}return e=>!i.some((t=>t(e.basename)))}return e=>t.some((t=>t(e.basename)))}};class ReaddirpStream extends f{static get defaultOptions(){return{root:".",fileFilter:e=>true,directoryFilter:e=>true,type:I,lstat:false,depth:2147483648,alwaysStat:false}}constructor(e={}){super({objectMode:true,autoDestroy:true,highWaterMark:e.highWaterMark||4096});const t={...ReaddirpStream.defaultOptions,...e};const{root:i,type:s}=t;this._fileFilter=normalizeFilter(t.fileFilter);this._directoryFilter=normalizeFilter(t.directoryFilter);const n=t.lstat?b:x;if($){this._stat=e=>n(e,{bigint:true})}else{this._stat=n}this._maxDepth=t.depth;this._wantsDir=[C,k,_].includes(s);this._wantsFile=[I,k,_].includes(s);this._wantsEverything=s===_;this._root=m.resolve(i);this._isDirent="Dirent"in p&&!t.alwaysStat;this._statsProp=this._isDirent?"dirent":"stats";this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent};this.parents=[this._exploreDir(i,1)];this.reading=false;this.parent=undefined}async _read(e){if(this.reading)return;this.reading=true;try{while(!this.destroyed&&e>0){const{path:t,depth:i,files:s=[]}=this.parent||{};if(s.length>0){const n=s.splice(0,e).map((e=>this._formatEntry(e,t)));for(const t of await Promise.all(n)){if(this.destroyed)return;const s=await this._getEntryType(t);if(s==="directory"&&this._directoryFilter(t)){if(i<=this._maxDepth){this.parents.push(this._exploreDir(t.fullPath,i+1))}if(this._wantsDir){this.push(t);e--}}else if((s==="file"||this._includeAsFile(t))&&this._fileFilter(t)){if(this._wantsFile){this.push(t);e--}}}}else{const e=this.parents.pop();if(!e){this.push(null);break}this.parent=await e;if(this.destroyed)return}}}catch(e){this.destroy(e)}finally{this.reading=false}}async _exploreDir(e,t){let i;try{i=await E(e,this._rdOptions)}catch(e){this._onError(e)}return{files:i,depth:t,path:e}}async _formatEntry(e,t){let i;try{const s=this._isDirent?e.name:e;const n=m.resolve(m.join(t,s));i={path:m.relative(this._root,n),fullPath:n,basename:s};i[this._statsProp]=this._isDirent?e:await this._stat(n)}catch(e){this._onError(e)}return i}_onError(e){if(isNormalFlowError(e)&&!this.destroyed){this.emit("warn",e)}else{this.destroy(e)}}async _getEntryType(e){const t=e&&e[this._statsProp];if(!t){return}if(t.isFile()){return"file"}if(t.isDirectory()){return"directory"}if(t&&t.isSymbolicLink()){const t=e.fullPath;try{const e=await v(t);const i=await b(e);if(i.isFile()){return"file"}if(i.isDirectory()){const i=e.length;if(t.startsWith(e)&&t.substr(i,1)===m.sep){const i=new Error(`Circular symlink detected: "${t}" points to "${e}"`);i.code=A;return this._onError(i)}return"directory"}}catch(e){this._onError(e)}}}_includeAsFile(e){const t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}}const readdirp$1=(e,t={})=>{let i=t.entryType||t.type;if(i==="both")i=k;if(i)t.type=i;if(!e){throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)")}else if(typeof e!=="string"){throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)")}else if(i&&!P.includes(i)){throw new Error(`readdirp: Invalid type passed. Use one of ${P.join(", ")}`)}t.root=e;return new ReaddirpStream(t)};const readdirpPromise=(e,t={})=>new Promise(((i,s)=>{const n=[];readdirp$1(e,t).on("data",(e=>n.push(e))).on("end",(()=>i(n))).on("error",(e=>s(e)))}));readdirp$1.promise=readdirpPromise;readdirp$1.ReaddirpStream=ReaddirpStream;readdirp$1.default=readdirp$1;var O=readdirp$1;var T={exports:{}};
|
|
32
32
|
/*!
|
|
33
33
|
* normalize-path <https://github.com/jonschlinkert/normalize-path>
|
|
34
34
|
*
|
|
@@ -64,34 +64,34 @@ const s=i(194);const n=i(147);const r=i(837);const o=i(781);const l=i(17);const
|
|
|
64
64
|
*
|
|
65
65
|
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
66
66
|
* Licensed under the MIT License.
|
|
67
|
-
*/const ne=r;const re=se;const isObject=e=>e!==null&&typeof e==="object"&&!Array.isArray(e);const transform=e=>t=>e===true?Number(t):String(t);const isValidValue=e=>typeof e==="number"||typeof e==="string"&&e!=="";const isNumber=e=>Number.isInteger(+e);const zeros=e=>{let t=`${e}`;let i=-1;if(t[0]==="-")t=t.slice(1);if(t==="0")return false;while(t[++i]==="0");return i>0};const stringify$3=(e,t,i)=>{if(typeof e==="string"||typeof t==="string"){return true}return i.stringify===true};const pad=(e,t,i)=>{if(t>0){let i=e[0]==="-"?"-":"";if(i)e=e.slice(1);e=i+e.padStart(i?t-1:t,"0")}if(i===false){return String(e)}return e};const toMaxLen=(e,t)=>{let i=e[0]==="-"?"-":"";if(i){e=e.slice(1);t--}while(e.length<t)e="0"+e;return i?"-"+e:e};const toSequence=(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 i=t.capture?"":"?:";let s="";let n="";let r;if(e.positives.length){s=e.positives.join("|")}if(e.negatives.length){n=`-(${i}${e.negatives.join("|")})`}if(s&&n){r=`${s}|${n}`}else{r=s||n}if(t.wrap){return`(${i}${r})`}return r};const toRange=(e,t,i,s)=>{if(i){return re(e,t,{wrap:false,...s})}let n=String.fromCharCode(e);if(e===t)return n;let r=String.fromCharCode(t);return`[${n}-${r}]`};const toRegex=(e,t,i)=>{if(Array.isArray(e)){let t=i.wrap===true;let s=i.capture?"":"?:";return t?`(${s}${e.join("|")})`:e.join("|")}return re(e,t,i)};const rangeError=(...e)=>new RangeError("Invalid range arguments: "+ne.inspect(...e));const invalidRange=(e,t,i)=>{if(i.strictRanges===true)throw rangeError([e,t]);return[]};const invalidStep=(e,t)=>{if(t.strictRanges===true){throw new TypeError(`Expected step "${e}" to be a number`)}return[]};const fillNumbers=(e,t,i=1,s={})=>{let n=Number(e);let r=Number(t);if(!Number.isInteger(n)||!Number.isInteger(r)){if(s.strictRanges===true)throw rangeError([e,t]);return[]}if(n===0)n=0;if(r===0)r=0;let o=n>r;let l=String(e);let c=String(t);let u=String(i);i=Math.max(Math.abs(i),1);let h=zeros(l)||zeros(c)||zeros(u);let d=h?Math.max(l.length,c.length,u.length):0;let p=h===false&&stringify$3(e,t,s)===false;let f=s.transform||transform(p);if(s.toRegex&&i===1){return toRange(toMaxLen(e,d),toMaxLen(t,d),true,s)}let m={negatives:[],positives:[]};let push=e=>m[e<0?"negatives":"positives"].push(Math.abs(e));let g=[];let y=0;while(o?n>=r:n<=r){if(s.toRegex===true&&i>1){push(n)}else{g.push(pad(f(n,y),d,p))}n=o?n-i:n+i;y++}if(s.toRegex===true){return i>1?toSequence(m,s):toRegex(g,null,{wrap:false,...s})}return g};const fillLetters=(e,t,i=1,s={})=>{if(!isNumber(e)&&e.length>1||!isNumber(t)&&t.length>1){return invalidRange(e,t,s)}let n=s.transform||(e=>String.fromCharCode(e));let r=`${e}`.charCodeAt(0);let o=`${t}`.charCodeAt(0);let l=r>o;let c=Math.min(r,o);let u=Math.max(r,o);if(s.toRegex&&i===1){return toRange(c,u,false,s)}let h=[];let d=0;while(l?r>=o:r<=o){h.push(n(r,d));r=l?r-i:r+i;d++}if(s.toRegex===true){return toRegex(h,null,{wrap:false,options:s})}return h};const fill$2=(e,t,i,s={})=>{if(t==null&&isValidValue(e)){return[e]}if(!isValidValue(e)||!isValidValue(t)){return invalidRange(e,t,s)}if(typeof i==="function"){return fill$2(e,t,1,{transform:i})}if(isObject(i)){return fill$2(e,t,0,i)}let n={...s};if(n.capture===true)n.wrap=true;i=i||n.step||1;if(!isNumber(i)){if(i!=null&&!isObject(i))return invalidStep(i,n);return fill$2(e,t,1,i)}if(isNumber(e)&&isNumber(t)){return fillNumbers(e,t,i,n)}return fillLetters(e,t,Math.max(Math.abs(i),1),n)};var oe=fill$2;const ae=oe;const le=ee;const compile$1=(e,t={})=>{let walk=(e,i={})=>{let s=le.isInvalidBrace(i);let n=e.invalid===true&&t.escapeInvalid===true;let r=s===true||n===true;let o=t.escapeInvalid===true?"\\":"";let l="";if(e.isOpen===true){return o+e.value}if(e.isClose===true){return o+e.value}if(e.type==="open"){return r?o+e.value:"("}if(e.type==="close"){return r?o+e.value:")"}if(e.type==="comma"){return e.prev.type==="comma"?"":r?e.value:"|"}if(e.value){return e.value}if(e.nodes&&e.ranges>0){let i=le.reduce(e.nodes);let s=ae(...i,{...t,wrap:false,toRegex:true});if(s.length!==0){return i.length>1&&s.length>1?`(${s})`:s}}if(e.nodes){for(let t of e.nodes){l+=walk(t,e)}}return l};return walk(e)};var ce=compile$1;const ue=oe;const he=stringify$4;const de=ee;const append=(e="",t="",i=false)=>{let s=[];e=[].concat(e);t=[].concat(t);if(!t.length)return e;if(!e.length){return i?de.flatten(t).map((e=>`{${e}}`)):t}for(let n of e){if(Array.isArray(n)){for(let e of n){s.push(append(e,t,i))}}else{for(let e of t){if(i===true&&typeof e==="string")e=`{${e}}`;s.push(Array.isArray(e)?append(n,e,i):n+e)}}}return de.flatten(s)};const expand$1=(e,t={})=>{let i=t.rangeLimit===void 0?1e3:t.rangeLimit;let walk=(e,s={})=>{e.queue=[];let n=s;let r=s.queue;while(n.type!=="brace"&&n.type!=="root"&&n.parent){n=n.parent;r=n.queue}if(e.invalid||e.dollar){r.push(append(r.pop(),he(e,t)));return}if(e.type==="brace"&&e.invalid!==true&&e.nodes.length===2){r.push(append(r.pop(),["{}"]));return}if(e.nodes&&e.ranges>0){let s=de.reduce(e.nodes);if(de.exceedsLimit(...s,t.step,i)){throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.")}let n=ue(...s,t);if(n.length===0){n=he(e,t)}r.push(append(r.pop(),n));e.nodes=[];return}let o=de.encloseBrace(e);let l=e.queue;let c=e;while(c.type!=="brace"&&c.type!=="root"&&c.parent){c=c.parent;l=c.queue}for(let t=0;t<e.nodes.length;t++){let i=e.nodes[t];if(i.type==="comma"&&e.type==="brace"){if(t===1)l.push("");l.push("");continue}if(i.type==="close"){r.push(append(r.pop(),l,o));continue}if(i.value&&i.type!=="open"){l.push(append(l.pop(),i.value));continue}if(i.nodes){walk(i,e)}}return l};return de.flatten(walk(e))};var pe=expand$1;var fe={MAX_LENGTH:1024*64,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"};const me=stringify$4;const{MAX_LENGTH:ge,CHAR_BACKSLASH:ye,CHAR_BACKTICK:Ee,CHAR_COMMA:xe,CHAR_DOT:be,CHAR_LEFT_PARENTHESES:ve,CHAR_RIGHT_PARENTHESES:Se,CHAR_LEFT_CURLY_BRACE:Ae,CHAR_RIGHT_CURLY_BRACE:we,CHAR_LEFT_SQUARE_BRACKET:Ie,CHAR_RIGHT_SQUARE_BRACKET:ke,CHAR_DOUBLE_QUOTE:Ce,CHAR_SINGLE_QUOTE:_e,CHAR_NO_BREAK_SPACE:Pe,CHAR_ZERO_WIDTH_NOBREAK_SPACE:Ne}=fe;const parse$1=(e,t={})=>{if(typeof e!=="string"){throw new TypeError("Expected a string")}let i=t||{};let s=typeof i.maxLength==="number"?Math.min(ge,i.maxLength):ge;if(e.length>s){throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${s})`)}let n={type:"root",input:e,nodes:[]};let r=[n];let o=n;let l=n;let c=0;let u=e.length;let h=0;let d=0;let p;const advance=()=>e[h++];const push=e=>{if(e.type==="text"&&l.type==="dot"){l.type="text"}if(l&&l.type==="text"&&e.type==="text"){l.value+=e.value;return}o.nodes.push(e);e.parent=o;e.prev=l;l=e;return e};push({type:"bos"});while(h<u){o=r[r.length-1];p=advance();if(p===Ne||p===Pe){continue}if(p===ye){push({type:"text",value:(t.keepEscaping?p:"")+advance()});continue}if(p===ke){push({type:"text",value:"\\"+p});continue}if(p===Ie){c++;let e;while(h<u&&(e=advance())){p+=e;if(e===Ie){c++;continue}if(e===ye){p+=advance();continue}if(e===ke){c--;if(c===0){break}}}push({type:"text",value:p});continue}if(p===ve){o=push({type:"paren",nodes:[]});r.push(o);push({type:"text",value:p});continue}if(p===Se){if(o.type!=="paren"){push({type:"text",value:p});continue}o=r.pop();push({type:"text",value:p});o=r[r.length-1];continue}if(p===Ce||p===_e||p===Ee){let e=p;let i;if(t.keepQuotes!==true){p=""}while(h<u&&(i=advance())){if(i===ye){p+=i+advance();continue}if(i===e){if(t.keepQuotes===true)p+=i;break}p+=i}push({type:"text",value:p});continue}if(p===Ae){d++;let e=l.value&&l.value.slice(-1)==="$"||o.dollar===true;let t={type:"brace",open:true,close:false,dollar:e,depth:d,commas:0,ranges:0,nodes:[]};o=push(t);r.push(o);push({type:"open",value:p});continue}if(p===we){if(o.type!=="brace"){push({type:"text",value:p});continue}let e="close";o=r.pop();o.close=true;push({type:e,value:p});d--;o=r[r.length-1];continue}if(p===xe&&d>0){if(o.ranges>0){o.ranges=0;let e=o.nodes.shift();o.nodes=[e,{type:"text",value:me(o)}]}push({type:"comma",value:p});o.commas++;continue}if(p===be&&d>0&&o.commas===0){let e=o.nodes;if(d===0||e.length===0){push({type:"text",value:p});continue}if(l.type==="dot"){o.range=[];l.value+=p;l.type="range";if(o.nodes.length!==3&&o.nodes.length!==5){o.invalid=true;o.ranges=0;l.type="text";continue}o.ranges++;o.args=[];continue}if(l.type==="range"){e.pop();let t=e[e.length-1];t.value+=l.value+p;l=t;o.ranges--;continue}push({type:"dot",value:p});continue}push({type:"text",value:p})}do{o=r.pop();if(o.type!=="root"){o.nodes.forEach((e=>{if(!e.nodes){if(e.type==="open")e.isOpen=true;if(e.type==="close")e.isClose=true;if(!e.nodes)e.type="text";e.invalid=true}}));let e=r[r.length-1];let t=e.nodes.indexOf(o);e.nodes.splice(t,1,...o.nodes)}}while(r.length>0);push({type:"eos"});return n};var Re=parse$1;const $e=stringify$4;const Oe=ce;const Te=pe;const De=Re;const braces$1=(e,t={})=>{let i=[];if(Array.isArray(e)){for(let s of e){let e=braces$1.create(s,t);if(Array.isArray(e)){i.push(...e)}else{i.push(e)}}}else{i=[].concat(braces$1.create(e,t))}if(t&&t.expand===true&&t.nodupes===true){i=[...new Set(i)]}return i};braces$1.parse=(e,t={})=>De(e,t);braces$1.stringify=(e,t={})=>{if(typeof e==="string"){return $e(braces$1.parse(e,t),t)}return $e(e,t)};braces$1.compile=(e,t={})=>{if(typeof e==="string"){e=braces$1.parse(e,t)}return Oe(e,t)};braces$1.expand=(e,t={})=>{if(typeof e==="string"){e=braces$1.parse(e,t)}let i=Te(e,t);if(t.noempty===true){i=i.filter(Boolean)}if(t.nodupes===true){i=[...new Set(i)]}return i};braces$1.create=(e,t={})=>{if(e===""||e.length<3){return[e]}return t.expand!==true?braces$1.compile(e,t):braces$1.expand(e,t)};var Me=braces$1;const Le=["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 Be=Le;const Fe=l;const Ve=Be;const ze=new Set(Ve);var isBinaryPath$1=e=>ze.has(Fe.extname(e).slice(1).toLowerCase());var je={};(function(e){const{sep:t}=l;const{platform:i}=process;const s=c;e.EV_ALL="all";e.EV_READY="ready";e.EV_ADD="add";e.EV_CHANGE="change";e.EV_ADD_DIR="addDir";e.EV_UNLINK="unlink";e.EV_UNLINK_DIR="unlinkDir";e.EV_RAW="raw";e.EV_ERROR="error";e.STR_DATA="data";e.STR_END="end";e.STR_CLOSE="close";e.FSEVENT_CREATED="created";e.FSEVENT_MODIFIED="modified";e.FSEVENT_DELETED="deleted";e.FSEVENT_MOVED="moved";e.FSEVENT_CLONED="cloned";e.FSEVENT_UNKNOWN="unknown";e.FSEVENT_TYPE_FILE="file";e.FSEVENT_TYPE_DIRECTORY="directory";e.FSEVENT_TYPE_SYMLINK="symlink";e.KEY_LISTENERS="listeners";e.KEY_ERR="errHandlers";e.KEY_RAW="rawEmitters";e.HANDLER_KEYS=[e.KEY_LISTENERS,e.KEY_ERR,e.KEY_RAW];e.DOT_SLASH=`.${t}`;e.BACK_SLASH_RE=/\\/g;e.DOUBLE_SLASH_RE=/\/\//;e.SLASH_OR_BACK_SLASH_RE=/[/\\]/;e.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/;e.REPLACER_RE=/^\.[/\\]/;e.SLASH="/";e.SLASH_SLASH="//";e.BRACE_START="{";e.BANG="!";e.ONE_DOT=".";e.TWO_DOTS="..";e.STAR="*";e.GLOBSTAR="**";e.ROOT_GLOBSTAR="/**/*";e.SLASH_GLOBSTAR="/**";e.DIR_SUFFIX="Dir";e.ANYMATCH_OPTS={dot:true};e.STRING_TYPE="string";e.FUNCTION_TYPE="function";e.EMPTY_STR="";e.EMPTY_FN=()=>{};e.IDENTITY_FN=e=>e;e.isWindows=i==="win32";e.isMacos=i==="darwin";e.isLinux=i==="linux";e.isIBMi=s.type()==="OS400"})(je);const Ue=n;const He=l;const{promisify:Ge}=r;const We=isBinaryPath$1;const{isWindows:qe,isLinux:Ke,EMPTY_FN:Ye,EMPTY_STR:Qe,KEY_LISTENERS:Xe,KEY_ERR:Ze,KEY_RAW:Je,HANDLER_KEYS:et,EV_CHANGE:tt,EV_ADD:it,EV_ADD_DIR:st,EV_ERROR:nt,STR_DATA:rt,STR_END:ot,BRACE_START:lt,STAR:ct}=je;const ut="watch";const ht=Ge(Ue.open);const dt=Ge(Ue.stat);const pt=Ge(Ue.lstat);const ft=Ge(Ue.close);const mt=Ge(Ue.realpath);const gt={lstat:pt,stat:dt};const foreach=(e,t)=>{if(e instanceof Set){e.forEach(t)}else{t(e)}};const addAndConvert=(e,t,i)=>{let s=e[t];if(!(s instanceof Set)){e[t]=s=new Set([s])}s.add(i)};const clearItem=e=>t=>{const i=e[t];if(i instanceof Set){i.clear()}else{delete e[t]}};const delFromSet=(e,t,i)=>{const s=e[t];if(s instanceof Set){s.delete(i)}else if(s===i){delete e[t]}};const isEmptySet=e=>e instanceof Set?e.size===0:!e;const yt=new Map;function createFsWatchInstance(e,t,i,s,n){const handleEvent=(t,s)=>{i(e);n(t,s,{watchedPath:e});if(s&&e!==s){fsWatchBroadcast(He.resolve(e,s),Xe,He.join(e,s))}};try{return Ue.watch(e,t,handleEvent)}catch(e){s(e)}}const fsWatchBroadcast=(e,t,i,s,n)=>{const r=yt.get(e);if(!r)return;foreach(r[t],(e=>{e(i,s,n)}))};const setFsWatchListener=(e,t,i,s)=>{const{listener:n,errHandler:r,rawEmitter:o}=s;let l=yt.get(t);let c;if(!i.persistent){c=createFsWatchInstance(e,i,n,r,o);return c.close.bind(c)}if(l){addAndConvert(l,Xe,n);addAndConvert(l,Ze,r);addAndConvert(l,Je,o)}else{c=createFsWatchInstance(e,i,fsWatchBroadcast.bind(null,t,Xe),r,fsWatchBroadcast.bind(null,t,Je));if(!c)return;c.on(nt,(async i=>{const s=fsWatchBroadcast.bind(null,t,Ze);l.watcherUnusable=true;if(qe&&i.code==="EPERM"){try{const t=await ht(e,"r");await ft(t);s(i)}catch(e){}}else{s(i)}}));l={listeners:n,errHandlers:r,rawEmitters:o,watcher:c};yt.set(t,l)}return()=>{delFromSet(l,Xe,n);delFromSet(l,Ze,r);delFromSet(l,Je,o);if(isEmptySet(l.listeners)){l.watcher.close();yt.delete(t);et.forEach(clearItem(l));l.watcher=undefined;Object.freeze(l)}}};const Et=new Map;const setFsWatchFileListener=(e,t,i,s)=>{const{listener:n,rawEmitter:r}=s;let o=Et.get(t);const l=o&&o.options;if(l&&(l.persistent<i.persistent||l.interval>i.interval)){Ue.unwatchFile(t);o=undefined}if(o){addAndConvert(o,Xe,n);addAndConvert(o,Je,r)}else{o={listeners:n,rawEmitters:r,options:i,watcher:Ue.watchFile(t,i,((i,s)=>{foreach(o.rawEmitters,(e=>{e(tt,t,{curr:i,prev:s})}));const n=i.mtimeMs;if(i.size!==s.size||n>s.mtimeMs||n===0){foreach(o.listeners,(t=>t(e,i)))}}))};Et.set(t,o)}return()=>{delFromSet(o,Xe,n);delFromSet(o,Je,r);if(isEmptySet(o.listeners)){Et.delete(t);Ue.unwatchFile(t);o.options=o.watcher=undefined;Object.freeze(o)}}};let xt=class NodeFsHandler{constructor(e){this.fsw=e;this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,t){const i=this.fsw.options;const s=He.dirname(e);const n=He.basename(e);const r=this.fsw._getWatchedDir(s);r.add(n);const o=He.resolve(e);const l={persistent:i.persistent};if(!t)t=Ye;let c;if(i.usePolling){l.interval=i.enableBinaryInterval&&We(n)?i.binaryInterval:i.interval;c=setFsWatchFileListener(e,o,l,{listener:t,rawEmitter:this.fsw._emitRaw})}else{c=setFsWatchListener(e,o,l,{listener:t,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw})}return c}_handleFile(e,t,i){if(this.fsw.closed){return}const s=He.dirname(e);const n=He.basename(e);const r=this.fsw._getWatchedDir(s);let o=t;if(r.has(n))return;const listener=async(t,i)=>{if(!this.fsw._throttle(ut,e,5))return;if(!i||i.mtimeMs===0){try{const i=await dt(e);if(this.fsw.closed)return;const s=i.atimeMs;const n=i.mtimeMs;if(!s||s<=n||n!==o.mtimeMs){this.fsw._emit(tt,e,i)}if(Ke&&o.ino!==i.ino){this.fsw._closeFile(t);o=i;this.fsw._addPathCloser(t,this._watchWithNodeFs(e,listener))}else{o=i}}catch(e){this.fsw._remove(s,n)}}else if(r.has(n)){const t=i.atimeMs;const s=i.mtimeMs;if(!t||t<=s||s!==o.mtimeMs){this.fsw._emit(tt,e,i)}o=i}};const l=this._watchWithNodeFs(e,listener);if(!(i&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(it,e,0))return;this.fsw._emit(it,e,t)}return l}async _handleSymlink(e,t,i,s){if(this.fsw.closed){return}const n=e.fullPath;const r=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let t;try{t=await mt(i)}catch(e){this.fsw._emitReady();return true}if(this.fsw.closed)return;if(r.has(s)){if(this.fsw._symlinkPaths.get(n)!==t){this.fsw._symlinkPaths.set(n,t);this.fsw._emit(tt,i,e.stats)}}else{r.add(s);this.fsw._symlinkPaths.set(n,t);this.fsw._emit(it,i,e.stats)}this.fsw._emitReady();return true}if(this.fsw._symlinkPaths.has(n)){return true}this.fsw._symlinkPaths.set(n,true)}_handleRead(e,t,i,s,n,r,o){e=He.join(e,Qe);if(!i.hasGlob){o=this.fsw._throttle("readdir",e,1e3);if(!o)return}const l=this.fsw._getWatchedDir(i.path);const c=new Set;let u=this.fsw._readdirp(e,{fileFilter:e=>i.filterPath(e),directoryFilter:e=>i.filterDir(e),depth:0}).on(rt,(async o=>{if(this.fsw.closed){u=undefined;return}const h=o.path;let d=He.join(e,h);c.add(h);if(o.stats.isSymbolicLink()&&await this._handleSymlink(o,e,d,h)){return}if(this.fsw.closed){u=undefined;return}if(h===s||!s&&!l.has(h)){this.fsw._incrReadyCount();d=He.join(n,He.relative(n,d));this._addToNodeFs(d,t,i,r+1)}})).on(nt,this._boundHandleError);return new Promise((t=>u.once(ot,(()=>{if(this.fsw.closed){u=undefined;return}const h=o?o.clear():false;t();l.getChildren().filter((t=>t!==e&&!c.has(t)&&(!i.hasGlob||i.filterPath({fullPath:He.resolve(e,t)})))).forEach((t=>{this.fsw._remove(e,t)}));u=undefined;if(h)this._handleRead(e,false,i,s,n,r,o)}))))}async _handleDir(e,t,i,s,n,r,o){const l=this.fsw._getWatchedDir(He.dirname(e));const c=l.has(He.basename(e));if(!(i&&this.fsw.options.ignoreInitial)&&!n&&!c){if(!r.hasGlob||r.globFilter(e))this.fsw._emit(st,e,t)}l.add(He.basename(e));this.fsw._getWatchedDir(e);let u;let h;const d=this.fsw.options.depth;if((d==null||s<=d)&&!this.fsw._symlinkPaths.has(o)){if(!n){await this._handleRead(e,i,r,n,e,s,u);if(this.fsw.closed)return}h=this._watchWithNodeFs(e,((t,i)=>{if(i&&i.mtimeMs===0)return;this._handleRead(t,false,r,n,e,s,u)}))}return h}async _addToNodeFs(e,t,i,s,n){const r=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed){r();return false}const o=this.fsw._getWatchHelpers(e,s);if(!o.hasGlob&&i){o.hasGlob=i.hasGlob;o.globFilter=i.globFilter;o.filterPath=e=>i.filterPath(e);o.filterDir=e=>i.filterDir(e)}try{const i=await gt[o.statMethod](o.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(o.watchPath,i)){r();return false}const l=this.fsw.options.followSymlinks&&!e.includes(ct)&&!e.includes(lt);let c;if(i.isDirectory()){const r=He.resolve(e);const u=l?await mt(e):e;if(this.fsw.closed)return;c=await this._handleDir(o.watchPath,i,t,s,n,o,u);if(this.fsw.closed)return;if(r!==u&&u!==undefined){this.fsw._symlinkPaths.set(r,u)}}else if(i.isSymbolicLink()){const n=l?await mt(e):e;if(this.fsw.closed)return;const r=He.dirname(o.watchPath);this.fsw._getWatchedDir(r).add(o.watchPath);this.fsw._emit(it,o.watchPath,i);c=await this._handleDir(r,i,t,s,e,o,n);if(this.fsw.closed)return;if(n!==undefined){this.fsw._symlinkPaths.set(He.resolve(e),n)}}else{c=this._handleFile(o.watchPath,i,t)}r();this.fsw._addPathCloser(e,c);return false}catch(t){if(this.fsw._handleError(t)){r();return e}}}};var bt=xt;var vt={exports:{}};const St=s.getAugmentedNamespace(u.fseventsImporter);const At=n;const wt=l;const{promisify:It}=r;let kt;try{kt=St.getFsEvents()}catch(e){if(process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR)console.error(e)}if(kt){const e=process.version.match(/v(\d+)\.(\d+)/);if(e&&e[1]&&e[2]){const t=Number.parseInt(e[1],10);const i=Number.parseInt(e[2],10);if(t===8&&i<16){kt=undefined}}}const{EV_ADD:Ct,EV_CHANGE:_t,EV_ADD_DIR:Pt,EV_UNLINK:Nt,EV_ERROR:Rt,STR_DATA:$t,STR_END:Ot,FSEVENT_CREATED:Tt,FSEVENT_MODIFIED:Dt,FSEVENT_DELETED:Mt,FSEVENT_MOVED:Lt,FSEVENT_UNKNOWN:Bt,FSEVENT_TYPE_FILE:Ft,FSEVENT_TYPE_DIRECTORY:Vt,FSEVENT_TYPE_SYMLINK:zt,ROOT_GLOBSTAR:jt,DIR_SUFFIX:Ut,DOT_SLASH:Ht,FUNCTION_TYPE:Gt,EMPTY_FN:Wt,IDENTITY_FN:qt}=je;const Depth=e=>isNaN(e)?{}:{depth:e};const Kt=It(At.stat);const Yt=It(At.lstat);const Qt=It(At.realpath);const Xt={stat:Kt,lstat:Yt};const Zt=new Map;const Jt=10;const ei=new Set([69888,70400,71424,72704,73472,131328,131840,262912]);const createFSEventsInstance=(e,t)=>{const i=kt.watch(e,t);return{stop:i}};function setFSEventsListener(e,t,i,s){let n=wt.extname(t)?wt.dirname(t):t;const r=wt.dirname(n);let o=Zt.get(n);if(couldConsolidate(r)){n=r}const l=wt.resolve(e);const c=l!==t;const filteredListener=(e,s,n)=>{if(c)e=e.replace(t,l);if(e===l||!e.indexOf(l+wt.sep))i(e,s,n)};let u=false;for(const e of Zt.keys()){if(t.indexOf(wt.resolve(e)+wt.sep)===0){n=e;o=Zt.get(n);u=true;break}}if(o||u){o.listeners.add(filteredListener)}else{o={listeners:new Set([filteredListener]),rawEmitter:s,watcher:createFSEventsInstance(n,((e,t)=>{if(!o.listeners.size)return;const i=kt.getInfo(e,t);o.listeners.forEach((s=>{s(e,t,i)}));o.rawEmitter(i.event,e,i)}))};Zt.set(n,o)}return()=>{const e=o.listeners;e.delete(filteredListener);if(!e.size){Zt.delete(n);if(o.watcher)return o.watcher.stop().then((()=>{o.rawEmitter=o.watcher=undefined;Object.freeze(o)}))}}}const couldConsolidate=e=>{let t=0;for(const i of Zt.keys()){if(i.indexOf(e)===0){t++;if(t>=Jt){return true}}}return false};const canUse=()=>kt&&Zt.size<128;const calcDepth=(e,t)=>{let i=0;while(!e.indexOf(t)&&(e=wt.dirname(e))!==t)i++;return i};const sameTypes=(e,t)=>e.type===Vt&&t.isDirectory()||e.type===zt&&t.isSymbolicLink()||e.type===Ft&&t.isFile();let ti=class FsEventsHandler{constructor(e){this.fsw=e}checkIgnored(e,t){const i=this.fsw._ignoredPaths;if(this.fsw._isIgnored(e,t)){i.add(e);if(t&&t.isDirectory()){i.add(e+jt)}return true}i.delete(e);i.delete(e+jt)}addOrChange(e,t,i,s,n,r,o,l){const c=n.has(r)?_t:Ct;this.handleEvent(c,e,t,i,s,n,r,o,l)}async checkExists(e,t,i,s,n,r,o,l){try{const c=await Kt(e);if(this.fsw.closed)return;if(sameTypes(o,c)){this.addOrChange(e,t,i,s,n,r,o,l)}else{this.handleEvent(Nt,e,t,i,s,n,r,o,l)}}catch(c){if(c.code==="EACCES"){this.addOrChange(e,t,i,s,n,r,o,l)}else{this.handleEvent(Nt,e,t,i,s,n,r,o,l)}}}handleEvent(e,t,i,s,n,r,o,l,c){if(this.fsw.closed||this.checkIgnored(t))return;if(e===Nt){const e=l.type===Vt;if(e||r.has(o)){this.fsw._remove(n,o,e)}}else{if(e===Ct){if(l.type===Vt)this.fsw._getWatchedDir(t);if(l.type===zt&&c.followSymlinks){const e=c.depth===undefined?undefined:calcDepth(i,s)+1;return this._addToFsEvents(t,false,true,e)}this.fsw._getWatchedDir(n).add(o)}const r=l.type===Vt?e+Ut:e;this.fsw._emit(r,t);if(r===Pt)this._addToFsEvents(t,false,true)}}_watchWithFsEvents(e,t,i,s){if(this.fsw.closed||this.fsw._isIgnored(e))return;const n=this.fsw.options;const watchCallback=async(r,o,l)=>{if(this.fsw.closed)return;if(n.depth!==undefined&&calcDepth(r,t)>n.depth)return;const c=i(wt.join(e,wt.relative(e,r)));if(s&&!s(c))return;const u=wt.dirname(c);const h=wt.basename(c);const d=this.fsw._getWatchedDir(l.type===Vt?c:u);if(ei.has(o)||l.event===Bt){if(typeof n.ignored===Gt){let e;try{e=await Kt(c)}catch(e){}if(this.fsw.closed)return;if(this.checkIgnored(c,e))return;if(sameTypes(l,e)){this.addOrChange(c,r,t,u,d,h,l,n)}else{this.handleEvent(Nt,c,r,t,u,d,h,l,n)}}else{this.checkExists(c,r,t,u,d,h,l,n)}}else{switch(l.event){case Tt:case Dt:return this.addOrChange(c,r,t,u,d,h,l,n);case Mt:case Lt:return this.checkExists(c,r,t,u,d,h,l,n)}}};const r=setFSEventsListener(e,t,watchCallback,this.fsw._emitRaw);this.fsw._emitReady();return r}async _handleFsEventsSymlink(e,t,i,s){if(this.fsw.closed||this.fsw._symlinkPaths.has(t))return;this.fsw._symlinkPaths.set(t,true);this.fsw._incrReadyCount();try{const t=await Qt(e);if(this.fsw.closed)return;if(this.fsw._isIgnored(t)){return this.fsw._emitReady()}this.fsw._incrReadyCount();this._addToFsEvents(t||e,(s=>{let n=e;if(t&&t!==Ht){n=s.replace(t,e)}else if(s!==Ht){n=wt.join(e,s)}return i(n)}),false,s)}catch(e){if(this.fsw._handleError(e)){return this.fsw._emitReady()}}}emitAdd(e,t,i,s,n){const r=i(e);const o=t.isDirectory();const l=this.fsw._getWatchedDir(wt.dirname(r));const c=wt.basename(r);if(o)this.fsw._getWatchedDir(r);if(l.has(c))return;l.add(c);if(!s.ignoreInitial||n===true){this.fsw._emit(o?Pt:Ct,r,t)}}initWatch(e,t,i,s){if(this.fsw.closed)return;const n=this._watchWithFsEvents(i.watchPath,wt.resolve(e||i.watchPath),s,i.globFilter);this.fsw._addPathCloser(t,n)}async _addToFsEvents(e,t,i,s){if(this.fsw.closed){return}const n=this.fsw.options;const r=typeof t===Gt?t:qt;const o=this.fsw._getWatchHelpers(e);try{const t=await Xt[o.statMethod](o.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(o.watchPath,t)){throw null}if(t.isDirectory()){if(!o.globFilter)this.emitAdd(r(e),t,r,n,i);if(s&&s>n.depth)return;this.fsw._readdirp(o.watchPath,{fileFilter:e=>o.filterPath(e),directoryFilter:e=>o.filterDir(e),...Depth(n.depth-(s||0))}).on($t,(e=>{if(this.fsw.closed){return}if(e.stats.isDirectory()&&!o.filterPath(e))return;const t=wt.join(o.watchPath,e.path);const{fullPath:s}=e;if(o.followSymlinks&&e.stats.isSymbolicLink()){const e=n.depth===undefined?undefined:calcDepth(t,wt.resolve(o.watchPath))+1;this._handleFsEventsSymlink(t,s,r,e)}else{this.emitAdd(t,e.stats,r,n,i)}})).on(Rt,Wt).on(Ot,(()=>{this.fsw._emitReady()}))}else{this.emitAdd(o.watchPath,t,r,n,i);this.fsw._emitReady()}}catch(e){if(!e||this.fsw._handleError(e)){this.fsw._emitReady();this.fsw._emitReady()}}if(n.persistent&&i!==true){if(typeof t===Gt){this.initWatch(undefined,e,o,r)}else{let t;try{t=await Qt(o.watchPath)}catch(e){}this.initWatch(t,e,o,r)}}}};vt.exports=ti;vt.exports.canUse=canUse;var ii=vt.exports;const{EventEmitter:si}=h;const ni=n;const ri=l;const{promisify:oi}=r;const ai=O;const li=V.default;const ci=J;const ui=H;const hi=Me;const di=normalizePath$2;const pi=bt;const fi=ii;const{EV_ALL:mi,EV_READY:gi,EV_ADD:yi,EV_CHANGE:Ei,EV_UNLINK:xi,EV_ADD_DIR:bi,EV_UNLINK_DIR:vi,EV_RAW:Si,EV_ERROR:Ai,STR_CLOSE:wi,STR_END:Ii,BACK_SLASH_RE:ki,DOUBLE_SLASH_RE:Ci,SLASH_OR_BACK_SLASH_RE:_i,DOT_RE:Pi,REPLACER_RE:Ni,SLASH:Ri,SLASH_SLASH:$i,BRACE_START:Oi,BANG:Ti,ONE_DOT:Di,TWO_DOTS:Mi,GLOBSTAR:Li,SLASH_GLOBSTAR:Bi,ANYMATCH_OPTS:Fi,STRING_TYPE:Vi,FUNCTION_TYPE:zi,EMPTY_STR:ji,EMPTY_FN:Ui,isWindows:Hi,isMacos:Gi,isIBMi:Wi}=je;const qi=oi(ni.stat);const Ki=oi(ni.readdir);const arrify=(e=[])=>Array.isArray(e)?e:[e];const flatten=(e,t=[])=>{e.forEach((e=>{if(Array.isArray(e)){flatten(e,t)}else{t.push(e)}}));return t};const unifyPaths=e=>{const t=flatten(arrify(e));if(!t.every((e=>typeof e===Vi))){throw new TypeError(`Non-string provided as watch path: ${t}`)}return t.map(normalizePathToUnix)};const toUnix=e=>{let t=e.replace(ki,Ri);let i=false;if(t.startsWith($i)){i=true}while(t.match(Ci)){t=t.replace(Ci,Ri)}if(i){t=Ri+t}return t};const normalizePathToUnix=e=>toUnix(ri.normalize(toUnix(e)));const normalizeIgnored=(e=ji)=>t=>{if(typeof t!==Vi)return t;return normalizePathToUnix(ri.isAbsolute(t)?t:ri.join(e,t))};const getAbsolutePath=(e,t)=>{if(ri.isAbsolute(e)){return e}if(e.startsWith(Ti)){return Ti+ri.join(t,e.slice(1))}return ri.join(t,e)};const undef=(e,t)=>e[t]===undefined;class DirEntry{constructor(e,t){this.path=e;this._removeWatcher=t;this.items=new Set}add(e){const{items:t}=this;if(!t)return;if(e!==Di&&e!==Mi)t.add(e)}async remove(e){const{items:t}=this;if(!t)return;t.delete(e);if(t.size>0)return;const i=this.path;try{await Ki(i)}catch(e){if(this._removeWatcher){this._removeWatcher(ri.dirname(i),ri.basename(i))}}}has(e){const{items:t}=this;if(!t)return;return t.has(e)}getChildren(){const{items:e}=this;if(!e)return;return[...e.values()]}dispose(){this.items.clear();delete this.path;delete this._removeWatcher;delete this.items;Object.freeze(this)}}const Yi="stat";const Qi="lstat";class WatchHelper{constructor(e,t,i,s){this.fsw=s;this.path=e=e.replace(Ni,ji);this.watchPath=t;this.fullWatchPath=ri.resolve(t);this.hasGlob=t!==e;if(e===ji)this.hasGlob=false;this.globSymlink=this.hasGlob&&i?undefined:false;this.globFilter=this.hasGlob?li(e,undefined,Fi):false;this.dirParts=this.getDirParts(e);this.dirParts.forEach((e=>{if(e.length>1)e.pop()}));this.followSymlinks=i;this.statMethod=i?Yi:Qi}checkGlobSymlink(e){if(this.globSymlink===undefined){this.globSymlink=e.fullParentDir===this.fullWatchPath?false:{realPath:e.fullParentDir,linkPath:this.fullWatchPath}}if(this.globSymlink){return e.fullPath.replace(this.globSymlink.realPath,this.globSymlink.linkPath)}return e.fullPath}entryPath(e){return ri.join(this.watchPath,ri.relative(this.watchPath,this.checkGlobSymlink(e)))}filterPath(e){const{stats:t}=e;if(t&&t.isSymbolicLink())return this.filterDir(e);const i=this.entryPath(e);const s=this.hasGlob&&typeof this.globFilter===zi?this.globFilter(i):true;return s&&this.fsw._isntIgnored(i,t)&&this.fsw._hasReadPermissions(t)}getDirParts(e){if(!this.hasGlob)return[];const t=[];const i=e.includes(Oi)?hi.expand(e):[e];i.forEach((e=>{t.push(ri.relative(this.watchPath,e).split(_i))}));return t}filterDir(e){if(this.hasGlob){const t=this.getDirParts(this.checkGlobSymlink(e));let i=false;this.unmatchedGlob=!this.dirParts.some((e=>e.every(((e,s)=>{if(e===Li)i=true;return i||!t[0][s]||li(e,t[0][s],Fi)}))))}return!this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}}class FSWatcher extends si{constructor(e){super();const t={};if(e)Object.assign(t,e);this._watched=new Map;this._closers=new Map;this._ignoredPaths=new Set;this._throttled=new Map;this._symlinkPaths=new Map;this._streams=new Set;this.closed=false;if(undef(t,"persistent"))t.persistent=true;if(undef(t,"ignoreInitial"))t.ignoreInitial=false;if(undef(t,"ignorePermissionErrors"))t.ignorePermissionErrors=false;if(undef(t,"interval"))t.interval=100;if(undef(t,"binaryInterval"))t.binaryInterval=300;if(undef(t,"disableGlobbing"))t.disableGlobbing=false;t.enableBinaryInterval=t.binaryInterval!==t.interval;if(undef(t,"useFsEvents"))t.useFsEvents=!t.usePolling;const i=fi.canUse();if(!i)t.useFsEvents=false;if(undef(t,"usePolling")&&!t.useFsEvents){t.usePolling=Gi}if(Wi){t.usePolling=true}const s=process.env.CHOKIDAR_USEPOLLING;if(s!==undefined){const e=s.toLowerCase();if(e==="false"||e==="0"){t.usePolling=false}else if(e==="true"||e==="1"){t.usePolling=true}else{t.usePolling=!!e}}const n=process.env.CHOKIDAR_INTERVAL;if(n){t.interval=Number.parseInt(n,10)}if(undef(t,"atomic"))t.atomic=!t.usePolling&&!t.useFsEvents;if(t.atomic)this._pendingUnlinks=new Map;if(undef(t,"followSymlinks"))t.followSymlinks=true;if(undef(t,"awaitWriteFinish"))t.awaitWriteFinish=false;if(t.awaitWriteFinish===true)t.awaitWriteFinish={};const r=t.awaitWriteFinish;if(r){if(!r.stabilityThreshold)r.stabilityThreshold=2e3;if(!r.pollInterval)r.pollInterval=100;this._pendingWrites=new Map}if(t.ignored)t.ignored=arrify(t.ignored);let o=0;this._emitReady=()=>{o++;if(o>=this._readyCount){this._emitReady=Ui;this._readyEmitted=true;process.nextTick((()=>this.emit(gi)))}};this._emitRaw=(...e)=>this.emit(Si,...e);this._readyEmitted=false;this.options=t;if(t.useFsEvents){this._fsEventsHandler=new fi(this)}else{this._nodeFsHandler=new pi(this)}Object.freeze(t)}add(e,t,i){const{cwd:s,disableGlobbing:n}=this.options;this.closed=false;let r=unifyPaths(e);if(s){r=r.map((e=>{const t=getAbsolutePath(e,s);if(n||!ui(e)){return t}return di(t)}))}r=r.filter((e=>{if(e.startsWith(Ti)){this._ignoredPaths.add(e.slice(1));return false}this._ignoredPaths.delete(e);this._ignoredPaths.delete(e+Bi);this._userIgnored=undefined;return true}));if(this.options.useFsEvents&&this._fsEventsHandler){if(!this._readyCount)this._readyCount=r.length;if(this.options.persistent)this._readyCount*=2;r.forEach((e=>this._fsEventsHandler._addToFsEvents(e)))}else{if(!this._readyCount)this._readyCount=0;this._readyCount+=r.length;Promise.all(r.map((async e=>{const s=await this._nodeFsHandler._addToNodeFs(e,!i,0,0,t);if(s)this._emitReady();return s}))).then((e=>{if(this.closed)return;e.filter((e=>e)).forEach((e=>{this.add(ri.dirname(e),ri.basename(t||e))}))}))}return this}unwatch(e){if(this.closed)return this;const t=unifyPaths(e);const{cwd:i}=this.options;t.forEach((e=>{if(!ri.isAbsolute(e)&&!this._closers.has(e)){if(i)e=ri.join(i,e);e=ri.resolve(e)}this._closePath(e);this._ignoredPaths.add(e);if(this._watched.has(e)){this._ignoredPaths.add(e+Bi)}this._userIgnored=undefined}));return this}close(){if(this.closed)return this._closePromise;this.closed=true;this.removeAllListeners();const e=[];this._closers.forEach((t=>t.forEach((t=>{const i=t();if(i instanceof Promise)e.push(i)}))));this._streams.forEach((e=>e.destroy()));this._userIgnored=undefined;this._readyCount=0;this._readyEmitted=false;this._watched.forEach((e=>e.dispose()));["closers","watched","streams","symlinkPaths","throttled"].forEach((e=>{this[`_${e}`].clear()}));this._closePromise=e.length?Promise.all(e).then((()=>undefined)):Promise.resolve();return this._closePromise}getWatched(){const e={};this._watched.forEach(((t,i)=>{const s=this.options.cwd?ri.relative(this.options.cwd,i):i;e[s||Di]=t.getChildren().sort()}));return e}emitWithAll(e,t){this.emit(...t);if(e!==Ai)this.emit(mi,...t)}async _emit(e,t,i,s,n){if(this.closed)return;const r=this.options;if(Hi)t=ri.normalize(t);if(r.cwd)t=ri.relative(r.cwd,t);const o=[e,t];if(n!==undefined)o.push(i,s,n);else if(s!==undefined)o.push(i,s);else if(i!==undefined)o.push(i);const l=r.awaitWriteFinish;let c;if(l&&(c=this._pendingWrites.get(t))){c.lastChange=new Date;return this}if(r.atomic){if(e===xi){this._pendingUnlinks.set(t,o);setTimeout((()=>{this._pendingUnlinks.forEach(((e,t)=>{this.emit(...e);this.emit(mi,...e);this._pendingUnlinks.delete(t)}))}),typeof r.atomic==="number"?r.atomic:100);return this}if(e===yi&&this._pendingUnlinks.has(t)){e=o[0]=Ei;this._pendingUnlinks.delete(t)}}if(l&&(e===yi||e===Ei)&&this._readyEmitted){const awfEmit=(t,i)=>{if(t){e=o[0]=Ai;o[1]=t;this.emitWithAll(e,o)}else if(i){if(o.length>2){o[2]=i}else{o.push(i)}this.emitWithAll(e,o)}};this._awaitWriteFinish(t,l.stabilityThreshold,e,awfEmit);return this}if(e===Ei){const e=!this._throttle(Ei,t,50);if(e)return this}if(r.alwaysStat&&i===undefined&&(e===yi||e===bi||e===Ei)){const e=r.cwd?ri.join(r.cwd,t):t;let i;try{i=await qi(e)}catch(e){}if(!i||this.closed)return;o.push(i)}this.emitWithAll(e,o);return this}_handleError(e){const t=e&&e.code;if(e&&t!=="ENOENT"&&t!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||t!=="EPERM"&&t!=="EACCES")){this.emit(Ai,e)}return e||this.closed}_throttle(e,t,i){if(!this._throttled.has(e)){this._throttled.set(e,new Map)}const s=this._throttled.get(e);const n=s.get(t);if(n){n.count++;return false}let r;const clear=()=>{const e=s.get(t);const i=e?e.count:0;s.delete(t);clearTimeout(r);if(e)clearTimeout(e.timeoutObject);return i};r=setTimeout(clear,i);const o={timeoutObject:r,clear:clear,count:0};s.set(t,o);return o}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,t,i,s){let n;let r=e;if(this.options.cwd&&!ri.isAbsolute(e)){r=ri.join(this.options.cwd,e)}const o=new Date;const awaitWriteFinish=i=>{ni.stat(r,((r,o)=>{if(r||!this._pendingWrites.has(e)){if(r&&r.code!=="ENOENT")s(r);return}const l=Number(new Date);if(i&&o.size!==i.size){this._pendingWrites.get(e).lastChange=l}const c=this._pendingWrites.get(e);const u=l-c.lastChange;if(u>=t){this._pendingWrites.delete(e);s(undefined,o)}else{n=setTimeout(awaitWriteFinish,this.options.awaitWriteFinish.pollInterval,o)}}))};if(!this._pendingWrites.has(e)){this._pendingWrites.set(e,{lastChange:o,cancelWait:()=>{this._pendingWrites.delete(e);clearTimeout(n);return i}});n=setTimeout(awaitWriteFinish,this.options.awaitWriteFinish.pollInterval)}}_getGlobIgnored(){return[...this._ignoredPaths.values()]}_isIgnored(e,t){if(this.options.atomic&&Pi.test(e))return true;if(!this._userIgnored){const{cwd:e}=this.options;const t=this.options.ignored;const i=t&&t.map(normalizeIgnored(e));const s=arrify(i).filter((e=>typeof e===Vi&&!ui(e))).map((e=>e+Bi));const n=this._getGlobIgnored().map(normalizeIgnored(e)).concat(i,s);this._userIgnored=li(n,undefined,Fi)}return this._userIgnored([e,t])}_isntIgnored(e,t){return!this._isIgnored(e,t)}_getWatchHelpers(e,t){const i=t||this.options.disableGlobbing||!ui(e)?e:ci(e);const s=this.options.followSymlinks;return new WatchHelper(e,i,s,this)}_getWatchedDir(e){if(!this._boundRemove)this._boundRemove=this._remove.bind(this);const t=ri.resolve(e);if(!this._watched.has(t))this._watched.set(t,new DirEntry(t,this._boundRemove));return this._watched.get(t)}_hasReadPermissions(e){if(this.options.ignorePermissionErrors)return true;const t=e&&Number.parseInt(e.mode,10);const i=t&511;const s=Number.parseInt(i.toString(8)[0],10);return Boolean(4&s)}_remove(e,t,i){const s=ri.join(e,t);const n=ri.resolve(s);i=i!=null?i:this._watched.has(s)||this._watched.has(n);if(!this._throttle("remove",s,100))return;if(!i&&!this.options.useFsEvents&&this._watched.size===1){this.add(e,t,true)}const r=this._getWatchedDir(s);const o=r.getChildren();o.forEach((e=>this._remove(s,e)));const l=this._getWatchedDir(e);const c=l.has(t);l.remove(t);if(this._symlinkPaths.has(n)){this._symlinkPaths.delete(n)}let u=s;if(this.options.cwd)u=ri.relative(this.options.cwd,s);if(this.options.awaitWriteFinish&&this._pendingWrites.has(u)){const e=this._pendingWrites.get(u).cancelWait();if(e===yi)return}this._watched.delete(s);this._watched.delete(n);const h=i?vi:xi;if(c&&!this._isIgnored(s))this._emit(h,s);if(!this.options.useFsEvents){this._closePath(s)}}_closePath(e){this._closeFile(e);const t=ri.dirname(e);this._getWatchedDir(t).remove(ri.basename(e))}_closeFile(e){const t=this._closers.get(e);if(!t)return;t.forEach((e=>e()));this._closers.delete(e)}_addPathCloser(e,t){if(!t)return;let i=this._closers.get(e);if(!i){i=[];this._closers.set(e,i)}i.push(t)}_readdirp(e,t){if(this.closed)return;const i={type:mi,alwaysStat:true,lstat:true,...t};let s=ai(e,i);this._streams.add(s);s.once(wi,(()=>{s=undefined}));s.once(Ii,(()=>{if(s){this._streams.delete(s);s=undefined}}));return s}}d.FSWatcher=FSWatcher;const watch=(e,t)=>{const i=new FSWatcher(t);i.add(e);return i};d.watch=watch;t.chokidar=d},194:(e,t,i)=>{
|
|
67
|
+
*/const ne=r;const re=se;const isObject=e=>e!==null&&typeof e==="object"&&!Array.isArray(e);const transform=e=>t=>e===true?Number(t):String(t);const isValidValue=e=>typeof e==="number"||typeof e==="string"&&e!=="";const isNumber=e=>Number.isInteger(+e);const zeros=e=>{let t=`${e}`;let i=-1;if(t[0]==="-")t=t.slice(1);if(t==="0")return false;while(t[++i]==="0");return i>0};const stringify$3=(e,t,i)=>{if(typeof e==="string"||typeof t==="string"){return true}return i.stringify===true};const pad=(e,t,i)=>{if(t>0){let i=e[0]==="-"?"-":"";if(i)e=e.slice(1);e=i+e.padStart(i?t-1:t,"0")}if(i===false){return String(e)}return e};const toMaxLen=(e,t)=>{let i=e[0]==="-"?"-":"";if(i){e=e.slice(1);t--}while(e.length<t)e="0"+e;return i?"-"+e:e};const toSequence=(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 i=t.capture?"":"?:";let s="";let n="";let r;if(e.positives.length){s=e.positives.join("|")}if(e.negatives.length){n=`-(${i}${e.negatives.join("|")})`}if(s&&n){r=`${s}|${n}`}else{r=s||n}if(t.wrap){return`(${i}${r})`}return r};const toRange=(e,t,i,s)=>{if(i){return re(e,t,{wrap:false,...s})}let n=String.fromCharCode(e);if(e===t)return n;let r=String.fromCharCode(t);return`[${n}-${r}]`};const toRegex=(e,t,i)=>{if(Array.isArray(e)){let t=i.wrap===true;let s=i.capture?"":"?:";return t?`(${s}${e.join("|")})`:e.join("|")}return re(e,t,i)};const rangeError=(...e)=>new RangeError("Invalid range arguments: "+ne.inspect(...e));const invalidRange=(e,t,i)=>{if(i.strictRanges===true)throw rangeError([e,t]);return[]};const invalidStep=(e,t)=>{if(t.strictRanges===true){throw new TypeError(`Expected step "${e}" to be a number`)}return[]};const fillNumbers=(e,t,i=1,s={})=>{let n=Number(e);let r=Number(t);if(!Number.isInteger(n)||!Number.isInteger(r)){if(s.strictRanges===true)throw rangeError([e,t]);return[]}if(n===0)n=0;if(r===0)r=0;let o=n>r;let l=String(e);let c=String(t);let u=String(i);i=Math.max(Math.abs(i),1);let h=zeros(l)||zeros(c)||zeros(u);let d=h?Math.max(l.length,c.length,u.length):0;let p=h===false&&stringify$3(e,t,s)===false;let f=s.transform||transform(p);if(s.toRegex&&i===1){return toRange(toMaxLen(e,d),toMaxLen(t,d),true,s)}let m={negatives:[],positives:[]};let push=e=>m[e<0?"negatives":"positives"].push(Math.abs(e));let g=[];let y=0;while(o?n>=r:n<=r){if(s.toRegex===true&&i>1){push(n)}else{g.push(pad(f(n,y),d,p))}n=o?n-i:n+i;y++}if(s.toRegex===true){return i>1?toSequence(m,s):toRegex(g,null,{wrap:false,...s})}return g};const fillLetters=(e,t,i=1,s={})=>{if(!isNumber(e)&&e.length>1||!isNumber(t)&&t.length>1){return invalidRange(e,t,s)}let n=s.transform||(e=>String.fromCharCode(e));let r=`${e}`.charCodeAt(0);let o=`${t}`.charCodeAt(0);let l=r>o;let c=Math.min(r,o);let u=Math.max(r,o);if(s.toRegex&&i===1){return toRange(c,u,false,s)}let h=[];let d=0;while(l?r>=o:r<=o){h.push(n(r,d));r=l?r-i:r+i;d++}if(s.toRegex===true){return toRegex(h,null,{wrap:false,options:s})}return h};const fill$2=(e,t,i,s={})=>{if(t==null&&isValidValue(e)){return[e]}if(!isValidValue(e)||!isValidValue(t)){return invalidRange(e,t,s)}if(typeof i==="function"){return fill$2(e,t,1,{transform:i})}if(isObject(i)){return fill$2(e,t,0,i)}let n={...s};if(n.capture===true)n.wrap=true;i=i||n.step||1;if(!isNumber(i)){if(i!=null&&!isObject(i))return invalidStep(i,n);return fill$2(e,t,1,i)}if(isNumber(e)&&isNumber(t)){return fillNumbers(e,t,i,n)}return fillLetters(e,t,Math.max(Math.abs(i),1),n)};var oe=fill$2;const ae=oe;const le=ee;const compile$1=(e,t={})=>{let walk=(e,i={})=>{let s=le.isInvalidBrace(i);let n=e.invalid===true&&t.escapeInvalid===true;let r=s===true||n===true;let o=t.escapeInvalid===true?"\\":"";let l="";if(e.isOpen===true){return o+e.value}if(e.isClose===true){return o+e.value}if(e.type==="open"){return r?o+e.value:"("}if(e.type==="close"){return r?o+e.value:")"}if(e.type==="comma"){return e.prev.type==="comma"?"":r?e.value:"|"}if(e.value){return e.value}if(e.nodes&&e.ranges>0){let i=le.reduce(e.nodes);let s=ae(...i,{...t,wrap:false,toRegex:true});if(s.length!==0){return i.length>1&&s.length>1?`(${s})`:s}}if(e.nodes){for(let t of e.nodes){l+=walk(t,e)}}return l};return walk(e)};var ce=compile$1;const ue=oe;const he=stringify$4;const de=ee;const append=(e="",t="",i=false)=>{let s=[];e=[].concat(e);t=[].concat(t);if(!t.length)return e;if(!e.length){return i?de.flatten(t).map((e=>`{${e}}`)):t}for(let n of e){if(Array.isArray(n)){for(let e of n){s.push(append(e,t,i))}}else{for(let e of t){if(i===true&&typeof e==="string")e=`{${e}}`;s.push(Array.isArray(e)?append(n,e,i):n+e)}}}return de.flatten(s)};const expand$1=(e,t={})=>{let i=t.rangeLimit===void 0?1e3:t.rangeLimit;let walk=(e,s={})=>{e.queue=[];let n=s;let r=s.queue;while(n.type!=="brace"&&n.type!=="root"&&n.parent){n=n.parent;r=n.queue}if(e.invalid||e.dollar){r.push(append(r.pop(),he(e,t)));return}if(e.type==="brace"&&e.invalid!==true&&e.nodes.length===2){r.push(append(r.pop(),["{}"]));return}if(e.nodes&&e.ranges>0){let s=de.reduce(e.nodes);if(de.exceedsLimit(...s,t.step,i)){throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.")}let n=ue(...s,t);if(n.length===0){n=he(e,t)}r.push(append(r.pop(),n));e.nodes=[];return}let o=de.encloseBrace(e);let l=e.queue;let c=e;while(c.type!=="brace"&&c.type!=="root"&&c.parent){c=c.parent;l=c.queue}for(let t=0;t<e.nodes.length;t++){let i=e.nodes[t];if(i.type==="comma"&&e.type==="brace"){if(t===1)l.push("");l.push("");continue}if(i.type==="close"){r.push(append(r.pop(),l,o));continue}if(i.value&&i.type!=="open"){l.push(append(l.pop(),i.value));continue}if(i.nodes){walk(i,e)}}return l};return de.flatten(walk(e))};var pe=expand$1;var fe={MAX_LENGTH:1024*64,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"};const me=stringify$4;const{MAX_LENGTH:ge,CHAR_BACKSLASH:ye,CHAR_BACKTICK:Ee,CHAR_COMMA:xe,CHAR_DOT:be,CHAR_LEFT_PARENTHESES:ve,CHAR_RIGHT_PARENTHESES:Se,CHAR_LEFT_CURLY_BRACE:Ae,CHAR_RIGHT_CURLY_BRACE:we,CHAR_LEFT_SQUARE_BRACKET:Ie,CHAR_RIGHT_SQUARE_BRACKET:Ce,CHAR_DOUBLE_QUOTE:ke,CHAR_SINGLE_QUOTE:_e,CHAR_NO_BREAK_SPACE:Pe,CHAR_ZERO_WIDTH_NOBREAK_SPACE:Ne}=fe;const parse$1=(e,t={})=>{if(typeof e!=="string"){throw new TypeError("Expected a string")}let i=t||{};let s=typeof i.maxLength==="number"?Math.min(ge,i.maxLength):ge;if(e.length>s){throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${s})`)}let n={type:"root",input:e,nodes:[]};let r=[n];let o=n;let l=n;let c=0;let u=e.length;let h=0;let d=0;let p;const advance=()=>e[h++];const push=e=>{if(e.type==="text"&&l.type==="dot"){l.type="text"}if(l&&l.type==="text"&&e.type==="text"){l.value+=e.value;return}o.nodes.push(e);e.parent=o;e.prev=l;l=e;return e};push({type:"bos"});while(h<u){o=r[r.length-1];p=advance();if(p===Ne||p===Pe){continue}if(p===ye){push({type:"text",value:(t.keepEscaping?p:"")+advance()});continue}if(p===Ce){push({type:"text",value:"\\"+p});continue}if(p===Ie){c++;let e;while(h<u&&(e=advance())){p+=e;if(e===Ie){c++;continue}if(e===ye){p+=advance();continue}if(e===Ce){c--;if(c===0){break}}}push({type:"text",value:p});continue}if(p===ve){o=push({type:"paren",nodes:[]});r.push(o);push({type:"text",value:p});continue}if(p===Se){if(o.type!=="paren"){push({type:"text",value:p});continue}o=r.pop();push({type:"text",value:p});o=r[r.length-1];continue}if(p===ke||p===_e||p===Ee){let e=p;let i;if(t.keepQuotes!==true){p=""}while(h<u&&(i=advance())){if(i===ye){p+=i+advance();continue}if(i===e){if(t.keepQuotes===true)p+=i;break}p+=i}push({type:"text",value:p});continue}if(p===Ae){d++;let e=l.value&&l.value.slice(-1)==="$"||o.dollar===true;let t={type:"brace",open:true,close:false,dollar:e,depth:d,commas:0,ranges:0,nodes:[]};o=push(t);r.push(o);push({type:"open",value:p});continue}if(p===we){if(o.type!=="brace"){push({type:"text",value:p});continue}let e="close";o=r.pop();o.close=true;push({type:e,value:p});d--;o=r[r.length-1];continue}if(p===xe&&d>0){if(o.ranges>0){o.ranges=0;let e=o.nodes.shift();o.nodes=[e,{type:"text",value:me(o)}]}push({type:"comma",value:p});o.commas++;continue}if(p===be&&d>0&&o.commas===0){let e=o.nodes;if(d===0||e.length===0){push({type:"text",value:p});continue}if(l.type==="dot"){o.range=[];l.value+=p;l.type="range";if(o.nodes.length!==3&&o.nodes.length!==5){o.invalid=true;o.ranges=0;l.type="text";continue}o.ranges++;o.args=[];continue}if(l.type==="range"){e.pop();let t=e[e.length-1];t.value+=l.value+p;l=t;o.ranges--;continue}push({type:"dot",value:p});continue}push({type:"text",value:p})}do{o=r.pop();if(o.type!=="root"){o.nodes.forEach((e=>{if(!e.nodes){if(e.type==="open")e.isOpen=true;if(e.type==="close")e.isClose=true;if(!e.nodes)e.type="text";e.invalid=true}}));let e=r[r.length-1];let t=e.nodes.indexOf(o);e.nodes.splice(t,1,...o.nodes)}}while(r.length>0);push({type:"eos"});return n};var Re=parse$1;const $e=stringify$4;const Oe=ce;const Te=pe;const De=Re;const braces$1=(e,t={})=>{let i=[];if(Array.isArray(e)){for(let s of e){let e=braces$1.create(s,t);if(Array.isArray(e)){i.push(...e)}else{i.push(e)}}}else{i=[].concat(braces$1.create(e,t))}if(t&&t.expand===true&&t.nodupes===true){i=[...new Set(i)]}return i};braces$1.parse=(e,t={})=>De(e,t);braces$1.stringify=(e,t={})=>{if(typeof e==="string"){return $e(braces$1.parse(e,t),t)}return $e(e,t)};braces$1.compile=(e,t={})=>{if(typeof e==="string"){e=braces$1.parse(e,t)}return Oe(e,t)};braces$1.expand=(e,t={})=>{if(typeof e==="string"){e=braces$1.parse(e,t)}let i=Te(e,t);if(t.noempty===true){i=i.filter(Boolean)}if(t.nodupes===true){i=[...new Set(i)]}return i};braces$1.create=(e,t={})=>{if(e===""||e.length<3){return[e]}return t.expand!==true?braces$1.compile(e,t):braces$1.expand(e,t)};var Me=braces$1;const Le=["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 Be=Le;const Fe=l;const Ve=Be;const ze=new Set(Ve);var isBinaryPath$1=e=>ze.has(Fe.extname(e).slice(1).toLowerCase());var je={};(function(e){const{sep:t}=l;const{platform:i}=process;const s=c;e.EV_ALL="all";e.EV_READY="ready";e.EV_ADD="add";e.EV_CHANGE="change";e.EV_ADD_DIR="addDir";e.EV_UNLINK="unlink";e.EV_UNLINK_DIR="unlinkDir";e.EV_RAW="raw";e.EV_ERROR="error";e.STR_DATA="data";e.STR_END="end";e.STR_CLOSE="close";e.FSEVENT_CREATED="created";e.FSEVENT_MODIFIED="modified";e.FSEVENT_DELETED="deleted";e.FSEVENT_MOVED="moved";e.FSEVENT_CLONED="cloned";e.FSEVENT_UNKNOWN="unknown";e.FSEVENT_TYPE_FILE="file";e.FSEVENT_TYPE_DIRECTORY="directory";e.FSEVENT_TYPE_SYMLINK="symlink";e.KEY_LISTENERS="listeners";e.KEY_ERR="errHandlers";e.KEY_RAW="rawEmitters";e.HANDLER_KEYS=[e.KEY_LISTENERS,e.KEY_ERR,e.KEY_RAW];e.DOT_SLASH=`.${t}`;e.BACK_SLASH_RE=/\\/g;e.DOUBLE_SLASH_RE=/\/\//;e.SLASH_OR_BACK_SLASH_RE=/[/\\]/;e.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/;e.REPLACER_RE=/^\.[/\\]/;e.SLASH="/";e.SLASH_SLASH="//";e.BRACE_START="{";e.BANG="!";e.ONE_DOT=".";e.TWO_DOTS="..";e.STAR="*";e.GLOBSTAR="**";e.ROOT_GLOBSTAR="/**/*";e.SLASH_GLOBSTAR="/**";e.DIR_SUFFIX="Dir";e.ANYMATCH_OPTS={dot:true};e.STRING_TYPE="string";e.FUNCTION_TYPE="function";e.EMPTY_STR="";e.EMPTY_FN=()=>{};e.IDENTITY_FN=e=>e;e.isWindows=i==="win32";e.isMacos=i==="darwin";e.isLinux=i==="linux";e.isIBMi=s.type()==="OS400"})(je);const Ue=n;const He=l;const{promisify:Ge}=r;const We=isBinaryPath$1;const{isWindows:qe,isLinux:Ke,EMPTY_FN:Ye,EMPTY_STR:Qe,KEY_LISTENERS:Xe,KEY_ERR:Ze,KEY_RAW:Je,HANDLER_KEYS:et,EV_CHANGE:tt,EV_ADD:it,EV_ADD_DIR:st,EV_ERROR:nt,STR_DATA:rt,STR_END:ot,BRACE_START:lt,STAR:ct}=je;const ut="watch";const ht=Ge(Ue.open);const dt=Ge(Ue.stat);const pt=Ge(Ue.lstat);const ft=Ge(Ue.close);const mt=Ge(Ue.realpath);const gt={lstat:pt,stat:dt};const foreach=(e,t)=>{if(e instanceof Set){e.forEach(t)}else{t(e)}};const addAndConvert=(e,t,i)=>{let s=e[t];if(!(s instanceof Set)){e[t]=s=new Set([s])}s.add(i)};const clearItem=e=>t=>{const i=e[t];if(i instanceof Set){i.clear()}else{delete e[t]}};const delFromSet=(e,t,i)=>{const s=e[t];if(s instanceof Set){s.delete(i)}else if(s===i){delete e[t]}};const isEmptySet=e=>e instanceof Set?e.size===0:!e;const yt=new Map;function createFsWatchInstance(e,t,i,s,n){const handleEvent=(t,s)=>{i(e);n(t,s,{watchedPath:e});if(s&&e!==s){fsWatchBroadcast(He.resolve(e,s),Xe,He.join(e,s))}};try{return Ue.watch(e,t,handleEvent)}catch(e){s(e)}}const fsWatchBroadcast=(e,t,i,s,n)=>{const r=yt.get(e);if(!r)return;foreach(r[t],(e=>{e(i,s,n)}))};const setFsWatchListener=(e,t,i,s)=>{const{listener:n,errHandler:r,rawEmitter:o}=s;let l=yt.get(t);let c;if(!i.persistent){c=createFsWatchInstance(e,i,n,r,o);return c.close.bind(c)}if(l){addAndConvert(l,Xe,n);addAndConvert(l,Ze,r);addAndConvert(l,Je,o)}else{c=createFsWatchInstance(e,i,fsWatchBroadcast.bind(null,t,Xe),r,fsWatchBroadcast.bind(null,t,Je));if(!c)return;c.on(nt,(async i=>{const s=fsWatchBroadcast.bind(null,t,Ze);l.watcherUnusable=true;if(qe&&i.code==="EPERM"){try{const t=await ht(e,"r");await ft(t);s(i)}catch(e){}}else{s(i)}}));l={listeners:n,errHandlers:r,rawEmitters:o,watcher:c};yt.set(t,l)}return()=>{delFromSet(l,Xe,n);delFromSet(l,Ze,r);delFromSet(l,Je,o);if(isEmptySet(l.listeners)){l.watcher.close();yt.delete(t);et.forEach(clearItem(l));l.watcher=undefined;Object.freeze(l)}}};const Et=new Map;const setFsWatchFileListener=(e,t,i,s)=>{const{listener:n,rawEmitter:r}=s;let o=Et.get(t);const l=o&&o.options;if(l&&(l.persistent<i.persistent||l.interval>i.interval)){Ue.unwatchFile(t);o=undefined}if(o){addAndConvert(o,Xe,n);addAndConvert(o,Je,r)}else{o={listeners:n,rawEmitters:r,options:i,watcher:Ue.watchFile(t,i,((i,s)=>{foreach(o.rawEmitters,(e=>{e(tt,t,{curr:i,prev:s})}));const n=i.mtimeMs;if(i.size!==s.size||n>s.mtimeMs||n===0){foreach(o.listeners,(t=>t(e,i)))}}))};Et.set(t,o)}return()=>{delFromSet(o,Xe,n);delFromSet(o,Je,r);if(isEmptySet(o.listeners)){Et.delete(t);Ue.unwatchFile(t);o.options=o.watcher=undefined;Object.freeze(o)}}};let xt=class NodeFsHandler{constructor(e){this.fsw=e;this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,t){const i=this.fsw.options;const s=He.dirname(e);const n=He.basename(e);const r=this.fsw._getWatchedDir(s);r.add(n);const o=He.resolve(e);const l={persistent:i.persistent};if(!t)t=Ye;let c;if(i.usePolling){l.interval=i.enableBinaryInterval&&We(n)?i.binaryInterval:i.interval;c=setFsWatchFileListener(e,o,l,{listener:t,rawEmitter:this.fsw._emitRaw})}else{c=setFsWatchListener(e,o,l,{listener:t,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw})}return c}_handleFile(e,t,i){if(this.fsw.closed){return}const s=He.dirname(e);const n=He.basename(e);const r=this.fsw._getWatchedDir(s);let o=t;if(r.has(n))return;const listener=async(t,i)=>{if(!this.fsw._throttle(ut,e,5))return;if(!i||i.mtimeMs===0){try{const i=await dt(e);if(this.fsw.closed)return;const s=i.atimeMs;const n=i.mtimeMs;if(!s||s<=n||n!==o.mtimeMs){this.fsw._emit(tt,e,i)}if(Ke&&o.ino!==i.ino){this.fsw._closeFile(t);o=i;this.fsw._addPathCloser(t,this._watchWithNodeFs(e,listener))}else{o=i}}catch(e){this.fsw._remove(s,n)}}else if(r.has(n)){const t=i.atimeMs;const s=i.mtimeMs;if(!t||t<=s||s!==o.mtimeMs){this.fsw._emit(tt,e,i)}o=i}};const l=this._watchWithNodeFs(e,listener);if(!(i&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(it,e,0))return;this.fsw._emit(it,e,t)}return l}async _handleSymlink(e,t,i,s){if(this.fsw.closed){return}const n=e.fullPath;const r=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let t;try{t=await mt(i)}catch(e){this.fsw._emitReady();return true}if(this.fsw.closed)return;if(r.has(s)){if(this.fsw._symlinkPaths.get(n)!==t){this.fsw._symlinkPaths.set(n,t);this.fsw._emit(tt,i,e.stats)}}else{r.add(s);this.fsw._symlinkPaths.set(n,t);this.fsw._emit(it,i,e.stats)}this.fsw._emitReady();return true}if(this.fsw._symlinkPaths.has(n)){return true}this.fsw._symlinkPaths.set(n,true)}_handleRead(e,t,i,s,n,r,o){e=He.join(e,Qe);if(!i.hasGlob){o=this.fsw._throttle("readdir",e,1e3);if(!o)return}const l=this.fsw._getWatchedDir(i.path);const c=new Set;let u=this.fsw._readdirp(e,{fileFilter:e=>i.filterPath(e),directoryFilter:e=>i.filterDir(e),depth:0}).on(rt,(async o=>{if(this.fsw.closed){u=undefined;return}const h=o.path;let d=He.join(e,h);c.add(h);if(o.stats.isSymbolicLink()&&await this._handleSymlink(o,e,d,h)){return}if(this.fsw.closed){u=undefined;return}if(h===s||!s&&!l.has(h)){this.fsw._incrReadyCount();d=He.join(n,He.relative(n,d));this._addToNodeFs(d,t,i,r+1)}})).on(nt,this._boundHandleError);return new Promise((t=>u.once(ot,(()=>{if(this.fsw.closed){u=undefined;return}const h=o?o.clear():false;t();l.getChildren().filter((t=>t!==e&&!c.has(t)&&(!i.hasGlob||i.filterPath({fullPath:He.resolve(e,t)})))).forEach((t=>{this.fsw._remove(e,t)}));u=undefined;if(h)this._handleRead(e,false,i,s,n,r,o)}))))}async _handleDir(e,t,i,s,n,r,o){const l=this.fsw._getWatchedDir(He.dirname(e));const c=l.has(He.basename(e));if(!(i&&this.fsw.options.ignoreInitial)&&!n&&!c){if(!r.hasGlob||r.globFilter(e))this.fsw._emit(st,e,t)}l.add(He.basename(e));this.fsw._getWatchedDir(e);let u;let h;const d=this.fsw.options.depth;if((d==null||s<=d)&&!this.fsw._symlinkPaths.has(o)){if(!n){await this._handleRead(e,i,r,n,e,s,u);if(this.fsw.closed)return}h=this._watchWithNodeFs(e,((t,i)=>{if(i&&i.mtimeMs===0)return;this._handleRead(t,false,r,n,e,s,u)}))}return h}async _addToNodeFs(e,t,i,s,n){const r=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed){r();return false}const o=this.fsw._getWatchHelpers(e,s);if(!o.hasGlob&&i){o.hasGlob=i.hasGlob;o.globFilter=i.globFilter;o.filterPath=e=>i.filterPath(e);o.filterDir=e=>i.filterDir(e)}try{const i=await gt[o.statMethod](o.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(o.watchPath,i)){r();return false}const l=this.fsw.options.followSymlinks&&!e.includes(ct)&&!e.includes(lt);let c;if(i.isDirectory()){const r=He.resolve(e);const u=l?await mt(e):e;if(this.fsw.closed)return;c=await this._handleDir(o.watchPath,i,t,s,n,o,u);if(this.fsw.closed)return;if(r!==u&&u!==undefined){this.fsw._symlinkPaths.set(r,u)}}else if(i.isSymbolicLink()){const n=l?await mt(e):e;if(this.fsw.closed)return;const r=He.dirname(o.watchPath);this.fsw._getWatchedDir(r).add(o.watchPath);this.fsw._emit(it,o.watchPath,i);c=await this._handleDir(r,i,t,s,e,o,n);if(this.fsw.closed)return;if(n!==undefined){this.fsw._symlinkPaths.set(He.resolve(e),n)}}else{c=this._handleFile(o.watchPath,i,t)}r();this.fsw._addPathCloser(e,c);return false}catch(t){if(this.fsw._handleError(t)){r();return e}}}};var bt=xt;var vt={exports:{}};const St=s.getAugmentedNamespace(u.fseventsImporter);const At=n;const wt=l;const{promisify:It}=r;let Ct;try{Ct=St.getFsEvents()}catch(e){if(process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR)console.error(e)}if(Ct){const e=process.version.match(/v(\d+)\.(\d+)/);if(e&&e[1]&&e[2]){const t=Number.parseInt(e[1],10);const i=Number.parseInt(e[2],10);if(t===8&&i<16){Ct=undefined}}}const{EV_ADD:kt,EV_CHANGE:_t,EV_ADD_DIR:Pt,EV_UNLINK:Nt,EV_ERROR:Rt,STR_DATA:$t,STR_END:Ot,FSEVENT_CREATED:Tt,FSEVENT_MODIFIED:Dt,FSEVENT_DELETED:Mt,FSEVENT_MOVED:Lt,FSEVENT_UNKNOWN:Bt,FSEVENT_TYPE_FILE:Ft,FSEVENT_TYPE_DIRECTORY:Vt,FSEVENT_TYPE_SYMLINK:zt,ROOT_GLOBSTAR:jt,DIR_SUFFIX:Ut,DOT_SLASH:Ht,FUNCTION_TYPE:Gt,EMPTY_FN:Wt,IDENTITY_FN:qt}=je;const Depth=e=>isNaN(e)?{}:{depth:e};const Kt=It(At.stat);const Yt=It(At.lstat);const Qt=It(At.realpath);const Xt={stat:Kt,lstat:Yt};const Zt=new Map;const Jt=10;const ei=new Set([69888,70400,71424,72704,73472,131328,131840,262912]);const createFSEventsInstance=(e,t)=>{const i=Ct.watch(e,t);return{stop:i}};function setFSEventsListener(e,t,i,s){let n=wt.extname(t)?wt.dirname(t):t;const r=wt.dirname(n);let o=Zt.get(n);if(couldConsolidate(r)){n=r}const l=wt.resolve(e);const c=l!==t;const filteredListener=(e,s,n)=>{if(c)e=e.replace(t,l);if(e===l||!e.indexOf(l+wt.sep))i(e,s,n)};let u=false;for(const e of Zt.keys()){if(t.indexOf(wt.resolve(e)+wt.sep)===0){n=e;o=Zt.get(n);u=true;break}}if(o||u){o.listeners.add(filteredListener)}else{o={listeners:new Set([filteredListener]),rawEmitter:s,watcher:createFSEventsInstance(n,((e,t)=>{if(!o.listeners.size)return;const i=Ct.getInfo(e,t);o.listeners.forEach((s=>{s(e,t,i)}));o.rawEmitter(i.event,e,i)}))};Zt.set(n,o)}return()=>{const e=o.listeners;e.delete(filteredListener);if(!e.size){Zt.delete(n);if(o.watcher)return o.watcher.stop().then((()=>{o.rawEmitter=o.watcher=undefined;Object.freeze(o)}))}}}const couldConsolidate=e=>{let t=0;for(const i of Zt.keys()){if(i.indexOf(e)===0){t++;if(t>=Jt){return true}}}return false};const canUse=()=>Ct&&Zt.size<128;const calcDepth=(e,t)=>{let i=0;while(!e.indexOf(t)&&(e=wt.dirname(e))!==t)i++;return i};const sameTypes=(e,t)=>e.type===Vt&&t.isDirectory()||e.type===zt&&t.isSymbolicLink()||e.type===Ft&&t.isFile();let ti=class FsEventsHandler{constructor(e){this.fsw=e}checkIgnored(e,t){const i=this.fsw._ignoredPaths;if(this.fsw._isIgnored(e,t)){i.add(e);if(t&&t.isDirectory()){i.add(e+jt)}return true}i.delete(e);i.delete(e+jt)}addOrChange(e,t,i,s,n,r,o,l){const c=n.has(r)?_t:kt;this.handleEvent(c,e,t,i,s,n,r,o,l)}async checkExists(e,t,i,s,n,r,o,l){try{const c=await Kt(e);if(this.fsw.closed)return;if(sameTypes(o,c)){this.addOrChange(e,t,i,s,n,r,o,l)}else{this.handleEvent(Nt,e,t,i,s,n,r,o,l)}}catch(c){if(c.code==="EACCES"){this.addOrChange(e,t,i,s,n,r,o,l)}else{this.handleEvent(Nt,e,t,i,s,n,r,o,l)}}}handleEvent(e,t,i,s,n,r,o,l,c){if(this.fsw.closed||this.checkIgnored(t))return;if(e===Nt){const e=l.type===Vt;if(e||r.has(o)){this.fsw._remove(n,o,e)}}else{if(e===kt){if(l.type===Vt)this.fsw._getWatchedDir(t);if(l.type===zt&&c.followSymlinks){const e=c.depth===undefined?undefined:calcDepth(i,s)+1;return this._addToFsEvents(t,false,true,e)}this.fsw._getWatchedDir(n).add(o)}const r=l.type===Vt?e+Ut:e;this.fsw._emit(r,t);if(r===Pt)this._addToFsEvents(t,false,true)}}_watchWithFsEvents(e,t,i,s){if(this.fsw.closed||this.fsw._isIgnored(e))return;const n=this.fsw.options;const watchCallback=async(r,o,l)=>{if(this.fsw.closed)return;if(n.depth!==undefined&&calcDepth(r,t)>n.depth)return;const c=i(wt.join(e,wt.relative(e,r)));if(s&&!s(c))return;const u=wt.dirname(c);const h=wt.basename(c);const d=this.fsw._getWatchedDir(l.type===Vt?c:u);if(ei.has(o)||l.event===Bt){if(typeof n.ignored===Gt){let e;try{e=await Kt(c)}catch(e){}if(this.fsw.closed)return;if(this.checkIgnored(c,e))return;if(sameTypes(l,e)){this.addOrChange(c,r,t,u,d,h,l,n)}else{this.handleEvent(Nt,c,r,t,u,d,h,l,n)}}else{this.checkExists(c,r,t,u,d,h,l,n)}}else{switch(l.event){case Tt:case Dt:return this.addOrChange(c,r,t,u,d,h,l,n);case Mt:case Lt:return this.checkExists(c,r,t,u,d,h,l,n)}}};const r=setFSEventsListener(e,t,watchCallback,this.fsw._emitRaw);this.fsw._emitReady();return r}async _handleFsEventsSymlink(e,t,i,s){if(this.fsw.closed||this.fsw._symlinkPaths.has(t))return;this.fsw._symlinkPaths.set(t,true);this.fsw._incrReadyCount();try{const t=await Qt(e);if(this.fsw.closed)return;if(this.fsw._isIgnored(t)){return this.fsw._emitReady()}this.fsw._incrReadyCount();this._addToFsEvents(t||e,(s=>{let n=e;if(t&&t!==Ht){n=s.replace(t,e)}else if(s!==Ht){n=wt.join(e,s)}return i(n)}),false,s)}catch(e){if(this.fsw._handleError(e)){return this.fsw._emitReady()}}}emitAdd(e,t,i,s,n){const r=i(e);const o=t.isDirectory();const l=this.fsw._getWatchedDir(wt.dirname(r));const c=wt.basename(r);if(o)this.fsw._getWatchedDir(r);if(l.has(c))return;l.add(c);if(!s.ignoreInitial||n===true){this.fsw._emit(o?Pt:kt,r,t)}}initWatch(e,t,i,s){if(this.fsw.closed)return;const n=this._watchWithFsEvents(i.watchPath,wt.resolve(e||i.watchPath),s,i.globFilter);this.fsw._addPathCloser(t,n)}async _addToFsEvents(e,t,i,s){if(this.fsw.closed){return}const n=this.fsw.options;const r=typeof t===Gt?t:qt;const o=this.fsw._getWatchHelpers(e);try{const t=await Xt[o.statMethod](o.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(o.watchPath,t)){throw null}if(t.isDirectory()){if(!o.globFilter)this.emitAdd(r(e),t,r,n,i);if(s&&s>n.depth)return;this.fsw._readdirp(o.watchPath,{fileFilter:e=>o.filterPath(e),directoryFilter:e=>o.filterDir(e),...Depth(n.depth-(s||0))}).on($t,(e=>{if(this.fsw.closed){return}if(e.stats.isDirectory()&&!o.filterPath(e))return;const t=wt.join(o.watchPath,e.path);const{fullPath:s}=e;if(o.followSymlinks&&e.stats.isSymbolicLink()){const e=n.depth===undefined?undefined:calcDepth(t,wt.resolve(o.watchPath))+1;this._handleFsEventsSymlink(t,s,r,e)}else{this.emitAdd(t,e.stats,r,n,i)}})).on(Rt,Wt).on(Ot,(()=>{this.fsw._emitReady()}))}else{this.emitAdd(o.watchPath,t,r,n,i);this.fsw._emitReady()}}catch(e){if(!e||this.fsw._handleError(e)){this.fsw._emitReady();this.fsw._emitReady()}}if(n.persistent&&i!==true){if(typeof t===Gt){this.initWatch(undefined,e,o,r)}else{let t;try{t=await Qt(o.watchPath)}catch(e){}this.initWatch(t,e,o,r)}}}};vt.exports=ti;vt.exports.canUse=canUse;var ii=vt.exports;const{EventEmitter:si}=h;const ni=n;const ri=l;const{promisify:oi}=r;const ai=O;const li=V.default;const ci=J;const ui=H;const hi=Me;const di=normalizePath$2;const pi=bt;const fi=ii;const{EV_ALL:mi,EV_READY:gi,EV_ADD:yi,EV_CHANGE:Ei,EV_UNLINK:xi,EV_ADD_DIR:bi,EV_UNLINK_DIR:vi,EV_RAW:Si,EV_ERROR:Ai,STR_CLOSE:wi,STR_END:Ii,BACK_SLASH_RE:Ci,DOUBLE_SLASH_RE:ki,SLASH_OR_BACK_SLASH_RE:_i,DOT_RE:Pi,REPLACER_RE:Ni,SLASH:Ri,SLASH_SLASH:$i,BRACE_START:Oi,BANG:Ti,ONE_DOT:Di,TWO_DOTS:Mi,GLOBSTAR:Li,SLASH_GLOBSTAR:Bi,ANYMATCH_OPTS:Fi,STRING_TYPE:Vi,FUNCTION_TYPE:zi,EMPTY_STR:ji,EMPTY_FN:Ui,isWindows:Hi,isMacos:Gi,isIBMi:Wi}=je;const qi=oi(ni.stat);const Ki=oi(ni.readdir);const arrify=(e=[])=>Array.isArray(e)?e:[e];const flatten=(e,t=[])=>{e.forEach((e=>{if(Array.isArray(e)){flatten(e,t)}else{t.push(e)}}));return t};const unifyPaths=e=>{const t=flatten(arrify(e));if(!t.every((e=>typeof e===Vi))){throw new TypeError(`Non-string provided as watch path: ${t}`)}return t.map(normalizePathToUnix)};const toUnix=e=>{let t=e.replace(Ci,Ri);let i=false;if(t.startsWith($i)){i=true}while(t.match(ki)){t=t.replace(ki,Ri)}if(i){t=Ri+t}return t};const normalizePathToUnix=e=>toUnix(ri.normalize(toUnix(e)));const normalizeIgnored=(e=ji)=>t=>{if(typeof t!==Vi)return t;return normalizePathToUnix(ri.isAbsolute(t)?t:ri.join(e,t))};const getAbsolutePath=(e,t)=>{if(ri.isAbsolute(e)){return e}if(e.startsWith(Ti)){return Ti+ri.join(t,e.slice(1))}return ri.join(t,e)};const undef=(e,t)=>e[t]===undefined;class DirEntry{constructor(e,t){this.path=e;this._removeWatcher=t;this.items=new Set}add(e){const{items:t}=this;if(!t)return;if(e!==Di&&e!==Mi)t.add(e)}async remove(e){const{items:t}=this;if(!t)return;t.delete(e);if(t.size>0)return;const i=this.path;try{await Ki(i)}catch(e){if(this._removeWatcher){this._removeWatcher(ri.dirname(i),ri.basename(i))}}}has(e){const{items:t}=this;if(!t)return;return t.has(e)}getChildren(){const{items:e}=this;if(!e)return;return[...e.values()]}dispose(){this.items.clear();delete this.path;delete this._removeWatcher;delete this.items;Object.freeze(this)}}const Yi="stat";const Qi="lstat";class WatchHelper{constructor(e,t,i,s){this.fsw=s;this.path=e=e.replace(Ni,ji);this.watchPath=t;this.fullWatchPath=ri.resolve(t);this.hasGlob=t!==e;if(e===ji)this.hasGlob=false;this.globSymlink=this.hasGlob&&i?undefined:false;this.globFilter=this.hasGlob?li(e,undefined,Fi):false;this.dirParts=this.getDirParts(e);this.dirParts.forEach((e=>{if(e.length>1)e.pop()}));this.followSymlinks=i;this.statMethod=i?Yi:Qi}checkGlobSymlink(e){if(this.globSymlink===undefined){this.globSymlink=e.fullParentDir===this.fullWatchPath?false:{realPath:e.fullParentDir,linkPath:this.fullWatchPath}}if(this.globSymlink){return e.fullPath.replace(this.globSymlink.realPath,this.globSymlink.linkPath)}return e.fullPath}entryPath(e){return ri.join(this.watchPath,ri.relative(this.watchPath,this.checkGlobSymlink(e)))}filterPath(e){const{stats:t}=e;if(t&&t.isSymbolicLink())return this.filterDir(e);const i=this.entryPath(e);const s=this.hasGlob&&typeof this.globFilter===zi?this.globFilter(i):true;return s&&this.fsw._isntIgnored(i,t)&&this.fsw._hasReadPermissions(t)}getDirParts(e){if(!this.hasGlob)return[];const t=[];const i=e.includes(Oi)?hi.expand(e):[e];i.forEach((e=>{t.push(ri.relative(this.watchPath,e).split(_i))}));return t}filterDir(e){if(this.hasGlob){const t=this.getDirParts(this.checkGlobSymlink(e));let i=false;this.unmatchedGlob=!this.dirParts.some((e=>e.every(((e,s)=>{if(e===Li)i=true;return i||!t[0][s]||li(e,t[0][s],Fi)}))))}return!this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}}class FSWatcher extends si{constructor(e){super();const t={};if(e)Object.assign(t,e);this._watched=new Map;this._closers=new Map;this._ignoredPaths=new Set;this._throttled=new Map;this._symlinkPaths=new Map;this._streams=new Set;this.closed=false;if(undef(t,"persistent"))t.persistent=true;if(undef(t,"ignoreInitial"))t.ignoreInitial=false;if(undef(t,"ignorePermissionErrors"))t.ignorePermissionErrors=false;if(undef(t,"interval"))t.interval=100;if(undef(t,"binaryInterval"))t.binaryInterval=300;if(undef(t,"disableGlobbing"))t.disableGlobbing=false;t.enableBinaryInterval=t.binaryInterval!==t.interval;if(undef(t,"useFsEvents"))t.useFsEvents=!t.usePolling;const i=fi.canUse();if(!i)t.useFsEvents=false;if(undef(t,"usePolling")&&!t.useFsEvents){t.usePolling=Gi}if(Wi){t.usePolling=true}const s=process.env.CHOKIDAR_USEPOLLING;if(s!==undefined){const e=s.toLowerCase();if(e==="false"||e==="0"){t.usePolling=false}else if(e==="true"||e==="1"){t.usePolling=true}else{t.usePolling=!!e}}const n=process.env.CHOKIDAR_INTERVAL;if(n){t.interval=Number.parseInt(n,10)}if(undef(t,"atomic"))t.atomic=!t.usePolling&&!t.useFsEvents;if(t.atomic)this._pendingUnlinks=new Map;if(undef(t,"followSymlinks"))t.followSymlinks=true;if(undef(t,"awaitWriteFinish"))t.awaitWriteFinish=false;if(t.awaitWriteFinish===true)t.awaitWriteFinish={};const r=t.awaitWriteFinish;if(r){if(!r.stabilityThreshold)r.stabilityThreshold=2e3;if(!r.pollInterval)r.pollInterval=100;this._pendingWrites=new Map}if(t.ignored)t.ignored=arrify(t.ignored);let o=0;this._emitReady=()=>{o++;if(o>=this._readyCount){this._emitReady=Ui;this._readyEmitted=true;process.nextTick((()=>this.emit(gi)))}};this._emitRaw=(...e)=>this.emit(Si,...e);this._readyEmitted=false;this.options=t;if(t.useFsEvents){this._fsEventsHandler=new fi(this)}else{this._nodeFsHandler=new pi(this)}Object.freeze(t)}add(e,t,i){const{cwd:s,disableGlobbing:n}=this.options;this.closed=false;let r=unifyPaths(e);if(s){r=r.map((e=>{const t=getAbsolutePath(e,s);if(n||!ui(e)){return t}return di(t)}))}r=r.filter((e=>{if(e.startsWith(Ti)){this._ignoredPaths.add(e.slice(1));return false}this._ignoredPaths.delete(e);this._ignoredPaths.delete(e+Bi);this._userIgnored=undefined;return true}));if(this.options.useFsEvents&&this._fsEventsHandler){if(!this._readyCount)this._readyCount=r.length;if(this.options.persistent)this._readyCount*=2;r.forEach((e=>this._fsEventsHandler._addToFsEvents(e)))}else{if(!this._readyCount)this._readyCount=0;this._readyCount+=r.length;Promise.all(r.map((async e=>{const s=await this._nodeFsHandler._addToNodeFs(e,!i,0,0,t);if(s)this._emitReady();return s}))).then((e=>{if(this.closed)return;e.filter((e=>e)).forEach((e=>{this.add(ri.dirname(e),ri.basename(t||e))}))}))}return this}unwatch(e){if(this.closed)return this;const t=unifyPaths(e);const{cwd:i}=this.options;t.forEach((e=>{if(!ri.isAbsolute(e)&&!this._closers.has(e)){if(i)e=ri.join(i,e);e=ri.resolve(e)}this._closePath(e);this._ignoredPaths.add(e);if(this._watched.has(e)){this._ignoredPaths.add(e+Bi)}this._userIgnored=undefined}));return this}close(){if(this.closed)return this._closePromise;this.closed=true;this.removeAllListeners();const e=[];this._closers.forEach((t=>t.forEach((t=>{const i=t();if(i instanceof Promise)e.push(i)}))));this._streams.forEach((e=>e.destroy()));this._userIgnored=undefined;this._readyCount=0;this._readyEmitted=false;this._watched.forEach((e=>e.dispose()));["closers","watched","streams","symlinkPaths","throttled"].forEach((e=>{this[`_${e}`].clear()}));this._closePromise=e.length?Promise.all(e).then((()=>undefined)):Promise.resolve();return this._closePromise}getWatched(){const e={};this._watched.forEach(((t,i)=>{const s=this.options.cwd?ri.relative(this.options.cwd,i):i;e[s||Di]=t.getChildren().sort()}));return e}emitWithAll(e,t){this.emit(...t);if(e!==Ai)this.emit(mi,...t)}async _emit(e,t,i,s,n){if(this.closed)return;const r=this.options;if(Hi)t=ri.normalize(t);if(r.cwd)t=ri.relative(r.cwd,t);const o=[e,t];if(n!==undefined)o.push(i,s,n);else if(s!==undefined)o.push(i,s);else if(i!==undefined)o.push(i);const l=r.awaitWriteFinish;let c;if(l&&(c=this._pendingWrites.get(t))){c.lastChange=new Date;return this}if(r.atomic){if(e===xi){this._pendingUnlinks.set(t,o);setTimeout((()=>{this._pendingUnlinks.forEach(((e,t)=>{this.emit(...e);this.emit(mi,...e);this._pendingUnlinks.delete(t)}))}),typeof r.atomic==="number"?r.atomic:100);return this}if(e===yi&&this._pendingUnlinks.has(t)){e=o[0]=Ei;this._pendingUnlinks.delete(t)}}if(l&&(e===yi||e===Ei)&&this._readyEmitted){const awfEmit=(t,i)=>{if(t){e=o[0]=Ai;o[1]=t;this.emitWithAll(e,o)}else if(i){if(o.length>2){o[2]=i}else{o.push(i)}this.emitWithAll(e,o)}};this._awaitWriteFinish(t,l.stabilityThreshold,e,awfEmit);return this}if(e===Ei){const e=!this._throttle(Ei,t,50);if(e)return this}if(r.alwaysStat&&i===undefined&&(e===yi||e===bi||e===Ei)){const e=r.cwd?ri.join(r.cwd,t):t;let i;try{i=await qi(e)}catch(e){}if(!i||this.closed)return;o.push(i)}this.emitWithAll(e,o);return this}_handleError(e){const t=e&&e.code;if(e&&t!=="ENOENT"&&t!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||t!=="EPERM"&&t!=="EACCES")){this.emit(Ai,e)}return e||this.closed}_throttle(e,t,i){if(!this._throttled.has(e)){this._throttled.set(e,new Map)}const s=this._throttled.get(e);const n=s.get(t);if(n){n.count++;return false}let r;const clear=()=>{const e=s.get(t);const i=e?e.count:0;s.delete(t);clearTimeout(r);if(e)clearTimeout(e.timeoutObject);return i};r=setTimeout(clear,i);const o={timeoutObject:r,clear:clear,count:0};s.set(t,o);return o}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,t,i,s){let n;let r=e;if(this.options.cwd&&!ri.isAbsolute(e)){r=ri.join(this.options.cwd,e)}const o=new Date;const awaitWriteFinish=i=>{ni.stat(r,((r,o)=>{if(r||!this._pendingWrites.has(e)){if(r&&r.code!=="ENOENT")s(r);return}const l=Number(new Date);if(i&&o.size!==i.size){this._pendingWrites.get(e).lastChange=l}const c=this._pendingWrites.get(e);const u=l-c.lastChange;if(u>=t){this._pendingWrites.delete(e);s(undefined,o)}else{n=setTimeout(awaitWriteFinish,this.options.awaitWriteFinish.pollInterval,o)}}))};if(!this._pendingWrites.has(e)){this._pendingWrites.set(e,{lastChange:o,cancelWait:()=>{this._pendingWrites.delete(e);clearTimeout(n);return i}});n=setTimeout(awaitWriteFinish,this.options.awaitWriteFinish.pollInterval)}}_getGlobIgnored(){return[...this._ignoredPaths.values()]}_isIgnored(e,t){if(this.options.atomic&&Pi.test(e))return true;if(!this._userIgnored){const{cwd:e}=this.options;const t=this.options.ignored;const i=t&&t.map(normalizeIgnored(e));const s=arrify(i).filter((e=>typeof e===Vi&&!ui(e))).map((e=>e+Bi));const n=this._getGlobIgnored().map(normalizeIgnored(e)).concat(i,s);this._userIgnored=li(n,undefined,Fi)}return this._userIgnored([e,t])}_isntIgnored(e,t){return!this._isIgnored(e,t)}_getWatchHelpers(e,t){const i=t||this.options.disableGlobbing||!ui(e)?e:ci(e);const s=this.options.followSymlinks;return new WatchHelper(e,i,s,this)}_getWatchedDir(e){if(!this._boundRemove)this._boundRemove=this._remove.bind(this);const t=ri.resolve(e);if(!this._watched.has(t))this._watched.set(t,new DirEntry(t,this._boundRemove));return this._watched.get(t)}_hasReadPermissions(e){if(this.options.ignorePermissionErrors)return true;const t=e&&Number.parseInt(e.mode,10);const i=t&511;const s=Number.parseInt(i.toString(8)[0],10);return Boolean(4&s)}_remove(e,t,i){const s=ri.join(e,t);const n=ri.resolve(s);i=i!=null?i:this._watched.has(s)||this._watched.has(n);if(!this._throttle("remove",s,100))return;if(!i&&!this.options.useFsEvents&&this._watched.size===1){this.add(e,t,true)}const r=this._getWatchedDir(s);const o=r.getChildren();o.forEach((e=>this._remove(s,e)));const l=this._getWatchedDir(e);const c=l.has(t);l.remove(t);if(this._symlinkPaths.has(n)){this._symlinkPaths.delete(n)}let u=s;if(this.options.cwd)u=ri.relative(this.options.cwd,s);if(this.options.awaitWriteFinish&&this._pendingWrites.has(u)){const e=this._pendingWrites.get(u).cancelWait();if(e===yi)return}this._watched.delete(s);this._watched.delete(n);const h=i?vi:xi;if(c&&!this._isIgnored(s))this._emit(h,s);if(!this.options.useFsEvents){this._closePath(s)}}_closePath(e){this._closeFile(e);const t=ri.dirname(e);this._getWatchedDir(t).remove(ri.basename(e))}_closeFile(e){const t=this._closers.get(e);if(!t)return;t.forEach((e=>e()));this._closers.delete(e)}_addPathCloser(e,t){if(!t)return;let i=this._closers.get(e);if(!i){i=[];this._closers.set(e,i)}i.push(t)}_readdirp(e,t){if(this.closed)return;const i={type:mi,alwaysStat:true,lstat:true,...t};let s=ai(e,i);this._streams.add(s);s.once(wi,(()=>{s=undefined}));s.once(Ii,(()=>{if(s){this._streams.delete(s);s=undefined}}));return s}}d.FSWatcher=FSWatcher;const watch=(e,t)=>{const i=new FSWatcher(t);i.add(e);return i};d.watch=watch;t.chokidar=d},425:(e,t,i)=>{
|
|
68
68
|
/*
|
|
69
69
|
@license
|
|
70
|
-
Rollup.js v3.
|
|
71
|
-
|
|
70
|
+
Rollup.js v3.29.4
|
|
71
|
+
Thu, 28 Sep 2023 04:54:30 GMT - commit 4e92d60fa90cead39481e3703d26e5d812f43bd1
|
|
72
72
|
|
|
73
73
|
https://github.com/rollup/rollup
|
|
74
74
|
|
|
75
75
|
Released under the MIT License.
|
|
76
76
|
*/
|
|
77
|
-
const s=i(742);const n=i(224);const r=i(411);const o=i(17);const l=i(846);const c=i(5);const u=i(977);function _interopNamespaceDefault(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e){t[i]=e[i]}}t.default=e;return t}const h=_interopNamespaceDefault(n);var d="3.23.0";function ensureArray$1(e){if(Array.isArray(e)){return e.filter(Boolean)}if(e){return[e]}return[]}const p="troubleshooting/#avoiding-eval";const f="troubleshooting/#error-name-is-not-exported-by-module";const m="troubleshooting/#error-this-is-undefined";const g="troubleshooting/#warning-treating-module-as-external-dependency";const y="troubleshooting/#warning-sourcemap-is-likely-to-be-incorrect";const E="configuration-options/#maxparallelfileops";const x="configuration-options/#output-amd-id";const b="configuration-options/#output-amd-basepath";const v="configuration-options/#output-dir";const S="configuration-options/#output-dynamicimportfunction";const A="configuration-options/#output-exports";const w="configuration-options/#output-extend";const I="configuration-options/#output-format";const k="configuration-options/#output-generatedcode";const C="configuration-options/#output-experimentaldeepdynamicchunkoptimization";const _="configuration-options/#output-generatedcode-constbindings";const P="configuration-options/#output-generatedcode-symbols";const N="configuration-options/#output-globals";const R="configuration-options/#output-inlinedynamicimports";const $="configuration-options/#output-interop";const O="configuration-options/#output-manualchunks";const T="configuration-options/#output-name";const D="configuration-options/#output-preservemodules";const M="configuration-options/#output-sourcemapbaseurl";const L="configuration-options/#output-sourcemapfile";const B="configuration-options/#preserveentrysignatures";const F="configuration-options/#treeshake";const V="configuration-options/#treeshake-modulesideeffects";const z="configuration-options/#watch";const j="command-line-interface/#bundleconfigascjs";const U="command-line-interface/#configuration-files";const H="plugin-development/#renderdynamicimport";const G="plugin-development/#this-getmoduleids";const W="plugin-development/#this-getmoduleinfo";async function asyncFlatten(e){do{e=(await Promise.all(e)).flat(Infinity)}while(e.some((e=>e?.then)));return e}const q=Object.freeze(Object.create(null));const K=Object.freeze({});const Y=Object.freeze([]);const Q=Object.freeze(new class extends Set{add(){throw new Error("Cannot add to empty set")}});function getLocator$1(e,t){if(t===void 0){t={}}var i=t.offsetLine||0;var s=t.offsetColumn||0;var n=e.split("\n");var r=0;var o=n.map((function(e,t){var i=r+e.length+1;var s={start:r,end:i,line:t};r=i;return s}));var l=0;function rangeContains(e,t){return e.start<=t&&t<e.end}function getLocation(e,t){return{line:i+e.line,column:s+t-e.start,character:t}}function locate(t,i){if(typeof t==="string"){t=e.indexOf(t,i||0)}var s=o[l];var n=t>=s.end?1:-1;while(s){if(rangeContains(s,t))return getLocation(s,t);l+=n;s=o[l]}}return locate}function locate(e,t,i){if(typeof i==="number"){throw new Error("locate takes a { startIndex, offsetLine, offsetColumn } object as the third argument")}return getLocator$1(e,i)(t,i&&i.startIndex)}function spaces(e){let t="";while(e--)t+=" ";return t}function tabsToSpaces(e){return e.replace(/^\t+/,(e=>e.split("\t").join(" ")))}const X=120;const Z=10;const J="...";function getCodeFrame(e,t,i){let s=e.split("\n");if(t>s.length)return"";const n=Math.max(tabsToSpaces(s[t-1].slice(0,i)).length+Z+J.length,X);const r=Math.max(0,t-3);let o=Math.min(t+2,s.length);s=s.slice(r,o);while(!/\S/.test(s[s.length-1])){s.pop();o-=1}const l=String(o).length;return s.map(((e,s)=>{const o=r+s+1===t;let c=String(s+r+1);while(c.length<l)c=` ${c}`;let u=tabsToSpaces(e);if(u.length>n){u=`${u.slice(0,n-J.length)}${J}`}if(o){const t=spaces(l+2+tabsToSpaces(e.slice(0,i)).length)+"^";return`${c}: ${u}\n${t}`}return`${c}: ${u}`})).join("\n")}const ee=/^(?:\/|(?:[A-Za-z]:)?[/\\|])/;const te=/^\.?\.(\/|$)/;function isAbsolute(e){return ee.test(e)}function isRelative(e){return te.test(e)}const ie=/\\/g;function normalize(e){return e.replace(ie,"/")}function printQuotedStringList(e,t){const i=e.length<=1;const s=e.map((e=>`"${e}"`));let n=i?s[0]:`${s.slice(0,-1).join(", ")} and ${s.slice(-1)[0]}`;if(t){n+=` ${i?t[0]:t[1]}`}return n}const se=/[/\\]/;function relative(e,t){const i=e.split(se).filter(Boolean);const s=t.split(se).filter(Boolean);if(i[0]===".")i.shift();if(s[0]===".")s.shift();while(i[0]&&s[0]&&i[0]===s[0]){i.shift();s.shift()}while(s[0]===".."&&i.length>0){s.shift();i.pop()}while(i.pop()){s.unshift("..")}return s.join("/")}function getAliasName(e){const t=r.basename(e);return t.slice(0,Math.max(0,t.length-r.extname(e).length))}function relativeId(e){if(!isAbsolute(e))return e;return relative(r.resolve(),e)}function isPathFragment(e){return e[0]==="/"||e[0]==="."&&(e[1]==="/"||e[1]===".")||isAbsolute(e)}const ne=/^(\.\.\/)*\.\.$/;function getImportPath(e,t,i,s){let n=normalize(relative(r.dirname(e),t));if(i&&n.endsWith(".js")){n=n.slice(0,-3)}if(s){if(n==="")return"../"+r.basename(t);if(ne.test(n)){return[...n.split("/"),"..",r.basename(t)].join("/")}}return n?n.startsWith("..")?n:"./"+n:"."}function isValidUrl(e){try{new URL(e)}catch{return false}return true}function getRollupUrl(e){return`https://rollupjs.org/${e}`}function error(e){if(!(e instanceof Error)){e=Object.assign(new Error(e.message),e);Object.defineProperty(e,"name",{value:"RollupError"})}throw e}function augmentCodeLocation(e,t,i,s){if(typeof t==="object"){const{line:i,column:n}=t;e.loc={column:n,file:s,line:i}}else{e.pos=t;const{line:n,column:r}=locate(i,t,{offsetLine:1});e.loc={column:r,file:s,line:n}}if(e.frame===undefined){const{line:t,column:s}=e.loc;e.frame=getCodeFrame(i,t,s)}}const re="ADDON_ERROR",oe="ALREADY_CLOSED",ae="AMBIGUOUS_EXTERNAL_NAMESPACES",le="ANONYMOUS_PLUGIN_CACHE",ce="ASSET_NOT_FINALISED",ue="ASSET_NOT_FOUND",he="ASSET_SOURCE_ALREADY_SET",de="ASSET_SOURCE_MISSING",pe="BAD_LOADER",fe="CANNOT_CALL_NAMESPACE",me="CANNOT_EMIT_FROM_OPTIONS_HOOK",ge="CHUNK_NOT_GENERATED",ye="CHUNK_INVALID",Ee="CIRCULAR_DEPENDENCY",xe="CIRCULAR_REEXPORT",be="CYCLIC_CROSS_CHUNK_REEXPORT",ve="DEPRECATED_FEATURE",Se="DUPLICATE_IMPORT_OPTIONS",Ae="DUPLICATE_PLUGIN_NAME",we="EMPTY_BUNDLE",Ie="EVAL",ke="EXTERNAL_SYNTHETIC_EXPORTS",Ce="FAIL_AFTER_WARNINGS",_e="FILE_NAME_CONFLICT",Pe="FILE_NOT_FOUND",Ne="ILLEGAL_IDENTIFIER_AS_NAME",Re="ILLEGAL_REASSIGNMENT",$e="INCONSISTENT_IMPORT_ASSERTIONS",Oe="INPUT_HOOK_IN_OUTPUT_PLUGIN",Te="INVALID_CHUNK",De="INVALID_CONFIG_MODULE_FORMAT",Me="INVALID_EXPORT_OPTION",Le="INVALID_EXTERNAL_ID",Be="INVALID_OPTION",Fe="INVALID_PLUGIN_HOOK",Ve="INVALID_ROLLUP_PHASE",ze="INVALID_SETASSETSOURCE",je="INVALID_TLA_FORMAT",Ue="MISSING_CONFIG",He="MISSING_EXPORT",Ge="MISSING_EXTERNAL_CONFIG",We="MISSING_GLOBAL_NAME",qe="MISSING_IMPLICIT_DEPENDANT",Ke="MISSING_NAME_OPTION_FOR_IIFE_EXPORT",Ye="MISSING_NODE_BUILTINS",Qe="MISSING_OPTION",Xe="MIXED_EXPORTS",Ze="MODULE_LEVEL_DIRECTIVE",Je="NAMESPACE_CONFLICT",et="NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE",tt="ONLY_INLINE_SOURCEMAPS",it="PARSE_ERROR",st="PLUGIN_ERROR",nt="SHIMMED_EXPORT",rt="SOURCEMAP_BROKEN",ot="SOURCEMAP_ERROR",lt="SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT",ct="THIS_IS_UNDEFINED",ut="UNEXPECTED_NAMED_IMPORT",ht="UNKNOWN_OPTION",dt="UNRESOLVED_ENTRY",pt="UNRESOLVED_IMPORT",ft="UNUSED_EXTERNAL_IMPORT",mt="VALIDATION_ERROR";function errorAddonNotGenerated(e,t,i){return{code:re,message:`Could not retrieve "${t}". Check configuration of plugin "${i}".\n\tError Message: ${e}`}}function errorAlreadyClosed(){return{code:oe,message:'Bundle is already closed, no more calls to "generate" or "write" are allowed.'}}function errorAmbiguousExternalNamespaces(e,t,i,s){return{binding:e,code:ae,ids:s,message:`Ambiguous external namespace resolution: "${relativeId(t)}" re-exports "${e}" from one of the external modules ${printQuotedStringList(s.map((e=>relativeId(e))))}, guessing "${relativeId(i)}".`,reexporter:t}}function errorAnonymousPluginCache(){return{code:le,message:"A plugin is trying to use the Rollup cache but is not declaring a plugin name or cacheKey."}}function errorAssetNotFinalisedForFileName(e){return{code:ce,message:`Plugin error - Unable to get file name for asset "${e}". Ensure that the source is set and that generate is called first. If you reference assets via import.meta.ROLLUP_FILE_URL_<referenceId>, you need to either have set their source after "renderStart" or need to provide an explicit "fileName" when emitting them.`}}function errorAssetReferenceIdNotFoundForSetSource(e){return{code:ue,message:`Plugin error - Unable to set the source for unknown asset "${e}".`}}function errorAssetSourceAlreadySet(e){return{code:he,message:`Unable to set the source for asset "${e}", source already set.`}}function errorNoAssetSourceSet(e){return{code:de,message:`Plugin error creating asset "${e}" - no asset source set.`}}function errorBadLoader(e){return{code:pe,message:`Error loading "${relativeId(e)}": plugin load hook should return a string, a { code, map } object, or nothing/null.`}}function errorCannotCallNamespace(e){return{code:fe,message:`Cannot call a namespace ("${e}").`}}function errorCannotEmitFromOptionsHook(){return{code:me,message:`Cannot emit files or set asset sources in the "outputOptions" hook, use the "renderStart" hook instead.`}}function errorChunkNotGeneratedForFileName(e){return{code:ge,message:`Plugin error - Unable to get file name for emitted chunk "${e}". You can only get file names once chunks have been generated after the "renderStart" hook.`}}function errorChunkInvalid({fileName:e,code:t},i){const s={code:ye,message:`Chunk "${e}" is not valid JavaScript: ${i.message}.`};augmentCodeLocation(s,i.loc,t,e);return s}function errorCircularDependency(e){return{code:Ee,ids:e,message:`Circular dependency: ${e.map(relativeId).join(" -> ")}`}}function errorCircularReexport(e,t){return{code:xe,exporter:t,message:`"${e}" cannot be exported from "${relativeId(t)}" as it is a reexport that references itself.`}}function errorCyclicCrossChunkReexport(e,t,i,s,n){return{code:be,exporter:t,id:s,message:`Export "${e}" of module "${relativeId(t)}" was reexported through module "${relativeId(i)}" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.\nEither change the import in "${relativeId(s)}" to point directly to the exporting module or ${n?'do not use "output.preserveModules"':'reconfigure "output.manualChunks"'} to ensure these modules end up in the same chunk.`,reexporter:i}}function errorDeprecation(e,t,i){return{code:ve,message:e,url:getRollupUrl(t),...i?{plugin:i}:{}}}function errorDuplicateImportOptions(){return{code:Se,message:"Either use --input, or pass input path as argument"}}function errorDuplicatePluginName(e){return{code:Ae,message:`The plugin name ${e} is being used twice in the same build. Plugin names must be distinct or provide a cacheKey (please post an issue to the plugin if you are a plugin user).`}}function errorEmptyChunk(e){return{code:we,message:`Generated an empty chunk: "${e}".`,names:[e]}}function errorEval(e){return{code:Ie,id:e,message:`Use of eval in "${relativeId(e)}" is strongly discouraged as it poses security risks and may cause issues with minification.`,url:getRollupUrl(p)}}function errorExternalSyntheticExports(e,t){return{code:ke,exporter:e,message:`External "${e}" cannot have "syntheticNamedExports" enabled (imported by "${relativeId(t)}").`}}function errorFailAfterWarnings(){return{code:Ce,message:"Warnings occurred and --failAfterWarnings flag present."}}function errorFileNameConflict(e){return{code:_e,message:`The emitted file "${e}" overwrites a previously emitted file of the same name.`}}function errorFileReferenceIdNotFoundForFilename(e){return{code:Pe,message:`Plugin error - Unable to get file name for unknown file "${e}".`}}function errorIllegalIdentifierAsName(e){return{code:Ne,message:`Given name "${e}" is not a legal JS identifier. If you need this, you can try "output.extend: true".`,url:getRollupUrl(w)}}function errorIllegalImportReassignment(e,t){return{code:Re,message:`Illegal reassignment of import "${e}" in "${relativeId(t)}".`}}function errorInconsistentImportAssertions(e,t,i,s){return{code:$e,message:`Module "${relativeId(s)}" tried to import "${relativeId(i)}" with ${formatAssertions$1(t)} assertions, but it was already imported elsewhere with ${formatAssertions$1(e)} assertions. Please ensure that import assertions for the same module are always consistent.`}}const formatAssertions$1=e=>{const t=Object.entries(e);if(t.length===0)return"no";return t.map((([e,t])=>`"${e}": "${t}"`)).join(", ")};function errorInputHookInOutputPlugin(e,t){return{code:Oe,message:`The "${t}" hook used by the output plugin ${e} is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.`}}function errorCannotAssignModuleToChunk(e,t,i){return{code:Te,message:`Cannot assign "${relativeId(e)}" to the "${t}" chunk as it is already in the "${i}" chunk.`}}function errorCannotBundleConfigAsEsm(e){return{cause:e,code:De,message:`Rollup transpiled your configuration to an ES module even though it appears to contain CommonJS elements. To resolve this, you can pass the "--bundleConfigAsCjs" flag to Rollup or change your configuration to only contain valid ESM code.\n\nOriginal error: ${e.message}`,stack:e.stack,url:getRollupUrl(j)}}function errorCannotLoadConfigAsCjs(e){return{cause:e,code:De,message:`Node tried to load your configuration file as CommonJS even though it is likely an ES module. To resolve this, change the extension of your configuration to ".mjs", set "type": "module" in your package.json file or pass the "--bundleConfigAsCjs" flag.\n\nOriginal error: ${e.message}`,stack:e.stack,url:getRollupUrl(j)}}function errorCannotLoadConfigAsEsm(e){return{cause:e,code:De,message:`Node tried to load your configuration as an ES module even though it is likely CommonJS. To resolve this, change the extension of your configuration to ".cjs" or pass the "--bundleConfigAsCjs" flag.\n\nOriginal error: ${e.message}`,stack:e.stack,url:getRollupUrl(j)}}function errorInvalidExportOptionValue(e){return{code:Me,message:`"output.exports" must be "default", "named", "none", "auto", or left unspecified (defaults to "auto"), received "${e}".`,url:getRollupUrl(A)}}function errorIncompatibleExportOptionValue(e,t,i){return{code:Me,message:`"${e}" was specified for "output.exports", but entry module "${relativeId(i)}" has the following exports: ${printQuotedStringList(t)}`,url:getRollupUrl(A)}}function errorInternalIdCannotBeExternal(e,t){return{code:Le,message:`"${e}" is imported as an external by "${relativeId(t)}", but is already an existing non-external module id.`}}function errorInvalidOption(e,t,i,s){return{code:Be,message:`Invalid value ${s===undefined?"":`${JSON.stringify(s)} `}for option "${e}" - ${i}.`,url:getRollupUrl(t)}}function errorInvalidAddonPluginHook(e,t){return{code:Fe,hook:e,message:`Error running plugin hook "${e}" for plugin "${t}", expected a string, a function hook or an object with a "handler" string or function.`,plugin:t}}function errorInvalidFunctionPluginHook(e,t){return{code:Fe,hook:e,message:`Error running plugin hook "${e}" for plugin "${t}", expected a function hook or an object with a "handler" function.`,plugin:t}}function errorInvalidRollupPhaseForAddWatchFile(){return{code:Ve,message:`Cannot call "addWatchFile" after the build has finished.`}}function errorInvalidRollupPhaseForChunkEmission(){return{code:Ve,message:`Cannot emit chunks after module loading has finished.`}}function errorInvalidSetAssetSourceCall(){return{code:ze,message:`setAssetSource cannot be called in transform for caching reasons. Use emitFile with a source, or call setAssetSource in another hook.`}}function errorInvalidFormatForTopLevelAwait(e,t){return{code:je,id:e,message:`Module format "${t}" does not support top-level await. Use the "es" or "system" output formats rather.`}}function errorMissingConfig(){return{code:Ue,message:"Config file must export an options object, or an array of options objects",url:getRollupUrl(U)}}function errorMissingExport(e,t,i){const s=r.extname(i)===".json";return{binding:e,code:He,exporter:i,id:t,message:`"${e}" is not exported by "${relativeId(i)}", imported by "${relativeId(t)}".${s?" (Note that you need @rollup/plugin-json to import JSON files)":""}`,url:getRollupUrl(f)}}function errorMissingExternalConfig(e){return{code:Ge,message:`Could not resolve config file "${e}"`}}function errorMissingGlobalName(e,t){return{code:We,id:e,message:`No name was provided for external module "${e}" in "output.globals" – guessing "${t}".`,names:[t],url:getRollupUrl(N)}}function errorImplicitDependantCannotBeExternal(e,t){return{code:qe,message:`Module "${relativeId(e)}" that should be implicitly loaded before "${relativeId(t)}" cannot be external.`}}function errorUnresolvedImplicitDependant(e,t){return{code:qe,message:`Module "${relativeId(e)}" that should be implicitly loaded before "${relativeId(t)}" could not be resolved.`}}function errorImplicitDependantIsNotIncluded(e){const t=[...e.implicitlyLoadedBefore].map((e=>relativeId(e.id))).sort();return{code:qe,message:`Module "${relativeId(e.id)}" that should be implicitly loaded before ${printQuotedStringList(t)} is not included in the module graph. Either it was not imported by an included module or only via a tree-shaken dynamic import, or no imported bindings were used and it had otherwise no side-effects.`}}function errorMissingNameOptionForIifeExport(){return{code:Ke,message:`If you do not supply "output.name", you may not be able to access the exports of an IIFE bundle.`,url:getRollupUrl(T)}}function errorMissingNameOptionForUmdExport(){return{code:Ke,message:'You must supply "output.name" for UMD bundles that have exports so that the exports are accessible in environments without a module loader.',url:getRollupUrl(T)}}function errorMissingNodeBuiltins(e){return{code:Ye,ids:e,message:`Creating a browser bundle that depends on Node.js built-in modules (${printQuotedStringList(e)}). You might need to include https://github.com/FredKSchott/rollup-plugin-polyfill-node`}}function errorMissingFileOrDirOption(){return{code:Qe,message:'You must specify "output.file" or "output.dir" for the build.',url:getRollupUrl(v)}}function errorMixedExport(e,t){return{code:Xe,id:e,message:`Entry module "${relativeId(e)}" is using named and default exports together. Consumers of your bundle will have to use \`${t||"chunk"}.default\` to access the default export, which may not be what you want. Use \`output.exports: "named"\` to disable this warning.`,url:getRollupUrl(A)}}function errorModuleLevelDirective(e,t){return{code:Ze,id:t,message:`Module level directives cause errors when bundled, "${e}" in "${relativeId(t)}" was ignored.`}}function errorNamespaceConflict(e,t,i){return{binding:e,code:Je,ids:i,message:`Conflicting namespaces: "${relativeId(t)}" re-exports "${e}" from one of the modules ${printQuotedStringList(i.map((e=>relativeId(e))))} (will be ignored).`,reexporter:t}}function errorNoTransformMapOrAstWithoutCode(e){return{code:et,message:`The plugin "${e}" returned a "map" or "ast" without returning `+'a "code". This will be ignored.'}}function errorOnlyInlineSourcemapsForStdout(){return{code:tt,message:"Only inline sourcemaps are supported when bundling to stdout."}}function errorParseError(e,t){let i=e.message.replace(/ \(\d+:\d+\)$/,"");if(t.endsWith(".json")){i+=" (Note that you need @rollup/plugin-json to import JSON files)"}else if(!t.endsWith(".js")){i+=" (Note that you need plugins to import files that are not JavaScript)"}return{cause:e,code:it,id:t,message:i}}function errorPluginError(e,t,{hook:i,id:s}={}){if(typeof e==="string")e={message:e};if(e.code&&e.code!==st){e.pluginCode=e.code}e.code=st;e.plugin=t;if(i){e.hook=i}if(s){e.id=s}return e}function errorShimmedExport(e,t){return{binding:t,code:nt,exporter:e,message:`Missing export "${t}" has been shimmed in module "${relativeId(e)}".`}}function errorSourcemapBroken(e){return{code:rt,message:`Sourcemap is likely to be incorrect: a plugin (${e}) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help`,plugin:e,url:getRollupUrl(y)}}function errorConflictingSourcemapSources(e){return{code:rt,message:`Multiple conflicting contents for sourcemap source ${e}`}}function errorInvalidSourcemapForError(e,t,i,s,n){return{cause:e,code:ot,id:t,loc:{column:i,file:t,line:s},message:`Error when using sourcemap for reporting an error: ${e.message}`,pos:n}}function errorSyntheticNamedExportsNeedNamespaceExport(e,t){return{code:lt,exporter:e,message:`Module "${relativeId(e)}" that is marked with \`syntheticNamedExports: ${JSON.stringify(t)}\` needs ${typeof t==="string"&&t!=="default"?`an explicit export named "${t}"`:"a default export"} that does not reexport an unresolved named export of the same module.`}}function errorThisIsUndefined(){return{code:ct,message:`The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten`,url:getRollupUrl(m)}}function errorUnexpectedNamedImport(e,t,i){const s=i?"reexport":"import";return{code:ut,exporter:e,message:`The named export "${t}" was ${s}ed from the external module "${relativeId(e)}" even though its interop type is "defaultOnly". Either remove or change this ${s} or change the value of the "output.interop" option.`,url:getRollupUrl($)}}function errorUnexpectedNamespaceReexport(e){return{code:ut,exporter:e,message:`There was a namespace "*" reexport from the external module "${relativeId(e)}" even though its interop type is "defaultOnly". This will be ignored as namespace reexports only reexport named exports. If this is not intended, either remove or change this reexport or change the value of the "output.interop" option.`,url:getRollupUrl($)}}function errorUnknownOption(e,t,i){return{code:ht,message:`Unknown ${e}: ${t.join(", ")}. Allowed options: ${i.join(", ")}`}}function errorEntryCannotBeExternal(e){return{code:dt,message:`Entry module "${relativeId(e)}" cannot be external.`}}function errorUnresolvedEntry(e){return{code:dt,message:`Could not resolve entry module "${relativeId(e)}".`}}function errorUnresolvedImport(e,t){return{code:pt,exporter:e,id:t,message:`Could not resolve "${e}" from "${relativeId(t)}"`}}function errorUnresolvedImportTreatedAsExternal(e,t){return{code:pt,exporter:e,id:t,message:`"${e}" is imported by "${relativeId(t)}", but could not be resolved – treating it as an external dependency.`,url:getRollupUrl(g)}}function errorUnusedExternalImports(e,t,i){return{code:ft,exporter:e,ids:i,message:`${printQuotedStringList(t,["is","are"])} imported from external module "${e}" but never used in ${printQuotedStringList(i.map((e=>relativeId(e))))}.`,names:t}}function errorFailedValidation(e){return{code:mt,message:e}}function warnDeprecation(e,t,i,s,n){warnDeprecationWithOptions(e,t,i,s.onwarn,s.strictDeprecations,n)}function warnDeprecationWithOptions(e,t,i,s,n,r){if(i||n){const i=errorDeprecation(e,t,r);if(n){return error(i)}s(i)}}const defaultOnWarn=e=>console.warn(e.message||e);function warnUnknownOptions(e,t,i,s,n=/$./){const r=new Set(t);const o=Object.keys(e).filter((e=>!(r.has(e)||n.test(e))));if(o.length>0){s(errorUnknownOption(i,o,[...r].sort()))}}const gt={recommended:{annotations:true,correctVarValueBeforeDeclaration:false,manualPureFunctions:Y,moduleSideEffects:()=>true,propertyReadSideEffects:true,tryCatchDeoptimization:true,unknownGlobalSideEffects:false},safest:{annotations:true,correctVarValueBeforeDeclaration:true,manualPureFunctions:Y,moduleSideEffects:()=>true,propertyReadSideEffects:true,tryCatchDeoptimization:true,unknownGlobalSideEffects:true},smallest:{annotations:true,correctVarValueBeforeDeclaration:false,manualPureFunctions:Y,moduleSideEffects:()=>false,propertyReadSideEffects:false,tryCatchDeoptimization:false,unknownGlobalSideEffects:false}};const yt={es2015:{arrowFunctions:true,constBindings:true,objectShorthand:true,reservedNamesAsProps:true,symbols:true},es5:{arrowFunctions:false,constBindings:false,objectShorthand:false,reservedNamesAsProps:true,symbols:false}};const objectifyOption=e=>e&&typeof e==="object"?e:{};const objectifyOptionWithPresets=(e,t,i,s)=>n=>{if(typeof n==="string"){const r=e[n];if(r){return r}error(errorInvalidOption(t,i,`valid values are ${s}${printQuotedStringList(Object.keys(e))}. You can also supply an object for more fine-grained control`,n))}return objectifyOption(n)};const getOptionWithPreset=(e,t,i,s,n)=>{const r=e?.preset;if(r){const n=t[r];if(n){return{...n,...e}}else{error(errorInvalidOption(`${i}.preset`,s,`valid values are ${printQuotedStringList(Object.keys(t))}`,r))}}return objectifyOptionWithPresets(t,i,s,n)(e)};const normalizePluginOption=async e=>(await asyncFlatten([e])).filter(Boolean);const Et={c:"config",d:"dir",e:"external",f:"format",g:"globals",h:"help",i:"input",m:"sourcemap",n:"name",o:"file",p:"plugin",v:"version",w:"watch"};const xt={external:[],globals:undefined};async function mergeOptions(e,t=xt,i=defaultOnWarn){const s=getCommandOptions(t);const n=await mergeInputOptions(e,s,i);const r=n.onwarn;if(s.output){Object.assign(s,s.output)}const o=ensureArray$1(e.output);if(o.length===0)o.push({});const l=await Promise.all(o.map((e=>mergeOutputOptions(e,s,r))));warnUnknownOptions(s,[...Object.keys(n),...Object.keys(l[0]).filter((e=>e!=="sourcemapIgnoreList"&&e!=="sourcemapPathTransform")),...Object.keys(Et),"bundleConfigAsCjs","config","environment","plugin","silent","failAfterWarnings","stdin","waitForBundleInput","configPlugin"],"CLI flags",r,/^_$|output$|config/);n.output=l;return n}function getCommandOptions(e){const t=e.external&&typeof e.external==="string"?e.external.split(","):[];return{...e,external:t,globals:typeof e.globals==="string"?e.globals.split(",").reduce(((e,i)=>{const[s,n]=i.split(":");e[s]=n;if(!t.includes(s)){t.push(s)}return e}),Object.create(null)):undefined}}async function mergeInputOptions(e,t,i){const getOption=i=>t[i]??e[i];const s={acorn:getOption("acorn"),acornInjectPlugins:e.acornInjectPlugins,cache:e.cache,context:getOption("context"),experimentalCacheExpiry:getOption("experimentalCacheExpiry"),experimentalLogSideEffects:getOption("experimentalLogSideEffects"),external:getExternal(e,t),inlineDynamicImports:getOption("inlineDynamicImports"),input:getOption("input")||[],makeAbsoluteExternalsRelative:getOption("makeAbsoluteExternalsRelative"),manualChunks:getOption("manualChunks"),maxParallelFileOps:getOption("maxParallelFileOps"),maxParallelFileReads:getOption("maxParallelFileReads"),moduleContext:getOption("moduleContext"),onwarn:getOnWarn(e,i),perf:getOption("perf"),plugins:await normalizePluginOption(e.plugins),preserveEntrySignatures:getOption("preserveEntrySignatures"),preserveModules:getOption("preserveModules"),preserveSymlinks:getOption("preserveSymlinks"),shimMissingExports:getOption("shimMissingExports"),strictDeprecations:getOption("strictDeprecations"),treeshake:getObjectOption(e,t,"treeshake",objectifyOptionWithPresets(gt,"treeshake",F,"false, true, ")),watch:getWatch(e,t)};warnUnknownOptions(e,Object.keys(s),"input options",s.onwarn,/^output$/);return s}const getExternal=(e,t)=>{const i=e.external;return typeof i==="function"?(e,s,n)=>i(e,s,n)||t.external.includes(e):[...ensureArray$1(i),...t.external]};const getOnWarn=(e,t)=>e.onwarn?i=>e.onwarn(i,t):t;const getObjectOption=(e,t,i,s=objectifyOption)=>{const n=normalizeObjectOptionValue(t[i],s);const r=normalizeObjectOptionValue(e[i],s);if(n!==undefined){return n&&{...r,...n}}return r};const getWatch=(e,t)=>e.watch!==false&&getObjectOption(e,t,"watch");const isWatchEnabled=e=>{if(Array.isArray(e)){return e.reduce(((e,t)=>typeof t==="boolean"?t:e),false)}return e===true};const normalizeObjectOptionValue=(e,t)=>{if(!e){return e}if(Array.isArray(e)){return e.reduce(((e,i)=>i&&e&&{...e,...t(i)}),{})}return t(e)};async function mergeOutputOptions(e,t,i){const getOption=i=>t[i]??e[i];const s={amd:getObjectOption(e,t,"amd"),assetFileNames:getOption("assetFileNames"),banner:getOption("banner"),chunkFileNames:getOption("chunkFileNames"),compact:getOption("compact"),dir:getOption("dir"),dynamicImportFunction:getOption("dynamicImportFunction"),dynamicImportInCjs:getOption("dynamicImportInCjs"),entryFileNames:getOption("entryFileNames"),esModule:getOption("esModule"),experimentalDeepDynamicChunkOptimization:getOption("experimentalDeepDynamicChunkOptimization"),experimentalMinChunkSize:getOption("experimentalMinChunkSize"),exports:getOption("exports"),extend:getOption("extend"),externalImportAssertions:getOption("externalImportAssertions"),externalLiveBindings:getOption("externalLiveBindings"),file:getOption("file"),footer:getOption("footer"),format:getOption("format"),freeze:getOption("freeze"),generatedCode:getObjectOption(e,t,"generatedCode",objectifyOptionWithPresets(yt,"output.generatedCode",k,"")),globals:getOption("globals"),hoistTransitiveImports:getOption("hoistTransitiveImports"),indent:getOption("indent"),inlineDynamicImports:getOption("inlineDynamicImports"),interop:getOption("interop"),intro:getOption("intro"),manualChunks:getOption("manualChunks"),minifyInternalExports:getOption("minifyInternalExports"),name:getOption("name"),namespaceToStringTag:getOption("namespaceToStringTag"),noConflict:getOption("noConflict"),outro:getOption("outro"),paths:getOption("paths"),plugins:await normalizePluginOption(e.plugins),preferConst:getOption("preferConst"),preserveModules:getOption("preserveModules"),preserveModulesRoot:getOption("preserveModulesRoot"),sanitizeFileName:getOption("sanitizeFileName"),sourcemap:getOption("sourcemap"),sourcemapBaseUrl:getOption("sourcemapBaseUrl"),sourcemapExcludeSources:getOption("sourcemapExcludeSources"),sourcemapFile:getOption("sourcemapFile"),sourcemapIgnoreList:getOption("sourcemapIgnoreList"),sourcemapPathTransform:getOption("sourcemapPathTransform"),strict:getOption("strict"),systemNullSetters:getOption("systemNullSetters"),validate:getOption("validate")};warnUnknownOptions(e,Object.keys(s),"output options",i);return s}const{env:bt={},argv:vt=[],platform:St=""}=typeof process==="undefined"?{}:process;const At="NO_COLOR"in bt||vt.includes("--no-color");const wt="FORCE_COLOR"in bt||vt.includes("--color");const It=St==="win32";const kt=bt.TERM==="dumb";const Ct=h&&h.isatty&&h.isatty(1)&&bt.TERM&&!kt;const _t="CI"in bt&&("GITHUB_ACTIONS"in bt||"GITLAB_CI"in bt||"CIRCLECI"in bt);const Pt=!At&&(wt||It&&!kt||Ct||_t);const replaceClose=(e,t,i,s,n=t.substring(0,e)+s,r=t.substring(e+i.length),o=r.indexOf(i))=>n+(o<0?r:replaceClose(o,r,i,s));const clearBleed=(e,t,i,s,n)=>e<0?i+t+s:i+replaceClose(e,t,s,n)+s;const filterEmpty=(e,t,i=e,s=e.length+1)=>n=>n||!(n===""||n===undefined)?clearBleed((""+n).indexOf(t,s),n,e,t,i):"";const init=(e,t,i)=>filterEmpty(`[${e}m`,`[${t}m`,i);const Nt={reset:init(0,0),bold:init(1,22,"[22m[1m"),dim:init(2,22,"[22m[2m"),italic:init(3,23),underline:init(4,24),inverse:init(7,27),hidden:init(8,28),strikethrough:init(9,29),black:init(30,39),red:init(31,39),green:init(32,39),yellow:init(33,39),blue:init(34,39),magenta:init(35,39),cyan:init(36,39),white:init(37,39),gray:init(90,39),bgBlack:init(40,49),bgRed:init(41,49),bgGreen:init(42,49),bgYellow:init(43,49),bgBlue:init(44,49),bgMagenta:init(45,49),bgCyan:init(46,49),bgWhite:init(47,49),blackBright:init(90,39),redBright:init(91,39),greenBright:init(92,39),yellowBright:init(93,39),blueBright:init(94,39),magentaBright:init(95,39),cyanBright:init(96,39),whiteBright:init(97,39),bgBlackBright:init(100,49),bgRedBright:init(101,49),bgGreenBright:init(102,49),bgYellowBright:init(103,49),bgBlueBright:init(104,49),bgMagentaBright:init(105,49),bgCyanBright:init(106,49),bgWhiteBright:init(107,49)};const createColors=({useColor:e=Pt}={})=>e?Nt:Object.keys(Nt).reduce(((e,t)=>({...e,[t]:String})),{});createColors();const{bold:Rt,cyan:$t,dim:Ot,gray:Tt,green:Dt,red:Mt,underline:Lt,yellow:Bt}=createColors({useColor:s.env.FORCE_COLOR!=="0"&&!s.env.NO_COLOR});const stderr=(...e)=>s.stderr.write(`${e.join("")}\n`);function handleError(e,t=false){const i=e.name||e.cause?.name;const n=i?`${i}: `:"";const r=e.plugin?`(plugin ${e.plugin}) `:"";const o=`${r}${n}${e.message}`;const l=[Rt(Mt(`[!] ${Rt(o.toString())}`))];if(e.url){l.push($t(e.url))}if(e.loc){l.push(`${relativeId(e.loc.file||e.id)} (${e.loc.line}:${e.loc.column})`)}else if(e.id){l.push(relativeId(e.id))}if(e.frame){l.push(Ot(e.frame))}if(e.stack){l.push(Ot(e.stack?.replace(`${n}${e.message}\n`,"")))}l.push("","");stderr(l.join("\n"));if(!t)s.exit(1)}const Ft=",".charCodeAt(0);const Vt=";".charCodeAt(0);const zt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";const jt=new Uint8Array(64);const Ut=new Uint8Array(128);for(let e=0;e<zt.length;e++){const t=zt.charCodeAt(e);jt[e]=t;Ut[t]=e}const Ht=typeof TextDecoder!=="undefined"?new TextDecoder:typeof Buffer!=="undefined"?{decode(e){const t=Buffer.from(e.buffer,e.byteOffset,e.byteLength);return t.toString()}}:{decode(e){let t="";for(let i=0;i<e.length;i++){t+=String.fromCharCode(e[i])}return t}};function decode(e){const t=new Int32Array(5);const i=[];let s=0;do{const n=indexOf(e,s);const r=[];let o=true;let l=0;t[0]=0;for(let i=s;i<n;i++){let s;i=decodeInteger(e,i,t,0);const c=t[0];if(c<l)o=false;l=c;if(hasMoreVlq(e,i,n)){i=decodeInteger(e,i,t,1);i=decodeInteger(e,i,t,2);i=decodeInteger(e,i,t,3);if(hasMoreVlq(e,i,n)){i=decodeInteger(e,i,t,4);s=[c,t[1],t[2],t[3],t[4]]}else{s=[c,t[1],t[2],t[3]]}}else{s=[c]}r.push(s)}if(!o)sort(r);i.push(r);s=n+1}while(s<=e.length);return i}function indexOf(e,t){const i=e.indexOf(";",t);return i===-1?e.length:i}function decodeInteger(e,t,i,s){let n=0;let r=0;let o=0;do{const i=e.charCodeAt(t++);o=Ut[i];n|=(o&31)<<r;r+=5}while(o&32);const l=n&1;n>>>=1;if(l){n=-2147483648|-n}i[s]+=n;return t}function hasMoreVlq(e,t,i){if(t>=i)return false;return e.charCodeAt(t)!==Ft}function sort(e){e.sort(sortComparator)}function sortComparator(e,t){return e[0]-t[0]}function encode(e){const t=new Int32Array(5);const i=1024*16;const s=i-36;const n=new Uint8Array(i);const r=n.subarray(0,s);let o=0;let l="";for(let c=0;c<e.length;c++){const u=e[c];if(c>0){if(o===i){l+=Ht.decode(n);o=0}n[o++]=Vt}if(u.length===0)continue;t[0]=0;for(let e=0;e<u.length;e++){const i=u[e];if(o>s){l+=Ht.decode(r);n.copyWithin(0,s,o);o-=s}if(e>0)n[o++]=Ft;o=encodeInteger(n,o,t,i,0);if(i.length===1)continue;o=encodeInteger(n,o,t,i,1);o=encodeInteger(n,o,t,i,2);o=encodeInteger(n,o,t,i,3);if(i.length===4)continue;o=encodeInteger(n,o,t,i,4)}}return l+Ht.decode(n.subarray(0,o))}function encodeInteger(e,t,i,s,n){const r=s[n];let o=r-i[n];i[n]=r;o=o<0?-o<<1|1:o<<1;do{let i=o&31;o>>>=5;if(o>0)i|=32;e[t++]=jt[i]}while(o>0);return t}class BitSet{constructor(e){this.bits=e instanceof BitSet?e.bits.slice():[]}add(e){this.bits[e>>5]|=1<<(e&31)}has(e){return!!(this.bits[e>>5]&1<<(e&31))}}let Gt=class Chunk{constructor(e,t,i){this.start=e;this.end=t;this.original=i;this.intro="";this.outro="";this.content=i;this.storeName=false;this.edited=false;{this.previous=null;this.next=null}}appendLeft(e){this.outro+=e}appendRight(e){this.intro=this.intro+e}clone(){const e=new Chunk(this.start,this.end,this.original);e.intro=this.intro;e.outro=this.outro;e.content=this.content;e.storeName=this.storeName;e.edited=this.edited;return e}contains(e){return this.start<e&&e<this.end}eachNext(e){let t=this;while(t){e(t);t=t.next}}eachPrevious(e){let t=this;while(t){e(t);t=t.previous}}edit(e,t,i){this.content=e;if(!i){this.intro="";this.outro=""}this.storeName=t;this.edited=true;return this}prependLeft(e){this.outro=e+this.outro}prependRight(e){this.intro=e+this.intro}split(e){const t=e-this.start;const i=this.original.slice(0,t);const s=this.original.slice(t);this.original=i;const n=new Chunk(e,this.end,s);n.outro=this.outro;this.outro="";this.end=e;if(this.edited){n.edit("",false);this.content=""}else{this.content=i}n.next=this.next;if(n.next)n.next.previous=n;n.previous=this;this.next=n;return n}toString(){return this.intro+this.content+this.outro}trimEnd(e){this.outro=this.outro.replace(e,"");if(this.outro.length)return true;const t=this.content.replace(e,"");if(t.length){if(t!==this.content){this.split(this.start+t.length).edit("",undefined,true)}return true}else{this.edit("",undefined,true);this.intro=this.intro.replace(e,"");if(this.intro.length)return true}}trimStart(e){this.intro=this.intro.replace(e,"");if(this.intro.length)return true;const t=this.content.replace(e,"");if(t.length){if(t!==this.content){this.split(this.end-t.length);this.edit("",undefined,true)}return true}else{this.edit("",undefined,true);this.outro=this.outro.replace(e,"");if(this.outro.length)return true}}};function getBtoa(){if(typeof window!=="undefined"&&typeof window.btoa==="function"){return e=>window.btoa(unescape(encodeURIComponent(e)))}else if(typeof Buffer==="function"){return e=>Buffer.from(e,"utf-8").toString("base64")}else{return()=>{throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.")}}}const Wt=getBtoa();class SourceMap{constructor(e){this.version=3;this.file=e.file;this.sources=e.sources;this.sourcesContent=e.sourcesContent;this.names=e.names;this.mappings=encode(e.mappings);if(typeof e.x_google_ignoreList!=="undefined"){this.x_google_ignoreList=e.x_google_ignoreList}}toString(){return JSON.stringify(this)}toUrl(){return"data:application/json;charset=utf-8;base64,"+Wt(this.toString())}}function guessIndent(e){const t=e.split("\n");const i=t.filter((e=>/^\t+/.test(e)));const s=t.filter((e=>/^ {2,}/.test(e)));if(i.length===0&&s.length===0){return null}if(i.length>=s.length){return"\t"}const n=s.reduce(((e,t)=>{const i=/^ +/.exec(t)[0].length;return Math.min(i,e)}),Infinity);return new Array(n+1).join(" ")}function getRelativePath(e,t){const i=e.split(/[/\\]/);const s=t.split(/[/\\]/);i.pop();while(i[0]===s[0]){i.shift();s.shift()}if(i.length){let e=i.length;while(e--)i[e]=".."}return i.concat(s).join("/")}const qt=Object.prototype.toString;function isObject$1(e){return qt.call(e)==="[object Object]"}function getLocator(e){const t=e.split("\n");const i=[];for(let e=0,s=0;e<t.length;e++){i.push(s);s+=t[e].length+1}return function locate(e){let t=0;let s=i.length;while(t<s){const n=t+s>>1;if(e<i[n]){s=n}else{t=n+1}}const n=t-1;const r=e-i[n];return{line:n,column:r}}}class Mappings{constructor(e){this.hires=e;this.generatedCodeLine=0;this.generatedCodeColumn=0;this.raw=[];this.rawSegments=this.raw[this.generatedCodeLine]=[];this.pending=null}addEdit(e,t,i,s){if(t.length){const t=[this.generatedCodeColumn,e,i.line,i.column];if(s>=0){t.push(s)}this.rawSegments.push(t)}else if(this.pending){this.rawSegments.push(this.pending)}this.advance(t);this.pending=null}addUneditedChunk(e,t,i,s,n){let r=t.start;let o=true;while(r<t.end){if(this.hires||o||n.has(r)){this.rawSegments.push([this.generatedCodeColumn,e,s.line,s.column])}if(i[r]==="\n"){s.line+=1;s.column=0;this.generatedCodeLine+=1;this.raw[this.generatedCodeLine]=this.rawSegments=[];this.generatedCodeColumn=0;o=true}else{s.column+=1;this.generatedCodeColumn+=1;o=false}r+=1}this.pending=null}advance(e){if(!e)return;const t=e.split("\n");if(t.length>1){for(let e=0;e<t.length-1;e++){this.generatedCodeLine++;this.raw[this.generatedCodeLine]=this.rawSegments=[]}this.generatedCodeColumn=0}this.generatedCodeColumn+=t[t.length-1].length}}const Kt="\n";const Yt={insertLeft:false,insertRight:false,storeName:false};class MagicString{constructor(e,t={}){const i=new Gt(0,e.length,e);Object.defineProperties(this,{original:{writable:true,value:e},outro:{writable:true,value:""},intro:{writable:true,value:""},firstChunk:{writable:true,value:i},lastChunk:{writable:true,value:i},lastSearchedChunk:{writable:true,value:i},byStart:{writable:true,value:{}},byEnd:{writable:true,value:{}},filename:{writable:true,value:t.filename},indentExclusionRanges:{writable:true,value:t.indentExclusionRanges},sourcemapLocations:{writable:true,value:new BitSet},storedNames:{writable:true,value:{}},indentStr:{writable:true,value:undefined},ignoreList:{writable:true,value:t.ignoreList}});this.byStart[0]=i;this.byEnd[e.length]=i}addSourcemapLocation(e){this.sourcemapLocations.add(e)}append(e){if(typeof e!=="string")throw new TypeError("outro content must be a string");this.outro+=e;return this}appendLeft(e,t){if(typeof t!=="string")throw new TypeError("inserted content must be a string");this._split(e);const i=this.byEnd[e];if(i){i.appendLeft(t)}else{this.intro+=t}return this}appendRight(e,t){if(typeof t!=="string")throw new TypeError("inserted content must be a string");this._split(e);const i=this.byStart[e];if(i){i.appendRight(t)}else{this.outro+=t}return this}clone(){const e=new MagicString(this.original,{filename:this.filename});let t=this.firstChunk;let i=e.firstChunk=e.lastSearchedChunk=t.clone();while(t){e.byStart[i.start]=i;e.byEnd[i.end]=i;const s=t.next;const n=s&&s.clone();if(n){i.next=n;n.previous=i;i=n}t=s}e.lastChunk=i;if(this.indentExclusionRanges){e.indentExclusionRanges=this.indentExclusionRanges.slice()}e.sourcemapLocations=new BitSet(this.sourcemapLocations);e.intro=this.intro;e.outro=this.outro;return e}generateDecodedMap(e){e=e||{};const t=0;const i=Object.keys(this.storedNames);const s=new Mappings(e.hires);const n=getLocator(this.original);if(this.intro){s.advance(this.intro)}this.firstChunk.eachNext((e=>{const r=n(e.start);if(e.intro.length)s.advance(e.intro);if(e.edited){s.addEdit(t,e.content,r,e.storeName?i.indexOf(e.original):-1)}else{s.addUneditedChunk(t,e,this.original,r,this.sourcemapLocations)}if(e.outro.length)s.advance(e.outro)}));return{file:e.file?e.file.split(/[/\\]/).pop():undefined,sources:[e.source?getRelativePath(e.file||"",e.source):e.file||""],sourcesContent:e.includeContent?[this.original]:undefined,names:i,mappings:s.raw,x_google_ignoreList:this.ignoreList?[t]:undefined}}generateMap(e){return new SourceMap(this.generateDecodedMap(e))}_ensureindentStr(){if(this.indentStr===undefined){this.indentStr=guessIndent(this.original)}}_getRawIndentString(){this._ensureindentStr();return this.indentStr}getIndentString(){this._ensureindentStr();return this.indentStr===null?"\t":this.indentStr}indent(e,t){const i=/^[^\r\n]/gm;if(isObject$1(e)){t=e;e=undefined}if(e===undefined){this._ensureindentStr();e=this.indentStr||"\t"}if(e==="")return this;t=t||{};const s={};if(t.exclude){const e=typeof t.exclude[0]==="number"?[t.exclude]:t.exclude;e.forEach((e=>{for(let t=e[0];t<e[1];t+=1){s[t]=true}}))}let n=t.indentStart!==false;const replacer=t=>{if(n)return`${e}${t}`;n=true;return t};this.intro=this.intro.replace(i,replacer);let r=0;let o=this.firstChunk;while(o){const t=o.end;if(o.edited){if(!s[r]){o.content=o.content.replace(i,replacer);if(o.content.length){n=o.content[o.content.length-1]==="\n"}}}else{r=o.start;while(r<t){if(!s[r]){const t=this.original[r];if(t==="\n"){n=true}else if(t!=="\r"&&n){n=false;if(r===o.start){o.prependRight(e)}else{this._splitChunk(o,r);o=o.next;o.prependRight(e)}}}r+=1}}r=o.end;o=o.next}this.outro=this.outro.replace(i,replacer);return this}insert(){throw new Error("magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)")}insertLeft(e,t){if(!Yt.insertLeft){console.warn("magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead");Yt.insertLeft=true}return this.appendLeft(e,t)}insertRight(e,t){if(!Yt.insertRight){console.warn("magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead");Yt.insertRight=true}return this.prependRight(e,t)}move(e,t,i){if(i>=e&&i<=t)throw new Error("Cannot move a selection inside itself");this._split(e);this._split(t);this._split(i);const s=this.byStart[e];const n=this.byEnd[t];const r=s.previous;const o=n.next;const l=this.byStart[i];if(!l&&n===this.lastChunk)return this;const c=l?l.previous:this.lastChunk;if(r)r.next=o;if(o)o.previous=r;if(c)c.next=s;if(l)l.previous=n;if(!s.previous)this.firstChunk=n.next;if(!n.next){this.lastChunk=s.previous;this.lastChunk.next=null}s.previous=c;n.next=l||null;if(!c)this.firstChunk=s;if(!l)this.lastChunk=n;return this}overwrite(e,t,i,s){s=s||{};return this.update(e,t,i,{...s,overwrite:!s.contentOnly})}update(e,t,i,s){if(typeof i!=="string")throw new TypeError("replacement content must be a string");while(e<0)e+=this.original.length;while(t<0)t+=this.original.length;if(t>this.original.length)throw new Error("end is out of bounds");if(e===t)throw new Error("Cannot overwrite a zero-length range – use appendLeft or prependRight instead");this._split(e);this._split(t);if(s===true){if(!Yt.storeName){console.warn("The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string");Yt.storeName=true}s={storeName:true}}const n=s!==undefined?s.storeName:false;const r=s!==undefined?s.overwrite:false;if(n){const i=this.original.slice(e,t);Object.defineProperty(this.storedNames,i,{writable:true,value:true,enumerable:true})}const o=this.byStart[e];const l=this.byEnd[t];if(o){let e=o;while(e!==l){if(e.next!==this.byStart[e.end]){throw new Error("Cannot overwrite across a split point")}e=e.next;e.edit("",false)}o.edit(i,n,!r)}else{const s=new Gt(e,t,"").edit(i,n);l.next=s;s.previous=l}return this}prepend(e){if(typeof e!=="string")throw new TypeError("outro content must be a string");this.intro=e+this.intro;return this}prependLeft(e,t){if(typeof t!=="string")throw new TypeError("inserted content must be a string");this._split(e);const i=this.byEnd[e];if(i){i.prependLeft(t)}else{this.intro=t+this.intro}return this}prependRight(e,t){if(typeof t!=="string")throw new TypeError("inserted content must be a string");this._split(e);const i=this.byStart[e];if(i){i.prependRight(t)}else{this.outro=t+this.outro}return this}remove(e,t){while(e<0)e+=this.original.length;while(t<0)t+=this.original.length;if(e===t)return this;if(e<0||t>this.original.length)throw new Error("Character is out of bounds");if(e>t)throw new Error("end must be greater than start");this._split(e);this._split(t);let i=this.byStart[e];while(i){i.intro="";i.outro="";i.edit("");i=t>i.end?this.byStart[i.end]:null}return this}lastChar(){if(this.outro.length)return this.outro[this.outro.length-1];let e=this.lastChunk;do{if(e.outro.length)return e.outro[e.outro.length-1];if(e.content.length)return e.content[e.content.length-1];if(e.intro.length)return e.intro[e.intro.length-1]}while(e=e.previous);if(this.intro.length)return this.intro[this.intro.length-1];return""}lastLine(){let e=this.outro.lastIndexOf(Kt);if(e!==-1)return this.outro.substr(e+1);let t=this.outro;let i=this.lastChunk;do{if(i.outro.length>0){e=i.outro.lastIndexOf(Kt);if(e!==-1)return i.outro.substr(e+1)+t;t=i.outro+t}if(i.content.length>0){e=i.content.lastIndexOf(Kt);if(e!==-1)return i.content.substr(e+1)+t;t=i.content+t}if(i.intro.length>0){e=i.intro.lastIndexOf(Kt);if(e!==-1)return i.intro.substr(e+1)+t;t=i.intro+t}}while(i=i.previous);e=this.intro.lastIndexOf(Kt);if(e!==-1)return this.intro.substr(e+1)+t;return this.intro+t}slice(e=0,t=this.original.length){while(e<0)e+=this.original.length;while(t<0)t+=this.original.length;let i="";let s=this.firstChunk;while(s&&(s.start>e||s.end<=e)){if(s.start<t&&s.end>=t){return i}s=s.next}if(s&&s.edited&&s.start!==e)throw new Error(`Cannot use replaced character ${e} as slice start anchor.`);const n=s;while(s){if(s.intro&&(n!==s||s.start===e)){i+=s.intro}const r=s.start<t&&s.end>=t;if(r&&s.edited&&s.end!==t)throw new Error(`Cannot use replaced character ${t} as slice end anchor.`);const o=n===s?e-s.start:0;const l=r?s.content.length+t-s.end:s.content.length;i+=s.content.slice(o,l);if(s.outro&&(!r||s.end===t)){i+=s.outro}if(r){break}s=s.next}return i}snip(e,t){const i=this.clone();i.remove(0,e);i.remove(t,i.original.length);return i}_split(e){if(this.byStart[e]||this.byEnd[e])return;let t=this.lastSearchedChunk;const i=e>t.end;while(t){if(t.contains(e))return this._splitChunk(t,e);t=i?this.byStart[t.end]:this.byEnd[t.start]}}_splitChunk(e,t){if(e.edited&&e.content.length){const i=getLocator(this.original)(t);throw new Error(`Cannot split a chunk that has already been edited (${i.line}:${i.column} – "${e.original}")`)}const i=e.split(t);this.byEnd[t]=e;this.byStart[t]=i;this.byEnd[i.end]=i;if(e===this.lastChunk)this.lastChunk=i;this.lastSearchedChunk=e;return true}toString(){let e=this.intro;let t=this.firstChunk;while(t){e+=t.toString();t=t.next}return e+this.outro}isEmpty(){let e=this.firstChunk;do{if(e.intro.length&&e.intro.trim()||e.content.length&&e.content.trim()||e.outro.length&&e.outro.trim())return false}while(e=e.next);return true}length(){let e=this.firstChunk;let t=0;do{t+=e.intro.length+e.content.length+e.outro.length}while(e=e.next);return t}trimLines(){return this.trim("[\\r\\n]")}trim(e){return this.trimStart(e).trimEnd(e)}trimEndAborted(e){const t=new RegExp((e||"\\s")+"+$");this.outro=this.outro.replace(t,"");if(this.outro.length)return true;let i=this.lastChunk;do{const e=i.end;const s=i.trimEnd(t);if(i.end!==e){if(this.lastChunk===i){this.lastChunk=i.next}this.byEnd[i.end]=i;this.byStart[i.next.start]=i.next;this.byEnd[i.next.end]=i.next}if(s)return true;i=i.previous}while(i);return false}trimEnd(e){this.trimEndAborted(e);return this}trimStartAborted(e){const t=new RegExp("^"+(e||"\\s")+"+");this.intro=this.intro.replace(t,"");if(this.intro.length)return true;let i=this.firstChunk;do{const e=i.end;const s=i.trimStart(t);if(i.end!==e){if(i===this.lastChunk)this.lastChunk=i.next;this.byEnd[i.end]=i;this.byStart[i.next.start]=i.next;this.byEnd[i.next.end]=i.next}if(s)return true;i=i.next}while(i);return false}trimStart(e){this.trimStartAborted(e);return this}hasChanged(){return this.original!==this.toString()}_replaceRegexp(e,t){function getReplacement(e,i){if(typeof t==="string"){return t.replace(/\$(\$|&|\d+)/g,((t,i)=>{if(i==="$")return"$";if(i==="&")return e[0];const s=+i;if(s<e.length)return e[+i];return`$${i}`}))}else{return t(...e,e.index,i,e.groups)}}function matchAll(e,t){let i;const s=[];while(i=e.exec(t)){s.push(i)}return s}if(e.global){const t=matchAll(e,this.original);t.forEach((e=>{if(e.index!=null)this.overwrite(e.index,e.index+e[0].length,getReplacement(e,this.original))}))}else{const t=this.original.match(e);if(t&&t.index!=null)this.overwrite(t.index,t.index+t[0].length,getReplacement(t,this.original))}return this}_replaceString(e,t){const{original:i}=this;const s=i.indexOf(e);if(s!==-1){this.overwrite(s,s+e.length,t)}return this}replace(e,t){if(typeof e==="string"){return this._replaceString(e,t)}return this._replaceRegexp(e,t)}_replaceAllString(e,t){const{original:i}=this;const s=e.length;for(let n=i.indexOf(e);n!==-1;n=i.indexOf(e,n+s)){this.overwrite(n,n+s,t)}return this}replaceAll(e,t){if(typeof e==="string"){return this._replaceAllString(e,t)}if(!e.global){throw new TypeError("MagicString.prototype.replaceAll called with a non-global RegExp argument")}return this._replaceRegexp(e,t)}}const Qt=Object.prototype.hasOwnProperty;let Xt=class Bundle{constructor(e={}){this.intro=e.intro||"";this.separator=e.separator!==undefined?e.separator:"\n";this.sources=[];this.uniqueSources=[];this.uniqueSourceIndexByFilename={}}addSource(e){if(e instanceof MagicString){return this.addSource({content:e,filename:e.filename,separator:this.separator})}if(!isObject$1(e)||!e.content){throw new Error("bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`")}["filename","ignoreList","indentExclusionRanges","separator"].forEach((t=>{if(!Qt.call(e,t))e[t]=e.content[t]}));if(e.separator===undefined){e.separator=this.separator}if(e.filename){if(!Qt.call(this.uniqueSourceIndexByFilename,e.filename)){this.uniqueSourceIndexByFilename[e.filename]=this.uniqueSources.length;this.uniqueSources.push({filename:e.filename,content:e.content.original})}else{const t=this.uniqueSources[this.uniqueSourceIndexByFilename[e.filename]];if(e.content.original!==t.content){throw new Error(`Illegal source: same filename (${e.filename}), different contents`)}}}this.sources.push(e);return this}append(e,t){this.addSource({content:new MagicString(e),separator:t&&t.separator||""});return this}clone(){const e=new Bundle({intro:this.intro,separator:this.separator});this.sources.forEach((t=>{e.addSource({filename:t.filename,content:t.content.clone(),separator:t.separator})}));return e}generateDecodedMap(e={}){const t=[];let i=undefined;this.sources.forEach((e=>{Object.keys(e.content.storedNames).forEach((e=>{if(!~t.indexOf(e))t.push(e)}))}));const s=new Mappings(e.hires);if(this.intro){s.advance(this.intro)}this.sources.forEach(((e,n)=>{if(n>0){s.advance(this.separator)}const r=e.filename?this.uniqueSourceIndexByFilename[e.filename]:-1;const o=e.content;const l=getLocator(o.original);if(o.intro){s.advance(o.intro)}o.firstChunk.eachNext((i=>{const n=l(i.start);if(i.intro.length)s.advance(i.intro);if(e.filename){if(i.edited){s.addEdit(r,i.content,n,i.storeName?t.indexOf(i.original):-1)}else{s.addUneditedChunk(r,i,o.original,n,o.sourcemapLocations)}}else{s.advance(i.content)}if(i.outro.length)s.advance(i.outro)}));if(o.outro){s.advance(o.outro)}if(e.ignoreList&&r!==-1){if(i===undefined){i=[]}i.push(r)}}));return{file:e.file?e.file.split(/[/\\]/).pop():undefined,sources:this.uniqueSources.map((t=>e.file?getRelativePath(e.file,t.filename):t.filename)),sourcesContent:this.uniqueSources.map((t=>e.includeContent?t.content:null)),names:t,mappings:s.raw,x_google_ignoreList:i}}generateMap(e){return new SourceMap(this.generateDecodedMap(e))}getIndentString(){const e={};this.sources.forEach((t=>{const i=t.content._getRawIndentString();if(i===null)return;if(!e[i])e[i]=0;e[i]+=1}));return Object.keys(e).sort(((t,i)=>e[t]-e[i]))[0]||"\t"}indent(e){if(!arguments.length){e=this.getIndentString()}if(e==="")return this;let t=!this.intro||this.intro.slice(-1)==="\n";this.sources.forEach(((i,s)=>{const n=i.separator!==undefined?i.separator:this.separator;const r=t||s>0&&/\r?\n$/.test(n);i.content.indent(e,{exclude:i.indentExclusionRanges,indentStart:r});t=i.content.lastChar()==="\n"}));if(this.intro){this.intro=e+this.intro.replace(/^[^\n]/gm,((t,i)=>i>0?e+t:t))}return this}prepend(e){this.intro=e+this.intro;return this}toString(){const e=this.sources.map(((e,t)=>{const i=e.separator!==undefined?e.separator:this.separator;const s=(t>0?i:"")+e.content.toString();return s})).join("");return this.intro+e}isEmpty(){if(this.intro.length&&this.intro.trim())return false;if(this.sources.some((e=>!e.content.isEmpty())))return false;return true}length(){return this.sources.reduce(((e,t)=>e+t.content.length()),this.intro.length)}trimLines(){return this.trim("[\\r\\n]")}trim(e){return this.trimStart(e).trimEnd(e)}trimStart(e){const t=new RegExp("^"+(e||"\\s")+"+");this.intro=this.intro.replace(t,"");if(!this.intro){let t;let i=0;do{t=this.sources[i++];if(!t){break}}while(!t.content.trimStartAborted(e))}return this}trimEnd(e){const t=new RegExp((e||"\\s")+"+$");let i;let s=this.sources.length-1;do{i=this.sources[s--];if(!i){this.intro=this.intro.replace(t,"");break}}while(!i.content.trimEndAborted(e));return this}};const Zt=/[\n\r'\\\u2028\u2029]/;const Jt=/([\n\r'\u2028\u2029])/g;const ei=/\\/g;function escapeId(e){if(!Zt.test(e))return e;return e.replace(ei,"\\\\").replace(Jt,"\\$1")}class ExternalChunk{constructor(e,t,i){this.options=t;this.inputBase=i;this.defaultVariableName="";this.namespaceVariableName="";this.variableName="";this.fileName=null;this.importAssertions=null;this.id=e.id;this.moduleInfo=e.info;this.renormalizeRenderPath=e.renormalizeRenderPath;this.suggestedVariableName=e.suggestedVariableName}getFileName(){if(this.fileName){return this.fileName}const{paths:e}=this.options;return this.fileName=(typeof e==="function"?e(this.id):e[this.id])||(this.renormalizeRenderPath?normalize(r.relative(this.inputBase,this.id)):this.id)}getImportAssertions(e){return this.importAssertions||(this.importAssertions=formatAssertions(this.options.format==="es"&&this.options.externalImportAssertions&&this.moduleInfo.assertions,e))}getImportPath(e){return escapeId(this.renormalizeRenderPath?getImportPath(e,this.getFileName(),this.options.format==="amd",false):this.getFileName())}}function formatAssertions(e,{getObject:t}){if(!e){return null}const i=Object.entries(e).map((([e,t])=>[e,`'${t}'`]));if(i.length>0){return t(i,{lineBreakIndent:null})}return null}function getOrCreate(e,t,i){const s=e.get(t);if(s!==undefined){return s}const n=i();e.set(t,n);return n}function getNewSet(){return new Set}function getNewArray(){return[]}const ti=Symbol("Unknown Key");const ii=Symbol("Unknown Non-Accessor Key");const si=Symbol("Unknown Integer");const ni=Symbol("Symbol.toStringTag");const ri=[];const oi=[ti];const ai=[ii];const li=[si];const ci=Symbol("Entities");class PathTracker{constructor(){this.entityPaths=Object.create(null,{[ci]:{value:new Set}})}trackEntityAtPathAndGetIfTracked(e,t){const i=this.getEntities(e);if(i.has(t))return true;i.add(t);return false}withTrackedEntityAtPath(e,t,i,s){const n=this.getEntities(e);if(n.has(t))return s;n.add(t);const r=i();n.delete(t);return r}getEntities(e){let t=this.entityPaths;for(const i of e){t=t[i]=t[i]||Object.create(null,{[ci]:{value:new Set}})}return t[ci]}}const ui=new PathTracker;class DiscriminatedPathTracker{constructor(){this.entityPaths=Object.create(null,{[ci]:{value:new Map}})}trackEntityAtPathAndGetIfTracked(e,t,i){let s=this.entityPaths;for(const t of e){s=s[t]=s[t]||Object.create(null,{[ci]:{value:new Map}})}const n=getOrCreate(s[ci],t,getNewSet);if(n.has(i))return true;n.add(i);return false}}const hi=Symbol("Unknown Value");const di=Symbol("Unknown Truthy Value");class ExpressionEntity{constructor(){this.included=false}deoptimizeArgumentsOnInteractionAtPath(e,t,i){deoptimizeInteraction(e)}deoptimizePath(e){}getLiteralValueAtPath(e,t,i){return hi}getReturnExpressionWhenCalledAtPath(e,t,i,s){return fi}hasEffectsOnInteractionAtPath(e,t,i){return true}include(e,t,i){this.included=true}includeCallArguments(e,t){for(const i of t){i.include(e,false)}}shouldBeIncluded(e){return true}}const pi=new class UnknownExpression extends ExpressionEntity{};const fi=[pi,false];const deoptimizeInteraction=e=>{for(const t of e.args){t?.deoptimizePath(oi)}};const mi=0;const gi=1;const yi=2;const Ei={args:[null],type:mi};const xi={args:[null,pi],type:gi};const bi={args:[null],type:yi,withNew:false};class Variable extends ExpressionEntity{constructor(e){super();this.name=e;this.alwaysRendered=false;this.forbiddenNames=null;this.initReached=false;this.isId=false;this.isReassigned=false;this.kind=null;this.renderBaseName=null;this.renderName=null}addReference(e){}forbidName(e){(this.forbiddenNames||(this.forbiddenNames=new Set)).add(e)}getBaseVariableName(){return this.renderBaseName||this.renderName||this.name}getName(e,t){if(t?.(this)){return this.name}const i=this.renderName||this.name;return this.renderBaseName?`${this.renderBaseName}${e(i)}`:i}hasEffectsOnInteractionAtPath(e,{type:t},i){return t!==mi||e.length>0}include(){this.included=true}markCalledFromTryStatement(){}setRenderNames(e,t){this.renderBaseName=e;this.renderName=t}}class ExternalVariable extends Variable{constructor(e,t){super(t);this.referenced=false;this.module=e;this.isNamespace=t==="*"}addReference(e){this.referenced=true;if(this.name==="default"||this.name==="*"){this.module.suggestName(e.name)}}hasEffectsOnInteractionAtPath(e,{type:t}){return t!==mi||e.length>(this.isNamespace?1:0)}include(){if(!this.included){this.included=true;this.module.used=true}}}const vi=new Set(["await","break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","eval","export","extends","false","finally","for","function","if","implements","import","in","instanceof","interface","let","NaN","new","null","package","private","protected","public","return","static","super","switch","this","throw","true","try","typeof","undefined","var","void","while","with","yield"]);const Si=vi;const Ai=/[^\w$]/g;const startsWithDigit=e=>/\d/.test(e[0]);const needsEscape=e=>startsWithDigit(e)||Si.has(e)||e==="arguments";function isLegal(e){if(needsEscape(e)){return false}return!Ai.test(e)}function makeLegal(e){e=e.replace(/-(\w)/g,((e,t)=>t.toUpperCase())).replace(Ai,"_");if(needsEscape(e))e=`_${e}`;return e||"_"}class ExternalModule{constructor(e,t,i,s,n,r){this.options=e;this.id=t;this.renormalizeRenderPath=n;this.dynamicImporters=[];this.execIndex=Infinity;this.exportedVariables=new Map;this.importers=[];this.reexported=false;this.used=false;this.declarations=new Map;this.mostCommonSuggestion=0;this.nameSuggestions=new Map;this.suggestedVariableName=makeLegal(t.split(/[/\\]/).pop());const{importers:o,dynamicImporters:l}=this;const c=this.info={assertions:r,ast:null,code:null,dynamicallyImportedIdResolutions:Y,dynamicallyImportedIds:Y,get dynamicImporters(){return l.sort()},exportedBindings:null,exports:null,hasDefaultExport:null,get hasModuleSideEffects(){warnDeprecation("Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.",W,true,e);return c.moduleSideEffects},id:t,implicitlyLoadedAfterOneOf:Y,implicitlyLoadedBefore:Y,importedIdResolutions:Y,importedIds:Y,get importers(){return o.sort()},isEntry:false,isExternal:true,isIncluded:null,meta:s,moduleSideEffects:i,syntheticNamedExports:false};Object.defineProperty(this.info,"hasModuleSideEffects",{enumerable:false})}getVariableForExportName(e){const t=this.declarations.get(e);if(t)return[t];const i=new ExternalVariable(this,e);this.declarations.set(e,i);this.exportedVariables.set(i,e);return[i]}suggestName(e){const t=(this.nameSuggestions.get(e)??0)+1;this.nameSuggestions.set(e,t);if(t>this.mostCommonSuggestion){this.mostCommonSuggestion=t;this.suggestedVariableName=e}}warnUnusedImports(){const e=[...this.declarations].filter((([e,t])=>e!=="*"&&!t.included&&!this.reexported&&!t.referenced)).map((([e])=>e));if(e.length===0)return;const t=new Set;for(const i of e){for(const e of this.declarations.get(i).module.importers){t.add(e)}}const i=[...t];this.options.onwarn(errorUnusedExternalImports(this.id,e,i))}}function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}function getAugmentedNamespace(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var i=function a(){if(this instanceof a){var e=[null];e.push.apply(e,arguments);var i=Function.bind.apply(t,e);return new i}return t.apply(this,arguments)};i.prototype=t.prototype}else i={};Object.defineProperty(i,"__esModule",{value:true});Object.keys(e).forEach((function(t){var s=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(i,t,s.get?s:{enumerable:true,get:function(){return e[t]}})}));return i}var wi={};const Ii=o;const ki="\\\\/";const Ci=`[^${ki}]`;const _i="\\.";const Pi="\\+";const Ni="\\?";const Ri="\\/";const $i="(?=.)";const Oi="[^/]";const Ti=`(?:${Ri}|$)`;const Di=`(?:^|${Ri})`;const Mi=`${_i}{1,2}${Ti}`;const Li=`(?!${_i})`;const Bi=`(?!${Di}${Mi})`;const Fi=`(?!${_i}{0,1}${Ti})`;const Vi=`(?!${Mi})`;const zi=`[^.${Ri}]`;const ji=`${Oi}*?`;const Ui={DOT_LITERAL:_i,PLUS_LITERAL:Pi,QMARK_LITERAL:Ni,SLASH_LITERAL:Ri,ONE_CHAR:$i,QMARK:Oi,END_ANCHOR:Ti,DOTS_SLASH:Mi,NO_DOT:Li,NO_DOTS:Bi,NO_DOT_SLASH:Fi,NO_DOTS_SLASH:Vi,QMARK_NO_DOT:zi,STAR:ji,START_ANCHOR:Di};const Hi={...Ui,SLASH_LITERAL:`[${ki}]`,QMARK:Ci,STAR:`${Ci}*?`,DOTS_SLASH:`${_i}{1,2}(?:[${ki}]|$)`,NO_DOT:`(?!${_i})`,NO_DOTS:`(?!(?:^|[${ki}])${_i}{1,2}(?:[${ki}]|$))`,NO_DOT_SLASH:`(?!${_i}{0,1}(?:[${ki}]|$))`,NO_DOTS_SLASH:`(?!${_i}{1,2}(?:[${ki}]|$))`,QMARK_NO_DOT:`[^.${ki}]`,START_ANCHOR:`(?:^|[${ki}])`,END_ANCHOR:`(?:[${ki}]|$)`};const Gi={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"};var Wi={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Gi,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:Ii.sep,extglobChars(e){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(e){return e===true?Hi:Ui}};(function(e){const t=o;const i=process.platform==="win32";const{REGEX_BACKSLASH:s,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:l}=Wi;e.isObject=e=>e!==null&&typeof e==="object"&&!Array.isArray(e);e.hasRegexChars=e=>r.test(e);e.isRegexChar=t=>t.length===1&&e.hasRegexChars(t);e.escapeRegex=e=>e.replace(l,"\\$1");e.toPosixSlashes=e=>e.replace(s,"/");e.removeBackslashes=e=>e.replace(n,(e=>e==="\\"?"":e));e.supportsLookbehinds=()=>{const e=process.version.slice(1).split(".").map(Number);if(e.length===3&&e[0]>=9||e[0]===8&&e[1]>=10){return true}return false};e.isWindows=e=>{if(e&&typeof e.windows==="boolean"){return e.windows}return i===true||t.sep==="\\"};e.escapeLast=(t,i,s)=>{const n=t.lastIndexOf(i,s);if(n===-1)return t;if(t[n-1]==="\\")return e.escapeLast(t,i,n-1);return`${t.slice(0,n)}\\${t.slice(n)}`};e.removePrefix=(e,t={})=>{let i=e;if(i.startsWith("./")){i=i.slice(2);t.prefix="./"}return i};e.wrapOutput=(e,t={},i={})=>{const s=i.contains?"":"^";const n=i.contains?"":"$";let r=`${s}(?:${e})${n}`;if(t.negated===true){r=`(?:^(?!${r}).*$)`}return r}})(wi);const qi=wi;const{CHAR_ASTERISK:Ki,CHAR_AT:Yi,CHAR_BACKWARD_SLASH:Qi,CHAR_COMMA:Xi,CHAR_DOT:Zi,CHAR_EXCLAMATION_MARK:Ji,CHAR_FORWARD_SLASH:ts,CHAR_LEFT_CURLY_BRACE:is,CHAR_LEFT_PARENTHESES:ss,CHAR_LEFT_SQUARE_BRACKET:ns,CHAR_PLUS:rs,CHAR_QUESTION_MARK:os,CHAR_RIGHT_CURLY_BRACE:as,CHAR_RIGHT_PARENTHESES:ls,CHAR_RIGHT_SQUARE_BRACKET:cs}=Wi;const isPathSeparator=e=>e===ts||e===Qi;const depth=e=>{if(e.isPrefix!==true){e.depth=e.isGlobstar?Infinity:1}};const scan$1=(e,t)=>{const i=t||{};const s=e.length-1;const n=i.parts===true||i.scanToEnd===true;const r=[];const o=[];const l=[];let c=e;let u=-1;let h=0;let d=0;let p=false;let f=false;let m=false;let g=false;let y=false;let E=false;let x=false;let b=false;let v=false;let S=false;let A=0;let w;let I;let k={value:"",depth:0,isGlob:false};const eos=()=>u>=s;const peek=()=>c.charCodeAt(u+1);const advance=()=>{w=I;return c.charCodeAt(++u)};while(u<s){I=advance();let e;if(I===Qi){x=k.backslashes=true;I=advance();if(I===is){E=true}continue}if(E===true||I===is){A++;while(eos()!==true&&(I=advance())){if(I===Qi){x=k.backslashes=true;advance();continue}if(I===is){A++;continue}if(E!==true&&I===Zi&&(I=advance())===Zi){p=k.isBrace=true;m=k.isGlob=true;S=true;if(n===true){continue}break}if(E!==true&&I===Xi){p=k.isBrace=true;m=k.isGlob=true;S=true;if(n===true){continue}break}if(I===as){A--;if(A===0){E=false;p=k.isBrace=true;S=true;break}}}if(n===true){continue}break}if(I===ts){r.push(u);o.push(k);k={value:"",depth:0,isGlob:false};if(S===true)continue;if(w===Zi&&u===h+1){h+=2;continue}d=u+1;continue}if(i.noext!==true){const e=I===rs||I===Yi||I===Ki||I===os||I===Ji;if(e===true&&peek()===ss){m=k.isGlob=true;g=k.isExtglob=true;S=true;if(I===Ji&&u===h){v=true}if(n===true){while(eos()!==true&&(I=advance())){if(I===Qi){x=k.backslashes=true;I=advance();continue}if(I===ls){m=k.isGlob=true;S=true;break}}continue}break}}if(I===Ki){if(w===Ki)y=k.isGlobstar=true;m=k.isGlob=true;S=true;if(n===true){continue}break}if(I===os){m=k.isGlob=true;S=true;if(n===true){continue}break}if(I===ns){while(eos()!==true&&(e=advance())){if(e===Qi){x=k.backslashes=true;advance();continue}if(e===cs){f=k.isBracket=true;m=k.isGlob=true;S=true;break}}if(n===true){continue}break}if(i.nonegate!==true&&I===Ji&&u===h){b=k.negated=true;h++;continue}if(i.noparen!==true&&I===ss){m=k.isGlob=true;if(n===true){while(eos()!==true&&(I=advance())){if(I===ss){x=k.backslashes=true;I=advance();continue}if(I===ls){S=true;break}}continue}break}if(m===true){S=true;if(n===true){continue}break}}if(i.noext===true){g=false;m=false}let C=c;let _="";let P="";if(h>0){_=c.slice(0,h);c=c.slice(h);d-=h}if(C&&m===true&&d>0){C=c.slice(0,d);P=c.slice(d)}else if(m===true){C="";P=c}else{C=c}if(C&&C!==""&&C!=="/"&&C!==c){if(isPathSeparator(C.charCodeAt(C.length-1))){C=C.slice(0,-1)}}if(i.unescape===true){if(P)P=qi.removeBackslashes(P);if(C&&x===true){C=qi.removeBackslashes(C)}}const N={prefix:_,input:e,start:h,base:C,glob:P,isBrace:p,isBracket:f,isGlob:m,isExtglob:g,isGlobstar:y,negated:b,negatedExtglob:v};if(i.tokens===true){N.maxDepth=0;if(!isPathSeparator(I)){o.push(k)}N.tokens=o}if(i.parts===true||i.tokens===true){let t;for(let s=0;s<r.length;s++){const n=t?t+1:h;const c=r[s];const u=e.slice(n,c);if(i.tokens){if(s===0&&h!==0){o[s].isPrefix=true;o[s].value=_}else{o[s].value=u}depth(o[s]);N.maxDepth+=o[s].depth}if(s!==0||u!==""){l.push(u)}t=c}if(t&&t+1<e.length){const s=e.slice(t+1);l.push(s);if(i.tokens){o[o.length-1].value=s;depth(o[o.length-1]);N.maxDepth+=o[o.length-1].depth}}N.slashes=r;N.parts=l}return N};var us=scan$1;const hs=Wi;const ds=wi;const{MAX_LENGTH:ps,POSIX_REGEX_SOURCE:fs,REGEX_NON_SPECIAL_CHARS:ms,REGEX_SPECIAL_CHARS_BACKREF:gs,REPLACEMENTS:ys}=hs;const expandRange=(e,t)=>{if(typeof t.expandRange==="function"){return t.expandRange(...e,t)}e.sort();const i=`[${e.join("-")}]`;return i};const syntaxError=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`;const parse$2=(e,t)=>{if(typeof e!=="string"){throw new TypeError("Expected a string")}e=ys[e]||e;const i={...t};const s=typeof i.maxLength==="number"?Math.min(ps,i.maxLength):ps;let n=e.length;if(n>s){throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${s}`)}const r={type:"bos",value:"",output:i.prepend||""};const o=[r];const l=i.capture?"":"?:";const c=ds.isWindows(t);const u=hs.globChars(c);const h=hs.extglobChars(u);const{DOT_LITERAL:d,PLUS_LITERAL:p,SLASH_LITERAL:f,ONE_CHAR:m,DOTS_SLASH:g,NO_DOT:y,NO_DOT_SLASH:E,NO_DOTS_SLASH:x,QMARK:b,QMARK_NO_DOT:v,STAR:S,START_ANCHOR:A}=u;const globstar=e=>`(${l}(?:(?!${A}${e.dot?g:d}).)*?)`;const w=i.dot?"":y;const I=i.dot?b:v;let k=i.bash===true?globstar(i):S;if(i.capture){k=`(${k})`}if(typeof i.noext==="boolean"){i.noextglob=i.noext}const C={input:e,index:-1,start:0,dot:i.dot===true,consumed:"",output:"",prefix:"",backtrack:false,negated:false,brackets:0,braces:0,parens:0,quotes:0,globstar:false,tokens:o};e=ds.removePrefix(e,C);n=e.length;const _=[];const P=[];const N=[];let R=r;let $;const eos=()=>C.index===n-1;const O=C.peek=(t=1)=>e[C.index+t];const T=C.advance=()=>e[++C.index]||"";const remaining=()=>e.slice(C.index+1);const consume=(e="",t=0)=>{C.consumed+=e;C.index+=t};const append=e=>{C.output+=e.output!=null?e.output:e.value;consume(e.value)};const negate=()=>{let e=1;while(O()==="!"&&(O(2)!=="("||O(3)==="?")){T();C.start++;e++}if(e%2===0){return false}C.negated=true;C.start++;return true};const increment=e=>{C[e]++;N.push(e)};const decrement=e=>{C[e]--;N.pop()};const push=e=>{if(R.type==="globstar"){const t=C.braces>0&&(e.type==="comma"||e.type==="brace");const i=e.extglob===true||_.length&&(e.type==="pipe"||e.type==="paren");if(e.type!=="slash"&&e.type!=="paren"&&!t&&!i){C.output=C.output.slice(0,-R.output.length);R.type="star";R.value="*";R.output=k;C.output+=R.output}}if(_.length&&e.type!=="paren"){_[_.length-1].inner+=e.value}if(e.value||e.output)append(e);if(R&&R.type==="text"&&e.type==="text"){R.value+=e.value;R.output=(R.output||"")+e.value;return}e.prev=R;o.push(e);R=e};const extglobOpen=(e,t)=>{const s={...h[t],conditions:1,inner:""};s.prev=R;s.parens=C.parens;s.output=C.output;const n=(i.capture?"(":"")+s.open;increment("parens");push({type:e,value:t,output:C.output?"":m});push({type:"paren",extglob:true,value:T(),output:n});_.push(s)};const extglobClose=e=>{let s=e.close+(i.capture?")":"");let n;if(e.type==="negate"){let r=k;if(e.inner&&e.inner.length>1&&e.inner.includes("/")){r=globstar(i)}if(r!==k||eos()||/^\)+$/.test(remaining())){s=e.close=`)$))${r}`}if(e.inner.includes("*")&&(n=remaining())&&/^\.[^\\/.]+$/.test(n)){const i=parse$2(n,{...t,fastpaths:false}).output;s=e.close=`)${i})${r})`}if(e.prev.type==="bos"){C.negatedExtglob=true}}push({type:"paren",extglob:true,value:$,output:s});decrement("parens")};if(i.fastpaths!==false&&!/(^[*!]|[/()[\]{}"])/.test(e)){let s=false;let n=e.replace(gs,((e,t,i,n,r,o)=>{if(n==="\\"){s=true;return e}if(n==="?"){if(t){return t+n+(r?b.repeat(r.length):"")}if(o===0){return I+(r?b.repeat(r.length):"")}return b.repeat(i.length)}if(n==="."){return d.repeat(i.length)}if(n==="*"){if(t){return t+n+(r?k:"")}return k}return t?e:`\\${e}`}));if(s===true){if(i.unescape===true){n=n.replace(/\\/g,"")}else{n=n.replace(/\\+/g,(e=>e.length%2===0?"\\\\":e?"\\":""))}}if(n===e&&i.contains===true){C.output=e;return C}C.output=ds.wrapOutput(n,C,t);return C}while(!eos()){$=T();if($==="\0"){continue}if($==="\\"){const e=O();if(e==="/"&&i.bash!==true){continue}if(e==="."||e===";"){continue}if(!e){$+="\\";push({type:"text",value:$});continue}const t=/^\\+/.exec(remaining());let s=0;if(t&&t[0].length>2){s=t[0].length;C.index+=s;if(s%2!==0){$+="\\"}}if(i.unescape===true){$=T()}else{$+=T()}if(C.brackets===0){push({type:"text",value:$});continue}}if(C.brackets>0&&($!=="]"||R.value==="["||R.value==="[^")){if(i.posix!==false&&$===":"){const e=R.value.slice(1);if(e.includes("[")){R.posix=true;if(e.includes(":")){const e=R.value.lastIndexOf("[");const t=R.value.slice(0,e);const i=R.value.slice(e+2);const s=fs[i];if(s){R.value=t+s;C.backtrack=true;T();if(!r.output&&o.indexOf(R)===1){r.output=m}continue}}}}if($==="["&&O()!==":"||$==="-"&&O()==="]"){$=`\\${$}`}if($==="]"&&(R.value==="["||R.value==="[^")){$=`\\${$}`}if(i.posix===true&&$==="!"&&R.value==="["){$="^"}R.value+=$;append({value:$});continue}if(C.quotes===1&&$!=='"'){$=ds.escapeRegex($);R.value+=$;append({value:$});continue}if($==='"'){C.quotes=C.quotes===1?0:1;if(i.keepQuotes===true){push({type:"text",value:$})}continue}if($==="("){increment("parens");push({type:"paren",value:$});continue}if($===")"){if(C.parens===0&&i.strictBrackets===true){throw new SyntaxError(syntaxError("opening","("))}const e=_[_.length-1];if(e&&C.parens===e.parens+1){extglobClose(_.pop());continue}push({type:"paren",value:$,output:C.parens?")":"\\)"});decrement("parens");continue}if($==="["){if(i.nobracket===true||!remaining().includes("]")){if(i.nobracket!==true&&i.strictBrackets===true){throw new SyntaxError(syntaxError("closing","]"))}$=`\\${$}`}else{increment("brackets")}push({type:"bracket",value:$});continue}if($==="]"){if(i.nobracket===true||R&&R.type==="bracket"&&R.value.length===1){push({type:"text",value:$,output:`\\${$}`});continue}if(C.brackets===0){if(i.strictBrackets===true){throw new SyntaxError(syntaxError("opening","["))}push({type:"text",value:$,output:`\\${$}`});continue}decrement("brackets");const e=R.value.slice(1);if(R.posix!==true&&e[0]==="^"&&!e.includes("/")){$=`/${$}`}R.value+=$;append({value:$});if(i.literalBrackets===false||ds.hasRegexChars(e)){continue}const t=ds.escapeRegex(R.value);C.output=C.output.slice(0,-R.value.length);if(i.literalBrackets===true){C.output+=t;R.value=t;continue}R.value=`(${l}${t}|${R.value})`;C.output+=R.value;continue}if($==="{"&&i.nobrace!==true){increment("braces");const e={type:"brace",value:$,output:"(",outputIndex:C.output.length,tokensIndex:C.tokens.length};P.push(e);push(e);continue}if($==="}"){const e=P[P.length-1];if(i.nobrace===true||!e){push({type:"text",value:$,output:$});continue}let t=")";if(e.dots===true){const e=o.slice();const s=[];for(let t=e.length-1;t>=0;t--){o.pop();if(e[t].type==="brace"){break}if(e[t].type!=="dots"){s.unshift(e[t].value)}}t=expandRange(s,i);C.backtrack=true}if(e.comma!==true&&e.dots!==true){const i=C.output.slice(0,e.outputIndex);const s=C.tokens.slice(e.tokensIndex);e.value=e.output="\\{";$=t="\\}";C.output=i;for(const e of s){C.output+=e.output||e.value}}push({type:"brace",value:$,output:t});decrement("braces");P.pop();continue}if($==="|"){if(_.length>0){_[_.length-1].conditions++}push({type:"text",value:$});continue}if($===","){let e=$;const t=P[P.length-1];if(t&&N[N.length-1]==="braces"){t.comma=true;e="|"}push({type:"comma",value:$,output:e});continue}if($==="/"){if(R.type==="dot"&&C.index===C.start+1){C.start=C.index+1;C.consumed="";C.output="";o.pop();R=r;continue}push({type:"slash",value:$,output:f});continue}if($==="."){if(C.braces>0&&R.type==="dot"){if(R.value===".")R.output=d;const e=P[P.length-1];R.type="dots";R.output+=$;R.value+=$;e.dots=true;continue}if(C.braces+C.parens===0&&R.type!=="bos"&&R.type!=="slash"){push({type:"text",value:$,output:d});continue}push({type:"dot",value:$,output:d});continue}if($==="?"){const e=R&&R.value==="(";if(!e&&i.noextglob!==true&&O()==="("&&O(2)!=="?"){extglobOpen("qmark",$);continue}if(R&&R.type==="paren"){const e=O();let t=$;if(e==="<"&&!ds.supportsLookbehinds()){throw new Error("Node.js v10 or higher is required for regex lookbehinds")}if(R.value==="("&&!/[!=<:]/.test(e)||e==="<"&&!/<([!=]|\w+>)/.test(remaining())){t=`\\${$}`}push({type:"text",value:$,output:t});continue}if(i.dot!==true&&(R.type==="slash"||R.type==="bos")){push({type:"qmark",value:$,output:v});continue}push({type:"qmark",value:$,output:b});continue}if($==="!"){if(i.noextglob!==true&&O()==="("){if(O(2)!=="?"||!/[!=<:]/.test(O(3))){extglobOpen("negate",$);continue}}if(i.nonegate!==true&&C.index===0){negate();continue}}if($==="+"){if(i.noextglob!==true&&O()==="("&&O(2)!=="?"){extglobOpen("plus",$);continue}if(R&&R.value==="("||i.regex===false){push({type:"plus",value:$,output:p});continue}if(R&&(R.type==="bracket"||R.type==="paren"||R.type==="brace")||C.parens>0){push({type:"plus",value:$});continue}push({type:"plus",value:p});continue}if($==="@"){if(i.noextglob!==true&&O()==="("&&O(2)!=="?"){push({type:"at",extglob:true,value:$,output:""});continue}push({type:"text",value:$});continue}if($!=="*"){if($==="$"||$==="^"){$=`\\${$}`}const e=ms.exec(remaining());if(e){$+=e[0];C.index+=e[0].length}push({type:"text",value:$});continue}if(R&&(R.type==="globstar"||R.star===true)){R.type="star";R.star=true;R.value+=$;R.output=k;C.backtrack=true;C.globstar=true;consume($);continue}let t=remaining();if(i.noextglob!==true&&/^\([^?]/.test(t)){extglobOpen("star",$);continue}if(R.type==="star"){if(i.noglobstar===true){consume($);continue}const s=R.prev;const n=s.prev;const r=s.type==="slash"||s.type==="bos";const o=n&&(n.type==="star"||n.type==="globstar");if(i.bash===true&&(!r||t[0]&&t[0]!=="/")){push({type:"star",value:$,output:""});continue}const l=C.braces>0&&(s.type==="comma"||s.type==="brace");const c=_.length&&(s.type==="pipe"||s.type==="paren");if(!r&&s.type!=="paren"&&!l&&!c){push({type:"star",value:$,output:""});continue}while(t.slice(0,3)==="/**"){const i=e[C.index+4];if(i&&i!=="/"){break}t=t.slice(3);consume("/**",3)}if(s.type==="bos"&&eos()){R.type="globstar";R.value+=$;R.output=globstar(i);C.output=R.output;C.globstar=true;consume($);continue}if(s.type==="slash"&&s.prev.type!=="bos"&&!o&&eos()){C.output=C.output.slice(0,-(s.output+R.output).length);s.output=`(?:${s.output}`;R.type="globstar";R.output=globstar(i)+(i.strictSlashes?")":"|$)");R.value+=$;C.globstar=true;C.output+=s.output+R.output;consume($);continue}if(s.type==="slash"&&s.prev.type!=="bos"&&t[0]==="/"){const e=t[1]!==void 0?"|$":"";C.output=C.output.slice(0,-(s.output+R.output).length);s.output=`(?:${s.output}`;R.type="globstar";R.output=`${globstar(i)}${f}|${f}${e})`;R.value+=$;C.output+=s.output+R.output;C.globstar=true;consume($+T());push({type:"slash",value:"/",output:""});continue}if(s.type==="bos"&&t[0]==="/"){R.type="globstar";R.value+=$;R.output=`(?:^|${f}|${globstar(i)}${f})`;C.output=R.output;C.globstar=true;consume($+T());push({type:"slash",value:"/",output:""});continue}C.output=C.output.slice(0,-R.output.length);R.type="globstar";R.output=globstar(i);R.value+=$;C.output+=R.output;C.globstar=true;consume($);continue}const s={type:"star",value:$,output:k};if(i.bash===true){s.output=".*?";if(R.type==="bos"||R.type==="slash"){s.output=w+s.output}push(s);continue}if(R&&(R.type==="bracket"||R.type==="paren")&&i.regex===true){s.output=$;push(s);continue}if(C.index===C.start||R.type==="slash"||R.type==="dot"){if(R.type==="dot"){C.output+=E;R.output+=E}else if(i.dot===true){C.output+=x;R.output+=x}else{C.output+=w;R.output+=w}if(O()!=="*"){C.output+=m;R.output+=m}}push(s)}while(C.brackets>0){if(i.strictBrackets===true)throw new SyntaxError(syntaxError("closing","]"));C.output=ds.escapeLast(C.output,"[");decrement("brackets")}while(C.parens>0){if(i.strictBrackets===true)throw new SyntaxError(syntaxError("closing",")"));C.output=ds.escapeLast(C.output,"(");decrement("parens")}while(C.braces>0){if(i.strictBrackets===true)throw new SyntaxError(syntaxError("closing","}"));C.output=ds.escapeLast(C.output,"{");decrement("braces")}if(i.strictSlashes!==true&&(R.type==="star"||R.type==="bracket")){push({type:"maybe_slash",value:"",output:`${f}?`})}if(C.backtrack===true){C.output="";for(const e of C.tokens){C.output+=e.output!=null?e.output:e.value;if(e.suffix){C.output+=e.suffix}}}return C};parse$2.fastpaths=(e,t)=>{const i={...t};const s=typeof i.maxLength==="number"?Math.min(ps,i.maxLength):ps;const n=e.length;if(n>s){throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${s}`)}e=ys[e]||e;const r=ds.isWindows(t);const{DOT_LITERAL:o,SLASH_LITERAL:l,ONE_CHAR:c,DOTS_SLASH:u,NO_DOT:h,NO_DOTS:d,NO_DOTS_SLASH:p,STAR:f,START_ANCHOR:m}=hs.globChars(r);const g=i.dot?d:h;const y=i.dot?p:h;const E=i.capture?"":"?:";const x={negated:false,prefix:""};let b=i.bash===true?".*?":f;if(i.capture){b=`(${b})`}const globstar=e=>{if(e.noglobstar===true)return b;return`(${E}(?:(?!${m}${e.dot?u:o}).)*?)`};const create=e=>{switch(e){case"*":return`${g}${c}${b}`;case".*":return`${o}${c}${b}`;case"*.*":return`${g}${b}${o}${c}${b}`;case"*/*":return`${g}${b}${l}${c}${y}${b}`;case"**":return g+globstar(i);case"**/*":return`(?:${g}${globstar(i)}${l})?${y}${c}${b}`;case"**/*.*":return`(?:${g}${globstar(i)}${l})?${y}${b}${o}${c}${b}`;case"**/.*":return`(?:${g}${globstar(i)}${l})?${o}${c}${b}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const i=create(t[1]);if(!i)return;return i+o+t[2]}}};const v=ds.removePrefix(e,x);let S=create(v);if(S&&i.strictSlashes!==true){S+=`${l}?`}return S};var Es=parse$2;const xs=o;const bs=us;const vs=Es;const Ss=wi;const As=Wi;const isObject=e=>e&&typeof e==="object"&&!Array.isArray(e);const picomatch$1=(e,t,i=false)=>{if(Array.isArray(e)){const s=e.map((e=>picomatch$1(e,t,i)));const arrayMatcher=e=>{for(const t of s){const i=t(e);if(i)return i}return false};return arrayMatcher}const s=isObject(e)&&e.tokens&&e.input;if(e===""||typeof e!=="string"&&!s){throw new TypeError("Expected pattern to be a non-empty string")}const n=t||{};const r=Ss.isWindows(t);const o=s?picomatch$1.compileRe(e,t):picomatch$1.makeRe(e,t,false,true);const l=o.state;delete o.state;let isIgnored=()=>false;if(n.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};isIgnored=picomatch$1(n.ignore,e,i)}const matcher=(i,s=false)=>{const{isMatch:c,match:u,output:h}=picomatch$1.test(i,o,t,{glob:e,posix:r});const d={glob:e,state:l,regex:o,posix:r,input:i,output:h,match:u,isMatch:c};if(typeof n.onResult==="function"){n.onResult(d)}if(c===false){d.isMatch=false;return s?d:false}if(isIgnored(i)){if(typeof n.onIgnore==="function"){n.onIgnore(d)}d.isMatch=false;return s?d:false}if(typeof n.onMatch==="function"){n.onMatch(d)}return s?d:true};if(i){matcher.state=l}return matcher};picomatch$1.test=(e,t,i,{glob:s,posix:n}={})=>{if(typeof e!=="string"){throw new TypeError("Expected input to be a string")}if(e===""){return{isMatch:false,output:""}}const r=i||{};const o=r.format||(n?Ss.toPosixSlashes:null);let l=e===s;let c=l&&o?o(e):e;if(l===false){c=o?o(e):e;l=c===s}if(l===false||r.capture===true){if(r.matchBase===true||r.basename===true){l=picomatch$1.matchBase(e,t,i,n)}else{l=t.exec(c)}}return{isMatch:Boolean(l),match:l,output:c}};picomatch$1.matchBase=(e,t,i,s=Ss.isWindows(i))=>{const n=t instanceof RegExp?t:picomatch$1.makeRe(t,i);return n.test(xs.basename(e))};picomatch$1.isMatch=(e,t,i)=>picomatch$1(t,i)(e);picomatch$1.parse=(e,t)=>{if(Array.isArray(e))return e.map((e=>picomatch$1.parse(e,t)));return vs(e,{...t,fastpaths:false})};picomatch$1.scan=(e,t)=>bs(e,t);picomatch$1.compileRe=(e,t,i=false,s=false)=>{if(i===true){return e.output}const n=t||{};const r=n.contains?"":"^";const o=n.contains?"":"$";let l=`${r}(?:${e.output})${o}`;if(e&&e.negated===true){l=`^(?!${l}).*$`}const c=picomatch$1.toRegex(l,t);if(s===true){c.state=e}return c};picomatch$1.makeRe=(e,t={},i=false,s=false)=>{if(!e||typeof e!=="string"){throw new TypeError("Expected a non-empty string")}let n={negated:false,fastpaths:true};if(t.fastpaths!==false&&(e[0]==="."||e[0]==="*")){n.output=vs.fastpaths(e,t)}if(!n.output){n=vs(e,t)}return picomatch$1.compileRe(n,t,i,s)};picomatch$1.toRegex=(e,t)=>{try{const i=t||{};return new RegExp(e,i.flags||(i.nocase?"i":""))}catch(e){if(t&&t.debug===true)throw e;return/$^/}};picomatch$1.constants=As;var ws=picomatch$1;var Is=ws;const ks=getDefaultExportFromCjs(Is);const Cs={ArrayPattern(e,t){for(const i of t.elements){if(i)Cs[i.type](e,i)}},AssignmentPattern(e,t){Cs[t.left.type](e,t.left)},Identifier(e,t){e.push(t.name)},MemberExpression(){},ObjectPattern(e,t){for(const i of t.properties){if(i.type==="RestElement"){Cs.RestElement(e,i)}else{Cs[i.value.type](e,i.value)}}},RestElement(e,t){Cs[t.argument.type](e,t.argument)}};const _s=function extractAssignedNames(e){const t=[];Cs[e.type](t,e);return t};function isArray$1(e){return Array.isArray(e)}function ensureArray(e){if(isArray$1(e))return e;if(e==null)return[];return[e]}const Ps=function normalizePath(e){return e.split(o.win32.sep).join(o.posix.sep)};function getMatcherString(e,t){if(t===false||o.isAbsolute(e)||e.startsWith("*")){return Ps(e)}const i=Ps(o.resolve(t||"")).replace(/[-^$*+?.()|[\]{}]/g,"\\$&");return o.posix.join(i,Ps(e))}const Ns=function createFilter(e,t,i){const s=i&&i.resolve;const getMatcher=e=>e instanceof RegExp?e:{test:t=>{const i=getMatcherString(e,s);const n=ks(i,{dot:true});const r=n(t);return r}};const n=ensureArray(e).map(getMatcher);const r=ensureArray(t).map(getMatcher);return function result(e){if(typeof e!=="string")return false;if(/\0/.test(e))return false;const t=Ps(e);for(let e=0;e<r.length;++e){const i=r[e];if(i.test(t))return false}for(let e=0;e<n.length;++e){const i=n[e];if(i.test(t))return true}return!n.length}};const Rs="break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public";const $s="arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl";const Os=new Set(`${Rs} ${$s}`.split(" "));Os.add("");function createInclusionContext(){return{brokenFlow:false,hasBreak:false,hasContinue:false,includedCallArguments:new Set,includedLabels:new Set}}function createHasEffectsContext(){return{accessed:new PathTracker,assigned:new PathTracker,brokenFlow:false,called:new DiscriminatedPathTracker,hasBreak:false,hasContinue:false,ignore:{breaks:false,continues:false,labels:new Set,returnYield:false,this:false},includedLabels:new Set,instantiated:new DiscriminatedPathTracker,replacedVariableInits:new Map}}function assembleMemberDescriptions(e,t=null){return Object.create(t,e)}const Ts=new class UndefinedExpression extends ExpressionEntity{getLiteralValueAtPath(){return undefined}};const Ds={value:{hasEffectsWhenCalled:null,returns:pi}};const Ms=new class UnknownBoolean extends ExpressionEntity{getReturnExpressionWhenCalledAtPath(e){if(e.length===1){return getMemberReturnExpressionWhenCalled(Hs,e[0])}return fi}hasEffectsOnInteractionAtPath(e,t,i){if(t.type===mi){return e.length>1}if(t.type===yi&&e.length===1){return hasMemberEffectWhenCalled(Hs,e[0],t,i)}return true}};const Ls={value:{hasEffectsWhenCalled:null,returns:Ms}};const Bs=new class UnknownNumber extends ExpressionEntity{getReturnExpressionWhenCalledAtPath(e){if(e.length===1){return getMemberReturnExpressionWhenCalled(Gs,e[0])}return fi}hasEffectsOnInteractionAtPath(e,t,i){if(t.type===mi){return e.length>1}if(t.type===yi&&e.length===1){return hasMemberEffectWhenCalled(Gs,e[0],t,i)}return true}};const Fs={value:{hasEffectsWhenCalled:null,returns:Bs}};const Vs=new class UnknownString extends ExpressionEntity{getReturnExpressionWhenCalledAtPath(e){if(e.length===1){return getMemberReturnExpressionWhenCalled(qs,e[0])}return fi}hasEffectsOnInteractionAtPath(e,t,i){if(t.type===mi){return e.length>1}if(t.type===yi&&e.length===1){return hasMemberEffectWhenCalled(qs,e[0],t,i)}return true}};const zs={value:{hasEffectsWhenCalled:null,returns:Vs}};const js={value:{hasEffectsWhenCalled({args:e},t){const i=e[2];return e.length<3||typeof i.getLiteralValueAtPath(ri,ui,{deoptimizeCache(){}})==="symbol"&&i.hasEffectsOnInteractionAtPath(ri,bi,t)},returns:Vs}};const Us=assembleMemberDescriptions({hasOwnProperty:Ls,isPrototypeOf:Ls,propertyIsEnumerable:Ls,toLocaleString:zs,toString:zs,valueOf:Ds});const Hs=assembleMemberDescriptions({valueOf:Ls},Us);const Gs=assembleMemberDescriptions({toExponential:zs,toFixed:zs,toLocaleString:zs,toPrecision:zs,valueOf:Fs},Us);const Ws=assembleMemberDescriptions({exec:Ds,test:Ls},Us);const qs=assembleMemberDescriptions({anchor:zs,at:Ds,big:zs,blink:zs,bold:zs,charAt:zs,charCodeAt:Fs,codePointAt:Ds,concat:zs,endsWith:Ls,fixed:zs,fontcolor:zs,fontsize:zs,includes:Ls,indexOf:Fs,italics:zs,lastIndexOf:Fs,link:zs,localeCompare:Fs,match:Ds,matchAll:Ds,normalize:zs,padEnd:zs,padStart:zs,repeat:zs,replace:js,replaceAll:js,search:Fs,slice:zs,small:zs,split:Ds,startsWith:Ls,strike:zs,sub:zs,substr:zs,substring:zs,sup:zs,toLocaleLowerCase:zs,toLocaleUpperCase:zs,toLowerCase:zs,toString:zs,toUpperCase:zs,trim:zs,trimEnd:zs,trimLeft:zs,trimRight:zs,trimStart:zs,valueOf:zs},Us);function getLiteralMembersForValue(e){if(e instanceof RegExp){return Ws}switch(typeof e){case"boolean":{return Hs}case"number":{return Gs}case"string":{return qs}}return Object.create(null)}function hasMemberEffectWhenCalled(e,t,i,s){if(typeof t!=="string"||!e[t]){return true}return e[t].hasEffectsWhenCalled?.(i,s)||false}function getMemberReturnExpressionWhenCalled(e,t){if(typeof t!=="string"||!e[t])return fi;return[e[t].returns,false]}function skipThrough(e,t,i){i(e,t)}function ignore(e,t,i){}var Ks={};Ks.Program=Ks.BlockStatement=Ks.StaticBlock=function(e,t,i){for(var s=0,n=e.body;s<n.length;s+=1){var r=n[s];i(r,t,"Statement")}};Ks.Statement=skipThrough;Ks.EmptyStatement=ignore;Ks.ExpressionStatement=Ks.ParenthesizedExpression=Ks.ChainExpression=function(e,t,i){return i(e.expression,t,"Expression")};Ks.IfStatement=function(e,t,i){i(e.test,t,"Expression");i(e.consequent,t,"Statement");if(e.alternate){i(e.alternate,t,"Statement")}};Ks.LabeledStatement=function(e,t,i){return i(e.body,t,"Statement")};Ks.BreakStatement=Ks.ContinueStatement=ignore;Ks.WithStatement=function(e,t,i){i(e.object,t,"Expression");i(e.body,t,"Statement")};Ks.SwitchStatement=function(e,t,i){i(e.discriminant,t,"Expression");for(var s=0,n=e.cases;s<n.length;s+=1){var r=n[s];if(r.test){i(r.test,t,"Expression")}for(var o=0,l=r.consequent;o<l.length;o+=1){var c=l[o];i(c,t,"Statement")}}};Ks.SwitchCase=function(e,t,i){if(e.test){i(e.test,t,"Expression")}for(var s=0,n=e.consequent;s<n.length;s+=1){var r=n[s];i(r,t,"Statement")}};Ks.ReturnStatement=Ks.YieldExpression=Ks.AwaitExpression=function(e,t,i){if(e.argument){i(e.argument,t,"Expression")}};Ks.ThrowStatement=Ks.SpreadElement=function(e,t,i){return i(e.argument,t,"Expression")};Ks.TryStatement=function(e,t,i){i(e.block,t,"Statement");if(e.handler){i(e.handler,t)}if(e.finalizer){i(e.finalizer,t,"Statement")}};Ks.CatchClause=function(e,t,i){if(e.param){i(e.param,t,"Pattern")}i(e.body,t,"Statement")};Ks.WhileStatement=Ks.DoWhileStatement=function(e,t,i){i(e.test,t,"Expression");i(e.body,t,"Statement")};Ks.ForStatement=function(e,t,i){if(e.init){i(e.init,t,"ForInit")}if(e.test){i(e.test,t,"Expression")}if(e.update){i(e.update,t,"Expression")}i(e.body,t,"Statement")};Ks.ForInStatement=Ks.ForOfStatement=function(e,t,i){i(e.left,t,"ForInit");i(e.right,t,"Expression");i(e.body,t,"Statement")};Ks.ForInit=function(e,t,i){if(e.type==="VariableDeclaration"){i(e,t)}else{i(e,t,"Expression")}};Ks.DebuggerStatement=ignore;Ks.FunctionDeclaration=function(e,t,i){return i(e,t,"Function")};Ks.VariableDeclaration=function(e,t,i){for(var s=0,n=e.declarations;s<n.length;s+=1){var r=n[s];i(r,t)}};Ks.VariableDeclarator=function(e,t,i){i(e.id,t,"Pattern");if(e.init){i(e.init,t,"Expression")}};Ks.Function=function(e,t,i){if(e.id){i(e.id,t,"Pattern")}for(var s=0,n=e.params;s<n.length;s+=1){var r=n[s];i(r,t,"Pattern")}i(e.body,t,e.expression?"Expression":"Statement")};Ks.Pattern=function(e,t,i){if(e.type==="Identifier"){i(e,t,"VariablePattern")}else if(e.type==="MemberExpression"){i(e,t,"MemberPattern")}else{i(e,t)}};Ks.VariablePattern=ignore;Ks.MemberPattern=skipThrough;Ks.RestElement=function(e,t,i){return i(e.argument,t,"Pattern")};Ks.ArrayPattern=function(e,t,i){for(var s=0,n=e.elements;s<n.length;s+=1){var r=n[s];if(r){i(r,t,"Pattern")}}};Ks.ObjectPattern=function(e,t,i){for(var s=0,n=e.properties;s<n.length;s+=1){var r=n[s];if(r.type==="Property"){if(r.computed){i(r.key,t,"Expression")}i(r.value,t,"Pattern")}else if(r.type==="RestElement"){i(r.argument,t,"Pattern")}}};Ks.Expression=skipThrough;Ks.ThisExpression=Ks.Super=Ks.MetaProperty=ignore;Ks.ArrayExpression=function(e,t,i){for(var s=0,n=e.elements;s<n.length;s+=1){var r=n[s];if(r){i(r,t,"Expression")}}};Ks.ObjectExpression=function(e,t,i){for(var s=0,n=e.properties;s<n.length;s+=1){var r=n[s];i(r,t)}};Ks.FunctionExpression=Ks.ArrowFunctionExpression=Ks.FunctionDeclaration;Ks.SequenceExpression=function(e,t,i){for(var s=0,n=e.expressions;s<n.length;s+=1){var r=n[s];i(r,t,"Expression")}};Ks.TemplateLiteral=function(e,t,i){for(var s=0,n=e.quasis;s<n.length;s+=1){var r=n[s];i(r,t)}for(var o=0,l=e.expressions;o<l.length;o+=1){var c=l[o];i(c,t,"Expression")}};Ks.TemplateElement=ignore;Ks.UnaryExpression=Ks.UpdateExpression=function(e,t,i){i(e.argument,t,"Expression")};Ks.BinaryExpression=Ks.LogicalExpression=function(e,t,i){i(e.left,t,"Expression");i(e.right,t,"Expression")};Ks.AssignmentExpression=Ks.AssignmentPattern=function(e,t,i){i(e.left,t,"Pattern");i(e.right,t,"Expression")};Ks.ConditionalExpression=function(e,t,i){i(e.test,t,"Expression");i(e.consequent,t,"Expression");i(e.alternate,t,"Expression")};Ks.NewExpression=Ks.CallExpression=function(e,t,i){i(e.callee,t,"Expression");if(e.arguments){for(var s=0,n=e.arguments;s<n.length;s+=1){var r=n[s];i(r,t,"Expression")}}};Ks.MemberExpression=function(e,t,i){i(e.object,t,"Expression");if(e.computed){i(e.property,t,"Expression")}};Ks.ExportNamedDeclaration=Ks.ExportDefaultDeclaration=function(e,t,i){if(e.declaration){i(e.declaration,t,e.type==="ExportNamedDeclaration"||e.declaration.id?"Statement":"Expression")}if(e.source){i(e.source,t,"Expression")}};Ks.ExportAllDeclaration=function(e,t,i){if(e.exported){i(e.exported,t)}i(e.source,t,"Expression")};Ks.ImportDeclaration=function(e,t,i){for(var s=0,n=e.specifiers;s<n.length;s+=1){var r=n[s];i(r,t)}i(e.source,t,"Expression")};Ks.ImportExpression=function(e,t,i){i(e.source,t,"Expression")};Ks.ImportSpecifier=Ks.ImportDefaultSpecifier=Ks.ImportNamespaceSpecifier=Ks.Identifier=Ks.PrivateIdentifier=Ks.Literal=ignore;Ks.TaggedTemplateExpression=function(e,t,i){i(e.tag,t,"Expression");i(e.quasi,t,"Expression")};Ks.ClassDeclaration=Ks.ClassExpression=function(e,t,i){return i(e,t,"Class")};Ks.Class=function(e,t,i){if(e.id){i(e.id,t,"Pattern")}if(e.superClass){i(e.superClass,t,"Expression")}i(e.body,t)};Ks.ClassBody=function(e,t,i){for(var s=0,n=e.body;s<n.length;s+=1){var r=n[s];i(r,t)}};Ks.MethodDefinition=Ks.PropertyDefinition=Ks.Property=function(e,t,i){if(e.computed){i(e.key,t,"Expression")}if(e.value){i(e.value,t,"Expression")}};const Ys="ArrowFunctionExpression";const Qs="BinaryExpression";const Xs="BlockStatement";const Zs="CallExpression";const Js="ChainExpression";const en="ConditionalExpression";const tn="ExpressionStatement";const sn="Identifier";const nn="LogicalExpression";const rn="NewExpression";const on="Program";const an="Property";const ln="ReturnStatement";const cn="SequenceExpression";let un="sourceMa";un+="ppingURL";const hn="[ \\f\\r\\t\\v\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]";const dn=new RegExp(`^#${hn}+${un}=.+`);const pn="_rollupAnnotations";const fn="_rollupRemoved";function handlePureAnnotationsOfNode(e,t,i=e.type){const{annotations:s,code:n}=t;let r=s[t.annotationIndex];while(r&&e.start>=r.end){markPureNode(e,r,n);r=s[++t.annotationIndex]}if(r&&r.end<=e.end){Ks[i](e,t,handlePureAnnotationsOfNode);while((r=s[t.annotationIndex])&&r.end<=e.end){++t.annotationIndex;annotateNode(e,r,false)}}}const mn=/[^\s(]/g;const gn=/\S/g;function markPureNode(e,t,i){const s=[];let n;const r=i.slice(t.end,e.start);if(doesNotMatchOutsideComment(r,mn)){const t=e.start;while(true){s.push(e);switch(e.type){case tn:case Js:{e=e.expression;continue}case cn:{if(doesNotMatchOutsideComment(i.slice(t,e.start),gn)){e=e.expressions[0];continue}n=true;break}case en:{if(doesNotMatchOutsideComment(i.slice(t,e.start),gn)){e=e.test;continue}n=true;break}case nn:case Qs:{if(doesNotMatchOutsideComment(i.slice(t,e.start),gn)){e=e.left;continue}n=true;break}case Zs:case rn:{break}default:{n=true}}break}}else{n=true}if(n){annotateNode(e,t,false)}else{for(const e of s){annotateNode(e,t,true)}}}function doesNotMatchOutsideComment(e,t){let i;while((i=t.exec(e))!==null){if(i[0]==="/"){const i=e.charCodeAt(t.lastIndex);if(i===42){t.lastIndex=e.indexOf("*/",t.lastIndex+1)+2;continue}else if(i===47){t.lastIndex=e.indexOf("\n",t.lastIndex+1)+1;continue}}t.lastIndex=0;return false}return true}const yn=/[#@]__PURE__/;function addAnnotations(e,t,i){const s=[];const n=[];for(const t of e){if(yn.test(t.value)){s.push(t)}else if(dn.test(t.value)){n.push(t)}}for(const e of n){annotateNode(t,e,false)}handlePureAnnotationsOfNode(t,{annotationIndex:0,annotations:s,code:i})}function annotateNode(e,t,i){const s=i?pn:fn;const n=e[s];if(n){n.push(t)}else{e[s]=[t]}}const En={ImportExpression:["arguments"],Literal:[],Program:["body"]};function getAndCreateKeys(e){En[e.type]=Object.keys(e).filter((t=>typeof e[t]==="object"&&t.charCodeAt(0)!==95));return En[e.type]}const xn="variables";class NodeBase extends ExpressionEntity{constructor(e,t,i,s=false){super();this.deoptimized=false;this.esTreeNode=s?e:null;this.keys=En[e.type]||getAndCreateKeys(e);this.parent=t;this.context=t.context;this.createScope(i);this.parseNode(e);this.initialise();this.context.magicString.addSourcemapLocation(this.start);this.context.magicString.addSourcemapLocation(this.end)}addExportedVariables(e,t){}bind(){for(const e of this.keys){const t=this[e];if(Array.isArray(t)){for(const e of t){e?.bind()}}else if(t){t.bind()}}}createScope(e){this.scope=e}hasEffects(e){if(!this.deoptimized)this.applyDeoptimizations();for(const t of this.keys){const i=this[t];if(i===null)continue;if(Array.isArray(i)){for(const t of i){if(t?.hasEffects(e))return true}}else if(i.hasEffects(e))return true}return false}hasEffectsAsAssignmentTarget(e,t){return this.hasEffects(e)||this.hasEffectsOnInteractionAtPath(ri,this.assignmentInteraction,e)}include(e,t,i){if(!this.deoptimized)this.applyDeoptimizations();this.included=true;for(const i of this.keys){const s=this[i];if(s===null)continue;if(Array.isArray(s)){for(const i of s){i?.include(e,t)}}else{s.include(e,t)}}}includeAsAssignmentTarget(e,t,i){this.include(e,t)}initialise(){}insertSemicolon(e){if(e.original[this.end-1]!==";"){e.appendLeft(this.end,";")}}parseNode(e,t){for(const[i,s]of Object.entries(e)){if(this.hasOwnProperty(i))continue;if(i.charCodeAt(0)===95){if(i===pn){this.annotations=s}else if(i===fn){for(const{start:e,end:t}of s)this.context.magicString.remove(e,t)}}else if(typeof s!=="object"||s===null){this[i]=s}else if(Array.isArray(s)){this[i]=[];for(const e of s){this[i].push(e===null?null:new(this.context.getNodeConstructor(e.type))(e,this,this.scope,t?.includes(i)))}}else{this[i]=new(this.context.getNodeConstructor(s.type))(s,this,this.scope,t?.includes(i))}}}render(e,t){for(const i of this.keys){const s=this[i];if(s===null)continue;if(Array.isArray(s)){for(const i of s){i?.render(e,t)}}else{s.render(e,t)}}}setAssignedValue(e){this.assignmentInteraction={args:[null,e],type:gi}}shouldBeIncluded(e){return this.included||!e.brokenFlow&&this.hasEffects(createHasEffectsContext())}applyDeoptimizations(){this.deoptimized=true;for(const e of this.keys){const t=this[e];if(t===null)continue;if(Array.isArray(t)){for(const e of t){e?.deoptimizePath(oi)}}else{t.deoptimizePath(oi)}}this.context.requestTreeshakingPass()}}class SpreadElement extends NodeBase{deoptimizeArgumentsOnInteractionAtPath(e,t,i){if(t.length>0){this.argument.deoptimizeArgumentsOnInteractionAtPath(e,[ti,...t],i)}}hasEffects(e){if(!this.deoptimized)this.applyDeoptimizations();const{propertyReadSideEffects:t}=this.context.options.treeshake;return this.argument.hasEffects(e)||t&&(t==="always"||this.argument.hasEffectsOnInteractionAtPath(oi,Ei,e))}applyDeoptimizations(){this.deoptimized=true;this.argument.deoptimizePath([ti,ti]);this.context.requestTreeshakingPass()}}class Method extends ExpressionEntity{constructor(e){super();this.description=e}deoptimizeArgumentsOnInteractionAtPath({args:e,type:t},i){if(t===yi&&i.length===0&&this.description.mutatesSelfAsArray){e[0]?.deoptimizePath(li)}}getReturnExpressionWhenCalledAtPath(e,{args:t}){if(e.length>0){return fi}return[this.description.returnsPrimitive||(this.description.returns==="self"?t[0]||pi:this.description.returns()),false]}hasEffectsOnInteractionAtPath(e,t,i){const{type:s}=t;if(e.length>(s===mi?1:0)){return true}if(s===yi){const{args:e}=t;if(this.description.mutatesSelfAsArray===true&&e[0]?.hasEffectsOnInteractionAtPath(li,xi,i)){return true}if(this.description.callsArgs){for(const t of this.description.callsArgs){if(e[t+1]?.hasEffectsOnInteractionAtPath(ri,bi,i)){return true}}}}return false}}const bn=[new Method({callsArgs:null,mutatesSelfAsArray:false,returns:null,returnsPrimitive:Ms})];const vn=[new Method({callsArgs:null,mutatesSelfAsArray:false,returns:null,returnsPrimitive:Vs})];const Sn=[new Method({callsArgs:null,mutatesSelfAsArray:false,returns:null,returnsPrimitive:Bs})];const An=[new Method({callsArgs:null,mutatesSelfAsArray:false,returns:null,returnsPrimitive:pi})];const wn=/^\d+$/;class ObjectEntity extends ExpressionEntity{constructor(e,t,i=false){super();this.prototypeExpression=t;this.immutable=i;this.additionalExpressionsToBeDeoptimized=new Set;this.allProperties=[];this.deoptimizedPaths=Object.create(null);this.expressionsToBeDeoptimizedByKey=Object.create(null);this.gettersByKey=Object.create(null);this.hasLostTrack=false;this.hasUnknownDeoptimizedInteger=false;this.hasUnknownDeoptimizedProperty=false;this.propertiesAndGettersByKey=Object.create(null);this.propertiesAndSettersByKey=Object.create(null);this.settersByKey=Object.create(null);this.unknownIntegerProps=[];this.unmatchableGetters=[];this.unmatchablePropertiesAndGetters=[];this.unmatchableSetters=[];if(Array.isArray(e)){this.buildPropertyMaps(e)}else{this.propertiesAndGettersByKey=this.propertiesAndSettersByKey=e;for(const t of Object.values(e)){this.allProperties.push(...t)}}}deoptimizeAllProperties(e){const t=this.hasLostTrack||this.hasUnknownDeoptimizedProperty;if(e){this.hasUnknownDeoptimizedProperty=true}else{this.hasLostTrack=true}if(t){return}for(const e of[...Object.values(this.propertiesAndGettersByKey),...Object.values(this.settersByKey)]){for(const t of e){t.deoptimizePath(oi)}}this.prototypeExpression?.deoptimizePath([ti,ti]);this.deoptimizeCachedEntities()}deoptimizeArgumentsOnInteractionAtPath(e,t,i){const[s,...n]=t;const{args:r,type:o}=e;if(this.hasLostTrack||(o===yi||t.length>1)&&(this.hasUnknownDeoptimizedProperty||typeof s==="string"&&this.deoptimizedPaths[s])){deoptimizeInteraction(e);return}const[l,c,u]=o===yi||t.length>1?[this.propertiesAndGettersByKey,this.propertiesAndGettersByKey,this.unmatchablePropertiesAndGetters]:o===mi?[this.propertiesAndGettersByKey,this.gettersByKey,this.unmatchableGetters]:[this.propertiesAndSettersByKey,this.settersByKey,this.unmatchableSetters];if(typeof s==="string"){if(l[s]){const t=c[s];if(t){for(const s of t){s.deoptimizeArgumentsOnInteractionAtPath(e,n,i)}}if(!this.immutable){for(const e of r){if(e){this.additionalExpressionsToBeDeoptimized.add(e)}}}return}for(const t of u){t.deoptimizeArgumentsOnInteractionAtPath(e,n,i)}if(wn.test(s)){for(const t of this.unknownIntegerProps){t.deoptimizeArgumentsOnInteractionAtPath(e,n,i)}}}else{for(const t of[...Object.values(c),u]){for(const s of t){s.deoptimizeArgumentsOnInteractionAtPath(e,n,i)}}for(const t of this.unknownIntegerProps){t.deoptimizeArgumentsOnInteractionAtPath(e,n,i)}}if(!this.immutable){for(const e of r){if(e){this.additionalExpressionsToBeDeoptimized.add(e)}}}this.prototypeExpression?.deoptimizeArgumentsOnInteractionAtPath(e,t,i)}deoptimizeIntegerProperties(){if(this.hasLostTrack||this.hasUnknownDeoptimizedProperty||this.hasUnknownDeoptimizedInteger){return}this.hasUnknownDeoptimizedInteger=true;for(const[e,t]of Object.entries(this.propertiesAndGettersByKey)){if(wn.test(e)){for(const e of t){e.deoptimizePath(oi)}}}this.deoptimizeCachedIntegerEntities()}deoptimizePath(e){if(this.hasLostTrack||this.immutable){return}const t=e[0];if(e.length===1){if(typeof t!=="string"){if(t===si){return this.deoptimizeIntegerProperties()}return this.deoptimizeAllProperties(t===ii)}if(!this.deoptimizedPaths[t]){this.deoptimizedPaths[t]=true;const e=this.expressionsToBeDeoptimizedByKey[t];if(e){for(const t of e){t.deoptimizeCache()}}}}const i=e.length===1?oi:e.slice(1);for(const e of typeof t==="string"?[...this.propertiesAndGettersByKey[t]||this.unmatchablePropertiesAndGetters,...this.settersByKey[t]||this.unmatchableSetters]:this.allProperties){e.deoptimizePath(i)}this.prototypeExpression?.deoptimizePath(e.length===1?[...e,ti]:e)}getLiteralValueAtPath(e,t,i){if(e.length===0){return di}const s=e[0];const n=this.getMemberExpressionAndTrackDeopt(s,i);if(n){return n.getLiteralValueAtPath(e.slice(1),t,i)}if(this.prototypeExpression){return this.prototypeExpression.getLiteralValueAtPath(e,t,i)}if(e.length===1){return undefined}return hi}getReturnExpressionWhenCalledAtPath(e,t,i,s){if(e.length===0){return fi}const[n,...r]=e;const o=this.getMemberExpressionAndTrackDeopt(n,s);if(o){return o.getReturnExpressionWhenCalledAtPath(r,t,i,s)}if(this.prototypeExpression){return this.prototypeExpression.getReturnExpressionWhenCalledAtPath(e,t,i,s)}return fi}hasEffectsOnInteractionAtPath(e,t,i){const[s,...n]=e;if(n.length>0||t.type===yi){const r=this.getMemberExpression(s);if(r){return r.hasEffectsOnInteractionAtPath(n,t,i)}if(this.prototypeExpression){return this.prototypeExpression.hasEffectsOnInteractionAtPath(e,t,i)}return true}if(s===ii)return false;if(this.hasLostTrack)return true;const[r,o,l]=t.type===mi?[this.propertiesAndGettersByKey,this.gettersByKey,this.unmatchableGetters]:[this.propertiesAndSettersByKey,this.settersByKey,this.unmatchableSetters];if(typeof s==="string"){if(r[s]){const e=o[s];if(e){for(const s of e){if(s.hasEffectsOnInteractionAtPath(n,t,i))return true}}return false}for(const e of l){if(e.hasEffectsOnInteractionAtPath(n,t,i)){return true}}}else{for(const e of[...Object.values(o),l]){for(const s of e){if(s.hasEffectsOnInteractionAtPath(n,t,i))return true}}}if(this.prototypeExpression){return this.prototypeExpression.hasEffectsOnInteractionAtPath(e,t,i)}return false}buildPropertyMaps(e){const{allProperties:t,propertiesAndGettersByKey:i,propertiesAndSettersByKey:s,settersByKey:n,gettersByKey:r,unknownIntegerProps:o,unmatchablePropertiesAndGetters:l,unmatchableGetters:c,unmatchableSetters:u}=this;const h=[];for(let d=e.length-1;d>=0;d--){const{key:p,kind:f,property:m}=e[d];t.push(m);if(typeof p==="string"){if(f==="set"){if(!s[p]){s[p]=[m,...h];n[p]=[m,...u]}}else if(f==="get"){if(!i[p]){i[p]=[m,...l];r[p]=[m,...c]}}else{if(!s[p]){s[p]=[m,...h]}if(!i[p]){i[p]=[m,...l]}}}else{if(p===si){o.push(m);continue}if(f==="set")u.push(m);if(f==="get")c.push(m);if(f!=="get")h.push(m);if(f!=="set")l.push(m)}}}deoptimizeCachedEntities(){for(const e of Object.values(this.expressionsToBeDeoptimizedByKey)){for(const t of e){t.deoptimizeCache()}}for(const e of this.additionalExpressionsToBeDeoptimized){e.deoptimizePath(oi)}}deoptimizeCachedIntegerEntities(){for(const[e,t]of Object.entries(this.expressionsToBeDeoptimizedByKey)){if(wn.test(e)){for(const e of t){e.deoptimizeCache()}}}for(const e of this.additionalExpressionsToBeDeoptimized){e.deoptimizePath(li)}}getMemberExpression(e){if(this.hasLostTrack||this.hasUnknownDeoptimizedProperty||typeof e!=="string"||this.hasUnknownDeoptimizedInteger&&wn.test(e)||this.deoptimizedPaths[e]){return pi}const t=this.propertiesAndGettersByKey[e];if(t?.length===1){return t[0]}if(t||this.unmatchablePropertiesAndGetters.length>0||this.unknownIntegerProps.length>0&&wn.test(e)){return pi}return null}getMemberExpressionAndTrackDeopt(e,t){if(typeof e!=="string"){return pi}const i=this.getMemberExpression(e);if(!(i===pi||this.immutable)){const i=this.expressionsToBeDeoptimizedByKey[e]=this.expressionsToBeDeoptimizedByKey[e]||[];i.push(t)}return i}}const isInteger=e=>typeof e==="string"&&/^\d+$/.test(e);const In=new class ObjectPrototypeFallbackExpression extends ExpressionEntity{deoptimizeArgumentsOnInteractionAtPath(e,t){if(e.type===yi&&t.length===1&&!isInteger(t[0])){deoptimizeInteraction(e)}}getLiteralValueAtPath(e){return e.length===1&&isInteger(e[0])?undefined:hi}hasEffectsOnInteractionAtPath(e,{type:t}){return e.length>1||t===yi}};const kn=new ObjectEntity({__proto__:null,hasOwnProperty:bn,isPrototypeOf:bn,propertyIsEnumerable:bn,toLocaleString:vn,toString:vn,valueOf:An},In,true);const Cn=[{key:si,kind:"init",property:pi},{key:"length",kind:"init",property:Bs}];const _n=[new Method({callsArgs:[0],mutatesSelfAsArray:"deopt-only",returns:null,returnsPrimitive:Ms})];const Pn=[new Method({callsArgs:[0],mutatesSelfAsArray:"deopt-only",returns:null,returnsPrimitive:Bs})];const Nn=[new Method({callsArgs:null,mutatesSelfAsArray:true,returns:()=>new ObjectEntity(Cn,Fn),returnsPrimitive:null})];const Rn=[new Method({callsArgs:null,mutatesSelfAsArray:"deopt-only",returns:()=>new ObjectEntity(Cn,Fn),returnsPrimitive:null})];const $n=[new Method({callsArgs:[0],mutatesSelfAsArray:"deopt-only",returns:()=>new ObjectEntity(Cn,Fn),returnsPrimitive:null})];const On=[new Method({callsArgs:null,mutatesSelfAsArray:true,returns:null,returnsPrimitive:Bs})];const Tn=[new Method({callsArgs:null,mutatesSelfAsArray:true,returns:null,returnsPrimitive:pi})];const Dn=[new Method({callsArgs:null,mutatesSelfAsArray:"deopt-only",returns:null,returnsPrimitive:pi})];const Mn=[new Method({callsArgs:[0],mutatesSelfAsArray:"deopt-only",returns:null,returnsPrimitive:pi})];const Ln=[new Method({callsArgs:null,mutatesSelfAsArray:true,returns:"self",returnsPrimitive:null})];const Bn=[new Method({callsArgs:[0],mutatesSelfAsArray:true,returns:"self",returnsPrimitive:null})];const Fn=new ObjectEntity({__proto__:null,at:Dn,concat:Rn,copyWithin:Ln,entries:Rn,every:_n,fill:Ln,filter:$n,find:Mn,findIndex:Pn,findLast:Mn,findLastIndex:Pn,flat:Rn,flatMap:$n,forEach:Mn,includes:bn,indexOf:Sn,join:vn,keys:An,lastIndexOf:Sn,map:$n,pop:Tn,push:On,reduce:Mn,reduceRight:Mn,reverse:Ln,shift:Tn,slice:Rn,some:_n,sort:Bn,splice:Nn,toLocaleString:vn,toString:vn,unshift:On,values:Dn},kn,true);class ArrayExpression extends NodeBase{constructor(){super(...arguments);this.objectEntity=null}deoptimizeArgumentsOnInteractionAtPath(e,t,i){this.getObjectEntity().deoptimizeArgumentsOnInteractionAtPath(e,t,i)}deoptimizePath(e){this.getObjectEntity().deoptimizePath(e)}getLiteralValueAtPath(e,t,i){return this.getObjectEntity().getLiteralValueAtPath(e,t,i)}getReturnExpressionWhenCalledAtPath(e,t,i,s){return this.getObjectEntity().getReturnExpressionWhenCalledAtPath(e,t,i,s)}hasEffectsOnInteractionAtPath(e,t,i){return this.getObjectEntity().hasEffectsOnInteractionAtPath(e,t,i)}applyDeoptimizations(){this.deoptimized=true;let e=false;for(let t=0;t<this.elements.length;t++){const i=this.elements[t];if(i&&(e||i instanceof SpreadElement)){e=true;i.deoptimizePath(oi)}}this.context.requestTreeshakingPass()}getObjectEntity(){if(this.objectEntity!==null){return this.objectEntity}const e=[{key:"length",kind:"init",property:Bs}];let t=false;for(let i=0;i<this.elements.length;i++){const s=this.elements[i];if(t||s instanceof SpreadElement){if(s){t=true;e.unshift({key:si,kind:"init",property:s})}}else if(s){e.push({key:String(i),kind:"init",property:s})}else{e.push({key:String(i),kind:"init",property:Ts})}}return this.objectEntity=new ObjectEntity(e,Fn)}}class ArrayPattern extends NodeBase{addExportedVariables(e,t){for(const i of this.elements){i?.addExportedVariables(e,t)}}declare(e){const t=[];for(const i of this.elements){if(i!==null){t.push(...i.declare(e,pi))}}return t}deoptimizePath(){for(const e of this.elements){e?.deoptimizePath(ri)}}hasEffectsOnInteractionAtPath(e,t,i){for(const e of this.elements){if(e?.hasEffectsOnInteractionAtPath(ri,t,i))return true}return false}markDeclarationReached(){for(const e of this.elements){e?.markDeclarationReached()}}}class LocalVariable extends Variable{constructor(e,t,i,s){super(e);this.init=i;this.calledFromTryStatement=false;this.additionalInitializers=null;this.expressionsToBeDeoptimized=[];this.declarations=t?[t]:[];this.deoptimizationTracker=s.deoptimizationTracker;this.module=s.module}addDeclaration(e,t){this.declarations.push(e);this.markInitializersForDeoptimization().push(t)}consolidateInitializers(){if(this.additionalInitializers){for(const e of this.additionalInitializers){e.deoptimizePath(oi)}this.additionalInitializers=null}}deoptimizeArgumentsOnInteractionAtPath(e,t,i){if(this.isReassigned){deoptimizeInteraction(e);return}i.withTrackedEntityAtPath(t,this.init,(()=>this.init.deoptimizeArgumentsOnInteractionAtPath(e,t,i)),undefined)}deoptimizePath(e){if(this.isReassigned||this.deoptimizationTracker.trackEntityAtPathAndGetIfTracked(e,this)){return}if(e.length===0){if(!this.isReassigned){this.isReassigned=true;const e=this.expressionsToBeDeoptimized;this.expressionsToBeDeoptimized=Y;for(const t of e){t.deoptimizeCache()}this.init.deoptimizePath(oi)}}else{this.init.deoptimizePath(e)}}getLiteralValueAtPath(e,t,i){if(this.isReassigned){return hi}return t.withTrackedEntityAtPath(e,this.init,(()=>{this.expressionsToBeDeoptimized.push(i);return this.init.getLiteralValueAtPath(e,t,i)}),hi)}getReturnExpressionWhenCalledAtPath(e,t,i,s){if(this.isReassigned){return fi}return i.withTrackedEntityAtPath(e,this.init,(()=>{this.expressionsToBeDeoptimized.push(s);return this.init.getReturnExpressionWhenCalledAtPath(e,t,i,s)}),fi)}hasEffectsOnInteractionAtPath(e,t,i){switch(t.type){case mi:{if(this.isReassigned)return true;return!i.accessed.trackEntityAtPathAndGetIfTracked(e,this)&&this.init.hasEffectsOnInteractionAtPath(e,t,i)}case gi:{if(this.included)return true;if(e.length===0)return false;if(this.isReassigned)return true;return!i.assigned.trackEntityAtPathAndGetIfTracked(e,this)&&this.init.hasEffectsOnInteractionAtPath(e,t,i)}case yi:{if(this.isReassigned)return true;return!(t.withNew?i.instantiated:i.called).trackEntityAtPathAndGetIfTracked(e,t.args,this)&&this.init.hasEffectsOnInteractionAtPath(e,t,i)}}}include(){if(!this.included){this.included=true;for(const e of this.declarations){if(!e.included)e.include(createInclusionContext(),false);let t=e.parent;while(!t.included){t.included=true;if(t.type===on)break;t=t.parent}}}}includeCallArguments(e,t){if(this.isReassigned||e.includedCallArguments.has(this.init)){for(const i of t){i.include(e,false)}}else{e.includedCallArguments.add(this.init);this.init.includeCallArguments(e,t);e.includedCallArguments.delete(this.init)}}markCalledFromTryStatement(){this.calledFromTryStatement=true}markInitializersForDeoptimization(){if(this.additionalInitializers===null){this.additionalInitializers=[this.init];this.init=pi;this.isReassigned=true}return this.additionalInitializers}mergeDeclarations(e){const{declarations:t}=this;for(const i of e.declarations){t.push(i)}const i=this.markInitializersForDeoptimization();i.push(e.init);if(e.additionalInitializers){for(const t of e.additionalInitializers){i.push(t)}}}}const Vn=20;const zn=Y;const jn=new Set([ti]);const Un=new PathTracker;const Hn=new Set([pi]);class ParameterVariable extends LocalVariable{constructor(e,t,i){super(e,t,pi,i);this.deoptimizationInteractions=[];this.deoptimizations=new PathTracker;this.deoptimizedFields=new Set;this.entitiesToBeDeoptimized=new Set}addEntityToBeDeoptimized(e){if(e===pi){if(!this.entitiesToBeDeoptimized.has(pi)){this.entitiesToBeDeoptimized.add(pi);for(const{interaction:e}of this.deoptimizationInteractions){deoptimizeInteraction(e)}this.deoptimizationInteractions=zn}}else if(this.deoptimizedFields.has(ti)){e.deoptimizePath(oi)}else if(!this.entitiesToBeDeoptimized.has(e)){this.entitiesToBeDeoptimized.add(e);for(const t of this.deoptimizedFields){e.deoptimizePath([t])}for(const{interaction:t,path:i}of this.deoptimizationInteractions){e.deoptimizeArgumentsOnInteractionAtPath(t,i,ui)}}}deoptimizeArgumentsOnInteractionAtPath(e,t){if(t.length>=2||this.entitiesToBeDeoptimized.has(pi)||this.deoptimizationInteractions.length>=Vn||t.length===1&&(this.deoptimizedFields.has(ti)||e.type===yi&&this.deoptimizedFields.has(t[0]))){deoptimizeInteraction(e);return}if(!this.deoptimizations.trackEntityAtPathAndGetIfTracked(t,e.args)){for(const i of this.entitiesToBeDeoptimized){i.deoptimizeArgumentsOnInteractionAtPath(e,t,ui)}if(!this.entitiesToBeDeoptimized.has(pi)){this.deoptimizationInteractions.push({interaction:e,path:t})}}}deoptimizePath(e){if(e.length===0||this.deoptimizedFields.has(ti)){return}const t=e[0];if(this.deoptimizedFields.has(t)){return}this.deoptimizedFields.add(t);for(const t of this.entitiesToBeDeoptimized){t.deoptimizePath(e)}if(t===ti){this.deoptimizationInteractions=zn;this.deoptimizations=Un;this.deoptimizedFields=jn;this.entitiesToBeDeoptimized=Hn}}getReturnExpressionWhenCalledAtPath(e){if(e.length===0){this.deoptimizePath(oi)}else if(!this.deoptimizedFields.has(e[0])){this.deoptimizePath([e[0]])}return fi}}const Gn="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$";const Wn=64;function toBase64(e){let t="";do{const i=e%Wn;e=e/Wn|0;t=Gn[i]+t}while(e!==0);return t}function getSafeName(e,t,i){let s=e;let n=1;while(t.has(s)||Si.has(s)||i?.has(s)){s=`${e}$${toBase64(n++)}`}t.add(s);return s}let qn=class Scope{constructor(){this.children=[];this.variables=new Map}addDeclaration(e,t,i,s){const n=e.name;let r=this.variables.get(n);if(r){r.addDeclaration(e,i)}else{r=new LocalVariable(e.name,e,i||Ts,t);this.variables.set(n,r)}return r}contains(e){return this.variables.has(e)}findVariable(e){throw new Error("Internal Error: findVariable needs to be implemented by a subclass")}};class ChildScope extends qn{constructor(e){super();this.accessedOutsideVariables=new Map;this.parent=e;e.children.push(this)}addAccessedDynamicImport(e){(this.accessedDynamicImports||(this.accessedDynamicImports=new Set)).add(e);if(this.parent instanceof ChildScope){this.parent.addAccessedDynamicImport(e)}}addAccessedGlobals(e,t){const i=t.get(this)||new Set;for(const t of e){i.add(t)}t.set(this,i);if(this.parent instanceof ChildScope){this.parent.addAccessedGlobals(e,t)}}addNamespaceMemberAccess(e,t){this.accessedOutsideVariables.set(e,t);this.parent.addNamespaceMemberAccess(e,t)}addReturnExpression(e){this.parent instanceof ChildScope&&this.parent.addReturnExpression(e)}addUsedOutsideNames(e,t,i,s){for(const s of this.accessedOutsideVariables.values()){if(s.included){e.add(s.getBaseVariableName());if(t==="system"&&i.has(s)){e.add("exports")}}}const n=s.get(this);if(n){for(const t of n){e.add(t)}}}contains(e){return this.variables.has(e)||this.parent.contains(e)}deconflict(e,t,i){const s=new Set;this.addUsedOutsideNames(s,e,t,i);if(this.accessedDynamicImports){for(const e of this.accessedDynamicImports){if(e.inlineNamespace){s.add(e.inlineNamespace.getBaseVariableName())}}}for(const[e,t]of this.variables){if(t.included||t.alwaysRendered){t.setRenderNames(null,getSafeName(e,s,t.forbiddenNames))}}for(const s of this.children){s.deconflict(e,t,i)}}findLexicalBoundary(){return this.parent.findLexicalBoundary()}findVariable(e){const t=this.variables.get(e)||this.accessedOutsideVariables.get(e);if(t){return t}const i=this.parent.findVariable(e);this.accessedOutsideVariables.set(e,i);return i}}class ParameterScope extends ChildScope{constructor(e,t){super(e);this.parameters=[];this.hasRest=false;this.context=t;this.hoistedBodyVarScope=new ChildScope(this)}addParameterDeclaration(e){const{name:t}=e;const i=new ParameterVariable(t,e,this.context);const s=this.hoistedBodyVarScope.variables.get(t);if(s){this.hoistedBodyVarScope.variables.set(t,i);i.mergeDeclarations(s)}this.variables.set(t,i);return i}addParameterVariables(e,t){this.parameters=e;for(const t of e){for(const e of t){e.alwaysRendered=true}}this.hasRest=t}includeCallArguments(e,t){let i=false;let s=false;const n=this.hasRest&&this.parameters[this.parameters.length-1];for(const i of t){if(i instanceof SpreadElement){for(const i of t){i.include(e,false)}break}}for(let r=t.length-1;r>=0;r--){const o=this.parameters[r]||n;const l=t[r];if(o){i=false;if(o.length===0){s=true}else{for(const e of o){if(e.included){s=true}if(e.calledFromTryStatement){i=true}}}}if(!s&&l.shouldBeIncluded(e)){s=true}if(s){l.include(e,i)}}}}class ReturnValueScope extends ParameterScope{constructor(){super(...arguments);this.returnExpression=null;this.returnExpressions=[]}addReturnExpression(e){this.returnExpressions.push(e)}getReturnExpression(){if(this.returnExpression===null)this.updateReturnExpression();return this.returnExpression}updateReturnExpression(){if(this.returnExpressions.length===1){this.returnExpression=this.returnExpressions[0]}else{this.returnExpression=pi;for(const e of this.returnExpressions){e.deoptimizePath(oi)}}}}function is_reference(e,t){if(e.type==="MemberExpression"){return!e.computed&&is_reference(e.object,e)}if(e.type==="Identifier"){if(!t)return true;switch(t.type){case"MemberExpression":return t.computed||e===t.object;case"MethodDefinition":return t.computed;case"PropertyDefinition":return t.computed||e===t.value;case"Property":return t.computed||e===t.value;case"ExportSpecifier":case"ImportSpecifier":return e===t.local;case"LabeledStatement":case"BreakStatement":case"ContinueStatement":return false;default:return true}}return false}const Kn=Symbol("PureFunction");const getPureFunctions=({treeshake:e})=>{const t=Object.create(null);for(const i of e?e.manualPureFunctions:[]){let e=t;for(const t of i.split(".")){e=e[t]||(e[t]=Object.create(null))}e[Kn]=true}return t};const doNothing=()=>{};const Yn=Symbol("Value Properties");const getTruthyLiteralValue=()=>di;const returnFalse=()=>false;const returnTrue=()=>true;const Qn={deoptimizeArgumentsOnCall:doNothing,getLiteralValue:getTruthyLiteralValue,hasEffectsWhenCalled:returnFalse};const Xn={deoptimizeArgumentsOnCall:doNothing,getLiteralValue:getTruthyLiteralValue,hasEffectsWhenCalled:returnTrue};const Zn={deoptimizeArgumentsOnCall:doNothing,getLiteralValue:getTruthyLiteralValue,hasEffectsWhenCalled({args:e}){return e.length>1&&!(e[1]instanceof ArrayExpression)}};const Jn={__proto__:null,[Yn]:Xn};const er={__proto__:null,[Yn]:Qn};const tr={__proto__:null,[Yn]:{deoptimizeArgumentsOnCall({args:[,e]}){e?.deoptimizePath(oi)},getLiteralValue:getTruthyLiteralValue,hasEffectsWhenCalled({args:e},t){return e.length<=1||e[1].hasEffectsOnInteractionAtPath(ai,xi,t)}}};const ir={__proto__:null,[Yn]:Xn,prototype:Jn};const sr={__proto__:null,[Yn]:Qn,prototype:Jn};const nr={__proto__:null,[Yn]:Zn,prototype:Jn};const rr={__proto__:null,[Yn]:Qn,from:Jn,of:er,prototype:Jn};const or={__proto__:null,[Yn]:Qn,supportedLocalesOf:sr};const ar={global:Jn,globalThis:Jn,self:Jn,window:Jn,__proto__:null,[Yn]:Xn,Array:{__proto__:null,[Yn]:Xn,from:Jn,isArray:er,of:er,prototype:Jn},ArrayBuffer:{__proto__:null,[Yn]:Qn,isView:er,prototype:Jn},Atomics:Jn,BigInt:ir,BigInt64Array:ir,BigUint64Array:ir,Boolean:sr,constructor:ir,DataView:sr,Date:{__proto__:null,[Yn]:Qn,now:er,parse:er,prototype:Jn,UTC:er},decodeURI:er,decodeURIComponent:er,encodeURI:er,encodeURIComponent:er,Error:sr,escape:er,eval:Jn,EvalError:sr,Float32Array:rr,Float64Array:rr,Function:ir,hasOwnProperty:Jn,Infinity:Jn,Int16Array:rr,Int32Array:rr,Int8Array:rr,isFinite:er,isNaN:er,isPrototypeOf:Jn,JSON:Jn,Map:nr,Math:{__proto__:null,[Yn]:Xn,abs:er,acos:er,acosh:er,asin:er,asinh:er,atan:er,atan2:er,atanh:er,cbrt:er,ceil:er,clz32:er,cos:er,cosh:er,exp:er,expm1:er,floor:er,fround:er,hypot:er,imul:er,log:er,log10:er,log1p:er,log2:er,max:er,min:er,pow:er,random:er,round:er,sign:er,sin:er,sinh:er,sqrt:er,tan:er,tanh:er,trunc:er},NaN:Jn,Number:{__proto__:null,[Yn]:Qn,isFinite:er,isInteger:er,isNaN:er,isSafeInteger:er,parseFloat:er,parseInt:er,prototype:Jn},Object:{__proto__:null,[Yn]:Qn,create:er,defineProperty:tr,defineProperties:tr,freeze:tr,getOwnPropertyDescriptor:er,getOwnPropertyDescriptors:er,getOwnPropertyNames:er,getOwnPropertySymbols:er,getPrototypeOf:er,hasOwn:er,is:er,isExtensible:er,isFrozen:er,isSealed:er,keys:er,fromEntries:Jn,entries:er,prototype:Jn},parseFloat:er,parseInt:er,Promise:{__proto__:null,[Yn]:Xn,all:Jn,allSettled:Jn,any:Jn,prototype:Jn,race:Jn,reject:Jn,resolve:Jn},propertyIsEnumerable:Jn,Proxy:Jn,RangeError:sr,ReferenceError:sr,Reflect:Jn,RegExp:sr,Set:nr,SharedArrayBuffer:ir,String:{__proto__:null,[Yn]:Qn,fromCharCode:er,fromCodePoint:er,prototype:Jn,raw:er},Symbol:{__proto__:null,[Yn]:Qn,for:er,keyFor:er,prototype:Jn,toStringTag:{__proto__:null,[Yn]:{deoptimizeArgumentsOnCall:doNothing,getLiteralValue(){return ni},hasEffectsWhenCalled:returnTrue}}},SyntaxError:sr,toLocaleString:Jn,toString:Jn,TypeError:sr,Uint16Array:rr,Uint32Array:rr,Uint8Array:rr,Uint8ClampedArray:rr,unescape:er,URIError:sr,valueOf:Jn,WeakMap:nr,WeakSet:nr,clearInterval:ir,clearTimeout:ir,console:{__proto__:null,[Yn]:Xn,assert:ir,clear:ir,count:ir,countReset:ir,debug:ir,dir:ir,dirxml:ir,error:ir,exception:ir,group:ir,groupCollapsed:ir,groupEnd:ir,info:ir,log:ir,table:ir,time:ir,timeEnd:ir,timeLog:ir,trace:ir,warn:ir},Intl:{__proto__:null,[Yn]:Xn,Collator:or,DateTimeFormat:or,ListFormat:or,NumberFormat:or,PluralRules:or,RelativeTimeFormat:or},setInterval:ir,setTimeout:ir,TextDecoder:ir,TextEncoder:ir,URL:ir,URLSearchParams:ir,AbortController:ir,AbortSignal:ir,addEventListener:Jn,alert:Jn,AnalyserNode:ir,Animation:ir,AnimationEvent:ir,applicationCache:Jn,ApplicationCache:ir,ApplicationCacheErrorEvent:ir,atob:Jn,Attr:ir,Audio:ir,AudioBuffer:ir,AudioBufferSourceNode:ir,AudioContext:ir,AudioDestinationNode:ir,AudioListener:ir,AudioNode:ir,AudioParam:ir,AudioProcessingEvent:ir,AudioScheduledSourceNode:ir,AudioWorkletNode:ir,BarProp:ir,BaseAudioContext:ir,BatteryManager:ir,BeforeUnloadEvent:ir,BiquadFilterNode:ir,Blob:ir,BlobEvent:ir,blur:Jn,BroadcastChannel:ir,btoa:Jn,ByteLengthQueuingStrategy:ir,Cache:ir,caches:Jn,CacheStorage:ir,cancelAnimationFrame:Jn,cancelIdleCallback:Jn,CanvasCaptureMediaStreamTrack:ir,CanvasGradient:ir,CanvasPattern:ir,CanvasRenderingContext2D:ir,ChannelMergerNode:ir,ChannelSplitterNode:ir,CharacterData:ir,clientInformation:Jn,ClipboardEvent:ir,close:Jn,closed:Jn,CloseEvent:ir,Comment:ir,CompositionEvent:ir,confirm:Jn,ConstantSourceNode:ir,ConvolverNode:ir,CountQueuingStrategy:ir,createImageBitmap:Jn,Credential:ir,CredentialsContainer:ir,crypto:Jn,Crypto:ir,CryptoKey:ir,CSS:ir,CSSConditionRule:ir,CSSFontFaceRule:ir,CSSGroupingRule:ir,CSSImportRule:ir,CSSKeyframeRule:ir,CSSKeyframesRule:ir,CSSMediaRule:ir,CSSNamespaceRule:ir,CSSPageRule:ir,CSSRule:ir,CSSRuleList:ir,CSSStyleDeclaration:ir,CSSStyleRule:ir,CSSStyleSheet:ir,CSSSupportsRule:ir,CustomElementRegistry:ir,customElements:Jn,CustomEvent:ir,DataTransfer:ir,DataTransferItem:ir,DataTransferItemList:ir,defaultstatus:Jn,defaultStatus:Jn,DelayNode:ir,DeviceMotionEvent:ir,DeviceOrientationEvent:ir,devicePixelRatio:Jn,dispatchEvent:Jn,document:Jn,Document:ir,DocumentFragment:ir,DocumentType:ir,DOMError:ir,DOMException:ir,DOMImplementation:ir,DOMMatrix:ir,DOMMatrixReadOnly:ir,DOMParser:ir,DOMPoint:ir,DOMPointReadOnly:ir,DOMQuad:ir,DOMRect:ir,DOMRectReadOnly:ir,DOMStringList:ir,DOMStringMap:ir,DOMTokenList:ir,DragEvent:ir,DynamicsCompressorNode:ir,Element:ir,ErrorEvent:ir,Event:ir,EventSource:ir,EventTarget:ir,external:Jn,fetch:Jn,File:ir,FileList:ir,FileReader:ir,find:Jn,focus:Jn,FocusEvent:ir,FontFace:ir,FontFaceSetLoadEvent:ir,FormData:ir,frames:Jn,GainNode:ir,Gamepad:ir,GamepadButton:ir,GamepadEvent:ir,getComputedStyle:Jn,getSelection:Jn,HashChangeEvent:ir,Headers:ir,history:Jn,History:ir,HTMLAllCollection:ir,HTMLAnchorElement:ir,HTMLAreaElement:ir,HTMLAudioElement:ir,HTMLBaseElement:ir,HTMLBodyElement:ir,HTMLBRElement:ir,HTMLButtonElement:ir,HTMLCanvasElement:ir,HTMLCollection:ir,HTMLContentElement:ir,HTMLDataElement:ir,HTMLDataListElement:ir,HTMLDetailsElement:ir,HTMLDialogElement:ir,HTMLDirectoryElement:ir,HTMLDivElement:ir,HTMLDListElement:ir,HTMLDocument:ir,HTMLElement:ir,HTMLEmbedElement:ir,HTMLFieldSetElement:ir,HTMLFontElement:ir,HTMLFormControlsCollection:ir,HTMLFormElement:ir,HTMLFrameElement:ir,HTMLFrameSetElement:ir,HTMLHeadElement:ir,HTMLHeadingElement:ir,HTMLHRElement:ir,HTMLHtmlElement:ir,HTMLIFrameElement:ir,HTMLImageElement:ir,HTMLInputElement:ir,HTMLLabelElement:ir,HTMLLegendElement:ir,HTMLLIElement:ir,HTMLLinkElement:ir,HTMLMapElement:ir,HTMLMarqueeElement:ir,HTMLMediaElement:ir,HTMLMenuElement:ir,HTMLMetaElement:ir,HTMLMeterElement:ir,HTMLModElement:ir,HTMLObjectElement:ir,HTMLOListElement:ir,HTMLOptGroupElement:ir,HTMLOptionElement:ir,HTMLOptionsCollection:ir,HTMLOutputElement:ir,HTMLParagraphElement:ir,HTMLParamElement:ir,HTMLPictureElement:ir,HTMLPreElement:ir,HTMLProgressElement:ir,HTMLQuoteElement:ir,HTMLScriptElement:ir,HTMLSelectElement:ir,HTMLShadowElement:ir,HTMLSlotElement:ir,HTMLSourceElement:ir,HTMLSpanElement:ir,HTMLStyleElement:ir,HTMLTableCaptionElement:ir,HTMLTableCellElement:ir,HTMLTableColElement:ir,HTMLTableElement:ir,HTMLTableRowElement:ir,HTMLTableSectionElement:ir,HTMLTemplateElement:ir,HTMLTextAreaElement:ir,HTMLTimeElement:ir,HTMLTitleElement:ir,HTMLTrackElement:ir,HTMLUListElement:ir,HTMLUnknownElement:ir,HTMLVideoElement:ir,IDBCursor:ir,IDBCursorWithValue:ir,IDBDatabase:ir,IDBFactory:ir,IDBIndex:ir,IDBKeyRange:ir,IDBObjectStore:ir,IDBOpenDBRequest:ir,IDBRequest:ir,IDBTransaction:ir,IDBVersionChangeEvent:ir,IdleDeadline:ir,IIRFilterNode:ir,Image:ir,ImageBitmap:ir,ImageBitmapRenderingContext:ir,ImageCapture:ir,ImageData:ir,indexedDB:Jn,innerHeight:Jn,innerWidth:Jn,InputEvent:ir,IntersectionObserver:ir,IntersectionObserverEntry:ir,isSecureContext:Jn,KeyboardEvent:ir,KeyframeEffect:ir,length:Jn,localStorage:Jn,location:Jn,Location:ir,locationbar:Jn,matchMedia:Jn,MediaDeviceInfo:ir,MediaDevices:ir,MediaElementAudioSourceNode:ir,MediaEncryptedEvent:ir,MediaError:ir,MediaKeyMessageEvent:ir,MediaKeySession:ir,MediaKeyStatusMap:ir,MediaKeySystemAccess:ir,MediaList:ir,MediaQueryList:ir,MediaQueryListEvent:ir,MediaRecorder:ir,MediaSettingsRange:ir,MediaSource:ir,MediaStream:ir,MediaStreamAudioDestinationNode:ir,MediaStreamAudioSourceNode:ir,MediaStreamEvent:ir,MediaStreamTrack:ir,MediaStreamTrackEvent:ir,menubar:Jn,MessageChannel:ir,MessageEvent:ir,MessagePort:ir,MIDIAccess:ir,MIDIConnectionEvent:ir,MIDIInput:ir,MIDIInputMap:ir,MIDIMessageEvent:ir,MIDIOutput:ir,MIDIOutputMap:ir,MIDIPort:ir,MimeType:ir,MimeTypeArray:ir,MouseEvent:ir,moveBy:Jn,moveTo:Jn,MutationEvent:ir,MutationObserver:ir,MutationRecord:ir,name:Jn,NamedNodeMap:ir,NavigationPreloadManager:ir,navigator:Jn,Navigator:ir,NetworkInformation:ir,Node:ir,NodeFilter:Jn,NodeIterator:ir,NodeList:ir,Notification:ir,OfflineAudioCompletionEvent:ir,OfflineAudioContext:ir,offscreenBuffering:Jn,OffscreenCanvas:ir,open:Jn,openDatabase:Jn,Option:ir,origin:Jn,OscillatorNode:ir,outerHeight:Jn,outerWidth:Jn,PageTransitionEvent:ir,pageXOffset:Jn,pageYOffset:Jn,PannerNode:ir,parent:Jn,Path2D:ir,PaymentAddress:ir,PaymentRequest:ir,PaymentRequestUpdateEvent:ir,PaymentResponse:ir,performance:Jn,Performance:ir,PerformanceEntry:ir,PerformanceLongTaskTiming:ir,PerformanceMark:ir,PerformanceMeasure:ir,PerformanceNavigation:ir,PerformanceNavigationTiming:ir,PerformanceObserver:ir,PerformanceObserverEntryList:ir,PerformancePaintTiming:ir,PerformanceResourceTiming:ir,PerformanceTiming:ir,PeriodicWave:ir,Permissions:ir,PermissionStatus:ir,personalbar:Jn,PhotoCapabilities:ir,Plugin:ir,PluginArray:ir,PointerEvent:ir,PopStateEvent:ir,postMessage:Jn,Presentation:ir,PresentationAvailability:ir,PresentationConnection:ir,PresentationConnectionAvailableEvent:ir,PresentationConnectionCloseEvent:ir,PresentationConnectionList:ir,PresentationReceiver:ir,PresentationRequest:ir,print:Jn,ProcessingInstruction:ir,ProgressEvent:ir,PromiseRejectionEvent:ir,prompt:Jn,PushManager:ir,PushSubscription:ir,PushSubscriptionOptions:ir,queueMicrotask:Jn,RadioNodeList:ir,Range:ir,ReadableStream:ir,RemotePlayback:ir,removeEventListener:Jn,Request:ir,requestAnimationFrame:Jn,requestIdleCallback:Jn,resizeBy:Jn,ResizeObserver:ir,ResizeObserverEntry:ir,resizeTo:Jn,Response:ir,RTCCertificate:ir,RTCDataChannel:ir,RTCDataChannelEvent:ir,RTCDtlsTransport:ir,RTCIceCandidate:ir,RTCIceTransport:ir,RTCPeerConnection:ir,RTCPeerConnectionIceEvent:ir,RTCRtpReceiver:ir,RTCRtpSender:ir,RTCSctpTransport:ir,RTCSessionDescription:ir,RTCStatsReport:ir,RTCTrackEvent:ir,screen:Jn,Screen:ir,screenLeft:Jn,ScreenOrientation:ir,screenTop:Jn,screenX:Jn,screenY:Jn,ScriptProcessorNode:ir,scroll:Jn,scrollbars:Jn,scrollBy:Jn,scrollTo:Jn,scrollX:Jn,scrollY:Jn,SecurityPolicyViolationEvent:ir,Selection:ir,ServiceWorker:ir,ServiceWorkerContainer:ir,ServiceWorkerRegistration:ir,sessionStorage:Jn,ShadowRoot:ir,SharedWorker:ir,SourceBuffer:ir,SourceBufferList:ir,speechSynthesis:Jn,SpeechSynthesisEvent:ir,SpeechSynthesisUtterance:ir,StaticRange:ir,status:Jn,statusbar:Jn,StereoPannerNode:ir,stop:Jn,Storage:ir,StorageEvent:ir,StorageManager:ir,styleMedia:Jn,StyleSheet:ir,StyleSheetList:ir,SubtleCrypto:ir,SVGAElement:ir,SVGAngle:ir,SVGAnimatedAngle:ir,SVGAnimatedBoolean:ir,SVGAnimatedEnumeration:ir,SVGAnimatedInteger:ir,SVGAnimatedLength:ir,SVGAnimatedLengthList:ir,SVGAnimatedNumber:ir,SVGAnimatedNumberList:ir,SVGAnimatedPreserveAspectRatio:ir,SVGAnimatedRect:ir,SVGAnimatedString:ir,SVGAnimatedTransformList:ir,SVGAnimateElement:ir,SVGAnimateMotionElement:ir,SVGAnimateTransformElement:ir,SVGAnimationElement:ir,SVGCircleElement:ir,SVGClipPathElement:ir,SVGComponentTransferFunctionElement:ir,SVGDefsElement:ir,SVGDescElement:ir,SVGDiscardElement:ir,SVGElement:ir,SVGEllipseElement:ir,SVGFEBlendElement:ir,SVGFEColorMatrixElement:ir,SVGFEComponentTransferElement:ir,SVGFECompositeElement:ir,SVGFEConvolveMatrixElement:ir,SVGFEDiffuseLightingElement:ir,SVGFEDisplacementMapElement:ir,SVGFEDistantLightElement:ir,SVGFEDropShadowElement:ir,SVGFEFloodElement:ir,SVGFEFuncAElement:ir,SVGFEFuncBElement:ir,SVGFEFuncGElement:ir,SVGFEFuncRElement:ir,SVGFEGaussianBlurElement:ir,SVGFEImageElement:ir,SVGFEMergeElement:ir,SVGFEMergeNodeElement:ir,SVGFEMorphologyElement:ir,SVGFEOffsetElement:ir,SVGFEPointLightElement:ir,SVGFESpecularLightingElement:ir,SVGFESpotLightElement:ir,SVGFETileElement:ir,SVGFETurbulenceElement:ir,SVGFilterElement:ir,SVGForeignObjectElement:ir,SVGGElement:ir,SVGGeometryElement:ir,SVGGradientElement:ir,SVGGraphicsElement:ir,SVGImageElement:ir,SVGLength:ir,SVGLengthList:ir,SVGLinearGradientElement:ir,SVGLineElement:ir,SVGMarkerElement:ir,SVGMaskElement:ir,SVGMatrix:ir,SVGMetadataElement:ir,SVGMPathElement:ir,SVGNumber:ir,SVGNumberList:ir,SVGPathElement:ir,SVGPatternElement:ir,SVGPoint:ir,SVGPointList:ir,SVGPolygonElement:ir,SVGPolylineElement:ir,SVGPreserveAspectRatio:ir,SVGRadialGradientElement:ir,SVGRect:ir,SVGRectElement:ir,SVGScriptElement:ir,SVGSetElement:ir,SVGStopElement:ir,SVGStringList:ir,SVGStyleElement:ir,SVGSVGElement:ir,SVGSwitchElement:ir,SVGSymbolElement:ir,SVGTextContentElement:ir,SVGTextElement:ir,SVGTextPathElement:ir,SVGTextPositioningElement:ir,SVGTitleElement:ir,SVGTransform:ir,SVGTransformList:ir,SVGTSpanElement:ir,SVGUnitTypes:ir,SVGUseElement:ir,SVGViewElement:ir,TaskAttributionTiming:ir,Text:ir,TextEvent:ir,TextMetrics:ir,TextTrack:ir,TextTrackCue:ir,TextTrackCueList:ir,TextTrackList:ir,TimeRanges:ir,toolbar:Jn,top:Jn,Touch:ir,TouchEvent:ir,TouchList:ir,TrackEvent:ir,TransitionEvent:ir,TreeWalker:ir,UIEvent:ir,ValidityState:ir,visualViewport:Jn,VisualViewport:ir,VTTCue:ir,WaveShaperNode:ir,WebAssembly:Jn,WebGL2RenderingContext:ir,WebGLActiveInfo:ir,WebGLBuffer:ir,WebGLContextEvent:ir,WebGLFramebuffer:ir,WebGLProgram:ir,WebGLQuery:ir,WebGLRenderbuffer:ir,WebGLRenderingContext:ir,WebGLSampler:ir,WebGLShader:ir,WebGLShaderPrecisionFormat:ir,WebGLSync:ir,WebGLTexture:ir,WebGLTransformFeedback:ir,WebGLUniformLocation:ir,WebGLVertexArrayObject:ir,WebSocket:ir,WheelEvent:ir,Window:ir,Worker:ir,WritableStream:ir,XMLDocument:ir,XMLHttpRequest:ir,XMLHttpRequestEventTarget:ir,XMLHttpRequestUpload:ir,XMLSerializer:ir,XPathEvaluator:ir,XPathExpression:ir,XPathResult:ir,XSLTProcessor:ir};for(const e of["window","global","self","globalThis"]){ar[e]=ar}function getGlobalAtPath(e){let t=ar;for(const i of e){if(typeof i!=="string"){return null}t=t[i];if(!t){return null}}return t[Yn]}class GlobalVariable extends Variable{constructor(){super(...arguments);this.isReassigned=true}deoptimizeArgumentsOnInteractionAtPath(e,t,i){switch(e.type){case mi:case gi:{if(!getGlobalAtPath([this.name,...t].slice(0,-1))){super.deoptimizeArgumentsOnInteractionAtPath(e,t,i)}return}case yi:{const s=getGlobalAtPath([this.name,...t]);if(s){s.deoptimizeArgumentsOnCall(e)}else{super.deoptimizeArgumentsOnInteractionAtPath(e,t,i)}return}}}getLiteralValueAtPath(e,t,i){const s=getGlobalAtPath([this.name,...e]);return s?s.getLiteralValue():hi}hasEffectsOnInteractionAtPath(e,t,i){switch(t.type){case mi:{if(e.length===0){return this.name!=="undefined"&&!getGlobalAtPath([this.name])}return!getGlobalAtPath([this.name,...e].slice(0,-1))}case gi:{return true}case yi:{const s=getGlobalAtPath([this.name,...e]);return!s||s.hasEffectsWhenCalled(t,i)}}}}const lr={__proto__:null,class:true,const:true,let:true,var:true};class Identifier extends NodeBase{constructor(){super(...arguments);this.variable=null;this.isTDZAccess=null}addExportedVariables(e,t){if(t.has(this.variable)){e.push(this.variable)}}bind(){if(!this.variable&&is_reference(this,this.parent)){this.variable=this.scope.findVariable(this.name);this.variable.addReference(this)}}declare(e,t){let i;const{treeshake:s}=this.context.options;switch(e){case"var":{i=this.scope.addDeclaration(this,this.context,t,true);if(s&&s.correctVarValueBeforeDeclaration){i.markInitializersForDeoptimization()}break}case"function":{i=this.scope.addDeclaration(this,this.context,t,false);break}case"let":case"const":case"class":{i=this.scope.addDeclaration(this,this.context,t,false);break}case"parameter":{i=this.scope.addParameterDeclaration(this);break}default:{throw new Error(`Internal Error: Unexpected identifier kind ${e}.`)}}i.kind=e;return[this.variable=i]}deoptimizeArgumentsOnInteractionAtPath(e,t,i){this.variable.deoptimizeArgumentsOnInteractionAtPath(e,t,i)}deoptimizePath(e){if(e.length===0&&!this.scope.contains(this.name)){this.disallowImportReassignment()}this.variable?.deoptimizePath(e)}getLiteralValueAtPath(e,t,i){return this.getVariableRespectingTDZ().getLiteralValueAtPath(e,t,i)}getReturnExpressionWhenCalledAtPath(e,t,i,s){const[n,r]=this.getVariableRespectingTDZ().getReturnExpressionWhenCalledAtPath(e,t,i,s);return[n,r||this.isPureFunction(e)]}hasEffects(e){if(!this.deoptimized)this.applyDeoptimizations();if(this.isPossibleTDZ()&&this.variable.kind!=="var"){return true}return this.context.options.treeshake.unknownGlobalSideEffects&&this.variable instanceof GlobalVariable&&!this.isPureFunction(ri)&&this.variable.hasEffectsOnInteractionAtPath(ri,Ei,e)}hasEffectsOnInteractionAtPath(e,t,i){switch(t.type){case mi:{return this.variable!==null&&!this.isPureFunction(e)&&this.getVariableRespectingTDZ().hasEffectsOnInteractionAtPath(e,t,i)}case gi:{return(e.length>0?this.getVariableRespectingTDZ():this.variable).hasEffectsOnInteractionAtPath(e,t,i)}case yi:{return!this.isPureFunction(e)&&this.getVariableRespectingTDZ().hasEffectsOnInteractionAtPath(e,t,i)}}}include(){if(!this.deoptimized)this.applyDeoptimizations();if(!this.included){this.included=true;if(this.variable!==null){this.context.includeVariableInModule(this.variable)}}}includeCallArguments(e,t){this.variable.includeCallArguments(e,t)}isPossibleTDZ(){if(this.isTDZAccess!==null)return this.isTDZAccess;if(!(this.variable instanceof LocalVariable&&this.variable.kind&&this.variable.kind in lr&&this.variable.module===this.context.module)){return this.isTDZAccess=false}let e;if(this.variable.declarations&&this.variable.declarations.length===1&&(e=this.variable.declarations[0])&&this.start<e.start&&closestParentFunctionOrProgram(this)===closestParentFunctionOrProgram(e)){return this.isTDZAccess=true}if(!this.variable.initReached){return this.isTDZAccess=true}return this.isTDZAccess=false}markDeclarationReached(){this.variable.initReached=true}render(e,{snippets:{getPropertyAccess:t},useOriginalName:i},{renderedParentType:s,isCalleeOfRenderedParent:n,isShorthandProperty:r}=q){if(this.variable){const o=this.variable.getName(t,i);if(o!==this.name){e.overwrite(this.start,this.end,o,{contentOnly:true,storeName:true});if(r){e.prependRight(this.start,`${this.name}: `)}}if(o==="eval"&&s===Zs&&n){e.appendRight(this.start,"0, ")}}}applyDeoptimizations(){this.deoptimized=true;if(this.variable instanceof LocalVariable){this.variable.consolidateInitializers();this.context.requestTreeshakingPass()}}disallowImportReassignment(){return this.context.error(errorIllegalImportReassignment(this.name,this.context.module.id),this.start)}getVariableRespectingTDZ(){if(this.isPossibleTDZ()){return pi}return this.variable}isPureFunction(e){let t=this.context.manualPureFunctions[this.name];for(const i of e){if(t){if(t[Kn]){return true}t=t[i]}else{return false}}return t?.[Kn]}}function closestParentFunctionOrProgram(e){while(e&&!/^Program|Function/.test(e.type)){e=e.parent}return e}function treeshakeNode(e,t,i,s){t.remove(i,s);if(e.annotations){for(const s of e.annotations){if(s.start<i){t.remove(s.start,s.end)}else{return}}}}function removeAnnotations(e,t){if(!e.annotations&&e.parent.type===tn){e=e.parent}if(e.annotations){for(const i of e.annotations){t.remove(i.start,i.end)}}}const cr={isNoStatement:true};function findFirstOccurrenceOutsideComment(e,t,i=0){let s,n;s=e.indexOf(t,i);while(true){i=e.indexOf("/",i);if(i===-1||i>=s)return s;n=e.charCodeAt(++i);++i;i=n===47?e.indexOf("\n",i)+1:e.indexOf("*/",i)+2;if(i>s){s=e.indexOf(t,i)}}}const ur=/\S/g;function findNonWhiteSpace(e,t){ur.lastIndex=t;const i=ur.exec(e);return i.index}function findFirstLineBreakOutsideComment(e){let t,i,s=0;t=e.indexOf("\n",s);while(true){s=e.indexOf("/",s);if(s===-1||s>t)return[t,t+1];i=e.charCodeAt(s+1);if(i===47)return[s,t+1];s=e.indexOf("*/",s+3)+2;if(s>t){t=e.indexOf("\n",s)}}}function renderStatementList(e,t,i,s,n){let r,o,l,c;let u=e[0];let h=!u.included||u.needsBoundaries;if(h){c=i+findFirstLineBreakOutsideComment(t.original.slice(i,u.start))[1]}for(let i=1;i<=e.length;i++){r=u;o=c;l=h;u=e[i];h=u===undefined?false:!u.included||u.needsBoundaries;if(l||h){c=r.end+findFirstLineBreakOutsideComment(t.original.slice(r.end,u===undefined?s:u.start))[1];if(r.included){l?r.render(t,n,{end:c,start:o}):r.render(t,n)}else{treeshakeNode(r,t,o,c)}}else{r.render(t,n)}}}function getCommaSeparatedNodesWithBoundaries(e,t,i,s){const n=[];let r,o,l,c;let u=i-1;for(const s of e){if(r!==undefined){u=r.end+findFirstOccurrenceOutsideComment(t.original.slice(r.end,s.start),",")}o=l=u+1+findFirstLineBreakOutsideComment(t.original.slice(u+1,s.start))[1];while(c=t.original.charCodeAt(o),c===32||c===9||c===10||c===13)o++;if(r!==undefined){n.push({contentEnd:l,end:o,node:r,separator:u,start:i})}r=s;i=o}n.push({contentEnd:s,end:s,node:r,separator:null,start:i});return n}function removeLineBreaks(e,t,i){while(true){const[s,n]=findFirstLineBreakOutsideComment(e.original.slice(t,i));if(s===-1){break}e.remove(t+s,t+=n)}}class BlockScope extends ChildScope{addDeclaration(e,t,i,s){if(s){const n=this.parent.addDeclaration(e,t,i,s);n.markInitializersForDeoptimization();return n}else{return super.addDeclaration(e,t,i,false)}}}class ExpressionStatement extends NodeBase{initialise(){if(this.directive&&this.directive!=="use strict"&&this.parent.type===on){this.context.warn(errorModuleLevelDirective(this.directive,this.context.module.id),this.start)}}render(e,t){super.render(e,t);if(this.included)this.insertSemicolon(e)}shouldBeIncluded(e){if(this.directive&&this.directive!=="use strict")return this.parent.type!==on;return super.shouldBeIncluded(e)}applyDeoptimizations(){}}class BlockStatement extends NodeBase{constructor(){super(...arguments);this.directlyIncluded=false}addImplicitReturnExpressionToScope(){const e=this.body[this.body.length-1];if(!e||e.type!==ln){this.scope.addReturnExpression(pi)}}createScope(e){this.scope=this.parent.preventChildBlockScope?e:new BlockScope(e)}hasEffects(e){if(this.deoptimizeBody)return true;for(const t of this.body){if(e.brokenFlow)break;if(t.hasEffects(e))return true}return false}include(e,t){if(!(this.deoptimizeBody&&this.directlyIncluded)){this.included=true;this.directlyIncluded=true;if(this.deoptimizeBody)t=true;for(const i of this.body){if(t||i.shouldBeIncluded(e))i.include(e,t)}}}initialise(){const e=this.body[0];this.deoptimizeBody=e instanceof ExpressionStatement&&e.directive==="use asm"}render(e,t){if(this.body.length>0){renderStatementList(this.body,e,this.start+1,this.end-1,t)}else{super.render(e,t)}}}class RestElement extends NodeBase{constructor(){super(...arguments);this.declarationInit=null}addExportedVariables(e,t){this.argument.addExportedVariables(e,t)}declare(e,t){this.declarationInit=t;return this.argument.declare(e,pi)}deoptimizePath(e){e.length===0&&this.argument.deoptimizePath(ri)}hasEffectsOnInteractionAtPath(e,t,i){return e.length>0||this.argument.hasEffectsOnInteractionAtPath(ri,t,i)}markDeclarationReached(){this.argument.markDeclarationReached()}applyDeoptimizations(){this.deoptimized=true;if(this.declarationInit!==null){this.declarationInit.deoptimizePath([ti,ti]);this.context.requestTreeshakingPass()}}}class FunctionBase extends NodeBase{constructor(){super(...arguments);this.objectEntity=null;this.deoptimizedReturn=false}deoptimizeArgumentsOnInteractionAtPath(e,t,i){if(e.type===yi){const{parameters:t}=this.scope;const{args:i}=e;let s=false;for(let e=0;e<i.length-1;e++){const n=this.params[e];const r=i[e+1];if(s||n instanceof RestElement){s=true;r.deoptimizePath(oi)}else if(n instanceof Identifier){t[e][0].addEntityToBeDeoptimized(r);this.addArgumentToBeDeoptimized(r)}else if(n){r.deoptimizePath(oi)}else{this.addArgumentToBeDeoptimized(r)}}}else{this.getObjectEntity().deoptimizeArgumentsOnInteractionAtPath(e,t,i)}}deoptimizePath(e){this.getObjectEntity().deoptimizePath(e);if(e.length===1&&e[0]===ti){this.scope.getReturnExpression().deoptimizePath(oi)}}getLiteralValueAtPath(e,t,i){return this.getObjectEntity().getLiteralValueAtPath(e,t,i)}getReturnExpressionWhenCalledAtPath(e,t,i,s){if(e.length>0){return this.getObjectEntity().getReturnExpressionWhenCalledAtPath(e,t,i,s)}if(this.async){if(!this.deoptimizedReturn){this.deoptimizedReturn=true;this.scope.getReturnExpression().deoptimizePath(oi);this.context.requestTreeshakingPass()}return fi}return[this.scope.getReturnExpression(),false]}hasEffectsOnInteractionAtPath(e,t,i){if(e.length>0||t.type!==yi){return this.getObjectEntity().hasEffectsOnInteractionAtPath(e,t,i)}if(this.async){const{propertyReadSideEffects:e}=this.context.options.treeshake;const t=this.scope.getReturnExpression();if(t.hasEffectsOnInteractionAtPath(["then"],bi,i)||e&&(e==="always"||t.hasEffectsOnInteractionAtPath(["then"],Ei,i))){return true}}for(const e of this.params){if(e.hasEffects(i))return true}return false}include(e,t){if(!this.deoptimized)this.applyDeoptimizations();this.included=true;const{brokenFlow:i}=e;e.brokenFlow=false;this.body.include(e,t);e.brokenFlow=i}includeCallArguments(e,t){this.scope.includeCallArguments(e,t)}initialise(){this.scope.addParameterVariables(this.params.map((e=>e.declare("parameter",pi))),this.params[this.params.length-1]instanceof RestElement);if(this.body instanceof BlockStatement){this.body.addImplicitReturnExpressionToScope()}else{this.scope.addReturnExpression(this.body)}}parseNode(e){if(e.body.type===Xs){this.body=new BlockStatement(e.body,this,this.scope.hoistedBodyVarScope)}super.parseNode(e)}addArgumentToBeDeoptimized(e){}applyDeoptimizations(){}}FunctionBase.prototype.preventChildBlockScope=true;class ArrowFunctionExpression extends FunctionBase{constructor(){super(...arguments);this.objectEntity=null}createScope(e){this.scope=new ReturnValueScope(e,this.context)}hasEffects(){if(!this.deoptimized)this.applyDeoptimizations();return false}hasEffectsOnInteractionAtPath(e,t,i){if(super.hasEffectsOnInteractionAtPath(e,t,i))return true;if(t.type===yi){const{ignore:e,brokenFlow:t}=i;i.ignore={breaks:false,continues:false,labels:new Set,returnYield:true,this:false};if(this.body.hasEffects(i))return true;i.ignore=e;i.brokenFlow=t}return false}include(e,t){super.include(e,t);for(const i of this.params){if(!(i instanceof Identifier)){i.include(e,t)}}}getObjectEntity(){if(this.objectEntity!==null){return this.objectEntity}return this.objectEntity=new ObjectEntity([],kn)}}function getSystemExportStatement(e,{exportNamesByVariable:t,snippets:{_:i,getObject:s,getPropertyAccess:n}},r=""){if(e.length===1&&t.get(e[0]).length===1){const s=e[0];return`exports('${t.get(s)}',${i}${s.getName(n)}${r})`}else{const i=[];for(const s of e){for(const e of t.get(s)){i.push([e,s.getName(n)+r])}}return`exports(${s(i,{lineBreakIndent:null})})`}}function renderSystemExportExpression(e,t,i,s,{exportNamesByVariable:n,snippets:{_:r}}){s.prependRight(t,`exports('${n.get(e)}',${r}`);s.appendLeft(i,")")}function renderSystemExportFunction(e,t,i,s,n,r){const{_:o,getDirectReturnIifeLeft:l}=r.snippets;n.prependRight(t,l(["v"],`${getSystemExportStatement(e,r)},${o}v`,{needsArrowReturnParens:true,needsWrappedFunction:s}));n.appendLeft(i,")")}function renderSystemExportSequenceAfterExpression(e,t,i,s,n,r){const{_:o,getPropertyAccess:l}=r.snippets;n.appendLeft(i,`,${o}${getSystemExportStatement([e],r)},${o}${e.getName(l)}`);if(s){n.prependRight(t,"(");n.appendLeft(i,")")}}function renderSystemExportSequenceBeforeExpression(e,t,i,s,n,r,o){const{_:l}=r.snippets;n.prependRight(t,`${getSystemExportStatement([e],r,o)},${l}`);if(s){n.prependRight(t,"(");n.appendLeft(i,")")}}class ObjectPattern extends NodeBase{addExportedVariables(e,t){for(const i of this.properties){if(i.type===an){i.value.addExportedVariables(e,t)}else{i.argument.addExportedVariables(e,t)}}}declare(e,t){const i=[];for(const s of this.properties){i.push(...s.declare(e,t))}return i}deoptimizePath(e){if(e.length===0){for(const t of this.properties){t.deoptimizePath(e)}}}hasEffectsOnInteractionAtPath(e,t,i){for(const e of this.properties){if(e.hasEffectsOnInteractionAtPath(ri,t,i))return true}return false}markDeclarationReached(){for(const e of this.properties){e.markDeclarationReached()}}}class AssignmentExpression extends NodeBase{hasEffects(e){const{deoptimized:t,left:i,operator:s,right:n}=this;if(!t)this.applyDeoptimizations();return n.hasEffects(e)||i.hasEffectsAsAssignmentTarget(e,s!=="=")}hasEffectsOnInteractionAtPath(e,t,i){return this.right.hasEffectsOnInteractionAtPath(e,t,i)}include(e,t){const{deoptimized:i,left:s,right:n,operator:r}=this;if(!i)this.applyDeoptimizations();this.included=true;if(t||r!=="="||s.included||s.hasEffectsAsAssignmentTarget(createHasEffectsContext(),false)){s.includeAsAssignmentTarget(e,t,r!=="=")}n.include(e,t)}initialise(){this.left.setAssignedValue(this.right)}render(e,t,{preventASI:i,renderedParentType:s,renderedSurroundingElement:n}=q){const{left:r,right:o,start:l,end:c,parent:u}=this;if(r.included){r.render(e,t);o.render(e,t)}else{const c=findNonWhiteSpace(e.original,findFirstOccurrenceOutsideComment(e.original,"=",r.end)+1);e.remove(l,c);if(i){removeLineBreaks(e,c,o.start)}o.render(e,t,{renderedParentType:s||u.type,renderedSurroundingElement:n||u.type})}if(t.format==="system"){if(r instanceof Identifier){const i=r.variable;const s=t.exportNamesByVariable.get(i);if(s){if(s.length===1){renderSystemExportExpression(i,l,c,e,t)}else{renderSystemExportSequenceAfterExpression(i,l,c,u.type!==tn,e,t)}return}}else{const i=[];r.addExportedVariables(i,t.exportNamesByVariable);if(i.length>0){renderSystemExportFunction(i,l,c,n===tn,e,t);return}}}if(r.included&&r instanceof ObjectPattern&&(n===tn||n===Ys)){e.appendRight(l,"(");e.prependLeft(c,")")}}applyDeoptimizations(){this.deoptimized=true;this.left.deoptimizePath(ri);this.right.deoptimizePath(oi);this.context.requestTreeshakingPass()}}class AssignmentPattern extends NodeBase{addExportedVariables(e,t){this.left.addExportedVariables(e,t)}declare(e,t){return this.left.declare(e,t)}deoptimizePath(e){e.length===0&&this.left.deoptimizePath(e)}hasEffectsOnInteractionAtPath(e,t,i){return e.length>0||this.left.hasEffectsOnInteractionAtPath(ri,t,i)}markDeclarationReached(){this.left.markDeclarationReached()}render(e,t,{isShorthandProperty:i}=q){this.left.render(e,t,{isShorthandProperty:i});this.right.render(e,t)}applyDeoptimizations(){this.deoptimized=true;this.left.deoptimizePath(ri);this.right.deoptimizePath(oi);this.context.requestTreeshakingPass()}}class ArgumentsVariable extends LocalVariable{constructor(e){super("arguments",null,pi,e);this.deoptimizedArguments=[]}addArgumentToBeDeoptimized(e){if(this.included){e.deoptimizePath(oi)}else{this.deoptimizedArguments.push(e)}}hasEffectsOnInteractionAtPath(e,{type:t}){return t!==mi||e.length>1}include(){super.include();for(const e of this.deoptimizedArguments){e.deoptimizePath(oi)}this.deoptimizedArguments.length=0}}class ThisVariable extends ParameterVariable{constructor(e){super("this",null,e)}hasEffectsOnInteractionAtPath(e,t,i){return(i.replacedVariableInits.get(this)||pi).hasEffectsOnInteractionAtPath(e,t,i)}}class FunctionScope extends ReturnValueScope{constructor(e,t){super(e,t);this.variables.set("arguments",this.argumentsVariable=new ArgumentsVariable(t));this.variables.set("this",this.thisVariable=new ThisVariable(t))}findLexicalBoundary(){return this}includeCallArguments(e,t){super.includeCallArguments(e,t);if(this.argumentsVariable.included){for(const i of t){if(!i.included){i.include(e,false)}}}}}class FunctionNode extends FunctionBase{constructor(){super(...arguments);this.objectEntity=null}createScope(e){this.scope=new FunctionScope(e,this.context);this.constructedEntity=new ObjectEntity(Object.create(null),kn);this.scope.thisVariable.addEntityToBeDeoptimized(this.constructedEntity)}deoptimizeArgumentsOnInteractionAtPath(e,t,i){super.deoptimizeArgumentsOnInteractionAtPath(e,t,i);if(e.type===yi&&t.length===0&&e.args[0]){this.scope.thisVariable.addEntityToBeDeoptimized(e.args[0])}}hasEffects(e){if(!this.deoptimized)this.applyDeoptimizations();return!!this.id?.hasEffects(e)}hasEffectsOnInteractionAtPath(e,t,i){if(super.hasEffectsOnInteractionAtPath(e,t,i))return true;if(t.type===yi){const e=i.replacedVariableInits.get(this.scope.thisVariable);i.replacedVariableInits.set(this.scope.thisVariable,t.withNew?this.constructedEntity:pi);const{brokenFlow:s,ignore:n,replacedVariableInits:r}=i;i.ignore={breaks:false,continues:false,labels:new Set,returnYield:true,this:t.withNew};if(this.body.hasEffects(i))return true;i.brokenFlow=s;if(e){r.set(this.scope.thisVariable,e)}else{r.delete(this.scope.thisVariable)}i.ignore=n}return false}include(e,t){super.include(e,t);this.id?.include();const i=this.scope.argumentsVariable.included;for(const s of this.params){if(!(s instanceof Identifier)||i){s.include(e,t)}}}initialise(){super.initialise();this.id?.declare("function",this)}addArgumentToBeDeoptimized(e){this.scope.argumentsVariable.addArgumentToBeDeoptimized(e)}getObjectEntity(){if(this.objectEntity!==null){return this.objectEntity}return this.objectEntity=new ObjectEntity([{key:"prototype",kind:"init",property:new ObjectEntity([],kn)}],kn)}}class AwaitExpression extends NodeBase{hasEffects(){if(!this.deoptimized)this.applyDeoptimizations();return true}include(e,t){if(!this.deoptimized)this.applyDeoptimizations();if(!this.included){this.included=true;e:if(!this.context.usesTopLevelAwait){let e=this.parent;do{if(e instanceof FunctionNode||e instanceof ArrowFunctionExpression)break e}while(e=e.parent);this.context.usesTopLevelAwait=true}}this.argument.include(e,t)}}const hr={"!=":(e,t)=>e!=t,"!==":(e,t)=>e!==t,"%":(e,t)=>e%t,"&":(e,t)=>e&t,"*":(e,t)=>e*t,"**":(e,t)=>e**t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"<":(e,t)=>e<t,"<<":(e,t)=>e<<t,"<=":(e,t)=>e<=t,"==":(e,t)=>e==t,"===":(e,t)=>e===t,">":(e,t)=>e>t,">=":(e,t)=>e>=t,">>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t,"^":(e,t)=>e^t,"|":(e,t)=>e|t};class BinaryExpression extends NodeBase{deoptimizeCache(){}getLiteralValueAtPath(e,t,i){if(e.length>0)return hi;const s=this.left.getLiteralValueAtPath(ri,t,i);if(typeof s==="symbol")return hi;const n=this.right.getLiteralValueAtPath(ri,t,i);if(typeof n==="symbol")return hi;const r=hr[this.operator];if(!r)return hi;return r(s,n)}hasEffects(e){if(this.operator==="+"&&this.parent instanceof ExpressionStatement&&this.left.getLiteralValueAtPath(ri,ui,this)===""){return true}return super.hasEffects(e)}hasEffectsOnInteractionAtPath(e,{type:t}){return t!==mi||e.length>1}render(e,t,{renderedSurroundingElement:i}=q){this.left.render(e,t,{renderedSurroundingElement:i});this.right.render(e,t)}}class BreakStatement extends NodeBase{hasEffects(e){if(this.label){if(!e.ignore.labels.has(this.label.name))return true;e.includedLabels.add(this.label.name)}else{if(!e.ignore.breaks)return true;e.hasBreak=true}e.brokenFlow=true;return false}include(e){this.included=true;if(this.label){this.label.include();e.includedLabels.add(this.label.name)}else{e.hasBreak=true}e.brokenFlow=true}}function renderCallArguments(e,t,i){if(i.arguments.length>0){if(i.arguments[i.arguments.length-1].included){for(const s of i.arguments){s.render(e,t)}}else{let s=i.arguments.length-2;while(s>=0&&!i.arguments[s].included){s--}if(s>=0){for(let n=0;n<=s;n++){i.arguments[n].render(e,t)}e.remove(findFirstOccurrenceOutsideComment(e.original,",",i.arguments[s].end),i.end-1)}else{e.remove(findFirstOccurrenceOutsideComment(e.original,"(",i.callee.end)+1,i.end-1)}}}}class Literal extends NodeBase{deoptimizeArgumentsOnInteractionAtPath(){}getLiteralValueAtPath(e){if(e.length>0||this.value===null&&this.context.code.charCodeAt(this.start)!==110||typeof this.value==="bigint"||this.context.code.charCodeAt(this.start)===47){return hi}return this.value}getReturnExpressionWhenCalledAtPath(e){if(e.length!==1)return fi;return getMemberReturnExpressionWhenCalled(this.members,e[0])}hasEffectsOnInteractionAtPath(e,t,i){switch(t.type){case mi:{return e.length>(this.value===null?0:1)}case gi:{return true}case yi:{if(this.included&&this.value instanceof RegExp&&(this.value.global||this.value.sticky)){return true}return e.length!==1||hasMemberEffectWhenCalled(this.members,e[0],t,i)}}}initialise(){this.members=getLiteralMembersForValue(this.value)}parseNode(e){this.value=e.value;this.regex=e.regex;super.parseNode(e)}render(e){if(typeof this.value==="string"){e.indentExclusionRanges.push([this.start+1,this.end-1])}}}const dr=7;function getResolvablePropertyKey(e){return e.computed?getResolvableComputedPropertyKey(e.property):e.property.name}function getResolvableComputedPropertyKey(e){if(e instanceof Literal){return String(e.value)}return null}function getPathIfNotComputed(e){const t=e.propertyKey;const i=e.object;if(typeof t==="string"){if(i instanceof Identifier){return[{key:i.name,pos:i.start},{key:t,pos:e.property.start}]}if(i instanceof MemberExpression){const s=getPathIfNotComputed(i);return s&&[...s,{key:t,pos:e.property.start}]}}return null}function getStringFromPath(e){let t=e[0].key;for(let i=1;i<e.length;i++){t+="."+e[i].key}return t}class MemberExpression extends NodeBase{constructor(){super(...arguments);this.variable=null;this.assignmentDeoptimized=false;this.bound=false;this.expressionsToBeDeoptimized=[];this.isUndefined=false}bind(){this.bound=true;const e=getPathIfNotComputed(this);const t=e&&this.scope.findVariable(e[0].key);if(t?.isNamespace){const i=resolveNamespaceVariables(t,e.slice(1),this.context);if(!i){super.bind()}else if(i==="undefined"){this.isUndefined=true}else{this.variable=i;this.scope.addNamespaceMemberAccess(getStringFromPath(e),i)}}else{super.bind()}}deoptimizeArgumentsOnInteractionAtPath(e,t,i){if(this.variable){this.variable.deoptimizeArgumentsOnInteractionAtPath(e,t,i)}else if(!this.isUndefined){if(t.length<dr){this.object.deoptimizeArgumentsOnInteractionAtPath(e,[this.getPropertyKey(),...t],i)}else{deoptimizeInteraction(e)}}}deoptimizeCache(){const{expressionsToBeDeoptimized:e,object:t}=this;this.expressionsToBeDeoptimized=Y;this.propertyKey=ti;t.deoptimizePath(oi);for(const t of e){t.deoptimizeCache()}}deoptimizePath(e){if(e.length===0)this.disallowNamespaceReassignment();if(this.variable){this.variable.deoptimizePath(e)}else if(!this.isUndefined&&e.length<dr){const t=this.getPropertyKey();this.object.deoptimizePath([t===ti?ii:t,...e])}}getLiteralValueAtPath(e,t,i){if(this.variable){return this.variable.getLiteralValueAtPath(e,t,i)}if(this.isUndefined){return undefined}if(this.propertyKey!==ti&&e.length<dr){this.expressionsToBeDeoptimized.push(i);return this.object.getLiteralValueAtPath([this.getPropertyKey(),...e],t,i)}return hi}getReturnExpressionWhenCalledAtPath(e,t,i,s){if(this.variable){return this.variable.getReturnExpressionWhenCalledAtPath(e,t,i,s)}if(this.isUndefined){return[Ts,false]}if(this.propertyKey!==ti&&e.length<dr){this.expressionsToBeDeoptimized.push(s);return this.object.getReturnExpressionWhenCalledAtPath([this.getPropertyKey(),...e],t,i,s)}return fi}hasEffects(e){if(!this.deoptimized)this.applyDeoptimizations();return this.property.hasEffects(e)||this.object.hasEffects(e)||this.hasAccessEffect(e)}hasEffectsAsAssignmentTarget(e,t){if(t&&!this.deoptimized)this.applyDeoptimizations();if(!this.assignmentDeoptimized)this.applyAssignmentDeoptimization();return this.property.hasEffects(e)||this.object.hasEffects(e)||t&&this.hasAccessEffect(e)||this.hasEffectsOnInteractionAtPath(ri,this.assignmentInteraction,e)}hasEffectsOnInteractionAtPath(e,t,i){if(this.variable){return this.variable.hasEffectsOnInteractionAtPath(e,t,i)}if(this.isUndefined){return true}if(e.length<dr){return this.object.hasEffectsOnInteractionAtPath([this.getPropertyKey(),...e],t,i)}return true}include(e,t){if(!this.deoptimized)this.applyDeoptimizations();this.includeProperties(e,t)}includeAsAssignmentTarget(e,t,i){if(!this.assignmentDeoptimized)this.applyAssignmentDeoptimization();if(i){this.include(e,t)}else{this.includeProperties(e,t)}}includeCallArguments(e,t){if(this.variable){this.variable.includeCallArguments(e,t)}else{super.includeCallArguments(e,t)}}initialise(){this.propertyKey=getResolvablePropertyKey(this);this.accessInteraction={args:[this.object],type:mi}}isSkippedAsOptional(e){return!this.variable&&!this.isUndefined&&(this.object.isSkippedAsOptional?.(e)||this.optional&&this.object.getLiteralValueAtPath(ri,ui,e)==null)}render(e,t,{renderedParentType:i,isCalleeOfRenderedParent:s,renderedSurroundingElement:n}=q){if(this.variable||this.isUndefined){const{snippets:{getPropertyAccess:n}}=t;let r=this.variable?this.variable.getName(n):"undefined";if(i&&s)r="0, "+r;e.overwrite(this.start,this.end,r,{contentOnly:true,storeName:true})}else{if(i&&s){e.appendRight(this.start,"0, ")}this.object.render(e,t,{renderedSurroundingElement:n});this.property.render(e,t)}}setAssignedValue(e){this.assignmentInteraction={args:[this.object,e],type:gi}}applyDeoptimizations(){this.deoptimized=true;const{propertyReadSideEffects:e}=this.context.options.treeshake;if(this.bound&&e&&!(this.variable||this.isUndefined)){const e=this.getPropertyKey();this.object.deoptimizeArgumentsOnInteractionAtPath(this.accessInteraction,[e],ui);this.context.requestTreeshakingPass()}}applyAssignmentDeoptimization(){this.assignmentDeoptimized=true;const{propertyReadSideEffects:e}=this.context.options.treeshake;if(this.bound&&e&&!(this.variable||this.isUndefined)){this.object.deoptimizeArgumentsOnInteractionAtPath(this.assignmentInteraction,[this.getPropertyKey()],ui);this.context.requestTreeshakingPass()}}disallowNamespaceReassignment(){if(this.object instanceof Identifier){const e=this.scope.findVariable(this.object.name);if(e.isNamespace){if(this.variable){this.context.includeVariableInModule(this.variable)}this.context.warn(errorIllegalImportReassignment(this.object.name,this.context.module.id),this.start)}}}getPropertyKey(){if(this.propertyKey===null){this.propertyKey=ti;const e=this.property.getLiteralValueAtPath(ri,ui,this);return this.propertyKey=e===ni?e:typeof e==="symbol"?ti:String(e)}return this.propertyKey}hasAccessEffect(e){const{propertyReadSideEffects:t}=this.context.options.treeshake;return!(this.variable||this.isUndefined)&&t&&(t==="always"||this.object.hasEffectsOnInteractionAtPath([this.getPropertyKey()],this.accessInteraction,e))}includeProperties(e,t){if(!this.included){this.included=true;if(this.variable){this.context.includeVariableInModule(this.variable)}}this.object.include(e,t);this.property.include(e,t)}}function resolveNamespaceVariables(e,t,i){if(t.length===0)return e;if(!e.isNamespace||e instanceof ExternalVariable)return null;const s=t[0].key;const n=e.context.traceExport(s);if(!n){if(t.length===1){const n=e.context.fileName;i.warn(errorMissingExport(s,i.module.id,n),t[0].pos);return"undefined"}return null}return resolveNamespaceVariables(n,t.slice(1),i)}class CallExpressionBase extends NodeBase{constructor(){super(...arguments);this.returnExpression=null;this.deoptimizableDependentExpressions=[];this.expressionsToBeDeoptimized=new Set}deoptimizeArgumentsOnInteractionAtPath(e,t,i){const{args:s}=e;const[n,r]=this.getReturnExpression(i);if(r)return;const o=s.filter((e=>!!e&&e!==pi));if(o.length===0)return;if(n===pi){for(const e of o){e.deoptimizePath(oi)}}else{i.withTrackedEntityAtPath(t,n,(()=>{for(const e of o){this.expressionsToBeDeoptimized.add(e)}n.deoptimizeArgumentsOnInteractionAtPath(e,t,i)}),null)}}deoptimizeCache(){if(this.returnExpression?.[0]!==pi){this.returnExpression=fi;const{deoptimizableDependentExpressions:e,expressionsToBeDeoptimized:t}=this;this.expressionsToBeDeoptimized=Q;this.deoptimizableDependentExpressions=Y;for(const t of e){t.deoptimizeCache()}for(const e of t){e.deoptimizePath(oi)}}}deoptimizePath(e){if(e.length===0||this.context.deoptimizationTracker.trackEntityAtPathAndGetIfTracked(e,this)){return}const[t]=this.getReturnExpression();if(t!==pi){t.deoptimizePath(e)}}getLiteralValueAtPath(e,t,i){const[s]=this.getReturnExpression(t);if(s===pi){return hi}return t.withTrackedEntityAtPath(e,s,(()=>{this.deoptimizableDependentExpressions.push(i);return s.getLiteralValueAtPath(e,t,i)}),hi)}getReturnExpressionWhenCalledAtPath(e,t,i,s){const n=this.getReturnExpression(i);if(n[0]===pi){return n}return i.withTrackedEntityAtPath(e,n,(()=>{this.deoptimizableDependentExpressions.push(s);const[r,o]=n[0].getReturnExpressionWhenCalledAtPath(e,t,i,s);return[r,o||n[1]]}),fi)}hasEffectsOnInteractionAtPath(e,t,i){const{type:s}=t;if(s===yi){const{args:s,withNew:n}=t;if((n?i.instantiated:i.called).trackEntityAtPathAndGetIfTracked(e,s,this)){return false}}else if((s===gi?i.assigned:i.accessed).trackEntityAtPathAndGetIfTracked(e,this)){return false}const[n,r]=this.getReturnExpression();return(s===gi||!r)&&n.hasEffectsOnInteractionAtPath(e,t,i)}}class CallExpression extends CallExpressionBase{bind(){super.bind();if(this.callee instanceof Identifier){const e=this.scope.findVariable(this.callee.name);if(e.isNamespace){this.context.warn(errorCannotCallNamespace(this.callee.name),this.start)}if(this.callee.name==="eval"){this.context.warn(errorEval(this.context.module.id),this.start)}}this.interaction={args:[this.callee instanceof MemberExpression&&!this.callee.variable?this.callee.object:null,...this.arguments],type:yi,withNew:false}}hasEffects(e){try{for(const t of this.arguments){if(t.hasEffects(e))return true}if(this.context.options.treeshake.annotations&&this.annotations)return false;return this.callee.hasEffects(e)||this.callee.hasEffectsOnInteractionAtPath(ri,this.interaction,e)}finally{if(!this.deoptimized)this.applyDeoptimizations()}}include(e,t){if(!this.deoptimized)this.applyDeoptimizations();if(t){super.include(e,t);if(t===xn&&this.callee instanceof Identifier&&this.callee.variable){this.callee.variable.markCalledFromTryStatement()}}else{this.included=true;this.callee.include(e,false)}this.callee.includeCallArguments(e,this.arguments)}isSkippedAsOptional(e){return this.callee.isSkippedAsOptional?.(e)||this.optional&&this.callee.getLiteralValueAtPath(ri,ui,e)==null}render(e,t,{renderedSurroundingElement:i}=q){this.callee.render(e,t,{isCalleeOfRenderedParent:true,renderedSurroundingElement:i});renderCallArguments(e,t,this)}applyDeoptimizations(){this.deoptimized=true;this.callee.deoptimizeArgumentsOnInteractionAtPath(this.interaction,ri,ui);this.context.requestTreeshakingPass()}getReturnExpression(e=ui){if(this.returnExpression===null){this.returnExpression=fi;return this.returnExpression=this.callee.getReturnExpressionWhenCalledAtPath(ri,this.interaction,e,this)}return this.returnExpression}}class CatchScope extends ParameterScope{addDeclaration(e,t,i,s){const n=this.variables.get(e.name);if(n){this.parent.addDeclaration(e,t,Ts,s);n.addDeclaration(e,i);return n}return this.parent.addDeclaration(e,t,i,s)}}class CatchClause extends NodeBase{createScope(e){this.scope=new CatchScope(e,this.context)}parseNode(e){const{param:t}=e;if(t){this.param=new(this.context.getNodeConstructor(t.type))(t,this,this.scope);this.param.declare("parameter",pi)}super.parseNode(e)}}class ChainExpression extends NodeBase{deoptimizeCache(){}getLiteralValueAtPath(e,t,i){if(this.expression.isSkippedAsOptional(i))return undefined;return this.expression.getLiteralValueAtPath(e,t,i)}hasEffects(e){if(this.expression.isSkippedAsOptional(this))return false;return this.expression.hasEffects(e)}}class ClassBodyScope extends ChildScope{constructor(e,t,i){super(e);this.variables.set("this",this.thisVariable=new LocalVariable("this",null,t,i));this.instanceScope=new ChildScope(this);this.instanceScope.variables.set("this",new ThisVariable(i))}findLexicalBoundary(){return this}}class ClassBody extends NodeBase{createScope(e){this.scope=new ClassBodyScope(e,this.parent,this.context)}include(e,t){this.included=true;this.context.includeVariableInModule(this.scope.thisVariable);for(const i of this.body){i.include(e,t)}}parseNode(e){const t=this.body=[];for(const i of e.body){t.push(new(this.context.getNodeConstructor(i.type))(i,this,i.static?this.scope:this.scope.instanceScope))}super.parseNode(e)}applyDeoptimizations(){}}class MethodBase extends NodeBase{constructor(){super(...arguments);this.accessedValue=null}deoptimizeArgumentsOnInteractionAtPath(e,t,i){if(e.type===mi&&this.kind==="get"&&t.length===0){return this.value.deoptimizeArgumentsOnInteractionAtPath({args:e.args,type:yi,withNew:false},ri,i)}if(e.type===gi&&this.kind==="set"&&t.length===0){return this.value.deoptimizeArgumentsOnInteractionAtPath({args:e.args,type:yi,withNew:false},ri,i)}this.getAccessedValue()[0].deoptimizeArgumentsOnInteractionAtPath(e,t,i)}deoptimizeCache(){}deoptimizePath(e){this.getAccessedValue()[0].deoptimizePath(e)}getLiteralValueAtPath(e,t,i){return this.getAccessedValue()[0].getLiteralValueAtPath(e,t,i)}getReturnExpressionWhenCalledAtPath(e,t,i,s){return this.getAccessedValue()[0].getReturnExpressionWhenCalledAtPath(e,t,i,s)}hasEffects(e){return this.key.hasEffects(e)}hasEffectsOnInteractionAtPath(e,t,i){if(this.kind==="get"&&t.type===mi&&e.length===0){return this.value.hasEffectsOnInteractionAtPath(ri,{args:t.args,type:yi,withNew:false},i)}if(this.kind==="set"&&t.type===gi){return this.value.hasEffectsOnInteractionAtPath(ri,{args:t.args,type:yi,withNew:false},i)}return this.getAccessedValue()[0].hasEffectsOnInteractionAtPath(e,t,i)}applyDeoptimizations(){}getAccessedValue(){if(this.accessedValue===null){if(this.kind==="get"){this.accessedValue=fi;return this.accessedValue=this.value.getReturnExpressionWhenCalledAtPath(ri,bi,ui,this)}else{return this.accessedValue=[this.value,false]}}return this.accessedValue}}class MethodDefinition extends MethodBase{applyDeoptimizations(){}}class ObjectMember extends ExpressionEntity{constructor(e,t){super();this.object=e;this.key=t}deoptimizeArgumentsOnInteractionAtPath(e,t,i){this.object.deoptimizeArgumentsOnInteractionAtPath(e,[this.key,...t],i)}deoptimizePath(e){this.object.deoptimizePath([this.key,...e])}getLiteralValueAtPath(e,t,i){return this.object.getLiteralValueAtPath([this.key,...e],t,i)}getReturnExpressionWhenCalledAtPath(e,t,i,s){return this.object.getReturnExpressionWhenCalledAtPath([this.key,...e],t,i,s)}hasEffectsOnInteractionAtPath(e,t,i){return this.object.hasEffectsOnInteractionAtPath([this.key,...e],t,i)}}class ClassNode extends NodeBase{constructor(){super(...arguments);this.objectEntity=null}createScope(e){this.scope=new ChildScope(e)}deoptimizeArgumentsOnInteractionAtPath(e,t,i){this.getObjectEntity().deoptimizeArgumentsOnInteractionAtPath(e,t,i)}deoptimizeCache(){this.getObjectEntity().deoptimizeAllProperties()}deoptimizePath(e){this.getObjectEntity().deoptimizePath(e)}getLiteralValueAtPath(e,t,i){return this.getObjectEntity().getLiteralValueAtPath(e,t,i)}getReturnExpressionWhenCalledAtPath(e,t,i,s){return this.getObjectEntity().getReturnExpressionWhenCalledAtPath(e,t,i,s)}hasEffects(e){if(!this.deoptimized)this.applyDeoptimizations();const t=this.superClass?.hasEffects(e)||this.body.hasEffects(e);this.id?.markDeclarationReached();return t||super.hasEffects(e)}hasEffectsOnInteractionAtPath(e,t,i){return t.type===yi&&e.length===0?!t.withNew||(this.classConstructor===null?this.superClass?.hasEffectsOnInteractionAtPath(e,t,i):this.classConstructor.hasEffectsOnInteractionAtPath(e,t,i))||false:this.getObjectEntity().hasEffectsOnInteractionAtPath(e,t,i)}include(e,t){if(!this.deoptimized)this.applyDeoptimizations();this.included=true;this.superClass?.include(e,t);this.body.include(e,t);if(this.id){this.id.markDeclarationReached();this.id.include()}}initialise(){this.id?.declare("class",this);for(const e of this.body.body){if(e instanceof MethodDefinition&&e.kind==="constructor"){this.classConstructor=e;return}}this.classConstructor=null}applyDeoptimizations(){this.deoptimized=true;for(const e of this.body.body){if(!(e.static||e instanceof MethodDefinition&&e.kind==="constructor")){e.deoptimizePath(oi)}}this.context.requestTreeshakingPass()}getObjectEntity(){if(this.objectEntity!==null){return this.objectEntity}const e=[];const t=[];for(const i of this.body.body){const s=i.static?e:t;const n=i.kind;if(s===t&&!n)continue;const r=n==="set"||n==="get"?n:"init";let o;if(i.computed){const e=i.key.getLiteralValueAtPath(ri,ui,this);if(typeof e==="symbol"){s.push({key:ti,kind:r,property:i});continue}else{o=String(e)}}else{o=i.key instanceof Identifier?i.key.name:String(i.key.value)}s.push({key:o,kind:r,property:i})}e.unshift({key:"prototype",kind:"init",property:new ObjectEntity(t,this.superClass?new ObjectMember(this.superClass,"prototype"):kn)});return this.objectEntity=new ObjectEntity(e,this.superClass||kn)}}class ClassDeclaration extends ClassNode{initialise(){super.initialise();if(this.id!==null){this.id.variable.isId=true}}parseNode(e){if(e.id!==null){this.id=new Identifier(e.id,this,this.scope.parent)}super.parseNode(e)}render(e,t){const{exportNamesByVariable:i,format:s,snippets:{_:n,getPropertyAccess:r}}=t;if(this.id){const{variable:o,name:l}=this.id;if(s==="system"&&i.has(o)){e.appendLeft(this.end,`${n}${getSystemExportStatement([o],t)};`)}const c=o.getName(r);if(c!==l){this.superClass?.render(e,t);this.body.render(e,{...t,useOriginalName:e=>e===o});e.prependRight(this.start,`let ${c}${n}=${n}`);e.prependLeft(this.end,";");return}}super.render(e,t)}applyDeoptimizations(){super.applyDeoptimizations();const{id:e,scope:t}=this;if(e){const{name:i,variable:s}=e;for(const e of t.accessedOutsideVariables.values()){if(e!==s){e.forbidName(i)}}}}}class ClassExpression extends ClassNode{render(e,t,{renderedSurroundingElement:i}=q){super.render(e,t);if(i===tn){e.appendRight(this.start,"(");e.prependLeft(this.end,")")}}}class MultiExpression extends ExpressionEntity{constructor(e){super();this.expressions=e;this.included=false}deoptimizePath(e){for(const t of this.expressions){t.deoptimizePath(e)}}getReturnExpressionWhenCalledAtPath(e,t,i,s){return[new MultiExpression(this.expressions.map((n=>n.getReturnExpressionWhenCalledAtPath(e,t,i,s)[0]))),false]}hasEffectsOnInteractionAtPath(e,t,i){for(const s of this.expressions){if(s.hasEffectsOnInteractionAtPath(e,t,i))return true}return false}}class ConditionalExpression extends NodeBase{constructor(){super(...arguments);this.expressionsToBeDeoptimized=[];this.isBranchResolutionAnalysed=false;this.usedBranch=null}deoptimizeArgumentsOnInteractionAtPath(e,t,i){this.consequent.deoptimizeArgumentsOnInteractionAtPath(e,t,i);this.alternate.deoptimizeArgumentsOnInteractionAtPath(e,t,i)}deoptimizeCache(){if(this.usedBranch!==null){const e=this.usedBranch===this.consequent?this.alternate:this.consequent;this.usedBranch=null;e.deoptimizePath(oi);const{expressionsToBeDeoptimized:t}=this;this.expressionsToBeDeoptimized=Y;for(const e of t){e.deoptimizeCache()}}}deoptimizePath(e){const t=this.getUsedBranch();if(t){t.deoptimizePath(e)}else{this.consequent.deoptimizePath(e);this.alternate.deoptimizePath(e)}}getLiteralValueAtPath(e,t,i){const s=this.getUsedBranch();if(!s)return hi;this.expressionsToBeDeoptimized.push(i);return s.getLiteralValueAtPath(e,t,i)}getReturnExpressionWhenCalledAtPath(e,t,i,s){const n=this.getUsedBranch();if(!n)return[new MultiExpression([this.consequent.getReturnExpressionWhenCalledAtPath(e,t,i,s)[0],this.alternate.getReturnExpressionWhenCalledAtPath(e,t,i,s)[0]]),false];this.expressionsToBeDeoptimized.push(s);return n.getReturnExpressionWhenCalledAtPath(e,t,i,s)}hasEffects(e){if(this.test.hasEffects(e))return true;const t=this.getUsedBranch();if(!t){return this.consequent.hasEffects(e)||this.alternate.hasEffects(e)}return t.hasEffects(e)}hasEffectsOnInteractionAtPath(e,t,i){const s=this.getUsedBranch();if(!s){return this.consequent.hasEffectsOnInteractionAtPath(e,t,i)||this.alternate.hasEffectsOnInteractionAtPath(e,t,i)}return s.hasEffectsOnInteractionAtPath(e,t,i)}include(e,t){this.included=true;const i=this.getUsedBranch();if(t||this.test.shouldBeIncluded(e)||i===null){this.test.include(e,t);this.consequent.include(e,t);this.alternate.include(e,t)}else{i.include(e,t)}}includeCallArguments(e,t){const i=this.getUsedBranch();if(i){i.includeCallArguments(e,t)}else{this.consequent.includeCallArguments(e,t);this.alternate.includeCallArguments(e,t)}}render(e,t,{isCalleeOfRenderedParent:i,preventASI:s,renderedParentType:n,renderedSurroundingElement:r}=q){const o=this.getUsedBranch();if(this.test.included){this.test.render(e,t,{renderedSurroundingElement:r});this.consequent.render(e,t);this.alternate.render(e,t)}else{const l=findFirstOccurrenceOutsideComment(e.original,":",this.consequent.end);const c=findNonWhiteSpace(e.original,(this.consequent.included?findFirstOccurrenceOutsideComment(e.original,"?",this.test.end):l)+1);if(s){removeLineBreaks(e,c,o.start)}e.remove(this.start,c);if(this.consequent.included){e.remove(l,this.end)}removeAnnotations(this,e);o.render(e,t,{isCalleeOfRenderedParent:i,preventASI:true,renderedParentType:n||this.parent.type,renderedSurroundingElement:r||this.parent.type})}}getUsedBranch(){if(this.isBranchResolutionAnalysed){return this.usedBranch}this.isBranchResolutionAnalysed=true;const e=this.test.getLiteralValueAtPath(ri,ui,this);return typeof e==="symbol"?null:this.usedBranch=e?this.consequent:this.alternate}}class ContinueStatement extends NodeBase{hasEffects(e){if(this.label){if(!e.ignore.labels.has(this.label.name))return true;e.includedLabels.add(this.label.name)}else{if(!e.ignore.continues)return true;e.hasContinue=true}e.brokenFlow=true;return false}include(e){this.included=true;if(this.label){this.label.include();e.includedLabels.add(this.label.name)}else{e.hasContinue=true}e.brokenFlow=true}}function hasLoopBodyEffects(e,t){const{brokenFlow:i,hasBreak:s,hasContinue:n,ignore:r}=e;const{breaks:o,continues:l}=r;r.breaks=true;r.continues=true;e.hasBreak=false;e.hasContinue=false;if(t.hasEffects(e))return true;r.breaks=o;r.continues=l;e.hasBreak=s;e.hasContinue=n;e.brokenFlow=i;return false}function includeLoopBody(e,t,i){const{brokenFlow:s,hasBreak:n,hasContinue:r}=e;e.hasBreak=false;e.hasContinue=false;t.include(e,i,{asSingleStatement:true});e.hasBreak=n;e.hasContinue=r;e.brokenFlow=s}class DoWhileStatement extends NodeBase{hasEffects(e){if(this.test.hasEffects(e))return true;return hasLoopBodyEffects(e,this.body)}include(e,t){this.included=true;this.test.include(e,t);includeLoopBody(e,this.body,t)}}class EmptyStatement extends NodeBase{hasEffects(){return false}}class ExportAllDeclaration extends NodeBase{hasEffects(){return false}initialise(){this.context.addExport(this)}render(e,t,i){e.remove(i.start,i.end)}applyDeoptimizations(){}}ExportAllDeclaration.prototype.needsBoundaries=true;class FunctionDeclaration extends FunctionNode{initialise(){super.initialise();if(this.id!==null){this.id.variable.isId=true}}parseNode(e){if(e.id!==null){this.id=new Identifier(e.id,this,this.scope.parent)}super.parseNode(e)}}function getDeclarationStart(e,t){return findNonWhiteSpace(e,findFirstOccurrenceOutsideComment(e,"default",t)+7)}function getFunctionIdInsertPosition(e,t){const i=findFirstOccurrenceOutsideComment(e,"function",t)+"function".length;e=e.slice(i,findFirstOccurrenceOutsideComment(e,"(",i));const s=findFirstOccurrenceOutsideComment(e,"*");if(s===-1){return i}return i+s+1}class ExportDefaultDeclaration extends NodeBase{include(e,t){super.include(e,t);if(t){this.context.includeVariableInModule(this.variable)}}initialise(){const e=this.declaration;this.declarationName=e.id&&e.id.name||this.declaration.name;this.variable=this.scope.addExportDefaultDeclaration(this.declarationName||this.context.getModuleName(),this,this.context);this.context.addExport(this)}render(e,t,i){const{start:s,end:n}=i;const r=getDeclarationStart(e.original,this.start);if(this.declaration instanceof FunctionDeclaration){this.renderNamedDeclaration(e,r,this.declaration.id===null?getFunctionIdInsertPosition(e.original,r):null,t)}else if(this.declaration instanceof ClassDeclaration){this.renderNamedDeclaration(e,r,this.declaration.id===null?findFirstOccurrenceOutsideComment(e.original,"class",s)+"class".length:null,t)}else if(this.variable.getOriginalVariable()!==this.variable){treeshakeNode(this,e,s,n);return}else if(this.variable.included){this.renderVariableDeclaration(e,r,t)}else{e.remove(this.start,r);this.declaration.render(e,t,{renderedSurroundingElement:tn});if(e.original[this.end-1]!==";"){e.appendLeft(this.end,";")}return}this.declaration.render(e,t)}applyDeoptimizations(){}renderNamedDeclaration(e,t,i,s){const{exportNamesByVariable:n,format:r,snippets:{getPropertyAccess:o}}=s;const l=this.variable.getName(o);e.remove(this.start,t);if(i!==null){e.appendLeft(i,` ${l}`)}if(r==="system"&&this.declaration instanceof ClassDeclaration&&n.has(this.variable)){e.appendLeft(this.end,` ${getSystemExportStatement([this.variable],s)};`)}}renderVariableDeclaration(e,t,{format:i,exportNamesByVariable:s,snippets:{cnst:n,getPropertyAccess:r}}){const o=e.original.charCodeAt(this.end-1)===59;const l=i==="system"&&s.get(this.variable);if(l){e.overwrite(this.start,t,`${n} ${this.variable.getName(r)} = exports('${l[0]}', `);e.appendRight(o?this.end-1:this.end,")"+(o?"":";"))}else{e.overwrite(this.start,t,`${n} ${this.variable.getName(r)} = `);if(!o){e.appendLeft(this.end,";")}}}}ExportDefaultDeclaration.prototype.needsBoundaries=true;class ExportNamedDeclaration extends NodeBase{bind(){this.declaration?.bind()}hasEffects(e){return!!this.declaration?.hasEffects(e)}initialise(){this.context.addExport(this)}render(e,t,i){const{start:s,end:n}=i;if(this.declaration===null){e.remove(s,n)}else{e.remove(this.start,this.declaration.start);this.declaration.render(e,t,{end:n,start:s})}}applyDeoptimizations(){}}ExportNamedDeclaration.prototype.needsBoundaries=true;class ExportSpecifier extends NodeBase{applyDeoptimizations(){}}class ForInStatement extends NodeBase{createScope(e){this.scope=new BlockScope(e)}hasEffects(e){const{body:t,deoptimized:i,left:s,right:n}=this;if(!i)this.applyDeoptimizations();if(s.hasEffectsAsAssignmentTarget(e,false)||n.hasEffects(e))return true;return hasLoopBodyEffects(e,t)}include(e,t){const{body:i,deoptimized:s,left:n,right:r}=this;if(!s)this.applyDeoptimizations();this.included=true;n.includeAsAssignmentTarget(e,t||true,false);r.include(e,t);includeLoopBody(e,i,t)}initialise(){this.left.setAssignedValue(pi)}render(e,t){this.left.render(e,t,cr);this.right.render(e,t,cr);if(e.original.charCodeAt(this.right.start-1)===110){e.prependLeft(this.right.start," ")}this.body.render(e,t)}applyDeoptimizations(){this.deoptimized=true;this.left.deoptimizePath(ri);this.context.requestTreeshakingPass()}}class ForOfStatement extends NodeBase{createScope(e){this.scope=new BlockScope(e)}hasEffects(){if(!this.deoptimized)this.applyDeoptimizations();return true}include(e,t){const{body:i,deoptimized:s,left:n,right:r}=this;if(!s)this.applyDeoptimizations();this.included=true;n.includeAsAssignmentTarget(e,t||true,false);r.include(e,t);includeLoopBody(e,i,t)}initialise(){this.left.setAssignedValue(pi)}render(e,t){this.left.render(e,t,cr);this.right.render(e,t,cr);if(e.original.charCodeAt(this.right.start-1)===102){e.prependLeft(this.right.start," ")}this.body.render(e,t)}applyDeoptimizations(){this.deoptimized=true;this.left.deoptimizePath(ri);this.right.deoptimizePath(oi);this.context.requestTreeshakingPass()}}class ForStatement extends NodeBase{createScope(e){this.scope=new BlockScope(e)}hasEffects(e){if(this.init?.hasEffects(e)||this.test?.hasEffects(e)||this.update?.hasEffects(e)){return true}return hasLoopBodyEffects(e,this.body)}include(e,t){this.included=true;this.init?.include(e,t,{asSingleStatement:true});this.test?.include(e,t);this.update?.include(e,t);includeLoopBody(e,this.body,t)}render(e,t){this.init?.render(e,t,cr);this.test?.render(e,t,cr);this.update?.render(e,t,cr);this.body.render(e,t)}}class FunctionExpression extends FunctionNode{render(e,t,{renderedSurroundingElement:i}=q){super.render(e,t);if(i===tn){e.appendRight(this.start,"(");e.prependLeft(this.end,")")}}}class TrackingScope extends BlockScope{constructor(){super(...arguments);this.hoistedDeclarations=[]}addDeclaration(e,t,i,s){this.hoistedDeclarations.push(e);return super.addDeclaration(e,t,i,s)}}const pr=Symbol("unset");class IfStatement extends NodeBase{constructor(){super(...arguments);this.testValue=pr}deoptimizeCache(){this.testValue=hi}hasEffects(e){if(this.test.hasEffects(e)){return true}const t=this.getTestValue();if(typeof t==="symbol"){const{brokenFlow:t}=e;if(this.consequent.hasEffects(e))return true;const i=e.brokenFlow;e.brokenFlow=t;if(this.alternate===null)return false;if(this.alternate.hasEffects(e))return true;e.brokenFlow=e.brokenFlow&&i;return false}return t?this.consequent.hasEffects(e):!!this.alternate?.hasEffects(e)}include(e,t){this.included=true;if(t){this.includeRecursively(t,e)}else{const t=this.getTestValue();if(typeof t==="symbol"){this.includeUnknownTest(e)}else{this.includeKnownTest(e,t)}}}parseNode(e){this.consequentScope=new TrackingScope(this.scope);this.consequent=new(this.context.getNodeConstructor(e.consequent.type))(e.consequent,this,this.consequentScope);if(e.alternate){this.alternateScope=new TrackingScope(this.scope);this.alternate=new(this.context.getNodeConstructor(e.alternate.type))(e.alternate,this,this.alternateScope)}super.parseNode(e)}render(e,t){const{snippets:{getPropertyAccess:i}}=t;const s=this.getTestValue();const n=[];const r=this.test.included;const o=!this.context.options.treeshake;if(r){this.test.render(e,t)}else{e.remove(this.start,this.consequent.start)}if(this.consequent.included&&(o||typeof s==="symbol"||s)){this.consequent.render(e,t)}else{e.overwrite(this.consequent.start,this.consequent.end,r?";":"");n.push(...this.consequentScope.hoistedDeclarations)}if(this.alternate){if(this.alternate.included&&(o||typeof s==="symbol"||!s)){if(r){if(e.original.charCodeAt(this.alternate.start-1)===101){e.prependLeft(this.alternate.start," ")}}else{e.remove(this.consequent.end,this.alternate.start)}this.alternate.render(e,t)}else{if(r&&this.shouldKeepAlternateBranch()){e.overwrite(this.alternate.start,this.end,";")}else{e.remove(this.consequent.end,this.end)}n.push(...this.alternateScope.hoistedDeclarations)}}this.renderHoistedDeclarations(n,e,i)}applyDeoptimizations(){}getTestValue(){if(this.testValue===pr){return this.testValue=this.test.getLiteralValueAtPath(ri,ui,this)}return this.testValue}includeKnownTest(e,t){if(this.test.shouldBeIncluded(e)){this.test.include(e,false)}if(t&&this.consequent.shouldBeIncluded(e)){this.consequent.include(e,false,{asSingleStatement:true})}if(!t&&this.alternate?.shouldBeIncluded(e)){this.alternate.include(e,false,{asSingleStatement:true})}}includeRecursively(e,t){this.test.include(t,e);this.consequent.include(t,e);this.alternate?.include(t,e)}includeUnknownTest(e){this.test.include(e,false);const{brokenFlow:t}=e;let i=false;if(this.consequent.shouldBeIncluded(e)){this.consequent.include(e,false,{asSingleStatement:true});i=e.brokenFlow;e.brokenFlow=t}if(this.alternate?.shouldBeIncluded(e)){this.alternate.include(e,false,{asSingleStatement:true});e.brokenFlow=e.brokenFlow&&i}}renderHoistedDeclarations(e,t,i){const s=[...new Set(e.map((e=>{const t=e.variable;return t.included?t.getName(i):""})))].filter(Boolean).join(", ");if(s){const e=this.parent.type;const i=e!==on&&e!==Xs;t.prependRight(this.start,`${i?"{ ":""}var ${s}; `);if(i){t.appendLeft(this.end,` }`)}}}shouldKeepAlternateBranch(){let e=this.parent;do{if(e instanceof IfStatement&&e.alternate){return true}if(e instanceof BlockStatement){return false}e=e.parent}while(e);return false}}class ImportAttribute extends NodeBase{}class ImportDeclaration extends NodeBase{bind(){}hasEffects(){return false}initialise(){this.context.addImport(this)}render(e,t,i){e.remove(i.start,i.end)}applyDeoptimizations(){}}ImportDeclaration.prototype.needsBoundaries=true;class ImportDefaultSpecifier extends NodeBase{applyDeoptimizations(){}}const fr="_interopDefault";const mr="_interopDefaultCompat";const gr="_interopNamespace";const yr="_interopNamespaceCompat";const Er="_interopNamespaceDefault";const xr="_interopNamespaceDefaultOnly";const br="_mergeNamespaces";const vr={auto:fr,compat:mr,default:null,defaultOnly:null,esModule:null};const isDefaultAProperty=(e,t)=>e==="esModule"||t&&(e==="auto"||e==="compat");const Sr={auto:gr,compat:yr,default:Er,defaultOnly:xr,esModule:null};const canDefaultBeTakenFromNamespace=(e,t)=>e!=="esModule"&&isDefaultAProperty(e,t);const getHelpersBlock=(e,t,i,s,n,r,o)=>{const l=new Set(e);for(const e of wr){if(t.has(e)){l.add(e)}}return wr.map((e=>l.has(e)?Ar[e](i,s,n,r,o,l):"")).join("")};const Ar={[mr](e,t,i){const{_:s,getDirectReturnFunction:n,n:r}=t;const[o,l]=n(["e"],{functionReturn:true,lineBreakIndent:null,name:mr});return`${o}${getIsCompatNamespace(t)}${s}?${s}`+`${i?getDefaultLiveBinding(t):getDefaultStatic(t)}${l}${r}${r}`},[fr](e,t,i){const{_:s,getDirectReturnFunction:n,n:r}=t;const[o,l]=n(["e"],{functionReturn:true,lineBreakIndent:null,name:fr});return`${o}e${s}&&${s}e.__esModule${s}?${s}`+`${i?getDefaultLiveBinding(t):getDefaultStatic(t)}${l}${r}${r}`},[yr](e,t,i,s,n,r){const{_:o,getDirectReturnFunction:l,n:c}=t;if(r.has(Er)){const[e,i]=l(["e"],{functionReturn:true,lineBreakIndent:null,name:yr});return`${e}${getIsCompatNamespace(t)}${o}?${o}e${o}:${o}${Er}(e)${i}${c}${c}`}return`function ${yr}(e)${o}{${c}`+`${e}if${o}(${getIsCompatNamespace(t)})${o}return e;${c}`+createNamespaceObject(e,e,t,i,s,n)+`}${c}${c}`},[xr](e,t,i,s,n){const{getDirectReturnFunction:r,getObject:o,n:l}=t;const[c,u]=r(["e"],{functionReturn:true,lineBreakIndent:null,name:xr});return`${c}${getFrozen(s,getWithToStringTag(n,o([["__proto__","null"],["default","e"]],{lineBreakIndent:null}),t))}${u}${l}${l}`},[Er](e,t,i,s,n){const{_:r,n:o}=t;return`function ${Er}(e)${r}{${o}`+createNamespaceObject(e,e,t,i,s,n)+`}${o}${o}`},[gr](e,t,i,s,n,r){const{_:o,getDirectReturnFunction:l,n:c}=t;if(r.has(Er)){const[e,t]=l(["e"],{functionReturn:true,lineBreakIndent:null,name:gr});return`${e}e${o}&&${o}e.__esModule${o}?${o}e${o}:${o}${Er}(e)${t}${c}${c}`}return`function ${gr}(e)${o}{${c}`+`${e}if${o}(e${o}&&${o}e.__esModule)${o}return e;${c}`+createNamespaceObject(e,e,t,i,s,n)+`}${c}${c}`},[br](e,t,i,s,n){const{_:r,cnst:o,n:l}=t;const c=o==="var"&&i;return`function ${br}(n, m)${r}{${l}`+`${e}${loopOverNamespaces(`{${l}`+`${e}${e}${e}if${r}(k${r}!==${r}'default'${r}&&${r}!(k in n))${r}{${l}`+(i?c?copyOwnPropertyLiveBinding:copyPropertyLiveBinding:copyPropertyStatic)(e,e+e+e+e,t)+`${e}${e}${e}}${l}`+`${e}${e}}`,c,e,t)}${l}`+`${e}return ${getFrozen(s,getWithToStringTag(n,"n",t))};${l}`+`}${l}${l}`}};const getDefaultLiveBinding=({_:e,getObject:t})=>`e${e}:${e}${t([["default","e"]],{lineBreakIndent:null})}`;const getDefaultStatic=({_:e,getPropertyAccess:t})=>`e${t("default")}${e}:${e}e`;const getIsCompatNamespace=({_:e})=>`e${e}&&${e}typeof e${e}===${e}'object'${e}&&${e}'default'${e}in e`;const createNamespaceObject=(e,t,i,s,n,r)=>{const{_:o,cnst:l,getObject:c,getPropertyAccess:u,n:h,s:d}=i;const p=`{${h}`+(s?copyNonDefaultOwnPropertyLiveBinding:copyPropertyStatic)(e,t+e+e,i)+`${t}${e}}`;return`${t}${l} n${o}=${o}Object.create(null${r?`,${o}{${o}[Symbol.toStringTag]:${o}${getToStringTagValue(c)}${o}}`:""});${h}`+`${t}if${o}(e)${o}{${h}`+`${t}${e}${loopOverKeys(p,!s,i)}${h}`+`${t}}${h}`+`${t}n${u("default")}${o}=${o}e;${h}`+`${t}return ${getFrozen(n,"n")}${d}${h}`};const loopOverKeys=(e,t,{_:i,cnst:s,getFunctionIntro:n,s:r})=>s!=="var"||t?`for${i}(${s} k in e)${i}${e}`:`Object.keys(e).forEach(${n(["k"],{isAsync:false,name:null})}${e})${r}`;const loopOverNamespaces=(e,t,i,{_:s,cnst:n,getDirectReturnFunction:r,getFunctionIntro:o,n:l})=>{if(t){const[t,n]=r(["e"],{functionReturn:false,lineBreakIndent:{base:i,t:i},name:null});return`m.forEach(${t}`+`e${s}&&${s}typeof e${s}!==${s}'string'${s}&&${s}!Array.isArray(e)${s}&&${s}Object.keys(e).forEach(${o(["k"],{isAsync:false,name:null})}${e})${n});`}return`for${s}(var i${s}=${s}0;${s}i${s}<${s}m.length;${s}i++)${s}{${l}`+`${i}${i}${n} e${s}=${s}m[i];${l}`+`${i}${i}if${s}(typeof e${s}!==${s}'string'${s}&&${s}!Array.isArray(e))${s}{${s}for${s}(${n} k in e)${s}${e}${s}}${l}${i}}`};const copyNonDefaultOwnPropertyLiveBinding=(e,t,i)=>{const{_:s,n:n}=i;return`${t}if${s}(k${s}!==${s}'default')${s}{${n}`+copyOwnPropertyLiveBinding(e,t+e,i)+`${t}}${n}`};const copyOwnPropertyLiveBinding=(e,t,{_:i,cnst:s,getDirectReturnFunction:n,n:r})=>{const[o,l]=n([],{functionReturn:true,lineBreakIndent:null,name:null});return`${t}${s} d${i}=${i}Object.getOwnPropertyDescriptor(e,${i}k);${r}`+`${t}Object.defineProperty(n,${i}k,${i}d.get${i}?${i}d${i}:${i}{${r}`+`${t}${e}enumerable:${i}true,${r}`+`${t}${e}get:${i}${o}e[k]${l}${r}`+`${t}});${r}`};const copyPropertyLiveBinding=(e,t,{_:i,cnst:s,getDirectReturnFunction:n,n:r})=>{const[o,l]=n([],{functionReturn:true,lineBreakIndent:null,name:null});return`${t}${s} d${i}=${i}Object.getOwnPropertyDescriptor(e,${i}k);${r}`+`${t}if${i}(d)${i}{${r}`+`${t}${e}Object.defineProperty(n,${i}k,${i}d.get${i}?${i}d${i}:${i}{${r}`+`${t}${e}${e}enumerable:${i}true,${r}`+`${t}${e}${e}get:${i}${o}e[k]${l}${r}`+`${t}${e}});${r}`+`${t}}${r}`};const copyPropertyStatic=(e,t,{_:i,n:s})=>`${t}n[k]${i}=${i}e[k];${s}`;const getFrozen=(e,t)=>e?`Object.freeze(${t})`:t;const getWithToStringTag=(e,t,{_:i,getObject:s})=>e?`Object.defineProperty(${t},${i}Symbol.toStringTag,${i}${getToStringTagValue(s)})`:t;const wr=Object.keys(Ar);function getToStringTagValue(e){return e([["value","'Module'"]],{lineBreakIndent:null})}function isReassignedExportsMember(e,t){return e.renderBaseName!==null&&t.has(e)&&e.isReassigned}class VariableDeclarator extends NodeBase{declareDeclarator(e){this.id.declare(e,this.init||Ts)}deoptimizePath(e){this.id.deoptimizePath(e)}hasEffects(e){if(!this.deoptimized)this.applyDeoptimizations();const t=this.init?.hasEffects(e);this.id.markDeclarationReached();return t||this.id.hasEffects(e)}include(e,t){const{deoptimized:i,id:s,init:n}=this;if(!i)this.applyDeoptimizations();this.included=true;n?.include(e,t);s.markDeclarationReached();if(t||s.shouldBeIncluded(e)){s.include(e,t)}}render(e,t){const{exportNamesByVariable:i,snippets:{_:s,getPropertyAccess:n}}=t;const{end:r,id:o,init:l,start:c}=this;const u=o.included;if(u){o.render(e,t)}else{const t=findFirstOccurrenceOutsideComment(e.original,"=",o.end);e.remove(c,findNonWhiteSpace(e.original,t+1))}if(l){if(o instanceof Identifier&&l instanceof ClassExpression&&!l.id){const t=o.variable.getName(n);if(t!==o.name){e.appendLeft(l.start+5,` ${o.name}`)}}l.render(e,t,u?q:{renderedSurroundingElement:tn})}else if(o instanceof Identifier&&isReassignedExportsMember(o.variable,i)){e.appendLeft(r,`${s}=${s}void 0`)}}applyDeoptimizations(){this.deoptimized=true;const{id:e,init:t}=this;if(t&&e instanceof Identifier&&t instanceof ClassExpression&&!t.id){const{name:i,variable:s}=e;for(const e of t.scope.accessedOutsideVariables.values()){if(e!==s){e.forbidName(i)}}}}}class ImportExpression extends NodeBase{constructor(){super(...arguments);this.inlineNamespace=null;this.assertions=null;this.mechanism=null;this.namespaceExportName=undefined;this.resolution=null;this.resolutionString=null}bind(){this.source.bind()}getDeterministicImportedNames(){const e=this.parent;if(e instanceof ExpressionStatement){return Y}if(e instanceof AwaitExpression){const t=e.parent;if(t instanceof ExpressionStatement){return Y}if(t instanceof VariableDeclarator){const e=t.id;return e instanceof ObjectPattern?getDeterministicObjectDestructure(e):undefined}if(t instanceof MemberExpression){const e=t.property;if(!t.computed&&e instanceof Identifier){return[e.name]}}return}if(e instanceof MemberExpression){const t=e.parent;const i=e.property;if(!(t instanceof CallExpression)||!(i instanceof Identifier)){return}const s=i.name;if(t.parent instanceof ExpressionStatement&&["catch","finally"].includes(s)){return Y}if(s!=="then")return;if(t.arguments.length===0){return Y}const n=t.arguments[0];if(t.arguments.length!==1||!(n instanceof ArrowFunctionExpression||n instanceof FunctionExpression)){return}if(n.params.length===0){return Y}const r=n.params[0];if(n.params.length===1&&r instanceof ObjectPattern){return getDeterministicObjectDestructure(r)}return}}hasEffects(){return true}include(e,t){if(!this.included){this.included=true;this.context.includeDynamicImport(this);this.scope.addAccessedDynamicImport(this)}this.source.include(e,t)}initialise(){this.context.addDynamicImport(this)}parseNode(e){super.parseNode(e,["source"])}render(e,t){const{snippets:{_:i,getDirectReturnFunction:s,getObject:n,getPropertyAccess:r}}=t;if(this.inlineNamespace){const[t,i]=s([],{functionReturn:true,lineBreakIndent:null,name:null});e.overwrite(this.start,this.end,`Promise.resolve().then(${t}${this.inlineNamespace.getName(r)}${i})`);return}if(this.mechanism){e.overwrite(this.start,findFirstOccurrenceOutsideComment(e.original,"(",this.start+6)+1,this.mechanism.left);e.overwrite(this.end-1,this.end,this.mechanism.right)}if(this.resolutionString){e.overwrite(this.source.start,this.source.end,this.resolutionString);if(this.namespaceExportName){const[t,i]=s(["n"],{functionReturn:true,lineBreakIndent:null,name:null});e.prependLeft(this.end,`.then(${t}n.${this.namespaceExportName}${i})`)}}else{this.source.render(e,t)}if(this.assertions!==true){if(this.arguments){e.overwrite(this.source.end,this.end-1,"",{contentOnly:true})}if(this.assertions){e.appendLeft(this.end-1,`,${i}${n([["assert",this.assertions]],{lineBreakIndent:null})}`)}}}setExternalResolution(e,t,i,s,n,r,o,l,c){const{format:u}=i;this.inlineNamespace=null;this.resolution=t;this.resolutionString=o;this.namespaceExportName=l;this.assertions=c;const h=[...Ir[u]||[]];let d;({helper:d,mechanism:this.mechanism}=this.getDynamicImportMechanismAndHelper(t,e,i,s,n));if(d){h.push(d)}if(h.length>0){this.scope.addAccessedGlobals(h,r)}}setInternalResolution(e){this.inlineNamespace=e}applyDeoptimizations(){}getDynamicImportMechanismAndHelper(e,t,{compact:i,dynamicImportFunction:s,dynamicImportInCjs:n,format:r,generatedCode:{arrowFunctions:o},interop:l},{_:c,getDirectReturnFunction:u,getDirectReturnIifeLeft:h},d){const p=d.hookFirstSync("renderDynamicImport",[{customResolution:typeof this.resolution==="string"?this.resolution:null,format:r,moduleId:this.context.module.id,targetModuleId:this.resolution&&typeof this.resolution!=="string"?this.resolution.id:null}]);if(p){return{helper:null,mechanism:p}}const f=!this.resolution||typeof this.resolution==="string";switch(r){case"cjs":{if(n&&(!e||typeof e==="string"||e instanceof ExternalModule)){return{helper:null,mechanism:null}}const i=getInteropHelper(e,t,l);let s=`require(`;let r=`)`;if(i){s=`/*#__PURE__*/${i}(${s}`;r+=")"}const[c,d]=u([],{functionReturn:true,lineBreakIndent:null,name:null});s=`Promise.resolve().then(${c}${s}`;r+=`${d})`;if(!o&&f){s=h(["t"],`${s}t${r}`,{needsArrowReturnParens:false,needsWrappedFunction:true});r=")"}return{helper:i,mechanism:{left:s,right:r}}}case"amd":{const s=i?"c":"resolve";const n=i?"e":"reject";const r=getInteropHelper(e,t,l);const[d,p]=u(["m"],{functionReturn:false,lineBreakIndent:null,name:null});const m=r?`${d}${s}(/*#__PURE__*/${r}(m))${p}`:s;const[g,y]=u([s,n],{functionReturn:false,lineBreakIndent:null,name:null});let E=`new Promise(${g}require([`;let x=`],${c}${m},${c}${n})${y})`;if(!o&&f){E=h(["t"],`${E}t${x}`,{needsArrowReturnParens:false,needsWrappedFunction:true});x=")"}return{helper:r,mechanism:{left:E,right:x}}}case"system":{return{helper:null,mechanism:{left:"module.import(",right:")"}}}case"es":{if(s){return{helper:null,mechanism:{left:`${s}(`,right:")"}}}}}return{helper:null,mechanism:null}}}function getInteropHelper(e,t,i){return t==="external"?Sr[i(e instanceof ExternalModule?e.id:null)]:t==="default"?xr:null}const Ir={amd:["require"],cjs:["require"],system:["module"]};function getDeterministicObjectDestructure(e){const t=[];for(const i of e.properties){if(i.type==="RestElement"||i.computed||i.key.type!=="Identifier")return;t.push(i.key.name)}return t}class ImportNamespaceSpecifier extends NodeBase{applyDeoptimizations(){}}class ImportSpecifier extends NodeBase{applyDeoptimizations(){}}class LabeledStatement extends NodeBase{hasEffects(e){const t=e.brokenFlow;e.ignore.labels.add(this.label.name);if(this.body.hasEffects(e))return true;e.ignore.labels.delete(this.label.name);if(e.includedLabels.has(this.label.name)){e.includedLabels.delete(this.label.name);e.brokenFlow=t}return false}include(e,t){this.included=true;const i=e.brokenFlow;this.body.include(e,t);if(t||e.includedLabels.has(this.label.name)){this.label.include();e.includedLabels.delete(this.label.name);e.brokenFlow=i}}render(e,t){if(this.label.included){this.label.render(e,t)}else{e.remove(this.start,findNonWhiteSpace(e.original,findFirstOccurrenceOutsideComment(e.original,":",this.label.end)+1))}this.body.render(e,t)}}class LogicalExpression extends NodeBase{constructor(){super(...arguments);this.expressionsToBeDeoptimized=[];this.isBranchResolutionAnalysed=false;this.usedBranch=null}deoptimizeArgumentsOnInteractionAtPath(e,t,i){this.left.deoptimizeArgumentsOnInteractionAtPath(e,t,i);this.right.deoptimizeArgumentsOnInteractionAtPath(e,t,i)}deoptimizeCache(){if(this.usedBranch){const e=this.usedBranch===this.left?this.right:this.left;this.usedBranch=null;e.deoptimizePath(oi);const{context:t,expressionsToBeDeoptimized:i}=this;this.expressionsToBeDeoptimized=Y;for(const e of i){e.deoptimizeCache()}t.requestTreeshakingPass()}}deoptimizePath(e){const t=this.getUsedBranch();if(t){t.deoptimizePath(e)}else{this.left.deoptimizePath(e);this.right.deoptimizePath(e)}}getLiteralValueAtPath(e,t,i){const s=this.getUsedBranch();if(!s)return hi;this.expressionsToBeDeoptimized.push(i);return s.getLiteralValueAtPath(e,t,i)}getReturnExpressionWhenCalledAtPath(e,t,i,s){const n=this.getUsedBranch();if(!n)return[new MultiExpression([this.left.getReturnExpressionWhenCalledAtPath(e,t,i,s)[0],this.right.getReturnExpressionWhenCalledAtPath(e,t,i,s)[0]]),false];this.expressionsToBeDeoptimized.push(s);return n.getReturnExpressionWhenCalledAtPath(e,t,i,s)}hasEffects(e){if(this.left.hasEffects(e)){return true}if(this.getUsedBranch()!==this.left){return this.right.hasEffects(e)}return false}hasEffectsOnInteractionAtPath(e,t,i){const s=this.getUsedBranch();if(!s){return this.left.hasEffectsOnInteractionAtPath(e,t,i)||this.right.hasEffectsOnInteractionAtPath(e,t,i)}return s.hasEffectsOnInteractionAtPath(e,t,i)}include(e,t){this.included=true;const i=this.getUsedBranch();if(t||i===this.right&&this.left.shouldBeIncluded(e)||!i){this.left.include(e,t);this.right.include(e,t)}else{i.include(e,t)}}render(e,t,{isCalleeOfRenderedParent:i,preventASI:s,renderedParentType:n,renderedSurroundingElement:r}=q){if(!this.left.included||!this.right.included){const o=findFirstOccurrenceOutsideComment(e.original,this.operator,this.left.end);if(this.right.included){const t=findNonWhiteSpace(e.original,o+2);e.remove(this.start,t);if(s){removeLineBreaks(e,t,this.right.start)}}else{e.remove(o,this.end)}removeAnnotations(this,e);this.getUsedBranch().render(e,t,{isCalleeOfRenderedParent:i,preventASI:s,renderedParentType:n||this.parent.type,renderedSurroundingElement:r||this.parent.type})}else{this.left.render(e,t,{preventASI:s,renderedSurroundingElement:r});this.right.render(e,t)}}getUsedBranch(){if(!this.isBranchResolutionAnalysed){this.isBranchResolutionAnalysed=true;const e=this.left.getLiteralValueAtPath(ri,ui,this);if(typeof e==="symbol"){return null}else{this.usedBranch=this.operator==="||"&&e||this.operator==="&&"&&!e||this.operator==="??"&&e!=null?this.left:this.right}}return this.usedBranch}}const kr="ROLLUP_FILE_URL_";const Cr="import";class MetaProperty extends NodeBase{constructor(){super(...arguments);this.metaProperty=null;this.preliminaryChunkId=null;this.referenceId=null}getReferencedFileName(e){const{meta:{name:t},metaProperty:i}=this;if(t===Cr&&i?.startsWith(kr)){return e.getFileName(i.slice(kr.length))}return null}hasEffects(){return false}hasEffectsOnInteractionAtPath(e,{type:t}){return e.length>1||t!==mi}include(){if(!this.included){this.included=true;if(this.meta.name===Cr){this.context.addImportMeta(this);const e=this.parent;const t=this.metaProperty=e instanceof MemberExpression&&typeof e.propertyKey==="string"?e.propertyKey:null;if(t?.startsWith(kr)){this.referenceId=t.slice(kr.length)}}}}render(e,{format:t,pluginDriver:i,snippets:s}){const{context:{module:{id:n}},meta:{name:o},metaProperty:l,parent:c,preliminaryChunkId:u,referenceId:h,start:d,end:p}=this;if(o!==Cr)return;const f=u;if(h){const s=i.getFileName(h);const o=normalize(r.relative(r.dirname(f),s));const l=i.hookFirstSync("resolveFileUrl",[{chunkId:f,fileName:s,format:t,moduleId:n,referenceId:h,relativePath:o}])||Nr[t](o);e.overwrite(c.start,c.end,l,{contentOnly:true});return}const m=i.hookFirstSync("resolveImportMeta",[l,{chunkId:f,format:t,moduleId:n}])||Rr[t]?.(l,{chunkId:f,snippets:s});if(typeof m==="string"){if(c instanceof MemberExpression){e.overwrite(c.start,c.end,m,{contentOnly:true})}else{e.overwrite(d,p,m,{contentOnly:true})}}}setResolution(e,t,i){this.preliminaryChunkId=i;const s=(this.metaProperty?.startsWith(kr)?Pr:_r)[e];if(s.length>0){this.scope.addAccessedGlobals(s,t)}}}const _r={amd:["document","module","URL"],cjs:["document","require","URL"],es:[],iife:["document","URL"],system:["module"],umd:["document","require","URL"]};const Pr={amd:["document","require","URL"],cjs:["document","require","URL"],es:[],iife:["document","URL"],system:["module","URL"],umd:["document","require","URL"]};const getResolveUrl=(e,t="URL")=>`new ${t}(${e}).href`;const getRelativeUrlFromDocument=(e,t=false)=>getResolveUrl(`'${escapeId(e)}', ${t?`typeof document === 'undefined' ? location.href : `:""}document.currentScript && document.currentScript.src || document.baseURI`);const getGenericImportMetaMechanism=e=>(t,{chunkId:i})=>{const s=e(i);return t===null?`({ url: ${s} })`:t==="url"?s:"undefined"};const getFileUrlFromFullPath=e=>`require('u' + 'rl').pathToFileURL(${e}).href`;const getFileUrlFromRelativePath=e=>getFileUrlFromFullPath(`__dirname + '/${e}'`);const getUrlFromDocument=(e,t=false)=>`${t?`typeof document === 'undefined' ? location.href : `:""}(document.currentScript && document.currentScript.src || new URL('${escapeId(e)}', document.baseURI).href)`;const Nr={amd:e=>{if(e[0]!==".")e="./"+e;return getResolveUrl(`require.toUrl('${e}'), document.baseURI`)},cjs:e=>`(typeof document === 'undefined' ? ${getFileUrlFromRelativePath(e)} : ${getRelativeUrlFromDocument(e)})`,es:e=>getResolveUrl(`'${e}', import.meta.url`),iife:e=>getRelativeUrlFromDocument(e),system:e=>getResolveUrl(`'${e}', module.meta.url`),umd:e=>`(typeof document === 'undefined' && typeof location === 'undefined' ? ${getFileUrlFromRelativePath(e)} : ${getRelativeUrlFromDocument(e,true)})`};const Rr={amd:getGenericImportMetaMechanism((()=>getResolveUrl(`module.uri, document.baseURI`))),cjs:getGenericImportMetaMechanism((e=>`(typeof document === 'undefined' ? ${getFileUrlFromFullPath("__filename")} : ${getUrlFromDocument(e)})`)),iife:getGenericImportMetaMechanism((e=>getUrlFromDocument(e))),system:(e,{snippets:{getPropertyAccess:t}})=>e===null?`module.meta`:`module.meta${t(e)}`,umd:getGenericImportMetaMechanism((e=>`(typeof document === 'undefined' && typeof location === 'undefined' ? ${getFileUrlFromFullPath("__filename")} : ${getUrlFromDocument(e,true)})`))};class NewExpression extends NodeBase{hasEffects(e){try{for(const t of this.arguments){if(t.hasEffects(e))return true}if(this.context.options.treeshake.annotations&&this.annotations){return false}return this.callee.hasEffects(e)||this.callee.hasEffectsOnInteractionAtPath(ri,this.interaction,e)}finally{if(!this.deoptimized)this.applyDeoptimizations()}}hasEffectsOnInteractionAtPath(e,{type:t}){return e.length>0||t!==mi}include(e,t){if(!this.deoptimized)this.applyDeoptimizations();if(t){super.include(e,t)}else{this.included=true;this.callee.include(e,false)}this.callee.includeCallArguments(e,this.arguments)}initialise(){this.interaction={args:[null,...this.arguments],type:yi,withNew:true}}render(e,t){this.callee.render(e,t);renderCallArguments(e,t,this)}applyDeoptimizations(){this.deoptimized=true;this.callee.deoptimizeArgumentsOnInteractionAtPath(this.interaction,ri,ui);this.context.requestTreeshakingPass()}}class ObjectExpression extends NodeBase{constructor(){super(...arguments);this.objectEntity=null}deoptimizeArgumentsOnInteractionAtPath(e,t,i){this.getObjectEntity().deoptimizeArgumentsOnInteractionAtPath(e,t,i)}deoptimizeCache(){this.getObjectEntity().deoptimizeAllProperties()}deoptimizePath(e){this.getObjectEntity().deoptimizePath(e)}getLiteralValueAtPath(e,t,i){return this.getObjectEntity().getLiteralValueAtPath(e,t,i)}getReturnExpressionWhenCalledAtPath(e,t,i,s){return this.getObjectEntity().getReturnExpressionWhenCalledAtPath(e,t,i,s)}hasEffectsOnInteractionAtPath(e,t,i){return this.getObjectEntity().hasEffectsOnInteractionAtPath(e,t,i)}render(e,t,{renderedSurroundingElement:i}=q){super.render(e,t);if(i===tn||i===Ys){e.appendRight(this.start,"(");e.prependLeft(this.end,")")}}applyDeoptimizations(){}getObjectEntity(){if(this.objectEntity!==null){return this.objectEntity}let e=kn;const t=[];for(const i of this.properties){if(i instanceof SpreadElement){t.push({key:ti,kind:"init",property:i});continue}let s;if(i.computed){const e=i.key.getLiteralValueAtPath(ri,ui,this);if(typeof e==="symbol"){t.push({key:ti,kind:i.kind,property:i});continue}else{s=String(e)}}else{s=i.key instanceof Identifier?i.key.name:String(i.key.value);if(s==="__proto__"&&i.kind==="init"){e=i.value instanceof Literal&&i.value.value===null?null:i.value;continue}}t.push({key:s,kind:i.kind,property:i})}return this.objectEntity=new ObjectEntity(t,e)}}class PrivateIdentifier extends NodeBase{}function getOriginalLocation(e,t){const i=e.filter((e=>!!e.mappings));e:while(i.length>0){const e=i.pop();const s=e.mappings[t.line-1];if(s){const e=s.filter((e=>e.length>1));const i=e[e.length-1];for(const s of e){if(s[0]>=t.column||s===i){t={column:s[3],line:s[2]+1};continue e}}}throw new Error("Can't resolve original location of error.")}return t}class Program extends NodeBase{constructor(){super(...arguments);this.hasCachedEffect=null;this.hasLoggedEffect=false}hasCachedEffects(){if(!this.included){return false}return this.hasCachedEffect===null?this.hasCachedEffect=this.hasEffects(createHasEffectsContext()):this.hasCachedEffect}hasEffects(e){for(const t of this.body){if(t.hasEffects(e)){if(this.context.options.experimentalLogSideEffects&&!this.hasLoggedEffect){this.hasLoggedEffect=true;const{code:e,module:i}=this.context;const{line:s,column:n}=locate(e,t.start,{offsetLine:1});console.log(`First side effect in ${relativeId(i.id)} is at (${s}:${n})\n${getCodeFrame(e,s,n)}`);try{const{column:e,line:t}=getOriginalLocation(i.sourcemapChain,{column:n,line:s});if(t!==s){console.log(`Original location is at (${t}:${e})\n${getCodeFrame(i.originalCode,t,e)}\n`)}}catch{}console.log()}return this.hasCachedEffect=true}}return false}include(e,t){this.included=true;for(const i of this.body){if(t||i.shouldBeIncluded(e)){i.include(e,t)}}}render(e,t){let i=this.start;if(e.original.startsWith("#!")){i=Math.min(e.original.indexOf("\n")+1,this.end);e.remove(0,i)}if(this.body.length>0){while(e.original[i]==="/"&&/[*/]/.test(e.original[i+1])){const t=findFirstLineBreakOutsideComment(e.original.slice(i,this.body[0].start));if(t[0]===-1){break}i+=t[1]}renderStatementList(this.body,e,i,this.end,t)}else{super.render(e,t)}}applyDeoptimizations(){}}class Property extends MethodBase{constructor(){super(...arguments);this.declarationInit=null}declare(e,t){this.declarationInit=t;return this.value.declare(e,pi)}hasEffects(e){if(!this.deoptimized)this.applyDeoptimizations();const t=this.context.options.treeshake.propertyReadSideEffects;return this.parent.type==="ObjectPattern"&&t==="always"||this.key.hasEffects(e)||this.value.hasEffects(e)}markDeclarationReached(){this.value.markDeclarationReached()}render(e,t){if(!this.shorthand){this.key.render(e,t)}this.value.render(e,t,{isShorthandProperty:this.shorthand})}applyDeoptimizations(){this.deoptimized=true;if(this.declarationInit!==null){this.declarationInit.deoptimizePath([ti,ti]);this.context.requestTreeshakingPass()}}}class PropertyDefinition extends NodeBase{deoptimizeArgumentsOnInteractionAtPath(e,t,i){this.value?.deoptimizeArgumentsOnInteractionAtPath(e,t,i)}deoptimizePath(e){this.value?.deoptimizePath(e)}getLiteralValueAtPath(e,t,i){return this.value?this.value.getLiteralValueAtPath(e,t,i):hi}getReturnExpressionWhenCalledAtPath(e,t,i,s){return this.value?this.value.getReturnExpressionWhenCalledAtPath(e,t,i,s):fi}hasEffects(e){return this.key.hasEffects(e)||this.static&&!!this.value?.hasEffects(e)}hasEffectsOnInteractionAtPath(e,t,i){return!this.value||this.value.hasEffectsOnInteractionAtPath(e,t,i)}applyDeoptimizations(){}}class ReturnStatement extends NodeBase{hasEffects(e){if(!e.ignore.returnYield||this.argument?.hasEffects(e))return true;e.brokenFlow=true;return false}include(e,t){this.included=true;this.argument?.include(e,t);e.brokenFlow=true}initialise(){this.scope.addReturnExpression(this.argument||pi)}render(e,t){if(this.argument){this.argument.render(e,t,{preventASI:true});if(this.argument.start===this.start+6){e.prependLeft(this.start+6," ")}}}}class SequenceExpression extends NodeBase{deoptimizeArgumentsOnInteractionAtPath(e,t,i){this.expressions[this.expressions.length-1].deoptimizeArgumentsOnInteractionAtPath(e,t,i)}deoptimizePath(e){this.expressions[this.expressions.length-1].deoptimizePath(e)}getLiteralValueAtPath(e,t,i){return this.expressions[this.expressions.length-1].getLiteralValueAtPath(e,t,i)}hasEffects(e){for(const t of this.expressions){if(t.hasEffects(e))return true}return false}hasEffectsOnInteractionAtPath(e,t,i){return this.expressions[this.expressions.length-1].hasEffectsOnInteractionAtPath(e,t,i)}include(e,t){this.included=true;const i=this.expressions[this.expressions.length-1];for(const s of this.expressions){if(t||s===i&&!(this.parent instanceof ExpressionStatement)||s.shouldBeIncluded(e))s.include(e,t)}}render(e,t,{renderedParentType:i,isCalleeOfRenderedParent:s,preventASI:n}=q){let r=0;let o=null;const l=this.expressions[this.expressions.length-1];for(const{node:c,separator:u,start:h,end:d}of getCommaSeparatedNodesWithBoundaries(this.expressions,e,this.start,this.end)){if(!c.included){treeshakeNode(c,e,h,d);continue}r++;o=u;if(r===1&&n){removeLineBreaks(e,h,c.start)}if(r===1){const n=i||this.parent.type;c.render(e,t,{isCalleeOfRenderedParent:s&&c===l,renderedParentType:n,renderedSurroundingElement:n})}else{c.render(e,t)}}if(o){e.remove(o,this.end)}}}class StaticBlock extends NodeBase{createScope(e){this.scope=new BlockScope(e)}hasEffects(e){for(const t of this.body){if(t.hasEffects(e))return true}return false}include(e,t){this.included=true;for(const i of this.body){if(t||i.shouldBeIncluded(e))i.include(e,t)}}render(e,t){if(this.body.length>0){const i=findFirstOccurrenceOutsideComment(e.original.slice(this.start,this.end),"{")+1;renderStatementList(this.body,e,this.start+i,this.end-1,t)}else{super.render(e,t)}}}class Super extends NodeBase{bind(){this.variable=this.scope.findVariable("this")}deoptimizeArgumentsOnInteractionAtPath(e,t,i){this.variable.deoptimizeArgumentsOnInteractionAtPath(e,t,i)}deoptimizePath(e){this.variable.deoptimizePath(e)}include(){if(!this.included){this.included=true;this.context.includeVariableInModule(this.variable)}}}class SwitchCase extends NodeBase{hasEffects(e){if(this.test?.hasEffects(e))return true;for(const t of this.consequent){if(e.brokenFlow)break;if(t.hasEffects(e))return true}return false}include(e,t){this.included=true;this.test?.include(e,t);for(const i of this.consequent){if(t||i.shouldBeIncluded(e))i.include(e,t)}}render(e,t,i){if(this.consequent.length>0){this.test&&this.test.render(e,t);const s=this.test?this.test.end:findFirstOccurrenceOutsideComment(e.original,"default",this.start)+7;const n=findFirstOccurrenceOutsideComment(e.original,":",s)+1;renderStatementList(this.consequent,e,n,i.end,t)}else{super.render(e,t)}}}SwitchCase.prototype.needsBoundaries=true;class SwitchStatement extends NodeBase{createScope(e){this.parentScope=e;this.scope=new BlockScope(e)}hasEffects(e){if(this.discriminant.hasEffects(e))return true;const{brokenFlow:t,hasBreak:i,ignore:s}=e;const{breaks:n}=s;s.breaks=true;e.hasBreak=false;let r=true;for(const i of this.cases){if(i.hasEffects(e))return true;r&&(r=e.brokenFlow&&!e.hasBreak);e.hasBreak=false;e.brokenFlow=t}if(this.defaultCase!==null){e.brokenFlow=r}s.breaks=n;e.hasBreak=i;return false}include(e,t){this.included=true;this.discriminant.include(e,t);const{brokenFlow:i,hasBreak:s}=e;e.hasBreak=false;let n=true;let r=t||this.defaultCase!==null&&this.defaultCase<this.cases.length-1;for(let s=this.cases.length-1;s>=0;s--){const o=this.cases[s];if(o.included){r=true}if(!r){const e=createHasEffectsContext();e.ignore.breaks=true;r=o.hasEffects(e)}if(r){o.include(e,t);n&&(n=e.brokenFlow&&!e.hasBreak);e.hasBreak=false;e.brokenFlow=i}else{n=i}}if(r&&this.defaultCase!==null){e.brokenFlow=n}e.hasBreak=s}initialise(){for(let e=0;e<this.cases.length;e++){if(this.cases[e].test===null){this.defaultCase=e;return}}this.defaultCase=null}parseNode(e){this.discriminant=new(this.context.getNodeConstructor(e.discriminant.type))(e.discriminant,this,this.parentScope);super.parseNode(e)}render(e,t){this.discriminant.render(e,t);if(this.cases.length>0){renderStatementList(this.cases,e,this.cases[0].start,this.end-1,t)}}}class TaggedTemplateExpression extends CallExpressionBase{bind(){super.bind();if(this.tag.type===sn){const e=this.tag.name;const t=this.scope.findVariable(e);if(t.isNamespace){this.context.warn(errorCannotCallNamespace(e),this.start)}}}hasEffects(e){try{for(const t of this.quasi.expressions){if(t.hasEffects(e))return true}return this.tag.hasEffects(e)||this.tag.hasEffectsOnInteractionAtPath(ri,this.interaction,e)}finally{if(!this.deoptimized)this.applyDeoptimizations()}}include(e,t){if(!this.deoptimized)this.applyDeoptimizations();if(t){super.include(e,t)}else{this.included=true;this.tag.include(e,t);this.quasi.include(e,t)}this.tag.includeCallArguments(e,this.args);const[i]=this.getReturnExpression();if(!i.included){i.include(e,false)}}initialise(){this.args=[pi,...this.quasi.expressions];this.interaction={args:[this.tag instanceof MemberExpression&&!this.tag.variable?this.tag.object:null,...this.args],type:yi,withNew:false}}render(e,t){this.tag.render(e,t,{isCalleeOfRenderedParent:true});this.quasi.render(e,t)}applyDeoptimizations(){this.deoptimized=true;this.tag.deoptimizeArgumentsOnInteractionAtPath(this.interaction,ri,ui);this.context.requestTreeshakingPass()}getReturnExpression(e=ui){if(this.returnExpression===null){this.returnExpression=fi;return this.returnExpression=this.tag.getReturnExpressionWhenCalledAtPath(ri,this.interaction,e,this)}return this.returnExpression}}class TemplateElement extends NodeBase{bind(){}hasEffects(){return false}include(){this.included=true}parseNode(e){this.value=e.value;super.parseNode(e)}render(){}}class TemplateLiteral extends NodeBase{deoptimizeArgumentsOnInteractionAtPath(){}getLiteralValueAtPath(e){if(e.length>0||this.quasis.length!==1){return hi}return this.quasis[0].value.cooked}getReturnExpressionWhenCalledAtPath(e){if(e.length!==1){return fi}return getMemberReturnExpressionWhenCalled(qs,e[0])}hasEffectsOnInteractionAtPath(e,t,i){if(t.type===mi){return e.length>1}if(t.type===yi&&e.length===1){return hasMemberEffectWhenCalled(qs,e[0],t,i)}return true}render(e,t){e.indentExclusionRanges.push([this.start,this.end]);super.render(e,t)}}class UndefinedVariable extends Variable{constructor(){super("undefined")}getLiteralValueAtPath(){return undefined}}class ExportDefaultVariable extends LocalVariable{constructor(e,t,i){super(e,t,t.declaration,i);this.hasId=false;this.originalId=null;this.originalVariable=null;const s=t.declaration;if((s instanceof FunctionDeclaration||s instanceof ClassDeclaration)&&s.id){this.hasId=true;this.originalId=s.id}else if(s instanceof Identifier){this.originalId=s}}addReference(e){if(!this.hasId){this.name=e.name}}forbidName(e){const t=this.getOriginalVariable();if(t===this){super.forbidName(e)}else{t.forbidName(e)}}getAssignedVariableName(){return this.originalId&&this.originalId.name||null}getBaseVariableName(){const e=this.getOriginalVariable();return e===this?super.getBaseVariableName():e.getBaseVariableName()}getDirectOriginalVariable(){return this.originalId&&(this.hasId||!(this.originalId.isPossibleTDZ()||this.originalId.variable.isReassigned||this.originalId.variable instanceof UndefinedVariable||"syntheticNamespace"in this.originalId.variable))?this.originalId.variable:null}getName(e){const t=this.getOriginalVariable();return t===this?super.getName(e):t.getName(e)}getOriginalVariable(){if(this.originalVariable)return this.originalVariable;let e=this;let t;const i=new Set;do{i.add(e);t=e;e=t.getDirectOriginalVariable()}while(e instanceof ExportDefaultVariable&&!i.has(e));return this.originalVariable=e||t}}class ModuleScope extends ChildScope{constructor(e,t){super(e);this.context=t;this.variables.set("this",new LocalVariable("this",null,Ts,t))}addExportDefaultDeclaration(e,t,i){const s=new ExportDefaultVariable(e,t,i);this.variables.set("default",s);return s}addNamespaceMemberAccess(){}deconflict(e,t,i){for(const s of this.children)s.deconflict(e,t,i)}findLexicalBoundary(){return this}findVariable(e){const t=this.variables.get(e)||this.accessedOutsideVariables.get(e);if(t){return t}const i=this.context.traceVariable(e)||this.parent.findVariable(e);if(i instanceof GlobalVariable){this.accessedOutsideVariables.set(e,i)}return i}}class ThisExpression extends NodeBase{bind(){this.variable=this.scope.findVariable("this")}deoptimizeArgumentsOnInteractionAtPath(e,t,i){this.variable.deoptimizeArgumentsOnInteractionAtPath(e,t,i)}deoptimizePath(e){this.variable.deoptimizePath(e)}hasEffectsOnInteractionAtPath(e,t,i){if(e.length===0){return t.type!==mi}return this.variable.hasEffectsOnInteractionAtPath(e,t,i)}include(){if(!this.included){this.included=true;this.context.includeVariableInModule(this.variable)}}initialise(){this.alias=this.scope.findLexicalBoundary()instanceof ModuleScope?this.context.moduleContext:null;if(this.alias==="undefined"){this.context.warn(errorThisIsUndefined(),this.start)}}render(e){if(this.alias!==null){e.overwrite(this.start,this.end,this.alias,{contentOnly:false,storeName:true})}}}class ThrowStatement extends NodeBase{hasEffects(){return true}include(e,t){this.included=true;this.argument.include(e,t);e.brokenFlow=true}render(e,t){this.argument.render(e,t,{preventASI:true});if(this.argument.start===this.start+5){e.prependLeft(this.start+5," ")}}}class TryStatement extends NodeBase{constructor(){super(...arguments);this.directlyIncluded=false;this.includedLabelsAfterBlock=null}hasEffects(e){return(this.context.options.treeshake.tryCatchDeoptimization?this.block.body.length>0:this.block.hasEffects(e))||!!this.finalizer?.hasEffects(e)}include(e,t){const i=this.context.options.treeshake?.tryCatchDeoptimization;const{brokenFlow:s,includedLabels:n}=e;if(!this.directlyIncluded||!i){this.included=true;this.directlyIncluded=true;this.block.include(e,i?xn:t);if(n.size>0){this.includedLabelsAfterBlock=[...n]}e.brokenFlow=s}else if(this.includedLabelsAfterBlock){for(const e of this.includedLabelsAfterBlock){n.add(e)}}if(this.handler!==null){this.handler.include(e,t);e.brokenFlow=s}this.finalizer?.include(e,t)}}const $r={"!":e=>!e,"+":e=>+e,"-":e=>-e,delete:()=>hi,typeof:e=>typeof e,void:()=>undefined,"~":e=>~e};class UnaryExpression extends NodeBase{getLiteralValueAtPath(e,t,i){if(e.length>0)return hi;const s=this.argument.getLiteralValueAtPath(ri,t,i);if(typeof s==="symbol")return hi;return $r[this.operator](s)}hasEffects(e){if(!this.deoptimized)this.applyDeoptimizations();if(this.operator==="typeof"&&this.argument instanceof Identifier)return false;return this.argument.hasEffects(e)||this.operator==="delete"&&this.argument.hasEffectsOnInteractionAtPath(ri,xi,e)}hasEffectsOnInteractionAtPath(e,{type:t}){return t!==mi||e.length>(this.operator==="void"?0:1)}applyDeoptimizations(){this.deoptimized=true;if(this.operator==="delete"){this.argument.deoptimizePath(ri);this.context.requestTreeshakingPass()}}}class UnknownNode extends NodeBase{hasEffects(){return true}include(e){super.include(e,true)}}class UpdateExpression extends NodeBase{hasEffects(e){if(!this.deoptimized)this.applyDeoptimizations();return this.argument.hasEffectsAsAssignmentTarget(e,true)}hasEffectsOnInteractionAtPath(e,{type:t}){return e.length>1||t!==mi}include(e,t){if(!this.deoptimized)this.applyDeoptimizations();this.included=true;this.argument.includeAsAssignmentTarget(e,t,true)}initialise(){this.argument.setAssignedValue(pi)}render(e,t){const{exportNamesByVariable:i,format:s,snippets:{_:n}}=t;this.argument.render(e,t);if(s==="system"){const s=this.argument.variable;const r=i.get(s);if(r){if(this.prefix){if(r.length===1){renderSystemExportExpression(s,this.start,this.end,e,t)}else{renderSystemExportSequenceAfterExpression(s,this.start,this.end,this.parent.type!==tn,e,t)}}else{const i=this.operator[0];renderSystemExportSequenceBeforeExpression(s,this.start,this.end,this.parent.type!==tn,e,t,`${n}${i}${n}1`)}}}}applyDeoptimizations(){this.deoptimized=true;this.argument.deoptimizePath(ri);if(this.argument instanceof Identifier){const e=this.scope.findVariable(this.argument.name);e.isReassigned=true}this.context.requestTreeshakingPass()}}function areAllDeclarationsIncludedAndNotExported(e,t){for(const i of e){if(!i.id.included)return false;if(i.id.type===sn){if(t.has(i.id.variable))return false}else{const e=[];i.id.addExportedVariables(e,t);if(e.length>0)return false}}return true}class VariableDeclaration extends NodeBase{deoptimizePath(){for(const e of this.declarations){e.deoptimizePath(ri)}}hasEffectsOnInteractionAtPath(){return false}include(e,t,{asSingleStatement:i}=q){this.included=true;for(const s of this.declarations){if(t||s.shouldBeIncluded(e))s.include(e,t);const{id:n,init:r}=s;if(i){n.include(e,t)}if(r&&n.included&&!r.included&&(n instanceof ObjectPattern||n instanceof ArrayPattern)){r.include(e,t)}}}initialise(){for(const e of this.declarations){e.declareDeclarator(this.kind)}}render(e,t,i=q){if(areAllDeclarationsIncludedAndNotExported(this.declarations,t.exportNamesByVariable)){for(const i of this.declarations){i.render(e,t)}if(!i.isNoStatement&&e.original.charCodeAt(this.end-1)!==59){e.appendLeft(this.end,";")}}else{this.renderReplacedDeclarations(e,t)}}applyDeoptimizations(){}renderDeclarationEnd(e,t,i,s,n,r,o){if(e.original.charCodeAt(this.end-1)===59){e.remove(this.end-1,this.end)}t+=";";if(i===null){e.appendLeft(n,t)}else{if(e.original.charCodeAt(s-1)===10&&(e.original.charCodeAt(this.end)===10||e.original.charCodeAt(this.end)===13)){s--;if(e.original.charCodeAt(s)===13){s--}}if(s===i+1){e.overwrite(i,n,t)}else{e.overwrite(i,i+1,t);e.remove(s,n)}}if(r.length>0){e.appendLeft(n,` ${getSystemExportStatement(r,o)};`)}}renderReplacedDeclarations(e,t){const i=getCommaSeparatedNodesWithBoundaries(this.declarations,e,this.start+this.kind.length,this.end-(e.original.charCodeAt(this.end-1)===59?1:0));let s,n;n=findNonWhiteSpace(e.original,this.start+this.kind.length);let r=n-1;e.remove(this.start,r);let o=false;let l=false;let c="",u,h;const d=[];const p=gatherSystemExportsAndGetSingleExport(i,t,d);for(const{node:d,start:f,separator:m,contentEnd:g,end:y}of i){if(!d.included){e.remove(f,y);continue}d.render(e,t);u="";h="";if(!d.id.included||d.id instanceof Identifier&&isReassignedExportsMember(d.id.variable,t.exportNamesByVariable)){if(l){c+=";"}o=false}else{if(p&&p===d.id.variable){const i=findFirstOccurrenceOutsideComment(e.original,"=",d.id.end);renderSystemExportExpression(p,findNonWhiteSpace(e.original,i+1),m===null?g:m,e,t)}if(o){c+=","}else{if(l){c+=";"}u+=`${this.kind} `;o=true}}if(n===r+1){e.overwrite(r,n,c+u)}else{e.overwrite(r,r+1,c);e.appendLeft(n,u)}s=g;n=y;l=true;r=m;c=h}this.renderDeclarationEnd(e,c,r,s,n,d,t)}}function gatherSystemExportsAndGetSingleExport(e,t,i){let s=null;if(t.format==="system"){for(const{node:n}of e){if(n.id instanceof Identifier&&n.init&&i.length===0&&t.exportNamesByVariable.get(n.id.variable)?.length===1){s=n.id.variable;i.push(s)}else{n.id.addExportedVariables(i,t.exportNamesByVariable)}}if(i.length>1){s=null}else if(s){i.length=0}}return s}class WhileStatement extends NodeBase{hasEffects(e){if(this.test.hasEffects(e))return true;return hasLoopBodyEffects(e,this.body)}include(e,t){this.included=true;this.test.include(e,t);includeLoopBody(e,this.body,t)}}class YieldExpression extends NodeBase{hasEffects(e){if(!this.deoptimized)this.applyDeoptimizations();return!(e.ignore.returnYield&&!this.argument?.hasEffects(e))}render(e,t){if(this.argument){this.argument.render(e,t,{preventASI:true});if(this.argument.start===this.start+5){e.prependLeft(this.start+5," ")}}}}const Or={ArrayExpression:ArrayExpression,ArrayPattern:ArrayPattern,ArrowFunctionExpression:ArrowFunctionExpression,AssignmentExpression:AssignmentExpression,AssignmentPattern:AssignmentPattern,AwaitExpression:AwaitExpression,BinaryExpression:BinaryExpression,BlockStatement:BlockStatement,BreakStatement:BreakStatement,CallExpression:CallExpression,CatchClause:CatchClause,ChainExpression:ChainExpression,ClassBody:ClassBody,ClassDeclaration:ClassDeclaration,ClassExpression:ClassExpression,ConditionalExpression:ConditionalExpression,ContinueStatement:ContinueStatement,DoWhileStatement:DoWhileStatement,EmptyStatement:EmptyStatement,ExportAllDeclaration:ExportAllDeclaration,ExportDefaultDeclaration:ExportDefaultDeclaration,ExportNamedDeclaration:ExportNamedDeclaration,ExportSpecifier:ExportSpecifier,ExpressionStatement:ExpressionStatement,ForInStatement:ForInStatement,ForOfStatement:ForOfStatement,ForStatement:ForStatement,FunctionDeclaration:FunctionDeclaration,FunctionExpression:FunctionExpression,Identifier:Identifier,IfStatement:IfStatement,ImportAttribute:ImportAttribute,ImportDeclaration:ImportDeclaration,ImportDefaultSpecifier:ImportDefaultSpecifier,ImportExpression:ImportExpression,ImportNamespaceSpecifier:ImportNamespaceSpecifier,ImportSpecifier:ImportSpecifier,LabeledStatement:LabeledStatement,Literal:Literal,LogicalExpression:LogicalExpression,MemberExpression:MemberExpression,MetaProperty:MetaProperty,MethodDefinition:MethodDefinition,NewExpression:NewExpression,ObjectExpression:ObjectExpression,ObjectPattern:ObjectPattern,PrivateIdentifier:PrivateIdentifier,Program:Program,Property:Property,PropertyDefinition:PropertyDefinition,RestElement:RestElement,ReturnStatement:ReturnStatement,SequenceExpression:SequenceExpression,SpreadElement:SpreadElement,StaticBlock:StaticBlock,Super:Super,SwitchCase:SwitchCase,SwitchStatement:SwitchStatement,TaggedTemplateExpression:TaggedTemplateExpression,TemplateElement:TemplateElement,TemplateLiteral:TemplateLiteral,ThisExpression:ThisExpression,ThrowStatement:ThrowStatement,TryStatement:TryStatement,UnaryExpression:UnaryExpression,UnknownNode:UnknownNode,UpdateExpression:UpdateExpression,VariableDeclaration:VariableDeclaration,VariableDeclarator:VariableDeclarator,WhileStatement:WhileStatement,YieldExpression:YieldExpression};const Tr="_missingExportShim";class ExportShimVariable extends Variable{constructor(e){super(Tr);this.module=e}include(){super.include();this.module.needsExportShim=true}}class NamespaceVariable extends Variable{constructor(e){super(e.getModuleName());this.memberVariables=null;this.mergedNamespaces=[];this.referencedEarly=false;this.references=[];this.context=e;this.module=e.module}addReference(e){this.references.push(e);this.name=e.name}deoptimizeArgumentsOnInteractionAtPath(e,t,i){if(t.length>1||t.length===1&&e.type===yi){const s=t[0];if(typeof s==="string"){this.getMemberVariables()[s]?.deoptimizeArgumentsOnInteractionAtPath(e,t.slice(1),i)}else{deoptimizeInteraction(e)}}}deoptimizePath(e){if(e.length>1){const t=e[0];if(typeof t==="string"){this.getMemberVariables()[t]?.deoptimizePath(e.slice(1))}}}getLiteralValueAtPath(e){if(e[0]===ni){return"Module"}return hi}getMemberVariables(){if(this.memberVariables){return this.memberVariables}const e=Object.create(null);const t=[...this.context.getExports(),...this.context.getReexports()].sort();for(const i of t){if(i[0]!=="*"&&i!==this.module.info.syntheticNamedExports){const t=this.context.traceExport(i);if(t){e[i]=t}}}return this.memberVariables=e}hasEffectsOnInteractionAtPath(e,t,i){const{type:s}=t;if(e.length===0){return true}if(e.length===1&&s!==yi){return s===gi}const n=e[0];if(typeof n!=="string"){return true}const r=this.getMemberVariables()[n];return!r||r.hasEffectsOnInteractionAtPath(e.slice(1),t,i)}include(){this.included=true;this.context.includeAllExports()}prepare(e){if(this.mergedNamespaces.length>0){this.module.scope.addAccessedGlobals([br],e)}}renderBlock(e){const{exportNamesByVariable:t,format:i,freeze:s,indent:n,namespaceToStringTag:r,snippets:{_:o,cnst:l,getObject:c,getPropertyAccess:u,n:h,s:d}}=e;const p=this.getMemberVariables();const f=Object.entries(p).filter((([e,t])=>t.included)).map((([e,t])=>{if(this.referencedEarly||t.isReassigned||t===this){return[null,`get ${e}${o}()${o}{${o}return ${t.getName(u)}${d}${o}}`]}return[e,t.getName(u)]}));f.unshift([null,`__proto__:${o}null`]);let m=c(f,{lineBreakIndent:{base:"",t:n}});if(this.mergedNamespaces.length>0){const e=this.mergedNamespaces.map((e=>e.getName(u)));m=`/*#__PURE__*/${br}(${m},${o}[${e.join(`,${o}`)}])`}else{if(r){m=`/*#__PURE__*/Object.defineProperty(${m},${o}Symbol.toStringTag,${o}${getToStringTagValue(c)})`}if(s){m=`/*#__PURE__*/Object.freeze(${m})`}}const g=this.getName(u);m=`${l} ${g}${o}=${o}${m};`;if(i==="system"&&t.has(this)){m+=`${h}${getSystemExportStatement([this],e)};`}return m}renderFirst(){return this.referencedEarly}setMergedNamespaces(e){this.mergedNamespaces=e;const t=this.context.getModuleExecIndex();for(const e of this.references){if(e.context.getModuleExecIndex()<=t){this.referencedEarly=true;break}}}}NamespaceVariable.prototype.isNamespace=true;class SyntheticNamedExportVariable extends Variable{constructor(e,t,i){super(t);this.baseVariable=null;this.context=e;this.module=e.module;this.syntheticNamespace=i}getBaseVariable(){if(this.baseVariable)return this.baseVariable;let e=this.syntheticNamespace;while(e instanceof ExportDefaultVariable||e instanceof SyntheticNamedExportVariable){if(e instanceof ExportDefaultVariable){const t=e.getOriginalVariable();if(t===e)break;e=t}if(e instanceof SyntheticNamedExportVariable){e=e.syntheticNamespace}}return this.baseVariable=e}getBaseVariableName(){return this.syntheticNamespace.getBaseVariableName()}getName(e){return`${this.syntheticNamespace.getName(e)}${e(this.name)}`}include(){this.included=true;this.context.includeVariableInModule(this.syntheticNamespace)}setRenderNames(e,t){super.setRenderNames(e,t)}}var Dr;(function(e){e[e["LOAD_AND_PARSE"]=0]="LOAD_AND_PARSE";e[e["ANALYSE"]=1]="ANALYSE";e[e["GENERATE"]=2]="GENERATE"})(Dr||(Dr={}));function getId(e){return e.id}function getAssertionsFromImportExpression(e){const t=e.arguments?.[0]?.properties.find((e=>getPropertyKey(e)==="assert"))?.value;if(!t){return K}const i=t.properties.map((e=>{const t=getPropertyKey(e);if(typeof t==="string"&&typeof e.value.value==="string"){return[t,e.value.value]}return null})).filter((e=>!!e));if(i.length>0){return Object.fromEntries(i)}return K}const getPropertyKey=e=>{const t=e.key;return t&&(t.name||t.value)};function getAssertionsFromImportExportDeclaration(e){return e?.length?Object.fromEntries(e.map((e=>[getPropertyKey(e),e.value.value]))):K}function doAssertionsDiffer(e,t){const i=Object.keys(e);return i.length!==Object.keys(t).length||i.some((i=>e[i]!==t[i]))}let Mr=new Map;function getPersistedLabel(e,t){switch(t){case 1:{return`# ${e}`}case 2:{return`## ${e}`}case 3:{return e}default:{return`${" ".repeat(t-4)}- ${e}`}}}function timeStartImpl(e,t=3){e=getPersistedLabel(e,t);const i=s.memoryUsage().heapUsed;const n=l.performance.now();const r=Mr.get(e);if(r===undefined){Mr.set(e,{memory:0,startMemory:i,startTime:n,time:0,totalMemory:0})}else{r.startMemory=i;r.startTime=n}}function timeEndImpl(e,t=3){e=getPersistedLabel(e,t);const i=Mr.get(e);if(i!==undefined){const e=s.memoryUsage().heapUsed;i.memory+=e-i.startMemory;i.time+=l.performance.now()-i.startTime;i.totalMemory=Math.max(i.totalMemory,e)}}function getTimings(){const e={};for(const[t,{memory:i,time:s,totalMemory:n}]of Mr){e[t]=[s,i,n]}return e}let Lr=doNothing;let Br=doNothing;const Fr=["augmentChunkHash","buildEnd","buildStart","generateBundle","load","moduleParsed","options","outputOptions","renderChunk","renderDynamicImport","renderStart","resolveDynamicImport","resolveFileUrl","resolveId","resolveImportMeta","shouldTransformCachedModule","transform","writeBundle"];function getPluginWithTimers(e,t){for(const i of Fr){if(i in e){let s=`plugin ${t}`;if(e.name){s+=` (${e.name})`}s+=` - ${i}`;const handler=function(...e){Lr(s,4);const t=n.apply(this,e);Br(s,4);return t};let n;if(typeof e[i].handler==="function"){n=e[i].handler;e[i].handler=handler}else{n=e[i];e[i]=handler}}}return e}function initialiseTimers(e){if(e.perf){Mr=new Map;Lr=timeStartImpl;Br=timeEndImpl;e.plugins=e.plugins.map(getPluginWithTimers)}else{Lr=doNothing;Br=doNothing}}function markModuleAndImpureDependenciesAsExecuted(e){e.isExecuted=true;const t=[e];const i=new Set;for(const e of t){for(const s of[...e.dependencies,...e.implicitlyLoadedBefore]){if(!(s instanceof ExternalModule)&&!s.isExecuted&&(s.info.moduleSideEffects||e.implicitlyLoadedBefore.has(s))&&!i.has(s.id)){s.isExecuted=true;i.add(s.id);t.push(s)}}}}const Vr={identifier:null,localName:Tr};function getVariableForExportNameRecursive(e,t,i,s,n=new Map){const r=n.get(t);if(r){if(r.has(e)){return s?[null]:error(errorCircularReexport(t,e.id))}r.add(e)}else{n.set(t,new Set([e]))}return e.getVariableForExportName(t,{importerForSideEffects:i,isExportAllSearch:s,searchedNamesAndModules:n})}function getAndExtendSideEffectModules(e,t){const i=getOrCreate(t.sideEffectDependenciesByVariable,e,getNewSet);let s=e;const n=new Set([s]);while(true){const e=s.module;s=s instanceof ExportDefaultVariable?s.getDirectOriginalVariable():s instanceof SyntheticNamedExportVariable?s.syntheticNamespace:null;if(!s||n.has(s)){break}n.add(s);i.add(e);const t=e.sideEffectDependenciesByVariable.get(s);if(t){for(const e of t){i.add(e)}}}return i}class Module{constructor(e,t,i,s,n,r,o,l){this.graph=e;this.id=t;this.options=i;this.alternativeReexportModules=new Map;this.chunkFileNames=new Set;this.chunkNames=[];this.cycles=new Set;this.dependencies=new Set;this.dynamicDependencies=new Set;this.dynamicImporters=[];this.dynamicImports=[];this.execIndex=Infinity;this.implicitlyLoadedAfter=new Set;this.implicitlyLoadedBefore=new Set;this.importDescriptions=new Map;this.importMetas=[];this.importedFromNotTreeshaken=false;this.importers=[];this.includedDynamicImporters=[];this.includedImports=new Set;this.isExecuted=false;this.isUserDefinedEntryPoint=false;this.needsExportShim=false;this.sideEffectDependenciesByVariable=new Map;this.sourcesWithAssertions=new Map;this.allExportNames=null;this.ast=null;this.exportAllModules=[];this.exportAllSources=new Set;this.exportNamesByVariable=null;this.exportShimVariable=new ExportShimVariable(this);this.exports=new Map;this.namespaceReexportsByName=new Map;this.reexportDescriptions=new Map;this.relevantDependencies=null;this.syntheticExports=new Map;this.syntheticNamespace=null;this.transformDependencies=[];this.transitiveReexports=null;this.excludeFromSourcemap=/\0/.test(t);this.context=i.moduleContext(t);this.preserveSignature=this.options.preserveEntrySignatures;const c=this;const{dynamicImports:u,dynamicImporters:h,exportAllSources:d,exports:p,implicitlyLoadedAfter:f,implicitlyLoadedBefore:m,importers:g,reexportDescriptions:y,sourcesWithAssertions:E}=this;this.info={assertions:l,ast:null,code:null,get dynamicallyImportedIdResolutions(){return u.map((({argument:e})=>typeof e==="string"&&c.resolvedIds[e])).filter(Boolean)},get dynamicallyImportedIds(){return u.map((({id:e})=>e)).filter((e=>e!=null))},get dynamicImporters(){return h.sort()},get exportedBindings(){const e={".":[...p.keys()]};for(const[t,{source:i}]of y){(e[i]??(e[i]=[])).push(t)}for(const t of d){(e[t]??(e[t]=[])).push("*")}return e},get exports(){return[...p.keys(),...y.keys(),...[...d].map((()=>"*"))]},get hasDefaultExport(){if(!c.ast){return null}return c.exports.has("default")||y.has("default")},get hasModuleSideEffects(){warnDeprecation("Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.",W,true,i);return this.moduleSideEffects},id:t,get implicitlyLoadedAfterOneOf(){return Array.from(f,getId).sort()},get implicitlyLoadedBefore(){return Array.from(m,getId).sort()},get importedIdResolutions(){return Array.from(E.keys(),(e=>c.resolvedIds[e])).filter(Boolean)},get importedIds(){return Array.from(E.keys(),(e=>c.resolvedIds[e]?.id)).filter(Boolean)},get importers(){return g.sort()},isEntry:s,isExternal:false,get isIncluded(){if(e.phase!==Dr.GENERATE){return null}return c.isIncluded()},meta:{...o},moduleSideEffects:n,syntheticNamedExports:r};Object.defineProperty(this.info,"hasModuleSideEffects",{enumerable:false})}basename(){const e=r.basename(this.id);const t=r.extname(this.id);return makeLegal(t?e.slice(0,-t.length):e)}bindReferences(){this.ast.bind()}error(e,t){this.addLocationToLogProps(e,t);return error(e)}estimateSize(){let e=0;for(const t of this.ast.body){if(t.included){e+=t.end-t.start}}return e}getAllExportNames(){if(this.allExportNames){return this.allExportNames}this.allExportNames=new Set([...this.exports.keys(),...this.reexportDescriptions.keys()]);for(const e of this.exportAllModules){if(e instanceof ExternalModule){this.allExportNames.add(`*${e.id}`);continue}for(const t of e.getAllExportNames()){if(t!=="default")this.allExportNames.add(t)}}if(typeof this.info.syntheticNamedExports==="string"){this.allExportNames.delete(this.info.syntheticNamedExports)}return this.allExportNames}getDependenciesToBeIncluded(){if(this.relevantDependencies)return this.relevantDependencies;this.relevantDependencies=new Set;const e=new Set;const t=new Set;const i=new Set(this.includedImports);if(this.info.isEntry||this.includedDynamicImporters.length>0||this.namespace.included||this.implicitlyLoadedAfter.size>0){for(const e of[...this.getReexports(),...this.getExports()]){const[t]=this.getVariableForExportName(e);if(t){i.add(t)}}}for(let s of i){const i=this.sideEffectDependenciesByVariable.get(s);if(i){for(const e of i){t.add(e)}}if(s instanceof SyntheticNamedExportVariable){s=s.getBaseVariable()}else if(s instanceof ExportDefaultVariable){s=s.getOriginalVariable()}e.add(s.module)}if(!this.options.treeshake||this.info.moduleSideEffects==="no-treeshake"){for(const e of this.dependencies){this.relevantDependencies.add(e)}}else{this.addRelevantSideEffectDependencies(this.relevantDependencies,e,t)}for(const t of e){this.relevantDependencies.add(t)}return this.relevantDependencies}getExportNamesByVariable(){if(this.exportNamesByVariable){return this.exportNamesByVariable}const e=new Map;for(const t of this.getAllExportNames()){let[i]=this.getVariableForExportName(t);if(i instanceof ExportDefaultVariable){i=i.getOriginalVariable()}if(!i||!(i.included||i instanceof ExternalVariable)){continue}const s=e.get(i);if(s){s.push(t)}else{e.set(i,[t])}}return this.exportNamesByVariable=e}getExports(){return[...this.exports.keys()]}getReexports(){if(this.transitiveReexports){return this.transitiveReexports}this.transitiveReexports=[];const e=new Set(this.reexportDescriptions.keys());for(const t of this.exportAllModules){if(t instanceof ExternalModule){e.add(`*${t.id}`)}else{for(const i of[...t.getReexports(),...t.getExports()]){if(i!=="default")e.add(i)}}}return this.transitiveReexports=[...e]}getRenderedExports(){const e=[];const t=[];for(const i of this.exports.keys()){const[s]=this.getVariableForExportName(i);(s&&s.included?e:t).push(i)}return{removedExports:t,renderedExports:e}}getSyntheticNamespace(){if(this.syntheticNamespace===null){this.syntheticNamespace=undefined;[this.syntheticNamespace]=this.getVariableForExportName(typeof this.info.syntheticNamedExports==="string"?this.info.syntheticNamedExports:"default",{onlyExplicit:true})}if(!this.syntheticNamespace){return error(errorSyntheticNamedExportsNeedNamespaceExport(this.id,this.info.syntheticNamedExports))}return this.syntheticNamespace}getVariableForExportName(e,{importerForSideEffects:t,isExportAllSearch:i,onlyExplicit:s,searchedNamesAndModules:n}=K){if(e[0]==="*"){if(e.length===1){return[this.namespace]}const t=this.graph.modulesById.get(e.slice(1));return t.getVariableForExportName("*")}const r=this.reexportDescriptions.get(e);if(r){const[e]=getVariableForExportNameRecursive(r.module,r.localName,t,false,n);if(!e){return this.error(errorMissingExport(r.localName,this.id,r.module.id),r.start)}if(t){setAlternativeExporterIfCyclic(e,t,this);if(this.info.moduleSideEffects){getOrCreate(t.sideEffectDependenciesByVariable,e,getNewSet).add(this)}}return[e]}const o=this.exports.get(e);if(o){if(o===Vr){return[this.exportShimVariable]}const e=o.localName;const i=this.traceVariable(e,{importerForSideEffects:t,searchedNamesAndModules:n});if(t){setAlternativeExporterIfCyclic(i,t,this);getOrCreate(t.sideEffectDependenciesByVariable,i,getNewSet).add(this)}return[i]}if(s){return[null]}if(e!=="default"){const i=this.namespaceReexportsByName.get(e)??this.getVariableFromNamespaceReexports(e,t,n);this.namespaceReexportsByName.set(e,i);if(i[0]){return i}}if(this.info.syntheticNamedExports){return[getOrCreate(this.syntheticExports,e,(()=>new SyntheticNamedExportVariable(this.astContext,e,this.getSyntheticNamespace())))]}if(!i&&this.options.shimMissingExports){this.shimMissingExport(e);return[this.exportShimVariable]}return[null]}hasEffects(){return this.info.moduleSideEffects==="no-treeshake"||this.ast.hasCachedEffects()}include(){const e=createInclusionContext();if(this.ast.shouldBeIncluded(e))this.ast.include(e,false)}includeAllExports(e){if(!this.isExecuted){markModuleAndImpureDependenciesAsExecuted(this);this.graph.needsTreeshakingPass=true}for(const t of this.exports.keys()){if(e||t!==this.info.syntheticNamedExports){const e=this.getVariableForExportName(t)[0];e.deoptimizePath(oi);if(!e.included){this.includeVariable(e)}}}for(const e of this.getReexports()){const[t]=this.getVariableForExportName(e);if(t){t.deoptimizePath(oi);if(!t.included){this.includeVariable(t)}if(t instanceof ExternalVariable){t.module.reexported=true}}}if(e){this.namespace.setMergedNamespaces(this.includeAndGetAdditionalMergedNamespaces())}}includeAllInBundle(){this.ast.include(createInclusionContext(),true);this.includeAllExports(false)}includeExportsByNames(e){if(!this.isExecuted){markModuleAndImpureDependenciesAsExecuted(this);this.graph.needsTreeshakingPass=true}let t=false;for(const i of e){const e=this.getVariableForExportName(i)[0];if(e){e.deoptimizePath(oi);if(!e.included){this.includeVariable(e)}}if(!this.exports.has(i)&&!this.reexportDescriptions.has(i)){t=true}}if(t){this.namespace.setMergedNamespaces(this.includeAndGetAdditionalMergedNamespaces())}}isIncluded(){return this.ast&&(this.ast.included||this.namespace.included||this.importedFromNotTreeshaken||this.exportShimVariable.included)}linkImports(){this.addModulesToImportDescriptions(this.importDescriptions);this.addModulesToImportDescriptions(this.reexportDescriptions);const e=[];for(const t of this.exportAllSources){const i=this.graph.modulesById.get(this.resolvedIds[t].id);if(i instanceof ExternalModule){e.push(i);continue}this.exportAllModules.push(i)}this.exportAllModules.push(...e)}render(e){const t=this.magicString.clone();this.ast.render(t,e);t.trim();const{usesTopLevelAwait:i}=this.astContext;if(i&&e.format!=="es"&&e.format!=="system"){return error(errorInvalidFormatForTopLevelAwait(this.id,e.format))}return{source:t,usesTopLevelAwait:i}}setSource({ast:e,code:t,customTransformCache:i,originalCode:s,originalSourcemap:n,resolvedIds:r,sourcemapChain:o,transformDependencies:l,transformFiles:c,...u}){Lr("generate ast",3);this.info.code=t;this.originalCode=s;this.originalSourcemap=n;this.sourcemapChain=o;if(c){this.transformFiles=c}this.transformDependencies=l;this.customTransformCache=i;this.updateOptions(u);const h=e??this.tryParse();Br("generate ast",3);Lr("analyze ast",3);this.resolvedIds=r??Object.create(null);const d=this.id;this.magicString=new MagicString(t,{filename:this.excludeFromSourcemap?null:d,indentExclusionRanges:[]});this.astContext={addDynamicImport:this.addDynamicImport.bind(this),addExport:this.addExport.bind(this),addImport:this.addImport.bind(this),addImportMeta:this.addImportMeta.bind(this),code:t,deoptimizationTracker:this.graph.deoptimizationTracker,error:this.error.bind(this),fileName:d,getExports:this.getExports.bind(this),getModuleExecIndex:()=>this.execIndex,getModuleName:this.basename.bind(this),getNodeConstructor:e=>Or[e]||Or.UnknownNode,getReexports:this.getReexports.bind(this),importDescriptions:this.importDescriptions,includeAllExports:()=>this.includeAllExports(true),includeDynamicImport:this.includeDynamicImport.bind(this),includeVariableInModule:this.includeVariableInModule.bind(this),magicString:this.magicString,manualPureFunctions:this.graph.pureFunctions,module:this,moduleContext:this.context,options:this.options,requestTreeshakingPass:()=>this.graph.needsTreeshakingPass=true,traceExport:e=>this.getVariableForExportName(e)[0],traceVariable:this.traceVariable.bind(this),usesTopLevelAwait:false,warn:this.warn.bind(this)};this.scope=new ModuleScope(this.graph.scope,this.astContext);this.namespace=new NamespaceVariable(this.astContext);this.ast=new Program(h,{context:this.astContext,type:"Module"},this.scope);if(e||this.options.cache!==false){this.info.ast=h}else{Object.defineProperty(this.info,"ast",{get:()=>{if(this.graph.astLru.has(d)){return this.graph.astLru.get(d)}else{const e=this.tryParse();this.graph.astLru.set(d,e);return e}}})}Br("analyze ast",3)}toJSON(){return{assertions:this.info.assertions,ast:this.info.ast,code:this.info.code,customTransformCache:this.customTransformCache,dependencies:Array.from(this.dependencies,getId),id:this.id,meta:this.info.meta,moduleSideEffects:this.info.moduleSideEffects,originalCode:this.originalCode,originalSourcemap:this.originalSourcemap,resolvedIds:this.resolvedIds,sourcemapChain:this.sourcemapChain,syntheticNamedExports:this.info.syntheticNamedExports,transformDependencies:this.transformDependencies,transformFiles:this.transformFiles}}traceVariable(e,{importerForSideEffects:t,isExportAllSearch:i,searchedNamesAndModules:s}=K){const n=this.scope.variables.get(e);if(n){return n}const r=this.importDescriptions.get(e);if(r){const e=r.module;if(e instanceof Module&&r.name==="*"){return e.namespace}const[n]=getVariableForExportNameRecursive(e,r.name,t||this,i,s);if(!n){return this.error(errorMissingExport(r.name,this.id,e.id),r.start)}return n}return null}updateOptions({meta:e,moduleSideEffects:t,syntheticNamedExports:i}){if(t!=null){this.info.moduleSideEffects=t}if(i!=null){this.info.syntheticNamedExports=i}if(e!=null){Object.assign(this.info.meta,e)}}warn(e,t){this.addLocationToLogProps(e,t);this.options.onwarn(e)}addDynamicImport(e){let t=e.source;if(t instanceof TemplateLiteral){if(t.quasis.length===1&&t.quasis[0].value.cooked){t=t.quasis[0].value.cooked}}else if(t instanceof Literal&&typeof t.value==="string"){t=t.value}this.dynamicImports.push({argument:t,id:null,node:e,resolution:null})}addExport(e){if(e instanceof ExportDefaultDeclaration){this.exports.set("default",{identifier:e.variable.getAssignedVariableName(),localName:"default"})}else if(e instanceof ExportAllDeclaration){const t=e.source.value;this.addSource(t,e);if(e.exported){const i=e.exported.name;this.reexportDescriptions.set(i,{localName:"*",module:null,source:t,start:e.start})}else{this.exportAllSources.add(t)}}else if(e.source instanceof Literal){const t=e.source.value;this.addSource(t,e);for(const{exported:i,local:s,start:n}of e.specifiers){const e=i instanceof Literal?i.value:i.name;this.reexportDescriptions.set(e,{localName:s instanceof Literal?s.value:s.name,module:null,source:t,start:n})}}else if(e.declaration){const t=e.declaration;if(t instanceof VariableDeclaration){for(const e of t.declarations){for(const t of _s(e.id)){this.exports.set(t,{identifier:null,localName:t})}}}else{const e=t.id.name;this.exports.set(e,{identifier:null,localName:e})}}else{for(const{local:t,exported:i}of e.specifiers){const e=t.name;const s=i instanceof Identifier?i.name:i.value;this.exports.set(s,{identifier:null,localName:e})}}}addImport(e){const t=e.source.value;this.addSource(t,e);for(const i of e.specifiers){const e=i instanceof ImportDefaultSpecifier?"default":i instanceof ImportNamespaceSpecifier?"*":i.imported instanceof Identifier?i.imported.name:i.imported.value;this.importDescriptions.set(i.local.name,{module:null,name:e,source:t,start:i.start})}}addImportMeta(e){this.importMetas.push(e)}addLocationToLogProps(e,t){e.id=this.id;e.pos=t;let i=this.info.code;const s=locate(i,t,{offsetLine:1});if(s){let{column:n,line:r}=s;try{({column:n,line:r}=getOriginalLocation(this.sourcemapChain,{column:n,line:r}));i=this.originalCode}catch(e){this.options.onwarn(errorInvalidSourcemapForError(e,this.id,n,r,t))}augmentCodeLocation(e,{column:n,line:r},i,this.id)}}addModulesToImportDescriptions(e){for(const t of e.values()){const{id:e}=this.resolvedIds[t.source];t.module=this.graph.modulesById.get(e)}}addRelevantSideEffectDependencies(e,t,i){const s=new Set;const addSideEffectDependencies=n=>{for(const r of n){if(s.has(r)){continue}s.add(r);if(t.has(r)){e.add(r);continue}if(!(r.info.moduleSideEffects||i.has(r))){continue}if(r instanceof ExternalModule||r.hasEffects()){e.add(r);continue}addSideEffectDependencies(r.dependencies)}};addSideEffectDependencies(this.dependencies);addSideEffectDependencies(i)}addSource(e,t){const i=getAssertionsFromImportExportDeclaration(t.assertions);const s=this.sourcesWithAssertions.get(e);if(s){if(doAssertionsDiffer(s,i)){this.warn(errorInconsistentImportAssertions(s,i,e,this.id),t.start)}}else{this.sourcesWithAssertions.set(e,i)}}getVariableFromNamespaceReexports(e,t,i){let s=null;const n=new Map;const r=new Set;for(const o of this.exportAllModules){if(o.info.syntheticNamedExports===e){continue}const[l,c]=getVariableForExportNameRecursive(o,e,t,true,copyNameToModulesMap(i));if(o instanceof ExternalModule||c){r.add(l)}else if(l instanceof SyntheticNamedExportVariable){if(!s){s=l}}else if(l){n.set(l,o)}}if(n.size>0){const t=[...n];const i=t[0][0];if(t.length===1){return[i]}this.options.onwarn(errorNamespaceConflict(e,this.id,t.map((([,e])=>e.id))));return[null]}if(r.size>0){const t=[...r];const i=t[0];if(t.length>1){this.options.onwarn(errorAmbiguousExternalNamespaces(e,this.id,i.module.id,t.map((e=>e.module.id))))}return[i,true]}if(s){return[s]}return[null]}includeAndGetAdditionalMergedNamespaces(){const e=new Set;const t=new Set;for(const i of[this,...this.exportAllModules]){if(i instanceof ExternalModule){const[t]=i.getVariableForExportName("*");t.include();this.includedImports.add(t);e.add(t)}else if(i.info.syntheticNamedExports){const e=i.getSyntheticNamespace();e.include();this.includedImports.add(e);t.add(e)}}return[...t,...e]}includeDynamicImport(e){const t=this.dynamicImports.find((t=>t.node===e)).resolution;if(t instanceof Module){t.includedDynamicImporters.push(this);const i=this.options.treeshake?e.getDeterministicImportedNames():undefined;if(i){t.includeExportsByNames(i)}else{t.includeAllExports(true)}}}includeVariable(e){if(!e.included){e.include();this.graph.needsTreeshakingPass=true;const t=e.module;if(t instanceof Module){if(!t.isExecuted){markModuleAndImpureDependenciesAsExecuted(t)}if(t!==this){const t=getAndExtendSideEffectModules(e,this);for(const e of t){if(!e.isExecuted){markModuleAndImpureDependenciesAsExecuted(e)}}}}}}includeVariableInModule(e){this.includeVariable(e);const t=e.module;if(t&&t!==this){this.includedImports.add(e)}}shimMissingExport(e){this.options.onwarn(errorShimmedExport(this.id,e));this.exports.set(e,Vr)}tryParse(){try{return this.graph.contextParse(this.info.code)}catch(e){return this.error(errorParseError(e,this.id),e.pos)}}}function setAlternativeExporterIfCyclic(e,t,i){if(e.module instanceof Module&&e.module!==i){const s=e.module.cycles;if(s.size>0){const n=i.cycles;for(const r of n){if(s.has(r)){t.alternativeReexportModules.set(e,i);break}}}}}const copyNameToModulesMap=e=>e&&new Map(Array.from(e,(([e,t])=>[e,new Set(t)])));function removeJsExtension(e){return e.endsWith(".js")?e.slice(0,-3):e}function getCompleteAmdId(e,t){if(e.autoId){return`${e.basePath?e.basePath+"/":""}${removeJsExtension(t)}`}return e.id??""}function getExportBlock$1(e,t,i,s,n,r,o,l="return "){const{_:c,getDirectReturnFunction:u,getFunctionIntro:h,getPropertyAccess:d,n:p,s:f}=n;if(!i){return`${p}${p}${l}${getSingleDefaultExport(e,t,s,o,d)};`}let m="";for(const{defaultVariableName:e,importPath:n,isChunk:l,name:h,namedExportsMode:f,namespaceVariableName:g,reexports:y}of t){if(y&&i){for(const t of y){if(t.reexported!=="*"){const i=getReexportedImportName(h,t.imported,f,l,e,g,s,n,o,d);if(m)m+=p;if(t.imported!=="*"&&t.needsLiveBinding){const[e,s]=u([],{functionReturn:true,lineBreakIndent:null,name:null});m+=`Object.defineProperty(exports,${c}'${t.reexported}',${c}{${p}`+`${r}enumerable:${c}true,${p}`+`${r}get:${c}${e}${i}${s}${p}});`}else{m+=`exports${d(t.reexported)}${c}=${c}${i};`}}}}}for(const{exported:t,local:i}of e){const e=`exports${d(t)}`;const s=i;if(e!==s){if(m)m+=p;m+=`${e}${c}=${c}${s};`}}for(const{name:e,reexports:s}of t){if(s&&i){for(const t of s){if(t.reexported==="*"){if(m)m+=p;const i=`{${p}${r}if${c}(k${c}!==${c}'default'${c}&&${c}!exports.hasOwnProperty(k))${c}${getDefineProperty(e,t.needsLiveBinding,r,n)}${f}${p}}`;m+=`Object.keys(${e}).forEach(${h(["k"],{isAsync:false,name:null})}${i});`}}}}if(m){return`${p}${p}${m}`}return""}function getSingleDefaultExport(e,t,i,s,n){if(e.length>0){return e[0].local}else{for(const{defaultVariableName:e,importPath:r,isChunk:o,name:l,namedExportsMode:c,namespaceVariableName:u,reexports:h}of t){if(h){return getReexportedImportName(l,h[0].imported,c,o,e,u,i,r,s,n)}}}}function getReexportedImportName(e,t,i,s,n,r,o,l,c,u){if(t==="default"){if(!s){const t=o(l);const i=vr[t]?n:e;return isDefaultAProperty(t,c)?`${i}${u("default")}`:i}return i?`${e}${u("default")}`:e}if(t==="*"){return(s?!i:Sr[o(l)])?r:e}return`${e}${u(t)}`}function getEsModuleValue(e){return e([["value","true"]],{lineBreakIndent:null})}function getNamespaceMarkers(e,t,i,{_:s,getObject:n}){if(e){if(t){if(i){return`Object.defineProperties(exports,${s}${n([["__esModule",getEsModuleValue(n)],[null,`[Symbol.toStringTag]:${s}${getToStringTagValue(n)}`]],{lineBreakIndent:null})});`}return`Object.defineProperty(exports,${s}'__esModule',${s}${getEsModuleValue(n)});`}if(i){return`Object.defineProperty(exports,${s}Symbol.toStringTag,${s}${getToStringTagValue(n)});`}}return""}const getDefineProperty=(e,t,i,{_:s,getDirectReturnFunction:n,n:r})=>{if(t){const[t,o]=n([],{functionReturn:true,lineBreakIndent:null,name:null});return`Object.defineProperty(exports,${s}k,${s}{${r}`+`${i}${i}enumerable:${s}true,${r}`+`${i}${i}get:${s}${t}${e}[k]${o}${r}${i}})`}return`exports[k]${s}=${s}${e}[k]`};function getInteropBlock(e,t,i,s,n,r,o,l){const{_:c,cnst:u,n:h}=l;const d=new Set;const p=[];const addInteropStatement=(e,t,i)=>{d.add(t);p.push(`${u} ${e}${c}=${c}/*#__PURE__*/${t}(${i});`)};for(const{defaultVariableName:i,imports:s,importPath:n,isChunk:r,name:o,namedExportsMode:l,namespaceVariableName:c,reexports:u}of e){if(r){for(const{imported:e,reexported:t}of[...s||[],...u||[]]){if(e==="*"&&t!=="*"){if(!l){addInteropStatement(c,xr,o)}break}}}else{const e=t(n);let r=false;let l=false;for(const{imported:t,reexported:n}of[...s||[],...u||[]]){let s;let u;if(t==="default"){if(!r){r=true;if(i!==c){u=i;s=vr[e]}}}else if(t==="*"&&n!=="*"&&!l){l=true;s=Sr[e];u=c}if(s){addInteropStatement(u,s,o)}}}}return`${getHelpersBlock(d,r,o,l,i,s,n)}${p.length>0?`${p.join(h)}${h}${h}`:""}`}function addJsExtension(e){return e.endsWith(".js")?e:e+".js"}function updateExtensionForRelativeAmdId(e,t){if(e[0]!=="."){return e}return t?addJsExtension(e):removeJsExtension(e)}const zr=["assert","async_hooks","buffer","child_process","cluster","console","constants","crypto","dgram","diagnostics_channel","dns","domain","events","fs","http","http2","https","inspector","module","net","os","path","perf_hooks","process","punycode","querystring","readline","repl","stream","string_decoder","timers","tls","trace_events","tty","url","util","v8","vm","wasi","worker_threads","zlib"];var jr=zr;const Ur=getDefaultExportFromCjs(jr);const Hr=new Set([...Ur,"assert/strict","dns/promises","fs/promises","path/posix","path/win32","readline/promises","stream/consumers","stream/promises","stream/web","timers/promises","util/types"]);function warnOnBuiltins(e,t){const i=t.map((({importPath:e})=>e)).filter((e=>Hr.has(e)||e.startsWith("node:")));if(i.length===0)return;e(errorMissingNodeBuiltins(i))}function amd(e,{accessedGlobals:t,dependencies:i,exports:s,hasDefaultExport:n,hasExports:r,id:o,indent:l,intro:c,isEntryFacade:u,isModuleFacade:h,namedExportsMode:d,outro:p,snippets:f,onwarn:m},{amd:g,esModule:y,externalLiveBindings:E,freeze:x,interop:b,namespaceToStringTag:v,strict:S}){warnOnBuiltins(m,i);const A=i.map((e=>`'${updateExtensionForRelativeAmdId(e.importPath,g.forceJsExtensionForImports)}'`));const w=i.map((e=>e.name));const{n:I,getNonArrowFunctionIntro:k,_:C}=f;if(d&&r){w.unshift(`exports`);A.unshift(`'exports'`)}if(t.has("require")){w.unshift("require");A.unshift(`'require'`)}if(t.has("module")){w.unshift("module");A.unshift(`'module'`)}const _=getCompleteAmdId(g,o);const P=(_?`'${_}',${C}`:``)+(A.length>0?`[${A.join(`,${C}`)}],${C}`:``);const N=S?`${C}'use strict';`:"";e.prepend(`${c}${getInteropBlock(i,b,E,x,v,t,l,f)}`);const R=getExportBlock$1(s,i,d,b,f,l,E);let $=getNamespaceMarkers(d&&r,u&&(y===true||y==="if-default-prop"&&n),h&&v,f);if($){$=I+I+$}e.append(`${R}${$}${p}`).indent(l).prepend(`${g.define}(${P}(${k(w,{isAsync:false,name:null})}{${N}${I}${I}`).append(`${I}${I}}));`)}function cjs(e,{accessedGlobals:t,dependencies:i,exports:s,hasDefaultExport:n,hasExports:r,indent:o,intro:l,isEntryFacade:c,isModuleFacade:u,namedExportsMode:h,outro:d,snippets:p},{compact:f,esModule:m,externalLiveBindings:g,freeze:y,interop:E,namespaceToStringTag:x,strict:b}){const{_:v,n:S}=p;const A=b?`'use strict';${S}${S}`:"";let w=getNamespaceMarkers(h&&r,c&&(m===true||m==="if-default-prop"&&n),u&&x,p);if(w){w+=S+S}const I=getImportBlock$1(i,p,f);const k=getInteropBlock(i,E,g,y,x,t,o,p);e.prepend(`${A}${l}${w}${I}${k}`);const C=getExportBlock$1(s,i,h,E,p,o,g,`module.exports${v}=${v}`);e.append(`${C}${d}`)}function getImportBlock$1(e,{_:t,cnst:i,n:s},n){let r="";let o=false;for(const{importPath:l,name:c,reexports:u,imports:h}of e){if(!u&&!h){if(r){r+=n&&!o?",":`;${s}`}o=false;r+=`require('${l}')`}else{r+=n&&o?",":`${r?`;${s}`:""}${i} `;o=true;r+=`${c}${t}=${t}require('${l}')`}}if(r){return`${r};${s}${s}`}return""}function es(e,{accessedGlobals:t,indent:i,intro:s,outro:n,dependencies:r,exports:o,snippets:l},{externalLiveBindings:c,freeze:u,namespaceToStringTag:h}){const{n:d}=l;const p=getImportBlock(r,l);if(p.length>0)s+=p.join(d)+d+d;s+=getHelpersBlock(null,t,i,l,c,u,h);if(s)e.prepend(s);const f=getExportBlock(o,l);if(f.length>0)e.append(d+d+f.join(d).trim());if(n)e.append(n);e.trim()}function getImportBlock(e,{_:t}){const i=[];for(const{importPath:s,reexports:n,imports:r,name:o,assertions:l}of e){const e=l?`${t}assert${t}${l}`:"";const c=`'${s}'${e};`;if(!n&&!r){i.push(`import${t}${c}`);continue}if(r){let e=null;let s=null;const n=[];for(const t of r){if(t.imported==="default"){e=t}else if(t.imported==="*"){s=t}else{n.push(t)}}if(s){i.push(`import${t}*${t}as ${s.local} from${t}${c}`)}if(e&&n.length===0){i.push(`import ${e.local} from${t}${c}`)}else if(n.length>0){i.push(`import ${e?`${e.local},${t}`:""}{${t}${n.map((e=>e.imported===e.local?e.imported:`${e.imported} as ${e.local}`)).join(`,${t}`)}${t}}${t}from${t}${c}`)}}if(n){let e=null;const s=[];const l=[];for(const t of n){if(t.reexported==="*"){e=t}else if(t.imported==="*"){s.push(t)}else{l.push(t)}}if(e){i.push(`export${t}*${t}from${t}${c}`)}if(s.length>0){if(!r||!r.some((e=>e.imported==="*"&&e.local===o))){i.push(`import${t}*${t}as ${o} from${t}${c}`)}for(const e of s){i.push(`export${t}{${t}${o===e.reexported?o:`${o} as ${e.reexported}`} };`)}}if(l.length>0){i.push(`export${t}{${t}${l.map((e=>e.imported===e.reexported?e.imported:`${e.imported} as ${e.reexported}`)).join(`,${t}`)}${t}}${t}from${t}${c}`)}}}return i}function getExportBlock(e,{_:t,cnst:i}){const s=[];const n=[];for(const r of e){if(r.expression){s.push(`${i} ${r.local}${t}=${t}${r.expression};`)}n.push(r.exported===r.local?r.local:`${r.local} as ${r.exported}`)}if(n.length>0){s.push(`export${t}{${t}${n.join(`,${t}`)}${t}};`)}return s}const keypath=(e,t)=>e.split(".").map(t).join("");function setupNamespace(e,t,i,{_:s,getPropertyAccess:n,s:r},o){const l=e.split(".");l[0]=(typeof i==="function"?i(l[0]):i[l[0]])||l[0];l.pop();let c=t;return l.map((e=>{c+=n(e);return`${c}${s}=${s}${c}${s}||${s}{}${r}`})).join(o?",":"\n")+(o&&l.length>0?";":"\n")}function assignToDeepVariable(e,t,i,s,{_:n,getPropertyAccess:r}){const o=e.split(".");o[0]=(typeof i==="function"?i(o[0]):i[o[0]])||o[0];const l=o.pop();let c=t;let u=[...o.map((e=>{c+=r(e);return`${c}${n}=${n}${c}${n}||${n}{}`})),`${c}${r(l)}`].join(`,${n}`)+`${n}=${n}${s}`;if(o.length>0){u=`(${u})`}return u}function trimEmptyImports(e){let t=e.length;while(t--){const{imports:i,reexports:s}=e[t];if(i||s){return e.slice(0,t+1)}}return[]}function iife(e,{accessedGlobals:t,dependencies:i,exports:s,hasDefaultExport:n,hasExports:r,indent:o,intro:l,namedExportsMode:c,outro:u,snippets:h,onwarn:d},{compact:p,esModule:f,extend:m,freeze:g,externalLiveBindings:y,globals:E,interop:x,name:b,namespaceToStringTag:v,strict:S}){const{_:A,getNonArrowFunctionIntro:w,getPropertyAccess:I,n:k}=h;const C=b&&b.includes(".");const _=!m&&!C;if(b&&_&&!isLegal(b)){return error(errorIllegalIdentifierAsName(b))}warnOnBuiltins(d,i);const P=trimEmptyImports(i);const N=P.map((e=>e.globalName||"null"));const R=P.map((e=>e.name));if(r&&!b){d(errorMissingNameOptionForIifeExport())}if(c&&r){if(m){N.unshift(`this${keypath(b,I)}${A}=${A}this${keypath(b,I)}${A}||${A}{}`);R.unshift("exports")}else{N.unshift("{}");R.unshift("exports")}}const $=S?`${o}'use strict';${k}`:"";const O=getInteropBlock(i,x,y,g,v,t,o,h);e.prepend(`${l}${O}`);let T=`(${w(R,{isAsync:false,name:null})}{${k}${$}${k}`;if(r){if(b&&!(m&&c)){T=(_?`var ${b}`:`this${keypath(b,I)}`)+`${A}=${A}${T}`}if(C){T=setupNamespace(b,"this",E,h,p)+T}}let D=`${k}${k}})(${N.join(`,${A}`)});`;if(r&&!m&&c){D=`${k}${k}${o}return exports;${D}`}const M=getExportBlock$1(s,i,c,x,h,o,y);let L=getNamespaceMarkers(c&&r,f===true||f==="if-default-prop"&&n,v,h);if(L){L=k+k+L}e.append(`${M}${L}${u}`).indent(o).prepend(T).append(D)}function system(e,{accessedGlobals:t,dependencies:i,exports:s,hasExports:n,indent:r,intro:o,snippets:l,outro:c,usesTopLevelAwait:u},{externalLiveBindings:h,freeze:d,name:p,namespaceToStringTag:f,strict:m,systemNullSetters:g}){const{_:y,getFunctionIntro:E,getNonArrowFunctionIntro:x,n:b,s:v}=l;const{importBindings:S,setters:A,starExcludes:w}=analyzeDependencies(i,s,r,l);const I=p?`'${p}',${y}`:"";const k=t.has("module")?["exports","module"]:n?["exports"]:[];let C=`System.register(${I}[`+i.map((({importPath:e})=>`'${e}'`)).join(`,${y}`)+`],${y}(${x(k,{isAsync:false,name:null})}{${b}${r}${m?"'use strict';":""}`+getStarExcludesBlock(w,r,l)+getImportBindingsBlock(S,r,l)+`${b}${r}return${y}{${A.length>0?`${b}${r}${r}setters:${y}[${A.map((e=>e?`${E(["module"],{isAsync:false,name:null})}{${b}${r}${r}${r}${e}${b}${r}${r}}`:g?`null`:`${E([],{isAsync:false,name:null})}{}`)).join(`,${y}`)}],`:""}${b}`;C+=`${r}${r}execute:${y}(${x([],{isAsync:u,name:null})}{${b}${b}`;const _=`${r}${r}})${b}${r}}${v}${b}}));`;e.prepend(o+getHelpersBlock(null,t,r,l,h,d,f)+getHoistedExportsBlock(s,r,l)).append(`${c}${b}${b}`+getSyntheticExportsBlock(s,r,l)+getMissingExportsBlock(s,r,l)).indent(`${r}${r}${r}`).append(_).prepend(C)}function analyzeDependencies(e,t,i,{_:s,cnst:n,getObject:r,getPropertyAccess:o,n:l}){const c=[];const u=[];let h=null;for(const{imports:d,reexports:p}of e){const f=[];if(d){for(const e of d){c.push(e.local);if(e.imported==="*"){f.push(`${e.local}${s}=${s}module;`)}else{f.push(`${e.local}${s}=${s}module${o(e.imported)};`)}}}if(p){const l=[];let c=false;for(const{imported:e,reexported:t}of p){if(t==="*"){c=true}else{l.push([t,e==="*"?"module":`module${o(e)}`])}}if(l.length>1||c){const o=r(l,{lineBreakIndent:null});if(c){if(!h){h=getStarExcludes({dependencies:e,exports:t})}f.push(`${n} setter${s}=${s}${o};`,`for${s}(${n} name in module)${s}{`,`${i}if${s}(!_starExcludes[name])${s}setter[name]${s}=${s}module[name];`,"}","exports(setter);")}else{f.push(`exports(${o});`)}}else{const[e,t]=l[0];f.push(`exports('${e}',${s}${t});`)}}u.push(f.join(`${l}${i}${i}${i}`))}return{importBindings:c,setters:u,starExcludes:h}}const getStarExcludes=({dependencies:e,exports:t})=>{const i=new Set(t.map((e=>e.exported)));i.add("default");for(const{reexports:t}of e){if(t){for(const e of t){if(e.reexported!=="*")i.add(e.reexported)}}}return i};const getStarExcludesBlock=(e,t,{_:i,cnst:s,getObject:n,n:r})=>e?`${r}${t}${s} _starExcludes${i}=${i}${n([...e].map((e=>[e,"1"])),{lineBreakIndent:{base:t,t:t}})};`:"";const getImportBindingsBlock=(e,t,{_:i,n:s})=>e.length>0?`${s}${t}var ${e.join(`,${i}`)};`:"";const getHoistedExportsBlock=(e,t,i)=>getExportsBlock(e.filter((e=>e.hoisted)).map((e=>({name:e.exported,value:e.local}))),t,i);function getExportsBlock(e,t,{_:i,n:s}){if(e.length===0){return""}if(e.length===1){return`exports('${e[0].name}',${i}${e[0].value});${s}${s}`}return`exports({${s}`+e.map((({name:e,value:s})=>`${t}${e}:${i}${s}`)).join(`,${s}`)+`${s}});${s}${s}`}const getSyntheticExportsBlock=(e,t,i)=>getExportsBlock(e.filter((e=>e.expression)).map((e=>({name:e.exported,value:e.local}))),t,i);const getMissingExportsBlock=(e,t,i)=>getExportsBlock(e.filter((e=>e.local===Tr)).map((e=>({name:e.exported,value:Tr}))),t,i);function globalProperty(e,t,i){if(!e)return"null";return`${t}${keypath(e,i)}`}function safeAccess(e,t,{_:i,getPropertyAccess:s}){let n=t;return e.split(".").map((e=>n+=s(e))).join(`${i}&&${i}`)}function umd(e,{accessedGlobals:t,dependencies:i,exports:s,hasDefaultExport:n,hasExports:r,id:o,indent:l,intro:c,namedExportsMode:u,outro:h,snippets:d,onwarn:p},{amd:f,compact:m,esModule:g,extend:y,externalLiveBindings:E,freeze:x,interop:b,name:v,namespaceToStringTag:S,globals:A,noConflict:w,strict:I}){const{_:k,cnst:C,getFunctionIntro:_,getNonArrowFunctionIntro:P,getPropertyAccess:N,n:R,s:$}=d;const O=m?"f":"factory";const T=m?"g":"global";if(r&&!v){return error(errorMissingNameOptionForUmdExport())}warnOnBuiltins(p,i);const D=i.map((e=>`'${updateExtensionForRelativeAmdId(e.importPath,f.forceJsExtensionForImports)}'`));const M=i.map((e=>`require('${e.importPath}')`));const L=trimEmptyImports(i);const B=L.map((e=>globalProperty(e.globalName,T,N)));const F=L.map((e=>e.name));if(u&&(r||w)){D.unshift(`'exports'`);M.unshift(`exports`);B.unshift(assignToDeepVariable(v,T,A,`${y?`${globalProperty(v,T,N)}${k}||${k}`:""}{}`,d));F.unshift("exports")}const V=getCompleteAmdId(f,o);const z=(V?`'${V}',${k}`:``)+(D.length>0?`[${D.join(`,${k}`)}],${k}`:``);const j=f.define;const U=!u&&r?`module.exports${k}=${k}`:``;const H=I?`${k}'use strict';${R}`:``;let G;if(w){const e=m?"e":"exports";let t;if(!u&&r){t=`${C} ${e}${k}=${k}${assignToDeepVariable(v,T,A,`${O}(${B.join(`,${k}`)})`,d)};`}else{const i=B.shift();t=`${C} ${e}${k}=${k}${i};${R}`+`${l}${l}${O}(${[e,...B].join(`,${k}`)});`}G=`(${_([],{isAsync:false,name:null})}{${R}`+`${l}${l}${C} current${k}=${k}${safeAccess(v,T,d)};${R}`+`${l}${l}${t}${R}`+`${l}${l}${e}.noConflict${k}=${k}${_([],{isAsync:false,name:null})}{${k}`+`${globalProperty(v,T,N)}${k}=${k}current;${k}return ${e}${$}${k}};${R}`+`${l}})()`}else{G=`${O}(${B.join(`,${k}`)})`;if(!u&&r){G=assignToDeepVariable(v,T,A,G,d)}}const W=r||w&&u||B.length>0;const q=[O];if(W){q.unshift(T)}const K=W?`this,${k}`:"";const Y=W?`(${T}${k}=${k}typeof globalThis${k}!==${k}'undefined'${k}?${k}globalThis${k}:${k}${T}${k}||${k}self,${k}`:"";const Q=W?")":"";const X=W?`${l}typeof exports${k}===${k}'object'${k}&&${k}typeof module${k}!==${k}'undefined'${k}?`+`${k}${U}${O}(${M.join(`,${k}`)})${k}:${R}`:"";const Z=`(${P(q,{isAsync:false,name:null})}{${R}`+X+`${l}typeof ${j}${k}===${k}'function'${k}&&${k}${j}.amd${k}?${k}${j}(${z}${O})${k}:${R}`+`${l}${Y}${G}${Q};${R}`+`})(${K}(${P(F,{isAsync:false,name:null})}{${H}${R}`;const J=R+R+"}));";e.prepend(`${c}${getInteropBlock(i,b,E,x,S,t,l,d)}`);const ee=getExportBlock$1(s,i,u,b,d,l,E);let te=getNamespaceMarkers(u&&r,g===true||g==="if-default-prop"&&n,S,d);if(te){te=R+R+te}e.append(`${ee}${te}${h}`).trim().indent(l).append(J).prepend(Z)}const Gr={amd:amd,cjs:cjs,es:es,iife:iife,system:system,umd:umd};const concatSeparator=(e,t)=>t?`${e}\n${t}`:e;const concatDblSeparator=(e,t)=>t?`${e}\n\n${t}`:e;async function createAddons(e,t,i){try{let[s,n,r,o]=await Promise.all([t.hookReduceValue("banner",e.banner(i),[i],concatSeparator),t.hookReduceValue("footer",e.footer(i),[i],concatSeparator),t.hookReduceValue("intro",e.intro(i),[i],concatDblSeparator),t.hookReduceValue("outro",e.outro(i),[i],concatDblSeparator)]);if(r)r+="\n\n";if(o)o=`\n\n${o}`;if(s)s+="\n";if(n)n="\n"+n;return{banner:s,footer:n,intro:r,outro:o}}catch(e){return error(errorAddonNotGenerated(e.message,e.hook,e.plugin))}}const Wr={amd:deconflictImportsOther,cjs:deconflictImportsOther,es:deconflictImportsEsmOrSystem,iife:deconflictImportsOther,system:deconflictImportsEsmOrSystem,umd:deconflictImportsOther};function deconflictChunk(e,t,i,s,n,r,o,l,c,u,h,d,p,f){const m=[...e].reverse();for(const e of m){e.scope.addUsedOutsideNames(s,n,d,p)}deconflictTopLevelVariables(s,m,f);Wr[n](s,i,t,r,o,l,c,u,h);for(const e of m){e.scope.deconflict(n,d,p)}}function deconflictImportsEsmOrSystem(e,t,i,s,n,r,o,l,c){for(const t of i.dependencies){if(n||t instanceof ExternalChunk){t.variableName=getSafeName(t.suggestedVariableName,e,null)}}for(const i of t){const t=i.module;const s=i.name;if(i.isNamespace&&(n||t instanceof ExternalModule)){i.setRenderNames(null,(t instanceof ExternalModule?l.get(t):o.get(t)).variableName)}else if(t instanceof ExternalModule&&s==="default"){i.setRenderNames(null,getSafeName([...t.exportedVariables].some((([e,t])=>t==="*"&&e.included))?t.suggestedVariableName+"__default":t.suggestedVariableName,e,i.forbiddenNames))}else{i.setRenderNames(null,getSafeName(s,e,i.forbiddenNames))}}for(const t of c){t.setRenderNames(null,getSafeName(t.name,e,t.forbiddenNames))}}function deconflictImportsOther(e,t,{deconflictedDefault:i,deconflictedNamespace:s,dependencies:n},r,o,l,c,u){for(const t of n){t.variableName=getSafeName(t.suggestedVariableName,e,null)}for(const t of s){t.namespaceVariableName=getSafeName(`${t.suggestedVariableName}__namespace`,e,null)}for(const t of i){t.defaultVariableName=s.has(t)&&canDefaultBeTakenFromNamespace(r(t.id),l)?t.namespaceVariableName:getSafeName(`${t.suggestedVariableName}__default`,e,null)}for(const e of t){const t=e.module;if(t instanceof ExternalModule){const i=u.get(t);const s=e.name;if(s==="default"){const s=r(t.id);const n=vr[s]?i.defaultVariableName:i.variableName;if(isDefaultAProperty(s,l)){e.setRenderNames(n,"default")}else{e.setRenderNames(null,n)}}else if(s==="*"){e.setRenderNames(null,Sr[r(t.id)]?i.namespaceVariableName:i.variableName)}else{e.setRenderNames(i.variableName,null)}}else{const i=c.get(t);if(o&&e.isNamespace){e.setRenderNames(null,i.exportMode==="default"?i.namespaceVariableName:i.variableName)}else if(i.exportMode==="default"){e.setRenderNames(null,i.variableName)}else{e.setRenderNames(i.variableName,i.getVariableExportName(e))}}}}function deconflictTopLevelVariables(e,t,i){for(const s of t){for(const t of s.scope.variables.values()){if(t.included&&!(t.renderBaseName||t instanceof ExportDefaultVariable&&t.getOriginalVariable()!==t)){t.setRenderNames(null,getSafeName(t.name,e,t.forbiddenNames))}}if(i.has(s)){const t=s.namespace;t.setRenderNames(null,getSafeName(t.name,e,t.forbiddenNames))}}}function assignExportsToMangledNames(e,t,i){let s=0;for(const n of e){let[e]=n.name;if(t.has(e)){do{e=toBase64(++s);if(e.charCodeAt(0)===49){s+=9*64**(e.length-1);e=toBase64(s)}}while(Si.has(e)||t.has(e))}t.set(e,n);i.set(n,[e])}}function assignExportsToNames(e,t,i){for(const s of e){let e=0;let n=s.name;while(t.has(n)){n=s.name+"$"+ ++e}t.set(n,s);i.set(s,[n])}}function getExportMode(e,{exports:t,name:i,format:s},n,r){const o=e.getExportNames();if(t==="default"){if(o.length!==1||o[0]!=="default"){return error(errorIncompatibleExportOptionValue("default",o,n))}}else if(t==="none"&&o.length>0){return error(errorIncompatibleExportOptionValue("none",o,n))}if(t==="auto"){if(o.length===0){t="none"}else if(o.length===1&&o[0]==="default"){t="default"}else{if(s!=="es"&&s!=="system"&&o.includes("default")){r(errorMixedExport(n,i))}t="named"}}return t}function guessIndentString(e){const t=e.split("\n");const i=t.filter((e=>/^\t+/.test(e)));const s=t.filter((e=>/^ {2,}/.test(e)));if(i.length===0&&s.length===0){return null}if(i.length>=s.length){return"\t"}const n=s.reduce(((e,t)=>{const i=/^ +/.exec(t)[0].length;return Math.min(i,e)}),Infinity);return" ".repeat(n)}function getIndentString(e,t){if(t.indent!==true)return t.indent;for(const t of e){const e=guessIndentString(t.originalCode);if(e!==null)return e}return"\t"}function getStaticDependencies(e,t,i,s){const n=[];const r=new Set;for(let o=t.length-1;o>=0;o--){const l=t[o];if(!r.has(l)){const t=[];addStaticDependencies(l,t,r,e,i,s);n.unshift(t)}}const o=new Set;for(const e of n){for(const t of e){o.add(t)}}return o}function addStaticDependencies(e,t,i,s,n,r){const o=e.getDependenciesToBeIncluded();for(const e of o){if(e instanceof ExternalModule){t.push(r.get(e));continue}const o=n.get(e);if(o!==s){t.push(o);continue}if(!i.has(e)){i.add(e);addStaticDependencies(e,t,i,s,n,r)}}}const qr="!~{";const Kr="}~";const Yr=qr.length+Kr.length;const Qr=64;const Xr=8;const getHashPlaceholderGenerator=()=>{let e=0;return(t,i=Xr)=>{if(i>Qr){return error(errorFailedValidation(`Hashes cannot be longer than ${Qr} characters, received ${i}. Check the "${t}" option.`))}const s=`${qr}${toBase64(++e).padStart(i-Yr,"0")}${Kr}`;if(s.length>i){return error(errorFailedValidation(`To generate hashes for this number of chunks (currently ${e}), you need a minimum hash size of ${s.length}, received ${i}. Check the "${t}" option.`))}return s}};const Zr=new RegExp(`${qr}[0-9a-zA-Z_$]{1,${Qr-Yr}}${Kr}`,"g");const replacePlaceholders=(e,t)=>e.replace(Zr,(e=>t.get(e)||e));const replaceSinglePlaceholder=(e,t,i)=>e.replace(Zr,(e=>e===t?i:e));const replacePlaceholdersWithDefaultAndGetContainedPlaceholders=(e,t)=>{const i=new Set;const s=e.replace(Zr,(e=>{if(t.has(e)){i.add(e);return`${qr}${"0".repeat(e.length-Yr)}${Kr}`}return e}));return{containedPlaceholders:i,transformedCode:s}};const Jr=Symbol("bundleKeys");const eo={type:"placeholder"};const getOutputBundle=e=>{const t=new Set;return new Proxy(e,{deleteProperty(e,i){if(typeof i==="string"){t.delete(i.toLowerCase())}return Reflect.deleteProperty(e,i)},get(e,i){if(i===Jr){return t}return Reflect.get(e,i)},set(e,i,s){if(typeof i==="string"){t.add(i.toLowerCase())}return Reflect.set(e,i,s)}})};const removeUnreferencedAssets=e=>{const t=new Set;const i=Object.values(e);for(const e of i){e.type==="asset"&&e.needsCodeReference&&t.add(e.fileName)}for(const e of i){if(e.type==="chunk"){for(const i of e.referencedFiles){t.has(i)&&t.delete(i)}}}for(const i of t){delete e[i]}};function renderNamePattern(e,t,i){if(isPathFragment(e))return error(errorFailedValidation(`Invalid pattern "${e}" for "${t}", patterns can be neither absolute nor relative paths. If you want your files to be stored in a subdirectory, write its name without a leading slash like this: subdirectory/pattern.`));return e.replace(/\[(\w+)(:\d+)?]/g,((e,s,n)=>{if(!i.hasOwnProperty(s)||n&&s!=="hash"){return error(errorFailedValidation(`"[${s}${n||""}]" is not a valid placeholder in the "${t}" pattern.`))}const r=i[s](n&&Number.parseInt(n.slice(1)));if(isPathFragment(r))return error(errorFailedValidation(`Invalid substitution "${r}" for placeholder "[${s}]" in "${t}" pattern, can be neither absolute nor relative path.`));return r}))}function makeUnique(e,{[Jr]:t}){if(!t.has(e.toLowerCase()))return e;const i=r.extname(e);e=e.slice(0,Math.max(0,e.length-i.length));let s,n=1;while(t.has((s=e+ ++n+i).toLowerCase()));return s}const to=new Set([".js",".jsx",".ts",".tsx",".mjs",".mts",".cjs",".cts"]);function getGlobalName(e,t,i,s){const n=typeof t==="function"?t(e.id):t[e.id];if(n){return n}if(i){s(errorMissingGlobalName(e.id,e.variableName));return e.variableName}}class Chunk{constructor(e,t,i,s,n,r,o,l,c,u,h,d,p,f,m){this.orderedModules=e;this.inputOptions=t;this.outputOptions=i;this.unsetOptions=s;this.pluginDriver=n;this.modulesById=r;this.chunkByModule=o;this.externalChunkByModule=l;this.facadeChunkByModule=c;this.includedNamespaces=u;this.manualChunkAlias=h;this.getPlaceholder=d;this.bundle=p;this.inputBase=f;this.snippets=m;this.entryModules=[];this.exportMode="named";this.facadeModule=null;this.namespaceVariableName="";this.variableName="";this.accessedGlobalsByScope=new Map;this.dependencies=new Set;this.dynamicEntryModules=[];this.dynamicName=null;this.exportNamesByVariable=new Map;this.exports=new Set;this.exportsByName=new Map;this.fileName=null;this.implicitEntryModules=[];this.implicitlyLoadedBefore=new Set;this.imports=new Set;this.includedDynamicImports=null;this.includedReexportsByModule=new Map;this.isEmpty=true;this.name=null;this.needsExportsShim=false;this.preRenderedChunkInfo=null;this.preliminaryFileName=null;this.renderedChunkInfo=null;this.renderedDependencies=null;this.renderedModules=Object.create(null);this.sortedExportNames=null;this.strictFacade=false;this.execIndex=e.length>0?e[0].execIndex:Infinity;const g=new Set(e);for(const t of e){o.set(t,this);if(t.namespace.included&&!i.preserveModules){u.add(t)}if(this.isEmpty&&t.isIncluded()){this.isEmpty=false}if(t.info.isEntry||i.preserveModules){this.entryModules.push(t)}for(const e of t.includedDynamicImporters){if(!g.has(e)){this.dynamicEntryModules.push(t);if(t.info.syntheticNamedExports){u.add(t);this.exports.add(t.namespace)}}}if(t.implicitlyLoadedAfter.size>0){this.implicitEntryModules.push(t)}}this.suggestedVariableName=makeLegal(this.generateVariableName())}static generateFacade(e,t,i,s,n,r,o,l,c,u,h,d,p,f,m){const g=new Chunk([],e,t,i,s,n,r,o,l,c,null,d,p,f,m);g.assignFacadeName(h,u);if(!l.has(u)){l.set(u,g)}for(const e of u.getDependenciesToBeIncluded()){g.dependencies.add(e instanceof Module?r.get(e):o.get(e))}if(!g.dependencies.has(r.get(u))&&u.info.moduleSideEffects&&u.hasEffects()){g.dependencies.add(r.get(u))}g.ensureReexportsAreAvailableForModule(u);g.facadeModule=u;g.strictFacade=true;return g}canModuleBeFacade(e,t){const i=e.getExportNamesByVariable();for(const e of this.exports){if(!i.has(e)){return false}}for(const s of t){if(!(s.module===e||i.has(s)||s instanceof SyntheticNamedExportVariable&&i.has(s.getBaseVariable()))){return false}}return true}finalizeChunk(e,t,i){const s=this.getRenderedChunkInfo();const finalize=e=>replacePlaceholders(e,i);const n=this.fileName=finalize(s.fileName);return{...s,code:e,dynamicImports:s.dynamicImports.map(finalize),fileName:n,implicitlyLoadedBefore:s.implicitlyLoadedBefore.map(finalize),importedBindings:Object.fromEntries(Object.entries(s.importedBindings).map((([e,t])=>[finalize(e),t]))),imports:s.imports.map(finalize),map:t,referencedFiles:s.referencedFiles.map(finalize)}}generateExports(){this.sortedExportNames=null;const e=new Set(this.exports);if(this.facadeModule!==null&&(this.facadeModule.preserveSignature!==false||this.strictFacade)){const t=this.facadeModule.getExportNamesByVariable();for(const[i,s]of t){this.exportNamesByVariable.set(i,[...s]);for(const e of s){this.exportsByName.set(e,i)}e.delete(i)}}if(this.outputOptions.minifyInternalExports){assignExportsToMangledNames(e,this.exportsByName,this.exportNamesByVariable)}else{assignExportsToNames(e,this.exportsByName,this.exportNamesByVariable)}if(this.outputOptions.preserveModules||this.facadeModule&&this.facadeModule.info.isEntry)this.exportMode=getExportMode(this,this.outputOptions,this.facadeModule.id,this.inputOptions.onwarn)}generateFacades(){const e=[];const t=new Set([...this.entryModules,...this.implicitEntryModules]);const i=new Set(this.dynamicEntryModules.map((({namespace:e})=>e)));for(const e of t){if(e.preserveSignature){for(const t of e.getExportNamesByVariable().keys()){if(this.chunkByModule.get(t.module)===this){i.add(t)}}}}for(const s of t){const t=Array.from(new Set(s.chunkNames.filter((({isUserDefined:e})=>e)).map((({name:e})=>e))),(e=>({name:e})));if(t.length===0&&s.isUserDefinedEntryPoint){t.push({})}t.push(...Array.from(s.chunkFileNames,(e=>({fileName:e}))));if(t.length===0){t.push({})}if(!this.facadeModule){const e=!this.outputOptions.preserveModules&&(s.preserveSignature==="strict"||s.preserveSignature==="exports-only"&&s.getExportNamesByVariable().size>0);if(!e||this.canModuleBeFacade(s,i)){this.facadeModule=s;this.facadeChunkByModule.set(s,this);if(s.preserveSignature){this.strictFacade=e}this.assignFacadeName(t.shift(),s,this.outputOptions.preserveModules)}}for(const i of t){e.push(Chunk.generateFacade(this.inputOptions,this.outputOptions,this.unsetOptions,this.pluginDriver,this.modulesById,this.chunkByModule,this.externalChunkByModule,this.facadeChunkByModule,this.includedNamespaces,s,i,this.getPlaceholder,this.bundle,this.inputBase,this.snippets))}}for(const e of this.dynamicEntryModules){if(e.info.syntheticNamedExports)continue;if(!this.facadeModule&&this.canModuleBeFacade(e,i)){this.facadeModule=e;this.facadeChunkByModule.set(e,this);this.strictFacade=true;this.dynamicName=getChunkNameFromModule(e)}else if(this.facadeModule===e&&!this.strictFacade&&this.canModuleBeFacade(e,i)){this.strictFacade=true}else if(!this.facadeChunkByModule.get(e)?.strictFacade){this.includedNamespaces.add(e);this.exports.add(e.namespace)}}if(!this.outputOptions.preserveModules){this.addNecessaryImportsForFacades()}return e}getChunkName(){return this.name??(this.name=this.outputOptions.sanitizeFileName(this.getFallbackChunkName()))}getExportNames(){return this.sortedExportNames??(this.sortedExportNames=[...this.exportsByName.keys()].sort())}getFileName(){return this.fileName||this.getPreliminaryFileName().fileName}getImportPath(e){return escapeId(getImportPath(e,this.getFileName(),this.outputOptions.format==="amd"&&!this.outputOptions.amd.forceJsExtensionForImports,true))}getPreliminaryFileName(){if(this.preliminaryFileName){return this.preliminaryFileName}let e;let t=null;const{chunkFileNames:i,entryFileNames:s,file:n,format:o,preserveModules:l}=this.outputOptions;if(n){e=r.basename(n)}else if(this.fileName===null){const[n,r]=l||this.facadeModule?.isUserDefinedEntryPoint?[s,"output.entryFileNames"]:[i,"output.chunkFileNames"];e=renderNamePattern(typeof n==="function"?n(this.getPreRenderedChunkInfo()):n,r,{format:()=>o,hash:e=>t||(t=this.getPlaceholder(r,e)),name:()=>this.getChunkName()});if(!t){e=makeUnique(e,this.bundle)}}else{e=this.fileName}if(!t){this.bundle[e]=eo}return this.preliminaryFileName={fileName:e,hashPlaceholder:t}}getRenderedChunkInfo(){if(this.renderedChunkInfo){return this.renderedChunkInfo}return this.renderedChunkInfo={...this.getPreRenderedChunkInfo(),dynamicImports:this.getDynamicDependencies().map(resolveFileName),fileName:this.getFileName(),implicitlyLoadedBefore:Array.from(this.implicitlyLoadedBefore,resolveFileName),importedBindings:getImportedBindingsPerDependency(this.getRenderedDependencies(),resolveFileName),imports:Array.from(this.dependencies,resolveFileName),modules:this.renderedModules,referencedFiles:this.getReferencedFiles()}}getVariableExportName(e){if(this.outputOptions.preserveModules&&e instanceof NamespaceVariable){return"*"}return this.exportNamesByVariable.get(e)[0]}link(){this.dependencies=getStaticDependencies(this,this.orderedModules,this.chunkByModule,this.externalChunkByModule);for(const e of this.orderedModules){this.addImplicitlyLoadedBeforeFromModule(e);this.setUpChunkImportsAndExportsForModule(e)}}async render(){const{dependencies:e,exportMode:t,facadeModule:i,inputOptions:{onwarn:s},outputOptions:n,pluginDriver:r,snippets:o}=this;const{format:l,hoistTransitiveImports:c,preserveModules:u}=n;if(c&&!u&&i!==null){for(const t of e){if(t instanceof Chunk)this.inlineChunkDependencies(t)}}const h=this.getPreliminaryFileName();const{accessedGlobals:d,indent:p,magicString:f,renderedSource:m,usedModules:g,usesTopLevelAwait:y}=this.renderModules(h.fileName);const E=[...this.getRenderedDependencies().values()];const x=t==="none"?[]:this.getChunkExportDeclarations(l);let b=x.length>0;let v=false;for(const e of E){const{reexports:t}=e;if(t?.length){b=true;if(!v&&t.some((e=>e.reexported==="default"))){v=true}if(l==="es"){e.reexports=t.filter((({reexported:e})=>!x.find((({exported:t})=>t===e))))}}}if(!v){for(const{exported:e}of x){if(e==="default"){v=true;break}}}const{intro:S,outro:A,banner:w,footer:I}=await createAddons(n,r,this.getRenderedChunkInfo());Gr[l](m,{accessedGlobals:d,dependencies:E,exports:x,hasDefaultExport:v,hasExports:b,id:h.fileName,indent:p,intro:S,isEntryFacade:u||i!==null&&i.info.isEntry,isModuleFacade:i!==null,namedExportsMode:t!=="default",onwarn:s,outro:A,snippets:o,usesTopLevelAwait:y},n);if(w)f.prepend(w);if(I)f.append(I);return{chunk:this,magicString:f,preliminaryFileName:h,usedModules:g}}addImplicitlyLoadedBeforeFromModule(e){const{chunkByModule:t,implicitlyLoadedBefore:i}=this;for(const s of e.implicitlyLoadedBefore){const e=t.get(s);if(e&&e!==this){i.add(e)}}}addNecessaryImportsForFacades(){for(const[e,t]of this.includedReexportsByModule){if(this.includedNamespaces.has(e)){for(const e of t){this.imports.add(e)}}}}assignFacadeName({fileName:e,name:t},i,s){if(e){this.fileName=e}else{this.name=this.outputOptions.sanitizeFileName(t||(s?this.getPreserveModulesChunkNameFromModule(i):getChunkNameFromModule(i)))}}checkCircularDependencyImport(e,t){const i=e.module;if(i instanceof Module){const s=this.chunkByModule.get(i);let n;do{n=t.alternativeReexportModules.get(e);if(n){const r=this.chunkByModule.get(n);if(r!==s){this.inputOptions.onwarn(errorCyclicCrossChunkReexport(i.getExportNamesByVariable().get(e)?.[0]||"*",i.id,n.id,t.id,this.outputOptions.preserveModules))}t=n}}while(n)}}ensureReexportsAreAvailableForModule(e){const t=[];const i=e.getExportNamesByVariable();for(const s of i.keys()){const i=s instanceof SyntheticNamedExportVariable;const n=i?s.getBaseVariable():s;this.checkCircularDependencyImport(n,e);if(!(n instanceof NamespaceVariable&&this.outputOptions.preserveModules)){const e=n.module;if(e instanceof Module){const s=this.chunkByModule.get(e);if(s&&s!==this){s.exports.add(n);t.push(n);if(i){this.imports.add(n)}}}}}if(t.length>0){this.includedReexportsByModule.set(e,t)}}generateVariableName(){if(this.manualChunkAlias){return this.manualChunkAlias}const e=this.entryModules[0]||this.implicitEntryModules[0]||this.dynamicEntryModules[0]||this.orderedModules[this.orderedModules.length-1];if(e){return getChunkNameFromModule(e)}return"chunk"}getChunkExportDeclarations(e){const t=[];for(const i of this.getExportNames()){if(i[0]==="*")continue;const s=this.exportsByName.get(i);if(!(s instanceof SyntheticNamedExportVariable)){const t=s.module;if(t){const s=this.chunkByModule.get(t);if(s!==this){if(!s||e!=="es"){continue}const t=this.renderedDependencies.get(s);if(!t){continue}const{imports:n,reexports:r}=t;const o=r?.find((({reexported:e})=>e===i));const l=n?.find((({imported:e})=>e===o?.imported));if(!l){continue}}}}let n=null;let r=false;let o=s.getName(this.snippets.getPropertyAccess);if(s instanceof LocalVariable){for(const e of s.declarations){if(e.parent instanceof FunctionDeclaration||e instanceof ExportDefaultDeclaration&&e.declaration instanceof FunctionDeclaration){r=true;break}}}else if(s instanceof SyntheticNamedExportVariable){n=o;if(e==="es"){o=s.renderName}}t.push({exported:i,expression:n,hoisted:r,local:o})}return t}getDependenciesToBeDeconflicted(e,t,i){const s=new Set;const n=new Set;const r=new Set;for(const t of[...this.exportNamesByVariable.keys(),...this.imports]){if(e||t.isNamespace){const o=t.module;if(o instanceof ExternalModule){const l=this.externalChunkByModule.get(o);s.add(l);if(e){if(t.name==="default"){if(vr[i(o.id)]){n.add(l)}}else if(t.name==="*"&&Sr[i(o.id)]){r.add(l)}}}else{const i=this.chunkByModule.get(o);if(i!==this){s.add(i);if(e&&i.exportMode==="default"&&t.isNamespace){r.add(i)}}}}}if(t){for(const e of this.dependencies){s.add(e)}}return{deconflictedDefault:n,deconflictedNamespace:r,dependencies:s}}getDynamicDependencies(){return this.getIncludedDynamicImports().map((e=>e.facadeChunk||e.chunk||e.externalChunk||e.resolution)).filter((e=>e!==this&&(e instanceof Chunk||e instanceof ExternalChunk)))}getDynamicImportStringAndAssertions(e,t){if(e instanceof ExternalModule){const i=this.externalChunkByModule.get(e);return[`'${i.getImportPath(t)}'`,i.getImportAssertions(this.snippets)]}return[e||"",this.outputOptions.format==="es"&&this.outputOptions.externalImportAssertions||null]}getFallbackChunkName(){if(this.manualChunkAlias){return this.manualChunkAlias}if(this.dynamicName){return this.dynamicName}if(this.fileName){return getAliasName(this.fileName)}return getAliasName(this.orderedModules[this.orderedModules.length-1].id)}getImportSpecifiers(){const{interop:e}=this.outputOptions;const t=new Map;for(const i of this.imports){const s=i.module;let n;let r;if(s instanceof ExternalModule){n=this.externalChunkByModule.get(s);r=i.name;if(r!=="default"&&r!=="*"&&e(s.id)==="defaultOnly"){return error(errorUnexpectedNamedImport(s.id,r,false))}}else{n=this.chunkByModule.get(s);r=n.getVariableExportName(i)}getOrCreate(t,n,getNewArray).push({imported:r,local:i.getName(this.snippets.getPropertyAccess)})}return t}getIncludedDynamicImports(){if(this.includedDynamicImports){return this.includedDynamicImports}const e=[];for(const t of this.orderedModules){for(const{node:i,resolution:s}of t.dynamicImports){if(!i.included){continue}e.push(s instanceof Module?{chunk:this.chunkByModule.get(s),externalChunk:null,facadeChunk:this.facadeChunkByModule.get(s),node:i,resolution:s}:s instanceof ExternalModule?{chunk:null,externalChunk:this.externalChunkByModule.get(s),facadeChunk:null,node:i,resolution:s}:{chunk:null,externalChunk:null,facadeChunk:null,node:i,resolution:s})}}return this.includedDynamicImports=e}getPreRenderedChunkInfo(){if(this.preRenderedChunkInfo){return this.preRenderedChunkInfo}const{dynamicEntryModules:e,facadeModule:t,implicitEntryModules:i,orderedModules:s}=this;return this.preRenderedChunkInfo={exports:this.getExportNames(),facadeModuleId:t&&t.id,isDynamicEntry:e.length>0,isEntry:!!t?.info.isEntry,isImplicitEntry:i.length>0,moduleIds:s.map((({id:e})=>e)),name:this.getChunkName(),type:"chunk"}}getPreserveModulesChunkNameFromModule(e){const t=getPredefinedChunkNameFromModule(e);if(t)return t;const{preserveModulesRoot:i,sanitizeFileName:s}=this.outputOptions;const n=s(normalize(e.id.split(io,1)[0]));const o=r.extname(n);const l=to.has(o)?n.slice(0,-o.length):n;if(isAbsolute(l)){return i&&r.resolve(l).startsWith(i)?l.slice(i.length).replace(/^[/\\]/,""):relative(this.inputBase,l)}else{return`_virtual/${r.basename(l)}`}}getReexportSpecifiers(){const{externalLiveBindings:e,interop:t}=this.outputOptions;const i=new Map;for(let s of this.getExportNames()){let n;let r;let o=false;if(s[0]==="*"){const i=s.slice(1);if(t(i)==="defaultOnly"){this.inputOptions.onwarn(errorUnexpectedNamespaceReexport(i))}o=e;n=this.externalChunkByModule.get(this.modulesById.get(i));r=s="*"}else{const i=this.exportsByName.get(s);if(i instanceof SyntheticNamedExportVariable)continue;const l=i.module;if(l instanceof Module){n=this.chunkByModule.get(l);if(n===this)continue;r=n.getVariableExportName(i);o=i.isReassigned}else{n=this.externalChunkByModule.get(l);r=i.name;if(r!=="default"&&r!=="*"&&t(l.id)==="defaultOnly"){return error(errorUnexpectedNamedImport(l.id,r,true))}o=e&&(r!=="default"||isDefaultAProperty(t(l.id),true))}}getOrCreate(i,n,getNewArray).push({imported:r,needsLiveBinding:o,reexported:s})}return i}getReferencedFiles(){const e=new Set;for(const t of this.orderedModules){for(const i of t.importMetas){const t=i.getReferencedFileName(this.pluginDriver);if(t){e.add(t)}}}return[...e]}getRenderedDependencies(){if(this.renderedDependencies){return this.renderedDependencies}const e=this.getImportSpecifiers();const t=this.getReexportSpecifiers();const i=new Map;const s=this.getFileName();for(const n of this.dependencies){const r=e.get(n)||null;const o=t.get(n)||null;const l=n instanceof ExternalChunk||n.exportMode!=="default";const c=n.getImportPath(s);i.set(n,{assertions:n instanceof ExternalChunk?n.getImportAssertions(this.snippets):null,defaultVariableName:n.defaultVariableName,globalName:n instanceof ExternalChunk&&(this.outputOptions.format==="umd"||this.outputOptions.format==="iife")&&getGlobalName(n,this.outputOptions.globals,(r||o)!==null,this.inputOptions.onwarn),importPath:c,imports:r,isChunk:n instanceof Chunk,name:n.variableName,namedExportsMode:l,namespaceVariableName:n.namespaceVariableName,reexports:o})}return this.renderedDependencies=i}inlineChunkDependencies(e){for(const t of e.dependencies){if(this.dependencies.has(t))continue;this.dependencies.add(t);if(t instanceof Chunk){this.inlineChunkDependencies(t)}}}renderModules(e){const{accessedGlobalsByScope:t,dependencies:i,exportNamesByVariable:s,includedNamespaces:n,inputOptions:{onwarn:r},isEmpty:o,orderedModules:l,outputOptions:c,pluginDriver:u,renderedModules:h,snippets:d}=this;const{compact:p,dynamicImportFunction:f,format:m,freeze:g,namespaceToStringTag:y}=c;const{_:E,cnst:x,n:b}=d;this.setDynamicImportResolutions(e);this.setImportMetaResolutions(e);this.setIdentifierRenderResolutions();const v=new Xt({separator:`${b}${b}`});const S=getIndentString(l,c);const A=[];let w="";const I=new Set;const k=new Map;const C={dynamicImportFunction:f,exportNamesByVariable:s,format:m,freeze:g,indent:S,namespaceToStringTag:y,pluginDriver:u,snippets:d,useOriginalName:null};let _=false;for(const e of l){let i=0;let s;if(e.isIncluded()||n.has(e)){const r=e.render(C);({source:s}=r);_||(_=r.usesTopLevelAwait);i=s.length();if(i){if(p&&s.lastLine().includes("//"))s.append("\n");k.set(e,s);v.addSource(s);A.push(e)}const o=e.namespace;if(n.has(e)){const e=o.renderBlock(C);if(o.renderFirst())w+=b+e;else v.addSource(new MagicString(e))}const l=t.get(e.scope);if(l){for(const e of l){I.add(e)}}}const{renderedExports:r,removedExports:o}=e.getRenderedExports();h[e.id]={get code(){return s?.toString()??null},originalLength:e.originalCode.length,removedExports:o,renderedExports:r,renderedLength:i}}if(w)v.prepend(w+b+b);if(this.needsExportsShim){v.prepend(`${b}${x} ${Tr}${E}=${E}void 0;${b}${b}`)}const P=p?v:v.trim();if(o&&this.getExportNames().length===0&&i.size===0){r(errorEmptyChunk(this.getChunkName()))}return{accessedGlobals:I,indent:S,magicString:v,renderedSource:P,usedModules:A,usesTopLevelAwait:_}}setDynamicImportResolutions(e){const{accessedGlobalsByScope:t,outputOptions:i,pluginDriver:s,snippets:n}=this;for(const r of this.getIncludedDynamicImports()){if(r.chunk){const{chunk:o,facadeChunk:l,node:c,resolution:u}=r;if(o===this){c.setInternalResolution(u.namespace)}else{c.setExternalResolution((l||o).exportMode,u,i,n,s,t,`'${(l||o).getImportPath(e)}'`,!l?.strictFacade&&o.exportNamesByVariable.get(u.namespace)[0],null)}}else{const{node:o,resolution:l}=r;const[c,u]=this.getDynamicImportStringAndAssertions(l,e);o.setExternalResolution("external",l,i,n,s,t,c,false,u)}}}setIdentifierRenderResolutions(){const{format:e,interop:t,namespaceToStringTag:i,preserveModules:s,externalLiveBindings:n}=this.outputOptions;const r=new Set;for(const t of this.getExportNames()){const i=this.exportsByName.get(t);if(e!=="es"&&e!=="system"&&i.isReassigned&&!i.isId){i.setRenderNames("exports",t)}else if(i instanceof SyntheticNamedExportVariable){r.add(i)}else{i.setRenderNames(null,null)}}for(const e of this.orderedModules){if(e.needsExportShim){this.needsExportsShim=true;break}}const o=new Set(["Object","Promise"]);if(this.needsExportsShim){o.add(Tr)}if(i){o.add("Symbol")}switch(e){case"system":{o.add("module").add("exports");break}case"es":{break}case"cjs":{o.add("module").add("require").add("__filename").add("__dirname")}default:{o.add("exports");for(const e of wr){o.add(e)}}}deconflictChunk(this.orderedModules,this.getDependenciesToBeDeconflicted(e!=="es"&&e!=="system",e==="amd"||e==="umd"||e==="iife",t),this.imports,o,e,t,s,n,this.chunkByModule,this.externalChunkByModule,r,this.exportNamesByVariable,this.accessedGlobalsByScope,this.includedNamespaces)}setImportMetaResolutions(e){const{accessedGlobalsByScope:t,includedNamespaces:i,orderedModules:s,outputOptions:{format:n}}=this;for(const r of s){for(const i of r.importMetas){i.setResolution(n,t,e)}if(i.has(r)){r.namespace.prepare(t)}}}setUpChunkImportsAndExportsForModule(e){const t=new Set(e.includedImports);if(!this.outputOptions.preserveModules&&this.includedNamespaces.has(e)){const i=e.namespace.getMemberVariables();for(const e of Object.values(i)){t.add(e)}}for(let i of t){if(i instanceof ExportDefaultVariable){i=i.getOriginalVariable()}if(i instanceof SyntheticNamedExportVariable){i=i.getBaseVariable()}const t=this.chunkByModule.get(i.module);if(t!==this){this.imports.add(i);if(i.module instanceof Module){this.checkCircularDependencyImport(i,e);if(!(i instanceof NamespaceVariable&&this.outputOptions.preserveModules)){t.exports.add(i)}}}}if(this.includedNamespaces.has(e)||e.info.isEntry&&e.preserveSignature!==false||e.includedDynamicImporters.some((e=>this.chunkByModule.get(e)!==this))){this.ensureReexportsAreAvailableForModule(e)}for(const{node:t,resolution:i}of e.dynamicImports){if(t.included&&i instanceof Module&&this.chunkByModule.get(i)===this&&!this.includedNamespaces.has(i)){this.includedNamespaces.add(i);this.ensureReexportsAreAvailableForModule(i)}}}}function getChunkNameFromModule(e){return getPredefinedChunkNameFromModule(e)??getAliasName(e.id)}function getPredefinedChunkNameFromModule(e){return e.chunkNames.find((({isUserDefined:e})=>e))?.name??e.chunkNames[0]?.name}function getImportedBindingsPerDependency(e,t){const i={};for(const[s,n]of e){const e=new Set;if(n.imports){for(const{imported:t}of n.imports){e.add(t)}}if(n.reexports){for(const{imported:t}of n.reexports){e.add(t)}}i[t(s)]=[...e]}return i}const io=/[#?]/;const resolveFileName=e=>e.getFileName();function*concatLazy(e){for(const t of e){yield*t}}function getChunkAssignments(e,t,i){const{chunkDefinitions:s,modulesInManualChunks:n}=getChunkDefinitionsFromManualChunks(t);const{allEntries:r,dependentEntriesByModule:o,dynamicallyDependentEntriesByDynamicEntry:l,dynamicImportsByEntry:c}=analyzeModuleGraph(e);const u=getChunksFromDependentEntries(getModulesWithDependentEntries(o,n));removeUnnecessaryDependentEntries(u,l,c,r);s.push(...getOptimizedChunks(getChunksFromDependentEntries(u),r.length,i).map((({modules:e})=>({alias:null,modules:e}))));return s}function getChunkDefinitionsFromManualChunks(e){const t=[];const i=new Set(e.keys());const s=Object.create(null);for(const[t,n]of e){addStaticDependenciesToManualChunk(t,s[n]||(s[n]=[]),i)}for(const[e,i]of Object.entries(s)){t.push({alias:e,modules:i})}return{chunkDefinitions:t,modulesInManualChunks:i}}function addStaticDependenciesToManualChunk(e,t,i){const s=new Set([e]);for(const e of s){i.add(e);t.push(e);for(const t of e.dependencies){if(!(t instanceof ExternalModule||i.has(t))){s.add(t)}}}}function analyzeModuleGraph(e){const t=new Set;const i=new Map;const s=[];const n=new Set(e);let r=0;for(const e of n){const o=new Set;s.push(o);const l=new Set([e]);for(const e of l){getOrCreate(i,e,getNewSet).add(r);for(const t of e.getDependenciesToBeIncluded()){if(!(t instanceof ExternalModule)){l.add(t)}}for(const{resolution:i}of e.dynamicImports){if(i instanceof Module&&i.includedDynamicImporters.length>0&&!n.has(i)){t.add(i);n.add(i);o.add(i)}}for(const i of e.implicitlyLoadedBefore){if(!n.has(i)){t.add(i);n.add(i)}}}r++}const o=[...n];const{dynamicEntries:l,dynamicImportsByEntry:c}=getDynamicEntries(o,t,s);return{allEntries:o,dependentEntriesByModule:i,dynamicallyDependentEntriesByDynamicEntry:getDynamicallyDependentEntriesByDynamicEntry(i,l,o),dynamicImportsByEntry:c}}function getDynamicEntries(e,t,i){const s=new Map;const n=new Set;for(const[i,r]of e.entries()){s.set(r,i);if(t.has(r)){n.add(i)}}const r=[];for(const e of i){const t=new Set;for(const i of e){t.add(s.get(i))}r.push(t)}return{dynamicEntries:n,dynamicImportsByEntry:r}}function getDynamicallyDependentEntriesByDynamicEntry(e,t,i){const s=new Map;for(const n of t){const t=getOrCreate(s,n,getNewSet);const r=i[n];for(const i of concatLazy([r.includedDynamicImporters,r.implicitlyLoadedAfter])){for(const s of e.get(i)){t.add(s)}}}return s}function getChunksFromDependentEntries(e){var t;const i=Object.create(null);for(const{dependentEntries:s,modules:n}of e){let e=0n;for(const t of s){e|=1n<<BigInt(t)}(i[t=String(e)]||(i[t]={dependentEntries:new Set(s),modules:[]})).modules.push(...n)}return Object.values(i)}function*getModulesWithDependentEntries(e,t){for(const[i,s]of e){if(!t.has(i)){yield{dependentEntries:s,modules:[i]}}}}function removeUnnecessaryDependentEntries(e,t,i,s){const n=s.map((()=>0n));const r=s.map(((e,i)=>t.has(i)?-1n:0n));let o=1n;for(const{dependentEntries:t}of e){for(const e of t){n[e]|=o}o<<=1n}const l=t;for(const[e,t]of l){l.delete(e);const s=r[e];let o=s;for(const e of t){o&=n[e]|r[e]}if(o!==s){r[e]=o;for(const t of i[e]){getOrCreate(l,t,getNewSet).add(e)}}}o=1n;for(const{dependentEntries:t}of e){for(const e of t){if((r[e]&o)===o){t.delete(e)}}o<<=1n}}function getOptimizedChunks(e,t,i){Lr("optimize chunks",3);const s=getPartitionedChunks(e,t,i);if(!s){Br("optimize chunks",3);return e}i>1&&console.log("Before eliminating small chunks, there were\n",e.length,"chunks, of which\n",s.small.size,"were below minChunkSize.");mergeChunks(s,i);i>1&&console.log("After merging chunks,\n",s.small.size+s.big.size,"chunks remain, of which\n",s.small.size,"are below minChunkSize.");Br("optimize chunks",3);return[...s.small,...s.big]}function getPartitionedChunks(e,t,i){const s=[];const n=[];const r=new Map;const o=[];let l=0n;let c=1n;for(const{dependentEntries:t,modules:u}of e){const e={containedAtoms:c,correlatedAtoms:0n,dependencies:new Set,dependentChunks:new Set,dependentEntries:t,modules:u,pure:true,size:0};let h=0;let d=true;for(const t of u){r.set(t,e);if(t.isIncluded()){d&&(d=!t.hasEffects());h+=i>1?t.estimateSize():1}}e.pure=d;e.size=h;o.push(h);if(!d){l|=c}(h<i?s:n).push(e);c<<=1n}if(s.length===0){return null}l|=addChunkDependenciesAndAtomsAndGetSideEffectAtoms([n,s],r,t,c);return{big:new Set(n),sideEffectAtoms:l,sizeByAtom:o,small:new Set(s)}}function mergeChunks(e,t){const{small:i}=e;for(const s of i){const n=findBestMergeTarget(s,e,t<=1?1:Infinity);if(n){const{containedAtoms:r,correlatedAtoms:o,modules:l,pure:c,size:u}=s;i.delete(s);getChunksInPartition(n,t,e).delete(n);n.modules.push(...l);n.size+=u;n.pure&&(n.pure=c);const{dependencies:h,dependentChunks:d,dependentEntries:p}=n;n.correlatedAtoms&=o;n.containedAtoms|=r;for(const e of s.dependentEntries){p.add(e)}for(const e of s.dependencies){h.add(e);e.dependentChunks.delete(s);e.dependentChunks.add(n)}for(const e of s.dependentChunks){d.add(e);e.dependencies.delete(s);e.dependencies.add(n)}h.delete(n);d.delete(n);getChunksInPartition(n,t,e).add(n)}}}function addChunkDependenciesAndAtomsAndGetSideEffectAtoms(e,t,i,s){const n=new Map;let r=0n;const o=[];for(let e=0;e<i;e++){o.push(0n)}for(const i of e){i.sort(compareChunkSize);for(const e of i){const{dependencies:i,dependentEntries:l,modules:c}=e;for(const o of c){for(const l of o.getDependenciesToBeIncluded()){if(l instanceof ExternalModule){if(l.info.moduleSideEffects){e.containedAtoms|=getOrCreate(n,l,(()=>{const e=s;s<<=1n;r|=e;return e}))}}else{const s=t.get(l);if(s&&s!==e){i.add(s);s.dependentChunks.add(e)}}}}const{containedAtoms:u}=e;for(const e of l){o[e]|=u}}}for(const t of e){for(const e of t){const{dependentEntries:t}=e;e.correlatedAtoms=-1n;for(const i of t){e.correlatedAtoms&=o[i]}}}return r}function findBestMergeTarget(e,{big:t,sideEffectAtoms:i,sizeByAtom:s,small:n},r){let o=null;for(const l of concatLazy([n,t])){if(e===l)continue;const t=getAdditionalSizeAfterMerge(e,l,r,i,s);if(t<r){o=l;if(t===0)break;r=t}}return o}function getChunksInPartition(e,t,i){return e.size<t?i.small:i.big}function compareChunkSize({size:e},{size:t}){return e-t}function getAdditionalSizeAfterMerge(e,t,i,s,n){const r=getAdditionalSizeIfNoTransitiveDependencyOrNonCorrelatedSideEffect(e,t,i,s,n);return r<i?r+getAdditionalSizeIfNoTransitiveDependencyOrNonCorrelatedSideEffect(t,e,i-r,s,n):Infinity}function getAdditionalSizeIfNoTransitiveDependencyOrNonCorrelatedSideEffect(e,t,i,s,n){const{correlatedAtoms:r}=t;let o=e.containedAtoms;const l=o&s;if((r&l)!==l){return Infinity}const c=new Set(e.dependencies);for(const{dependencies:e,containedAtoms:i}of c){o|=i;const n=i&s;if((r&n)!==n){return Infinity}for(const i of e){if(i===t){return Infinity}c.add(i)}}return getAtomsSizeIfBelowLimit(o&~r,i,n)}function getAtomsSizeIfBelowLimit(e,t,i){let s=0;let n=0;let r=1n;const{length:o}=i;for(;n<o;n++){if((e&r)===r){s+=i[n]}r<<=1n;if(s>=t){return Infinity}}return s}function commondir(e){if(e.length===0)return"/";if(e.length===1)return r.dirname(e[0]);const t=e.slice(1).reduce(((e,t)=>{const i=t.split(/\/+|\\+/);let s;for(s=0;e[s]===i[s]&&s<Math.min(e.length,i.length);s++);return e.slice(0,s)}),e[0].split(/\/+|\\+/));return t.length>1?t.join("/"):"/"}const compareExecIndex=(e,t)=>e.execIndex>t.execIndex?1:-1;function sortByExecutionOrder(e){e.sort(compareExecIndex)}function analyseModuleExecution(e){let t=0;const i=[];const s=new Set;const n=new Set;const r=new Map;const o=[];const analyseModule=e=>{if(e instanceof Module){for(const t of e.dependencies){if(r.has(t)){if(!s.has(t)){i.push(getCyclePath(t,e,r))}continue}r.set(t,e);analyseModule(t)}for(const t of e.implicitlyLoadedBefore){n.add(t)}for(const{resolution:t}of e.dynamicImports){if(t instanceof Module){n.add(t)}}o.push(e)}e.execIndex=t++;s.add(e)};for(const t of e){if(!r.has(t)){r.set(t,null);analyseModule(t)}}for(const e of n){if(!r.has(e)){r.set(e,null);analyseModule(e)}}return{cyclePaths:i,orderedModules:o}}function getCyclePath(e,t,i){const s=Symbol(e.id);const n=[e.id];let r=t;e.cycles.add(s);while(r!==e){r.cycles.add(s);n.push(r.id);r=i.get(r)}n.push(n[0]);n.reverse();return n}function getGenerateCodeSnippets({compact:e,generatedCode:{arrowFunctions:t,constBindings:i,objectShorthand:s,reservedNamesAsProps:n}}){const{_:r,n:o,s:l}=e?{_:"",n:"",s:""}:{_:" ",n:"\n",s:";"};const c=i?"const":"var";const getNonArrowFunctionIntro=(e,{isAsync:t,name:i})=>`${t?`async `:""}function${i?` ${i}`:""}${r}(${e.join(`,${r}`)})${r}`;const u=t?(e,{isAsync:t,name:i})=>{const s=e.length===1;const n=t?`async${s?" ":r}`:"";return`${i?`${c} ${i}${r}=${r}`:""}${n}${s?e[0]:`(${e.join(`,${r}`)})`}${r}=>${r}`}:getNonArrowFunctionIntro;const getDirectReturnFunction=(e,{functionReturn:i,lineBreakIndent:s,name:n})=>[`${u(e,{isAsync:false,name:n})}${t?s?`${o}${s.base}${s.t}`:"":`{${s?`${o}${s.base}${s.t}`:r}${i?"return ":""}`}`,t?`${n?";":""}${s?`${o}${s.base}`:""}`:`${l}${s?`${o}${s.base}`:r}}`];const h=n?e=>so.test(e):e=>!Si.has(e)&&so.test(e);return{_:r,cnst:c,getDirectReturnFunction:getDirectReturnFunction,getDirectReturnIifeLeft:(e,i,{needsArrowReturnParens:s,needsWrappedFunction:n})=>{const[r,o]=getDirectReturnFunction(e,{functionReturn:true,lineBreakIndent:null,name:null});return`${wrapIfNeeded(`${r}${wrapIfNeeded(i,t&&s)}${o}`,t||n)}(`},getFunctionIntro:u,getNonArrowFunctionIntro:getNonArrowFunctionIntro,getObject(e,{lineBreakIndent:t}){const i=t?`${o}${t.base}${t.t}`:r;return`{${e.map((([e,t])=>{if(e===null)return`${i}${t}`;const n=!h(e);return e===t&&s&&!n?i+e:`${i}${n?`'${e}'`:e}:${r}${t}`})).join(`,`)}${e.length===0?"":t?`${o}${t.base}`:r}}`},getPropertyAccess:e=>h(e)?`.${e}`:`[${JSON.stringify(e)}]`,n:o,s:l}}const wrapIfNeeded=(e,t)=>t?`(${e})`:e;const so=/^(?!\d)[\w$]+$/;class Source{constructor(e,t){this.isOriginal=true;this.filename=e;this.content=t}traceSegment(e,t,i){return{column:t,line:e,name:i,source:this}}}class Link{constructor(e,t){this.sources=t;this.names=e.names;this.mappings=e.mappings}traceMappings(){const e=[];const t=new Map;const i=[];const s=[];const n=new Map;const r=[];for(const o of this.mappings){const l=[];for(const r of o){if(r.length===1)continue;const o=this.sources[r[1]];if(!o)continue;const c=o.traceSegment(r[2],r[3],r.length===5?this.names[r[4]]:"");if(c){const{column:o,line:u,name:h,source:{content:d,filename:p}}=c;let f=t.get(p);if(f===undefined){f=e.length;e.push(p);t.set(p,f);i[f]=d}else if(i[f]==null){i[f]=d}else if(d!=null&&i[f]!==d){return error(errorConflictingSourcemapSources(p))}const m=[r[0],f,u,o];if(h){let e=n.get(h);if(e===undefined){e=s.length;s.push(h);n.set(h,e)}m[4]=e}l.push(m)}}r.push(l)}return{mappings:r,names:s,sources:e,sourcesContent:i}}traceSegment(e,t,i){const s=this.mappings[e];if(!s)return null;let n=0;let r=s.length-1;while(n<=r){const e=n+r>>1;const o=s[e];if(o[0]===t||n===r){if(o.length==1)return null;const e=this.sources[o[1]];if(!e)return null;return e.traceSegment(o[2],o[3],o.length===5?this.names[o[4]]:i)}if(o[0]>t){r=e-1}else{n=e+1}}return null}}function getLinkMap(e){return function linkMap(t,i){if(i.mappings){return new Link(i,[t])}e(errorSourcemapBroken(i.plugin));return new Link({mappings:[],names:[]},[t])}}function getCollapsedSourcemap(e,t,i,s,n){let o;if(i){const t=i.sources;const s=i.sourcesContent||[];const n=r.dirname(e)||".";const l=i.sourceRoot||".";const c=t.map(((e,t)=>new Source(r.resolve(n,l,e),s[t])));o=new Link(i,c)}else{o=new Source(e,t)}return s.reduce(n,o)}function collapseSourcemaps(e,t,i,s,n,o){const l=getLinkMap(o);const c=i.filter((e=>!e.excludeFromSourcemap)).map((e=>getCollapsedSourcemap(e.id,e.originalCode,e.originalSourcemap,e.sourcemapChain,l)));const u=new Link(t,c);const h=s.reduce(l,u);let{sources:d,sourcesContent:p,names:f,mappings:m}=h.traceMappings();if(e){const t=r.dirname(e);d=d.map((e=>r.relative(t,e)));e=r.basename(e)}p=n?null:p;return new SourceMap({file:e,mappings:m,names:f,sources:d,sourcesContent:p})}function collapseSourcemap(e,t,i,s,n){if(s.length===0){return i}const r=getCollapsedSourcemap(e,t,i,s,getLinkMap(n));const o=r.traceMappings();return{version:3,...o}}const createHash=()=>c.createHash("sha256");function decodedSourcemap(e){if(!e)return null;if(typeof e==="string"){e=JSON.parse(e)}if(e.mappings===""){return{mappings:[],names:[],sources:[],version:3}}const t=typeof e.mappings==="string"?decode(e.mappings):e.mappings;return{...e,mappings:t}}async function renderChunks(e,t,i,s,n){Lr("render chunks",2);reserveEntryChunksInBundle(e);const r=await Promise.all(e.map((e=>e.render())));Br("render chunks",2);Lr("transform chunks",2);const o=getChunkGraph(e);const{nonHashedChunksWithPlaceholders:l,renderedChunksByPlaceholder:c,hashDependenciesByPlaceholder:u}=await transformChunksAndGenerateContentHashes(r,o,s,i,n);const h=generateFinalHashes(c,u,t);addChunksToBundle(c,h,t,l,i,s);Br("transform chunks",2)}function reserveEntryChunksInBundle(e){for(const t of e){if(t.facadeModule&&t.facadeModule.isUserDefinedEntryPoint){t.getPreliminaryFileName()}}}function getChunkGraph(e){return Object.fromEntries(e.map((e=>{const t=e.getRenderedChunkInfo();return[t.fileName,t]})))}async function transformChunk(e,t,i,s,n,o,l){let c=null;const u=[];let h=await o.hookReduceArg0("renderChunk",[e.toString(),s[t],n,{chunks:s}],((e,t,i)=>{if(t==null)return e;if(typeof t==="string")t={code:t,map:undefined};if(t.map!==null){const e=decodedSourcemap(t.map);u.push(e||{missing:true,plugin:i.name})}return t.code}));const{compact:d,dir:p,file:f,sourcemap:m,sourcemapExcludeSources:g,sourcemapFile:y,sourcemapPathTransform:E,sourcemapIgnoreList:x}=n;if(!d&&h[h.length-1]!=="\n")h+="\n";if(m){Lr("sourcemaps",3);let s;if(f)s=r.resolve(y||f);else if(p)s=r.resolve(p,t);else s=r.resolve(t);const n=e.generateDecodedMap({});c=collapseSourcemaps(s,n,i,u,g,l);for(let e=0;e<c.sources.length;++e){let t=c.sources[e];const i=`${s}.map`;const n=x(t,i);if(typeof n!=="boolean"){error(errorFailedValidation("sourcemapIgnoreList function must return a boolean."))}if(n){if(c.x_google_ignoreList===undefined){c.x_google_ignoreList=[]}if(!c.x_google_ignoreList.includes(e)){c.x_google_ignoreList.push(e)}}if(E){t=E(t,i);if(typeof t!=="string"){error(errorFailedValidation(`sourcemapPathTransform function must return a string.`))}}c.sources[e]=normalize(t)}Br("sourcemaps",3)}return{code:h,map:c}}async function transformChunksAndGenerateContentHashes(e,t,i,s,n){const r=[];const o=new Map;const l=new Map;const c=new Set;for(const{preliminaryFileName:{hashPlaceholder:t}}of e){if(t)c.add(t)}await Promise.all(e.map((async({chunk:e,preliminaryFileName:{fileName:u,hashPlaceholder:h},magicString:d,usedModules:p})=>{const f={chunk:e,fileName:u,...await transformChunk(d,u,p,t,i,s,n)};const{code:m}=f;if(h){const{containedPlaceholders:t,transformedCode:i}=replacePlaceholdersWithDefaultAndGetContainedPlaceholders(m,c);const n=createHash().update(i);const r=s.hookReduceValueSync("augmentChunkHash","",[e.getRenderedChunkInfo()],((e,t)=>{if(t){e+=t}return e}));if(r){n.update(r)}o.set(h,f);l.set(h,{containedPlaceholders:t,contentHash:n.digest("hex")})}else{r.push(f)}})));return{hashDependenciesByPlaceholder:l,nonHashedChunksWithPlaceholders:r,renderedChunksByPlaceholder:o}}function generateFinalHashes(e,t,i){const s=new Map;for(const[n,{fileName:r}]of e){let e=createHash();const o=new Set([n]);for(const i of o){const{containedPlaceholders:s,contentHash:n}=t.get(i);e.update(n);for(const e of s){o.add(e)}}let l;let c;do{if(c){e=createHash().update(c)}c=e.digest("hex").slice(0,n.length);l=replaceSinglePlaceholder(r,n,c)}while(i[Jr].has(l.toLowerCase()));i[l]=eo;s.set(n,c)}return s}function addChunksToBundle(e,t,i,s,n,r){for(const{chunk:s,code:o,fileName:l,map:c}of e.values()){let e=replacePlaceholders(o,t);const u=replacePlaceholders(l,t);if(c){c.file=replacePlaceholders(c.file,t);e+=emitSourceMapAndGetComment(u,c,n,r)}i[u]=s.finalizeChunk(e,c,t)}for(const{chunk:e,code:o,fileName:l,map:c}of s){let s=t.size>0?replacePlaceholders(o,t):o;if(c){s+=emitSourceMapAndGetComment(l,c,n,r)}i[l]=e.finalizeChunk(s,c,t)}}function emitSourceMapAndGetComment(e,t,i,{sourcemap:s,sourcemapBaseUrl:n}){let o;if(s==="inline"){o=t.toUrl()}else{const s=`${r.basename(e)}.map`;o=n?new URL(s,n).toString():s;i.emitFile({fileName:`${e}.map`,source:t.toString(),type:"asset"})}return s==="hidden"?"":`//# ${un}=${o}\n`}class Bundle{constructor(e,t,i,s,n){this.outputOptions=e;this.unsetOptions=t;this.inputOptions=i;this.pluginDriver=s;this.graph=n;this.facadeChunkByModule=new Map;this.includedNamespaces=new Set}async generate(e){Lr("GENERATE",1);const t=Object.create(null);const i=getOutputBundle(t);this.pluginDriver.setOutputBundle(i,this.outputOptions);try{Lr("initialize render",2);await this.pluginDriver.hookParallel("renderStart",[this.outputOptions,this.inputOptions]);Br("initialize render",2);Lr("generate chunks",2);const e=getHashPlaceholderGenerator();const t=await this.generateChunks(i,e);if(t.length>1){validateOptionsForMultiChunkOutput(this.outputOptions,this.inputOptions.onwarn)}this.pluginDriver.setChunkInformation(this.facadeChunkByModule);for(const e of t){e.generateExports()}Br("generate chunks",2);await renderChunks(t,i,this.pluginDriver,this.outputOptions,this.inputOptions.onwarn)}catch(e){await this.pluginDriver.hookParallel("renderError",[e]);throw e}removeUnreferencedAssets(i);Lr("generate bundle",2);await this.pluginDriver.hookSeq("generateBundle",[this.outputOptions,i,e]);this.finaliseAssets(i);Br("generate bundle",2);Br("GENERATE",1);return t}async addManualChunks(e){const t=new Map;const i=await Promise.all(Object.entries(e).map((async([e,t])=>({alias:e,entries:await this.graph.moduleLoader.addAdditionalModules(t)}))));for(const{alias:e,entries:s}of i){for(const i of s){addModuleToManualChunk(e,i,t)}}return t}assignManualChunks(e){const t=[];const i={getModuleIds:()=>this.graph.modulesById.keys(),getModuleInfo:this.graph.getModuleInfo};for(const s of this.graph.modulesById.values()){if(s instanceof Module){const n=e(s.id,i);if(typeof n==="string"){t.push([n,s])}}}t.sort((([e],[t])=>e>t?1:e<t?-1:0));const s=new Map;for(const[e,i]of t){addModuleToManualChunk(e,i,s)}return s}finaliseAssets(e){if(this.outputOptions.validate){for(const t of Object.values(e)){if("code"in t){try{this.graph.contextParse(t.code,{ecmaVersion:"latest"})}catch(e){this.inputOptions.onwarn(errorChunkInvalid(t,e))}}}}this.pluginDriver.finaliseAssets()}async generateChunks(e,t){const{experimentalMinChunkSize:i,inlineDynamicImports:s,manualChunks:n,preserveModules:r}=this.outputOptions;const o=typeof n==="object"?await this.addManualChunks(n):this.assignManualChunks(n);const l=getGenerateCodeSnippets(this.outputOptions);const c=getIncludedModules(this.graph.modulesById);const u=commondir(getAbsoluteEntryModulePaths(c,r));const h=getExternalChunkByModule(this.graph.modulesById,this.outputOptions,u);const d=[];const p=new Map;for(const{alias:n,modules:f}of s?[{alias:null,modules:c}]:r?c.map((e=>({alias:null,modules:[e]}))):getChunkAssignments(this.graph.entryModules,o,i)){sortByExecutionOrder(f);const i=new Chunk(f,this.inputOptions,this.outputOptions,this.unsetOptions,this.pluginDriver,this.graph.modulesById,p,h,this.facadeChunkByModule,this.includedNamespaces,n,t,e,u,l);d.push(i)}for(const e of d){e.link()}const f=[];for(const e of d){f.push(...e.generateFacades())}return[...d,...f]}}function validateOptionsForMultiChunkOutput(e,t){if(e.format==="umd"||e.format==="iife")return error(errorInvalidOption("output.format",I,"UMD and IIFE output formats are not supported for code-splitting builds",e.format));if(typeof e.file==="string")return error(errorInvalidOption("output.file",v,'when building multiple chunks, the "output.dir" option must be used, not "output.file". To inline dynamic imports, set the "inlineDynamicImports" option'));if(e.sourcemapFile)return error(errorInvalidOption("output.sourcemapFile",L,'"output.sourcemapFile" is only supported for single-file builds'));if(!e.amd.autoId&&e.amd.id)t(errorInvalidOption("output.amd.id",x,'this option is only properly supported for single-file builds. Use "output.amd.autoId" and "output.amd.basePath" instead'))}function getIncludedModules(e){const t=[];for(const i of e.values()){if(i instanceof Module&&(i.isIncluded()||i.info.isEntry||i.includedDynamicImporters.length>0)){t.push(i)}}return t}function getAbsoluteEntryModulePaths(e,t){const i=[];for(const s of e){if((s.info.isEntry||t)&&isAbsolute(s.id)){i.push(s.id)}}return i}function getExternalChunkByModule(e,t,i){const s=new Map;for(const n of e.values()){if(n instanceof ExternalModule){s.set(n,new ExternalChunk(n,t,i))}}return s}function addModuleToManualChunk(e,t,i){const s=i.get(t);if(typeof s==="string"&&s!==e){return error(errorCannotAssignModuleToChunk(t.id,e,s))}i.set(t,e)}var no=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239];var ro=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,3104,541,1507,4938,6,4191];var oo="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࢘-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_";var ao="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟊꟐꟑꟓꟕ-ꟙꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ";var lo={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"};var co="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this";var uo={5:co,"5module":co+" export import",6:co+" const class extends export import super"};var ho=/^in(stanceof)?$/;var po=new RegExp("["+ao+"]");var fo=new RegExp("["+ao+oo+"]");function isInAstralSet(e,t){var i=65536;for(var s=0;s<t.length;s+=2){i+=t[s];if(i>e){return false}i+=t[s+1];if(i>=e){return true}}return false}function isIdentifierStart(e,t){if(e<65){return e===36}if(e<91){return true}if(e<97){return e===95}if(e<123){return true}if(e<=65535){return e>=170&&po.test(String.fromCharCode(e))}if(t===false){return false}return isInAstralSet(e,ro)}function isIdentifierChar(e,t){if(e<48){return e===36}if(e<58){return true}if(e<65){return false}if(e<91){return true}if(e<97){return e===95}if(e<123){return true}if(e<=65535){return e>=170&&fo.test(String.fromCharCode(e))}if(t===false){return false}return isInAstralSet(e,ro)||isInAstralSet(e,no)}var mo=function TokenType(e,t){if(t===void 0)t={};this.label=e;this.keyword=t.keyword;this.beforeExpr=!!t.beforeExpr;this.startsExpr=!!t.startsExpr;this.isLoop=!!t.isLoop;this.isAssign=!!t.isAssign;this.prefix=!!t.prefix;this.postfix=!!t.postfix;this.binop=t.binop||null;this.updateContext=null};function binop(e,t){return new mo(e,{beforeExpr:true,binop:t})}var go={beforeExpr:true},yo={startsExpr:true};var Eo={};function kw(e,t){if(t===void 0)t={};t.keyword=e;return Eo[e]=new mo(e,t)}var xo={num:new mo("num",yo),regexp:new mo("regexp",yo),string:new mo("string",yo),name:new mo("name",yo),privateId:new mo("privateId",yo),eof:new mo("eof"),bracketL:new mo("[",{beforeExpr:true,startsExpr:true}),bracketR:new mo("]"),braceL:new mo("{",{beforeExpr:true,startsExpr:true}),braceR:new mo("}"),parenL:new mo("(",{beforeExpr:true,startsExpr:true}),parenR:new mo(")"),comma:new mo(",",go),semi:new mo(";",go),colon:new mo(":",go),dot:new mo("."),question:new mo("?",go),questionDot:new mo("?."),arrow:new mo("=>",go),template:new mo("template"),invalidTemplate:new mo("invalidTemplate"),ellipsis:new mo("...",go),backQuote:new mo("`",yo),dollarBraceL:new mo("${",{beforeExpr:true,startsExpr:true}),eq:new mo("=",{beforeExpr:true,isAssign:true}),assign:new mo("_=",{beforeExpr:true,isAssign:true}),incDec:new mo("++/--",{prefix:true,postfix:true,startsExpr:true}),prefix:new mo("!/~",{beforeExpr:true,prefix:true,startsExpr:true}),logicalOR:binop("||",1),logicalAND:binop("&&",2),bitwiseOR:binop("|",3),bitwiseXOR:binop("^",4),bitwiseAND:binop("&",5),equality:binop("==/!=/===/!==",6),relational:binop("</>/<=/>=",7),bitShift:binop("<</>>/>>>",8),plusMin:new mo("+/-",{beforeExpr:true,binop:9,prefix:true,startsExpr:true}),modulo:binop("%",10),star:binop("*",10),slash:binop("/",10),starstar:new mo("**",{beforeExpr:true}),coalesce:binop("??",1),_break:kw("break"),_case:kw("case",go),_catch:kw("catch"),_continue:kw("continue"),_debugger:kw("debugger"),_default:kw("default",go),_do:kw("do",{isLoop:true,beforeExpr:true}),_else:kw("else",go),_finally:kw("finally"),_for:kw("for",{isLoop:true}),_function:kw("function",yo),_if:kw("if"),_return:kw("return",go),_switch:kw("switch"),_throw:kw("throw",go),_try:kw("try"),_var:kw("var"),_const:kw("const"),_while:kw("while",{isLoop:true}),_with:kw("with"),_new:kw("new",{beforeExpr:true,startsExpr:true}),_this:kw("this",yo),_super:kw("super",yo),_class:kw("class",yo),_extends:kw("extends",go),_export:kw("export"),_import:kw("import",yo),_null:kw("null",yo),_true:kw("true",yo),_false:kw("false",yo),_in:kw("in",{beforeExpr:true,binop:7}),_instanceof:kw("instanceof",{beforeExpr:true,binop:7}),_typeof:kw("typeof",{beforeExpr:true,prefix:true,startsExpr:true}),_void:kw("void",{beforeExpr:true,prefix:true,startsExpr:true}),_delete:kw("delete",{beforeExpr:true,prefix:true,startsExpr:true})};var bo=/\r\n?|\n|\u2028|\u2029/;var vo=new RegExp(bo.source,"g");function isNewLine(e){return e===10||e===13||e===8232||e===8233}function nextLineBreak(e,t,i){if(i===void 0)i=e.length;for(var s=t;s<i;s++){var n=e.charCodeAt(s);if(isNewLine(n)){return s<i-1&&n===13&&e.charCodeAt(s+1)===10?s+2:s+1}}return-1}var So=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/;var Ao=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;var wo=Object.prototype;var Io=wo.hasOwnProperty;var ko=wo.toString;var Co=Object.hasOwn||function(e,t){return Io.call(e,t)};var _o=Array.isArray||function(e){return ko.call(e)==="[object Array]"};function wordsRegexp(e){return new RegExp("^(?:"+e.replace(/ /g,"|")+")$")}function codePointToString(e){if(e<=65535){return String.fromCharCode(e)}e-=65536;return String.fromCharCode((e>>10)+55296,(e&1023)+56320)}var Po=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/;var No=function Position(e,t){this.line=e;this.column=t};No.prototype.offset=function offset(e){return new No(this.line,this.column+e)};var Ro=function SourceLocation(e,t,i){this.start=t;this.end=i;if(e.sourceFile!==null){this.source=e.sourceFile}};function getLineInfo(e,t){for(var i=1,s=0;;){var n=nextLineBreak(e,s,t);if(n<0){return new No(i,t-s)}++i;s=n}}var $o={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:false,allowImportExportEverywhere:false,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:false,locations:false,onToken:null,onComment:null,ranges:false,program:null,sourceFile:null,directSourceFile:null,preserveParens:false};var Oo=false;function getOptions(e){var t={};for(var i in $o){t[i]=e&&Co(e,i)?e[i]:$o[i]}if(t.ecmaVersion==="latest"){t.ecmaVersion=1e8}else if(t.ecmaVersion==null){if(!Oo&&typeof console==="object"&&console.warn){Oo=true;console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.")}t.ecmaVersion=11}else if(t.ecmaVersion>=2015){t.ecmaVersion-=2009}if(t.allowReserved==null){t.allowReserved=t.ecmaVersion<5}if(!e||e.allowHashBang==null){t.allowHashBang=t.ecmaVersion>=14}if(_o(t.onToken)){var s=t.onToken;t.onToken=function(e){return s.push(e)}}if(_o(t.onComment)){t.onComment=pushComment(t,t.onComment)}return t}function pushComment(e,t){return function(i,s,n,r,o,l){var c={type:i?"Block":"Line",value:s,start:n,end:r};if(e.locations){c.loc=new Ro(this,o,l)}if(e.ranges){c.range=[n,r]}t.push(c)}}var To=1,Do=2,Mo=4,Lo=8,Bo=16,Fo=32,Vo=64,zo=128,jo=256,Uo=To|Do|jo;function functionFlags(e,t){return Do|(e?Mo:0)|(t?Lo:0)}var Ho=0,Go=1,Wo=2,qo=3,Ko=4,Yo=5;var Qo=function Parser(e,t,i){this.options=e=getOptions(e);this.sourceFile=e.sourceFile;this.keywords=wordsRegexp(uo[e.ecmaVersion>=6?6:e.sourceType==="module"?"5module":5]);var s="";if(e.allowReserved!==true){s=lo[e.ecmaVersion>=6?6:e.ecmaVersion===5?5:3];if(e.sourceType==="module"){s+=" await"}}this.reservedWords=wordsRegexp(s);var n=(s?s+" ":"")+lo.strict;this.reservedWordsStrict=wordsRegexp(n);this.reservedWordsStrictBind=wordsRegexp(n+" "+lo.strictBind);this.input=String(t);this.containsEsc=false;if(i){this.pos=i;this.lineStart=this.input.lastIndexOf("\n",i-1)+1;this.curLine=this.input.slice(0,this.lineStart).split(bo).length}else{this.pos=this.lineStart=0;this.curLine=1}this.type=xo.eof;this.value=null;this.start=this.end=this.pos;this.startLoc=this.endLoc=this.curPosition();this.lastTokEndLoc=this.lastTokStartLoc=null;this.lastTokStart=this.lastTokEnd=this.pos;this.context=this.initialContext();this.exprAllowed=true;this.inModule=e.sourceType==="module";this.strict=this.inModule||this.strictDirective(this.pos);this.potentialArrowAt=-1;this.potentialArrowInForAwait=false;this.yieldPos=this.awaitPos=this.awaitIdentPos=0;this.labels=[];this.undefinedExports=Object.create(null);if(this.pos===0&&e.allowHashBang&&this.input.slice(0,2)==="#!"){this.skipLineComment(2)}this.scopeStack=[];this.enterScope(To);this.regexpState=null;this.privateNameStack=[]};var Xo={inFunction:{configurable:true},inGenerator:{configurable:true},inAsync:{configurable:true},canAwait:{configurable:true},allowSuper:{configurable:true},allowDirectSuper:{configurable:true},treatFunctionsAsVar:{configurable:true},allowNewDotTarget:{configurable:true},inClassStaticBlock:{configurable:true}};Qo.prototype.parse=function parse(){var e=this.options.program||this.startNode();this.nextToken();return this.parseTopLevel(e)};Xo.inFunction.get=function(){return(this.currentVarScope().flags&Do)>0};Xo.inGenerator.get=function(){return(this.currentVarScope().flags&Lo)>0&&!this.currentVarScope().inClassFieldInit};Xo.inAsync.get=function(){return(this.currentVarScope().flags&Mo)>0&&!this.currentVarScope().inClassFieldInit};Xo.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e];if(t.inClassFieldInit||t.flags&jo){return false}if(t.flags&Do){return(t.flags&Mo)>0}}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};Xo.allowSuper.get=function(){var e=this.currentThisScope();var t=e.flags;var i=e.inClassFieldInit;return(t&Vo)>0||i||this.options.allowSuperOutsideMethod};Xo.allowDirectSuper.get=function(){return(this.currentThisScope().flags&zo)>0};Xo.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};Xo.allowNewDotTarget.get=function(){var e=this.currentThisScope();var t=e.flags;var i=e.inClassFieldInit;return(t&(Do|jo))>0||i};Xo.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&jo)>0};Qo.extend=function extend(){var e=[],t=arguments.length;while(t--)e[t]=arguments[t];var i=this;for(var s=0;s<e.length;s++){i=e[s](i)}return i};Qo.parse=function parse(e,t){return new this(t,e).parse()};Qo.parseExpressionAt=function parseExpressionAt(e,t,i){var s=new this(i,e,t);s.nextToken();return s.parseExpression()};Qo.tokenizer=function tokenizer(e,t){return new this(t,e)};Object.defineProperties(Qo.prototype,Xo);var Zo=Qo.prototype;var Jo=/^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;Zo.strictDirective=function(e){if(this.options.ecmaVersion<5){return false}for(;;){Ao.lastIndex=e;e+=Ao.exec(this.input)[0].length;var t=Jo.exec(this.input.slice(e));if(!t){return false}if((t[1]||t[2])==="use strict"){Ao.lastIndex=e+t[0].length;var i=Ao.exec(this.input),s=i.index+i[0].length;var n=this.input.charAt(s);return n===";"||n==="}"||bo.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(n)||n==="!"&&this.input.charAt(s+1)==="=")}e+=t[0].length;Ao.lastIndex=e;e+=Ao.exec(this.input)[0].length;if(this.input[e]===";"){e++}}};Zo.eat=function(e){if(this.type===e){this.next();return true}else{return false}};Zo.isContextual=function(e){return this.type===xo.name&&this.value===e&&!this.containsEsc};Zo.eatContextual=function(e){if(!this.isContextual(e)){return false}this.next();return true};Zo.expectContextual=function(e){if(!this.eatContextual(e)){this.unexpected()}};Zo.canInsertSemicolon=function(){return this.type===xo.eof||this.type===xo.braceR||bo.test(this.input.slice(this.lastTokEnd,this.start))};Zo.insertSemicolon=function(){if(this.canInsertSemicolon()){if(this.options.onInsertedSemicolon){this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc)}return true}};Zo.semicolon=function(){if(!this.eat(xo.semi)&&!this.insertSemicolon()){this.unexpected()}};Zo.afterTrailingComma=function(e,t){if(this.type===e){if(this.options.onTrailingComma){this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc)}if(!t){this.next()}return true}};Zo.expect=function(e){this.eat(e)||this.unexpected()};Zo.unexpected=function(e){this.raise(e!=null?e:this.start,"Unexpected token")};var ea=function DestructuringErrors(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};Zo.checkPatternErrors=function(e,t){if(!e){return}if(e.trailingComma>-1){this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element")}var i=t?e.parenthesizedAssign:e.parenthesizedBind;if(i>-1){this.raiseRecoverable(i,t?"Assigning to rvalue":"Parenthesized pattern")}};Zo.checkExpressionErrors=function(e,t){if(!e){return false}var i=e.shorthandAssign;var s=e.doubleProto;if(!t){return i>=0||s>=0}if(i>=0){this.raise(i,"Shorthand property assignments are valid only in destructuring patterns")}if(s>=0){this.raiseRecoverable(s,"Redefinition of __proto__ property")}};Zo.checkYieldAwaitInDefaultParams=function(){if(this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)){this.raise(this.yieldPos,"Yield expression cannot be a default value")}if(this.awaitPos){this.raise(this.awaitPos,"Await expression cannot be a default value")}};Zo.isSimpleAssignTarget=function(e){if(e.type==="ParenthesizedExpression"){return this.isSimpleAssignTarget(e.expression)}return e.type==="Identifier"||e.type==="MemberExpression"};var ta=Qo.prototype;ta.parseTopLevel=function(e){var t=Object.create(null);if(!e.body){e.body=[]}while(this.type!==xo.eof){var i=this.parseStatement(null,true,t);e.body.push(i)}if(this.inModule){for(var s=0,n=Object.keys(this.undefinedExports);s<n.length;s+=1){var r=n[s];this.raiseRecoverable(this.undefinedExports[r].start,"Export '"+r+"' is not defined")}}this.adaptDirectivePrologue(e.body);this.next();e.sourceType=this.options.sourceType;return this.finishNode(e,"Program")};var ia={kind:"loop"},sa={kind:"switch"};ta.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let")){return false}Ao.lastIndex=this.pos;var t=Ao.exec(this.input);var i=this.pos+t[0].length,s=this.input.charCodeAt(i);if(s===91||s===92){return true}if(e){return false}if(s===123||s>55295&&s<56320){return true}if(isIdentifierStart(s,true)){var n=i+1;while(isIdentifierChar(s=this.input.charCodeAt(n),true)){++n}if(s===92||s>55295&&s<56320){return true}var r=this.input.slice(i,n);if(!ho.test(r)){return true}}return false};ta.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async")){return false}Ao.lastIndex=this.pos;var e=Ao.exec(this.input);var t=this.pos+e[0].length,i;return!bo.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(isIdentifierChar(i=this.input.charCodeAt(t+8))||i>55295&&i<56320))};ta.parseStatement=function(e,t,i){var s=this.type,n=this.startNode(),r;if(this.isLet(e)){s=xo._var;r="let"}switch(s){case xo._break:case xo._continue:return this.parseBreakContinueStatement(n,s.keyword);case xo._debugger:return this.parseDebuggerStatement(n);case xo._do:return this.parseDoStatement(n);case xo._for:return this.parseForStatement(n);case xo._function:if(e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6){this.unexpected()}return this.parseFunctionStatement(n,false,!e);case xo._class:if(e){this.unexpected()}return this.parseClass(n,true);case xo._if:return this.parseIfStatement(n);case xo._return:return this.parseReturnStatement(n);case xo._switch:return this.parseSwitchStatement(n);case xo._throw:return this.parseThrowStatement(n);case xo._try:return this.parseTryStatement(n);case xo._const:case xo._var:r=r||this.value;if(e&&r!=="var"){this.unexpected()}return this.parseVarStatement(n,r);case xo._while:return this.parseWhileStatement(n);case xo._with:return this.parseWithStatement(n);case xo.braceL:return this.parseBlock(true,n);case xo.semi:return this.parseEmptyStatement(n);case xo._export:case xo._import:if(this.options.ecmaVersion>10&&s===xo._import){Ao.lastIndex=this.pos;var o=Ao.exec(this.input);var l=this.pos+o[0].length,c=this.input.charCodeAt(l);if(c===40||c===46){return this.parseExpressionStatement(n,this.parseExpression())}}if(!this.options.allowImportExportEverywhere){if(!t){this.raise(this.start,"'import' and 'export' may only appear at the top level")}if(!this.inModule){this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")}}return s===xo._import?this.parseImport(n):this.parseExport(n,i);default:if(this.isAsyncFunction()){if(e){this.unexpected()}this.next();return this.parseFunctionStatement(n,true,!e)}var u=this.value,h=this.parseExpression();if(s===xo.name&&h.type==="Identifier"&&this.eat(xo.colon)){return this.parseLabeledStatement(n,u,h,e)}else{return this.parseExpressionStatement(n,h)}}};ta.parseBreakContinueStatement=function(e,t){var i=t==="break";this.next();if(this.eat(xo.semi)||this.insertSemicolon()){e.label=null}else if(this.type!==xo.name){this.unexpected()}else{e.label=this.parseIdent();this.semicolon()}var s=0;for(;s<this.labels.length;++s){var n=this.labels[s];if(e.label==null||n.name===e.label.name){if(n.kind!=null&&(i||n.kind==="loop")){break}if(e.label&&i){break}}}if(s===this.labels.length){this.raise(e.start,"Unsyntactic "+t)}return this.finishNode(e,i?"BreakStatement":"ContinueStatement")};ta.parseDebuggerStatement=function(e){this.next();this.semicolon();return this.finishNode(e,"DebuggerStatement")};ta.parseDoStatement=function(e){this.next();this.labels.push(ia);e.body=this.parseStatement("do");this.labels.pop();this.expect(xo._while);e.test=this.parseParenExpression();if(this.options.ecmaVersion>=6){this.eat(xo.semi)}else{this.semicolon()}return this.finishNode(e,"DoWhileStatement")};ta.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;this.labels.push(ia);this.enterScope(0);this.expect(xo.parenL);if(this.type===xo.semi){if(t>-1){this.unexpected(t)}return this.parseFor(e,null)}var i=this.isLet();if(this.type===xo._var||this.type===xo._const||i){var s=this.startNode(),n=i?"let":this.value;this.next();this.parseVar(s,true,n);this.finishNode(s,"VariableDeclaration");if((this.type===xo._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&s.declarations.length===1){if(this.options.ecmaVersion>=9){if(this.type===xo._in){if(t>-1){this.unexpected(t)}}else{e.await=t>-1}}return this.parseForIn(e,s)}if(t>-1){this.unexpected(t)}return this.parseFor(e,s)}var r=this.isContextual("let"),o=false;var l=new ea;var c=this.parseExpression(t>-1?"await":true,l);if(this.type===xo._in||(o=this.options.ecmaVersion>=6&&this.isContextual("of"))){if(this.options.ecmaVersion>=9){if(this.type===xo._in){if(t>-1){this.unexpected(t)}}else{e.await=t>-1}}if(r&&o){this.raise(c.start,"The left-hand side of a for-of loop may not start with 'let'.")}this.toAssignable(c,false,l);this.checkLValPattern(c);return this.parseForIn(e,c)}else{this.checkExpressionErrors(l,true)}if(t>-1){this.unexpected(t)}return this.parseFor(e,c)};ta.parseFunctionStatement=function(e,t,i){this.next();return this.parseFunction(e,ra|(i?0:oa),false,t)};ta.parseIfStatement=function(e){this.next();e.test=this.parseParenExpression();e.consequent=this.parseStatement("if");e.alternate=this.eat(xo._else)?this.parseStatement("if"):null;return this.finishNode(e,"IfStatement")};ta.parseReturnStatement=function(e){if(!this.inFunction&&!this.options.allowReturnOutsideFunction){this.raise(this.start,"'return' outside of function")}this.next();if(this.eat(xo.semi)||this.insertSemicolon()){e.argument=null}else{e.argument=this.parseExpression();this.semicolon()}return this.finishNode(e,"ReturnStatement")};ta.parseSwitchStatement=function(e){this.next();e.discriminant=this.parseParenExpression();e.cases=[];this.expect(xo.braceL);this.labels.push(sa);this.enterScope(0);var t;for(var i=false;this.type!==xo.braceR;){if(this.type===xo._case||this.type===xo._default){var s=this.type===xo._case;if(t){this.finishNode(t,"SwitchCase")}e.cases.push(t=this.startNode());t.consequent=[];this.next();if(s){t.test=this.parseExpression()}else{if(i){this.raiseRecoverable(this.lastTokStart,"Multiple default clauses")}i=true;t.test=null}this.expect(xo.colon)}else{if(!t){this.unexpected()}t.consequent.push(this.parseStatement(null))}}this.exitScope();if(t){this.finishNode(t,"SwitchCase")}this.next();this.labels.pop();return this.finishNode(e,"SwitchStatement")};ta.parseThrowStatement=function(e){this.next();if(bo.test(this.input.slice(this.lastTokEnd,this.start))){this.raise(this.lastTokEnd,"Illegal newline after throw")}e.argument=this.parseExpression();this.semicolon();return this.finishNode(e,"ThrowStatement")};var na=[];ta.parseTryStatement=function(e){this.next();e.block=this.parseBlock();e.handler=null;if(this.type===xo._catch){var t=this.startNode();this.next();if(this.eat(xo.parenL)){t.param=this.parseBindingAtom();var i=t.param.type==="Identifier";this.enterScope(i?Fo:0);this.checkLValPattern(t.param,i?Ko:Wo);this.expect(xo.parenR)}else{if(this.options.ecmaVersion<10){this.unexpected()}t.param=null;this.enterScope(0)}t.body=this.parseBlock(false);this.exitScope();e.handler=this.finishNode(t,"CatchClause")}e.finalizer=this.eat(xo._finally)?this.parseBlock():null;if(!e.handler&&!e.finalizer){this.raise(e.start,"Missing catch or finally clause")}return this.finishNode(e,"TryStatement")};ta.parseVarStatement=function(e,t){this.next();this.parseVar(e,false,t);this.semicolon();return this.finishNode(e,"VariableDeclaration")};ta.parseWhileStatement=function(e){this.next();e.test=this.parseParenExpression();this.labels.push(ia);e.body=this.parseStatement("while");this.labels.pop();return this.finishNode(e,"WhileStatement")};ta.parseWithStatement=function(e){if(this.strict){this.raise(this.start,"'with' in strict mode")}this.next();e.object=this.parseParenExpression();e.body=this.parseStatement("with");return this.finishNode(e,"WithStatement")};ta.parseEmptyStatement=function(e){this.next();return this.finishNode(e,"EmptyStatement")};ta.parseLabeledStatement=function(e,t,i,s){for(var n=0,r=this.labels;n<r.length;n+=1){var o=r[n];if(o.name===t){this.raise(i.start,"Label '"+t+"' is already declared")}}var l=this.type.isLoop?"loop":this.type===xo._switch?"switch":null;for(var c=this.labels.length-1;c>=0;c--){var u=this.labels[c];if(u.statementStart===e.start){u.statementStart=this.start;u.kind=l}else{break}}this.labels.push({name:t,kind:l,statementStart:this.start});e.body=this.parseStatement(s?s.indexOf("label")===-1?s+"label":s:"label");this.labels.pop();e.label=i;return this.finishNode(e,"LabeledStatement")};ta.parseExpressionStatement=function(e,t){e.expression=t;this.semicolon();return this.finishNode(e,"ExpressionStatement")};ta.parseBlock=function(e,t,i){if(e===void 0)e=true;if(t===void 0)t=this.startNode();t.body=[];this.expect(xo.braceL);if(e){this.enterScope(0)}while(this.type!==xo.braceR){var s=this.parseStatement(null);t.body.push(s)}if(i){this.strict=false}this.next();if(e){this.exitScope()}return this.finishNode(t,"BlockStatement")};ta.parseFor=function(e,t){e.init=t;this.expect(xo.semi);e.test=this.type===xo.semi?null:this.parseExpression();this.expect(xo.semi);e.update=this.type===xo.parenR?null:this.parseExpression();this.expect(xo.parenR);e.body=this.parseStatement("for");this.exitScope();this.labels.pop();return this.finishNode(e,"ForStatement")};ta.parseForIn=function(e,t){var i=this.type===xo._in;this.next();if(t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!i||this.options.ecmaVersion<8||this.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier")){this.raise(t.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer")}e.left=t;e.right=i?this.parseExpression():this.parseMaybeAssign();this.expect(xo.parenR);e.body=this.parseStatement("for");this.exitScope();this.labels.pop();return this.finishNode(e,i?"ForInStatement":"ForOfStatement")};ta.parseVar=function(e,t,i){e.declarations=[];e.kind=i;for(;;){var s=this.startNode();this.parseVarId(s,i);if(this.eat(xo.eq)){s.init=this.parseMaybeAssign(t)}else if(i==="const"&&!(this.type===xo._in||this.options.ecmaVersion>=6&&this.isContextual("of"))){this.unexpected()}else if(s.id.type!=="Identifier"&&!(t&&(this.type===xo._in||this.isContextual("of")))){this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value")}else{s.init=null}e.declarations.push(this.finishNode(s,"VariableDeclarator"));if(!this.eat(xo.comma)){break}}return e};ta.parseVarId=function(e,t){e.id=this.parseBindingAtom();this.checkLValPattern(e.id,t==="var"?Go:Wo,false)};var ra=1,oa=2,aa=4;ta.parseFunction=function(e,t,i,s,n){this.initFunction(e);if(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!s){if(this.type===xo.star&&t&oa){this.unexpected()}e.generator=this.eat(xo.star)}if(this.options.ecmaVersion>=8){e.async=!!s}if(t&ra){e.id=t&aa&&this.type!==xo.name?null:this.parseIdent();if(e.id&&!(t&oa)){this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?Go:Wo:qo)}}var r=this.yieldPos,o=this.awaitPos,l=this.awaitIdentPos;this.yieldPos=0;this.awaitPos=0;this.awaitIdentPos=0;this.enterScope(functionFlags(e.async,e.generator));if(!(t&ra)){e.id=this.type===xo.name?this.parseIdent():null}this.parseFunctionParams(e);this.parseFunctionBody(e,i,false,n);this.yieldPos=r;this.awaitPos=o;this.awaitIdentPos=l;return this.finishNode(e,t&ra?"FunctionDeclaration":"FunctionExpression")};ta.parseFunctionParams=function(e){this.expect(xo.parenL);e.params=this.parseBindingList(xo.parenR,false,this.options.ecmaVersion>=8);this.checkYieldAwaitInDefaultParams()};ta.parseClass=function(e,t){this.next();var i=this.strict;this.strict=true;this.parseClassId(e,t);this.parseClassSuper(e);var s=this.enterClassBody();var n=this.startNode();var r=false;n.body=[];this.expect(xo.braceL);while(this.type!==xo.braceR){var o=this.parseClassElement(e.superClass!==null);if(o){n.body.push(o);if(o.type==="MethodDefinition"&&o.kind==="constructor"){if(r){this.raise(o.start,"Duplicate constructor in the same class")}r=true}else if(o.key&&o.key.type==="PrivateIdentifier"&&isPrivateNameConflicted(s,o)){this.raiseRecoverable(o.key.start,"Identifier '#"+o.key.name+"' has already been declared")}}}this.strict=i;this.next();e.body=this.finishNode(n,"ClassBody");this.exitClassBody();return this.finishNode(e,t?"ClassDeclaration":"ClassExpression")};ta.parseClassElement=function(e){if(this.eat(xo.semi)){return null}var t=this.options.ecmaVersion;var i=this.startNode();var s="";var n=false;var r=false;var o="method";var l=false;if(this.eatContextual("static")){if(t>=13&&this.eat(xo.braceL)){this.parseClassStaticBlock(i);return i}if(this.isClassElementNameStart()||this.type===xo.star){l=true}else{s="static"}}i.static=l;if(!s&&t>=8&&this.eatContextual("async")){if((this.isClassElementNameStart()||this.type===xo.star)&&!this.canInsertSemicolon()){r=true}else{s="async"}}if(!s&&(t>=9||!r)&&this.eat(xo.star)){n=true}if(!s&&!r&&!n){var c=this.value;if(this.eatContextual("get")||this.eatContextual("set")){if(this.isClassElementNameStart()){o=c}else{s=c}}}if(s){i.computed=false;i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc);i.key.name=s;this.finishNode(i.key,"Identifier")}else{this.parseClassElementName(i)}if(t<13||this.type===xo.parenL||o!=="method"||n||r){var u=!i.static&&checkKeyName(i,"constructor");var h=u&&e;if(u&&o!=="method"){this.raise(i.key.start,"Constructor can't have get/set modifier")}i.kind=u?"constructor":o;this.parseClassMethod(i,n,r,h)}else{this.parseClassField(i)}return i};ta.isClassElementNameStart=function(){return this.type===xo.name||this.type===xo.privateId||this.type===xo.num||this.type===xo.string||this.type===xo.bracketL||this.type.keyword};ta.parseClassElementName=function(e){if(this.type===xo.privateId){if(this.value==="constructor"){this.raise(this.start,"Classes can't have an element named '#constructor'")}e.computed=false;e.key=this.parsePrivateIdent()}else{this.parsePropertyName(e)}};ta.parseClassMethod=function(e,t,i,s){var n=e.key;if(e.kind==="constructor"){if(t){this.raise(n.start,"Constructor can't be a generator")}if(i){this.raise(n.start,"Constructor can't be an async method")}}else if(e.static&&checkKeyName(e,"prototype")){this.raise(n.start,"Classes may not have a static property named prototype")}var r=e.value=this.parseMethod(t,i,s);if(e.kind==="get"&&r.params.length!==0){this.raiseRecoverable(r.start,"getter should have no params")}if(e.kind==="set"&&r.params.length!==1){this.raiseRecoverable(r.start,"setter should have exactly one param")}if(e.kind==="set"&&r.params[0].type==="RestElement"){this.raiseRecoverable(r.params[0].start,"Setter cannot use rest params")}return this.finishNode(e,"MethodDefinition")};ta.parseClassField=function(e){if(checkKeyName(e,"constructor")){this.raise(e.key.start,"Classes can't have a field named 'constructor'")}else if(e.static&&checkKeyName(e,"prototype")){this.raise(e.key.start,"Classes can't have a static field named 'prototype'")}if(this.eat(xo.eq)){var t=this.currentThisScope();var i=t.inClassFieldInit;t.inClassFieldInit=true;e.value=this.parseMaybeAssign();t.inClassFieldInit=i}else{e.value=null}this.semicolon();return this.finishNode(e,"PropertyDefinition")};ta.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;this.labels=[];this.enterScope(jo|Vo);while(this.type!==xo.braceR){var i=this.parseStatement(null);e.body.push(i)}this.next();this.exitScope();this.labels=t;return this.finishNode(e,"StaticBlock")};ta.parseClassId=function(e,t){if(this.type===xo.name){e.id=this.parseIdent();if(t){this.checkLValSimple(e.id,Wo,false)}}else{if(t===true){this.unexpected()}e.id=null}};ta.parseClassSuper=function(e){e.superClass=this.eat(xo._extends)?this.parseExprSubscripts(null,false):null};ta.enterClassBody=function(){var e={declared:Object.create(null),used:[]};this.privateNameStack.push(e);return e.declared};ta.exitClassBody=function(){var e=this.privateNameStack.pop();var t=e.declared;var i=e.used;var s=this.privateNameStack.length;var n=s===0?null:this.privateNameStack[s-1];for(var r=0;r<i.length;++r){var o=i[r];if(!Co(t,o.name)){if(n){n.used.push(o)}else{this.raiseRecoverable(o.start,"Private field '#"+o.name+"' must be declared in an enclosing class")}}}};function isPrivateNameConflicted(e,t){var i=t.key.name;var s=e[i];var n="true";if(t.type==="MethodDefinition"&&(t.kind==="get"||t.kind==="set")){n=(t.static?"s":"i")+t.kind}if(s==="iget"&&n==="iset"||s==="iset"&&n==="iget"||s==="sget"&&n==="sset"||s==="sset"&&n==="sget"){e[i]="true";return false}else if(!s){e[i]=n;return false}else{return true}}function checkKeyName(e,t){var i=e.computed;var s=e.key;return!i&&(s.type==="Identifier"&&s.name===t||s.type==="Literal"&&s.value===t)}ta.parseExport=function(e,t){this.next();if(this.eat(xo.star)){if(this.options.ecmaVersion>=11){if(this.eatContextual("as")){e.exported=this.parseModuleExportName();this.checkExport(t,e.exported,this.lastTokStart)}else{e.exported=null}}this.expectContextual("from");if(this.type!==xo.string){this.unexpected()}e.source=this.parseExprAtom();this.semicolon();return this.finishNode(e,"ExportAllDeclaration")}if(this.eat(xo._default)){this.checkExport(t,"default",this.lastTokStart);var i;if(this.type===xo._function||(i=this.isAsyncFunction())){var s=this.startNode();this.next();if(i){this.next()}e.declaration=this.parseFunction(s,ra|aa,false,i)}else if(this.type===xo._class){var n=this.startNode();e.declaration=this.parseClass(n,"nullableID")}else{e.declaration=this.parseMaybeAssign();this.semicolon()}return this.finishNode(e,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement()){e.declaration=this.parseStatement(null);if(e.declaration.type==="VariableDeclaration"){this.checkVariableExport(t,e.declaration.declarations)}else{this.checkExport(t,e.declaration.id,e.declaration.id.start)}e.specifiers=[];e.source=null}else{e.declaration=null;e.specifiers=this.parseExportSpecifiers(t);if(this.eatContextual("from")){if(this.type!==xo.string){this.unexpected()}e.source=this.parseExprAtom()}else{for(var r=0,o=e.specifiers;r<o.length;r+=1){var l=o[r];this.checkUnreserved(l.local);this.checkLocalExport(l.local);if(l.local.type==="Literal"){this.raise(l.local.start,"A string literal cannot be used as an exported binding without `from`.")}}e.source=null}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")};ta.checkExport=function(e,t,i){if(!e){return}if(typeof t!=="string"){t=t.type==="Identifier"?t.name:t.value}if(Co(e,t)){this.raiseRecoverable(i,"Duplicate export '"+t+"'")}e[t]=true};ta.checkPatternExport=function(e,t){var i=t.type;if(i==="Identifier"){this.checkExport(e,t,t.start)}else if(i==="ObjectPattern"){for(var s=0,n=t.properties;s<n.length;s+=1){var r=n[s];this.checkPatternExport(e,r)}}else if(i==="ArrayPattern"){for(var o=0,l=t.elements;o<l.length;o+=1){var c=l[o];if(c){this.checkPatternExport(e,c)}}}else if(i==="Property"){this.checkPatternExport(e,t.value)}else if(i==="AssignmentPattern"){this.checkPatternExport(e,t.left)}else if(i==="RestElement"){this.checkPatternExport(e,t.argument)}else if(i==="ParenthesizedExpression"){this.checkPatternExport(e,t.expression)}};ta.checkVariableExport=function(e,t){if(!e){return}for(var i=0,s=t;i<s.length;i+=1){var n=s[i];this.checkPatternExport(e,n.id)}};ta.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};ta.parseExportSpecifiers=function(e){var t=[],i=true;this.expect(xo.braceL);while(!this.eat(xo.braceR)){if(!i){this.expect(xo.comma);if(this.afterTrailingComma(xo.braceR)){break}}else{i=false}var s=this.startNode();s.local=this.parseModuleExportName();s.exported=this.eatContextual("as")?this.parseModuleExportName():s.local;this.checkExport(e,s.exported,s.exported.start);t.push(this.finishNode(s,"ExportSpecifier"))}return t};ta.parseImport=function(e){this.next();if(this.type===xo.string){e.specifiers=na;e.source=this.parseExprAtom()}else{e.specifiers=this.parseImportSpecifiers();this.expectContextual("from");e.source=this.type===xo.string?this.parseExprAtom():this.unexpected()}this.semicolon();return this.finishNode(e,"ImportDeclaration")};ta.parseImportSpecifiers=function(){var e=[],t=true;if(this.type===xo.name){var i=this.startNode();i.local=this.parseIdent();this.checkLValSimple(i.local,Wo);e.push(this.finishNode(i,"ImportDefaultSpecifier"));if(!this.eat(xo.comma)){return e}}if(this.type===xo.star){var s=this.startNode();this.next();this.expectContextual("as");s.local=this.parseIdent();this.checkLValSimple(s.local,Wo);e.push(this.finishNode(s,"ImportNamespaceSpecifier"));return e}this.expect(xo.braceL);while(!this.eat(xo.braceR)){if(!t){this.expect(xo.comma);if(this.afterTrailingComma(xo.braceR)){break}}else{t=false}var n=this.startNode();n.imported=this.parseModuleExportName();if(this.eatContextual("as")){n.local=this.parseIdent()}else{this.checkUnreserved(n.imported);n.local=n.imported}this.checkLValSimple(n.local,Wo);e.push(this.finishNode(n,"ImportSpecifier"))}return e};ta.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===xo.string){var e=this.parseLiteral(this.value);if(Po.test(e.value)){this.raise(e.start,"An export name cannot include a lone surrogate.")}return e}return this.parseIdent(true)};ta.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t){e[t].directive=e[t].expression.raw.slice(1,-1)}};ta.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value==="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var la=Qo.prototype;la.toAssignable=function(e,t,i){if(this.options.ecmaVersion>=6&&e){switch(e.type){case"Identifier":if(this.inAsync&&e.name==="await"){this.raise(e.start,"Cannot use 'await' as identifier inside an async function")}break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern";if(i){this.checkPatternErrors(i,true)}for(var s=0,n=e.properties;s<n.length;s+=1){var r=n[s];this.toAssignable(r,t);if(r.type==="RestElement"&&(r.argument.type==="ArrayPattern"||r.argument.type==="ObjectPattern")){this.raise(r.argument.start,"Unexpected token")}}break;case"Property":if(e.kind!=="init"){this.raise(e.key.start,"Object pattern can't contain getter or setter")}this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern";if(i){this.checkPatternErrors(i,true)}this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement";this.toAssignable(e.argument,t);if(e.argument.type==="AssignmentPattern"){this.raise(e.argument.start,"Rest elements cannot have a default value")}break;case"AssignmentExpression":if(e.operator!=="="){this.raise(e.left.end,"Only '=' operator can be used for specifying default value.")}e.type="AssignmentPattern";delete e.operator;this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,i);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t){break}default:this.raise(e.start,"Assigning to rvalue")}}else if(i){this.checkPatternErrors(i,true)}return e};la.toAssignableList=function(e,t){var i=e.length;for(var s=0;s<i;s++){var n=e[s];if(n){this.toAssignable(n,t)}}if(i){var r=e[i-1];if(this.options.ecmaVersion===6&&t&&r&&r.type==="RestElement"&&r.argument.type!=="Identifier"){this.unexpected(r.argument.start)}}return e};la.parseSpread=function(e){var t=this.startNode();this.next();t.argument=this.parseMaybeAssign(false,e);return this.finishNode(t,"SpreadElement")};la.parseRestBinding=function(){var e=this.startNode();this.next();if(this.options.ecmaVersion===6&&this.type!==xo.name){this.unexpected()}e.argument=this.parseBindingAtom();return this.finishNode(e,"RestElement")};la.parseBindingAtom=function(){if(this.options.ecmaVersion>=6){switch(this.type){case xo.bracketL:var e=this.startNode();this.next();e.elements=this.parseBindingList(xo.bracketR,true,true);return this.finishNode(e,"ArrayPattern");case xo.braceL:return this.parseObj(true)}}return this.parseIdent()};la.parseBindingList=function(e,t,i){var s=[],n=true;while(!this.eat(e)){if(n){n=false}else{this.expect(xo.comma)}if(t&&this.type===xo.comma){s.push(null)}else if(i&&this.afterTrailingComma(e)){break}else if(this.type===xo.ellipsis){var r=this.parseRestBinding();this.parseBindingListItem(r);s.push(r);if(this.type===xo.comma){this.raise(this.start,"Comma is not permitted after the rest element")}this.expect(e);break}else{var o=this.parseMaybeDefault(this.start,this.startLoc);this.parseBindingListItem(o);s.push(o)}}return s};la.parseBindingListItem=function(e){return e};la.parseMaybeDefault=function(e,t,i){i=i||this.parseBindingAtom();if(this.options.ecmaVersion<6||!this.eat(xo.eq)){return i}var s=this.startNodeAt(e,t);s.left=i;s.right=this.parseMaybeAssign();return this.finishNode(s,"AssignmentPattern")};la.checkLValSimple=function(e,t,i){if(t===void 0)t=Ho;var s=t!==Ho;switch(e.type){case"Identifier":if(this.strict&&this.reservedWordsStrictBind.test(e.name)){this.raiseRecoverable(e.start,(s?"Binding ":"Assigning to ")+e.name+" in strict mode")}if(s){if(t===Wo&&e.name==="let"){this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name")}if(i){if(Co(i,e.name)){this.raiseRecoverable(e.start,"Argument name clash")}i[e.name]=true}if(t!==Yo){this.declareName(e.name,t,e.start)}}break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(s){this.raiseRecoverable(e.start,"Binding member expression")}break;case"ParenthesizedExpression":if(s){this.raiseRecoverable(e.start,"Binding parenthesized expression")}return this.checkLValSimple(e.expression,t,i);default:this.raise(e.start,(s?"Binding":"Assigning to")+" rvalue")}};la.checkLValPattern=function(e,t,i){if(t===void 0)t=Ho;switch(e.type){case"ObjectPattern":for(var s=0,n=e.properties;s<n.length;s+=1){var r=n[s];this.checkLValInnerPattern(r,t,i)}break;case"ArrayPattern":for(var o=0,l=e.elements;o<l.length;o+=1){var c=l[o];if(c){this.checkLValInnerPattern(c,t,i)}}break;default:this.checkLValSimple(e,t,i)}};la.checkLValInnerPattern=function(e,t,i){if(t===void 0)t=Ho;switch(e.type){case"Property":this.checkLValInnerPattern(e.value,t,i);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,i);break;case"RestElement":this.checkLValPattern(e.argument,t,i);break;default:this.checkLValPattern(e,t,i)}};var ca=function TokContext(e,t,i,s,n){this.token=e;this.isExpr=!!t;this.preserveSpace=!!i;this.override=s;this.generator=!!n};var ua={b_stat:new ca("{",false),b_expr:new ca("{",true),b_tmpl:new ca("${",false),p_stat:new ca("(",false),p_expr:new ca("(",true),q_tmpl:new ca("`",true,true,(function(e){return e.tryReadTemplateToken()})),f_stat:new ca("function",false),f_expr:new ca("function",true),f_expr_gen:new ca("function",true,false,null,true),f_gen:new ca("function",false,false,null,true)};var ha=Qo.prototype;ha.initialContext=function(){return[ua.b_stat]};ha.curContext=function(){return this.context[this.context.length-1]};ha.braceIsBlock=function(e){var t=this.curContext();if(t===ua.f_expr||t===ua.f_stat){return true}if(e===xo.colon&&(t===ua.b_stat||t===ua.b_expr)){return!t.isExpr}if(e===xo._return||e===xo.name&&this.exprAllowed){return bo.test(this.input.slice(this.lastTokEnd,this.start))}if(e===xo._else||e===xo.semi||e===xo.eof||e===xo.parenR||e===xo.arrow){return true}if(e===xo.braceL){return t===ua.b_stat}if(e===xo._var||e===xo._const||e===xo.name){return false}return!this.exprAllowed};ha.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token==="function"){return t.generator}}return false};ha.updateContext=function(e){var t,i=this.type;if(i.keyword&&e===xo.dot){this.exprAllowed=false}else if(t=i.updateContext){t.call(this,e)}else{this.exprAllowed=i.beforeExpr}};ha.overrideContext=function(e){if(this.curContext()!==e){this.context[this.context.length-1]=e}};xo.parenR.updateContext=xo.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=true;return}var e=this.context.pop();if(e===ua.b_stat&&this.curContext().token==="function"){e=this.context.pop()}this.exprAllowed=!e.isExpr};xo.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?ua.b_stat:ua.b_expr);this.exprAllowed=true};xo.dollarBraceL.updateContext=function(){this.context.push(ua.b_tmpl);this.exprAllowed=true};xo.parenL.updateContext=function(e){var t=e===xo._if||e===xo._for||e===xo._with||e===xo._while;this.context.push(t?ua.p_stat:ua.p_expr);this.exprAllowed=true};xo.incDec.updateContext=function(){};xo._function.updateContext=xo._class.updateContext=function(e){if(e.beforeExpr&&e!==xo._else&&!(e===xo.semi&&this.curContext()!==ua.p_stat)&&!(e===xo._return&&bo.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===xo.colon||e===xo.braceL)&&this.curContext()===ua.b_stat)){this.context.push(ua.f_expr)}else{this.context.push(ua.f_stat)}this.exprAllowed=false};xo.backQuote.updateContext=function(){if(this.curContext()===ua.q_tmpl){this.context.pop()}else{this.context.push(ua.q_tmpl)}this.exprAllowed=false};xo.star.updateContext=function(e){if(e===xo._function){var t=this.context.length-1;if(this.context[t]===ua.f_expr){this.context[t]=ua.f_expr_gen}else{this.context[t]=ua.f_gen}}this.exprAllowed=true};xo.name.updateContext=function(e){var t=false;if(this.options.ecmaVersion>=6&&e!==xo.dot){if(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext()){t=true}}this.exprAllowed=t};var da=Qo.prototype;da.checkPropClash=function(e,t,i){if(this.options.ecmaVersion>=9&&e.type==="SpreadElement"){return}if(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand)){return}var s=e.key;var n;switch(s.type){case"Identifier":n=s.name;break;case"Literal":n=String(s.value);break;default:return}var r=e.kind;if(this.options.ecmaVersion>=6){if(n==="__proto__"&&r==="init"){if(t.proto){if(i){if(i.doubleProto<0){i.doubleProto=s.start}}else{this.raiseRecoverable(s.start,"Redefinition of __proto__ property")}}t.proto=true}return}n="$"+n;var o=t[n];if(o){var l;if(r==="init"){l=this.strict&&o.init||o.get||o.set}else{l=o.init||o[r]}if(l){this.raiseRecoverable(s.start,"Redefinition of property")}}else{o=t[n]={init:false,get:false,set:false}}o[r]=true};da.parseExpression=function(e,t){var i=this.start,s=this.startLoc;var n=this.parseMaybeAssign(e,t);if(this.type===xo.comma){var r=this.startNodeAt(i,s);r.expressions=[n];while(this.eat(xo.comma)){r.expressions.push(this.parseMaybeAssign(e,t))}return this.finishNode(r,"SequenceExpression")}return n};da.parseMaybeAssign=function(e,t,i){if(this.isContextual("yield")){if(this.inGenerator){return this.parseYield(e)}else{this.exprAllowed=false}}var s=false,n=-1,r=-1,o=-1;if(t){n=t.parenthesizedAssign;r=t.trailingComma;o=t.doubleProto;t.parenthesizedAssign=t.trailingComma=-1}else{t=new ea;s=true}var l=this.start,c=this.startLoc;if(this.type===xo.parenL||this.type===xo.name){this.potentialArrowAt=this.start;this.potentialArrowInForAwait=e==="await"}var u=this.parseMaybeConditional(e,t);if(i){u=i.call(this,u,l,c)}if(this.type.isAssign){var h=this.startNodeAt(l,c);h.operator=this.value;if(this.type===xo.eq){u=this.toAssignable(u,false,t)}if(!s){t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1}if(t.shorthandAssign>=u.start){t.shorthandAssign=-1}if(this.type===xo.eq){this.checkLValPattern(u)}else{this.checkLValSimple(u)}h.left=u;this.next();h.right=this.parseMaybeAssign(e);if(o>-1){t.doubleProto=o}return this.finishNode(h,"AssignmentExpression")}else{if(s){this.checkExpressionErrors(t,true)}}if(n>-1){t.parenthesizedAssign=n}if(r>-1){t.trailingComma=r}return u};da.parseMaybeConditional=function(e,t){var i=this.start,s=this.startLoc;var n=this.parseExprOps(e,t);if(this.checkExpressionErrors(t)){return n}if(this.eat(xo.question)){var r=this.startNodeAt(i,s);r.test=n;r.consequent=this.parseMaybeAssign();this.expect(xo.colon);r.alternate=this.parseMaybeAssign(e);return this.finishNode(r,"ConditionalExpression")}return n};da.parseExprOps=function(e,t){var i=this.start,s=this.startLoc;var n=this.parseMaybeUnary(t,false,false,e);if(this.checkExpressionErrors(t)){return n}return n.start===i&&n.type==="ArrowFunctionExpression"?n:this.parseExprOp(n,i,s,-1,e)};da.parseExprOp=function(e,t,i,s,n){var r=this.type.binop;if(r!=null&&(!n||this.type!==xo._in)){if(r>s){var o=this.type===xo.logicalOR||this.type===xo.logicalAND;var l=this.type===xo.coalesce;if(l){r=xo.logicalAND.binop}var c=this.value;this.next();var u=this.start,h=this.startLoc;var d=this.parseExprOp(this.parseMaybeUnary(null,false,false,n),u,h,r,n);var p=this.buildBinary(t,i,e,d,c,o||l);if(o&&this.type===xo.coalesce||l&&(this.type===xo.logicalOR||this.type===xo.logicalAND)){this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses")}return this.parseExprOp(p,t,i,s,n)}}return e};da.buildBinary=function(e,t,i,s,n,r){if(s.type==="PrivateIdentifier"){this.raise(s.start,"Private identifier can only be left side of binary expression")}var o=this.startNodeAt(e,t);o.left=i;o.operator=n;o.right=s;return this.finishNode(o,r?"LogicalExpression":"BinaryExpression")};da.parseMaybeUnary=function(e,t,i,s){var n=this.start,r=this.startLoc,o;if(this.isContextual("await")&&this.canAwait){o=this.parseAwait(s);t=true}else if(this.type.prefix){var l=this.startNode(),c=this.type===xo.incDec;l.operator=this.value;l.prefix=true;this.next();l.argument=this.parseMaybeUnary(null,true,c,s);this.checkExpressionErrors(e,true);if(c){this.checkLValSimple(l.argument)}else if(this.strict&&l.operator==="delete"&&l.argument.type==="Identifier"){this.raiseRecoverable(l.start,"Deleting local variable in strict mode")}else if(l.operator==="delete"&&isPrivateFieldAccess(l.argument)){this.raiseRecoverable(l.start,"Private fields can not be deleted")}else{t=true}o=this.finishNode(l,c?"UpdateExpression":"UnaryExpression")}else if(!t&&this.type===xo.privateId){if(s||this.privateNameStack.length===0){this.unexpected()}o=this.parsePrivateIdent();if(this.type!==xo._in){this.unexpected()}}else{o=this.parseExprSubscripts(e,s);if(this.checkExpressionErrors(e)){return o}while(this.type.postfix&&!this.canInsertSemicolon()){var u=this.startNodeAt(n,r);u.operator=this.value;u.prefix=false;u.argument=o;this.checkLValSimple(o);this.next();o=this.finishNode(u,"UpdateExpression")}}if(!i&&this.eat(xo.starstar)){if(t){this.unexpected(this.lastTokStart)}else{return this.buildBinary(n,r,o,this.parseMaybeUnary(null,false,false,s),"**",false)}}else{return o}};function isPrivateFieldAccess(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&isPrivateFieldAccess(e.expression)}da.parseExprSubscripts=function(e,t){var i=this.start,s=this.startLoc;var n=this.parseExprAtom(e,t);if(n.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")"){return n}var r=this.parseSubscripts(n,i,s,false,t);if(e&&r.type==="MemberExpression"){if(e.parenthesizedAssign>=r.start){e.parenthesizedAssign=-1}if(e.parenthesizedBind>=r.start){e.parenthesizedBind=-1}if(e.trailingComma>=r.start){e.trailingComma=-1}}return r};da.parseSubscripts=function(e,t,i,s,n){var r=this.options.ecmaVersion>=8&&e.type==="Identifier"&&e.name==="async"&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start;var o=false;while(true){var l=this.parseSubscript(e,t,i,s,r,o,n);if(l.optional){o=true}if(l===e||l.type==="ArrowFunctionExpression"){if(o){var c=this.startNodeAt(t,i);c.expression=l;l=this.finishNode(c,"ChainExpression")}return l}e=l}};da.parseSubscript=function(e,t,i,s,n,r,o){var l=this.options.ecmaVersion>=11;var c=l&&this.eat(xo.questionDot);if(s&&c){this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions")}var u=this.eat(xo.bracketL);if(u||c&&this.type!==xo.parenL&&this.type!==xo.backQuote||this.eat(xo.dot)){var h=this.startNodeAt(t,i);h.object=e;if(u){h.property=this.parseExpression();this.expect(xo.bracketR)}else if(this.type===xo.privateId&&e.type!=="Super"){h.property=this.parsePrivateIdent()}else{h.property=this.parseIdent(this.options.allowReserved!=="never")}h.computed=!!u;if(l){h.optional=c}e=this.finishNode(h,"MemberExpression")}else if(!s&&this.eat(xo.parenL)){var d=new ea,p=this.yieldPos,f=this.awaitPos,m=this.awaitIdentPos;this.yieldPos=0;this.awaitPos=0;this.awaitIdentPos=0;var g=this.parseExprList(xo.parenR,this.options.ecmaVersion>=8,false,d);if(n&&!c&&!this.canInsertSemicolon()&&this.eat(xo.arrow)){this.checkPatternErrors(d,false);this.checkYieldAwaitInDefaultParams();if(this.awaitIdentPos>0){this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function")}this.yieldPos=p;this.awaitPos=f;this.awaitIdentPos=m;return this.parseArrowExpression(this.startNodeAt(t,i),g,true,o)}this.checkExpressionErrors(d,true);this.yieldPos=p||this.yieldPos;this.awaitPos=f||this.awaitPos;this.awaitIdentPos=m||this.awaitIdentPos;var y=this.startNodeAt(t,i);y.callee=e;y.arguments=g;if(l){y.optional=c}e=this.finishNode(y,"CallExpression")}else if(this.type===xo.backQuote){if(c||r){this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions")}var E=this.startNodeAt(t,i);E.tag=e;E.quasi=this.parseTemplate({isTagged:true});e=this.finishNode(E,"TaggedTemplateExpression")}return e};da.parseExprAtom=function(e,t){if(this.type===xo.slash){this.readRegexp()}var i,s=this.potentialArrowAt===this.start;switch(this.type){case xo._super:if(!this.allowSuper){this.raise(this.start,"'super' keyword outside a method")}i=this.startNode();this.next();if(this.type===xo.parenL&&!this.allowDirectSuper){this.raise(i.start,"super() call outside constructor of a subclass")}if(this.type!==xo.dot&&this.type!==xo.bracketL&&this.type!==xo.parenL){this.unexpected()}return this.finishNode(i,"Super");case xo._this:i=this.startNode();this.next();return this.finishNode(i,"ThisExpression");case xo.name:var n=this.start,r=this.startLoc,o=this.containsEsc;var l=this.parseIdent(false);if(this.options.ecmaVersion>=8&&!o&&l.name==="async"&&!this.canInsertSemicolon()&&this.eat(xo._function)){this.overrideContext(ua.f_expr);return this.parseFunction(this.startNodeAt(n,r),0,false,true,t)}if(s&&!this.canInsertSemicolon()){if(this.eat(xo.arrow)){return this.parseArrowExpression(this.startNodeAt(n,r),[l],false,t)}if(this.options.ecmaVersion>=8&&l.name==="async"&&this.type===xo.name&&!o&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc)){l=this.parseIdent(false);if(this.canInsertSemicolon()||!this.eat(xo.arrow)){this.unexpected()}return this.parseArrowExpression(this.startNodeAt(n,r),[l],true,t)}}return l;case xo.regexp:var c=this.value;i=this.parseLiteral(c.value);i.regex={pattern:c.pattern,flags:c.flags};return i;case xo.num:case xo.string:return this.parseLiteral(this.value);case xo._null:case xo._true:case xo._false:i=this.startNode();i.value=this.type===xo._null?null:this.type===xo._true;i.raw=this.type.keyword;this.next();return this.finishNode(i,"Literal");case xo.parenL:var u=this.start,h=this.parseParenAndDistinguishExpression(s,t);if(e){if(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(h)){e.parenthesizedAssign=u}if(e.parenthesizedBind<0){e.parenthesizedBind=u}}return h;case xo.bracketL:i=this.startNode();this.next();i.elements=this.parseExprList(xo.bracketR,true,true,e);return this.finishNode(i,"ArrayExpression");case xo.braceL:this.overrideContext(ua.b_expr);return this.parseObj(false,e);case xo._function:i=this.startNode();this.next();return this.parseFunction(i,0);case xo._class:return this.parseClass(this.startNode(),false);case xo._new:return this.parseNew();case xo.backQuote:return this.parseTemplate();case xo._import:if(this.options.ecmaVersion>=11){return this.parseExprImport()}else{return this.unexpected()}default:this.unexpected()}};da.parseExprImport=function(){var e=this.startNode();if(this.containsEsc){this.raiseRecoverable(this.start,"Escape sequence in keyword import")}var t=this.parseIdent(true);switch(this.type){case xo.parenL:return this.parseDynamicImport(e);case xo.dot:e.meta=t;return this.parseImportMeta(e);default:this.unexpected()}};da.parseDynamicImport=function(e){this.next();e.source=this.parseMaybeAssign();if(!this.eat(xo.parenR)){var t=this.start;if(this.eat(xo.comma)&&this.eat(xo.parenR)){this.raiseRecoverable(t,"Trailing comma is not allowed in import()")}else{this.unexpected(t)}}return this.finishNode(e,"ImportExpression")};da.parseImportMeta=function(e){this.next();var t=this.containsEsc;e.property=this.parseIdent(true);if(e.property.name!=="meta"){this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'")}if(t){this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters")}if(this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere){this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module")}return this.finishNode(e,"MetaProperty")};da.parseLiteral=function(e){var t=this.startNode();t.value=e;t.raw=this.input.slice(this.start,this.end);if(t.raw.charCodeAt(t.raw.length-1)===110){t.bigint=t.raw.slice(0,-1).replace(/_/g,"")}this.next();return this.finishNode(t,"Literal")};da.parseParenExpression=function(){this.expect(xo.parenL);var e=this.parseExpression();this.expect(xo.parenR);return e};da.parseParenAndDistinguishExpression=function(e,t){var i=this.start,s=this.startLoc,n,r=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o=this.start,l=this.startLoc;var c=[],u=true,h=false;var d=new ea,p=this.yieldPos,f=this.awaitPos,m;this.yieldPos=0;this.awaitPos=0;while(this.type!==xo.parenR){u?u=false:this.expect(xo.comma);if(r&&this.afterTrailingComma(xo.parenR,true)){h=true;break}else if(this.type===xo.ellipsis){m=this.start;c.push(this.parseParenItem(this.parseRestBinding()));if(this.type===xo.comma){this.raise(this.start,"Comma is not permitted after the rest element")}break}else{c.push(this.parseMaybeAssign(false,d,this.parseParenItem))}}var g=this.lastTokEnd,y=this.lastTokEndLoc;this.expect(xo.parenR);if(e&&!this.canInsertSemicolon()&&this.eat(xo.arrow)){this.checkPatternErrors(d,false);this.checkYieldAwaitInDefaultParams();this.yieldPos=p;this.awaitPos=f;return this.parseParenArrowList(i,s,c,t)}if(!c.length||h){this.unexpected(this.lastTokStart)}if(m){this.unexpected(m)}this.checkExpressionErrors(d,true);this.yieldPos=p||this.yieldPos;this.awaitPos=f||this.awaitPos;if(c.length>1){n=this.startNodeAt(o,l);n.expressions=c;this.finishNodeAt(n,"SequenceExpression",g,y)}else{n=c[0]}}else{n=this.parseParenExpression()}if(this.options.preserveParens){var E=this.startNodeAt(i,s);E.expression=n;return this.finishNode(E,"ParenthesizedExpression")}else{return n}};da.parseParenItem=function(e){return e};da.parseParenArrowList=function(e,t,i,s){return this.parseArrowExpression(this.startNodeAt(e,t),i,false,s)};var pa=[];da.parseNew=function(){if(this.containsEsc){this.raiseRecoverable(this.start,"Escape sequence in keyword new")}var e=this.startNode();var t=this.parseIdent(true);if(this.options.ecmaVersion>=6&&this.eat(xo.dot)){e.meta=t;var i=this.containsEsc;e.property=this.parseIdent(true);if(e.property.name!=="target"){this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'")}if(i){this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters")}if(!this.allowNewDotTarget){this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block")}return this.finishNode(e,"MetaProperty")}var s=this.start,n=this.startLoc,r=this.type===xo._import;e.callee=this.parseSubscripts(this.parseExprAtom(),s,n,true,false);if(r&&e.callee.type==="ImportExpression"){this.raise(s,"Cannot use new with import()")}if(this.eat(xo.parenL)){e.arguments=this.parseExprList(xo.parenR,this.options.ecmaVersion>=8,false)}else{e.arguments=pa}return this.finishNode(e,"NewExpression")};da.parseTemplateElement=function(e){var t=e.isTagged;var i=this.startNode();if(this.type===xo.invalidTemplate){if(!t){this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal")}i.value={raw:this.value,cooked:null}}else{i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value}}this.next();i.tail=this.type===xo.backQuote;return this.finishNode(i,"TemplateElement")};da.parseTemplate=function(e){if(e===void 0)e={};var t=e.isTagged;if(t===void 0)t=false;var i=this.startNode();this.next();i.expressions=[];var s=this.parseTemplateElement({isTagged:t});i.quasis=[s];while(!s.tail){if(this.type===xo.eof){this.raise(this.pos,"Unterminated template literal")}this.expect(xo.dollarBraceL);i.expressions.push(this.parseExpression());this.expect(xo.braceR);i.quasis.push(s=this.parseTemplateElement({isTagged:t}))}this.next();return this.finishNode(i,"TemplateLiteral")};da.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===xo.name||this.type===xo.num||this.type===xo.string||this.type===xo.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===xo.star)&&!bo.test(this.input.slice(this.lastTokEnd,this.start))};da.parseObj=function(e,t){var i=this.startNode(),s=true,n={};i.properties=[];this.next();while(!this.eat(xo.braceR)){if(!s){this.expect(xo.comma);if(this.options.ecmaVersion>=5&&this.afterTrailingComma(xo.braceR)){break}}else{s=false}var r=this.parseProperty(e,t);if(!e){this.checkPropClash(r,n,t)}i.properties.push(r)}return this.finishNode(i,e?"ObjectPattern":"ObjectExpression")};da.parseProperty=function(e,t){var i=this.startNode(),s,n,r,o;if(this.options.ecmaVersion>=9&&this.eat(xo.ellipsis)){if(e){i.argument=this.parseIdent(false);if(this.type===xo.comma){this.raise(this.start,"Comma is not permitted after the rest element")}return this.finishNode(i,"RestElement")}i.argument=this.parseMaybeAssign(false,t);if(this.type===xo.comma&&t&&t.trailingComma<0){t.trailingComma=this.start}return this.finishNode(i,"SpreadElement")}if(this.options.ecmaVersion>=6){i.method=false;i.shorthand=false;if(e||t){r=this.start;o=this.startLoc}if(!e){s=this.eat(xo.star)}}var l=this.containsEsc;this.parsePropertyName(i);if(!e&&!l&&this.options.ecmaVersion>=8&&!s&&this.isAsyncProp(i)){n=true;s=this.options.ecmaVersion>=9&&this.eat(xo.star);this.parsePropertyName(i)}else{n=false}this.parsePropertyValue(i,e,s,n,r,o,t,l);return this.finishNode(i,"Property")};da.parsePropertyValue=function(e,t,i,s,n,r,o,l){if((i||s)&&this.type===xo.colon){this.unexpected()}if(this.eat(xo.colon)){e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(false,o);e.kind="init"}else if(this.options.ecmaVersion>=6&&this.type===xo.parenL){if(t){this.unexpected()}e.kind="init";e.method=true;e.value=this.parseMethod(i,s)}else if(!t&&!l&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&(this.type!==xo.comma&&this.type!==xo.braceR&&this.type!==xo.eq)){if(i||s){this.unexpected()}e.kind=e.key.name;this.parsePropertyName(e);e.value=this.parseMethod(false);var c=e.kind==="get"?0:1;if(e.value.params.length!==c){var u=e.value.start;if(e.kind==="get"){this.raiseRecoverable(u,"getter should have no params")}else{this.raiseRecoverable(u,"setter should have exactly one param")}}else{if(e.kind==="set"&&e.value.params[0].type==="RestElement"){this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")}}}else if(this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"){if(i||s){this.unexpected()}this.checkUnreserved(e.key);if(e.key.name==="await"&&!this.awaitIdentPos){this.awaitIdentPos=n}e.kind="init";if(t){e.value=this.parseMaybeDefault(n,r,this.copyNode(e.key))}else if(this.type===xo.eq&&o){if(o.shorthandAssign<0){o.shorthandAssign=this.start}e.value=this.parseMaybeDefault(n,r,this.copyNode(e.key))}else{e.value=this.copyNode(e.key)}e.shorthand=true}else{this.unexpected()}};da.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(xo.bracketL)){e.computed=true;e.key=this.parseMaybeAssign();this.expect(xo.bracketR);return e.key}else{e.computed=false}}return e.key=this.type===xo.num||this.type===xo.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};da.initFunction=function(e){e.id=null;if(this.options.ecmaVersion>=6){e.generator=e.expression=false}if(this.options.ecmaVersion>=8){e.async=false}};da.parseMethod=function(e,t,i){var s=this.startNode(),n=this.yieldPos,r=this.awaitPos,o=this.awaitIdentPos;this.initFunction(s);if(this.options.ecmaVersion>=6){s.generator=e}if(this.options.ecmaVersion>=8){s.async=!!t}this.yieldPos=0;this.awaitPos=0;this.awaitIdentPos=0;this.enterScope(functionFlags(t,s.generator)|Vo|(i?zo:0));this.expect(xo.parenL);s.params=this.parseBindingList(xo.parenR,false,this.options.ecmaVersion>=8);this.checkYieldAwaitInDefaultParams();this.parseFunctionBody(s,false,true,false);this.yieldPos=n;this.awaitPos=r;this.awaitIdentPos=o;return this.finishNode(s,"FunctionExpression")};da.parseArrowExpression=function(e,t,i,s){var n=this.yieldPos,r=this.awaitPos,o=this.awaitIdentPos;this.enterScope(functionFlags(i,false)|Bo);this.initFunction(e);if(this.options.ecmaVersion>=8){e.async=!!i}this.yieldPos=0;this.awaitPos=0;this.awaitIdentPos=0;e.params=this.toAssignableList(t,true);this.parseFunctionBody(e,true,false,s);this.yieldPos=n;this.awaitPos=r;this.awaitIdentPos=o;return this.finishNode(e,"ArrowFunctionExpression")};da.parseFunctionBody=function(e,t,i,s){var n=t&&this.type!==xo.braceL;var r=this.strict,o=false;if(n){e.body=this.parseMaybeAssign(s);e.expression=true;this.checkParams(e,false)}else{var l=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);if(!r||l){o=this.strictDirective(this.end);if(o&&l){this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list")}}var c=this.labels;this.labels=[];if(o){this.strict=true}this.checkParams(e,!r&&!o&&!t&&!i&&this.isSimpleParamList(e.params));if(this.strict&&e.id){this.checkLValSimple(e.id,Yo)}e.body=this.parseBlock(false,undefined,o&&!r);e.expression=false;this.adaptDirectivePrologue(e.body.body);this.labels=c}this.exitScope()};da.isSimpleParamList=function(e){for(var t=0,i=e;t<i.length;t+=1){var s=i[t];if(s.type!=="Identifier"){return false}}return true};da.checkParams=function(e,t){var i=Object.create(null);for(var s=0,n=e.params;s<n.length;s+=1){var r=n[s];this.checkLValInnerPattern(r,Go,t?null:i)}};da.parseExprList=function(e,t,i,s){var n=[],r=true;while(!this.eat(e)){if(!r){this.expect(xo.comma);if(t&&this.afterTrailingComma(e)){break}}else{r=false}var o=void 0;if(i&&this.type===xo.comma){o=null}else if(this.type===xo.ellipsis){o=this.parseSpread(s);if(s&&this.type===xo.comma&&s.trailingComma<0){s.trailingComma=this.start}}else{o=this.parseMaybeAssign(false,s)}n.push(o)}return n};da.checkUnreserved=function(e){var t=e.start;var i=e.end;var s=e.name;if(this.inGenerator&&s==="yield"){this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator")}if(this.inAsync&&s==="await"){this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function")}if(this.currentThisScope().inClassFieldInit&&s==="arguments"){this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer")}if(this.inClassStaticBlock&&(s==="arguments"||s==="await")){this.raise(t,"Cannot use "+s+" in class static initialization block")}if(this.keywords.test(s)){this.raise(t,"Unexpected keyword '"+s+"'")}if(this.options.ecmaVersion<6&&this.input.slice(t,i).indexOf("\\")!==-1){return}var n=this.strict?this.reservedWordsStrict:this.reservedWords;if(n.test(s)){if(!this.inAsync&&s==="await"){this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function")}this.raiseRecoverable(t,"The keyword '"+s+"' is reserved")}};da.parseIdent=function(e){var t=this.startNode();if(this.type===xo.name){t.name=this.value}else if(this.type.keyword){t.name=this.type.keyword;if((t.name==="class"||t.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)){this.context.pop()}}else{this.unexpected()}this.next(!!e);this.finishNode(t,"Identifier");if(!e){this.checkUnreserved(t);if(t.name==="await"&&!this.awaitIdentPos){this.awaitIdentPos=t.start}}return t};da.parsePrivateIdent=function(){var e=this.startNode();if(this.type===xo.privateId){e.name=this.value}else{this.unexpected()}this.next();this.finishNode(e,"PrivateIdentifier");if(this.privateNameStack.length===0){this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class")}else{this.privateNameStack[this.privateNameStack.length-1].used.push(e)}return e};da.parseYield=function(e){if(!this.yieldPos){this.yieldPos=this.start}var t=this.startNode();this.next();if(this.type===xo.semi||this.canInsertSemicolon()||this.type!==xo.star&&!this.type.startsExpr){t.delegate=false;t.argument=null}else{t.delegate=this.eat(xo.star);t.argument=this.parseMaybeAssign(e)}return this.finishNode(t,"YieldExpression")};da.parseAwait=function(e){if(!this.awaitPos){this.awaitPos=this.start}var t=this.startNode();this.next();t.argument=this.parseMaybeUnary(null,true,false,e);return this.finishNode(t,"AwaitExpression")};var fa=Qo.prototype;fa.raise=function(e,t){var i=getLineInfo(this.input,e);t+=" ("+i.line+":"+i.column+")";var s=new SyntaxError(t);s.pos=e;s.loc=i;s.raisedAt=this.pos;throw s};fa.raiseRecoverable=fa.raise;fa.curPosition=function(){if(this.options.locations){return new No(this.curLine,this.pos-this.lineStart)}};var ma=Qo.prototype;var ga=function Scope(e){this.flags=e;this.var=[];this.lexical=[];this.functions=[];this.inClassFieldInit=false};ma.enterScope=function(e){this.scopeStack.push(new ga(e))};ma.exitScope=function(){this.scopeStack.pop()};ma.treatFunctionsAsVarInScope=function(e){return e.flags&Do||!this.inModule&&e.flags&To};ma.declareName=function(e,t,i){var s=false;if(t===Wo){var n=this.currentScope();s=n.lexical.indexOf(e)>-1||n.functions.indexOf(e)>-1||n.var.indexOf(e)>-1;n.lexical.push(e);if(this.inModule&&n.flags&To){delete this.undefinedExports[e]}}else if(t===Ko){var r=this.currentScope();r.lexical.push(e)}else if(t===qo){var o=this.currentScope();if(this.treatFunctionsAsVar){s=o.lexical.indexOf(e)>-1}else{s=o.lexical.indexOf(e)>-1||o.var.indexOf(e)>-1}o.functions.push(e)}else{for(var l=this.scopeStack.length-1;l>=0;--l){var c=this.scopeStack[l];if(c.lexical.indexOf(e)>-1&&!(c.flags&Fo&&c.lexical[0]===e)||!this.treatFunctionsAsVarInScope(c)&&c.functions.indexOf(e)>-1){s=true;break}c.var.push(e);if(this.inModule&&c.flags&To){delete this.undefinedExports[e]}if(c.flags&Uo){break}}}if(s){this.raiseRecoverable(i,"Identifier '"+e+"' has already been declared")}};ma.checkLocalExport=function(e){if(this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1){this.undefinedExports[e.name]=e}};ma.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};ma.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&Uo){return t}}};ma.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&Uo&&!(t.flags&Bo)){return t}}};var ya=function Node(e,t,i){this.type="";this.start=t;this.end=0;if(e.options.locations){this.loc=new Ro(e,i)}if(e.options.directSourceFile){this.sourceFile=e.options.directSourceFile}if(e.options.ranges){this.range=[t,0]}};var Ea=Qo.prototype;Ea.startNode=function(){return new ya(this,this.start,this.startLoc)};Ea.startNodeAt=function(e,t){return new ya(this,e,t)};function finishNodeAt(e,t,i,s){e.type=t;e.end=i;if(this.options.locations){e.loc.end=s}if(this.options.ranges){e.range[1]=i}return e}Ea.finishNode=function(e,t){return finishNodeAt.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)};Ea.finishNodeAt=function(e,t,i,s){return finishNodeAt.call(this,e,t,i,s)};Ea.copyNode=function(e){var t=new ya(this,e.start,this.startLoc);for(var i in e){t[i]=e[i]}return t};var xa="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS";var ba=xa+" Extended_Pictographic";var va=ba;var Sa=va+" EBase EComp EMod EPres ExtPict";var Aa=Sa;var wa=Aa;var Ia={9:xa,10:ba,11:va,12:Sa,13:Aa,14:wa};var ka="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu";var Ca="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb";var _a=Ca+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd";var Pa=_a+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho";var Na=Pa+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi";var Ra=Na+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith";var $a=Ra+" Kawi Nag_Mundari Nagm";var Oa={9:Ca,10:_a,11:Pa,12:Na,13:Ra,14:$a};var Ta={};function buildUnicodeData(e){var t=Ta[e]={binary:wordsRegexp(Ia[e]+" "+ka),nonBinary:{General_Category:wordsRegexp(ka),Script:wordsRegexp(Oa[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script;t.nonBinary.gc=t.nonBinary.General_Category;t.nonBinary.sc=t.nonBinary.Script;t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var Da=0,Ma=[9,10,11,12,13,14];Da<Ma.length;Da+=1){var La=Ma[Da];buildUnicodeData(La)}var Ba=Qo.prototype;var Fa=function RegExpValidationState(e){this.parser=e;this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":"")+(e.options.ecmaVersion>=13?"d":"");this.unicodeProperties=Ta[e.options.ecmaVersion>=14?14:e.options.ecmaVersion];this.source="";this.flags="";this.start=0;this.switchU=false;this.switchN=false;this.pos=0;this.lastIntValue=0;this.lastStringValue="";this.lastAssertionIsQuantifiable=false;this.numCapturingParens=0;this.maxBackReference=0;this.groupNames=[];this.backReferenceNames=[]};Fa.prototype.reset=function reset(e,t,i){var s=i.indexOf("u")!==-1;this.start=e|0;this.source=t+"";this.flags=i;this.switchU=s&&this.parser.options.ecmaVersion>=6;this.switchN=s&&this.parser.options.ecmaVersion>=9};Fa.prototype.raise=function raise(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)};Fa.prototype.at=function at(e,t){if(t===void 0)t=false;var i=this.source;var s=i.length;if(e>=s){return-1}var n=i.charCodeAt(e);if(!(t||this.switchU)||n<=55295||n>=57344||e+1>=s){return n}var r=i.charCodeAt(e+1);return r>=56320&&r<=57343?(n<<10)+r-56613888:n};Fa.prototype.nextIndex=function nextIndex(e,t){if(t===void 0)t=false;var i=this.source;var s=i.length;if(e>=s){return s}var n=i.charCodeAt(e),r;if(!(t||this.switchU)||n<=55295||n>=57344||e+1>=s||(r=i.charCodeAt(e+1))<56320||r>57343){return e+1}return e+2};Fa.prototype.current=function current(e){if(e===void 0)e=false;return this.at(this.pos,e)};Fa.prototype.lookahead=function lookahead(e){if(e===void 0)e=false;return this.at(this.nextIndex(this.pos,e),e)};Fa.prototype.advance=function advance(e){if(e===void 0)e=false;this.pos=this.nextIndex(this.pos,e)};Fa.prototype.eat=function eat(e,t){if(t===void 0)t=false;if(this.current(t)===e){this.advance(t);return true}return false};Ba.validateRegExpFlags=function(e){var t=e.validFlags;var i=e.flags;for(var s=0;s<i.length;s++){var n=i.charAt(s);if(t.indexOf(n)===-1){this.raise(e.start,"Invalid regular expression flag")}if(i.indexOf(n,s+1)>-1){this.raise(e.start,"Duplicate regular expression flag")}}};Ba.validateRegExpPattern=function(e){this.regexp_pattern(e);if(!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0){e.switchN=true;this.regexp_pattern(e)}};Ba.regexp_pattern=function(e){e.pos=0;e.lastIntValue=0;e.lastStringValue="";e.lastAssertionIsQuantifiable=false;e.numCapturingParens=0;e.maxBackReference=0;e.groupNames.length=0;e.backReferenceNames.length=0;this.regexp_disjunction(e);if(e.pos!==e.source.length){if(e.eat(41)){e.raise("Unmatched ')'")}if(e.eat(93)||e.eat(125)){e.raise("Lone quantifier brackets")}}if(e.maxBackReference>e.numCapturingParens){e.raise("Invalid escape")}for(var t=0,i=e.backReferenceNames;t<i.length;t+=1){var s=i[t];if(e.groupNames.indexOf(s)===-1){e.raise("Invalid named capture referenced")}}};Ba.regexp_disjunction=function(e){this.regexp_alternative(e);while(e.eat(124)){this.regexp_alternative(e)}if(this.regexp_eatQuantifier(e,true)){e.raise("Nothing to repeat")}if(e.eat(123)){e.raise("Lone quantifier brackets")}};Ba.regexp_alternative=function(e){while(e.pos<e.source.length&&this.regexp_eatTerm(e)){}};Ba.regexp_eatTerm=function(e){if(this.regexp_eatAssertion(e)){if(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)){if(e.switchU){e.raise("Invalid quantifier")}}return true}if(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e)){this.regexp_eatQuantifier(e);return true}return false};Ba.regexp_eatAssertion=function(e){var t=e.pos;e.lastAssertionIsQuantifiable=false;if(e.eat(94)||e.eat(36)){return true}if(e.eat(92)){if(e.eat(66)||e.eat(98)){return true}e.pos=t}if(e.eat(40)&&e.eat(63)){var i=false;if(this.options.ecmaVersion>=9){i=e.eat(60)}if(e.eat(61)||e.eat(33)){this.regexp_disjunction(e);if(!e.eat(41)){e.raise("Unterminated group")}e.lastAssertionIsQuantifiable=!i;return true}}e.pos=t;return false};Ba.regexp_eatQuantifier=function(e,t){if(t===void 0)t=false;if(this.regexp_eatQuantifierPrefix(e,t)){e.eat(63);return true}return false};Ba.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)};Ba.regexp_eatBracedQuantifier=function(e,t){var i=e.pos;if(e.eat(123)){var s=0,n=-1;if(this.regexp_eatDecimalDigits(e)){s=e.lastIntValue;if(e.eat(44)&&this.regexp_eatDecimalDigits(e)){n=e.lastIntValue}if(e.eat(125)){if(n!==-1&&n<s&&!t){e.raise("numbers out of order in {} quantifier")}return true}}if(e.switchU&&!t){e.raise("Incomplete quantifier")}e.pos=i}return false};Ba.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)};Ba.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e)){return true}e.pos=t}return false};Ba.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)&&e.eat(58)){this.regexp_disjunction(e);if(e.eat(41)){return true}e.raise("Unterminated group")}e.pos=t}return false};Ba.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9){this.regexp_groupSpecifier(e)}else if(e.current()===63){e.raise("Invalid group")}this.regexp_disjunction(e);if(e.eat(41)){e.numCapturingParens+=1;return true}e.raise("Unterminated group")}return false};Ba.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)};Ba.regexp_eatInvalidBracedQuantifier=function(e){if(this.regexp_eatBracedQuantifier(e,true)){e.raise("Nothing to repeat")}return false};Ba.regexp_eatSyntaxCharacter=function(e){var t=e.current();if(isSyntaxCharacter(t)){e.lastIntValue=t;e.advance();return true}return false};function isSyntaxCharacter(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}Ba.regexp_eatPatternCharacters=function(e){var t=e.pos;var i=0;while((i=e.current())!==-1&&!isSyntaxCharacter(i)){e.advance()}return e.pos!==t};Ba.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();if(t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124){e.advance();return true}return false};Ba.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e)){if(e.groupNames.indexOf(e.lastStringValue)!==-1){e.raise("Duplicate capture group name")}e.groupNames.push(e.lastStringValue);return}e.raise("Invalid group")}};Ba.regexp_eatGroupName=function(e){e.lastStringValue="";if(e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62)){return true}e.raise("Invalid capture group name")}return false};Ba.regexp_eatRegExpIdentifierName=function(e){e.lastStringValue="";if(this.regexp_eatRegExpIdentifierStart(e)){e.lastStringValue+=codePointToString(e.lastIntValue);while(this.regexp_eatRegExpIdentifierPart(e)){e.lastStringValue+=codePointToString(e.lastIntValue)}return true}return false};Ba.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos;var i=this.options.ecmaVersion>=11;var s=e.current(i);e.advance(i);if(s===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)){s=e.lastIntValue}if(isRegExpIdentifierStart(s)){e.lastIntValue=s;return true}e.pos=t;return false};function isRegExpIdentifierStart(e){return isIdentifierStart(e,true)||e===36||e===95}Ba.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos;var i=this.options.ecmaVersion>=11;var s=e.current(i);e.advance(i);if(s===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)){s=e.lastIntValue}if(isRegExpIdentifierPart(s)){e.lastIntValue=s;return true}e.pos=t;return false};function isRegExpIdentifierPart(e){return isIdentifierChar(e,true)||e===36||e===95||e===8204||e===8205}Ba.regexp_eatAtomEscape=function(e){if(this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)){return true}if(e.switchU){if(e.current()===99){e.raise("Invalid unicode escape")}e.raise("Invalid escape")}return false};Ba.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var i=e.lastIntValue;if(e.switchU){if(i>e.maxBackReference){e.maxBackReference=i}return true}if(i<=e.numCapturingParens){return true}e.pos=t}return false};Ba.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e)){e.backReferenceNames.push(e.lastStringValue);return true}e.raise("Invalid named reference")}return false};Ba.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,false)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};Ba.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e)){return true}e.pos=t}return false};Ba.regexp_eatZero=function(e){if(e.current()===48&&!isDecimalDigit(e.lookahead())){e.lastIntValue=0;e.advance();return true}return false};Ba.regexp_eatControlEscape=function(e){var t=e.current();if(t===116){e.lastIntValue=9;e.advance();return true}if(t===110){e.lastIntValue=10;e.advance();return true}if(t===118){e.lastIntValue=11;e.advance();return true}if(t===102){e.lastIntValue=12;e.advance();return true}if(t===114){e.lastIntValue=13;e.advance();return true}return false};Ba.regexp_eatControlLetter=function(e){var t=e.current();if(isControlLetter(t)){e.lastIntValue=t%32;e.advance();return true}return false};function isControlLetter(e){return e>=65&&e<=90||e>=97&&e<=122}Ba.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){if(t===void 0)t=false;var i=e.pos;var s=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var n=e.lastIntValue;if(s&&n>=55296&&n<=56319){var r=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343){e.lastIntValue=(n-55296)*1024+(o-56320)+65536;return true}}e.pos=r;e.lastIntValue=n}return true}if(s&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&isValidUnicode(e.lastIntValue)){return true}if(s){e.raise("Invalid unicode escape")}e.pos=i}return false};function isValidUnicode(e){return e>=0&&e<=1114111}Ba.regexp_eatIdentityEscape=function(e){if(e.switchU){if(this.regexp_eatSyntaxCharacter(e)){return true}if(e.eat(47)){e.lastIntValue=47;return true}return false}var t=e.current();if(t!==99&&(!e.switchN||t!==107)){e.lastIntValue=t;e.advance();return true}return false};Ba.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do{e.lastIntValue=10*e.lastIntValue+(t-48);e.advance()}while((t=e.current())>=48&&t<=57);return true}return false};Ba.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(isCharacterClassEscape(t)){e.lastIntValue=-1;e.advance();return true}if(e.switchU&&this.options.ecmaVersion>=9&&(t===80||t===112)){e.lastIntValue=-1;e.advance();if(e.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(e)&&e.eat(125)){return true}e.raise("Invalid property name")}return false};function isCharacterClassEscape(e){return e===100||e===68||e===115||e===83||e===119||e===87}Ba.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var i=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var s=e.lastStringValue;this.regexp_validateUnicodePropertyNameAndValue(e,i,s);return true}}e.pos=t;if(this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var n=e.lastStringValue;this.regexp_validateUnicodePropertyNameOrValue(e,n);return true}return false};Ba.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){if(!Co(e.unicodeProperties.nonBinary,t)){e.raise("Invalid property name")}if(!e.unicodeProperties.nonBinary[t].test(i)){e.raise("Invalid property value")}};Ba.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(!e.unicodeProperties.binary.test(t)){e.raise("Invalid property name")}};Ba.regexp_eatUnicodePropertyName=function(e){var t=0;e.lastStringValue="";while(isUnicodePropertyNameCharacter(t=e.current())){e.lastStringValue+=codePointToString(t);e.advance()}return e.lastStringValue!==""};function isUnicodePropertyNameCharacter(e){return isControlLetter(e)||e===95}Ba.regexp_eatUnicodePropertyValue=function(e){var t=0;e.lastStringValue="";while(isUnicodePropertyValueCharacter(t=e.current())){e.lastStringValue+=codePointToString(t);e.advance()}return e.lastStringValue!==""};function isUnicodePropertyValueCharacter(e){return isUnicodePropertyNameCharacter(e)||isDecimalDigit(e)}Ba.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};Ba.regexp_eatCharacterClass=function(e){if(e.eat(91)){e.eat(94);this.regexp_classRanges(e);if(e.eat(93)){return true}e.raise("Unterminated character class")}return false};Ba.regexp_classRanges=function(e){while(this.regexp_eatClassAtom(e)){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var i=e.lastIntValue;if(e.switchU&&(t===-1||i===-1)){e.raise("Invalid character class")}if(t!==-1&&i!==-1&&t>i){e.raise("Range out of order in character class")}}}};Ba.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e)){return true}if(e.switchU){var i=e.current();if(i===99||isOctalDigit(i)){e.raise("Invalid class escape")}e.raise("Invalid escape")}e.pos=t}var s=e.current();if(s!==93){e.lastIntValue=s;e.advance();return true}return false};Ba.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98)){e.lastIntValue=8;return true}if(e.switchU&&e.eat(45)){e.lastIntValue=45;return true}if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e)){return true}e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)};Ba.regexp_eatClassControlLetter=function(e){var t=e.current();if(isDecimalDigit(t)||t===95){e.lastIntValue=t%32;e.advance();return true}return false};Ba.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2)){return true}if(e.switchU){e.raise("Invalid escape")}e.pos=t}return false};Ba.regexp_eatDecimalDigits=function(e){var t=e.pos;var i=0;e.lastIntValue=0;while(isDecimalDigit(i=e.current())){e.lastIntValue=10*e.lastIntValue+(i-48);e.advance()}return e.pos!==t};function isDecimalDigit(e){return e>=48&&e<=57}Ba.regexp_eatHexDigits=function(e){var t=e.pos;var i=0;e.lastIntValue=0;while(isHexDigit(i=e.current())){e.lastIntValue=16*e.lastIntValue+hexToInt(i);e.advance()}return e.pos!==t};function isHexDigit(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function hexToInt(e){if(e>=65&&e<=70){return 10+(e-65)}if(e>=97&&e<=102){return 10+(e-97)}return e-48}Ba.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var i=e.lastIntValue;if(t<=3&&this.regexp_eatOctalDigit(e)){e.lastIntValue=t*64+i*8+e.lastIntValue}else{e.lastIntValue=t*8+i}}else{e.lastIntValue=t}return true}return false};Ba.regexp_eatOctalDigit=function(e){var t=e.current();if(isOctalDigit(t)){e.lastIntValue=t-48;e.advance();return true}e.lastIntValue=0;return false};function isOctalDigit(e){return e>=48&&e<=55}Ba.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var s=0;s<t;++s){var n=e.current();if(!isHexDigit(n)){e.pos=i;return false}e.lastIntValue=16*e.lastIntValue+hexToInt(n);e.advance()}return true};var Va=function Token(e){this.type=e.type;this.value=e.value;this.start=e.start;this.end=e.end;if(e.options.locations){this.loc=new Ro(e,e.startLoc,e.endLoc)}if(e.options.ranges){this.range=[e.start,e.end]}};var za=Qo.prototype;za.next=function(e){if(!e&&this.type.keyword&&this.containsEsc){this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword)}if(this.options.onToken){this.options.onToken(new Va(this))}this.lastTokEnd=this.end;this.lastTokStart=this.start;this.lastTokEndLoc=this.endLoc;this.lastTokStartLoc=this.startLoc;this.nextToken()};za.getToken=function(){this.next();return new Va(this)};if(typeof Symbol!=="undefined"){za[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===xo.eof,value:t}}}}}za.nextToken=function(){var e=this.curContext();if(!e||!e.preserveSpace){this.skipSpace()}this.start=this.pos;if(this.options.locations){this.startLoc=this.curPosition()}if(this.pos>=this.input.length){return this.finishToken(xo.eof)}if(e.override){return e.override(this)}else{this.readToken(this.fullCharCodeAtPos())}};za.readToken=function(e){if(isIdentifierStart(e,this.options.ecmaVersion>=6)||e===92){return this.readWord()}return this.getTokenFromCode(e)};za.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320){return e}var t=this.input.charCodeAt(this.pos+1);return t<=56319||t>=57344?e:(e<<10)+t-56613888};za.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition();var t=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(i===-1){this.raise(this.pos-2,"Unterminated comment")}this.pos=i+2;if(this.options.locations){for(var s=void 0,n=t;(s=nextLineBreak(this.input,n,this.pos))>-1;){++this.curLine;n=this.lineStart=s}}if(this.options.onComment){this.options.onComment(true,this.input.slice(t+2,i),t,this.pos,e,this.curPosition())}};za.skipLineComment=function(e){var t=this.pos;var i=this.options.onComment&&this.curPosition();var s=this.input.charCodeAt(this.pos+=e);while(this.pos<this.input.length&&!isNewLine(s)){s=this.input.charCodeAt(++this.pos)}if(this.options.onComment){this.options.onComment(false,this.input.slice(t+e,this.pos),t,this.pos,i,this.curPosition())}};za.skipSpace=function(){e:while(this.pos<this.input.length){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:if(this.input.charCodeAt(this.pos+1)===10){++this.pos}case 10:case 8232:case 8233:++this.pos;if(this.options.locations){++this.curLine;this.lineStart=this.pos}break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(e>8&&e<14||e>=5760&&So.test(String.fromCharCode(e))){++this.pos}else{break e}}}};za.finishToken=function(e,t){this.end=this.pos;if(this.options.locations){this.endLoc=this.curPosition()}var i=this.type;this.type=e;this.value=t;this.updateContext(i)};za.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57){return this.readNumber(true)}var t=this.input.charCodeAt(this.pos+2);if(this.options.ecmaVersion>=6&&e===46&&t===46){this.pos+=3;return this.finishToken(xo.ellipsis)}else{++this.pos;return this.finishToken(xo.dot)}};za.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);if(this.exprAllowed){++this.pos;return this.readRegexp()}if(e===61){return this.finishOp(xo.assign,2)}return this.finishOp(xo.slash,1)};za.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1);var i=1;var s=e===42?xo.star:xo.modulo;if(this.options.ecmaVersion>=7&&e===42&&t===42){++i;s=xo.starstar;t=this.input.charCodeAt(this.pos+2)}if(t===61){return this.finishOp(xo.assign,i+1)}return this.finishOp(s,i)};za.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12){var i=this.input.charCodeAt(this.pos+2);if(i===61){return this.finishOp(xo.assign,3)}}return this.finishOp(e===124?xo.logicalOR:xo.logicalAND,2)}if(t===61){return this.finishOp(xo.assign,2)}return this.finishOp(e===124?xo.bitwiseOR:xo.bitwiseAND,1)};za.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);if(e===61){return this.finishOp(xo.assign,2)}return this.finishOp(xo.bitwiseXOR,1)};za.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||bo.test(this.input.slice(this.lastTokEnd,this.pos)))){this.skipLineComment(3);this.skipSpace();return this.nextToken()}return this.finishOp(xo.incDec,2)}if(t===61){return this.finishOp(xo.assign,2)}return this.finishOp(xo.plusMin,1)};za.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1);var i=1;if(t===e){i=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2;if(this.input.charCodeAt(this.pos+i)===61){return this.finishOp(xo.assign,i+1)}return this.finishOp(xo.bitShift,i)}if(t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45){this.skipLineComment(4);this.skipSpace();return this.nextToken()}if(t===61){i=2}return this.finishOp(xo.relational,i)};za.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===61){return this.finishOp(xo.equality,this.input.charCodeAt(this.pos+2)===61?3:2)}if(e===61&&t===62&&this.options.ecmaVersion>=6){this.pos+=2;return this.finishToken(xo.arrow)}return this.finishOp(e===61?xo.eq:xo.prefix,1)};za.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var i=this.input.charCodeAt(this.pos+2);if(i<48||i>57){return this.finishOp(xo.questionDot,2)}}if(t===63){if(e>=12){var s=this.input.charCodeAt(this.pos+2);if(s===61){return this.finishOp(xo.assign,3)}}return this.finishOp(xo.coalesce,2)}}return this.finishOp(xo.question,1)};za.readToken_numberSign=function(){var e=this.options.ecmaVersion;var t=35;if(e>=13){++this.pos;t=this.fullCharCodeAtPos();if(isIdentifierStart(t,true)||t===92){return this.finishToken(xo.privateId,this.readWord1())}}this.raise(this.pos,"Unexpected character '"+codePointToString(t)+"'")};za.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:++this.pos;return this.finishToken(xo.parenL);case 41:++this.pos;return this.finishToken(xo.parenR);case 59:++this.pos;return this.finishToken(xo.semi);case 44:++this.pos;return this.finishToken(xo.comma);case 91:++this.pos;return this.finishToken(xo.bracketL);case 93:++this.pos;return this.finishToken(xo.bracketR);case 123:++this.pos;return this.finishToken(xo.braceL);case 125:++this.pos;return this.finishToken(xo.braceR);case 58:++this.pos;return this.finishToken(xo.colon);case 96:if(this.options.ecmaVersion<6){break}++this.pos;return this.finishToken(xo.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88){return this.readRadixNumber(16)}if(this.options.ecmaVersion>=6){if(t===111||t===79){return this.readRadixNumber(8)}if(t===98||t===66){return this.readRadixNumber(2)}}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(false);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(xo.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+codePointToString(e)+"'")};za.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);this.pos+=t;return this.finishToken(e,i)};za.readRegexp=function(){var e,t,i=this.pos;for(;;){if(this.pos>=this.input.length){this.raise(i,"Unterminated regular expression")}var s=this.input.charAt(this.pos);if(bo.test(s)){this.raise(i,"Unterminated regular expression")}if(!e){if(s==="["){t=true}else if(s==="]"&&t){t=false}else if(s==="/"&&!t){break}e=s==="\\"}else{e=false}++this.pos}var n=this.input.slice(i,this.pos);++this.pos;var r=this.pos;var o=this.readWord1();if(this.containsEsc){this.unexpected(r)}var l=this.regexpState||(this.regexpState=new Fa(this));l.reset(i,n,o);this.validateRegExpFlags(l);this.validateRegExpPattern(l);var c=null;try{c=new RegExp(n,o)}catch(e){}return this.finishToken(xo.regexp,{pattern:n,flags:o,value:c})};za.readInt=function(e,t,i){var s=this.options.ecmaVersion>=12&&t===undefined;var n=i&&this.input.charCodeAt(this.pos)===48;var r=this.pos,o=0,l=0;for(var c=0,u=t==null?Infinity:t;c<u;++c,++this.pos){var h=this.input.charCodeAt(this.pos),d=void 0;if(s&&h===95){if(n){this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals")}if(l===95){this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore")}if(c===0){this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits")}l=h;continue}if(h>=97){d=h-97+10}else if(h>=65){d=h-65+10}else if(h>=48&&h<=57){d=h-48}else{d=Infinity}if(d>=e){break}l=h;o=o*e+d}if(s&&l===95){this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits")}if(this.pos===r||t!=null&&this.pos-r!==t){return null}return o};function stringToNumber(e,t){if(t){return parseInt(e,8)}return parseFloat(e.replace(/_/g,""))}function stringToBigInt(e){if(typeof BigInt!=="function"){return null}return BigInt(e.replace(/_/g,""))}za.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var i=this.readInt(e);if(i==null){this.raise(this.start+2,"Expected number in radix "+e)}if(this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110){i=stringToBigInt(this.input.slice(t,this.pos));++this.pos}else if(isIdentifierStart(this.fullCharCodeAtPos())){this.raise(this.pos,"Identifier directly after number")}return this.finishToken(xo.num,i)};za.readNumber=function(e){var t=this.pos;if(!e&&this.readInt(10,undefined,true)===null){this.raise(t,"Invalid number")}var i=this.pos-t>=2&&this.input.charCodeAt(t)===48;if(i&&this.strict){this.raise(t,"Invalid number")}var s=this.input.charCodeAt(this.pos);if(!i&&!e&&this.options.ecmaVersion>=11&&s===110){var n=stringToBigInt(this.input.slice(t,this.pos));++this.pos;if(isIdentifierStart(this.fullCharCodeAtPos())){this.raise(this.pos,"Identifier directly after number")}return this.finishToken(xo.num,n)}if(i&&/[89]/.test(this.input.slice(t,this.pos))){i=false}if(s===46&&!i){++this.pos;this.readInt(10);s=this.input.charCodeAt(this.pos)}if((s===69||s===101)&&!i){s=this.input.charCodeAt(++this.pos);if(s===43||s===45){++this.pos}if(this.readInt(10)===null){this.raise(t,"Invalid number")}}if(isIdentifierStart(this.fullCharCodeAtPos())){this.raise(this.pos,"Identifier directly after number")}var r=stringToNumber(this.input.slice(t,this.pos),i);return this.finishToken(xo.num,r)};za.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){if(this.options.ecmaVersion<6){this.unexpected()}var i=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos);++this.pos;if(t>1114111){this.invalidStringToken(i,"Code point out of bounds")}}else{t=this.readHexChar(4)}return t};za.readString=function(e){var t="",i=++this.pos;for(;;){if(this.pos>=this.input.length){this.raise(this.start,"Unterminated string constant")}var s=this.input.charCodeAt(this.pos);if(s===e){break}if(s===92){t+=this.input.slice(i,this.pos);t+=this.readEscapedChar(false);i=this.pos}else if(s===8232||s===8233){if(this.options.ecmaVersion<10){this.raise(this.start,"Unterminated string constant")}++this.pos;if(this.options.locations){this.curLine++;this.lineStart=this.pos}}else{if(isNewLine(s)){this.raise(this.start,"Unterminated string constant")}++this.pos}}t+=this.input.slice(i,this.pos++);return this.finishToken(xo.string,t)};var ja={};za.tryReadTemplateToken=function(){this.inTemplateElement=true;try{this.readTmplToken()}catch(e){if(e===ja){this.readInvalidTemplateToken()}else{throw e}}this.inTemplateElement=false};za.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9){throw ja}else{this.raise(e,t)}};za.readTmplToken=function(){var e="",t=this.pos;for(;;){if(this.pos>=this.input.length){this.raise(this.start,"Unterminated template")}var i=this.input.charCodeAt(this.pos);if(i===96||i===36&&this.input.charCodeAt(this.pos+1)===123){if(this.pos===this.start&&(this.type===xo.template||this.type===xo.invalidTemplate)){if(i===36){this.pos+=2;return this.finishToken(xo.dollarBraceL)}else{++this.pos;return this.finishToken(xo.backQuote)}}e+=this.input.slice(t,this.pos);return this.finishToken(xo.template,e)}if(i===92){e+=this.input.slice(t,this.pos);e+=this.readEscapedChar(true);t=this.pos}else if(isNewLine(i)){e+=this.input.slice(t,this.pos);++this.pos;switch(i){case 13:if(this.input.charCodeAt(this.pos)===10){++this.pos}case 10:e+="\n";break;default:e+=String.fromCharCode(i);break}if(this.options.locations){++this.curLine;this.lineStart=this.pos}t=this.pos}else{++this.pos}}};za.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++){switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{"){break}case"`":return this.finishToken(xo.invalidTemplate,this.input.slice(this.start,this.pos))}}this.raise(this.start,"Unterminated template")};za.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);++this.pos;switch(t){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return codePointToString(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:if(this.input.charCodeAt(this.pos)===10){++this.pos}case 10:if(this.options.locations){this.lineStart=this.pos;++this.curLine}return"";case 56:case 57:if(this.strict){this.invalidStringToken(this.pos-1,"Invalid escape sequence")}if(e){var i=this.pos-1;this.invalidStringToken(i,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var s=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0];var n=parseInt(s,8);if(n>255){s=s.slice(0,-1);n=parseInt(s,8)}this.pos+=s.length-1;t=this.input.charCodeAt(this.pos);if((s!=="0"||t===56||t===57)&&(this.strict||e)){this.invalidStringToken(this.pos-1-s.length,e?"Octal literal in template string":"Octal literal in strict mode")}return String.fromCharCode(n)}if(isNewLine(t)){return""}return String.fromCharCode(t)}};za.readHexChar=function(e){var t=this.pos;var i=this.readInt(16,e);if(i===null){this.invalidStringToken(t,"Bad character escape sequence")}return i};za.readWord1=function(){this.containsEsc=false;var e="",t=true,i=this.pos;var s=this.options.ecmaVersion>=6;while(this.pos<this.input.length){var n=this.fullCharCodeAtPos();if(isIdentifierChar(n,s)){this.pos+=n<=65535?1:2}else if(n===92){this.containsEsc=true;e+=this.input.slice(i,this.pos);var r=this.pos;if(this.input.charCodeAt(++this.pos)!==117){this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX")}++this.pos;var o=this.readCodePoint();if(!(t?isIdentifierStart:isIdentifierChar)(o,s)){this.invalidStringToken(r,"Invalid Unicode escape")}e+=codePointToString(o);i=this.pos}else{break}t=false}return e+this.input.slice(i,this.pos)};za.readWord=function(){var e=this.readWord1();var t=xo.name;if(this.keywords.test(e)){t=Eo[e]}return this.finishToken(t,e)};var Ua="8.8.2";Qo.acorn={Parser:Qo,version:Ua,defaultOptions:$o,Position:No,SourceLocation:Ro,getLineInfo:getLineInfo,Node:ya,TokenType:mo,tokTypes:xo,keywordTypes:Eo,TokContext:ca,tokContexts:ua,isIdentifierChar:isIdentifierChar,isIdentifierStart:isIdentifierStart,Token:Va,isNewLine:isNewLine,lineBreak:bo,lineBreakG:vo,nonASCIIwhitespace:So};function parse(e,t){return Qo.parse(e,t)}function parseExpressionAt(e,t,i){return Qo.parseExpressionAt(e,t,i)}function tokenizer(e,t){return Qo.tokenizer(e,t)}const Ha=Object.defineProperty({__proto__:null,Node:ya,Parser:Qo,Position:No,SourceLocation:Ro,TokContext:ca,Token:Va,TokenType:mo,defaultOptions:$o,getLineInfo:getLineInfo,isIdentifierChar:isIdentifierChar,isIdentifierStart:isIdentifierStart,isNewLine:isNewLine,keywordTypes:Eo,lineBreak:bo,lineBreakG:vo,nonASCIIwhitespace:So,parse:parse,parseExpressionAt:parseExpressionAt,tokContexts:ua,tokTypes:xo,tokenizer:tokenizer,version:Ua},Symbol.toStringTag,{value:"Module"});function flru(e){var t,i,s;var n=e||1;function keep(e,r){if(++t>n){s=i;reset(1);++t}i[e]=r}function reset(e){t=0;i=Object.create(null);e||(s=Object.create(null))}reset();return{clear:reset,has:function(e){return i[e]!==void 0||s[e]!==void 0},get:function(e){var t=i[e];if(t!==void 0)return t;if((t=s[e])!==void 0){keep(e,t);return t}},set:function(e,t){if(i[e]!==void 0){i[e]=t}else{keep(e,t)}}}}function resolveIdViaPlugins(e,t,i,s,n,r,o,l){let c=null;let u=null;if(n){c=new Set;for(const i of n){if(e===i.source&&t===i.importer){c.add(i.plugin)}}u=(e,t)=>({...e,resolve:(e,i,{assertions:r,custom:o,isEntry:l,skipSelf:c}=q)=>s(e,i,o,l,r||K,c?[...n,{importer:i,plugin:t,source:e}]:n)})}return i.hookFirstAndGetPlugin("resolveId",[e,t,{assertions:l,custom:r,isEntry:o}],u,c)}async function resolveId(e,t,i,s,n,o,l,c,u){const h=await resolveIdViaPlugins(e,t,s,n,o,l,c,u);if(h!=null){const[e,t]=h;if(typeof e==="object"&&!e.resolvedBy){return{...e,resolvedBy:t.name}}if(typeof e==="string"){return{id:e,resolvedBy:t.name}}return e}if(t!==undefined&&!isAbsolute(e)&&e[0]!==".")return null;return addJsExtensionIfNecessary(t?r.resolve(r.dirname(t),e):r.resolve(e),i)}async function addJsExtensionIfNecessary(e,t){return await findFile(e,t)??await findFile(e+".mjs",t)??await findFile(e+".js",t)}async function findFile(e,t){try{const i=await u.lstat(e);if(!t&&i.isSymbolicLink())return await findFile(await u.realpath(e),t);if(t&&i.isSymbolicLink()||i.isFile()){const t=r.basename(e);const i=await u.readdir(r.dirname(e));if(i.includes(t))return e}}catch{}}const Ga="at position ";const Wa="at output position ";function createPluginCache(e){return{delete(t){return delete e[t]},get(t){const i=e[t];if(!i)return;i[0]=0;return i[1]},has(t){const i=e[t];if(!i)return false;i[0]=0;return true},set(t,i){e[t]=[0,i]}}}function getTrackedPluginCache(e,t){return{delete(i){t();return e.delete(i)},get(i){t();return e.get(i)},has(i){t();return e.has(i)},set(i,s){t();return e.set(i,s)}}}const qa={delete(){return false},get(){return undefined},has(){return false},set(){}};function uncacheablePluginError(e){if(e.startsWith(Ga)||e.startsWith(Wa)){return error(errorAnonymousPluginCache())}return error(errorDuplicatePluginName(e))}function getCacheForUncacheablePlugin(e){return{delete(){return uncacheablePluginError(e)},get(){return uncacheablePluginError(e)},has(){return uncacheablePluginError(e)},set(){return uncacheablePluginError(e)}}}async function transform(e,t,i,s){const n=t.id;const r=[];let o=e.map===null?null:decodedSourcemap(e.map);const l=e.code;let c=e.ast;const u=[];const h=[];let d=false;const useCustomTransformCache=()=>d=true;let p="";const f=e.code;function transformReducer(e,i,n){let o;let l;if(typeof i==="string"){o=i}else if(i&&typeof i==="object"){t.updateOptions(i);if(i.code==null){if(i.map||i.ast){s(errorNoTransformMapOrAstWithoutCode(n.name))}return e}({code:o,map:l,ast:c}=i)}else{return e}if(l!==null){r.push(decodedSourcemap(typeof l==="string"?JSON.parse(l):l)||{missing:true,plugin:n.name})}return o}let m;try{m=await i.hookReduceArg0("transform",[f,n],transformReducer,((e,t)=>{p=t.name;return{...e,addWatchFile(t){u.push(t);e.addWatchFile(t)},cache:d?e.cache:getTrackedPluginCache(e.cache,useCustomTransformCache),emitFile(e){h.push(e);return i.emitFile(e)},error(t,i){if(typeof t==="string")t={message:t};if(i)augmentCodeLocation(t,i,f,n);t.id=n;t.hook="transform";return e.error(t)},getCombinedSourcemap(){const e=collapseSourcemap(n,l,o,r,s);if(!e){const e=new MagicString(l);return e.generateMap({hires:true,includeContent:true,source:n})}if(o!==e){o=e;r.length=0}return new SourceMap({...e,file:null,sourcesContent:e.sourcesContent})},setAssetSource(){return this.error(errorInvalidSetAssetSourceCall())},warn(t,i){if(typeof t==="string")t={message:t};if(i)augmentCodeLocation(t,i,f,n);t.id=n;t.hook="transform";e.warn(t)}}}))}catch(e){return error(errorPluginError(e,p,{hook:"transform",id:n}))}if(!d&&h.length>0)t.transformFiles=h;return{ast:c,code:m,customTransformCache:d,originalCode:l,originalSourcemap:o,sourcemapChain:r,transformDependencies:u}}const Ka="resolveDependencies";class ModuleLoader{constructor(e,t,i,s){this.graph=e;this.modulesById=t;this.options=i;this.pluginDriver=s;this.implicitEntryModules=new Set;this.indexedEntryModules=[];this.latestLoadModulesPromise=Promise.resolve();this.moduleLoadPromises=new Map;this.modulesWithLoadedDependencies=new Set;this.nextChunkNamePriority=0;this.nextEntryModuleIndex=0;this.resolveId=async(e,t,i,s,n,r=null)=>this.getResolvedIdWithDefaults(this.getNormalizedResolvedIdWithoutDefaults(this.options.external(e,t,false)?false:await resolveId(e,t,this.options.preserveSymlinks,this.pluginDriver,this.resolveId,r,i,typeof s==="boolean"?s:!t,n),t,e),n);this.hasModuleSideEffects=i.treeshake?i.treeshake.moduleSideEffects:()=>true}async addAdditionalModules(e){const t=this.extendLoadModulesPromise(Promise.all(e.map((e=>this.loadEntryModule(e,false,undefined,null)))));await this.awaitLoadModulesPromise();return t}async addEntryModules(e,t){const i=this.nextEntryModuleIndex;this.nextEntryModuleIndex+=e.length;const s=this.nextChunkNamePriority;this.nextChunkNamePriority+=e.length;const n=await this.extendLoadModulesPromise(Promise.all(e.map((({id:e,importer:t})=>this.loadEntryModule(e,true,t,null)))).then((n=>{for(const[r,o]of n.entries()){o.isUserDefinedEntryPoint=o.isUserDefinedEntryPoint||t;addChunkNamesToModule(o,e[r],t,s+r);const n=this.indexedEntryModules.find((e=>e.module===o));if(n){n.index=Math.min(n.index,i+r)}else{this.indexedEntryModules.push({index:i+r,module:o})}}this.indexedEntryModules.sort((({index:e},{index:t})=>e>t?1:-1));return n})));await this.awaitLoadModulesPromise();return{entryModules:this.indexedEntryModules.map((({module:e})=>e)),implicitEntryModules:[...this.implicitEntryModules],newEntryModules:n}}async emitChunk({fileName:e,id:t,importer:i,name:s,implicitlyLoadedAfterOneOf:n,preserveSignature:r}){const o={fileName:e||null,id:t,importer:i,name:s||null};const l=n?await this.addEntryWithImplicitDependants(o,n):(await this.addEntryModules([o],false)).newEntryModules[0];if(r!=null){l.preserveSignature=r}return l}async preloadModule(e){const t=await this.fetchModule(this.getResolvedIdWithDefaults(e,K),undefined,false,e.resolveDependencies?Ka:true);return t.info}addEntryWithImplicitDependants(e,t){const i=this.nextChunkNamePriority++;return this.extendLoadModulesPromise(this.loadEntryModule(e.id,false,e.importer,null).then((async s=>{addChunkNamesToModule(s,e,false,i);if(!s.info.isEntry){this.implicitEntryModules.add(s);const i=await Promise.all(t.map((t=>this.loadEntryModule(t,false,e.importer,s.id))));for(const e of i){s.implicitlyLoadedAfter.add(e)}for(const e of s.implicitlyLoadedAfter){e.implicitlyLoadedBefore.add(s)}}return s})))}async addModuleSource(e,t,i){let s;try{s=await this.graph.fileOperationQueue.run((async()=>await this.pluginDriver.hookFirst("load",[e])??await u.readFile(e,"utf8")))}catch(i){let s=`Could not load ${e}`;if(t)s+=` (imported by ${relativeId(t)})`;s+=`: ${i.message}`;i.message=s;throw i}const n=typeof s==="string"?{code:s}:s!=null&&typeof s==="object"&&typeof s.code==="string"?s:error(errorBadLoader(e));const r=this.graph.cachedModules.get(e);if(r&&!r.customTransformCache&&r.originalCode===n.code&&!await this.pluginDriver.hookFirst("shouldTransformCachedModule",[{ast:r.ast,code:r.code,id:r.id,meta:r.meta,moduleSideEffects:r.moduleSideEffects,resolvedSources:r.resolvedIds,syntheticNamedExports:r.syntheticNamedExports}])){if(r.transformFiles){for(const e of r.transformFiles)this.pluginDriver.emitFile(e)}i.setSource(r)}else{i.updateOptions(n);i.setSource(await transform(n,i,this.pluginDriver,this.options.onwarn))}}async awaitLoadModulesPromise(){let e;do{e=this.latestLoadModulesPromise;await e}while(e!==this.latestLoadModulesPromise)}extendLoadModulesPromise(e){this.latestLoadModulesPromise=Promise.all([e,this.latestLoadModulesPromise]);this.latestLoadModulesPromise.catch((()=>{}));return e}async fetchDynamicDependencies(e,t){const i=await Promise.all(t.map((t=>t.then((async([t,i])=>{if(i===null)return null;if(typeof i==="string"){t.resolution=i;return null}return t.resolution=await this.fetchResolvedDependency(relativeId(i.id),e.id,i)})))));for(const t of i){if(t){e.dynamicDependencies.add(t);t.dynamicImporters.push(e.id)}}}async fetchModule({assertions:e,id:t,meta:i,moduleSideEffects:s,syntheticNamedExports:n},r,o,l){const c=this.modulesById.get(t);if(c instanceof Module){if(r&&doAssertionsDiffer(e,c.info.assertions)){this.options.onwarn(errorInconsistentImportAssertions(c.info.assertions,e,t,r))}await this.handleExistingModule(c,o,l);return c}const u=new Module(this.graph,t,this.options,o,s,n,i,e);this.modulesById.set(t,u);this.graph.watchFiles[t]=true;const h=this.addModuleSource(t,r,u).then((()=>[this.getResolveStaticDependencyPromises(u),this.getResolveDynamicImportPromises(u),d]));const d=waitForDependencyResolution(h).then((()=>this.pluginDriver.hookParallel("moduleParsed",[u.info])));d.catch((()=>{}));this.moduleLoadPromises.set(u,h);const p=await h;if(!l){await this.fetchModuleDependencies(u,...p)}else if(l===Ka){await d}return u}async fetchModuleDependencies(e,t,i,s){if(this.modulesWithLoadedDependencies.has(e)){return}this.modulesWithLoadedDependencies.add(e);await Promise.all([this.fetchStaticDependencies(e,t),this.fetchDynamicDependencies(e,i)]);e.linkImports();await s}fetchResolvedDependency(e,t,i){if(i.external){const{assertions:s,external:n,id:r,moduleSideEffects:o,meta:l}=i;let c=this.modulesById.get(r);if(!c){c=new ExternalModule(this.options,r,o,l,n!=="absolute"&&isAbsolute(r),s);this.modulesById.set(r,c)}else if(!(c instanceof ExternalModule)){return error(errorInternalIdCannotBeExternal(e,t))}else if(doAssertionsDiffer(c.info.assertions,s)){this.options.onwarn(errorInconsistentImportAssertions(c.info.assertions,s,e,t))}return Promise.resolve(c)}return this.fetchModule(i,t,false,false)}async fetchStaticDependencies(e,t){for(const i of await Promise.all(t.map((t=>t.then((([t,i])=>this.fetchResolvedDependency(t,e.id,i))))))){e.dependencies.add(i);i.importers.push(e.id)}if(!this.options.treeshake||e.info.moduleSideEffects==="no-treeshake"){for(const t of e.dependencies){if(t instanceof Module){t.importedFromNotTreeshaken=true}}}}getNormalizedResolvedIdWithoutDefaults(e,t,i){const{makeAbsoluteExternalsRelative:s}=this.options;if(e){if(typeof e==="object"){const n=e.external||this.options.external(e.id,t,true);return{...e,external:n&&(n==="relative"||!isAbsolute(e.id)||n===true&&isNotAbsoluteExternal(e.id,i,s)||"absolute")}}const n=this.options.external(e,t,true);return{external:n&&(isNotAbsoluteExternal(e,i,s)||"absolute"),id:n&&s?normalizeRelativeExternalId(e,t):e}}const n=s?normalizeRelativeExternalId(i,t):i;if(e!==false&&!this.options.external(n,t,true)){return null}return{external:isNotAbsoluteExternal(n,i,s)||"absolute",id:n}}getResolveDynamicImportPromises(e){return e.dynamicImports.map((async t=>{const i=await this.resolveDynamicImport(e,typeof t.argument==="string"?t.argument:t.argument.esTreeNode,e.id,getAssertionsFromImportExpression(t.node));if(i&&typeof i==="object"){t.id=i.id}return[t,i]}))}getResolveStaticDependencyPromises(e){return Array.from(e.sourcesWithAssertions,(async([t,i])=>[t,e.resolvedIds[t]=e.resolvedIds[t]||this.handleInvalidResolvedId(await this.resolveId(t,e.id,K,false,i),t,e.id,i)]))}getResolvedIdWithDefaults(e,t){if(!e){return null}const i=e.external||false;return{assertions:e.assertions||t,external:i,id:e.id,meta:e.meta||{},moduleSideEffects:e.moduleSideEffects??this.hasModuleSideEffects(e.id,!!i),resolvedBy:e.resolvedBy??"rollup",syntheticNamedExports:e.syntheticNamedExports??false}}async handleExistingModule(e,t,i){const s=this.moduleLoadPromises.get(e);if(i){return i===Ka?waitForDependencyResolution(s):s}if(t){e.info.isEntry=true;this.implicitEntryModules.delete(e);for(const t of e.implicitlyLoadedAfter){t.implicitlyLoadedBefore.delete(e)}e.implicitlyLoadedAfter.clear()}return this.fetchModuleDependencies(e,...await s)}handleInvalidResolvedId(e,t,i,s){if(e===null){if(isRelative(t)){return error(errorUnresolvedImport(t,i))}this.options.onwarn(errorUnresolvedImportTreatedAsExternal(t,i));return{assertions:s,external:true,id:t,meta:{},moduleSideEffects:this.hasModuleSideEffects(t,true),resolvedBy:"rollup",syntheticNamedExports:false}}else if(e.external&&e.syntheticNamedExports){this.options.onwarn(errorExternalSyntheticExports(t,i))}return e}async loadEntryModule(e,t,i,s){const n=await resolveId(e,i,this.options.preserveSymlinks,this.pluginDriver,this.resolveId,null,K,true,K);if(n==null){return error(s===null?errorUnresolvedEntry(e):errorUnresolvedImplicitDependant(e,s))}if(n===false||typeof n==="object"&&n.external){return error(s===null?errorEntryCannotBeExternal(e):errorImplicitDependantCannotBeExternal(e,s))}return this.fetchModule(this.getResolvedIdWithDefaults(typeof n==="object"?n:{id:n},K),undefined,t,false)}async resolveDynamicImport(e,t,i,s){const n=await this.pluginDriver.hookFirst("resolveDynamicImport",[t,i,{assertions:s}]);if(typeof t!=="string"){if(typeof n==="string"){return n}if(!n){return null}return this.getResolvedIdWithDefaults(n,s)}if(n==null){const n=e.resolvedIds[t];if(n){if(doAssertionsDiffer(n.assertions,s)){this.options.onwarn(errorInconsistentImportAssertions(n.assertions,s,t,i))}return n}return e.resolvedIds[t]=this.handleInvalidResolvedId(await this.resolveId(t,e.id,K,false,s),t,e.id,s)}return this.handleInvalidResolvedId(this.getResolvedIdWithDefaults(this.getNormalizedResolvedIdWithoutDefaults(n,i,t),s),t,i,s)}}function normalizeRelativeExternalId(e,t){return isRelative(e)?t?r.resolve(t,"..",e):r.resolve(e):e}function addChunkNamesToModule(e,{fileName:t,name:i},s,n){if(t!==null){e.chunkFileNames.add(t)}else if(i!==null){let t=0;while(e.chunkNames[t]?.priority<n)t++;e.chunkNames.splice(t,0,{isUserDefined:s,name:i,priority:n})}}function isNotAbsoluteExternal(e,t,i){return i===true||i==="ifRelativeSource"&&isRelative(t)||!isAbsolute(e)}async function waitForDependencyResolution(e){const[t,i]=await e;return Promise.all([...t,...i])}class GlobalScope extends qn{constructor(){super();this.parent=null;this.variables.set("undefined",new UndefinedVariable)}findVariable(e){let t=this.variables.get(e);if(!t){t=new GlobalVariable(e);this.variables.set(e,t)}return t}}function getSourceHash(e){return createHash().update(e).digest("hex")}function generateAssetFileName(e,t,i,s,n){const o=s.sanitizeFileName(e||"asset");return makeUnique(renderNamePattern(typeof s.assetFileNames==="function"?s.assetFileNames({name:e,source:t,type:"asset"}):s.assetFileNames,"output.assetFileNames",{ext:()=>r.extname(o).slice(1),extname:()=>r.extname(o),hash:e=>i.slice(0,Math.max(0,e||Xr)),name:()=>o.slice(0,Math.max(0,o.length-r.extname(o).length))}),n)}function reserveFileNameInBundle(e,{bundle:t},i){if(t[Jr].has(e.toLowerCase())){i(errorFileNameConflict(e))}else{t[e]=eo}}const Ya=new Set(["chunk","asset","prebuilt-chunk"]);function hasValidType(e){return Boolean(e&&Ya.has(e.type))}function hasValidName(e){const t=e.fileName||e.name;return!t||typeof t==="string"&&!isPathFragment(t)}function getValidSource(e,t,i){if(!(typeof e==="string"||e instanceof Uint8Array)){const e=t.fileName||t.name||i;return error(errorFailedValidation(`Could not set source for ${typeof e==="string"?`asset "${e}"`:"unnamed asset"}, asset source needs to be a string, Uint8Array or Buffer.`))}return e}function getAssetFileName(e,t){if(typeof e.fileName!=="string"){return error(errorAssetNotFinalisedForFileName(e.name||t))}return e.fileName}function getChunkFileName(e,t){if(e.fileName){return e.fileName}if(t){return t.get(e.module).getFileName()}return error(errorChunkNotGeneratedForFileName(e.fileName||e.name))}class FileEmitter{constructor(e,t,i){this.graph=e;this.options=t;this.facadeChunkByModule=null;this.nextIdBase=1;this.output=null;this.outputFileEmitters=[];this.emitFile=e=>{if(!hasValidType(e)){return error(errorFailedValidation(`Emitted files must be of type "asset", "chunk" or "prebuilt-chunk", received "${e&&e.type}".`))}if(e.type==="prebuilt-chunk"){return this.emitPrebuiltChunk(e)}if(!hasValidName(e)){return error(errorFailedValidation(`The "fileName" or "name" properties of emitted chunks and assets must be strings that are neither absolute nor relative paths, received "${e.fileName||e.name}".`))}if(e.type==="chunk"){return this.emitChunk(e)}return this.emitAsset(e)};this.finaliseAssets=()=>{for(const[e,t]of this.filesByReferenceId){if(t.type==="asset"&&typeof t.fileName!=="string")return error(errorNoAssetSourceSet(t.name||e))}};this.getFileName=e=>{const t=this.filesByReferenceId.get(e);if(!t)return error(errorFileReferenceIdNotFoundForFilename(e));if(t.type==="chunk"){return getChunkFileName(t,this.facadeChunkByModule)}if(t.type==="prebuilt-chunk"){return t.fileName}return getAssetFileName(t,e)};this.setAssetSource=(e,t)=>{const i=this.filesByReferenceId.get(e);if(!i)return error(errorAssetReferenceIdNotFoundForSetSource(e));if(i.type!=="asset"){return error(errorFailedValidation(`Asset sources can only be set for emitted assets but "${e}" is an emitted chunk.`))}if(i.source!==undefined){return error(errorAssetSourceAlreadySet(i.name||e))}const s=getValidSource(t,i,e);if(this.output){this.finalizeAdditionalAsset(i,s,this.output)}else{i.source=s;for(const e of this.outputFileEmitters){e.finalizeAdditionalAsset(i,s,e.output)}}};this.setChunkInformation=e=>{this.facadeChunkByModule=e};this.setOutputBundle=(e,t)=>{const i=this.output={bundle:e,fileNamesBySource:new Map,outputOptions:t};for(const e of this.filesByReferenceId.values()){if(e.fileName){reserveFileNameInBundle(e.fileName,i,this.options.onwarn)}}const s=new Map;for(const e of this.filesByReferenceId.values()){if(e.type==="asset"&&e.source!==undefined){if(e.fileName){this.finalizeAdditionalAsset(e,e.source,i)}else{const t=getSourceHash(e.source);getOrCreate(s,t,(()=>[])).push(e)}}else if(e.type==="prebuilt-chunk"){this.output.bundle[e.fileName]=this.createPrebuiltChunk(e)}}for(const[e,t]of s){this.finalizeAssetsWithSameSource(t,e,i)}};this.filesByReferenceId=i?new Map(i.filesByReferenceId):new Map;i?.addOutputFileEmitter(this)}addOutputFileEmitter(e){this.outputFileEmitters.push(e)}assignReferenceId(e,t){let i=t;do{i=createHash().update(i).digest("hex").slice(0,8)}while(this.filesByReferenceId.has(i)||this.outputFileEmitters.some((({filesByReferenceId:e})=>e.has(i))));e.referenceId=i;this.filesByReferenceId.set(i,e);for(const{filesByReferenceId:t}of this.outputFileEmitters){t.set(i,e)}return i}createPrebuiltChunk(e){return{code:e.code,dynamicImports:[],exports:e.exports||[],facadeModuleId:null,fileName:e.fileName,implicitlyLoadedBefore:[],importedBindings:{},imports:[],isDynamicEntry:false,isEntry:false,isImplicitEntry:false,map:e.map||null,moduleIds:[],modules:{},name:e.fileName,referencedFiles:[],type:"chunk"}}emitAsset(e){const t=e.source===undefined?undefined:getValidSource(e.source,e,null);const i={fileName:e.fileName,name:e.name,needsCodeReference:!!e.needsCodeReference,referenceId:"",source:t,type:"asset"};const s=this.assignReferenceId(i,e.fileName||e.name||String(this.nextIdBase++));if(this.output){this.emitAssetWithReferenceId(i,this.output)}else{for(const e of this.outputFileEmitters){e.emitAssetWithReferenceId(i,e.output)}}return s}emitAssetWithReferenceId(e,t){const{fileName:i,source:s}=e;if(i){reserveFileNameInBundle(i,t,this.options.onwarn)}if(s!==undefined){this.finalizeAdditionalAsset(e,s,t)}}emitChunk(e){if(this.graph.phase>Dr.LOAD_AND_PARSE){return error(errorInvalidRollupPhaseForChunkEmission())}if(typeof e.id!=="string"){return error(errorFailedValidation(`Emitted chunks need to have a valid string id, received "${e.id}"`))}const t={fileName:e.fileName,module:null,name:e.name||e.id,referenceId:"",type:"chunk"};this.graph.moduleLoader.emitChunk(e).then((e=>t.module=e)).catch((()=>{}));return this.assignReferenceId(t,e.id)}emitPrebuiltChunk(e){if(typeof e.code!=="string"){return error(errorFailedValidation(`Emitted prebuilt chunks need to have a valid string code, received "${e.code}".`))}if(typeof e.fileName!=="string"||isPathFragment(e.fileName)){return error(errorFailedValidation(`The "fileName" property of emitted prebuilt chunks must be strings that are neither absolute nor relative paths, received "${e.fileName}".`))}const t={code:e.code,exports:e.exports,fileName:e.fileName,map:e.map,referenceId:"",type:"prebuilt-chunk"};const i=this.assignReferenceId(t,t.fileName);if(this.output){this.output.bundle[t.fileName]=this.createPrebuiltChunk(t)}return i}finalizeAdditionalAsset(e,t,{bundle:i,fileNamesBySource:s,outputOptions:n}){let{fileName:r,needsCodeReference:o,referenceId:l}=e;if(!r){const o=getSourceHash(t);r=s.get(o);if(!r){r=generateAssetFileName(e.name,t,o,n,i);s.set(o,r)}}const c={...e,fileName:r,source:t};this.filesByReferenceId.set(l,c);const u=i[r];if(u?.type==="asset"){u.needsCodeReference&&(u.needsCodeReference=o)}else{i[r]={fileName:r,name:e.name,needsCodeReference:o,source:t,type:"asset"}}}finalizeAssetsWithSameSource(e,t,{bundle:i,fileNamesBySource:s,outputOptions:n}){let r="";let o;let l=true;for(const s of e){l&&(l=s.needsCodeReference);const e=generateAssetFileName(s.name,s.source,t,n,i);if(!r||e.length<r.length||e.length===r.length&&e<r){r=e;o=s}}s.set(t,r);for(const t of e){const e={...t,fileName:r};this.filesByReferenceId.set(t.referenceId,e)}i[r]={fileName:r,name:o.name,needsCodeReference:l,source:o.source,type:"asset"}}}function getPluginContext(e,t,i,s,n,r){let o=true;if(typeof e.cacheKey!=="string"){if(e.name.startsWith(Ga)||e.name.startsWith(Wa)||r.has(e.name)){o=false}else{r.add(e.name)}}let l;if(!t){l=qa}else if(o){const i=e.cacheKey||e.name;l=createPluginCache(t[i]||(t[i]=Object.create(null)))}else{l=getCacheForUncacheablePlugin(e.name)}return{addWatchFile(e){if(i.phase>=Dr.GENERATE){return this.error(errorInvalidRollupPhaseForAddWatchFile())}i.watchFiles[e]=true},cache:l,emitFile:n.emitFile.bind(n),error(t){return error(errorPluginError(t,e.name))},getFileName:n.getFileName,getModuleIds:()=>i.modulesById.keys(),getModuleInfo:i.getModuleInfo,getWatchFiles:()=>Object.keys(i.watchFiles),load(e){return i.moduleLoader.preloadModule(e)},meta:{rollupVersion:d,watchMode:i.watchMode},get moduleIds(){function*wrappedModuleIds(){warnDeprecation(`Accessing "this.moduleIds" on the plugin context by plugin ${e.name} is deprecated. The "this.getModuleIds" plugin context function should be used instead.`,G,true,s,e.name);yield*t}const t=i.modulesById.keys();return wrappedModuleIds()},parse:i.contextParse.bind(i),resolve(t,s,{assertions:n,custom:r,isEntry:o,skipSelf:l}=q){return i.moduleLoader.resolveId(t,s,r,o,n||K,l?[{importer:s,plugin:e,source:t}]:null)},setAssetSource:n.setAssetSource,warn(t){if(typeof t==="string")t={message:t};if(t.code)t.pluginCode=t.code;t.code="PLUGIN_WARNING";t.plugin=e.name;s.onwarn(t)}}}const Qa={buildEnd:1,buildStart:1,closeBundle:1,closeWatcher:1,load:1,moduleParsed:1,options:1,resolveDynamicImport:1,resolveId:1,shouldTransformCachedModule:1,transform:1,watchChange:1};const Xa=Object.keys(Qa);class PluginDriver{constructor(e,t,i,s,n){this.graph=e;this.options=t;this.pluginCache=s;this.sortedPlugins=new Map;this.unfulfilledActions=new Set;this.fileEmitter=new FileEmitter(e,t,n&&n.fileEmitter);this.emitFile=this.fileEmitter.emitFile.bind(this.fileEmitter);this.getFileName=this.fileEmitter.getFileName.bind(this.fileEmitter);this.finaliseAssets=this.fileEmitter.finaliseAssets.bind(this.fileEmitter);this.setChunkInformation=this.fileEmitter.setChunkInformation.bind(this.fileEmitter);this.setOutputBundle=this.fileEmitter.setOutputBundle.bind(this.fileEmitter);this.plugins=[...n?n.plugins:[],...i];const r=new Set;this.pluginContexts=new Map(this.plugins.map((i=>[i,getPluginContext(i,s,e,t,this.fileEmitter,r)])));if(n){for(const e of i){for(const i of Xa){if(i in e){t.onwarn(errorInputHookInOutputPlugin(e.name,i))}}}}}createOutputPluginDriver(e){return new PluginDriver(this.graph,this.options,e,this.pluginCache,this)}getUnfulfilledHookActions(){return this.unfulfilledActions}hookFirst(e,t,i,s){return this.hookFirstAndGetPlugin(e,t,i,s).then((e=>e&&e[0]))}async hookFirstAndGetPlugin(e,t,i,s){for(const n of this.getSortedPlugins(e)){if(s?.has(n))continue;const r=await this.runHook(e,t,n,i);if(r!=null)return[r,n]}return null}hookFirstSync(e,t,i){for(const s of this.getSortedPlugins(e)){const n=this.runHookSync(e,t,s,i);if(n!=null)return n}return null}async hookParallel(e,t,i){const s=[];for(const n of this.getSortedPlugins(e)){if(n[e].sequential){await Promise.all(s);s.length=0;await this.runHook(e,t,n,i)}else{s.push(this.runHook(e,t,n,i))}}await Promise.all(s)}hookReduceArg0(e,[t,...i],s,n){let r=Promise.resolve(t);for(const t of this.getSortedPlugins(e)){r=r.then((r=>this.runHook(e,[r,...i],t,n).then((e=>s.call(this.pluginContexts.get(t),r,e,t)))))}return r}hookReduceArg0Sync(e,[t,...i],s,n){for(const r of this.getSortedPlugins(e)){const o=[t,...i];const l=this.runHookSync(e,o,r,n);t=s.call(this.pluginContexts.get(r),t,l,r)}return t}async hookReduceValue(e,t,i,s){const n=[];const r=[];for(const t of this.getSortedPlugins(e,validateAddonPluginHandler)){if(t[e].sequential){n.push(...await Promise.all(r));r.length=0;n.push(await this.runHook(e,i,t))}else{r.push(this.runHook(e,i,t))}}n.push(...await Promise.all(r));return n.reduce(s,await t)}hookReduceValueSync(e,t,i,s,n){let r=t;for(const t of this.getSortedPlugins(e)){const o=this.runHookSync(e,i,t,n);r=s.call(this.pluginContexts.get(t),r,o,t)}return r}hookSeq(e,t,i){let s=Promise.resolve();for(const n of this.getSortedPlugins(e)){s=s.then((()=>this.runHook(e,t,n,i)))}return s.then(noReturn)}getSortedPlugins(e,t){return getOrCreate(this.sortedPlugins,e,(()=>getSortedValidatedPlugins(e,this.plugins,t)))}runHook(e,t,i,s){const n=i[e];const r=typeof n==="object"?n.handler:n;let o=this.pluginContexts.get(i);if(s){o=s(o,i)}let l=null;return Promise.resolve().then((()=>{if(typeof r!=="function"){return r}const s=r.apply(o,t);if(!s?.then){return s}l=[i.name,e,t];this.unfulfilledActions.add(l);return Promise.resolve(s).then((e=>{this.unfulfilledActions.delete(l);return e}))})).catch((t=>{if(l!==null){this.unfulfilledActions.delete(l)}return error(errorPluginError(t,i.name,{hook:e}))}))}runHookSync(e,t,i,s){const n=i[e];const r=typeof n==="object"?n.handler:n;let o=this.pluginContexts.get(i);if(s){o=s(o,i)}try{return r.apply(o,t)}catch(t){return error(errorPluginError(t,i.name,{hook:e}))}}}function getSortedValidatedPlugins(e,t,i=validateFunctionPluginHandler){const s=[];const n=[];const r=[];for(const o of t){const t=o[e];if(t){if(typeof t==="object"){i(t.handler,e,o);if(t.order==="pre"){s.push(o);continue}if(t.order==="post"){r.push(o);continue}}else{i(t,e,o)}n.push(o)}}return[...s,...n,...r]}function validateFunctionPluginHandler(e,t,i){if(typeof e!=="function"){error(errorInvalidFunctionPluginHook(t,i.name))}}function validateAddonPluginHandler(e,t,i){if(typeof e!=="string"&&typeof e!=="function"){return error(errorInvalidAddonPluginHook(t,i.name))}}function noReturn(){}class Queue{constructor(e){this.maxParallel=e;this.queue=[];this.workerCount=0}run(e){return new Promise(((t,i)=>{this.queue.push({reject:i,resolve:t,task:e});this.work()}))}async work(){if(this.workerCount>=this.maxParallel)return;this.workerCount++;let e;while(e=this.queue.shift()){const{reject:t,resolve:i,task:s}=e;try{const e=await s();i(e)}catch(e){t(e)}}this.workerCount--}}function normalizeEntryModules(e){if(Array.isArray(e)){return e.map((e=>({fileName:null,id:e,implicitlyLoadedAfter:[],importer:undefined,name:null})))}return Object.entries(e).map((([e,t])=>({fileName:null,id:t,implicitlyLoadedAfter:[],importer:undefined,name:e})))}class Graph{constructor(e,t){this.options=e;this.astLru=flru(5);this.cachedModules=new Map;this.deoptimizationTracker=new PathTracker;this.entryModules=[];this.modulesById=new Map;this.needsTreeshakingPass=false;this.phase=Dr.LOAD_AND_PARSE;this.scope=new GlobalScope;this.watchFiles=Object.create(null);this.watchMode=false;this.externalModules=[];this.implicitEntryModules=[];this.modules=[];this.getModuleInfo=e=>{const t=this.modulesById.get(e);if(!t)return null;return t.info};if(e.cache!==false){if(e.cache?.modules){for(const t of e.cache.modules)this.cachedModules.set(t.id,t)}this.pluginCache=e.cache?.plugins||Object.create(null);for(const e in this.pluginCache){const t=this.pluginCache[e];for(const e of Object.values(t))e[0]++}}if(t){this.watchMode=true;const handleChange=(...e)=>this.pluginDriver.hookParallel("watchChange",e);const handleClose=()=>this.pluginDriver.hookParallel("closeWatcher",[]);t.onCurrentRun("change",handleChange);t.onCurrentRun("close",handleClose)}this.pluginDriver=new PluginDriver(this,e,e.plugins,this.pluginCache);this.acornParser=Qo.extend(...e.acornInjectPlugins);this.moduleLoader=new ModuleLoader(this,this.modulesById,this.options,this.pluginDriver);this.fileOperationQueue=new Queue(e.maxParallelFileOps);this.pureFunctions=getPureFunctions(e)}async build(){Lr("generate module graph",2);await this.generateModuleGraph();Br("generate module graph",2);Lr("sort and bind modules",2);this.phase=Dr.ANALYSE;this.sortModules();Br("sort and bind modules",2);Lr("mark included statements",2);this.includeStatements();Br("mark included statements",2);this.phase=Dr.GENERATE}contextParse(e,t={}){const i=t.onComment;const s=[];t.onComment=i&&typeof i=="function"?(e,n,r,o,...l)=>{s.push({end:o,start:r,type:e?"Block":"Line",value:n});return i.call(t,e,n,r,o,...l)}:s;const n=this.acornParser.parse(e,{...this.options.acorn,...t});if(typeof i=="object"){i.push(...s)}t.onComment=i;addAnnotations(s,n,e);return n}getCache(){for(const e in this.pluginCache){const t=this.pluginCache[e];let i=true;for(const[e,s]of Object.entries(t)){if(s[0]>=this.options.experimentalCacheExpiry)delete t[e];else i=false}if(i)delete this.pluginCache[e]}return{modules:this.modules.map((e=>e.toJSON())),plugins:this.pluginCache}}async generateModuleGraph(){({entryModules:this.entryModules,implicitEntryModules:this.implicitEntryModules}=await this.moduleLoader.addEntryModules(normalizeEntryModules(this.options.input),true));if(this.entryModules.length===0){throw new Error("You must supply options.input to rollup")}for(const e of this.modulesById.values()){if(e instanceof Module){this.modules.push(e)}else{this.externalModules.push(e)}}}includeStatements(){const e=[...this.entryModules,...this.implicitEntryModules];for(const t of e){markModuleAndImpureDependenciesAsExecuted(t)}if(this.options.treeshake){let t=1;do{Lr(`treeshaking pass ${t}`,3);this.needsTreeshakingPass=false;for(const e of this.modules){if(e.isExecuted){if(e.info.moduleSideEffects==="no-treeshake"){e.includeAllInBundle()}else{e.include()}}}if(t===1){for(const t of e){if(t.preserveSignature!==false){t.includeAllExports(false);this.needsTreeshakingPass=true}}}Br(`treeshaking pass ${t++}`,3)}while(this.needsTreeshakingPass)}else{for(const e of this.modules)e.includeAllInBundle()}for(const e of this.externalModules)e.warnUnusedImports();for(const e of this.implicitEntryModules){for(const t of e.implicitlyLoadedAfter){if(!(t.info.isEntry||t.isIncluded())){error(errorImplicitDependantIsNotIncluded(t))}}}}sortModules(){const{orderedModules:e,cyclePaths:t}=analyseModuleExecution(this.entryModules);for(const e of t){this.options.onwarn(errorCircularDependency(e))}this.modules=e;for(const e of this.modules){e.bindReferences()}this.warnForMissingExports()}warnForMissingExports(){for(const e of this.modules){for(const t of e.importDescriptions.values()){if(t.name!=="*"&&!t.module.getVariableForExportName(t.name)[0]){e.warn(errorMissingExport(t.name,e.id,t.module.id),t.start)}}}}}function formatAction([e,t,i]){const s=`(${e}) ${t}`;const n=JSON.stringify;switch(t){case"resolveId":{return`${s} ${n(i[0])} ${n(i[1])}`}case"load":{return`${s} ${n(i[0])}`}case"transform":{return`${s} ${n(i[1])}`}case"shouldTransformCachedModule":{return`${s} ${n(i[0].id)}`}case"moduleParsed":{return`${s} ${n(i[0].id)}`}}return s}let Za=null;const Ja=new Map;async function catchUnfinishedHookActions(e,t){const i=new Promise(((t,i)=>{Ja.set(e,i);if(!Za){Za=()=>{for(const[e,t]of Ja){const i=e.getUnfulfilledHookActions();t(new Error(`Unexpected early exit. This happens when Promises returned by plugins cannot resolve. Unfinished hook action(s) on exit:\n`+[...i].map(formatAction).join("\n")))}};s.once("beforeExit",Za)}}));try{return await Promise.race([t(),i])}finally{Ja.delete(e);if(Ja.size===0){s.off("beforeExit",Za);Za=null}}}const el="{".charCodeAt(0);const tl=" ".charCodeAt(0);const il="assert";const sl=1,nl=4;function importAssertions(e){const t=e.acorn||Ha;const{tokTypes:i,TokenType:s}=t;return class extends e{constructor(...e){super(...e);this.assertToken=new s(il)}_codeAt(e){return this.input.charCodeAt(e)}_eat(e){if(this.type!==e){this.unexpected()}this.next()}readToken(e){let t=0;for(;t<il.length;t++){if(this._codeAt(this.pos+t)!==il.charCodeAt(t)){return super.readToken(e)}}for(;;t++){if(this._codeAt(this.pos+t)===el){break}else if(this._codeAt(this.pos+t)===tl){continue}else{return super.readToken(e)}}if(this.type.label==="{"){return super.readToken(e)}this.pos+=il.length;return this.finishToken(this.assertToken)}parseDynamicImport(e){this.next();e.source=this.parseMaybeAssign();if(this.eat(i.comma)){const t=this.parseObj(false);e.arguments=[t]}this._eat(i.parenR);return this.finishNode(e,"ImportExpression")}parseExport(e,t){this.next();if(this.eat(i.star)){if(this.options.ecmaVersion>=11){if(this.eatContextual("as")){e.exported=this.parseIdent(true);this.checkExport(t,e.exported.name,this.lastTokStart)}else{e.exported=null}}this.expectContextual("from");if(this.type!==i.string){this.unexpected()}e.source=this.parseExprAtom();if(this.type===this.assertToken||this.type===i._with){this.next();const t=this.parseImportAssertions();if(t){e.assertions=t}}this.semicolon();return this.finishNode(e,"ExportAllDeclaration")}if(this.eat(i._default)){this.checkExport(t,"default",this.lastTokStart);var s;if(this.type===i._function||(s=this.isAsyncFunction())){var n=this.startNode();this.next();if(s){this.next()}e.declaration=this.parseFunction(n,sl|nl,false,s)}else if(this.type===i._class){var r=this.startNode();e.declaration=this.parseClass(r,"nullableID")}else{e.declaration=this.parseMaybeAssign();this.semicolon()}return this.finishNode(e,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement()){e.declaration=this.parseStatement(null);if(e.declaration.type==="VariableDeclaration"){this.checkVariableExport(t,e.declaration.declarations)}else{this.checkExport(t,e.declaration.id.name,e.declaration.id.start)}e.specifiers=[];e.source=null}else{e.declaration=null;e.specifiers=this.parseExportSpecifiers(t);if(this.eatContextual("from")){if(this.type!==i.string){this.unexpected()}e.source=this.parseExprAtom();if(this.type===this.assertToken||this.type===i._with){this.next();const t=this.parseImportAssertions();if(t){e.assertions=t}}}else{for(var o=0,l=e.specifiers;o<l.length;o+=1){var c=l[o];this.checkUnreserved(c.local);this.checkLocalExport(c.local)}e.source=null}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")}parseImport(e){this.next();if(this.type===i.string){e.specifiers=[];e.source=this.parseExprAtom()}else{e.specifiers=this.parseImportSpecifiers();this.expectContextual("from");e.source=this.type===i.string?this.parseExprAtom():this.unexpected()}if(this.type===this.assertToken||this.type==i._with){this.next();const t=this.parseImportAssertions();if(t){e.assertions=t}}this.semicolon();return this.finishNode(e,"ImportDeclaration")}parseImportAssertions(){this._eat(i.braceL);const e=this.parseAssertEntries();this._eat(i.braceR);return e}parseAssertEntries(){const e=[];const t=new Set;do{if(this.type===i.braceR){break}const s=this.startNode();let n;if(this.type===i.string){n=this.parseLiteral(this.value)}else{n=this.parseIdent(true)}this.next();s.key=n;if(t.has(s.key.name)){this.raise(this.pos,"Duplicated key in assertions")}t.add(s.key.name);if(this.type!==i.string){this.raise(this.pos,"Only string is supported as an assertion value")}s.value=this.parseLiteral(this.value);e.push(this.finishNode(s,"ImportAttribute"))}while(this.eat(i.comma));return e}}}async function normalizeInputOptions(e){const t=new Set;const i=e.context??"undefined";const s=getOnwarn(e);const n=e.strictDeprecations||false;const r=getmaxParallelFileOps(e,s,n);const o={acorn:getAcorn(e),acornInjectPlugins:getAcornInjectPlugins(e),cache:getCache(e),context:i,experimentalCacheExpiry:e.experimentalCacheExpiry??10,experimentalLogSideEffects:e.experimentalLogSideEffects||false,external:getIdMatcher(e.external),inlineDynamicImports:getInlineDynamicImports$1(e,s,n),input:getInput(e),makeAbsoluteExternalsRelative:e.makeAbsoluteExternalsRelative??"ifRelativeSource",manualChunks:getManualChunks$1(e,s,n),maxParallelFileOps:r,maxParallelFileReads:r,moduleContext:getModuleContext(e,i),onwarn:s,perf:e.perf||false,plugins:await normalizePluginOption(e.plugins),preserveEntrySignatures:e.preserveEntrySignatures??"exports-only",preserveModules:getPreserveModules$1(e,s,n),preserveSymlinks:e.preserveSymlinks||false,shimMissingExports:e.shimMissingExports||false,strictDeprecations:n,treeshake:getTreeshake(e)};warnUnknownOptions(e,[...Object.keys(o),"watch"],"input options",o.onwarn,/^(output)$/);return{options:o,unsetOptions:t}}const getOnwarn=e=>{const{onwarn:t}=e;return t?e=>{e.toString=()=>{let t="";if(e.plugin)t+=`(${e.plugin} plugin) `;if(e.loc)t+=`${relativeId(e.loc.file)} (${e.loc.line}:${e.loc.column}) `;t+=e.message;return t};t(e,defaultOnWarn)}:defaultOnWarn};const getAcorn=e=>({ecmaVersion:"latest",sourceType:"module",...e.acorn});const getAcornInjectPlugins=e=>[importAssertions,...ensureArray$1(e.acornInjectPlugins)];const getCache=e=>e.cache===true?undefined:e.cache?.cache||e.cache;const getIdMatcher=e=>{if(e===true){return()=>true}if(typeof e==="function"){return(t,...i)=>!t.startsWith("\0")&&e(t,...i)||false}if(e){const t=new Set;const i=[];for(const s of ensureArray$1(e)){if(s instanceof RegExp){i.push(s)}else{t.add(s)}}return(e,...s)=>t.has(e)||i.some((t=>t.test(e)))}return()=>false};const getInlineDynamicImports$1=(e,t,i)=>{const s=e.inlineDynamicImports;if(s){warnDeprecationWithOptions('The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.',R,true,t,i)}return s};const getInput=e=>{const t=e.input;return t==null?[]:typeof t==="string"?[t]:t};const getManualChunks$1=(e,t,i)=>{const s=e.manualChunks;if(s){warnDeprecationWithOptions('The "manualChunks" option is deprecated. Use the "output.manualChunks" option instead.',O,true,t,i)}return s};const getmaxParallelFileOps=(e,t,i)=>{const s=e.maxParallelFileReads;if(typeof s==="number"){warnDeprecationWithOptions('The "maxParallelFileReads" option is deprecated. Use the "maxParallelFileOps" option instead.',E,true,t,i)}const n=e.maxParallelFileOps??s;if(typeof n==="number"){if(n<=0)return Infinity;return n}return 20};const getModuleContext=(e,t)=>{const i=e.moduleContext;if(typeof i==="function"){return e=>i(e)??t}if(i){const e=Object.create(null);for(const[t,s]of Object.entries(i)){e[r.resolve(t)]=s}return i=>e[i]??t}return()=>t};const getPreserveModules$1=(e,t,i)=>{const s=e.preserveModules;if(s){warnDeprecationWithOptions('The "preserveModules" option is deprecated. Use the "output.preserveModules" option instead.',D,true,t,i)}return s};const getTreeshake=e=>{const t=e.treeshake;if(t===false){return false}const i=getOptionWithPreset(e.treeshake,gt,"treeshake",F,"false, true, ");return{annotations:i.annotations!==false,correctVarValueBeforeDeclaration:i.correctVarValueBeforeDeclaration===true,manualPureFunctions:i.manualPureFunctions??Y,moduleSideEffects:getHasModuleSideEffects(i.moduleSideEffects),propertyReadSideEffects:i.propertyReadSideEffects==="always"?"always":i.propertyReadSideEffects!==false,tryCatchDeoptimization:i.tryCatchDeoptimization!==false,unknownGlobalSideEffects:i.unknownGlobalSideEffects!==false}};const getHasModuleSideEffects=e=>{if(typeof e==="boolean"){return()=>e}if(e==="no-external"){return(e,t)=>!t}if(typeof e==="function"){return(t,i)=>t.startsWith("\0")?true:e(t,i)!==false}if(Array.isArray(e)){const t=new Set(e);return e=>t.has(e)}if(e){error(errorInvalidOption("treeshake.moduleSideEffects",V,'please use one of false, "no-external", a function or an array'))}return()=>true};const rl=/[\u0000-\u001F"#$&*+,:;<=>?[\]^`{|}\u007F]/g;const ol=/^[a-z]:/i;function sanitizeFileName(e){const t=ol.exec(e);const i=t?t[0]:"";return i+e.slice(i.length).replace(rl,"_")}async function normalizeOutputOptions(e,t,i){const s=new Set(i);const n=e.compact||false;const r=getFormat(e);const o=getInlineDynamicImports(e,t);const l=getPreserveModules(e,o,t);const c=getFile(e,l,t);const u=getPreferConst(e,t);const h=getGeneratedCode(e,u);const d={amd:getAmd(e),assetFileNames:e.assetFileNames??"assets/[name]-[hash][extname]",banner:getAddon(e,"banner"),chunkFileNames:e.chunkFileNames??"[name]-[hash].js",compact:n,dir:getDir(e,c),dynamicImportFunction:getDynamicImportFunction(e,t,r),dynamicImportInCjs:e.dynamicImportInCjs??true,entryFileNames:getEntryFileNames(e,s),esModule:e.esModule??"if-default-prop",experimentalDeepDynamicChunkOptimization:getExperimentalDeepDynamicChunkOptimization(e,t),experimentalMinChunkSize:e.experimentalMinChunkSize??1,exports:getExports(e,s),extend:e.extend||false,externalImportAssertions:e.externalImportAssertions??true,externalLiveBindings:e.externalLiveBindings??true,file:c,footer:getAddon(e,"footer"),format:r,freeze:e.freeze??true,generatedCode:h,globals:e.globals||{},hoistTransitiveImports:e.hoistTransitiveImports??true,indent:getIndent(e,n),inlineDynamicImports:o,interop:getInterop(e),intro:getAddon(e,"intro"),manualChunks:getManualChunks(e,o,l,t),minifyInternalExports:getMinifyInternalExports(e,r,n),name:e.name,namespaceToStringTag:getNamespaceToStringTag(e,h,t),noConflict:e.noConflict||false,outro:getAddon(e,"outro"),paths:e.paths||{},plugins:await normalizePluginOption(e.plugins),preferConst:u,preserveModules:l,preserveModulesRoot:getPreserveModulesRoot(e),sanitizeFileName:typeof e.sanitizeFileName==="function"?e.sanitizeFileName:e.sanitizeFileName===false?e=>e:sanitizeFileName,sourcemap:e.sourcemap||false,sourcemapBaseUrl:getSourcemapBaseUrl(e),sourcemapExcludeSources:e.sourcemapExcludeSources||false,sourcemapFile:e.sourcemapFile,sourcemapIgnoreList:typeof e.sourcemapIgnoreList==="function"?e.sourcemapIgnoreList:e.sourcemapIgnoreList===false?()=>false:e=>e.includes("node_modules"),sourcemapPathTransform:e.sourcemapPathTransform,strict:e.strict??true,systemNullSetters:e.systemNullSetters??true,validate:e.validate||false};warnUnknownOptions(e,Object.keys(d),"output options",t.onwarn);return{options:d,unsetOptions:s}}const getFile=(e,t,i)=>{const{file:s}=e;if(typeof s==="string"){if(t){return error(errorInvalidOption("output.file",v,'you must set "output.dir" instead of "output.file" when using the "output.preserveModules" option'))}if(!Array.isArray(i.input))return error(errorInvalidOption("output.file",v,'you must set "output.dir" instead of "output.file" when providing named inputs'))}return s};const getFormat=e=>{const t=e.format;switch(t){case undefined:case"es":case"esm":case"module":{return"es"}case"cjs":case"commonjs":{return"cjs"}case"system":case"systemjs":{return"system"}case"amd":case"iife":case"umd":{return t}default:{return error(errorInvalidOption("output.format",I,`Valid values are "amd", "cjs", "system", "es", "iife" or "umd"`,t))}}};const getInlineDynamicImports=(e,t)=>{const i=(e.inlineDynamicImports??t.inlineDynamicImports)||false;const{input:s}=t;if(i&&(Array.isArray(s)?s:Object.keys(s)).length>1){return error(errorInvalidOption("output.inlineDynamicImports",R,'multiple inputs are not supported when "output.inlineDynamicImports" is true'))}return i};const getPreserveModules=(e,t,i)=>{const s=(e.preserveModules??i.preserveModules)||false;if(s){if(t){return error(errorInvalidOption("output.inlineDynamicImports",R,`this option is not supported for "output.preserveModules"`))}if(i.preserveEntrySignatures===false){return error(errorInvalidOption("preserveEntrySignatures",B,'setting this option to false is not supported for "output.preserveModules"'))}}return s};const getPreferConst=(e,t)=>{const i=e.preferConst;if(i!=null){warnDeprecation(`The "output.preferConst" option is deprecated. Use the "output.generatedCode.constBindings" option instead.`,_,true,t)}return!!i};const getPreserveModulesRoot=e=>{const{preserveModulesRoot:t}=e;if(t===null||t===undefined){return undefined}return r.resolve(t)};const getAmd=e=>{const t={autoId:false,basePath:"",define:"define",forceJsExtensionForImports:false,...e.amd};if((t.autoId||t.basePath)&&t.id){return error(errorInvalidOption("output.amd.id",x,'this option cannot be used together with "output.amd.autoId"/"output.amd.basePath"'))}if(t.basePath&&!t.autoId){return error(errorInvalidOption("output.amd.basePath",b,'this option only works with "output.amd.autoId"'))}return t.autoId?{autoId:true,basePath:t.basePath,define:t.define,forceJsExtensionForImports:t.forceJsExtensionForImports}:{autoId:false,define:t.define,forceJsExtensionForImports:t.forceJsExtensionForImports,id:t.id}};const getAddon=(e,t)=>{const i=e[t];if(typeof i==="function"){return i}return()=>i||""};const getDir=(e,t)=>{const{dir:i}=e;if(typeof i==="string"&&typeof t==="string"){return error(errorInvalidOption("output.dir",v,'you must set either "output.file" for a single-file build or "output.dir" when generating multiple chunks'))}return i};const getDynamicImportFunction=(e,t,i)=>{const s=e.dynamicImportFunction;if(s){warnDeprecation(`The "output.dynamicImportFunction" option is deprecated. Use the "renderDynamicImport" plugin hook instead.`,H,true,t);if(i!=="es"){t.onwarn(errorInvalidOption("output.dynamicImportFunction",S,'this option is ignored for formats other than "es"'))}}return s};const getEntryFileNames=(e,t)=>{const i=e.entryFileNames;if(i==null){t.add("entryFileNames")}return i??"[name].js"};function getExperimentalDeepDynamicChunkOptimization(e,t){const i=e.experimentalDeepDynamicChunkOptimization;if(i!=null){warnDeprecation(`The "output.experimentalDeepDynamicChunkOptimization" option is deprecated as Rollup always runs the full chunking algorithm now. The option should be removed.`,C,true,t)}return i||false}function getExports(e,t){const i=e.exports;if(i==null){t.add("exports")}else if(!["default","named","none","auto"].includes(i)){return error(errorInvalidExportOptionValue(i))}return i||"auto"}const getGeneratedCode=(e,t)=>{const i=getOptionWithPreset(e.generatedCode,yt,"output.generatedCode",k,"");return{arrowFunctions:i.arrowFunctions===true,constBindings:i.constBindings===true||t,objectShorthand:i.objectShorthand===true,reservedNamesAsProps:i.reservedNamesAsProps!==false,symbols:i.symbols===true}};const getIndent=(e,t)=>{if(t){return""}const i=e.indent;return i===false?"":i??true};const al=new Set(["compat","auto","esModule","default","defaultOnly"]);const getInterop=e=>{const t=e.interop;if(typeof t==="function"){const e=Object.create(null);let i=null;return s=>s===null?i||validateInterop(i=t(s)):s in e?e[s]:validateInterop(e[s]=t(s))}return t===undefined?()=>"default":()=>validateInterop(t)};const validateInterop=e=>{if(!al.has(e)){return error(errorInvalidOption("output.interop",$,`use one of ${Array.from(al,(e=>JSON.stringify(e))).join(", ")}`,e))}return e};const getManualChunks=(e,t,i,s)=>{const n=e.manualChunks||s.manualChunks;if(n){if(t){return error(errorInvalidOption("output.manualChunks",O,'this option is not supported for "output.inlineDynamicImports"'))}if(i){return error(errorInvalidOption("output.manualChunks",O,'this option is not supported for "output.preserveModules"'))}}return n||{}};const getMinifyInternalExports=(e,t,i)=>e.minifyInternalExports??(i||t==="es"||t==="system");const getNamespaceToStringTag=(e,t,i)=>{const s=e.namespaceToStringTag;if(s!=null){warnDeprecation(`The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.`,P,true,i);return s}return t.symbols||false};const getSourcemapBaseUrl=e=>{const{sourcemapBaseUrl:t}=e;if(t){if(isValidUrl(t)){return t}return error(errorInvalidOption("output.sourcemapBaseUrl",M,`must be a valid URL, received ${JSON.stringify(t)}`))}};function rollup(e){return rollupInternal(e,null)}async function rollupInternal(e,t){const{options:i,unsetOptions:s}=await getInputOptions(e,t!==null);initialiseTimers(i);const n=new Graph(i,t);const r=e.cache!==false;if(e.cache){i.cache=undefined;e.cache=undefined}Lr("BUILD",1);await catchUnfinishedHookActions(n.pluginDriver,(async()=>{try{Lr("initialize",2);await n.pluginDriver.hookParallel("buildStart",[i]);Br("initialize",2);await n.build()}catch(e){const t=Object.keys(n.watchFiles);if(t.length>0){e.watchFiles=t}await n.pluginDriver.hookParallel("buildEnd",[e]);await n.pluginDriver.hookParallel("closeBundle",[]);throw e}await n.pluginDriver.hookParallel("buildEnd",[])}));Br("BUILD",1);const o={cache:r?n.getCache():undefined,async close(){if(o.closed)return;o.closed=true;await n.pluginDriver.hookParallel("closeBundle",[])},closed:false,async generate(e){if(o.closed)return error(errorAlreadyClosed());return handleGenerateWrite(false,i,s,e,n)},watchFiles:Object.keys(n.watchFiles),async write(e){if(o.closed)return error(errorAlreadyClosed());return handleGenerateWrite(true,i,s,e,n)}};if(i.perf)o.getTimings=getTimings;return o}async function getInputOptions(e,t){if(!e){throw new Error("You must supply an options object to rollup")}const i=getSortedValidatedPlugins("options",await normalizePluginOption(e.plugins));const{options:s,unsetOptions:n}=await normalizeInputOptions(await i.reduce(applyOptionHook(t),Promise.resolve(e)));normalizePlugins(s.plugins,Ga);return{options:s,unsetOptions:n}}function applyOptionHook(e){return async(t,i)=>{const s="handler"in i.options?i.options.handler:i.options;return await s.call({meta:{rollupVersion:d,watchMode:e}},await t)||t}}function normalizePlugins(e,t){for(const[i,s]of e.entries()){if(!s.name){s.name=`${t}${i+1}`}}}async function handleGenerateWrite(e,t,i,s,n){const{options:r,outputPluginDriver:o,unsetOptions:l}=await getOutputOptionsAndPluginDriver(s,n.pluginDriver,t,i);return catchUnfinishedHookActions(o,(async()=>{const i=new Bundle(r,l,t,o,n);const s=await i.generate(e);if(e){Lr("WRITE",1);if(!r.dir&&!r.file){return error(errorMissingFileOrDirOption())}await Promise.all(Object.values(s).map((e=>n.fileOperationQueue.run((()=>writeOutputFile(e,r))))));await o.hookParallel("writeBundle",[r,s]);Br("WRITE",1)}return createOutput(s)}))}async function getOutputOptionsAndPluginDriver(e,t,i,s){if(!e){throw new Error("You must supply an options object")}const n=await normalizePluginOption(e.plugins);normalizePlugins(n,Wa);const r=t.createOutputPluginDriver(n);return{...await getOutputOptions(i,s,e,r),outputPluginDriver:r}}function getOutputOptions(e,t,i,s){return normalizeOutputOptions(s.hookReduceArg0Sync("outputOptions",[i],((e,t)=>t||e),(e=>{const emitError=()=>e.error(errorCannotEmitFromOptionsHook());return{...e,emitFile:emitError,setAssetSource:emitError}})),e,t)}function createOutput(e){return{output:Object.values(e).filter((e=>Object.keys(e).length>0)).sort(((e,t)=>getSortingFileType(e)-getSortingFileType(t)))}}var ll;(function(e){e[e["ENTRY_CHUNK"]=0]="ENTRY_CHUNK";e[e["SECONDARY_CHUNK"]=1]="SECONDARY_CHUNK";e[e["ASSET"]=2]="ASSET"})(ll||(ll={}));function getSortingFileType(e){if(e.type==="asset"){return ll.ASSET}if(e.isEntry){return ll.ENTRY_CHUNK}return ll.SECONDARY_CHUNK}async function writeOutputFile(e,t){const i=r.resolve(t.dir||r.dirname(t.file),e.fileName);await u.mkdir(r.dirname(i),{recursive:true});return u.writeFile(i,e.type==="asset"?e.source:e.code)}function defineConfig(e){return e}t.URL_AVOIDING_EVAL=p;t.URL_NAME_IS_NOT_EXPORTED=f;t.URL_OUTPUT_EXPORTS=A;t.URL_OUTPUT_GLOBALS=N;t.URL_SOURCEMAP_IS_LIKELY_TO_BE_INCORRECT=y;t.URL_THIS_IS_UNDEFINED=m;t.URL_TREATING_MODULE_AS_EXTERNAL_DEPENDENCY=g;t.URL_WATCH=z;t.bold=Rt;t.commandAliases=Et;t.createFilter=Ns;t.cyan=$t;t.defineConfig=defineConfig;t.ensureArray=ensureArray$1;t.error=error;t.errorCannotBundleConfigAsEsm=errorCannotBundleConfigAsEsm;t.errorCannotLoadConfigAsCjs=errorCannotLoadConfigAsCjs;t.errorCannotLoadConfigAsEsm=errorCannotLoadConfigAsEsm;t.errorDuplicateImportOptions=errorDuplicateImportOptions;t.errorFailAfterWarnings=errorFailAfterWarnings;t.errorInvalidOption=errorInvalidOption;t.errorMissingConfig=errorMissingConfig;t.errorMissingExternalConfig=errorMissingExternalConfig;t.errorOnlyInlineSourcemapsForStdout=errorOnlyInlineSourcemapsForStdout;t.getAliasName=getAliasName;t.getAugmentedNamespace=getAugmentedNamespace;t.getNewArray=getNewArray;t.getOrCreate=getOrCreate;t.getRollupUrl=getRollupUrl;t.gray=Tt;t.green=Dt;t.handleError=handleError;t.isWatchEnabled=isWatchEnabled;t.mergeOptions=mergeOptions;t.normalizePluginOption=normalizePluginOption;t.picomatch=Is;t.printQuotedStringList=printQuotedStringList;t.relativeId=relativeId;t.rollup=rollup;t.rollupInternal=rollupInternal;t.stderr=stderr;t.underline=Lt;t.version=d;t.yellow=Bt},12:(e,t,i)=>{
|
|
77
|
+
const s=i(742);const n=i(224);const r=i(411);const o=i(17);const l=i(846);const c=i(5);const u=i(977);function _interopNamespaceDefault(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e){t[i]=e[i]}}t.default=e;return t}const h=_interopNamespaceDefault(n);var d="3.29.4";function ensureArray$1(e){if(Array.isArray(e)){return e.filter(Boolean)}if(e){return[e]}return[]}var p;(function(e){e[e["LOAD_AND_PARSE"]=0]="LOAD_AND_PARSE";e[e["ANALYSE"]=1]="ANALYSE";e[e["GENERATE"]=2]="GENERATE"})(p||(p={}));const createHash=()=>c.createHash("sha256");function getOrCreate(e,t,i){const s=e.get(t);if(s!==undefined){return s}const n=i();e.set(t,n);return n}function getNewSet(){return new Set}function getNewArray(){return[]}const f="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$";const m=64;function toBase64(e){let t="";do{const i=e%m;e=e/m|0;t=f[i]+t}while(e!==0);return t}function rangeContains(e,t){return e.start<=t&&t<e.end}function getLocator$1(e,t={}){const{offsetLine:i=0,offsetColumn:s=0}=t;let n=0;const r=e.split("\n").map(((e,t)=>{const i=n+e.length+1;const s={start:n,end:i,line:t};n=i;return s}));let o=0;function locator(t,n){if(typeof t==="string"){t=e.indexOf(t,n??0)}if(t===-1)return undefined;let l=r[o];const c=t>=l.end?1:-1;while(l){if(rangeContains(l,t)){return{line:i+l.line,column:s+t-l.start,character:t}}o+=c;l=r[o]}}return locator}function locate(e,t,i){return getLocator$1(e,i)(t,i&&i.startIndex)}function spaces(e){let t="";while(e--)t+=" ";return t}function tabsToSpaces(e){return e.replace(/^\t+/,(e=>e.split("\t").join(" ")))}const g=120;const y=10;const E="...";function getCodeFrame(e,t,i){let s=e.split("\n");if(t>s.length)return"";const n=Math.max(tabsToSpaces(s[t-1].slice(0,i)).length+y+E.length,g);const r=Math.max(0,t-3);let o=Math.min(t+2,s.length);s=s.slice(r,o);while(!/\S/.test(s[s.length-1])){s.pop();o-=1}const l=String(o).length;return s.map(((e,s)=>{const o=r+s+1===t;let c=String(s+r+1);while(c.length<l)c=` ${c}`;let u=tabsToSpaces(e);if(u.length>n){u=`${u.slice(0,n-E.length)}${E}`}if(o){const t=spaces(l+2+tabsToSpaces(e.slice(0,i)).length)+"^";return`${c}: ${u}\n${t}`}return`${c}: ${u}`})).join("\n")}const x="silent";const b="error";const v="warn";const S="info";const A="debug";const w={[A]:0,[S]:1,[x]:3,[v]:2};const I=/^(?:\/|(?:[A-Za-z]:)?[/\\|])/;const C=/^\.?\.(\/|$)/;function isAbsolute(e){return I.test(e)}function isRelative(e){return C.test(e)}const k=/\\/g;function normalize(e){return e.replace(k,"/")}function printQuotedStringList(e,t){const i=e.length<=1;const s=e.map((e=>`"${e}"`));let n=i?s[0]:`${s.slice(0,-1).join(", ")} and ${s.slice(-1)[0]}`;if(t){n+=` ${i?t[0]:t[1]}`}return n}const _=/[/\\]/;function relative(e,t){const i=e.split(_).filter(Boolean);const s=t.split(_).filter(Boolean);if(i[0]===".")i.shift();if(s[0]===".")s.shift();while(i[0]&&s[0]&&i[0]===s[0]){i.shift();s.shift()}while(s[0]===".."&&i.length>0){s.shift();i.pop()}while(i.pop()){s.unshift("..")}return s.join("/")}function getAliasName(e){const t=r.basename(e);return t.slice(0,Math.max(0,t.length-r.extname(e).length))}function relativeId(e){if(!isAbsolute(e))return e;return relative(r.resolve(),e)}function isPathFragment(e){return e[0]==="/"||e[0]==="."&&(e[1]==="/"||e[1]===".")||isAbsolute(e)}const P=/^(\.\.\/)*\.\.$/;function getImportPath(e,t,i,s){while(t.startsWith("../")){t=t.slice(3);e="_/"+e}let n=normalize(relative(r.dirname(e),t));if(i&&n.endsWith(".js")){n=n.slice(0,-3)}if(s){if(n==="")return"../"+r.basename(t);if(P.test(n)){return[...n.split("/"),"..",r.basename(t)].join("/")}}return n?n.startsWith("..")?n:"./"+n:"."}function isValidUrl(e){try{new URL(e)}catch{return false}return true}function getRollupUrl(e){return`https://rollupjs.org/${e}`}function addTrailingSlashIfMissed(e){if(!e.endsWith("/")){return e+"/"}return e}const N="troubleshooting/#avoiding-eval";const R="troubleshooting/#error-name-is-not-exported-by-module";const $="troubleshooting/#error-this-is-undefined";const O="troubleshooting/#warning-treating-module-as-external-dependency";const T="troubleshooting/#warning-sourcemap-is-likely-to-be-incorrect";const D="configuration-options/#maxparallelfileops";const M="configuration-options/#output-amd-id";const L="configuration-options/#output-amd-basepath";const B="configuration-options/#output-dir";const F="configuration-options/#output-dynamicimportfunction";const V="configuration-options/#output-exports";const z="configuration-options/#output-extend";const j="configuration-options/#output-format";const U="configuration-options/#output-generatedcode";const H="configuration-options/#output-experimentaldeepdynamicchunkoptimization";const G="configuration-options/#output-generatedcode-constbindings";const W="configuration-options/#output-generatedcode-symbols";const q="configuration-options/#output-globals";const K="configuration-options/#output-inlinedynamicimports";const Y="configuration-options/#output-interop";const Q="configuration-options/#output-manualchunks";const X="configuration-options/#output-name";const Z="configuration-options/#output-preservemodules";const J="configuration-options/#output-sourcemapbaseurl";const ee="configuration-options/#output-sourcemapfile";const te="configuration-options/#preserveentrysignatures";const ie="configuration-options/#treeshake";const se="configuration-options/#treeshake-modulesideeffects";const ne="configuration-options/#watch";const re="command-line-interface/#bundleconfigascjs";const oe="command-line-interface/#configuration-files";const ae="plugin-development/#renderdynamicimport";const le="plugin-development/#this-getmoduleids";const ce="plugin-development/#this-getmoduleinfo";function error(e){if(!(e instanceof Error)){e=Object.assign(new Error(e.message),e);Object.defineProperty(e,"name",{value:"RollupError"})}throw e}function augmentCodeLocation(e,t,i,s){if(typeof t==="object"){const{line:i,column:n}=t;e.loc={column:n,file:s,line:i}}else{e.pos=t;const{line:n,column:r}=locate(i,t,{offsetLine:1});e.loc={column:r,file:s,line:n}}if(e.frame===undefined){const{line:t,column:s}=e.loc;e.frame=getCodeFrame(i,t,s)}}const ue="ADDON_ERROR",he="ALREADY_CLOSED",de="AMBIGUOUS_EXTERNAL_NAMESPACES",pe="ANONYMOUS_PLUGIN_CACHE",fe="ASSET_NOT_FINALISED",me="ASSET_NOT_FOUND",ge="ASSET_SOURCE_ALREADY_SET",ye="ASSET_SOURCE_MISSING",Ee="BAD_LOADER",xe="CANNOT_CALL_NAMESPACE",be="CANNOT_EMIT_FROM_OPTIONS_HOOK",ve="CHUNK_NOT_GENERATED",Se="CHUNK_INVALID",Ae="CIRCULAR_DEPENDENCY",we="CIRCULAR_REEXPORT",Ie="CYCLIC_CROSS_CHUNK_REEXPORT",Ce="DEPRECATED_FEATURE",ke="DUPLICATE_IMPORT_OPTIONS",_e="DUPLICATE_PLUGIN_NAME",Pe="EMPTY_BUNDLE",Ne="EVAL",Re="EXTERNAL_MODULES_CANNOT_BE_INCLUDED_IN_MANUAL_CHUNKS",$e="EXTERNAL_MODULES_CANNOT_BE_TRANSFORMED_TO_MODULES",Oe="EXTERNAL_SYNTHETIC_EXPORTS",Te="FAIL_AFTER_WARNINGS",De="FILE_NAME_CONFLICT",Me="FILE_NOT_FOUND",Le="FIRST_SIDE_EFFECT",Be="ILLEGAL_IDENTIFIER_AS_NAME",Fe="ILLEGAL_REASSIGNMENT",Ve="INCONSISTENT_IMPORT_ASSERTIONS",ze="INPUT_HOOK_IN_OUTPUT_PLUGIN",je="INVALID_CHUNK",Ue="INVALID_CONFIG_MODULE_FORMAT",He="INVALID_EXPORT_OPTION",Ge="INVALID_EXTERNAL_ID",We="INVALID_LOG_POSITION",qe="INVALID_OPTION",Ke="INVALID_PLUGIN_HOOK",Ye="INVALID_ROLLUP_PHASE",Qe="INVALID_SETASSETSOURCE",Xe="INVALID_TLA_FORMAT",Ze="MISSING_CONFIG",Je="MISSING_EXPORT",et="MISSING_EXTERNAL_CONFIG",tt="MISSING_GLOBAL_NAME",it="MISSING_IMPLICIT_DEPENDANT",st="MISSING_NAME_OPTION_FOR_IIFE_EXPORT",nt="MISSING_NODE_BUILTINS",rt="MISSING_OPTION",ot="MIXED_EXPORTS",lt="MODULE_LEVEL_DIRECTIVE",ct="NAMESPACE_CONFLICT",ut="NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE",ht="ONLY_INLINE_SOURCEMAPS",dt="OPTIMIZE_CHUNK_STATUS",pt="PARSE_ERROR",ft="PLUGIN_ERROR",mt="SHIMMED_EXPORT",gt="SOURCEMAP_BROKEN",yt="SOURCEMAP_ERROR",Et="SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT",xt="THIS_IS_UNDEFINED",bt="UNEXPECTED_NAMED_IMPORT",vt="UNKNOWN_OPTION",St="UNRESOLVED_ENTRY",At="UNRESOLVED_IMPORT",wt="UNUSED_EXTERNAL_IMPORT",It="VALIDATION_ERROR";function logAddonNotGenerated(e,t,i){return{code:ue,message:`Could not retrieve "${t}". Check configuration of plugin "${i}".\n\tError Message: ${e}`}}function logAlreadyClosed(){return{code:he,message:'Bundle is already closed, no more calls to "generate" or "write" are allowed.'}}function logAmbiguousExternalNamespaces(e,t,i,s){return{binding:e,code:de,ids:s,message:`Ambiguous external namespace resolution: "${relativeId(t)}" re-exports "${e}" from one of the external modules ${printQuotedStringList(s.map((e=>relativeId(e))))}, guessing "${relativeId(i)}".`,reexporter:t}}function logAnonymousPluginCache(){return{code:pe,message:"A plugin is trying to use the Rollup cache but is not declaring a plugin name or cacheKey."}}function logAssetNotFinalisedForFileName(e){return{code:fe,message:`Plugin error - Unable to get file name for asset "${e}". Ensure that the source is set and that generate is called first. If you reference assets via import.meta.ROLLUP_FILE_URL_<referenceId>, you need to either have set their source after "renderStart" or need to provide an explicit "fileName" when emitting them.`}}function logAssetReferenceIdNotFoundForSetSource(e){return{code:me,message:`Plugin error - Unable to set the source for unknown asset "${e}".`}}function logAssetSourceAlreadySet(e){return{code:ge,message:`Unable to set the source for asset "${e}", source already set.`}}function logNoAssetSourceSet(e){return{code:ye,message:`Plugin error creating asset "${e}" - no asset source set.`}}function logBadLoader(e){return{code:Ee,message:`Error loading "${relativeId(e)}": plugin load hook should return a string, a { code, map } object, or nothing/null.`}}function logCannotCallNamespace(e){return{code:xe,message:`Cannot call a namespace ("${e}").`}}function logCannotEmitFromOptionsHook(){return{code:be,message:`Cannot emit files or set asset sources in the "outputOptions" hook, use the "renderStart" hook instead.`}}function logChunkNotGeneratedForFileName(e){return{code:ve,message:`Plugin error - Unable to get file name for emitted chunk "${e}". You can only get file names once chunks have been generated after the "renderStart" hook.`}}function logChunkInvalid({fileName:e,code:t},i){const s={code:Se,message:`Chunk "${e}" is not valid JavaScript: ${i.message}.`};augmentCodeLocation(s,i.loc,t,e);return s}function logCircularDependency(e){return{code:Ae,ids:e,message:`Circular dependency: ${e.map(relativeId).join(" -> ")}`}}function logCircularReexport(e,t){return{code:we,exporter:t,message:`"${e}" cannot be exported from "${relativeId(t)}" as it is a reexport that references itself.`}}function logCyclicCrossChunkReexport(e,t,i,s,n){return{code:Ie,exporter:t,id:s,message:`Export "${e}" of module "${relativeId(t)}" was reexported through module "${relativeId(i)}" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.\nEither change the import in "${relativeId(s)}" to point directly to the exporting module or ${n?'do not use "output.preserveModules"':'reconfigure "output.manualChunks"'} to ensure these modules end up in the same chunk.`,reexporter:i}}function logDeprecation(e,t,i){return{code:Ce,message:e,url:getRollupUrl(t),...i?{plugin:i}:{}}}function logDuplicateImportOptions(){return{code:ke,message:"Either use --input, or pass input path as argument"}}function logDuplicatePluginName(e){return{code:_e,message:`The plugin name ${e} is being used twice in the same build. Plugin names must be distinct or provide a cacheKey (please post an issue to the plugin if you are a plugin user).`}}function logEmptyChunk(e){return{code:Pe,message:`Generated an empty chunk: "${e}".`,names:[e]}}function logEval(e){return{code:Ne,id:e,message:`Use of eval in "${relativeId(e)}" is strongly discouraged as it poses security risks and may cause issues with minification.`,url:getRollupUrl(N)}}function logExternalSyntheticExports(e,t){return{code:Oe,exporter:e,message:`External "${e}" cannot have "syntheticNamedExports" enabled (imported by "${relativeId(t)}").`}}function logFailAfterWarnings(){return{code:Te,message:"Warnings occurred and --failAfterWarnings flag present."}}function logFileNameConflict(e){return{code:De,message:`The emitted file "${e}" overwrites a previously emitted file of the same name.`}}function logFileReferenceIdNotFoundForFilename(e){return{code:Me,message:`Plugin error - Unable to get file name for unknown file "${e}".`}}function logFirstSideEffect(e,t,{line:i,column:s}){return{code:Le,message:`First side effect in ${relativeId(t)} is at (${i}:${s})\n${getCodeFrame(e,i,s)}`}}function logIllegalIdentifierAsName(e){return{code:Be,message:`Given name "${e}" is not a legal JS identifier. If you need this, you can try "output.extend: true".`,url:getRollupUrl(z)}}function logIllegalImportReassignment(e,t){return{code:Fe,message:`Illegal reassignment of import "${e}" in "${relativeId(t)}".`}}function logInconsistentImportAssertions(e,t,i,s){return{code:Ve,message:`Module "${relativeId(s)}" tried to import "${relativeId(i)}" with ${formatAssertions$1(t)} assertions, but it was already imported elsewhere with ${formatAssertions$1(e)} assertions. Please ensure that import assertions for the same module are always consistent.`}}const formatAssertions$1=e=>{const t=Object.entries(e);if(t.length===0)return"no";return t.map((([e,t])=>`"${e}": "${t}"`)).join(", ")};function logInputHookInOutputPlugin(e,t){return{code:ze,message:`The "${t}" hook used by the output plugin ${e} is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.`}}function logCannotAssignModuleToChunk(e,t,i){return{code:je,message:`Cannot assign "${relativeId(e)}" to the "${t}" chunk as it is already in the "${i}" chunk.`}}function logCannotBundleConfigAsEsm(e){return{cause:e,code:Ue,message:`Rollup transpiled your configuration to an ES module even though it appears to contain CommonJS elements. To resolve this, you can pass the "--bundleConfigAsCjs" flag to Rollup or change your configuration to only contain valid ESM code.\n\nOriginal error: ${e.message}`,stack:e.stack,url:getRollupUrl(re)}}function logCannotLoadConfigAsCjs(e){return{cause:e,code:Ue,message:`Node tried to load your configuration file as CommonJS even though it is likely an ES module. To resolve this, change the extension of your configuration to ".mjs", set "type": "module" in your package.json file or pass the "--bundleConfigAsCjs" flag.\n\nOriginal error: ${e.message}`,stack:e.stack,url:getRollupUrl(re)}}function logCannotLoadConfigAsEsm(e){return{cause:e,code:Ue,message:`Node tried to load your configuration as an ES module even though it is likely CommonJS. To resolve this, change the extension of your configuration to ".cjs" or pass the "--bundleConfigAsCjs" flag.\n\nOriginal error: ${e.message}`,stack:e.stack,url:getRollupUrl(re)}}function logInvalidExportOptionValue(e){return{code:He,message:`"output.exports" must be "default", "named", "none", "auto", or left unspecified (defaults to "auto"), received "${e}".`,url:getRollupUrl(V)}}function logIncompatibleExportOptionValue(e,t,i){return{code:He,message:`"${e}" was specified for "output.exports", but entry module "${relativeId(i)}" has the following exports: ${printQuotedStringList(t)}`,url:getRollupUrl(V)}}function logInternalIdCannotBeExternal(e,t){return{code:Ge,message:`"${e}" is imported as an external by "${relativeId(t)}", but is already an existing non-external module id.`}}function logInvalidLogPosition(e){return{code:We,message:`Plugin "${e}" tried to add a file position to a log or warning. This is only supported in the "transform" hook at the moment and will be ignored.`}}function logInvalidOption(e,t,i,s){return{code:qe,message:`Invalid value ${s===undefined?"":`${JSON.stringify(s)} `}for option "${e}" - ${i}.`,url:getRollupUrl(t)}}function logInvalidAddonPluginHook(e,t){return{code:Ke,hook:e,message:`Error running plugin hook "${e}" for plugin "${t}", expected a string, a function hook or an object with a "handler" string or function.`,plugin:t}}function logInvalidFunctionPluginHook(e,t){return{code:Ke,hook:e,message:`Error running plugin hook "${e}" for plugin "${t}", expected a function hook or an object with a "handler" function.`,plugin:t}}function logInvalidRollupPhaseForAddWatchFile(){return{code:Ye,message:`Cannot call "addWatchFile" after the build has finished.`}}function logInvalidRollupPhaseForChunkEmission(){return{code:Ye,message:`Cannot emit chunks after module loading has finished.`}}function logInvalidSetAssetSourceCall(){return{code:Qe,message:`setAssetSource cannot be called in transform for caching reasons. Use emitFile with a source, or call setAssetSource in another hook.`}}function logInvalidFormatForTopLevelAwait(e,t){return{code:Xe,id:e,message:`Module format "${t}" does not support top-level await. Use the "es" or "system" output formats rather.`}}function logMissingConfig(){return{code:Ze,message:"Config file must export an options object, or an array of options objects",url:getRollupUrl(oe)}}function logMissingExport(e,t,i){const s=r.extname(i)===".json";return{binding:e,code:Je,exporter:i,id:t,message:`"${e}" is not exported by "${relativeId(i)}", imported by "${relativeId(t)}".${s?" (Note that you need @rollup/plugin-json to import JSON files)":""}`,url:getRollupUrl(R)}}function logMissingExternalConfig(e){return{code:et,message:`Could not resolve config file "${e}"`}}function logMissingGlobalName(e,t){return{code:tt,id:e,message:`No name was provided for external module "${e}" in "output.globals" – guessing "${t}".`,names:[t],url:getRollupUrl(q)}}function logImplicitDependantCannotBeExternal(e,t){return{code:it,message:`Module "${relativeId(e)}" that should be implicitly loaded before "${relativeId(t)}" cannot be external.`}}function logUnresolvedImplicitDependant(e,t){return{code:it,message:`Module "${relativeId(e)}" that should be implicitly loaded before "${relativeId(t)}" could not be resolved.`}}function logImplicitDependantIsNotIncluded(e){const t=[...e.implicitlyLoadedBefore].map((e=>relativeId(e.id))).sort();return{code:it,message:`Module "${relativeId(e.id)}" that should be implicitly loaded before ${printQuotedStringList(t)} is not included in the module graph. Either it was not imported by an included module or only via a tree-shaken dynamic import, or no imported bindings were used and it had otherwise no side-effects.`}}function logMissingNameOptionForIifeExport(){return{code:st,message:`If you do not supply "output.name", you may not be able to access the exports of an IIFE bundle.`,url:getRollupUrl(X)}}function logMissingNameOptionForUmdExport(){return{code:st,message:'You must supply "output.name" for UMD bundles that have exports so that the exports are accessible in environments without a module loader.',url:getRollupUrl(X)}}function logMissingNodeBuiltins(e){return{code:nt,ids:e,message:`Creating a browser bundle that depends on Node.js built-in modules (${printQuotedStringList(e)}). You might need to include https://github.com/FredKSchott/rollup-plugin-polyfill-node`}}function logMissingFileOrDirOption(){return{code:rt,message:'You must specify "output.file" or "output.dir" for the build.',url:getRollupUrl(B)}}function logMixedExport(e,t){return{code:ot,id:e,message:`Entry module "${relativeId(e)}" is using named and default exports together. Consumers of your bundle will have to use \`${t||"chunk"}.default\` to access the default export, which may not be what you want. Use \`output.exports: "named"\` to disable this warning.`,url:getRollupUrl(V)}}function logModuleLevelDirective(e,t){return{code:lt,id:t,message:`Module level directives cause errors when bundled, "${e}" in "${relativeId(t)}" was ignored.`}}function logNamespaceConflict(e,t,i){return{binding:e,code:ct,ids:i,message:`Conflicting namespaces: "${relativeId(t)}" re-exports "${e}" from one of the modules ${printQuotedStringList(i.map((e=>relativeId(e))))} (will be ignored).`,reexporter:t}}function logNoTransformMapOrAstWithoutCode(e){return{code:ut,message:`The plugin "${e}" returned a "map" or "ast" without returning `+'a "code". This will be ignored.'}}function logOnlyInlineSourcemapsForStdout(){return{code:ht,message:"Only inline sourcemaps are supported when bundling to stdout."}}function logOptimizeChunkStatus(e,t,i){return{code:dt,message:`${i}, there are\n`+`${e} chunks, of which\n`+`${t} are below minChunkSize.`}}function logParseError(e,t){let i=e.message.replace(/ \(\d+:\d+\)$/,"");if(t.endsWith(".json")){i+=" (Note that you need @rollup/plugin-json to import JSON files)"}else if(!t.endsWith(".js")){i+=" (Note that you need plugins to import files that are not JavaScript)"}return{cause:e,code:pt,id:t,message:i}}function logPluginError(e,t,{hook:i,id:s}={}){const n=e.code;if(!e.pluginCode&&n!=null&&(typeof n!=="string"||typeof n==="string"&&!n.startsWith("PLUGIN_"))){e.pluginCode=n}e.code=ft;e.plugin=t;if(i){e.hook=i}if(s){e.id=s}return e}function logShimmedExport(e,t){return{binding:t,code:mt,exporter:e,message:`Missing export "${t}" has been shimmed in module "${relativeId(e)}".`}}function logSourcemapBroken(e){return{code:gt,message:`Sourcemap is likely to be incorrect: a plugin (${e}) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help`,plugin:e,url:getRollupUrl(T)}}function logConflictingSourcemapSources(e){return{code:gt,message:`Multiple conflicting contents for sourcemap source ${e}`}}function logInvalidSourcemapForError(e,t,i,s,n){return{cause:e,code:yt,id:t,loc:{column:i,file:t,line:s},message:`Error when using sourcemap for reporting an error: ${e.message}`,pos:n}}function logSyntheticNamedExportsNeedNamespaceExport(e,t){return{code:Et,exporter:e,message:`Module "${relativeId(e)}" that is marked with \`syntheticNamedExports: ${JSON.stringify(t)}\` needs ${typeof t==="string"&&t!=="default"?`an explicit export named "${t}"`:"a default export"} that does not reexport an unresolved named export of the same module.`}}function logThisIsUndefined(){return{code:xt,message:`The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten`,url:getRollupUrl($)}}function logUnexpectedNamedImport(e,t,i){const s=i?"reexport":"import";return{code:bt,exporter:e,message:`The named export "${t}" was ${s}ed from the external module "${relativeId(e)}" even though its interop type is "defaultOnly". Either remove or change this ${s} or change the value of the "output.interop" option.`,url:getRollupUrl(Y)}}function logUnexpectedNamespaceReexport(e){return{code:bt,exporter:e,message:`There was a namespace "*" reexport from the external module "${relativeId(e)}" even though its interop type is "defaultOnly". This will be ignored as namespace reexports only reexport named exports. If this is not intended, either remove or change this reexport or change the value of the "output.interop" option.`,url:getRollupUrl(Y)}}function logUnknownOption(e,t,i){return{code:vt,message:`Unknown ${e}: ${t.join(", ")}. Allowed options: ${i.join(", ")}`}}function logEntryCannotBeExternal(e){return{code:St,message:`Entry module "${relativeId(e)}" cannot be external.`}}function logExternalModulesCannotBeIncludedInManualChunks(e){return{code:Re,message:`"${e}" cannot be included in manualChunks because it is resolved as an external module by the "external" option or plugins.`}}function logExternalModulesCannotBeTransformedToModules(e){return{code:$e,message:`${e} is resolved as a module now, but it was an external module before. Please check whether there are conflicts in your Rollup options "external" and "manualChunks", manualChunks cannot include external modules.`}}function logUnresolvedEntry(e){return{code:St,message:`Could not resolve entry module "${relativeId(e)}".`}}function logUnresolvedImport(e,t){return{code:At,exporter:e,id:t,message:`Could not resolve "${e}" from "${relativeId(t)}"`}}function logUnresolvedImportTreatedAsExternal(e,t){return{code:At,exporter:e,id:t,message:`"${e}" is imported by "${relativeId(t)}", but could not be resolved – treating it as an external dependency.`,url:getRollupUrl(O)}}function logUnusedExternalImports(e,t,i){return{code:wt,exporter:e,ids:i,message:`${printQuotedStringList(t,["is","are"])} imported from external module "${e}" but never used in ${printQuotedStringList(i.map((e=>relativeId(e))))}.`,names:t}}function logFailedValidation(e){return{code:It,message:e}}function warnDeprecation(e,t,i,s,n){warnDeprecationWithOptions(e,t,i,s.onLog,s.strictDeprecations,n)}function warnDeprecationWithOptions(e,t,i,s,n,r){if(i||n){const i=logDeprecation(e,t,r);if(n){return error(i)}s(v,i)}}const Ct="!~{";const kt="}~";const _t=Ct.length+kt.length;const Pt=64;const Nt=8;const getHashPlaceholderGenerator=()=>{let e=0;return(t,i=Nt)=>{if(i>Pt){return error(logFailedValidation(`Hashes cannot be longer than ${Pt} characters, received ${i}. Check the "${t}" option.`))}const s=`${Ct}${toBase64(++e).padStart(i-_t,"0")}${kt}`;if(s.length>i){return error(logFailedValidation(`To generate hashes for this number of chunks (currently ${e}), you need a minimum hash size of ${s.length}, received ${i}. Check the "${t}" option.`))}return s}};const Rt=new RegExp(`${Ct}[0-9a-zA-Z_$]{1,${Pt-_t}}${kt}`,"g");const replacePlaceholders=(e,t)=>e.replace(Rt,(e=>t.get(e)||e));const replaceSinglePlaceholder=(e,t,i)=>e.replace(Rt,(e=>e===t?i:e));const replacePlaceholdersWithDefaultAndGetContainedPlaceholders=(e,t)=>{const i=new Set;const s=e.replace(Rt,(e=>{if(t.has(e)){i.add(e);return`${Ct}${"0".repeat(e.length-_t)}${kt}`}return e}));return{containedPlaceholders:i,transformedCode:s}};const $t=Symbol("bundleKeys");const Ot={type:"placeholder"};const getOutputBundle=e=>{const t=new Set;return new Proxy(e,{deleteProperty(e,i){if(typeof i==="string"){t.delete(i.toLowerCase())}return Reflect.deleteProperty(e,i)},get(e,i){if(i===$t){return t}return Reflect.get(e,i)},set(e,i,s){if(typeof i==="string"){t.add(i.toLowerCase())}return Reflect.set(e,i,s)}})};const removeUnreferencedAssets=e=>{const t=new Set;const i=Object.values(e);for(const e of i){e.type==="asset"&&e.needsCodeReference&&t.add(e.fileName)}for(const e of i){if(e.type==="chunk"){for(const i of e.referencedFiles){t.has(i)&&t.delete(i)}}}for(const i of t){delete e[i]}};function renderNamePattern(e,t,i){if(isPathFragment(e))return error(logFailedValidation(`Invalid pattern "${e}" for "${t}", patterns can be neither absolute nor relative paths. If you want your files to be stored in a subdirectory, write its name without a leading slash like this: subdirectory/pattern.`));return e.replace(/\[(\w+)(:\d+)?]/g,((e,s,n)=>{if(!i.hasOwnProperty(s)||n&&s!=="hash"){return error(logFailedValidation(`"[${s}${n||""}]" is not a valid placeholder in the "${t}" pattern.`))}const r=i[s](n&&Number.parseInt(n.slice(1)));if(isPathFragment(r))return error(logFailedValidation(`Invalid substitution "${r}" for placeholder "[${s}]" in "${t}" pattern, can be neither absolute nor relative path.`));return r}))}function makeUnique(e,{[$t]:t}){if(!t.has(e.toLowerCase()))return e;const i=r.extname(e);e=e.slice(0,Math.max(0,e.length-i.length));let s,n=1;while(t.has((s=e+ ++n+i).toLowerCase()));return s}function getSourceHash(e){return createHash().update(e).digest("hex")}function generateAssetFileName(e,t,i,s,n){const o=s.sanitizeFileName(e||"asset");return makeUnique(renderNamePattern(typeof s.assetFileNames==="function"?s.assetFileNames({name:e,source:t,type:"asset"}):s.assetFileNames,"output.assetFileNames",{ext:()=>r.extname(o).slice(1),extname:()=>r.extname(o),hash:e=>i.slice(0,Math.max(0,e||Nt)),name:()=>o.slice(0,Math.max(0,o.length-r.extname(o).length))}),n)}function reserveFileNameInBundle(e,{bundle:t},i){if(t[$t].has(e.toLowerCase())){i(v,logFileNameConflict(e))}else{t[e]=Ot}}const Tt=new Set(["chunk","asset","prebuilt-chunk"]);function hasValidType(e){return Boolean(e&&Tt.has(e.type))}function hasValidName(e){const t=e.fileName||e.name;return!t||typeof t==="string"&&!isPathFragment(t)}function getValidSource(e,t,i){if(!(typeof e==="string"||e instanceof Uint8Array)){const e=t.fileName||t.name||i;return error(logFailedValidation(`Could not set source for ${typeof e==="string"?`asset "${e}"`:"unnamed asset"}, asset source needs to be a string, Uint8Array or Buffer.`))}return e}function getAssetFileName(e,t){if(typeof e.fileName!=="string"){return error(logAssetNotFinalisedForFileName(e.name||t))}return e.fileName}function getChunkFileName(e,t){if(e.fileName){return e.fileName}if(t){return t.get(e.module).getFileName()}return error(logChunkNotGeneratedForFileName(e.fileName||e.name))}class FileEmitter{constructor(e,t,i){this.graph=e;this.options=t;this.facadeChunkByModule=null;this.nextIdBase=1;this.output=null;this.outputFileEmitters=[];this.emitFile=e=>{if(!hasValidType(e)){return error(logFailedValidation(`Emitted files must be of type "asset", "chunk" or "prebuilt-chunk", received "${e&&e.type}".`))}if(e.type==="prebuilt-chunk"){return this.emitPrebuiltChunk(e)}if(!hasValidName(e)){return error(logFailedValidation(`The "fileName" or "name" properties of emitted chunks and assets must be strings that are neither absolute nor relative paths, received "${e.fileName||e.name}".`))}if(e.type==="chunk"){return this.emitChunk(e)}return this.emitAsset(e)};this.finaliseAssets=()=>{for(const[e,t]of this.filesByReferenceId){if(t.type==="asset"&&typeof t.fileName!=="string")return error(logNoAssetSourceSet(t.name||e))}};this.getFileName=e=>{const t=this.filesByReferenceId.get(e);if(!t)return error(logFileReferenceIdNotFoundForFilename(e));if(t.type==="chunk"){return getChunkFileName(t,this.facadeChunkByModule)}if(t.type==="prebuilt-chunk"){return t.fileName}return getAssetFileName(t,e)};this.setAssetSource=(e,t)=>{const i=this.filesByReferenceId.get(e);if(!i)return error(logAssetReferenceIdNotFoundForSetSource(e));if(i.type!=="asset"){return error(logFailedValidation(`Asset sources can only be set for emitted assets but "${e}" is an emitted chunk.`))}if(i.source!==undefined){return error(logAssetSourceAlreadySet(i.name||e))}const s=getValidSource(t,i,e);if(this.output){this.finalizeAdditionalAsset(i,s,this.output)}else{i.source=s;for(const e of this.outputFileEmitters){e.finalizeAdditionalAsset(i,s,e.output)}}};this.setChunkInformation=e=>{this.facadeChunkByModule=e};this.setOutputBundle=(e,t)=>{const i=this.output={bundle:e,fileNamesBySource:new Map,outputOptions:t};for(const e of this.filesByReferenceId.values()){if(e.fileName){reserveFileNameInBundle(e.fileName,i,this.options.onLog)}}const s=new Map;for(const e of this.filesByReferenceId.values()){if(e.type==="asset"&&e.source!==undefined){if(e.fileName){this.finalizeAdditionalAsset(e,e.source,i)}else{const t=getSourceHash(e.source);getOrCreate(s,t,(()=>[])).push(e)}}else if(e.type==="prebuilt-chunk"){this.output.bundle[e.fileName]=this.createPrebuiltChunk(e)}}for(const[e,t]of s){this.finalizeAssetsWithSameSource(t,e,i)}};this.filesByReferenceId=i?new Map(i.filesByReferenceId):new Map;i?.addOutputFileEmitter(this)}addOutputFileEmitter(e){this.outputFileEmitters.push(e)}assignReferenceId(e,t){let i=t;do{i=createHash().update(i).digest("hex").slice(0,8)}while(this.filesByReferenceId.has(i)||this.outputFileEmitters.some((({filesByReferenceId:e})=>e.has(i))));e.referenceId=i;this.filesByReferenceId.set(i,e);for(const{filesByReferenceId:t}of this.outputFileEmitters){t.set(i,e)}return i}createPrebuiltChunk(e){return{code:e.code,dynamicImports:[],exports:e.exports||[],facadeModuleId:null,fileName:e.fileName,implicitlyLoadedBefore:[],importedBindings:{},imports:[],isDynamicEntry:false,isEntry:false,isImplicitEntry:false,map:e.map||null,moduleIds:[],modules:{},name:e.fileName,preliminaryFileName:e.fileName,referencedFiles:[],sourcemapFileName:e.sourcemapFileName||null,type:"chunk"}}emitAsset(e){const t=e.source===undefined?undefined:getValidSource(e.source,e,null);const i={fileName:e.fileName,name:e.name,needsCodeReference:!!e.needsCodeReference,referenceId:"",source:t,type:"asset"};const s=this.assignReferenceId(i,e.fileName||e.name||String(this.nextIdBase++));if(this.output){this.emitAssetWithReferenceId(i,this.output)}else{for(const e of this.outputFileEmitters){e.emitAssetWithReferenceId(i,e.output)}}return s}emitAssetWithReferenceId(e,t){const{fileName:i,source:s}=e;if(i){reserveFileNameInBundle(i,t,this.options.onLog)}if(s!==undefined){this.finalizeAdditionalAsset(e,s,t)}}emitChunk(e){if(this.graph.phase>p.LOAD_AND_PARSE){return error(logInvalidRollupPhaseForChunkEmission())}if(typeof e.id!=="string"){return error(logFailedValidation(`Emitted chunks need to have a valid string id, received "${e.id}"`))}const t={fileName:e.fileName,module:null,name:e.name||e.id,referenceId:"",type:"chunk"};this.graph.moduleLoader.emitChunk(e).then((e=>t.module=e)).catch((()=>{}));return this.assignReferenceId(t,e.id)}emitPrebuiltChunk(e){if(typeof e.code!=="string"){return error(logFailedValidation(`Emitted prebuilt chunks need to have a valid string code, received "${e.code}".`))}if(typeof e.fileName!=="string"||isPathFragment(e.fileName)){return error(logFailedValidation(`The "fileName" property of emitted prebuilt chunks must be strings that are neither absolute nor relative paths, received "${e.fileName}".`))}const t={code:e.code,exports:e.exports,fileName:e.fileName,map:e.map,referenceId:"",type:"prebuilt-chunk"};const i=this.assignReferenceId(t,t.fileName);if(this.output){this.output.bundle[t.fileName]=this.createPrebuiltChunk(t)}return i}finalizeAdditionalAsset(e,t,{bundle:i,fileNamesBySource:s,outputOptions:n}){let{fileName:r,needsCodeReference:o,referenceId:l}=e;if(!r){const o=getSourceHash(t);r=s.get(o);if(!r){r=generateAssetFileName(e.name,t,o,n,i);s.set(o,r)}}const c={...e,fileName:r,source:t};this.filesByReferenceId.set(l,c);const u=i[r];if(u?.type==="asset"){u.needsCodeReference&&(u.needsCodeReference=o)}else{i[r]={fileName:r,name:e.name,needsCodeReference:o,source:t,type:"asset"}}}finalizeAssetsWithSameSource(e,t,{bundle:i,fileNamesBySource:s,outputOptions:n}){let r="";let o;let l=true;for(const s of e){l&&(l=s.needsCodeReference);const e=generateAssetFileName(s.name,s.source,t,n,i);if(!r||e.length<r.length||e.length===r.length&&e<r){r=e;o=s}}s.set(t,r);for(const t of e){const e={...t,fileName:r};this.filesByReferenceId.set(t.referenceId,e)}i[r]={fileName:r,name:o.name,needsCodeReference:l,source:o.source,type:"asset"}}}const Dt="at position ";const Mt="at output position ";function createPluginCache(e){return{delete(t){return delete e[t]},get(t){const i=e[t];if(!i)return;i[0]=0;return i[1]},has(t){const i=e[t];if(!i)return false;i[0]=0;return true},set(t,i){e[t]=[0,i]}}}function getTrackedPluginCache(e,t){return{delete(i){t();return e.delete(i)},get(i){t();return e.get(i)},has(i){t();return e.has(i)},set(i,s){t();return e.set(i,s)}}}const Lt={delete(){return false},get(){return undefined},has(){return false},set(){}};function uncacheablePluginError(e){if(e.startsWith(Dt)||e.startsWith(Mt)){return error(logAnonymousPluginCache())}return error(logDuplicatePluginName(e))}function getCacheForUncacheablePlugin(e){return{delete(){return uncacheablePluginError(e)},get(){return uncacheablePluginError(e)},has(){return uncacheablePluginError(e)},set(){return uncacheablePluginError(e)}}}const Bt=Object.freeze(Object.create(null));const Ft=Object.freeze({});const Vt=Object.freeze([]);const zt=Object.freeze(new class extends Set{add(){throw new Error("Cannot add to empty set")}});const doNothing=()=>{};async function asyncFlatten(e){do{e=(await Promise.all(e)).flat(Infinity)}while(e.some((e=>e?.then)));return e}const getOnLog=(e,t,i=defaultPrintLog)=>{const{onwarn:s,onLog:n}=e;const r=getDefaultOnLog(i,s);if(n){const e=w[t];return(t,i)=>n(t,addLogToString(i),((t,i)=>{if(t===b){return error(normalizeLog(i))}if(w[t]>=e){r(t,normalizeLog(i))}}))}return r};const getDefaultOnLog=(e,t)=>t?(i,s)=>{if(i===v){t(addLogToString(s),(t=>e(v,normalizeLog(t))))}else{e(i,s)}}:e;const addLogToString=e=>{Object.defineProperty(e,"toString",{value:()=>getExtendedLogMessage(e),writable:true});return e};const normalizeLog=e=>typeof e==="string"?{message:e}:typeof e==="function"?normalizeLog(e()):e;const getExtendedLogMessage=e=>{let t="";if(e.plugin){t+=`(${e.plugin} plugin) `}if(e.loc){t+=`${relativeId(e.loc.file)} (${e.loc.line}:${e.loc.column}) `}return t+e.message};const defaultPrintLog=(e,t)=>{const i=getExtendedLogMessage(t);switch(e){case v:{return console.warn(i)}case A:{return console.debug(i)}default:{return console.info(i)}}};function warnUnknownOptions(e,t,i,s,n=/$./){const r=new Set(t);const o=Object.keys(e).filter((e=>!(r.has(e)||n.test(e))));if(o.length>0){s(v,logUnknownOption(i,o,[...r].sort()))}}const jt={recommended:{annotations:true,correctVarValueBeforeDeclaration:false,manualPureFunctions:Vt,moduleSideEffects:()=>true,propertyReadSideEffects:true,tryCatchDeoptimization:true,unknownGlobalSideEffects:false},safest:{annotations:true,correctVarValueBeforeDeclaration:true,manualPureFunctions:Vt,moduleSideEffects:()=>true,propertyReadSideEffects:true,tryCatchDeoptimization:true,unknownGlobalSideEffects:true},smallest:{annotations:true,correctVarValueBeforeDeclaration:false,manualPureFunctions:Vt,moduleSideEffects:()=>false,propertyReadSideEffects:false,tryCatchDeoptimization:false,unknownGlobalSideEffects:false}};const Ut={es2015:{arrowFunctions:true,constBindings:true,objectShorthand:true,reservedNamesAsProps:true,symbols:true},es5:{arrowFunctions:false,constBindings:false,objectShorthand:false,reservedNamesAsProps:true,symbols:false}};const objectifyOption=e=>e&&typeof e==="object"?e:{};const objectifyOptionWithPresets=(e,t,i,s)=>n=>{if(typeof n==="string"){const r=e[n];if(r){return r}error(logInvalidOption(t,i,`valid values are ${s}${printQuotedStringList(Object.keys(e))}. You can also supply an object for more fine-grained control`,n))}return objectifyOption(n)};const getOptionWithPreset=(e,t,i,s,n)=>{const r=e?.preset;if(r){const n=t[r];if(n){return{...n,...e}}else{error(logInvalidOption(`${i}.preset`,s,`valid values are ${printQuotedStringList(Object.keys(t))}`,r))}}return objectifyOptionWithPresets(t,i,s,n)(e)};const normalizePluginOption=async e=>(await asyncFlatten([e])).filter(Boolean);function getLogHandler(e,t,i,s,n){if(w[e]<w[n]){return doNothing}return(n,r)=>{if(r!=null){i(v,logInvalidLogPosition(s))}n=normalizeLog(n);if(n.code&&!n.pluginCode){n.pluginCode=n.code}n.code=t;n.plugin=s;i(e,n)}}function getPluginContext(e,t,i,s,n,r){const{logLevel:o,onLog:l}=s;let c=true;if(typeof e.cacheKey!=="string"){if(e.name.startsWith(Dt)||e.name.startsWith(Mt)||r.has(e.name)){c=false}else{r.add(e.name)}}let u;if(!t){u=Lt}else if(c){const i=e.cacheKey||e.name;u=createPluginCache(t[i]||(t[i]=Object.create(null)))}else{u=getCacheForUncacheablePlugin(e.name)}return{addWatchFile(e){if(i.phase>=p.GENERATE){return this.error(logInvalidRollupPhaseForAddWatchFile())}i.watchFiles[e]=true},cache:u,debug:getLogHandler(A,"PLUGIN_LOG",l,e.name,o),emitFile:n.emitFile.bind(n),error(t){return error(logPluginError(normalizeLog(t),e.name))},getFileName:n.getFileName,getModuleIds:()=>i.modulesById.keys(),getModuleInfo:i.getModuleInfo,getWatchFiles:()=>Object.keys(i.watchFiles),info:getLogHandler(S,"PLUGIN_LOG",l,e.name,o),load(e){return i.moduleLoader.preloadModule(e)},meta:{rollupVersion:d,watchMode:i.watchMode},get moduleIds(){function*wrappedModuleIds(){warnDeprecation(`Accessing "this.moduleIds" on the plugin context by plugin ${e.name} is deprecated. The "this.getModuleIds" plugin context function should be used instead.`,le,true,s,e.name);yield*t}const t=i.modulesById.keys();return wrappedModuleIds()},parse:i.contextParse.bind(i),resolve(t,s,{assertions:n,custom:r,isEntry:o,skipSelf:l}=Bt){return i.moduleLoader.resolveId(t,s,r,o,n||Ft,l?[{importer:s,plugin:e,source:t}]:null)},setAssetSource:n.setAssetSource,warn:getLogHandler(v,"PLUGIN_WARNING",l,e.name,o)}}const Ht={buildEnd:1,buildStart:1,closeBundle:1,closeWatcher:1,load:1,moduleParsed:1,onLog:1,options:1,resolveDynamicImport:1,resolveId:1,shouldTransformCachedModule:1,transform:1,watchChange:1};const Gt=Object.keys(Ht);class PluginDriver{constructor(e,t,i,s,n){this.graph=e;this.options=t;this.pluginCache=s;this.sortedPlugins=new Map;this.unfulfilledActions=new Set;this.fileEmitter=new FileEmitter(e,t,n&&n.fileEmitter);this.emitFile=this.fileEmitter.emitFile.bind(this.fileEmitter);this.getFileName=this.fileEmitter.getFileName.bind(this.fileEmitter);this.finaliseAssets=this.fileEmitter.finaliseAssets.bind(this.fileEmitter);this.setChunkInformation=this.fileEmitter.setChunkInformation.bind(this.fileEmitter);this.setOutputBundle=this.fileEmitter.setOutputBundle.bind(this.fileEmitter);this.plugins=[...n?n.plugins:[],...i];const r=new Set;this.pluginContexts=new Map(this.plugins.map((i=>[i,getPluginContext(i,s,e,t,this.fileEmitter,r)])));if(n){for(const e of i){for(const i of Gt){if(i in e){t.onLog(v,logInputHookInOutputPlugin(e.name,i))}}}}}createOutputPluginDriver(e){return new PluginDriver(this.graph,this.options,e,this.pluginCache,this)}getUnfulfilledHookActions(){return this.unfulfilledActions}hookFirst(e,t,i,s){return this.hookFirstAndGetPlugin(e,t,i,s).then((e=>e&&e[0]))}async hookFirstAndGetPlugin(e,t,i,s){for(const n of this.getSortedPlugins(e)){if(s?.has(n))continue;const r=await this.runHook(e,t,n,i);if(r!=null)return[r,n]}return null}hookFirstSync(e,t,i){for(const s of this.getSortedPlugins(e)){const n=this.runHookSync(e,t,s,i);if(n!=null)return n}return null}async hookParallel(e,t,i){const s=[];for(const n of this.getSortedPlugins(e)){if(n[e].sequential){await Promise.all(s);s.length=0;await this.runHook(e,t,n,i)}else{s.push(this.runHook(e,t,n,i))}}await Promise.all(s)}hookReduceArg0(e,[t,...i],s,n){let r=Promise.resolve(t);for(const t of this.getSortedPlugins(e)){r=r.then((r=>this.runHook(e,[r,...i],t,n).then((e=>s.call(this.pluginContexts.get(t),r,e,t)))))}return r}hookReduceArg0Sync(e,[t,...i],s,n){for(const r of this.getSortedPlugins(e)){const o=[t,...i];const l=this.runHookSync(e,o,r,n);t=s.call(this.pluginContexts.get(r),t,l,r)}return t}async hookReduceValue(e,t,i,s){const n=[];const r=[];for(const t of this.getSortedPlugins(e,validateAddonPluginHandler)){if(t[e].sequential){n.push(...await Promise.all(r));r.length=0;n.push(await this.runHook(e,i,t))}else{r.push(this.runHook(e,i,t))}}n.push(...await Promise.all(r));return n.reduce(s,await t)}hookReduceValueSync(e,t,i,s,n){let r=t;for(const t of this.getSortedPlugins(e)){const o=this.runHookSync(e,i,t,n);r=s.call(this.pluginContexts.get(t),r,o,t)}return r}hookSeq(e,t,i){let s=Promise.resolve();for(const n of this.getSortedPlugins(e)){s=s.then((()=>this.runHook(e,t,n,i)))}return s.then(noReturn)}getSortedPlugins(e,t){return getOrCreate(this.sortedPlugins,e,(()=>getSortedValidatedPlugins(e,this.plugins,t)))}runHook(e,t,i,s){const n=i[e];const r=typeof n==="object"?n.handler:n;let o=this.pluginContexts.get(i);if(s){o=s(o,i)}let l=null;return Promise.resolve().then((()=>{if(typeof r!=="function"){return r}const s=r.apply(o,t);if(!s?.then){return s}l=[i.name,e,t];this.unfulfilledActions.add(l);return Promise.resolve(s).then((e=>{this.unfulfilledActions.delete(l);return e}))})).catch((t=>{if(l!==null){this.unfulfilledActions.delete(l)}return error(logPluginError(t,i.name,{hook:e}))}))}runHookSync(e,t,i,s){const n=i[e];const r=typeof n==="object"?n.handler:n;let o=this.pluginContexts.get(i);if(s){o=s(o,i)}try{return r.apply(o,t)}catch(t){return error(logPluginError(t,i.name,{hook:e}))}}}function getSortedValidatedPlugins(e,t,i=validateFunctionPluginHandler){const s=[];const n=[];const r=[];for(const o of t){const t=o[e];if(t){if(typeof t==="object"){i(t.handler,e,o);if(t.order==="pre"){s.push(o);continue}if(t.order==="post"){r.push(o);continue}}else{i(t,e,o)}n.push(o)}}return[...s,...n,...r]}function validateFunctionPluginHandler(e,t,i){if(typeof e!=="function"){error(logInvalidFunctionPluginHook(t,i.name))}}function validateAddonPluginHandler(e,t,i){if(typeof e!=="string"&&typeof e!=="function"){return error(logInvalidAddonPluginHook(t,i.name))}}function noReturn(){}function getLogger(e,t,i,s){e=getSortedValidatedPlugins("onLog",e);const n=w[s];const logger=(s,r,o=zt)=>{const l=w[s];if(l<n){return}for(const t of e){if(o.has(t))continue;const{onLog:e}=t;const getLogHandler=e=>{if(w[e]<n){return doNothing}return i=>logger(e,normalizeLog(i),new Set(o).add(t))};const l="handler"in e?e.handler:e;if(l.call({debug:getLogHandler(A),error:e=>error(normalizeLog(e)),info:getLogHandler(S),meta:{rollupVersion:d,watchMode:i},warn:getLogHandler(v)},s,r)===false){return}}t(s,r)};return logger}const Wt={c:"config",d:"dir",e:"external",f:"format",g:"globals",h:"help",i:"input",m:"sourcemap",n:"name",o:"file",p:"plugin",v:"version",w:"watch"};const qt={external:[],globals:undefined};async function mergeOptions(e,t,i=qt,s){const n=getCommandOptions(i);const r=await normalizePluginOption(e.plugins);const o=e.logLevel||S;const l=getOnLog(e,o,s);const c=getLogger(r,l,t,o);const u=await mergeInputOptions(e,n,r,c,l);if(n.output){Object.assign(n,n.output)}const h=ensureArray$1(e.output);if(h.length===0)h.push({});const d=await Promise.all(h.map((e=>mergeOutputOptions(e,n,c))));warnUnknownOptions(n,[...Object.keys(u),...Object.keys(d[0]).filter((e=>e!=="sourcemapIgnoreList"&&e!=="sourcemapPathTransform")),...Object.keys(Wt),"bundleConfigAsCjs","config","environment","filterLogs","plugin","silent","failAfterWarnings","stdin","waitForBundleInput","configPlugin"],"CLI flags",c,/^_$|output$|config/);u.output=d;return u}function getCommandOptions(e){const t=e.external&&typeof e.external==="string"?e.external.split(","):[];return{...e,external:t,globals:typeof e.globals==="string"?e.globals.split(",").reduce(((e,i)=>{const[s,n]=i.split(":");e[s]=n;if(!t.includes(s)){t.push(s)}return e}),Object.create(null)):undefined}}function mergeInputOptions(e,t,i,s,n){const getOption=i=>t[i]??e[i];const r={acorn:getOption("acorn"),acornInjectPlugins:e.acornInjectPlugins,cache:e.cache,context:getOption("context"),experimentalCacheExpiry:getOption("experimentalCacheExpiry"),experimentalLogSideEffects:getOption("experimentalLogSideEffects"),external:getExternal(e,t),inlineDynamicImports:getOption("inlineDynamicImports"),input:getOption("input")||[],logLevel:getOption("logLevel"),makeAbsoluteExternalsRelative:getOption("makeAbsoluteExternalsRelative"),manualChunks:getOption("manualChunks"),maxParallelFileOps:getOption("maxParallelFileOps"),maxParallelFileReads:getOption("maxParallelFileReads"),moduleContext:getOption("moduleContext"),onLog:n,onwarn:undefined,perf:getOption("perf"),plugins:i,preserveEntrySignatures:getOption("preserveEntrySignatures"),preserveModules:getOption("preserveModules"),preserveSymlinks:getOption("preserveSymlinks"),shimMissingExports:getOption("shimMissingExports"),strictDeprecations:getOption("strictDeprecations"),treeshake:getObjectOption(e,t,"treeshake",objectifyOptionWithPresets(jt,"treeshake",ie,"false, true, ")),watch:getWatch(e,t)};warnUnknownOptions(e,Object.keys(r),"input options",s,/^output$/);return r}const getExternal=(e,t)=>{const i=e.external;return typeof i==="function"?(e,s,n)=>i(e,s,n)||t.external.includes(e):[...ensureArray$1(i),...t.external]};const getObjectOption=(e,t,i,s=objectifyOption)=>{const n=normalizeObjectOptionValue(t[i],s);const r=normalizeObjectOptionValue(e[i],s);if(n!==undefined){return n&&{...r,...n}}return r};const getWatch=(e,t)=>e.watch!==false&&getObjectOption(e,t,"watch");const isWatchEnabled=e=>{if(Array.isArray(e)){return e.reduce(((e,t)=>typeof t==="boolean"?t:e),false)}return e===true};const normalizeObjectOptionValue=(e,t)=>{if(!e){return e}if(Array.isArray(e)){return e.reduce(((e,i)=>i&&e&&{...e,...t(i)}),{})}return t(e)};async function mergeOutputOptions(e,t,i){const getOption=i=>t[i]??e[i];const s={amd:getObjectOption(e,t,"amd"),assetFileNames:getOption("assetFileNames"),banner:getOption("banner"),chunkFileNames:getOption("chunkFileNames"),compact:getOption("compact"),dir:getOption("dir"),dynamicImportFunction:getOption("dynamicImportFunction"),dynamicImportInCjs:getOption("dynamicImportInCjs"),entryFileNames:getOption("entryFileNames"),esModule:getOption("esModule"),experimentalDeepDynamicChunkOptimization:getOption("experimentalDeepDynamicChunkOptimization"),experimentalMinChunkSize:getOption("experimentalMinChunkSize"),exports:getOption("exports"),extend:getOption("extend"),externalImportAssertions:getOption("externalImportAssertions"),externalLiveBindings:getOption("externalLiveBindings"),file:getOption("file"),footer:getOption("footer"),format:getOption("format"),freeze:getOption("freeze"),generatedCode:getObjectOption(e,t,"generatedCode",objectifyOptionWithPresets(Ut,"output.generatedCode",U,"")),globals:getOption("globals"),hoistTransitiveImports:getOption("hoistTransitiveImports"),indent:getOption("indent"),inlineDynamicImports:getOption("inlineDynamicImports"),interop:getOption("interop"),intro:getOption("intro"),manualChunks:getOption("manualChunks"),minifyInternalExports:getOption("minifyInternalExports"),name:getOption("name"),namespaceToStringTag:getOption("namespaceToStringTag"),noConflict:getOption("noConflict"),outro:getOption("outro"),paths:getOption("paths"),plugins:await normalizePluginOption(e.plugins),preferConst:getOption("preferConst"),preserveModules:getOption("preserveModules"),preserveModulesRoot:getOption("preserveModulesRoot"),sanitizeFileName:getOption("sanitizeFileName"),sourcemap:getOption("sourcemap"),sourcemapBaseUrl:getOption("sourcemapBaseUrl"),sourcemapExcludeSources:getOption("sourcemapExcludeSources"),sourcemapFile:getOption("sourcemapFile"),sourcemapFileNames:getOption("sourcemapFileNames"),sourcemapIgnoreList:getOption("sourcemapIgnoreList"),sourcemapPathTransform:getOption("sourcemapPathTransform"),strict:getOption("strict"),systemNullSetters:getOption("systemNullSetters"),validate:getOption("validate")};warnUnknownOptions(e,Object.keys(s),"output options",i);return s}const{env:Kt={},argv:Yt=[],platform:Qt=""}=typeof process==="undefined"?{}:process;const Xt="NO_COLOR"in Kt||Yt.includes("--no-color");const Zt="FORCE_COLOR"in Kt||Yt.includes("--color");const Jt=Qt==="win32";const ei=Kt.TERM==="dumb";const ti=h&&h.isatty&&h.isatty(1)&&Kt.TERM&&!ei;const ii="CI"in Kt&&("GITHUB_ACTIONS"in Kt||"GITLAB_CI"in Kt||"CIRCLECI"in Kt);const si=!Xt&&(Zt||Jt&&!ei||ti||ii);const replaceClose=(e,t,i,s,n=t.substring(0,e)+s,r=t.substring(e+i.length),o=r.indexOf(i))=>n+(o<0?r:replaceClose(o,r,i,s));const clearBleed=(e,t,i,s,n)=>e<0?i+t+s:i+replaceClose(e,t,s,n)+s;const filterEmpty=(e,t,i=e,s=e.length+1)=>n=>n||!(n===""||n===undefined)?clearBleed((""+n).indexOf(t,s),n,e,t,i):"";const init=(e,t,i)=>filterEmpty(`[${e}m`,`[${t}m`,i);const ni={reset:init(0,0),bold:init(1,22,"[22m[1m"),dim:init(2,22,"[22m[2m"),italic:init(3,23),underline:init(4,24),inverse:init(7,27),hidden:init(8,28),strikethrough:init(9,29),black:init(30,39),red:init(31,39),green:init(32,39),yellow:init(33,39),blue:init(34,39),magenta:init(35,39),cyan:init(36,39),white:init(37,39),gray:init(90,39),bgBlack:init(40,49),bgRed:init(41,49),bgGreen:init(42,49),bgYellow:init(43,49),bgBlue:init(44,49),bgMagenta:init(45,49),bgCyan:init(46,49),bgWhite:init(47,49),blackBright:init(90,39),redBright:init(91,39),greenBright:init(92,39),yellowBright:init(93,39),blueBright:init(94,39),magentaBright:init(95,39),cyanBright:init(96,39),whiteBright:init(97,39),bgBlackBright:init(100,49),bgRedBright:init(101,49),bgGreenBright:init(102,49),bgYellowBright:init(103,49),bgBlueBright:init(104,49),bgMagentaBright:init(105,49),bgCyanBright:init(106,49),bgWhiteBright:init(107,49)};const createColors=({useColor:e=si}={})=>e?ni:Object.keys(ni).reduce(((e,t)=>({...e,[t]:String})),{});const{reset:ri,bold:oi,dim:ai,italic:li,underline:ci,inverse:ui,hidden:hi,strikethrough:di,black:pi,red:fi,green:mi,yellow:gi,blue:yi,magenta:Ei,cyan:xi,white:bi,gray:vi,bgBlack:Si,bgRed:Ai,bgGreen:wi,bgYellow:Ii,bgBlue:Ci,bgMagenta:ki,bgCyan:_i,bgWhite:Pi,blackBright:Ni,redBright:Ri,greenBright:$i,yellowBright:Oi,blueBright:Ti,magentaBright:Di,cyanBright:Mi,whiteBright:Li,bgBlackBright:Bi,bgRedBright:Fi,bgGreenBright:Vi,bgYellowBright:zi,bgBlueBright:ji,bgMagentaBright:Ui,bgCyanBright:Hi,bgWhiteBright:Gi}=createColors();const{bold:Wi,cyan:qi,dim:Ki,gray:Yi,green:Qi,red:Xi,underline:Zi,yellow:Ji}=createColors({useColor:s.env.FORCE_COLOR!=="0"&&!s.env.NO_COLOR});const stderr=(...e)=>s.stderr.write(`${e.join("")}\n`);function handleError(e,t=false){const i=e.name||e.cause?.name;const n=i?`${i}: `:"";const r=e.plugin?`(plugin ${e.plugin}) `:"";const o=`${r}${n}${e.message}`;const l=[Wi(Xi(`[!] ${Wi(o.toString())}`))];if(e.url){l.push(qi(e.url))}if(e.loc){l.push(`${relativeId(e.loc.file||e.id)} (${e.loc.line}:${e.loc.column})`)}else if(e.id){l.push(relativeId(e.id))}if(e.frame){l.push(Ki(e.frame))}if(e.stack){l.push(Ki(e.stack?.replace(`${n}${e.message}\n`,"")))}l.push("","");stderr(l.join("\n"));if(!t)s.exit(1)}const ts=",".charCodeAt(0);const is=";".charCodeAt(0);const ss="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";const ns=new Uint8Array(64);const rs=new Uint8Array(128);for(let e=0;e<ss.length;e++){const t=ss.charCodeAt(e);ns[e]=t;rs[t]=e}const os=typeof TextDecoder!=="undefined"?new TextDecoder:typeof Buffer!=="undefined"?{decode(e){const t=Buffer.from(e.buffer,e.byteOffset,e.byteLength);return t.toString()}}:{decode(e){let t="";for(let i=0;i<e.length;i++){t+=String.fromCharCode(e[i])}return t}};function decode(e){const t=new Int32Array(5);const i=[];let s=0;do{const n=indexOf(e,s);const r=[];let o=true;let l=0;t[0]=0;for(let i=s;i<n;i++){let s;i=decodeInteger(e,i,t,0);const c=t[0];if(c<l)o=false;l=c;if(hasMoreVlq(e,i,n)){i=decodeInteger(e,i,t,1);i=decodeInteger(e,i,t,2);i=decodeInteger(e,i,t,3);if(hasMoreVlq(e,i,n)){i=decodeInteger(e,i,t,4);s=[c,t[1],t[2],t[3],t[4]]}else{s=[c,t[1],t[2],t[3]]}}else{s=[c]}r.push(s)}if(!o)sort(r);i.push(r);s=n+1}while(s<=e.length);return i}function indexOf(e,t){const i=e.indexOf(";",t);return i===-1?e.length:i}function decodeInteger(e,t,i,s){let n=0;let r=0;let o=0;do{const i=e.charCodeAt(t++);o=rs[i];n|=(o&31)<<r;r+=5}while(o&32);const l=n&1;n>>>=1;if(l){n=-2147483648|-n}i[s]+=n;return t}function hasMoreVlq(e,t,i){if(t>=i)return false;return e.charCodeAt(t)!==ts}function sort(e){e.sort(sortComparator)}function sortComparator(e,t){return e[0]-t[0]}function encode(e){const t=new Int32Array(5);const i=1024*16;const s=i-36;const n=new Uint8Array(i);const r=n.subarray(0,s);let o=0;let l="";for(let c=0;c<e.length;c++){const u=e[c];if(c>0){if(o===i){l+=os.decode(n);o=0}n[o++]=is}if(u.length===0)continue;t[0]=0;for(let e=0;e<u.length;e++){const i=u[e];if(o>s){l+=os.decode(r);n.copyWithin(0,s,o);o-=s}if(e>0)n[o++]=ts;o=encodeInteger(n,o,t,i,0);if(i.length===1)continue;o=encodeInteger(n,o,t,i,1);o=encodeInteger(n,o,t,i,2);o=encodeInteger(n,o,t,i,3);if(i.length===4)continue;o=encodeInteger(n,o,t,i,4)}}return l+os.decode(n.subarray(0,o))}function encodeInteger(e,t,i,s,n){const r=s[n];let o=r-i[n];i[n]=r;o=o<0?-o<<1|1:o<<1;do{let i=o&31;o>>>=5;if(o>0)i|=32;e[t++]=ns[i]}while(o>0);return t}class BitSet{constructor(e){this.bits=e instanceof BitSet?e.bits.slice():[]}add(e){this.bits[e>>5]|=1<<(e&31)}has(e){return!!(this.bits[e>>5]&1<<(e&31))}}let as=class Chunk{constructor(e,t,i){this.start=e;this.end=t;this.original=i;this.intro="";this.outro="";this.content=i;this.storeName=false;this.edited=false;{this.previous=null;this.next=null}}appendLeft(e){this.outro+=e}appendRight(e){this.intro=this.intro+e}clone(){const e=new Chunk(this.start,this.end,this.original);e.intro=this.intro;e.outro=this.outro;e.content=this.content;e.storeName=this.storeName;e.edited=this.edited;return e}contains(e){return this.start<e&&e<this.end}eachNext(e){let t=this;while(t){e(t);t=t.next}}eachPrevious(e){let t=this;while(t){e(t);t=t.previous}}edit(e,t,i){this.content=e;if(!i){this.intro="";this.outro=""}this.storeName=t;this.edited=true;return this}prependLeft(e){this.outro=e+this.outro}prependRight(e){this.intro=e+this.intro}split(e){const t=e-this.start;const i=this.original.slice(0,t);const s=this.original.slice(t);this.original=i;const n=new Chunk(e,this.end,s);n.outro=this.outro;this.outro="";this.end=e;if(this.edited){n.edit("",false);this.content=""}else{this.content=i}n.next=this.next;if(n.next)n.next.previous=n;n.previous=this;this.next=n;return n}toString(){return this.intro+this.content+this.outro}trimEnd(e){this.outro=this.outro.replace(e,"");if(this.outro.length)return true;const t=this.content.replace(e,"");if(t.length){if(t!==this.content){this.split(this.start+t.length).edit("",undefined,true);if(this.edited){this.edit(t,this.storeName,true)}}return true}else{this.edit("",undefined,true);this.intro=this.intro.replace(e,"");if(this.intro.length)return true}}trimStart(e){this.intro=this.intro.replace(e,"");if(this.intro.length)return true;const t=this.content.replace(e,"");if(t.length){if(t!==this.content){const e=this.split(this.end-t.length);if(this.edited){e.edit(t,this.storeName,true)}this.edit("",undefined,true)}return true}else{this.edit("",undefined,true);this.outro=this.outro.replace(e,"");if(this.outro.length)return true}}};function getBtoa(){if(typeof window!=="undefined"&&typeof window.btoa==="function"){return e=>window.btoa(unescape(encodeURIComponent(e)))}else if(typeof Buffer==="function"){return e=>Buffer.from(e,"utf-8").toString("base64")}else{return()=>{throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.")}}}const ls=getBtoa();class SourceMap{constructor(e){this.version=3;this.file=e.file;this.sources=e.sources;this.sourcesContent=e.sourcesContent;this.names=e.names;this.mappings=encode(e.mappings);if(typeof e.x_google_ignoreList!=="undefined"){this.x_google_ignoreList=e.x_google_ignoreList}}toString(){return JSON.stringify(this)}toUrl(){return"data:application/json;charset=utf-8;base64,"+ls(this.toString())}}function guessIndent(e){const t=e.split("\n");const i=t.filter((e=>/^\t+/.test(e)));const s=t.filter((e=>/^ {2,}/.test(e)));if(i.length===0&&s.length===0){return null}if(i.length>=s.length){return"\t"}const n=s.reduce(((e,t)=>{const i=/^ +/.exec(t)[0].length;return Math.min(i,e)}),Infinity);return new Array(n+1).join(" ")}function getRelativePath(e,t){const i=e.split(/[/\\]/);const s=t.split(/[/\\]/);i.pop();while(i[0]===s[0]){i.shift();s.shift()}if(i.length){let e=i.length;while(e--)i[e]=".."}return i.concat(s).join("/")}const cs=Object.prototype.toString;function isObject$1(e){return cs.call(e)==="[object Object]"}function getLocator(e){const t=e.split("\n");const i=[];for(let e=0,s=0;e<t.length;e++){i.push(s);s+=t[e].length+1}return function locate(e){let t=0;let s=i.length;while(t<s){const n=t+s>>1;if(e<i[n]){s=n}else{t=n+1}}const n=t-1;const r=e-i[n];return{line:n,column:r}}}const us=/\w/;class Mappings{constructor(e){this.hires=e;this.generatedCodeLine=0;this.generatedCodeColumn=0;this.raw=[];this.rawSegments=this.raw[this.generatedCodeLine]=[];this.pending=null}addEdit(e,t,i,s){if(t.length){const t=[this.generatedCodeColumn,e,i.line,i.column];if(s>=0){t.push(s)}this.rawSegments.push(t)}else if(this.pending){this.rawSegments.push(this.pending)}this.advance(t);this.pending=null}addUneditedChunk(e,t,i,s,n){let r=t.start;let o=true;let l=false;while(r<t.end){if(this.hires||o||n.has(r)){const t=[this.generatedCodeColumn,e,s.line,s.column];if(this.hires==="boundary"){if(us.test(i[r])){if(!l){this.rawSegments.push(t);l=true}}else{this.rawSegments.push(t);l=false}}else{this.rawSegments.push(t)}}if(i[r]==="\n"){s.line+=1;s.column=0;this.generatedCodeLine+=1;this.raw[this.generatedCodeLine]=this.rawSegments=[];this.generatedCodeColumn=0;o=true}else{s.column+=1;this.generatedCodeColumn+=1;o=false}r+=1}this.pending=null}advance(e){if(!e)return;const t=e.split("\n");if(t.length>1){for(let e=0;e<t.length-1;e++){this.generatedCodeLine++;this.raw[this.generatedCodeLine]=this.rawSegments=[]}this.generatedCodeColumn=0}this.generatedCodeColumn+=t[t.length-1].length}}const hs="\n";const ds={insertLeft:false,insertRight:false,storeName:false};class MagicString{constructor(e,t={}){const i=new as(0,e.length,e);Object.defineProperties(this,{original:{writable:true,value:e},outro:{writable:true,value:""},intro:{writable:true,value:""},firstChunk:{writable:true,value:i},lastChunk:{writable:true,value:i},lastSearchedChunk:{writable:true,value:i},byStart:{writable:true,value:{}},byEnd:{writable:true,value:{}},filename:{writable:true,value:t.filename},indentExclusionRanges:{writable:true,value:t.indentExclusionRanges},sourcemapLocations:{writable:true,value:new BitSet},storedNames:{writable:true,value:{}},indentStr:{writable:true,value:undefined},ignoreList:{writable:true,value:t.ignoreList}});this.byStart[0]=i;this.byEnd[e.length]=i}addSourcemapLocation(e){this.sourcemapLocations.add(e)}append(e){if(typeof e!=="string")throw new TypeError("outro content must be a string");this.outro+=e;return this}appendLeft(e,t){if(typeof t!=="string")throw new TypeError("inserted content must be a string");this._split(e);const i=this.byEnd[e];if(i){i.appendLeft(t)}else{this.intro+=t}return this}appendRight(e,t){if(typeof t!=="string")throw new TypeError("inserted content must be a string");this._split(e);const i=this.byStart[e];if(i){i.appendRight(t)}else{this.outro+=t}return this}clone(){const e=new MagicString(this.original,{filename:this.filename});let t=this.firstChunk;let i=e.firstChunk=e.lastSearchedChunk=t.clone();while(t){e.byStart[i.start]=i;e.byEnd[i.end]=i;const s=t.next;const n=s&&s.clone();if(n){i.next=n;n.previous=i;i=n}t=s}e.lastChunk=i;if(this.indentExclusionRanges){e.indentExclusionRanges=this.indentExclusionRanges.slice()}e.sourcemapLocations=new BitSet(this.sourcemapLocations);e.intro=this.intro;e.outro=this.outro;return e}generateDecodedMap(e){e=e||{};const t=0;const i=Object.keys(this.storedNames);const s=new Mappings(e.hires);const n=getLocator(this.original);if(this.intro){s.advance(this.intro)}this.firstChunk.eachNext((e=>{const r=n(e.start);if(e.intro.length)s.advance(e.intro);if(e.edited){s.addEdit(t,e.content,r,e.storeName?i.indexOf(e.original):-1)}else{s.addUneditedChunk(t,e,this.original,r,this.sourcemapLocations)}if(e.outro.length)s.advance(e.outro)}));return{file:e.file?e.file.split(/[/\\]/).pop():undefined,sources:[e.source?getRelativePath(e.file||"",e.source):e.file||""],sourcesContent:e.includeContent?[this.original]:undefined,names:i,mappings:s.raw,x_google_ignoreList:this.ignoreList?[t]:undefined}}generateMap(e){return new SourceMap(this.generateDecodedMap(e))}_ensureindentStr(){if(this.indentStr===undefined){this.indentStr=guessIndent(this.original)}}_getRawIndentString(){this._ensureindentStr();return this.indentStr}getIndentString(){this._ensureindentStr();return this.indentStr===null?"\t":this.indentStr}indent(e,t){const i=/^[^\r\n]/gm;if(isObject$1(e)){t=e;e=undefined}if(e===undefined){this._ensureindentStr();e=this.indentStr||"\t"}if(e==="")return this;t=t||{};const s={};if(t.exclude){const e=typeof t.exclude[0]==="number"?[t.exclude]:t.exclude;e.forEach((e=>{for(let t=e[0];t<e[1];t+=1){s[t]=true}}))}let n=t.indentStart!==false;const replacer=t=>{if(n)return`${e}${t}`;n=true;return t};this.intro=this.intro.replace(i,replacer);let r=0;let o=this.firstChunk;while(o){const t=o.end;if(o.edited){if(!s[r]){o.content=o.content.replace(i,replacer);if(o.content.length){n=o.content[o.content.length-1]==="\n"}}}else{r=o.start;while(r<t){if(!s[r]){const t=this.original[r];if(t==="\n"){n=true}else if(t!=="\r"&&n){n=false;if(r===o.start){o.prependRight(e)}else{this._splitChunk(o,r);o=o.next;o.prependRight(e)}}}r+=1}}r=o.end;o=o.next}this.outro=this.outro.replace(i,replacer);return this}insert(){throw new Error("magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)")}insertLeft(e,t){if(!ds.insertLeft){console.warn("magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead");ds.insertLeft=true}return this.appendLeft(e,t)}insertRight(e,t){if(!ds.insertRight){console.warn("magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead");ds.insertRight=true}return this.prependRight(e,t)}move(e,t,i){if(i>=e&&i<=t)throw new Error("Cannot move a selection inside itself");this._split(e);this._split(t);this._split(i);const s=this.byStart[e];const n=this.byEnd[t];const r=s.previous;const o=n.next;const l=this.byStart[i];if(!l&&n===this.lastChunk)return this;const c=l?l.previous:this.lastChunk;if(r)r.next=o;if(o)o.previous=r;if(c)c.next=s;if(l)l.previous=n;if(!s.previous)this.firstChunk=n.next;if(!n.next){this.lastChunk=s.previous;this.lastChunk.next=null}s.previous=c;n.next=l||null;if(!c)this.firstChunk=s;if(!l)this.lastChunk=n;return this}overwrite(e,t,i,s){s=s||{};return this.update(e,t,i,{...s,overwrite:!s.contentOnly})}update(e,t,i,s){if(typeof i!=="string")throw new TypeError("replacement content must be a string");while(e<0)e+=this.original.length;while(t<0)t+=this.original.length;if(t>this.original.length)throw new Error("end is out of bounds");if(e===t)throw new Error("Cannot overwrite a zero-length range – use appendLeft or prependRight instead");this._split(e);this._split(t);if(s===true){if(!ds.storeName){console.warn("The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string");ds.storeName=true}s={storeName:true}}const n=s!==undefined?s.storeName:false;const r=s!==undefined?s.overwrite:false;if(n){const i=this.original.slice(e,t);Object.defineProperty(this.storedNames,i,{writable:true,value:true,enumerable:true})}const o=this.byStart[e];const l=this.byEnd[t];if(o){let e=o;while(e!==l){if(e.next!==this.byStart[e.end]){throw new Error("Cannot overwrite across a split point")}e=e.next;e.edit("",false)}o.edit(i,n,!r)}else{const s=new as(e,t,"").edit(i,n);l.next=s;s.previous=l}return this}prepend(e){if(typeof e!=="string")throw new TypeError("outro content must be a string");this.intro=e+this.intro;return this}prependLeft(e,t){if(typeof t!=="string")throw new TypeError("inserted content must be a string");this._split(e);const i=this.byEnd[e];if(i){i.prependLeft(t)}else{this.intro=t+this.intro}return this}prependRight(e,t){if(typeof t!=="string")throw new TypeError("inserted content must be a string");this._split(e);const i=this.byStart[e];if(i){i.prependRight(t)}else{this.outro=t+this.outro}return this}remove(e,t){while(e<0)e+=this.original.length;while(t<0)t+=this.original.length;if(e===t)return this;if(e<0||t>this.original.length)throw new Error("Character is out of bounds");if(e>t)throw new Error("end must be greater than start");this._split(e);this._split(t);let i=this.byStart[e];while(i){i.intro="";i.outro="";i.edit("");i=t>i.end?this.byStart[i.end]:null}return this}lastChar(){if(this.outro.length)return this.outro[this.outro.length-1];let e=this.lastChunk;do{if(e.outro.length)return e.outro[e.outro.length-1];if(e.content.length)return e.content[e.content.length-1];if(e.intro.length)return e.intro[e.intro.length-1]}while(e=e.previous);if(this.intro.length)return this.intro[this.intro.length-1];return""}lastLine(){let e=this.outro.lastIndexOf(hs);if(e!==-1)return this.outro.substr(e+1);let t=this.outro;let i=this.lastChunk;do{if(i.outro.length>0){e=i.outro.lastIndexOf(hs);if(e!==-1)return i.outro.substr(e+1)+t;t=i.outro+t}if(i.content.length>0){e=i.content.lastIndexOf(hs);if(e!==-1)return i.content.substr(e+1)+t;t=i.content+t}if(i.intro.length>0){e=i.intro.lastIndexOf(hs);if(e!==-1)return i.intro.substr(e+1)+t;t=i.intro+t}}while(i=i.previous);e=this.intro.lastIndexOf(hs);if(e!==-1)return this.intro.substr(e+1)+t;return this.intro+t}slice(e=0,t=this.original.length){while(e<0)e+=this.original.length;while(t<0)t+=this.original.length;let i="";let s=this.firstChunk;while(s&&(s.start>e||s.end<=e)){if(s.start<t&&s.end>=t){return i}s=s.next}if(s&&s.edited&&s.start!==e)throw new Error(`Cannot use replaced character ${e} as slice start anchor.`);const n=s;while(s){if(s.intro&&(n!==s||s.start===e)){i+=s.intro}const r=s.start<t&&s.end>=t;if(r&&s.edited&&s.end!==t)throw new Error(`Cannot use replaced character ${t} as slice end anchor.`);const o=n===s?e-s.start:0;const l=r?s.content.length+t-s.end:s.content.length;i+=s.content.slice(o,l);if(s.outro&&(!r||s.end===t)){i+=s.outro}if(r){break}s=s.next}return i}snip(e,t){const i=this.clone();i.remove(0,e);i.remove(t,i.original.length);return i}_split(e){if(this.byStart[e]||this.byEnd[e])return;let t=this.lastSearchedChunk;const i=e>t.end;while(t){if(t.contains(e))return this._splitChunk(t,e);t=i?this.byStart[t.end]:this.byEnd[t.start]}}_splitChunk(e,t){if(e.edited&&e.content.length){const i=getLocator(this.original)(t);throw new Error(`Cannot split a chunk that has already been edited (${i.line}:${i.column} – "${e.original}")`)}const i=e.split(t);this.byEnd[t]=e;this.byStart[t]=i;this.byEnd[i.end]=i;if(e===this.lastChunk)this.lastChunk=i;this.lastSearchedChunk=e;return true}toString(){let e=this.intro;let t=this.firstChunk;while(t){e+=t.toString();t=t.next}return e+this.outro}isEmpty(){let e=this.firstChunk;do{if(e.intro.length&&e.intro.trim()||e.content.length&&e.content.trim()||e.outro.length&&e.outro.trim())return false}while(e=e.next);return true}length(){let e=this.firstChunk;let t=0;do{t+=e.intro.length+e.content.length+e.outro.length}while(e=e.next);return t}trimLines(){return this.trim("[\\r\\n]")}trim(e){return this.trimStart(e).trimEnd(e)}trimEndAborted(e){const t=new RegExp((e||"\\s")+"+$");this.outro=this.outro.replace(t,"");if(this.outro.length)return true;let i=this.lastChunk;do{const e=i.end;const s=i.trimEnd(t);if(i.end!==e){if(this.lastChunk===i){this.lastChunk=i.next}this.byEnd[i.end]=i;this.byStart[i.next.start]=i.next;this.byEnd[i.next.end]=i.next}if(s)return true;i=i.previous}while(i);return false}trimEnd(e){this.trimEndAborted(e);return this}trimStartAborted(e){const t=new RegExp("^"+(e||"\\s")+"+");this.intro=this.intro.replace(t,"");if(this.intro.length)return true;let i=this.firstChunk;do{const e=i.end;const s=i.trimStart(t);if(i.end!==e){if(i===this.lastChunk)this.lastChunk=i.next;this.byEnd[i.end]=i;this.byStart[i.next.start]=i.next;this.byEnd[i.next.end]=i.next}if(s)return true;i=i.next}while(i);return false}trimStart(e){this.trimStartAborted(e);return this}hasChanged(){return this.original!==this.toString()}_replaceRegexp(e,t){function getReplacement(e,i){if(typeof t==="string"){return t.replace(/\$(\$|&|\d+)/g,((t,i)=>{if(i==="$")return"$";if(i==="&")return e[0];const s=+i;if(s<e.length)return e[+i];return`$${i}`}))}else{return t(...e,e.index,i,e.groups)}}function matchAll(e,t){let i;const s=[];while(i=e.exec(t)){s.push(i)}return s}if(e.global){const t=matchAll(e,this.original);t.forEach((e=>{if(e.index!=null)this.overwrite(e.index,e.index+e[0].length,getReplacement(e,this.original))}))}else{const t=this.original.match(e);if(t&&t.index!=null)this.overwrite(t.index,t.index+t[0].length,getReplacement(t,this.original))}return this}_replaceString(e,t){const{original:i}=this;const s=i.indexOf(e);if(s!==-1){this.overwrite(s,s+e.length,t)}return this}replace(e,t){if(typeof e==="string"){return this._replaceString(e,t)}return this._replaceRegexp(e,t)}_replaceAllString(e,t){const{original:i}=this;const s=e.length;for(let n=i.indexOf(e);n!==-1;n=i.indexOf(e,n+s)){this.overwrite(n,n+s,t)}return this}replaceAll(e,t){if(typeof e==="string"){return this._replaceAllString(e,t)}if(!e.global){throw new TypeError("MagicString.prototype.replaceAll called with a non-global RegExp argument")}return this._replaceRegexp(e,t)}}const ps=Object.prototype.hasOwnProperty;let fs=class Bundle{constructor(e={}){this.intro=e.intro||"";this.separator=e.separator!==undefined?e.separator:"\n";this.sources=[];this.uniqueSources=[];this.uniqueSourceIndexByFilename={}}addSource(e){if(e instanceof MagicString){return this.addSource({content:e,filename:e.filename,separator:this.separator})}if(!isObject$1(e)||!e.content){throw new Error("bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`")}["filename","ignoreList","indentExclusionRanges","separator"].forEach((t=>{if(!ps.call(e,t))e[t]=e.content[t]}));if(e.separator===undefined){e.separator=this.separator}if(e.filename){if(!ps.call(this.uniqueSourceIndexByFilename,e.filename)){this.uniqueSourceIndexByFilename[e.filename]=this.uniqueSources.length;this.uniqueSources.push({filename:e.filename,content:e.content.original})}else{const t=this.uniqueSources[this.uniqueSourceIndexByFilename[e.filename]];if(e.content.original!==t.content){throw new Error(`Illegal source: same filename (${e.filename}), different contents`)}}}this.sources.push(e);return this}append(e,t){this.addSource({content:new MagicString(e),separator:t&&t.separator||""});return this}clone(){const e=new Bundle({intro:this.intro,separator:this.separator});this.sources.forEach((t=>{e.addSource({filename:t.filename,content:t.content.clone(),separator:t.separator})}));return e}generateDecodedMap(e={}){const t=[];let i=undefined;this.sources.forEach((e=>{Object.keys(e.content.storedNames).forEach((e=>{if(!~t.indexOf(e))t.push(e)}))}));const s=new Mappings(e.hires);if(this.intro){s.advance(this.intro)}this.sources.forEach(((e,n)=>{if(n>0){s.advance(this.separator)}const r=e.filename?this.uniqueSourceIndexByFilename[e.filename]:-1;const o=e.content;const l=getLocator(o.original);if(o.intro){s.advance(o.intro)}o.firstChunk.eachNext((i=>{const n=l(i.start);if(i.intro.length)s.advance(i.intro);if(e.filename){if(i.edited){s.addEdit(r,i.content,n,i.storeName?t.indexOf(i.original):-1)}else{s.addUneditedChunk(r,i,o.original,n,o.sourcemapLocations)}}else{s.advance(i.content)}if(i.outro.length)s.advance(i.outro)}));if(o.outro){s.advance(o.outro)}if(e.ignoreList&&r!==-1){if(i===undefined){i=[]}i.push(r)}}));return{file:e.file?e.file.split(/[/\\]/).pop():undefined,sources:this.uniqueSources.map((t=>e.file?getRelativePath(e.file,t.filename):t.filename)),sourcesContent:this.uniqueSources.map((t=>e.includeContent?t.content:null)),names:t,mappings:s.raw,x_google_ignoreList:i}}generateMap(e){return new SourceMap(this.generateDecodedMap(e))}getIndentString(){const e={};this.sources.forEach((t=>{const i=t.content._getRawIndentString();if(i===null)return;if(!e[i])e[i]=0;e[i]+=1}));return Object.keys(e).sort(((t,i)=>e[t]-e[i]))[0]||"\t"}indent(e){if(!arguments.length){e=this.getIndentString()}if(e==="")return this;let t=!this.intro||this.intro.slice(-1)==="\n";this.sources.forEach(((i,s)=>{const n=i.separator!==undefined?i.separator:this.separator;const r=t||s>0&&/\r?\n$/.test(n);i.content.indent(e,{exclude:i.indentExclusionRanges,indentStart:r});t=i.content.lastChar()==="\n"}));if(this.intro){this.intro=e+this.intro.replace(/^[^\n]/gm,((t,i)=>i>0?e+t:t))}return this}prepend(e){this.intro=e+this.intro;return this}toString(){const e=this.sources.map(((e,t)=>{const i=e.separator!==undefined?e.separator:this.separator;const s=(t>0?i:"")+e.content.toString();return s})).join("");return this.intro+e}isEmpty(){if(this.intro.length&&this.intro.trim())return false;if(this.sources.some((e=>!e.content.isEmpty())))return false;return true}length(){return this.sources.reduce(((e,t)=>e+t.content.length()),this.intro.length)}trimLines(){return this.trim("[\\r\\n]")}trim(e){return this.trimStart(e).trimEnd(e)}trimStart(e){const t=new RegExp("^"+(e||"\\s")+"+");this.intro=this.intro.replace(t,"");if(!this.intro){let t;let i=0;do{t=this.sources[i++];if(!t){break}}while(!t.content.trimStartAborted(e))}return this}trimEnd(e){const t=new RegExp((e||"\\s")+"+$");let i;let s=this.sources.length-1;do{i=this.sources[s--];if(!i){this.intro=this.intro.replace(t,"");break}}while(!i.content.trimEndAborted(e));return this}};const ms=/[\n\r'\\\u2028\u2029]/;const gs=/([\n\r'\u2028\u2029])/g;const ys=/\\/g;function escapeId(e){if(!ms.test(e))return e;return e.replace(ys,"\\\\").replace(gs,"\\$1")}class ExternalChunk{constructor(e,t,i){this.options=t;this.inputBase=i;this.defaultVariableName="";this.namespaceVariableName="";this.variableName="";this.fileName=null;this.importAssertions=null;this.id=e.id;this.moduleInfo=e.info;this.renormalizeRenderPath=e.renormalizeRenderPath;this.suggestedVariableName=e.suggestedVariableName}getFileName(){if(this.fileName){return this.fileName}const{paths:e}=this.options;return this.fileName=(typeof e==="function"?e(this.id):e[this.id])||(this.renormalizeRenderPath?normalize(r.relative(this.inputBase,this.id)):this.id)}getImportAssertions(e){return this.importAssertions||(this.importAssertions=formatAssertions(this.options.format==="es"&&this.options.externalImportAssertions&&this.moduleInfo.assertions,e))}getImportPath(e){return escapeId(this.renormalizeRenderPath?getImportPath(e,this.getFileName(),this.options.format==="amd",false):this.getFileName())}}function formatAssertions(e,{getObject:t}){if(!e){return null}const i=Object.entries(e).map((([e,t])=>[e,`'${t}'`]));if(i.length>0){return t(i,{lineBreakIndent:null})}return null}const Es=Symbol("Unknown Key");const xs=Symbol("Unknown Non-Accessor Key");const bs=Symbol("Unknown Integer");const vs=Symbol("Symbol.toStringTag");const Ss=[];const As=[Es];const ws=[xs];const Is=[bs];const Cs=Symbol("Entities");class PathTracker{constructor(){this.entityPaths=Object.create(null,{[Cs]:{value:new Set}})}trackEntityAtPathAndGetIfTracked(e,t){const i=this.getEntities(e);if(i.has(t))return true;i.add(t);return false}withTrackedEntityAtPath(e,t,i,s){const n=this.getEntities(e);if(n.has(t))return s;n.add(t);const r=i();n.delete(t);return r}getEntities(e){let t=this.entityPaths;for(const i of e){t=t[i]=t[i]||Object.create(null,{[Cs]:{value:new Set}})}return t[Cs]}}const ks=new PathTracker;class DiscriminatedPathTracker{constructor(){this.entityPaths=Object.create(null,{[Cs]:{value:new Map}})}trackEntityAtPathAndGetIfTracked(e,t,i){let s=this.entityPaths;for(const t of e){s=s[t]=s[t]||Object.create(null,{[Cs]:{value:new Map}})}const n=getOrCreate(s[Cs],t,getNewSet);if(n.has(i))return true;n.add(i);return false}}const _s=Symbol("Unknown Value");const Ps=Symbol("Unknown Truthy Value");class ExpressionEntity{constructor(){this.included=false}deoptimizeArgumentsOnInteractionAtPath(e,t,i){deoptimizeInteraction(e)}deoptimizePath(e){}getLiteralValueAtPath(e,t,i){return _s}getReturnExpressionWhenCalledAtPath(e,t,i,s){return Rs}hasEffectsOnInteractionAtPath(e,t,i){return true}include(e,t,i){this.included=true}includeCallArguments(e,t){for(const i of t){i.include(e,false)}}shouldBeIncluded(e){return true}}const Ns=new class UnknownExpression extends ExpressionEntity{};const Rs=[Ns,false];const deoptimizeInteraction=e=>{for(const t of e.args){t?.deoptimizePath(As)}};const $s=0;const Os=1;const Ts=2;const Ds={args:[null],type:$s};const Ms={args:[null,Ns],type:Os};const Ls={args:[null],type:Ts,withNew:false};class Variable extends ExpressionEntity{constructor(e){super();this.name=e;this.alwaysRendered=false;this.forbiddenNames=null;this.initReached=false;this.isId=false;this.isReassigned=false;this.kind=null;this.renderBaseName=null;this.renderName=null}addReference(e){}forbidName(e){(this.forbiddenNames||(this.forbiddenNames=new Set)).add(e)}getBaseVariableName(){return this.renderBaseName||this.renderName||this.name}getName(e,t){if(t?.(this)){return this.name}const i=this.renderName||this.name;return this.renderBaseName?`${this.renderBaseName}${e(i)}`:i}hasEffectsOnInteractionAtPath(e,{type:t},i){return t!==$s||e.length>0}include(){this.included=true}markCalledFromTryStatement(){}setRenderNames(e,t){this.renderBaseName=e;this.renderName=t}}class ExternalVariable extends Variable{constructor(e,t){super(t);this.referenced=false;this.module=e;this.isNamespace=t==="*"}addReference(e){this.referenced=true;if(this.name==="default"||this.name==="*"){this.module.suggestName(e.name)}}hasEffectsOnInteractionAtPath(e,{type:t}){return t!==$s||e.length>(this.isNamespace?1:0)}include(){if(!this.included){this.included=true;this.module.used=true}}}const Bs=new Set(["await","break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","eval","export","extends","false","finally","for","function","if","implements","import","in","instanceof","interface","let","NaN","new","null","package","private","protected","public","return","static","super","switch","this","throw","true","try","typeof","undefined","var","void","while","with","yield"]);const Fs=Bs;const Vs=/[^\w$]/g;const startsWithDigit=e=>/\d/.test(e[0]);const needsEscape=e=>startsWithDigit(e)||Fs.has(e)||e==="arguments";function isLegal(e){if(needsEscape(e)){return false}return!Vs.test(e)}function makeLegal(e){e=e.replace(/-(\w)/g,((e,t)=>t.toUpperCase())).replace(Vs,"_");if(needsEscape(e))e=`_${e}`;return e||"_"}class ExternalModule{constructor(e,t,i,s,n,r){this.options=e;this.id=t;this.renormalizeRenderPath=n;this.dynamicImporters=[];this.execIndex=Infinity;this.exportedVariables=new Map;this.importers=[];this.reexported=false;this.used=false;this.declarations=new Map;this.mostCommonSuggestion=0;this.nameSuggestions=new Map;this.suggestedVariableName=makeLegal(t.split(/[/\\]/).pop());const{importers:o,dynamicImporters:l}=this;const c=this.info={assertions:r,ast:null,code:null,dynamicallyImportedIdResolutions:Vt,dynamicallyImportedIds:Vt,get dynamicImporters(){return l.sort()},exportedBindings:null,exports:null,hasDefaultExport:null,get hasModuleSideEffects(){warnDeprecation("Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.",ce,true,e);return c.moduleSideEffects},id:t,implicitlyLoadedAfterOneOf:Vt,implicitlyLoadedBefore:Vt,importedIdResolutions:Vt,importedIds:Vt,get importers(){return o.sort()},isEntry:false,isExternal:true,isIncluded:null,meta:s,moduleSideEffects:i,syntheticNamedExports:false};Object.defineProperty(this.info,"hasModuleSideEffects",{enumerable:false})}getVariableForExportName(e){const t=this.declarations.get(e);if(t)return[t];const i=new ExternalVariable(this,e);this.declarations.set(e,i);this.exportedVariables.set(i,e);return[i]}suggestName(e){const t=(this.nameSuggestions.get(e)??0)+1;this.nameSuggestions.set(e,t);if(t>this.mostCommonSuggestion){this.mostCommonSuggestion=t;this.suggestedVariableName=e}}warnUnusedImports(){const e=[...this.declarations].filter((([e,t])=>e!=="*"&&!t.included&&!this.reexported&&!t.referenced)).map((([e])=>e));if(e.length===0)return;const t=new Set;for(const i of e){for(const e of this.declarations.get(i).module.importers){t.add(e)}}const i=[...t];this.options.onLog(v,logUnusedExternalImports(this.id,e,i))}}function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}function getAugmentedNamespace(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var i=function a(){if(this instanceof a){return Reflect.construct(t,arguments,this.constructor)}return t.apply(this,arguments)};i.prototype=t.prototype}else i={};Object.defineProperty(i,"__esModule",{value:true});Object.keys(e).forEach((function(t){var s=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(i,t,s.get?s:{enumerable:true,get:function(){return e[t]}})}));return i}var zs={};const js=o;const Us="\\\\/";const Hs=`[^${Us}]`;const Gs="\\.";const Ws="\\+";const qs="\\?";const Ks="\\/";const Ys="(?=.)";const Qs="[^/]";const Xs=`(?:${Ks}|$)`;const Zs=`(?:^|${Ks})`;const Js=`${Gs}{1,2}${Xs}`;const en=`(?!${Gs})`;const tn=`(?!${Zs}${Js})`;const sn=`(?!${Gs}{0,1}${Xs})`;const nn=`(?!${Js})`;const rn=`[^.${Ks}]`;const on=`${Qs}*?`;const an={DOT_LITERAL:Gs,PLUS_LITERAL:Ws,QMARK_LITERAL:qs,SLASH_LITERAL:Ks,ONE_CHAR:Ys,QMARK:Qs,END_ANCHOR:Xs,DOTS_SLASH:Js,NO_DOT:en,NO_DOTS:tn,NO_DOT_SLASH:sn,NO_DOTS_SLASH:nn,QMARK_NO_DOT:rn,STAR:on,START_ANCHOR:Zs};const ln={...an,SLASH_LITERAL:`[${Us}]`,QMARK:Hs,STAR:`${Hs}*?`,DOTS_SLASH:`${Gs}{1,2}(?:[${Us}]|$)`,NO_DOT:`(?!${Gs})`,NO_DOTS:`(?!(?:^|[${Us}])${Gs}{1,2}(?:[${Us}]|$))`,NO_DOT_SLASH:`(?!${Gs}{0,1}(?:[${Us}]|$))`,NO_DOTS_SLASH:`(?!${Gs}{1,2}(?:[${Us}]|$))`,QMARK_NO_DOT:`[^.${Us}]`,START_ANCHOR:`(?:^|[${Us}])`,END_ANCHOR:`(?:[${Us}]|$)`};const cn={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"};var un={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:cn,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:js.sep,extglobChars(e){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(e){return e===true?ln:an}};(function(e){const t=o;const i=process.platform==="win32";const{REGEX_BACKSLASH:s,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:l}=un;e.isObject=e=>e!==null&&typeof e==="object"&&!Array.isArray(e);e.hasRegexChars=e=>r.test(e);e.isRegexChar=t=>t.length===1&&e.hasRegexChars(t);e.escapeRegex=e=>e.replace(l,"\\$1");e.toPosixSlashes=e=>e.replace(s,"/");e.removeBackslashes=e=>e.replace(n,(e=>e==="\\"?"":e));e.supportsLookbehinds=()=>{const e=process.version.slice(1).split(".").map(Number);if(e.length===3&&e[0]>=9||e[0]===8&&e[1]>=10){return true}return false};e.isWindows=e=>{if(e&&typeof e.windows==="boolean"){return e.windows}return i===true||t.sep==="\\"};e.escapeLast=(t,i,s)=>{const n=t.lastIndexOf(i,s);if(n===-1)return t;if(t[n-1]==="\\")return e.escapeLast(t,i,n-1);return`${t.slice(0,n)}\\${t.slice(n)}`};e.removePrefix=(e,t={})=>{let i=e;if(i.startsWith("./")){i=i.slice(2);t.prefix="./"}return i};e.wrapOutput=(e,t={},i={})=>{const s=i.contains?"":"^";const n=i.contains?"":"$";let r=`${s}(?:${e})${n}`;if(t.negated===true){r=`(?:^(?!${r}).*$)`}return r}})(zs);const hn=zs;const{CHAR_ASTERISK:dn,CHAR_AT:pn,CHAR_BACKWARD_SLASH:fn,CHAR_COMMA:mn,CHAR_DOT:gn,CHAR_EXCLAMATION_MARK:yn,CHAR_FORWARD_SLASH:En,CHAR_LEFT_CURLY_BRACE:xn,CHAR_LEFT_PARENTHESES:bn,CHAR_LEFT_SQUARE_BRACKET:vn,CHAR_PLUS:Sn,CHAR_QUESTION_MARK:An,CHAR_RIGHT_CURLY_BRACE:wn,CHAR_RIGHT_PARENTHESES:In,CHAR_RIGHT_SQUARE_BRACKET:Cn}=un;const isPathSeparator=e=>e===En||e===fn;const depth=e=>{if(e.isPrefix!==true){e.depth=e.isGlobstar?Infinity:1}};const scan$1=(e,t)=>{const i=t||{};const s=e.length-1;const n=i.parts===true||i.scanToEnd===true;const r=[];const o=[];const l=[];let c=e;let u=-1;let h=0;let d=0;let p=false;let f=false;let m=false;let g=false;let y=false;let E=false;let x=false;let b=false;let v=false;let S=false;let A=0;let w;let I;let C={value:"",depth:0,isGlob:false};const eos=()=>u>=s;const peek=()=>c.charCodeAt(u+1);const advance=()=>{w=I;return c.charCodeAt(++u)};while(u<s){I=advance();let e;if(I===fn){x=C.backslashes=true;I=advance();if(I===xn){E=true}continue}if(E===true||I===xn){A++;while(eos()!==true&&(I=advance())){if(I===fn){x=C.backslashes=true;advance();continue}if(I===xn){A++;continue}if(E!==true&&I===gn&&(I=advance())===gn){p=C.isBrace=true;m=C.isGlob=true;S=true;if(n===true){continue}break}if(E!==true&&I===mn){p=C.isBrace=true;m=C.isGlob=true;S=true;if(n===true){continue}break}if(I===wn){A--;if(A===0){E=false;p=C.isBrace=true;S=true;break}}}if(n===true){continue}break}if(I===En){r.push(u);o.push(C);C={value:"",depth:0,isGlob:false};if(S===true)continue;if(w===gn&&u===h+1){h+=2;continue}d=u+1;continue}if(i.noext!==true){const e=I===Sn||I===pn||I===dn||I===An||I===yn;if(e===true&&peek()===bn){m=C.isGlob=true;g=C.isExtglob=true;S=true;if(I===yn&&u===h){v=true}if(n===true){while(eos()!==true&&(I=advance())){if(I===fn){x=C.backslashes=true;I=advance();continue}if(I===In){m=C.isGlob=true;S=true;break}}continue}break}}if(I===dn){if(w===dn)y=C.isGlobstar=true;m=C.isGlob=true;S=true;if(n===true){continue}break}if(I===An){m=C.isGlob=true;S=true;if(n===true){continue}break}if(I===vn){while(eos()!==true&&(e=advance())){if(e===fn){x=C.backslashes=true;advance();continue}if(e===Cn){f=C.isBracket=true;m=C.isGlob=true;S=true;break}}if(n===true){continue}break}if(i.nonegate!==true&&I===yn&&u===h){b=C.negated=true;h++;continue}if(i.noparen!==true&&I===bn){m=C.isGlob=true;if(n===true){while(eos()!==true&&(I=advance())){if(I===bn){x=C.backslashes=true;I=advance();continue}if(I===In){S=true;break}}continue}break}if(m===true){S=true;if(n===true){continue}break}}if(i.noext===true){g=false;m=false}let k=c;let _="";let P="";if(h>0){_=c.slice(0,h);c=c.slice(h);d-=h}if(k&&m===true&&d>0){k=c.slice(0,d);P=c.slice(d)}else if(m===true){k="";P=c}else{k=c}if(k&&k!==""&&k!=="/"&&k!==c){if(isPathSeparator(k.charCodeAt(k.length-1))){k=k.slice(0,-1)}}if(i.unescape===true){if(P)P=hn.removeBackslashes(P);if(k&&x===true){k=hn.removeBackslashes(k)}}const N={prefix:_,input:e,start:h,base:k,glob:P,isBrace:p,isBracket:f,isGlob:m,isExtglob:g,isGlobstar:y,negated:b,negatedExtglob:v};if(i.tokens===true){N.maxDepth=0;if(!isPathSeparator(I)){o.push(C)}N.tokens=o}if(i.parts===true||i.tokens===true){let t;for(let s=0;s<r.length;s++){const n=t?t+1:h;const c=r[s];const u=e.slice(n,c);if(i.tokens){if(s===0&&h!==0){o[s].isPrefix=true;o[s].value=_}else{o[s].value=u}depth(o[s]);N.maxDepth+=o[s].depth}if(s!==0||u!==""){l.push(u)}t=c}if(t&&t+1<e.length){const s=e.slice(t+1);l.push(s);if(i.tokens){o[o.length-1].value=s;depth(o[o.length-1]);N.maxDepth+=o[o.length-1].depth}}N.slashes=r;N.parts=l}return N};var kn=scan$1;const _n=un;const Pn=zs;const{MAX_LENGTH:Nn,POSIX_REGEX_SOURCE:Rn,REGEX_NON_SPECIAL_CHARS:$n,REGEX_SPECIAL_CHARS_BACKREF:On,REPLACEMENTS:Tn}=_n;const expandRange=(e,t)=>{if(typeof t.expandRange==="function"){return t.expandRange(...e,t)}e.sort();const i=`[${e.join("-")}]`;return i};const syntaxError=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`;const parse$2=(e,t)=>{if(typeof e!=="string"){throw new TypeError("Expected a string")}e=Tn[e]||e;const i={...t};const s=typeof i.maxLength==="number"?Math.min(Nn,i.maxLength):Nn;let n=e.length;if(n>s){throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${s}`)}const r={type:"bos",value:"",output:i.prepend||""};const o=[r];const l=i.capture?"":"?:";const c=Pn.isWindows(t);const u=_n.globChars(c);const h=_n.extglobChars(u);const{DOT_LITERAL:d,PLUS_LITERAL:p,SLASH_LITERAL:f,ONE_CHAR:m,DOTS_SLASH:g,NO_DOT:y,NO_DOT_SLASH:E,NO_DOTS_SLASH:x,QMARK:b,QMARK_NO_DOT:v,STAR:S,START_ANCHOR:A}=u;const globstar=e=>`(${l}(?:(?!${A}${e.dot?g:d}).)*?)`;const w=i.dot?"":y;const I=i.dot?b:v;let C=i.bash===true?globstar(i):S;if(i.capture){C=`(${C})`}if(typeof i.noext==="boolean"){i.noextglob=i.noext}const k={input:e,index:-1,start:0,dot:i.dot===true,consumed:"",output:"",prefix:"",backtrack:false,negated:false,brackets:0,braces:0,parens:0,quotes:0,globstar:false,tokens:o};e=Pn.removePrefix(e,k);n=e.length;const _=[];const P=[];const N=[];let R=r;let $;const eos=()=>k.index===n-1;const O=k.peek=(t=1)=>e[k.index+t];const T=k.advance=()=>e[++k.index]||"";const remaining=()=>e.slice(k.index+1);const consume=(e="",t=0)=>{k.consumed+=e;k.index+=t};const append=e=>{k.output+=e.output!=null?e.output:e.value;consume(e.value)};const negate=()=>{let e=1;while(O()==="!"&&(O(2)!=="("||O(3)==="?")){T();k.start++;e++}if(e%2===0){return false}k.negated=true;k.start++;return true};const increment=e=>{k[e]++;N.push(e)};const decrement=e=>{k[e]--;N.pop()};const push=e=>{if(R.type==="globstar"){const t=k.braces>0&&(e.type==="comma"||e.type==="brace");const i=e.extglob===true||_.length&&(e.type==="pipe"||e.type==="paren");if(e.type!=="slash"&&e.type!=="paren"&&!t&&!i){k.output=k.output.slice(0,-R.output.length);R.type="star";R.value="*";R.output=C;k.output+=R.output}}if(_.length&&e.type!=="paren"){_[_.length-1].inner+=e.value}if(e.value||e.output)append(e);if(R&&R.type==="text"&&e.type==="text"){R.value+=e.value;R.output=(R.output||"")+e.value;return}e.prev=R;o.push(e);R=e};const extglobOpen=(e,t)=>{const s={...h[t],conditions:1,inner:""};s.prev=R;s.parens=k.parens;s.output=k.output;const n=(i.capture?"(":"")+s.open;increment("parens");push({type:e,value:t,output:k.output?"":m});push({type:"paren",extglob:true,value:T(),output:n});_.push(s)};const extglobClose=e=>{let s=e.close+(i.capture?")":"");let n;if(e.type==="negate"){let r=C;if(e.inner&&e.inner.length>1&&e.inner.includes("/")){r=globstar(i)}if(r!==C||eos()||/^\)+$/.test(remaining())){s=e.close=`)$))${r}`}if(e.inner.includes("*")&&(n=remaining())&&/^\.[^\\/.]+$/.test(n)){const i=parse$2(n,{...t,fastpaths:false}).output;s=e.close=`)${i})${r})`}if(e.prev.type==="bos"){k.negatedExtglob=true}}push({type:"paren",extglob:true,value:$,output:s});decrement("parens")};if(i.fastpaths!==false&&!/(^[*!]|[/()[\]{}"])/.test(e)){let s=false;let n=e.replace(On,((e,t,i,n,r,o)=>{if(n==="\\"){s=true;return e}if(n==="?"){if(t){return t+n+(r?b.repeat(r.length):"")}if(o===0){return I+(r?b.repeat(r.length):"")}return b.repeat(i.length)}if(n==="."){return d.repeat(i.length)}if(n==="*"){if(t){return t+n+(r?C:"")}return C}return t?e:`\\${e}`}));if(s===true){if(i.unescape===true){n=n.replace(/\\/g,"")}else{n=n.replace(/\\+/g,(e=>e.length%2===0?"\\\\":e?"\\":""))}}if(n===e&&i.contains===true){k.output=e;return k}k.output=Pn.wrapOutput(n,k,t);return k}while(!eos()){$=T();if($==="\0"){continue}if($==="\\"){const e=O();if(e==="/"&&i.bash!==true){continue}if(e==="."||e===";"){continue}if(!e){$+="\\";push({type:"text",value:$});continue}const t=/^\\+/.exec(remaining());let s=0;if(t&&t[0].length>2){s=t[0].length;k.index+=s;if(s%2!==0){$+="\\"}}if(i.unescape===true){$=T()}else{$+=T()}if(k.brackets===0){push({type:"text",value:$});continue}}if(k.brackets>0&&($!=="]"||R.value==="["||R.value==="[^")){if(i.posix!==false&&$===":"){const e=R.value.slice(1);if(e.includes("[")){R.posix=true;if(e.includes(":")){const e=R.value.lastIndexOf("[");const t=R.value.slice(0,e);const i=R.value.slice(e+2);const s=Rn[i];if(s){R.value=t+s;k.backtrack=true;T();if(!r.output&&o.indexOf(R)===1){r.output=m}continue}}}}if($==="["&&O()!==":"||$==="-"&&O()==="]"){$=`\\${$}`}if($==="]"&&(R.value==="["||R.value==="[^")){$=`\\${$}`}if(i.posix===true&&$==="!"&&R.value==="["){$="^"}R.value+=$;append({value:$});continue}if(k.quotes===1&&$!=='"'){$=Pn.escapeRegex($);R.value+=$;append({value:$});continue}if($==='"'){k.quotes=k.quotes===1?0:1;if(i.keepQuotes===true){push({type:"text",value:$})}continue}if($==="("){increment("parens");push({type:"paren",value:$});continue}if($===")"){if(k.parens===0&&i.strictBrackets===true){throw new SyntaxError(syntaxError("opening","("))}const e=_[_.length-1];if(e&&k.parens===e.parens+1){extglobClose(_.pop());continue}push({type:"paren",value:$,output:k.parens?")":"\\)"});decrement("parens");continue}if($==="["){if(i.nobracket===true||!remaining().includes("]")){if(i.nobracket!==true&&i.strictBrackets===true){throw new SyntaxError(syntaxError("closing","]"))}$=`\\${$}`}else{increment("brackets")}push({type:"bracket",value:$});continue}if($==="]"){if(i.nobracket===true||R&&R.type==="bracket"&&R.value.length===1){push({type:"text",value:$,output:`\\${$}`});continue}if(k.brackets===0){if(i.strictBrackets===true){throw new SyntaxError(syntaxError("opening","["))}push({type:"text",value:$,output:`\\${$}`});continue}decrement("brackets");const e=R.value.slice(1);if(R.posix!==true&&e[0]==="^"&&!e.includes("/")){$=`/${$}`}R.value+=$;append({value:$});if(i.literalBrackets===false||Pn.hasRegexChars(e)){continue}const t=Pn.escapeRegex(R.value);k.output=k.output.slice(0,-R.value.length);if(i.literalBrackets===true){k.output+=t;R.value=t;continue}R.value=`(${l}${t}|${R.value})`;k.output+=R.value;continue}if($==="{"&&i.nobrace!==true){increment("braces");const e={type:"brace",value:$,output:"(",outputIndex:k.output.length,tokensIndex:k.tokens.length};P.push(e);push(e);continue}if($==="}"){const e=P[P.length-1];if(i.nobrace===true||!e){push({type:"text",value:$,output:$});continue}let t=")";if(e.dots===true){const e=o.slice();const s=[];for(let t=e.length-1;t>=0;t--){o.pop();if(e[t].type==="brace"){break}if(e[t].type!=="dots"){s.unshift(e[t].value)}}t=expandRange(s,i);k.backtrack=true}if(e.comma!==true&&e.dots!==true){const i=k.output.slice(0,e.outputIndex);const s=k.tokens.slice(e.tokensIndex);e.value=e.output="\\{";$=t="\\}";k.output=i;for(const e of s){k.output+=e.output||e.value}}push({type:"brace",value:$,output:t});decrement("braces");P.pop();continue}if($==="|"){if(_.length>0){_[_.length-1].conditions++}push({type:"text",value:$});continue}if($===","){let e=$;const t=P[P.length-1];if(t&&N[N.length-1]==="braces"){t.comma=true;e="|"}push({type:"comma",value:$,output:e});continue}if($==="/"){if(R.type==="dot"&&k.index===k.start+1){k.start=k.index+1;k.consumed="";k.output="";o.pop();R=r;continue}push({type:"slash",value:$,output:f});continue}if($==="."){if(k.braces>0&&R.type==="dot"){if(R.value===".")R.output=d;const e=P[P.length-1];R.type="dots";R.output+=$;R.value+=$;e.dots=true;continue}if(k.braces+k.parens===0&&R.type!=="bos"&&R.type!=="slash"){push({type:"text",value:$,output:d});continue}push({type:"dot",value:$,output:d});continue}if($==="?"){const e=R&&R.value==="(";if(!e&&i.noextglob!==true&&O()==="("&&O(2)!=="?"){extglobOpen("qmark",$);continue}if(R&&R.type==="paren"){const e=O();let t=$;if(e==="<"&&!Pn.supportsLookbehinds()){throw new Error("Node.js v10 or higher is required for regex lookbehinds")}if(R.value==="("&&!/[!=<:]/.test(e)||e==="<"&&!/<([!=]|\w+>)/.test(remaining())){t=`\\${$}`}push({type:"text",value:$,output:t});continue}if(i.dot!==true&&(R.type==="slash"||R.type==="bos")){push({type:"qmark",value:$,output:v});continue}push({type:"qmark",value:$,output:b});continue}if($==="!"){if(i.noextglob!==true&&O()==="("){if(O(2)!=="?"||!/[!=<:]/.test(O(3))){extglobOpen("negate",$);continue}}if(i.nonegate!==true&&k.index===0){negate();continue}}if($==="+"){if(i.noextglob!==true&&O()==="("&&O(2)!=="?"){extglobOpen("plus",$);continue}if(R&&R.value==="("||i.regex===false){push({type:"plus",value:$,output:p});continue}if(R&&(R.type==="bracket"||R.type==="paren"||R.type==="brace")||k.parens>0){push({type:"plus",value:$});continue}push({type:"plus",value:p});continue}if($==="@"){if(i.noextglob!==true&&O()==="("&&O(2)!=="?"){push({type:"at",extglob:true,value:$,output:""});continue}push({type:"text",value:$});continue}if($!=="*"){if($==="$"||$==="^"){$=`\\${$}`}const e=$n.exec(remaining());if(e){$+=e[0];k.index+=e[0].length}push({type:"text",value:$});continue}if(R&&(R.type==="globstar"||R.star===true)){R.type="star";R.star=true;R.value+=$;R.output=C;k.backtrack=true;k.globstar=true;consume($);continue}let t=remaining();if(i.noextglob!==true&&/^\([^?]/.test(t)){extglobOpen("star",$);continue}if(R.type==="star"){if(i.noglobstar===true){consume($);continue}const s=R.prev;const n=s.prev;const r=s.type==="slash"||s.type==="bos";const o=n&&(n.type==="star"||n.type==="globstar");if(i.bash===true&&(!r||t[0]&&t[0]!=="/")){push({type:"star",value:$,output:""});continue}const l=k.braces>0&&(s.type==="comma"||s.type==="brace");const c=_.length&&(s.type==="pipe"||s.type==="paren");if(!r&&s.type!=="paren"&&!l&&!c){push({type:"star",value:$,output:""});continue}while(t.slice(0,3)==="/**"){const i=e[k.index+4];if(i&&i!=="/"){break}t=t.slice(3);consume("/**",3)}if(s.type==="bos"&&eos()){R.type="globstar";R.value+=$;R.output=globstar(i);k.output=R.output;k.globstar=true;consume($);continue}if(s.type==="slash"&&s.prev.type!=="bos"&&!o&&eos()){k.output=k.output.slice(0,-(s.output+R.output).length);s.output=`(?:${s.output}`;R.type="globstar";R.output=globstar(i)+(i.strictSlashes?")":"|$)");R.value+=$;k.globstar=true;k.output+=s.output+R.output;consume($);continue}if(s.type==="slash"&&s.prev.type!=="bos"&&t[0]==="/"){const e=t[1]!==void 0?"|$":"";k.output=k.output.slice(0,-(s.output+R.output).length);s.output=`(?:${s.output}`;R.type="globstar";R.output=`${globstar(i)}${f}|${f}${e})`;R.value+=$;k.output+=s.output+R.output;k.globstar=true;consume($+T());push({type:"slash",value:"/",output:""});continue}if(s.type==="bos"&&t[0]==="/"){R.type="globstar";R.value+=$;R.output=`(?:^|${f}|${globstar(i)}${f})`;k.output=R.output;k.globstar=true;consume($+T());push({type:"slash",value:"/",output:""});continue}k.output=k.output.slice(0,-R.output.length);R.type="globstar";R.output=globstar(i);R.value+=$;k.output+=R.output;k.globstar=true;consume($);continue}const s={type:"star",value:$,output:C};if(i.bash===true){s.output=".*?";if(R.type==="bos"||R.type==="slash"){s.output=w+s.output}push(s);continue}if(R&&(R.type==="bracket"||R.type==="paren")&&i.regex===true){s.output=$;push(s);continue}if(k.index===k.start||R.type==="slash"||R.type==="dot"){if(R.type==="dot"){k.output+=E;R.output+=E}else if(i.dot===true){k.output+=x;R.output+=x}else{k.output+=w;R.output+=w}if(O()!=="*"){k.output+=m;R.output+=m}}push(s)}while(k.brackets>0){if(i.strictBrackets===true)throw new SyntaxError(syntaxError("closing","]"));k.output=Pn.escapeLast(k.output,"[");decrement("brackets")}while(k.parens>0){if(i.strictBrackets===true)throw new SyntaxError(syntaxError("closing",")"));k.output=Pn.escapeLast(k.output,"(");decrement("parens")}while(k.braces>0){if(i.strictBrackets===true)throw new SyntaxError(syntaxError("closing","}"));k.output=Pn.escapeLast(k.output,"{");decrement("braces")}if(i.strictSlashes!==true&&(R.type==="star"||R.type==="bracket")){push({type:"maybe_slash",value:"",output:`${f}?`})}if(k.backtrack===true){k.output="";for(const e of k.tokens){k.output+=e.output!=null?e.output:e.value;if(e.suffix){k.output+=e.suffix}}}return k};parse$2.fastpaths=(e,t)=>{const i={...t};const s=typeof i.maxLength==="number"?Math.min(Nn,i.maxLength):Nn;const n=e.length;if(n>s){throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${s}`)}e=Tn[e]||e;const r=Pn.isWindows(t);const{DOT_LITERAL:o,SLASH_LITERAL:l,ONE_CHAR:c,DOTS_SLASH:u,NO_DOT:h,NO_DOTS:d,NO_DOTS_SLASH:p,STAR:f,START_ANCHOR:m}=_n.globChars(r);const g=i.dot?d:h;const y=i.dot?p:h;const E=i.capture?"":"?:";const x={negated:false,prefix:""};let b=i.bash===true?".*?":f;if(i.capture){b=`(${b})`}const globstar=e=>{if(e.noglobstar===true)return b;return`(${E}(?:(?!${m}${e.dot?u:o}).)*?)`};const create=e=>{switch(e){case"*":return`${g}${c}${b}`;case".*":return`${o}${c}${b}`;case"*.*":return`${g}${b}${o}${c}${b}`;case"*/*":return`${g}${b}${l}${c}${y}${b}`;case"**":return g+globstar(i);case"**/*":return`(?:${g}${globstar(i)}${l})?${y}${c}${b}`;case"**/*.*":return`(?:${g}${globstar(i)}${l})?${y}${b}${o}${c}${b}`;case"**/.*":return`(?:${g}${globstar(i)}${l})?${o}${c}${b}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const i=create(t[1]);if(!i)return;return i+o+t[2]}}};const v=Pn.removePrefix(e,x);let S=create(v);if(S&&i.strictSlashes!==true){S+=`${l}?`}return S};var Dn=parse$2;const Mn=o;const Ln=kn;const Bn=Dn;const Fn=zs;const Vn=un;const isObject=e=>e&&typeof e==="object"&&!Array.isArray(e);const picomatch$1=(e,t,i=false)=>{if(Array.isArray(e)){const s=e.map((e=>picomatch$1(e,t,i)));const arrayMatcher=e=>{for(const t of s){const i=t(e);if(i)return i}return false};return arrayMatcher}const s=isObject(e)&&e.tokens&&e.input;if(e===""||typeof e!=="string"&&!s){throw new TypeError("Expected pattern to be a non-empty string")}const n=t||{};const r=Fn.isWindows(t);const o=s?picomatch$1.compileRe(e,t):picomatch$1.makeRe(e,t,false,true);const l=o.state;delete o.state;let isIgnored=()=>false;if(n.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};isIgnored=picomatch$1(n.ignore,e,i)}const matcher=(i,s=false)=>{const{isMatch:c,match:u,output:h}=picomatch$1.test(i,o,t,{glob:e,posix:r});const d={glob:e,state:l,regex:o,posix:r,input:i,output:h,match:u,isMatch:c};if(typeof n.onResult==="function"){n.onResult(d)}if(c===false){d.isMatch=false;return s?d:false}if(isIgnored(i)){if(typeof n.onIgnore==="function"){n.onIgnore(d)}d.isMatch=false;return s?d:false}if(typeof n.onMatch==="function"){n.onMatch(d)}return s?d:true};if(i){matcher.state=l}return matcher};picomatch$1.test=(e,t,i,{glob:s,posix:n}={})=>{if(typeof e!=="string"){throw new TypeError("Expected input to be a string")}if(e===""){return{isMatch:false,output:""}}const r=i||{};const o=r.format||(n?Fn.toPosixSlashes:null);let l=e===s;let c=l&&o?o(e):e;if(l===false){c=o?o(e):e;l=c===s}if(l===false||r.capture===true){if(r.matchBase===true||r.basename===true){l=picomatch$1.matchBase(e,t,i,n)}else{l=t.exec(c)}}return{isMatch:Boolean(l),match:l,output:c}};picomatch$1.matchBase=(e,t,i,s=Fn.isWindows(i))=>{const n=t instanceof RegExp?t:picomatch$1.makeRe(t,i);return n.test(Mn.basename(e))};picomatch$1.isMatch=(e,t,i)=>picomatch$1(t,i)(e);picomatch$1.parse=(e,t)=>{if(Array.isArray(e))return e.map((e=>picomatch$1.parse(e,t)));return Bn(e,{...t,fastpaths:false})};picomatch$1.scan=(e,t)=>Ln(e,t);picomatch$1.compileRe=(e,t,i=false,s=false)=>{if(i===true){return e.output}const n=t||{};const r=n.contains?"":"^";const o=n.contains?"":"$";let l=`${r}(?:${e.output})${o}`;if(e&&e.negated===true){l=`^(?!${l}).*$`}const c=picomatch$1.toRegex(l,t);if(s===true){c.state=e}return c};picomatch$1.makeRe=(e,t={},i=false,s=false)=>{if(!e||typeof e!=="string"){throw new TypeError("Expected a non-empty string")}let n={negated:false,fastpaths:true};if(t.fastpaths!==false&&(e[0]==="."||e[0]==="*")){n.output=Bn.fastpaths(e,t)}if(!n.output){n=Bn(e,t)}return picomatch$1.compileRe(n,t,i,s)};picomatch$1.toRegex=(e,t)=>{try{const i=t||{};return new RegExp(e,i.flags||(i.nocase?"i":""))}catch(e){if(t&&t.debug===true)throw e;return/$^/}};picomatch$1.constants=Vn;var zn=picomatch$1;var jn=zn;const Un=getDefaultExportFromCjs(jn);const Hn={ArrayPattern(e,t){for(const i of t.elements){if(i)Hn[i.type](e,i)}},AssignmentPattern(e,t){Hn[t.left.type](e,t.left)},Identifier(e,t){e.push(t.name)},MemberExpression(){},ObjectPattern(e,t){for(const i of t.properties){if(i.type==="RestElement"){Hn.RestElement(e,i)}else{Hn[i.value.type](e,i.value)}}},RestElement(e,t){Hn[t.argument.type](e,t.argument)}};const Gn=function extractAssignedNames(e){const t=[];Hn[e.type](t,e);return t};function isArray$1(e){return Array.isArray(e)}function ensureArray(e){if(isArray$1(e))return e;if(e==null)return[];return[e]}const Wn=function normalizePath(e){return e.split(o.win32.sep).join(o.posix.sep)};function getMatcherString(e,t){if(t===false||o.isAbsolute(e)||e.startsWith("**")){return Wn(e)}const i=Wn(o.resolve(t||"")).replace(/[-^$*+?.()|[\]{}]/g,"\\$&");return o.posix.join(i,Wn(e))}const qn=function createFilter(e,t,i){const s=i&&i.resolve;const getMatcher=e=>e instanceof RegExp?e:{test:t=>{const i=getMatcherString(e,s);const n=Un(i,{dot:true});const r=n(t);return r}};const n=ensureArray(e).map(getMatcher);const r=ensureArray(t).map(getMatcher);return function result(e){if(typeof e!=="string")return false;if(/\0/.test(e))return false;const t=Wn(e);for(let e=0;e<r.length;++e){const i=r[e];if(i.test(t))return false}for(let e=0;e<n.length;++e){const i=n[e];if(i.test(t))return true}return!n.length}};const Kn="break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public";const Yn="arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl";const Qn=new Set(`${Kn} ${Yn}`.split(" "));Qn.add("");function createInclusionContext(){return{brokenFlow:false,hasBreak:false,hasContinue:false,includedCallArguments:new Set,includedLabels:new Set}}function createHasEffectsContext(){return{accessed:new PathTracker,assigned:new PathTracker,brokenFlow:false,called:new DiscriminatedPathTracker,hasBreak:false,hasContinue:false,ignore:{breaks:false,continues:false,labels:new Set,returnYield:false,this:false},includedLabels:new Set,instantiated:new DiscriminatedPathTracker,replacedVariableInits:new Map}}function assembleMemberDescriptions(e,t=null){return Object.create(t,e)}const Xn=new class UndefinedExpression extends ExpressionEntity{getLiteralValueAtPath(){return undefined}};const Zn={value:{hasEffectsWhenCalled:null,returns:Ns}};const Jn=new class UnknownBoolean extends ExpressionEntity{getReturnExpressionWhenCalledAtPath(e){if(e.length===1){return getMemberReturnExpressionWhenCalled(ar,e[0])}return Rs}hasEffectsOnInteractionAtPath(e,t,i){if(t.type===$s){return e.length>1}if(t.type===Ts&&e.length===1){return hasMemberEffectWhenCalled(ar,e[0],t,i)}return true}};const er={value:{hasEffectsWhenCalled:null,returns:Jn}};const tr=new class UnknownNumber extends ExpressionEntity{getReturnExpressionWhenCalledAtPath(e){if(e.length===1){return getMemberReturnExpressionWhenCalled(lr,e[0])}return Rs}hasEffectsOnInteractionAtPath(e,t,i){if(t.type===$s){return e.length>1}if(t.type===Ts&&e.length===1){return hasMemberEffectWhenCalled(lr,e[0],t,i)}return true}};const ir={value:{hasEffectsWhenCalled:null,returns:tr}};const sr=new class UnknownString extends ExpressionEntity{getReturnExpressionWhenCalledAtPath(e){if(e.length===1){return getMemberReturnExpressionWhenCalled(ur,e[0])}return Rs}hasEffectsOnInteractionAtPath(e,t,i){if(t.type===$s){return e.length>1}if(t.type===Ts&&e.length===1){return hasMemberEffectWhenCalled(ur,e[0],t,i)}return true}};const nr={value:{hasEffectsWhenCalled:null,returns:sr}};const rr={value:{hasEffectsWhenCalled({args:e},t){const i=e[2];return e.length<3||typeof i.getLiteralValueAtPath(Ss,ks,{deoptimizeCache(){}})==="symbol"&&i.hasEffectsOnInteractionAtPath(Ss,Ls,t)},returns:sr}};const or=assembleMemberDescriptions({hasOwnProperty:er,isPrototypeOf:er,propertyIsEnumerable:er,toLocaleString:nr,toString:nr,valueOf:Zn});const ar=assembleMemberDescriptions({valueOf:er},or);const lr=assembleMemberDescriptions({toExponential:nr,toFixed:nr,toLocaleString:nr,toPrecision:nr,valueOf:ir},or);const cr=assembleMemberDescriptions({exec:Zn,test:er},or);const ur=assembleMemberDescriptions({anchor:nr,at:Zn,big:nr,blink:nr,bold:nr,charAt:nr,charCodeAt:ir,codePointAt:Zn,concat:nr,endsWith:er,fixed:nr,fontcolor:nr,fontsize:nr,includes:er,indexOf:ir,italics:nr,lastIndexOf:ir,link:nr,localeCompare:ir,match:Zn,matchAll:Zn,normalize:nr,padEnd:nr,padStart:nr,repeat:nr,replace:rr,replaceAll:rr,search:ir,slice:nr,small:nr,split:Zn,startsWith:er,strike:nr,sub:nr,substr:nr,substring:nr,sup:nr,toLocaleLowerCase:nr,toLocaleUpperCase:nr,toLowerCase:nr,toString:nr,toUpperCase:nr,trim:nr,trimEnd:nr,trimLeft:nr,trimRight:nr,trimStart:nr,valueOf:nr},or);function getLiteralMembersForValue(e){if(e instanceof RegExp){return cr}switch(typeof e){case"boolean":{return ar}case"number":{return lr}case"string":{return ur}}return Object.create(null)}function hasMemberEffectWhenCalled(e,t,i,s){if(typeof t!=="string"||!e[t]){return true}return e[t].hasEffectsWhenCalled?.(i,s)||false}function getMemberReturnExpressionWhenCalled(e,t){if(typeof t!=="string"||!e[t])return Rs;return[e[t].returns,false]}function skipThrough(e,t,i){i(e,t)}function ignore(e,t,i){}var hr={};hr.Program=hr.BlockStatement=hr.StaticBlock=function(e,t,i){for(var s=0,n=e.body;s<n.length;s+=1){var r=n[s];i(r,t,"Statement")}};hr.Statement=skipThrough;hr.EmptyStatement=ignore;hr.ExpressionStatement=hr.ParenthesizedExpression=hr.ChainExpression=function(e,t,i){return i(e.expression,t,"Expression")};hr.IfStatement=function(e,t,i){i(e.test,t,"Expression");i(e.consequent,t,"Statement");if(e.alternate){i(e.alternate,t,"Statement")}};hr.LabeledStatement=function(e,t,i){return i(e.body,t,"Statement")};hr.BreakStatement=hr.ContinueStatement=ignore;hr.WithStatement=function(e,t,i){i(e.object,t,"Expression");i(e.body,t,"Statement")};hr.SwitchStatement=function(e,t,i){i(e.discriminant,t,"Expression");for(var s=0,n=e.cases;s<n.length;s+=1){var r=n[s];if(r.test){i(r.test,t,"Expression")}for(var o=0,l=r.consequent;o<l.length;o+=1){var c=l[o];i(c,t,"Statement")}}};hr.SwitchCase=function(e,t,i){if(e.test){i(e.test,t,"Expression")}for(var s=0,n=e.consequent;s<n.length;s+=1){var r=n[s];i(r,t,"Statement")}};hr.ReturnStatement=hr.YieldExpression=hr.AwaitExpression=function(e,t,i){if(e.argument){i(e.argument,t,"Expression")}};hr.ThrowStatement=hr.SpreadElement=function(e,t,i){return i(e.argument,t,"Expression")};hr.TryStatement=function(e,t,i){i(e.block,t,"Statement");if(e.handler){i(e.handler,t)}if(e.finalizer){i(e.finalizer,t,"Statement")}};hr.CatchClause=function(e,t,i){if(e.param){i(e.param,t,"Pattern")}i(e.body,t,"Statement")};hr.WhileStatement=hr.DoWhileStatement=function(e,t,i){i(e.test,t,"Expression");i(e.body,t,"Statement")};hr.ForStatement=function(e,t,i){if(e.init){i(e.init,t,"ForInit")}if(e.test){i(e.test,t,"Expression")}if(e.update){i(e.update,t,"Expression")}i(e.body,t,"Statement")};hr.ForInStatement=hr.ForOfStatement=function(e,t,i){i(e.left,t,"ForInit");i(e.right,t,"Expression");i(e.body,t,"Statement")};hr.ForInit=function(e,t,i){if(e.type==="VariableDeclaration"){i(e,t)}else{i(e,t,"Expression")}};hr.DebuggerStatement=ignore;hr.FunctionDeclaration=function(e,t,i){return i(e,t,"Function")};hr.VariableDeclaration=function(e,t,i){for(var s=0,n=e.declarations;s<n.length;s+=1){var r=n[s];i(r,t)}};hr.VariableDeclarator=function(e,t,i){i(e.id,t,"Pattern");if(e.init){i(e.init,t,"Expression")}};hr.Function=function(e,t,i){if(e.id){i(e.id,t,"Pattern")}for(var s=0,n=e.params;s<n.length;s+=1){var r=n[s];i(r,t,"Pattern")}i(e.body,t,e.expression?"Expression":"Statement")};hr.Pattern=function(e,t,i){if(e.type==="Identifier"){i(e,t,"VariablePattern")}else if(e.type==="MemberExpression"){i(e,t,"MemberPattern")}else{i(e,t)}};hr.VariablePattern=ignore;hr.MemberPattern=skipThrough;hr.RestElement=function(e,t,i){return i(e.argument,t,"Pattern")};hr.ArrayPattern=function(e,t,i){for(var s=0,n=e.elements;s<n.length;s+=1){var r=n[s];if(r){i(r,t,"Pattern")}}};hr.ObjectPattern=function(e,t,i){for(var s=0,n=e.properties;s<n.length;s+=1){var r=n[s];if(r.type==="Property"){if(r.computed){i(r.key,t,"Expression")}i(r.value,t,"Pattern")}else if(r.type==="RestElement"){i(r.argument,t,"Pattern")}}};hr.Expression=skipThrough;hr.ThisExpression=hr.Super=hr.MetaProperty=ignore;hr.ArrayExpression=function(e,t,i){for(var s=0,n=e.elements;s<n.length;s+=1){var r=n[s];if(r){i(r,t,"Expression")}}};hr.ObjectExpression=function(e,t,i){for(var s=0,n=e.properties;s<n.length;s+=1){var r=n[s];i(r,t)}};hr.FunctionExpression=hr.ArrowFunctionExpression=hr.FunctionDeclaration;hr.SequenceExpression=function(e,t,i){for(var s=0,n=e.expressions;s<n.length;s+=1){var r=n[s];i(r,t,"Expression")}};hr.TemplateLiteral=function(e,t,i){for(var s=0,n=e.quasis;s<n.length;s+=1){var r=n[s];i(r,t)}for(var o=0,l=e.expressions;o<l.length;o+=1){var c=l[o];i(c,t,"Expression")}};hr.TemplateElement=ignore;hr.UnaryExpression=hr.UpdateExpression=function(e,t,i){i(e.argument,t,"Expression")};hr.BinaryExpression=hr.LogicalExpression=function(e,t,i){i(e.left,t,"Expression");i(e.right,t,"Expression")};hr.AssignmentExpression=hr.AssignmentPattern=function(e,t,i){i(e.left,t,"Pattern");i(e.right,t,"Expression")};hr.ConditionalExpression=function(e,t,i){i(e.test,t,"Expression");i(e.consequent,t,"Expression");i(e.alternate,t,"Expression")};hr.NewExpression=hr.CallExpression=function(e,t,i){i(e.callee,t,"Expression");if(e.arguments){for(var s=0,n=e.arguments;s<n.length;s+=1){var r=n[s];i(r,t,"Expression")}}};hr.MemberExpression=function(e,t,i){i(e.object,t,"Expression");if(e.computed){i(e.property,t,"Expression")}};hr.ExportNamedDeclaration=hr.ExportDefaultDeclaration=function(e,t,i){if(e.declaration){i(e.declaration,t,e.type==="ExportNamedDeclaration"||e.declaration.id?"Statement":"Expression")}if(e.source){i(e.source,t,"Expression")}};hr.ExportAllDeclaration=function(e,t,i){if(e.exported){i(e.exported,t)}i(e.source,t,"Expression")};hr.ImportDeclaration=function(e,t,i){for(var s=0,n=e.specifiers;s<n.length;s+=1){var r=n[s];i(r,t)}i(e.source,t,"Expression")};hr.ImportExpression=function(e,t,i){i(e.source,t,"Expression")};hr.ImportSpecifier=hr.ImportDefaultSpecifier=hr.ImportNamespaceSpecifier=hr.Identifier=hr.PrivateIdentifier=hr.Literal=ignore;hr.TaggedTemplateExpression=function(e,t,i){i(e.tag,t,"Expression");i(e.quasi,t,"Expression")};hr.ClassDeclaration=hr.ClassExpression=function(e,t,i){return i(e,t,"Class")};hr.Class=function(e,t,i){if(e.id){i(e.id,t,"Pattern")}if(e.superClass){i(e.superClass,t,"Expression")}i(e.body,t)};hr.ClassBody=function(e,t,i){for(var s=0,n=e.body;s<n.length;s+=1){var r=n[s];i(r,t)}};hr.MethodDefinition=hr.PropertyDefinition=hr.Property=function(e,t,i){if(e.computed){i(e.key,t,"Expression")}if(e.value){i(e.value,t,"Expression")}};const dr="ArrowFunctionExpression";const pr="BinaryExpression";const fr="BlockStatement";const mr="CallExpression";const gr="ChainExpression";const yr="ConditionalExpression";const Er="ExportDefaultDeclaration";const xr="ExportNamedDeclaration";const br="ExpressionStatement";const vr="FunctionDeclaration";const Sr="Identifier";const Ar="LogicalExpression";const wr="NewExpression";const Ir="Program";const Cr="Property";const kr="ReturnStatement";const _r="SequenceExpression";const Pr="VariableDeclarator";const Nr="VariableDeclaration";let Rr="sourceMa";Rr+="ppingURL";const $r="[ \\f\\r\\t\\v\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]";const Or=new RegExp(`^#${$r}+${Rr}=.+`);const Tr="_rollupAnnotations";const Dr="_rollupRemoved";function handlePureAnnotationsOfNode(e,t,i=e.type){const{annotations:s,code:n}=t;let r=s[t.annotationIndex];while(r&&e.start>=r.end){markPureNode(e,r,n);r=s[++t.annotationIndex]}if(r&&r.end<=e.end){hr[i](e,t,handlePureAnnotationsOfNode);while((r=s[t.annotationIndex])&&r.end<=e.end){++t.annotationIndex;annotateNode(e,r,false)}}}const Mr=/[^\s(]/g;const Lr=/\S/g;function markPureNode(e,t,i){const s=[];let n;const r=i.slice(t.end,e.start);if(doesNotMatchOutsideComment(r,Mr)){const t=e.start;while(true){s.push(e);switch(e.type){case br:case gr:{e=e.expression;continue}case _r:{if(doesNotMatchOutsideComment(i.slice(t,e.start),Lr)){e=e.expressions[0];continue}n=true;break}case yr:{if(doesNotMatchOutsideComment(i.slice(t,e.start),Lr)){e=e.test;continue}n=true;break}case Ar:case pr:{if(doesNotMatchOutsideComment(i.slice(t,e.start),Lr)){e=e.left;continue}n=true;break}case xr:case Er:{e=e.declaration;continue}case Nr:{const t=e;if(t.kind==="const"){e=t.declarations[0].init;continue}n=true;break}case Pr:{e=e.init;continue}case vr:case dr:case mr:case wr:{break}default:{n=true}}break}}else{n=true}if(n){annotateNode(e,t,false)}else{for(const e of s){annotateNode(e,t,true)}}}function doesNotMatchOutsideComment(e,t){let i;while((i=t.exec(e))!==null){if(i[0]==="/"){const i=e.charCodeAt(t.lastIndex);if(i===42){t.lastIndex=e.indexOf("*/",t.lastIndex+1)+2;continue}else if(i===47){t.lastIndex=e.indexOf("\n",t.lastIndex+1)+1;continue}}t.lastIndex=0;return false}return true}const Br=[["pure",/[#@]__PURE__/],["noSideEffects",/[#@]__NO_SIDE_EFFECTS__/]];function addAnnotations(e,t,i){const s=[];const n=[];for(const t of e){for(const[e,i]of Br){if(i.test(t.value)){s.push({...t,annotationType:e})}}if(Or.test(t.value)){n.push(t)}}for(const e of n){annotateNode(t,e,false)}handlePureAnnotationsOfNode(t,{annotationIndex:0,annotations:s,code:i})}function annotateNode(e,t,i){const s=i?Tr:Dr;const n=e[s];if(n){n.push(t)}else{e[s]=[t]}}const Fr={ImportExpression:["arguments"],Literal:[],Program:["body"]};function getAndCreateKeys(e){Fr[e.type]=Object.keys(e).filter((t=>typeof e[t]==="object"&&t.charCodeAt(0)!==95));return Fr[e.type]}const Vr="variables";class NodeBase extends ExpressionEntity{constructor(e,t,i,s=false){super();this.deoptimized=false;this.esTreeNode=s?e:null;this.keys=Fr[e.type]||getAndCreateKeys(e);this.parent=t;this.context=t.context;this.createScope(i);this.parseNode(e);this.initialise();this.context.magicString.addSourcemapLocation(this.start);this.context.magicString.addSourcemapLocation(this.end)}addExportedVariables(e,t){}bind(){for(const e of this.keys){const t=this[e];if(Array.isArray(t)){for(const e of t){e?.bind()}}else if(t){t.bind()}}}createScope(e){this.scope=e}hasEffects(e){if(!this.deoptimized)this.applyDeoptimizations();for(const t of this.keys){const i=this[t];if(i===null)continue;if(Array.isArray(i)){for(const t of i){if(t?.hasEffects(e))return true}}else if(i.hasEffects(e))return true}return false}hasEffectsAsAssignmentTarget(e,t){return this.hasEffects(e)||this.hasEffectsOnInteractionAtPath(Ss,this.assignmentInteraction,e)}include(e,t,i){if(!this.deoptimized)this.applyDeoptimizations();this.included=true;for(const i of this.keys){const s=this[i];if(s===null)continue;if(Array.isArray(s)){for(const i of s){i?.include(e,t)}}else{s.include(e,t)}}}includeAsAssignmentTarget(e,t,i){this.include(e,t)}initialise(){}insertSemicolon(e){if(e.original[this.end-1]!==";"){e.appendLeft(this.end,";")}}parseNode(e,t){for(const[i,s]of Object.entries(e)){if(this.hasOwnProperty(i))continue;if(i.charCodeAt(0)===95){if(i===Tr){const e=s;this.annotations=e;if(this.context.options.treeshake.annotations){this.annotationNoSideEffects=e.some((e=>e.annotationType==="noSideEffects"));this.annotationPure=e.some((e=>e.annotationType==="pure"))}}else if(i===Dr){for(const{start:e,end:t}of s)this.context.magicString.remove(e,t)}}else if(typeof s!=="object"||s===null){this[i]=s}else if(Array.isArray(s)){this[i]=[];for(const e of s){this[i].push(e===null?null:new(this.context.getNodeConstructor(e.type))(e,this,this.scope,t?.includes(i)))}}else{this[i]=new(this.context.getNodeConstructor(s.type))(s,this,this.scope,t?.includes(i))}}}render(e,t){for(const i of this.keys){const s=this[i];if(s===null)continue;if(Array.isArray(s)){for(const i of s){i?.render(e,t)}}else{s.render(e,t)}}}setAssignedValue(e){this.assignmentInteraction={args:[null,e],type:Os}}shouldBeIncluded(e){return this.included||!e.brokenFlow&&this.hasEffects(createHasEffectsContext())}applyDeoptimizations(){this.deoptimized=true;for(const e of this.keys){const t=this[e];if(t===null)continue;if(Array.isArray(t)){for(const e of t){e?.deoptimizePath(As)}}else{t.deoptimizePath(As)}}this.context.requestTreeshakingPass()}}class SpreadElement extends NodeBase{deoptimizeArgumentsOnInteractionAtPath(e,t,i){if(t.length>0){this.argument.deoptimizeArgumentsOnInteractionAtPath(e,[Es,...t],i)}}hasEffects(e){if(!this.deoptimized)this.applyDeoptimizations();const{propertyReadSideEffects:t}=this.context.options.treeshake;return this.argument.hasEffects(e)||t&&(t==="always"||this.argument.hasEffectsOnInteractionAtPath(As,Ds,e))}applyDeoptimizations(){this.deoptimized=true;this.argument.deoptimizePath([Es,Es]);this.context.requestTreeshakingPass()}}class Method extends ExpressionEntity{constructor(e){super();this.description=e}deoptimizeArgumentsOnInteractionAtPath({args:e,type:t},i){if(t===Ts&&i.length===0&&this.description.mutatesSelfAsArray){e[0]?.deoptimizePath(Is)}}getReturnExpressionWhenCalledAtPath(e,{args:t}){if(e.length>0){return Rs}return[this.description.returnsPrimitive||(this.description.returns==="self"?t[0]||Ns:this.description.returns()),false]}hasEffectsOnInteractionAtPath(e,t,i){const{type:s}=t;if(e.length>(s===$s?1:0)){return true}if(s===Ts){const{args:e}=t;if(this.description.mutatesSelfAsArray===true&&e[0]?.hasEffectsOnInteractionAtPath(Is,Ms,i)){return true}if(this.description.callsArgs){for(const t of this.description.callsArgs){if(e[t+1]?.hasEffectsOnInteractionAtPath(Ss,Ls,i)){return true}}}}return false}}const zr=[new Method({callsArgs:null,mutatesSelfAsArray:false,returns:null,returnsPrimitive:Jn})];const jr=[new Method({callsArgs:null,mutatesSelfAsArray:false,returns:null,returnsPrimitive:sr})];const Ur=[new Method({callsArgs:null,mutatesSelfAsArray:false,returns:null,returnsPrimitive:tr})];const Hr=[new Method({callsArgs:null,mutatesSelfAsArray:false,returns:null,returnsPrimitive:Ns})];const Gr=/^\d+$/;class ObjectEntity extends ExpressionEntity{constructor(e,t,i=false){super();this.prototypeExpression=t;this.immutable=i;this.additionalExpressionsToBeDeoptimized=new Set;this.allProperties=[];this.deoptimizedPaths=Object.create(null);this.expressionsToBeDeoptimizedByKey=Object.create(null);this.gettersByKey=Object.create(null);this.hasLostTrack=false;this.hasUnknownDeoptimizedInteger=false;this.hasUnknownDeoptimizedProperty=false;this.propertiesAndGettersByKey=Object.create(null);this.propertiesAndSettersByKey=Object.create(null);this.settersByKey=Object.create(null);this.unknownIntegerProps=[];this.unmatchableGetters=[];this.unmatchablePropertiesAndGetters=[];this.unmatchableSetters=[];if(Array.isArray(e)){this.buildPropertyMaps(e)}else{this.propertiesAndGettersByKey=this.propertiesAndSettersByKey=e;for(const t of Object.values(e)){this.allProperties.push(...t)}}}deoptimizeAllProperties(e){const t=this.hasLostTrack||this.hasUnknownDeoptimizedProperty;if(e){this.hasUnknownDeoptimizedProperty=true}else{this.hasLostTrack=true}if(t){return}for(const e of[...Object.values(this.propertiesAndGettersByKey),...Object.values(this.settersByKey)]){for(const t of e){t.deoptimizePath(As)}}this.prototypeExpression?.deoptimizePath([Es,Es]);this.deoptimizeCachedEntities()}deoptimizeArgumentsOnInteractionAtPath(e,t,i){const[s,...n]=t;const{args:r,type:o}=e;if(this.hasLostTrack||(o===Ts||t.length>1)&&(this.hasUnknownDeoptimizedProperty||typeof s==="string"&&this.deoptimizedPaths[s])){deoptimizeInteraction(e);return}const[l,c,u]=o===Ts||t.length>1?[this.propertiesAndGettersByKey,this.propertiesAndGettersByKey,this.unmatchablePropertiesAndGetters]:o===$s?[this.propertiesAndGettersByKey,this.gettersByKey,this.unmatchableGetters]:[this.propertiesAndSettersByKey,this.settersByKey,this.unmatchableSetters];if(typeof s==="string"){if(l[s]){const t=c[s];if(t){for(const s of t){s.deoptimizeArgumentsOnInteractionAtPath(e,n,i)}}if(!this.immutable){for(const e of r){if(e){this.additionalExpressionsToBeDeoptimized.add(e)}}}return}for(const t of u){t.deoptimizeArgumentsOnInteractionAtPath(e,n,i)}if(Gr.test(s)){for(const t of this.unknownIntegerProps){t.deoptimizeArgumentsOnInteractionAtPath(e,n,i)}}}else{for(const t of[...Object.values(c),u]){for(const s of t){s.deoptimizeArgumentsOnInteractionAtPath(e,n,i)}}for(const t of this.unknownIntegerProps){t.deoptimizeArgumentsOnInteractionAtPath(e,n,i)}}if(!this.immutable){for(const e of r){if(e){this.additionalExpressionsToBeDeoptimized.add(e)}}}this.prototypeExpression?.deoptimizeArgumentsOnInteractionAtPath(e,t,i)}deoptimizeIntegerProperties(){if(this.hasLostTrack||this.hasUnknownDeoptimizedProperty||this.hasUnknownDeoptimizedInteger){return}this.hasUnknownDeoptimizedInteger=true;for(const[e,t]of Object.entries(this.propertiesAndGettersByKey)){if(Gr.test(e)){for(const e of t){e.deoptimizePath(As)}}}this.deoptimizeCachedIntegerEntities()}deoptimizePath(e){if(this.hasLostTrack||this.immutable){return}const t=e[0];if(e.length===1){if(typeof t!=="string"){if(t===bs){return this.deoptimizeIntegerProperties()}return this.deoptimizeAllProperties(t===xs)}if(!this.deoptimizedPaths[t]){this.deoptimizedPaths[t]=true;const e=this.expressionsToBeDeoptimizedByKey[t];if(e){for(const t of e){t.deoptimizeCache()}}}}const i=e.length===1?As:e.slice(1);for(const e of typeof t==="string"?[...this.propertiesAndGettersByKey[t]||this.unmatchablePropertiesAndGetters,...this.settersByKey[t]||this.unmatchableSetters]:this.allProperties){e.deoptimizePath(i)}this.prototypeExpression?.deoptimizePath(e.length===1?[...e,Es]:e)}getLiteralValueAtPath(e,t,i){if(e.length===0){return Ps}const s=e[0];const n=this.getMemberExpressionAndTrackDeopt(s,i);if(n){return n.getLiteralValueAtPath(e.slice(1),t,i)}if(this.prototypeExpression){return this.prototypeExpression.getLiteralValueAtPath(e,t,i)}if(e.length===1){return undefined}return _s}getReturnExpressionWhenCalledAtPath(e,t,i,s){if(e.length===0){return Rs}const[n,...r]=e;const o=this.getMemberExpressionAndTrackDeopt(n,s);if(o){return o.getReturnExpressionWhenCalledAtPath(r,t,i,s)}if(this.prototypeExpression){return this.prototypeExpression.getReturnExpressionWhenCalledAtPath(e,t,i,s)}return Rs}hasEffectsOnInteractionAtPath(e,t,i){const[s,...n]=e;if(n.length>0||t.type===Ts){const r=this.getMemberExpression(s);if(r){return r.hasEffectsOnInteractionAtPath(n,t,i)}if(this.prototypeExpression){return this.prototypeExpression.hasEffectsOnInteractionAtPath(e,t,i)}return true}if(s===xs)return false;if(this.hasLostTrack)return true;const[r,o,l]=t.type===$s?[this.propertiesAndGettersByKey,this.gettersByKey,this.unmatchableGetters]:[this.propertiesAndSettersByKey,this.settersByKey,this.unmatchableSetters];if(typeof s==="string"){if(r[s]){const e=o[s];if(e){for(const s of e){if(s.hasEffectsOnInteractionAtPath(n,t,i))return true}}return false}for(const e of l){if(e.hasEffectsOnInteractionAtPath(n,t,i)){return true}}}else{for(const e of[...Object.values(o),l]){for(const s of e){if(s.hasEffectsOnInteractionAtPath(n,t,i))return true}}}if(this.prototypeExpression){return this.prototypeExpression.hasEffectsOnInteractionAtPath(e,t,i)}return false}buildPropertyMaps(e){const{allProperties:t,propertiesAndGettersByKey:i,propertiesAndSettersByKey:s,settersByKey:n,gettersByKey:r,unknownIntegerProps:o,unmatchablePropertiesAndGetters:l,unmatchableGetters:c,unmatchableSetters:u}=this;const h=[];for(let d=e.length-1;d>=0;d--){const{key:p,kind:f,property:m}=e[d];t.push(m);if(typeof p==="string"){if(f==="set"){if(!s[p]){s[p]=[m,...h];n[p]=[m,...u]}}else if(f==="get"){if(!i[p]){i[p]=[m,...l];r[p]=[m,...c]}}else{if(!s[p]){s[p]=[m,...h]}if(!i[p]){i[p]=[m,...l]}}}else{if(p===bs){o.push(m);continue}if(f==="set")u.push(m);if(f==="get")c.push(m);if(f!=="get")h.push(m);if(f!=="set")l.push(m)}}}deoptimizeCachedEntities(){for(const e of Object.values(this.expressionsToBeDeoptimizedByKey)){for(const t of e){t.deoptimizeCache()}}for(const e of this.additionalExpressionsToBeDeoptimized){e.deoptimizePath(As)}}deoptimizeCachedIntegerEntities(){for(const[e,t]of Object.entries(this.expressionsToBeDeoptimizedByKey)){if(Gr.test(e)){for(const e of t){e.deoptimizeCache()}}}for(const e of this.additionalExpressionsToBeDeoptimized){e.deoptimizePath(Is)}}getMemberExpression(e){if(this.hasLostTrack||this.hasUnknownDeoptimizedProperty||typeof e!=="string"||this.hasUnknownDeoptimizedInteger&&Gr.test(e)||this.deoptimizedPaths[e]){return Ns}const t=this.propertiesAndGettersByKey[e];if(t?.length===1){return t[0]}if(t||this.unmatchablePropertiesAndGetters.length>0||this.unknownIntegerProps.length>0&&Gr.test(e)){return Ns}return null}getMemberExpressionAndTrackDeopt(e,t){if(typeof e!=="string"){return Ns}const i=this.getMemberExpression(e);if(!(i===Ns||this.immutable)){const i=this.expressionsToBeDeoptimizedByKey[e]=this.expressionsToBeDeoptimizedByKey[e]||[];i.push(t)}return i}}const isInteger=e=>typeof e==="string"&&/^\d+$/.test(e);const Wr=new class ObjectPrototypeFallbackExpression extends ExpressionEntity{deoptimizeArgumentsOnInteractionAtPath(e,t){if(e.type===Ts&&t.length===1&&!isInteger(t[0])){deoptimizeInteraction(e)}}getLiteralValueAtPath(e){return e.length===1&&isInteger(e[0])?undefined:_s}hasEffectsOnInteractionAtPath(e,{type:t}){return e.length>1||t===Ts}};const qr=new ObjectEntity({__proto__:null,hasOwnProperty:zr,isPrototypeOf:zr,propertyIsEnumerable:zr,toLocaleString:jr,toString:jr,valueOf:Hr},Wr,true);const Kr=[{key:bs,kind:"init",property:Ns},{key:"length",kind:"init",property:tr}];const Yr=[new Method({callsArgs:[0],mutatesSelfAsArray:"deopt-only",returns:null,returnsPrimitive:Jn})];const Qr=[new Method({callsArgs:[0],mutatesSelfAsArray:"deopt-only",returns:null,returnsPrimitive:tr})];const Xr=[new Method({callsArgs:null,mutatesSelfAsArray:true,returns:()=>new ObjectEntity(Kr,oo),returnsPrimitive:null})];const Zr=[new Method({callsArgs:null,mutatesSelfAsArray:"deopt-only",returns:()=>new ObjectEntity(Kr,oo),returnsPrimitive:null})];const Jr=[new Method({callsArgs:[0],mutatesSelfAsArray:"deopt-only",returns:()=>new ObjectEntity(Kr,oo),returnsPrimitive:null})];const eo=[new Method({callsArgs:null,mutatesSelfAsArray:true,returns:null,returnsPrimitive:tr})];const to=[new Method({callsArgs:null,mutatesSelfAsArray:true,returns:null,returnsPrimitive:Ns})];const io=[new Method({callsArgs:null,mutatesSelfAsArray:"deopt-only",returns:null,returnsPrimitive:Ns})];const so=[new Method({callsArgs:[0],mutatesSelfAsArray:"deopt-only",returns:null,returnsPrimitive:Ns})];const no=[new Method({callsArgs:null,mutatesSelfAsArray:true,returns:"self",returnsPrimitive:null})];const ro=[new Method({callsArgs:[0],mutatesSelfAsArray:true,returns:"self",returnsPrimitive:null})];const oo=new ObjectEntity({__proto__:null,at:io,concat:Zr,copyWithin:no,entries:Zr,every:Yr,fill:no,filter:Jr,find:so,findIndex:Qr,findLast:so,findLastIndex:Qr,flat:Zr,flatMap:Jr,forEach:so,includes:zr,indexOf:Ur,join:jr,keys:Hr,lastIndexOf:Ur,map:Jr,pop:to,push:eo,reduce:so,reduceRight:so,reverse:no,shift:to,slice:Zr,some:Yr,sort:ro,splice:Xr,toLocaleString:jr,toString:jr,unshift:eo,values:io},qr,true);class ArrayExpression extends NodeBase{constructor(){super(...arguments);this.objectEntity=null}deoptimizeArgumentsOnInteractionAtPath(e,t,i){this.getObjectEntity().deoptimizeArgumentsOnInteractionAtPath(e,t,i)}deoptimizePath(e){this.getObjectEntity().deoptimizePath(e)}getLiteralValueAtPath(e,t,i){return this.getObjectEntity().getLiteralValueAtPath(e,t,i)}getReturnExpressionWhenCalledAtPath(e,t,i,s){return this.getObjectEntity().getReturnExpressionWhenCalledAtPath(e,t,i,s)}hasEffectsOnInteractionAtPath(e,t,i){return this.getObjectEntity().hasEffectsOnInteractionAtPath(e,t,i)}applyDeoptimizations(){this.deoptimized=true;let e=false;for(let t=0;t<this.elements.length;t++){const i=this.elements[t];if(i&&(e||i instanceof SpreadElement)){e=true;i.deoptimizePath(As)}}this.context.requestTreeshakingPass()}getObjectEntity(){if(this.objectEntity!==null){return this.objectEntity}const e=[{key:"length",kind:"init",property:tr}];let t=false;for(let i=0;i<this.elements.length;i++){const s=this.elements[i];if(t||s instanceof SpreadElement){if(s){t=true;e.unshift({key:bs,kind:"init",property:s})}}else if(s){e.push({key:String(i),kind:"init",property:s})}else{e.push({key:String(i),kind:"init",property:Xn})}}return this.objectEntity=new ObjectEntity(e,oo)}}class ArrayPattern extends NodeBase{addExportedVariables(e,t){for(const i of this.elements){i?.addExportedVariables(e,t)}}declare(e){const t=[];for(const i of this.elements){if(i!==null){t.push(...i.declare(e,Ns))}}return t}deoptimizePath(){for(const e of this.elements){e?.deoptimizePath(Ss)}}hasEffectsOnInteractionAtPath(e,t,i){for(const e of this.elements){if(e?.hasEffectsOnInteractionAtPath(Ss,t,i))return true}return false}markDeclarationReached(){for(const e of this.elements){e?.markDeclarationReached()}}}class LocalVariable extends Variable{constructor(e,t,i,s){super(e);this.init=i;this.calledFromTryStatement=false;this.additionalInitializers=null;this.expressionsToBeDeoptimized=[];this.declarations=t?[t]:[];this.deoptimizationTracker=s.deoptimizationTracker;this.module=s.module}addDeclaration(e,t){this.declarations.push(e);this.markInitializersForDeoptimization().push(t)}consolidateInitializers(){if(this.additionalInitializers){for(const e of this.additionalInitializers){e.deoptimizePath(As)}this.additionalInitializers=null}}deoptimizeArgumentsOnInteractionAtPath(e,t,i){if(this.isReassigned){deoptimizeInteraction(e);return}i.withTrackedEntityAtPath(t,this.init,(()=>this.init.deoptimizeArgumentsOnInteractionAtPath(e,t,i)),undefined)}deoptimizePath(e){if(this.isReassigned||this.deoptimizationTracker.trackEntityAtPathAndGetIfTracked(e,this)){return}if(e.length===0){if(!this.isReassigned){this.isReassigned=true;const e=this.expressionsToBeDeoptimized;this.expressionsToBeDeoptimized=Vt;for(const t of e){t.deoptimizeCache()}this.init.deoptimizePath(As)}}else{this.init.deoptimizePath(e)}}getLiteralValueAtPath(e,t,i){if(this.isReassigned){return _s}return t.withTrackedEntityAtPath(e,this.init,(()=>{this.expressionsToBeDeoptimized.push(i);return this.init.getLiteralValueAtPath(e,t,i)}),_s)}getReturnExpressionWhenCalledAtPath(e,t,i,s){if(this.isReassigned){return Rs}return i.withTrackedEntityAtPath(e,this.init,(()=>{this.expressionsToBeDeoptimized.push(s);return this.init.getReturnExpressionWhenCalledAtPath(e,t,i,s)}),Rs)}hasEffectsOnInteractionAtPath(e,t,i){switch(t.type){case $s:{if(this.isReassigned)return true;return!i.accessed.trackEntityAtPathAndGetIfTracked(e,this)&&this.init.hasEffectsOnInteractionAtPath(e,t,i)}case Os:{if(this.included)return true;if(e.length===0)return false;if(this.isReassigned)return true;return!i.assigned.trackEntityAtPathAndGetIfTracked(e,this)&&this.init.hasEffectsOnInteractionAtPath(e,t,i)}case Ts:{if(this.isReassigned)return true;return!(t.withNew?i.instantiated:i.called).trackEntityAtPathAndGetIfTracked(e,t.args,this)&&this.init.hasEffectsOnInteractionAtPath(e,t,i)}}}include(){if(!this.included){this.included=true;for(const e of this.declarations){if(!e.included)e.include(createInclusionContext(),false);let t=e.parent;while(!t.included){t.included=true;if(t.type===Ir)break;t=t.parent}}}}includeCallArguments(e,t){if(this.isReassigned||e.includedCallArguments.has(this.init)){for(const i of t){i.include(e,false)}}else{e.includedCallArguments.add(this.init);this.init.includeCallArguments(e,t);e.includedCallArguments.delete(this.init)}}markCalledFromTryStatement(){this.calledFromTryStatement=true}markInitializersForDeoptimization(){if(this.additionalInitializers===null){this.additionalInitializers=[this.init];this.init=Ns;this.isReassigned=true}return this.additionalInitializers}mergeDeclarations(e){const{declarations:t}=this;for(const i of e.declarations){t.push(i)}const i=this.markInitializersForDeoptimization();i.push(e.init);if(e.additionalInitializers){for(const t of e.additionalInitializers){i.push(t)}}}}const ao=20;const lo=Vt;const co=new Set([Es]);const uo=new PathTracker;const ho=new Set([Ns]);class ParameterVariable extends LocalVariable{constructor(e,t,i){super(e,t,Ns,i);this.deoptimizationInteractions=[];this.deoptimizations=new PathTracker;this.deoptimizedFields=new Set;this.entitiesToBeDeoptimized=new Set}addEntityToBeDeoptimized(e){if(e===Ns){if(!this.entitiesToBeDeoptimized.has(Ns)){this.entitiesToBeDeoptimized.add(Ns);for(const{interaction:e}of this.deoptimizationInteractions){deoptimizeInteraction(e)}this.deoptimizationInteractions=lo}}else if(this.deoptimizedFields.has(Es)){e.deoptimizePath(As)}else if(!this.entitiesToBeDeoptimized.has(e)){this.entitiesToBeDeoptimized.add(e);for(const t of this.deoptimizedFields){e.deoptimizePath([t])}for(const{interaction:t,path:i}of this.deoptimizationInteractions){e.deoptimizeArgumentsOnInteractionAtPath(t,i,ks)}}}deoptimizeArgumentsOnInteractionAtPath(e,t){if(t.length>=2||this.entitiesToBeDeoptimized.has(Ns)||this.deoptimizationInteractions.length>=ao||t.length===1&&(this.deoptimizedFields.has(Es)||e.type===Ts&&this.deoptimizedFields.has(t[0]))){deoptimizeInteraction(e);return}if(!this.deoptimizations.trackEntityAtPathAndGetIfTracked(t,e.args)){for(const i of this.entitiesToBeDeoptimized){i.deoptimizeArgumentsOnInteractionAtPath(e,t,ks)}if(!this.entitiesToBeDeoptimized.has(Ns)){this.deoptimizationInteractions.push({interaction:e,path:t})}}}deoptimizePath(e){if(e.length===0||this.deoptimizedFields.has(Es)){return}const t=e[0];if(this.deoptimizedFields.has(t)){return}this.deoptimizedFields.add(t);for(const e of this.entitiesToBeDeoptimized){e.deoptimizePath([t])}if(t===Es){this.deoptimizationInteractions=lo;this.deoptimizations=uo;this.deoptimizedFields=co;this.entitiesToBeDeoptimized=ho}}getReturnExpressionWhenCalledAtPath(e){if(e.length===0){this.deoptimizePath(As)}else if(!this.deoptimizedFields.has(e[0])){this.deoptimizePath([e[0]])}return Rs}}function getSafeName(e,t,i){let s=e;let n=1;while(t.has(s)||Fs.has(s)||i?.has(s)){s=`${e}$${toBase64(n++)}`}t.add(s);return s}let po=class Scope{constructor(){this.children=[];this.variables=new Map}addDeclaration(e,t,i,s){const n=e.name;let r=this.variables.get(n);if(r){r.addDeclaration(e,i)}else{r=new LocalVariable(e.name,e,i||Xn,t);this.variables.set(n,r)}return r}contains(e){return this.variables.has(e)}findVariable(e){throw new Error("Internal Error: findVariable needs to be implemented by a subclass")}};class ChildScope extends po{constructor(e){super();this.accessedOutsideVariables=new Map;this.parent=e;e.children.push(this)}addAccessedDynamicImport(e){(this.accessedDynamicImports||(this.accessedDynamicImports=new Set)).add(e);if(this.parent instanceof ChildScope){this.parent.addAccessedDynamicImport(e)}}addAccessedGlobals(e,t){const i=t.get(this)||new Set;for(const t of e){i.add(t)}t.set(this,i);if(this.parent instanceof ChildScope){this.parent.addAccessedGlobals(e,t)}}addNamespaceMemberAccess(e,t){this.accessedOutsideVariables.set(e,t);this.parent.addNamespaceMemberAccess(e,t)}addReturnExpression(e){this.parent instanceof ChildScope&&this.parent.addReturnExpression(e)}addUsedOutsideNames(e,t,i,s){for(const s of this.accessedOutsideVariables.values()){if(s.included){e.add(s.getBaseVariableName());if(t==="system"&&i.has(s)){e.add("exports")}}}const n=s.get(this);if(n){for(const t of n){e.add(t)}}}contains(e){return this.variables.has(e)||this.parent.contains(e)}deconflict(e,t,i){const s=new Set;this.addUsedOutsideNames(s,e,t,i);if(this.accessedDynamicImports){for(const e of this.accessedDynamicImports){if(e.inlineNamespace){s.add(e.inlineNamespace.getBaseVariableName())}}}for(const[e,t]of this.variables){if(t.included||t.alwaysRendered){t.setRenderNames(null,getSafeName(e,s,t.forbiddenNames))}}for(const s of this.children){s.deconflict(e,t,i)}}findLexicalBoundary(){return this.parent.findLexicalBoundary()}findVariable(e){const t=this.variables.get(e)||this.accessedOutsideVariables.get(e);if(t){return t}const i=this.parent.findVariable(e);this.accessedOutsideVariables.set(e,i);return i}}class ParameterScope extends ChildScope{constructor(e,t){super(e);this.parameters=[];this.hasRest=false;this.context=t;this.hoistedBodyVarScope=new ChildScope(this)}addParameterDeclaration(e){const{name:t}=e;const i=new ParameterVariable(t,e,this.context);const s=this.hoistedBodyVarScope.variables.get(t);if(s){this.hoistedBodyVarScope.variables.set(t,i);i.mergeDeclarations(s)}this.variables.set(t,i);return i}addParameterVariables(e,t){this.parameters=e;for(const t of e){for(const e of t){e.alwaysRendered=true}}this.hasRest=t}includeCallArguments(e,t){let i=false;let s=false;const n=this.hasRest&&this.parameters[this.parameters.length-1];for(const i of t){if(i instanceof SpreadElement){for(const i of t){i.include(e,false)}break}}for(let r=t.length-1;r>=0;r--){const o=this.parameters[r]||n;const l=t[r];if(o){i=false;if(o.length===0){s=true}else{for(const e of o){if(e.included){s=true}if(e.calledFromTryStatement){i=true}}}}if(!s&&l.shouldBeIncluded(e)){s=true}if(s){l.include(e,i)}}}}class ReturnValueScope extends ParameterScope{constructor(){super(...arguments);this.returnExpression=null;this.returnExpressions=[]}addReturnExpression(e){this.returnExpressions.push(e)}getReturnExpression(){if(this.returnExpression===null)this.updateReturnExpression();return this.returnExpression}updateReturnExpression(){if(this.returnExpressions.length===1){this.returnExpression=this.returnExpressions[0]}else{this.returnExpression=Ns;for(const e of this.returnExpressions){e.deoptimizePath(As)}}}}function is_reference(e,t){if(e.type==="MemberExpression"){return!e.computed&&is_reference(e.object,e)}if(e.type==="Identifier"){if(!t)return true;switch(t.type){case"MemberExpression":return t.computed||e===t.object;case"MethodDefinition":return t.computed;case"PropertyDefinition":return t.computed||e===t.value;case"Property":return t.computed||e===t.value;case"ExportSpecifier":case"ImportSpecifier":return e===t.local;case"LabeledStatement":case"BreakStatement":case"ContinueStatement":return false;default:return true}}return false}const fo=Symbol("PureFunction");const getPureFunctions=({treeshake:e})=>{const t=Object.create(null);for(const i of e?e.manualPureFunctions:[]){let e=t;for(const t of i.split(".")){e=e[t]||(e[t]=Object.create(null))}e[fo]=true}return t};const mo=Symbol("Value Properties");const getTruthyLiteralValue=()=>Ps;const returnFalse=()=>false;const returnTrue=()=>true;const go={deoptimizeArgumentsOnCall:doNothing,getLiteralValue:getTruthyLiteralValue,hasEffectsWhenCalled:returnFalse};const yo={deoptimizeArgumentsOnCall:doNothing,getLiteralValue:getTruthyLiteralValue,hasEffectsWhenCalled:returnTrue};const Eo={deoptimizeArgumentsOnCall:doNothing,getLiteralValue:getTruthyLiteralValue,hasEffectsWhenCalled({args:e}){return e.length>1&&!(e[1]instanceof ArrayExpression)}};const xo={deoptimizeArgumentsOnCall:doNothing,getLiteralValue:getTruthyLiteralValue,hasEffectsWhenCalled({args:e},t){const[i,s]=e;return!(s instanceof ExpressionEntity)||s.hasEffectsOnInteractionAtPath(As,Ds,t)}};const bo={__proto__:null,[mo]:yo};const vo={__proto__:null,[mo]:go};const So={__proto__:null,[mo]:xo};const Ao={__proto__:null,[mo]:{deoptimizeArgumentsOnCall({args:[,e]}){e?.deoptimizePath(As)},getLiteralValue:getTruthyLiteralValue,hasEffectsWhenCalled({args:e},t){return e.length<=1||e[1].hasEffectsOnInteractionAtPath(ws,Ms,t)}}};const wo={__proto__:null,[mo]:yo,prototype:bo};const Io={__proto__:null,[mo]:go,prototype:bo};const Co={__proto__:null,[mo]:Eo,prototype:bo};const ko={__proto__:null,[mo]:go,from:bo,of:vo,prototype:bo};const _o={__proto__:null,[mo]:go,supportedLocalesOf:Io};const Po={global:bo,globalThis:bo,self:bo,window:bo,__proto__:null,[mo]:yo,Array:{__proto__:null,[mo]:yo,from:bo,isArray:vo,of:vo,prototype:bo},ArrayBuffer:{__proto__:null,[mo]:go,isView:vo,prototype:bo},Atomics:bo,BigInt:wo,BigInt64Array:wo,BigUint64Array:wo,Boolean:Io,constructor:wo,DataView:Io,Date:{__proto__:null,[mo]:go,now:vo,parse:vo,prototype:bo,UTC:vo},decodeURI:vo,decodeURIComponent:vo,encodeURI:vo,encodeURIComponent:vo,Error:Io,escape:vo,eval:bo,EvalError:Io,Float32Array:ko,Float64Array:ko,Function:wo,hasOwnProperty:bo,Infinity:bo,Int16Array:ko,Int32Array:ko,Int8Array:ko,isFinite:vo,isNaN:vo,isPrototypeOf:bo,JSON:bo,Map:Co,Math:{__proto__:null,[mo]:yo,abs:vo,acos:vo,acosh:vo,asin:vo,asinh:vo,atan:vo,atan2:vo,atanh:vo,cbrt:vo,ceil:vo,clz32:vo,cos:vo,cosh:vo,exp:vo,expm1:vo,floor:vo,fround:vo,hypot:vo,imul:vo,log:vo,log10:vo,log1p:vo,log2:vo,max:vo,min:vo,pow:vo,random:vo,round:vo,sign:vo,sin:vo,sinh:vo,sqrt:vo,tan:vo,tanh:vo,trunc:vo},NaN:bo,Number:{__proto__:null,[mo]:go,isFinite:vo,isInteger:vo,isNaN:vo,isSafeInteger:vo,parseFloat:vo,parseInt:vo,prototype:bo},Object:{__proto__:null,[mo]:go,create:vo,defineProperty:Ao,defineProperties:Ao,freeze:Ao,getOwnPropertyDescriptor:vo,getOwnPropertyDescriptors:vo,getOwnPropertyNames:vo,getOwnPropertySymbols:vo,getPrototypeOf:vo,hasOwn:vo,is:vo,isExtensible:vo,isFrozen:vo,isSealed:vo,keys:vo,fromEntries:bo,entries:So,values:So,prototype:bo},parseFloat:vo,parseInt:vo,Promise:{__proto__:null,[mo]:yo,all:bo,allSettled:bo,any:bo,prototype:bo,race:bo,reject:bo,resolve:bo},propertyIsEnumerable:bo,Proxy:bo,RangeError:Io,ReferenceError:Io,Reflect:bo,RegExp:Io,Set:Co,SharedArrayBuffer:wo,String:{__proto__:null,[mo]:go,fromCharCode:vo,fromCodePoint:vo,prototype:bo,raw:vo},Symbol:{__proto__:null,[mo]:go,for:vo,keyFor:vo,prototype:bo,toStringTag:{__proto__:null,[mo]:{deoptimizeArgumentsOnCall:doNothing,getLiteralValue(){return vs},hasEffectsWhenCalled:returnTrue}}},SyntaxError:Io,toLocaleString:bo,toString:bo,TypeError:Io,Uint16Array:ko,Uint32Array:ko,Uint8Array:ko,Uint8ClampedArray:ko,unescape:vo,URIError:Io,valueOf:bo,WeakMap:Co,WeakSet:Co,clearInterval:wo,clearTimeout:wo,console:{__proto__:null,[mo]:yo,assert:wo,clear:wo,count:wo,countReset:wo,debug:wo,dir:wo,dirxml:wo,error:wo,exception:wo,group:wo,groupCollapsed:wo,groupEnd:wo,info:wo,log:wo,table:wo,time:wo,timeEnd:wo,timeLog:wo,trace:wo,warn:wo},Intl:{__proto__:null,[mo]:yo,Collator:_o,DateTimeFormat:_o,DisplayNames:_o,ListFormat:_o,Locale:_o,NumberFormat:_o,PluralRules:_o,RelativeTimeFormat:_o,Segmenter:_o},setInterval:wo,setTimeout:wo,TextDecoder:wo,TextEncoder:wo,URL:{__proto__:null,[mo]:yo,prototype:bo,canParse:vo},URLSearchParams:wo,AbortController:wo,AbortSignal:wo,addEventListener:bo,alert:bo,AnalyserNode:wo,Animation:wo,AnimationEvent:wo,applicationCache:bo,ApplicationCache:wo,ApplicationCacheErrorEvent:wo,atob:bo,Attr:wo,Audio:wo,AudioBuffer:wo,AudioBufferSourceNode:wo,AudioContext:wo,AudioDestinationNode:wo,AudioListener:wo,AudioNode:wo,AudioParam:wo,AudioProcessingEvent:wo,AudioScheduledSourceNode:wo,AudioWorkletNode:wo,BarProp:wo,BaseAudioContext:wo,BatteryManager:wo,BeforeUnloadEvent:wo,BiquadFilterNode:wo,Blob:wo,BlobEvent:wo,blur:bo,BroadcastChannel:wo,btoa:bo,ByteLengthQueuingStrategy:wo,Cache:wo,caches:bo,CacheStorage:wo,cancelAnimationFrame:bo,cancelIdleCallback:bo,CanvasCaptureMediaStreamTrack:wo,CanvasGradient:wo,CanvasPattern:wo,CanvasRenderingContext2D:wo,ChannelMergerNode:wo,ChannelSplitterNode:wo,CharacterData:wo,clientInformation:bo,ClipboardEvent:wo,close:bo,closed:bo,CloseEvent:wo,Comment:wo,CompositionEvent:wo,confirm:bo,ConstantSourceNode:wo,ConvolverNode:wo,CountQueuingStrategy:wo,createImageBitmap:bo,Credential:wo,CredentialsContainer:wo,crypto:bo,Crypto:wo,CryptoKey:wo,CSS:wo,CSSConditionRule:wo,CSSFontFaceRule:wo,CSSGroupingRule:wo,CSSImportRule:wo,CSSKeyframeRule:wo,CSSKeyframesRule:wo,CSSMediaRule:wo,CSSNamespaceRule:wo,CSSPageRule:wo,CSSRule:wo,CSSRuleList:wo,CSSStyleDeclaration:wo,CSSStyleRule:wo,CSSStyleSheet:wo,CSSSupportsRule:wo,CustomElementRegistry:wo,customElements:bo,CustomEvent:{__proto__:null,[mo]:{deoptimizeArgumentsOnCall({args:e}){e[2]?.deoptimizePath(["detail"])},getLiteralValue:getTruthyLiteralValue,hasEffectsWhenCalled:returnFalse},prototype:bo},DataTransfer:wo,DataTransferItem:wo,DataTransferItemList:wo,defaultstatus:bo,defaultStatus:bo,DelayNode:wo,DeviceMotionEvent:wo,DeviceOrientationEvent:wo,devicePixelRatio:bo,dispatchEvent:bo,document:bo,Document:wo,DocumentFragment:wo,DocumentType:wo,DOMError:wo,DOMException:wo,DOMImplementation:wo,DOMMatrix:wo,DOMMatrixReadOnly:wo,DOMParser:wo,DOMPoint:wo,DOMPointReadOnly:wo,DOMQuad:wo,DOMRect:wo,DOMRectReadOnly:wo,DOMStringList:wo,DOMStringMap:wo,DOMTokenList:wo,DragEvent:wo,DynamicsCompressorNode:wo,Element:wo,ErrorEvent:wo,Event:wo,EventSource:wo,EventTarget:wo,external:bo,fetch:bo,File:wo,FileList:wo,FileReader:wo,find:bo,focus:bo,FocusEvent:wo,FontFace:wo,FontFaceSetLoadEvent:wo,FormData:wo,frames:bo,GainNode:wo,Gamepad:wo,GamepadButton:wo,GamepadEvent:wo,getComputedStyle:bo,getSelection:bo,HashChangeEvent:wo,Headers:wo,history:bo,History:wo,HTMLAllCollection:wo,HTMLAnchorElement:wo,HTMLAreaElement:wo,HTMLAudioElement:wo,HTMLBaseElement:wo,HTMLBodyElement:wo,HTMLBRElement:wo,HTMLButtonElement:wo,HTMLCanvasElement:wo,HTMLCollection:wo,HTMLContentElement:wo,HTMLDataElement:wo,HTMLDataListElement:wo,HTMLDetailsElement:wo,HTMLDialogElement:wo,HTMLDirectoryElement:wo,HTMLDivElement:wo,HTMLDListElement:wo,HTMLDocument:wo,HTMLElement:wo,HTMLEmbedElement:wo,HTMLFieldSetElement:wo,HTMLFontElement:wo,HTMLFormControlsCollection:wo,HTMLFormElement:wo,HTMLFrameElement:wo,HTMLFrameSetElement:wo,HTMLHeadElement:wo,HTMLHeadingElement:wo,HTMLHRElement:wo,HTMLHtmlElement:wo,HTMLIFrameElement:wo,HTMLImageElement:wo,HTMLInputElement:wo,HTMLLabelElement:wo,HTMLLegendElement:wo,HTMLLIElement:wo,HTMLLinkElement:wo,HTMLMapElement:wo,HTMLMarqueeElement:wo,HTMLMediaElement:wo,HTMLMenuElement:wo,HTMLMetaElement:wo,HTMLMeterElement:wo,HTMLModElement:wo,HTMLObjectElement:wo,HTMLOListElement:wo,HTMLOptGroupElement:wo,HTMLOptionElement:wo,HTMLOptionsCollection:wo,HTMLOutputElement:wo,HTMLParagraphElement:wo,HTMLParamElement:wo,HTMLPictureElement:wo,HTMLPreElement:wo,HTMLProgressElement:wo,HTMLQuoteElement:wo,HTMLScriptElement:wo,HTMLSelectElement:wo,HTMLShadowElement:wo,HTMLSlotElement:wo,HTMLSourceElement:wo,HTMLSpanElement:wo,HTMLStyleElement:wo,HTMLTableCaptionElement:wo,HTMLTableCellElement:wo,HTMLTableColElement:wo,HTMLTableElement:wo,HTMLTableRowElement:wo,HTMLTableSectionElement:wo,HTMLTemplateElement:wo,HTMLTextAreaElement:wo,HTMLTimeElement:wo,HTMLTitleElement:wo,HTMLTrackElement:wo,HTMLUListElement:wo,HTMLUnknownElement:wo,HTMLVideoElement:wo,IDBCursor:wo,IDBCursorWithValue:wo,IDBDatabase:wo,IDBFactory:wo,IDBIndex:wo,IDBKeyRange:wo,IDBObjectStore:wo,IDBOpenDBRequest:wo,IDBRequest:wo,IDBTransaction:wo,IDBVersionChangeEvent:wo,IdleDeadline:wo,IIRFilterNode:wo,Image:wo,ImageBitmap:wo,ImageBitmapRenderingContext:wo,ImageCapture:wo,ImageData:wo,indexedDB:bo,innerHeight:bo,innerWidth:bo,InputEvent:wo,IntersectionObserver:wo,IntersectionObserverEntry:wo,isSecureContext:bo,KeyboardEvent:wo,KeyframeEffect:wo,length:bo,localStorage:bo,location:bo,Location:wo,locationbar:bo,matchMedia:bo,MediaDeviceInfo:wo,MediaDevices:wo,MediaElementAudioSourceNode:wo,MediaEncryptedEvent:wo,MediaError:wo,MediaKeyMessageEvent:wo,MediaKeySession:wo,MediaKeyStatusMap:wo,MediaKeySystemAccess:wo,MediaList:wo,MediaQueryList:wo,MediaQueryListEvent:wo,MediaRecorder:wo,MediaSettingsRange:wo,MediaSource:wo,MediaStream:wo,MediaStreamAudioDestinationNode:wo,MediaStreamAudioSourceNode:wo,MediaStreamEvent:wo,MediaStreamTrack:wo,MediaStreamTrackEvent:wo,menubar:bo,MessageChannel:wo,MessageEvent:wo,MessagePort:wo,MIDIAccess:wo,MIDIConnectionEvent:wo,MIDIInput:wo,MIDIInputMap:wo,MIDIMessageEvent:wo,MIDIOutput:wo,MIDIOutputMap:wo,MIDIPort:wo,MimeType:wo,MimeTypeArray:wo,MouseEvent:wo,moveBy:bo,moveTo:bo,MutationEvent:wo,MutationObserver:wo,MutationRecord:wo,name:bo,NamedNodeMap:wo,NavigationPreloadManager:wo,navigator:bo,Navigator:wo,NetworkInformation:wo,Node:wo,NodeFilter:bo,NodeIterator:wo,NodeList:wo,Notification:wo,OfflineAudioCompletionEvent:wo,OfflineAudioContext:wo,offscreenBuffering:bo,OffscreenCanvas:wo,open:bo,openDatabase:bo,Option:wo,origin:bo,OscillatorNode:wo,outerHeight:bo,outerWidth:bo,PageTransitionEvent:wo,pageXOffset:bo,pageYOffset:bo,PannerNode:wo,parent:bo,Path2D:wo,PaymentAddress:wo,PaymentRequest:wo,PaymentRequestUpdateEvent:wo,PaymentResponse:wo,performance:bo,Performance:wo,PerformanceEntry:wo,PerformanceLongTaskTiming:wo,PerformanceMark:wo,PerformanceMeasure:wo,PerformanceNavigation:wo,PerformanceNavigationTiming:wo,PerformanceObserver:wo,PerformanceObserverEntryList:wo,PerformancePaintTiming:wo,PerformanceResourceTiming:wo,PerformanceTiming:wo,PeriodicWave:wo,Permissions:wo,PermissionStatus:wo,personalbar:bo,PhotoCapabilities:wo,Plugin:wo,PluginArray:wo,PointerEvent:wo,PopStateEvent:wo,postMessage:bo,Presentation:wo,PresentationAvailability:wo,PresentationConnection:wo,PresentationConnectionAvailableEvent:wo,PresentationConnectionCloseEvent:wo,PresentationConnectionList:wo,PresentationReceiver:wo,PresentationRequest:wo,print:bo,ProcessingInstruction:wo,ProgressEvent:wo,PromiseRejectionEvent:wo,prompt:bo,PushManager:wo,PushSubscription:wo,PushSubscriptionOptions:wo,queueMicrotask:bo,RadioNodeList:wo,Range:wo,ReadableStream:wo,RemotePlayback:wo,removeEventListener:bo,Request:wo,requestAnimationFrame:bo,requestIdleCallback:bo,resizeBy:bo,ResizeObserver:wo,ResizeObserverEntry:wo,resizeTo:bo,Response:wo,RTCCertificate:wo,RTCDataChannel:wo,RTCDataChannelEvent:wo,RTCDtlsTransport:wo,RTCIceCandidate:wo,RTCIceTransport:wo,RTCPeerConnection:wo,RTCPeerConnectionIceEvent:wo,RTCRtpReceiver:wo,RTCRtpSender:wo,RTCSctpTransport:wo,RTCSessionDescription:wo,RTCStatsReport:wo,RTCTrackEvent:wo,screen:bo,Screen:wo,screenLeft:bo,ScreenOrientation:wo,screenTop:bo,screenX:bo,screenY:bo,ScriptProcessorNode:wo,scroll:bo,scrollbars:bo,scrollBy:bo,scrollTo:bo,scrollX:bo,scrollY:bo,SecurityPolicyViolationEvent:wo,Selection:wo,ServiceWorker:wo,ServiceWorkerContainer:wo,ServiceWorkerRegistration:wo,sessionStorage:bo,ShadowRoot:wo,SharedWorker:wo,SourceBuffer:wo,SourceBufferList:wo,speechSynthesis:bo,SpeechSynthesisEvent:wo,SpeechSynthesisUtterance:wo,StaticRange:wo,status:bo,statusbar:bo,StereoPannerNode:wo,stop:bo,Storage:wo,StorageEvent:wo,StorageManager:wo,styleMedia:bo,StyleSheet:wo,StyleSheetList:wo,SubtleCrypto:wo,SVGAElement:wo,SVGAngle:wo,SVGAnimatedAngle:wo,SVGAnimatedBoolean:wo,SVGAnimatedEnumeration:wo,SVGAnimatedInteger:wo,SVGAnimatedLength:wo,SVGAnimatedLengthList:wo,SVGAnimatedNumber:wo,SVGAnimatedNumberList:wo,SVGAnimatedPreserveAspectRatio:wo,SVGAnimatedRect:wo,SVGAnimatedString:wo,SVGAnimatedTransformList:wo,SVGAnimateElement:wo,SVGAnimateMotionElement:wo,SVGAnimateTransformElement:wo,SVGAnimationElement:wo,SVGCircleElement:wo,SVGClipPathElement:wo,SVGComponentTransferFunctionElement:wo,SVGDefsElement:wo,SVGDescElement:wo,SVGDiscardElement:wo,SVGElement:wo,SVGEllipseElement:wo,SVGFEBlendElement:wo,SVGFEColorMatrixElement:wo,SVGFEComponentTransferElement:wo,SVGFECompositeElement:wo,SVGFEConvolveMatrixElement:wo,SVGFEDiffuseLightingElement:wo,SVGFEDisplacementMapElement:wo,SVGFEDistantLightElement:wo,SVGFEDropShadowElement:wo,SVGFEFloodElement:wo,SVGFEFuncAElement:wo,SVGFEFuncBElement:wo,SVGFEFuncGElement:wo,SVGFEFuncRElement:wo,SVGFEGaussianBlurElement:wo,SVGFEImageElement:wo,SVGFEMergeElement:wo,SVGFEMergeNodeElement:wo,SVGFEMorphologyElement:wo,SVGFEOffsetElement:wo,SVGFEPointLightElement:wo,SVGFESpecularLightingElement:wo,SVGFESpotLightElement:wo,SVGFETileElement:wo,SVGFETurbulenceElement:wo,SVGFilterElement:wo,SVGForeignObjectElement:wo,SVGGElement:wo,SVGGeometryElement:wo,SVGGradientElement:wo,SVGGraphicsElement:wo,SVGImageElement:wo,SVGLength:wo,SVGLengthList:wo,SVGLinearGradientElement:wo,SVGLineElement:wo,SVGMarkerElement:wo,SVGMaskElement:wo,SVGMatrix:wo,SVGMetadataElement:wo,SVGMPathElement:wo,SVGNumber:wo,SVGNumberList:wo,SVGPathElement:wo,SVGPatternElement:wo,SVGPoint:wo,SVGPointList:wo,SVGPolygonElement:wo,SVGPolylineElement:wo,SVGPreserveAspectRatio:wo,SVGRadialGradientElement:wo,SVGRect:wo,SVGRectElement:wo,SVGScriptElement:wo,SVGSetElement:wo,SVGStopElement:wo,SVGStringList:wo,SVGStyleElement:wo,SVGSVGElement:wo,SVGSwitchElement:wo,SVGSymbolElement:wo,SVGTextContentElement:wo,SVGTextElement:wo,SVGTextPathElement:wo,SVGTextPositioningElement:wo,SVGTitleElement:wo,SVGTransform:wo,SVGTransformList:wo,SVGTSpanElement:wo,SVGUnitTypes:wo,SVGUseElement:wo,SVGViewElement:wo,TaskAttributionTiming:wo,Text:wo,TextEvent:wo,TextMetrics:wo,TextTrack:wo,TextTrackCue:wo,TextTrackCueList:wo,TextTrackList:wo,TimeRanges:wo,toolbar:bo,top:bo,Touch:wo,TouchEvent:wo,TouchList:wo,TrackEvent:wo,TransitionEvent:wo,TreeWalker:wo,UIEvent:wo,ValidityState:wo,visualViewport:bo,VisualViewport:wo,VTTCue:wo,WaveShaperNode:wo,WebAssembly:bo,WebGL2RenderingContext:wo,WebGLActiveInfo:wo,WebGLBuffer:wo,WebGLContextEvent:wo,WebGLFramebuffer:wo,WebGLProgram:wo,WebGLQuery:wo,WebGLRenderbuffer:wo,WebGLRenderingContext:wo,WebGLSampler:wo,WebGLShader:wo,WebGLShaderPrecisionFormat:wo,WebGLSync:wo,WebGLTexture:wo,WebGLTransformFeedback:wo,WebGLUniformLocation:wo,WebGLVertexArrayObject:wo,WebSocket:wo,WheelEvent:wo,Window:wo,Worker:wo,WritableStream:wo,XMLDocument:wo,XMLHttpRequest:wo,XMLHttpRequestEventTarget:wo,XMLHttpRequestUpload:wo,XMLSerializer:wo,XPathEvaluator:wo,XPathExpression:wo,XPathResult:wo,XSLTProcessor:wo};for(const e of["window","global","self","globalThis"]){Po[e]=Po}function getGlobalAtPath(e){let t=Po;for(const i of e){if(typeof i!=="string"){return null}t=t[i];if(!t){return null}}return t[mo]}class GlobalVariable extends Variable{constructor(){super(...arguments);this.isReassigned=true}deoptimizeArgumentsOnInteractionAtPath(e,t,i){switch(e.type){case $s:case Os:{if(!getGlobalAtPath([this.name,...t].slice(0,-1))){super.deoptimizeArgumentsOnInteractionAtPath(e,t,i)}return}case Ts:{const s=getGlobalAtPath([this.name,...t]);if(s){s.deoptimizeArgumentsOnCall(e)}else{super.deoptimizeArgumentsOnInteractionAtPath(e,t,i)}return}}}getLiteralValueAtPath(e,t,i){const s=getGlobalAtPath([this.name,...e]);return s?s.getLiteralValue():_s}hasEffectsOnInteractionAtPath(e,t,i){switch(t.type){case $s:{if(e.length===0){return this.name!=="undefined"&&!getGlobalAtPath([this.name])}return!getGlobalAtPath([this.name,...e].slice(0,-1))}case Os:{return true}case Ts:{const s=getGlobalAtPath([this.name,...e]);return!s||s.hasEffectsWhenCalled(t,i)}}}}const No={__proto__:null,class:true,const:true,let:true,var:true};class Identifier extends NodeBase{constructor(){super(...arguments);this.variable=null;this.isTDZAccess=null}addExportedVariables(e,t){if(t.has(this.variable)){e.push(this.variable)}}bind(){if(!this.variable&&is_reference(this,this.parent)){this.variable=this.scope.findVariable(this.name);this.variable.addReference(this)}}declare(e,t){let i;const{treeshake:s}=this.context.options;switch(e){case"var":{i=this.scope.addDeclaration(this,this.context,t,true);if(s&&s.correctVarValueBeforeDeclaration){i.markInitializersForDeoptimization()}break}case"function":{i=this.scope.addDeclaration(this,this.context,t,false);break}case"let":case"const":case"class":{i=this.scope.addDeclaration(this,this.context,t,false);break}case"parameter":{i=this.scope.addParameterDeclaration(this);break}default:{throw new Error(`Internal Error: Unexpected identifier kind ${e}.`)}}i.kind=e;return[this.variable=i]}deoptimizeArgumentsOnInteractionAtPath(e,t,i){this.variable.deoptimizeArgumentsOnInteractionAtPath(e,t,i)}deoptimizePath(e){if(e.length===0&&!this.scope.contains(this.name)){this.disallowImportReassignment()}this.variable?.deoptimizePath(e)}getLiteralValueAtPath(e,t,i){return this.getVariableRespectingTDZ().getLiteralValueAtPath(e,t,i)}getReturnExpressionWhenCalledAtPath(e,t,i,s){const[n,r]=this.getVariableRespectingTDZ().getReturnExpressionWhenCalledAtPath(e,t,i,s);return[n,r||this.isPureFunction(e)]}hasEffects(e){if(!this.deoptimized)this.applyDeoptimizations();if(this.isPossibleTDZ()&&this.variable.kind!=="var"){return true}return this.context.options.treeshake.unknownGlobalSideEffects&&this.variable instanceof GlobalVariable&&!this.isPureFunction(Ss)&&this.variable.hasEffectsOnInteractionAtPath(Ss,Ds,e)}hasEffectsOnInteractionAtPath(e,t,i){switch(t.type){case $s:{return this.variable!==null&&!this.isPureFunction(e)&&this.getVariableRespectingTDZ().hasEffectsOnInteractionAtPath(e,t,i)}case Os:{return(e.length>0?this.getVariableRespectingTDZ():this.variable).hasEffectsOnInteractionAtPath(e,t,i)}case Ts:{return!this.isPureFunction(e)&&this.getVariableRespectingTDZ().hasEffectsOnInteractionAtPath(e,t,i)}}}include(){if(!this.deoptimized)this.applyDeoptimizations();if(!this.included){this.included=true;if(this.variable!==null){this.context.includeVariableInModule(this.variable)}}}includeCallArguments(e,t){this.variable.includeCallArguments(e,t)}isPossibleTDZ(){if(this.isTDZAccess!==null)return this.isTDZAccess;if(!(this.variable instanceof LocalVariable&&this.variable.kind&&this.variable.kind in No&&this.variable.module===this.context.module)){return this.isTDZAccess=false}let e;if(this.variable.declarations&&this.variable.declarations.length===1&&(e=this.variable.declarations[0])&&this.start<e.start&&closestParentFunctionOrProgram(this)===closestParentFunctionOrProgram(e)){return this.isTDZAccess=true}if(!this.variable.initReached){return this.isTDZAccess=true}return this.isTDZAccess=false}markDeclarationReached(){this.variable.initReached=true}render(e,{snippets:{getPropertyAccess:t},useOriginalName:i},{renderedParentType:s,isCalleeOfRenderedParent:n,isShorthandProperty:r}=Bt){if(this.variable){const o=this.variable.getName(t,i);if(o!==this.name){e.overwrite(this.start,this.end,o,{contentOnly:true,storeName:true});if(r){e.prependRight(this.start,`${this.name}: `)}}if(o==="eval"&&s===mr&&n){e.appendRight(this.start,"0, ")}}}applyDeoptimizations(){this.deoptimized=true;if(this.variable instanceof LocalVariable){this.variable.consolidateInitializers();this.context.requestTreeshakingPass()}}disallowImportReassignment(){return this.context.error(logIllegalImportReassignment(this.name,this.context.module.id),this.start)}getVariableRespectingTDZ(){if(this.isPossibleTDZ()){return Ns}return this.variable}isPureFunction(e){let t=this.context.manualPureFunctions[this.name];for(const i of e){if(t){if(t[fo]){return true}t=t[i]}else{return false}}return t?.[fo]}}function closestParentFunctionOrProgram(e){while(e&&!/^Program|Function/.test(e.type)){e=e.parent}return e}function treeshakeNode(e,t,i,s){t.remove(i,s);if(e.annotations){for(const s of e.annotations){if(s.start<i){t.remove(s.start,s.end)}else{return}}}}function removeAnnotations(e,t){if(!e.annotations&&e.parent.type===br){e=e.parent}if(e.annotations){for(const i of e.annotations){t.remove(i.start,i.end)}}}const Ro={isNoStatement:true};function findFirstOccurrenceOutsideComment(e,t,i=0){let s,n;s=e.indexOf(t,i);while(true){i=e.indexOf("/",i);if(i===-1||i>=s)return s;n=e.charCodeAt(++i);++i;i=n===47?e.indexOf("\n",i)+1:e.indexOf("*/",i)+2;if(i>s){s=e.indexOf(t,i)}}}const $o=/\S/g;function findNonWhiteSpace(e,t){$o.lastIndex=t;const i=$o.exec(e);return i.index}function findFirstLineBreakOutsideComment(e){let t,i,s=0;t=e.indexOf("\n",s);while(true){s=e.indexOf("/",s);if(s===-1||s>t)return[t,t+1];i=e.charCodeAt(s+1);if(i===47)return[s,t+1];s=e.indexOf("*/",s+3)+2;if(s>t){t=e.indexOf("\n",s)}}}function renderStatementList(e,t,i,s,n){let r,o,l,c;let u=e[0];let h=!u.included||u.needsBoundaries;if(h){c=i+findFirstLineBreakOutsideComment(t.original.slice(i,u.start))[1]}for(let i=1;i<=e.length;i++){r=u;o=c;l=h;u=e[i];h=u===undefined?false:!u.included||u.needsBoundaries;if(l||h){c=r.end+findFirstLineBreakOutsideComment(t.original.slice(r.end,u===undefined?s:u.start))[1];if(r.included){l?r.render(t,n,{end:c,start:o}):r.render(t,n)}else{treeshakeNode(r,t,o,c)}}else{r.render(t,n)}}}function getCommaSeparatedNodesWithBoundaries(e,t,i,s){const n=[];let r,o,l,c;let u=i-1;for(const s of e){if(r!==undefined){u=r.end+findFirstOccurrenceOutsideComment(t.original.slice(r.end,s.start),",")}o=l=u+1+findFirstLineBreakOutsideComment(t.original.slice(u+1,s.start))[1];while(c=t.original.charCodeAt(o),c===32||c===9||c===10||c===13)o++;if(r!==undefined){n.push({contentEnd:l,end:o,node:r,separator:u,start:i})}r=s;i=o}n.push({contentEnd:s,end:s,node:r,separator:null,start:i});return n}function removeLineBreaks(e,t,i){while(true){const[s,n]=findFirstLineBreakOutsideComment(e.original.slice(t,i));if(s===-1){break}e.remove(t+s,t+=n)}}class BlockScope extends ChildScope{addDeclaration(e,t,i,s){if(s){const n=this.parent.addDeclaration(e,t,i,s);n.markInitializersForDeoptimization();return n}else{return super.addDeclaration(e,t,i,false)}}}class ExpressionStatement extends NodeBase{initialise(){if(this.directive&&this.directive!=="use strict"&&this.parent.type===Ir){this.context.log(v,logModuleLevelDirective(this.directive,this.context.module.id),this.start)}}render(e,t){super.render(e,t);if(this.included)this.insertSemicolon(e)}shouldBeIncluded(e){if(this.directive&&this.directive!=="use strict")return this.parent.type!==Ir;return super.shouldBeIncluded(e)}applyDeoptimizations(){}}class BlockStatement extends NodeBase{constructor(){super(...arguments);this.directlyIncluded=false}addImplicitReturnExpressionToScope(){const e=this.body[this.body.length-1];if(!e||e.type!==kr){this.scope.addReturnExpression(Ns)}}createScope(e){this.scope=this.parent.preventChildBlockScope?e:new BlockScope(e)}hasEffects(e){if(this.deoptimizeBody)return true;for(const t of this.body){if(e.brokenFlow)break;if(t.hasEffects(e))return true}return false}include(e,t){if(!(this.deoptimizeBody&&this.directlyIncluded)){this.included=true;this.directlyIncluded=true;if(this.deoptimizeBody)t=true;for(const i of this.body){if(t||i.shouldBeIncluded(e))i.include(e,t)}}}initialise(){const e=this.body[0];this.deoptimizeBody=e instanceof ExpressionStatement&&e.directive==="use asm"}render(e,t){if(this.body.length>0){renderStatementList(this.body,e,this.start+1,this.end-1,t)}else{super.render(e,t)}}}class RestElement extends NodeBase{constructor(){super(...arguments);this.declarationInit=null}addExportedVariables(e,t){this.argument.addExportedVariables(e,t)}declare(e,t){this.declarationInit=t;return this.argument.declare(e,Ns)}deoptimizePath(e){e.length===0&&this.argument.deoptimizePath(Ss)}hasEffectsOnInteractionAtPath(e,t,i){return e.length>0||this.argument.hasEffectsOnInteractionAtPath(Ss,t,i)}markDeclarationReached(){this.argument.markDeclarationReached()}applyDeoptimizations(){this.deoptimized=true;if(this.declarationInit!==null){this.declarationInit.deoptimizePath([Es,Es]);this.context.requestTreeshakingPass()}}}class FunctionBase extends NodeBase{constructor(){super(...arguments);this.objectEntity=null;this.deoptimizedReturn=false}deoptimizeArgumentsOnInteractionAtPath(e,t,i){if(e.type===Ts){const{parameters:t}=this.scope;const{args:i}=e;let s=false;for(let e=0;e<i.length-1;e++){const n=this.params[e];const r=i[e+1];if(s||n instanceof RestElement){s=true;r.deoptimizePath(As)}else if(n instanceof Identifier){t[e][0].addEntityToBeDeoptimized(r);this.addArgumentToBeDeoptimized(r)}else if(n){r.deoptimizePath(As)}else{this.addArgumentToBeDeoptimized(r)}}}else{this.getObjectEntity().deoptimizeArgumentsOnInteractionAtPath(e,t,i)}}deoptimizePath(e){this.getObjectEntity().deoptimizePath(e);if(e.length===1&&e[0]===Es){this.scope.getReturnExpression().deoptimizePath(As);for(const e of this.scope.parameters){for(const t of e){t.deoptimizePath(As)}}}}getLiteralValueAtPath(e,t,i){return this.getObjectEntity().getLiteralValueAtPath(e,t,i)}getReturnExpressionWhenCalledAtPath(e,t,i,s){if(e.length>0){return this.getObjectEntity().getReturnExpressionWhenCalledAtPath(e,t,i,s)}if(this.async){if(!this.deoptimizedReturn){this.deoptimizedReturn=true;this.scope.getReturnExpression().deoptimizePath(As);this.context.requestTreeshakingPass()}return Rs}return[this.scope.getReturnExpression(),false]}hasEffectsOnInteractionAtPath(e,t,i){if(e.length>0||t.type!==Ts){return this.getObjectEntity().hasEffectsOnInteractionAtPath(e,t,i)}if(this.annotationNoSideEffects){return false}if(this.async){const{propertyReadSideEffects:e}=this.context.options.treeshake;const t=this.scope.getReturnExpression();if(t.hasEffectsOnInteractionAtPath(["then"],Ls,i)||e&&(e==="always"||t.hasEffectsOnInteractionAtPath(["then"],Ds,i))){return true}}for(const e of this.params){if(e.hasEffects(i))return true}return false}include(e,t){if(!this.deoptimized)this.applyDeoptimizations();this.included=true;const{brokenFlow:i}=e;e.brokenFlow=false;this.body.include(e,t);e.brokenFlow=i}includeCallArguments(e,t){this.scope.includeCallArguments(e,t)}initialise(){this.scope.addParameterVariables(this.params.map((e=>e.declare("parameter",Ns))),this.params[this.params.length-1]instanceof RestElement);if(this.body instanceof BlockStatement){this.body.addImplicitReturnExpressionToScope()}else{this.scope.addReturnExpression(this.body)}}parseNode(e){if(e.body.type===fr){this.body=new BlockStatement(e.body,this,this.scope.hoistedBodyVarScope)}super.parseNode(e)}addArgumentToBeDeoptimized(e){}applyDeoptimizations(){}}FunctionBase.prototype.preventChildBlockScope=true;class ArrowFunctionExpression extends FunctionBase{constructor(){super(...arguments);this.objectEntity=null}createScope(e){this.scope=new ReturnValueScope(e,this.context)}hasEffects(){if(!this.deoptimized)this.applyDeoptimizations();return false}hasEffectsOnInteractionAtPath(e,t,i){if(super.hasEffectsOnInteractionAtPath(e,t,i)){return true}if(this.annotationNoSideEffects){return false}if(t.type===Ts){const{ignore:e,brokenFlow:t}=i;i.ignore={breaks:false,continues:false,labels:new Set,returnYield:true,this:false};if(this.body.hasEffects(i))return true;i.ignore=e;i.brokenFlow=t}return false}include(e,t){super.include(e,t);for(const i of this.params){if(!(i instanceof Identifier)){i.include(e,t)}}}getObjectEntity(){if(this.objectEntity!==null){return this.objectEntity}return this.objectEntity=new ObjectEntity([],qr)}}function getSystemExportStatement(e,{exportNamesByVariable:t,snippets:{_:i,getObject:s,getPropertyAccess:n}},r=""){if(e.length===1&&t.get(e[0]).length===1){const s=e[0];return`exports('${t.get(s)}',${i}${s.getName(n)}${r})`}else{const i=[];for(const s of e){for(const e of t.get(s)){i.push([e,s.getName(n)+r])}}return`exports(${s(i,{lineBreakIndent:null})})`}}function renderSystemExportExpression(e,t,i,s,{exportNamesByVariable:n,snippets:{_:r}}){s.prependRight(t,`exports('${n.get(e)}',${r}`);s.appendLeft(i,")")}function renderSystemExportFunction(e,t,i,s,n,r){const{_:o,getDirectReturnIifeLeft:l}=r.snippets;n.prependRight(t,l(["v"],`${getSystemExportStatement(e,r)},${o}v`,{needsArrowReturnParens:true,needsWrappedFunction:s}));n.appendLeft(i,")")}function renderSystemExportSequenceAfterExpression(e,t,i,s,n,r){const{_:o,getPropertyAccess:l}=r.snippets;n.appendLeft(i,`,${o}${getSystemExportStatement([e],r)},${o}${e.getName(l)}`);if(s){n.prependRight(t,"(");n.appendLeft(i,")")}}function renderSystemExportSequenceBeforeExpression(e,t,i,s,n,r,o){const{_:l}=r.snippets;n.prependRight(t,`${getSystemExportStatement([e],r,o)},${l}`);if(s){n.prependRight(t,"(");n.appendLeft(i,")")}}class ObjectPattern extends NodeBase{addExportedVariables(e,t){for(const i of this.properties){if(i.type===Cr){i.value.addExportedVariables(e,t)}else{i.argument.addExportedVariables(e,t)}}}declare(e,t){const i=[];for(const s of this.properties){i.push(...s.declare(e,t))}return i}deoptimizePath(e){if(e.length===0){for(const t of this.properties){t.deoptimizePath(e)}}}hasEffectsOnInteractionAtPath(e,t,i){for(const e of this.properties){if(e.hasEffectsOnInteractionAtPath(Ss,t,i))return true}return false}markDeclarationReached(){for(const e of this.properties){e.markDeclarationReached()}}}class AssignmentExpression extends NodeBase{hasEffects(e){const{deoptimized:t,left:i,operator:s,right:n}=this;if(!t)this.applyDeoptimizations();return n.hasEffects(e)||i.hasEffectsAsAssignmentTarget(e,s!=="=")}hasEffectsOnInteractionAtPath(e,t,i){return this.right.hasEffectsOnInteractionAtPath(e,t,i)}include(e,t){const{deoptimized:i,left:s,right:n,operator:r}=this;if(!i)this.applyDeoptimizations();this.included=true;if(t||r!=="="||s.included||s.hasEffectsAsAssignmentTarget(createHasEffectsContext(),false)){s.includeAsAssignmentTarget(e,t,r!=="=")}n.include(e,t)}initialise(){this.left.setAssignedValue(this.right)}render(e,t,{preventASI:i,renderedParentType:s,renderedSurroundingElement:n}=Bt){const{left:r,right:o,start:l,end:c,parent:u}=this;if(r.included){r.render(e,t);o.render(e,t)}else{const c=findNonWhiteSpace(e.original,findFirstOccurrenceOutsideComment(e.original,"=",r.end)+1);e.remove(l,c);if(i){removeLineBreaks(e,c,o.start)}o.render(e,t,{renderedParentType:s||u.type,renderedSurroundingElement:n||u.type})}if(t.format==="system"){if(r instanceof Identifier){const i=r.variable;const s=t.exportNamesByVariable.get(i);if(s){if(s.length===1){renderSystemExportExpression(i,l,c,e,t)}else{renderSystemExportSequenceAfterExpression(i,l,c,u.type!==br,e,t)}return}}else{const i=[];r.addExportedVariables(i,t.exportNamesByVariable);if(i.length>0){renderSystemExportFunction(i,l,c,n===br,e,t);return}}}if(r.included&&r instanceof ObjectPattern&&(n===br||n===dr)){e.appendRight(l,"(");e.prependLeft(c,")")}}applyDeoptimizations(){this.deoptimized=true;this.left.deoptimizePath(Ss);this.right.deoptimizePath(As);this.context.requestTreeshakingPass()}}class AssignmentPattern extends NodeBase{addExportedVariables(e,t){this.left.addExportedVariables(e,t)}declare(e,t){return this.left.declare(e,t)}deoptimizePath(e){e.length===0&&this.left.deoptimizePath(e)}hasEffectsOnInteractionAtPath(e,t,i){return e.length>0||this.left.hasEffectsOnInteractionAtPath(Ss,t,i)}markDeclarationReached(){this.left.markDeclarationReached()}render(e,t,{isShorthandProperty:i}=Bt){this.left.render(e,t,{isShorthandProperty:i});this.right.render(e,t)}applyDeoptimizations(){this.deoptimized=true;this.left.deoptimizePath(Ss);this.right.deoptimizePath(As);this.context.requestTreeshakingPass()}}class ArgumentsVariable extends LocalVariable{constructor(e){super("arguments",null,Ns,e);this.deoptimizedArguments=[]}addArgumentToBeDeoptimized(e){if(this.included){e.deoptimizePath(As)}else{this.deoptimizedArguments.push(e)}}hasEffectsOnInteractionAtPath(e,{type:t}){return t!==$s||e.length>1}include(){super.include();for(const e of this.deoptimizedArguments){e.deoptimizePath(As)}this.deoptimizedArguments.length=0}}class ThisVariable extends ParameterVariable{constructor(e){super("this",null,e)}hasEffectsOnInteractionAtPath(e,t,i){return(i.replacedVariableInits.get(this)||Ns).hasEffectsOnInteractionAtPath(e,t,i)}}class FunctionScope extends ReturnValueScope{constructor(e,t){super(e,t);this.variables.set("arguments",this.argumentsVariable=new ArgumentsVariable(t));this.variables.set("this",this.thisVariable=new ThisVariable(t))}findLexicalBoundary(){return this}includeCallArguments(e,t){super.includeCallArguments(e,t);if(this.argumentsVariable.included){for(const i of t){if(!i.included){i.include(e,false)}}}}}class FunctionNode extends FunctionBase{constructor(){super(...arguments);this.objectEntity=null}createScope(e){this.scope=new FunctionScope(e,this.context);this.constructedEntity=new ObjectEntity(Object.create(null),qr);this.scope.thisVariable.addEntityToBeDeoptimized(this.constructedEntity)}deoptimizeArgumentsOnInteractionAtPath(e,t,i){super.deoptimizeArgumentsOnInteractionAtPath(e,t,i);if(e.type===Ts&&t.length===0&&e.args[0]){this.scope.thisVariable.addEntityToBeDeoptimized(e.args[0])}}hasEffects(e){if(!this.deoptimized)this.applyDeoptimizations();if(this.annotationNoSideEffects){return false}return!!this.id?.hasEffects(e)}hasEffectsOnInteractionAtPath(e,t,i){if(super.hasEffectsOnInteractionAtPath(e,t,i))return true;if(this.annotationNoSideEffects){return false}if(t.type===Ts){const e=i.replacedVariableInits.get(this.scope.thisVariable);i.replacedVariableInits.set(this.scope.thisVariable,t.withNew?this.constructedEntity:Ns);const{brokenFlow:s,ignore:n,replacedVariableInits:r}=i;i.ignore={breaks:false,continues:false,labels:new Set,returnYield:true,this:t.withNew};if(this.body.hasEffects(i))return true;i.brokenFlow=s;if(e){r.set(this.scope.thisVariable,e)}else{r.delete(this.scope.thisVariable)}i.ignore=n}return false}include(e,t){super.include(e,t);this.id?.include();const i=this.scope.argumentsVariable.included;for(const s of this.params){if(!(s instanceof Identifier)||i){s.include(e,t)}}}initialise(){super.initialise();this.id?.declare("function",this)}addArgumentToBeDeoptimized(e){this.scope.argumentsVariable.addArgumentToBeDeoptimized(e)}getObjectEntity(){if(this.objectEntity!==null){return this.objectEntity}return this.objectEntity=new ObjectEntity([{key:"prototype",kind:"init",property:new ObjectEntity([],qr)}],qr)}}class AwaitExpression extends NodeBase{hasEffects(){if(!this.deoptimized)this.applyDeoptimizations();return true}include(e,t){if(!this.deoptimized)this.applyDeoptimizations();if(!this.included){this.included=true;e:if(!this.context.usesTopLevelAwait){let e=this.parent;do{if(e instanceof FunctionNode||e instanceof ArrowFunctionExpression)break e}while(e=e.parent);this.context.usesTopLevelAwait=true}}this.argument.include(e,t)}}const Oo={"!=":(e,t)=>e!=t,"!==":(e,t)=>e!==t,"%":(e,t)=>e%t,"&":(e,t)=>e&t,"*":(e,t)=>e*t,"**":(e,t)=>e**t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"<":(e,t)=>e<t,"<<":(e,t)=>e<<t,"<=":(e,t)=>e<=t,"==":(e,t)=>e==t,"===":(e,t)=>e===t,">":(e,t)=>e>t,">=":(e,t)=>e>=t,">>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t,"^":(e,t)=>e^t,"|":(e,t)=>e|t};class BinaryExpression extends NodeBase{deoptimizeCache(){}getLiteralValueAtPath(e,t,i){if(e.length>0)return _s;const s=this.left.getLiteralValueAtPath(Ss,t,i);if(typeof s==="symbol")return _s;const n=this.right.getLiteralValueAtPath(Ss,t,i);if(typeof n==="symbol")return _s;const r=Oo[this.operator];if(!r)return _s;return r(s,n)}hasEffects(e){if(this.operator==="+"&&this.parent instanceof ExpressionStatement&&this.left.getLiteralValueAtPath(Ss,ks,this)===""){return true}return super.hasEffects(e)}hasEffectsOnInteractionAtPath(e,{type:t}){return t!==$s||e.length>1}render(e,t,{renderedSurroundingElement:i}=Bt){this.left.render(e,t,{renderedSurroundingElement:i});this.right.render(e,t)}}class BreakStatement extends NodeBase{hasEffects(e){if(this.label){if(!e.ignore.labels.has(this.label.name))return true;e.includedLabels.add(this.label.name)}else{if(!e.ignore.breaks)return true;e.hasBreak=true}e.brokenFlow=true;return false}include(e){this.included=true;if(this.label){this.label.include();e.includedLabels.add(this.label.name)}else{e.hasBreak=true}e.brokenFlow=true}}function renderCallArguments(e,t,i){if(i.arguments.length>0){if(i.arguments[i.arguments.length-1].included){for(const s of i.arguments){s.render(e,t)}}else{let s=i.arguments.length-2;while(s>=0&&!i.arguments[s].included){s--}if(s>=0){for(let n=0;n<=s;n++){i.arguments[n].render(e,t)}e.remove(findFirstOccurrenceOutsideComment(e.original,",",i.arguments[s].end),i.end-1)}else{e.remove(findFirstOccurrenceOutsideComment(e.original,"(",i.callee.end)+1,i.end-1)}}}}class Literal extends NodeBase{deoptimizeArgumentsOnInteractionAtPath(){}getLiteralValueAtPath(e){if(e.length>0||this.value===null&&this.context.code.charCodeAt(this.start)!==110||typeof this.value==="bigint"||this.context.code.charCodeAt(this.start)===47){return _s}return this.value}getReturnExpressionWhenCalledAtPath(e){if(e.length!==1)return Rs;return getMemberReturnExpressionWhenCalled(this.members,e[0])}hasEffectsOnInteractionAtPath(e,t,i){switch(t.type){case $s:{return e.length>(this.value===null?0:1)}case Os:{return true}case Ts:{if(this.included&&this.value instanceof RegExp&&(this.value.global||this.value.sticky)){return true}return e.length!==1||hasMemberEffectWhenCalled(this.members,e[0],t,i)}}}initialise(){this.members=getLiteralMembersForValue(this.value)}parseNode(e){this.value=e.value;this.regex=e.regex;super.parseNode(e)}render(e){if(typeof this.value==="string"){e.indentExclusionRanges.push([this.start+1,this.end-1])}}}const To=7;function getResolvablePropertyKey(e){return e.computed?getResolvableComputedPropertyKey(e.property):e.property.name}function getResolvableComputedPropertyKey(e){if(e instanceof Literal){return String(e.value)}return null}function getPathIfNotComputed(e){const t=e.propertyKey;const i=e.object;if(typeof t==="string"){if(i instanceof Identifier){return[{key:i.name,pos:i.start},{key:t,pos:e.property.start}]}if(i instanceof MemberExpression){const s=getPathIfNotComputed(i);return s&&[...s,{key:t,pos:e.property.start}]}}return null}function getStringFromPath(e){let t=e[0].key;for(let i=1;i<e.length;i++){t+="."+e[i].key}return t}class MemberExpression extends NodeBase{constructor(){super(...arguments);this.variable=null;this.assignmentDeoptimized=false;this.bound=false;this.expressionsToBeDeoptimized=[];this.isUndefined=false}bind(){this.bound=true;const e=getPathIfNotComputed(this);const t=e&&this.scope.findVariable(e[0].key);if(t?.isNamespace){const i=resolveNamespaceVariables(t,e.slice(1),this.context);if(!i){super.bind()}else if(i==="undefined"){this.isUndefined=true}else{this.variable=i;this.scope.addNamespaceMemberAccess(getStringFromPath(e),i)}}else{super.bind()}}deoptimizeArgumentsOnInteractionAtPath(e,t,i){if(this.variable){this.variable.deoptimizeArgumentsOnInteractionAtPath(e,t,i)}else if(!this.isUndefined){if(t.length<To){this.object.deoptimizeArgumentsOnInteractionAtPath(e,[this.getPropertyKey(),...t],i)}else{deoptimizeInteraction(e)}}}deoptimizeCache(){const{expressionsToBeDeoptimized:e,object:t}=this;this.expressionsToBeDeoptimized=Vt;this.propertyKey=Es;t.deoptimizePath(As);for(const t of e){t.deoptimizeCache()}}deoptimizePath(e){if(e.length===0)this.disallowNamespaceReassignment();if(this.variable){this.variable.deoptimizePath(e)}else if(!this.isUndefined&&e.length<To){const t=this.getPropertyKey();this.object.deoptimizePath([t===Es?xs:t,...e])}}getLiteralValueAtPath(e,t,i){if(this.variable){return this.variable.getLiteralValueAtPath(e,t,i)}if(this.isUndefined){return undefined}if(this.propertyKey!==Es&&e.length<To){this.expressionsToBeDeoptimized.push(i);return this.object.getLiteralValueAtPath([this.getPropertyKey(),...e],t,i)}return _s}getReturnExpressionWhenCalledAtPath(e,t,i,s){if(this.variable){return this.variable.getReturnExpressionWhenCalledAtPath(e,t,i,s)}if(this.isUndefined){return[Xn,false]}if(this.propertyKey!==Es&&e.length<To){this.expressionsToBeDeoptimized.push(s);return this.object.getReturnExpressionWhenCalledAtPath([this.getPropertyKey(),...e],t,i,s)}return Rs}hasEffects(e){if(!this.deoptimized)this.applyDeoptimizations();return this.property.hasEffects(e)||this.object.hasEffects(e)||this.hasAccessEffect(e)}hasEffectsAsAssignmentTarget(e,t){if(t&&!this.deoptimized)this.applyDeoptimizations();if(!this.assignmentDeoptimized)this.applyAssignmentDeoptimization();return this.property.hasEffects(e)||this.object.hasEffects(e)||t&&this.hasAccessEffect(e)||this.hasEffectsOnInteractionAtPath(Ss,this.assignmentInteraction,e)}hasEffectsOnInteractionAtPath(e,t,i){if(this.variable){return this.variable.hasEffectsOnInteractionAtPath(e,t,i)}if(this.isUndefined){return true}if(e.length<To){return this.object.hasEffectsOnInteractionAtPath([this.getPropertyKey(),...e],t,i)}return true}include(e,t){if(!this.deoptimized)this.applyDeoptimizations();this.includeProperties(e,t)}includeAsAssignmentTarget(e,t,i){if(!this.assignmentDeoptimized)this.applyAssignmentDeoptimization();if(i){this.include(e,t)}else{this.includeProperties(e,t)}}includeCallArguments(e,t){if(this.variable){this.variable.includeCallArguments(e,t)}else{super.includeCallArguments(e,t)}}initialise(){this.propertyKey=getResolvablePropertyKey(this);this.accessInteraction={args:[this.object],type:$s}}isSkippedAsOptional(e){return!this.variable&&!this.isUndefined&&(this.object.isSkippedAsOptional?.(e)||this.optional&&this.object.getLiteralValueAtPath(Ss,ks,e)==null)}render(e,t,{renderedParentType:i,isCalleeOfRenderedParent:s,renderedSurroundingElement:n}=Bt){if(this.variable||this.isUndefined){const{snippets:{getPropertyAccess:n}}=t;let r=this.variable?this.variable.getName(n):"undefined";if(i&&s)r="0, "+r;e.overwrite(this.start,this.end,r,{contentOnly:true,storeName:true})}else{if(i&&s){e.appendRight(this.start,"0, ")}this.object.render(e,t,{renderedSurroundingElement:n});this.property.render(e,t)}}setAssignedValue(e){this.assignmentInteraction={args:[this.object,e],type:Os}}applyDeoptimizations(){this.deoptimized=true;const{propertyReadSideEffects:e}=this.context.options.treeshake;if(this.bound&&e&&!(this.variable||this.isUndefined)){const e=this.getPropertyKey();this.object.deoptimizeArgumentsOnInteractionAtPath(this.accessInteraction,[e],ks);this.context.requestTreeshakingPass()}}applyAssignmentDeoptimization(){this.assignmentDeoptimized=true;const{propertyReadSideEffects:e}=this.context.options.treeshake;if(this.bound&&e&&!(this.variable||this.isUndefined)){this.object.deoptimizeArgumentsOnInteractionAtPath(this.assignmentInteraction,[this.getPropertyKey()],ks);this.context.requestTreeshakingPass()}}disallowNamespaceReassignment(){if(this.object instanceof Identifier){const e=this.scope.findVariable(this.object.name);if(e.isNamespace){if(this.variable){this.context.includeVariableInModule(this.variable)}this.context.log(v,logIllegalImportReassignment(this.object.name,this.context.module.id),this.start)}}}getPropertyKey(){if(this.propertyKey===null){this.propertyKey=Es;const e=this.property.getLiteralValueAtPath(Ss,ks,this);return this.propertyKey=e===vs?e:typeof e==="symbol"?Es:String(e)}return this.propertyKey}hasAccessEffect(e){const{propertyReadSideEffects:t}=this.context.options.treeshake;return!(this.variable||this.isUndefined)&&t&&(t==="always"||this.object.hasEffectsOnInteractionAtPath([this.getPropertyKey()],this.accessInteraction,e))}includeProperties(e,t){if(!this.included){this.included=true;if(this.variable){this.context.includeVariableInModule(this.variable)}}this.object.include(e,t);this.property.include(e,t)}}function resolveNamespaceVariables(e,t,i){if(t.length===0)return e;if(!e.isNamespace||e instanceof ExternalVariable)return null;const s=t[0].key;const n=e.context.traceExport(s);if(!n){if(t.length===1){const n=e.context.fileName;i.log(v,logMissingExport(s,i.module.id,n),t[0].pos);return"undefined"}return null}return resolveNamespaceVariables(n,t.slice(1),i)}class CallExpressionBase extends NodeBase{constructor(){super(...arguments);this.returnExpression=null;this.deoptimizableDependentExpressions=[];this.expressionsToBeDeoptimized=new Set}deoptimizeArgumentsOnInteractionAtPath(e,t,i){const{args:s}=e;const[n,r]=this.getReturnExpression(i);if(r)return;const o=s.filter((e=>!!e&&e!==Ns));if(o.length===0)return;if(n===Ns){for(const e of o){e.deoptimizePath(As)}}else{i.withTrackedEntityAtPath(t,n,(()=>{for(const e of o){this.expressionsToBeDeoptimized.add(e)}n.deoptimizeArgumentsOnInteractionAtPath(e,t,i)}),null)}}deoptimizeCache(){if(this.returnExpression?.[0]!==Ns){this.returnExpression=Rs;const{deoptimizableDependentExpressions:e,expressionsToBeDeoptimized:t}=this;this.expressionsToBeDeoptimized=zt;this.deoptimizableDependentExpressions=Vt;for(const t of e){t.deoptimizeCache()}for(const e of t){e.deoptimizePath(As)}}}deoptimizePath(e){if(e.length===0||this.context.deoptimizationTracker.trackEntityAtPathAndGetIfTracked(e,this)){return}const[t]=this.getReturnExpression();if(t!==Ns){t.deoptimizePath(e)}}getLiteralValueAtPath(e,t,i){const[s]=this.getReturnExpression(t);if(s===Ns){return _s}return t.withTrackedEntityAtPath(e,s,(()=>{this.deoptimizableDependentExpressions.push(i);return s.getLiteralValueAtPath(e,t,i)}),_s)}getReturnExpressionWhenCalledAtPath(e,t,i,s){const n=this.getReturnExpression(i);if(n[0]===Ns){return n}return i.withTrackedEntityAtPath(e,n,(()=>{this.deoptimizableDependentExpressions.push(s);const[r,o]=n[0].getReturnExpressionWhenCalledAtPath(e,t,i,s);return[r,o||n[1]]}),Rs)}hasEffectsOnInteractionAtPath(e,t,i){const{type:s}=t;if(s===Ts){const{args:s,withNew:n}=t;if((n?i.instantiated:i.called).trackEntityAtPathAndGetIfTracked(e,s,this)){return false}}else if((s===Os?i.assigned:i.accessed).trackEntityAtPathAndGetIfTracked(e,this)){return false}const[n,r]=this.getReturnExpression();return(s===Os||!r)&&n.hasEffectsOnInteractionAtPath(e,t,i)}}class CallExpression extends CallExpressionBase{bind(){super.bind();if(this.callee instanceof Identifier){const e=this.scope.findVariable(this.callee.name);if(e.isNamespace){this.context.log(v,logCannotCallNamespace(this.callee.name),this.start)}if(this.callee.name==="eval"){this.context.log(v,logEval(this.context.module.id),this.start)}}this.interaction={args:[this.callee instanceof MemberExpression&&!this.callee.variable?this.callee.object:null,...this.arguments],type:Ts,withNew:false}}hasEffects(e){try{for(const t of this.arguments){if(t.hasEffects(e))return true}if(this.annotationPure){return false}return this.callee.hasEffects(e)||this.callee.hasEffectsOnInteractionAtPath(Ss,this.interaction,e)}finally{if(!this.deoptimized)this.applyDeoptimizations()}}include(e,t){if(!this.deoptimized)this.applyDeoptimizations();if(t){super.include(e,t);if(t===Vr&&this.callee instanceof Identifier&&this.callee.variable){this.callee.variable.markCalledFromTryStatement()}}else{this.included=true;this.callee.include(e,false)}this.callee.includeCallArguments(e,this.arguments)}isSkippedAsOptional(e){return this.callee.isSkippedAsOptional?.(e)||this.optional&&this.callee.getLiteralValueAtPath(Ss,ks,e)==null}render(e,t,{renderedSurroundingElement:i}=Bt){this.callee.render(e,t,{isCalleeOfRenderedParent:true,renderedSurroundingElement:i});renderCallArguments(e,t,this)}applyDeoptimizations(){this.deoptimized=true;this.callee.deoptimizeArgumentsOnInteractionAtPath(this.interaction,Ss,ks);this.context.requestTreeshakingPass()}getReturnExpression(e=ks){if(this.returnExpression===null){this.returnExpression=Rs;return this.returnExpression=this.callee.getReturnExpressionWhenCalledAtPath(Ss,this.interaction,e,this)}return this.returnExpression}}class CatchScope extends ParameterScope{addDeclaration(e,t,i,s){const n=this.variables.get(e.name);if(n){this.parent.addDeclaration(e,t,Xn,s);n.addDeclaration(e,i);return n}return this.parent.addDeclaration(e,t,i,s)}}class CatchClause extends NodeBase{createScope(e){this.scope=new CatchScope(e,this.context)}parseNode(e){const{param:t}=e;if(t){this.param=new(this.context.getNodeConstructor(t.type))(t,this,this.scope);this.param.declare("parameter",Ns)}super.parseNode(e)}}class ChainExpression extends NodeBase{deoptimizeCache(){}getLiteralValueAtPath(e,t,i){if(this.expression.isSkippedAsOptional(i))return undefined;return this.expression.getLiteralValueAtPath(e,t,i)}hasEffects(e){if(this.expression.isSkippedAsOptional(this))return false;return this.expression.hasEffects(e)}}class ClassBodyScope extends ChildScope{constructor(e,t,i){super(e);this.variables.set("this",this.thisVariable=new LocalVariable("this",null,t,i));this.instanceScope=new ChildScope(this);this.instanceScope.variables.set("this",new ThisVariable(i))}findLexicalBoundary(){return this}}class ClassBody extends NodeBase{createScope(e){this.scope=new ClassBodyScope(e,this.parent,this.context)}include(e,t){this.included=true;this.context.includeVariableInModule(this.scope.thisVariable);for(const i of this.body){i.include(e,t)}}parseNode(e){const t=this.body=[];for(const i of e.body){t.push(new(this.context.getNodeConstructor(i.type))(i,this,i.static?this.scope:this.scope.instanceScope))}super.parseNode(e)}applyDeoptimizations(){}}class MethodBase extends NodeBase{constructor(){super(...arguments);this.accessedValue=null}deoptimizeArgumentsOnInteractionAtPath(e,t,i){if(e.type===$s&&this.kind==="get"&&t.length===0){return this.value.deoptimizeArgumentsOnInteractionAtPath({args:e.args,type:Ts,withNew:false},Ss,i)}if(e.type===Os&&this.kind==="set"&&t.length===0){return this.value.deoptimizeArgumentsOnInteractionAtPath({args:e.args,type:Ts,withNew:false},Ss,i)}this.getAccessedValue()[0].deoptimizeArgumentsOnInteractionAtPath(e,t,i)}deoptimizeCache(){}deoptimizePath(e){this.getAccessedValue()[0].deoptimizePath(e)}getLiteralValueAtPath(e,t,i){return this.getAccessedValue()[0].getLiteralValueAtPath(e,t,i)}getReturnExpressionWhenCalledAtPath(e,t,i,s){return this.getAccessedValue()[0].getReturnExpressionWhenCalledAtPath(e,t,i,s)}hasEffects(e){return this.key.hasEffects(e)}hasEffectsOnInteractionAtPath(e,t,i){if(this.kind==="get"&&t.type===$s&&e.length===0){return this.value.hasEffectsOnInteractionAtPath(Ss,{args:t.args,type:Ts,withNew:false},i)}if(this.kind==="set"&&t.type===Os){return this.value.hasEffectsOnInteractionAtPath(Ss,{args:t.args,type:Ts,withNew:false},i)}return this.getAccessedValue()[0].hasEffectsOnInteractionAtPath(e,t,i)}applyDeoptimizations(){}getAccessedValue(){if(this.accessedValue===null){if(this.kind==="get"){this.accessedValue=Rs;return this.accessedValue=this.value.getReturnExpressionWhenCalledAtPath(Ss,Ls,ks,this)}else{return this.accessedValue=[this.value,false]}}return this.accessedValue}}class MethodDefinition extends MethodBase{applyDeoptimizations(){}}class ObjectMember extends ExpressionEntity{constructor(e,t){super();this.object=e;this.key=t}deoptimizeArgumentsOnInteractionAtPath(e,t,i){this.object.deoptimizeArgumentsOnInteractionAtPath(e,[this.key,...t],i)}deoptimizePath(e){this.object.deoptimizePath([this.key,...e])}getLiteralValueAtPath(e,t,i){return this.object.getLiteralValueAtPath([this.key,...e],t,i)}getReturnExpressionWhenCalledAtPath(e,t,i,s){return this.object.getReturnExpressionWhenCalledAtPath([this.key,...e],t,i,s)}hasEffectsOnInteractionAtPath(e,t,i){return this.object.hasEffectsOnInteractionAtPath([this.key,...e],t,i)}}class ClassNode extends NodeBase{constructor(){super(...arguments);this.objectEntity=null}createScope(e){this.scope=new ChildScope(e)}deoptimizeArgumentsOnInteractionAtPath(e,t,i){this.getObjectEntity().deoptimizeArgumentsOnInteractionAtPath(e,t,i)}deoptimizeCache(){this.getObjectEntity().deoptimizeAllProperties()}deoptimizePath(e){this.getObjectEntity().deoptimizePath(e)}getLiteralValueAtPath(e,t,i){return this.getObjectEntity().getLiteralValueAtPath(e,t,i)}getReturnExpressionWhenCalledAtPath(e,t,i,s){return this.getObjectEntity().getReturnExpressionWhenCalledAtPath(e,t,i,s)}hasEffects(e){if(!this.deoptimized)this.applyDeoptimizations();const t=this.superClass?.hasEffects(e)||this.body.hasEffects(e);this.id?.markDeclarationReached();return t||super.hasEffects(e)}hasEffectsOnInteractionAtPath(e,t,i){return t.type===Ts&&e.length===0?!t.withNew||(this.classConstructor===null?this.superClass?.hasEffectsOnInteractionAtPath(e,t,i):this.classConstructor.hasEffectsOnInteractionAtPath(e,t,i))||false:this.getObjectEntity().hasEffectsOnInteractionAtPath(e,t,i)}include(e,t){if(!this.deoptimized)this.applyDeoptimizations();this.included=true;this.superClass?.include(e,t);this.body.include(e,t);if(this.id){this.id.markDeclarationReached();this.id.include()}}initialise(){this.id?.declare("class",this);for(const e of this.body.body){if(e instanceof MethodDefinition&&e.kind==="constructor"){this.classConstructor=e;return}}this.classConstructor=null}applyDeoptimizations(){this.deoptimized=true;for(const e of this.body.body){if(!(e.static||e instanceof MethodDefinition&&e.kind==="constructor")){e.deoptimizePath(As)}}this.context.requestTreeshakingPass()}getObjectEntity(){if(this.objectEntity!==null){return this.objectEntity}const e=[];const t=[];for(const i of this.body.body){const s=i.static?e:t;const n=i.kind;if(s===t&&!n)continue;const r=n==="set"||n==="get"?n:"init";let o;if(i.computed){const e=i.key.getLiteralValueAtPath(Ss,ks,this);if(typeof e==="symbol"){s.push({key:Es,kind:r,property:i});continue}else{o=String(e)}}else{o=i.key instanceof Identifier?i.key.name:String(i.key.value)}s.push({key:o,kind:r,property:i})}e.unshift({key:"prototype",kind:"init",property:new ObjectEntity(t,this.superClass?new ObjectMember(this.superClass,"prototype"):qr)});return this.objectEntity=new ObjectEntity(e,this.superClass||qr)}}class ClassDeclaration extends ClassNode{initialise(){super.initialise();if(this.id!==null){this.id.variable.isId=true}}parseNode(e){if(e.id!==null){this.id=new Identifier(e.id,this,this.scope.parent)}super.parseNode(e)}render(e,t){const{exportNamesByVariable:i,format:s,snippets:{_:n,getPropertyAccess:r}}=t;if(this.id){const{variable:o,name:l}=this.id;if(s==="system"&&i.has(o)){e.appendLeft(this.end,`${n}${getSystemExportStatement([o],t)};`)}const c=o.getName(r);if(c!==l){this.superClass?.render(e,t);this.body.render(e,{...t,useOriginalName:e=>e===o});e.prependRight(this.start,`let ${c}${n}=${n}`);e.prependLeft(this.end,";");return}}super.render(e,t)}applyDeoptimizations(){super.applyDeoptimizations();const{id:e,scope:t}=this;if(e){const{name:i,variable:s}=e;for(const e of t.accessedOutsideVariables.values()){if(e!==s){e.forbidName(i)}}}}}class ClassExpression extends ClassNode{render(e,t,{renderedSurroundingElement:i}=Bt){super.render(e,t);if(i===br){e.appendRight(this.start,"(");e.prependLeft(this.end,")")}}}class MultiExpression extends ExpressionEntity{constructor(e){super();this.expressions=e;this.included=false}deoptimizePath(e){for(const t of this.expressions){t.deoptimizePath(e)}}getReturnExpressionWhenCalledAtPath(e,t,i,s){return[new MultiExpression(this.expressions.map((n=>n.getReturnExpressionWhenCalledAtPath(e,t,i,s)[0]))),false]}hasEffectsOnInteractionAtPath(e,t,i){for(const s of this.expressions){if(s.hasEffectsOnInteractionAtPath(e,t,i))return true}return false}}class ConditionalExpression extends NodeBase{constructor(){super(...arguments);this.expressionsToBeDeoptimized=[];this.isBranchResolutionAnalysed=false;this.usedBranch=null}deoptimizeArgumentsOnInteractionAtPath(e,t,i){this.consequent.deoptimizeArgumentsOnInteractionAtPath(e,t,i);this.alternate.deoptimizeArgumentsOnInteractionAtPath(e,t,i)}deoptimizeCache(){if(this.usedBranch!==null){const e=this.usedBranch===this.consequent?this.alternate:this.consequent;this.usedBranch=null;e.deoptimizePath(As);const{expressionsToBeDeoptimized:t}=this;this.expressionsToBeDeoptimized=Vt;for(const e of t){e.deoptimizeCache()}}}deoptimizePath(e){const t=this.getUsedBranch();if(t){t.deoptimizePath(e)}else{this.consequent.deoptimizePath(e);this.alternate.deoptimizePath(e)}}getLiteralValueAtPath(e,t,i){const s=this.getUsedBranch();if(!s)return _s;this.expressionsToBeDeoptimized.push(i);return s.getLiteralValueAtPath(e,t,i)}getReturnExpressionWhenCalledAtPath(e,t,i,s){const n=this.getUsedBranch();if(!n)return[new MultiExpression([this.consequent.getReturnExpressionWhenCalledAtPath(e,t,i,s)[0],this.alternate.getReturnExpressionWhenCalledAtPath(e,t,i,s)[0]]),false];this.expressionsToBeDeoptimized.push(s);return n.getReturnExpressionWhenCalledAtPath(e,t,i,s)}hasEffects(e){if(this.test.hasEffects(e))return true;const t=this.getUsedBranch();if(!t){return this.consequent.hasEffects(e)||this.alternate.hasEffects(e)}return t.hasEffects(e)}hasEffectsOnInteractionAtPath(e,t,i){const s=this.getUsedBranch();if(!s){return this.consequent.hasEffectsOnInteractionAtPath(e,t,i)||this.alternate.hasEffectsOnInteractionAtPath(e,t,i)}return s.hasEffectsOnInteractionAtPath(e,t,i)}include(e,t){this.included=true;const i=this.getUsedBranch();if(t||this.test.shouldBeIncluded(e)||i===null){this.test.include(e,t);this.consequent.include(e,t);this.alternate.include(e,t)}else{i.include(e,t)}}includeCallArguments(e,t){const i=this.getUsedBranch();if(i){i.includeCallArguments(e,t)}else{this.consequent.includeCallArguments(e,t);this.alternate.includeCallArguments(e,t)}}render(e,t,{isCalleeOfRenderedParent:i,preventASI:s,renderedParentType:n,renderedSurroundingElement:r}=Bt){const o=this.getUsedBranch();if(this.test.included){this.test.render(e,t,{renderedSurroundingElement:r});this.consequent.render(e,t);this.alternate.render(e,t)}else{const l=findFirstOccurrenceOutsideComment(e.original,":",this.consequent.end);const c=findNonWhiteSpace(e.original,(this.consequent.included?findFirstOccurrenceOutsideComment(e.original,"?",this.test.end):l)+1);if(s){removeLineBreaks(e,c,o.start)}e.remove(this.start,c);if(this.consequent.included){e.remove(l,this.end)}removeAnnotations(this,e);o.render(e,t,{isCalleeOfRenderedParent:i,preventASI:true,renderedParentType:n||this.parent.type,renderedSurroundingElement:r||this.parent.type})}}getUsedBranch(){if(this.isBranchResolutionAnalysed){return this.usedBranch}this.isBranchResolutionAnalysed=true;const e=this.test.getLiteralValueAtPath(Ss,ks,this);return typeof e==="symbol"?null:this.usedBranch=e?this.consequent:this.alternate}}class ContinueStatement extends NodeBase{hasEffects(e){if(this.label){if(!e.ignore.labels.has(this.label.name))return true;e.includedLabels.add(this.label.name)}else{if(!e.ignore.continues)return true;e.hasContinue=true}e.brokenFlow=true;return false}include(e){this.included=true;if(this.label){this.label.include();e.includedLabels.add(this.label.name)}else{e.hasContinue=true}e.brokenFlow=true}}function hasLoopBodyEffects(e,t){const{brokenFlow:i,hasBreak:s,hasContinue:n,ignore:r}=e;const{breaks:o,continues:l}=r;r.breaks=true;r.continues=true;e.hasBreak=false;e.hasContinue=false;if(t.hasEffects(e))return true;r.breaks=o;r.continues=l;e.hasBreak=s;e.hasContinue=n;e.brokenFlow=i;return false}function includeLoopBody(e,t,i){const{brokenFlow:s,hasBreak:n,hasContinue:r}=e;e.hasBreak=false;e.hasContinue=false;t.include(e,i,{asSingleStatement:true});e.hasBreak=n;e.hasContinue=r;e.brokenFlow=s}class DoWhileStatement extends NodeBase{hasEffects(e){if(this.test.hasEffects(e))return true;return hasLoopBodyEffects(e,this.body)}include(e,t){this.included=true;this.test.include(e,t);includeLoopBody(e,this.body,t)}}class EmptyStatement extends NodeBase{hasEffects(){return false}}class ExportAllDeclaration extends NodeBase{hasEffects(){return false}initialise(){this.context.addExport(this)}render(e,t,i){e.remove(i.start,i.end)}applyDeoptimizations(){}}ExportAllDeclaration.prototype.needsBoundaries=true;class FunctionDeclaration extends FunctionNode{initialise(){super.initialise();if(this.id!==null){this.id.variable.isId=true}}parseNode(e){if(e.id!==null){this.id=new Identifier(e.id,this,this.scope.parent)}super.parseNode(e)}}function getDeclarationStart(e,t){return findNonWhiteSpace(e,findFirstOccurrenceOutsideComment(e,"default",t)+7)}function getFunctionIdInsertPosition(e,t){const i=findFirstOccurrenceOutsideComment(e,"function",t)+"function".length;e=e.slice(i,findFirstOccurrenceOutsideComment(e,"(",i));const s=findFirstOccurrenceOutsideComment(e,"*");if(s===-1){return i}return i+s+1}class ExportDefaultDeclaration extends NodeBase{include(e,t){super.include(e,t);if(t){this.context.includeVariableInModule(this.variable)}}initialise(){const e=this.declaration;this.declarationName=e.id&&e.id.name||this.declaration.name;this.variable=this.scope.addExportDefaultDeclaration(this.declarationName||this.context.getModuleName(),this,this.context);this.context.addExport(this)}render(e,t,i){const{start:s,end:n}=i;const r=getDeclarationStart(e.original,this.start);if(this.declaration instanceof FunctionDeclaration){this.renderNamedDeclaration(e,r,this.declaration.id===null?getFunctionIdInsertPosition(e.original,r):null,t)}else if(this.declaration instanceof ClassDeclaration){this.renderNamedDeclaration(e,r,this.declaration.id===null?findFirstOccurrenceOutsideComment(e.original,"class",s)+"class".length:null,t)}else if(this.variable.getOriginalVariable()!==this.variable){treeshakeNode(this,e,s,n);return}else if(this.variable.included){this.renderVariableDeclaration(e,r,t)}else{e.remove(this.start,r);this.declaration.render(e,t,{renderedSurroundingElement:br});if(e.original[this.end-1]!==";"){e.appendLeft(this.end,";")}return}this.declaration.render(e,t)}applyDeoptimizations(){}renderNamedDeclaration(e,t,i,s){const{exportNamesByVariable:n,format:r,snippets:{getPropertyAccess:o}}=s;const l=this.variable.getName(o);e.remove(this.start,t);if(i!==null){e.appendLeft(i,` ${l}`)}if(r==="system"&&this.declaration instanceof ClassDeclaration&&n.has(this.variable)){e.appendLeft(this.end,` ${getSystemExportStatement([this.variable],s)};`)}}renderVariableDeclaration(e,t,{format:i,exportNamesByVariable:s,snippets:{cnst:n,getPropertyAccess:r}}){const o=e.original.charCodeAt(this.end-1)===59;const l=i==="system"&&s.get(this.variable);if(l){e.overwrite(this.start,t,`${n} ${this.variable.getName(r)} = exports('${l[0]}', `);e.appendRight(o?this.end-1:this.end,")"+(o?"":";"))}else{e.overwrite(this.start,t,`${n} ${this.variable.getName(r)} = `);if(!o){e.appendLeft(this.end,";")}}}}ExportDefaultDeclaration.prototype.needsBoundaries=true;class ExportNamedDeclaration extends NodeBase{bind(){this.declaration?.bind()}hasEffects(e){return!!this.declaration?.hasEffects(e)}initialise(){this.context.addExport(this)}render(e,t,i){const{start:s,end:n}=i;if(this.declaration===null){e.remove(s,n)}else{e.remove(this.start,this.declaration.start);this.declaration.render(e,t,{end:n,start:s})}}applyDeoptimizations(){}}ExportNamedDeclaration.prototype.needsBoundaries=true;class ExportSpecifier extends NodeBase{applyDeoptimizations(){}}class ForInStatement extends NodeBase{createScope(e){this.scope=new BlockScope(e)}hasEffects(e){const{body:t,deoptimized:i,left:s,right:n}=this;if(!i)this.applyDeoptimizations();if(s.hasEffectsAsAssignmentTarget(e,false)||n.hasEffects(e))return true;return hasLoopBodyEffects(e,t)}include(e,t){const{body:i,deoptimized:s,left:n,right:r}=this;if(!s)this.applyDeoptimizations();this.included=true;n.includeAsAssignmentTarget(e,t||true,false);r.include(e,t);includeLoopBody(e,i,t)}initialise(){this.left.setAssignedValue(Ns)}render(e,t){this.left.render(e,t,Ro);this.right.render(e,t,Ro);if(e.original.charCodeAt(this.right.start-1)===110){e.prependLeft(this.right.start," ")}this.body.render(e,t)}applyDeoptimizations(){this.deoptimized=true;this.left.deoptimizePath(Ss);this.context.requestTreeshakingPass()}}class ForOfStatement extends NodeBase{createScope(e){this.scope=new BlockScope(e)}hasEffects(){if(!this.deoptimized)this.applyDeoptimizations();return true}include(e,t){const{body:i,deoptimized:s,left:n,right:r}=this;if(!s)this.applyDeoptimizations();this.included=true;n.includeAsAssignmentTarget(e,t||true,false);r.include(e,t);includeLoopBody(e,i,t)}initialise(){this.left.setAssignedValue(Ns)}render(e,t){this.left.render(e,t,Ro);this.right.render(e,t,Ro);if(e.original.charCodeAt(this.right.start-1)===102){e.prependLeft(this.right.start," ")}this.body.render(e,t)}applyDeoptimizations(){this.deoptimized=true;this.left.deoptimizePath(Ss);this.right.deoptimizePath(As);this.context.requestTreeshakingPass()}}class ForStatement extends NodeBase{createScope(e){this.scope=new BlockScope(e)}hasEffects(e){if(this.init?.hasEffects(e)||this.test?.hasEffects(e)||this.update?.hasEffects(e)){return true}return hasLoopBodyEffects(e,this.body)}include(e,t){this.included=true;this.init?.include(e,t,{asSingleStatement:true});this.test?.include(e,t);this.update?.include(e,t);includeLoopBody(e,this.body,t)}render(e,t){this.init?.render(e,t,Ro);this.test?.render(e,t,Ro);this.update?.render(e,t,Ro);this.body.render(e,t)}}class FunctionExpression extends FunctionNode{render(e,t,{renderedSurroundingElement:i}=Bt){super.render(e,t);if(i===br){e.appendRight(this.start,"(");e.prependLeft(this.end,")")}}}class TrackingScope extends BlockScope{constructor(){super(...arguments);this.hoistedDeclarations=[]}addDeclaration(e,t,i,s){this.hoistedDeclarations.push(e);return super.addDeclaration(e,t,i,s)}}const Do=Symbol("unset");class IfStatement extends NodeBase{constructor(){super(...arguments);this.testValue=Do}deoptimizeCache(){this.testValue=_s}hasEffects(e){if(this.test.hasEffects(e)){return true}const t=this.getTestValue();if(typeof t==="symbol"){const{brokenFlow:t}=e;if(this.consequent.hasEffects(e))return true;const i=e.brokenFlow;e.brokenFlow=t;if(this.alternate===null)return false;if(this.alternate.hasEffects(e))return true;e.brokenFlow=e.brokenFlow&&i;return false}return t?this.consequent.hasEffects(e):!!this.alternate?.hasEffects(e)}include(e,t){this.included=true;if(t){this.includeRecursively(t,e)}else{const t=this.getTestValue();if(typeof t==="symbol"){this.includeUnknownTest(e)}else{this.includeKnownTest(e,t)}}}parseNode(e){this.consequentScope=new TrackingScope(this.scope);this.consequent=new(this.context.getNodeConstructor(e.consequent.type))(e.consequent,this,this.consequentScope);if(e.alternate){this.alternateScope=new TrackingScope(this.scope);this.alternate=new(this.context.getNodeConstructor(e.alternate.type))(e.alternate,this,this.alternateScope)}super.parseNode(e)}render(e,t){const{snippets:{getPropertyAccess:i}}=t;const s=this.getTestValue();const n=[];const r=this.test.included;const o=!this.context.options.treeshake;if(r){this.test.render(e,t)}else{e.remove(this.start,this.consequent.start)}if(this.consequent.included&&(o||typeof s==="symbol"||s)){this.consequent.render(e,t)}else{e.overwrite(this.consequent.start,this.consequent.end,r?";":"");n.push(...this.consequentScope.hoistedDeclarations)}if(this.alternate){if(this.alternate.included&&(o||typeof s==="symbol"||!s)){if(r){if(e.original.charCodeAt(this.alternate.start-1)===101){e.prependLeft(this.alternate.start," ")}}else{e.remove(this.consequent.end,this.alternate.start)}this.alternate.render(e,t)}else{if(r&&this.shouldKeepAlternateBranch()){e.overwrite(this.alternate.start,this.end,";")}else{e.remove(this.consequent.end,this.end)}n.push(...this.alternateScope.hoistedDeclarations)}}this.renderHoistedDeclarations(n,e,i)}applyDeoptimizations(){}getTestValue(){if(this.testValue===Do){return this.testValue=this.test.getLiteralValueAtPath(Ss,ks,this)}return this.testValue}includeKnownTest(e,t){if(this.test.shouldBeIncluded(e)){this.test.include(e,false)}if(t&&this.consequent.shouldBeIncluded(e)){this.consequent.include(e,false,{asSingleStatement:true})}if(!t&&this.alternate?.shouldBeIncluded(e)){this.alternate.include(e,false,{asSingleStatement:true})}}includeRecursively(e,t){this.test.include(t,e);this.consequent.include(t,e);this.alternate?.include(t,e)}includeUnknownTest(e){this.test.include(e,false);const{brokenFlow:t}=e;let i=false;if(this.consequent.shouldBeIncluded(e)){this.consequent.include(e,false,{asSingleStatement:true});i=e.brokenFlow;e.brokenFlow=t}if(this.alternate?.shouldBeIncluded(e)){this.alternate.include(e,false,{asSingleStatement:true});e.brokenFlow=e.brokenFlow&&i}}renderHoistedDeclarations(e,t,i){const s=[...new Set(e.map((e=>{const t=e.variable;return t.included?t.getName(i):""})))].filter(Boolean).join(", ");if(s){const e=this.parent.type;const i=e!==Ir&&e!==fr;t.prependRight(this.start,`${i?"{ ":""}var ${s}; `);if(i){t.appendLeft(this.end,` }`)}}}shouldKeepAlternateBranch(){let e=this.parent;do{if(e instanceof IfStatement&&e.alternate){return true}if(e instanceof BlockStatement){return false}e=e.parent}while(e);return false}}class ImportAttribute extends NodeBase{}class ImportDeclaration extends NodeBase{bind(){}hasEffects(){return false}initialise(){this.context.addImport(this)}render(e,t,i){e.remove(i.start,i.end)}applyDeoptimizations(){}}ImportDeclaration.prototype.needsBoundaries=true;class ImportDefaultSpecifier extends NodeBase{applyDeoptimizations(){}}const Mo="_interopDefault";const Lo="_interopDefaultCompat";const Bo="_interopNamespace";const Fo="_interopNamespaceCompat";const Vo="_interopNamespaceDefault";const zo="_interopNamespaceDefaultOnly";const jo="_mergeNamespaces";const Uo="_documentCurrentScript";const Ho={auto:Mo,compat:Lo,default:null,defaultOnly:null,esModule:null};const isDefaultAProperty=(e,t)=>e==="esModule"||t&&(e==="auto"||e==="compat");const Go={auto:Bo,compat:Fo,default:Vo,defaultOnly:zo,esModule:null};const canDefaultBeTakenFromNamespace=(e,t)=>e!=="esModule"&&isDefaultAProperty(e,t);const getHelpersBlock=(e,t,i,s,n,r,o)=>{const l=new Set(e);for(const e of qo){if(t.has(e)){l.add(e)}}return qo.map((e=>l.has(e)?Wo[e](i,s,n,r,o,l):"")).join("")};const Wo={[Uo](e,{_:t,n:i}){return`var${t}${Uo}${t}=${t}typeof${t}document${t}!==${t}'undefined'${t}?${t}document.currentScript${t}:${t}null;${i}`},[Lo](e,t,i){const{_:s,getDirectReturnFunction:n,n:r}=t;const[o,l]=n(["e"],{functionReturn:true,lineBreakIndent:null,name:Lo});return`${o}${getIsCompatNamespace(t)}${s}?${s}`+`${i?getDefaultLiveBinding(t):getDefaultStatic(t)}${l}${r}${r}`},[Mo](e,t,i){const{_:s,getDirectReturnFunction:n,n:r}=t;const[o,l]=n(["e"],{functionReturn:true,lineBreakIndent:null,name:Mo});return`${o}e${s}&&${s}e.__esModule${s}?${s}`+`${i?getDefaultLiveBinding(t):getDefaultStatic(t)}${l}${r}${r}`},[Fo](e,t,i,s,n,r){const{_:o,getDirectReturnFunction:l,n:c}=t;if(r.has(Vo)){const[e,i]=l(["e"],{functionReturn:true,lineBreakIndent:null,name:Fo});return`${e}${getIsCompatNamespace(t)}${o}?${o}e${o}:${o}${Vo}(e)${i}${c}${c}`}return`function ${Fo}(e)${o}{${c}`+`${e}if${o}(${getIsCompatNamespace(t)})${o}return e;${c}`+createNamespaceObject(e,e,t,i,s,n)+`}${c}${c}`},[zo](e,t,i,s,n){const{getDirectReturnFunction:r,getObject:o,n:l}=t;const[c,u]=r(["e"],{functionReturn:true,lineBreakIndent:null,name:zo});return`${c}${getFrozen(s,getWithToStringTag(n,o([["__proto__","null"],["default","e"]],{lineBreakIndent:null}),t))}${u}${l}${l}`},[Vo](e,t,i,s,n){const{_:r,n:o}=t;return`function ${Vo}(e)${r}{${o}`+createNamespaceObject(e,e,t,i,s,n)+`}${o}${o}`},[Bo](e,t,i,s,n,r){const{_:o,getDirectReturnFunction:l,n:c}=t;if(r.has(Vo)){const[e,t]=l(["e"],{functionReturn:true,lineBreakIndent:null,name:Bo});return`${e}e${o}&&${o}e.__esModule${o}?${o}e${o}:${o}${Vo}(e)${t}${c}${c}`}return`function ${Bo}(e)${o}{${c}`+`${e}if${o}(e${o}&&${o}e.__esModule)${o}return e;${c}`+createNamespaceObject(e,e,t,i,s,n)+`}${c}${c}`},[jo](e,t,i,s,n){const{_:r,cnst:o,n:l}=t;const c=o==="var"&&i;return`function ${jo}(n, m)${r}{${l}`+`${e}${loopOverNamespaces(`{${l}`+`${e}${e}${e}if${r}(k${r}!==${r}'default'${r}&&${r}!(k in n))${r}{${l}`+(i?c?copyOwnPropertyLiveBinding:copyPropertyLiveBinding:copyPropertyStatic)(e,e+e+e+e,t)+`${e}${e}${e}}${l}`+`${e}${e}}`,c,e,t)}${l}`+`${e}return ${getFrozen(s,getWithToStringTag(n,"n",t))};${l}`+`}${l}${l}`}};const getDefaultLiveBinding=({_:e,getObject:t})=>`e${e}:${e}${t([["default","e"]],{lineBreakIndent:null})}`;const getDefaultStatic=({_:e,getPropertyAccess:t})=>`e${t("default")}${e}:${e}e`;const getIsCompatNamespace=({_:e})=>`e${e}&&${e}typeof e${e}===${e}'object'${e}&&${e}'default'${e}in e`;const createNamespaceObject=(e,t,i,s,n,r)=>{const{_:o,cnst:l,getObject:c,getPropertyAccess:u,n:h,s:d}=i;const p=`{${h}`+(s?copyNonDefaultOwnPropertyLiveBinding:copyPropertyStatic)(e,t+e+e,i)+`${t}${e}}`;return`${t}${l} n${o}=${o}Object.create(null${r?`,${o}{${o}[Symbol.toStringTag]:${o}${getToStringTagValue(c)}${o}}`:""});${h}`+`${t}if${o}(e)${o}{${h}`+`${t}${e}${loopOverKeys(p,!s,i)}${h}`+`${t}}${h}`+`${t}n${u("default")}${o}=${o}e;${h}`+`${t}return ${getFrozen(n,"n")}${d}${h}`};const loopOverKeys=(e,t,{_:i,cnst:s,getFunctionIntro:n,s:r})=>s!=="var"||t?`for${i}(${s} k in e)${i}${e}`:`Object.keys(e).forEach(${n(["k"],{isAsync:false,name:null})}${e})${r}`;const loopOverNamespaces=(e,t,i,{_:s,cnst:n,getDirectReturnFunction:r,getFunctionIntro:o,n:l})=>{if(t){const[t,n]=r(["e"],{functionReturn:false,lineBreakIndent:{base:i,t:i},name:null});return`m.forEach(${t}`+`e${s}&&${s}typeof e${s}!==${s}'string'${s}&&${s}!Array.isArray(e)${s}&&${s}Object.keys(e).forEach(${o(["k"],{isAsync:false,name:null})}${e})${n});`}return`for${s}(var i${s}=${s}0;${s}i${s}<${s}m.length;${s}i++)${s}{${l}`+`${i}${i}${n} e${s}=${s}m[i];${l}`+`${i}${i}if${s}(typeof e${s}!==${s}'string'${s}&&${s}!Array.isArray(e))${s}{${s}for${s}(${n} k in e)${s}${e}${s}}${l}${i}}`};const copyNonDefaultOwnPropertyLiveBinding=(e,t,i)=>{const{_:s,n:n}=i;return`${t}if${s}(k${s}!==${s}'default')${s}{${n}`+copyOwnPropertyLiveBinding(e,t+e,i)+`${t}}${n}`};const copyOwnPropertyLiveBinding=(e,t,{_:i,cnst:s,getDirectReturnFunction:n,n:r})=>{const[o,l]=n([],{functionReturn:true,lineBreakIndent:null,name:null});return`${t}${s} d${i}=${i}Object.getOwnPropertyDescriptor(e,${i}k);${r}`+`${t}Object.defineProperty(n,${i}k,${i}d.get${i}?${i}d${i}:${i}{${r}`+`${t}${e}enumerable:${i}true,${r}`+`${t}${e}get:${i}${o}e[k]${l}${r}`+`${t}});${r}`};const copyPropertyLiveBinding=(e,t,{_:i,cnst:s,getDirectReturnFunction:n,n:r})=>{const[o,l]=n([],{functionReturn:true,lineBreakIndent:null,name:null});return`${t}${s} d${i}=${i}Object.getOwnPropertyDescriptor(e,${i}k);${r}`+`${t}if${i}(d)${i}{${r}`+`${t}${e}Object.defineProperty(n,${i}k,${i}d.get${i}?${i}d${i}:${i}{${r}`+`${t}${e}${e}enumerable:${i}true,${r}`+`${t}${e}${e}get:${i}${o}e[k]${l}${r}`+`${t}${e}});${r}`+`${t}}${r}`};const copyPropertyStatic=(e,t,{_:i,n:s})=>`${t}n[k]${i}=${i}e[k];${s}`;const getFrozen=(e,t)=>e?`Object.freeze(${t})`:t;const getWithToStringTag=(e,t,{_:i,getObject:s})=>e?`Object.defineProperty(${t},${i}Symbol.toStringTag,${i}${getToStringTagValue(s)})`:t;const qo=Object.keys(Wo);function getToStringTagValue(e){return e([["value","'Module'"]],{lineBreakIndent:null})}function isReassignedExportsMember(e,t){return e.renderBaseName!==null&&t.has(e)&&e.isReassigned}class VariableDeclarator extends NodeBase{declareDeclarator(e){this.id.declare(e,this.init||Xn)}deoptimizePath(e){this.id.deoptimizePath(e)}hasEffects(e){if(!this.deoptimized)this.applyDeoptimizations();const t=this.init?.hasEffects(e);this.id.markDeclarationReached();return t||this.id.hasEffects(e)}include(e,t){const{deoptimized:i,id:s,init:n}=this;if(!i)this.applyDeoptimizations();this.included=true;n?.include(e,t);s.markDeclarationReached();if(t||s.shouldBeIncluded(e)){s.include(e,t)}}render(e,t){const{exportNamesByVariable:i,snippets:{_:s,getPropertyAccess:n}}=t;const{end:r,id:o,init:l,start:c}=this;const u=o.included;if(u){o.render(e,t)}else{const t=findFirstOccurrenceOutsideComment(e.original,"=",o.end);e.remove(c,findNonWhiteSpace(e.original,t+1))}if(l){if(o instanceof Identifier&&l instanceof ClassExpression&&!l.id){const t=o.variable.getName(n);if(t!==o.name){e.appendLeft(l.start+5,` ${o.name}`)}}l.render(e,t,u?Bt:{renderedSurroundingElement:br})}else if(o instanceof Identifier&&isReassignedExportsMember(o.variable,i)){e.appendLeft(r,`${s}=${s}void 0`)}}applyDeoptimizations(){this.deoptimized=true;const{id:e,init:t}=this;if(t&&e instanceof Identifier&&t instanceof ClassExpression&&!t.id){const{name:i,variable:s}=e;for(const e of t.scope.accessedOutsideVariables.values()){if(e!==s){e.forbidName(i)}}}}}class ImportExpression extends NodeBase{constructor(){super(...arguments);this.inlineNamespace=null;this.assertions=null;this.mechanism=null;this.namespaceExportName=undefined;this.resolution=null;this.resolutionString=null}bind(){this.source.bind()}getDeterministicImportedNames(){const e=this.parent;if(e instanceof ExpressionStatement){return Vt}if(e instanceof AwaitExpression){const t=e.parent;if(t instanceof ExpressionStatement){return Vt}if(t instanceof VariableDeclarator){const e=t.id;return e instanceof ObjectPattern?getDeterministicObjectDestructure(e):undefined}if(t instanceof MemberExpression){const e=t.property;if(!t.computed&&e instanceof Identifier){return[e.name]}}return}if(e instanceof MemberExpression){const t=e.parent;const i=e.property;if(!(t instanceof CallExpression)||!(i instanceof Identifier)){return}const s=i.name;if(t.parent instanceof ExpressionStatement&&["catch","finally"].includes(s)){return Vt}if(s!=="then")return;if(t.arguments.length===0){return Vt}const n=t.arguments[0];if(t.arguments.length!==1||!(n instanceof ArrowFunctionExpression||n instanceof FunctionExpression)){return}if(n.params.length===0){return Vt}const r=n.params[0];if(n.params.length===1&&r instanceof ObjectPattern){return getDeterministicObjectDestructure(r)}return}}hasEffects(){return true}include(e,t){if(!this.included){this.included=true;this.context.includeDynamicImport(this);this.scope.addAccessedDynamicImport(this)}this.source.include(e,t)}initialise(){this.context.addDynamicImport(this)}parseNode(e){super.parseNode(e,["source"])}render(e,t){const{snippets:{_:i,getDirectReturnFunction:s,getObject:n,getPropertyAccess:r}}=t;if(this.inlineNamespace){const[t,i]=s([],{functionReturn:true,lineBreakIndent:null,name:null});e.overwrite(this.start,this.end,`Promise.resolve().then(${t}${this.inlineNamespace.getName(r)}${i})`);return}if(this.mechanism){e.overwrite(this.start,findFirstOccurrenceOutsideComment(e.original,"(",this.start+6)+1,this.mechanism.left);e.overwrite(this.end-1,this.end,this.mechanism.right)}if(this.resolutionString){e.overwrite(this.source.start,this.source.end,this.resolutionString);if(this.namespaceExportName){const[t,i]=s(["n"],{functionReturn:true,lineBreakIndent:null,name:null});e.prependLeft(this.end,`.then(${t}n.${this.namespaceExportName}${i})`)}}else{this.source.render(e,t)}if(this.assertions!==true){if(this.arguments){e.overwrite(this.source.end,this.end-1,"",{contentOnly:true})}if(this.assertions){e.appendLeft(this.end-1,`,${i}${n([["assert",this.assertions]],{lineBreakIndent:null})}`)}}}setExternalResolution(e,t,i,s,n,r,o,l,c){const{format:u}=i;this.inlineNamespace=null;this.resolution=t;this.resolutionString=o;this.namespaceExportName=l;this.assertions=c;const h=[...Ko[u]||[]];let d;({helper:d,mechanism:this.mechanism}=this.getDynamicImportMechanismAndHelper(t,e,i,s,n));if(d){h.push(d)}if(h.length>0){this.scope.addAccessedGlobals(h,r)}}setInternalResolution(e){this.inlineNamespace=e}applyDeoptimizations(){}getDynamicImportMechanismAndHelper(e,t,{compact:i,dynamicImportFunction:s,dynamicImportInCjs:n,format:r,generatedCode:{arrowFunctions:o},interop:l},{_:c,getDirectReturnFunction:u,getDirectReturnIifeLeft:h},d){const p=d.hookFirstSync("renderDynamicImport",[{customResolution:typeof this.resolution==="string"?this.resolution:null,format:r,moduleId:this.context.module.id,targetModuleId:this.resolution&&typeof this.resolution!=="string"?this.resolution.id:null}]);if(p){return{helper:null,mechanism:p}}const f=!this.resolution||typeof this.resolution==="string";switch(r){case"cjs":{if(n&&(!e||typeof e==="string"||e instanceof ExternalModule)){return{helper:null,mechanism:null}}const i=getInteropHelper(e,t,l);let s=`require(`;let r=`)`;if(i){s=`/*#__PURE__*/${i}(${s}`;r+=")"}const[c,d]=u([],{functionReturn:true,lineBreakIndent:null,name:null});s=`Promise.resolve().then(${c}${s}`;r+=`${d})`;if(!o&&f){s=h(["t"],`${s}t${r}`,{needsArrowReturnParens:false,needsWrappedFunction:true});r=")"}return{helper:i,mechanism:{left:s,right:r}}}case"amd":{const s=i?"c":"resolve";const n=i?"e":"reject";const r=getInteropHelper(e,t,l);const[d,p]=u(["m"],{functionReturn:false,lineBreakIndent:null,name:null});const m=r?`${d}${s}(/*#__PURE__*/${r}(m))${p}`:s;const[g,y]=u([s,n],{functionReturn:false,lineBreakIndent:null,name:null});let E=`new Promise(${g}require([`;let x=`],${c}${m},${c}${n})${y})`;if(!o&&f){E=h(["t"],`${E}t${x}`,{needsArrowReturnParens:false,needsWrappedFunction:true});x=")"}return{helper:r,mechanism:{left:E,right:x}}}case"system":{return{helper:null,mechanism:{left:"module.import(",right:")"}}}case"es":{if(s){return{helper:null,mechanism:{left:`${s}(`,right:")"}}}}}return{helper:null,mechanism:null}}}function getInteropHelper(e,t,i){return t==="external"?Go[i(e instanceof ExternalModule?e.id:null)]:t==="default"?zo:null}const Ko={amd:["require"],cjs:["require"],system:["module"]};function getDeterministicObjectDestructure(e){const t=[];for(const i of e.properties){if(i.type==="RestElement"||i.computed||i.key.type!=="Identifier")return;t.push(i.key.name)}return t}class ImportNamespaceSpecifier extends NodeBase{applyDeoptimizations(){}}class ImportSpecifier extends NodeBase{applyDeoptimizations(){}}class LabeledStatement extends NodeBase{hasEffects(e){const t=e.brokenFlow;e.ignore.labels.add(this.label.name);if(this.body.hasEffects(e))return true;e.ignore.labels.delete(this.label.name);if(e.includedLabels.has(this.label.name)){e.includedLabels.delete(this.label.name);e.brokenFlow=t}return false}include(e,t){this.included=true;const i=e.brokenFlow;this.body.include(e,t);if(t||e.includedLabels.has(this.label.name)){this.label.include();e.includedLabels.delete(this.label.name);e.brokenFlow=i}}render(e,t){if(this.label.included){this.label.render(e,t)}else{e.remove(this.start,findNonWhiteSpace(e.original,findFirstOccurrenceOutsideComment(e.original,":",this.label.end)+1))}this.body.render(e,t)}}class LogicalExpression extends NodeBase{constructor(){super(...arguments);this.expressionsToBeDeoptimized=[];this.isBranchResolutionAnalysed=false;this.usedBranch=null}deoptimizeArgumentsOnInteractionAtPath(e,t,i){this.left.deoptimizeArgumentsOnInteractionAtPath(e,t,i);this.right.deoptimizeArgumentsOnInteractionAtPath(e,t,i)}deoptimizeCache(){if(this.usedBranch){const e=this.usedBranch===this.left?this.right:this.left;this.usedBranch=null;e.deoptimizePath(As);const{context:t,expressionsToBeDeoptimized:i}=this;this.expressionsToBeDeoptimized=Vt;for(const e of i){e.deoptimizeCache()}t.requestTreeshakingPass()}}deoptimizePath(e){const t=this.getUsedBranch();if(t){t.deoptimizePath(e)}else{this.left.deoptimizePath(e);this.right.deoptimizePath(e)}}getLiteralValueAtPath(e,t,i){const s=this.getUsedBranch();if(!s)return _s;this.expressionsToBeDeoptimized.push(i);return s.getLiteralValueAtPath(e,t,i)}getReturnExpressionWhenCalledAtPath(e,t,i,s){const n=this.getUsedBranch();if(!n)return[new MultiExpression([this.left.getReturnExpressionWhenCalledAtPath(e,t,i,s)[0],this.right.getReturnExpressionWhenCalledAtPath(e,t,i,s)[0]]),false];this.expressionsToBeDeoptimized.push(s);return n.getReturnExpressionWhenCalledAtPath(e,t,i,s)}hasEffects(e){if(this.left.hasEffects(e)){return true}if(this.getUsedBranch()!==this.left){return this.right.hasEffects(e)}return false}hasEffectsOnInteractionAtPath(e,t,i){const s=this.getUsedBranch();if(!s){return this.left.hasEffectsOnInteractionAtPath(e,t,i)||this.right.hasEffectsOnInteractionAtPath(e,t,i)}return s.hasEffectsOnInteractionAtPath(e,t,i)}include(e,t){this.included=true;const i=this.getUsedBranch();if(t||i===this.right&&this.left.shouldBeIncluded(e)||!i){this.left.include(e,t);this.right.include(e,t)}else{i.include(e,t)}}render(e,t,{isCalleeOfRenderedParent:i,preventASI:s,renderedParentType:n,renderedSurroundingElement:r}=Bt){if(!this.left.included||!this.right.included){const o=findFirstOccurrenceOutsideComment(e.original,this.operator,this.left.end);if(this.right.included){const t=findNonWhiteSpace(e.original,o+2);e.remove(this.start,t);if(s){removeLineBreaks(e,t,this.right.start)}}else{e.remove(o,this.end)}removeAnnotations(this,e);this.getUsedBranch().render(e,t,{isCalleeOfRenderedParent:i,preventASI:s,renderedParentType:n||this.parent.type,renderedSurroundingElement:r||this.parent.type})}else{this.left.render(e,t,{preventASI:s,renderedSurroundingElement:r});this.right.render(e,t)}}getUsedBranch(){if(!this.isBranchResolutionAnalysed){this.isBranchResolutionAnalysed=true;const e=this.left.getLiteralValueAtPath(Ss,ks,this);if(typeof e==="symbol"){return null}else{this.usedBranch=this.operator==="||"&&e||this.operator==="&&"&&!e||this.operator==="??"&&e!=null?this.left:this.right}}return this.usedBranch}}const Yo="ROLLUP_FILE_URL_";const Qo="import";class MetaProperty extends NodeBase{constructor(){super(...arguments);this.metaProperty=null;this.preliminaryChunkId=null;this.referenceId=null}getReferencedFileName(e){const{meta:{name:t},metaProperty:i}=this;if(t===Qo&&i?.startsWith(Yo)){return e.getFileName(i.slice(Yo.length))}return null}hasEffects(){return false}hasEffectsOnInteractionAtPath(e,{type:t}){return e.length>1||t!==$s}include(){if(!this.included){this.included=true;if(this.meta.name===Qo){this.context.addImportMeta(this);const e=this.parent;const t=this.metaProperty=e instanceof MemberExpression&&typeof e.propertyKey==="string"?e.propertyKey:null;if(t?.startsWith(Yo)){this.referenceId=t.slice(Yo.length)}}}}render(e,t){const{format:i,pluginDriver:s,snippets:n}=t;const{context:{module:o},meta:{name:l},metaProperty:c,parent:u,preliminaryChunkId:h,referenceId:d,start:p,end:f}=this;const{id:m}=o;if(l!==Qo)return;const g=h;if(d){const t=s.getFileName(d);const n=normalize(r.relative(r.dirname(g),t));const o=s.hookFirstSync("resolveFileUrl",[{chunkId:g,fileName:t,format:i,moduleId:m,referenceId:d,relativePath:n}])||ea[i](n);e.overwrite(u.start,u.end,o,{contentOnly:true});return}let y=s.hookFirstSync("resolveImportMeta",[c,{chunkId:g,format:i,moduleId:m}]);if(!y){y=ta[i]?.(c,{chunkId:g,snippets:n});t.accessedDocumentCurrentScript||(t.accessedDocumentCurrentScript=Xo.includes(i)&&y!=="undefined")}if(typeof y==="string"){if(u instanceof MemberExpression){e.overwrite(u.start,u.end,y,{contentOnly:true})}else{e.overwrite(p,f,y,{contentOnly:true})}}}setResolution(e,t,i){this.preliminaryChunkId=i;const s=(this.metaProperty?.startsWith(Yo)?Jo:Zo)[e];if(s.length>0){this.scope.addAccessedGlobals(s,t)}}}const Xo=["cjs","iife","umd"];const Zo={amd:["document","module","URL"],cjs:["document","require","URL",Uo],es:[],iife:["document","URL",Uo],system:["module"],umd:["document","require","URL",Uo]};const Jo={amd:["document","require","URL"],cjs:["document","require","URL"],es:[],iife:["document","URL"],system:["module","URL"],umd:["document","require","URL"]};const getResolveUrl=(e,t="URL")=>`new ${t}(${e}).href`;const getRelativeUrlFromDocument=(e,t=false)=>getResolveUrl(`'${escapeId(e)}', ${t?`typeof document === 'undefined' ? location.href : `:""}document.currentScript && document.currentScript.src || document.baseURI`);const getGenericImportMetaMechanism=e=>(t,{chunkId:i})=>{const s=e(i);return t===null?`({ url: ${s} })`:t==="url"?s:"undefined"};const getFileUrlFromFullPath=e=>`require('u' + 'rl').pathToFileURL(${e}).href`;const getFileUrlFromRelativePath=e=>getFileUrlFromFullPath(`__dirname + '/${e}'`);const getUrlFromDocument=(e,t=false)=>`${t?`typeof document === 'undefined' ? location.href : `:""}(${Uo} && ${Uo}.src || new URL('${escapeId(e)}', document.baseURI).href)`;const ea={amd:e=>{if(e[0]!==".")e="./"+e;return getResolveUrl(`require.toUrl('${e}'), document.baseURI`)},cjs:e=>`(typeof document === 'undefined' ? ${getFileUrlFromRelativePath(e)} : ${getRelativeUrlFromDocument(e)})`,es:e=>getResolveUrl(`'${e}', import.meta.url`),iife:e=>getRelativeUrlFromDocument(e),system:e=>getResolveUrl(`'${e}', module.meta.url`),umd:e=>`(typeof document === 'undefined' && typeof location === 'undefined' ? ${getFileUrlFromRelativePath(e)} : ${getRelativeUrlFromDocument(e,true)})`};const ta={amd:getGenericImportMetaMechanism((()=>getResolveUrl(`module.uri, document.baseURI`))),cjs:getGenericImportMetaMechanism((e=>`(typeof document === 'undefined' ? ${getFileUrlFromFullPath("__filename")} : ${getUrlFromDocument(e)})`)),iife:getGenericImportMetaMechanism((e=>getUrlFromDocument(e))),system:(e,{snippets:{getPropertyAccess:t}})=>e===null?`module.meta`:`module.meta${t(e)}`,umd:getGenericImportMetaMechanism((e=>`(typeof document === 'undefined' && typeof location === 'undefined' ? ${getFileUrlFromFullPath("__filename")} : ${getUrlFromDocument(e,true)})`))};class NewExpression extends NodeBase{hasEffects(e){try{for(const t of this.arguments){if(t.hasEffects(e))return true}if(this.annotationPure){return false}return this.callee.hasEffects(e)||this.callee.hasEffectsOnInteractionAtPath(Ss,this.interaction,e)}finally{if(!this.deoptimized)this.applyDeoptimizations()}}hasEffectsOnInteractionAtPath(e,{type:t}){return e.length>0||t!==$s}include(e,t){if(!this.deoptimized)this.applyDeoptimizations();if(t){super.include(e,t)}else{this.included=true;this.callee.include(e,false)}this.callee.includeCallArguments(e,this.arguments)}initialise(){this.interaction={args:[null,...this.arguments],type:Ts,withNew:true}}render(e,t){this.callee.render(e,t);renderCallArguments(e,t,this)}applyDeoptimizations(){this.deoptimized=true;this.callee.deoptimizeArgumentsOnInteractionAtPath(this.interaction,Ss,ks);this.context.requestTreeshakingPass()}}class ObjectExpression extends NodeBase{constructor(){super(...arguments);this.objectEntity=null}deoptimizeArgumentsOnInteractionAtPath(e,t,i){this.getObjectEntity().deoptimizeArgumentsOnInteractionAtPath(e,t,i)}deoptimizeCache(){this.getObjectEntity().deoptimizeAllProperties()}deoptimizePath(e){this.getObjectEntity().deoptimizePath(e)}getLiteralValueAtPath(e,t,i){return this.getObjectEntity().getLiteralValueAtPath(e,t,i)}getReturnExpressionWhenCalledAtPath(e,t,i,s){return this.getObjectEntity().getReturnExpressionWhenCalledAtPath(e,t,i,s)}hasEffectsOnInteractionAtPath(e,t,i){return this.getObjectEntity().hasEffectsOnInteractionAtPath(e,t,i)}render(e,t,{renderedSurroundingElement:i}=Bt){super.render(e,t);if(i===br||i===dr){e.appendRight(this.start,"(");e.prependLeft(this.end,")")}}applyDeoptimizations(){}getObjectEntity(){if(this.objectEntity!==null){return this.objectEntity}let e=qr;const t=[];for(const i of this.properties){if(i instanceof SpreadElement){t.push({key:Es,kind:"init",property:i});continue}let s;if(i.computed){const e=i.key.getLiteralValueAtPath(Ss,ks,this);if(typeof e==="symbol"){t.push({key:Es,kind:i.kind,property:i});continue}else{s=String(e)}}else{s=i.key instanceof Identifier?i.key.name:String(i.key.value);if(s==="__proto__"&&i.kind==="init"){e=i.value instanceof Literal&&i.value.value===null?null:i.value;continue}}t.push({key:s,kind:i.kind,property:i})}return this.objectEntity=new ObjectEntity(t,e)}}class PrivateIdentifier extends NodeBase{}class Program extends NodeBase{constructor(){super(...arguments);this.hasCachedEffect=null;this.hasLoggedEffect=false}hasCachedEffects(){if(!this.included){return false}return this.hasCachedEffect===null?this.hasCachedEffect=this.hasEffects(createHasEffectsContext()):this.hasCachedEffect}hasEffects(e){for(const t of this.body){if(t.hasEffects(e)){if(this.context.options.experimentalLogSideEffects&&!this.hasLoggedEffect){this.hasLoggedEffect=true;const{code:e,log:i,module:s}=this.context;i(S,logFirstSideEffect(e,s.id,locate(e,t.start,{offsetLine:1})),t.start)}return this.hasCachedEffect=true}}return false}include(e,t){this.included=true;for(const i of this.body){if(t||i.shouldBeIncluded(e)){i.include(e,t)}}}render(e,t){let i=this.start;if(e.original.startsWith("#!")){i=Math.min(e.original.indexOf("\n")+1,this.end);e.remove(0,i)}if(this.body.length>0){while(e.original[i]==="/"&&/[*/]/.test(e.original[i+1])){const t=findFirstLineBreakOutsideComment(e.original.slice(i,this.body[0].start));if(t[0]===-1){break}i+=t[1]}renderStatementList(this.body,e,i,this.end,t)}else{super.render(e,t)}}applyDeoptimizations(){}}class Property extends MethodBase{constructor(){super(...arguments);this.declarationInit=null}declare(e,t){this.declarationInit=t;return this.value.declare(e,Ns)}hasEffects(e){if(!this.deoptimized)this.applyDeoptimizations();const t=this.context.options.treeshake.propertyReadSideEffects;return this.parent.type==="ObjectPattern"&&t==="always"||this.key.hasEffects(e)||this.value.hasEffects(e)}markDeclarationReached(){this.value.markDeclarationReached()}render(e,t){if(!this.shorthand){this.key.render(e,t)}this.value.render(e,t,{isShorthandProperty:this.shorthand})}applyDeoptimizations(){this.deoptimized=true;if(this.declarationInit!==null){this.declarationInit.deoptimizePath([Es,Es]);this.context.requestTreeshakingPass()}}}class PropertyDefinition extends NodeBase{deoptimizeArgumentsOnInteractionAtPath(e,t,i){this.value?.deoptimizeArgumentsOnInteractionAtPath(e,t,i)}deoptimizePath(e){this.value?.deoptimizePath(e)}getLiteralValueAtPath(e,t,i){return this.value?this.value.getLiteralValueAtPath(e,t,i):_s}getReturnExpressionWhenCalledAtPath(e,t,i,s){return this.value?this.value.getReturnExpressionWhenCalledAtPath(e,t,i,s):Rs}hasEffects(e){return this.key.hasEffects(e)||this.static&&!!this.value?.hasEffects(e)}hasEffectsOnInteractionAtPath(e,t,i){return!this.value||this.value.hasEffectsOnInteractionAtPath(e,t,i)}applyDeoptimizations(){}}class ReturnStatement extends NodeBase{hasEffects(e){if(!e.ignore.returnYield||this.argument?.hasEffects(e))return true;e.brokenFlow=true;return false}include(e,t){this.included=true;this.argument?.include(e,t);e.brokenFlow=true}initialise(){this.scope.addReturnExpression(this.argument||Ns)}render(e,t){if(this.argument){this.argument.render(e,t,{preventASI:true});if(this.argument.start===this.start+6){e.prependLeft(this.start+6," ")}}}}class SequenceExpression extends NodeBase{deoptimizeArgumentsOnInteractionAtPath(e,t,i){this.expressions[this.expressions.length-1].deoptimizeArgumentsOnInteractionAtPath(e,t,i)}deoptimizePath(e){this.expressions[this.expressions.length-1].deoptimizePath(e)}getLiteralValueAtPath(e,t,i){return this.expressions[this.expressions.length-1].getLiteralValueAtPath(e,t,i)}hasEffects(e){for(const t of this.expressions){if(t.hasEffects(e))return true}return false}hasEffectsOnInteractionAtPath(e,t,i){return this.expressions[this.expressions.length-1].hasEffectsOnInteractionAtPath(e,t,i)}include(e,t){this.included=true;const i=this.expressions[this.expressions.length-1];for(const s of this.expressions){if(t||s===i&&!(this.parent instanceof ExpressionStatement)||s.shouldBeIncluded(e))s.include(e,t)}}render(e,t,{renderedParentType:i,isCalleeOfRenderedParent:s,preventASI:n}=Bt){let r=0;let o=null;const l=this.expressions[this.expressions.length-1];for(const{node:c,separator:u,start:h,end:d}of getCommaSeparatedNodesWithBoundaries(this.expressions,e,this.start,this.end)){if(!c.included){treeshakeNode(c,e,h,d);continue}r++;o=u;if(r===1&&n){removeLineBreaks(e,h,c.start)}if(r===1){const n=i||this.parent.type;c.render(e,t,{isCalleeOfRenderedParent:s&&c===l,renderedParentType:n,renderedSurroundingElement:n})}else{c.render(e,t)}}if(o){e.remove(o,this.end)}}}class StaticBlock extends NodeBase{createScope(e){this.scope=new BlockScope(e)}hasEffects(e){for(const t of this.body){if(t.hasEffects(e))return true}return false}include(e,t){this.included=true;for(const i of this.body){if(t||i.shouldBeIncluded(e))i.include(e,t)}}render(e,t){if(this.body.length>0){const i=findFirstOccurrenceOutsideComment(e.original.slice(this.start,this.end),"{")+1;renderStatementList(this.body,e,this.start+i,this.end-1,t)}else{super.render(e,t)}}}class Super extends NodeBase{bind(){this.variable=this.scope.findVariable("this")}deoptimizeArgumentsOnInteractionAtPath(e,t,i){this.variable.deoptimizeArgumentsOnInteractionAtPath(e,t,i)}deoptimizePath(e){this.variable.deoptimizePath(e)}include(){if(!this.included){this.included=true;this.context.includeVariableInModule(this.variable)}}}class SwitchCase extends NodeBase{hasEffects(e){if(this.test?.hasEffects(e))return true;for(const t of this.consequent){if(e.brokenFlow)break;if(t.hasEffects(e))return true}return false}include(e,t){this.included=true;this.test?.include(e,t);for(const i of this.consequent){if(t||i.shouldBeIncluded(e))i.include(e,t)}}render(e,t,i){if(this.consequent.length>0){this.test&&this.test.render(e,t);const s=this.test?this.test.end:findFirstOccurrenceOutsideComment(e.original,"default",this.start)+7;const n=findFirstOccurrenceOutsideComment(e.original,":",s)+1;renderStatementList(this.consequent,e,n,i.end,t)}else{super.render(e,t)}}}SwitchCase.prototype.needsBoundaries=true;class SwitchStatement extends NodeBase{createScope(e){this.parentScope=e;this.scope=new BlockScope(e)}hasEffects(e){if(this.discriminant.hasEffects(e))return true;const{brokenFlow:t,hasBreak:i,ignore:s}=e;const{breaks:n}=s;s.breaks=true;e.hasBreak=false;let r=true;for(const i of this.cases){if(i.hasEffects(e))return true;r&&(r=e.brokenFlow&&!e.hasBreak);e.hasBreak=false;e.brokenFlow=t}if(this.defaultCase!==null){e.brokenFlow=r}s.breaks=n;e.hasBreak=i;return false}include(e,t){this.included=true;this.discriminant.include(e,t);const{brokenFlow:i,hasBreak:s}=e;e.hasBreak=false;let n=true;let r=t||this.defaultCase!==null&&this.defaultCase<this.cases.length-1;for(let s=this.cases.length-1;s>=0;s--){const o=this.cases[s];if(o.included){r=true}if(!r){const e=createHasEffectsContext();e.ignore.breaks=true;r=o.hasEffects(e)}if(r){o.include(e,t);n&&(n=e.brokenFlow&&!e.hasBreak);e.hasBreak=false;e.brokenFlow=i}else{n=i}}if(r&&this.defaultCase!==null){e.brokenFlow=n}e.hasBreak=s}initialise(){for(let e=0;e<this.cases.length;e++){if(this.cases[e].test===null){this.defaultCase=e;return}}this.defaultCase=null}parseNode(e){this.discriminant=new(this.context.getNodeConstructor(e.discriminant.type))(e.discriminant,this,this.parentScope);super.parseNode(e)}render(e,t){this.discriminant.render(e,t);if(this.cases.length>0){renderStatementList(this.cases,e,this.cases[0].start,this.end-1,t)}}}class TaggedTemplateExpression extends CallExpressionBase{bind(){super.bind();if(this.tag.type===Sr){const e=this.tag.name;const t=this.scope.findVariable(e);if(t.isNamespace){this.context.log(v,logCannotCallNamespace(e),this.start)}}}hasEffects(e){try{for(const t of this.quasi.expressions){if(t.hasEffects(e))return true}return this.tag.hasEffects(e)||this.tag.hasEffectsOnInteractionAtPath(Ss,this.interaction,e)}finally{if(!this.deoptimized)this.applyDeoptimizations()}}include(e,t){if(!this.deoptimized)this.applyDeoptimizations();if(t){super.include(e,t)}else{this.included=true;this.tag.include(e,t);this.quasi.include(e,t)}this.tag.includeCallArguments(e,this.args);const[i]=this.getReturnExpression();if(!i.included){i.include(e,false)}}initialise(){this.args=[Ns,...this.quasi.expressions];this.interaction={args:[this.tag instanceof MemberExpression&&!this.tag.variable?this.tag.object:null,...this.args],type:Ts,withNew:false}}render(e,t){this.tag.render(e,t,{isCalleeOfRenderedParent:true});this.quasi.render(e,t)}applyDeoptimizations(){this.deoptimized=true;this.tag.deoptimizeArgumentsOnInteractionAtPath(this.interaction,Ss,ks);this.context.requestTreeshakingPass()}getReturnExpression(e=ks){if(this.returnExpression===null){this.returnExpression=Rs;return this.returnExpression=this.tag.getReturnExpressionWhenCalledAtPath(Ss,this.interaction,e,this)}return this.returnExpression}}class TemplateElement extends NodeBase{bind(){}hasEffects(){return false}include(){this.included=true}parseNode(e){this.value=e.value;super.parseNode(e)}render(){}}class TemplateLiteral extends NodeBase{deoptimizeArgumentsOnInteractionAtPath(){}getLiteralValueAtPath(e){if(e.length>0||this.quasis.length!==1){return _s}return this.quasis[0].value.cooked}getReturnExpressionWhenCalledAtPath(e){if(e.length!==1){return Rs}return getMemberReturnExpressionWhenCalled(ur,e[0])}hasEffectsOnInteractionAtPath(e,t,i){if(t.type===$s){return e.length>1}if(t.type===Ts&&e.length===1){return hasMemberEffectWhenCalled(ur,e[0],t,i)}return true}render(e,t){e.indentExclusionRanges.push([this.start,this.end]);super.render(e,t)}}class UndefinedVariable extends Variable{constructor(){super("undefined")}getLiteralValueAtPath(){return undefined}}class ExportDefaultVariable extends LocalVariable{constructor(e,t,i){super(e,t,t.declaration,i);this.hasId=false;this.originalId=null;this.originalVariable=null;const s=t.declaration;if((s instanceof FunctionDeclaration||s instanceof ClassDeclaration)&&s.id){this.hasId=true;this.originalId=s.id}else if(s instanceof Identifier){this.originalId=s}}addReference(e){if(!this.hasId){this.name=e.name}}forbidName(e){const t=this.getOriginalVariable();if(t===this){super.forbidName(e)}else{t.forbidName(e)}}getAssignedVariableName(){return this.originalId&&this.originalId.name||null}getBaseVariableName(){const e=this.getOriginalVariable();return e===this?super.getBaseVariableName():e.getBaseVariableName()}getDirectOriginalVariable(){return this.originalId&&(this.hasId||!(this.originalId.isPossibleTDZ()||this.originalId.variable.isReassigned||this.originalId.variable instanceof UndefinedVariable||"syntheticNamespace"in this.originalId.variable))?this.originalId.variable:null}getName(e){const t=this.getOriginalVariable();return t===this?super.getName(e):t.getName(e)}getOriginalVariable(){if(this.originalVariable)return this.originalVariable;let e=this;let t;const i=new Set;do{i.add(e);t=e;e=t.getDirectOriginalVariable()}while(e instanceof ExportDefaultVariable&&!i.has(e));return this.originalVariable=e||t}}class ModuleScope extends ChildScope{constructor(e,t){super(e);this.context=t;this.variables.set("this",new LocalVariable("this",null,Xn,t))}addExportDefaultDeclaration(e,t,i){const s=new ExportDefaultVariable(e,t,i);this.variables.set("default",s);return s}addNamespaceMemberAccess(){}deconflict(e,t,i){for(const s of this.children)s.deconflict(e,t,i)}findLexicalBoundary(){return this}findVariable(e){const t=this.variables.get(e)||this.accessedOutsideVariables.get(e);if(t){return t}const i=this.context.traceVariable(e)||this.parent.findVariable(e);if(i instanceof GlobalVariable){this.accessedOutsideVariables.set(e,i)}return i}}class ThisExpression extends NodeBase{bind(){this.variable=this.scope.findVariable("this")}deoptimizeArgumentsOnInteractionAtPath(e,t,i){this.variable.deoptimizeArgumentsOnInteractionAtPath(e,t,i)}deoptimizePath(e){this.variable.deoptimizePath(e)}hasEffectsOnInteractionAtPath(e,t,i){if(e.length===0){return t.type!==$s}return this.variable.hasEffectsOnInteractionAtPath(e,t,i)}include(){if(!this.included){this.included=true;this.context.includeVariableInModule(this.variable)}}initialise(){this.alias=this.scope.findLexicalBoundary()instanceof ModuleScope?this.context.moduleContext:null;if(this.alias==="undefined"){this.context.log(v,logThisIsUndefined(),this.start)}}render(e){if(this.alias!==null){e.overwrite(this.start,this.end,this.alias,{contentOnly:false,storeName:true})}}}class ThrowStatement extends NodeBase{hasEffects(){return true}include(e,t){this.included=true;this.argument.include(e,t);e.brokenFlow=true}render(e,t){this.argument.render(e,t,{preventASI:true});if(this.argument.start===this.start+5){e.prependLeft(this.start+5," ")}}}class TryStatement extends NodeBase{constructor(){super(...arguments);this.directlyIncluded=false;this.includedLabelsAfterBlock=null}hasEffects(e){return(this.context.options.treeshake.tryCatchDeoptimization?this.block.body.length>0:this.block.hasEffects(e))||!!this.finalizer?.hasEffects(e)}include(e,t){const i=this.context.options.treeshake?.tryCatchDeoptimization;const{brokenFlow:s,includedLabels:n}=e;if(!this.directlyIncluded||!i){this.included=true;this.directlyIncluded=true;this.block.include(e,i?Vr:t);if(n.size>0){this.includedLabelsAfterBlock=[...n]}e.brokenFlow=s}else if(this.includedLabelsAfterBlock){for(const e of this.includedLabelsAfterBlock){n.add(e)}}if(this.handler!==null){this.handler.include(e,t);e.brokenFlow=s}this.finalizer?.include(e,t)}}const ia={"!":e=>!e,"+":e=>+e,"-":e=>-e,delete:()=>_s,typeof:e=>typeof e,void:()=>undefined,"~":e=>~e};class UnaryExpression extends NodeBase{getLiteralValueAtPath(e,t,i){if(e.length>0)return _s;const s=this.argument.getLiteralValueAtPath(Ss,t,i);if(typeof s==="symbol")return _s;return ia[this.operator](s)}hasEffects(e){if(!this.deoptimized)this.applyDeoptimizations();if(this.operator==="typeof"&&this.argument instanceof Identifier)return false;return this.argument.hasEffects(e)||this.operator==="delete"&&this.argument.hasEffectsOnInteractionAtPath(Ss,Ms,e)}hasEffectsOnInteractionAtPath(e,{type:t}){return t!==$s||e.length>(this.operator==="void"?0:1)}applyDeoptimizations(){this.deoptimized=true;if(this.operator==="delete"){this.argument.deoptimizePath(Ss);this.context.requestTreeshakingPass()}}}class UnknownNode extends NodeBase{hasEffects(){return true}include(e){super.include(e,true)}}class UpdateExpression extends NodeBase{hasEffects(e){if(!this.deoptimized)this.applyDeoptimizations();return this.argument.hasEffectsAsAssignmentTarget(e,true)}hasEffectsOnInteractionAtPath(e,{type:t}){return e.length>1||t!==$s}include(e,t){if(!this.deoptimized)this.applyDeoptimizations();this.included=true;this.argument.includeAsAssignmentTarget(e,t,true)}initialise(){this.argument.setAssignedValue(Ns)}render(e,t){const{exportNamesByVariable:i,format:s,snippets:{_:n}}=t;this.argument.render(e,t);if(s==="system"){const s=this.argument.variable;const r=i.get(s);if(r){if(this.prefix){if(r.length===1){renderSystemExportExpression(s,this.start,this.end,e,t)}else{renderSystemExportSequenceAfterExpression(s,this.start,this.end,this.parent.type!==br,e,t)}}else{const i=this.operator[0];renderSystemExportSequenceBeforeExpression(s,this.start,this.end,this.parent.type!==br,e,t,`${n}${i}${n}1`)}}}}applyDeoptimizations(){this.deoptimized=true;this.argument.deoptimizePath(Ss);if(this.argument instanceof Identifier){const e=this.scope.findVariable(this.argument.name);e.isReassigned=true}this.context.requestTreeshakingPass()}}function areAllDeclarationsIncludedAndNotExported(e,t){for(const i of e){if(!i.id.included)return false;if(i.id.type===Sr){if(t.has(i.id.variable))return false}else{const e=[];i.id.addExportedVariables(e,t);if(e.length>0)return false}}return true}class VariableDeclaration extends NodeBase{deoptimizePath(){for(const e of this.declarations){e.deoptimizePath(Ss)}}hasEffectsOnInteractionAtPath(){return false}include(e,t,{asSingleStatement:i}=Bt){this.included=true;for(const s of this.declarations){if(t||s.shouldBeIncluded(e))s.include(e,t);const{id:n,init:r}=s;if(i){n.include(e,t)}if(r&&n.included&&!r.included&&(n instanceof ObjectPattern||n instanceof ArrayPattern)){r.include(e,t)}}}initialise(){for(const e of this.declarations){e.declareDeclarator(this.kind)}}render(e,t,i=Bt){if(areAllDeclarationsIncludedAndNotExported(this.declarations,t.exportNamesByVariable)){for(const i of this.declarations){i.render(e,t)}if(!i.isNoStatement&&e.original.charCodeAt(this.end-1)!==59){e.appendLeft(this.end,";")}}else{this.renderReplacedDeclarations(e,t)}}applyDeoptimizations(){}renderDeclarationEnd(e,t,i,s,n,r,o){if(e.original.charCodeAt(this.end-1)===59){e.remove(this.end-1,this.end)}t+=";";if(i===null){e.appendLeft(n,t)}else{if(e.original.charCodeAt(s-1)===10&&(e.original.charCodeAt(this.end)===10||e.original.charCodeAt(this.end)===13)){s--;if(e.original.charCodeAt(s)===13){s--}}if(s===i+1){e.overwrite(i,n,t)}else{e.overwrite(i,i+1,t);e.remove(s,n)}}if(r.length>0){e.appendLeft(n,` ${getSystemExportStatement(r,o)};`)}}renderReplacedDeclarations(e,t){const i=getCommaSeparatedNodesWithBoundaries(this.declarations,e,this.start+this.kind.length,this.end-(e.original.charCodeAt(this.end-1)===59?1:0));let s,n;n=findNonWhiteSpace(e.original,this.start+this.kind.length);let r=n-1;e.remove(this.start,r);let o=false;let l=false;let c="",u,h;const d=[];const p=gatherSystemExportsAndGetSingleExport(i,t,d);for(const{node:d,start:f,separator:m,contentEnd:g,end:y}of i){if(!d.included){e.remove(f,y);continue}d.render(e,t);u="";h="";if(!d.id.included||d.id instanceof Identifier&&isReassignedExportsMember(d.id.variable,t.exportNamesByVariable)){if(l){c+=";"}o=false}else{if(p&&p===d.id.variable){const i=findFirstOccurrenceOutsideComment(e.original,"=",d.id.end);renderSystemExportExpression(p,findNonWhiteSpace(e.original,i+1),m===null?g:m,e,t)}if(o){c+=","}else{if(l){c+=";"}u+=`${this.kind} `;o=true}}if(n===r+1){e.overwrite(r,n,c+u)}else{e.overwrite(r,r+1,c);e.appendLeft(n,u)}s=g;n=y;l=true;r=m;c=h}this.renderDeclarationEnd(e,c,r,s,n,d,t)}}function gatherSystemExportsAndGetSingleExport(e,t,i){let s=null;if(t.format==="system"){for(const{node:n}of e){if(n.id instanceof Identifier&&n.init&&i.length===0&&t.exportNamesByVariable.get(n.id.variable)?.length===1){s=n.id.variable;i.push(s)}else{n.id.addExportedVariables(i,t.exportNamesByVariable)}}if(i.length>1){s=null}else if(s){i.length=0}}return s}class WhileStatement extends NodeBase{hasEffects(e){if(this.test.hasEffects(e))return true;return hasLoopBodyEffects(e,this.body)}include(e,t){this.included=true;this.test.include(e,t);includeLoopBody(e,this.body,t)}}class YieldExpression extends NodeBase{hasEffects(e){if(!this.deoptimized)this.applyDeoptimizations();return!(e.ignore.returnYield&&!this.argument?.hasEffects(e))}render(e,t){if(this.argument){this.argument.render(e,t,{preventASI:true});if(this.argument.start===this.start+5){e.prependLeft(this.start+5," ")}}}}const sa={ArrayExpression:ArrayExpression,ArrayPattern:ArrayPattern,ArrowFunctionExpression:ArrowFunctionExpression,AssignmentExpression:AssignmentExpression,AssignmentPattern:AssignmentPattern,AwaitExpression:AwaitExpression,BinaryExpression:BinaryExpression,BlockStatement:BlockStatement,BreakStatement:BreakStatement,CallExpression:CallExpression,CatchClause:CatchClause,ChainExpression:ChainExpression,ClassBody:ClassBody,ClassDeclaration:ClassDeclaration,ClassExpression:ClassExpression,ConditionalExpression:ConditionalExpression,ContinueStatement:ContinueStatement,DoWhileStatement:DoWhileStatement,EmptyStatement:EmptyStatement,ExportAllDeclaration:ExportAllDeclaration,ExportDefaultDeclaration:ExportDefaultDeclaration,ExportNamedDeclaration:ExportNamedDeclaration,ExportSpecifier:ExportSpecifier,ExpressionStatement:ExpressionStatement,ForInStatement:ForInStatement,ForOfStatement:ForOfStatement,ForStatement:ForStatement,FunctionDeclaration:FunctionDeclaration,FunctionExpression:FunctionExpression,Identifier:Identifier,IfStatement:IfStatement,ImportAttribute:ImportAttribute,ImportDeclaration:ImportDeclaration,ImportDefaultSpecifier:ImportDefaultSpecifier,ImportExpression:ImportExpression,ImportNamespaceSpecifier:ImportNamespaceSpecifier,ImportSpecifier:ImportSpecifier,LabeledStatement:LabeledStatement,Literal:Literal,LogicalExpression:LogicalExpression,MemberExpression:MemberExpression,MetaProperty:MetaProperty,MethodDefinition:MethodDefinition,NewExpression:NewExpression,ObjectExpression:ObjectExpression,ObjectPattern:ObjectPattern,PrivateIdentifier:PrivateIdentifier,Program:Program,Property:Property,PropertyDefinition:PropertyDefinition,RestElement:RestElement,ReturnStatement:ReturnStatement,SequenceExpression:SequenceExpression,SpreadElement:SpreadElement,StaticBlock:StaticBlock,Super:Super,SwitchCase:SwitchCase,SwitchStatement:SwitchStatement,TaggedTemplateExpression:TaggedTemplateExpression,TemplateElement:TemplateElement,TemplateLiteral:TemplateLiteral,ThisExpression:ThisExpression,ThrowStatement:ThrowStatement,TryStatement:TryStatement,UnaryExpression:UnaryExpression,UnknownNode:UnknownNode,UpdateExpression:UpdateExpression,VariableDeclaration:VariableDeclaration,VariableDeclarator:VariableDeclarator,WhileStatement:WhileStatement,YieldExpression:YieldExpression};const na="_missingExportShim";class ExportShimVariable extends Variable{constructor(e){super(na);this.module=e}include(){super.include();this.module.needsExportShim=true}}class NamespaceVariable extends Variable{constructor(e){super(e.getModuleName());this.memberVariables=null;this.mergedNamespaces=[];this.referencedEarly=false;this.references=[];this.context=e;this.module=e.module}addReference(e){this.references.push(e);this.name=e.name}deoptimizeArgumentsOnInteractionAtPath(e,t,i){if(t.length>1||t.length===1&&e.type===Ts){const s=t[0];if(typeof s==="string"){this.getMemberVariables()[s]?.deoptimizeArgumentsOnInteractionAtPath(e,t.slice(1),i)}else{deoptimizeInteraction(e)}}}deoptimizePath(e){if(e.length>1){const t=e[0];if(typeof t==="string"){this.getMemberVariables()[t]?.deoptimizePath(e.slice(1))}}}getLiteralValueAtPath(e){if(e[0]===vs){return"Module"}return _s}getMemberVariables(){if(this.memberVariables){return this.memberVariables}const e=Object.create(null);const t=[...this.context.getExports(),...this.context.getReexports()].sort();for(const i of t){if(i[0]!=="*"&&i!==this.module.info.syntheticNamedExports){const t=this.context.traceExport(i);if(t){e[i]=t}}}return this.memberVariables=e}hasEffectsOnInteractionAtPath(e,t,i){const{type:s}=t;if(e.length===0){return true}if(e.length===1&&s!==Ts){return s===Os}const n=e[0];if(typeof n!=="string"){return true}const r=this.getMemberVariables()[n];return!r||r.hasEffectsOnInteractionAtPath(e.slice(1),t,i)}include(){this.included=true;this.context.includeAllExports()}prepare(e){if(this.mergedNamespaces.length>0){this.module.scope.addAccessedGlobals([jo],e)}}renderBlock(e){const{exportNamesByVariable:t,format:i,freeze:s,indent:n,namespaceToStringTag:r,snippets:{_:o,cnst:l,getObject:c,getPropertyAccess:u,n:h,s:d}}=e;const p=this.getMemberVariables();const f=Object.entries(p).filter((([e,t])=>t.included)).map((([e,t])=>{if(this.referencedEarly||t.isReassigned||t===this){return[null,`get ${e}${o}()${o}{${o}return ${t.getName(u)}${d}${o}}`]}return[e,t.getName(u)]}));f.unshift([null,`__proto__:${o}null`]);let m=c(f,{lineBreakIndent:{base:"",t:n}});if(this.mergedNamespaces.length>0){const e=this.mergedNamespaces.map((e=>e.getName(u)));m=`/*#__PURE__*/${jo}(${m},${o}[${e.join(`,${o}`)}])`}else{if(r){m=`/*#__PURE__*/Object.defineProperty(${m},${o}Symbol.toStringTag,${o}${getToStringTagValue(c)})`}if(s){m=`/*#__PURE__*/Object.freeze(${m})`}}const g=this.getName(u);m=`${l} ${g}${o}=${o}${m};`;if(i==="system"&&t.has(this)){m+=`${h}${getSystemExportStatement([this],e)};`}return m}renderFirst(){return this.referencedEarly}setMergedNamespaces(e){this.mergedNamespaces=e;const t=this.context.getModuleExecIndex();for(const e of this.references){if(e.context.getModuleExecIndex()<=t){this.referencedEarly=true;break}}}}NamespaceVariable.prototype.isNamespace=true;class SyntheticNamedExportVariable extends Variable{constructor(e,t,i){super(t);this.baseVariable=null;this.context=e;this.module=e.module;this.syntheticNamespace=i}getBaseVariable(){if(this.baseVariable)return this.baseVariable;let e=this.syntheticNamespace;while(e instanceof ExportDefaultVariable||e instanceof SyntheticNamedExportVariable){if(e instanceof ExportDefaultVariable){const t=e.getOriginalVariable();if(t===e)break;e=t}if(e instanceof SyntheticNamedExportVariable){e=e.syntheticNamespace}}return this.baseVariable=e}getBaseVariableName(){return this.syntheticNamespace.getBaseVariableName()}getName(e){return`${this.syntheticNamespace.getName(e)}${e(this.name)}`}include(){this.included=true;this.context.includeVariableInModule(this.syntheticNamespace)}setRenderNames(e,t){super.setRenderNames(e,t)}}const ra=new WeakMap;function resetCacheToEncoded(e){if(e.encodedMappings===undefined&&e.decodedMappings){e.encodedMappings=encode(e.decodedMappings)}e.decodedMappings=undefined}function resetSourcemapCache(e,t){if(e){const t=ra.get(e);if(t){resetCacheToEncoded(t)}}if(!t){return}for(const e of t){if(e.missing)continue;resetSourcemapCache(e)}}function decodedSourcemap(e){if(!e)return null;if(typeof e==="string"){e=JSON.parse(e)}if(!e.mappings){return{mappings:[],names:[],sources:[],version:3}}const t=e.mappings;const i=Array.isArray(t);const s={decodedMappings:i?t:undefined,encodedMappings:i?undefined:t};const n={...e,get mappings(){if(s.decodedMappings){return s.decodedMappings}s.decodedMappings=s.encodedMappings?decode(s.encodedMappings):[];s.encodedMappings=undefined;return s.decodedMappings}};ra.set(n,s);return n}function getId(e){return e.id}function getOriginalLocation(e,t){const i=e.filter((e=>!e.missing));e:while(i.length>0){const e=i.pop();const s=e.mappings[t.line-1];if(s){const e=s.filter((e=>e.length>1));const i=e[e.length-1];for(const s of e){if(s[0]>=t.column||s===i){t={column:s[3],line:s[2]+1};continue e}}}throw new Error("Can't resolve original location of error.")}return t}function getAssertionsFromImportExpression(e){const t=e.arguments?.[0]?.properties.find((e=>getPropertyKey(e)==="assert"))?.value;if(!t){return Ft}const i=t.properties.map((e=>{const t=getPropertyKey(e);if(typeof t==="string"&&typeof e.value.value==="string"){return[t,e.value.value]}return null})).filter((e=>!!e));if(i.length>0){return Object.fromEntries(i)}return Ft}const getPropertyKey=e=>{const t=e.key;return t&&(t.name||t.value)};function getAssertionsFromImportExportDeclaration(e){return e?.length?Object.fromEntries(e.map((e=>[getPropertyKey(e),e.value.value]))):Ft}function doAssertionsDiffer(e,t){const i=Object.keys(e);return i.length!==Object.keys(t).length||i.some((i=>e[i]!==t[i]))}let oa=new Map;function getPersistedLabel(e,t){switch(t){case 1:{return`# ${e}`}case 2:{return`## ${e}`}case 3:{return e}default:{return`${" ".repeat(t-4)}- ${e}`}}}function timeStartImpl(e,t=3){e=getPersistedLabel(e,t);const i=s.memoryUsage().heapUsed;const n=l.performance.now();const r=oa.get(e);if(r===undefined){oa.set(e,{memory:0,startMemory:i,startTime:n,time:0,totalMemory:0})}else{r.startMemory=i;r.startTime=n}}function timeEndImpl(e,t=3){e=getPersistedLabel(e,t);const i=oa.get(e);if(i!==undefined){const e=s.memoryUsage().heapUsed;i.memory+=e-i.startMemory;i.time+=l.performance.now()-i.startTime;i.totalMemory=Math.max(i.totalMemory,e)}}function getTimings(){const e={};for(const[t,{memory:i,time:s,totalMemory:n}]of oa){e[t]=[s,i,n]}return e}let aa=doNothing;let la=doNothing;const ca=["augmentChunkHash","buildEnd","buildStart","generateBundle","load","moduleParsed","options","outputOptions","renderChunk","renderDynamicImport","renderStart","resolveDynamicImport","resolveFileUrl","resolveId","resolveImportMeta","shouldTransformCachedModule","transform","writeBundle"];function getPluginWithTimers(e,t){if(e._hasTimer)return e;e._hasTimer=true;for(const i of ca){if(i in e){let s=`plugin ${t}`;if(e.name){s+=` (${e.name})`}s+=` - ${i}`;const handler=function(...e){aa(s,4);const t=n.apply(this,e);la(s,4);return t};let n;if(typeof e[i].handler==="function"){n=e[i].handler;e[i].handler=handler}else{n=e[i];e[i]=handler}}}return e}function initialiseTimers(e){if(e.perf){oa=new Map;aa=timeStartImpl;la=timeEndImpl;e.plugins=e.plugins.map(getPluginWithTimers)}else{aa=doNothing;la=doNothing}}function markModuleAndImpureDependenciesAsExecuted(e){e.isExecuted=true;const t=[e];const i=new Set;for(const e of t){for(const s of[...e.dependencies,...e.implicitlyLoadedBefore]){if(!(s instanceof ExternalModule)&&!s.isExecuted&&(s.info.moduleSideEffects||e.implicitlyLoadedBefore.has(s))&&!i.has(s.id)){s.isExecuted=true;i.add(s.id);t.push(s)}}}}const ua={identifier:null,localName:na};function getVariableForExportNameRecursive(e,t,i,s,n=new Map){const r=n.get(t);if(r){if(r.has(e)){return s?[null]:error(logCircularReexport(t,e.id))}r.add(e)}else{n.set(t,new Set([e]))}return e.getVariableForExportName(t,{importerForSideEffects:i,isExportAllSearch:s,searchedNamesAndModules:n})}function getAndExtendSideEffectModules(e,t){const i=getOrCreate(t.sideEffectDependenciesByVariable,e,getNewSet);let s=e;const n=new Set([s]);while(true){const e=s.module;s=s instanceof ExportDefaultVariable?s.getDirectOriginalVariable():s instanceof SyntheticNamedExportVariable?s.syntheticNamespace:null;if(!s||n.has(s)){break}n.add(s);i.add(e);const t=e.sideEffectDependenciesByVariable.get(s);if(t){for(const e of t){i.add(e)}}}return i}class Module{constructor(e,t,i,s,n,r,o,l){this.graph=e;this.id=t;this.options=i;this.alternativeReexportModules=new Map;this.chunkFileNames=new Set;this.chunkNames=[];this.cycles=new Set;this.dependencies=new Set;this.dynamicDependencies=new Set;this.dynamicImporters=[];this.dynamicImports=[];this.execIndex=Infinity;this.implicitlyLoadedAfter=new Set;this.implicitlyLoadedBefore=new Set;this.importDescriptions=new Map;this.importMetas=[];this.importedFromNotTreeshaken=false;this.importers=[];this.includedDynamicImporters=[];this.includedImports=new Set;this.isExecuted=false;this.isUserDefinedEntryPoint=false;this.needsExportShim=false;this.sideEffectDependenciesByVariable=new Map;this.sourcesWithAssertions=new Map;this.allExportNames=null;this.ast=null;this.exportAllModules=[];this.exportAllSources=new Set;this.exportNamesByVariable=null;this.exportShimVariable=new ExportShimVariable(this);this.exports=new Map;this.namespaceReexportsByName=new Map;this.reexportDescriptions=new Map;this.relevantDependencies=null;this.syntheticExports=new Map;this.syntheticNamespace=null;this.transformDependencies=[];this.transitiveReexports=null;this.excludeFromSourcemap=/\0/.test(t);this.context=i.moduleContext(t);this.preserveSignature=this.options.preserveEntrySignatures;const c=this;const{dynamicImports:u,dynamicImporters:h,exportAllSources:d,exports:f,implicitlyLoadedAfter:m,implicitlyLoadedBefore:g,importers:y,reexportDescriptions:E,sourcesWithAssertions:x}=this;this.info={assertions:l,ast:null,code:null,get dynamicallyImportedIdResolutions(){return u.map((({argument:e})=>typeof e==="string"&&c.resolvedIds[e])).filter(Boolean)},get dynamicallyImportedIds(){return u.map((({id:e})=>e)).filter((e=>e!=null))},get dynamicImporters(){return h.sort()},get exportedBindings(){const e={".":[...f.keys()]};for(const[t,{source:i}]of E){(e[i]??(e[i]=[])).push(t)}for(const t of d){(e[t]??(e[t]=[])).push("*")}return e},get exports(){return[...f.keys(),...E.keys(),...[...d].map((()=>"*"))]},get hasDefaultExport(){if(!c.ast){return null}return c.exports.has("default")||E.has("default")},get hasModuleSideEffects(){warnDeprecation("Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.",ce,true,i);return this.moduleSideEffects},id:t,get implicitlyLoadedAfterOneOf(){return Array.from(m,getId).sort()},get implicitlyLoadedBefore(){return Array.from(g,getId).sort()},get importedIdResolutions(){return Array.from(x.keys(),(e=>c.resolvedIds[e])).filter(Boolean)},get importedIds(){return Array.from(x.keys(),(e=>c.resolvedIds[e]?.id)).filter(Boolean)},get importers(){return y.sort()},isEntry:s,isExternal:false,get isIncluded(){if(e.phase!==p.GENERATE){return null}return c.isIncluded()},meta:{...o},moduleSideEffects:n,syntheticNamedExports:r};Object.defineProperty(this.info,"hasModuleSideEffects",{enumerable:false})}basename(){const e=r.basename(this.id);const t=r.extname(this.id);return makeLegal(t?e.slice(0,-t.length):e)}bindReferences(){this.ast.bind()}error(e,t){this.addLocationToLogProps(e,t);return error(e)}estimateSize(){let e=0;for(const t of this.ast.body){if(t.included){e+=t.end-t.start}}return e}getAllExportNames(){if(this.allExportNames){return this.allExportNames}this.allExportNames=new Set([...this.exports.keys(),...this.reexportDescriptions.keys()]);for(const e of this.exportAllModules){if(e instanceof ExternalModule){this.allExportNames.add(`*${e.id}`);continue}for(const t of e.getAllExportNames()){if(t!=="default")this.allExportNames.add(t)}}if(typeof this.info.syntheticNamedExports==="string"){this.allExportNames.delete(this.info.syntheticNamedExports)}return this.allExportNames}getDependenciesToBeIncluded(){if(this.relevantDependencies)return this.relevantDependencies;this.relevantDependencies=new Set;const e=new Set;const t=new Set;const i=new Set(this.includedImports);if(this.info.isEntry||this.includedDynamicImporters.length>0||this.namespace.included||this.implicitlyLoadedAfter.size>0){for(const e of[...this.getReexports(),...this.getExports()]){const[t]=this.getVariableForExportName(e);if(t?.included){i.add(t)}}}for(let s of i){const i=this.sideEffectDependenciesByVariable.get(s);if(i){for(const e of i){t.add(e)}}if(s instanceof SyntheticNamedExportVariable){s=s.getBaseVariable()}else if(s instanceof ExportDefaultVariable){s=s.getOriginalVariable()}e.add(s.module)}if(!this.options.treeshake||this.info.moduleSideEffects==="no-treeshake"){for(const e of this.dependencies){this.relevantDependencies.add(e)}}else{this.addRelevantSideEffectDependencies(this.relevantDependencies,e,t)}for(const t of e){this.relevantDependencies.add(t)}return this.relevantDependencies}getExportNamesByVariable(){if(this.exportNamesByVariable){return this.exportNamesByVariable}const e=new Map;for(const t of this.getAllExportNames()){let[i]=this.getVariableForExportName(t);if(i instanceof ExportDefaultVariable){i=i.getOriginalVariable()}if(!i||!(i.included||i instanceof ExternalVariable)){continue}const s=e.get(i);if(s){s.push(t)}else{e.set(i,[t])}}return this.exportNamesByVariable=e}getExports(){return[...this.exports.keys()]}getReexports(){if(this.transitiveReexports){return this.transitiveReexports}this.transitiveReexports=[];const e=new Set(this.reexportDescriptions.keys());for(const t of this.exportAllModules){if(t instanceof ExternalModule){e.add(`*${t.id}`)}else{for(const i of[...t.getReexports(),...t.getExports()]){if(i!=="default")e.add(i)}}}return this.transitiveReexports=[...e]}getRenderedExports(){const e=[];const t=[];for(const i of this.exports.keys()){const[s]=this.getVariableForExportName(i);(s&&s.included?e:t).push(i)}return{removedExports:t,renderedExports:e}}getSyntheticNamespace(){if(this.syntheticNamespace===null){this.syntheticNamespace=undefined;[this.syntheticNamespace]=this.getVariableForExportName(typeof this.info.syntheticNamedExports==="string"?this.info.syntheticNamedExports:"default",{onlyExplicit:true})}if(!this.syntheticNamespace){return error(logSyntheticNamedExportsNeedNamespaceExport(this.id,this.info.syntheticNamedExports))}return this.syntheticNamespace}getVariableForExportName(e,{importerForSideEffects:t,isExportAllSearch:i,onlyExplicit:s,searchedNamesAndModules:n}=Ft){if(e[0]==="*"){if(e.length===1){return[this.namespace]}const t=this.graph.modulesById.get(e.slice(1));return t.getVariableForExportName("*")}const r=this.reexportDescriptions.get(e);if(r){const[e]=getVariableForExportNameRecursive(r.module,r.localName,t,false,n);if(!e){return this.error(logMissingExport(r.localName,this.id,r.module.id),r.start)}if(t){setAlternativeExporterIfCyclic(e,t,this);if(this.info.moduleSideEffects){getOrCreate(t.sideEffectDependenciesByVariable,e,getNewSet).add(this)}}return[e]}const o=this.exports.get(e);if(o){if(o===ua){return[this.exportShimVariable]}const e=o.localName;const i=this.traceVariable(e,{importerForSideEffects:t,searchedNamesAndModules:n});if(t){setAlternativeExporterIfCyclic(i,t,this);getOrCreate(t.sideEffectDependenciesByVariable,i,getNewSet).add(this)}return[i]}if(s){return[null]}if(e!=="default"){const i=this.namespaceReexportsByName.get(e)??this.getVariableFromNamespaceReexports(e,t,n);this.namespaceReexportsByName.set(e,i);if(i[0]){return i}}if(this.info.syntheticNamedExports){return[getOrCreate(this.syntheticExports,e,(()=>new SyntheticNamedExportVariable(this.astContext,e,this.getSyntheticNamespace())))]}if(!i&&this.options.shimMissingExports){this.shimMissingExport(e);return[this.exportShimVariable]}return[null]}hasEffects(){return this.info.moduleSideEffects==="no-treeshake"||this.ast.hasCachedEffects()}include(){const e=createInclusionContext();if(this.ast.shouldBeIncluded(e))this.ast.include(e,false)}includeAllExports(e){if(!this.isExecuted){markModuleAndImpureDependenciesAsExecuted(this);this.graph.needsTreeshakingPass=true}for(const t of this.exports.keys()){if(e||t!==this.info.syntheticNamedExports){const e=this.getVariableForExportName(t)[0];e.deoptimizePath(As);if(!e.included){this.includeVariable(e)}}}for(const e of this.getReexports()){const[t]=this.getVariableForExportName(e);if(t){t.deoptimizePath(As);if(!t.included){this.includeVariable(t)}if(t instanceof ExternalVariable){t.module.reexported=true}}}if(e){this.namespace.setMergedNamespaces(this.includeAndGetAdditionalMergedNamespaces())}}includeAllInBundle(){this.ast.include(createInclusionContext(),true);this.includeAllExports(false)}includeExportsByNames(e){if(!this.isExecuted){markModuleAndImpureDependenciesAsExecuted(this);this.graph.needsTreeshakingPass=true}let t=false;for(const i of e){const e=this.getVariableForExportName(i)[0];if(e){e.deoptimizePath(As);if(!e.included){this.includeVariable(e)}}if(!this.exports.has(i)&&!this.reexportDescriptions.has(i)){t=true}}if(t){this.namespace.setMergedNamespaces(this.includeAndGetAdditionalMergedNamespaces())}}isIncluded(){return this.ast&&(this.ast.included||this.namespace.included||this.importedFromNotTreeshaken||this.exportShimVariable.included)}linkImports(){this.addModulesToImportDescriptions(this.importDescriptions);this.addModulesToImportDescriptions(this.reexportDescriptions);const e=[];for(const t of this.exportAllSources){const i=this.graph.modulesById.get(this.resolvedIds[t].id);if(i instanceof ExternalModule){e.push(i);continue}this.exportAllModules.push(i)}this.exportAllModules.push(...e)}log(e,t,i){this.addLocationToLogProps(t,i);this.options.onLog(e,t)}render(e){const t=this.magicString.clone();this.ast.render(t,e);t.trim();const{usesTopLevelAwait:i}=this.astContext;if(i&&e.format!=="es"&&e.format!=="system"){return error(logInvalidFormatForTopLevelAwait(this.id,e.format))}return{source:t,usesTopLevelAwait:i}}setSource({ast:e,code:t,customTransformCache:i,originalCode:s,originalSourcemap:n,resolvedIds:r,sourcemapChain:o,transformDependencies:l,transformFiles:c,...u}){aa("generate ast",3);this.info.code=t;this.originalCode=s;this.originalSourcemap=decodedSourcemap(n);this.sourcemapChain=o.map((e=>e.missing?e:decodedSourcemap(e)));resetSourcemapCache(this.originalSourcemap,this.sourcemapChain);if(c){this.transformFiles=c}this.transformDependencies=l;this.customTransformCache=i;this.updateOptions(u);const h=e??this.tryParse();la("generate ast",3);aa("analyze ast",3);this.resolvedIds=r??Object.create(null);const d=this.id;this.magicString=new MagicString(t,{filename:this.excludeFromSourcemap?null:d,indentExclusionRanges:[]});this.astContext={addDynamicImport:this.addDynamicImport.bind(this),addExport:this.addExport.bind(this),addImport:this.addImport.bind(this),addImportMeta:this.addImportMeta.bind(this),code:t,deoptimizationTracker:this.graph.deoptimizationTracker,error:this.error.bind(this),fileName:d,getExports:this.getExports.bind(this),getModuleExecIndex:()=>this.execIndex,getModuleName:this.basename.bind(this),getNodeConstructor:e=>sa[e]||sa.UnknownNode,getReexports:this.getReexports.bind(this),importDescriptions:this.importDescriptions,includeAllExports:()=>this.includeAllExports(true),includeDynamicImport:this.includeDynamicImport.bind(this),includeVariableInModule:this.includeVariableInModule.bind(this),log:this.log.bind(this),magicString:this.magicString,manualPureFunctions:this.graph.pureFunctions,module:this,moduleContext:this.context,options:this.options,requestTreeshakingPass:()=>this.graph.needsTreeshakingPass=true,traceExport:e=>this.getVariableForExportName(e)[0],traceVariable:this.traceVariable.bind(this),usesTopLevelAwait:false};this.scope=new ModuleScope(this.graph.scope,this.astContext);this.namespace=new NamespaceVariable(this.astContext);this.ast=new Program(h,{context:this.astContext,type:"Module"},this.scope);if(e||this.options.cache!==false){this.info.ast=h}else{Object.defineProperty(this.info,"ast",{get:()=>{if(this.graph.astLru.has(d)){return this.graph.astLru.get(d)}else{const e=this.tryParse();this.graph.astLru.set(d,e);return e}}})}la("analyze ast",3)}toJSON(){return{assertions:this.info.assertions,ast:this.info.ast,code:this.info.code,customTransformCache:this.customTransformCache,dependencies:Array.from(this.dependencies,getId),id:this.id,meta:this.info.meta,moduleSideEffects:this.info.moduleSideEffects,originalCode:this.originalCode,originalSourcemap:this.originalSourcemap,resolvedIds:this.resolvedIds,sourcemapChain:this.sourcemapChain,syntheticNamedExports:this.info.syntheticNamedExports,transformDependencies:this.transformDependencies,transformFiles:this.transformFiles}}traceVariable(e,{importerForSideEffects:t,isExportAllSearch:i,searchedNamesAndModules:s}=Ft){const n=this.scope.variables.get(e);if(n){return n}const r=this.importDescriptions.get(e);if(r){const e=r.module;if(e instanceof Module&&r.name==="*"){return e.namespace}const[n]=getVariableForExportNameRecursive(e,r.name,t||this,i,s);if(!n){return this.error(logMissingExport(r.name,this.id,e.id),r.start)}return n}return null}updateOptions({meta:e,moduleSideEffects:t,syntheticNamedExports:i}){if(t!=null){this.info.moduleSideEffects=t}if(i!=null){this.info.syntheticNamedExports=i}if(e!=null){Object.assign(this.info.meta,e)}}addDynamicImport(e){let t=e.source;if(t instanceof TemplateLiteral){if(t.quasis.length===1&&t.quasis[0].value.cooked){t=t.quasis[0].value.cooked}}else if(t instanceof Literal&&typeof t.value==="string"){t=t.value}this.dynamicImports.push({argument:t,id:null,node:e,resolution:null})}addExport(e){if(e instanceof ExportDefaultDeclaration){this.exports.set("default",{identifier:e.variable.getAssignedVariableName(),localName:"default"})}else if(e instanceof ExportAllDeclaration){const t=e.source.value;this.addSource(t,e);if(e.exported){const i=e.exported.name;this.reexportDescriptions.set(i,{localName:"*",module:null,source:t,start:e.start})}else{this.exportAllSources.add(t)}}else if(e.source instanceof Literal){const t=e.source.value;this.addSource(t,e);for(const{exported:i,local:s,start:n}of e.specifiers){const e=i instanceof Literal?i.value:i.name;this.reexportDescriptions.set(e,{localName:s instanceof Literal?s.value:s.name,module:null,source:t,start:n})}}else if(e.declaration){const t=e.declaration;if(t instanceof VariableDeclaration){for(const e of t.declarations){for(const t of Gn(e.id)){this.exports.set(t,{identifier:null,localName:t})}}}else{const e=t.id.name;this.exports.set(e,{identifier:null,localName:e})}}else{for(const{local:t,exported:i}of e.specifiers){const e=t.name;const s=i instanceof Identifier?i.name:i.value;this.exports.set(s,{identifier:null,localName:e})}}}addImport(e){const t=e.source.value;this.addSource(t,e);for(const i of e.specifiers){const e=i instanceof ImportDefaultSpecifier?"default":i instanceof ImportNamespaceSpecifier?"*":i.imported instanceof Identifier?i.imported.name:i.imported.value;this.importDescriptions.set(i.local.name,{module:null,name:e,source:t,start:i.start})}}addImportMeta(e){this.importMetas.push(e)}addLocationToLogProps(e,t){e.id=this.id;e.pos=t;let i=this.info.code;const s=locate(i,t,{offsetLine:1});if(s){let{column:n,line:r}=s;try{({column:n,line:r}=getOriginalLocation(this.sourcemapChain,{column:n,line:r}));i=this.originalCode}catch(e){this.options.onLog(v,logInvalidSourcemapForError(e,this.id,n,r,t))}augmentCodeLocation(e,{column:n,line:r},i,this.id)}}addModulesToImportDescriptions(e){for(const t of e.values()){const{id:e}=this.resolvedIds[t.source];t.module=this.graph.modulesById.get(e)}}addRelevantSideEffectDependencies(e,t,i){const s=new Set;const addSideEffectDependencies=n=>{for(const r of n){if(s.has(r)){continue}s.add(r);if(t.has(r)){e.add(r);continue}if(!(r.info.moduleSideEffects||i.has(r))){continue}if(r instanceof ExternalModule||r.hasEffects()){e.add(r);continue}addSideEffectDependencies(r.dependencies)}};addSideEffectDependencies(this.dependencies);addSideEffectDependencies(i)}addSource(e,t){const i=getAssertionsFromImportExportDeclaration(t.assertions);const s=this.sourcesWithAssertions.get(e);if(s){if(doAssertionsDiffer(s,i)){this.log(v,logInconsistentImportAssertions(s,i,e,this.id),t.start)}}else{this.sourcesWithAssertions.set(e,i)}}getVariableFromNamespaceReexports(e,t,i){let s=null;const n=new Map;const r=new Set;for(const o of this.exportAllModules){if(o.info.syntheticNamedExports===e){continue}const[l,c]=getVariableForExportNameRecursive(o,e,t,true,copyNameToModulesMap(i));if(o instanceof ExternalModule||c){r.add(l)}else if(l instanceof SyntheticNamedExportVariable){if(!s){s=l}}else if(l){n.set(l,o)}}if(n.size>0){const t=[...n];const i=t[0][0];if(t.length===1){return[i]}this.options.onLog(v,logNamespaceConflict(e,this.id,t.map((([,e])=>e.id))));return[null]}if(r.size>0){const t=[...r];const i=t[0];if(t.length>1){this.options.onLog(v,logAmbiguousExternalNamespaces(e,this.id,i.module.id,t.map((e=>e.module.id))))}return[i,true]}if(s){return[s]}return[null]}includeAndGetAdditionalMergedNamespaces(){const e=new Set;const t=new Set;for(const i of[this,...this.exportAllModules]){if(i instanceof ExternalModule){const[t]=i.getVariableForExportName("*");t.include();this.includedImports.add(t);e.add(t)}else if(i.info.syntheticNamedExports){const e=i.getSyntheticNamespace();e.include();this.includedImports.add(e);t.add(e)}}return[...t,...e]}includeDynamicImport(e){const t=this.dynamicImports.find((t=>t.node===e)).resolution;if(t instanceof Module){t.includedDynamicImporters.push(this);const i=this.options.treeshake?e.getDeterministicImportedNames():undefined;if(i){t.includeExportsByNames(i)}else{t.includeAllExports(true)}}}includeVariable(e){const t=e.module;if(e.included){if(t instanceof Module&&t!==this){getAndExtendSideEffectModules(e,this)}}else{e.include();this.graph.needsTreeshakingPass=true;if(t instanceof Module){if(!t.isExecuted){markModuleAndImpureDependenciesAsExecuted(t)}if(t!==this){const t=getAndExtendSideEffectModules(e,this);for(const e of t){if(!e.isExecuted){markModuleAndImpureDependenciesAsExecuted(e)}}}}}}includeVariableInModule(e){this.includeVariable(e);const t=e.module;if(t&&t!==this){this.includedImports.add(e)}}shimMissingExport(e){this.options.onLog(v,logShimmedExport(this.id,e));this.exports.set(e,ua)}tryParse(){try{return this.graph.contextParse(this.info.code)}catch(e){return this.error(logParseError(e,this.id),e.pos)}}}function setAlternativeExporterIfCyclic(e,t,i){if(e.module instanceof Module&&e.module!==i){const s=e.module.cycles;if(s.size>0){const n=i.cycles;for(const r of n){if(s.has(r)){t.alternativeReexportModules.set(e,i);break}}}}}const copyNameToModulesMap=e=>e&&new Map(Array.from(e,(([e,t])=>[e,new Set(t)])));function removeJsExtension(e){return e.endsWith(".js")?e.slice(0,-3):e}function getCompleteAmdId(e,t){if(e.autoId){return`${e.basePath?e.basePath+"/":""}${removeJsExtension(t)}`}return e.id??""}function getExportBlock$1(e,t,i,s,n,r,o,l="return "){const{_:c,getDirectReturnFunction:u,getFunctionIntro:h,getPropertyAccess:d,n:p,s:f}=n;if(!i){return`${p}${p}${l}${getSingleDefaultExport(e,t,s,o,d)};`}let m="";for(const{defaultVariableName:e,importPath:n,isChunk:l,name:h,namedExportsMode:f,namespaceVariableName:g,reexports:y}of t){if(y&&i){for(const t of y){if(t.reexported!=="*"){const i=getReexportedImportName(h,t.imported,f,l,e,g,s,n,o,d);if(m)m+=p;if(t.imported!=="*"&&t.needsLiveBinding){const[e,s]=u([],{functionReturn:true,lineBreakIndent:null,name:null});m+=`Object.defineProperty(exports,${c}'${t.reexported}',${c}{${p}`+`${r}enumerable:${c}true,${p}`+`${r}get:${c}${e}${i}${s}${p}});`}else{m+=`exports${d(t.reexported)}${c}=${c}${i};`}}}}}for(const{exported:t,local:i}of e){const e=`exports${d(t)}`;const s=i;if(e!==s){if(m)m+=p;m+=`${e}${c}=${c}${s};`}}for(const{name:e,reexports:s}of t){if(s&&i){for(const t of s){if(t.reexported==="*"){if(m)m+=p;const i=`{${p}${r}if${c}(k${c}!==${c}'default'${c}&&${c}!Object.prototype.hasOwnProperty.call(exports,${c}k))${c}${getDefineProperty(e,t.needsLiveBinding,r,n)}${f}${p}}`;m+=`Object.keys(${e}).forEach(${h(["k"],{isAsync:false,name:null})}${i});`}}}}if(m){return`${p}${p}${m}`}return""}function getSingleDefaultExport(e,t,i,s,n){if(e.length>0){return e[0].local}else{for(const{defaultVariableName:e,importPath:r,isChunk:o,name:l,namedExportsMode:c,namespaceVariableName:u,reexports:h}of t){if(h){return getReexportedImportName(l,h[0].imported,c,o,e,u,i,r,s,n)}}}}function getReexportedImportName(e,t,i,s,n,r,o,l,c,u){if(t==="default"){if(!s){const t=o(l);const i=Ho[t]?n:e;return isDefaultAProperty(t,c)?`${i}${u("default")}`:i}return i?`${e}${u("default")}`:e}if(t==="*"){return(s?!i:Go[o(l)])?r:e}return`${e}${u(t)}`}function getEsModuleValue(e){return e([["value","true"]],{lineBreakIndent:null})}function getNamespaceMarkers(e,t,i,{_:s,getObject:n}){if(e){if(t){if(i){return`Object.defineProperties(exports,${s}${n([["__esModule",getEsModuleValue(n)],[null,`[Symbol.toStringTag]:${s}${getToStringTagValue(n)}`]],{lineBreakIndent:null})});`}return`Object.defineProperty(exports,${s}'__esModule',${s}${getEsModuleValue(n)});`}if(i){return`Object.defineProperty(exports,${s}Symbol.toStringTag,${s}${getToStringTagValue(n)});`}}return""}const getDefineProperty=(e,t,i,{_:s,getDirectReturnFunction:n,n:r})=>{if(t){const[t,o]=n([],{functionReturn:true,lineBreakIndent:null,name:null});return`Object.defineProperty(exports,${s}k,${s}{${r}`+`${i}${i}enumerable:${s}true,${r}`+`${i}${i}get:${s}${t}${e}[k]${o}${r}${i}})`}return`exports[k]${s}=${s}${e}[k]`};function getInteropBlock(e,t,i,s,n,r,o,l){const{_:c,cnst:u,n:h}=l;const d=new Set;const p=[];const addInteropStatement=(e,t,i)=>{d.add(t);p.push(`${u} ${e}${c}=${c}/*#__PURE__*/${t}(${i});`)};for(const{defaultVariableName:i,imports:s,importPath:n,isChunk:r,name:o,namedExportsMode:l,namespaceVariableName:c,reexports:u}of e){if(r){for(const{imported:e,reexported:t}of[...s||[],...u||[]]){if(e==="*"&&t!=="*"){if(!l){addInteropStatement(c,zo,o)}break}}}else{const e=t(n);let r=false;let l=false;for(const{imported:t,reexported:n}of[...s||[],...u||[]]){let s;let u;if(t==="default"){if(!r){r=true;if(i!==c){u=i;s=Ho[e]}}}else if(t==="*"&&n!=="*"&&!l){l=true;s=Go[e];u=c}if(s){addInteropStatement(u,s,o)}}}}return`${getHelpersBlock(d,r,o,l,i,s,n)}${p.length>0?`${p.join(h)}${h}${h}`:""}`}function addJsExtension(e){return e.endsWith(".js")?e:e+".js"}function updateExtensionForRelativeAmdId(e,t){if(e[0]!=="."){return e}return t?addJsExtension(e):removeJsExtension(e)}const ha=["assert","async_hooks","buffer","child_process","cluster","console","constants","crypto","dgram","diagnostics_channel","dns","domain","events","fs","http","http2","https","inspector","module","net","os","path","perf_hooks","process","punycode","querystring","readline","repl","stream","string_decoder","timers","tls","trace_events","tty","url","util","v8","vm","wasi","worker_threads","zlib"];var da=ha;const pa=getDefaultExportFromCjs(da);const fa=new Set([...pa,"assert/strict","dns/promises","fs/promises","path/posix","path/win32","readline/promises","stream/consumers","stream/promises","stream/web","timers/promises","util/types"]);function warnOnBuiltins(e,t){const i=t.map((({importPath:e})=>e)).filter((e=>fa.has(e)||e.startsWith("node:")));if(i.length===0)return;e(v,logMissingNodeBuiltins(i))}function amd(e,{accessedGlobals:t,dependencies:i,exports:s,hasDefaultExport:n,hasExports:r,id:o,indent:l,intro:c,isEntryFacade:u,isModuleFacade:h,namedExportsMode:d,log:p,outro:f,snippets:m},{amd:g,esModule:y,externalLiveBindings:E,freeze:x,interop:b,namespaceToStringTag:v,strict:S}){warnOnBuiltins(p,i);const A=i.map((e=>`'${updateExtensionForRelativeAmdId(e.importPath,g.forceJsExtensionForImports)}'`));const w=i.map((e=>e.name));const{n:I,getNonArrowFunctionIntro:C,_:k}=m;if(d&&r){w.unshift(`exports`);A.unshift(`'exports'`)}if(t.has("require")){w.unshift("require");A.unshift(`'require'`)}if(t.has("module")){w.unshift("module");A.unshift(`'module'`)}const _=getCompleteAmdId(g,o);const P=(_?`'${_}',${k}`:``)+(A.length>0?`[${A.join(`,${k}`)}],${k}`:``);const N=S?`${k}'use strict';`:"";e.prepend(`${c}${getInteropBlock(i,b,E,x,v,t,l,m)}`);const R=getExportBlock$1(s,i,d,b,m,l,E);let $=getNamespaceMarkers(d&&r,u&&(y===true||y==="if-default-prop"&&n),h&&v,m);if($){$=I+I+$}e.append(`${R}${$}${f}`).indent(l).prepend(`${g.define}(${P}(${C(w,{isAsync:false,name:null})}{${N}${I}${I}`).append(`${I}${I}}));`)}function cjs(e,{accessedGlobals:t,dependencies:i,exports:s,hasDefaultExport:n,hasExports:r,indent:o,intro:l,isEntryFacade:c,isModuleFacade:u,namedExportsMode:h,outro:d,snippets:p},{compact:f,esModule:m,externalLiveBindings:g,freeze:y,interop:E,namespaceToStringTag:x,strict:b}){const{_:v,n:S}=p;const A=b?`'use strict';${S}${S}`:"";let w=getNamespaceMarkers(h&&r,c&&(m===true||m==="if-default-prop"&&n),u&&x,p);if(w){w+=S+S}const I=getImportBlock$1(i,p,f);const C=getInteropBlock(i,E,g,y,x,t,o,p);e.prepend(`${A}${l}${w}${I}${C}`);const k=getExportBlock$1(s,i,h,E,p,o,g,`module.exports${v}=${v}`);e.append(`${k}${d}`)}function getImportBlock$1(e,{_:t,cnst:i,n:s},n){let r="";let o=false;for(const{importPath:l,name:c,reexports:u,imports:h}of e){if(!u&&!h){if(r){r+=n&&!o?",":`;${s}`}o=false;r+=`require('${l}')`}else{r+=n&&o?",":`${r?`;${s}`:""}${i} `;o=true;r+=`${c}${t}=${t}require('${l}')`}}if(r){return`${r};${s}${s}`}return""}function es(e,{accessedGlobals:t,indent:i,intro:s,outro:n,dependencies:r,exports:o,snippets:l},{externalLiveBindings:c,freeze:u,namespaceToStringTag:h}){const{n:d}=l;const p=getImportBlock(r,l);if(p.length>0)s+=p.join(d)+d+d;s+=getHelpersBlock(null,t,i,l,c,u,h);if(s)e.prepend(s);const f=getExportBlock(o,l);if(f.length>0)e.append(d+d+f.join(d).trim());if(n)e.append(n);e.trim()}function getImportBlock(e,{_:t}){const i=[];for(const{importPath:s,reexports:n,imports:r,name:o,assertions:l}of e){const e=l?`${t}assert${t}${l}`:"";const c=`'${s}'${e};`;if(!n&&!r){i.push(`import${t}${c}`);continue}if(r){let e=null;let s=null;const n=[];for(const t of r){if(t.imported==="default"){e=t}else if(t.imported==="*"){s=t}else{n.push(t)}}if(s){i.push(`import${t}*${t}as ${s.local} from${t}${c}`)}if(e&&n.length===0){i.push(`import ${e.local} from${t}${c}`)}else if(n.length>0){i.push(`import ${e?`${e.local},${t}`:""}{${t}${n.map((e=>e.imported===e.local?e.imported:`${e.imported} as ${e.local}`)).join(`,${t}`)}${t}}${t}from${t}${c}`)}}if(n){let e=null;const s=[];const l=[];for(const t of n){if(t.reexported==="*"){e=t}else if(t.imported==="*"){s.push(t)}else{l.push(t)}}if(e){i.push(`export${t}*${t}from${t}${c}`)}if(s.length>0){if(!r||!r.some((e=>e.imported==="*"&&e.local===o))){i.push(`import${t}*${t}as ${o} from${t}${c}`)}for(const e of s){i.push(`export${t}{${t}${o===e.reexported?o:`${o} as ${e.reexported}`} };`)}}if(l.length>0){i.push(`export${t}{${t}${l.map((e=>e.imported===e.reexported?e.imported:`${e.imported} as ${e.reexported}`)).join(`,${t}`)}${t}}${t}from${t}${c}`)}}}return i}function getExportBlock(e,{_:t,cnst:i}){const s=[];const n=[];for(const r of e){if(r.expression){s.push(`${i} ${r.local}${t}=${t}${r.expression};`)}n.push(r.exported===r.local?r.local:`${r.local} as ${r.exported}`)}if(n.length>0){s.push(`export${t}{${t}${n.join(`,${t}`)}${t}};`)}return s}const keypath=(e,t)=>e.split(".").map(t).join("");function setupNamespace(e,t,i,{_:s,getPropertyAccess:n,s:r},o){const l=e.split(".");l[0]=(typeof i==="function"?i(l[0]):i[l[0]])||l[0];l.pop();let c=t;return l.map((e=>{c+=n(e);return`${c}${s}=${s}${c}${s}||${s}{}${r}`})).join(o?",":"\n")+(o&&l.length>0?";":"\n")}function assignToDeepVariable(e,t,i,s,{_:n,getPropertyAccess:r}){const o=e.split(".");o[0]=(typeof i==="function"?i(o[0]):i[o[0]])||o[0];const l=o.pop();let c=t;let u=[...o.map((e=>{c+=r(e);return`${c}${n}=${n}${c}${n}||${n}{}`})),`${c}${r(l)}`].join(`,${n}`)+`${n}=${n}${s}`;if(o.length>0){u=`(${u})`}return u}function trimEmptyImports(e){let t=e.length;while(t--){const{imports:i,reexports:s}=e[t];if(i||s){return e.slice(0,t+1)}}return[]}function iife(e,{accessedGlobals:t,dependencies:i,exports:s,hasDefaultExport:n,hasExports:r,indent:o,intro:l,namedExportsMode:c,log:u,outro:h,snippets:d},{compact:p,esModule:f,extend:m,freeze:g,externalLiveBindings:y,globals:E,interop:x,name:b,namespaceToStringTag:S,strict:A}){const{_:w,getNonArrowFunctionIntro:I,getPropertyAccess:C,n:k}=d;const _=b&&b.includes(".");const P=!m&&!_;if(b&&P&&!isLegal(b)){return error(logIllegalIdentifierAsName(b))}warnOnBuiltins(u,i);const N=trimEmptyImports(i);const R=N.map((e=>e.globalName||"null"));const $=N.map((e=>e.name));if(r&&!b){u(v,logMissingNameOptionForIifeExport())}if(c&&r){if(m){R.unshift(`this${keypath(b,C)}${w}=${w}this${keypath(b,C)}${w}||${w}{}`);$.unshift("exports")}else{R.unshift("{}");$.unshift("exports")}}const O=A?`${o}'use strict';${k}`:"";const T=getInteropBlock(i,x,y,g,S,t,o,d);e.prepend(`${l}${T}`);let D=`(${I($,{isAsync:false,name:null})}{${k}${O}${k}`;if(r){if(b&&!(m&&c)){D=(P?`var ${b}`:`this${keypath(b,C)}`)+`${w}=${w}${D}`}if(_){D=setupNamespace(b,"this",E,d,p)+D}}let M=`${k}${k}})(${R.join(`,${w}`)});`;if(r&&!m&&c){M=`${k}${k}${o}return exports;${M}`}const L=getExportBlock$1(s,i,c,x,d,o,y);let B=getNamespaceMarkers(c&&r,f===true||f==="if-default-prop"&&n,S,d);if(B){B=k+k+B}e.append(`${L}${B}${h}`).indent(o).prepend(D).append(M)}function system(e,{accessedGlobals:t,dependencies:i,exports:s,hasExports:n,indent:r,intro:o,snippets:l,outro:c,usesTopLevelAwait:u},{externalLiveBindings:h,freeze:d,name:p,namespaceToStringTag:f,strict:m,systemNullSetters:g}){const{_:y,getFunctionIntro:E,getNonArrowFunctionIntro:x,n:b,s:v}=l;const{importBindings:S,setters:A,starExcludes:w}=analyzeDependencies(i,s,r,l);const I=p?`'${p}',${y}`:"";const C=t.has("module")?["exports","module"]:n?["exports"]:[];let k=`System.register(${I}[`+i.map((({importPath:e})=>`'${e}'`)).join(`,${y}`)+`],${y}(${x(C,{isAsync:false,name:null})}{${b}${r}${m?"'use strict';":""}`+getStarExcludesBlock(w,r,l)+getImportBindingsBlock(S,r,l)+`${b}${r}return${y}{${A.length>0?`${b}${r}${r}setters:${y}[${A.map((e=>e?`${E(["module"],{isAsync:false,name:null})}{${b}${r}${r}${r}${e}${b}${r}${r}}`:g?`null`:`${E([],{isAsync:false,name:null})}{}`)).join(`,${y}`)}],`:""}${b}`;k+=`${r}${r}execute:${y}(${x([],{isAsync:u,name:null})}{${b}${b}`;const _=`${r}${r}})${b}${r}}${v}${b}}));`;e.prepend(o+getHelpersBlock(null,t,r,l,h,d,f)+getHoistedExportsBlock(s,r,l)).append(`${c}${b}${b}`+getSyntheticExportsBlock(s,r,l)+getMissingExportsBlock(s,r,l)).indent(`${r}${r}${r}`).append(_).prepend(k)}function analyzeDependencies(e,t,i,{_:s,cnst:n,getObject:r,getPropertyAccess:o,n:l}){const c=[];const u=[];let h=null;for(const{imports:d,reexports:p}of e){const f=[];if(d){for(const e of d){c.push(e.local);if(e.imported==="*"){f.push(`${e.local}${s}=${s}module;`)}else{f.push(`${e.local}${s}=${s}module${o(e.imported)};`)}}}if(p){const l=[];let c=false;for(const{imported:e,reexported:t}of p){if(t==="*"){c=true}else{l.push([t,e==="*"?"module":`module${o(e)}`])}}if(l.length>1||c){const o=r(l,{lineBreakIndent:null});if(c){if(!h){h=getStarExcludes({dependencies:e,exports:t})}f.push(`${n} setter${s}=${s}${o};`,`for${s}(${n} name in module)${s}{`,`${i}if${s}(!_starExcludes[name])${s}setter[name]${s}=${s}module[name];`,"}","exports(setter);")}else{f.push(`exports(${o});`)}}else{const[e,t]=l[0];f.push(`exports('${e}',${s}${t});`)}}u.push(f.join(`${l}${i}${i}${i}`))}return{importBindings:c,setters:u,starExcludes:h}}const getStarExcludes=({dependencies:e,exports:t})=>{const i=new Set(t.map((e=>e.exported)));i.add("default");for(const{reexports:t}of e){if(t){for(const e of t){if(e.reexported!=="*")i.add(e.reexported)}}}return i};const getStarExcludesBlock=(e,t,{_:i,cnst:s,getObject:n,n:r})=>e?`${r}${t}${s} _starExcludes${i}=${i}${n([...e].map((e=>[e,"1"])),{lineBreakIndent:{base:t,t:t}})};`:"";const getImportBindingsBlock=(e,t,{_:i,n:s})=>e.length>0?`${s}${t}var ${e.join(`,${i}`)};`:"";const getHoistedExportsBlock=(e,t,i)=>getExportsBlock(e.filter((e=>e.hoisted)).map((e=>({name:e.exported,value:e.local}))),t,i);function getExportsBlock(e,t,{_:i,n:s}){if(e.length===0){return""}if(e.length===1){return`exports('${e[0].name}',${i}${e[0].value});${s}${s}`}return`exports({${s}`+e.map((({name:e,value:s})=>`${t}${e}:${i}${s}`)).join(`,${s}`)+`${s}});${s}${s}`}const getSyntheticExportsBlock=(e,t,i)=>getExportsBlock(e.filter((e=>e.expression)).map((e=>({name:e.exported,value:e.local}))),t,i);const getMissingExportsBlock=(e,t,i)=>getExportsBlock(e.filter((e=>e.local===na)).map((e=>({name:e.exported,value:na}))),t,i);function globalProperty(e,t,i){if(!e)return"null";return`${t}${keypath(e,i)}`}function safeAccess(e,t,{_:i,getPropertyAccess:s}){let n=t;return e.split(".").map((e=>n+=s(e))).join(`${i}&&${i}`)}function umd(e,{accessedGlobals:t,dependencies:i,exports:s,hasDefaultExport:n,hasExports:r,id:o,indent:l,intro:c,namedExportsMode:u,log:h,outro:d,snippets:p},{amd:f,compact:m,esModule:g,extend:y,externalLiveBindings:E,freeze:x,interop:b,name:v,namespaceToStringTag:S,globals:A,noConflict:w,strict:I}){const{_:C,cnst:k,getFunctionIntro:_,getNonArrowFunctionIntro:P,getPropertyAccess:N,n:R,s:$}=p;const O=m?"f":"factory";const T=m?"g":"global";if(r&&!v){return error(logMissingNameOptionForUmdExport())}warnOnBuiltins(h,i);const D=i.map((e=>`'${updateExtensionForRelativeAmdId(e.importPath,f.forceJsExtensionForImports)}'`));const M=i.map((e=>`require('${e.importPath}')`));const L=trimEmptyImports(i);const B=L.map((e=>globalProperty(e.globalName,T,N)));const F=L.map((e=>e.name));if(u&&(r||w)){D.unshift(`'exports'`);M.unshift(`exports`);B.unshift(assignToDeepVariable(v,T,A,`${y?`${globalProperty(v,T,N)}${C}||${C}`:""}{}`,p));F.unshift("exports")}const V=getCompleteAmdId(f,o);const z=(V?`'${V}',${C}`:``)+(D.length>0?`[${D.join(`,${C}`)}],${C}`:``);const j=f.define;const U=!u&&r?`module.exports${C}=${C}`:``;const H=I?`${C}'use strict';${R}`:``;let G;if(w){const e=m?"e":"exports";let t;if(!u&&r){t=`${k} ${e}${C}=${C}${assignToDeepVariable(v,T,A,`${O}(${B.join(`,${C}`)})`,p)};`}else{const i=B.shift();t=`${k} ${e}${C}=${C}${i};${R}`+`${l}${l}${O}(${[e,...B].join(`,${C}`)});`}G=`(${_([],{isAsync:false,name:null})}{${R}`+`${l}${l}${k} current${C}=${C}${safeAccess(v,T,p)};${R}`+`${l}${l}${t}${R}`+`${l}${l}${e}.noConflict${C}=${C}${_([],{isAsync:false,name:null})}{${C}`+`${globalProperty(v,T,N)}${C}=${C}current;${C}return ${e}${$}${C}};${R}`+`${l}})()`}else{G=`${O}(${B.join(`,${C}`)})`;if(!u&&r){G=assignToDeepVariable(v,T,A,G,p)}}const W=r||w&&u||B.length>0;const q=[O];if(W){q.unshift(T)}const K=W?`this,${C}`:"";const Y=W?`(${T}${C}=${C}typeof globalThis${C}!==${C}'undefined'${C}?${C}globalThis${C}:${C}${T}${C}||${C}self,${C}`:"";const Q=W?")":"";const X=W?`${l}typeof exports${C}===${C}'object'${C}&&${C}typeof module${C}!==${C}'undefined'${C}?`+`${C}${U}${O}(${M.join(`,${C}`)})${C}:${R}`:"";const Z=`(${P(q,{isAsync:false,name:null})}{${R}`+X+`${l}typeof ${j}${C}===${C}'function'${C}&&${C}${j}.amd${C}?${C}${j}(${z}${O})${C}:${R}`+`${l}${Y}${G}${Q};${R}`+`})(${K}(${P(F,{isAsync:false,name:null})}{${H}${R}`;const J=R+R+"}));";e.prepend(`${c}${getInteropBlock(i,b,E,x,S,t,l,p)}`);const ee=getExportBlock$1(s,i,u,b,p,l,E);let te=getNamespaceMarkers(u&&r,g===true||g==="if-default-prop"&&n,S,p);if(te){te=R+R+te}e.append(`${ee}${te}${d}`).trim().indent(l).append(J).prepend(Z)}const ma={amd:amd,cjs:cjs,es:es,iife:iife,system:system,umd:umd};const concatSeparator=(e,t)=>t?`${e}\n${t}`:e;const concatDblSeparator=(e,t)=>t?`${e}\n\n${t}`:e;async function createAddons(e,t,i){try{let[s,n,r,o]=await Promise.all([t.hookReduceValue("banner",e.banner(i),[i],concatSeparator),t.hookReduceValue("footer",e.footer(i),[i],concatSeparator),t.hookReduceValue("intro",e.intro(i),[i],concatDblSeparator),t.hookReduceValue("outro",e.outro(i),[i],concatDblSeparator)]);if(r)r+="\n\n";if(o)o=`\n\n${o}`;if(s)s+="\n";if(n)n="\n"+n;return{banner:s,footer:n,intro:r,outro:o}}catch(e){return error(logAddonNotGenerated(e.message,e.hook,e.plugin))}}const ga={amd:deconflictImportsOther,cjs:deconflictImportsOther,es:deconflictImportsEsmOrSystem,iife:deconflictImportsOther,system:deconflictImportsEsmOrSystem,umd:deconflictImportsOther};function deconflictChunk(e,t,i,s,n,r,o,l,c,u,h,d,p,f){const m=[...e].reverse();for(const e of m){e.scope.addUsedOutsideNames(s,n,d,p)}deconflictTopLevelVariables(s,m,f);ga[n](s,i,t,r,o,l,c,u,h);for(const e of m){e.scope.deconflict(n,d,p)}}function deconflictImportsEsmOrSystem(e,t,i,s,n,r,o,l,c){for(const t of i.dependencies){if(n||t instanceof ExternalChunk){t.variableName=getSafeName(t.suggestedVariableName,e,null)}}for(const i of t){const t=i.module;const s=i.name;if(i.isNamespace&&(n||t instanceof ExternalModule)){i.setRenderNames(null,(t instanceof ExternalModule?l.get(t):o.get(t)).variableName)}else if(t instanceof ExternalModule&&s==="default"){i.setRenderNames(null,getSafeName([...t.exportedVariables].some((([e,t])=>t==="*"&&e.included))?t.suggestedVariableName+"__default":t.suggestedVariableName,e,i.forbiddenNames))}else{i.setRenderNames(null,getSafeName(s,e,i.forbiddenNames))}}for(const t of c){t.setRenderNames(null,getSafeName(t.name,e,t.forbiddenNames))}}function deconflictImportsOther(e,t,{deconflictedDefault:i,deconflictedNamespace:s,dependencies:n},r,o,l,c,u){for(const t of n){t.variableName=getSafeName(t.suggestedVariableName,e,null)}for(const t of s){t.namespaceVariableName=getSafeName(`${t.suggestedVariableName}__namespace`,e,null)}for(const t of i){t.defaultVariableName=s.has(t)&&canDefaultBeTakenFromNamespace(r(t.id),l)?t.namespaceVariableName:getSafeName(`${t.suggestedVariableName}__default`,e,null)}for(const e of t){const t=e.module;if(t instanceof ExternalModule){const i=u.get(t);const s=e.name;if(s==="default"){const s=r(t.id);const n=Ho[s]?i.defaultVariableName:i.variableName;if(isDefaultAProperty(s,l)){e.setRenderNames(n,"default")}else{e.setRenderNames(null,n)}}else if(s==="*"){e.setRenderNames(null,Go[r(t.id)]?i.namespaceVariableName:i.variableName)}else{e.setRenderNames(i.variableName,null)}}else{const i=c.get(t);if(o&&e.isNamespace){e.setRenderNames(null,i.exportMode==="default"?i.namespaceVariableName:i.variableName)}else if(i.exportMode==="default"){e.setRenderNames(null,i.variableName)}else{e.setRenderNames(i.variableName,i.getVariableExportName(e))}}}}function deconflictTopLevelVariables(e,t,i){for(const s of t){for(const t of s.scope.variables.values()){if(t.included&&!(t.renderBaseName||t instanceof ExportDefaultVariable&&t.getOriginalVariable()!==t)){t.setRenderNames(null,getSafeName(t.name,e,t.forbiddenNames))}}if(i.has(s)){const t=s.namespace;t.setRenderNames(null,getSafeName(t.name,e,t.forbiddenNames))}}}function assignExportsToMangledNames(e,t,i){let s=0;for(const n of e){let[e]=n.name;if(t.has(e)){do{e=toBase64(++s);if(e.charCodeAt(0)===49){s+=9*64**(e.length-1);e=toBase64(s)}}while(Fs.has(e)||t.has(e))}t.set(e,n);i.set(n,[e])}}function assignExportsToNames(e,t,i){for(const s of e){let e=0;let n=s.name;while(t.has(n)){n=s.name+"$"+ ++e}t.set(n,s);i.set(s,[n])}}function getExportMode(e,{exports:t,name:i,format:s},n,r){const o=e.getExportNames();if(t==="default"){if(o.length!==1||o[0]!=="default"){return error(logIncompatibleExportOptionValue("default",o,n))}}else if(t==="none"&&o.length>0){return error(logIncompatibleExportOptionValue("none",o,n))}if(t==="auto"){if(o.length===0){t="none"}else if(o.length===1&&o[0]==="default"){t="default"}else{if(s!=="es"&&s!=="system"&&o.includes("default")){r(v,logMixedExport(n,i))}t="named"}}return t}function guessIndentString(e){const t=e.split("\n");const i=t.filter((e=>/^\t+/.test(e)));const s=t.filter((e=>/^ {2,}/.test(e)));if(i.length===0&&s.length===0){return null}if(i.length>=s.length){return"\t"}const n=s.reduce(((e,t)=>{const i=/^ +/.exec(t)[0].length;return Math.min(i,e)}),Infinity);return" ".repeat(n)}function getIndentString(e,t){if(t.indent!==true)return t.indent;for(const t of e){const e=guessIndentString(t.originalCode);if(e!==null)return e}return"\t"}function getStaticDependencies(e,t,i,s){const n=[];const r=new Set;for(let o=t.length-1;o>=0;o--){const l=t[o];if(!r.has(l)){const t=[];addStaticDependencies(l,t,r,e,i,s);n.unshift(t)}}const o=new Set;for(const e of n){for(const t of e){o.add(t)}}return o}function addStaticDependencies(e,t,i,s,n,r){const o=e.getDependenciesToBeIncluded();for(const e of o){if(e instanceof ExternalModule){t.push(r.get(e));continue}const o=n.get(e);if(o!==s){t.push(o);continue}if(!i.has(e)){i.add(e);addStaticDependencies(e,t,i,s,n,r)}}}const ya=new Set([".js",".jsx",".ts",".tsx",".mjs",".mts",".cjs",".cts"]);function getGlobalName(e,t,i,s){const n=typeof t==="function"?t(e.id):t[e.id];if(n){return n}if(i){s(v,logMissingGlobalName(e.id,e.variableName));return e.variableName}}class Chunk{constructor(e,t,i,s,n,r,o,l,c,u,h,d,p,f,m){this.orderedModules=e;this.inputOptions=t;this.outputOptions=i;this.unsetOptions=s;this.pluginDriver=n;this.modulesById=r;this.chunkByModule=o;this.externalChunkByModule=l;this.facadeChunkByModule=c;this.includedNamespaces=u;this.manualChunkAlias=h;this.getPlaceholder=d;this.bundle=p;this.inputBase=f;this.snippets=m;this.entryModules=[];this.exportMode="named";this.facadeModule=null;this.namespaceVariableName="";this.variableName="";this.accessedGlobalsByScope=new Map;this.dependencies=new Set;this.dynamicEntryModules=[];this.dynamicName=null;this.exportNamesByVariable=new Map;this.exports=new Set;this.exportsByName=new Map;this.fileName=null;this.implicitEntryModules=[];this.implicitlyLoadedBefore=new Set;this.imports=new Set;this.includedDynamicImports=null;this.includedReexportsByModule=new Map;this.isEmpty=true;this.name=null;this.needsExportsShim=false;this.preRenderedChunkInfo=null;this.preliminaryFileName=null;this.preliminarySourcemapFileName=null;this.renderedChunkInfo=null;this.renderedDependencies=null;this.renderedModules=Object.create(null);this.sortedExportNames=null;this.strictFacade=false;this.execIndex=e.length>0?e[0].execIndex:Infinity;const g=new Set(e);for(const t of e){o.set(t,this);if(t.namespace.included&&!i.preserveModules){u.add(t)}if(this.isEmpty&&t.isIncluded()){this.isEmpty=false}if(t.info.isEntry||i.preserveModules){this.entryModules.push(t)}for(const e of t.includedDynamicImporters){if(!g.has(e)){this.dynamicEntryModules.push(t);if(t.info.syntheticNamedExports){u.add(t);this.exports.add(t.namespace)}}}if(t.implicitlyLoadedAfter.size>0){this.implicitEntryModules.push(t)}}this.suggestedVariableName=makeLegal(this.generateVariableName())}static generateFacade(e,t,i,s,n,r,o,l,c,u,h,d,p,f,m){const g=new Chunk([],e,t,i,s,n,r,o,l,c,null,d,p,f,m);g.assignFacadeName(h,u);if(!l.has(u)){l.set(u,g)}for(const e of u.getDependenciesToBeIncluded()){g.dependencies.add(e instanceof Module?r.get(e):o.get(e))}if(!g.dependencies.has(r.get(u))&&u.info.moduleSideEffects&&u.hasEffects()){g.dependencies.add(r.get(u))}g.ensureReexportsAreAvailableForModule(u);g.facadeModule=u;g.strictFacade=true;return g}canModuleBeFacade(e,t){const i=e.getExportNamesByVariable();for(const e of this.exports){if(!i.has(e)){return false}}for(const s of t){if(!(s.module===e||i.has(s)||s instanceof SyntheticNamedExportVariable&&i.has(s.getBaseVariable()))){return false}}return true}finalizeChunk(e,t,i,s){const n=this.getRenderedChunkInfo();const finalize=e=>replacePlaceholders(e,s);const r=n.fileName;const o=this.fileName=finalize(r);return{...n,code:e,dynamicImports:n.dynamicImports.map(finalize),fileName:o,implicitlyLoadedBefore:n.implicitlyLoadedBefore.map(finalize),importedBindings:Object.fromEntries(Object.entries(n.importedBindings).map((([e,t])=>[finalize(e),t]))),imports:n.imports.map(finalize),map:t,preliminaryFileName:r,referencedFiles:n.referencedFiles.map(finalize),sourcemapFileName:i}}generateExports(){this.sortedExportNames=null;const e=new Set(this.exports);if(this.facadeModule!==null&&(this.facadeModule.preserveSignature!==false||this.strictFacade)){const t=this.facadeModule.getExportNamesByVariable();for(const[i,s]of t){this.exportNamesByVariable.set(i,[...s]);for(const e of s){this.exportsByName.set(e,i)}e.delete(i)}}if(this.outputOptions.minifyInternalExports){assignExportsToMangledNames(e,this.exportsByName,this.exportNamesByVariable)}else{assignExportsToNames(e,this.exportsByName,this.exportNamesByVariable)}if(this.outputOptions.preserveModules||this.facadeModule&&this.facadeModule.info.isEntry)this.exportMode=getExportMode(this,this.outputOptions,this.facadeModule.id,this.inputOptions.onLog)}generateFacades(){const e=[];const t=new Set([...this.entryModules,...this.implicitEntryModules]);const i=new Set(this.dynamicEntryModules.map((({namespace:e})=>e)));for(const e of t){if(e.preserveSignature){for(const t of e.getExportNamesByVariable().keys()){if(this.chunkByModule.get(t.module)===this){i.add(t)}}}}for(const s of t){const t=Array.from(new Set(s.chunkNames.filter((({isUserDefined:e})=>e)).map((({name:e})=>e))),(e=>({name:e})));if(t.length===0&&s.isUserDefinedEntryPoint){t.push({})}t.push(...Array.from(s.chunkFileNames,(e=>({fileName:e}))));if(t.length===0){t.push({})}if(!this.facadeModule){const e=!this.outputOptions.preserveModules&&(s.preserveSignature==="strict"||s.preserveSignature==="exports-only"&&s.getExportNamesByVariable().size>0);if(!e||this.canModuleBeFacade(s,i)){this.facadeModule=s;this.facadeChunkByModule.set(s,this);if(s.preserveSignature){this.strictFacade=e}this.assignFacadeName(t.shift(),s,this.outputOptions.preserveModules)}}for(const i of t){e.push(Chunk.generateFacade(this.inputOptions,this.outputOptions,this.unsetOptions,this.pluginDriver,this.modulesById,this.chunkByModule,this.externalChunkByModule,this.facadeChunkByModule,this.includedNamespaces,s,i,this.getPlaceholder,this.bundle,this.inputBase,this.snippets))}}for(const e of this.dynamicEntryModules){if(e.info.syntheticNamedExports)continue;if(!this.facadeModule&&this.canModuleBeFacade(e,i)){this.facadeModule=e;this.facadeChunkByModule.set(e,this);this.strictFacade=true;this.dynamicName=getChunkNameFromModule(e)}else if(this.facadeModule===e&&!this.strictFacade&&this.canModuleBeFacade(e,i)){this.strictFacade=true}else if(!this.facadeChunkByModule.get(e)?.strictFacade){this.includedNamespaces.add(e);this.exports.add(e.namespace)}}if(!this.outputOptions.preserveModules){this.addNecessaryImportsForFacades()}return e}getChunkName(){return this.name??(this.name=this.outputOptions.sanitizeFileName(this.getFallbackChunkName()))}getExportNames(){return this.sortedExportNames??(this.sortedExportNames=[...this.exportsByName.keys()].sort())}getFileName(){return this.fileName||this.getPreliminaryFileName().fileName}getImportPath(e){return escapeId(getImportPath(e,this.getFileName(),this.outputOptions.format==="amd"&&!this.outputOptions.amd.forceJsExtensionForImports,true))}getPreliminaryFileName(){if(this.preliminaryFileName){return this.preliminaryFileName}let e;let t=null;const{chunkFileNames:i,entryFileNames:s,file:n,format:o,preserveModules:l}=this.outputOptions;if(n){e=r.basename(n)}else if(this.fileName===null){const[n,r]=l||this.facadeModule?.isUserDefinedEntryPoint?[s,"output.entryFileNames"]:[i,"output.chunkFileNames"];e=renderNamePattern(typeof n==="function"?n(this.getPreRenderedChunkInfo()):n,r,{format:()=>o,hash:e=>t||(t=this.getPlaceholder(r,e)),name:()=>this.getChunkName()});if(!t){e=makeUnique(e,this.bundle)}}else{e=this.fileName}if(!t){this.bundle[e]=Ot}return this.preliminaryFileName={fileName:e,hashPlaceholder:t}}getPreliminarySourcemapFileName(){if(this.preliminarySourcemapFileName){return this.preliminarySourcemapFileName}let e=null;let t=null;const{sourcemapFileNames:i,format:s}=this.outputOptions;if(i){const[n,r]=[i,"output.sourcemapFileNames"];e=renderNamePattern(typeof n==="function"?n(this.getPreRenderedChunkInfo()):n,r,{chunkhash:()=>this.getPreliminaryFileName().hashPlaceholder||"",format:()=>s,hash:e=>t||(t=this.getPlaceholder(r,e)),name:()=>this.getChunkName()});if(!t){e=makeUnique(e,this.bundle)}}else{return null}return this.preliminarySourcemapFileName={fileName:e,hashPlaceholder:t}}getRenderedChunkInfo(){if(this.renderedChunkInfo){return this.renderedChunkInfo}return this.renderedChunkInfo={...this.getPreRenderedChunkInfo(),dynamicImports:this.getDynamicDependencies().map(resolveFileName),fileName:this.getFileName(),implicitlyLoadedBefore:Array.from(this.implicitlyLoadedBefore,resolveFileName),importedBindings:getImportedBindingsPerDependency(this.getRenderedDependencies(),resolveFileName),imports:Array.from(this.dependencies,resolveFileName),modules:this.renderedModules,referencedFiles:this.getReferencedFiles()}}getVariableExportName(e){if(this.outputOptions.preserveModules&&e instanceof NamespaceVariable){return"*"}return this.exportNamesByVariable.get(e)[0]}link(){this.dependencies=getStaticDependencies(this,this.orderedModules,this.chunkByModule,this.externalChunkByModule);for(const e of this.orderedModules){this.addImplicitlyLoadedBeforeFromModule(e);this.setUpChunkImportsAndExportsForModule(e)}}async render(){const{dependencies:e,exportMode:t,facadeModule:i,inputOptions:{onLog:s},outputOptions:n,pluginDriver:r,snippets:o}=this;const{format:l,hoistTransitiveImports:c,preserveModules:u}=n;if(c&&!u&&i!==null){for(const t of e){if(t instanceof Chunk)this.inlineChunkDependencies(t)}}const h=this.getPreliminaryFileName();const d=this.getPreliminarySourcemapFileName();const{accessedGlobals:p,indent:f,magicString:m,renderedSource:g,usedModules:y,usesTopLevelAwait:E}=this.renderModules(h.fileName);const x=[...this.getRenderedDependencies().values()];const b=t==="none"?[]:this.getChunkExportDeclarations(l);let v=b.length>0;let S=false;for(const e of x){const{reexports:t}=e;if(t?.length){v=true;if(!S&&t.some((e=>e.reexported==="default"))){S=true}if(l==="es"){e.reexports=t.filter((({reexported:e})=>!b.find((({exported:t})=>t===e))))}}}if(!S){for(const{exported:e}of b){if(e==="default"){S=true;break}}}const{intro:A,outro:w,banner:I,footer:C}=await createAddons(n,r,this.getRenderedChunkInfo());ma[l](g,{accessedGlobals:p,dependencies:x,exports:b,hasDefaultExport:S,hasExports:v,id:h.fileName,indent:f,intro:A,isEntryFacade:u||i!==null&&i.info.isEntry,isModuleFacade:i!==null,log:s,namedExportsMode:t!=="default",outro:w,snippets:o,usesTopLevelAwait:E},n);if(I)m.prepend(I);if(C)m.append(C);return{chunk:this,magicString:m,preliminaryFileName:h,preliminarySourcemapFileName:d,usedModules:y}}addImplicitlyLoadedBeforeFromModule(e){const{chunkByModule:t,implicitlyLoadedBefore:i}=this;for(const s of e.implicitlyLoadedBefore){const e=t.get(s);if(e&&e!==this){i.add(e)}}}addNecessaryImportsForFacades(){for(const[e,t]of this.includedReexportsByModule){if(this.includedNamespaces.has(e)){for(const e of t){this.imports.add(e)}}}}assignFacadeName({fileName:e,name:t},i,s){if(e){this.fileName=e}else{this.name=this.outputOptions.sanitizeFileName(t||(s?this.getPreserveModulesChunkNameFromModule(i):getChunkNameFromModule(i)))}}checkCircularDependencyImport(e,t){const i=e.module;if(i instanceof Module){const s=this.chunkByModule.get(i);let n;do{n=t.alternativeReexportModules.get(e);if(n){const r=this.chunkByModule.get(n);if(r!==s){this.inputOptions.onLog(v,logCyclicCrossChunkReexport(i.getExportNamesByVariable().get(e)?.[0]||"*",i.id,n.id,t.id,this.outputOptions.preserveModules))}t=n}}while(n)}}ensureReexportsAreAvailableForModule(e){const t=[];const i=e.getExportNamesByVariable();for(const s of i.keys()){const i=s instanceof SyntheticNamedExportVariable;const n=i?s.getBaseVariable():s;this.checkCircularDependencyImport(n,e);if(!(n instanceof NamespaceVariable&&this.outputOptions.preserveModules)){const e=n.module;if(e instanceof Module){const s=this.chunkByModule.get(e);if(s&&s!==this){s.exports.add(n);t.push(n);if(i){this.imports.add(n)}}}}}if(t.length>0){this.includedReexportsByModule.set(e,t)}}generateVariableName(){if(this.manualChunkAlias){return this.manualChunkAlias}const e=this.entryModules[0]||this.implicitEntryModules[0]||this.dynamicEntryModules[0]||this.orderedModules[this.orderedModules.length-1];if(e){return getChunkNameFromModule(e)}return"chunk"}getChunkExportDeclarations(e){const t=[];for(const i of this.getExportNames()){if(i[0]==="*")continue;const s=this.exportsByName.get(i);if(!(s instanceof SyntheticNamedExportVariable)){const t=s.module;if(t){const s=this.chunkByModule.get(t);if(s!==this){if(!s||e!=="es"){continue}const t=this.renderedDependencies.get(s);if(!t){continue}const{imports:n,reexports:r}=t;const o=r?.find((({reexported:e})=>e===i));const l=n?.find((({imported:e})=>e===o?.imported));if(!l){continue}}}}let n=null;let r=false;let o=s.getName(this.snippets.getPropertyAccess);if(s instanceof LocalVariable){for(const e of s.declarations){if(e.parent instanceof FunctionDeclaration||e instanceof ExportDefaultDeclaration&&e.declaration instanceof FunctionDeclaration){r=true;break}}}else if(s instanceof SyntheticNamedExportVariable){n=o;if(e==="es"){o=s.renderName}}t.push({exported:i,expression:n,hoisted:r,local:o})}return t}getDependenciesToBeDeconflicted(e,t,i){const s=new Set;const n=new Set;const r=new Set;for(const t of[...this.exportNamesByVariable.keys(),...this.imports]){if(e||t.isNamespace){const o=t.module;if(o instanceof ExternalModule){const l=this.externalChunkByModule.get(o);s.add(l);if(e){if(t.name==="default"){if(Ho[i(o.id)]){n.add(l)}}else if(t.name==="*"&&Go[i(o.id)]){r.add(l)}}}else{const i=this.chunkByModule.get(o);if(i!==this){s.add(i);if(e&&i.exportMode==="default"&&t.isNamespace){r.add(i)}}}}}if(t){for(const e of this.dependencies){s.add(e)}}return{deconflictedDefault:n,deconflictedNamespace:r,dependencies:s}}getDynamicDependencies(){return this.getIncludedDynamicImports().map((e=>e.facadeChunk||e.chunk||e.externalChunk||e.resolution)).filter((e=>e!==this&&(e instanceof Chunk||e instanceof ExternalChunk)))}getDynamicImportStringAndAssertions(e,t){if(e instanceof ExternalModule){const i=this.externalChunkByModule.get(e);return[`'${i.getImportPath(t)}'`,i.getImportAssertions(this.snippets)]}return[e||"",this.outputOptions.format==="es"&&this.outputOptions.externalImportAssertions||null]}getFallbackChunkName(){if(this.manualChunkAlias){return this.manualChunkAlias}if(this.dynamicName){return this.dynamicName}if(this.fileName){return getAliasName(this.fileName)}return getAliasName(this.orderedModules[this.orderedModules.length-1].id)}getImportSpecifiers(){const{interop:e}=this.outputOptions;const t=new Map;for(const i of this.imports){const s=i.module;let n;let r;if(s instanceof ExternalModule){n=this.externalChunkByModule.get(s);r=i.name;if(r!=="default"&&r!=="*"&&e(s.id)==="defaultOnly"){return error(logUnexpectedNamedImport(s.id,r,false))}}else{n=this.chunkByModule.get(s);r=n.getVariableExportName(i)}getOrCreate(t,n,getNewArray).push({imported:r,local:i.getName(this.snippets.getPropertyAccess)})}return t}getIncludedDynamicImports(){if(this.includedDynamicImports){return this.includedDynamicImports}const e=[];for(const t of this.orderedModules){for(const{node:i,resolution:s}of t.dynamicImports){if(!i.included){continue}e.push(s instanceof Module?{chunk:this.chunkByModule.get(s),externalChunk:null,facadeChunk:this.facadeChunkByModule.get(s),node:i,resolution:s}:s instanceof ExternalModule?{chunk:null,externalChunk:this.externalChunkByModule.get(s),facadeChunk:null,node:i,resolution:s}:{chunk:null,externalChunk:null,facadeChunk:null,node:i,resolution:s})}}return this.includedDynamicImports=e}getPreRenderedChunkInfo(){if(this.preRenderedChunkInfo){return this.preRenderedChunkInfo}const{dynamicEntryModules:e,facadeModule:t,implicitEntryModules:i,orderedModules:s}=this;return this.preRenderedChunkInfo={exports:this.getExportNames(),facadeModuleId:t&&t.id,isDynamicEntry:e.length>0,isEntry:!!t?.info.isEntry,isImplicitEntry:i.length>0,moduleIds:s.map((({id:e})=>e)),name:this.getChunkName(),type:"chunk"}}getPreserveModulesChunkNameFromModule(e){const t=getPredefinedChunkNameFromModule(e);if(t)return t;const{preserveModulesRoot:i,sanitizeFileName:s}=this.outputOptions;const n=s(normalize(e.id.split(Ea,1)[0]));const o=r.extname(n);const l=ya.has(o)?n.slice(0,-o.length):n;if(isAbsolute(l)){return i&&r.resolve(l).startsWith(i)?l.slice(i.length).replace(/^[/\\]/,""):relative(this.inputBase,l)}else{return`_virtual/${r.basename(l)}`}}getReexportSpecifiers(){const{externalLiveBindings:e,interop:t}=this.outputOptions;const i=new Map;for(let s of this.getExportNames()){let n;let r;let o=false;if(s[0]==="*"){const i=s.slice(1);if(t(i)==="defaultOnly"){this.inputOptions.onLog(v,logUnexpectedNamespaceReexport(i))}o=e;n=this.externalChunkByModule.get(this.modulesById.get(i));r=s="*"}else{const i=this.exportsByName.get(s);if(i instanceof SyntheticNamedExportVariable)continue;const l=i.module;if(l instanceof Module){n=this.chunkByModule.get(l);if(n===this)continue;r=n.getVariableExportName(i);o=i.isReassigned}else{n=this.externalChunkByModule.get(l);r=i.name;if(r!=="default"&&r!=="*"&&t(l.id)==="defaultOnly"){return error(logUnexpectedNamedImport(l.id,r,true))}o=e&&(r!=="default"||isDefaultAProperty(t(l.id),true))}}getOrCreate(i,n,getNewArray).push({imported:r,needsLiveBinding:o,reexported:s})}return i}getReferencedFiles(){const e=new Set;for(const t of this.orderedModules){for(const i of t.importMetas){const t=i.getReferencedFileName(this.pluginDriver);if(t){e.add(t)}}}return[...e]}getRenderedDependencies(){if(this.renderedDependencies){return this.renderedDependencies}const e=this.getImportSpecifiers();const t=this.getReexportSpecifiers();const i=new Map;const s=this.getFileName();for(const n of this.dependencies){const r=e.get(n)||null;const o=t.get(n)||null;const l=n instanceof ExternalChunk||n.exportMode!=="default";const c=n.getImportPath(s);i.set(n,{assertions:n instanceof ExternalChunk?n.getImportAssertions(this.snippets):null,defaultVariableName:n.defaultVariableName,globalName:n instanceof ExternalChunk&&(this.outputOptions.format==="umd"||this.outputOptions.format==="iife")&&getGlobalName(n,this.outputOptions.globals,(r||o)!==null,this.inputOptions.onLog),importPath:c,imports:r,isChunk:n instanceof Chunk,name:n.variableName,namedExportsMode:l,namespaceVariableName:n.namespaceVariableName,reexports:o})}return this.renderedDependencies=i}inlineChunkDependencies(e){for(const t of e.dependencies){if(this.dependencies.has(t))continue;this.dependencies.add(t);if(t instanceof Chunk){this.inlineChunkDependencies(t)}}}renderModules(e){const{accessedGlobalsByScope:t,dependencies:i,exportNamesByVariable:s,includedNamespaces:n,inputOptions:{onLog:r},isEmpty:o,orderedModules:l,outputOptions:c,pluginDriver:u,renderedModules:h,snippets:d}=this;const{compact:p,dynamicImportFunction:f,format:m,freeze:g,namespaceToStringTag:y}=c;const{_:E,cnst:x,n:b}=d;this.setDynamicImportResolutions(e);this.setImportMetaResolutions(e);this.setIdentifierRenderResolutions();const S=new fs({separator:`${b}${b}`});const A=getIndentString(l,c);const w=[];let I="";const C=new Set;const k=new Map;const _={accessedDocumentCurrentScript:false,dynamicImportFunction:f,exportNamesByVariable:s,format:m,freeze:g,indent:A,namespaceToStringTag:y,pluginDriver:u,snippets:d,useOriginalName:null};let P=false;for(const e of l){let i=0;let s;if(e.isIncluded()||n.has(e)){const r=e.render(_);if(!_.accessedDocumentCurrentScript&&Xo.includes(m)){this.accessedGlobalsByScope.get(e.scope)?.delete(Uo)}_.accessedDocumentCurrentScript=false;({source:s}=r);P||(P=r.usesTopLevelAwait);i=s.length();if(i){if(p&&s.lastLine().includes("//"))s.append("\n");k.set(e,s);S.addSource(s);w.push(e)}const o=e.namespace;if(n.has(e)){const e=o.renderBlock(_);if(o.renderFirst())I+=b+e;else S.addSource(new MagicString(e))}const l=t.get(e.scope);if(l){for(const e of l){C.add(e)}}}const{renderedExports:r,removedExports:o}=e.getRenderedExports();h[e.id]={get code(){return s?.toString()??null},originalLength:e.originalCode.length,removedExports:o,renderedExports:r,renderedLength:i}}if(I)S.prepend(I+b+b);if(this.needsExportsShim){S.prepend(`${b}${x} ${na}${E}=${E}void 0;${b}${b}`)}const N=p?S:S.trim();if(o&&this.getExportNames().length===0&&i.size===0){r(v,logEmptyChunk(this.getChunkName()))}return{accessedGlobals:C,indent:A,magicString:S,renderedSource:N,usedModules:w,usesTopLevelAwait:P}}setDynamicImportResolutions(e){const{accessedGlobalsByScope:t,outputOptions:i,pluginDriver:s,snippets:n}=this;for(const r of this.getIncludedDynamicImports()){if(r.chunk){const{chunk:o,facadeChunk:l,node:c,resolution:u}=r;if(o===this){c.setInternalResolution(u.namespace)}else{c.setExternalResolution((l||o).exportMode,u,i,n,s,t,`'${(l||o).getImportPath(e)}'`,!l?.strictFacade&&o.exportNamesByVariable.get(u.namespace)[0],null)}}else{const{node:o,resolution:l}=r;const[c,u]=this.getDynamicImportStringAndAssertions(l,e);o.setExternalResolution("external",l,i,n,s,t,c,false,u)}}}setIdentifierRenderResolutions(){const{format:e,interop:t,namespaceToStringTag:i,preserveModules:s,externalLiveBindings:n}=this.outputOptions;const r=new Set;for(const t of this.getExportNames()){const i=this.exportsByName.get(t);if(e!=="es"&&e!=="system"&&i.isReassigned&&!i.isId){i.setRenderNames("exports",t)}else if(i instanceof SyntheticNamedExportVariable){r.add(i)}else{i.setRenderNames(null,null)}}for(const e of this.orderedModules){if(e.needsExportShim){this.needsExportsShim=true;break}}const o=new Set(["Object","Promise"]);if(this.needsExportsShim){o.add(na)}if(i){o.add("Symbol")}switch(e){case"system":{o.add("module").add("exports");break}case"es":{break}case"cjs":{o.add("module").add("require").add("__filename").add("__dirname")}default:{o.add("exports");for(const e of qo){o.add(e)}}}deconflictChunk(this.orderedModules,this.getDependenciesToBeDeconflicted(e!=="es"&&e!=="system",e==="amd"||e==="umd"||e==="iife",t),this.imports,o,e,t,s,n,this.chunkByModule,this.externalChunkByModule,r,this.exportNamesByVariable,this.accessedGlobalsByScope,this.includedNamespaces)}setImportMetaResolutions(e){const{accessedGlobalsByScope:t,includedNamespaces:i,orderedModules:s,outputOptions:{format:n}}=this;for(const r of s){for(const i of r.importMetas){i.setResolution(n,t,e)}if(i.has(r)){r.namespace.prepare(t)}}}setUpChunkImportsAndExportsForModule(e){const t=new Set(e.includedImports);if(!this.outputOptions.preserveModules&&this.includedNamespaces.has(e)){const i=e.namespace.getMemberVariables();for(const e of Object.values(i)){if(e.included){t.add(e)}}}for(let i of t){if(i instanceof ExportDefaultVariable){i=i.getOriginalVariable()}if(i instanceof SyntheticNamedExportVariable){i=i.getBaseVariable()}const t=this.chunkByModule.get(i.module);if(t!==this){this.imports.add(i);if(i.module instanceof Module){this.checkCircularDependencyImport(i,e);if(!(i instanceof NamespaceVariable&&this.outputOptions.preserveModules)){t.exports.add(i)}}}}if(this.includedNamespaces.has(e)||e.info.isEntry&&e.preserveSignature!==false||e.includedDynamicImporters.some((e=>this.chunkByModule.get(e)!==this))){this.ensureReexportsAreAvailableForModule(e)}for(const{node:t,resolution:i}of e.dynamicImports){if(t.included&&i instanceof Module&&this.chunkByModule.get(i)===this&&!this.includedNamespaces.has(i)){this.includedNamespaces.add(i);this.ensureReexportsAreAvailableForModule(i)}}}}function getChunkNameFromModule(e){return getPredefinedChunkNameFromModule(e)??getAliasName(e.id)}function getPredefinedChunkNameFromModule(e){return e.chunkNames.find((({isUserDefined:e})=>e))?.name??e.chunkNames[0]?.name}function getImportedBindingsPerDependency(e,t){const i={};for(const[s,n]of e){const e=new Set;if(n.imports){for(const{imported:t}of n.imports){e.add(t)}}if(n.reexports){for(const{imported:t}of n.reexports){e.add(t)}}i[t(s)]=[...e]}return i}const Ea=/[#?]/;const resolveFileName=e=>e.getFileName();function*concatLazy(e){for(const t of e){yield*t}}function getChunkAssignments(e,t,i,s){const{chunkDefinitions:n,modulesInManualChunks:r}=getChunkDefinitionsFromManualChunks(t);const{allEntries:o,dependentEntriesByModule:l,dynamicallyDependentEntriesByDynamicEntry:c,dynamicImportsByEntry:u}=analyzeModuleGraph(e);const h=getChunksFromDependentEntries(getModulesWithDependentEntries(l,r));removeUnnecessaryDependentEntries(h,c,u,o);n.push(...getOptimizedChunks(getChunksFromDependentEntries(h),o.length,i,s).map((({modules:e})=>({alias:null,modules:e}))));return n}function getChunkDefinitionsFromManualChunks(e){const t=[];const i=new Set(e.keys());const s=Object.create(null);for(const[t,n]of e){addStaticDependenciesToManualChunk(t,s[n]||(s[n]=[]),i)}for(const[e,i]of Object.entries(s)){t.push({alias:e,modules:i})}return{chunkDefinitions:t,modulesInManualChunks:i}}function addStaticDependenciesToManualChunk(e,t,i){const s=new Set([e]);for(const e of s){i.add(e);t.push(e);for(const t of e.dependencies){if(!(t instanceof ExternalModule||i.has(t))){s.add(t)}}}}function analyzeModuleGraph(e){const t=new Set;const i=new Map;const s=[];const n=new Set(e);let r=0;for(const e of n){const o=new Set;s.push(o);const l=new Set([e]);for(const e of l){getOrCreate(i,e,getNewSet).add(r);for(const t of e.getDependenciesToBeIncluded()){if(!(t instanceof ExternalModule)){l.add(t)}}for(const{resolution:i}of e.dynamicImports){if(i instanceof Module&&i.includedDynamicImporters.length>0&&!n.has(i)){t.add(i);n.add(i);o.add(i)}}for(const i of e.implicitlyLoadedBefore){if(!n.has(i)){t.add(i);n.add(i)}}}r++}const o=[...n];const{dynamicEntries:l,dynamicImportsByEntry:c}=getDynamicEntries(o,t,s);return{allEntries:o,dependentEntriesByModule:i,dynamicallyDependentEntriesByDynamicEntry:getDynamicallyDependentEntriesByDynamicEntry(i,l,o),dynamicImportsByEntry:c}}function getDynamicEntries(e,t,i){const s=new Map;const n=new Set;for(const[i,r]of e.entries()){s.set(r,i);if(t.has(r)){n.add(i)}}const r=[];for(const e of i){const t=new Set;for(const i of e){t.add(s.get(i))}r.push(t)}return{dynamicEntries:n,dynamicImportsByEntry:r}}function getDynamicallyDependentEntriesByDynamicEntry(e,t,i){const s=new Map;for(const n of t){const t=getOrCreate(s,n,getNewSet);const r=i[n];for(const i of concatLazy([r.includedDynamicImporters,r.implicitlyLoadedAfter])){for(const s of e.get(i)){t.add(s)}}}return s}function getChunksFromDependentEntries(e){var t;const i=Object.create(null);for(const{dependentEntries:s,modules:n}of e){let e=0n;for(const t of s){e|=1n<<BigInt(t)}(i[t=String(e)]||(i[t]={dependentEntries:new Set(s),modules:[]})).modules.push(...n)}return Object.values(i)}function*getModulesWithDependentEntries(e,t){for(const[i,s]of e){if(!t.has(i)){yield{dependentEntries:s,modules:[i]}}}}function removeUnnecessaryDependentEntries(e,t,i,s){const n=s.map((()=>0n));const r=s.map(((e,i)=>t.has(i)?-1n:0n));let o=1n;for(const{dependentEntries:t}of e){for(const e of t){n[e]|=o}o<<=1n}const l=t;for(const[e,t]of l){l.delete(e);const s=r[e];let o=s;for(const e of t){o&=n[e]|r[e]}if(o!==s){r[e]=o;for(const t of i[e]){getOrCreate(l,t,getNewSet).add(e)}}}o=1n;for(const{dependentEntries:t}of e){for(const e of t){if((r[e]&o)===o){t.delete(e)}}o<<=1n}}function getOptimizedChunks(e,t,i,s){aa("optimize chunks",3);const n=getPartitionedChunks(e,t,i);if(!n){la("optimize chunks",3);return e}i>1&&s("info",logOptimizeChunkStatus(e.length,n.small.size,"Initially"));mergeChunks(n,i);i>1&&s("info",logOptimizeChunkStatus(n.small.size+n.big.size,n.small.size,"After merging chunks"));la("optimize chunks",3);return[...n.small,...n.big]}function getPartitionedChunks(e,t,i){const s=[];const n=[];const r=new Map;const o=[];let l=0n;let c=1n;for(const{dependentEntries:t,modules:u}of e){const e={containedAtoms:c,correlatedAtoms:0n,dependencies:new Set,dependentChunks:new Set,dependentEntries:t,modules:u,pure:true,size:0};let h=0;let d=true;for(const t of u){r.set(t,e);if(t.isIncluded()){d&&(d=!t.hasEffects());h+=i>1?t.estimateSize():1}}e.pure=d;e.size=h;o.push(h);if(!d){l|=c}(h<i?s:n).push(e);c<<=1n}if(s.length===0){return null}l|=addChunkDependenciesAndAtomsAndGetSideEffectAtoms([n,s],r,t,c);return{big:new Set(n),sideEffectAtoms:l,sizeByAtom:o,small:new Set(s)}}function mergeChunks(e,t){const{small:i}=e;for(const s of i){const n=findBestMergeTarget(s,e,t<=1?1:Infinity);if(n){const{containedAtoms:r,correlatedAtoms:o,modules:l,pure:c,size:u}=s;i.delete(s);getChunksInPartition(n,t,e).delete(n);n.modules.push(...l);n.size+=u;n.pure&&(n.pure=c);const{dependencies:h,dependentChunks:d,dependentEntries:p}=n;n.correlatedAtoms&=o;n.containedAtoms|=r;for(const e of s.dependentEntries){p.add(e)}for(const e of s.dependencies){h.add(e);e.dependentChunks.delete(s);e.dependentChunks.add(n)}for(const e of s.dependentChunks){d.add(e);e.dependencies.delete(s);e.dependencies.add(n)}h.delete(n);d.delete(n);getChunksInPartition(n,t,e).add(n)}}}function addChunkDependenciesAndAtomsAndGetSideEffectAtoms(e,t,i,s){const n=new Map;let r=0n;const o=[];for(let e=0;e<i;e++){o.push(0n)}for(const i of e){i.sort(compareChunkSize);for(const e of i){const{dependencies:i,dependentEntries:l,modules:c}=e;for(const o of c){for(const l of o.getDependenciesToBeIncluded()){if(l instanceof ExternalModule){if(l.info.moduleSideEffects){e.containedAtoms|=getOrCreate(n,l,(()=>{const e=s;s<<=1n;r|=e;return e}))}}else{const s=t.get(l);if(s&&s!==e){i.add(s);s.dependentChunks.add(e)}}}}const{containedAtoms:u}=e;for(const e of l){o[e]|=u}}}for(const t of e){for(const e of t){const{dependentEntries:t}=e;e.correlatedAtoms=-1n;for(const i of t){e.correlatedAtoms&=o[i]}}}return r}function findBestMergeTarget(e,{big:t,sideEffectAtoms:i,sizeByAtom:s,small:n},r){let o=null;for(const l of concatLazy([n,t])){if(e===l)continue;const t=getAdditionalSizeAfterMerge(e,l,r,i,s);if(t<r){o=l;if(t===0)break;r=t}}return o}function getChunksInPartition(e,t,i){return e.size<t?i.small:i.big}function compareChunkSize({size:e},{size:t}){return e-t}function getAdditionalSizeAfterMerge(e,t,i,s,n){const r=getAdditionalSizeIfNoTransitiveDependencyOrNonCorrelatedSideEffect(e,t,i,s,n);return r<i?r+getAdditionalSizeIfNoTransitiveDependencyOrNonCorrelatedSideEffect(t,e,i-r,s,n):Infinity}function getAdditionalSizeIfNoTransitiveDependencyOrNonCorrelatedSideEffect(e,t,i,s,n){const{correlatedAtoms:r}=t;let o=e.containedAtoms;const l=o&s;if((r&l)!==l){return Infinity}const c=new Set(e.dependencies);for(const{dependencies:e,containedAtoms:i}of c){o|=i;const n=i&s;if((r&n)!==n){return Infinity}for(const i of e){if(i===t){return Infinity}c.add(i)}}return getAtomsSizeIfBelowLimit(o&~r,i,n)}function getAtomsSizeIfBelowLimit(e,t,i){let s=0;let n=0;let r=1n;const{length:o}=i;for(;n<o;n++){if((e&r)===r){s+=i[n]}r<<=1n;if(s>=t){return Infinity}}return s}function commondir(e){if(e.length===0)return"/";if(e.length===1)return r.dirname(e[0]);const t=e.slice(1).reduce(((e,t)=>{const i=t.split(/\/+|\\+/);let s;for(s=0;e[s]===i[s]&&s<Math.min(e.length,i.length);s++);return e.slice(0,s)}),e[0].split(/\/+|\\+/));return t.length>1?t.join("/"):"/"}const compareExecIndex=(e,t)=>e.execIndex>t.execIndex?1:-1;function sortByExecutionOrder(e){e.sort(compareExecIndex)}function analyseModuleExecution(e){let t=0;const i=[];const s=new Set;const n=new Set;const r=new Map;const o=[];const analyseModule=e=>{if(e instanceof Module){for(const t of e.dependencies){if(r.has(t)){if(!s.has(t)){i.push(getCyclePath(t,e,r))}continue}r.set(t,e);analyseModule(t)}for(const t of e.implicitlyLoadedBefore){n.add(t)}for(const{resolution:t}of e.dynamicImports){if(t instanceof Module){n.add(t)}}o.push(e)}e.execIndex=t++;s.add(e)};for(const t of e){if(!r.has(t)){r.set(t,null);analyseModule(t)}}for(const e of n){if(!r.has(e)){r.set(e,null);analyseModule(e)}}return{cyclePaths:i,orderedModules:o}}function getCyclePath(e,t,i){const s=Symbol(e.id);const n=[e.id];let r=t;e.cycles.add(s);while(r!==e){r.cycles.add(s);n.push(r.id);r=i.get(r)}n.push(n[0]);n.reverse();return n}function getGenerateCodeSnippets({compact:e,generatedCode:{arrowFunctions:t,constBindings:i,objectShorthand:s,reservedNamesAsProps:n}}){const{_:r,n:o,s:l}=e?{_:"",n:"",s:""}:{_:" ",n:"\n",s:";"};const c=i?"const":"var";const getNonArrowFunctionIntro=(e,{isAsync:t,name:i})=>`${t?`async `:""}function${i?` ${i}`:""}${r}(${e.join(`,${r}`)})${r}`;const u=t?(e,{isAsync:t,name:i})=>{const s=e.length===1;const n=t?`async${s?" ":r}`:"";return`${i?`${c} ${i}${r}=${r}`:""}${n}${s?e[0]:`(${e.join(`,${r}`)})`}${r}=>${r}`}:getNonArrowFunctionIntro;const getDirectReturnFunction=(e,{functionReturn:i,lineBreakIndent:s,name:n})=>[`${u(e,{isAsync:false,name:n})}${t?s?`${o}${s.base}${s.t}`:"":`{${s?`${o}${s.base}${s.t}`:r}${i?"return ":""}`}`,t?`${n?";":""}${s?`${o}${s.base}`:""}`:`${l}${s?`${o}${s.base}`:r}}`];const h=n?e=>xa.test(e):e=>!Fs.has(e)&&xa.test(e);return{_:r,cnst:c,getDirectReturnFunction:getDirectReturnFunction,getDirectReturnIifeLeft:(e,i,{needsArrowReturnParens:s,needsWrappedFunction:n})=>{const[r,o]=getDirectReturnFunction(e,{functionReturn:true,lineBreakIndent:null,name:null});return`${wrapIfNeeded(`${r}${wrapIfNeeded(i,t&&s)}${o}`,t||n)}(`},getFunctionIntro:u,getNonArrowFunctionIntro:getNonArrowFunctionIntro,getObject(e,{lineBreakIndent:t}){const i=t?`${o}${t.base}${t.t}`:r;return`{${e.map((([e,t])=>{if(e===null)return`${i}${t}`;const n=!h(e);return e===t&&s&&!n?i+e:`${i}${n?`'${e}'`:e}:${r}${t}`})).join(`,`)}${e.length===0?"":t?`${o}${t.base}`:r}}`},getPropertyAccess:e=>h(e)?`.${e}`:`[${JSON.stringify(e)}]`,n:o,s:l}}const wrapIfNeeded=(e,t)=>t?`(${e})`:e;const xa=/^(?!\d)[\w$]+$/;class Source{constructor(e,t){this.isOriginal=true;this.filename=e;this.content=t}traceSegment(e,t,i){return{column:t,line:e,name:i,source:this}}}class Link{constructor(e,t){this.sources=t;this.names=e.names;this.mappings=e.mappings}traceMappings(){const e=[];const t=new Map;const i=[];const s=[];const n=new Map;const r=[];for(const o of this.mappings){const l=[];for(const r of o){if(r.length===1)continue;const o=this.sources[r[1]];if(!o)continue;const c=o.traceSegment(r[2],r[3],r.length===5?this.names[r[4]]:"");if(c){const{column:o,line:u,name:h,source:{content:d,filename:p}}=c;let f=t.get(p);if(f===undefined){f=e.length;e.push(p);t.set(p,f);i[f]=d}else if(i[f]==null){i[f]=d}else if(d!=null&&i[f]!==d){return error(logConflictingSourcemapSources(p))}const m=[r[0],f,u,o];if(h){let e=n.get(h);if(e===undefined){e=s.length;s.push(h);n.set(h,e)}m[4]=e}l.push(m)}}r.push(l)}return{mappings:r,names:s,sources:e,sourcesContent:i}}traceSegment(e,t,i){const s=this.mappings[e];if(!s)return null;let n=0;let r=s.length-1;while(n<=r){const e=n+r>>1;const o=s[e];if(o[0]===t||n===r){if(o.length==1)return null;const e=this.sources[o[1]];if(!e)return null;return e.traceSegment(o[2],o[3],o.length===5?this.names[o[4]]:i)}if(o[0]>t){r=e-1}else{n=e+1}}return null}}function getLinkMap(e){return function linkMap(t,i){if(!i.missing){return new Link(i,[t])}e(v,logSourcemapBroken(i.plugin));return new Link({mappings:[],names:[]},[t])}}function getCollapsedSourcemap(e,t,i,s,n){let o;if(i){const t=i.sources;const s=i.sourcesContent||[];const n=r.dirname(e)||".";const l=i.sourceRoot||".";const c=t.map(((e,t)=>new Source(r.resolve(n,l,e),s[t])));o=new Link(i,c)}else{o=new Source(e,t)}return s.reduce(n,o)}function collapseSourcemaps(e,t,i,s,n,o){const l=getLinkMap(o);const c=i.filter((e=>!e.excludeFromSourcemap)).map((e=>getCollapsedSourcemap(e.id,e.originalCode,e.originalSourcemap,e.sourcemapChain,l)));const u=new Link(t,c);const h=s.reduce(l,u);let{sources:d,sourcesContent:p,names:f,mappings:m}=h.traceMappings();if(e){const t=r.dirname(e);d=d.map((e=>r.relative(t,e)));e=r.basename(e)}p=n?null:p;for(const e of i){resetSourcemapCache(e.originalSourcemap,e.sourcemapChain)}return new SourceMap({file:e,mappings:m,names:f,sources:d,sourcesContent:p})}function collapseSourcemap(e,t,i,s,n){if(s.length===0){return i}const r=getCollapsedSourcemap(e,t,i,s,getLinkMap(n));const o=r.traceMappings();return decodedSourcemap({version:3,...o})}async function renderChunks(e,t,i,s,n){aa("render chunks",2);reserveEntryChunksInBundle(e);const r=await Promise.all(e.map((e=>e.render())));la("render chunks",2);aa("transform chunks",2);const o=getChunkGraph(e);const{initialHashesByPlaceholder:l,nonHashedChunksWithPlaceholders:c,renderedChunksByPlaceholder:u,hashDependenciesByPlaceholder:h}=await transformChunksAndGenerateContentHashes(r,o,s,i,n);const d=generateFinalHashes(u,h,l,t);addChunksToBundle(u,d,t,c,i,s);la("transform chunks",2)}function reserveEntryChunksInBundle(e){for(const t of e){if(t.facadeModule&&t.facadeModule.isUserDefinedEntryPoint){t.getPreliminaryFileName()}}}function getChunkGraph(e){return Object.fromEntries(e.map((e=>{const t=e.getRenderedChunkInfo();return[t.fileName,t]})))}async function transformChunk(e,t,i,s,n,o,l){let c=null;const u=[];let h=await o.hookReduceArg0("renderChunk",[e.toString(),s[t],n,{chunks:s}],((e,t,i)=>{if(t==null)return e;if(typeof t==="string")t={code:t,map:undefined};if(t.map!==null){const e=decodedSourcemap(t.map);u.push(e||{missing:true,plugin:i.name})}return t.code}));const{compact:d,dir:p,file:f,sourcemap:m,sourcemapExcludeSources:g,sourcemapFile:y,sourcemapPathTransform:E,sourcemapIgnoreList:x}=n;if(!d&&h[h.length-1]!=="\n")h+="\n";if(m){aa("sourcemaps",3);let s;if(f)s=r.resolve(y||f);else if(p)s=r.resolve(p,t);else s=r.resolve(t);const n=e.generateDecodedMap({});c=collapseSourcemaps(s,n,i,u,g,l);for(let e=0;e<c.sources.length;++e){let t=c.sources[e];const i=`${s}.map`;const n=x(t,i);if(typeof n!=="boolean"){error(logFailedValidation("sourcemapIgnoreList function must return a boolean."))}if(n){if(c.x_google_ignoreList===undefined){c.x_google_ignoreList=[]}if(!c.x_google_ignoreList.includes(e)){c.x_google_ignoreList.push(e)}}if(E){t=E(t,i);if(typeof t!=="string"){error(logFailedValidation(`sourcemapPathTransform function must return a string.`))}}c.sources[e]=normalize(t)}la("sourcemaps",3)}return{code:h,map:c}}async function transformChunksAndGenerateContentHashes(e,t,i,s,n){const r=[];const o=new Map;const l=new Map;const c=new Map;const u=new Set;for(const{preliminaryFileName:{hashPlaceholder:t}}of e){if(t)u.add(t)}await Promise.all(e.map((async({chunk:e,preliminaryFileName:{fileName:h,hashPlaceholder:d},preliminarySourcemapFileName:p,magicString:f,usedModules:m})=>{const g={chunk:e,fileName:h,sourcemapFileName:p?.fileName??null,...await transformChunk(f,h,m,t,i,s,n)};const{code:y,map:E}=g;if(d){const{containedPlaceholders:t,transformedCode:i}=replacePlaceholdersWithDefaultAndGetContainedPlaceholders(y,u);const n=createHash().update(i);const r=s.hookReduceValueSync("augmentChunkHash","",[e.getRenderedChunkInfo()],((e,t)=>{if(t){e+=t}return e}));if(r){n.update(r)}o.set(d,g);l.set(d,{containedPlaceholders:t,contentHash:n.digest("hex")})}else{r.push(g)}const x=p?.hashPlaceholder;if(E&&x){c.set(p.hashPlaceholder,createHash().update(E.toString()).digest("hex").slice(0,p.hashPlaceholder.length))}})));return{hashDependenciesByPlaceholder:l,initialHashesByPlaceholder:c,nonHashedChunksWithPlaceholders:r,renderedChunksByPlaceholder:o}}function generateFinalHashes(e,t,i,s){const n=new Map(i);for(const[i,{fileName:r}]of e){let e=createHash();const o=new Set([i]);for(const i of o){const{containedPlaceholders:s,contentHash:n}=t.get(i);e.update(n);for(const e of s){o.add(e)}}let l;let c;do{if(c){e=createHash().update(c)}c=e.digest("hex").slice(0,i.length);l=replaceSinglePlaceholder(r,i,c)}while(s[$t].has(l.toLowerCase()));s[l]=Ot;n.set(i,c)}return n}function addChunksToBundle(e,t,i,s,n,r){for(const{chunk:s,code:o,fileName:l,sourcemapFileName:c,map:u}of e.values()){let e=replacePlaceholders(o,t);const h=replacePlaceholders(l,t);let d=null;if(u){d=c?replacePlaceholders(c,t):`${h}.map`;u.file=replacePlaceholders(u.file,t);e+=emitSourceMapAndGetComment(d,u,n,r)}i[h]=s.finalizeChunk(e,u,d,t)}for(const{chunk:e,code:o,fileName:l,sourcemapFileName:c,map:u}of s){let s=t.size>0?replacePlaceholders(o,t):o;let h=null;if(u){h=c?replacePlaceholders(c,t):`${l}.map`;s+=emitSourceMapAndGetComment(h,u,n,r)}i[l]=e.finalizeChunk(s,u,h,t)}}function emitSourceMapAndGetComment(e,t,i,{sourcemap:s,sourcemapBaseUrl:n}){let o;if(s==="inline"){o=t.toUrl()}else{const s=r.basename(e);o=n?new URL(s,n).toString():s;i.emitFile({fileName:e,source:t.toString(),type:"asset"})}return s==="hidden"?"":`//# ${Rr}=${o}\n`}class Bundle{constructor(e,t,i,s,n){this.outputOptions=e;this.unsetOptions=t;this.inputOptions=i;this.pluginDriver=s;this.graph=n;this.facadeChunkByModule=new Map;this.includedNamespaces=new Set}async generate(e){aa("GENERATE",1);const t=Object.create(null);const i=getOutputBundle(t);this.pluginDriver.setOutputBundle(i,this.outputOptions);try{aa("initialize render",2);await this.pluginDriver.hookParallel("renderStart",[this.outputOptions,this.inputOptions]);la("initialize render",2);aa("generate chunks",2);const e=getHashPlaceholderGenerator();const t=await this.generateChunks(i,e);if(t.length>1){validateOptionsForMultiChunkOutput(this.outputOptions,this.inputOptions.onLog)}this.pluginDriver.setChunkInformation(this.facadeChunkByModule);for(const e of t){e.generateExports()}la("generate chunks",2);await renderChunks(t,i,this.pluginDriver,this.outputOptions,this.inputOptions.onLog)}catch(e){await this.pluginDriver.hookParallel("renderError",[e]);throw e}removeUnreferencedAssets(i);aa("generate bundle",2);await this.pluginDriver.hookSeq("generateBundle",[this.outputOptions,i,e]);this.finaliseAssets(i);la("generate bundle",2);la("GENERATE",1);return t}async addManualChunks(e){const t=new Map;const i=await Promise.all(Object.entries(e).map((async([e,t])=>({alias:e,entries:await this.graph.moduleLoader.addAdditionalModules(t,true)}))));for(const{alias:e,entries:s}of i){for(const i of s){addModuleToManualChunk(e,i,t)}}return t}assignManualChunks(e){const t=[];const i={getModuleIds:()=>this.graph.modulesById.keys(),getModuleInfo:this.graph.getModuleInfo};for(const s of this.graph.modulesById.values()){if(s instanceof Module){const n=e(s.id,i);if(typeof n==="string"){t.push([n,s])}}}t.sort((([e],[t])=>e>t?1:e<t?-1:0));const s=new Map;for(const[e,i]of t){addModuleToManualChunk(e,i,s)}return s}finaliseAssets(e){if(this.outputOptions.validate){for(const t of Object.values(e)){if("code"in t){try{this.graph.contextParse(t.code,{ecmaVersion:"latest"})}catch(e){this.inputOptions.onLog(v,logChunkInvalid(t,e))}}}}this.pluginDriver.finaliseAssets()}async generateChunks(e,t){const{experimentalMinChunkSize:i,inlineDynamicImports:s,manualChunks:n,preserveModules:r}=this.outputOptions;const o=typeof n==="object"?await this.addManualChunks(n):this.assignManualChunks(n);const l=getGenerateCodeSnippets(this.outputOptions);const c=getIncludedModules(this.graph.modulesById);const u=commondir(getAbsoluteEntryModulePaths(c,r));const h=getExternalChunkByModule(this.graph.modulesById,this.outputOptions,u);const d=[];const p=new Map;for(const{alias:n,modules:f}of s?[{alias:null,modules:c}]:r?c.map((e=>({alias:null,modules:[e]}))):getChunkAssignments(this.graph.entryModules,o,i,this.inputOptions.onLog)){sortByExecutionOrder(f);const i=new Chunk(f,this.inputOptions,this.outputOptions,this.unsetOptions,this.pluginDriver,this.graph.modulesById,p,h,this.facadeChunkByModule,this.includedNamespaces,n,t,e,u,l);d.push(i)}for(const e of d){e.link()}const f=[];for(const e of d){f.push(...e.generateFacades())}return[...d,...f]}}function validateOptionsForMultiChunkOutput(e,t){if(e.format==="umd"||e.format==="iife")return error(logInvalidOption("output.format",j,"UMD and IIFE output formats are not supported for code-splitting builds",e.format));if(typeof e.file==="string")return error(logInvalidOption("output.file",B,'when building multiple chunks, the "output.dir" option must be used, not "output.file". To inline dynamic imports, set the "inlineDynamicImports" option'));if(e.sourcemapFile)return error(logInvalidOption("output.sourcemapFile",ee,'"output.sourcemapFile" is only supported for single-file builds'));if(!e.amd.autoId&&e.amd.id)t(v,logInvalidOption("output.amd.id",M,'this option is only properly supported for single-file builds. Use "output.amd.autoId" and "output.amd.basePath" instead'))}function getIncludedModules(e){const t=[];for(const i of e.values()){if(i instanceof Module&&(i.isIncluded()||i.info.isEntry||i.includedDynamicImporters.length>0)){t.push(i)}}return t}function getAbsoluteEntryModulePaths(e,t){const i=[];for(const s of e){if((s.info.isEntry||t)&&isAbsolute(s.id)){i.push(s.id)}}return i}function getExternalChunkByModule(e,t,i){const s=new Map;for(const n of e.values()){if(n instanceof ExternalModule){s.set(n,new ExternalChunk(n,t,i))}}return s}function addModuleToManualChunk(e,t,i){const s=i.get(t);if(typeof s==="string"&&s!==e){return error(logCannotAssignModuleToChunk(t.id,e,s))}i.set(t,e)}var ba=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239];var va=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,3104,541,1507,4938,6,4191];var Sa="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࢘-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_";var Aa="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟊꟐꟑꟓꟕ-ꟙꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ";var wa={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"};var Ia="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this";var Ca={5:Ia,"5module":Ia+" export import",6:Ia+" const class extends export import super"};var ka=/^in(stanceof)?$/;var _a=new RegExp("["+Aa+"]");var Pa=new RegExp("["+Aa+Sa+"]");function isInAstralSet(e,t){var i=65536;for(var s=0;s<t.length;s+=2){i+=t[s];if(i>e){return false}i+=t[s+1];if(i>=e){return true}}return false}function isIdentifierStart(e,t){if(e<65){return e===36}if(e<91){return true}if(e<97){return e===95}if(e<123){return true}if(e<=65535){return e>=170&&_a.test(String.fromCharCode(e))}if(t===false){return false}return isInAstralSet(e,va)}function isIdentifierChar(e,t){if(e<48){return e===36}if(e<58){return true}if(e<65){return false}if(e<91){return true}if(e<97){return e===95}if(e<123){return true}if(e<=65535){return e>=170&&Pa.test(String.fromCharCode(e))}if(t===false){return false}return isInAstralSet(e,va)||isInAstralSet(e,ba)}var Na=function TokenType(e,t){if(t===void 0)t={};this.label=e;this.keyword=t.keyword;this.beforeExpr=!!t.beforeExpr;this.startsExpr=!!t.startsExpr;this.isLoop=!!t.isLoop;this.isAssign=!!t.isAssign;this.prefix=!!t.prefix;this.postfix=!!t.postfix;this.binop=t.binop||null;this.updateContext=null};function binop(e,t){return new Na(e,{beforeExpr:true,binop:t})}var Ra={beforeExpr:true},$a={startsExpr:true};var Oa={};function kw(e,t){if(t===void 0)t={};t.keyword=e;return Oa[e]=new Na(e,t)}var Ta={num:new Na("num",$a),regexp:new Na("regexp",$a),string:new Na("string",$a),name:new Na("name",$a),privateId:new Na("privateId",$a),eof:new Na("eof"),bracketL:new Na("[",{beforeExpr:true,startsExpr:true}),bracketR:new Na("]"),braceL:new Na("{",{beforeExpr:true,startsExpr:true}),braceR:new Na("}"),parenL:new Na("(",{beforeExpr:true,startsExpr:true}),parenR:new Na(")"),comma:new Na(",",Ra),semi:new Na(";",Ra),colon:new Na(":",Ra),dot:new Na("."),question:new Na("?",Ra),questionDot:new Na("?."),arrow:new Na("=>",Ra),template:new Na("template"),invalidTemplate:new Na("invalidTemplate"),ellipsis:new Na("...",Ra),backQuote:new Na("`",$a),dollarBraceL:new Na("${",{beforeExpr:true,startsExpr:true}),eq:new Na("=",{beforeExpr:true,isAssign:true}),assign:new Na("_=",{beforeExpr:true,isAssign:true}),incDec:new Na("++/--",{prefix:true,postfix:true,startsExpr:true}),prefix:new Na("!/~",{beforeExpr:true,prefix:true,startsExpr:true}),logicalOR:binop("||",1),logicalAND:binop("&&",2),bitwiseOR:binop("|",3),bitwiseXOR:binop("^",4),bitwiseAND:binop("&",5),equality:binop("==/!=/===/!==",6),relational:binop("</>/<=/>=",7),bitShift:binop("<</>>/>>>",8),plusMin:new Na("+/-",{beforeExpr:true,binop:9,prefix:true,startsExpr:true}),modulo:binop("%",10),star:binop("*",10),slash:binop("/",10),starstar:new Na("**",{beforeExpr:true}),coalesce:binop("??",1),_break:kw("break"),_case:kw("case",Ra),_catch:kw("catch"),_continue:kw("continue"),_debugger:kw("debugger"),_default:kw("default",Ra),_do:kw("do",{isLoop:true,beforeExpr:true}),_else:kw("else",Ra),_finally:kw("finally"),_for:kw("for",{isLoop:true}),_function:kw("function",$a),_if:kw("if"),_return:kw("return",Ra),_switch:kw("switch"),_throw:kw("throw",Ra),_try:kw("try"),_var:kw("var"),_const:kw("const"),_while:kw("while",{isLoop:true}),_with:kw("with"),_new:kw("new",{beforeExpr:true,startsExpr:true}),_this:kw("this",$a),_super:kw("super",$a),_class:kw("class",$a),_extends:kw("extends",Ra),_export:kw("export"),_import:kw("import",$a),_null:kw("null",$a),_true:kw("true",$a),_false:kw("false",$a),_in:kw("in",{beforeExpr:true,binop:7}),_instanceof:kw("instanceof",{beforeExpr:true,binop:7}),_typeof:kw("typeof",{beforeExpr:true,prefix:true,startsExpr:true}),_void:kw("void",{beforeExpr:true,prefix:true,startsExpr:true}),_delete:kw("delete",{beforeExpr:true,prefix:true,startsExpr:true})};var Da=/\r\n?|\n|\u2028|\u2029/;var Ma=new RegExp(Da.source,"g");function isNewLine(e){return e===10||e===13||e===8232||e===8233}function nextLineBreak(e,t,i){if(i===void 0)i=e.length;for(var s=t;s<i;s++){var n=e.charCodeAt(s);if(isNewLine(n)){return s<i-1&&n===13&&e.charCodeAt(s+1)===10?s+2:s+1}}return-1}var La=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/;var Ba=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;var Fa=Object.prototype;var Va=Fa.hasOwnProperty;var za=Fa.toString;var ja=Object.hasOwn||function(e,t){return Va.call(e,t)};var Ua=Array.isArray||function(e){return za.call(e)==="[object Array]"};function wordsRegexp(e){return new RegExp("^(?:"+e.replace(/ /g,"|")+")$")}function codePointToString(e){if(e<=65535){return String.fromCharCode(e)}e-=65536;return String.fromCharCode((e>>10)+55296,(e&1023)+56320)}var Ha=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/;var Ga=function Position(e,t){this.line=e;this.column=t};Ga.prototype.offset=function offset(e){return new Ga(this.line,this.column+e)};var Wa=function SourceLocation(e,t,i){this.start=t;this.end=i;if(e.sourceFile!==null){this.source=e.sourceFile}};function getLineInfo(e,t){for(var i=1,s=0;;){var n=nextLineBreak(e,s,t);if(n<0){return new Ga(i,t-s)}++i;s=n}}var qa={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:false,allowImportExportEverywhere:false,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:false,checkPrivateFields:true,locations:false,onToken:null,onComment:null,ranges:false,program:null,sourceFile:null,directSourceFile:null,preserveParens:false};var Ka=false;function getOptions(e){var t={};for(var i in qa){t[i]=e&&ja(e,i)?e[i]:qa[i]}if(t.ecmaVersion==="latest"){t.ecmaVersion=1e8}else if(t.ecmaVersion==null){if(!Ka&&typeof console==="object"&&console.warn){Ka=true;console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.")}t.ecmaVersion=11}else if(t.ecmaVersion>=2015){t.ecmaVersion-=2009}if(t.allowReserved==null){t.allowReserved=t.ecmaVersion<5}if(!e||e.allowHashBang==null){t.allowHashBang=t.ecmaVersion>=14}if(Ua(t.onToken)){var s=t.onToken;t.onToken=function(e){return s.push(e)}}if(Ua(t.onComment)){t.onComment=pushComment(t,t.onComment)}return t}function pushComment(e,t){return function(i,s,n,r,o,l){var c={type:i?"Block":"Line",value:s,start:n,end:r};if(e.locations){c.loc=new Wa(this,o,l)}if(e.ranges){c.range=[n,r]}t.push(c)}}var Ya=1,Qa=2,Xa=4,Za=8,Ja=16,el=32,tl=64,il=128,sl=256,nl=Ya|Qa|sl;function functionFlags(e,t){return Qa|(e?Xa:0)|(t?Za:0)}var rl=0,ol=1,al=2,ll=3,cl=4,ul=5;var hl=function Parser(e,t,i){this.options=e=getOptions(e);this.sourceFile=e.sourceFile;this.keywords=wordsRegexp(Ca[e.ecmaVersion>=6?6:e.sourceType==="module"?"5module":5]);var s="";if(e.allowReserved!==true){s=wa[e.ecmaVersion>=6?6:e.ecmaVersion===5?5:3];if(e.sourceType==="module"){s+=" await"}}this.reservedWords=wordsRegexp(s);var n=(s?s+" ":"")+wa.strict;this.reservedWordsStrict=wordsRegexp(n);this.reservedWordsStrictBind=wordsRegexp(n+" "+wa.strictBind);this.input=String(t);this.containsEsc=false;if(i){this.pos=i;this.lineStart=this.input.lastIndexOf("\n",i-1)+1;this.curLine=this.input.slice(0,this.lineStart).split(Da).length}else{this.pos=this.lineStart=0;this.curLine=1}this.type=Ta.eof;this.value=null;this.start=this.end=this.pos;this.startLoc=this.endLoc=this.curPosition();this.lastTokEndLoc=this.lastTokStartLoc=null;this.lastTokStart=this.lastTokEnd=this.pos;this.context=this.initialContext();this.exprAllowed=true;this.inModule=e.sourceType==="module";this.strict=this.inModule||this.strictDirective(this.pos);this.potentialArrowAt=-1;this.potentialArrowInForAwait=false;this.yieldPos=this.awaitPos=this.awaitIdentPos=0;this.labels=[];this.undefinedExports=Object.create(null);if(this.pos===0&&e.allowHashBang&&this.input.slice(0,2)==="#!"){this.skipLineComment(2)}this.scopeStack=[];this.enterScope(Ya);this.regexpState=null;this.privateNameStack=[]};var dl={inFunction:{configurable:true},inGenerator:{configurable:true},inAsync:{configurable:true},canAwait:{configurable:true},allowSuper:{configurable:true},allowDirectSuper:{configurable:true},treatFunctionsAsVar:{configurable:true},allowNewDotTarget:{configurable:true},inClassStaticBlock:{configurable:true}};hl.prototype.parse=function parse(){var e=this.options.program||this.startNode();this.nextToken();return this.parseTopLevel(e)};dl.inFunction.get=function(){return(this.currentVarScope().flags&Qa)>0};dl.inGenerator.get=function(){return(this.currentVarScope().flags&Za)>0&&!this.currentVarScope().inClassFieldInit};dl.inAsync.get=function(){return(this.currentVarScope().flags&Xa)>0&&!this.currentVarScope().inClassFieldInit};dl.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e];if(t.inClassFieldInit||t.flags&sl){return false}if(t.flags&Qa){return(t.flags&Xa)>0}}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};dl.allowSuper.get=function(){var e=this.currentThisScope();var t=e.flags;var i=e.inClassFieldInit;return(t&tl)>0||i||this.options.allowSuperOutsideMethod};dl.allowDirectSuper.get=function(){return(this.currentThisScope().flags&il)>0};dl.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};dl.allowNewDotTarget.get=function(){var e=this.currentThisScope();var t=e.flags;var i=e.inClassFieldInit;return(t&(Qa|sl))>0||i};dl.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&sl)>0};hl.extend=function extend(){var e=[],t=arguments.length;while(t--)e[t]=arguments[t];var i=this;for(var s=0;s<e.length;s++){i=e[s](i)}return i};hl.parse=function parse(e,t){return new this(t,e).parse()};hl.parseExpressionAt=function parseExpressionAt(e,t,i){var s=new this(i,e,t);s.nextToken();return s.parseExpression()};hl.tokenizer=function tokenizer(e,t){return new this(t,e)};Object.defineProperties(hl.prototype,dl);var pl=hl.prototype;var fl=/^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;pl.strictDirective=function(e){if(this.options.ecmaVersion<5){return false}for(;;){Ba.lastIndex=e;e+=Ba.exec(this.input)[0].length;var t=fl.exec(this.input.slice(e));if(!t){return false}if((t[1]||t[2])==="use strict"){Ba.lastIndex=e+t[0].length;var i=Ba.exec(this.input),s=i.index+i[0].length;var n=this.input.charAt(s);return n===";"||n==="}"||Da.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(n)||n==="!"&&this.input.charAt(s+1)==="=")}e+=t[0].length;Ba.lastIndex=e;e+=Ba.exec(this.input)[0].length;if(this.input[e]===";"){e++}}};pl.eat=function(e){if(this.type===e){this.next();return true}else{return false}};pl.isContextual=function(e){return this.type===Ta.name&&this.value===e&&!this.containsEsc};pl.eatContextual=function(e){if(!this.isContextual(e)){return false}this.next();return true};pl.expectContextual=function(e){if(!this.eatContextual(e)){this.unexpected()}};pl.canInsertSemicolon=function(){return this.type===Ta.eof||this.type===Ta.braceR||Da.test(this.input.slice(this.lastTokEnd,this.start))};pl.insertSemicolon=function(){if(this.canInsertSemicolon()){if(this.options.onInsertedSemicolon){this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc)}return true}};pl.semicolon=function(){if(!this.eat(Ta.semi)&&!this.insertSemicolon()){this.unexpected()}};pl.afterTrailingComma=function(e,t){if(this.type===e){if(this.options.onTrailingComma){this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc)}if(!t){this.next()}return true}};pl.expect=function(e){this.eat(e)||this.unexpected()};pl.unexpected=function(e){this.raise(e!=null?e:this.start,"Unexpected token")};var ml=function DestructuringErrors(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};pl.checkPatternErrors=function(e,t){if(!e){return}if(e.trailingComma>-1){this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element")}var i=t?e.parenthesizedAssign:e.parenthesizedBind;if(i>-1){this.raiseRecoverable(i,t?"Assigning to rvalue":"Parenthesized pattern")}};pl.checkExpressionErrors=function(e,t){if(!e){return false}var i=e.shorthandAssign;var s=e.doubleProto;if(!t){return i>=0||s>=0}if(i>=0){this.raise(i,"Shorthand property assignments are valid only in destructuring patterns")}if(s>=0){this.raiseRecoverable(s,"Redefinition of __proto__ property")}};pl.checkYieldAwaitInDefaultParams=function(){if(this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)){this.raise(this.yieldPos,"Yield expression cannot be a default value")}if(this.awaitPos){this.raise(this.awaitPos,"Await expression cannot be a default value")}};pl.isSimpleAssignTarget=function(e){if(e.type==="ParenthesizedExpression"){return this.isSimpleAssignTarget(e.expression)}return e.type==="Identifier"||e.type==="MemberExpression"};var gl=hl.prototype;gl.parseTopLevel=function(e){var t=Object.create(null);if(!e.body){e.body=[]}while(this.type!==Ta.eof){var i=this.parseStatement(null,true,t);e.body.push(i)}if(this.inModule){for(var s=0,n=Object.keys(this.undefinedExports);s<n.length;s+=1){var r=n[s];this.raiseRecoverable(this.undefinedExports[r].start,"Export '"+r+"' is not defined")}}this.adaptDirectivePrologue(e.body);this.next();e.sourceType=this.options.sourceType;return this.finishNode(e,"Program")};var yl={kind:"loop"},El={kind:"switch"};gl.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let")){return false}Ba.lastIndex=this.pos;var t=Ba.exec(this.input);var i=this.pos+t[0].length,s=this.input.charCodeAt(i);if(s===91||s===92){return true}if(e){return false}if(s===123||s>55295&&s<56320){return true}if(isIdentifierStart(s,true)){var n=i+1;while(isIdentifierChar(s=this.input.charCodeAt(n),true)){++n}if(s===92||s>55295&&s<56320){return true}var r=this.input.slice(i,n);if(!ka.test(r)){return true}}return false};gl.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async")){return false}Ba.lastIndex=this.pos;var e=Ba.exec(this.input);var t=this.pos+e[0].length,i;return!Da.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(isIdentifierChar(i=this.input.charCodeAt(t+8))||i>55295&&i<56320))};gl.parseStatement=function(e,t,i){var s=this.type,n=this.startNode(),r;if(this.isLet(e)){s=Ta._var;r="let"}switch(s){case Ta._break:case Ta._continue:return this.parseBreakContinueStatement(n,s.keyword);case Ta._debugger:return this.parseDebuggerStatement(n);case Ta._do:return this.parseDoStatement(n);case Ta._for:return this.parseForStatement(n);case Ta._function:if(e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6){this.unexpected()}return this.parseFunctionStatement(n,false,!e);case Ta._class:if(e){this.unexpected()}return this.parseClass(n,true);case Ta._if:return this.parseIfStatement(n);case Ta._return:return this.parseReturnStatement(n);case Ta._switch:return this.parseSwitchStatement(n);case Ta._throw:return this.parseThrowStatement(n);case Ta._try:return this.parseTryStatement(n);case Ta._const:case Ta._var:r=r||this.value;if(e&&r!=="var"){this.unexpected()}return this.parseVarStatement(n,r);case Ta._while:return this.parseWhileStatement(n);case Ta._with:return this.parseWithStatement(n);case Ta.braceL:return this.parseBlock(true,n);case Ta.semi:return this.parseEmptyStatement(n);case Ta._export:case Ta._import:if(this.options.ecmaVersion>10&&s===Ta._import){Ba.lastIndex=this.pos;var o=Ba.exec(this.input);var l=this.pos+o[0].length,c=this.input.charCodeAt(l);if(c===40||c===46){return this.parseExpressionStatement(n,this.parseExpression())}}if(!this.options.allowImportExportEverywhere){if(!t){this.raise(this.start,"'import' and 'export' may only appear at the top level")}if(!this.inModule){this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")}}return s===Ta._import?this.parseImport(n):this.parseExport(n,i);default:if(this.isAsyncFunction()){if(e){this.unexpected()}this.next();return this.parseFunctionStatement(n,true,!e)}var u=this.value,h=this.parseExpression();if(s===Ta.name&&h.type==="Identifier"&&this.eat(Ta.colon)){return this.parseLabeledStatement(n,u,h,e)}else{return this.parseExpressionStatement(n,h)}}};gl.parseBreakContinueStatement=function(e,t){var i=t==="break";this.next();if(this.eat(Ta.semi)||this.insertSemicolon()){e.label=null}else if(this.type!==Ta.name){this.unexpected()}else{e.label=this.parseIdent();this.semicolon()}var s=0;for(;s<this.labels.length;++s){var n=this.labels[s];if(e.label==null||n.name===e.label.name){if(n.kind!=null&&(i||n.kind==="loop")){break}if(e.label&&i){break}}}if(s===this.labels.length){this.raise(e.start,"Unsyntactic "+t)}return this.finishNode(e,i?"BreakStatement":"ContinueStatement")};gl.parseDebuggerStatement=function(e){this.next();this.semicolon();return this.finishNode(e,"DebuggerStatement")};gl.parseDoStatement=function(e){this.next();this.labels.push(yl);e.body=this.parseStatement("do");this.labels.pop();this.expect(Ta._while);e.test=this.parseParenExpression();if(this.options.ecmaVersion>=6){this.eat(Ta.semi)}else{this.semicolon()}return this.finishNode(e,"DoWhileStatement")};gl.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;this.labels.push(yl);this.enterScope(0);this.expect(Ta.parenL);if(this.type===Ta.semi){if(t>-1){this.unexpected(t)}return this.parseFor(e,null)}var i=this.isLet();if(this.type===Ta._var||this.type===Ta._const||i){var s=this.startNode(),n=i?"let":this.value;this.next();this.parseVar(s,true,n);this.finishNode(s,"VariableDeclaration");if((this.type===Ta._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&s.declarations.length===1){if(this.options.ecmaVersion>=9){if(this.type===Ta._in){if(t>-1){this.unexpected(t)}}else{e.await=t>-1}}return this.parseForIn(e,s)}if(t>-1){this.unexpected(t)}return this.parseFor(e,s)}var r=this.isContextual("let"),o=false;var l=new ml;var c=this.parseExpression(t>-1?"await":true,l);if(this.type===Ta._in||(o=this.options.ecmaVersion>=6&&this.isContextual("of"))){if(this.options.ecmaVersion>=9){if(this.type===Ta._in){if(t>-1){this.unexpected(t)}}else{e.await=t>-1}}if(r&&o){this.raise(c.start,"The left-hand side of a for-of loop may not start with 'let'.")}this.toAssignable(c,false,l);this.checkLValPattern(c);return this.parseForIn(e,c)}else{this.checkExpressionErrors(l,true)}if(t>-1){this.unexpected(t)}return this.parseFor(e,c)};gl.parseFunctionStatement=function(e,t,i){this.next();return this.parseFunction(e,bl|(i?0:vl),false,t)};gl.parseIfStatement=function(e){this.next();e.test=this.parseParenExpression();e.consequent=this.parseStatement("if");e.alternate=this.eat(Ta._else)?this.parseStatement("if"):null;return this.finishNode(e,"IfStatement")};gl.parseReturnStatement=function(e){if(!this.inFunction&&!this.options.allowReturnOutsideFunction){this.raise(this.start,"'return' outside of function")}this.next();if(this.eat(Ta.semi)||this.insertSemicolon()){e.argument=null}else{e.argument=this.parseExpression();this.semicolon()}return this.finishNode(e,"ReturnStatement")};gl.parseSwitchStatement=function(e){this.next();e.discriminant=this.parseParenExpression();e.cases=[];this.expect(Ta.braceL);this.labels.push(El);this.enterScope(0);var t;for(var i=false;this.type!==Ta.braceR;){if(this.type===Ta._case||this.type===Ta._default){var s=this.type===Ta._case;if(t){this.finishNode(t,"SwitchCase")}e.cases.push(t=this.startNode());t.consequent=[];this.next();if(s){t.test=this.parseExpression()}else{if(i){this.raiseRecoverable(this.lastTokStart,"Multiple default clauses")}i=true;t.test=null}this.expect(Ta.colon)}else{if(!t){this.unexpected()}t.consequent.push(this.parseStatement(null))}}this.exitScope();if(t){this.finishNode(t,"SwitchCase")}this.next();this.labels.pop();return this.finishNode(e,"SwitchStatement")};gl.parseThrowStatement=function(e){this.next();if(Da.test(this.input.slice(this.lastTokEnd,this.start))){this.raise(this.lastTokEnd,"Illegal newline after throw")}e.argument=this.parseExpression();this.semicolon();return this.finishNode(e,"ThrowStatement")};var xl=[];gl.parseCatchClauseParam=function(){var e=this.parseBindingAtom();var t=e.type==="Identifier";this.enterScope(t?el:0);this.checkLValPattern(e,t?cl:al);this.expect(Ta.parenR);return e};gl.parseTryStatement=function(e){this.next();e.block=this.parseBlock();e.handler=null;if(this.type===Ta._catch){var t=this.startNode();this.next();if(this.eat(Ta.parenL)){t.param=this.parseCatchClauseParam()}else{if(this.options.ecmaVersion<10){this.unexpected()}t.param=null;this.enterScope(0)}t.body=this.parseBlock(false);this.exitScope();e.handler=this.finishNode(t,"CatchClause")}e.finalizer=this.eat(Ta._finally)?this.parseBlock():null;if(!e.handler&&!e.finalizer){this.raise(e.start,"Missing catch or finally clause")}return this.finishNode(e,"TryStatement")};gl.parseVarStatement=function(e,t,i){this.next();this.parseVar(e,false,t,i);this.semicolon();return this.finishNode(e,"VariableDeclaration")};gl.parseWhileStatement=function(e){this.next();e.test=this.parseParenExpression();this.labels.push(yl);e.body=this.parseStatement("while");this.labels.pop();return this.finishNode(e,"WhileStatement")};gl.parseWithStatement=function(e){if(this.strict){this.raise(this.start,"'with' in strict mode")}this.next();e.object=this.parseParenExpression();e.body=this.parseStatement("with");return this.finishNode(e,"WithStatement")};gl.parseEmptyStatement=function(e){this.next();return this.finishNode(e,"EmptyStatement")};gl.parseLabeledStatement=function(e,t,i,s){for(var n=0,r=this.labels;n<r.length;n+=1){var o=r[n];if(o.name===t){this.raise(i.start,"Label '"+t+"' is already declared")}}var l=this.type.isLoop?"loop":this.type===Ta._switch?"switch":null;for(var c=this.labels.length-1;c>=0;c--){var u=this.labels[c];if(u.statementStart===e.start){u.statementStart=this.start;u.kind=l}else{break}}this.labels.push({name:t,kind:l,statementStart:this.start});e.body=this.parseStatement(s?s.indexOf("label")===-1?s+"label":s:"label");this.labels.pop();e.label=i;return this.finishNode(e,"LabeledStatement")};gl.parseExpressionStatement=function(e,t){e.expression=t;this.semicolon();return this.finishNode(e,"ExpressionStatement")};gl.parseBlock=function(e,t,i){if(e===void 0)e=true;if(t===void 0)t=this.startNode();t.body=[];this.expect(Ta.braceL);if(e){this.enterScope(0)}while(this.type!==Ta.braceR){var s=this.parseStatement(null);t.body.push(s)}if(i){this.strict=false}this.next();if(e){this.exitScope()}return this.finishNode(t,"BlockStatement")};gl.parseFor=function(e,t){e.init=t;this.expect(Ta.semi);e.test=this.type===Ta.semi?null:this.parseExpression();this.expect(Ta.semi);e.update=this.type===Ta.parenR?null:this.parseExpression();this.expect(Ta.parenR);e.body=this.parseStatement("for");this.exitScope();this.labels.pop();return this.finishNode(e,"ForStatement")};gl.parseForIn=function(e,t){var i=this.type===Ta._in;this.next();if(t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!i||this.options.ecmaVersion<8||this.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier")){this.raise(t.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer")}e.left=t;e.right=i?this.parseExpression():this.parseMaybeAssign();this.expect(Ta.parenR);e.body=this.parseStatement("for");this.exitScope();this.labels.pop();return this.finishNode(e,i?"ForInStatement":"ForOfStatement")};gl.parseVar=function(e,t,i,s){e.declarations=[];e.kind=i;for(;;){var n=this.startNode();this.parseVarId(n,i);if(this.eat(Ta.eq)){n.init=this.parseMaybeAssign(t)}else if(!s&&i==="const"&&!(this.type===Ta._in||this.options.ecmaVersion>=6&&this.isContextual("of"))){this.unexpected()}else if(!s&&n.id.type!=="Identifier"&&!(t&&(this.type===Ta._in||this.isContextual("of")))){this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value")}else{n.init=null}e.declarations.push(this.finishNode(n,"VariableDeclarator"));if(!this.eat(Ta.comma)){break}}return e};gl.parseVarId=function(e,t){e.id=this.parseBindingAtom();this.checkLValPattern(e.id,t==="var"?ol:al,false)};var bl=1,vl=2,Sl=4;gl.parseFunction=function(e,t,i,s,n){this.initFunction(e);if(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!s){if(this.type===Ta.star&&t&vl){this.unexpected()}e.generator=this.eat(Ta.star)}if(this.options.ecmaVersion>=8){e.async=!!s}if(t&bl){e.id=t&Sl&&this.type!==Ta.name?null:this.parseIdent();if(e.id&&!(t&vl)){this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?ol:al:ll)}}var r=this.yieldPos,o=this.awaitPos,l=this.awaitIdentPos;this.yieldPos=0;this.awaitPos=0;this.awaitIdentPos=0;this.enterScope(functionFlags(e.async,e.generator));if(!(t&bl)){e.id=this.type===Ta.name?this.parseIdent():null}this.parseFunctionParams(e);this.parseFunctionBody(e,i,false,n);this.yieldPos=r;this.awaitPos=o;this.awaitIdentPos=l;return this.finishNode(e,t&bl?"FunctionDeclaration":"FunctionExpression")};gl.parseFunctionParams=function(e){this.expect(Ta.parenL);e.params=this.parseBindingList(Ta.parenR,false,this.options.ecmaVersion>=8);this.checkYieldAwaitInDefaultParams()};gl.parseClass=function(e,t){this.next();var i=this.strict;this.strict=true;this.parseClassId(e,t);this.parseClassSuper(e);var s=this.enterClassBody();var n=this.startNode();var r=false;n.body=[];this.expect(Ta.braceL);while(this.type!==Ta.braceR){var o=this.parseClassElement(e.superClass!==null);if(o){n.body.push(o);if(o.type==="MethodDefinition"&&o.kind==="constructor"){if(r){this.raiseRecoverable(o.start,"Duplicate constructor in the same class")}r=true}else if(o.key&&o.key.type==="PrivateIdentifier"&&isPrivateNameConflicted(s,o)){this.raiseRecoverable(o.key.start,"Identifier '#"+o.key.name+"' has already been declared")}}}this.strict=i;this.next();e.body=this.finishNode(n,"ClassBody");this.exitClassBody();return this.finishNode(e,t?"ClassDeclaration":"ClassExpression")};gl.parseClassElement=function(e){if(this.eat(Ta.semi)){return null}var t=this.options.ecmaVersion;var i=this.startNode();var s="";var n=false;var r=false;var o="method";var l=false;if(this.eatContextual("static")){if(t>=13&&this.eat(Ta.braceL)){this.parseClassStaticBlock(i);return i}if(this.isClassElementNameStart()||this.type===Ta.star){l=true}else{s="static"}}i.static=l;if(!s&&t>=8&&this.eatContextual("async")){if((this.isClassElementNameStart()||this.type===Ta.star)&&!this.canInsertSemicolon()){r=true}else{s="async"}}if(!s&&(t>=9||!r)&&this.eat(Ta.star)){n=true}if(!s&&!r&&!n){var c=this.value;if(this.eatContextual("get")||this.eatContextual("set")){if(this.isClassElementNameStart()){o=c}else{s=c}}}if(s){i.computed=false;i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc);i.key.name=s;this.finishNode(i.key,"Identifier")}else{this.parseClassElementName(i)}if(t<13||this.type===Ta.parenL||o!=="method"||n||r){var u=!i.static&&checkKeyName(i,"constructor");var h=u&&e;if(u&&o!=="method"){this.raise(i.key.start,"Constructor can't have get/set modifier")}i.kind=u?"constructor":o;this.parseClassMethod(i,n,r,h)}else{this.parseClassField(i)}return i};gl.isClassElementNameStart=function(){return this.type===Ta.name||this.type===Ta.privateId||this.type===Ta.num||this.type===Ta.string||this.type===Ta.bracketL||this.type.keyword};gl.parseClassElementName=function(e){if(this.type===Ta.privateId){if(this.value==="constructor"){this.raise(this.start,"Classes can't have an element named '#constructor'")}e.computed=false;e.key=this.parsePrivateIdent()}else{this.parsePropertyName(e)}};gl.parseClassMethod=function(e,t,i,s){var n=e.key;if(e.kind==="constructor"){if(t){this.raise(n.start,"Constructor can't be a generator")}if(i){this.raise(n.start,"Constructor can't be an async method")}}else if(e.static&&checkKeyName(e,"prototype")){this.raise(n.start,"Classes may not have a static property named prototype")}var r=e.value=this.parseMethod(t,i,s);if(e.kind==="get"&&r.params.length!==0){this.raiseRecoverable(r.start,"getter should have no params")}if(e.kind==="set"&&r.params.length!==1){this.raiseRecoverable(r.start,"setter should have exactly one param")}if(e.kind==="set"&&r.params[0].type==="RestElement"){this.raiseRecoverable(r.params[0].start,"Setter cannot use rest params")}return this.finishNode(e,"MethodDefinition")};gl.parseClassField=function(e){if(checkKeyName(e,"constructor")){this.raise(e.key.start,"Classes can't have a field named 'constructor'")}else if(e.static&&checkKeyName(e,"prototype")){this.raise(e.key.start,"Classes can't have a static field named 'prototype'")}if(this.eat(Ta.eq)){var t=this.currentThisScope();var i=t.inClassFieldInit;t.inClassFieldInit=true;e.value=this.parseMaybeAssign();t.inClassFieldInit=i}else{e.value=null}this.semicolon();return this.finishNode(e,"PropertyDefinition")};gl.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;this.labels=[];this.enterScope(sl|tl);while(this.type!==Ta.braceR){var i=this.parseStatement(null);e.body.push(i)}this.next();this.exitScope();this.labels=t;return this.finishNode(e,"StaticBlock")};gl.parseClassId=function(e,t){if(this.type===Ta.name){e.id=this.parseIdent();if(t){this.checkLValSimple(e.id,al,false)}}else{if(t===true){this.unexpected()}e.id=null}};gl.parseClassSuper=function(e){e.superClass=this.eat(Ta._extends)?this.parseExprSubscripts(null,false):null};gl.enterClassBody=function(){var e={declared:Object.create(null),used:[]};this.privateNameStack.push(e);return e.declared};gl.exitClassBody=function(){var e=this.privateNameStack.pop();var t=e.declared;var i=e.used;if(!this.options.checkPrivateFields){return}var s=this.privateNameStack.length;var n=s===0?null:this.privateNameStack[s-1];for(var r=0;r<i.length;++r){var o=i[r];if(!ja(t,o.name)){if(n){n.used.push(o)}else{this.raiseRecoverable(o.start,"Private field '#"+o.name+"' must be declared in an enclosing class")}}}};function isPrivateNameConflicted(e,t){var i=t.key.name;var s=e[i];var n="true";if(t.type==="MethodDefinition"&&(t.kind==="get"||t.kind==="set")){n=(t.static?"s":"i")+t.kind}if(s==="iget"&&n==="iset"||s==="iset"&&n==="iget"||s==="sget"&&n==="sset"||s==="sset"&&n==="sget"){e[i]="true";return false}else if(!s){e[i]=n;return false}else{return true}}function checkKeyName(e,t){var i=e.computed;var s=e.key;return!i&&(s.type==="Identifier"&&s.name===t||s.type==="Literal"&&s.value===t)}gl.parseExportAllDeclaration=function(e,t){if(this.options.ecmaVersion>=11){if(this.eatContextual("as")){e.exported=this.parseModuleExportName();this.checkExport(t,e.exported,this.lastTokStart)}else{e.exported=null}}this.expectContextual("from");if(this.type!==Ta.string){this.unexpected()}e.source=this.parseExprAtom();this.semicolon();return this.finishNode(e,"ExportAllDeclaration")};gl.parseExport=function(e,t){this.next();if(this.eat(Ta.star)){return this.parseExportAllDeclaration(e,t)}if(this.eat(Ta._default)){this.checkExport(t,"default",this.lastTokStart);e.declaration=this.parseExportDefaultDeclaration();return this.finishNode(e,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement()){e.declaration=this.parseExportDeclaration(e);if(e.declaration.type==="VariableDeclaration"){this.checkVariableExport(t,e.declaration.declarations)}else{this.checkExport(t,e.declaration.id,e.declaration.id.start)}e.specifiers=[];e.source=null}else{e.declaration=null;e.specifiers=this.parseExportSpecifiers(t);if(this.eatContextual("from")){if(this.type!==Ta.string){this.unexpected()}e.source=this.parseExprAtom()}else{for(var i=0,s=e.specifiers;i<s.length;i+=1){var n=s[i];this.checkUnreserved(n.local);this.checkLocalExport(n.local);if(n.local.type==="Literal"){this.raise(n.local.start,"A string literal cannot be used as an exported binding without `from`.")}}e.source=null}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")};gl.parseExportDeclaration=function(e){return this.parseStatement(null)};gl.parseExportDefaultDeclaration=function(){var e;if(this.type===Ta._function||(e=this.isAsyncFunction())){var t=this.startNode();this.next();if(e){this.next()}return this.parseFunction(t,bl|Sl,false,e)}else if(this.type===Ta._class){var i=this.startNode();return this.parseClass(i,"nullableID")}else{var s=this.parseMaybeAssign();this.semicolon();return s}};gl.checkExport=function(e,t,i){if(!e){return}if(typeof t!=="string"){t=t.type==="Identifier"?t.name:t.value}if(ja(e,t)){this.raiseRecoverable(i,"Duplicate export '"+t+"'")}e[t]=true};gl.checkPatternExport=function(e,t){var i=t.type;if(i==="Identifier"){this.checkExport(e,t,t.start)}else if(i==="ObjectPattern"){for(var s=0,n=t.properties;s<n.length;s+=1){var r=n[s];this.checkPatternExport(e,r)}}else if(i==="ArrayPattern"){for(var o=0,l=t.elements;o<l.length;o+=1){var c=l[o];if(c){this.checkPatternExport(e,c)}}}else if(i==="Property"){this.checkPatternExport(e,t.value)}else if(i==="AssignmentPattern"){this.checkPatternExport(e,t.left)}else if(i==="RestElement"){this.checkPatternExport(e,t.argument)}else if(i==="ParenthesizedExpression"){this.checkPatternExport(e,t.expression)}};gl.checkVariableExport=function(e,t){if(!e){return}for(var i=0,s=t;i<s.length;i+=1){var n=s[i];this.checkPatternExport(e,n.id)}};gl.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};gl.parseExportSpecifier=function(e){var t=this.startNode();t.local=this.parseModuleExportName();t.exported=this.eatContextual("as")?this.parseModuleExportName():t.local;this.checkExport(e,t.exported,t.exported.start);return this.finishNode(t,"ExportSpecifier")};gl.parseExportSpecifiers=function(e){var t=[],i=true;this.expect(Ta.braceL);while(!this.eat(Ta.braceR)){if(!i){this.expect(Ta.comma);if(this.afterTrailingComma(Ta.braceR)){break}}else{i=false}t.push(this.parseExportSpecifier(e))}return t};gl.parseImport=function(e){this.next();if(this.type===Ta.string){e.specifiers=xl;e.source=this.parseExprAtom()}else{e.specifiers=this.parseImportSpecifiers();this.expectContextual("from");e.source=this.type===Ta.string?this.parseExprAtom():this.unexpected()}this.semicolon();return this.finishNode(e,"ImportDeclaration")};gl.parseImportSpecifier=function(){var e=this.startNode();e.imported=this.parseModuleExportName();if(this.eatContextual("as")){e.local=this.parseIdent()}else{this.checkUnreserved(e.imported);e.local=e.imported}this.checkLValSimple(e.local,al);return this.finishNode(e,"ImportSpecifier")};gl.parseImportDefaultSpecifier=function(){var e=this.startNode();e.local=this.parseIdent();this.checkLValSimple(e.local,al);return this.finishNode(e,"ImportDefaultSpecifier")};gl.parseImportNamespaceSpecifier=function(){var e=this.startNode();this.next();this.expectContextual("as");e.local=this.parseIdent();this.checkLValSimple(e.local,al);return this.finishNode(e,"ImportNamespaceSpecifier")};gl.parseImportSpecifiers=function(){var e=[],t=true;if(this.type===Ta.name){e.push(this.parseImportDefaultSpecifier());if(!this.eat(Ta.comma)){return e}}if(this.type===Ta.star){e.push(this.parseImportNamespaceSpecifier());return e}this.expect(Ta.braceL);while(!this.eat(Ta.braceR)){if(!t){this.expect(Ta.comma);if(this.afterTrailingComma(Ta.braceR)){break}}else{t=false}e.push(this.parseImportSpecifier())}return e};gl.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===Ta.string){var e=this.parseLiteral(this.value);if(Ha.test(e.value)){this.raise(e.start,"An export name cannot include a lone surrogate.")}return e}return this.parseIdent(true)};gl.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t){e[t].directive=e[t].expression.raw.slice(1,-1)}};gl.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value==="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var Al=hl.prototype;Al.toAssignable=function(e,t,i){if(this.options.ecmaVersion>=6&&e){switch(e.type){case"Identifier":if(this.inAsync&&e.name==="await"){this.raise(e.start,"Cannot use 'await' as identifier inside an async function")}break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern";if(i){this.checkPatternErrors(i,true)}for(var s=0,n=e.properties;s<n.length;s+=1){var r=n[s];this.toAssignable(r,t);if(r.type==="RestElement"&&(r.argument.type==="ArrayPattern"||r.argument.type==="ObjectPattern")){this.raise(r.argument.start,"Unexpected token")}}break;case"Property":if(e.kind!=="init"){this.raise(e.key.start,"Object pattern can't contain getter or setter")}this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern";if(i){this.checkPatternErrors(i,true)}this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement";this.toAssignable(e.argument,t);if(e.argument.type==="AssignmentPattern"){this.raise(e.argument.start,"Rest elements cannot have a default value")}break;case"AssignmentExpression":if(e.operator!=="="){this.raise(e.left.end,"Only '=' operator can be used for specifying default value.")}e.type="AssignmentPattern";delete e.operator;this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,i);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t){break}default:this.raise(e.start,"Assigning to rvalue")}}else if(i){this.checkPatternErrors(i,true)}return e};Al.toAssignableList=function(e,t){var i=e.length;for(var s=0;s<i;s++){var n=e[s];if(n){this.toAssignable(n,t)}}if(i){var r=e[i-1];if(this.options.ecmaVersion===6&&t&&r&&r.type==="RestElement"&&r.argument.type!=="Identifier"){this.unexpected(r.argument.start)}}return e};Al.parseSpread=function(e){var t=this.startNode();this.next();t.argument=this.parseMaybeAssign(false,e);return this.finishNode(t,"SpreadElement")};Al.parseRestBinding=function(){var e=this.startNode();this.next();if(this.options.ecmaVersion===6&&this.type!==Ta.name){this.unexpected()}e.argument=this.parseBindingAtom();return this.finishNode(e,"RestElement")};Al.parseBindingAtom=function(){if(this.options.ecmaVersion>=6){switch(this.type){case Ta.bracketL:var e=this.startNode();this.next();e.elements=this.parseBindingList(Ta.bracketR,true,true);return this.finishNode(e,"ArrayPattern");case Ta.braceL:return this.parseObj(true)}}return this.parseIdent()};Al.parseBindingList=function(e,t,i,s){var n=[],r=true;while(!this.eat(e)){if(r){r=false}else{this.expect(Ta.comma)}if(t&&this.type===Ta.comma){n.push(null)}else if(i&&this.afterTrailingComma(e)){break}else if(this.type===Ta.ellipsis){var o=this.parseRestBinding();this.parseBindingListItem(o);n.push(o);if(this.type===Ta.comma){this.raiseRecoverable(this.start,"Comma is not permitted after the rest element")}this.expect(e);break}else{n.push(this.parseAssignableListItem(s))}}return n};Al.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);this.parseBindingListItem(t);return t};Al.parseBindingListItem=function(e){return e};Al.parseMaybeDefault=function(e,t,i){i=i||this.parseBindingAtom();if(this.options.ecmaVersion<6||!this.eat(Ta.eq)){return i}var s=this.startNodeAt(e,t);s.left=i;s.right=this.parseMaybeAssign();return this.finishNode(s,"AssignmentPattern")};Al.checkLValSimple=function(e,t,i){if(t===void 0)t=rl;var s=t!==rl;switch(e.type){case"Identifier":if(this.strict&&this.reservedWordsStrictBind.test(e.name)){this.raiseRecoverable(e.start,(s?"Binding ":"Assigning to ")+e.name+" in strict mode")}if(s){if(t===al&&e.name==="let"){this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name")}if(i){if(ja(i,e.name)){this.raiseRecoverable(e.start,"Argument name clash")}i[e.name]=true}if(t!==ul){this.declareName(e.name,t,e.start)}}break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(s){this.raiseRecoverable(e.start,"Binding member expression")}break;case"ParenthesizedExpression":if(s){this.raiseRecoverable(e.start,"Binding parenthesized expression")}return this.checkLValSimple(e.expression,t,i);default:this.raise(e.start,(s?"Binding":"Assigning to")+" rvalue")}};Al.checkLValPattern=function(e,t,i){if(t===void 0)t=rl;switch(e.type){case"ObjectPattern":for(var s=0,n=e.properties;s<n.length;s+=1){var r=n[s];this.checkLValInnerPattern(r,t,i)}break;case"ArrayPattern":for(var o=0,l=e.elements;o<l.length;o+=1){var c=l[o];if(c){this.checkLValInnerPattern(c,t,i)}}break;default:this.checkLValSimple(e,t,i)}};Al.checkLValInnerPattern=function(e,t,i){if(t===void 0)t=rl;switch(e.type){case"Property":this.checkLValInnerPattern(e.value,t,i);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,i);break;case"RestElement":this.checkLValPattern(e.argument,t,i);break;default:this.checkLValPattern(e,t,i)}};var wl=function TokContext(e,t,i,s,n){this.token=e;this.isExpr=!!t;this.preserveSpace=!!i;this.override=s;this.generator=!!n};var Il={b_stat:new wl("{",false),b_expr:new wl("{",true),b_tmpl:new wl("${",false),p_stat:new wl("(",false),p_expr:new wl("(",true),q_tmpl:new wl("`",true,true,(function(e){return e.tryReadTemplateToken()})),f_stat:new wl("function",false),f_expr:new wl("function",true),f_expr_gen:new wl("function",true,false,null,true),f_gen:new wl("function",false,false,null,true)};var Cl=hl.prototype;Cl.initialContext=function(){return[Il.b_stat]};Cl.curContext=function(){return this.context[this.context.length-1]};Cl.braceIsBlock=function(e){var t=this.curContext();if(t===Il.f_expr||t===Il.f_stat){return true}if(e===Ta.colon&&(t===Il.b_stat||t===Il.b_expr)){return!t.isExpr}if(e===Ta._return||e===Ta.name&&this.exprAllowed){return Da.test(this.input.slice(this.lastTokEnd,this.start))}if(e===Ta._else||e===Ta.semi||e===Ta.eof||e===Ta.parenR||e===Ta.arrow){return true}if(e===Ta.braceL){return t===Il.b_stat}if(e===Ta._var||e===Ta._const||e===Ta.name){return false}return!this.exprAllowed};Cl.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token==="function"){return t.generator}}return false};Cl.updateContext=function(e){var t,i=this.type;if(i.keyword&&e===Ta.dot){this.exprAllowed=false}else if(t=i.updateContext){t.call(this,e)}else{this.exprAllowed=i.beforeExpr}};Cl.overrideContext=function(e){if(this.curContext()!==e){this.context[this.context.length-1]=e}};Ta.parenR.updateContext=Ta.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=true;return}var e=this.context.pop();if(e===Il.b_stat&&this.curContext().token==="function"){e=this.context.pop()}this.exprAllowed=!e.isExpr};Ta.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?Il.b_stat:Il.b_expr);this.exprAllowed=true};Ta.dollarBraceL.updateContext=function(){this.context.push(Il.b_tmpl);this.exprAllowed=true};Ta.parenL.updateContext=function(e){var t=e===Ta._if||e===Ta._for||e===Ta._with||e===Ta._while;this.context.push(t?Il.p_stat:Il.p_expr);this.exprAllowed=true};Ta.incDec.updateContext=function(){};Ta._function.updateContext=Ta._class.updateContext=function(e){if(e.beforeExpr&&e!==Ta._else&&!(e===Ta.semi&&this.curContext()!==Il.p_stat)&&!(e===Ta._return&&Da.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===Ta.colon||e===Ta.braceL)&&this.curContext()===Il.b_stat)){this.context.push(Il.f_expr)}else{this.context.push(Il.f_stat)}this.exprAllowed=false};Ta.backQuote.updateContext=function(){if(this.curContext()===Il.q_tmpl){this.context.pop()}else{this.context.push(Il.q_tmpl)}this.exprAllowed=false};Ta.star.updateContext=function(e){if(e===Ta._function){var t=this.context.length-1;if(this.context[t]===Il.f_expr){this.context[t]=Il.f_expr_gen}else{this.context[t]=Il.f_gen}}this.exprAllowed=true};Ta.name.updateContext=function(e){var t=false;if(this.options.ecmaVersion>=6&&e!==Ta.dot){if(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext()){t=true}}this.exprAllowed=t};var kl=hl.prototype;kl.checkPropClash=function(e,t,i){if(this.options.ecmaVersion>=9&&e.type==="SpreadElement"){return}if(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand)){return}var s=e.key;var n;switch(s.type){case"Identifier":n=s.name;break;case"Literal":n=String(s.value);break;default:return}var r=e.kind;if(this.options.ecmaVersion>=6){if(n==="__proto__"&&r==="init"){if(t.proto){if(i){if(i.doubleProto<0){i.doubleProto=s.start}}else{this.raiseRecoverable(s.start,"Redefinition of __proto__ property")}}t.proto=true}return}n="$"+n;var o=t[n];if(o){var l;if(r==="init"){l=this.strict&&o.init||o.get||o.set}else{l=o.init||o[r]}if(l){this.raiseRecoverable(s.start,"Redefinition of property")}}else{o=t[n]={init:false,get:false,set:false}}o[r]=true};kl.parseExpression=function(e,t){var i=this.start,s=this.startLoc;var n=this.parseMaybeAssign(e,t);if(this.type===Ta.comma){var r=this.startNodeAt(i,s);r.expressions=[n];while(this.eat(Ta.comma)){r.expressions.push(this.parseMaybeAssign(e,t))}return this.finishNode(r,"SequenceExpression")}return n};kl.parseMaybeAssign=function(e,t,i){if(this.isContextual("yield")){if(this.inGenerator){return this.parseYield(e)}else{this.exprAllowed=false}}var s=false,n=-1,r=-1,o=-1;if(t){n=t.parenthesizedAssign;r=t.trailingComma;o=t.doubleProto;t.parenthesizedAssign=t.trailingComma=-1}else{t=new ml;s=true}var l=this.start,c=this.startLoc;if(this.type===Ta.parenL||this.type===Ta.name){this.potentialArrowAt=this.start;this.potentialArrowInForAwait=e==="await"}var u=this.parseMaybeConditional(e,t);if(i){u=i.call(this,u,l,c)}if(this.type.isAssign){var h=this.startNodeAt(l,c);h.operator=this.value;if(this.type===Ta.eq){u=this.toAssignable(u,false,t)}if(!s){t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1}if(t.shorthandAssign>=u.start){t.shorthandAssign=-1}if(this.type===Ta.eq){this.checkLValPattern(u)}else{this.checkLValSimple(u)}h.left=u;this.next();h.right=this.parseMaybeAssign(e);if(o>-1){t.doubleProto=o}return this.finishNode(h,"AssignmentExpression")}else{if(s){this.checkExpressionErrors(t,true)}}if(n>-1){t.parenthesizedAssign=n}if(r>-1){t.trailingComma=r}return u};kl.parseMaybeConditional=function(e,t){var i=this.start,s=this.startLoc;var n=this.parseExprOps(e,t);if(this.checkExpressionErrors(t)){return n}if(this.eat(Ta.question)){var r=this.startNodeAt(i,s);r.test=n;r.consequent=this.parseMaybeAssign();this.expect(Ta.colon);r.alternate=this.parseMaybeAssign(e);return this.finishNode(r,"ConditionalExpression")}return n};kl.parseExprOps=function(e,t){var i=this.start,s=this.startLoc;var n=this.parseMaybeUnary(t,false,false,e);if(this.checkExpressionErrors(t)){return n}return n.start===i&&n.type==="ArrowFunctionExpression"?n:this.parseExprOp(n,i,s,-1,e)};kl.parseExprOp=function(e,t,i,s,n){var r=this.type.binop;if(r!=null&&(!n||this.type!==Ta._in)){if(r>s){var o=this.type===Ta.logicalOR||this.type===Ta.logicalAND;var l=this.type===Ta.coalesce;if(l){r=Ta.logicalAND.binop}var c=this.value;this.next();var u=this.start,h=this.startLoc;var d=this.parseExprOp(this.parseMaybeUnary(null,false,false,n),u,h,r,n);var p=this.buildBinary(t,i,e,d,c,o||l);if(o&&this.type===Ta.coalesce||l&&(this.type===Ta.logicalOR||this.type===Ta.logicalAND)){this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses")}return this.parseExprOp(p,t,i,s,n)}}return e};kl.buildBinary=function(e,t,i,s,n,r){if(s.type==="PrivateIdentifier"){this.raise(s.start,"Private identifier can only be left side of binary expression")}var o=this.startNodeAt(e,t);o.left=i;o.operator=n;o.right=s;return this.finishNode(o,r?"LogicalExpression":"BinaryExpression")};kl.parseMaybeUnary=function(e,t,i,s){var n=this.start,r=this.startLoc,o;if(this.isContextual("await")&&this.canAwait){o=this.parseAwait(s);t=true}else if(this.type.prefix){var l=this.startNode(),c=this.type===Ta.incDec;l.operator=this.value;l.prefix=true;this.next();l.argument=this.parseMaybeUnary(null,true,c,s);this.checkExpressionErrors(e,true);if(c){this.checkLValSimple(l.argument)}else if(this.strict&&l.operator==="delete"&&l.argument.type==="Identifier"){this.raiseRecoverable(l.start,"Deleting local variable in strict mode")}else if(l.operator==="delete"&&isPrivateFieldAccess(l.argument)){this.raiseRecoverable(l.start,"Private fields can not be deleted")}else{t=true}o=this.finishNode(l,c?"UpdateExpression":"UnaryExpression")}else if(!t&&this.type===Ta.privateId){if((s||this.privateNameStack.length===0)&&this.options.checkPrivateFields){this.unexpected()}o=this.parsePrivateIdent();if(this.type!==Ta._in){this.unexpected()}}else{o=this.parseExprSubscripts(e,s);if(this.checkExpressionErrors(e)){return o}while(this.type.postfix&&!this.canInsertSemicolon()){var u=this.startNodeAt(n,r);u.operator=this.value;u.prefix=false;u.argument=o;this.checkLValSimple(o);this.next();o=this.finishNode(u,"UpdateExpression")}}if(!i&&this.eat(Ta.starstar)){if(t){this.unexpected(this.lastTokStart)}else{return this.buildBinary(n,r,o,this.parseMaybeUnary(null,false,false,s),"**",false)}}else{return o}};function isPrivateFieldAccess(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&isPrivateFieldAccess(e.expression)}kl.parseExprSubscripts=function(e,t){var i=this.start,s=this.startLoc;var n=this.parseExprAtom(e,t);if(n.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")"){return n}var r=this.parseSubscripts(n,i,s,false,t);if(e&&r.type==="MemberExpression"){if(e.parenthesizedAssign>=r.start){e.parenthesizedAssign=-1}if(e.parenthesizedBind>=r.start){e.parenthesizedBind=-1}if(e.trailingComma>=r.start){e.trailingComma=-1}}return r};kl.parseSubscripts=function(e,t,i,s,n){var r=this.options.ecmaVersion>=8&&e.type==="Identifier"&&e.name==="async"&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start;var o=false;while(true){var l=this.parseSubscript(e,t,i,s,r,o,n);if(l.optional){o=true}if(l===e||l.type==="ArrowFunctionExpression"){if(o){var c=this.startNodeAt(t,i);c.expression=l;l=this.finishNode(c,"ChainExpression")}return l}e=l}};kl.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(Ta.arrow)};kl.parseSubscriptAsyncArrow=function(e,t,i,s){return this.parseArrowExpression(this.startNodeAt(e,t),i,true,s)};kl.parseSubscript=function(e,t,i,s,n,r,o){var l=this.options.ecmaVersion>=11;var c=l&&this.eat(Ta.questionDot);if(s&&c){this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions")}var u=this.eat(Ta.bracketL);if(u||c&&this.type!==Ta.parenL&&this.type!==Ta.backQuote||this.eat(Ta.dot)){var h=this.startNodeAt(t,i);h.object=e;if(u){h.property=this.parseExpression();this.expect(Ta.bracketR)}else if(this.type===Ta.privateId&&e.type!=="Super"){h.property=this.parsePrivateIdent()}else{h.property=this.parseIdent(this.options.allowReserved!=="never")}h.computed=!!u;if(l){h.optional=c}e=this.finishNode(h,"MemberExpression")}else if(!s&&this.eat(Ta.parenL)){var d=new ml,p=this.yieldPos,f=this.awaitPos,m=this.awaitIdentPos;this.yieldPos=0;this.awaitPos=0;this.awaitIdentPos=0;var g=this.parseExprList(Ta.parenR,this.options.ecmaVersion>=8,false,d);if(n&&!c&&this.shouldParseAsyncArrow()){this.checkPatternErrors(d,false);this.checkYieldAwaitInDefaultParams();if(this.awaitIdentPos>0){this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function")}this.yieldPos=p;this.awaitPos=f;this.awaitIdentPos=m;return this.parseSubscriptAsyncArrow(t,i,g,o)}this.checkExpressionErrors(d,true);this.yieldPos=p||this.yieldPos;this.awaitPos=f||this.awaitPos;this.awaitIdentPos=m||this.awaitIdentPos;var y=this.startNodeAt(t,i);y.callee=e;y.arguments=g;if(l){y.optional=c}e=this.finishNode(y,"CallExpression")}else if(this.type===Ta.backQuote){if(c||r){this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions")}var E=this.startNodeAt(t,i);E.tag=e;E.quasi=this.parseTemplate({isTagged:true});e=this.finishNode(E,"TaggedTemplateExpression")}return e};kl.parseExprAtom=function(e,t,i){if(this.type===Ta.slash){this.readRegexp()}var s,n=this.potentialArrowAt===this.start;switch(this.type){case Ta._super:if(!this.allowSuper){this.raise(this.start,"'super' keyword outside a method")}s=this.startNode();this.next();if(this.type===Ta.parenL&&!this.allowDirectSuper){this.raise(s.start,"super() call outside constructor of a subclass")}if(this.type!==Ta.dot&&this.type!==Ta.bracketL&&this.type!==Ta.parenL){this.unexpected()}return this.finishNode(s,"Super");case Ta._this:s=this.startNode();this.next();return this.finishNode(s,"ThisExpression");case Ta.name:var r=this.start,o=this.startLoc,l=this.containsEsc;var c=this.parseIdent(false);if(this.options.ecmaVersion>=8&&!l&&c.name==="async"&&!this.canInsertSemicolon()&&this.eat(Ta._function)){this.overrideContext(Il.f_expr);return this.parseFunction(this.startNodeAt(r,o),0,false,true,t)}if(n&&!this.canInsertSemicolon()){if(this.eat(Ta.arrow)){return this.parseArrowExpression(this.startNodeAt(r,o),[c],false,t)}if(this.options.ecmaVersion>=8&&c.name==="async"&&this.type===Ta.name&&!l&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc)){c=this.parseIdent(false);if(this.canInsertSemicolon()||!this.eat(Ta.arrow)){this.unexpected()}return this.parseArrowExpression(this.startNodeAt(r,o),[c],true,t)}}return c;case Ta.regexp:var u=this.value;s=this.parseLiteral(u.value);s.regex={pattern:u.pattern,flags:u.flags};return s;case Ta.num:case Ta.string:return this.parseLiteral(this.value);case Ta._null:case Ta._true:case Ta._false:s=this.startNode();s.value=this.type===Ta._null?null:this.type===Ta._true;s.raw=this.type.keyword;this.next();return this.finishNode(s,"Literal");case Ta.parenL:var h=this.start,d=this.parseParenAndDistinguishExpression(n,t);if(e){if(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(d)){e.parenthesizedAssign=h}if(e.parenthesizedBind<0){e.parenthesizedBind=h}}return d;case Ta.bracketL:s=this.startNode();this.next();s.elements=this.parseExprList(Ta.bracketR,true,true,e);return this.finishNode(s,"ArrayExpression");case Ta.braceL:this.overrideContext(Il.b_expr);return this.parseObj(false,e);case Ta._function:s=this.startNode();this.next();return this.parseFunction(s,0);case Ta._class:return this.parseClass(this.startNode(),false);case Ta._new:return this.parseNew();case Ta.backQuote:return this.parseTemplate();case Ta._import:if(this.options.ecmaVersion>=11){return this.parseExprImport(i)}else{return this.unexpected()}default:return this.parseExprAtomDefault()}};kl.parseExprAtomDefault=function(){this.unexpected()};kl.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc){this.raiseRecoverable(this.start,"Escape sequence in keyword import")}var i=this.parseIdent(true);if(this.type===Ta.parenL&&!e){return this.parseDynamicImport(t)}else if(this.type===Ta.dot){t.meta=i;return this.parseImportMeta(t)}else{this.unexpected()}};kl.parseDynamicImport=function(e){this.next();e.source=this.parseMaybeAssign();if(!this.eat(Ta.parenR)){var t=this.start;if(this.eat(Ta.comma)&&this.eat(Ta.parenR)){this.raiseRecoverable(t,"Trailing comma is not allowed in import()")}else{this.unexpected(t)}}return this.finishNode(e,"ImportExpression")};kl.parseImportMeta=function(e){this.next();var t=this.containsEsc;e.property=this.parseIdent(true);if(e.property.name!=="meta"){this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'")}if(t){this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters")}if(this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere){this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module")}return this.finishNode(e,"MetaProperty")};kl.parseLiteral=function(e){var t=this.startNode();t.value=e;t.raw=this.input.slice(this.start,this.end);if(t.raw.charCodeAt(t.raw.length-1)===110){t.bigint=t.raw.slice(0,-1).replace(/_/g,"")}this.next();return this.finishNode(t,"Literal")};kl.parseParenExpression=function(){this.expect(Ta.parenL);var e=this.parseExpression();this.expect(Ta.parenR);return e};kl.shouldParseArrow=function(e){return!this.canInsertSemicolon()};kl.parseParenAndDistinguishExpression=function(e,t){var i=this.start,s=this.startLoc,n,r=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o=this.start,l=this.startLoc;var c=[],u=true,h=false;var d=new ml,p=this.yieldPos,f=this.awaitPos,m;this.yieldPos=0;this.awaitPos=0;while(this.type!==Ta.parenR){u?u=false:this.expect(Ta.comma);if(r&&this.afterTrailingComma(Ta.parenR,true)){h=true;break}else if(this.type===Ta.ellipsis){m=this.start;c.push(this.parseParenItem(this.parseRestBinding()));if(this.type===Ta.comma){this.raiseRecoverable(this.start,"Comma is not permitted after the rest element")}break}else{c.push(this.parseMaybeAssign(false,d,this.parseParenItem))}}var g=this.lastTokEnd,y=this.lastTokEndLoc;this.expect(Ta.parenR);if(e&&this.shouldParseArrow(c)&&this.eat(Ta.arrow)){this.checkPatternErrors(d,false);this.checkYieldAwaitInDefaultParams();this.yieldPos=p;this.awaitPos=f;return this.parseParenArrowList(i,s,c,t)}if(!c.length||h){this.unexpected(this.lastTokStart)}if(m){this.unexpected(m)}this.checkExpressionErrors(d,true);this.yieldPos=p||this.yieldPos;this.awaitPos=f||this.awaitPos;if(c.length>1){n=this.startNodeAt(o,l);n.expressions=c;this.finishNodeAt(n,"SequenceExpression",g,y)}else{n=c[0]}}else{n=this.parseParenExpression()}if(this.options.preserveParens){var E=this.startNodeAt(i,s);E.expression=n;return this.finishNode(E,"ParenthesizedExpression")}else{return n}};kl.parseParenItem=function(e){return e};kl.parseParenArrowList=function(e,t,i,s){return this.parseArrowExpression(this.startNodeAt(e,t),i,false,s)};var _l=[];kl.parseNew=function(){if(this.containsEsc){this.raiseRecoverable(this.start,"Escape sequence in keyword new")}var e=this.startNode();var t=this.parseIdent(true);if(this.options.ecmaVersion>=6&&this.eat(Ta.dot)){e.meta=t;var i=this.containsEsc;e.property=this.parseIdent(true);if(e.property.name!=="target"){this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'")}if(i){this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters")}if(!this.allowNewDotTarget){this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block")}return this.finishNode(e,"MetaProperty")}var s=this.start,n=this.startLoc;e.callee=this.parseSubscripts(this.parseExprAtom(null,false,true),s,n,true,false);if(this.eat(Ta.parenL)){e.arguments=this.parseExprList(Ta.parenR,this.options.ecmaVersion>=8,false)}else{e.arguments=_l}return this.finishNode(e,"NewExpression")};kl.parseTemplateElement=function(e){var t=e.isTagged;var i=this.startNode();if(this.type===Ta.invalidTemplate){if(!t){this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal")}i.value={raw:this.value,cooked:null}}else{i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value}}this.next();i.tail=this.type===Ta.backQuote;return this.finishNode(i,"TemplateElement")};kl.parseTemplate=function(e){if(e===void 0)e={};var t=e.isTagged;if(t===void 0)t=false;var i=this.startNode();this.next();i.expressions=[];var s=this.parseTemplateElement({isTagged:t});i.quasis=[s];while(!s.tail){if(this.type===Ta.eof){this.raise(this.pos,"Unterminated template literal")}this.expect(Ta.dollarBraceL);i.expressions.push(this.parseExpression());this.expect(Ta.braceR);i.quasis.push(s=this.parseTemplateElement({isTagged:t}))}this.next();return this.finishNode(i,"TemplateLiteral")};kl.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===Ta.name||this.type===Ta.num||this.type===Ta.string||this.type===Ta.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===Ta.star)&&!Da.test(this.input.slice(this.lastTokEnd,this.start))};kl.parseObj=function(e,t){var i=this.startNode(),s=true,n={};i.properties=[];this.next();while(!this.eat(Ta.braceR)){if(!s){this.expect(Ta.comma);if(this.options.ecmaVersion>=5&&this.afterTrailingComma(Ta.braceR)){break}}else{s=false}var r=this.parseProperty(e,t);if(!e){this.checkPropClash(r,n,t)}i.properties.push(r)}return this.finishNode(i,e?"ObjectPattern":"ObjectExpression")};kl.parseProperty=function(e,t){var i=this.startNode(),s,n,r,o;if(this.options.ecmaVersion>=9&&this.eat(Ta.ellipsis)){if(e){i.argument=this.parseIdent(false);if(this.type===Ta.comma){this.raiseRecoverable(this.start,"Comma is not permitted after the rest element")}return this.finishNode(i,"RestElement")}i.argument=this.parseMaybeAssign(false,t);if(this.type===Ta.comma&&t&&t.trailingComma<0){t.trailingComma=this.start}return this.finishNode(i,"SpreadElement")}if(this.options.ecmaVersion>=6){i.method=false;i.shorthand=false;if(e||t){r=this.start;o=this.startLoc}if(!e){s=this.eat(Ta.star)}}var l=this.containsEsc;this.parsePropertyName(i);if(!e&&!l&&this.options.ecmaVersion>=8&&!s&&this.isAsyncProp(i)){n=true;s=this.options.ecmaVersion>=9&&this.eat(Ta.star);this.parsePropertyName(i)}else{n=false}this.parsePropertyValue(i,e,s,n,r,o,t,l);return this.finishNode(i,"Property")};kl.parseGetterSetter=function(e){e.kind=e.key.name;this.parsePropertyName(e);e.value=this.parseMethod(false);var t=e.kind==="get"?0:1;if(e.value.params.length!==t){var i=e.value.start;if(e.kind==="get"){this.raiseRecoverable(i,"getter should have no params")}else{this.raiseRecoverable(i,"setter should have exactly one param")}}else{if(e.kind==="set"&&e.value.params[0].type==="RestElement"){this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")}}};kl.parsePropertyValue=function(e,t,i,s,n,r,o,l){if((i||s)&&this.type===Ta.colon){this.unexpected()}if(this.eat(Ta.colon)){e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(false,o);e.kind="init"}else if(this.options.ecmaVersion>=6&&this.type===Ta.parenL){if(t){this.unexpected()}e.kind="init";e.method=true;e.value=this.parseMethod(i,s)}else if(!t&&!l&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&(this.type!==Ta.comma&&this.type!==Ta.braceR&&this.type!==Ta.eq)){if(i||s){this.unexpected()}this.parseGetterSetter(e)}else if(this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"){if(i||s){this.unexpected()}this.checkUnreserved(e.key);if(e.key.name==="await"&&!this.awaitIdentPos){this.awaitIdentPos=n}e.kind="init";if(t){e.value=this.parseMaybeDefault(n,r,this.copyNode(e.key))}else if(this.type===Ta.eq&&o){if(o.shorthandAssign<0){o.shorthandAssign=this.start}e.value=this.parseMaybeDefault(n,r,this.copyNode(e.key))}else{e.value=this.copyNode(e.key)}e.shorthand=true}else{this.unexpected()}};kl.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(Ta.bracketL)){e.computed=true;e.key=this.parseMaybeAssign();this.expect(Ta.bracketR);return e.key}else{e.computed=false}}return e.key=this.type===Ta.num||this.type===Ta.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};kl.initFunction=function(e){e.id=null;if(this.options.ecmaVersion>=6){e.generator=e.expression=false}if(this.options.ecmaVersion>=8){e.async=false}};kl.parseMethod=function(e,t,i){var s=this.startNode(),n=this.yieldPos,r=this.awaitPos,o=this.awaitIdentPos;this.initFunction(s);if(this.options.ecmaVersion>=6){s.generator=e}if(this.options.ecmaVersion>=8){s.async=!!t}this.yieldPos=0;this.awaitPos=0;this.awaitIdentPos=0;this.enterScope(functionFlags(t,s.generator)|tl|(i?il:0));this.expect(Ta.parenL);s.params=this.parseBindingList(Ta.parenR,false,this.options.ecmaVersion>=8);this.checkYieldAwaitInDefaultParams();this.parseFunctionBody(s,false,true,false);this.yieldPos=n;this.awaitPos=r;this.awaitIdentPos=o;return this.finishNode(s,"FunctionExpression")};kl.parseArrowExpression=function(e,t,i,s){var n=this.yieldPos,r=this.awaitPos,o=this.awaitIdentPos;this.enterScope(functionFlags(i,false)|Ja);this.initFunction(e);if(this.options.ecmaVersion>=8){e.async=!!i}this.yieldPos=0;this.awaitPos=0;this.awaitIdentPos=0;e.params=this.toAssignableList(t,true);this.parseFunctionBody(e,true,false,s);this.yieldPos=n;this.awaitPos=r;this.awaitIdentPos=o;return this.finishNode(e,"ArrowFunctionExpression")};kl.parseFunctionBody=function(e,t,i,s){var n=t&&this.type!==Ta.braceL;var r=this.strict,o=false;if(n){e.body=this.parseMaybeAssign(s);e.expression=true;this.checkParams(e,false)}else{var l=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);if(!r||l){o=this.strictDirective(this.end);if(o&&l){this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list")}}var c=this.labels;this.labels=[];if(o){this.strict=true}this.checkParams(e,!r&&!o&&!t&&!i&&this.isSimpleParamList(e.params));if(this.strict&&e.id){this.checkLValSimple(e.id,ul)}e.body=this.parseBlock(false,undefined,o&&!r);e.expression=false;this.adaptDirectivePrologue(e.body.body);this.labels=c}this.exitScope()};kl.isSimpleParamList=function(e){for(var t=0,i=e;t<i.length;t+=1){var s=i[t];if(s.type!=="Identifier"){return false}}return true};kl.checkParams=function(e,t){var i=Object.create(null);for(var s=0,n=e.params;s<n.length;s+=1){var r=n[s];this.checkLValInnerPattern(r,ol,t?null:i)}};kl.parseExprList=function(e,t,i,s){var n=[],r=true;while(!this.eat(e)){if(!r){this.expect(Ta.comma);if(t&&this.afterTrailingComma(e)){break}}else{r=false}var o=void 0;if(i&&this.type===Ta.comma){o=null}else if(this.type===Ta.ellipsis){o=this.parseSpread(s);if(s&&this.type===Ta.comma&&s.trailingComma<0){s.trailingComma=this.start}}else{o=this.parseMaybeAssign(false,s)}n.push(o)}return n};kl.checkUnreserved=function(e){var t=e.start;var i=e.end;var s=e.name;if(this.inGenerator&&s==="yield"){this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator")}if(this.inAsync&&s==="await"){this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function")}if(this.currentThisScope().inClassFieldInit&&s==="arguments"){this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer")}if(this.inClassStaticBlock&&(s==="arguments"||s==="await")){this.raise(t,"Cannot use "+s+" in class static initialization block")}if(this.keywords.test(s)){this.raise(t,"Unexpected keyword '"+s+"'")}if(this.options.ecmaVersion<6&&this.input.slice(t,i).indexOf("\\")!==-1){return}var n=this.strict?this.reservedWordsStrict:this.reservedWords;if(n.test(s)){if(!this.inAsync&&s==="await"){this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function")}this.raiseRecoverable(t,"The keyword '"+s+"' is reserved")}};kl.parseIdent=function(e){var t=this.parseIdentNode();this.next(!!e);this.finishNode(t,"Identifier");if(!e){this.checkUnreserved(t);if(t.name==="await"&&!this.awaitIdentPos){this.awaitIdentPos=t.start}}return t};kl.parseIdentNode=function(){var e=this.startNode();if(this.type===Ta.name){e.name=this.value}else if(this.type.keyword){e.name=this.type.keyword;if((e.name==="class"||e.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)){this.context.pop()}}else{this.unexpected()}return e};kl.parsePrivateIdent=function(){var e=this.startNode();if(this.type===Ta.privateId){e.name=this.value}else{this.unexpected()}this.next();this.finishNode(e,"PrivateIdentifier");if(this.options.checkPrivateFields){if(this.privateNameStack.length===0){this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class")}else{this.privateNameStack[this.privateNameStack.length-1].used.push(e)}}return e};kl.parseYield=function(e){if(!this.yieldPos){this.yieldPos=this.start}var t=this.startNode();this.next();if(this.type===Ta.semi||this.canInsertSemicolon()||this.type!==Ta.star&&!this.type.startsExpr){t.delegate=false;t.argument=null}else{t.delegate=this.eat(Ta.star);t.argument=this.parseMaybeAssign(e)}return this.finishNode(t,"YieldExpression")};kl.parseAwait=function(e){if(!this.awaitPos){this.awaitPos=this.start}var t=this.startNode();this.next();t.argument=this.parseMaybeUnary(null,true,false,e);return this.finishNode(t,"AwaitExpression")};var Pl=hl.prototype;Pl.raise=function(e,t){var i=getLineInfo(this.input,e);t+=" ("+i.line+":"+i.column+")";var s=new SyntaxError(t);s.pos=e;s.loc=i;s.raisedAt=this.pos;throw s};Pl.raiseRecoverable=Pl.raise;Pl.curPosition=function(){if(this.options.locations){return new Ga(this.curLine,this.pos-this.lineStart)}};var Nl=hl.prototype;var Rl=function Scope(e){this.flags=e;this.var=[];this.lexical=[];this.functions=[];this.inClassFieldInit=false};Nl.enterScope=function(e){this.scopeStack.push(new Rl(e))};Nl.exitScope=function(){this.scopeStack.pop()};Nl.treatFunctionsAsVarInScope=function(e){return e.flags&Qa||!this.inModule&&e.flags&Ya};Nl.declareName=function(e,t,i){var s=false;if(t===al){var n=this.currentScope();s=n.lexical.indexOf(e)>-1||n.functions.indexOf(e)>-1||n.var.indexOf(e)>-1;n.lexical.push(e);if(this.inModule&&n.flags&Ya){delete this.undefinedExports[e]}}else if(t===cl){var r=this.currentScope();r.lexical.push(e)}else if(t===ll){var o=this.currentScope();if(this.treatFunctionsAsVar){s=o.lexical.indexOf(e)>-1}else{s=o.lexical.indexOf(e)>-1||o.var.indexOf(e)>-1}o.functions.push(e)}else{for(var l=this.scopeStack.length-1;l>=0;--l){var c=this.scopeStack[l];if(c.lexical.indexOf(e)>-1&&!(c.flags&el&&c.lexical[0]===e)||!this.treatFunctionsAsVarInScope(c)&&c.functions.indexOf(e)>-1){s=true;break}c.var.push(e);if(this.inModule&&c.flags&Ya){delete this.undefinedExports[e]}if(c.flags&nl){break}}}if(s){this.raiseRecoverable(i,"Identifier '"+e+"' has already been declared")}};Nl.checkLocalExport=function(e){if(this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1){this.undefinedExports[e.name]=e}};Nl.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};Nl.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&nl){return t}}};Nl.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&nl&&!(t.flags&Ja)){return t}}};var $l=function Node(e,t,i){this.type="";this.start=t;this.end=0;if(e.options.locations){this.loc=new Wa(e,i)}if(e.options.directSourceFile){this.sourceFile=e.options.directSourceFile}if(e.options.ranges){this.range=[t,0]}};var Ol=hl.prototype;Ol.startNode=function(){return new $l(this,this.start,this.startLoc)};Ol.startNodeAt=function(e,t){return new $l(this,e,t)};function finishNodeAt(e,t,i,s){e.type=t;e.end=i;if(this.options.locations){e.loc.end=s}if(this.options.ranges){e.range[1]=i}return e}Ol.finishNode=function(e,t){return finishNodeAt.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)};Ol.finishNodeAt=function(e,t,i,s){return finishNodeAt.call(this,e,t,i,s)};Ol.copyNode=function(e){var t=new $l(this,e.start,this.startLoc);for(var i in e){t[i]=e[i]}return t};var Tl="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS";var Dl=Tl+" Extended_Pictographic";var Ml=Dl;var Ll=Ml+" EBase EComp EMod EPres ExtPict";var Bl=Ll;var Fl=Bl;var Vl={9:Tl,10:Dl,11:Ml,12:Ll,13:Bl,14:Fl};var zl="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji";var jl={9:"",10:"",11:"",12:"",13:"",14:zl};var Ul="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu";var Hl="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb";var Gl=Hl+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd";var Wl=Gl+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho";var ql=Wl+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi";var Kl=ql+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith";var Yl=Kl+" Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz";var Ql={9:Hl,10:Gl,11:Wl,12:ql,13:Kl,14:Yl};var Xl={};function buildUnicodeData(e){var t=Xl[e]={binary:wordsRegexp(Vl[e]+" "+Ul),binaryOfStrings:wordsRegexp(jl[e]),nonBinary:{General_Category:wordsRegexp(Ul),Script:wordsRegexp(Ql[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script;t.nonBinary.gc=t.nonBinary.General_Category;t.nonBinary.sc=t.nonBinary.Script;t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var Zl=0,Jl=[9,10,11,12,13,14];Zl<Jl.length;Zl+=1){var ec=Jl[Zl];buildUnicodeData(ec)}var tc=hl.prototype;var ic=function RegExpValidationState(e){this.parser=e;this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":"")+(e.options.ecmaVersion>=13?"d":"")+(e.options.ecmaVersion>=15?"v":"");this.unicodeProperties=Xl[e.options.ecmaVersion>=14?14:e.options.ecmaVersion];this.source="";this.flags="";this.start=0;this.switchU=false;this.switchV=false;this.switchN=false;this.pos=0;this.lastIntValue=0;this.lastStringValue="";this.lastAssertionIsQuantifiable=false;this.numCapturingParens=0;this.maxBackReference=0;this.groupNames=[];this.backReferenceNames=[]};ic.prototype.reset=function reset(e,t,i){var s=i.indexOf("v")!==-1;var n=i.indexOf("u")!==-1;this.start=e|0;this.source=t+"";this.flags=i;if(s&&this.parser.options.ecmaVersion>=15){this.switchU=true;this.switchV=true;this.switchN=true}else{this.switchU=n&&this.parser.options.ecmaVersion>=6;this.switchV=false;this.switchN=n&&this.parser.options.ecmaVersion>=9}};ic.prototype.raise=function raise(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)};ic.prototype.at=function at(e,t){if(t===void 0)t=false;var i=this.source;var s=i.length;if(e>=s){return-1}var n=i.charCodeAt(e);if(!(t||this.switchU)||n<=55295||n>=57344||e+1>=s){return n}var r=i.charCodeAt(e+1);return r>=56320&&r<=57343?(n<<10)+r-56613888:n};ic.prototype.nextIndex=function nextIndex(e,t){if(t===void 0)t=false;var i=this.source;var s=i.length;if(e>=s){return s}var n=i.charCodeAt(e),r;if(!(t||this.switchU)||n<=55295||n>=57344||e+1>=s||(r=i.charCodeAt(e+1))<56320||r>57343){return e+1}return e+2};ic.prototype.current=function current(e){if(e===void 0)e=false;return this.at(this.pos,e)};ic.prototype.lookahead=function lookahead(e){if(e===void 0)e=false;return this.at(this.nextIndex(this.pos,e),e)};ic.prototype.advance=function advance(e){if(e===void 0)e=false;this.pos=this.nextIndex(this.pos,e)};ic.prototype.eat=function eat(e,t){if(t===void 0)t=false;if(this.current(t)===e){this.advance(t);return true}return false};ic.prototype.eatChars=function eatChars(e,t){if(t===void 0)t=false;var i=this.pos;for(var s=0,n=e;s<n.length;s+=1){var r=n[s];var o=this.at(i,t);if(o===-1||o!==r){return false}i=this.nextIndex(i,t)}this.pos=i;return true};tc.validateRegExpFlags=function(e){var t=e.validFlags;var i=e.flags;var s=false;var n=false;for(var r=0;r<i.length;r++){var o=i.charAt(r);if(t.indexOf(o)===-1){this.raise(e.start,"Invalid regular expression flag")}if(i.indexOf(o,r+1)>-1){this.raise(e.start,"Duplicate regular expression flag")}if(o==="u"){s=true}if(o==="v"){n=true}}if(this.options.ecmaVersion>=15&&s&&n){this.raise(e.start,"Invalid regular expression flag")}};tc.validateRegExpPattern=function(e){this.regexp_pattern(e);if(!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0){e.switchN=true;this.regexp_pattern(e)}};tc.regexp_pattern=function(e){e.pos=0;e.lastIntValue=0;e.lastStringValue="";e.lastAssertionIsQuantifiable=false;e.numCapturingParens=0;e.maxBackReference=0;e.groupNames.length=0;e.backReferenceNames.length=0;this.regexp_disjunction(e);if(e.pos!==e.source.length){if(e.eat(41)){e.raise("Unmatched ')'")}if(e.eat(93)||e.eat(125)){e.raise("Lone quantifier brackets")}}if(e.maxBackReference>e.numCapturingParens){e.raise("Invalid escape")}for(var t=0,i=e.backReferenceNames;t<i.length;t+=1){var s=i[t];if(e.groupNames.indexOf(s)===-1){e.raise("Invalid named capture referenced")}}};tc.regexp_disjunction=function(e){this.regexp_alternative(e);while(e.eat(124)){this.regexp_alternative(e)}if(this.regexp_eatQuantifier(e,true)){e.raise("Nothing to repeat")}if(e.eat(123)){e.raise("Lone quantifier brackets")}};tc.regexp_alternative=function(e){while(e.pos<e.source.length&&this.regexp_eatTerm(e)){}};tc.regexp_eatTerm=function(e){if(this.regexp_eatAssertion(e)){if(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)){if(e.switchU){e.raise("Invalid quantifier")}}return true}if(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e)){this.regexp_eatQuantifier(e);return true}return false};tc.regexp_eatAssertion=function(e){var t=e.pos;e.lastAssertionIsQuantifiable=false;if(e.eat(94)||e.eat(36)){return true}if(e.eat(92)){if(e.eat(66)||e.eat(98)){return true}e.pos=t}if(e.eat(40)&&e.eat(63)){var i=false;if(this.options.ecmaVersion>=9){i=e.eat(60)}if(e.eat(61)||e.eat(33)){this.regexp_disjunction(e);if(!e.eat(41)){e.raise("Unterminated group")}e.lastAssertionIsQuantifiable=!i;return true}}e.pos=t;return false};tc.regexp_eatQuantifier=function(e,t){if(t===void 0)t=false;if(this.regexp_eatQuantifierPrefix(e,t)){e.eat(63);return true}return false};tc.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)};tc.regexp_eatBracedQuantifier=function(e,t){var i=e.pos;if(e.eat(123)){var s=0,n=-1;if(this.regexp_eatDecimalDigits(e)){s=e.lastIntValue;if(e.eat(44)&&this.regexp_eatDecimalDigits(e)){n=e.lastIntValue}if(e.eat(125)){if(n!==-1&&n<s&&!t){e.raise("numbers out of order in {} quantifier")}return true}}if(e.switchU&&!t){e.raise("Incomplete quantifier")}e.pos=i}return false};tc.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)};tc.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e)){return true}e.pos=t}return false};tc.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)&&e.eat(58)){this.regexp_disjunction(e);if(e.eat(41)){return true}e.raise("Unterminated group")}e.pos=t}return false};tc.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9){this.regexp_groupSpecifier(e)}else if(e.current()===63){e.raise("Invalid group")}this.regexp_disjunction(e);if(e.eat(41)){e.numCapturingParens+=1;return true}e.raise("Unterminated group")}return false};tc.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)};tc.regexp_eatInvalidBracedQuantifier=function(e){if(this.regexp_eatBracedQuantifier(e,true)){e.raise("Nothing to repeat")}return false};tc.regexp_eatSyntaxCharacter=function(e){var t=e.current();if(isSyntaxCharacter(t)){e.lastIntValue=t;e.advance();return true}return false};function isSyntaxCharacter(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}tc.regexp_eatPatternCharacters=function(e){var t=e.pos;var i=0;while((i=e.current())!==-1&&!isSyntaxCharacter(i)){e.advance()}return e.pos!==t};tc.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();if(t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124){e.advance();return true}return false};tc.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e)){if(e.groupNames.indexOf(e.lastStringValue)!==-1){e.raise("Duplicate capture group name")}e.groupNames.push(e.lastStringValue);return}e.raise("Invalid group")}};tc.regexp_eatGroupName=function(e){e.lastStringValue="";if(e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62)){return true}e.raise("Invalid capture group name")}return false};tc.regexp_eatRegExpIdentifierName=function(e){e.lastStringValue="";if(this.regexp_eatRegExpIdentifierStart(e)){e.lastStringValue+=codePointToString(e.lastIntValue);while(this.regexp_eatRegExpIdentifierPart(e)){e.lastStringValue+=codePointToString(e.lastIntValue)}return true}return false};tc.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos;var i=this.options.ecmaVersion>=11;var s=e.current(i);e.advance(i);if(s===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)){s=e.lastIntValue}if(isRegExpIdentifierStart(s)){e.lastIntValue=s;return true}e.pos=t;return false};function isRegExpIdentifierStart(e){return isIdentifierStart(e,true)||e===36||e===95}tc.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos;var i=this.options.ecmaVersion>=11;var s=e.current(i);e.advance(i);if(s===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)){s=e.lastIntValue}if(isRegExpIdentifierPart(s)){e.lastIntValue=s;return true}e.pos=t;return false};function isRegExpIdentifierPart(e){return isIdentifierChar(e,true)||e===36||e===95||e===8204||e===8205}tc.regexp_eatAtomEscape=function(e){if(this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)){return true}if(e.switchU){if(e.current()===99){e.raise("Invalid unicode escape")}e.raise("Invalid escape")}return false};tc.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var i=e.lastIntValue;if(e.switchU){if(i>e.maxBackReference){e.maxBackReference=i}return true}if(i<=e.numCapturingParens){return true}e.pos=t}return false};tc.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e)){e.backReferenceNames.push(e.lastStringValue);return true}e.raise("Invalid named reference")}return false};tc.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,false)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};tc.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e)){return true}e.pos=t}return false};tc.regexp_eatZero=function(e){if(e.current()===48&&!isDecimalDigit(e.lookahead())){e.lastIntValue=0;e.advance();return true}return false};tc.regexp_eatControlEscape=function(e){var t=e.current();if(t===116){e.lastIntValue=9;e.advance();return true}if(t===110){e.lastIntValue=10;e.advance();return true}if(t===118){e.lastIntValue=11;e.advance();return true}if(t===102){e.lastIntValue=12;e.advance();return true}if(t===114){e.lastIntValue=13;e.advance();return true}return false};tc.regexp_eatControlLetter=function(e){var t=e.current();if(isControlLetter(t)){e.lastIntValue=t%32;e.advance();return true}return false};function isControlLetter(e){return e>=65&&e<=90||e>=97&&e<=122}tc.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){if(t===void 0)t=false;var i=e.pos;var s=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var n=e.lastIntValue;if(s&&n>=55296&&n<=56319){var r=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343){e.lastIntValue=(n-55296)*1024+(o-56320)+65536;return true}}e.pos=r;e.lastIntValue=n}return true}if(s&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&isValidUnicode(e.lastIntValue)){return true}if(s){e.raise("Invalid unicode escape")}e.pos=i}return false};function isValidUnicode(e){return e>=0&&e<=1114111}tc.regexp_eatIdentityEscape=function(e){if(e.switchU){if(this.regexp_eatSyntaxCharacter(e)){return true}if(e.eat(47)){e.lastIntValue=47;return true}return false}var t=e.current();if(t!==99&&(!e.switchN||t!==107)){e.lastIntValue=t;e.advance();return true}return false};tc.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do{e.lastIntValue=10*e.lastIntValue+(t-48);e.advance()}while((t=e.current())>=48&&t<=57);return true}return false};var sc=0;var nc=1;var rc=2;tc.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(isCharacterClassEscape(t)){e.lastIntValue=-1;e.advance();return nc}var i=false;if(e.switchU&&this.options.ecmaVersion>=9&&((i=t===80)||t===112)){e.lastIntValue=-1;e.advance();var s;if(e.eat(123)&&(s=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125)){if(i&&s===rc){e.raise("Invalid property name")}return s}e.raise("Invalid property name")}return sc};function isCharacterClassEscape(e){return e===100||e===68||e===115||e===83||e===119||e===87}tc.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var i=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var s=e.lastStringValue;this.regexp_validateUnicodePropertyNameAndValue(e,i,s);return nc}}e.pos=t;if(this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var n=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,n)}return sc};tc.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){if(!ja(e.unicodeProperties.nonBinary,t)){e.raise("Invalid property name")}if(!e.unicodeProperties.nonBinary[t].test(i)){e.raise("Invalid property value")}};tc.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t)){return nc}if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t)){return rc}e.raise("Invalid property name")};tc.regexp_eatUnicodePropertyName=function(e){var t=0;e.lastStringValue="";while(isUnicodePropertyNameCharacter(t=e.current())){e.lastStringValue+=codePointToString(t);e.advance()}return e.lastStringValue!==""};function isUnicodePropertyNameCharacter(e){return isControlLetter(e)||e===95}tc.regexp_eatUnicodePropertyValue=function(e){var t=0;e.lastStringValue="";while(isUnicodePropertyValueCharacter(t=e.current())){e.lastStringValue+=codePointToString(t);e.advance()}return e.lastStringValue!==""};function isUnicodePropertyValueCharacter(e){return isUnicodePropertyNameCharacter(e)||isDecimalDigit(e)}tc.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};tc.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94);var i=this.regexp_classContents(e);if(!e.eat(93)){e.raise("Unterminated character class")}if(t&&i===rc){e.raise("Negated character class may contain strings")}return true}return false};tc.regexp_classContents=function(e){if(e.current()===93){return nc}if(e.switchV){return this.regexp_classSetExpression(e)}this.regexp_nonEmptyClassRanges(e);return nc};tc.regexp_nonEmptyClassRanges=function(e){while(this.regexp_eatClassAtom(e)){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var i=e.lastIntValue;if(e.switchU&&(t===-1||i===-1)){e.raise("Invalid character class")}if(t!==-1&&i!==-1&&t>i){e.raise("Range out of order in character class")}}}};tc.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e)){return true}if(e.switchU){var i=e.current();if(i===99||isOctalDigit(i)){e.raise("Invalid class escape")}e.raise("Invalid escape")}e.pos=t}var s=e.current();if(s!==93){e.lastIntValue=s;e.advance();return true}return false};tc.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98)){e.lastIntValue=8;return true}if(e.switchU&&e.eat(45)){e.lastIntValue=45;return true}if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e)){return true}e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)};tc.regexp_classSetExpression=function(e){var t=nc,i;if(this.regexp_eatClassSetRange(e));else if(i=this.regexp_eatClassSetOperand(e)){if(i===rc){t=rc}var s=e.pos;while(e.eatChars([38,38])){if(e.current()!==38&&(i=this.regexp_eatClassSetOperand(e))){if(i!==rc){t=nc}continue}e.raise("Invalid character in character class")}if(s!==e.pos){return t}while(e.eatChars([45,45])){if(this.regexp_eatClassSetOperand(e)){continue}e.raise("Invalid character in character class")}if(s!==e.pos){return t}}else{e.raise("Invalid character in character class")}for(;;){if(this.regexp_eatClassSetRange(e)){continue}i=this.regexp_eatClassSetOperand(e);if(!i){return t}if(i===rc){t=rc}}};tc.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var i=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var s=e.lastIntValue;if(i!==-1&&s!==-1&&i>s){e.raise("Range out of order in character class")}return true}e.pos=t}return false};tc.regexp_eatClassSetOperand=function(e){if(this.regexp_eatClassSetCharacter(e)){return nc}return this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)};tc.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var i=e.eat(94);var s=this.regexp_classContents(e);if(e.eat(93)){if(i&&s===rc){e.raise("Negated character class may contain strings")}return s}e.pos=t}if(e.eat(92)){var n=this.regexp_eatCharacterClassEscape(e);if(n){return n}e.pos=t}return null};tc.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var i=this.regexp_classStringDisjunctionContents(e);if(e.eat(125)){return i}}else{e.raise("Invalid escape")}e.pos=t}return null};tc.regexp_classStringDisjunctionContents=function(e){var t=this.regexp_classString(e);while(e.eat(124)){if(this.regexp_classString(e)===rc){t=rc}}return t};tc.regexp_classString=function(e){var t=0;while(this.regexp_eatClassSetCharacter(e)){t++}return t===1?nc:rc};tc.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)){return true}if(e.eat(98)){e.lastIntValue=8;return true}e.pos=t;return false}var i=e.current();if(i<0||i===e.lookahead()&&isClassSetReservedDoublePunctuatorCharacter(i)){return false}if(isClassSetSyntaxCharacter(i)){return false}e.advance();e.lastIntValue=i;return true};function isClassSetReservedDoublePunctuatorCharacter(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function isClassSetSyntaxCharacter(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}tc.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();if(isClassSetReservedPunctuator(t)){e.lastIntValue=t;e.advance();return true}return false};function isClassSetReservedPunctuator(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}tc.regexp_eatClassControlLetter=function(e){var t=e.current();if(isDecimalDigit(t)||t===95){e.lastIntValue=t%32;e.advance();return true}return false};tc.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2)){return true}if(e.switchU){e.raise("Invalid escape")}e.pos=t}return false};tc.regexp_eatDecimalDigits=function(e){var t=e.pos;var i=0;e.lastIntValue=0;while(isDecimalDigit(i=e.current())){e.lastIntValue=10*e.lastIntValue+(i-48);e.advance()}return e.pos!==t};function isDecimalDigit(e){return e>=48&&e<=57}tc.regexp_eatHexDigits=function(e){var t=e.pos;var i=0;e.lastIntValue=0;while(isHexDigit(i=e.current())){e.lastIntValue=16*e.lastIntValue+hexToInt(i);e.advance()}return e.pos!==t};function isHexDigit(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function hexToInt(e){if(e>=65&&e<=70){return 10+(e-65)}if(e>=97&&e<=102){return 10+(e-97)}return e-48}tc.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var i=e.lastIntValue;if(t<=3&&this.regexp_eatOctalDigit(e)){e.lastIntValue=t*64+i*8+e.lastIntValue}else{e.lastIntValue=t*8+i}}else{e.lastIntValue=t}return true}return false};tc.regexp_eatOctalDigit=function(e){var t=e.current();if(isOctalDigit(t)){e.lastIntValue=t-48;e.advance();return true}e.lastIntValue=0;return false};function isOctalDigit(e){return e>=48&&e<=55}tc.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var s=0;s<t;++s){var n=e.current();if(!isHexDigit(n)){e.pos=i;return false}e.lastIntValue=16*e.lastIntValue+hexToInt(n);e.advance()}return true};var oc=function Token(e){this.type=e.type;this.value=e.value;this.start=e.start;this.end=e.end;if(e.options.locations){this.loc=new Wa(e,e.startLoc,e.endLoc)}if(e.options.ranges){this.range=[e.start,e.end]}};var ac=hl.prototype;ac.next=function(e){if(!e&&this.type.keyword&&this.containsEsc){this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword)}if(this.options.onToken){this.options.onToken(new oc(this))}this.lastTokEnd=this.end;this.lastTokStart=this.start;this.lastTokEndLoc=this.endLoc;this.lastTokStartLoc=this.startLoc;this.nextToken()};ac.getToken=function(){this.next();return new oc(this)};if(typeof Symbol!=="undefined"){ac[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===Ta.eof,value:t}}}}}ac.nextToken=function(){var e=this.curContext();if(!e||!e.preserveSpace){this.skipSpace()}this.start=this.pos;if(this.options.locations){this.startLoc=this.curPosition()}if(this.pos>=this.input.length){return this.finishToken(Ta.eof)}if(e.override){return e.override(this)}else{this.readToken(this.fullCharCodeAtPos())}};ac.readToken=function(e){if(isIdentifierStart(e,this.options.ecmaVersion>=6)||e===92){return this.readWord()}return this.getTokenFromCode(e)};ac.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320){return e}var t=this.input.charCodeAt(this.pos+1);return t<=56319||t>=57344?e:(e<<10)+t-56613888};ac.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition();var t=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(i===-1){this.raise(this.pos-2,"Unterminated comment")}this.pos=i+2;if(this.options.locations){for(var s=void 0,n=t;(s=nextLineBreak(this.input,n,this.pos))>-1;){++this.curLine;n=this.lineStart=s}}if(this.options.onComment){this.options.onComment(true,this.input.slice(t+2,i),t,this.pos,e,this.curPosition())}};ac.skipLineComment=function(e){var t=this.pos;var i=this.options.onComment&&this.curPosition();var s=this.input.charCodeAt(this.pos+=e);while(this.pos<this.input.length&&!isNewLine(s)){s=this.input.charCodeAt(++this.pos)}if(this.options.onComment){this.options.onComment(false,this.input.slice(t+e,this.pos),t,this.pos,i,this.curPosition())}};ac.skipSpace=function(){e:while(this.pos<this.input.length){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:if(this.input.charCodeAt(this.pos+1)===10){++this.pos}case 10:case 8232:case 8233:++this.pos;if(this.options.locations){++this.curLine;this.lineStart=this.pos}break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(e>8&&e<14||e>=5760&&La.test(String.fromCharCode(e))){++this.pos}else{break e}}}};ac.finishToken=function(e,t){this.end=this.pos;if(this.options.locations){this.endLoc=this.curPosition()}var i=this.type;this.type=e;this.value=t;this.updateContext(i)};ac.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57){return this.readNumber(true)}var t=this.input.charCodeAt(this.pos+2);if(this.options.ecmaVersion>=6&&e===46&&t===46){this.pos+=3;return this.finishToken(Ta.ellipsis)}else{++this.pos;return this.finishToken(Ta.dot)}};ac.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);if(this.exprAllowed){++this.pos;return this.readRegexp()}if(e===61){return this.finishOp(Ta.assign,2)}return this.finishOp(Ta.slash,1)};ac.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1);var i=1;var s=e===42?Ta.star:Ta.modulo;if(this.options.ecmaVersion>=7&&e===42&&t===42){++i;s=Ta.starstar;t=this.input.charCodeAt(this.pos+2)}if(t===61){return this.finishOp(Ta.assign,i+1)}return this.finishOp(s,i)};ac.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12){var i=this.input.charCodeAt(this.pos+2);if(i===61){return this.finishOp(Ta.assign,3)}}return this.finishOp(e===124?Ta.logicalOR:Ta.logicalAND,2)}if(t===61){return this.finishOp(Ta.assign,2)}return this.finishOp(e===124?Ta.bitwiseOR:Ta.bitwiseAND,1)};ac.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);if(e===61){return this.finishOp(Ta.assign,2)}return this.finishOp(Ta.bitwiseXOR,1)};ac.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||Da.test(this.input.slice(this.lastTokEnd,this.pos)))){this.skipLineComment(3);this.skipSpace();return this.nextToken()}return this.finishOp(Ta.incDec,2)}if(t===61){return this.finishOp(Ta.assign,2)}return this.finishOp(Ta.plusMin,1)};ac.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1);var i=1;if(t===e){i=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2;if(this.input.charCodeAt(this.pos+i)===61){return this.finishOp(Ta.assign,i+1)}return this.finishOp(Ta.bitShift,i)}if(t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45){this.skipLineComment(4);this.skipSpace();return this.nextToken()}if(t===61){i=2}return this.finishOp(Ta.relational,i)};ac.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===61){return this.finishOp(Ta.equality,this.input.charCodeAt(this.pos+2)===61?3:2)}if(e===61&&t===62&&this.options.ecmaVersion>=6){this.pos+=2;return this.finishToken(Ta.arrow)}return this.finishOp(e===61?Ta.eq:Ta.prefix,1)};ac.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var i=this.input.charCodeAt(this.pos+2);if(i<48||i>57){return this.finishOp(Ta.questionDot,2)}}if(t===63){if(e>=12){var s=this.input.charCodeAt(this.pos+2);if(s===61){return this.finishOp(Ta.assign,3)}}return this.finishOp(Ta.coalesce,2)}}return this.finishOp(Ta.question,1)};ac.readToken_numberSign=function(){var e=this.options.ecmaVersion;var t=35;if(e>=13){++this.pos;t=this.fullCharCodeAtPos();if(isIdentifierStart(t,true)||t===92){return this.finishToken(Ta.privateId,this.readWord1())}}this.raise(this.pos,"Unexpected character '"+codePointToString(t)+"'")};ac.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:++this.pos;return this.finishToken(Ta.parenL);case 41:++this.pos;return this.finishToken(Ta.parenR);case 59:++this.pos;return this.finishToken(Ta.semi);case 44:++this.pos;return this.finishToken(Ta.comma);case 91:++this.pos;return this.finishToken(Ta.bracketL);case 93:++this.pos;return this.finishToken(Ta.bracketR);case 123:++this.pos;return this.finishToken(Ta.braceL);case 125:++this.pos;return this.finishToken(Ta.braceR);case 58:++this.pos;return this.finishToken(Ta.colon);case 96:if(this.options.ecmaVersion<6){break}++this.pos;return this.finishToken(Ta.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88){return this.readRadixNumber(16)}if(this.options.ecmaVersion>=6){if(t===111||t===79){return this.readRadixNumber(8)}if(t===98||t===66){return this.readRadixNumber(2)}}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(false);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(Ta.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+codePointToString(e)+"'")};ac.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);this.pos+=t;return this.finishToken(e,i)};ac.readRegexp=function(){var e,t,i=this.pos;for(;;){if(this.pos>=this.input.length){this.raise(i,"Unterminated regular expression")}var s=this.input.charAt(this.pos);if(Da.test(s)){this.raise(i,"Unterminated regular expression")}if(!e){if(s==="["){t=true}else if(s==="]"&&t){t=false}else if(s==="/"&&!t){break}e=s==="\\"}else{e=false}++this.pos}var n=this.input.slice(i,this.pos);++this.pos;var r=this.pos;var o=this.readWord1();if(this.containsEsc){this.unexpected(r)}var l=this.regexpState||(this.regexpState=new ic(this));l.reset(i,n,o);this.validateRegExpFlags(l);this.validateRegExpPattern(l);var c=null;try{c=new RegExp(n,o)}catch(e){}return this.finishToken(Ta.regexp,{pattern:n,flags:o,value:c})};ac.readInt=function(e,t,i){var s=this.options.ecmaVersion>=12&&t===undefined;var n=i&&this.input.charCodeAt(this.pos)===48;var r=this.pos,o=0,l=0;for(var c=0,u=t==null?Infinity:t;c<u;++c,++this.pos){var h=this.input.charCodeAt(this.pos),d=void 0;if(s&&h===95){if(n){this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals")}if(l===95){this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore")}if(c===0){this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits")}l=h;continue}if(h>=97){d=h-97+10}else if(h>=65){d=h-65+10}else if(h>=48&&h<=57){d=h-48}else{d=Infinity}if(d>=e){break}l=h;o=o*e+d}if(s&&l===95){this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits")}if(this.pos===r||t!=null&&this.pos-r!==t){return null}return o};function stringToNumber(e,t){if(t){return parseInt(e,8)}return parseFloat(e.replace(/_/g,""))}function stringToBigInt(e){if(typeof BigInt!=="function"){return null}return BigInt(e.replace(/_/g,""))}ac.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var i=this.readInt(e);if(i==null){this.raise(this.start+2,"Expected number in radix "+e)}if(this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110){i=stringToBigInt(this.input.slice(t,this.pos));++this.pos}else if(isIdentifierStart(this.fullCharCodeAtPos())){this.raise(this.pos,"Identifier directly after number")}return this.finishToken(Ta.num,i)};ac.readNumber=function(e){var t=this.pos;if(!e&&this.readInt(10,undefined,true)===null){this.raise(t,"Invalid number")}var i=this.pos-t>=2&&this.input.charCodeAt(t)===48;if(i&&this.strict){this.raise(t,"Invalid number")}var s=this.input.charCodeAt(this.pos);if(!i&&!e&&this.options.ecmaVersion>=11&&s===110){var n=stringToBigInt(this.input.slice(t,this.pos));++this.pos;if(isIdentifierStart(this.fullCharCodeAtPos())){this.raise(this.pos,"Identifier directly after number")}return this.finishToken(Ta.num,n)}if(i&&/[89]/.test(this.input.slice(t,this.pos))){i=false}if(s===46&&!i){++this.pos;this.readInt(10);s=this.input.charCodeAt(this.pos)}if((s===69||s===101)&&!i){s=this.input.charCodeAt(++this.pos);if(s===43||s===45){++this.pos}if(this.readInt(10)===null){this.raise(t,"Invalid number")}}if(isIdentifierStart(this.fullCharCodeAtPos())){this.raise(this.pos,"Identifier directly after number")}var r=stringToNumber(this.input.slice(t,this.pos),i);return this.finishToken(Ta.num,r)};ac.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){if(this.options.ecmaVersion<6){this.unexpected()}var i=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos);++this.pos;if(t>1114111){this.invalidStringToken(i,"Code point out of bounds")}}else{t=this.readHexChar(4)}return t};ac.readString=function(e){var t="",i=++this.pos;for(;;){if(this.pos>=this.input.length){this.raise(this.start,"Unterminated string constant")}var s=this.input.charCodeAt(this.pos);if(s===e){break}if(s===92){t+=this.input.slice(i,this.pos);t+=this.readEscapedChar(false);i=this.pos}else if(s===8232||s===8233){if(this.options.ecmaVersion<10){this.raise(this.start,"Unterminated string constant")}++this.pos;if(this.options.locations){this.curLine++;this.lineStart=this.pos}}else{if(isNewLine(s)){this.raise(this.start,"Unterminated string constant")}++this.pos}}t+=this.input.slice(i,this.pos++);return this.finishToken(Ta.string,t)};var lc={};ac.tryReadTemplateToken=function(){this.inTemplateElement=true;try{this.readTmplToken()}catch(e){if(e===lc){this.readInvalidTemplateToken()}else{throw e}}this.inTemplateElement=false};ac.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9){throw lc}else{this.raise(e,t)}};ac.readTmplToken=function(){var e="",t=this.pos;for(;;){if(this.pos>=this.input.length){this.raise(this.start,"Unterminated template")}var i=this.input.charCodeAt(this.pos);if(i===96||i===36&&this.input.charCodeAt(this.pos+1)===123){if(this.pos===this.start&&(this.type===Ta.template||this.type===Ta.invalidTemplate)){if(i===36){this.pos+=2;return this.finishToken(Ta.dollarBraceL)}else{++this.pos;return this.finishToken(Ta.backQuote)}}e+=this.input.slice(t,this.pos);return this.finishToken(Ta.template,e)}if(i===92){e+=this.input.slice(t,this.pos);e+=this.readEscapedChar(true);t=this.pos}else if(isNewLine(i)){e+=this.input.slice(t,this.pos);++this.pos;switch(i){case 13:if(this.input.charCodeAt(this.pos)===10){++this.pos}case 10:e+="\n";break;default:e+=String.fromCharCode(i);break}if(this.options.locations){++this.curLine;this.lineStart=this.pos}t=this.pos}else{++this.pos}}};ac.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++){switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{"){break}case"`":return this.finishToken(Ta.invalidTemplate,this.input.slice(this.start,this.pos))}}this.raise(this.start,"Unterminated template")};ac.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);++this.pos;switch(t){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return codePointToString(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:if(this.input.charCodeAt(this.pos)===10){++this.pos}case 10:if(this.options.locations){this.lineStart=this.pos;++this.curLine}return"";case 56:case 57:if(this.strict){this.invalidStringToken(this.pos-1,"Invalid escape sequence")}if(e){var i=this.pos-1;this.invalidStringToken(i,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var s=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0];var n=parseInt(s,8);if(n>255){s=s.slice(0,-1);n=parseInt(s,8)}this.pos+=s.length-1;t=this.input.charCodeAt(this.pos);if((s!=="0"||t===56||t===57)&&(this.strict||e)){this.invalidStringToken(this.pos-1-s.length,e?"Octal literal in template string":"Octal literal in strict mode")}return String.fromCharCode(n)}if(isNewLine(t)){return""}return String.fromCharCode(t)}};ac.readHexChar=function(e){var t=this.pos;var i=this.readInt(16,e);if(i===null){this.invalidStringToken(t,"Bad character escape sequence")}return i};ac.readWord1=function(){this.containsEsc=false;var e="",t=true,i=this.pos;var s=this.options.ecmaVersion>=6;while(this.pos<this.input.length){var n=this.fullCharCodeAtPos();if(isIdentifierChar(n,s)){this.pos+=n<=65535?1:2}else if(n===92){this.containsEsc=true;e+=this.input.slice(i,this.pos);var r=this.pos;if(this.input.charCodeAt(++this.pos)!==117){this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX")}++this.pos;var o=this.readCodePoint();if(!(t?isIdentifierStart:isIdentifierChar)(o,s)){this.invalidStringToken(r,"Invalid Unicode escape")}e+=codePointToString(o);i=this.pos}else{break}t=false}return e+this.input.slice(i,this.pos)};ac.readWord=function(){var e=this.readWord1();var t=Ta.name;if(this.keywords.test(e)){t=Oa[e]}return this.finishToken(t,e)};var cc="8.10.0";hl.acorn={Parser:hl,version:cc,defaultOptions:qa,Position:Ga,SourceLocation:Wa,getLineInfo:getLineInfo,Node:$l,TokenType:Na,tokTypes:Ta,keywordTypes:Oa,TokContext:wl,tokContexts:Il,isIdentifierChar:isIdentifierChar,isIdentifierStart:isIdentifierStart,Token:oc,isNewLine:isNewLine,lineBreak:Da,lineBreakG:Ma,nonASCIIwhitespace:La};function parse(e,t){return hl.parse(e,t)}function parseExpressionAt(e,t,i){return hl.parseExpressionAt(e,t,i)}function tokenizer(e,t){return hl.tokenizer(e,t)}const uc=Object.defineProperty({__proto__:null,Node:$l,Parser:hl,Position:Ga,SourceLocation:Wa,TokContext:wl,Token:oc,TokenType:Na,defaultOptions:qa,getLineInfo:getLineInfo,isIdentifierChar:isIdentifierChar,isIdentifierStart:isIdentifierStart,isNewLine:isNewLine,keywordTypes:Oa,lineBreak:Da,lineBreakG:Ma,nonASCIIwhitespace:La,parse:parse,parseExpressionAt:parseExpressionAt,tokContexts:Il,tokTypes:Ta,tokenizer:tokenizer,version:cc},Symbol.toStringTag,{value:"Module"});function flru(e){var t,i,s;var n=e||1;function keep(e,r){if(++t>n){s=i;reset(1);++t}i[e]=r}function reset(e){t=0;i=Object.create(null);e||(s=Object.create(null))}reset();return{clear:reset,has:function(e){return i[e]!==void 0||s[e]!==void 0},get:function(e){var t=i[e];if(t!==void 0)return t;if((t=s[e])!==void 0){keep(e,t);return t}},set:function(e,t){if(i[e]!==void 0){i[e]=t}else{keep(e,t)}}}}function resolveIdViaPlugins(e,t,i,s,n,r,o,l){let c=null;let u=null;if(n){c=new Set;for(const i of n){if(e===i.source&&t===i.importer){c.add(i.plugin)}}u=(e,t)=>({...e,resolve:(e,i,{assertions:r,custom:o,isEntry:l,skipSelf:c}=Bt)=>s(e,i,o,l,r||Ft,c?[...n,{importer:i,plugin:t,source:e}]:n)})}return i.hookFirstAndGetPlugin("resolveId",[e,t,{assertions:l,custom:r,isEntry:o}],u,c)}async function resolveId(e,t,i,s,n,o,l,c,u){const h=await resolveIdViaPlugins(e,t,s,n,o,l,c,u);if(h!=null){const[e,t]=h;if(typeof e==="object"&&!e.resolvedBy){return{...e,resolvedBy:t.name}}if(typeof e==="string"){return{id:e,resolvedBy:t.name}}return e}if(t!==undefined&&!isAbsolute(e)&&e[0]!==".")return null;return addJsExtensionIfNecessary(t?r.resolve(r.dirname(t),e):r.resolve(e),i)}async function addJsExtensionIfNecessary(e,t){return await findFile(e,t)??await findFile(e+".mjs",t)??await findFile(e+".js",t)}async function findFile(e,t){try{const i=await u.lstat(e);if(!t&&i.isSymbolicLink())return await findFile(await u.realpath(e),t);if(t&&i.isSymbolicLink()||i.isFile()){const t=r.basename(e);const i=await u.readdir(r.dirname(e));if(i.includes(t))return e}}catch{}}async function transform(e,t,i,s){const n=t.id;const r=[];let o=e.map===null?null:decodedSourcemap(e.map);const l=e.code;let c=e.ast;const u=[];const h=[];let d=false;const useCustomTransformCache=()=>d=true;let p="";let f=e.code;function transformReducer(e,i,n){let o;let l;if(typeof i==="string"){o=i}else if(i&&typeof i==="object"){t.updateOptions(i);if(i.code==null){if(i.map||i.ast){s(v,logNoTransformMapOrAstWithoutCode(n.name))}return e}({code:o,map:l,ast:c}=i)}else{return e}if(l!==null){r.push(decodedSourcemap(typeof l==="string"?JSON.parse(l):l)||{missing:true,plugin:n.name})}f=o;return o}const getLogHandler=e=>(t,i)=>{t=normalizeLog(t);if(i)augmentCodeLocation(t,i,f,n);t.id=n;t.hook="transform";e(t)};let m;try{m=await i.hookReduceArg0("transform",[f,n],transformReducer,((e,t)=>{p=t.name;return{...e,addWatchFile(t){u.push(t);e.addWatchFile(t)},cache:d?e.cache:getTrackedPluginCache(e.cache,useCustomTransformCache),debug:getLogHandler(e.debug),emitFile(e){h.push(e);return i.emitFile(e)},error(t,i){if(typeof t==="string")t={message:t};if(i)augmentCodeLocation(t,i,f,n);t.id=n;t.hook="transform";return e.error(t)},getCombinedSourcemap(){const e=collapseSourcemap(n,l,o,r,s);if(!e){const e=new MagicString(l);return e.generateMap({hires:true,includeContent:true,source:n})}if(o!==e){o=e;r.length=0}return new SourceMap({...e,file:null,sourcesContent:e.sourcesContent})},info:getLogHandler(e.info),setAssetSource(){return this.error(logInvalidSetAssetSourceCall())},warn:getLogHandler(e.warn)}}))}catch(e){return error(logPluginError(e,p,{hook:"transform",id:n}))}if(!d&&h.length>0)t.transformFiles=h;return{ast:c,code:m,customTransformCache:d,originalCode:l,originalSourcemap:o,sourcemapChain:r,transformDependencies:u}}const hc="resolveDependencies";class ModuleLoader{constructor(e,t,i,s){this.graph=e;this.modulesById=t;this.options=i;this.pluginDriver=s;this.implicitEntryModules=new Set;this.indexedEntryModules=[];this.latestLoadModulesPromise=Promise.resolve();this.moduleLoadPromises=new Map;this.modulesWithLoadedDependencies=new Set;this.nextChunkNamePriority=0;this.nextEntryModuleIndex=0;this.resolveId=async(e,t,i,s,n,r=null)=>this.getResolvedIdWithDefaults(this.getNormalizedResolvedIdWithoutDefaults(this.options.external(e,t,false)?false:await resolveId(e,t,this.options.preserveSymlinks,this.pluginDriver,this.resolveId,r,i,typeof s==="boolean"?s:!t,n),t,e),n);this.hasModuleSideEffects=i.treeshake?i.treeshake.moduleSideEffects:()=>true}async addAdditionalModules(e,t){const i=this.extendLoadModulesPromise(Promise.all(e.map((e=>this.loadEntryModule(e,false,undefined,null,t)))));await this.awaitLoadModulesPromise();return i}async addEntryModules(e,t){const i=this.nextEntryModuleIndex;this.nextEntryModuleIndex+=e.length;const s=this.nextChunkNamePriority;this.nextChunkNamePriority+=e.length;const n=await this.extendLoadModulesPromise(Promise.all(e.map((({id:e,importer:t})=>this.loadEntryModule(e,true,t,null)))).then((n=>{for(const[r,o]of n.entries()){o.isUserDefinedEntryPoint=o.isUserDefinedEntryPoint||t;addChunkNamesToModule(o,e[r],t,s+r);const n=this.indexedEntryModules.find((e=>e.module===o));if(n){n.index=Math.min(n.index,i+r)}else{this.indexedEntryModules.push({index:i+r,module:o})}}this.indexedEntryModules.sort((({index:e},{index:t})=>e>t?1:-1));return n})));await this.awaitLoadModulesPromise();return{entryModules:this.indexedEntryModules.map((({module:e})=>e)),implicitEntryModules:[...this.implicitEntryModules],newEntryModules:n}}async emitChunk({fileName:e,id:t,importer:i,name:s,implicitlyLoadedAfterOneOf:n,preserveSignature:r}){const o={fileName:e||null,id:t,importer:i,name:s||null};const l=n?await this.addEntryWithImplicitDependants(o,n):(await this.addEntryModules([o],false)).newEntryModules[0];if(r!=null){l.preserveSignature=r}return l}async preloadModule(e){const t=await this.fetchModule(this.getResolvedIdWithDefaults(e,Ft),undefined,false,e.resolveDependencies?hc:true);return t.info}addEntryWithImplicitDependants(e,t){const i=this.nextChunkNamePriority++;return this.extendLoadModulesPromise(this.loadEntryModule(e.id,false,e.importer,null).then((async s=>{addChunkNamesToModule(s,e,false,i);if(!s.info.isEntry){this.implicitEntryModules.add(s);const i=await Promise.all(t.map((t=>this.loadEntryModule(t,false,e.importer,s.id))));for(const e of i){s.implicitlyLoadedAfter.add(e)}for(const e of s.implicitlyLoadedAfter){e.implicitlyLoadedBefore.add(s)}}return s})))}async addModuleSource(e,t,i){let s;try{s=await this.graph.fileOperationQueue.run((async()=>await this.pluginDriver.hookFirst("load",[e])??await u.readFile(e,"utf8")))}catch(i){let s=`Could not load ${e}`;if(t)s+=` (imported by ${relativeId(t)})`;s+=`: ${i.message}`;i.message=s;throw i}const n=typeof s==="string"?{code:s}:s!=null&&typeof s==="object"&&typeof s.code==="string"?s:error(logBadLoader(e));const r=this.graph.cachedModules.get(e);if(r&&!r.customTransformCache&&r.originalCode===n.code&&!await this.pluginDriver.hookFirst("shouldTransformCachedModule",[{ast:r.ast,code:r.code,id:r.id,meta:r.meta,moduleSideEffects:r.moduleSideEffects,resolvedSources:r.resolvedIds,syntheticNamedExports:r.syntheticNamedExports}])){if(r.transformFiles){for(const e of r.transformFiles)this.pluginDriver.emitFile(e)}i.setSource(r)}else{i.updateOptions(n);i.setSource(await transform(n,i,this.pluginDriver,this.options.onLog))}}async awaitLoadModulesPromise(){let e;do{e=this.latestLoadModulesPromise;await e}while(e!==this.latestLoadModulesPromise)}extendLoadModulesPromise(e){this.latestLoadModulesPromise=Promise.all([e,this.latestLoadModulesPromise]);this.latestLoadModulesPromise.catch((()=>{}));return e}async fetchDynamicDependencies(e,t){const i=await Promise.all(t.map((t=>t.then((async([t,i])=>{if(i===null)return null;if(typeof i==="string"){t.resolution=i;return null}return t.resolution=await this.fetchResolvedDependency(relativeId(i.id),e.id,i)})))));for(const t of i){if(t){e.dynamicDependencies.add(t);t.dynamicImporters.push(e.id)}}}async fetchModule({assertions:e,id:t,meta:i,moduleSideEffects:s,syntheticNamedExports:n},r,o,l){const c=this.modulesById.get(t);if(c instanceof Module){if(r&&doAssertionsDiffer(e,c.info.assertions)){this.options.onLog(v,logInconsistentImportAssertions(c.info.assertions,e,t,r))}await this.handleExistingModule(c,o,l);return c}if(c instanceof ExternalModule){return error(logExternalModulesCannotBeTransformedToModules(c.id))}const u=new Module(this.graph,t,this.options,o,s,n,i,e);this.modulesById.set(t,u);this.graph.watchFiles[t]=true;const h=this.addModuleSource(t,r,u).then((()=>[this.getResolveStaticDependencyPromises(u),this.getResolveDynamicImportPromises(u),d]));const d=waitForDependencyResolution(h).then((()=>this.pluginDriver.hookParallel("moduleParsed",[u.info])));d.catch((()=>{}));this.moduleLoadPromises.set(u,h);const p=await h;if(!l){await this.fetchModuleDependencies(u,...p)}else if(l===hc){await d}return u}async fetchModuleDependencies(e,t,i,s){if(this.modulesWithLoadedDependencies.has(e)){return}this.modulesWithLoadedDependencies.add(e);await Promise.all([this.fetchStaticDependencies(e,t),this.fetchDynamicDependencies(e,i)]);e.linkImports();await s}fetchResolvedDependency(e,t,i){if(i.external){const{assertions:s,external:n,id:r,moduleSideEffects:o,meta:l}=i;let c=this.modulesById.get(r);if(!c){c=new ExternalModule(this.options,r,o,l,n!=="absolute"&&isAbsolute(r),s);this.modulesById.set(r,c)}else if(!(c instanceof ExternalModule)){return error(logInternalIdCannotBeExternal(e,t))}else if(doAssertionsDiffer(c.info.assertions,s)){this.options.onLog(v,logInconsistentImportAssertions(c.info.assertions,s,e,t))}return Promise.resolve(c)}return this.fetchModule(i,t,false,false)}async fetchStaticDependencies(e,t){for(const i of await Promise.all(t.map((t=>t.then((([t,i])=>this.fetchResolvedDependency(t,e.id,i))))))){e.dependencies.add(i);i.importers.push(e.id)}if(!this.options.treeshake||e.info.moduleSideEffects==="no-treeshake"){for(const t of e.dependencies){if(t instanceof Module){t.importedFromNotTreeshaken=true}}}}getNormalizedResolvedIdWithoutDefaults(e,t,i){const{makeAbsoluteExternalsRelative:s}=this.options;if(e){if(typeof e==="object"){const n=e.external||this.options.external(e.id,t,true);return{...e,external:n&&(n==="relative"||!isAbsolute(e.id)||n===true&&isNotAbsoluteExternal(e.id,i,s)||"absolute")}}const n=this.options.external(e,t,true);return{external:n&&(isNotAbsoluteExternal(e,i,s)||"absolute"),id:n&&s?normalizeRelativeExternalId(e,t):e}}const n=s?normalizeRelativeExternalId(i,t):i;if(e!==false&&!this.options.external(n,t,true)){return null}return{external:isNotAbsoluteExternal(n,i,s)||"absolute",id:n}}getResolveDynamicImportPromises(e){return e.dynamicImports.map((async t=>{const i=await this.resolveDynamicImport(e,typeof t.argument==="string"?t.argument:t.argument.esTreeNode,e.id,getAssertionsFromImportExpression(t.node));if(i&&typeof i==="object"){t.id=i.id}return[t,i]}))}getResolveStaticDependencyPromises(e){return Array.from(e.sourcesWithAssertions,(async([t,i])=>[t,e.resolvedIds[t]=e.resolvedIds[t]||this.handleInvalidResolvedId(await this.resolveId(t,e.id,Ft,false,i),t,e.id,i)]))}getResolvedIdWithDefaults(e,t){if(!e){return null}const i=e.external||false;return{assertions:e.assertions||t,external:i,id:e.id,meta:e.meta||{},moduleSideEffects:e.moduleSideEffects??this.hasModuleSideEffects(e.id,!!i),resolvedBy:e.resolvedBy??"rollup",syntheticNamedExports:e.syntheticNamedExports??false}}async handleExistingModule(e,t,i){const s=this.moduleLoadPromises.get(e);if(i){return i===hc?waitForDependencyResolution(s):s}if(t){e.info.isEntry=true;this.implicitEntryModules.delete(e);for(const t of e.implicitlyLoadedAfter){t.implicitlyLoadedBefore.delete(e)}e.implicitlyLoadedAfter.clear()}return this.fetchModuleDependencies(e,...await s)}handleInvalidResolvedId(e,t,i,s){if(e===null){if(isRelative(t)){return error(logUnresolvedImport(t,i))}this.options.onLog(v,logUnresolvedImportTreatedAsExternal(t,i));return{assertions:s,external:true,id:t,meta:{},moduleSideEffects:this.hasModuleSideEffects(t,true),resolvedBy:"rollup",syntheticNamedExports:false}}else if(e.external&&e.syntheticNamedExports){this.options.onLog(v,logExternalSyntheticExports(t,i))}return e}async loadEntryModule(e,t,i,s,n=false){const r=await resolveId(e,i,this.options.preserveSymlinks,this.pluginDriver,this.resolveId,null,Ft,true,Ft);if(r==null){return error(s===null?logUnresolvedEntry(e):logUnresolvedImplicitDependant(e,s))}const o=typeof r==="object"&&r.external;if(r===false||o){return error(s===null?o&&n?logExternalModulesCannotBeIncludedInManualChunks(e):logEntryCannotBeExternal(e):logImplicitDependantCannotBeExternal(e,s))}return this.fetchModule(this.getResolvedIdWithDefaults(typeof r==="object"?r:{id:r},Ft),undefined,t,false)}async resolveDynamicImport(e,t,i,s){const n=await this.pluginDriver.hookFirst("resolveDynamicImport",[t,i,{assertions:s}]);if(typeof t!=="string"){if(typeof n==="string"){return n}if(!n){return null}return this.getResolvedIdWithDefaults(n,s)}if(n==null){const n=e.resolvedIds[t];if(n){if(doAssertionsDiffer(n.assertions,s)){this.options.onLog(v,logInconsistentImportAssertions(n.assertions,s,t,i))}return n}return e.resolvedIds[t]=this.handleInvalidResolvedId(await this.resolveId(t,e.id,Ft,false,s),t,e.id,s)}return this.handleInvalidResolvedId(this.getResolvedIdWithDefaults(this.getNormalizedResolvedIdWithoutDefaults(n,i,t),s),t,i,s)}}function normalizeRelativeExternalId(e,t){return isRelative(e)?t?r.resolve(t,"..",e):r.resolve(e):e}function addChunkNamesToModule(e,{fileName:t,name:i},s,n){if(t!==null){e.chunkFileNames.add(t)}else if(i!==null){let t=0;while(e.chunkNames[t]?.priority<n)t++;e.chunkNames.splice(t,0,{isUserDefined:s,name:i,priority:n})}}function isNotAbsoluteExternal(e,t,i){return i===true||i==="ifRelativeSource"&&isRelative(t)||!isAbsolute(e)}async function waitForDependencyResolution(e){const[t,i]=await e;return Promise.all([...t,...i])}class GlobalScope extends po{constructor(){super();this.parent=null;this.variables.set("undefined",new UndefinedVariable)}findVariable(e){let t=this.variables.get(e);if(!t){t=new GlobalVariable(e);this.variables.set(e,t)}return t}}class Queue{constructor(e){this.maxParallel=e;this.queue=[];this.workerCount=0}run(e){return new Promise(((t,i)=>{this.queue.push({reject:i,resolve:t,task:e});this.work()}))}async work(){if(this.workerCount>=this.maxParallel)return;this.workerCount++;let e;while(e=this.queue.shift()){const{reject:t,resolve:i,task:s}=e;try{const e=await s();i(e)}catch(e){t(e)}}this.workerCount--}}function normalizeEntryModules(e){if(Array.isArray(e)){return e.map((e=>({fileName:null,id:e,implicitlyLoadedAfter:[],importer:undefined,name:null})))}return Object.entries(e).map((([e,t])=>({fileName:null,id:t,implicitlyLoadedAfter:[],importer:undefined,name:e})))}class Graph{constructor(e,t){this.options=e;this.astLru=flru(5);this.cachedModules=new Map;this.deoptimizationTracker=new PathTracker;this.entryModules=[];this.modulesById=new Map;this.needsTreeshakingPass=false;this.phase=p.LOAD_AND_PARSE;this.scope=new GlobalScope;this.watchFiles=Object.create(null);this.watchMode=false;this.externalModules=[];this.implicitEntryModules=[];this.modules=[];this.getModuleInfo=e=>{const t=this.modulesById.get(e);if(!t)return null;return t.info};if(e.cache!==false){if(e.cache?.modules){for(const t of e.cache.modules)this.cachedModules.set(t.id,t)}this.pluginCache=e.cache?.plugins||Object.create(null);for(const e in this.pluginCache){const t=this.pluginCache[e];for(const e of Object.values(t))e[0]++}}if(t){this.watchMode=true;const handleChange=(...e)=>this.pluginDriver.hookParallel("watchChange",e);const handleClose=()=>this.pluginDriver.hookParallel("closeWatcher",[]);t.onCurrentRun("change",handleChange);t.onCurrentRun("close",handleClose)}this.pluginDriver=new PluginDriver(this,e,e.plugins,this.pluginCache);this.acornParser=hl.extend(...e.acornInjectPlugins);this.moduleLoader=new ModuleLoader(this,this.modulesById,this.options,this.pluginDriver);this.fileOperationQueue=new Queue(e.maxParallelFileOps);this.pureFunctions=getPureFunctions(e)}async build(){aa("generate module graph",2);await this.generateModuleGraph();la("generate module graph",2);aa("sort and bind modules",2);this.phase=p.ANALYSE;this.sortModules();la("sort and bind modules",2);aa("mark included statements",2);this.includeStatements();la("mark included statements",2);this.phase=p.GENERATE}contextParse(e,t={}){const i=t.onComment;const s=[];t.onComment=i&&typeof i=="function"?(e,n,r,o,...l)=>{s.push({end:o,start:r,type:e?"Block":"Line",value:n});return i.call(t,e,n,r,o,...l)}:s;const n=this.acornParser.parse(e,{...this.options.acorn,...t});if(typeof i=="object"){i.push(...s)}t.onComment=i;addAnnotations(s,n,e);return n}getCache(){for(const e in this.pluginCache){const t=this.pluginCache[e];let i=true;for(const[e,s]of Object.entries(t)){if(s[0]>=this.options.experimentalCacheExpiry)delete t[e];else i=false}if(i)delete this.pluginCache[e]}return{modules:this.modules.map((e=>e.toJSON())),plugins:this.pluginCache}}async generateModuleGraph(){({entryModules:this.entryModules,implicitEntryModules:this.implicitEntryModules}=await this.moduleLoader.addEntryModules(normalizeEntryModules(this.options.input),true));if(this.entryModules.length===0){throw new Error("You must supply options.input to rollup")}for(const e of this.modulesById.values()){if(e instanceof Module){this.modules.push(e)}else{this.externalModules.push(e)}}}includeStatements(){const e=[...this.entryModules,...this.implicitEntryModules];for(const t of e){markModuleAndImpureDependenciesAsExecuted(t)}if(this.options.treeshake){let t=1;do{aa(`treeshaking pass ${t}`,3);this.needsTreeshakingPass=false;for(const e of this.modules){if(e.isExecuted){if(e.info.moduleSideEffects==="no-treeshake"){e.includeAllInBundle()}else{e.include()}}}if(t===1){for(const t of e){if(t.preserveSignature!==false){t.includeAllExports(false);this.needsTreeshakingPass=true}}}la(`treeshaking pass ${t++}`,3)}while(this.needsTreeshakingPass)}else{for(const e of this.modules)e.includeAllInBundle()}for(const e of this.externalModules)e.warnUnusedImports();for(const e of this.implicitEntryModules){for(const t of e.implicitlyLoadedAfter){if(!(t.info.isEntry||t.isIncluded())){error(logImplicitDependantIsNotIncluded(t))}}}}sortModules(){const{orderedModules:e,cyclePaths:t}=analyseModuleExecution(this.entryModules);for(const e of t){this.options.onLog(v,logCircularDependency(e))}this.modules=e;for(const e of this.modules){e.bindReferences()}this.warnForMissingExports()}warnForMissingExports(){for(const e of this.modules){for(const t of e.importDescriptions.values()){if(t.name!=="*"&&!t.module.getVariableForExportName(t.name)[0]){e.log(v,logMissingExport(t.name,e.id,t.module.id),t.start)}}}}}function formatAction([e,t,i]){const s=`(${e}) ${t}`;const n=JSON.stringify;switch(t){case"resolveId":{return`${s} ${n(i[0])} ${n(i[1])}`}case"load":{return`${s} ${n(i[0])}`}case"transform":{return`${s} ${n(i[1])}`}case"shouldTransformCachedModule":{return`${s} ${n(i[0].id)}`}case"moduleParsed":{return`${s} ${n(i[0].id)}`}}return s}let dc=null;const pc=new Map;async function catchUnfinishedHookActions(e,t){const i=new Promise(((t,i)=>{pc.set(e,i);if(!dc){dc=()=>{for(const[e,t]of pc){const i=e.getUnfulfilledHookActions();t(new Error(`Unexpected early exit. This happens when Promises returned by plugins cannot resolve. Unfinished hook action(s) on exit:\n`+[...i].map(formatAction).join("\n")))}};s.once("beforeExit",dc)}}));try{return await Promise.race([t(),i])}finally{pc.delete(e);if(pc.size===0){s.off("beforeExit",dc);dc=null}}}const fc="{".charCodeAt(0);const mc=" ".charCodeAt(0);const gc="assert";const yc=1,Ec=4;function importAssertions(e){const t=e.acorn||uc;const{tokTypes:i,TokenType:s}=t;return class extends e{constructor(...e){super(...e);this.assertToken=new s(gc)}_codeAt(e){return this.input.charCodeAt(e)}_eat(e){if(this.type!==e){this.unexpected()}this.next()}readToken(e){let t=0;for(;t<gc.length;t++){if(this._codeAt(this.pos+t)!==gc.charCodeAt(t)){return super.readToken(e)}}for(;;t++){if(this._codeAt(this.pos+t)===fc){break}else if(this._codeAt(this.pos+t)===mc){continue}else{return super.readToken(e)}}if(this.type.label==="{"){return super.readToken(e)}this.pos+=gc.length;return this.finishToken(this.assertToken)}parseDynamicImport(e){this.next();e.source=this.parseMaybeAssign();if(this.eat(i.comma)){const t=this.parseObj(false);e.arguments=[t]}this._eat(i.parenR);return this.finishNode(e,"ImportExpression")}parseExport(e,t){this.next();if(this.eat(i.star)){if(this.options.ecmaVersion>=11){if(this.eatContextual("as")){e.exported=this.parseIdent(true);this.checkExport(t,e.exported.name,this.lastTokStart)}else{e.exported=null}}this.expectContextual("from");if(this.type!==i.string){this.unexpected()}e.source=this.parseExprAtom();if(this.type===this.assertToken||this.type===i._with){this.next();const t=this.parseImportAssertions();if(t){e.assertions=t}}this.semicolon();return this.finishNode(e,"ExportAllDeclaration")}if(this.eat(i._default)){this.checkExport(t,"default",this.lastTokStart);var s;if(this.type===i._function||(s=this.isAsyncFunction())){var n=this.startNode();this.next();if(s){this.next()}e.declaration=this.parseFunction(n,yc|Ec,false,s)}else if(this.type===i._class){var r=this.startNode();e.declaration=this.parseClass(r,"nullableID")}else{e.declaration=this.parseMaybeAssign();this.semicolon()}return this.finishNode(e,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement()){e.declaration=this.parseStatement(null);if(e.declaration.type==="VariableDeclaration"){this.checkVariableExport(t,e.declaration.declarations)}else{this.checkExport(t,e.declaration.id.name,e.declaration.id.start)}e.specifiers=[];e.source=null}else{e.declaration=null;e.specifiers=this.parseExportSpecifiers(t);if(this.eatContextual("from")){if(this.type!==i.string){this.unexpected()}e.source=this.parseExprAtom();if(this.type===this.assertToken||this.type===i._with){this.next();const t=this.parseImportAssertions();if(t){e.assertions=t}}}else{for(var o=0,l=e.specifiers;o<l.length;o+=1){var c=l[o];this.checkUnreserved(c.local);this.checkLocalExport(c.local)}e.source=null}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")}parseImport(e){this.next();if(this.type===i.string){e.specifiers=[];e.source=this.parseExprAtom()}else{e.specifiers=this.parseImportSpecifiers();this.expectContextual("from");e.source=this.type===i.string?this.parseExprAtom():this.unexpected()}if(this.type===this.assertToken||this.type==i._with){this.next();const t=this.parseImportAssertions();if(t){e.assertions=t}}this.semicolon();return this.finishNode(e,"ImportDeclaration")}parseImportAssertions(){this._eat(i.braceL);const e=this.parseAssertEntries();this._eat(i.braceR);return e}parseAssertEntries(){const e=[];const t=new Set;do{if(this.type===i.braceR){break}const s=this.startNode();let n;if(this.type===i.string){n=this.parseLiteral(this.value)}else{n=this.parseIdent(true)}this.next();s.key=n;if(t.has(s.key.name)){this.raise(this.pos,"Duplicated key in assertions")}t.add(s.key.name);if(this.type!==i.string){this.raise(this.pos,"Only string is supported as an assertion value")}s.value=this.parseLiteral(this.value);e.push(this.finishNode(s,"ImportAttribute"))}while(this.eat(i.comma));return e}}}async function normalizeInputOptions(e,t){const i=new Set;const s=e.context??"undefined";const n=await normalizePluginOption(e.plugins);const r=e.logLevel||S;const o=getLogger(n,getOnLog(e,r),t,r);const l=e.strictDeprecations||false;const c=getMaxParallelFileOps(e,o,l);const u={acorn:getAcorn(e),acornInjectPlugins:getAcornInjectPlugins(e),cache:getCache(e),context:s,experimentalCacheExpiry:e.experimentalCacheExpiry??10,experimentalLogSideEffects:e.experimentalLogSideEffects||false,external:getIdMatcher(e.external),inlineDynamicImports:getInlineDynamicImports$1(e,o,l),input:getInput(e),logLevel:r,makeAbsoluteExternalsRelative:e.makeAbsoluteExternalsRelative??"ifRelativeSource",manualChunks:getManualChunks$1(e,o,l),maxParallelFileOps:c,maxParallelFileReads:c,moduleContext:getModuleContext(e,s),onLog:o,onwarn:e=>o(v,e),perf:e.perf||false,plugins:n,preserveEntrySignatures:e.preserveEntrySignatures??"exports-only",preserveModules:getPreserveModules$1(e,o,l),preserveSymlinks:e.preserveSymlinks||false,shimMissingExports:e.shimMissingExports||false,strictDeprecations:l,treeshake:getTreeshake(e)};warnUnknownOptions(e,[...Object.keys(u),"watch"],"input options",o,/^(output)$/);return{options:u,unsetOptions:i}}const getAcorn=e=>({ecmaVersion:"latest",sourceType:"module",...e.acorn});const getAcornInjectPlugins=e=>[importAssertions,...ensureArray$1(e.acornInjectPlugins)];const getCache=e=>e.cache===true?undefined:e.cache?.cache||e.cache;const getIdMatcher=e=>{if(e===true){return()=>true}if(typeof e==="function"){return(t,...i)=>!t.startsWith("\0")&&e(t,...i)||false}if(e){const t=new Set;const i=[];for(const s of ensureArray$1(e)){if(s instanceof RegExp){i.push(s)}else{t.add(s)}}return(e,...s)=>t.has(e)||i.some((t=>t.test(e)))}return()=>false};const getInlineDynamicImports$1=(e,t,i)=>{const s=e.inlineDynamicImports;if(s){warnDeprecationWithOptions('The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.',K,true,t,i)}return s};const getInput=e=>{const t=e.input;return t==null?[]:typeof t==="string"?[t]:t};const getManualChunks$1=(e,t,i)=>{const s=e.manualChunks;if(s){warnDeprecationWithOptions('The "manualChunks" option is deprecated. Use the "output.manualChunks" option instead.',Q,true,t,i)}return s};const getMaxParallelFileOps=(e,t,i)=>{const s=e.maxParallelFileReads;if(typeof s==="number"){warnDeprecationWithOptions('The "maxParallelFileReads" option is deprecated. Use the "maxParallelFileOps" option instead.',D,true,t,i)}const n=e.maxParallelFileOps??s;if(typeof n==="number"){if(n<=0)return Infinity;return n}return 20};const getModuleContext=(e,t)=>{const i=e.moduleContext;if(typeof i==="function"){return e=>i(e)??t}if(i){const e=Object.create(null);for(const[t,s]of Object.entries(i)){e[r.resolve(t)]=s}return i=>e[i]??t}return()=>t};const getPreserveModules$1=(e,t,i)=>{const s=e.preserveModules;if(s){warnDeprecationWithOptions('The "preserveModules" option is deprecated. Use the "output.preserveModules" option instead.',Z,true,t,i)}return s};const getTreeshake=e=>{const t=e.treeshake;if(t===false){return false}const i=getOptionWithPreset(e.treeshake,jt,"treeshake",ie,"false, true, ");return{annotations:i.annotations!==false,correctVarValueBeforeDeclaration:i.correctVarValueBeforeDeclaration===true,manualPureFunctions:i.manualPureFunctions??Vt,moduleSideEffects:getHasModuleSideEffects(i.moduleSideEffects),propertyReadSideEffects:i.propertyReadSideEffects==="always"?"always":i.propertyReadSideEffects!==false,tryCatchDeoptimization:i.tryCatchDeoptimization!==false,unknownGlobalSideEffects:i.unknownGlobalSideEffects!==false}};const getHasModuleSideEffects=e=>{if(typeof e==="boolean"){return()=>e}if(e==="no-external"){return(e,t)=>!t}if(typeof e==="function"){return(t,i)=>t.startsWith("\0")?true:e(t,i)!==false}if(Array.isArray(e)){const t=new Set(e);return e=>t.has(e)}if(e){error(logInvalidOption("treeshake.moduleSideEffects",se,'please use one of false, "no-external", a function or an array'))}return()=>true};const xc=/[\u0000-\u001F"#$&*+,:;<=>?[\]^`{|}\u007F]/g;const bc=/^[a-z]:/i;function sanitizeFileName(e){const t=bc.exec(e);const i=t?t[0]:"";return i+e.slice(i.length).replace(xc,"_")}async function normalizeOutputOptions(e,t,i){const s=new Set(i);const n=e.compact||false;const r=getFormat(e);const o=getInlineDynamicImports(e,t);const l=getPreserveModules(e,o,t);const c=getFile(e,l,t);const u=getPreferConst(e,t);const h=getGeneratedCode(e,u);const d={amd:getAmd(e),assetFileNames:e.assetFileNames??"assets/[name]-[hash][extname]",banner:getAddon(e,"banner"),chunkFileNames:e.chunkFileNames??"[name]-[hash].js",compact:n,dir:getDir(e,c),dynamicImportFunction:getDynamicImportFunction(e,t,r),dynamicImportInCjs:e.dynamicImportInCjs??true,entryFileNames:getEntryFileNames(e,s),esModule:e.esModule??"if-default-prop",experimentalDeepDynamicChunkOptimization:getExperimentalDeepDynamicChunkOptimization(e,t),experimentalMinChunkSize:e.experimentalMinChunkSize??1,exports:getExports(e,s),extend:e.extend||false,externalImportAssertions:e.externalImportAssertions??true,externalLiveBindings:e.externalLiveBindings??true,file:c,footer:getAddon(e,"footer"),format:r,freeze:e.freeze??true,generatedCode:h,globals:e.globals||{},hoistTransitiveImports:e.hoistTransitiveImports??true,indent:getIndent(e,n),inlineDynamicImports:o,interop:getInterop(e),intro:getAddon(e,"intro"),manualChunks:getManualChunks(e,o,l,t),minifyInternalExports:getMinifyInternalExports(e,r,n),name:e.name,namespaceToStringTag:getNamespaceToStringTag(e,h,t),noConflict:e.noConflict||false,outro:getAddon(e,"outro"),paths:e.paths||{},plugins:await normalizePluginOption(e.plugins),preferConst:u,preserveModules:l,preserveModulesRoot:getPreserveModulesRoot(e),sanitizeFileName:typeof e.sanitizeFileName==="function"?e.sanitizeFileName:e.sanitizeFileName===false?e=>e:sanitizeFileName,sourcemap:e.sourcemap||false,sourcemapBaseUrl:getSourcemapBaseUrl(e),sourcemapExcludeSources:e.sourcemapExcludeSources||false,sourcemapFile:e.sourcemapFile,sourcemapFileNames:getSourcemapFileNames(e,s),sourcemapIgnoreList:typeof e.sourcemapIgnoreList==="function"?e.sourcemapIgnoreList:e.sourcemapIgnoreList===false?()=>false:e=>e.includes("node_modules"),sourcemapPathTransform:e.sourcemapPathTransform,strict:e.strict??true,systemNullSetters:e.systemNullSetters??true,validate:e.validate||false};warnUnknownOptions(e,Object.keys(d),"output options",t.onLog);return{options:d,unsetOptions:s}}const getFile=(e,t,i)=>{const{file:s}=e;if(typeof s==="string"){if(t){return error(logInvalidOption("output.file",B,'you must set "output.dir" instead of "output.file" when using the "output.preserveModules" option'))}if(!Array.isArray(i.input))return error(logInvalidOption("output.file",B,'you must set "output.dir" instead of "output.file" when providing named inputs'))}return s};const getFormat=e=>{const t=e.format;switch(t){case undefined:case"es":case"esm":case"module":{return"es"}case"cjs":case"commonjs":{return"cjs"}case"system":case"systemjs":{return"system"}case"amd":case"iife":case"umd":{return t}default:{return error(logInvalidOption("output.format",j,`Valid values are "amd", "cjs", "system", "es", "iife" or "umd"`,t))}}};const getInlineDynamicImports=(e,t)=>{const i=(e.inlineDynamicImports??t.inlineDynamicImports)||false;const{input:s}=t;if(i&&(Array.isArray(s)?s:Object.keys(s)).length>1){return error(logInvalidOption("output.inlineDynamicImports",K,'multiple inputs are not supported when "output.inlineDynamicImports" is true'))}return i};const getPreserveModules=(e,t,i)=>{const s=(e.preserveModules??i.preserveModules)||false;if(s){if(t){return error(logInvalidOption("output.inlineDynamicImports",K,`this option is not supported for "output.preserveModules"`))}if(i.preserveEntrySignatures===false){return error(logInvalidOption("preserveEntrySignatures",te,'setting this option to false is not supported for "output.preserveModules"'))}}return s};const getPreferConst=(e,t)=>{const i=e.preferConst;if(i!=null){warnDeprecation(`The "output.preferConst" option is deprecated. Use the "output.generatedCode.constBindings" option instead.`,G,true,t)}return!!i};const getPreserveModulesRoot=e=>{const{preserveModulesRoot:t}=e;if(t===null||t===undefined){return undefined}return r.resolve(t)};const getAmd=e=>{const t={autoId:false,basePath:"",define:"define",forceJsExtensionForImports:false,...e.amd};if((t.autoId||t.basePath)&&t.id){return error(logInvalidOption("output.amd.id",M,'this option cannot be used together with "output.amd.autoId"/"output.amd.basePath"'))}if(t.basePath&&!t.autoId){return error(logInvalidOption("output.amd.basePath",L,'this option only works with "output.amd.autoId"'))}return t.autoId?{autoId:true,basePath:t.basePath,define:t.define,forceJsExtensionForImports:t.forceJsExtensionForImports}:{autoId:false,define:t.define,forceJsExtensionForImports:t.forceJsExtensionForImports,id:t.id}};const getAddon=(e,t)=>{const i=e[t];if(typeof i==="function"){return i}return()=>i||""};const getDir=(e,t)=>{const{dir:i}=e;if(typeof i==="string"&&typeof t==="string"){return error(logInvalidOption("output.dir",B,'you must set either "output.file" for a single-file build or "output.dir" when generating multiple chunks'))}return i};const getDynamicImportFunction=(e,t,i)=>{const s=e.dynamicImportFunction;if(s){warnDeprecation(`The "output.dynamicImportFunction" option is deprecated. Use the "renderDynamicImport" plugin hook instead.`,ae,true,t);if(i!=="es"){t.onLog(v,logInvalidOption("output.dynamicImportFunction",F,'this option is ignored for formats other than "es"'))}}return s};const getEntryFileNames=(e,t)=>{const i=e.entryFileNames;if(i==null){t.add("entryFileNames")}return i??"[name].js"};function getExperimentalDeepDynamicChunkOptimization(e,t){const i=e.experimentalDeepDynamicChunkOptimization;if(i!=null){warnDeprecation(`The "output.experimentalDeepDynamicChunkOptimization" option is deprecated as Rollup always runs the full chunking algorithm now. The option should be removed.`,H,true,t)}return i||false}function getExports(e,t){const i=e.exports;if(i==null){t.add("exports")}else if(!["default","named","none","auto"].includes(i)){return error(logInvalidExportOptionValue(i))}return i||"auto"}const getGeneratedCode=(e,t)=>{const i=getOptionWithPreset(e.generatedCode,Ut,"output.generatedCode",U,"");return{arrowFunctions:i.arrowFunctions===true,constBindings:i.constBindings===true||t,objectShorthand:i.objectShorthand===true,reservedNamesAsProps:i.reservedNamesAsProps!==false,symbols:i.symbols===true}};const getIndent=(e,t)=>{if(t){return""}const i=e.indent;return i===false?"":i??true};const vc=new Set(["compat","auto","esModule","default","defaultOnly"]);const getInterop=e=>{const t=e.interop;if(typeof t==="function"){const e=Object.create(null);let i=null;return s=>s===null?i||validateInterop(i=t(s)):s in e?e[s]:validateInterop(e[s]=t(s))}return t===undefined?()=>"default":()=>validateInterop(t)};const validateInterop=e=>{if(!vc.has(e)){return error(logInvalidOption("output.interop",Y,`use one of ${Array.from(vc,(e=>JSON.stringify(e))).join(", ")}`,e))}return e};const getManualChunks=(e,t,i,s)=>{const n=e.manualChunks||s.manualChunks;if(n){if(t){return error(logInvalidOption("output.manualChunks",Q,'this option is not supported for "output.inlineDynamicImports"'))}if(i){return error(logInvalidOption("output.manualChunks",Q,'this option is not supported for "output.preserveModules"'))}}return n||{}};const getMinifyInternalExports=(e,t,i)=>e.minifyInternalExports??(i||t==="es"||t==="system");const getNamespaceToStringTag=(e,t,i)=>{const s=e.namespaceToStringTag;if(s!=null){warnDeprecation(`The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.`,W,true,i);return s}return t.symbols||false};const getSourcemapFileNames=(e,t)=>{const i=e.sourcemapFileNames;if(i==null){t.add("sourcemapFileNames")}return i};const getSourcemapBaseUrl=e=>{const{sourcemapBaseUrl:t}=e;if(t){if(isValidUrl(t)){return addTrailingSlashIfMissed(t)}return error(logInvalidOption("output.sourcemapBaseUrl",J,`must be a valid URL, received ${JSON.stringify(t)}`))}};function rollup(e){return rollupInternal(e,null)}async function rollupInternal(e,t){const{options:i,unsetOptions:s}=await getInputOptions(e,t!==null);initialiseTimers(i);const n=new Graph(i,t);const r=e.cache!==false;if(e.cache){i.cache=undefined;e.cache=undefined}aa("BUILD",1);await catchUnfinishedHookActions(n.pluginDriver,(async()=>{try{aa("initialize",2);await n.pluginDriver.hookParallel("buildStart",[i]);la("initialize",2);await n.build()}catch(e){const t=Object.keys(n.watchFiles);if(t.length>0){e.watchFiles=t}await n.pluginDriver.hookParallel("buildEnd",[e]);await n.pluginDriver.hookParallel("closeBundle",[]);throw e}await n.pluginDriver.hookParallel("buildEnd",[])}));la("BUILD",1);const o={cache:r?n.getCache():undefined,async close(){if(o.closed)return;o.closed=true;await n.pluginDriver.hookParallel("closeBundle",[])},closed:false,async generate(e){if(o.closed)return error(logAlreadyClosed());return handleGenerateWrite(false,i,s,e,n)},watchFiles:Object.keys(n.watchFiles),async write(e){if(o.closed)return error(logAlreadyClosed());return handleGenerateWrite(true,i,s,e,n)}};if(i.perf)o.getTimings=getTimings;return o}async function getInputOptions(e,t){if(!e){throw new Error("You must supply an options object to rollup")}const i=await getProcessedInputOptions(e,t);const{options:s,unsetOptions:n}=await normalizeInputOptions(i,t);normalizePlugins(s.plugins,Dt);return{options:s,unsetOptions:n}}async function getProcessedInputOptions(e,t){const i=getSortedValidatedPlugins("options",await normalizePluginOption(e.plugins));const s=e.logLevel||S;const n=getLogger(i,getOnLog(e,s),t,s);for(const r of i){const{name:i,options:o}=r;const l="handler"in o?o.handler:o;const c=await l.call({debug:getLogHandler(A,"PLUGIN_LOG",n,i,s),error:e=>error(logPluginError(normalizeLog(e),i,{hook:"onLog"})),info:getLogHandler(S,"PLUGIN_LOG",n,i,s),meta:{rollupVersion:d,watchMode:t},warn:getLogHandler(v,"PLUGIN_WARNING",n,i,s)},e);if(c){e=c}}return e}function normalizePlugins(e,t){for(const[i,s]of e.entries()){if(!s.name){s.name=`${t}${i+1}`}}}async function handleGenerateWrite(e,t,i,s,n){const{options:r,outputPluginDriver:o,unsetOptions:l}=await getOutputOptionsAndPluginDriver(s,n.pluginDriver,t,i);return catchUnfinishedHookActions(o,(async()=>{const i=new Bundle(r,l,t,o,n);const s=await i.generate(e);if(e){aa("WRITE",1);if(!r.dir&&!r.file){return error(logMissingFileOrDirOption())}await Promise.all(Object.values(s).map((e=>n.fileOperationQueue.run((()=>writeOutputFile(e,r))))));await o.hookParallel("writeBundle",[r,s]);la("WRITE",1)}return createOutput(s)}))}async function getOutputOptionsAndPluginDriver(e,t,i,s){if(!e){throw new Error("You must supply an options object")}const n=await normalizePluginOption(e.plugins);normalizePlugins(n,Mt);const r=t.createOutputPluginDriver(n);return{...await getOutputOptions(i,s,e,r),outputPluginDriver:r}}function getOutputOptions(e,t,i,s){return normalizeOutputOptions(s.hookReduceArg0Sync("outputOptions",[i],((e,t)=>t||e),(e=>{const emitError=()=>e.error(logCannotEmitFromOptionsHook());return{...e,emitFile:emitError,setAssetSource:emitError}})),e,t)}function createOutput(e){return{output:Object.values(e).filter((e=>Object.keys(e).length>0)).sort(((e,t)=>getSortingFileType(e)-getSortingFileType(t)))}}var Sc;(function(e){e[e["ENTRY_CHUNK"]=0]="ENTRY_CHUNK";e[e["SECONDARY_CHUNK"]=1]="SECONDARY_CHUNK";e[e["ASSET"]=2]="ASSET"})(Sc||(Sc={}));function getSortingFileType(e){if(e.type==="asset"){return Sc.ASSET}if(e.isEntry){return Sc.ENTRY_CHUNK}return Sc.SECONDARY_CHUNK}async function writeOutputFile(e,t){const i=r.resolve(t.dir||r.dirname(t.file),e.fileName);await u.mkdir(r.dirname(i),{recursive:true});return u.writeFile(i,e.type==="asset"?e.source:e.code)}function defineConfig(e){return e}t.LOGLEVEL_DEBUG=A;t.LOGLEVEL_WARN=v;t.URL_AVOIDING_EVAL=N;t.URL_NAME_IS_NOT_EXPORTED=R;t.URL_OUTPUT_EXPORTS=V;t.URL_OUTPUT_GLOBALS=q;t.URL_SOURCEMAP_IS_LIKELY_TO_BE_INCORRECT=T;t.URL_THIS_IS_UNDEFINED=$;t.URL_TREATING_MODULE_AS_EXTERNAL_DEPENDENCY=O;t.URL_WATCH=ne;t.blue=yi;t.bold=Wi;t.commandAliases=Wt;t.createFilter=qn;t.cyan=xi;t.cyan$1=qi;t.defineConfig=defineConfig;t.ensureArray=ensureArray$1;t.error=error;t.getAliasName=getAliasName;t.getAugmentedNamespace=getAugmentedNamespace;t.getNewArray=getNewArray;t.getOrCreate=getOrCreate;t.getRollupUrl=getRollupUrl;t.gray=Yi;t.green=Qi;t.handleError=handleError;t.isWatchEnabled=isWatchEnabled;t.logCannotBundleConfigAsEsm=logCannotBundleConfigAsEsm;t.logCannotLoadConfigAsCjs=logCannotLoadConfigAsCjs;t.logCannotLoadConfigAsEsm=logCannotLoadConfigAsEsm;t.logDuplicateImportOptions=logDuplicateImportOptions;t.logFailAfterWarnings=logFailAfterWarnings;t.logInvalidOption=logInvalidOption;t.logMissingConfig=logMissingConfig;t.logMissingExternalConfig=logMissingExternalConfig;t.logOnlyInlineSourcemapsForStdout=logOnlyInlineSourcemapsForStdout;t.mergeOptions=mergeOptions;t.normalizePluginOption=normalizePluginOption;t.picomatch=jn;t.printQuotedStringList=printQuotedStringList;t.relativeId=relativeId;t.rollup=rollup;t.rollupInternal=rollupInternal;t.stderr=stderr;t.underline=Zi;t.version=d;t.yellow=Ji},262:(e,t,i)=>{
|
|
78
78
|
/*
|
|
79
79
|
@license
|
|
80
|
-
Rollup.js v3.
|
|
81
|
-
|
|
80
|
+
Rollup.js v3.29.4
|
|
81
|
+
Thu, 28 Sep 2023 04:54:30 GMT - commit 4e92d60fa90cead39481e3703d26e5d812f43bd1
|
|
82
82
|
|
|
83
83
|
https://github.com/rollup/rollup
|
|
84
84
|
|
|
85
85
|
Released under the MIT License.
|
|
86
86
|
*/
|
|
87
|
-
const s=i(
|
|
87
|
+
const s=i(425);const n=i(967);class WatchEmitter{constructor(){this.currentHandlers=Object.create(null);this.persistentHandlers=Object.create(null)}async close(){}emit(e,...t){return Promise.all([...this.getCurrentHandlers(e),...this.getPersistentHandlers(e)].map((e=>e(...t))))}off(e,t){const i=this.persistentHandlers[e];if(i){i.splice(i.indexOf(t)>>>0,1)}return this}on(e,t){this.getPersistentHandlers(e).push(t);return this}onCurrentRun(e,t){this.getCurrentHandlers(e).push(t);return this}once(e,t){const selfRemovingListener=(...i)=>{this.off(e,selfRemovingListener);return t(...i)};this.on(e,selfRemovingListener);return this}removeAllListeners(){this.removeListenersForCurrentRun();this.persistentHandlers=Object.create(null);return this}removeListenersForCurrentRun(){this.currentHandlers=Object.create(null);return this}getCurrentHandlers(e){return this.currentHandlers[e]||(this.currentHandlers[e]=[])}getPersistentHandlers(e){return this.persistentHandlers[e]||(this.persistentHandlers[e]=[])}}function watch(e){const t=new WatchEmitter;watchInternal(e,t).catch((e=>{s.handleError(e)}));return t}async function watchInternal(e,t){const r=await Promise.all(s.ensureArray(e).map((e=>s.mergeOptions(e,true))));const o=r.filter((e=>e.watch!==false));if(o.length===0){return s.error(s.logInvalidOption("watch",s.URL_WATCH,'there must be at least one config where "watch" is not set to "false"'))}await n.loadFsEvents();const{Watcher:l}=await Promise.resolve().then((()=>i(470)));new l(o,t)}t.watch=watch},470:(e,t,i)=>{
|
|
88
88
|
/*
|
|
89
89
|
@license
|
|
90
|
-
Rollup.js v3.
|
|
91
|
-
|
|
90
|
+
Rollup.js v3.29.4
|
|
91
|
+
Thu, 28 Sep 2023 04:54:30 GMT - commit 4e92d60fa90cead39481e3703d26e5d812f43bd1
|
|
92
92
|
|
|
93
93
|
https://github.com/rollup/rollup
|
|
94
94
|
|
|
95
95
|
Released under the MIT License.
|
|
96
96
|
*/
|
|
97
|
-
Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=i(411);const n=i(742);const r=i(
|
|
97
|
+
Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=i(411);const n=i(742);const r=i(425);const o=i(612);const l=i(466);i(224);i(17);i(846);i(5);i(977);i(147);i(837);i(781);i(37);i(967);i(361);class FileWatcher{constructor(e,t){this.transformWatchers=new Map;this.chokidarOptions=t;this.task=e;this.watcher=this.createWatcher(null)}close(){this.watcher.close();for(const e of this.transformWatchers.values()){e.close()}}unwatch(e){this.watcher.unwatch(e);const t=this.transformWatchers.get(e);if(t){this.transformWatchers.delete(e);t.close()}}watch(e,t){if(t){const t=this.transformWatchers.get(e)??this.createWatcher(e);t.add(e);this.transformWatchers.set(e,t)}else{this.watcher.add(e)}}createWatcher(e){const t=this.task;const i=o.platform()==="linux";const s=e!==null;const handleChange=(r,o)=>{const l=e||r;if(i){n.unwatch(l);n.add(l)}t.invalidate(l,{event:o,isTransformDependency:s})};const n=l.chokidar.watch([],this.chokidarOptions).on("add",(e=>handleChange(e,"create"))).on("change",(e=>handleChange(e,"update"))).on("unlink",(e=>handleChange(e,"delete")));return n}}const c={create:{create:"buggy",delete:null,update:"create"},delete:{create:"update",delete:"buggy",update:"buggy"},update:{create:"buggy",delete:"delete",update:"update"}};class Watcher{constructor(e,t){this.buildDelay=0;this.buildTimeout=null;this.closed=false;this.invalidatedIds=new Map;this.rerun=false;this.running=true;this.emitter=t;t.close=this.close.bind(this);this.tasks=e.map((e=>new Task(this,e)));for(const{watch:t}of e){if(t&&typeof t.buildDelay==="number"){this.buildDelay=Math.max(this.buildDelay,t.buildDelay)}}n.nextTick((()=>this.run()))}async close(){if(this.closed)return;this.closed=true;if(this.buildTimeout)clearTimeout(this.buildTimeout);for(const e of this.tasks){e.close()}await this.emitter.emit("close");this.emitter.removeAllListeners()}invalidate(e){if(e){const t=this.invalidatedIds.get(e.id);const i=t?c[t][e.event]:e.event;if(i==="buggy"){this.invalidatedIds.set(e.id,e.event)}else if(i===null){this.invalidatedIds.delete(e.id)}else{this.invalidatedIds.set(e.id,i)}}if(this.running){this.rerun=true;return}if(this.buildTimeout)clearTimeout(this.buildTimeout);this.buildTimeout=setTimeout((async()=>{this.buildTimeout=null;try{await Promise.all([...this.invalidatedIds].map((([e,t])=>this.emitter.emit("change",e,{event:t}))));this.invalidatedIds.clear();await this.emitter.emit("restart");this.emitter.removeListenersForCurrentRun();this.run()}catch(e){this.invalidatedIds.clear();await this.emitter.emit("event",{code:"ERROR",error:e,result:null});await this.emitter.emit("event",{code:"END"})}}),this.buildDelay)}async run(){this.running=true;await this.emitter.emit("event",{code:"START"});for(const e of this.tasks){await e.run()}this.running=false;await this.emitter.emit("event",{code:"END"});if(this.rerun){this.rerun=false;this.invalidate()}}}class Task{constructor(e,t){this.cache={modules:[]};this.watchFiles=[];this.closed=false;this.invalidated=true;this.watched=new Set;this.watcher=e;this.options=t;this.skipWrite=Boolean(t.watch&&t.watch.skipWrite);this.outputs=this.options.output;this.outputFiles=this.outputs.map((e=>{if(e.file||e.dir)return s.resolve(e.file||e.dir);return undefined}));const i=this.options.watch||{};this.filter=r.createFilter(i.include,i.exclude);this.fileWatcher=new FileWatcher(this,{...i.chokidar,disableGlobbing:true,ignoreInitial:true})}close(){this.closed=true;this.fileWatcher.close()}invalidate(e,t){this.invalidated=true;if(t.isTransformDependency){for(const t of this.cache.modules){if(!t.transformDependencies.includes(e))continue;t.originalCode=null}}this.watcher.invalidate({event:t.event,id:e})}async run(){if(!this.invalidated)return;this.invalidated=false;const e={...this.options,cache:this.cache};const t=Date.now();await this.watcher.emitter.emit("event",{code:"BUNDLE_START",input:this.options.input,output:this.outputFiles});let i=null;try{i=await r.rollupInternal(e,this.watcher.emitter);if(this.closed){return}this.updateWatchedFiles(i);this.skipWrite||await Promise.all(this.outputs.map((e=>i.write(e))));await this.watcher.emitter.emit("event",{code:"BUNDLE_END",duration:Date.now()-t,input:this.options.input,output:this.outputFiles,result:i})}catch(e){if(!this.closed){if(Array.isArray(e.watchFiles)){for(const t of e.watchFiles){this.watchFile(t)}}if(e.id){this.cache.modules=this.cache.modules.filter((t=>t.id!==e.id))}}await this.watcher.emitter.emit("event",{code:"ERROR",error:e,result:i})}}updateWatchedFiles(e){const t=this.watched;this.watched=new Set;this.watchFiles=e.watchFiles;this.cache=e.cache;for(const e of this.watchFiles){this.watchFile(e)}for(const e of this.cache.modules){for(const t of e.transformDependencies){this.watchFile(t,true)}}for(const e of t){if(!this.watched.has(e)){this.fileWatcher.unwatch(e)}}}watchFile(e,t=false){if(!this.filter(e))return;this.watched.add(e);if(this.outputFiles.includes(e)){throw new Error("Cannot import the generated bundle")}this.fileWatcher.watch(e,t)}}t.Task=Task;t.Watcher=Watcher},361:e=>{e.exports=require("events")},147:e=>{e.exports=require("fs")},5:e=>{e.exports=require("node:crypto")},977:e=>{e.exports=require("node:fs/promises")},612:e=>{e.exports=require("node:os")},411:e=>{e.exports=require("node:path")},846:e=>{e.exports=require("node:perf_hooks")},742:e=>{e.exports=require("node:process")},37:e=>{e.exports=require("os")},17:e=>{e.exports=require("path")},781:e=>{e.exports=require("stream")},224:e=>{e.exports=require("tty")},837:e=>{e.exports=require("util")}};var t={};function __nccwpck_require__(i){var s=t[i];if(s!==undefined){return s.exports}var n=t[i]={exports:{}};var r=true;try{e[i](n,n.exports,__nccwpck_require__);r=false}finally{if(r)delete t[i]}return n.exports}__nccwpck_require__.m=e;(()=>{var e=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;var t;__nccwpck_require__.t=function(i,s){if(s&1)i=this(i);if(s&8)return i;if(typeof i==="object"&&i){if(s&4&&i.__esModule)return i;if(s&16&&typeof i.then==="function")return i}var n=Object.create(null);__nccwpck_require__.r(n);var r={};t=t||[null,e({}),e([]),e(e)];for(var o=s&2&&i;typeof o=="object"&&!~t.indexOf(o);o=e(o)){Object.getOwnPropertyNames(o).forEach((e=>r[e]=()=>i[e]))}r["default"]=()=>i;__nccwpck_require__.d(n,r);return n}})();(()=>{__nccwpck_require__.d=(e,t)=>{for(var i in t){if(__nccwpck_require__.o(t,i)&&!__nccwpck_require__.o(e,i)){Object.defineProperty(e,i,{enumerable:true,get:t[i]})}}}})();(()=>{__nccwpck_require__.f={};__nccwpck_require__.e=e=>Promise.all(Object.keys(__nccwpck_require__.f).reduce(((t,i)=>{__nccwpck_require__.f[i](e,t);return t}),[]))})();(()=>{__nccwpck_require__.u=e=>""+e+".index.js"})();(()=>{__nccwpck_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})();(()=>{__nccwpck_require__.r=e=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(e,"__esModule",{value:true})}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";(()=>{var e={179:1};var installChunk=t=>{var i=t.modules,s=t.ids,n=t.runtime;for(var r in i){if(__nccwpck_require__.o(i,r)){__nccwpck_require__.m[r]=i[r]}}if(n)n(__nccwpck_require__);for(var o=0;o<s.length;o++)e[s[o]]=1};__nccwpck_require__.f.require=(t,i)=>{if(!e[t]){if(true){installChunk(require("./"+__nccwpck_require__.u(t)))}else e[t]=1}}})();var i=__nccwpck_require__(142);module.exports=i})();
|