@builder.io/dev-tools 1.6.49 → 1.6.50-dev.202505201747.032b583c

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/webpack/index.cjs CHANGED
@@ -1,29 +1,2885 @@
1
- "use strict";var Nt=Object.create;var Y=Object.defineProperty;var jt=Object.getOwnPropertyDescriptor;var xt=Object.getOwnPropertyNames;var kt=Object.getPrototypeOf,It=Object.prototype.hasOwnProperty;var Dt=(n,e,t)=>e in n?Y(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var j=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),Rt=(n,e)=>{for(var t in e)Y(n,t,{get:e[t],enumerable:!0})},ze=(n,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of xt(e))!It.call(n,i)&&i!==t&&Y(n,i,{get:()=>e[i],enumerable:!(s=jt(e,i))||s.enumerable});return n};var Lt=(n,e,t)=>(t=n!=null?Nt(kt(n)):{},ze(e||!n||!n.__esModule?Y(t,"default",{value:n,enumerable:!0}):t,n)),Ht=n=>ze(Y({},"__esModule",{value:!0}),n);var Ee=(n,e,t)=>Dt(n,typeof e!="symbol"?e+"":e,t);var G=j((Us,qe)=>{"use strict";var pe=class{source(){throw new Error("Abstract")}buffer(){let e=this.source();return Buffer.isBuffer(e)?e:Buffer.from(e,"utf-8")}size(){return this.buffer().length}map(e){return null}sourceAndMap(e){return{source:this.source(),map:this.map(e)}}updateHash(e){throw new Error("Abstract")}};qe.exports=pe});var ie=j((Fs,Ne)=>{"use strict";var Pt=n=>{if(n===void 0)return{};let e=n.lastIndexOf(`
2
- `);if(e===-1)return{generatedLine:1,generatedColumn:n.length,source:n};let t=2;for(let s=0;s<e;s++)n.charCodeAt(s)===10&&t++;return{generatedLine:t,generatedColumn:n.length-e-1,source:n}};Ne.exports=Pt});var X=j((Js,je)=>{var Wt=n=>{let e=[],t=n.length,s=0;for(;s<t;)if(n.charCodeAt(s)===10)e.push(`
3
- `),s++;else{let r=s+1;for(;r<t&&n.charCodeAt(r)!==10;)r++;e.push(n.slice(s,r+1)),s=r+1}return e};je.exports=Wt});var ue=j((Xs,xe)=>{"use strict";var Gt=ie(),Vt=X(),Ut=(n,e,t,s)=>{let i=1,r=Vt(n),f;for(f of r)e(f,i,0,-1,-1,-1,-1),i++;return r.length===0||f.endsWith(`
4
- `)?{generatedLine:r.length+1,generatedColumn:0}:{generatedLine:r.length,generatedColumn:f.length}};xe.exports=(n,e,t,s,i)=>i?Gt(n):Ut(n,e,t,s)});var fe=j(($s,ke)=>{"use strict";var Ft=ue(),Jt=G(),_e=class extends Jt{constructor(e,t=!1){super();let s=Buffer.isBuffer(e);if(!s&&typeof e!="string")throw new TypeError("argument 'value' must be either string of Buffer");this._valueIsBuffer=!t&&s,this._value=t&&s?void 0:e,this._valueAsBuffer=s?e:void 0,this._valueAsString=s?void 0:e}isBuffer(){return this._valueIsBuffer}source(){return this._value===void 0&&(this._value=this._valueAsBuffer.toString("utf-8")),this._value}buffer(){return this._valueAsBuffer===void 0&&(this._valueAsBuffer=Buffer.from(this._value,"utf-8")),this._valueAsBuffer}map(e){return null}streamChunks(e,t,s,i){return this._value===void 0&&(this._value=Buffer.from(this._valueAsBuffer,"utf-8")),this._valueAsString===void 0&&(this._valueAsString=typeof this._value=="string"?this._value:this._value.toString("utf-8")),Ft(this._valueAsString,t,s,i,!!(e&&e.finalSource))}updateHash(e){this._valueAsBuffer===void 0&&(this._valueAsBuffer=Buffer.from(this._value,"utf-8")),e.update("RawSource"),e.update(this._valueAsBuffer)}};ke.exports=_e});var ge=j((Ks,De)=>{"use strict";var ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Ie=32,Xt=n=>n&&n.columns===!1?Kt():$t(),$t=()=>{let n=1,e=0,t=0,s=1,i=0,r=0,f=!1,u=!1,h=!0;return(o,a,l,d,m,c)=>{if(f&&n===o){if(l===t&&d===s&&m===i&&!u&&c<0)return""}else if(l<0)return"";let _;n<o?(_=";".repeat(o-n),n=o,e=0,h=!1):h?(_="",h=!1):_=",";let g=A=>{let O=A>>>31&1,y=A>>31,E=(A+y^y)<<1|O;for(;;){let p=E&31;if(E>>=5,E===0){_+=ce[p];break}else _+=ce[p|Ie]}};return g(a-e),e=a,l>=0?(f=!0,l===t?_+="A":(g(l-t),t=l),g(d-s),s=d,m===i?_+="A":(g(m-i),i=m),c>=0?(g(c-r),r=c,u=!0):u=!1):f=!1,_}},Kt=()=>{let n=0,e=1,t=0,s=1;return(i,r,f,u,h,o)=>{if(f<0||n===i)return"";let a,l=d=>{let m=d>>>31&1,c=d>>31,g=(d+c^c)<<1|m;for(;;){let A=g&31;if(g>>=5,g===0){a+=ce[A];break}else a+=ce[A|Ie]}};return n=i,i===e+1?(e=i,f===t?(t=f,u===s+1?(s=u,";AACA"):(a=";AA",l(u-s),s=u,a+"A")):(a=";A",l(f-t),t=f,l(u-s),s=u,a+"A")):(a=";".repeat(i-e),e=i,f===t?(t=f,u===s+1?(s=u,a+"AACA"):(a+="AA",l(u-s),s=u,a+"A")):(a+="A",l(f-t),t=f,l(u-s),s=u,a+"A"))}};De.exports=Xt});var $=j(Se=>{"use strict";var Re=ge();Se.getSourceAndMap=(n,e)=>{let t="",s="",i=[],r=[],f=[],u=Re(e),{source:h}=n.streamChunks(Object.assign({},e,{finalSource:!0}),(o,a,l,d,m,c,_)=>{o!==void 0&&(t+=o),s+=u(a,l,d,m,c,_)},(o,a,l)=>{for(;i.length<o;)i.push(null);if(i[o]=a,l!==void 0){for(;r.length<o;)r.push(null);r[o]=l}},(o,a)=>{for(;f.length<o;)f.push(null);f[o]=a});return{source:h!==void 0?h:t,map:s.length>0?{version:3,file:"x",mappings:s,sources:i,sourcesContent:r.length>0?r:void 0,names:f}:null}};Se.getMap=(n,e)=>{let t="",s=[],i=[],r=[],f=Re(e);return n.streamChunks(Object.assign({},e,{source:!1,finalSource:!0}),(u,h,o,a,l,d,m)=>{t+=f(h,o,a,l,d,m)},(u,h,o)=>{for(;s.length<u;)s.push(null);if(s[u]=h,o!==void 0){for(;i.length<u;)i.push(null);i[u]=o}},(u,h)=>{for(;r.length<u;)r.push(null);r[u]=h}),t.length>0?{version:3,file:"x",mappings:t,sources:s,sourcesContent:i.length>0?i:void 0,names:r}:null}});var He=j((Ys,Le)=>{var Qt=n=>{let e=n.length;if(e===0)return null;let t=[],s=0;for(;s<e;){let i=s;e:{let r=n.charCodeAt(s);for(;r!==10&&r!==59&&r!==123&&r!==125;){if(++s>=e)break e;r=n.charCodeAt(s)}for(;r===59||r===32||r===123||r===125||r===13||r===9;){if(++s>=e)break e;r=n.charCodeAt(s)}r===10&&s++}t.push(n.slice(i,s))}return t};Le.exports=Qt});var We=j((Zs,Pe)=>{"use strict";var{getMap:Yt,getSourceAndMap:Zt}=$(),es=X(),ts=ie(),ss=G(),rs=He(),me=class extends ss{constructor(e,t){super();let s=Buffer.isBuffer(e);this._value=s?void 0:e,this._valueAsBuffer=s?e:void 0,this._name=t}getName(){return this._name}source(){return this._value===void 0&&(this._value=this._valueAsBuffer.toString("utf-8")),this._value}buffer(){return this._valueAsBuffer===void 0&&(this._valueAsBuffer=Buffer.from(this._value,"utf-8")),this._valueAsBuffer}map(e){return Yt(this,e)}sourceAndMap(e){return Zt(this,e)}streamChunks(e,t,s,i){this._value===void 0&&(this._value=this._valueAsBuffer.toString("utf-8")),s(0,this._name,this._value);let r=!!(e&&e.finalSource);if(!e||e.columns!==!1){let f=rs(this._value),u=1,h=0;if(f!==null)for(let o of f){let a=o.endsWith(`
5
- `);a&&o.length===1?r||t(o,u,h,-1,-1,-1,-1):t(r?void 0:o,u,h,0,u,h,-1),a?(u++,h=0):h+=o.length}return{generatedLine:u,generatedColumn:h,source:r?this._value:void 0}}else if(r){let f=ts(this._value),{generatedLine:u,generatedColumn:h}=f;if(h===0)for(let o=1;o<u;o++)t(void 0,o,0,0,o,0,-1);else for(let o=1;o<=u;o++)t(void 0,o,0,0,o,0,-1);return f}else{let f=1,u=es(this._value),h;for(h of u)t(r?void 0:h,f,0,0,f,0,-1),f++;return u.length===0||h.endsWith(`
6
- `)?{generatedLine:u.length+1,generatedColumn:0,source:r?this._value:void 0}:{generatedLine:u.length,generatedColumn:h.length,source:r?this._value:void 0}}}updateHash(e){this._valueAsBuffer===void 0&&(this._valueAsBuffer=Buffer.from(this._value,"utf-8")),e.update("OriginalSource"),e.update(this._valueAsBuffer),e.update(this._name||"")}};Pe.exports=me});var Ve=j((er,Ge)=>{"use strict";var ns=(n,e)=>{if(e<0)return null;let{sourceRoot:t,sources:s}=n,i=s[e];return t?t.endsWith("/")?t+i:t+"/"+i:i};Ge.exports=ns});var Je=j((tr,Fe)=>{"use strict";var Ue="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",K=new Uint8Array(123);{K.fill(66);for(let n=0;n<Ue.length;n++)K[Ue.charCodeAt(n)]=n;K[44]=64,K[59]=65}var is=K.length-1,us=(n,e)=>{let t=new Uint32Array([0,0,1,0,0]),s=0,i=0,r=0,f=1,u=-1;for(let h=0;h<n.length;h++){let o=n.charCodeAt(h);if(o>is)continue;let a=K[o];if(a&64)t[0]>u&&(s===1?e(f,t[0],-1,-1,-1,-1):s===4?e(f,t[0],t[1],t[2],t[3],-1):s===5&&e(f,t[0],t[1],t[2],t[3],t[4]),u=t[0]),s=0,a===65&&(f++,t[0]=0,u=-1);else if(a&32)i|=(a&31)<<r,r+=5;else{i|=a<<r;let l=i&1?-(i>>1):i>>1;t[s++]+=l,r=0,i=0}}s===1?e(f,t[0],-1,-1,-1,-1):s===4?e(f,t[0],t[1],t[2],t[3],-1):s===5&&e(f,t[0],t[1],t[2],t[3],t[4])};Fe.exports=us});var Z=j((sr,Ke)=>{"use strict";var Xe=ie(),oe=Ve(),le=Je(),$e=X(),fs=(n,e,t,s,i)=>{let r=$e(n);if(r.length===0)return{generatedLine:1,generatedColumn:0};let{sources:f,sourcesContent:u,names:h,mappings:o}=e;for(let p=0;p<f.length;p++)s(p,oe(e,p),u&&u[p]||void 0);if(h)for(let p=0;p<h.length;p++)i(p,h[p]);let a=r[r.length-1],l=a.endsWith(`
7
- `),d=l?r.length+1:r.length,m=l?0:a.length,c=1,_=0,g=!1,A=-1,O=-1,y=-1,v=-1,E=(p,B,q,w,b,T)=>{if(g&&c<=r.length){let S,M=c,N=_,z=r[c-1];p!==c?(S=z.slice(_),c++,_=0):(S=z.slice(_,B),_=B),S&&t(S,M,N,A,O,y,v),g=!1}if(p>c&&_>0){if(c<=r.length){let S=r[c-1].slice(_);t(S,c,_,-1,-1,-1,-1)}c++,_=0}for(;p>c;)c<=r.length&&t(r[c-1],c,0,-1,-1,-1,-1),c++;if(B>_){if(c<=r.length){let S=r[c-1].slice(_,B);t(S,c,_,-1,-1,-1,-1)}_=B}q>=0&&(p<d||p===d&&B<m)&&(g=!0,A=q,O=w,y=b,v=T)};return le(o,E),E(d,m,-1,-1,-1,-1),{generatedLine:d,generatedColumn:m}},cs=(n,e,t,s,i)=>{let r=$e(n);if(r.length===0)return{generatedLine:1,generatedColumn:0};let{sources:f,sourcesContent:u,mappings:h}=e;for(let _=0;_<f.length;_++)s(_,oe(e,_),u&&u[_]||void 0);let o=1;for(le(h,(_,g,A,O,y,v)=>{if(!(A<0||_<o||_>r.length)){for(;_>o;)o<=r.length&&t(r[o-1],o,0,-1,-1,-1,-1),o++;_<=r.length&&(t(r[_-1],_,0,A,O,y,-1),o++)}});o<=r.length;o++)t(r[o-1],o,0,-1,-1,-1,-1);let l=r[r.length-1],d=l.endsWith(`
8
- `),m=d?r.length+1:r.length,c=d?0:l.length;return{generatedLine:m,generatedColumn:c}},os=(n,e,t,s,i)=>{let r=Xe(n),{generatedLine:f,generatedColumn:u}=r;if(f===1&&u===0)return r;let{sources:h,sourcesContent:o,names:a,mappings:l}=e;for(let c=0;c<h.length;c++)s(c,oe(e,c),o&&o[c]||void 0);if(a)for(let c=0;c<a.length;c++)i(c,a[c]);let d=0;return le(l,(c,_,g,A,O,y)=>{c>=f&&(_>=u||c>f)||(g>=0?(t(void 0,c,_,g,A,O,y),d=c):d===c&&(t(void 0,c,_,-1,-1,-1,-1),d=0))}),r},ls=(n,e,t,s,i)=>{let r=Xe(n),{generatedLine:f,generatedColumn:u}=r;if(f===1&&u===0)return{generatedLine:1,generatedColumn:0};let{sources:h,sourcesContent:o,mappings:a}=e;for(let c=0;c<h.length;c++)s(c,oe(e,c),o&&o[c]||void 0);let l=u===0?f-1:f,d=1;return le(a,(c,_,g,A,O,y)=>{g>=0&&d<=c&&c<=l&&(t(void 0,c,0,g,A,O,-1),d=c+1)}),r};Ke.exports=(n,e,t,s,i,r,f)=>f?r?os(n,e,t,s,i):fs(n,e,t,s,i):r?ls(n,e,t,s,i):cs(n,e,t,s,i)});var et=j((rr,Ze)=>{"use strict";var Qe=Z(),Ye=X(),as=(n,e,t,s,i,r,f,u,h,o,a)=>{let l=new Map,d=new Map,m=[],c=[],_=[],g=-2,A=[],O=[],y=[],v=[],E=[],p=[],B=[],q=(w,b)=>{if(w>B.length)return-1;let{mappingsData:T}=B[w-1],S=0,M=T.length/5;for(;S<M;){let N=S+M>>1;T[N*5]<=b?S=N+1:M=N}return S===0?-1:S-1};return Qe(n,e,(w,b,T,S,M,N,z)=>{if(S===g){let R=q(M,N);if(R!==-1){let{chunks:L,mappingsData:I}=B[M-1],H=R*5,C=I[H+1],k=I[H+2],F=I[H+3],U=I[H+4];if(C>=0){let Et=L[R],qt=I[H],te=N-qt;if(te>0){let x=C<v.length?v[C]:null;if(x===void 0){let D=y[C];x=D?Ye(D):null,v[C]=x}if(x!==null){let D=k<=x.length?x[k-1].slice(F,F+te):"";Et.slice(0,te)===D&&(F+=te,U=-1)}}let se=C<A.length?A[C]:-2;if(se===-2){let[x,D]=C<O.length?O[C]:[null,void 0],J=l.get(x);J===void 0&&(l.set(x,J=l.size),u(J,x,D)),se=J,A[C]=se}let W=-1;if(U>=0){if(W=U<E.length?E[U]:-2,W===-2){let x=U<p.length?p[U]:void 0;if(x){let D=d.get(x);D===void 0&&(d.set(x,D=d.size),h(D,x)),W=D}else W=-1;E[U]=W}}else if(z>=0){let x=v[C];if(x===void 0){let D=y[C];x=D?Ye(D):null,v[C]=x}if(x!==null){let D=_[z],J=k<=x.length?x[k-1].slice(F,F+D.length):"";if(D===J&&(W=z<c.length?c[z]:-2,W===-2)){let re=_[z];if(re){let ne=d.get(re);ne===void 0&&(d.set(re,ne=d.size),h(ne,re)),W=ne}else W=-1;c[z]=W}}}f(w,b,T,se,k,F,W);return}}if(r){f(w,b,T,-1,-1,-1,-1);return}else if(m[S]===-2){let L=l.get(t);L===void 0&&(l.set(n,L=l.size),u(L,t,s)),m[S]=L}}let P=S<0||S>=m.length?-1:m[S];if(P<0)f(w,b,T,-1,-1,-1,-1);else{let R=-1;if(z>=0&&z<c.length&&(R=c[z],R===-2)){let L=_[z],I=d.get(L);I===void 0&&(d.set(L,I=d.size),h(I,L)),R=I,c[z]=R}f(w,b,T,P,M,N,R)}},(w,b,T)=>{if(b===t)g=w,s!==void 0?T=s:s=T,m[w]=-2,Qe(T,i,(S,M,N,z,P,R,L)=>{for(;B.length<M;)B.push({mappingsData:[],chunks:[]});let I=B[M-1];I.mappingsData.push(N,z,P,R,L),I.chunks.push(S)},(S,M,N)=>{y[S]=N,v[S]=void 0,A[S]=-2,O[S]=[M,N]},(S,M)=>{E[S]=-2,p[S]=M},!1,a);else{let S=l.get(b);S===void 0&&(l.set(b,S=l.size),u(S,b,T)),m[w]=S}},(w,b)=>{c[w]=-2,_[w]=b},o,a)};Ze.exports=as});var st=j((nr,tt)=>{"use strict";var hs=G(),ds=Z(),ps=et(),{getMap:_s,getSourceAndMap:gs}=$(),Ae=class extends hs{constructor(e,t,s,i,r,f){super();let u=Buffer.isBuffer(e);this._valueAsString=u?void 0:e,this._valueAsBuffer=u?e:void 0,this._name=t,this._hasSourceMap=!!s;let h=Buffer.isBuffer(s),o=typeof s=="string";this._sourceMapAsObject=h||o?void 0:s,this._sourceMapAsString=o?s:void 0,this._sourceMapAsBuffer=h?s:void 0,this._hasOriginalSource=!!i;let a=Buffer.isBuffer(i);this._originalSourceAsString=a?void 0:i,this._originalSourceAsBuffer=a?i:void 0,this._hasInnerSourceMap=!!r;let l=Buffer.isBuffer(r),d=typeof r=="string";this._innerSourceMapAsObject=l||d?void 0:r,this._innerSourceMapAsString=d?r:void 0,this._innerSourceMapAsBuffer=l?r:void 0,this._removeOriginalSource=f}_ensureValueBuffer(){this._valueAsBuffer===void 0&&(this._valueAsBuffer=Buffer.from(this._valueAsString,"utf-8"))}_ensureValueString(){this._valueAsString===void 0&&(this._valueAsString=this._valueAsBuffer.toString("utf-8"))}_ensureOriginalSourceBuffer(){this._originalSourceAsBuffer===void 0&&this._hasOriginalSource&&(this._originalSourceAsBuffer=Buffer.from(this._originalSourceAsString,"utf-8"))}_ensureOriginalSourceString(){this._originalSourceAsString===void 0&&this._hasOriginalSource&&(this._originalSourceAsString=this._originalSourceAsBuffer.toString("utf-8"))}_ensureInnerSourceMapObject(){this._innerSourceMapAsObject===void 0&&this._hasInnerSourceMap&&(this._ensureInnerSourceMapString(),this._innerSourceMapAsObject=JSON.parse(this._innerSourceMapAsString))}_ensureInnerSourceMapBuffer(){this._innerSourceMapAsBuffer===void 0&&this._hasInnerSourceMap&&(this._ensureInnerSourceMapString(),this._innerSourceMapAsBuffer=Buffer.from(this._innerSourceMapAsString,"utf-8"))}_ensureInnerSourceMapString(){this._innerSourceMapAsString===void 0&&this._hasInnerSourceMap&&(this._innerSourceMapAsBuffer!==void 0?this._innerSourceMapAsString=this._innerSourceMapAsBuffer.toString("utf-8"):this._innerSourceMapAsString=JSON.stringify(this._innerSourceMapAsObject))}_ensureSourceMapObject(){this._sourceMapAsObject===void 0&&(this._ensureSourceMapString(),this._sourceMapAsObject=JSON.parse(this._sourceMapAsString))}_ensureSourceMapBuffer(){this._sourceMapAsBuffer===void 0&&(this._ensureSourceMapString(),this._sourceMapAsBuffer=Buffer.from(this._sourceMapAsString,"utf-8"))}_ensureSourceMapString(){this._sourceMapAsString===void 0&&(this._sourceMapAsBuffer!==void 0?this._sourceMapAsString=this._sourceMapAsBuffer.toString("utf-8"):this._sourceMapAsString=JSON.stringify(this._sourceMapAsObject))}getArgsAsBuffers(){return this._ensureValueBuffer(),this._ensureSourceMapBuffer(),this._ensureOriginalSourceBuffer(),this._ensureInnerSourceMapBuffer(),[this._valueAsBuffer,this._name,this._sourceMapAsBuffer,this._originalSourceAsBuffer,this._innerSourceMapAsBuffer,this._removeOriginalSource]}buffer(){return this._ensureValueBuffer(),this._valueAsBuffer}source(){return this._ensureValueString(),this._valueAsString}map(e){return this._hasInnerSourceMap?_s(this,e):(this._ensureSourceMapObject(),this._sourceMapAsObject)}sourceAndMap(e){return this._hasInnerSourceMap?gs(this,e):(this._ensureValueString(),this._ensureSourceMapObject(),{source:this._valueAsString,map:this._sourceMapAsObject})}streamChunks(e,t,s,i){return this._ensureValueString(),this._ensureSourceMapObject(),this._ensureOriginalSourceString(),this._hasInnerSourceMap?(this._ensureInnerSourceMapObject(),ps(this._valueAsString,this._sourceMapAsObject,this._name,this._originalSourceAsString,this._innerSourceMapAsObject,this._removeOriginalSource,t,s,i,!!(e&&e.finalSource),!!(e&&e.columns!==!1))):ds(this._valueAsString,this._sourceMapAsObject,t,s,i,!!(e&&e.finalSource),!!(e&&e.columns!==!1))}updateHash(e){this._ensureValueBuffer(),this._ensureSourceMapBuffer(),this._ensureOriginalSourceBuffer(),this._ensureInnerSourceMapBuffer(),e.update("SourceMapSource"),e.update(this._valueAsBuffer),e.update(this._sourceMapAsBuffer),this._hasOriginalSource&&e.update(this._originalSourceAsBuffer),this._hasInnerSourceMap&&e.update(this._innerSourceMapAsBuffer),e.update(this._removeOriginalSource?"true":"false")}};tt.exports=Ae});var ee=j((ir,rt)=>{"use strict";var Ss=ue(),ms=Z();rt.exports=(n,e,t,s,i)=>{if(typeof n.streamChunks=="function")return n.streamChunks(e,t,s,i);{let r=n.sourceAndMap(e);return r.map?ms(r.source,r.map,t,s,i,!!(e&&e.finalSource),!!(e&&e.columns!==!1)):Ss(r.source,t,s,i,!!(e&&e.finalSource))}}});var it=j((ur,nt)=>{"use strict";var As=ge(),Ms=ee(),Bs=(n,e,t,s,i)=>{let r="",f="",u=[],h=[],o=[],a=As(Object.assign({},e,{columns:!0})),l=!!(e&&e.finalSource),{generatedLine:d,generatedColumn:m,source:c}=Ms(n,e,(g,A,O,y,v,E,p)=>(g!==void 0&&(r+=g),f+=a(A,O,y,v,E,p),t(l?void 0:g,A,O,y,v,E,p)),(g,A,O)=>{for(;u.length<g;)u.push(null);if(u[g]=A,O!==void 0){for(;h.length<g;)h.push(null);h[g]=O}return s(g,A,O)},(g,A)=>{for(;o.length<g;)o.push(null);return o[g]=A,i(g,A)}),_=c!==void 0?c:r;return{result:{generatedLine:d,generatedColumn:m,source:l?_:void 0},source:_,map:f.length>0?{version:3,file:"x",mappings:f,sources:u,sourcesContent:h.length>0?h:void 0,names:o}:null}};nt.exports=Bs});var ft=j((fr,ut)=>{"use strict";var vs=G(),bs=Z(),Os=ue(),ys=it(),ws=n=>{if(typeof n!="object"||!n)return n;let e=Object.assign({},n);return n.mappings&&(e.mappings=Buffer.from(n.mappings,"utf-8")),n.sourcesContent&&(e.sourcesContent=n.sourcesContent.map(t=>t&&Buffer.from(t,"utf-8"))),e},Ts=n=>{if(typeof n!="object"||!n)return n;let e=Object.assign({},n);return n.mappings&&(e.mappings=n.mappings.toString("utf-8")),n.sourcesContent&&(e.sourcesContent=n.sourcesContent.map(t=>t&&t.toString("utf-8"))),e},Me=class extends vs{constructor(e,t){super(),this._source=e,this._cachedSourceType=t?t.source:void 0,this._cachedSource=void 0,this._cachedBuffer=t?t.buffer:void 0,this._cachedSize=t?t.size:void 0,this._cachedMaps=t?t.maps:new Map,this._cachedHashUpdate=t?t.hash:void 0}getCachedData(){let e=new Map;for(let t of this._cachedMaps){let s=t[1];s.bufferedMap===void 0&&(s.bufferedMap=ws(this._getMapFromCacheEntry(s))),e.set(t[0],{map:void 0,bufferedMap:s.bufferedMap})}return this._cachedSource&&this.buffer(),{buffer:this._cachedBuffer,source:this._cachedSourceType!==void 0?this._cachedSourceType:typeof this._cachedSource=="string"?!0:Buffer.isBuffer(this._cachedSource)?!1:void 0,size:this._cachedSize,maps:e,hash:this._cachedHashUpdate}}originalLazy(){return this._source}original(){return typeof this._source=="function"&&(this._source=this._source()),this._source}source(){let e=this._getCachedSource();return e!==void 0?e:this._cachedSource=this.original().source()}_getMapFromCacheEntry(e){if(e.map!==void 0)return e.map;if(e.bufferedMap!==void 0)return e.map=Ts(e.bufferedMap)}_getCachedSource(){if(this._cachedSource!==void 0)return this._cachedSource;if(this._cachedBuffer&&this._cachedSourceType!==void 0)return this._cachedSource=this._cachedSourceType?this._cachedBuffer.toString("utf-8"):this._cachedBuffer}buffer(){if(this._cachedBuffer!==void 0)return this._cachedBuffer;if(this._cachedSource!==void 0)return Buffer.isBuffer(this._cachedSource)?this._cachedBuffer=this._cachedSource:this._cachedBuffer=Buffer.from(this._cachedSource,"utf-8");if(typeof this.original().buffer=="function")return this._cachedBuffer=this.original().buffer();let e=this.source();return Buffer.isBuffer(e)?this._cachedBuffer=e:this._cachedBuffer=Buffer.from(e,"utf-8")}size(){if(this._cachedSize!==void 0)return this._cachedSize;if(this._cachedBuffer!==void 0)return this._cachedSize=this._cachedBuffer.length;let e=this._getCachedSource();return e!==void 0?this._cachedSize=Buffer.byteLength(e):this._cachedSize=this.original().size()}sourceAndMap(e){let t=e?JSON.stringify(e):"{}",s=this._cachedMaps.get(t);if(s!==void 0){let f=this._getMapFromCacheEntry(s);return{source:this.source(),map:f}}let i=this._getCachedSource(),r;if(i!==void 0)r=this.original().map(e);else{let f=this.original().sourceAndMap(e);i=f.source,r=f.map,this._cachedSource=i}return this._cachedMaps.set(t,{map:r,bufferedMap:void 0}),{source:i,map:r}}streamChunks(e,t,s,i){let r=e?JSON.stringify(e):"{}";if(this._cachedMaps.has(r)&&(this._cachedBuffer!==void 0||this._cachedSource!==void 0)){let{source:o,map:a}=this.sourceAndMap(e);return a?bs(o,a,t,s,i,!!(e&&e.finalSource),!0):Os(o,t,s,i,!!(e&&e.finalSource))}let{result:f,source:u,map:h}=ys(this.original(),e,t,s,i);return this._cachedSource=u,this._cachedMaps.set(r,{map:h,bufferedMap:void 0}),f}map(e){let t=e?JSON.stringify(e):"{}",s=this._cachedMaps.get(t);if(s!==void 0)return this._getMapFromCacheEntry(s);let i=this.original().map(e);return this._cachedMaps.set(t,{map:i,bufferedMap:void 0}),i}updateHash(e){if(this._cachedHashUpdate!==void 0){for(let r of this._cachedHashUpdate)e.update(r);return}let t=[],s,i={update:r=>{typeof r=="string"&&r.length<10240?s===void 0?s=r:(s+=r,s.length>102400&&(t.push(Buffer.from(s)),s=void 0)):(s!==void 0&&(t.push(Buffer.from(s)),s=void 0),t.push(r))}};this.original().updateHash(i),s!==void 0&&t.push(Buffer.from(s));for(let r of t)e.update(r);this._cachedHashUpdate=t}};ut.exports=Me});var lt=j((cr,ot)=>{"use strict";var Cs=G(),ct=fe(),zs=ee(),{getMap:Es,getSourceAndMap:qs}=$(),Be=new WeakSet,ve=class n extends Cs{constructor(){super(),this._children=[];for(let e=0;e<arguments.length;e++){let t=arguments[e];if(t instanceof n)for(let s of t._children)this._children.push(s);else this._children.push(t)}this._isOptimized=arguments.length===0}getChildren(){return this._isOptimized||this._optimize(),this._children}add(e){if(e instanceof n)for(let t of e._children)this._children.push(t);else this._children.push(e);this._isOptimized=!1}addAllSkipOptimizing(e){for(let t of e)this._children.push(t)}buffer(){this._isOptimized||this._optimize();let e=[];for(let t of this._children)if(typeof t.buffer=="function")e.push(t.buffer());else{let s=t.source();Buffer.isBuffer(s)?e.push(s):e.push(Buffer.from(s,"utf-8"))}return Buffer.concat(e)}source(){this._isOptimized||this._optimize();let e="";for(let t of this._children)e+=t.source();return e}size(){this._isOptimized||this._optimize();let e=0;for(let t of this._children)e+=t.size();return e}map(e){return Es(this,e)}sourceAndMap(e){return qs(this,e)}streamChunks(e,t,s,i){if(this._isOptimized||this._optimize(),this._children.length===1)return this._children[0].streamChunks(e,t,s,i);let r=0,f=0,u=new Map,h=new Map,o=!!(e&&e.finalSource),a="",l=!1;for(let d of this._children){let m=[],c=[],_=0,{generatedLine:g,generatedColumn:A,source:O}=zs(d,e,(y,v,E,p,B,q,w)=>{let b=v+r,T=v===1?E+f:E;l&&((v!==1||E!==0)&&t(void 0,r+1,f,-1,-1,-1,-1),l=!1);let S=p<0||p>=m.length?-1:m[p],M=w<0||w>=c.length?-1:c[w];_=S<0?0:v,o?(y!==void 0&&(a+=y),S>=0&&t(void 0,b,T,S,B,q,M)):S<0?t(y,b,T,-1,-1,-1,-1):t(y,b,T,S,B,q,M)},(y,v,E)=>{let p=u.get(v);p===void 0&&(u.set(v,p=u.size),s(p,v,E)),m[y]=p},(y,v)=>{let E=h.get(v);E===void 0&&(h.set(v,E=h.size),i(E,v)),c[y]=E});O!==void 0&&(a+=O),l&&(g!==1||A!==0)&&(t(void 0,r+1,f,-1,-1,-1,-1),l=!1),g>1?f=A:f+=A,l=l||o&&_===g,r+=g-1}return{generatedLine:r+1,generatedColumn:f,source:o?a:void 0}}updateHash(e){this._isOptimized||this._optimize(),e.update("ConcatSource");for(let t of this._children)t.updateHash(e)}_optimize(){let e=[],t,s,i=u=>{s===void 0?s=u:Array.isArray(s)?s.push(u):s=[typeof s=="string"?s:s.source(),u]},r=u=>{s===void 0?s=u:Array.isArray(s)?s.push(u.source()):s=[typeof s=="string"?s:s.source(),u.source()]},f=()=>{if(Array.isArray(s)){let u=new ct(s.join(""));Be.add(u),e.push(u)}else if(typeof s=="string"){let u=new ct(s);Be.add(u),e.push(u)}else e.push(s)};for(let u of this._children)typeof u=="string"?t===void 0?t=u:t+=u:(t!==void 0&&(i(t),t=void 0),Be.has(u)?r(u):(s!==void 0&&(f(),s=void 0),e.push(u)));t!==void 0&&i(t),s!==void 0&&f(),this._children=e,this._isOptimized=!0}};ot.exports=ve});var pt=j((or,dt)=>{"use strict";var{getMap:Ns,getSourceAndMap:js}=$(),xs=ee(),ks=G(),be=X(),ht=typeof process=="object"&&process.versions&&typeof process.versions.v8=="string"&&!/^[0-6]\./.test(process.versions.v8),at=536870912,ae=class{constructor(e,t,s,i){this.start=e,this.end=t,this.content=s,this.name=i,ht||(this.index=-1)}},Oe=class extends ks{constructor(e,t){super(),this._source=e,this._name=t,this._replacements=[],this._isSorted=!0}getName(){return this._name}getReplacements(){return this._sortReplacements(),this._replacements}replace(e,t,s,i){if(typeof s!="string")throw new Error("insertion must be a string, but is a "+typeof s);this._replacements.push(new ae(e,t,s,i)),this._isSorted=!1}insert(e,t,s){if(typeof t!="string")throw new Error("insertion must be a string, but is a "+typeof t+": "+t);this._replacements.push(new ae(e,e-1,t,s)),this._isSorted=!1}source(){if(this._replacements.length===0)return this._source.source();let e=this._source.source(),t=0,s=[];this._sortReplacements();for(let i of this._replacements){let r=Math.floor(i.start),f=Math.floor(i.end+1);if(t<r){let u=r-t;s.push(e.slice(0,u)),e=e.slice(u),t=r}if(s.push(i.content),t<f){let u=f-t;e=e.slice(u),t=f}}return s.push(e),s.join("")}map(e){return this._replacements.length===0?this._source.map(e):Ns(this,e)}sourceAndMap(e){return this._replacements.length===0?this._source.sourceAndMap(e):js(this,e)}original(){return this._source}_sortReplacements(){this._isSorted||(ht?this._replacements.sort(function(e,t){let s=e.start-t.start;if(s!==0)return s;let i=e.end-t.end;return i!==0?i:0}):(this._replacements.forEach((e,t)=>e.index=t),this._replacements.sort(function(e,t){let s=e.start-t.start;if(s!==0)return s;let i=e.end-t.end;return i!==0?i:e.index-t.index})),this._isSorted=!0)}streamChunks(e,t,s,i){this._sortReplacements();let r=this._replacements,f=0,u=0,h=-1,o=u<r.length?Math.floor(r[u].start):at,a=0,l=0,d=0,m=[],c=new Map,_=[],g=(p,B,q,w)=>{let b=p<m.length?m[p]:void 0;if(b===void 0)return!1;typeof b=="string"&&(b=be(b),m[p]=b);let T=B<=b.length?b[B-1]:null;return T===null?!1:T.slice(q,q+w.length)===w},{generatedLine:A,generatedColumn:O}=xs(this._source,Object.assign({},e,{finalSource:!1}),(p,B,q,w,b,T,S)=>{let M=0,N=f+p.length;if(h>f){if(h>=N){let P=B+a;p.endsWith(`
9
- `)?(a--,d===P&&(l+=q)):d===P?l-=p.length:(l=-p.length,d=P),f=N;return}M=h-f,g(w,b,T,p.slice(0,M))&&(T+=M),f+=M;let z=B+a;d===z?l-=M:(l=-M,d=z),q+=M}if(o<N)do{let z=B+a;if(o>f){let C=o-f,k=p.slice(M,M+C);t(k,z,q+(z===d?l:0),w,b,T,S<0||S>=_.length?-1:_[S]),q+=C,M+=C,f=o,g(w,b,T,k)&&(T+=k.length)}let{content:P,name:R}=r[u],L=be(P),I=S;if(w>=0&&R){let C=c.get(R);C===void 0&&(C=c.size,c.set(R,C),i(C,R)),I=C}for(let C=0;C<L.length;C++){let k=L[C];t(k,z,q+(z===d?l:0),w,b,T,I),I=-1,C===L.length-1&&!k.endsWith(`
10
- `)?d===z?l+=k.length:(l=k.length,d=z):(a++,z++,l=-q,d=z)}h=Math.max(h,Math.floor(r[u].end+1)),u++,o=u<r.length?Math.floor(r[u].start):at;let H=p.length-N+h-M;if(H>0){if(h>=N){let k=B+a;p.endsWith(`
11
- `)?(a--,d===k&&(l+=q)):d===k?l-=p.length-M:(l=M-p.length,d=k),f=N;return}let C=B+a;g(w,b,T,p.slice(M,M+H))&&(T+=H),M+=H,f+=H,d===C?l-=H:(l=-H,d=C),q+=H}}while(o<N);if(M<p.length){let z=M===0?p:p.slice(M),P=B+a;t(z,P,q+(P===d?l:0),w,b,T,S<0?-1:_[S])}f=N},(p,B,q)=>{for(;m.length<p;)m.push(void 0);m[p]=q,s(p,B,q)},(p,B)=>{let q=c.get(B);q===void 0&&(q=c.size,c.set(B,q),i(q,B)),_[p]=q}),y="";for(;u<r.length;u++)y+=r[u].content;let v=A+a,E=be(y);for(let p=0;p<E.length;p++){let B=E[p];t(B,v,O+(v===d?l:0),-1,-1,-1,-1),p===E.length-1&&!B.endsWith(`
12
- `)?d===v?l+=B.length:(l=B.length,d=v):(a++,v++,l=-O,d=v)}return{generatedLine:v,generatedColumn:O+(v===d?l:0)}}updateHash(e){this._sortReplacements(),e.update("ReplaceSource"),this._source.updateHash(e),e.update(this._name||"");for(let t of this._replacements)e.update(`${t.start}${t.end}${t.content}${t.name}`)}};dt.exports=Oe});var St=j((lr,gt)=>{"use strict";var Is=G(),Ds=fe(),Rs=ee(),{getMap:Ls,getSourceAndMap:Hs}=$(),_t=/\n(?=.|\s)/g,ye=class extends Is{constructor(e,t){super(),this._source=typeof t=="string"||Buffer.isBuffer(t)?new Ds(t,!0):t,this._prefix=e}getPrefix(){return this._prefix}original(){return this._source}source(){let e=this._source.source(),t=this._prefix;return t+e.replace(_t,`
13
- `+t)}map(e){return Ls(this,e)}sourceAndMap(e){return Hs(this,e)}streamChunks(e,t,s,i){let r=this._prefix,f=r.length,u=!!(e&&e.columns===!1),{generatedLine:h,generatedColumn:o,source:a}=Rs(this._source,e,(l,d,m,c,_,g,A)=>{m!==0?m+=f:l!==void 0?u||c<0?l=r+l:f>0&&(t(r,d,m,-1,-1,-1,-1),m+=f):u||(m+=f),t(l,d,m,c,_,g,A)},s,i);return{generatedLine:h,generatedColumn:o===0?0:f+o,source:a!==void 0?r+a.replace(_t,`
14
- `+r):void 0}}updateHash(e){e.update("PrefixSource"),this._source.updateHash(e),e.update(this._prefix)}};gt.exports=ye});var At=j((ar,mt)=>{"use strict";var Ps=G(),we=class extends Ps{constructor(e){super(),this._size=e}_error(){return new Error("Content and Map of this Source is not available (only size() is supported)")}size(){return this._size}source(){throw this._error()}buffer(){throw this._error()}map(e){throw this._error()}updateHash(){throw this._error()}};mt.exports=we});var vt=j((hr,Bt)=>{"use strict";var Mt=G(),Te=class n extends Mt{static from(e){return e instanceof Mt?e:new n(e)}constructor(e){super(),this._sourceLike=e}source(){return this._sourceLike.source()}buffer(){return typeof this._sourceLike.buffer=="function"?this._sourceLike.buffer():super.buffer()}size(){return typeof this._sourceLike.size=="function"?this._sourceLike.size():super.size()}map(e){return typeof this._sourceLike.map=="function"?this._sourceLike.map(e):super.map(e)}sourceAndMap(e){return typeof this._sourceLike.sourceAndMap=="function"?this._sourceLike.sourceAndMap(e):super.sourceAndMap(e)}updateHash(e){if(typeof this._sourceLike.updateHash=="function")return this._sourceLike.updateHash(e);if(typeof this._sourceLike.map=="function")throw new Error("A Source-like object with a 'map' method must also provide an 'updateHash' method");e.update(this.buffer())}};Bt.exports=Te});var Ot=j(bt=>{var V=(n,e)=>{let t;Object.defineProperty(bt,n,{get:()=>(e!==void 0&&(t=e(),e=void 0),t),configurable:!0})};V("Source",()=>G());V("RawSource",()=>fe());V("OriginalSource",()=>We());V("SourceMapSource",()=>st());V("CachedSource",()=>ft());V("ConcatSource",()=>lt());V("ReplaceSource",()=>pt());V("PrefixSource",()=>St());V("SizeOnlySource",()=>At());V("CompatSource",()=>vt())});var Gs={};Rt(Gs,{BuilderDevToolsPlugin:()=>Ce});module.exports=Ht(Gs);var wt=Lt(Ot(),1),de=require("path"),Q=require("fs"),Tt=require("../core/index.cjs"),Ct=require("../node/index.cjs"),zt=require("../server/index.cjs");var yt="BuilderDevToolsPlugin",he=null;async function Ws(n){let e=await(0,Ct.createDevToolsNodeSys)({cwd:process.cwd()});e.debug("webpack setupDevTools init");let t=await(0,Tt.createDevTools)(e),s=await(0,zt.createDevToolsServer)({...t,getClientId:()=>"webpack-builder-dev-tools",closeAppServer:async()=>{},restartAppServer:async()=>{e.debug("restart server");let i=["next.config.js","next.config.ts","next.config.mjs","webpack.config.js","webpack.config.ts"].map(r=>(0,de.join)(e.getAppRootDir(),r));for(let r of i)if((0,Q.existsSync)(r)){e.debug(`restart server: ${r}`),(0,Q.writeFileSync)(r,(0,Q.readFileSync)(r,{encoding:"utf-8"})),await new Promise(f=>setTimeout(f,50));return}},enableAppWatch:async i=>i,...e,...n});return e.debug("webpack setupDevTools done"),{server:s,sys:e}}var Ce=class{constructor(e){Ee(this,"opts");this.opts=e||{},typeof this.opts.enabled!="boolean"&&(this.opts.enabled=process.env.NODE_ENV!=="production"),this.opts.enabled&&he==null&&(he=Ws(this.opts))}apply(e){if(this.opts.enabled===!1)return;let t=e,s=t.webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS,i=new WeakMap;t.hooks.compilation.tap(yt,r=>{r.hooks.processAssets.tapAsync({name:yt,stage:s},async(f,u)=>{if(he!=null){for(let h of r.chunks)for(let o of h.files){let a=(0,de.basename)(o),{server:l,sys:d}=await he;if(d.getFrameworks().some(A=>A.name==="next")&&a!=="webpack.js")continue;d.getAppRootDir=()=>t.context;let m=new URL("/~builder-dev-tools.js",l.getUrl()),c=`
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
+ var __commonJS = (cb, mod) => function __require() {
10
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
11
+ };
12
+ var __export = (target, all) => {
13
+ for (var name in all)
14
+ __defProp(target, name, { get: all[name], enumerable: true });
15
+ };
16
+ var __copyProps = (to, from, except, desc) => {
17
+ if (from && typeof from === "object" || typeof from === "function") {
18
+ for (let key of __getOwnPropNames(from))
19
+ if (!__hasOwnProp.call(to, key) && key !== except)
20
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
21
+ }
22
+ return to;
23
+ };
24
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
25
+ // If the importer is in node compatibility mode or this is not an ESM
26
+ // file that has been converted to a CommonJS file using a Babel-
27
+ // compatible transform (i.e. "__esModule" has not been set), then set
28
+ // "default" to the CommonJS "module.exports" for node compatibility.
29
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
30
+ mod
31
+ ));
32
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
33
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
34
+
35
+ // node_modules/webpack-sources/lib/Source.js
36
+ var require_Source = __commonJS({
37
+ "node_modules/webpack-sources/lib/Source.js"(exports2, module2) {
38
+ "use strict";
39
+ var Source = class {
40
+ source() {
41
+ throw new Error("Abstract");
42
+ }
43
+ buffer() {
44
+ const source = this.source();
45
+ if (Buffer.isBuffer(source)) return source;
46
+ return Buffer.from(source, "utf-8");
47
+ }
48
+ size() {
49
+ return this.buffer().length;
50
+ }
51
+ map(options) {
52
+ return null;
53
+ }
54
+ sourceAndMap(options) {
55
+ return {
56
+ source: this.source(),
57
+ map: this.map(options)
58
+ };
59
+ }
60
+ updateHash(hash) {
61
+ throw new Error("Abstract");
62
+ }
63
+ };
64
+ module2.exports = Source;
65
+ }
66
+ });
67
+
68
+ // node_modules/webpack-sources/lib/helpers/getGeneratedSourceInfo.js
69
+ var require_getGeneratedSourceInfo = __commonJS({
70
+ "node_modules/webpack-sources/lib/helpers/getGeneratedSourceInfo.js"(exports2, module2) {
71
+ "use strict";
72
+ var CHAR_CODE_NEW_LINE = "\n".charCodeAt(0);
73
+ var getGeneratedSourceInfo = (source) => {
74
+ if (source === void 0) {
75
+ return {};
76
+ }
77
+ const lastLineStart = source.lastIndexOf("\n");
78
+ if (lastLineStart === -1) {
79
+ return {
80
+ generatedLine: 1,
81
+ generatedColumn: source.length,
82
+ source
83
+ };
84
+ }
85
+ let generatedLine = 2;
86
+ for (let i = 0; i < lastLineStart; i++) {
87
+ if (source.charCodeAt(i) === CHAR_CODE_NEW_LINE) generatedLine++;
88
+ }
89
+ return {
90
+ generatedLine,
91
+ generatedColumn: source.length - lastLineStart - 1,
92
+ source
93
+ };
94
+ };
95
+ module2.exports = getGeneratedSourceInfo;
96
+ }
97
+ });
98
+
99
+ // node_modules/webpack-sources/lib/helpers/splitIntoLines.js
100
+ var require_splitIntoLines = __commonJS({
101
+ "node_modules/webpack-sources/lib/helpers/splitIntoLines.js"(exports2, module2) {
102
+ var splitIntoLines = (str) => {
103
+ const results = [];
104
+ const len = str.length;
105
+ let i = 0;
106
+ for (; i < len; ) {
107
+ const cc = str.charCodeAt(i);
108
+ if (cc === 10) {
109
+ results.push("\n");
110
+ i++;
111
+ } else {
112
+ let j = i + 1;
113
+ while (j < len && str.charCodeAt(j) !== 10) j++;
114
+ results.push(str.slice(i, j + 1));
115
+ i = j + 1;
116
+ }
117
+ }
118
+ return results;
119
+ };
120
+ module2.exports = splitIntoLines;
121
+ }
122
+ });
123
+
124
+ // node_modules/webpack-sources/lib/helpers/streamChunksOfRawSource.js
125
+ var require_streamChunksOfRawSource = __commonJS({
126
+ "node_modules/webpack-sources/lib/helpers/streamChunksOfRawSource.js"(exports2, module2) {
127
+ "use strict";
128
+ var getGeneratedSourceInfo = require_getGeneratedSourceInfo();
129
+ var splitIntoLines = require_splitIntoLines();
130
+ var streamChunksOfRawSource = (source, onChunk, onSource, onName) => {
131
+ let line = 1;
132
+ const matches = splitIntoLines(source);
133
+ let match;
134
+ for (match of matches) {
135
+ onChunk(match, line, 0, -1, -1, -1, -1);
136
+ line++;
137
+ }
138
+ return matches.length === 0 || match.endsWith("\n") ? {
139
+ generatedLine: matches.length + 1,
140
+ generatedColumn: 0
141
+ } : {
142
+ generatedLine: matches.length,
143
+ generatedColumn: match.length
144
+ };
145
+ };
146
+ module2.exports = (source, onChunk, onSource, onName, finalSource) => {
147
+ return finalSource ? getGeneratedSourceInfo(source) : streamChunksOfRawSource(source, onChunk, onSource, onName);
148
+ };
149
+ }
150
+ });
151
+
152
+ // node_modules/webpack-sources/lib/RawSource.js
153
+ var require_RawSource = __commonJS({
154
+ "node_modules/webpack-sources/lib/RawSource.js"(exports2, module2) {
155
+ "use strict";
156
+ var streamChunksOfRawSource = require_streamChunksOfRawSource();
157
+ var Source = require_Source();
158
+ var RawSource = class extends Source {
159
+ constructor(value, convertToString = false) {
160
+ super();
161
+ const isBuffer = Buffer.isBuffer(value);
162
+ if (!isBuffer && typeof value !== "string") {
163
+ throw new TypeError("argument 'value' must be either string of Buffer");
164
+ }
165
+ this._valueIsBuffer = !convertToString && isBuffer;
166
+ this._value = convertToString && isBuffer ? void 0 : value;
167
+ this._valueAsBuffer = isBuffer ? value : void 0;
168
+ this._valueAsString = isBuffer ? void 0 : value;
169
+ }
170
+ isBuffer() {
171
+ return this._valueIsBuffer;
172
+ }
173
+ source() {
174
+ if (this._value === void 0) {
175
+ this._value = this._valueAsBuffer.toString("utf-8");
176
+ }
177
+ return this._value;
178
+ }
179
+ buffer() {
180
+ if (this._valueAsBuffer === void 0) {
181
+ this._valueAsBuffer = Buffer.from(this._value, "utf-8");
182
+ }
183
+ return this._valueAsBuffer;
184
+ }
185
+ map(options) {
186
+ return null;
187
+ }
188
+ /**
189
+ * @param {object} options options
190
+ * @param {function(string, number, number, number, number, number, number): void} onChunk called for each chunk of code
191
+ * @param {function(number, string, string)} onSource called for each source
192
+ * @param {function(number, string)} onName called for each name
193
+ * @returns {void}
194
+ */
195
+ streamChunks(options, onChunk, onSource, onName) {
196
+ if (this._value === void 0) {
197
+ this._value = Buffer.from(this._valueAsBuffer, "utf-8");
198
+ }
199
+ if (this._valueAsString === void 0) {
200
+ this._valueAsString = typeof this._value === "string" ? this._value : this._value.toString("utf-8");
201
+ }
202
+ return streamChunksOfRawSource(
203
+ this._valueAsString,
204
+ onChunk,
205
+ onSource,
206
+ onName,
207
+ !!(options && options.finalSource)
208
+ );
209
+ }
210
+ updateHash(hash) {
211
+ if (this._valueAsBuffer === void 0) {
212
+ this._valueAsBuffer = Buffer.from(this._value, "utf-8");
213
+ }
214
+ hash.update("RawSource");
215
+ hash.update(this._valueAsBuffer);
216
+ }
217
+ };
218
+ module2.exports = RawSource;
219
+ }
220
+ });
221
+
222
+ // node_modules/webpack-sources/lib/helpers/createMappingsSerializer.js
223
+ var require_createMappingsSerializer = __commonJS({
224
+ "node_modules/webpack-sources/lib/helpers/createMappingsSerializer.js"(exports2, module2) {
225
+ "use strict";
226
+ var ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(
227
+ ""
228
+ );
229
+ var CONTINUATION_BIT = 32;
230
+ var createMappingsSerializer = (options) => {
231
+ const linesOnly = options && options.columns === false;
232
+ return linesOnly ? createLinesOnlyMappingsSerializer() : createFullMappingsSerializer();
233
+ };
234
+ var createFullMappingsSerializer = () => {
235
+ let currentLine = 1;
236
+ let currentColumn = 0;
237
+ let currentSourceIndex = 0;
238
+ let currentOriginalLine = 1;
239
+ let currentOriginalColumn = 0;
240
+ let currentNameIndex = 0;
241
+ let activeMapping = false;
242
+ let activeName = false;
243
+ let initial = true;
244
+ return (generatedLine, generatedColumn, sourceIndex, originalLine, originalColumn, nameIndex) => {
245
+ if (activeMapping && currentLine === generatedLine) {
246
+ if (sourceIndex === currentSourceIndex && originalLine === currentOriginalLine && originalColumn === currentOriginalColumn && !activeName && nameIndex < 0) {
247
+ return "";
248
+ }
249
+ } else {
250
+ if (sourceIndex < 0) {
251
+ return "";
252
+ }
253
+ }
254
+ let str;
255
+ if (currentLine < generatedLine) {
256
+ str = ";".repeat(generatedLine - currentLine);
257
+ currentLine = generatedLine;
258
+ currentColumn = 0;
259
+ initial = false;
260
+ } else if (initial) {
261
+ str = "";
262
+ initial = false;
263
+ } else {
264
+ str = ",";
265
+ }
266
+ const writeValue = (value) => {
267
+ const sign = value >>> 31 & 1;
268
+ const mask = value >> 31;
269
+ const absValue = value + mask ^ mask;
270
+ let data = absValue << 1 | sign;
271
+ for (; ; ) {
272
+ const sextet = data & 31;
273
+ data >>= 5;
274
+ if (data === 0) {
275
+ str += ALPHABET[sextet];
276
+ break;
277
+ } else {
278
+ str += ALPHABET[sextet | CONTINUATION_BIT];
279
+ }
280
+ }
281
+ };
282
+ writeValue(generatedColumn - currentColumn);
283
+ currentColumn = generatedColumn;
284
+ if (sourceIndex >= 0) {
285
+ activeMapping = true;
286
+ if (sourceIndex === currentSourceIndex) {
287
+ str += "A";
288
+ } else {
289
+ writeValue(sourceIndex - currentSourceIndex);
290
+ currentSourceIndex = sourceIndex;
291
+ }
292
+ writeValue(originalLine - currentOriginalLine);
293
+ currentOriginalLine = originalLine;
294
+ if (originalColumn === currentOriginalColumn) {
295
+ str += "A";
296
+ } else {
297
+ writeValue(originalColumn - currentOriginalColumn);
298
+ currentOriginalColumn = originalColumn;
299
+ }
300
+ if (nameIndex >= 0) {
301
+ writeValue(nameIndex - currentNameIndex);
302
+ currentNameIndex = nameIndex;
303
+ activeName = true;
304
+ } else {
305
+ activeName = false;
306
+ }
307
+ } else {
308
+ activeMapping = false;
309
+ }
310
+ return str;
311
+ };
312
+ };
313
+ var createLinesOnlyMappingsSerializer = () => {
314
+ let lastWrittenLine = 0;
315
+ let currentLine = 1;
316
+ let currentSourceIndex = 0;
317
+ let currentOriginalLine = 1;
318
+ return (generatedLine, _generatedColumn, sourceIndex, originalLine, _originalColumn, _nameIndex) => {
319
+ if (sourceIndex < 0) {
320
+ return "";
321
+ }
322
+ if (lastWrittenLine === generatedLine) {
323
+ return "";
324
+ }
325
+ let str;
326
+ const writeValue = (value) => {
327
+ const sign = value >>> 31 & 1;
328
+ const mask = value >> 31;
329
+ const absValue = value + mask ^ mask;
330
+ let data = absValue << 1 | sign;
331
+ for (; ; ) {
332
+ const sextet = data & 31;
333
+ data >>= 5;
334
+ if (data === 0) {
335
+ str += ALPHABET[sextet];
336
+ break;
337
+ } else {
338
+ str += ALPHABET[sextet | CONTINUATION_BIT];
339
+ }
340
+ }
341
+ };
342
+ lastWrittenLine = generatedLine;
343
+ if (generatedLine === currentLine + 1) {
344
+ currentLine = generatedLine;
345
+ if (sourceIndex === currentSourceIndex) {
346
+ currentSourceIndex = sourceIndex;
347
+ if (originalLine === currentOriginalLine + 1) {
348
+ currentOriginalLine = originalLine;
349
+ return ";AACA";
350
+ } else {
351
+ str = ";AA";
352
+ writeValue(originalLine - currentOriginalLine);
353
+ currentOriginalLine = originalLine;
354
+ return str + "A";
355
+ }
356
+ } else {
357
+ str = ";A";
358
+ writeValue(sourceIndex - currentSourceIndex);
359
+ currentSourceIndex = sourceIndex;
360
+ writeValue(originalLine - currentOriginalLine);
361
+ currentOriginalLine = originalLine;
362
+ return str + "A";
363
+ }
364
+ } else {
365
+ str = ";".repeat(generatedLine - currentLine);
366
+ currentLine = generatedLine;
367
+ if (sourceIndex === currentSourceIndex) {
368
+ currentSourceIndex = sourceIndex;
369
+ if (originalLine === currentOriginalLine + 1) {
370
+ currentOriginalLine = originalLine;
371
+ return str + "AACA";
372
+ } else {
373
+ str += "AA";
374
+ writeValue(originalLine - currentOriginalLine);
375
+ currentOriginalLine = originalLine;
376
+ return str + "A";
377
+ }
378
+ } else {
379
+ str += "A";
380
+ writeValue(sourceIndex - currentSourceIndex);
381
+ currentSourceIndex = sourceIndex;
382
+ writeValue(originalLine - currentOriginalLine);
383
+ currentOriginalLine = originalLine;
384
+ return str + "A";
385
+ }
386
+ }
387
+ };
388
+ };
389
+ module2.exports = createMappingsSerializer;
390
+ }
391
+ });
392
+
393
+ // node_modules/webpack-sources/lib/helpers/getFromStreamChunks.js
394
+ var require_getFromStreamChunks = __commonJS({
395
+ "node_modules/webpack-sources/lib/helpers/getFromStreamChunks.js"(exports2) {
396
+ "use strict";
397
+ var createMappingsSerializer = require_createMappingsSerializer();
398
+ exports2.getSourceAndMap = (inputSource, options) => {
399
+ let code = "";
400
+ let mappings = "";
401
+ let sources = [];
402
+ let sourcesContent = [];
403
+ let names = [];
404
+ const addMapping = createMappingsSerializer(options);
405
+ const { source } = inputSource.streamChunks(
406
+ Object.assign({}, options, { finalSource: true }),
407
+ (chunk, generatedLine, generatedColumn, sourceIndex, originalLine, originalColumn, nameIndex) => {
408
+ if (chunk !== void 0) code += chunk;
409
+ mappings += addMapping(
410
+ generatedLine,
411
+ generatedColumn,
412
+ sourceIndex,
413
+ originalLine,
414
+ originalColumn,
415
+ nameIndex
416
+ );
417
+ },
418
+ (sourceIndex, source2, sourceContent) => {
419
+ while (sources.length < sourceIndex) {
420
+ sources.push(null);
421
+ }
422
+ sources[sourceIndex] = source2;
423
+ if (sourceContent !== void 0) {
424
+ while (sourcesContent.length < sourceIndex) {
425
+ sourcesContent.push(null);
426
+ }
427
+ sourcesContent[sourceIndex] = sourceContent;
428
+ }
429
+ },
430
+ (nameIndex, name) => {
431
+ while (names.length < nameIndex) {
432
+ names.push(null);
433
+ }
434
+ names[nameIndex] = name;
435
+ }
436
+ );
437
+ return {
438
+ source: source !== void 0 ? source : code,
439
+ map: mappings.length > 0 ? {
440
+ version: 3,
441
+ file: "x",
442
+ mappings,
443
+ sources,
444
+ sourcesContent: sourcesContent.length > 0 ? sourcesContent : void 0,
445
+ names
446
+ } : null
447
+ };
448
+ };
449
+ exports2.getMap = (source, options) => {
450
+ let mappings = "";
451
+ let sources = [];
452
+ let sourcesContent = [];
453
+ let names = [];
454
+ const addMapping = createMappingsSerializer(options);
455
+ source.streamChunks(
456
+ Object.assign({}, options, { source: false, finalSource: true }),
457
+ (chunk, generatedLine, generatedColumn, sourceIndex, originalLine, originalColumn, nameIndex) => {
458
+ mappings += addMapping(
459
+ generatedLine,
460
+ generatedColumn,
461
+ sourceIndex,
462
+ originalLine,
463
+ originalColumn,
464
+ nameIndex
465
+ );
466
+ },
467
+ (sourceIndex, source2, sourceContent) => {
468
+ while (sources.length < sourceIndex) {
469
+ sources.push(null);
470
+ }
471
+ sources[sourceIndex] = source2;
472
+ if (sourceContent !== void 0) {
473
+ while (sourcesContent.length < sourceIndex) {
474
+ sourcesContent.push(null);
475
+ }
476
+ sourcesContent[sourceIndex] = sourceContent;
477
+ }
478
+ },
479
+ (nameIndex, name) => {
480
+ while (names.length < nameIndex) {
481
+ names.push(null);
482
+ }
483
+ names[nameIndex] = name;
484
+ }
485
+ );
486
+ return mappings.length > 0 ? {
487
+ version: 3,
488
+ file: "x",
489
+ mappings,
490
+ sources,
491
+ sourcesContent: sourcesContent.length > 0 ? sourcesContent : void 0,
492
+ names
493
+ } : null;
494
+ };
495
+ }
496
+ });
497
+
498
+ // node_modules/webpack-sources/lib/helpers/splitIntoPotentialTokens.js
499
+ var require_splitIntoPotentialTokens = __commonJS({
500
+ "node_modules/webpack-sources/lib/helpers/splitIntoPotentialTokens.js"(exports2, module2) {
501
+ var splitIntoPotentialTokens = (str) => {
502
+ const len = str.length;
503
+ if (len === 0) return null;
504
+ const results = [];
505
+ let i = 0;
506
+ for (; i < len; ) {
507
+ const s = i;
508
+ block: {
509
+ let cc = str.charCodeAt(i);
510
+ while (cc !== 10 && cc !== 59 && cc !== 123 && cc !== 125) {
511
+ if (++i >= len) break block;
512
+ cc = str.charCodeAt(i);
513
+ }
514
+ while (cc === 59 || cc === 32 || cc === 123 || cc === 125 || cc === 13 || cc === 9) {
515
+ if (++i >= len) break block;
516
+ cc = str.charCodeAt(i);
517
+ }
518
+ if (cc === 10) {
519
+ i++;
520
+ }
521
+ }
522
+ results.push(str.slice(s, i));
523
+ }
524
+ return results;
525
+ };
526
+ module2.exports = splitIntoPotentialTokens;
527
+ }
528
+ });
529
+
530
+ // node_modules/webpack-sources/lib/OriginalSource.js
531
+ var require_OriginalSource = __commonJS({
532
+ "node_modules/webpack-sources/lib/OriginalSource.js"(exports2, module2) {
533
+ "use strict";
534
+ var { getMap, getSourceAndMap } = require_getFromStreamChunks();
535
+ var splitIntoLines = require_splitIntoLines();
536
+ var getGeneratedSourceInfo = require_getGeneratedSourceInfo();
537
+ var Source = require_Source();
538
+ var splitIntoPotentialTokens = require_splitIntoPotentialTokens();
539
+ var OriginalSource = class extends Source {
540
+ constructor(value, name) {
541
+ super();
542
+ const isBuffer = Buffer.isBuffer(value);
543
+ this._value = isBuffer ? void 0 : value;
544
+ this._valueAsBuffer = isBuffer ? value : void 0;
545
+ this._name = name;
546
+ }
547
+ getName() {
548
+ return this._name;
549
+ }
550
+ source() {
551
+ if (this._value === void 0) {
552
+ this._value = this._valueAsBuffer.toString("utf-8");
553
+ }
554
+ return this._value;
555
+ }
556
+ buffer() {
557
+ if (this._valueAsBuffer === void 0) {
558
+ this._valueAsBuffer = Buffer.from(this._value, "utf-8");
559
+ }
560
+ return this._valueAsBuffer;
561
+ }
562
+ map(options) {
563
+ return getMap(this, options);
564
+ }
565
+ sourceAndMap(options) {
566
+ return getSourceAndMap(this, options);
567
+ }
568
+ /**
569
+ * @param {object} options options
570
+ * @param {function(string, number, number, number, number, number, number): void} onChunk called for each chunk of code
571
+ * @param {function(number, string, string)} onSource called for each source
572
+ * @param {function(number, string)} onName called for each name
573
+ * @returns {void}
574
+ */
575
+ streamChunks(options, onChunk, onSource, onName) {
576
+ if (this._value === void 0) {
577
+ this._value = this._valueAsBuffer.toString("utf-8");
578
+ }
579
+ onSource(0, this._name, this._value);
580
+ const finalSource = !!(options && options.finalSource);
581
+ if (!options || options.columns !== false) {
582
+ const matches = splitIntoPotentialTokens(this._value);
583
+ let line = 1;
584
+ let column = 0;
585
+ if (matches !== null) {
586
+ for (const match of matches) {
587
+ const isEndOfLine = match.endsWith("\n");
588
+ if (isEndOfLine && match.length === 1) {
589
+ if (!finalSource) onChunk(match, line, column, -1, -1, -1, -1);
590
+ } else {
591
+ const chunk = finalSource ? void 0 : match;
592
+ onChunk(chunk, line, column, 0, line, column, -1);
593
+ }
594
+ if (isEndOfLine) {
595
+ line++;
596
+ column = 0;
597
+ } else {
598
+ column += match.length;
599
+ }
600
+ }
601
+ }
602
+ return {
603
+ generatedLine: line,
604
+ generatedColumn: column,
605
+ source: finalSource ? this._value : void 0
606
+ };
607
+ } else if (finalSource) {
608
+ const result = getGeneratedSourceInfo(this._value);
609
+ const { generatedLine, generatedColumn } = result;
610
+ if (generatedColumn === 0) {
611
+ for (let line = 1; line < generatedLine; line++)
612
+ onChunk(void 0, line, 0, 0, line, 0, -1);
613
+ } else {
614
+ for (let line = 1; line <= generatedLine; line++)
615
+ onChunk(void 0, line, 0, 0, line, 0, -1);
616
+ }
617
+ return result;
618
+ } else {
619
+ let line = 1;
620
+ const matches = splitIntoLines(this._value);
621
+ let match;
622
+ for (match of matches) {
623
+ onChunk(finalSource ? void 0 : match, line, 0, 0, line, 0, -1);
624
+ line++;
625
+ }
626
+ return matches.length === 0 || match.endsWith("\n") ? {
627
+ generatedLine: matches.length + 1,
628
+ generatedColumn: 0,
629
+ source: finalSource ? this._value : void 0
630
+ } : {
631
+ generatedLine: matches.length,
632
+ generatedColumn: match.length,
633
+ source: finalSource ? this._value : void 0
634
+ };
635
+ }
636
+ }
637
+ updateHash(hash) {
638
+ if (this._valueAsBuffer === void 0) {
639
+ this._valueAsBuffer = Buffer.from(this._value, "utf-8");
640
+ }
641
+ hash.update("OriginalSource");
642
+ hash.update(this._valueAsBuffer);
643
+ hash.update(this._name || "");
644
+ }
645
+ };
646
+ module2.exports = OriginalSource;
647
+ }
648
+ });
649
+
650
+ // node_modules/webpack-sources/lib/helpers/getSource.js
651
+ var require_getSource = __commonJS({
652
+ "node_modules/webpack-sources/lib/helpers/getSource.js"(exports2, module2) {
653
+ "use strict";
654
+ var getSource = (sourceMap, index) => {
655
+ if (index < 0) return null;
656
+ const { sourceRoot, sources } = sourceMap;
657
+ const source = sources[index];
658
+ if (!sourceRoot) return source;
659
+ if (sourceRoot.endsWith("/")) return sourceRoot + source;
660
+ return sourceRoot + "/" + source;
661
+ };
662
+ module2.exports = getSource;
663
+ }
664
+ });
665
+
666
+ // node_modules/webpack-sources/lib/helpers/readMappings.js
667
+ var require_readMappings = __commonJS({
668
+ "node_modules/webpack-sources/lib/helpers/readMappings.js"(exports2, module2) {
669
+ "use strict";
670
+ var ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
671
+ var CONTINUATION_BIT = 32;
672
+ var END_SEGMENT_BIT = 64;
673
+ var NEXT_LINE = END_SEGMENT_BIT | 1;
674
+ var INVALID = END_SEGMENT_BIT | 2;
675
+ var DATA_MASK = 31;
676
+ var ccToValue = new Uint8Array("z".charCodeAt(0) + 1);
677
+ {
678
+ ccToValue.fill(INVALID);
679
+ for (let i = 0; i < ALPHABET.length; i++) {
680
+ ccToValue[ALPHABET.charCodeAt(i)] = i;
681
+ }
682
+ ccToValue[",".charCodeAt(0)] = END_SEGMENT_BIT;
683
+ ccToValue[";".charCodeAt(0)] = NEXT_LINE;
684
+ }
685
+ var ccMax = ccToValue.length - 1;
686
+ var readMappings = (mappings, onMapping) => {
687
+ const currentData = new Uint32Array([0, 0, 1, 0, 0]);
688
+ let currentDataPos = 0;
689
+ let currentValue = 0;
690
+ let currentValuePos = 0;
691
+ let generatedLine = 1;
692
+ let generatedColumn = -1;
693
+ for (let i = 0; i < mappings.length; i++) {
694
+ const cc = mappings.charCodeAt(i);
695
+ if (cc > ccMax) continue;
696
+ const value = ccToValue[cc];
697
+ if ((value & END_SEGMENT_BIT) !== 0) {
698
+ if (currentData[0] > generatedColumn) {
699
+ if (currentDataPos === 1) {
700
+ onMapping(generatedLine, currentData[0], -1, -1, -1, -1);
701
+ } else if (currentDataPos === 4) {
702
+ onMapping(
703
+ generatedLine,
704
+ currentData[0],
705
+ currentData[1],
706
+ currentData[2],
707
+ currentData[3],
708
+ -1
709
+ );
710
+ } else if (currentDataPos === 5) {
711
+ onMapping(
712
+ generatedLine,
713
+ currentData[0],
714
+ currentData[1],
715
+ currentData[2],
716
+ currentData[3],
717
+ currentData[4]
718
+ );
719
+ }
720
+ generatedColumn = currentData[0];
721
+ }
722
+ currentDataPos = 0;
723
+ if (value === NEXT_LINE) {
724
+ generatedLine++;
725
+ currentData[0] = 0;
726
+ generatedColumn = -1;
727
+ }
728
+ } else if ((value & CONTINUATION_BIT) === 0) {
729
+ currentValue |= value << currentValuePos;
730
+ const finalValue = currentValue & 1 ? -(currentValue >> 1) : currentValue >> 1;
731
+ currentData[currentDataPos++] += finalValue;
732
+ currentValuePos = 0;
733
+ currentValue = 0;
734
+ } else {
735
+ currentValue |= (value & DATA_MASK) << currentValuePos;
736
+ currentValuePos += 5;
737
+ }
738
+ }
739
+ if (currentDataPos === 1) {
740
+ onMapping(generatedLine, currentData[0], -1, -1, -1, -1);
741
+ } else if (currentDataPos === 4) {
742
+ onMapping(
743
+ generatedLine,
744
+ currentData[0],
745
+ currentData[1],
746
+ currentData[2],
747
+ currentData[3],
748
+ -1
749
+ );
750
+ } else if (currentDataPos === 5) {
751
+ onMapping(
752
+ generatedLine,
753
+ currentData[0],
754
+ currentData[1],
755
+ currentData[2],
756
+ currentData[3],
757
+ currentData[4]
758
+ );
759
+ }
760
+ };
761
+ module2.exports = readMappings;
762
+ }
763
+ });
764
+
765
+ // node_modules/webpack-sources/lib/helpers/streamChunksOfSourceMap.js
766
+ var require_streamChunksOfSourceMap = __commonJS({
767
+ "node_modules/webpack-sources/lib/helpers/streamChunksOfSourceMap.js"(exports2, module2) {
768
+ "use strict";
769
+ var getGeneratedSourceInfo = require_getGeneratedSourceInfo();
770
+ var getSource = require_getSource();
771
+ var readMappings = require_readMappings();
772
+ var splitIntoLines = require_splitIntoLines();
773
+ var streamChunksOfSourceMapFull = (source, sourceMap, onChunk, onSource, onName) => {
774
+ const lines = splitIntoLines(source);
775
+ if (lines.length === 0) {
776
+ return {
777
+ generatedLine: 1,
778
+ generatedColumn: 0
779
+ };
780
+ }
781
+ const { sources, sourcesContent, names, mappings } = sourceMap;
782
+ for (let i = 0; i < sources.length; i++) {
783
+ onSource(
784
+ i,
785
+ getSource(sourceMap, i),
786
+ sourcesContent && sourcesContent[i] || void 0
787
+ );
788
+ }
789
+ if (names) {
790
+ for (let i = 0; i < names.length; i++) {
791
+ onName(i, names[i]);
792
+ }
793
+ }
794
+ const lastLine = lines[lines.length - 1];
795
+ const lastNewLine = lastLine.endsWith("\n");
796
+ const finalLine = lastNewLine ? lines.length + 1 : lines.length;
797
+ const finalColumn = lastNewLine ? 0 : lastLine.length;
798
+ let currentGeneratedLine = 1;
799
+ let currentGeneratedColumn = 0;
800
+ let mappingActive = false;
801
+ let activeMappingSourceIndex = -1;
802
+ let activeMappingOriginalLine = -1;
803
+ let activeMappingOriginalColumn = -1;
804
+ let activeMappingNameIndex = -1;
805
+ const onMapping = (generatedLine, generatedColumn, sourceIndex, originalLine, originalColumn, nameIndex) => {
806
+ if (mappingActive && currentGeneratedLine <= lines.length) {
807
+ let chunk;
808
+ const mappingLine = currentGeneratedLine;
809
+ const mappingColumn = currentGeneratedColumn;
810
+ const line = lines[currentGeneratedLine - 1];
811
+ if (generatedLine !== currentGeneratedLine) {
812
+ chunk = line.slice(currentGeneratedColumn);
813
+ currentGeneratedLine++;
814
+ currentGeneratedColumn = 0;
815
+ } else {
816
+ chunk = line.slice(currentGeneratedColumn, generatedColumn);
817
+ currentGeneratedColumn = generatedColumn;
818
+ }
819
+ if (chunk) {
820
+ onChunk(
821
+ chunk,
822
+ mappingLine,
823
+ mappingColumn,
824
+ activeMappingSourceIndex,
825
+ activeMappingOriginalLine,
826
+ activeMappingOriginalColumn,
827
+ activeMappingNameIndex
828
+ );
829
+ }
830
+ mappingActive = false;
831
+ }
832
+ if (generatedLine > currentGeneratedLine && currentGeneratedColumn > 0) {
833
+ if (currentGeneratedLine <= lines.length) {
834
+ const chunk = lines[currentGeneratedLine - 1].slice(
835
+ currentGeneratedColumn
836
+ );
837
+ onChunk(
838
+ chunk,
839
+ currentGeneratedLine,
840
+ currentGeneratedColumn,
841
+ -1,
842
+ -1,
843
+ -1,
844
+ -1
845
+ );
846
+ }
847
+ currentGeneratedLine++;
848
+ currentGeneratedColumn = 0;
849
+ }
850
+ while (generatedLine > currentGeneratedLine) {
851
+ if (currentGeneratedLine <= lines.length) {
852
+ onChunk(
853
+ lines[currentGeneratedLine - 1],
854
+ currentGeneratedLine,
855
+ 0,
856
+ -1,
857
+ -1,
858
+ -1,
859
+ -1
860
+ );
861
+ }
862
+ currentGeneratedLine++;
863
+ }
864
+ if (generatedColumn > currentGeneratedColumn) {
865
+ if (currentGeneratedLine <= lines.length) {
866
+ const chunk = lines[currentGeneratedLine - 1].slice(
867
+ currentGeneratedColumn,
868
+ generatedColumn
869
+ );
870
+ onChunk(
871
+ chunk,
872
+ currentGeneratedLine,
873
+ currentGeneratedColumn,
874
+ -1,
875
+ -1,
876
+ -1,
877
+ -1
878
+ );
879
+ }
880
+ currentGeneratedColumn = generatedColumn;
881
+ }
882
+ if (sourceIndex >= 0 && (generatedLine < finalLine || generatedLine === finalLine && generatedColumn < finalColumn)) {
883
+ mappingActive = true;
884
+ activeMappingSourceIndex = sourceIndex;
885
+ activeMappingOriginalLine = originalLine;
886
+ activeMappingOriginalColumn = originalColumn;
887
+ activeMappingNameIndex = nameIndex;
888
+ }
889
+ };
890
+ readMappings(mappings, onMapping);
891
+ onMapping(finalLine, finalColumn, -1, -1, -1, -1);
892
+ return {
893
+ generatedLine: finalLine,
894
+ generatedColumn: finalColumn
895
+ };
896
+ };
897
+ var streamChunksOfSourceMapLinesFull = (source, sourceMap, onChunk, onSource, _onName) => {
898
+ const lines = splitIntoLines(source);
899
+ if (lines.length === 0) {
900
+ return {
901
+ generatedLine: 1,
902
+ generatedColumn: 0
903
+ };
904
+ }
905
+ const { sources, sourcesContent, mappings } = sourceMap;
906
+ for (let i = 0; i < sources.length; i++) {
907
+ onSource(
908
+ i,
909
+ getSource(sourceMap, i),
910
+ sourcesContent && sourcesContent[i] || void 0
911
+ );
912
+ }
913
+ let currentGeneratedLine = 1;
914
+ const onMapping = (generatedLine, _generatedColumn, sourceIndex, originalLine, originalColumn, _nameIndex) => {
915
+ if (sourceIndex < 0 || generatedLine < currentGeneratedLine || generatedLine > lines.length) {
916
+ return;
917
+ }
918
+ while (generatedLine > currentGeneratedLine) {
919
+ if (currentGeneratedLine <= lines.length) {
920
+ onChunk(
921
+ lines[currentGeneratedLine - 1],
922
+ currentGeneratedLine,
923
+ 0,
924
+ -1,
925
+ -1,
926
+ -1,
927
+ -1
928
+ );
929
+ }
930
+ currentGeneratedLine++;
931
+ }
932
+ if (generatedLine <= lines.length) {
933
+ onChunk(
934
+ lines[generatedLine - 1],
935
+ generatedLine,
936
+ 0,
937
+ sourceIndex,
938
+ originalLine,
939
+ originalColumn,
940
+ -1
941
+ );
942
+ currentGeneratedLine++;
943
+ }
944
+ };
945
+ readMappings(mappings, onMapping);
946
+ for (; currentGeneratedLine <= lines.length; currentGeneratedLine++) {
947
+ onChunk(
948
+ lines[currentGeneratedLine - 1],
949
+ currentGeneratedLine,
950
+ 0,
951
+ -1,
952
+ -1,
953
+ -1,
954
+ -1
955
+ );
956
+ }
957
+ const lastLine = lines[lines.length - 1];
958
+ const lastNewLine = lastLine.endsWith("\n");
959
+ const finalLine = lastNewLine ? lines.length + 1 : lines.length;
960
+ const finalColumn = lastNewLine ? 0 : lastLine.length;
961
+ return {
962
+ generatedLine: finalLine,
963
+ generatedColumn: finalColumn
964
+ };
965
+ };
966
+ var streamChunksOfSourceMapFinal = (source, sourceMap, onChunk, onSource, onName) => {
967
+ const result = getGeneratedSourceInfo(source);
968
+ const { generatedLine: finalLine, generatedColumn: finalColumn } = result;
969
+ if (finalLine === 1 && finalColumn === 0) return result;
970
+ const { sources, sourcesContent, names, mappings } = sourceMap;
971
+ for (let i = 0; i < sources.length; i++) {
972
+ onSource(
973
+ i,
974
+ getSource(sourceMap, i),
975
+ sourcesContent && sourcesContent[i] || void 0
976
+ );
977
+ }
978
+ if (names) {
979
+ for (let i = 0; i < names.length; i++) {
980
+ onName(i, names[i]);
981
+ }
982
+ }
983
+ let mappingActiveLine = 0;
984
+ const onMapping = (generatedLine, generatedColumn, sourceIndex, originalLine, originalColumn, nameIndex) => {
985
+ if (generatedLine >= finalLine && (generatedColumn >= finalColumn || generatedLine > finalLine)) {
986
+ return;
987
+ }
988
+ if (sourceIndex >= 0) {
989
+ onChunk(
990
+ void 0,
991
+ generatedLine,
992
+ generatedColumn,
993
+ sourceIndex,
994
+ originalLine,
995
+ originalColumn,
996
+ nameIndex
997
+ );
998
+ mappingActiveLine = generatedLine;
999
+ } else if (mappingActiveLine === generatedLine) {
1000
+ onChunk(void 0, generatedLine, generatedColumn, -1, -1, -1, -1);
1001
+ mappingActiveLine = 0;
1002
+ }
1003
+ };
1004
+ readMappings(mappings, onMapping);
1005
+ return result;
1006
+ };
1007
+ var streamChunksOfSourceMapLinesFinal = (source, sourceMap, onChunk, onSource, _onName) => {
1008
+ const result = getGeneratedSourceInfo(source);
1009
+ const { generatedLine, generatedColumn } = result;
1010
+ if (generatedLine === 1 && generatedColumn === 0) {
1011
+ return {
1012
+ generatedLine: 1,
1013
+ generatedColumn: 0
1014
+ };
1015
+ }
1016
+ const { sources, sourcesContent, mappings } = sourceMap;
1017
+ for (let i = 0; i < sources.length; i++) {
1018
+ onSource(
1019
+ i,
1020
+ getSource(sourceMap, i),
1021
+ sourcesContent && sourcesContent[i] || void 0
1022
+ );
1023
+ }
1024
+ const finalLine = generatedColumn === 0 ? generatedLine - 1 : generatedLine;
1025
+ let currentGeneratedLine = 1;
1026
+ const onMapping = (generatedLine2, _generatedColumn, sourceIndex, originalLine, originalColumn, _nameIndex) => {
1027
+ if (sourceIndex >= 0 && currentGeneratedLine <= generatedLine2 && generatedLine2 <= finalLine) {
1028
+ onChunk(
1029
+ void 0,
1030
+ generatedLine2,
1031
+ 0,
1032
+ sourceIndex,
1033
+ originalLine,
1034
+ originalColumn,
1035
+ -1
1036
+ );
1037
+ currentGeneratedLine = generatedLine2 + 1;
1038
+ }
1039
+ };
1040
+ readMappings(mappings, onMapping);
1041
+ return result;
1042
+ };
1043
+ module2.exports = (source, sourceMap, onChunk, onSource, onName, finalSource, columns) => {
1044
+ if (columns) {
1045
+ return finalSource ? streamChunksOfSourceMapFinal(
1046
+ source,
1047
+ sourceMap,
1048
+ onChunk,
1049
+ onSource,
1050
+ onName
1051
+ ) : streamChunksOfSourceMapFull(
1052
+ source,
1053
+ sourceMap,
1054
+ onChunk,
1055
+ onSource,
1056
+ onName
1057
+ );
1058
+ } else {
1059
+ return finalSource ? streamChunksOfSourceMapLinesFinal(
1060
+ source,
1061
+ sourceMap,
1062
+ onChunk,
1063
+ onSource,
1064
+ onName
1065
+ ) : streamChunksOfSourceMapLinesFull(
1066
+ source,
1067
+ sourceMap,
1068
+ onChunk,
1069
+ onSource,
1070
+ onName
1071
+ );
1072
+ }
1073
+ };
1074
+ }
1075
+ });
1076
+
1077
+ // node_modules/webpack-sources/lib/helpers/streamChunksOfCombinedSourceMap.js
1078
+ var require_streamChunksOfCombinedSourceMap = __commonJS({
1079
+ "node_modules/webpack-sources/lib/helpers/streamChunksOfCombinedSourceMap.js"(exports2, module2) {
1080
+ "use strict";
1081
+ var streamChunksOfSourceMap = require_streamChunksOfSourceMap();
1082
+ var splitIntoLines = require_splitIntoLines();
1083
+ var streamChunksOfCombinedSourceMap = (source, sourceMap, innerSourceName, innerSource, innerSourceMap, removeInnerSource, onChunk, onSource, onName, finalSource, columns) => {
1084
+ let sourceMapping = /* @__PURE__ */ new Map();
1085
+ let nameMapping = /* @__PURE__ */ new Map();
1086
+ const sourceIndexMapping = [];
1087
+ const nameIndexMapping = [];
1088
+ const nameIndexValueMapping = [];
1089
+ let innerSourceIndex = -2;
1090
+ const innerSourceIndexMapping = [];
1091
+ const innerSourceIndexValueMapping = [];
1092
+ const innerSourceContents = [];
1093
+ const innerSourceContentLines = [];
1094
+ const innerNameIndexMapping = [];
1095
+ const innerNameIndexValueMapping = [];
1096
+ const innerSourceMapLineData = [];
1097
+ const findInnerMapping = (line, column) => {
1098
+ if (line > innerSourceMapLineData.length) return -1;
1099
+ const { mappingsData } = innerSourceMapLineData[line - 1];
1100
+ let l = 0;
1101
+ let r = mappingsData.length / 5;
1102
+ while (l < r) {
1103
+ let m = l + r >> 1;
1104
+ if (mappingsData[m * 5] <= column) {
1105
+ l = m + 1;
1106
+ } else {
1107
+ r = m;
1108
+ }
1109
+ }
1110
+ if (l === 0) return -1;
1111
+ return l - 1;
1112
+ };
1113
+ return streamChunksOfSourceMap(
1114
+ source,
1115
+ sourceMap,
1116
+ (chunk, generatedLine, generatedColumn, sourceIndex, originalLine, originalColumn, nameIndex) => {
1117
+ if (sourceIndex === innerSourceIndex) {
1118
+ const idx = findInnerMapping(originalLine, originalColumn);
1119
+ if (idx !== -1) {
1120
+ const { chunks, mappingsData } = innerSourceMapLineData[originalLine - 1];
1121
+ const mi = idx * 5;
1122
+ const innerSourceIndex2 = mappingsData[mi + 1];
1123
+ const innerOriginalLine = mappingsData[mi + 2];
1124
+ let innerOriginalColumn = mappingsData[mi + 3];
1125
+ let innerNameIndex = mappingsData[mi + 4];
1126
+ if (innerSourceIndex2 >= 0) {
1127
+ const innerChunk = chunks[idx];
1128
+ const innerGeneratedColumn = mappingsData[mi];
1129
+ const locationInChunk = originalColumn - innerGeneratedColumn;
1130
+ if (locationInChunk > 0) {
1131
+ let originalSourceLines = innerSourceIndex2 < innerSourceContentLines.length ? innerSourceContentLines[innerSourceIndex2] : null;
1132
+ if (originalSourceLines === void 0) {
1133
+ const originalSource = innerSourceContents[innerSourceIndex2];
1134
+ originalSourceLines = originalSource ? splitIntoLines(originalSource) : null;
1135
+ innerSourceContentLines[innerSourceIndex2] = originalSourceLines;
1136
+ }
1137
+ if (originalSourceLines !== null) {
1138
+ const originalChunk = innerOriginalLine <= originalSourceLines.length ? originalSourceLines[innerOriginalLine - 1].slice(
1139
+ innerOriginalColumn,
1140
+ innerOriginalColumn + locationInChunk
1141
+ ) : "";
1142
+ if (innerChunk.slice(0, locationInChunk) === originalChunk) {
1143
+ innerOriginalColumn += locationInChunk;
1144
+ innerNameIndex = -1;
1145
+ }
1146
+ }
1147
+ }
1148
+ let sourceIndex2 = innerSourceIndex2 < innerSourceIndexMapping.length ? innerSourceIndexMapping[innerSourceIndex2] : -2;
1149
+ if (sourceIndex2 === -2) {
1150
+ const [source2, sourceContent] = innerSourceIndex2 < innerSourceIndexValueMapping.length ? innerSourceIndexValueMapping[innerSourceIndex2] : [null, void 0];
1151
+ let globalIndex = sourceMapping.get(source2);
1152
+ if (globalIndex === void 0) {
1153
+ sourceMapping.set(source2, globalIndex = sourceMapping.size);
1154
+ onSource(globalIndex, source2, sourceContent);
1155
+ }
1156
+ sourceIndex2 = globalIndex;
1157
+ innerSourceIndexMapping[innerSourceIndex2] = sourceIndex2;
1158
+ }
1159
+ let finalNameIndex = -1;
1160
+ if (innerNameIndex >= 0) {
1161
+ finalNameIndex = innerNameIndex < innerNameIndexMapping.length ? innerNameIndexMapping[innerNameIndex] : -2;
1162
+ if (finalNameIndex === -2) {
1163
+ const name = innerNameIndex < innerNameIndexValueMapping.length ? innerNameIndexValueMapping[innerNameIndex] : void 0;
1164
+ if (name) {
1165
+ let globalIndex = nameMapping.get(name);
1166
+ if (globalIndex === void 0) {
1167
+ nameMapping.set(name, globalIndex = nameMapping.size);
1168
+ onName(globalIndex, name);
1169
+ }
1170
+ finalNameIndex = globalIndex;
1171
+ } else {
1172
+ finalNameIndex = -1;
1173
+ }
1174
+ innerNameIndexMapping[innerNameIndex] = finalNameIndex;
1175
+ }
1176
+ } else if (nameIndex >= 0) {
1177
+ let originalSourceLines = innerSourceContentLines[innerSourceIndex2];
1178
+ if (originalSourceLines === void 0) {
1179
+ const originalSource = innerSourceContents[innerSourceIndex2];
1180
+ originalSourceLines = originalSource ? splitIntoLines(originalSource) : null;
1181
+ innerSourceContentLines[innerSourceIndex2] = originalSourceLines;
1182
+ }
1183
+ if (originalSourceLines !== null) {
1184
+ const name = nameIndexValueMapping[nameIndex];
1185
+ const originalName = innerOriginalLine <= originalSourceLines.length ? originalSourceLines[innerOriginalLine - 1].slice(
1186
+ innerOriginalColumn,
1187
+ innerOriginalColumn + name.length
1188
+ ) : "";
1189
+ if (name === originalName) {
1190
+ finalNameIndex = nameIndex < nameIndexMapping.length ? nameIndexMapping[nameIndex] : -2;
1191
+ if (finalNameIndex === -2) {
1192
+ const name2 = nameIndexValueMapping[nameIndex];
1193
+ if (name2) {
1194
+ let globalIndex = nameMapping.get(name2);
1195
+ if (globalIndex === void 0) {
1196
+ nameMapping.set(name2, globalIndex = nameMapping.size);
1197
+ onName(globalIndex, name2);
1198
+ }
1199
+ finalNameIndex = globalIndex;
1200
+ } else {
1201
+ finalNameIndex = -1;
1202
+ }
1203
+ nameIndexMapping[nameIndex] = finalNameIndex;
1204
+ }
1205
+ }
1206
+ }
1207
+ }
1208
+ onChunk(
1209
+ chunk,
1210
+ generatedLine,
1211
+ generatedColumn,
1212
+ sourceIndex2,
1213
+ innerOriginalLine,
1214
+ innerOriginalColumn,
1215
+ finalNameIndex
1216
+ );
1217
+ return;
1218
+ }
1219
+ }
1220
+ if (removeInnerSource) {
1221
+ onChunk(chunk, generatedLine, generatedColumn, -1, -1, -1, -1);
1222
+ return;
1223
+ } else {
1224
+ if (sourceIndexMapping[sourceIndex] === -2) {
1225
+ let globalIndex = sourceMapping.get(innerSourceName);
1226
+ if (globalIndex === void 0) {
1227
+ sourceMapping.set(source, globalIndex = sourceMapping.size);
1228
+ onSource(globalIndex, innerSourceName, innerSource);
1229
+ }
1230
+ sourceIndexMapping[sourceIndex] = globalIndex;
1231
+ }
1232
+ }
1233
+ }
1234
+ const finalSourceIndex = sourceIndex < 0 || sourceIndex >= sourceIndexMapping.length ? -1 : sourceIndexMapping[sourceIndex];
1235
+ if (finalSourceIndex < 0) {
1236
+ onChunk(chunk, generatedLine, generatedColumn, -1, -1, -1, -1);
1237
+ } else {
1238
+ let finalNameIndex = -1;
1239
+ if (nameIndex >= 0 && nameIndex < nameIndexMapping.length) {
1240
+ finalNameIndex = nameIndexMapping[nameIndex];
1241
+ if (finalNameIndex === -2) {
1242
+ const name = nameIndexValueMapping[nameIndex];
1243
+ let globalIndex = nameMapping.get(name);
1244
+ if (globalIndex === void 0) {
1245
+ nameMapping.set(name, globalIndex = nameMapping.size);
1246
+ onName(globalIndex, name);
1247
+ }
1248
+ finalNameIndex = globalIndex;
1249
+ nameIndexMapping[nameIndex] = finalNameIndex;
1250
+ }
1251
+ }
1252
+ onChunk(
1253
+ chunk,
1254
+ generatedLine,
1255
+ generatedColumn,
1256
+ finalSourceIndex,
1257
+ originalLine,
1258
+ originalColumn,
1259
+ finalNameIndex
1260
+ );
1261
+ }
1262
+ },
1263
+ (i, source2, sourceContent) => {
1264
+ if (source2 === innerSourceName) {
1265
+ innerSourceIndex = i;
1266
+ if (innerSource !== void 0) sourceContent = innerSource;
1267
+ else innerSource = sourceContent;
1268
+ sourceIndexMapping[i] = -2;
1269
+ streamChunksOfSourceMap(
1270
+ sourceContent,
1271
+ innerSourceMap,
1272
+ (chunk, generatedLine, generatedColumn, sourceIndex, originalLine, originalColumn, nameIndex) => {
1273
+ while (innerSourceMapLineData.length < generatedLine) {
1274
+ innerSourceMapLineData.push({
1275
+ mappingsData: [],
1276
+ chunks: []
1277
+ });
1278
+ }
1279
+ const data = innerSourceMapLineData[generatedLine - 1];
1280
+ data.mappingsData.push(
1281
+ generatedColumn,
1282
+ sourceIndex,
1283
+ originalLine,
1284
+ originalColumn,
1285
+ nameIndex
1286
+ );
1287
+ data.chunks.push(chunk);
1288
+ },
1289
+ (i2, source3, sourceContent2) => {
1290
+ innerSourceContents[i2] = sourceContent2;
1291
+ innerSourceContentLines[i2] = void 0;
1292
+ innerSourceIndexMapping[i2] = -2;
1293
+ innerSourceIndexValueMapping[i2] = [source3, sourceContent2];
1294
+ },
1295
+ (i2, name) => {
1296
+ innerNameIndexMapping[i2] = -2;
1297
+ innerNameIndexValueMapping[i2] = name;
1298
+ },
1299
+ false,
1300
+ columns
1301
+ );
1302
+ } else {
1303
+ let globalIndex = sourceMapping.get(source2);
1304
+ if (globalIndex === void 0) {
1305
+ sourceMapping.set(source2, globalIndex = sourceMapping.size);
1306
+ onSource(globalIndex, source2, sourceContent);
1307
+ }
1308
+ sourceIndexMapping[i] = globalIndex;
1309
+ }
1310
+ },
1311
+ (i, name) => {
1312
+ nameIndexMapping[i] = -2;
1313
+ nameIndexValueMapping[i] = name;
1314
+ },
1315
+ finalSource,
1316
+ columns
1317
+ );
1318
+ };
1319
+ module2.exports = streamChunksOfCombinedSourceMap;
1320
+ }
1321
+ });
1322
+
1323
+ // node_modules/webpack-sources/lib/SourceMapSource.js
1324
+ var require_SourceMapSource = __commonJS({
1325
+ "node_modules/webpack-sources/lib/SourceMapSource.js"(exports2, module2) {
1326
+ "use strict";
1327
+ var Source = require_Source();
1328
+ var streamChunksOfSourceMap = require_streamChunksOfSourceMap();
1329
+ var streamChunksOfCombinedSourceMap = require_streamChunksOfCombinedSourceMap();
1330
+ var { getMap, getSourceAndMap } = require_getFromStreamChunks();
1331
+ var SourceMapSource = class extends Source {
1332
+ constructor(value, name, sourceMap, originalSource, innerSourceMap, removeOriginalSource) {
1333
+ super();
1334
+ const valueIsBuffer = Buffer.isBuffer(value);
1335
+ this._valueAsString = valueIsBuffer ? void 0 : value;
1336
+ this._valueAsBuffer = valueIsBuffer ? value : void 0;
1337
+ this._name = name;
1338
+ this._hasSourceMap = !!sourceMap;
1339
+ const sourceMapIsBuffer = Buffer.isBuffer(sourceMap);
1340
+ const sourceMapIsString = typeof sourceMap === "string";
1341
+ this._sourceMapAsObject = sourceMapIsBuffer || sourceMapIsString ? void 0 : sourceMap;
1342
+ this._sourceMapAsString = sourceMapIsString ? sourceMap : void 0;
1343
+ this._sourceMapAsBuffer = sourceMapIsBuffer ? sourceMap : void 0;
1344
+ this._hasOriginalSource = !!originalSource;
1345
+ const originalSourceIsBuffer = Buffer.isBuffer(originalSource);
1346
+ this._originalSourceAsString = originalSourceIsBuffer ? void 0 : originalSource;
1347
+ this._originalSourceAsBuffer = originalSourceIsBuffer ? originalSource : void 0;
1348
+ this._hasInnerSourceMap = !!innerSourceMap;
1349
+ const innerSourceMapIsBuffer = Buffer.isBuffer(innerSourceMap);
1350
+ const innerSourceMapIsString = typeof innerSourceMap === "string";
1351
+ this._innerSourceMapAsObject = innerSourceMapIsBuffer || innerSourceMapIsString ? void 0 : innerSourceMap;
1352
+ this._innerSourceMapAsString = innerSourceMapIsString ? innerSourceMap : void 0;
1353
+ this._innerSourceMapAsBuffer = innerSourceMapIsBuffer ? innerSourceMap : void 0;
1354
+ this._removeOriginalSource = removeOriginalSource;
1355
+ }
1356
+ _ensureValueBuffer() {
1357
+ if (this._valueAsBuffer === void 0) {
1358
+ this._valueAsBuffer = Buffer.from(this._valueAsString, "utf-8");
1359
+ }
1360
+ }
1361
+ _ensureValueString() {
1362
+ if (this._valueAsString === void 0) {
1363
+ this._valueAsString = this._valueAsBuffer.toString("utf-8");
1364
+ }
1365
+ }
1366
+ _ensureOriginalSourceBuffer() {
1367
+ if (this._originalSourceAsBuffer === void 0 && this._hasOriginalSource) {
1368
+ this._originalSourceAsBuffer = Buffer.from(
1369
+ this._originalSourceAsString,
1370
+ "utf-8"
1371
+ );
1372
+ }
1373
+ }
1374
+ _ensureOriginalSourceString() {
1375
+ if (this._originalSourceAsString === void 0 && this._hasOriginalSource) {
1376
+ this._originalSourceAsString = this._originalSourceAsBuffer.toString(
1377
+ "utf-8"
1378
+ );
1379
+ }
1380
+ }
1381
+ _ensureInnerSourceMapObject() {
1382
+ if (this._innerSourceMapAsObject === void 0 && this._hasInnerSourceMap) {
1383
+ this._ensureInnerSourceMapString();
1384
+ this._innerSourceMapAsObject = JSON.parse(this._innerSourceMapAsString);
1385
+ }
1386
+ }
1387
+ _ensureInnerSourceMapBuffer() {
1388
+ if (this._innerSourceMapAsBuffer === void 0 && this._hasInnerSourceMap) {
1389
+ this._ensureInnerSourceMapString();
1390
+ this._innerSourceMapAsBuffer = Buffer.from(
1391
+ this._innerSourceMapAsString,
1392
+ "utf-8"
1393
+ );
1394
+ }
1395
+ }
1396
+ _ensureInnerSourceMapString() {
1397
+ if (this._innerSourceMapAsString === void 0 && this._hasInnerSourceMap) {
1398
+ if (this._innerSourceMapAsBuffer !== void 0) {
1399
+ this._innerSourceMapAsString = this._innerSourceMapAsBuffer.toString(
1400
+ "utf-8"
1401
+ );
1402
+ } else {
1403
+ this._innerSourceMapAsString = JSON.stringify(
1404
+ this._innerSourceMapAsObject
1405
+ );
1406
+ }
1407
+ }
1408
+ }
1409
+ _ensureSourceMapObject() {
1410
+ if (this._sourceMapAsObject === void 0) {
1411
+ this._ensureSourceMapString();
1412
+ this._sourceMapAsObject = JSON.parse(this._sourceMapAsString);
1413
+ }
1414
+ }
1415
+ _ensureSourceMapBuffer() {
1416
+ if (this._sourceMapAsBuffer === void 0) {
1417
+ this._ensureSourceMapString();
1418
+ this._sourceMapAsBuffer = Buffer.from(this._sourceMapAsString, "utf-8");
1419
+ }
1420
+ }
1421
+ _ensureSourceMapString() {
1422
+ if (this._sourceMapAsString === void 0) {
1423
+ if (this._sourceMapAsBuffer !== void 0) {
1424
+ this._sourceMapAsString = this._sourceMapAsBuffer.toString("utf-8");
1425
+ } else {
1426
+ this._sourceMapAsString = JSON.stringify(this._sourceMapAsObject);
1427
+ }
1428
+ }
1429
+ }
1430
+ getArgsAsBuffers() {
1431
+ this._ensureValueBuffer();
1432
+ this._ensureSourceMapBuffer();
1433
+ this._ensureOriginalSourceBuffer();
1434
+ this._ensureInnerSourceMapBuffer();
1435
+ return [
1436
+ this._valueAsBuffer,
1437
+ this._name,
1438
+ this._sourceMapAsBuffer,
1439
+ this._originalSourceAsBuffer,
1440
+ this._innerSourceMapAsBuffer,
1441
+ this._removeOriginalSource
1442
+ ];
1443
+ }
1444
+ buffer() {
1445
+ this._ensureValueBuffer();
1446
+ return this._valueAsBuffer;
1447
+ }
1448
+ source() {
1449
+ this._ensureValueString();
1450
+ return this._valueAsString;
1451
+ }
1452
+ map(options) {
1453
+ if (!this._hasInnerSourceMap) {
1454
+ this._ensureSourceMapObject();
1455
+ return this._sourceMapAsObject;
1456
+ }
1457
+ return getMap(this, options);
1458
+ }
1459
+ sourceAndMap(options) {
1460
+ if (!this._hasInnerSourceMap) {
1461
+ this._ensureValueString();
1462
+ this._ensureSourceMapObject();
1463
+ return {
1464
+ source: this._valueAsString,
1465
+ map: this._sourceMapAsObject
1466
+ };
1467
+ }
1468
+ return getSourceAndMap(this, options);
1469
+ }
1470
+ streamChunks(options, onChunk, onSource, onName) {
1471
+ this._ensureValueString();
1472
+ this._ensureSourceMapObject();
1473
+ this._ensureOriginalSourceString();
1474
+ if (this._hasInnerSourceMap) {
1475
+ this._ensureInnerSourceMapObject();
1476
+ return streamChunksOfCombinedSourceMap(
1477
+ this._valueAsString,
1478
+ this._sourceMapAsObject,
1479
+ this._name,
1480
+ this._originalSourceAsString,
1481
+ this._innerSourceMapAsObject,
1482
+ this._removeOriginalSource,
1483
+ onChunk,
1484
+ onSource,
1485
+ onName,
1486
+ !!(options && options.finalSource),
1487
+ !!(options && options.columns !== false)
1488
+ );
1489
+ } else {
1490
+ return streamChunksOfSourceMap(
1491
+ this._valueAsString,
1492
+ this._sourceMapAsObject,
1493
+ onChunk,
1494
+ onSource,
1495
+ onName,
1496
+ !!(options && options.finalSource),
1497
+ !!(options && options.columns !== false)
1498
+ );
1499
+ }
1500
+ }
1501
+ updateHash(hash) {
1502
+ this._ensureValueBuffer();
1503
+ this._ensureSourceMapBuffer();
1504
+ this._ensureOriginalSourceBuffer();
1505
+ this._ensureInnerSourceMapBuffer();
1506
+ hash.update("SourceMapSource");
1507
+ hash.update(this._valueAsBuffer);
1508
+ hash.update(this._sourceMapAsBuffer);
1509
+ if (this._hasOriginalSource) {
1510
+ hash.update(this._originalSourceAsBuffer);
1511
+ }
1512
+ if (this._hasInnerSourceMap) {
1513
+ hash.update(this._innerSourceMapAsBuffer);
1514
+ }
1515
+ hash.update(this._removeOriginalSource ? "true" : "false");
1516
+ }
1517
+ };
1518
+ module2.exports = SourceMapSource;
1519
+ }
1520
+ });
1521
+
1522
+ // node_modules/webpack-sources/lib/helpers/streamChunks.js
1523
+ var require_streamChunks = __commonJS({
1524
+ "node_modules/webpack-sources/lib/helpers/streamChunks.js"(exports2, module2) {
1525
+ "use strict";
1526
+ var streamChunksOfRawSource = require_streamChunksOfRawSource();
1527
+ var streamChunksOfSourceMap = require_streamChunksOfSourceMap();
1528
+ module2.exports = (source, options, onChunk, onSource, onName) => {
1529
+ if (typeof source.streamChunks === "function") {
1530
+ return source.streamChunks(options, onChunk, onSource, onName);
1531
+ } else {
1532
+ const sourceAndMap = source.sourceAndMap(options);
1533
+ if (sourceAndMap.map) {
1534
+ return streamChunksOfSourceMap(
1535
+ sourceAndMap.source,
1536
+ sourceAndMap.map,
1537
+ onChunk,
1538
+ onSource,
1539
+ onName,
1540
+ !!(options && options.finalSource),
1541
+ !!(options && options.columns !== false)
1542
+ );
1543
+ } else {
1544
+ return streamChunksOfRawSource(
1545
+ sourceAndMap.source,
1546
+ onChunk,
1547
+ onSource,
1548
+ onName,
1549
+ !!(options && options.finalSource)
1550
+ );
1551
+ }
1552
+ }
1553
+ };
1554
+ }
1555
+ });
1556
+
1557
+ // node_modules/webpack-sources/lib/helpers/streamAndGetSourceAndMap.js
1558
+ var require_streamAndGetSourceAndMap = __commonJS({
1559
+ "node_modules/webpack-sources/lib/helpers/streamAndGetSourceAndMap.js"(exports2, module2) {
1560
+ "use strict";
1561
+ var createMappingsSerializer = require_createMappingsSerializer();
1562
+ var streamChunks = require_streamChunks();
1563
+ var streamAndGetSourceAndMap = (inputSource, options, onChunk, onSource, onName) => {
1564
+ let code = "";
1565
+ let mappings = "";
1566
+ let sources = [];
1567
+ let sourcesContent = [];
1568
+ let names = [];
1569
+ const addMapping = createMappingsSerializer(
1570
+ Object.assign({}, options, { columns: true })
1571
+ );
1572
+ const finalSource = !!(options && options.finalSource);
1573
+ const { generatedLine, generatedColumn, source } = streamChunks(
1574
+ inputSource,
1575
+ options,
1576
+ (chunk, generatedLine2, generatedColumn2, sourceIndex, originalLine, originalColumn, nameIndex) => {
1577
+ if (chunk !== void 0) code += chunk;
1578
+ mappings += addMapping(
1579
+ generatedLine2,
1580
+ generatedColumn2,
1581
+ sourceIndex,
1582
+ originalLine,
1583
+ originalColumn,
1584
+ nameIndex
1585
+ );
1586
+ return onChunk(
1587
+ finalSource ? void 0 : chunk,
1588
+ generatedLine2,
1589
+ generatedColumn2,
1590
+ sourceIndex,
1591
+ originalLine,
1592
+ originalColumn,
1593
+ nameIndex
1594
+ );
1595
+ },
1596
+ (sourceIndex, source2, sourceContent) => {
1597
+ while (sources.length < sourceIndex) {
1598
+ sources.push(null);
1599
+ }
1600
+ sources[sourceIndex] = source2;
1601
+ if (sourceContent !== void 0) {
1602
+ while (sourcesContent.length < sourceIndex) {
1603
+ sourcesContent.push(null);
1604
+ }
1605
+ sourcesContent[sourceIndex] = sourceContent;
1606
+ }
1607
+ return onSource(sourceIndex, source2, sourceContent);
1608
+ },
1609
+ (nameIndex, name) => {
1610
+ while (names.length < nameIndex) {
1611
+ names.push(null);
1612
+ }
1613
+ names[nameIndex] = name;
1614
+ return onName(nameIndex, name);
1615
+ }
1616
+ );
1617
+ const resultSource = source !== void 0 ? source : code;
1618
+ return {
1619
+ result: {
1620
+ generatedLine,
1621
+ generatedColumn,
1622
+ source: finalSource ? resultSource : void 0
1623
+ },
1624
+ source: resultSource,
1625
+ map: mappings.length > 0 ? {
1626
+ version: 3,
1627
+ file: "x",
1628
+ mappings,
1629
+ sources,
1630
+ sourcesContent: sourcesContent.length > 0 ? sourcesContent : void 0,
1631
+ names
1632
+ } : null
1633
+ };
1634
+ };
1635
+ module2.exports = streamAndGetSourceAndMap;
1636
+ }
1637
+ });
1638
+
1639
+ // node_modules/webpack-sources/lib/CachedSource.js
1640
+ var require_CachedSource = __commonJS({
1641
+ "node_modules/webpack-sources/lib/CachedSource.js"(exports2, module2) {
1642
+ "use strict";
1643
+ var Source = require_Source();
1644
+ var streamChunksOfSourceMap = require_streamChunksOfSourceMap();
1645
+ var streamChunksOfRawSource = require_streamChunksOfRawSource();
1646
+ var streamAndGetSourceAndMap = require_streamAndGetSourceAndMap();
1647
+ var mapToBufferedMap = (map) => {
1648
+ if (typeof map !== "object" || !map) return map;
1649
+ const bufferedMap = Object.assign({}, map);
1650
+ if (map.mappings) {
1651
+ bufferedMap.mappings = Buffer.from(map.mappings, "utf-8");
1652
+ }
1653
+ if (map.sourcesContent) {
1654
+ bufferedMap.sourcesContent = map.sourcesContent.map(
1655
+ (str) => str && Buffer.from(str, "utf-8")
1656
+ );
1657
+ }
1658
+ return bufferedMap;
1659
+ };
1660
+ var bufferedMapToMap = (bufferedMap) => {
1661
+ if (typeof bufferedMap !== "object" || !bufferedMap) return bufferedMap;
1662
+ const map = Object.assign({}, bufferedMap);
1663
+ if (bufferedMap.mappings) {
1664
+ map.mappings = bufferedMap.mappings.toString("utf-8");
1665
+ }
1666
+ if (bufferedMap.sourcesContent) {
1667
+ map.sourcesContent = bufferedMap.sourcesContent.map(
1668
+ (buffer) => buffer && buffer.toString("utf-8")
1669
+ );
1670
+ }
1671
+ return map;
1672
+ };
1673
+ var CachedSource = class extends Source {
1674
+ constructor(source, cachedData) {
1675
+ super();
1676
+ this._source = source;
1677
+ this._cachedSourceType = cachedData ? cachedData.source : void 0;
1678
+ this._cachedSource = void 0;
1679
+ this._cachedBuffer = cachedData ? cachedData.buffer : void 0;
1680
+ this._cachedSize = cachedData ? cachedData.size : void 0;
1681
+ this._cachedMaps = cachedData ? cachedData.maps : /* @__PURE__ */ new Map();
1682
+ this._cachedHashUpdate = cachedData ? cachedData.hash : void 0;
1683
+ }
1684
+ getCachedData() {
1685
+ const bufferedMaps = /* @__PURE__ */ new Map();
1686
+ for (const pair of this._cachedMaps) {
1687
+ let cacheEntry = pair[1];
1688
+ if (cacheEntry.bufferedMap === void 0) {
1689
+ cacheEntry.bufferedMap = mapToBufferedMap(
1690
+ this._getMapFromCacheEntry(cacheEntry)
1691
+ );
1692
+ }
1693
+ bufferedMaps.set(pair[0], {
1694
+ map: void 0,
1695
+ bufferedMap: cacheEntry.bufferedMap
1696
+ });
1697
+ }
1698
+ if (this._cachedSource) {
1699
+ this.buffer();
1700
+ }
1701
+ return {
1702
+ buffer: this._cachedBuffer,
1703
+ source: this._cachedSourceType !== void 0 ? this._cachedSourceType : typeof this._cachedSource === "string" ? true : Buffer.isBuffer(this._cachedSource) ? false : void 0,
1704
+ size: this._cachedSize,
1705
+ maps: bufferedMaps,
1706
+ hash: this._cachedHashUpdate
1707
+ };
1708
+ }
1709
+ originalLazy() {
1710
+ return this._source;
1711
+ }
1712
+ original() {
1713
+ if (typeof this._source === "function") this._source = this._source();
1714
+ return this._source;
1715
+ }
1716
+ source() {
1717
+ const source = this._getCachedSource();
1718
+ if (source !== void 0) return source;
1719
+ return this._cachedSource = this.original().source();
1720
+ }
1721
+ _getMapFromCacheEntry(cacheEntry) {
1722
+ if (cacheEntry.map !== void 0) {
1723
+ return cacheEntry.map;
1724
+ } else if (cacheEntry.bufferedMap !== void 0) {
1725
+ return cacheEntry.map = bufferedMapToMap(cacheEntry.bufferedMap);
1726
+ }
1727
+ }
1728
+ _getCachedSource() {
1729
+ if (this._cachedSource !== void 0) return this._cachedSource;
1730
+ if (this._cachedBuffer && this._cachedSourceType !== void 0) {
1731
+ return this._cachedSource = this._cachedSourceType ? this._cachedBuffer.toString("utf-8") : this._cachedBuffer;
1732
+ }
1733
+ }
1734
+ buffer() {
1735
+ if (this._cachedBuffer !== void 0) return this._cachedBuffer;
1736
+ if (this._cachedSource !== void 0) {
1737
+ if (Buffer.isBuffer(this._cachedSource)) {
1738
+ return this._cachedBuffer = this._cachedSource;
1739
+ }
1740
+ return this._cachedBuffer = Buffer.from(this._cachedSource, "utf-8");
1741
+ }
1742
+ if (typeof this.original().buffer === "function") {
1743
+ return this._cachedBuffer = this.original().buffer();
1744
+ }
1745
+ const bufferOrString = this.source();
1746
+ if (Buffer.isBuffer(bufferOrString)) {
1747
+ return this._cachedBuffer = bufferOrString;
1748
+ }
1749
+ return this._cachedBuffer = Buffer.from(bufferOrString, "utf-8");
1750
+ }
1751
+ size() {
1752
+ if (this._cachedSize !== void 0) return this._cachedSize;
1753
+ if (this._cachedBuffer !== void 0) {
1754
+ return this._cachedSize = this._cachedBuffer.length;
1755
+ }
1756
+ const source = this._getCachedSource();
1757
+ if (source !== void 0) {
1758
+ return this._cachedSize = Buffer.byteLength(source);
1759
+ }
1760
+ return this._cachedSize = this.original().size();
1761
+ }
1762
+ sourceAndMap(options) {
1763
+ const key = options ? JSON.stringify(options) : "{}";
1764
+ const cacheEntry = this._cachedMaps.get(key);
1765
+ if (cacheEntry !== void 0) {
1766
+ const map2 = this._getMapFromCacheEntry(cacheEntry);
1767
+ return { source: this.source(), map: map2 };
1768
+ }
1769
+ let source = this._getCachedSource();
1770
+ let map;
1771
+ if (source !== void 0) {
1772
+ map = this.original().map(options);
1773
+ } else {
1774
+ const sourceAndMap = this.original().sourceAndMap(options);
1775
+ source = sourceAndMap.source;
1776
+ map = sourceAndMap.map;
1777
+ this._cachedSource = source;
1778
+ }
1779
+ this._cachedMaps.set(key, {
1780
+ map,
1781
+ bufferedMap: void 0
1782
+ });
1783
+ return { source, map };
1784
+ }
1785
+ streamChunks(options, onChunk, onSource, onName) {
1786
+ const key = options ? JSON.stringify(options) : "{}";
1787
+ if (this._cachedMaps.has(key) && (this._cachedBuffer !== void 0 || this._cachedSource !== void 0)) {
1788
+ const { source: source2, map: map2 } = this.sourceAndMap(options);
1789
+ if (map2) {
1790
+ return streamChunksOfSourceMap(
1791
+ source2,
1792
+ map2,
1793
+ onChunk,
1794
+ onSource,
1795
+ onName,
1796
+ !!(options && options.finalSource),
1797
+ true
1798
+ );
1799
+ } else {
1800
+ return streamChunksOfRawSource(
1801
+ source2,
1802
+ onChunk,
1803
+ onSource,
1804
+ onName,
1805
+ !!(options && options.finalSource)
1806
+ );
1807
+ }
1808
+ }
1809
+ const { result, source, map } = streamAndGetSourceAndMap(
1810
+ this.original(),
1811
+ options,
1812
+ onChunk,
1813
+ onSource,
1814
+ onName
1815
+ );
1816
+ this._cachedSource = source;
1817
+ this._cachedMaps.set(key, {
1818
+ map,
1819
+ bufferedMap: void 0
1820
+ });
1821
+ return result;
1822
+ }
1823
+ map(options) {
1824
+ const key = options ? JSON.stringify(options) : "{}";
1825
+ const cacheEntry = this._cachedMaps.get(key);
1826
+ if (cacheEntry !== void 0) {
1827
+ return this._getMapFromCacheEntry(cacheEntry);
1828
+ }
1829
+ const map = this.original().map(options);
1830
+ this._cachedMaps.set(key, {
1831
+ map,
1832
+ bufferedMap: void 0
1833
+ });
1834
+ return map;
1835
+ }
1836
+ updateHash(hash) {
1837
+ if (this._cachedHashUpdate !== void 0) {
1838
+ for (const item of this._cachedHashUpdate) hash.update(item);
1839
+ return;
1840
+ }
1841
+ const update = [];
1842
+ let currentString = void 0;
1843
+ const tracker = {
1844
+ update: (item) => {
1845
+ if (typeof item === "string" && item.length < 10240) {
1846
+ if (currentString === void 0) {
1847
+ currentString = item;
1848
+ } else {
1849
+ currentString += item;
1850
+ if (currentString.length > 102400) {
1851
+ update.push(Buffer.from(currentString));
1852
+ currentString = void 0;
1853
+ }
1854
+ }
1855
+ } else {
1856
+ if (currentString !== void 0) {
1857
+ update.push(Buffer.from(currentString));
1858
+ currentString = void 0;
1859
+ }
1860
+ update.push(item);
1861
+ }
1862
+ }
1863
+ };
1864
+ this.original().updateHash(tracker);
1865
+ if (currentString !== void 0) {
1866
+ update.push(Buffer.from(currentString));
1867
+ }
1868
+ for (const item of update) hash.update(item);
1869
+ this._cachedHashUpdate = update;
1870
+ }
1871
+ };
1872
+ module2.exports = CachedSource;
1873
+ }
1874
+ });
1875
+
1876
+ // node_modules/webpack-sources/lib/ConcatSource.js
1877
+ var require_ConcatSource = __commonJS({
1878
+ "node_modules/webpack-sources/lib/ConcatSource.js"(exports2, module2) {
1879
+ "use strict";
1880
+ var Source = require_Source();
1881
+ var RawSource = require_RawSource();
1882
+ var streamChunks = require_streamChunks();
1883
+ var { getMap, getSourceAndMap } = require_getFromStreamChunks();
1884
+ var stringsAsRawSources = /* @__PURE__ */ new WeakSet();
1885
+ var ConcatSource2 = class _ConcatSource extends Source {
1886
+ constructor() {
1887
+ super();
1888
+ this._children = [];
1889
+ for (let i = 0; i < arguments.length; i++) {
1890
+ const item = arguments[i];
1891
+ if (item instanceof _ConcatSource) {
1892
+ for (const child of item._children) {
1893
+ this._children.push(child);
1894
+ }
1895
+ } else {
1896
+ this._children.push(item);
1897
+ }
1898
+ }
1899
+ this._isOptimized = arguments.length === 0;
1900
+ }
1901
+ getChildren() {
1902
+ if (!this._isOptimized) this._optimize();
1903
+ return this._children;
1904
+ }
1905
+ add(item) {
1906
+ if (item instanceof _ConcatSource) {
1907
+ for (const child of item._children) {
1908
+ this._children.push(child);
1909
+ }
1910
+ } else {
1911
+ this._children.push(item);
1912
+ }
1913
+ this._isOptimized = false;
1914
+ }
1915
+ addAllSkipOptimizing(items) {
1916
+ for (const item of items) {
1917
+ this._children.push(item);
1918
+ }
1919
+ }
1920
+ buffer() {
1921
+ if (!this._isOptimized) this._optimize();
1922
+ const buffers = [];
1923
+ for (const child of this._children) {
1924
+ if (typeof child.buffer === "function") {
1925
+ buffers.push(child.buffer());
1926
+ } else {
1927
+ const bufferOrString = child.source();
1928
+ if (Buffer.isBuffer(bufferOrString)) {
1929
+ buffers.push(bufferOrString);
1930
+ } else {
1931
+ buffers.push(Buffer.from(bufferOrString, "utf-8"));
1932
+ }
1933
+ }
1934
+ }
1935
+ return Buffer.concat(buffers);
1936
+ }
1937
+ source() {
1938
+ if (!this._isOptimized) this._optimize();
1939
+ let source = "";
1940
+ for (const child of this._children) {
1941
+ source += child.source();
1942
+ }
1943
+ return source;
1944
+ }
1945
+ size() {
1946
+ if (!this._isOptimized) this._optimize();
1947
+ let size = 0;
1948
+ for (const child of this._children) {
1949
+ size += child.size();
1950
+ }
1951
+ return size;
1952
+ }
1953
+ map(options) {
1954
+ return getMap(this, options);
1955
+ }
1956
+ sourceAndMap(options) {
1957
+ return getSourceAndMap(this, options);
1958
+ }
1959
+ streamChunks(options, onChunk, onSource, onName) {
1960
+ if (!this._isOptimized) this._optimize();
1961
+ if (this._children.length === 1)
1962
+ return this._children[0].streamChunks(options, onChunk, onSource, onName);
1963
+ let currentLineOffset = 0;
1964
+ let currentColumnOffset = 0;
1965
+ let sourceMapping = /* @__PURE__ */ new Map();
1966
+ let nameMapping = /* @__PURE__ */ new Map();
1967
+ const finalSource = !!(options && options.finalSource);
1968
+ let code = "";
1969
+ let needToCloseMapping = false;
1970
+ for (const item of this._children) {
1971
+ const sourceIndexMapping = [];
1972
+ const nameIndexMapping = [];
1973
+ let lastMappingLine = 0;
1974
+ const { generatedLine, generatedColumn, source } = streamChunks(
1975
+ item,
1976
+ options,
1977
+ // eslint-disable-next-line no-loop-func
1978
+ (chunk, generatedLine2, generatedColumn2, sourceIndex, originalLine, originalColumn, nameIndex) => {
1979
+ const line = generatedLine2 + currentLineOffset;
1980
+ const column = generatedLine2 === 1 ? generatedColumn2 + currentColumnOffset : generatedColumn2;
1981
+ if (needToCloseMapping) {
1982
+ if (generatedLine2 !== 1 || generatedColumn2 !== 0) {
1983
+ onChunk(
1984
+ void 0,
1985
+ currentLineOffset + 1,
1986
+ currentColumnOffset,
1987
+ -1,
1988
+ -1,
1989
+ -1,
1990
+ -1
1991
+ );
1992
+ }
1993
+ needToCloseMapping = false;
1994
+ }
1995
+ const resultSourceIndex = sourceIndex < 0 || sourceIndex >= sourceIndexMapping.length ? -1 : sourceIndexMapping[sourceIndex];
1996
+ const resultNameIndex = nameIndex < 0 || nameIndex >= nameIndexMapping.length ? -1 : nameIndexMapping[nameIndex];
1997
+ lastMappingLine = resultSourceIndex < 0 ? 0 : generatedLine2;
1998
+ if (finalSource) {
1999
+ if (chunk !== void 0) code += chunk;
2000
+ if (resultSourceIndex >= 0) {
2001
+ onChunk(
2002
+ void 0,
2003
+ line,
2004
+ column,
2005
+ resultSourceIndex,
2006
+ originalLine,
2007
+ originalColumn,
2008
+ resultNameIndex
2009
+ );
2010
+ }
2011
+ } else {
2012
+ if (resultSourceIndex < 0) {
2013
+ onChunk(chunk, line, column, -1, -1, -1, -1);
2014
+ } else {
2015
+ onChunk(
2016
+ chunk,
2017
+ line,
2018
+ column,
2019
+ resultSourceIndex,
2020
+ originalLine,
2021
+ originalColumn,
2022
+ resultNameIndex
2023
+ );
2024
+ }
2025
+ }
2026
+ },
2027
+ (i, source2, sourceContent) => {
2028
+ let globalIndex = sourceMapping.get(source2);
2029
+ if (globalIndex === void 0) {
2030
+ sourceMapping.set(source2, globalIndex = sourceMapping.size);
2031
+ onSource(globalIndex, source2, sourceContent);
2032
+ }
2033
+ sourceIndexMapping[i] = globalIndex;
2034
+ },
2035
+ (i, name) => {
2036
+ let globalIndex = nameMapping.get(name);
2037
+ if (globalIndex === void 0) {
2038
+ nameMapping.set(name, globalIndex = nameMapping.size);
2039
+ onName(globalIndex, name);
2040
+ }
2041
+ nameIndexMapping[i] = globalIndex;
2042
+ }
2043
+ );
2044
+ if (source !== void 0) code += source;
2045
+ if (needToCloseMapping) {
2046
+ if (generatedLine !== 1 || generatedColumn !== 0) {
2047
+ onChunk(
2048
+ void 0,
2049
+ currentLineOffset + 1,
2050
+ currentColumnOffset,
2051
+ -1,
2052
+ -1,
2053
+ -1,
2054
+ -1
2055
+ );
2056
+ needToCloseMapping = false;
2057
+ }
2058
+ }
2059
+ if (generatedLine > 1) {
2060
+ currentColumnOffset = generatedColumn;
2061
+ } else {
2062
+ currentColumnOffset += generatedColumn;
2063
+ }
2064
+ needToCloseMapping = needToCloseMapping || finalSource && lastMappingLine === generatedLine;
2065
+ currentLineOffset += generatedLine - 1;
2066
+ }
2067
+ return {
2068
+ generatedLine: currentLineOffset + 1,
2069
+ generatedColumn: currentColumnOffset,
2070
+ source: finalSource ? code : void 0
2071
+ };
2072
+ }
2073
+ updateHash(hash) {
2074
+ if (!this._isOptimized) this._optimize();
2075
+ hash.update("ConcatSource");
2076
+ for (const item of this._children) {
2077
+ item.updateHash(hash);
2078
+ }
2079
+ }
2080
+ _optimize() {
2081
+ const newChildren = [];
2082
+ let currentString = void 0;
2083
+ let currentRawSources = void 0;
2084
+ const addStringToRawSources = (string) => {
2085
+ if (currentRawSources === void 0) {
2086
+ currentRawSources = string;
2087
+ } else if (Array.isArray(currentRawSources)) {
2088
+ currentRawSources.push(string);
2089
+ } else {
2090
+ currentRawSources = [
2091
+ typeof currentRawSources === "string" ? currentRawSources : currentRawSources.source(),
2092
+ string
2093
+ ];
2094
+ }
2095
+ };
2096
+ const addSourceToRawSources = (source) => {
2097
+ if (currentRawSources === void 0) {
2098
+ currentRawSources = source;
2099
+ } else if (Array.isArray(currentRawSources)) {
2100
+ currentRawSources.push(source.source());
2101
+ } else {
2102
+ currentRawSources = [
2103
+ typeof currentRawSources === "string" ? currentRawSources : currentRawSources.source(),
2104
+ source.source()
2105
+ ];
2106
+ }
2107
+ };
2108
+ const mergeRawSources = () => {
2109
+ if (Array.isArray(currentRawSources)) {
2110
+ const rawSource = new RawSource(currentRawSources.join(""));
2111
+ stringsAsRawSources.add(rawSource);
2112
+ newChildren.push(rawSource);
2113
+ } else if (typeof currentRawSources === "string") {
2114
+ const rawSource = new RawSource(currentRawSources);
2115
+ stringsAsRawSources.add(rawSource);
2116
+ newChildren.push(rawSource);
2117
+ } else {
2118
+ newChildren.push(currentRawSources);
2119
+ }
2120
+ };
2121
+ for (const child of this._children) {
2122
+ if (typeof child === "string") {
2123
+ if (currentString === void 0) {
2124
+ currentString = child;
2125
+ } else {
2126
+ currentString += child;
2127
+ }
2128
+ } else {
2129
+ if (currentString !== void 0) {
2130
+ addStringToRawSources(currentString);
2131
+ currentString = void 0;
2132
+ }
2133
+ if (stringsAsRawSources.has(child)) {
2134
+ addSourceToRawSources(child);
2135
+ } else {
2136
+ if (currentRawSources !== void 0) {
2137
+ mergeRawSources();
2138
+ currentRawSources = void 0;
2139
+ }
2140
+ newChildren.push(child);
2141
+ }
2142
+ }
2143
+ }
2144
+ if (currentString !== void 0) {
2145
+ addStringToRawSources(currentString);
2146
+ }
2147
+ if (currentRawSources !== void 0) {
2148
+ mergeRawSources();
2149
+ }
2150
+ this._children = newChildren;
2151
+ this._isOptimized = true;
2152
+ }
2153
+ };
2154
+ module2.exports = ConcatSource2;
2155
+ }
2156
+ });
2157
+
2158
+ // node_modules/webpack-sources/lib/ReplaceSource.js
2159
+ var require_ReplaceSource = __commonJS({
2160
+ "node_modules/webpack-sources/lib/ReplaceSource.js"(exports2, module2) {
2161
+ "use strict";
2162
+ var { getMap, getSourceAndMap } = require_getFromStreamChunks();
2163
+ var streamChunks = require_streamChunks();
2164
+ var Source = require_Source();
2165
+ var splitIntoLines = require_splitIntoLines();
2166
+ var hasStableSort = typeof process === "object" && process.versions && typeof process.versions.v8 === "string" && !/^[0-6]\./.test(process.versions.v8);
2167
+ var MAX_SOURCE_POSITION = 536870912;
2168
+ var Replacement = class {
2169
+ constructor(start, end, content, name) {
2170
+ this.start = start;
2171
+ this.end = end;
2172
+ this.content = content;
2173
+ this.name = name;
2174
+ if (!hasStableSort) {
2175
+ this.index = -1;
2176
+ }
2177
+ }
2178
+ };
2179
+ var ReplaceSource = class extends Source {
2180
+ constructor(source, name) {
2181
+ super();
2182
+ this._source = source;
2183
+ this._name = name;
2184
+ this._replacements = [];
2185
+ this._isSorted = true;
2186
+ }
2187
+ getName() {
2188
+ return this._name;
2189
+ }
2190
+ getReplacements() {
2191
+ this._sortReplacements();
2192
+ return this._replacements;
2193
+ }
2194
+ replace(start, end, newValue, name) {
2195
+ if (typeof newValue !== "string")
2196
+ throw new Error(
2197
+ "insertion must be a string, but is a " + typeof newValue
2198
+ );
2199
+ this._replacements.push(new Replacement(start, end, newValue, name));
2200
+ this._isSorted = false;
2201
+ }
2202
+ insert(pos, newValue, name) {
2203
+ if (typeof newValue !== "string")
2204
+ throw new Error(
2205
+ "insertion must be a string, but is a " + typeof newValue + ": " + newValue
2206
+ );
2207
+ this._replacements.push(new Replacement(pos, pos - 1, newValue, name));
2208
+ this._isSorted = false;
2209
+ }
2210
+ source() {
2211
+ if (this._replacements.length === 0) {
2212
+ return this._source.source();
2213
+ }
2214
+ let current = this._source.source();
2215
+ let pos = 0;
2216
+ const result = [];
2217
+ this._sortReplacements();
2218
+ for (const replacement of this._replacements) {
2219
+ const start = Math.floor(replacement.start);
2220
+ const end = Math.floor(replacement.end + 1);
2221
+ if (pos < start) {
2222
+ const offset = start - pos;
2223
+ result.push(current.slice(0, offset));
2224
+ current = current.slice(offset);
2225
+ pos = start;
2226
+ }
2227
+ result.push(replacement.content);
2228
+ if (pos < end) {
2229
+ const offset = end - pos;
2230
+ current = current.slice(offset);
2231
+ pos = end;
2232
+ }
2233
+ }
2234
+ result.push(current);
2235
+ return result.join("");
2236
+ }
2237
+ map(options) {
2238
+ if (this._replacements.length === 0) {
2239
+ return this._source.map(options);
2240
+ }
2241
+ return getMap(this, options);
2242
+ }
2243
+ sourceAndMap(options) {
2244
+ if (this._replacements.length === 0) {
2245
+ return this._source.sourceAndMap(options);
2246
+ }
2247
+ return getSourceAndMap(this, options);
2248
+ }
2249
+ original() {
2250
+ return this._source;
2251
+ }
2252
+ _sortReplacements() {
2253
+ if (this._isSorted) return;
2254
+ if (hasStableSort) {
2255
+ this._replacements.sort(function(a, b) {
2256
+ const diff1 = a.start - b.start;
2257
+ if (diff1 !== 0) return diff1;
2258
+ const diff2 = a.end - b.end;
2259
+ if (diff2 !== 0) return diff2;
2260
+ return 0;
2261
+ });
2262
+ } else {
2263
+ this._replacements.forEach((repl, i) => repl.index = i);
2264
+ this._replacements.sort(function(a, b) {
2265
+ const diff1 = a.start - b.start;
2266
+ if (diff1 !== 0) return diff1;
2267
+ const diff2 = a.end - b.end;
2268
+ if (diff2 !== 0) return diff2;
2269
+ return a.index - b.index;
2270
+ });
2271
+ }
2272
+ this._isSorted = true;
2273
+ }
2274
+ streamChunks(options, onChunk, onSource, onName) {
2275
+ this._sortReplacements();
2276
+ const repls = this._replacements;
2277
+ let pos = 0;
2278
+ let i = 0;
2279
+ let replacmentEnd = -1;
2280
+ let nextReplacement = i < repls.length ? Math.floor(repls[i].start) : MAX_SOURCE_POSITION;
2281
+ let generatedLineOffset = 0;
2282
+ let generatedColumnOffset = 0;
2283
+ let generatedColumnOffsetLine = 0;
2284
+ const sourceContents = [];
2285
+ const nameMapping = /* @__PURE__ */ new Map();
2286
+ const nameIndexMapping = [];
2287
+ const checkOriginalContent = (sourceIndex, line2, column, expectedChunk) => {
2288
+ let content = sourceIndex < sourceContents.length ? sourceContents[sourceIndex] : void 0;
2289
+ if (content === void 0) return false;
2290
+ if (typeof content === "string") {
2291
+ content = splitIntoLines(content);
2292
+ sourceContents[sourceIndex] = content;
2293
+ }
2294
+ const contentLine = line2 <= content.length ? content[line2 - 1] : null;
2295
+ if (contentLine === null) return false;
2296
+ return contentLine.slice(column, column + expectedChunk.length) === expectedChunk;
2297
+ };
2298
+ let { generatedLine, generatedColumn } = streamChunks(
2299
+ this._source,
2300
+ Object.assign({}, options, { finalSource: false }),
2301
+ (chunk, generatedLine2, generatedColumn2, sourceIndex, originalLine, originalColumn, nameIndex) => {
2302
+ let chunkPos = 0;
2303
+ let endPos = pos + chunk.length;
2304
+ if (replacmentEnd > pos) {
2305
+ if (replacmentEnd >= endPos) {
2306
+ const line3 = generatedLine2 + generatedLineOffset;
2307
+ if (chunk.endsWith("\n")) {
2308
+ generatedLineOffset--;
2309
+ if (generatedColumnOffsetLine === line3) {
2310
+ generatedColumnOffset += generatedColumn2;
2311
+ }
2312
+ } else if (generatedColumnOffsetLine === line3) {
2313
+ generatedColumnOffset -= chunk.length;
2314
+ } else {
2315
+ generatedColumnOffset = -chunk.length;
2316
+ generatedColumnOffsetLine = line3;
2317
+ }
2318
+ pos = endPos;
2319
+ return;
2320
+ }
2321
+ chunkPos = replacmentEnd - pos;
2322
+ if (checkOriginalContent(
2323
+ sourceIndex,
2324
+ originalLine,
2325
+ originalColumn,
2326
+ chunk.slice(0, chunkPos)
2327
+ )) {
2328
+ originalColumn += chunkPos;
2329
+ }
2330
+ pos += chunkPos;
2331
+ const line2 = generatedLine2 + generatedLineOffset;
2332
+ if (generatedColumnOffsetLine === line2) {
2333
+ generatedColumnOffset -= chunkPos;
2334
+ } else {
2335
+ generatedColumnOffset = -chunkPos;
2336
+ generatedColumnOffsetLine = line2;
2337
+ }
2338
+ generatedColumn2 += chunkPos;
2339
+ }
2340
+ if (nextReplacement < endPos) {
2341
+ do {
2342
+ let line2 = generatedLine2 + generatedLineOffset;
2343
+ if (nextReplacement > pos) {
2344
+ const offset2 = nextReplacement - pos;
2345
+ const chunkSlice = chunk.slice(chunkPos, chunkPos + offset2);
2346
+ onChunk(
2347
+ chunkSlice,
2348
+ line2,
2349
+ generatedColumn2 + (line2 === generatedColumnOffsetLine ? generatedColumnOffset : 0),
2350
+ sourceIndex,
2351
+ originalLine,
2352
+ originalColumn,
2353
+ nameIndex < 0 || nameIndex >= nameIndexMapping.length ? -1 : nameIndexMapping[nameIndex]
2354
+ );
2355
+ generatedColumn2 += offset2;
2356
+ chunkPos += offset2;
2357
+ pos = nextReplacement;
2358
+ if (checkOriginalContent(
2359
+ sourceIndex,
2360
+ originalLine,
2361
+ originalColumn,
2362
+ chunkSlice
2363
+ )) {
2364
+ originalColumn += chunkSlice.length;
2365
+ }
2366
+ }
2367
+ const { content, name } = repls[i];
2368
+ let matches2 = splitIntoLines(content);
2369
+ let replacementNameIndex = nameIndex;
2370
+ if (sourceIndex >= 0 && name) {
2371
+ let globalIndex = nameMapping.get(name);
2372
+ if (globalIndex === void 0) {
2373
+ globalIndex = nameMapping.size;
2374
+ nameMapping.set(name, globalIndex);
2375
+ onName(globalIndex, name);
2376
+ }
2377
+ replacementNameIndex = globalIndex;
2378
+ }
2379
+ for (let m = 0; m < matches2.length; m++) {
2380
+ const contentLine = matches2[m];
2381
+ onChunk(
2382
+ contentLine,
2383
+ line2,
2384
+ generatedColumn2 + (line2 === generatedColumnOffsetLine ? generatedColumnOffset : 0),
2385
+ sourceIndex,
2386
+ originalLine,
2387
+ originalColumn,
2388
+ replacementNameIndex
2389
+ );
2390
+ replacementNameIndex = -1;
2391
+ if (m === matches2.length - 1 && !contentLine.endsWith("\n")) {
2392
+ if (generatedColumnOffsetLine === line2) {
2393
+ generatedColumnOffset += contentLine.length;
2394
+ } else {
2395
+ generatedColumnOffset = contentLine.length;
2396
+ generatedColumnOffsetLine = line2;
2397
+ }
2398
+ } else {
2399
+ generatedLineOffset++;
2400
+ line2++;
2401
+ generatedColumnOffset = -generatedColumn2;
2402
+ generatedColumnOffsetLine = line2;
2403
+ }
2404
+ }
2405
+ replacmentEnd = Math.max(
2406
+ replacmentEnd,
2407
+ Math.floor(repls[i].end + 1)
2408
+ );
2409
+ i++;
2410
+ nextReplacement = i < repls.length ? Math.floor(repls[i].start) : MAX_SOURCE_POSITION;
2411
+ const offset = chunk.length - endPos + replacmentEnd - chunkPos;
2412
+ if (offset > 0) {
2413
+ if (replacmentEnd >= endPos) {
2414
+ let line4 = generatedLine2 + generatedLineOffset;
2415
+ if (chunk.endsWith("\n")) {
2416
+ generatedLineOffset--;
2417
+ if (generatedColumnOffsetLine === line4) {
2418
+ generatedColumnOffset += generatedColumn2;
2419
+ }
2420
+ } else if (generatedColumnOffsetLine === line4) {
2421
+ generatedColumnOffset -= chunk.length - chunkPos;
2422
+ } else {
2423
+ generatedColumnOffset = chunkPos - chunk.length;
2424
+ generatedColumnOffsetLine = line4;
2425
+ }
2426
+ pos = endPos;
2427
+ return;
2428
+ }
2429
+ const line3 = generatedLine2 + generatedLineOffset;
2430
+ if (checkOriginalContent(
2431
+ sourceIndex,
2432
+ originalLine,
2433
+ originalColumn,
2434
+ chunk.slice(chunkPos, chunkPos + offset)
2435
+ )) {
2436
+ originalColumn += offset;
2437
+ }
2438
+ chunkPos += offset;
2439
+ pos += offset;
2440
+ if (generatedColumnOffsetLine === line3) {
2441
+ generatedColumnOffset -= offset;
2442
+ } else {
2443
+ generatedColumnOffset = -offset;
2444
+ generatedColumnOffsetLine = line3;
2445
+ }
2446
+ generatedColumn2 += offset;
2447
+ }
2448
+ } while (nextReplacement < endPos);
2449
+ }
2450
+ if (chunkPos < chunk.length) {
2451
+ const chunkSlice = chunkPos === 0 ? chunk : chunk.slice(chunkPos);
2452
+ const line2 = generatedLine2 + generatedLineOffset;
2453
+ onChunk(
2454
+ chunkSlice,
2455
+ line2,
2456
+ generatedColumn2 + (line2 === generatedColumnOffsetLine ? generatedColumnOffset : 0),
2457
+ sourceIndex,
2458
+ originalLine,
2459
+ originalColumn,
2460
+ nameIndex < 0 ? -1 : nameIndexMapping[nameIndex]
2461
+ );
2462
+ }
2463
+ pos = endPos;
2464
+ },
2465
+ (sourceIndex, source, sourceContent) => {
2466
+ while (sourceContents.length < sourceIndex)
2467
+ sourceContents.push(void 0);
2468
+ sourceContents[sourceIndex] = sourceContent;
2469
+ onSource(sourceIndex, source, sourceContent);
2470
+ },
2471
+ (nameIndex, name) => {
2472
+ let globalIndex = nameMapping.get(name);
2473
+ if (globalIndex === void 0) {
2474
+ globalIndex = nameMapping.size;
2475
+ nameMapping.set(name, globalIndex);
2476
+ onName(globalIndex, name);
2477
+ }
2478
+ nameIndexMapping[nameIndex] = globalIndex;
2479
+ }
2480
+ );
2481
+ let remainer = "";
2482
+ for (; i < repls.length; i++) {
2483
+ remainer += repls[i].content;
2484
+ }
2485
+ let line = generatedLine + generatedLineOffset;
2486
+ let matches = splitIntoLines(remainer);
2487
+ for (let m = 0; m < matches.length; m++) {
2488
+ const contentLine = matches[m];
2489
+ onChunk(
2490
+ contentLine,
2491
+ line,
2492
+ generatedColumn + (line === generatedColumnOffsetLine ? generatedColumnOffset : 0),
2493
+ -1,
2494
+ -1,
2495
+ -1,
2496
+ -1
2497
+ );
2498
+ if (m === matches.length - 1 && !contentLine.endsWith("\n")) {
2499
+ if (generatedColumnOffsetLine === line) {
2500
+ generatedColumnOffset += contentLine.length;
2501
+ } else {
2502
+ generatedColumnOffset = contentLine.length;
2503
+ generatedColumnOffsetLine = line;
2504
+ }
2505
+ } else {
2506
+ generatedLineOffset++;
2507
+ line++;
2508
+ generatedColumnOffset = -generatedColumn;
2509
+ generatedColumnOffsetLine = line;
2510
+ }
2511
+ }
2512
+ return {
2513
+ generatedLine: line,
2514
+ generatedColumn: generatedColumn + (line === generatedColumnOffsetLine ? generatedColumnOffset : 0)
2515
+ };
2516
+ }
2517
+ updateHash(hash) {
2518
+ this._sortReplacements();
2519
+ hash.update("ReplaceSource");
2520
+ this._source.updateHash(hash);
2521
+ hash.update(this._name || "");
2522
+ for (const repl of this._replacements) {
2523
+ hash.update(`${repl.start}${repl.end}${repl.content}${repl.name}`);
2524
+ }
2525
+ }
2526
+ };
2527
+ module2.exports = ReplaceSource;
2528
+ }
2529
+ });
2530
+
2531
+ // node_modules/webpack-sources/lib/PrefixSource.js
2532
+ var require_PrefixSource = __commonJS({
2533
+ "node_modules/webpack-sources/lib/PrefixSource.js"(exports2, module2) {
2534
+ "use strict";
2535
+ var Source = require_Source();
2536
+ var RawSource = require_RawSource();
2537
+ var streamChunks = require_streamChunks();
2538
+ var { getMap, getSourceAndMap } = require_getFromStreamChunks();
2539
+ var REPLACE_REGEX = /\n(?=.|\s)/g;
2540
+ var PrefixSource = class extends Source {
2541
+ constructor(prefix, source) {
2542
+ super();
2543
+ this._source = typeof source === "string" || Buffer.isBuffer(source) ? new RawSource(source, true) : source;
2544
+ this._prefix = prefix;
2545
+ }
2546
+ getPrefix() {
2547
+ return this._prefix;
2548
+ }
2549
+ original() {
2550
+ return this._source;
2551
+ }
2552
+ source() {
2553
+ const node = this._source.source();
2554
+ const prefix = this._prefix;
2555
+ return prefix + node.replace(REPLACE_REGEX, "\n" + prefix);
2556
+ }
2557
+ // TODO efficient buffer() implementation
2558
+ map(options) {
2559
+ return getMap(this, options);
2560
+ }
2561
+ sourceAndMap(options) {
2562
+ return getSourceAndMap(this, options);
2563
+ }
2564
+ streamChunks(options, onChunk, onSource, onName) {
2565
+ const prefix = this._prefix;
2566
+ const prefixOffset = prefix.length;
2567
+ const linesOnly = !!(options && options.columns === false);
2568
+ const { generatedLine, generatedColumn, source } = streamChunks(
2569
+ this._source,
2570
+ options,
2571
+ (chunk, generatedLine2, generatedColumn2, sourceIndex, originalLine, originalColumn, nameIndex) => {
2572
+ if (generatedColumn2 !== 0) {
2573
+ generatedColumn2 += prefixOffset;
2574
+ } else if (chunk !== void 0) {
2575
+ if (linesOnly || sourceIndex < 0) {
2576
+ chunk = prefix + chunk;
2577
+ } else if (prefixOffset > 0) {
2578
+ onChunk(prefix, generatedLine2, generatedColumn2, -1, -1, -1, -1);
2579
+ generatedColumn2 += prefixOffset;
2580
+ }
2581
+ } else if (!linesOnly) {
2582
+ generatedColumn2 += prefixOffset;
2583
+ }
2584
+ onChunk(
2585
+ chunk,
2586
+ generatedLine2,
2587
+ generatedColumn2,
2588
+ sourceIndex,
2589
+ originalLine,
2590
+ originalColumn,
2591
+ nameIndex
2592
+ );
2593
+ },
2594
+ onSource,
2595
+ onName
2596
+ );
2597
+ return {
2598
+ generatedLine,
2599
+ generatedColumn: generatedColumn === 0 ? 0 : prefixOffset + generatedColumn,
2600
+ source: source !== void 0 ? prefix + source.replace(REPLACE_REGEX, "\n" + prefix) : void 0
2601
+ };
2602
+ }
2603
+ updateHash(hash) {
2604
+ hash.update("PrefixSource");
2605
+ this._source.updateHash(hash);
2606
+ hash.update(this._prefix);
2607
+ }
2608
+ };
2609
+ module2.exports = PrefixSource;
2610
+ }
2611
+ });
2612
+
2613
+ // node_modules/webpack-sources/lib/SizeOnlySource.js
2614
+ var require_SizeOnlySource = __commonJS({
2615
+ "node_modules/webpack-sources/lib/SizeOnlySource.js"(exports2, module2) {
2616
+ "use strict";
2617
+ var Source = require_Source();
2618
+ var SizeOnlySource = class extends Source {
2619
+ constructor(size) {
2620
+ super();
2621
+ this._size = size;
2622
+ }
2623
+ _error() {
2624
+ return new Error(
2625
+ "Content and Map of this Source is not available (only size() is supported)"
2626
+ );
2627
+ }
2628
+ size() {
2629
+ return this._size;
2630
+ }
2631
+ source() {
2632
+ throw this._error();
2633
+ }
2634
+ buffer() {
2635
+ throw this._error();
2636
+ }
2637
+ map(options) {
2638
+ throw this._error();
2639
+ }
2640
+ updateHash() {
2641
+ throw this._error();
2642
+ }
2643
+ };
2644
+ module2.exports = SizeOnlySource;
2645
+ }
2646
+ });
2647
+
2648
+ // node_modules/webpack-sources/lib/CompatSource.js
2649
+ var require_CompatSource = __commonJS({
2650
+ "node_modules/webpack-sources/lib/CompatSource.js"(exports2, module2) {
2651
+ "use strict";
2652
+ var Source = require_Source();
2653
+ var CompatSource = class _CompatSource extends Source {
2654
+ static from(sourceLike) {
2655
+ return sourceLike instanceof Source ? sourceLike : new _CompatSource(sourceLike);
2656
+ }
2657
+ constructor(sourceLike) {
2658
+ super();
2659
+ this._sourceLike = sourceLike;
2660
+ }
2661
+ source() {
2662
+ return this._sourceLike.source();
2663
+ }
2664
+ buffer() {
2665
+ if (typeof this._sourceLike.buffer === "function") {
2666
+ return this._sourceLike.buffer();
2667
+ }
2668
+ return super.buffer();
2669
+ }
2670
+ size() {
2671
+ if (typeof this._sourceLike.size === "function") {
2672
+ return this._sourceLike.size();
2673
+ }
2674
+ return super.size();
2675
+ }
2676
+ map(options) {
2677
+ if (typeof this._sourceLike.map === "function") {
2678
+ return this._sourceLike.map(options);
2679
+ }
2680
+ return super.map(options);
2681
+ }
2682
+ sourceAndMap(options) {
2683
+ if (typeof this._sourceLike.sourceAndMap === "function") {
2684
+ return this._sourceLike.sourceAndMap(options);
2685
+ }
2686
+ return super.sourceAndMap(options);
2687
+ }
2688
+ updateHash(hash) {
2689
+ if (typeof this._sourceLike.updateHash === "function") {
2690
+ return this._sourceLike.updateHash(hash);
2691
+ }
2692
+ if (typeof this._sourceLike.map === "function") {
2693
+ throw new Error(
2694
+ "A Source-like object with a 'map' method must also provide an 'updateHash' method"
2695
+ );
2696
+ }
2697
+ hash.update(this.buffer());
2698
+ }
2699
+ };
2700
+ module2.exports = CompatSource;
2701
+ }
2702
+ });
2703
+
2704
+ // node_modules/webpack-sources/lib/index.js
2705
+ var require_lib = __commonJS({
2706
+ "node_modules/webpack-sources/lib/index.js"(exports2) {
2707
+ var defineExport = (name, fn) => {
2708
+ let value;
2709
+ Object.defineProperty(exports2, name, {
2710
+ get: () => {
2711
+ if (fn !== void 0) {
2712
+ value = fn();
2713
+ fn = void 0;
2714
+ }
2715
+ return value;
2716
+ },
2717
+ configurable: true
2718
+ });
2719
+ };
2720
+ defineExport("Source", () => require_Source());
2721
+ defineExport("RawSource", () => require_RawSource());
2722
+ defineExport("OriginalSource", () => require_OriginalSource());
2723
+ defineExport("SourceMapSource", () => require_SourceMapSource());
2724
+ defineExport("CachedSource", () => require_CachedSource());
2725
+ defineExport("ConcatSource", () => require_ConcatSource());
2726
+ defineExport("ReplaceSource", () => require_ReplaceSource());
2727
+ defineExport("PrefixSource", () => require_PrefixSource());
2728
+ defineExport("SizeOnlySource", () => require_SizeOnlySource());
2729
+ defineExport("CompatSource", () => require_CompatSource());
2730
+ }
2731
+ });
2732
+
2733
+ // packages/dev-tools/webpack/main.ts
2734
+ var main_exports = {};
2735
+ __export(main_exports, {
2736
+ BuilderDevToolsPlugin: () => BuilderDevToolsPlugin
2737
+ });
2738
+ module.exports = __toCommonJS(main_exports);
2739
+ var import_webpack_sources = __toESM(require_lib(), 1);
2740
+ var import_node_path = require("path");
2741
+ var import_node_fs = require("fs");
2742
+ var import_core = require("../core/index.cjs");
2743
+ var import_node = require("../node/index.cjs");
2744
+ var import_server = require("../server/index.cjs");
2745
+ var PLUGIN_NAME = "BuilderDevToolsPlugin";
2746
+ var devToolsSetupPromise = null;
2747
+ async function setupDevTools(opts) {
2748
+ const sys = await (0, import_node.createDevToolsNodeSys)({
2749
+ cwd: process.cwd()
2750
+ });
2751
+ sys.debug("webpack setupDevTools init");
2752
+ const devTools = await (0, import_core.createDevTools)(sys);
2753
+ const server = await (0, import_server.createDevToolsServer)({
2754
+ ...devTools,
2755
+ getClientId: () => "webpack-builder-dev-tools",
2756
+ closeAppServer: async () => {
2757
+ },
2758
+ restartAppServer: async () => {
2759
+ sys.debug("restart server");
2760
+ const configPaths = [
2761
+ "next.config.js",
2762
+ "next.config.ts",
2763
+ "next.config.mjs",
2764
+ "webpack.config.js",
2765
+ "webpack.config.ts"
2766
+ ].map((c) => (0, import_node_path.join)(sys.getAppRootDir(), c));
2767
+ for (const configPath of configPaths) {
2768
+ if ((0, import_node_fs.existsSync)(configPath)) {
2769
+ sys.debug(`restart server: ${configPath}`);
2770
+ (0, import_node_fs.writeFileSync)(
2771
+ configPath,
2772
+ (0, import_node_fs.readFileSync)(configPath, {
2773
+ encoding: "utf-8"
2774
+ })
2775
+ );
2776
+ await new Promise((r) => setTimeout(r, 50));
2777
+ return;
2778
+ }
2779
+ }
2780
+ },
2781
+ enableAppWatch: async (enable) => {
2782
+ return enable;
2783
+ },
2784
+ ...sys,
2785
+ ...opts
2786
+ });
2787
+ sys.debug("webpack setupDevTools done");
2788
+ return {
2789
+ server,
2790
+ sys
2791
+ };
2792
+ }
2793
+ var BuilderDevToolsPlugin = class {
2794
+ constructor(opts) {
2795
+ __publicField(this, "opts");
2796
+ this.opts = opts || {};
2797
+ if (typeof this.opts.enabled !== "boolean") {
2798
+ this.opts.enabled = process.env.NODE_ENV !== "production";
2799
+ }
2800
+ if (this.opts.enabled && devToolsSetupPromise == null) {
2801
+ devToolsSetupPromise = setupDevTools(this.opts);
2802
+ }
2803
+ }
2804
+ apply(c) {
2805
+ if (this.opts.enabled === false) {
2806
+ return;
2807
+ }
2808
+ const compiler = c;
2809
+ const stage = compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS;
2810
+ const cache = /* @__PURE__ */ new WeakMap();
2811
+ compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
2812
+ compilation.hooks.processAssets.tapAsync(
2813
+ {
2814
+ name: PLUGIN_NAME,
2815
+ stage
2816
+ },
2817
+ async (_, callback) => {
2818
+ if (devToolsSetupPromise == null) {
2819
+ return;
2820
+ }
2821
+ for (const chunk of compilation.chunks) {
2822
+ for (const file of chunk.files) {
2823
+ const fileName = (0, import_node_path.basename)(file);
2824
+ const { server, sys } = await devToolsSetupPromise;
2825
+ if (sys.getFrameworks().some((f) => f.name === "next") && fileName !== "webpack.js") {
2826
+ continue;
2827
+ }
2828
+ sys.getAppRootDir = () => compiler.context;
2829
+ const url = new URL(`/~builder-dev-tools.js`, server.getUrl());
2830
+ let c2 = `
15
2831
  ;
16
2832
  /* Builder Devtools (Webpack) */
17
- `;c+=`(() => {
18
- `,c+=` if (typeof document !== "undefined") {
19
- `,c+=` let devToolsScript = document.head.querySelector("script[data-builder-dev-tools]");
20
- `,c+=` if (!devToolsScript) {
21
- `,c+=` devToolsScript = document.createElement("script");
22
- `,c+=` devToolsScript.setAttribute("src", ${JSON.stringify(m)});
23
- `,c+=` devToolsScript.setAttribute("data-builder-dev-tools", "");
24
- `,c+=` devToolsScript.setAttribute("async", "");
25
- `,c+=` document.head.appendChild(devToolsScript);
26
- `,c+=` }
27
- `,c+=` }
28
- `,c+=`})();
29
- `;let _={chunk:h,filename:o},g=r.getPath(c,_);r.updateAsset(o,A=>{let O=i.get(A);if(!O||O.inject!==g){let y=new wt.ConcatSource(A,g);return i.set(A,{source:y,inject:g}),y}return O.source})}u()}})})}};0&&(module.exports={BuilderDevToolsPlugin});
2833
+ `;
2834
+ c2 += `(() => {
2835
+ `;
2836
+ c2 += ` if (typeof document !== "undefined") {
2837
+ `;
2838
+ c2 += ` let devToolsScript = document.head.querySelector("script[data-builder-dev-tools]");
2839
+ `;
2840
+ c2 += ` if (!devToolsScript) {
2841
+ `;
2842
+ c2 += ` devToolsScript = document.createElement("script");
2843
+ `;
2844
+ c2 += ` devToolsScript.setAttribute("src", ${JSON.stringify(
2845
+ url
2846
+ )});
2847
+ `;
2848
+ c2 += ` devToolsScript.setAttribute("data-builder-dev-tools", "");
2849
+ `;
2850
+ c2 += ` devToolsScript.setAttribute("async", "");
2851
+ `;
2852
+ c2 += ` document.head.appendChild(devToolsScript);
2853
+ `;
2854
+ c2 += ` }
2855
+ `;
2856
+ c2 += ` }
2857
+ `;
2858
+ c2 += `})();
2859
+ `;
2860
+ const data = {
2861
+ chunk,
2862
+ filename: file
2863
+ };
2864
+ const inject = compilation.getPath(c2, data);
2865
+ compilation.updateAsset(file, (old) => {
2866
+ const cached = cache.get(old);
2867
+ if (!cached || cached.inject !== inject) {
2868
+ const source = new import_webpack_sources.ConcatSource(old, inject);
2869
+ cache.set(old, { source, inject });
2870
+ return source;
2871
+ }
2872
+ return cached.source;
2873
+ });
2874
+ }
2875
+ }
2876
+ callback();
2877
+ }
2878
+ );
2879
+ });
2880
+ }
2881
+ };
2882
+ // Annotate the CommonJS export names for ESM import in node:
2883
+ 0 && (module.exports = {
2884
+ BuilderDevToolsPlugin
2885
+ });