vite-bundle-analyzer
Version:
a modern vite bundle analyzer tool
8 lines • 50.3 kB
JavaScript
import e from"fs";import t,{isAbsolute as n,posix as r,resolve as o,win32 as i}from"path";import s from"child_process";import a from"zlib";import{Readable as l}from"stream";import u from"util";import p from"os";import{EventEmitter as c}from"events";import f from"http";import d from"net";var h=Object.create,m=Object.defineProperty,g=Object.getOwnPropertyDescriptor,y=Object.getOwnPropertyNames,b=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty,S=(e,t)=>function(){return t||(0,e[y(e)[0]])((t={exports:{}}).exports,t),t.exports},A=(e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var o,i=y(t),s=0,a=i.length;s<a;s++)o=i[s],x.call(e,o)||o===n||m(e,o,{get:(e=>t[e]).bind(null,o),enumerable:!(r=g(t,o))||r.enumerable});return e},_=(e,t,n)=>(n=null!=e?h(b(e)):{},A(!t&&e&&e.__esModule?n:m(n,"default",{value:e,enumerable:!0}),e)),R=_(S({"node_modules/.pnpm/ansis@4.1.0/node_modules/ansis/index.cjs"(e,t){let n,r,o,{defineProperty:i,setPrototypeOf:s,create:a,keys:l}=Object,{round:u,max:p}=Math,c=e=>{let t=/([a-f\d]{3,6})/i.exec(e)?.[1],n=t?.length,r=parseInt(6^n?3^n?"0":t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,16);return[r>>16&255,r>>8&255,255&r]},f=(e,t,n)=>e^t||t^n?16+36*u(e/51)+6*u(t/51)+u(n/51):8>e?16:e>248?231:u(24*(e-8)/247)+232,d=e=>{let t,n,r,o,i;return 8>e?30+e:16>e?e-8+90:(232>e?(i=(e-=16)%36,t=(e/36|0)/5,n=(i/6|0)/5,r=i%6/5):t=n=r=(10*(e-232)+8)/255,(o=2*p(t,n,r))?30+(u(r)<<2|u(n)<<1|u(t))+(2^o?0:60):30)},h=(()=>{let e,t,o,i=e=>u.some(t=>e.test(t)),s=globalThis,a=s.process??{},u=a.argv??[],p=a.env??{},c=-1;try{n=","+l(p).join(",")}catch(e){p={},c=0}let f="FORCE_COLOR",d={false:0,0:0,1:1,2:2,3:3}[p[f]]??-1,h=f in p&&d||i(/^--color=?(true|always)?$/);return h&&(c=d),~c||(e=p,t=!!p.PM2_HOME||p.NEXT_RUNTIME?.includes("edge")||!!a.stdout?.isTTY,o="win32"===a.platform,r=e.TERM,c=({"24bit":3,truecolor:3,ansi256:2,ansi:1})[e.COLORTERM]||(e.CI?/,GITHUB/.test(n)?3:1:t&&"dumb"!==r?o?3:/-256/.test(r)?2:1:0)),!d||p.NO_COLOR||i(/^--(no-color|color=(false|never))$/)?0:s.window?.chrome||h&&!c?3:c})(),m={open:"",close:""},g={},y=({p:e},{open:t,close:n})=>{let r=(e,...o)=>{if(!e){if(t&&t===n)return t;if((e??"")==="")return""}let i,s=e.raw?String.raw({raw:e},...o):""+e,a=r.p,l=a.o,u=a.c;if(s.includes("\x1b"))for(;a;a=a.p){let{open:e,close:t}=a,n=t.length,r="",o=0;if(n)for(;~(i=s.indexOf(t,o));o=i+n)r+=s.slice(o,i)+e;s=r+s.slice(o)}return l+(s.includes("\n")?s.replace(/(\r?\n)/g,u+"$1"+l):s)+u},i=t,a=n;return e&&(i=e.o+t,a=n+e.c),s(r,o),r.p={open:t,close:n,o:i,c:a,p:e},r.open=i,r.close=a,r},b=function(e=h){let t={Ansis:b,level:e,isSupported:()=>n,strip:e=>e.replace(/[][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,""),extend(e){for(let t in e){let n=e[t],r=(typeof n)[0],o="s"===r?S(...c(n)):n;g[t]="f"===r?{get(){return(...e)=>y(this,n(...e))}}:{get(){let e=y(this,o);return i(this,t,{value:e}),e}}}return s(t,o=a({},g)),t}},n=e>0,r=(e,t)=>n?{open:`[${e}m`,close:`[${t}m`}:m,l=e=>t=>e(...c(t)),u=(e,t)=>(n,o,i)=>r(`${e}8;2;${n};${o};${i}`,t),p=(e,t)=>(n,o,i)=>r(d(f(n,o,i))+e,t),x=e=>(t,n,r)=>e(f(t,n,r)),S=u(3,39),A=u(4,49),_=e=>r("38;5;"+e,39),R=e=>r("48;5;"+e,49);2===e?(S=x(_),A=x(R)):1===e&&(S=p(0,39),A=p(10,49),_=e=>r(d(e),39),R=e=>r(d(e)+10,49));let E,w={fg:_,bg:R,rgb:S,bgRgb:A,hex:l(S),bgHex:l(A),visible:m,reset:r(0,0),bold:r(1,22),dim:r(2,22),italic:r(3,23),underline:r(4,24),inverse:r(7,27),hidden:r(8,28),strikethrough:r(9,29)},v="Bright";return"black,red,green,yellow,blue,magenta,cyan,white,gray".split(",").map((e,t)=>{E="bg"+e[0].toUpperCase()+e.slice(1),8>t?(w[e+v]=r(90+t,39),w[E+v]=r(100+t,49)):t=60,w[e]=r(30+t,39),w[E]=r(40+t,49)}),t.extend(w)},x=new b;t.exports=x,x.default=x}})(),1),E=R.default;let{Ansis:w,fg:v,bg:$,rgb:O,bgRgb:C,hex:k,bgHex:z,reset:L,inverse:T,hidden:H,visible:M,bold:N,dim:I,italic:B,underline:P,strikethrough:j,black:D,red:F,green:U,yellow:G,blue:K,magenta:W,cyan:q,white:Q,gray:X,redBright:J,greenBright:Z,yellowBright:Y,blueBright:V,magentaBright:ee,cyanBright:et,whiteBright:en,bgBlack:er,bgRed:eo,bgGreen:ei,bgYellow:es,bgBlue:ea,bgMagenta:el,bgCyan:eu,bgWhite:ep,bgGray:ec,bgRedBright:ef,bgGreenBright:ed,bgYellowBright:eh,bgBlueBright:em,bgMagentaBright:eg,bgCyanBright:ey,bgWhiteBright:eb}=R.default;var ex=S({"node_modules/.pnpm/picomatch@4.0.2/node_modules/picomatch/lib/constants.js"(e,t){let n="[^\\\\/]",r="[^/]",o="(?:\\/|$)",i="(?:^|\\/)",s=`\\.{1,2}${o}`,a=`(?!${i}${s})`,l=`(?!\\.{0,1}${o})`,u=`(?!${s})`,p=`${r}*?`,c={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:"(?=.)",QMARK:r,END_ANCHOR:o,DOTS_SLASH:s,NO_DOT:"(?!\\.)",NO_DOTS:a,NO_DOT_SLASH:l,NO_DOTS_SLASH:u,QMARK_NO_DOT:"[^.\\/]",STAR:p,START_ANCHOR:i,SEP:"/"},f={...c,SLASH_LITERAL:"[\\\\/]",QMARK:n,STAR:`${n}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"};t.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?f:c}}}),eS=S({"node_modules/.pnpm/picomatch@4.0.2/node_modules/picomatch/lib/utils.js"(e){let{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:o}=ex();e.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),e.hasRegexChars=e=>r.test(e),e.isRegexChar=t=>1===t.length&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(o,"\\$1"),e.toPosixSlashes=e=>e.replace(t,"/"),e.isWindows=()=>{if("undefined"!=typeof navigator&&navigator.platform){let e=navigator.platform.toLowerCase();return"win32"===e||"windows"===e}return"undefined"!=typeof process&&!!process.platform&&"win32"===process.platform},e.removeBackslashes=e=>e.replace(n,e=>"\\"===e?"":e),e.escapeLast=(t,n,r)=>{let o=t.lastIndexOf(n,r);return -1===o?t:"\\"===t[o-1]?e.escapeLast(t,n,o-1):`${t.slice(0,o)}\\${t.slice(o)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith("./")&&(n=n.slice(2),t.prefix="./"),n},e.wrapOutput=(e,t={},n={})=>{let r=n.contains?"":"^",o=n.contains?"":"$",i=`${r}(?:${e})${o}`;return!0===t.negated&&(i=`(?:^(?!${i}).*$)`),i},e.basename=(e,{windows:t}={})=>{let n=e.split(t?/[\\/]/:"/"),r=n[n.length-1];return""===r?n[n.length-2]:r}}}),eA=S({"node_modules/.pnpm/picomatch@4.0.2/node_modules/picomatch/lib/scan.js"(e,t){let n=eS(),{CHAR_ASTERISK:r,CHAR_AT:o,CHAR_BACKWARD_SLASH:i,CHAR_COMMA:s,CHAR_DOT:a,CHAR_EXCLAMATION_MARK:l,CHAR_FORWARD_SLASH:u,CHAR_LEFT_CURLY_BRACE:p,CHAR_LEFT_PARENTHESES:c,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:d,CHAR_QUESTION_MARK:h,CHAR_RIGHT_CURLY_BRACE:m,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:y}=ex(),b=e=>e===u||e===i,x=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};t.exports=(e,t)=>{let S,A,_=t||{},R=e.length-1,E=!0===_.parts||!0===_.scanToEnd,w=[],v=[],$=[],O=e,C=-1,k=0,z=0,L=!1,T=!1,H=!1,M=!1,N=!1,I=!1,B=!1,P=!1,j=!1,D=!1,F=0,U={value:"",depth:0,isGlob:!1},G=()=>C>=R,K=()=>O.charCodeAt(C+1),W=()=>(S=A,O.charCodeAt(++C));for(;C<R;){let e;if((A=W())===i){B=U.backslashes=!0,(A=W())===p&&(I=!0);continue}if(!0===I||A===p){for(F++;!0!==G()&&(A=W());){if(A===i){B=U.backslashes=!0,W();continue}if(A===p){F++;continue}if(!0!==I&&A===a&&(A=W())===a||!0!==I&&A===s){if(L=U.isBrace=!0,H=U.isGlob=!0,D=!0,!0===E)continue;break}if(A===m&&0==--F){I=!1,L=U.isBrace=!0,D=!0;break}}if(!0===E)continue;break}if(A===u){if(w.push(C),v.push(U),U={value:"",depth:0,isGlob:!1},!0===D)continue;if(S===a&&C===k+1){k+=2;continue}z=C+1;continue}if(!0!==_.noext&&!0==(A===d||A===o||A===r||A===h||A===l)&&K()===c){if(H=U.isGlob=!0,M=U.isExtglob=!0,D=!0,A===l&&C===k&&(j=!0),!0===E){for(;!0!==G()&&(A=W());){if(A===i){B=U.backslashes=!0,A=W();continue}if(A===g){H=U.isGlob=!0,D=!0;break}}continue}break}if(A===r){if(S===r&&(N=U.isGlobstar=!0),H=U.isGlob=!0,D=!0,!0===E)continue;break}if(A===h){if(H=U.isGlob=!0,D=!0,!0===E)continue;break}if(A===f){for(;!0!==G()&&(e=W());){if(e===i){B=U.backslashes=!0,W();continue}if(e===y){T=U.isBracket=!0,H=U.isGlob=!0,D=!0;break}}if(!0===E)continue;break}if(!0!==_.nonegate&&A===l&&C===k){P=U.negated=!0,k++;continue}if(!0!==_.noparen&&A===c){if(H=U.isGlob=!0,!0===E){for(;!0!==G()&&(A=W());){if(A===c){B=U.backslashes=!0,A=W();continue}if(A===g){D=!0;break}}continue}break}if(!0===H){if(D=!0,!0===E)continue;break}}!0===_.noext&&(M=!1,H=!1);let q=O,Q="",X="";k>0&&(Q=O.slice(0,k),O=O.slice(k),z-=k),q&&!0===H&&z>0?(q=O.slice(0,z),X=O.slice(z)):!0===H?(q="",X=O):q=O,q&&""!==q&&"/"!==q&&q!==O&&b(q.charCodeAt(q.length-1))&&(q=q.slice(0,-1)),!0===_.unescape&&(X&&(X=n.removeBackslashes(X)),q&&!0===B&&(q=n.removeBackslashes(q)));let J={prefix:Q,input:e,start:k,base:q,glob:X,isBrace:L,isBracket:T,isGlob:H,isExtglob:M,isGlobstar:N,negated:P,negatedExtglob:j};if(!0===_.tokens&&(J.maxDepth=0,b(A)||v.push(U),J.tokens=v),!0===_.parts||!0===_.tokens){let t;for(let n=0;n<w.length;n++){let r=t?t+1:k,o=w[n],i=e.slice(r,o);_.tokens&&(0===n&&0!==k?(v[n].isPrefix=!0,v[n].value=Q):v[n].value=i,x(v[n]),J.maxDepth+=v[n].depth),(0!==n||""!==i)&&$.push(i),t=o}if(t&&t+1<e.length){let n=e.slice(t+1);$.push(n),_.tokens&&(v[v.length-1].value=n,x(v[v.length-1]),J.maxDepth+=v[v.length-1].depth)}J.slashes=w,J.parts=$}return J}}}),e_=S({"node_modules/.pnpm/picomatch@4.0.2/node_modules/picomatch/lib/parse.js"(e,t){let n=ex(),r=eS(),{MAX_LENGTH:o,POSIX_REGEX_SOURCE:i,REGEX_NON_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_BACKREF:a,REPLACEMENTS:l}=n,u=(e,t)=>{if("function"==typeof t.expandRange)return t.expandRange(...e,t);e.sort();let n=`[${e.join("-")}]`;try{new RegExp(n)}catch(t){return e.map(e=>r.escapeRegex(e)).join("..")}return n},p=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,c=(e,t)=>{let f;if("string"!=typeof e)throw TypeError("Expected a string");e=l[e]||e;let d={...t},h="number"==typeof d.maxLength?Math.min(o,d.maxLength):o,m=e.length;if(m>h)throw SyntaxError(`Input length: ${m}, exceeds maximum allowed length: ${h}`);let g={type:"bos",value:"",output:d.prepend||""},y=[g],b=d.capture?"":"?:",x=n.globChars(d.windows),S=n.extglobChars(x),{DOT_LITERAL:A,PLUS_LITERAL:_,SLASH_LITERAL:R,ONE_CHAR:E,DOTS_SLASH:w,NO_DOT:v,NO_DOT_SLASH:$,NO_DOTS_SLASH:O,QMARK:C,QMARK_NO_DOT:k,STAR:z,START_ANCHOR:L}=x,T=e=>`(${b}(?:(?!${L}${e.dot?w:A}).)*?)`,H=d.dot?"":v,M=d.dot?C:k,N=!0===d.bash?T(d):z;d.capture&&(N=`(${N})`),"boolean"==typeof d.noext&&(d.noextglob=d.noext);let I={input:e,index:-1,start:0,dot:!0===d.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:y};m=(e=r.removePrefix(e,I)).length;let B=[],P=[],j=[],D=g,F=()=>I.index===m-1,U=I.peek=(t=1)=>e[I.index+t],G=I.advance=()=>e[++I.index]||"",K=()=>e.slice(I.index+1),W=(e="",t=0)=>{I.consumed+=e,I.index+=t},q=e=>{I.output+=null!=e.output?e.output:e.value,W(e.value)},Q=()=>{let e=1;for(;"!"===U()&&("("!==U(2)||"?"===U(3));)G(),I.start++,e++;return e%2!=0&&(I.negated=!0,I.start++,!0)},X=e=>{I[e]++,j.push(e)},J=e=>{I[e]--,j.pop()},Z=e=>{if("globstar"===D.type){let t=I.braces>0&&("comma"===e.type||"brace"===e.type),n=!0===e.extglob||B.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||n||(I.output=I.output.slice(0,-D.output.length),D.type="star",D.value="*",D.output=N,I.output+=D.output)}if(B.length&&"paren"!==e.type&&(B[B.length-1].inner+=e.value),(e.value||e.output)&&q(e),D&&"text"===D.type&&"text"===e.type){D.output=(D.output||D.value)+e.value,D.value+=e.value;return}e.prev=D,y.push(e),D=e},Y=(e,t)=>{let n={...S[t],conditions:1,inner:""};n.prev=D,n.parens=I.parens,n.output=I.output;let r=(d.capture?"(":"")+n.open;X("parens"),Z({type:e,value:t,output:I.output?"":E}),Z({type:"paren",extglob:!0,value:G(),output:r}),B.push(n)},V=e=>{let n,r=e.close+(d.capture?")":"");if("negate"===e.type){let o=N;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(o=T(d)),(o!==N||F()||/^\)+$/.test(K()))&&(r=e.close=`)$))${o}`),e.inner.includes("*")&&(n=K())&&/^\.[^\\/.]+$/.test(n)){let i=c(n,{...t,fastpaths:!1}).output;r=e.close=`)${i})${o})`}"bos"===e.prev.type&&(I.negatedExtglob=!0)}Z({type:"paren",extglob:!0,value:f,output:r}),J("parens")};if(!1!==d.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=!1,o=e.replace(a,(e,t,r,o,i,s)=>"\\"===o?(n=!0,e):"?"===o?t?t+o+(i?C.repeat(i.length):""):0===s?M+(i?C.repeat(i.length):""):C.repeat(r.length):"."===o?A.repeat(r.length):"*"===o?t?t+o+(i?N:""):N:t?e:`\\${e}`);return(!0===n&&(o=!0===d.unescape?o.replace(/\\/g,""):o.replace(/\\+/g,e=>e.length%2==0?"\\\\":e?"\\":"")),o===e&&!0===d.contains)?I.output=e:I.output=r.wrapOutput(o,I,t),I}for(;!F();){if("\0"===(f=G()))continue;if("\\"===f){let e=U();if("/"===e&&!0!==d.bash||"."===e||";"===e)continue;if(!e){Z({type:"text",value:f+="\\"});continue}let t=/^\\+/.exec(K()),n=0;if(t&&t[0].length>2&&(n=t[0].length,I.index+=n,n%2!=0&&(f+="\\")),!0===d.unescape?f=G():f+=G(),0===I.brackets){Z({type:"text",value:f});continue}}if(I.brackets>0&&("]"!==f||"["===D.value||"[^"===D.value)){if(!1!==d.posix&&":"===f){let e=D.value.slice(1);if(e.includes("[")&&(D.posix=!0,e.includes(":"))){let e=D.value.lastIndexOf("["),t=D.value.slice(0,e),n=i[D.value.slice(e+2)];if(n){D.value=t+n,I.backtrack=!0,G(),g.output||1!==y.indexOf(D)||(g.output=E);continue}}}("["===f&&":"!==U()||"-"===f&&"]"===U())&&(f=`\\${f}`),"]"===f&&("["===D.value||"[^"===D.value)&&(f=`\\${f}`),!0===d.posix&&"!"===f&&"["===D.value&&(f="^"),D.value+=f,q({value:f});continue}if(1===I.quotes&&'"'!==f){f=r.escapeRegex(f),D.value+=f,q({value:f});continue}if('"'===f){I.quotes=+(1!==I.quotes),!0===d.keepQuotes&&Z({type:"text",value:f});continue}if("("===f){X("parens"),Z({type:"paren",value:f});continue}if(")"===f){if(0===I.parens&&!0===d.strictBrackets)throw SyntaxError(p("opening","("));let e=B[B.length-1];if(e&&I.parens===e.parens+1){V(B.pop());continue}Z({type:"paren",value:f,output:I.parens?")":"\\)"}),J("parens");continue}if("["===f){if(!0!==d.nobracket&&K().includes("]"))X("brackets");else{if(!0!==d.nobracket&&!0===d.strictBrackets)throw SyntaxError(p("closing","]"));f=`\\${f}`}Z({type:"bracket",value:f});continue}if("]"===f){if(!0===d.nobracket||D&&"bracket"===D.type&&1===D.value.length){Z({type:"text",value:f,output:`\\${f}`});continue}if(0===I.brackets){if(!0===d.strictBrackets)throw SyntaxError(p("opening","["));Z({type:"text",value:f,output:`\\${f}`});continue}J("brackets");let e=D.value.slice(1);if(!0===D.posix||"^"!==e[0]||e.includes("/")||(f=`/${f}`),D.value+=f,q({value:f}),!1===d.literalBrackets||r.hasRegexChars(e))continue;let t=r.escapeRegex(D.value);if(I.output=I.output.slice(0,-D.value.length),!0===d.literalBrackets){I.output+=t,D.value=t;continue}D.value=`(${b}${t}|${D.value})`,I.output+=D.value;continue}if("{"===f&&!0!==d.nobrace){X("braces");let e={type:"brace",value:f,output:"(",outputIndex:I.output.length,tokensIndex:I.tokens.length};P.push(e),Z(e);continue}if("}"===f){let e=P[P.length-1];if(!0===d.nobrace||!e){Z({type:"text",value:f,output:f});continue}let t=")";if(!0===e.dots){let e=y.slice(),n=[];for(let t=e.length-1;t>=0&&(y.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&n.unshift(e[t].value);t=u(n,d),I.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){let n=I.output.slice(0,e.outputIndex),r=I.tokens.slice(e.tokensIndex);for(let o of(e.value=e.output="\\{",f=t="\\}",I.output=n,r))I.output+=o.output||o.value}Z({type:"brace",value:f,output:t}),J("braces"),P.pop();continue}if("|"===f){B.length>0&&B[B.length-1].conditions++,Z({type:"text",value:f});continue}if(","===f){let e=f,t=P[P.length-1];t&&"braces"===j[j.length-1]&&(t.comma=!0,e="|"),Z({type:"comma",value:f,output:e});continue}if("/"===f){if("dot"===D.type&&I.index===I.start+1){I.start=I.index+1,I.consumed="",I.output="",y.pop(),D=g;continue}Z({type:"slash",value:f,output:R});continue}if("."===f){if(I.braces>0&&"dot"===D.type){"."===D.value&&(D.output=A);let e=P[P.length-1];D.type="dots",D.output+=f,D.value+=f,e.dots=!0;continue}if(I.braces+I.parens===0&&"bos"!==D.type&&"slash"!==D.type){Z({type:"text",value:f,output:A});continue}Z({type:"dot",value:f,output:A});continue}if("?"===f){if(!(D&&"("===D.value)&&!0!==d.noextglob&&"("===U()&&"?"!==U(2)){Y("qmark",f);continue}if(D&&"paren"===D.type){let e=U(),t=f;("("!==D.value||/[!=<:]/.test(e))&&("<"!==e||/<([!=]|\w+>)/.test(K()))||(t=`\\${f}`),Z({type:"text",value:f,output:t});continue}if(!0!==d.dot&&("slash"===D.type||"bos"===D.type)){Z({type:"qmark",value:f,output:k});continue}Z({type:"qmark",value:f,output:C});continue}if("!"===f){if(!0!==d.noextglob&&"("===U()&&("?"!==U(2)||!/[!=<:]/.test(U(3)))){Y("negate",f);continue}if(!0!==d.nonegate&&0===I.index){Q();continue}}if("+"===f){if(!0!==d.noextglob&&"("===U()&&"?"!==U(2)){Y("plus",f);continue}if(D&&"("===D.value||!1===d.regex){Z({type:"plus",value:f,output:_});continue}if(D&&("bracket"===D.type||"paren"===D.type||"brace"===D.type)||I.parens>0){Z({type:"plus",value:f});continue}Z({type:"plus",value:_});continue}if("@"===f){if(!0!==d.noextglob&&"("===U()&&"?"!==U(2)){Z({type:"at",extglob:!0,value:f,output:""});continue}Z({type:"text",value:f});continue}if("*"!==f){("$"===f||"^"===f)&&(f=`\\${f}`);let e=s.exec(K());e&&(f+=e[0],I.index+=e[0].length),Z({type:"text",value:f});continue}if(D&&("globstar"===D.type||!0===D.star)){D.type="star",D.star=!0,D.value+=f,D.output=N,I.backtrack=!0,I.globstar=!0,W(f);continue}let t=K();if(!0!==d.noextglob&&/^\([^?]/.test(t)){Y("star",f);continue}if("star"===D.type){if(!0===d.noglobstar){W(f);continue}let n=D.prev,r=n.prev,o="slash"===n.type||"bos"===n.type,i=r&&("star"===r.type||"globstar"===r.type);if(!0===d.bash&&(!o||t[0]&&"/"!==t[0])){Z({type:"star",value:f,output:""});continue}let s=I.braces>0&&("comma"===n.type||"brace"===n.type),a=B.length&&("pipe"===n.type||"paren"===n.type);if(!o&&"paren"!==n.type&&!s&&!a){Z({type:"star",value:f,output:""});continue}for(;"/**"===t.slice(0,3);){let n=e[I.index+4];if(n&&"/"!==n)break;t=t.slice(3),W("/**",3)}if("bos"===n.type&&F()){D.type="globstar",D.value+=f,D.output=T(d),I.output=D.output,I.globstar=!0,W(f);continue}if("slash"===n.type&&"bos"!==n.prev.type&&!i&&F()){I.output=I.output.slice(0,-(n.output+D.output).length),n.output=`(?:${n.output}`,D.type="globstar",D.output=T(d)+(d.strictSlashes?")":"|$)"),D.value+=f,I.globstar=!0,I.output+=n.output+D.output,W(f);continue}if("slash"===n.type&&"bos"!==n.prev.type&&"/"===t[0]){let e=void 0!==t[1]?"|$":"";I.output=I.output.slice(0,-(n.output+D.output).length),n.output=`(?:${n.output}`,D.type="globstar",D.output=`${T(d)}${R}|${R}${e})`,D.value+=f,I.output+=n.output+D.output,I.globstar=!0,W(f+G()),Z({type:"slash",value:"/",output:""});continue}if("bos"===n.type&&"/"===t[0]){D.type="globstar",D.value+=f,D.output=`(?:^|${R}|${T(d)}${R})`,I.output=D.output,I.globstar=!0,W(f+G()),Z({type:"slash",value:"/",output:""});continue}I.output=I.output.slice(0,-D.output.length),D.type="globstar",D.output=T(d),D.value+=f,I.output+=D.output,I.globstar=!0,W(f);continue}let n={type:"star",value:f,output:N};if(!0===d.bash){n.output=".*?",("bos"===D.type||"slash"===D.type)&&(n.output=H+n.output),Z(n);continue}if(D&&("bracket"===D.type||"paren"===D.type)&&!0===d.regex){n.output=f,Z(n);continue}(I.index===I.start||"slash"===D.type||"dot"===D.type)&&("dot"===D.type?(I.output+=$,D.output+=$):!0===d.dot?(I.output+=O,D.output+=O):(I.output+=H,D.output+=H),"*"!==U()&&(I.output+=E,D.output+=E)),Z(n)}for(;I.brackets>0;){if(!0===d.strictBrackets)throw SyntaxError(p("closing","]"));I.output=r.escapeLast(I.output,"["),J("brackets")}for(;I.parens>0;){if(!0===d.strictBrackets)throw SyntaxError(p("closing",")"));I.output=r.escapeLast(I.output,"("),J("parens")}for(;I.braces>0;){if(!0===d.strictBrackets)throw SyntaxError(p("closing","}"));I.output=r.escapeLast(I.output,"{"),J("braces")}if(!0!==d.strictSlashes&&("star"===D.type||"bracket"===D.type)&&Z({type:"maybe_slash",value:"",output:`${R}?`}),!0===I.backtrack)for(let e of(I.output="",I.tokens))I.output+=null!=e.output?e.output:e.value,e.suffix&&(I.output+=e.suffix);return I};c.fastpaths=(e,t)=>{let i={...t},s="number"==typeof i.maxLength?Math.min(o,i.maxLength):o,a=e.length;if(a>s)throw SyntaxError(`Input length: ${a}, exceeds maximum allowed length: ${s}`);e=l[e]||e;let{DOT_LITERAL:u,SLASH_LITERAL:p,ONE_CHAR:c,DOTS_SLASH:f,NO_DOT:d,NO_DOTS:h,NO_DOTS_SLASH:m,STAR:g,START_ANCHOR:y}=n.globChars(i.windows),b=i.dot?h:d,x=i.dot?m:d,S=i.capture?"":"?:",A=!0===i.bash?".*?":g;i.capture&&(A=`(${A})`);let _=e=>!0===e.noglobstar?A:`(${S}(?:(?!${y}${e.dot?f:u}).)*?)`,R=e=>{switch(e){case"*":return`${b}${c}${A}`;case".*":return`${u}${c}${A}`;case"*.*":return`${b}${A}${u}${c}${A}`;case"*/*":return`${b}${A}${p}${c}${x}${A}`;case"**":return b+_(i);case"**/*":return`(?:${b}${_(i)}${p})?${x}${c}${A}`;case"**/*.*":return`(?:${b}${_(i)}${p})?${x}${A}${u}${c}${A}`;case"**/.*":return`(?:${b}${_(i)}${p})?${u}${c}${A}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let n=R(t[1]);if(!n)return;return n+u+t[2]}}},E=R(r.removePrefix(e,{negated:!1,prefix:""}));return E&&!0!==i.strictSlashes&&(E+=`${p}?`),E},t.exports=c}}),eR=S({"node_modules/.pnpm/picomatch@4.0.2/node_modules/picomatch/lib/picomatch.js"(e,t){let n=eA(),r=e_(),o=eS(),i=ex(),s=e=>e&&"object"==typeof e&&!Array.isArray(e),a=(e,t,n=!1)=>{if(Array.isArray(e)){let r=e.map(e=>a(e,t,n));return e=>{for(let t of r){let n=t(e);if(n)return n}return!1}}let r=s(e)&&e.tokens&&e.input;if(""===e||"string"!=typeof e&&!r)throw TypeError("Expected pattern to be a non-empty string");let o=t||{},i=o.windows,l=r?a.compileRe(e,t):a.makeRe(e,t,!1,!0),u=l.state;delete l.state;let p=()=>!1;if(o.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};p=a(o.ignore,e,n)}let c=(n,r=!1)=>{let{isMatch:s,match:c,output:f}=a.test(n,l,t,{glob:e,posix:i}),d={glob:e,state:u,regex:l,posix:i,input:n,output:f,match:c,isMatch:s};return("function"==typeof o.onResult&&o.onResult(d),!1===s)?(d.isMatch=!1,!!r&&d):p(n)?("function"==typeof o.onIgnore&&o.onIgnore(d),d.isMatch=!1,!!r&&d):("function"==typeof o.onMatch&&o.onMatch(d),!r||d)};return n&&(c.state=u),c};a.test=(e,t,n,{glob:r,posix:i}={})=>{if("string"!=typeof e)throw TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};let s=n||{},l=s.format||(i?o.toPosixSlashes:null),u=e===r,p=u&&l?l(e):e;return!1===u&&(u=(p=l?l(e):e)===r),(!1===u||!0===s.capture)&&(u=!0===s.matchBase||!0===s.basename?a.matchBase(e,t,n,i):t.exec(p)),{isMatch:!!u,match:u,output:p}},a.matchBase=(e,t,n)=>(t instanceof RegExp?t:a.makeRe(t,n)).test(o.basename(e)),a.isMatch=(e,t,n)=>a(t,n)(e),a.parse=(e,t)=>Array.isArray(e)?e.map(e=>a.parse(e,t)):r(e,{...t,fastpaths:!1}),a.scan=(e,t)=>n(e,t),a.compileRe=(e,t,n=!1,r=!1)=>{if(!0===n)return e.output;let o=t||{},i=o.contains?"":"^",s=o.contains?"":"$",l=`${i}(?:${e.output})${s}`;e&&!0===e.negated&&(l=`^(?!${l}).*$`);let u=a.toRegex(l,t);return!0===r&&(u.state=e),u},a.makeRe=(e,t={},n=!1,o=!1)=>{if(!e||"string"!=typeof e)throw TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return!1!==t.fastpaths&&("."===e[0]||"*"===e[0])&&(i.output=r.fastpaths(e,t)),i.output||(i=r(e,t)),a.compileRe(i,t,n,o)},a.toRegex=(e,t)=>{try{let n=t||{};return new RegExp(e,n.flags||(n.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},a.constants=i,t.exports=a}}),eE=S({"node_modules/.pnpm/picomatch@4.0.2/node_modules/picomatch/index.js"(e,t){let n=eR(),r=eS();function o(e,t,i=!1){return t&&(null===t.windows||void 0===t.windows)&&(t={...t,windows:r.isWindows()}),n(e,t,i)}Object.assign(o,n),t.exports=o}});new TextEncoder,new TextDecoder;let{platform:ew,arch:ev}=process,e$=["pnpm-workspace.yaml","lerna.json"];function eO(n,r=n){if(function(n){let r=t.join(n,"package.json");return e.existsSync(r)}(n))return n;let o=t.dirname(n);return o&&o!==n?eO(o,r):r}function eC(n,r=eO(n)){if(e$.some(r=>e.existsSync(t.join(n,r)))||function(n){let r=t.join(n,"package.json");if(!function(t){if(!function(t){try{return e.statSync(t,{throwIfNoEntry:!1})}catch{}}(t))return!1;try{return e.accessSync(t,e.constants.R_OK),!0}catch{return!1}}(r))return!1;try{return!!(JSON.parse(e.readFileSync(r,"utf-8"))||{}).workspaces}catch{return!1}}(n))return n;let o=t.dirname(n);return o&&o!==n?eC(o,r):r}var ek=_(eE(),1);function ez(e){return Array.isArray(e)?e:null==e?[]:[e]}let eL=RegExp(`\\${i.sep}`,"g"),eT=function(e){return e.replace(eL,r.sep)},eH=function(e,t,i){let s=i&&i.resolve,a=e=>e instanceof RegExp?e:{test:t=>{let i=function(e,t){if(!1===t||n(e)||e.startsWith("**"))return eT(e);let i=eT(o(t||"")).replace(/[-^$*+?.()|[\]{}]/g,"\\$&");return r.join(i,eT(e))}(e,s);return(0,ek.default)(i,{dot:!0})(t)}},l=ez(e).map(a),u=ez(t).map(a);return l.length||u.length?function(e){if("string"!=typeof e||e.includes("\0"))return!1;let t=eT(e);for(let e=0;e<u.length;++e){let n=u[e];if(n instanceof RegExp&&(n.lastIndex=0),n.test(t))return!1}for(let e=0;e<l.length;++e){let n=l[e];if(n instanceof RegExp&&(n.lastIndex=0),n.test(t))return!0}return!l.length}:e=>"string"==typeof e&&!e.includes("\0")};new Set("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 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".split(" ")).add("");function eM(e,t){return t.reduce((t,n)=>(t[n]=e[n],t),{})}let eN=e.promises,eI=new TextEncoder,eB=new TextDecoder,eP=u.promisify(a.gzip),ej=u.promisify(a.brotliCompress),eD={level:a.constants.Z_DEFAULT_LEVEL},eF={params:{[a.constants.BROTLI_PARAM_QUALITY]:a.constants.BROTLI_MAX_QUALITY}};function eU(e){return/^\\\\\?\\/.test(e)?e:e.replace(/\\/g,"/")}function eG(e){return"string"==typeof e?eI.encode(e):e}function eK(e){return"string"==typeof e?e:eB.decode(e)}let eW=process.env.DEBUG||process.env.ANALYZE_DEBUG?(...e)=>{console.log(E.hex("#5B45DE")("[vite:bundle-analyzer]"),...e)}:()=>{};function eq(){let e,t=!1;return{rs:new l,into(n){t||(this.rs.push(n),this.rs.push(null),e||(e=eG(n)),t=!0)},refresh(n){n&&(e=eG(n)),t=!1,this.rs=new l,this.into(e)}}}let eQ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",eX=new Uint8Array(64),eJ=new Uint8Array(128);for(let e=0;e<eQ.length;e++){let t=eQ.charCodeAt(e);eX[e]=t,eJ[t]=e}function eZ(e,t){let n=0,r=0,o=0;do n|=(31&(o=eJ[e.next()]))<<r,r+=5;while(32&o);let i=1&n;return n>>>=1,i&&(n=-0x80000000|-n),t+n}function eY(e,t){return!(e.pos>=t)&&44!==e.peek()}var eV=class{constructor(e){this.pos=0,this.buffer=e}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(e){let{buffer:t,pos:n}=this,r=t.indexOf(e,n);return -1===r?t.length:r}};function e0(e,t){return e[0]-t[0]}let e1=/^[\w+.-]+:\/\//,e2=/^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,e3=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;function e4(e){return e.startsWith("/")}function e5(e){return/^[.?#]/.test(e)}function e6(e){let t=e2.exec(e);return e9(t[1],t[2]||"",t[3],t[4]||"",t[5]||"/",t[6]||"",t[7]||"")}function e9(e,t,n,r,o,i,s){return{scheme:e,user:t,host:n,port:r,path:o,query:i,hash:s,type:7}}function e8(e){if(e.startsWith("//")){let t=e6("http:"+e);return t.scheme="",t.type=6,t}if(e4(e)){let t=e6("http://foo.com"+e);return t.scheme="",t.host="",t.type=5,t}if(e.startsWith("file:")){let t=e3.exec(e),n=t[2];return e9("file:","",t[1]||"","",e4(n)?n:"/"+n,t[3]||"",t[4]||"")}if(e1.test(e))return e6(e);let t=e6("http://foo.com/"+e);return t.scheme="",t.host="",t.type=e?e.startsWith("?")?3:e.startsWith("#")?2:4:1,t}function e7(e,t){let n=t<=4,r=e.path.split("/"),o=1,i=0,s=!1;for(let e=1;e<r.length;e++){let t=r[e];if(!t){s=!0;continue}if(s=!1,"."!==t){if(".."===t){i?(s=!0,i--,o--):n&&(r[o++]=t);continue}r[o++]=t,i++}}let a="";for(let e=1;e<o;e++)a+="/"+r[e];a&&(!s||a.endsWith("/.."))||(a+="/"),e.path=a}function te(e,t){return t&&!t.endsWith("/")&&(t+="/"),function(e,t){if(!e&&!t)return"";let n=e8(e),r=n.type;if(t&&7!==r){let e=e8(t),o=e.type;switch(r){case 1:n.hash=e.hash;case 2:n.query=e.query;case 3:case 4:e7(e,e.type),"/"===n.path?n.path=e.path:n.path=function(e){if(e.endsWith("/.."))return e;let t=e.lastIndexOf("/");return e.slice(0,t+1)}(e.path)+n.path;case 5:n.user=e.user,n.host=e.host,n.port=e.port;case 6:n.scheme=e.scheme}o>r&&(r=o)}e7(n,r);let o=n.query+n.hash;switch(r){case 2:case 3:return o;case 4:{let r=n.path.slice(1);if(!r)return o||".";if(e5(t||e)&&!e5(r))return"./"+r+o;return r+o}case 5:return n.path+o;default:return n.scheme+"//"+n.user+n.host+n.port+n.path+o}}(e,t)}function tt(e,t){for(let n=t;n<e.length;n++)if(!function(e){for(let t=1;t<e.length;t++)if(e[t][0]<e[t-1][0])return!1;return!0}(e[n]))return n;return e.length}function tn(e,t){return e[0]-t[0]}let tr=!1,to=function(e,t){let n=ti(e);if(!("sections"in n))return new ta(n,t);let r=[],o=[],i=[],s=[],a=[];return function e(t,n,r,o,i,s,a,l,u,p,c){let{sections:f}=t;for(let t=0;t<f.length;t++){let{map:d,offset:h}=f[t],m=p,g=c;if(t+1<f.length){let e=f[t+1].offset;(m=Math.min(p,l+e.line))===p?g=Math.min(c,u+e.column):m<p&&(g=u+e.column)}!function(t,n,r,o,i,s,a,l,u,p,c){let f=ti(t);if("sections"in f)return e(...arguments);let d=new ta(f,n),h=o.length,m=s.length,g=tl(d),{resolvedSources:y,sourcesContent:b,ignoreList:x}=d;if(ts(o,y),ts(s,d.names),b)ts(i,b);else for(let e=0;e<y.length;e++)i.push(null);if(x)for(let e=0;e<x.length;e++)a.push(x[e]+h);for(let e=0;e<g.length;e++){let t=l+e;if(t>p)return;let n=function(e,t){for(let n=e.length;n<=t;n++)e[n]=[];return e[t]}(r,t),o=0===e?u:0,i=g[e];for(let e=0;e<i.length;e++){let r=i[e],s=o+r[0];if(t===p&&s>=c)return;if(1===r.length){n.push([s]);continue}let a=h+r[1],l=r[2],u=r[3];n.push(4===r.length?[s,a,l,u]:[s,a,l,u,m+r[4]])}}}(d,n,r,o,i,s,a,l+h.line,u+h.column,m,g)}}(n,t,r,o,i,s,a,0,0,1/0,1/0),function(e,t){var n,r;let o=new ta((r=[],{version:(n=e).version,file:n.file,names:n.names,sourceRoot:n.sourceRoot,sources:n.sources,sourcesContent:n.sourcesContent,mappings:r,ignoreList:n.ignoreList||n.x_google_ignoreList}),void 0);return o._decoded=e.mappings,o}({version:3,file:n.file,names:s,sources:o,sourcesContent:i,mappings:r,ignoreList:a})};function ti(e){return"string"==typeof e?JSON.parse(e):e}function ts(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}var ta=class{constructor(e,t){let n="string"==typeof e;if(!n&&e._decodedMemo)return e;let r=n?JSON.parse(e):e,{version:o,file:i,names:s,sourceRoot:a,sources:l,sourcesContent:u}=r;this.version=o,this.file=i,this.names=s||[],this.sourceRoot=a,this.sources=l,this.sourcesContent=u,this.ignoreList=r.ignoreList||r.x_google_ignoreList||void 0;let p=te(a||"",function(e){if(!e)return"";let t=e.lastIndexOf("/");return e.slice(0,t+1)}(t));this.resolvedSources=l.map(e=>te(e||"",p));let{mappings:c}=r;"string"==typeof c?(this._encoded=c,this._decoded=void 0):(this._encoded=void 0,this._decoded=function(e,t){let n=tt(e,0);if(n===e.length)return e;t||(e=e.slice());for(let o=n;o<e.length;o=tt(e,o+1)){var r;e[o]=(r=e[o],t||(r=r.slice()),r.sort(tn))}return e}(c,n)),this._decodedMemo={lastKey:-1,lastNeedle:-1,lastIndex:-1},this._bySources=void 0,this._bySourceMemos=void 0}};function tl(e){return e._decoded||(e._decoded=function(e){let{length:t}=e,n=new eV(e),r=[],o=0,i=0,s=0,a=0,l=0;do{let e=n.indexOf(";"),t=[],u=!0,p=0;for(o=0;n.pos<e;){let r;(o=eZ(n,o))<p&&(u=!1),p=o,eY(n,e)?(i=eZ(n,i),s=eZ(n,s),a=eZ(n,a),r=eY(n,e)?[o,i,s,a,l=eZ(n,l)]:[o,i,s,a]):r=[o],t.push(r),n.pos++}u||t.sort(e0),r.push(t),n.pos=e+1}while(n.pos<=t);return r}(e._encoded))}function tu(e,t,n,r){return{source:e,line:t,column:n,name:r}}var tp=class{constructor(e,t){let n=this._map=new to(e,t);this.file=n.file,this.names=n.names,this.sourceRoot=n.sourceRoot,this.sources=n.resolvedSources,this.sourcesContent=n.sourcesContent,this.version=n.version}originalPositionFor(e){return function(e,t){var n,r,o,i,s;let a,{line:l,column:u,bias:p}=t;if(--l<0)throw Error("`line` must be greater than 0 (lines start at line 1)");if(u<0)throw Error("`column` must be greater than or equal to 0 (columns start at column 0)");let c=tl(e);if(l>=c.length)return tu(null,null,null,null);let f=c[l],d=(n=f,r=e._decodedMemo,o=l,i=u,s=p||1,a=function(e,t,n,r){let{lastKey:o,lastNeedle:i,lastIndex:s}=n,a=0,l=e.length-1;if(r===o){if(t===i)return tr=-1!==s&&e[s][0]===t,s;t>=i?a=-1===s?0:s:l=s}return n.lastKey=r,n.lastNeedle=t,n.lastIndex=function(e,t,n,r){for(;n<=r;){let o=n+(r-n>>1),i=e[o][0]-t;if(0===i)return tr=!0,o;i<0?n=o+1:r=o-1}return tr=!1,n-1}(e,t,a,l)}(n,i,r,o),(tr?a=(-1===s?function(e,t,n){for(let r=n+1;r<e.length&&e[r][0]===t;n=r++);return n}:function(e,t,n){for(let r=n-1;r>=0&&e[r][0]===t;n=r--);return n})(n,i,a):-1===s&&a++,-1===a||a===n.length)?-1:a);if(-1===d)return tu(null,null,null,null);let h=f[d];if(1===h.length)return tu(null,null,null,null);let{names:m,resolvedSources:g}=e;return tu(g[h[1]],h[2]+1,h[3],5===h.length?m[h[4]]:null)}(this._map,e)}sourceContentFor(e,t){let n=function(e,t){let{sourcesContent:n}=e;if(null==n)return null;let r=function(e,t){let{sources:n,resolvedSources:r}=e,o=n.indexOf(t);return -1===o&&(o=r.indexOf(t)),o}(e,t);return -1===r?null:n[r]}(this._map,e);if(null!=n)return n;if(t)return null;throw Error(`"${e}" is not in the SourceMap.`)}};function tc(e){return e.replace(/^((\.\.\/)+|(\.\.\\)+)/,"")}function tf(e,n){if("."===n[0]){let r=tc(e),o=t.dirname(r);return eU(t.join(o,n))}return n}function td(e){let t,n=[],r=[],o=/import\s+(?:(?:[^{}*'"\s,]+)\s*,?\s*)?(?:{(?:[^{}]*)})?\s*from\s+['"]([^'"]+)['"]/g;for(;null!==(t=o.exec(e));)n.push(t[1]);let i=/import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;for(;null!==(t=i.exec(e));)r.push(t[1]);return{staticImports:n,dynamicImports:r}}var th=class{meta;filename;children;groups;isEndOfPath;constructor(e){this.meta=e?.meta||{},this.filename=e?.filename||"",this.children=new Map,this.groups=[],this.isEndOfPath=!1}},tm=class{root;constructor(e){this.root=new th(e)}insert(e,t){let n=this.root,r=e.split("/").filter(Boolean),o="";for(let e of r)o=o?`${o}/${e}`:e,n.children.has(e)||n.children.set(e,new th({...t})),(n=n.children.get(e)).filename=o;n.isEndOfPath=!0}mergePrefixSingleDirectory(e=this.root){for(let[t,n]of e.children.entries()){if(n.isEndOfPath)break;if(n.children.size>1){this.mergePrefixSingleDirectory(n);continue}for(let[r,o]of(e.children.delete(t),n.children.entries()))e.children.set(`${t}/${r}`,o),o.isEndOfPath||this.mergePrefixSingleDirectory(o)}}walk(e,t){if(e.children.size){for(let[n,r]of e.children.entries()){let o={...r.meta,label:n,groups:r.groups,filename:r.filename};r.isEndOfPath&&delete o.groups,t.enter&&t.enter(o,e,r.isEndOfPath),this.walk(r,t),t.leave&&t.leave(o,e,r.isEndOfPath)}e.children.clear()}}};let tg=process.cwd();function ty(e,t,n){if(t in n)return n[t].source;throw Error(`[analyzer error]: Missing sourcemap for ${e}.`)}let tb=/\.(c|m)?js$/;async function tx(e,t){let[{byteLength:n},{byteLength:r}]=await Promise.all([t.gzip(e),t.brotli(e)]);return{gzipSize:n,brotliSize:r}}function tS(e){return Array.from(new Set(e))}function tA(e,t){return e=[...tS(e)],t=[...tS(t)],[...e.map(e=>({id:e,kind:"static"})),...t.map(e=>({id:e,kind:"dynamic"}))]}var t_=class{originalId;filename;label;parsedSize;mapSize;gzipSize;brotliSize;source;imports;isAsset;isEntry;constructor(e){this.originalId=e,this.filename=e,this.label=e,this.parsedSize=0,this.gzipSize=0,this.brotliSize=0,this.mapSize=0,this.source=[],this.imports=new Set,this.isAsset=!0,this.isEntry=!1}addImports(...e){e.forEach(e=>this.imports.add(e))}async setup(e,n,r,o,i){let s=new tm({meta:{gzipSize:0,brotliSize:0,parsedSize:0,importedBy:[]}});if("asset"===e.kind){this.parsedSize=e.code.byteLength;let{brotliSize:t,gzipSize:r}=await tx(e.code,n);this.brotliSize=t,this.gzipSize=r}else{let{code:a,imports:l,dynamicImports:u,map:p}=e;if(this.addImports(...l,...u),this.mapSize=p.length,this.isEntry=e.isEntry,p){let{grouped:e,files:l}=function(e,t){let n=new tp(t),r={},o=new Set,i=1,s=0,a=eK(e);for(let e=0;e<a.length;e++,s++){let{source:t}=n.originalPositionFor({line:i,column:s});if(null!=t){let n=tc(t),i=a[e];n in r||(r[n]={code:"",importedBy:[]},r[n].code=""),r[n].code+=i,o.add(n)}"\n"===a[e]&&(i+=1,s=-1)}for(let e of n.sources.reduce((e,t)=>{if(t){let r=n.sourceContentFor(t,!0);if(r){let{staticImports:n,dynamicImports:o}=td(r);e.push({id:tc(t),code:r,importedBy:tA(n.map(e=>tf(t,e)),o.map(e=>tf(t,e)))})}}return e},[]))e.id in r&&(r[e.id].importedBy=e.importedBy);return{grouped:r,files:o}}(a,p);if(!l.size){let t=eK(a),{staticImports:n,dynamicImports:r}=td(eK(a));e[this.originalId]={code:t,importedBy:tA(n.map(e=>tf(this.originalId,e)),r.map(e=>tf(this.originalId,e)))},l.add(this.originalId)}let u=Object.entries(e).filter(([e])=>o(e));await Promise.all(u.map(async([e,{code:o,importedBy:a}])=>{let l=eG(o),u=l.byteLength,p=await tx(l,n);s.insert(i(function(e,n=tg){let r=function(e,t=tg){return(e=eU(e)).replace(t,"").replace(/\0/,"")}(e,n);return t.isAbsolute(r)?r.replace("/",""):r}(e,r),r),{meta:{parsedSize:u,...p,importedBy:a}})}))}}for(let e of(s.mergePrefixSingleDirectory(),s.walk(s.root,{enter:(e,t)=>{t&&t.groups.push(e)},leave:(e,t,n)=>{e.groups&&e.groups.length&&Object.assign(e,e.groups.reduce((e,t)=>(e.gzipSize+=t.gzipSize,e.brotliSize+=t.brotliSize,e.parsedSize+=t.parsedSize,e),{gzipSize:0,brotliSize:0,parsedSize:0})),n||delete e.importedBy}}),this.source=s.root.groups,this.source))this.gzipSize+=e.gzipSize,this.brotliSize+=e.brotliSize,this.parsedSize+=e.parsedSize}},tR=class{compressAlorithm;modules;workspaceRoot;pluginContext;chunks;matcher;pathFormatter;constructor(e={}){this.compressAlorithm=function(e){let{gzip:t,brotli:n}=e;return{gzip:function(e={}){return e={...eD,...e},t=>eP(t,e)}(t),brotli:function(e={}){return e={...eF,...e},t=>ej(t,e)}(n)}}(e),this.modules=[],this.pluginContext=null,this.chunks={},this.workspaceRoot=process.cwd(),this.matcher=eH(e.include,e.exclude),this.pathFormatter=e.pathFormatter||(e=>e)}installPluginContext(e){this.pluginContext=e}setupRollupChunks(e){Object.assign(this.chunks,e)}async addModule(e){if("map"===e.fileName.slice(-3)||!this.matcher(e.fileName))return;let t=function(e,t){if("asset"===e.type&&!tb.test(e.fileName))return{code:eG(e.source),filename:e.fileName,kind:"asset"};let n="";if(tb.test(e.fileName)&&("sourcemapFileName"in e&&e.sourcemapFileName&&e.sourcemapFileName in t&&(n=ty(e.fileName,e.sourcemapFileName,t)),!n)){let r=e.fileName+".map";r in t&&(n=ty(e.fileName,r,t))}return{code:eG("asset"===e.type?e.source:e.code),filename:e.fileName,map:n,imports:"chunk"===e.type?e.imports:[],dynamicImports:"chunk"===e.type?e.dynamicImports:[],moduleIds:"chunk"===e.type?Object.keys(e.modules):[],isEntry:"chunk"===e.type&&e.isEntry,kind:"chunk"}}(e,this.chunks),n=new t_(t.filename);await n.setup(t,this.compressAlorithm,this.workspaceRoot,this.matcher,this.pathFormatter),this.modules.push(n)}processModule(){return this.modules.map(e=>{let{originalId:t,imports:n,...r}=e;return{...r,imports:[...n]}})}};async function tE(e,t){let{html:n}=await import("./html.mjs");return n(t.title,function(e,t){let{stringify:n}=JSON;return`var defaultSizes=${n(t)},analyzeModule=${n(e)};`}(e,t.mode))}async function tw(e){let t=()=>Math.floor(64512*Math.random())+1024,n=async e=>new Promise(t=>{let n=d.createServer();n.once("error",e=>{"EADDRINUSE"===e.code?t(!1):t(!0)}),n.once("listening",()=>{n.close(()=>{t(!0)})}),n.listen(e,"localhost")});if(0===e){let e=!1,r=0;for(;!e;)r=t(),e=await n(r);return r}let r=await n(e);if(r)return e;{let t=e+1;for(;;){if(r=await n(t))return t;t++}}}function tv(){let e=[],t={},n=(n,r)=>{let o=new URL(n.url||"",`http://${n.headers.host}`),i=o.pathname||"",s=Object.fromEntries(o.searchParams.entries()),a=[...e],l={req:n,res:r,query:s,params:{}},u=Object.keys(t).find(e=>RegExp(`^${e.replace(/:\w+/g,"\\w+")}$`).test(i));if(u){let e=RegExp(`^${u.replace(/:\w+/g,"(\\w+)")}$`),n=i.match(e);n&&(l.params=u.split("/").filter(e=>e.startsWith(":")).map(e=>e.substring(1)).reduce((e,t,r)=>(e[t]=n[r+1],e),{})),a.push(t[u])}let p=0,c=()=>{let e=a[p++];e&&e(l,c)};c()};return{use:t=>{e.push(t)},get:(e,n)=>{t[e]=n},listen:(e,t)=>{f.createServer(n).listen(e,t)}}}function t$(e){let t="head"===e.injectTo?/([ \t]*)<\/head>/i:/([ \t]*)<\/body>/i;e.descriptors=Array.isArray(e.descriptors)?e.descriptors:[e.descriptors];let n=e.descriptors.map(e=>e.attrs&&e.attrs.length>0?`<${e.kind} ${e.attrs.join(" ")}>${e.text}</${e.kind}>`:`<${e.kind}>${e.text}</${e.kind}>`);return e.html.replace(t,e=>`${n.join("\n")}${e}`)}var tO=class{activeStreams=[];serverEventStream(e,t){t.writeHead(200,{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive","access-control-allow-origin":"*"}),t.write("retry: 500\n"),t.write(":\n\n"),t.flushHeaders();let n=new c;this.activeStreams.push(n);let r=setInterval(()=>{t.write(":\n\n"),t.flushHeaders()},3e3);n.on("message",e=>{t.write(`event: ${e.event}
data: ${e.data}
`),t.flushHeaders()}),e.on("close",()=>{clearInterval(r),this.removeStream(n),t.end()})}sendEvent(e,t){let n={event:e,data:t};this.activeStreams.forEach(e=>{e.emit("message",n)})}removeStream(e){let t=this.activeStreams.indexOf(e);-1!==t&&this.activeStreams.splice(t,1)}};function tC(e){let n=eM(e,["name","generateBundle","closeBundle","api"]),{store:r}=n.api;return r.pluginOptions.enabled?{...n,outputOptions(e){let n=eC(process.cwd());if("."===n&&e.dir){let r=eC(t.resolve(e.dir,".."));"."!==r&&(n=r)}return r.analyzerModule.workspaceRoot=n,"sourcemap"in e&&!r.hasSetupSourcemapOption&&(r.lastSourcemapOption="boolean"==typeof e.sourcemap?e.sourcemap:"hidden"===e.sourcemap),"boolean"==typeof e.sourcemap&&e.sourcemap?e.sourcemap=!0:e.sourcemap="hidden",r.hasSetupSourcemapOption=!0,e}}:n}async function tk(...e){let t=await tE(...e);return t$({html:t,injectTo:"body",descriptors:{kind:"script",text:`
new EventSource('/__vite__bundle__analyer').addEventListener('refresh', () => {
window.location.reload();
})
`}})}function tz(e){let n,r=eM(e,["name","generateBundle","api"]),{store:o}=r.api;if(!o.pluginOptions.enabled)return r;let i=eq(),s=0,a=new tO;return{...r,outputOptions(e){let n=eC(process.cwd());if("."===n&&e.dir){let r=eC(t.resolve(e.dir,".."));"."!==r&&(n=r)}return o.analyzerModule.workspaceRoot=n,"sourcemap"in e&&!o.hasSetupSourcemapOption&&(o.lastSourcemapOption="boolean"==typeof e.sourcemap?e.sourcemap:"hidden"===e.sourcemap),"boolean"==typeof e.sourcemap&&e.sourcemap?e.sourcemap=!0:e.sourcemap="hidden",o.hasSetupSourcemapOption=!0,e},async closeBundle(){if(n){let e=o.analyzerModule.processModule(),t=await tk(e,{title:o.pluginOptions.reportTitle,mode:o.pluginOptions.defaultSizes||"stat"});i.refresh(t),a.sendEvent("refresh",JSON.stringify({timestamp:Date.now()}));return}let e=o.pluginOptions,t=o.analyzerModule.processModule(),r=o.analyzerModule.workspaceRoot;if("function"==typeof e.analyzerMode)return void e.analyzerMode(t);if("json"===e.analyzerMode||"static"===e.analyzerMode){await tP(t,e,r,i),"static"===e.analyzerMode&&e.openAnalyzer&&!tL&&console.error("vite-bundle-analyzer: openAnalyzer is not supported in rolldown adapter");return}if(o.preferLivingServer){let{server:r}=await tj(t,e,i,s,{path:"/__vite__bundle__analyer",handler:(e,t)=>{"text/event-stream"===e.req.headers.accept&&a.serverEventStream(e.req,e.res),t()}},tk);n=r}s++}}}let tL=!!process.env.CI,tT={enabled:!0,analyzerMode:"server",defaultSizes:"stat",summary:!0,include:[],exclude:[]};function tH(e){var t=[e];let[n,r]=function(e){switch(e){case"linux":if(-1!==p.release().toLocaleLowerCase().indexOf("microsoft"))return["win32","cmd.exe"];return["linux","xdg-open"];case"win32":return["win32","cmd.exe"];case"darwin":return["darwin","open"];default:return[e,"xdg-open"]}}(p.platform());"win32"===n&&(t=["/c","start",'""'].concat(t=t.map(e=>e.replace(/[&^]/g,"^$&")))),s.spawn(r,t)}let tM=e=>E.dim(E.bold(e+"")),tN=e=>tM(function(e){let t=["Bytes","KB","MB","GB","TB"];if(!e)return"0 "+t[0];let n=parseInt(`${Math.floor(Math.log(e)/Math.log(1024))}`);return(e/(1<<10*n)).toFixed(2)+" "+t[n]}(e)),tI=e=>{let t=e.length,n=e.reduce((e,t)=>(e.gzip+=t.gzipSize,e.parsed+=t.parsedSize,e.map+=t.mapSize,e),{gzip:0,parsed:0,map:0}),r=[n.gzip&&`gzip: ${tN(n.gzip)}`,n.map&&`map: ${tN(n.map)}`].filter(Boolean).join(" | ");return`${tM(t)} chunks of ${tN(n.parsed)} ${r?`(${r})`:""}`},tB=0;async function tP(n,r,o,i){let{isJSON:s,absPath:a}=function(n,r="stats",o){let i=t.isAbsolute(r)?r:t.join(n,r),s=t.extname(i);return s||(i+="json"===o?".json":".html"),e.existsSync(i)&&tB>0&&(i=t.join(n,`${t.basename(i,s)}-${tB}${s}`)),{isJSON:".json"===t.extname(i),absPath:i}}(o,function(e,t){if("json"===e.analyzerMode||"static"===e.analyzerMode)return"function"==typeof e.fileName?e.fileName(t)||"stats":e.fileName||"stats";throw Error("[analyzer error]: unreachable")}(r,o),r.analyzerMode);if(s)return await eN.writeFile(a,JSON.stringify(n,null,2),"utf8"),{filePath:a,isJSON:!0};let l=await tE(n,{title:r.reportTitle||"vite-bundle-analyzer",mode:r.defaultSizes||"stat"});return await eN.writeFile(a,l,"utf8"),i.into(l),{filePath:a,isJSON:!1,html:l}}async function tj(e,t,n,r,o,i=tE){let s=await i(e,{title:t.reportTitle||"vite-bundle-analyzer",mode:t.defaultSizes||"stat"});n.into(s);let l=await tw("analyzerPort"in t?"auto"===t.analyzerPort?0:t.analyzerPort||0:8888+r),u=tv();return u.get("/",e=>{e.res.writeHead(200,{"Content-Type":"text/html; charset=utf8;","content-Encoding":"gzip"}),n.refresh(),n.rs.pipe(a.createGzip()).pipe(e.res)}),o&&u.get(o.path,o.handler),u.listen(l,()=>{console.log("server run on ",E.hex("#5B45DE")(`http://localhost:${l}`))}),"openAnalyzer"in t&&!t.openAnalyzer||tL||tH(`http://localhost:${l}`),{server:u,port:l}}function tD(e){let n,{reportTitle:r="vite-bundle-analyzer"}=e={...tT,...e},o=function(e={}){return new tR(e)}({gzip:e.gzipOptions,brotli:e.brotliOptions,include:e.include,exclude:e.exclude,pathFormatter:e.pathFormatter}),i=process.cwd(),s=!0,a=process.cwd(),l=("server"===e.analyzerMode||"static"===e.analyzerMode)&&!tL,u="json"===e.analyzerMode||"static"===e.analyzerMode,p={analyzerModule:o,lastSourcemapOption:!1,hasSetupSourcemapOption:!1,pluginOptions:{...e,reportTitle:r},preferLivingServer:l,preferSilent:u},c={name:"vite-bundle-analyzer",apply:"build",enforce:"post",api:{store:p,processModule:()=>o.processModule()}};if(!e.enabled)return c;let f=eq();return{...c,config:e=>(e.build||(e.build={}),"sourcemap"in e.build&&!p.hasSetupSourcemapOption&&(p.lastSourcemapOption="boolean"==typeof e.build.sourcemap?e.build.sourcemap:"hidden"===e.build.sourcemap,"inline"===e.build.sourcemap&&console.warn("vite-bundle-analyzer: sourcemap option is set to `inline`, it might cause the result inaccurate.")),e.build&&("boolean"==typeof e.build.sourcemap?e.build.sourcemap=!0:e.build.sourcemap="hidden",eW(`plugin status is ${e.build.sourcemap?E.green("ok"):E.red("invalid")}`)),p.hasSetupSourcemapOption=!0,e),configResolved(r){if(i=t.resolve(r.root,r.build.outDir??""),n=r.logger,o.workspaceRoot=eC(r.root),e.summary){let e=r.plugins.find(e=>"vite:reporter"===e.name);if(s=!!e?.writeBundle,e?.writeBundle){let t="function"==typeof e.writeBundle?e.writeBundle:e.writeBundle?.handler,r=async function(...e){await t?.apply(this,e),n.info(tI(o.modules))};"function"!=typeof e.writeBundle?e.writeBundle.handler=r:e.writeBundle=r}}},async generateBundle(e,t){for(let e in o.installPluginContext(this),o.setupRollupChunks(t),t){let n=t[e];await o.addModule(n)}if(!p.lastSourcemapOption)for(let e in t){let n=t[e];if(tb.test(n.fileName)){let e=n.fileName+".map";e in t&&Reflect.deleteProperty(t,e),"chunk"===n.type&&Reflect.deleteProperty(n,"map")}}},async closeBundle(){if("function"==typeof e.analyzerMode)return void e.analyzerMode(o.processModule());e.summary&&!s&&n.info(tI(o.modules));let t=o.processModule();(!u||(await tP(t,e,i,f),"static"!==e.analyzerMode||e.openAnalyzer))&&(l&&await tj(t,e,f,tB),tB++)}}}export{tO as SSE,S as __commonJS,_ as __toESM,tC as adapter,tD as analyzer,E as ansis_default,tj as createAnalyzerServer,tv as createServer,tw as ensureEmptyPort,tP as handleStaticOutput,t$ as injectHTMLTag,tL as isCI,tH as openBrowser,tE as renderView,eO as searchForPackageRoot,eC as searchForWorkspaceRoot,tz as unstableRolldownAdapter};