Initial code test
This commit is contained in:
commit
d4fae15f5c
1696 files changed
+271223
No files matched your search
+14
@@ -0,0 +1,14 @@
|
||||
"use strict";var Yt=Object.defineProperty;var l=(s,e)=>Yt(s,"name",{value:e,configurable:!0});var q=require("node:path"),Fe=require("node:url"),J=require("esbuild"),Qt=require("node:crypto"),Pe=require("./node-features-CEjg7cMX.cjs"),$=require("node:fs"),Zt=require("node:os"),Vt=require("./temporary-directory-B83uKxJF.cjs");const ve=l(s=>Qt.createHash("sha1").update(s).digest("hex"),"sha1");let E,ae,xe,Q=2<<19;const Be=new Uint8Array(new Uint16Array([1]).buffer)[0]===1?function(s,e){const n=s.length;let i=0;for(;i<n;)e[i]=s.charCodeAt(i++)}:function(s,e){const n=s.length;let i=0;for(;i<n;){const o=s.charCodeAt(i);e[i++]=(255&o)<<8|o>>>8}},en="xportmportlassforetaourceromsyncunctionssertvoyiedelecontininstantybreareturdebuggeawaithrwhileifcatcfinallels";let I,We,C;function tn(s,e="@"){I=s,We=e;const n=2*I.length+(2<<18);if(n>Q||!E){for(;n>Q;)Q*=2;ae=new ArrayBuffer(Q),Be(en,new Uint16Array(ae,16,110)),E=function(u,p,g){var b=new u.Int8Array(g),d=new u.Int16Array(g),r=new u.Int32Array(g),S=new u.Uint8Array(g),O=new u.Uint16Array(g),_=1040;function N(){var t=0,c=0,h=0,f=0,m=0,w=0,y=0;y=_,_=_+10240|0,b[804]=1,b[803]=0,d[399]=0,d[400]=0,r[69]=r[2],b[805]=0,r[68]=0,b[802]=0,r[70]=y+2048,r[71]=y,b[806]=0,t=(r[3]|0)+-2|0,r[72]=t,c=t+(r[66]<<1)|0,r[73]=c;e:for(;;){if(h=t+2|0,r[72]=h,t>>>0>=c>>>0){f=18;break}t:do switch(d[h>>1]|0){case 9:case 10:case 11:case 12:case 13:case 32:break;case 101:{if(!(d[400]|0)&&X(h)|0&&!(A(t+4|0,16,10)|0)&&(D(),(b[804]|0)==0)){f=9;break e}else f=17;break}case 105:{X(h)|0&&!(A(t+4|0,26,10)|0)&&P(),f=17;break}case 59:{f=17;break}case 47:switch(d[t+4>>1]|0){case 47:{me();break t}case 42:{be(1);break t}default:{f=16;break e}}default:{f=16;break e}}while(!1);(f|0)==17&&(f=0,r[69]=r[72]),t=r[72]|0,c=r[73]|0}(f|0)==9?(t=r[72]|0,r[69]=t,f=19):(f|0)==16?(b[804]=0,r[72]=t,f=19):(f|0)==18&&(b[802]|0?t=0:(t=h,f=19));do if((f|0)==19){e:for(;;){if(c=t+2|0,r[72]=c,t>>>0>=(r[73]|0)>>>0){f=92;break}t:do switch(d[c>>1]|0){case 9:case 10:case 11:case 12:case 13:case 32:break;case 101:{!(d[400]|0)&&X(c)|0&&!(A(t+4|0,16,10)|0)&&D(),f=91;break}case 105:{X(c)|0&&!(A(t+4|0,26,10)|0)&&P(),f=91;break}case 99:{X(c)|0&&!(A(t+4|0,36,8)|0)&&W(d[t+12>>1]|0)|0&&(b[806]=1),f=91;break}case 40:{h=r[70]|0,t=d[400]|0,f=t&65535,r[h+(f<<3)>>2]=1,c=r[69]|0,d[400]=t+1<<16>>16,r[h+(f<<3)+4>>2]=c,f=91;break}case 41:{if(c=d[400]|0,!(c<<16>>16)){f=36;break e}h=c+-1<<16>>16,d[400]=h,f=d[399]|0,c=f&65535,f<<16>>16&&(r[(r[70]|0)+((h&65535)<<3)>>2]|0)==5&&(c=r[(r[71]|0)+(c+-1<<2)>>2]|0,h=c+4|0,r[h>>2]|0||(r[h>>2]=(r[69]|0)+2),r[c+12>>2]=t+4,d[399]=f+-1<<16>>16),f=91;break}case 123:{f=r[69]|0,h=r[63]|0,t=f;do if((d[f>>1]|0)==41&(h|0)!=0&&(r[h+4>>2]|0)==(f|0))if(c=r[64]|0,r[63]=c,c){r[c+32>>2]=0;break}else{r[59]=0;break}while(!1);h=r[70]|0,c=d[400]|0,f=c&65535,r[h+(f<<3)>>2]=b[806]|0?6:2,d[400]=c+1<<16>>16,r[h+(f<<3)+4>>2]=t,b[806]=0,f=91;break}case 125:{if(t=d[400]|0,!(t<<16>>16)){f=49;break e}h=r[70]|0,f=t+-1<<16>>16,d[400]=f,(r[h+((f&65535)<<3)>>2]|0)==4&&$e(),f=91;break}case 39:{R(39),f=91;break}case 34:{R(34),f=91;break}case 47:switch(d[t+4>>1]|0){case 47:{me();break t}case 42:{be(1);break t}default:{t=r[69]|0,c=d[t>>1]|0;n:do if(!(It(c)|0))c<<16>>16==41?(h=d[400]|0,Nt(r[(r[70]|0)+((h&65535)<<3)+4>>2]|0)|0||(f=65)):f=64;else switch(c<<16>>16){case 46:if(((d[t+-2>>1]|0)+-48&65535)<10){f=64;break n}else break n;case 43:if((d[t+-2>>1]|0)==43){f=64;break n}else break n;case 45:if((d[t+-2>>1]|0)==45){f=64;break n}else break n;default:break n}while(!1);(f|0)==64&&(h=d[400]|0,f=65);n:do if((f|0)==65){if(f=0,h<<16>>16&&(m=r[70]|0,w=(h&65535)+-1|0,c<<16>>16==102?(r[m+(w<<3)>>2]|0)==1:0)){if((d[t+-2>>1]|0)==111&&L(r[m+(w<<3)+4>>2]|0,44,3)|0)break}else f=69;if((f|0)==69&&c<<16>>16==125&&(f=r[70]|0,h=h&65535,_t(r[f+(h<<3)+4>>2]|0)|0||(r[f+(h<<3)>>2]|0)==6))break;if(!(xt(t)|0)){switch(c<<16>>16){case 0:break n;case 47:{if(b[805]|0)break n;break}default:}if(f=r[65]|0,f|0&&t>>>0>=(r[f>>2]|0)>>>0&&t>>>0<=(r[f+4>>2]|0)>>>0){ge(),b[805]=0,f=91;break t}h=r[3]|0;do{if(t>>>0<=h>>>0)break;t=t+-2|0,r[69]=t,c=d[t>>1]|0}while(!(pe(c)|0));if(oe(c)|0){do{if(t>>>0<=h>>>0)break;t=t+-2|0,r[69]=t}while(oe(d[t>>1]|0)|0);if(Ot(t)|0){ge(),b[805]=0,f=91;break t}}b[805]=1,f=91;break t}}while(!1);ge(),b[805]=0,f=91;break t}}case 96:{h=r[70]|0,c=d[400]|0,f=c&65535,r[h+(f<<3)+4>>2]=r[69],d[400]=c+1<<16>>16,r[h+(f<<3)>>2]=3,$e(),f=91;break}default:f=91}while(!1);(f|0)==91&&(f=0,r[69]=r[72]),t=r[72]|0}if((f|0)==36){M(),t=0;break}else if((f|0)==49){M(),t=0;break}else if((f|0)==92){t=b[802]|0?0:(d[399]|d[400])<<16>>16==0;break}}while(!1);return _=y,t|0}l(N,"b");function D(){var t=0,c=0,h=0,f=0,m=0,w=0,y=0,T=0,ke=0,Ce=0,ye=0,Se=0,v=0,x=0;T=r[72]|0,ke=r[65]|0,x=T+12|0,r[72]=x,h=k(1)|0,t=r[72]|0,(t|0)==(x|0)&&!(se(h)|0)||(v=3);e:do if((v|0)==3){t:do switch(h<<16>>16){case 123:{for(r[72]=t+2,t=k(1)|0,c=r[72]|0;;){if(Y(t)|0?(R(t),t=(r[72]|0)+2|0,r[72]=t):(j(t)|0,t=r[72]|0),k(1)|0,t=je(c,t)|0,t<<16>>16==44&&(r[72]=(r[72]|0)+2,t=k(1)|0),t<<16>>16==125){v=15;break}if(x=c,c=r[72]|0Line truncated
|
||||
`;case 114:return"\r";case 120:return String.fromCharCode(_e(2));case 117:return function(){const e=I.charCodeAt(C);let n;return e===123?(++C,n=_e(I.indexOf("}",C)-C),++C,n>1114111&&U()):n=_e(4),n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode(55296+(n>>10),56320+(1023&n)))}();case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:I.charCodeAt(C)===10&&++C;case 10:return"";case 56:case 57:U();default:if(s>=48&&s<=55){let e=I.substr(C-1,3).match(/^[0-7]+/)[0],n=parseInt(e,8);return n>255&&(e=e.slice(0,-1),n=parseInt(e,8)),C+=e.length-1,s=I.charCodeAt(C),e==="0"&&s!==56&&s!==57||U(),String.fromCharCode(n)}return qe(s)?"":String.fromCharCode(s)}}l(nn,"k");function _e(s){const e=C;let n=0,i=0;for(let o=0;o<s;++o,++C){let a,u=I.charCodeAt(C);if(u!==95){if(u>=97)a=u-97+10;else if(u>=65)a=u-65+10;else{if(!(u>=48&&u<=57))break;a=u-48}if(a>=16)break;i=u,n=16*n+a}else i!==95&&o!==0||U(),i=u}return i!==95&&C-e===s||U(),n}l(_e,"l");function qe(s){return s===13||s===10}l(qe,"u");function U(){throw Object.assign(Error(`Parse error ${We}:${I.slice(0,C).split(`
|
||||
`).length}:${C-I.lastIndexOf(`
|
||||
`,C-1)}`),{idx:C})}l(U,"o");let Ie;typeof WebAssembly<"u"&&(async()=>{const{parse:s,init:e}=await Promise.resolve().then(function(){return require("./lexer-DgIbo0BU.cjs")});await e,Ie=s})();const ce=l((s,e)=>Ie?Ie(s,e):tn(s,e),"parseEsm"),rn=l(s=>{if(!s.includes("import")&&!s.includes("export"))return!1;try{return ce(s)[3]}catch{return!0}},"isESM");var sn=44,on=59,Je="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ze=new Uint8Array(64),an=new Uint8Array(128);for(let s=0;s<Je.length;s++){const e=Je.charCodeAt(s);ze[s]=e,an[e]=s}function Z(s,e,n){let i=e-n;i=i<0?-i<<1|1:i<<1;do{let o=i&31;i>>>=5,i>0&&(o|=32),s.write(ze[o])}while(i>0);return e}l(Z,"encodeInteger$1");var He=1024*16,Ge=typeof TextDecoder<"u"?new TextDecoder:typeof Buffer<"u"?{decode(s){return Buffer.from(s.buffer,s.byteOffset,s.byteLength).toString()}}:{decode(s){let e="";for(let n=0;n<s.length;n++)e+=String.fromCharCode(s[n]);return e}},cn=class{static{l(this,"StringWriter")}constructor(){this.pos=0,this.out="",this.buffer=new Uint8Array(He)}write(s){const{buffer:e}=this;e[this.pos++]=s,this.pos===He&&(this.out+=Ge.decode(e),this.pos=0)}flush(){const{buffer:s,out:e,pos:n}=this;return n>0?e+Ge.decode(s.subarray(0,n)):e}};function un(s){const e=new cn;let n=0,i=0,o=0,a=0;for(let u=0;u<s.length;u++){const p=s[u];if(u>0&&e.write(on),p.length===0)continue;let g=0;for(let b=0;b<p.length;b++){const d=p[b];b>0&&e.write(sn),g=Z(e,d[0],g),d.length!==1&&(n=Z(e,d[1],n),i=Z(e,d[2],i),o=Z(e,d[3],o),d.length!==4&&(a=Z(e,d[4],a)))}}return e.flush()}l(un,"encode$1");class he{static{l(this,"BitSet")}constructor(e){this.bits=e instanceof he?e.bits.slice():[]}add(e){this.bits[e>>5]|=1<<(e&31)}has(e){return!!(this.bits[e>>5]&1<<(e&31))}}class ie{static{l(this,"Chunk")}constructor(e,n,i){this.start=e,this.end=n,this.original=i,this.intro="",this.outro="",this.content=i,this.storeName=!1,this.edited=!1,this.previous=null,this.next=null}appendLeft(e){this.outro+=e}appendRight(e){this.intro=this.intro+e}clone(){const e=new ie(this.start,this.end,this.original);return e.intro=this.intro,e.outro=this.outro,e.content=this.content,e.storeName=this.storeName,e.edited=this.edited,e}contains(e){return this.start<e&&e<this.end}eachNext(e){let n=this;for(;n;)e(n),n=n.next}eachPrevious(e){let n=this;for(;n;)e(n),n=n.previous}edit(e,n,i){return this.content=e,i||(this.intro="",this.outro=""),this.storeName=n,this.edited=!0,this}prependLeft(e){this.outro=e+this.outro}prependRight(e){this.intro=e+this.intro}reset(){this.intro="",this.outro="",this.edited&&(this.content=this.original,this.storeName=!1,this.edited=!1)}split(e){const n=e-this.start,i=this.original.slice(0,n),o=this.original.slice(n);this.original=i;const a=new ie(e,this.end,o);return a.outro=this.outro,this.outro="",this.end=e,this.edited?(a.edit("",!1),this.content=""):this.content=i,a.next=this.next,a.next&&(a.next.previous=a),a.previous=this,this.next=a,a}toString(){return this.intro+this.content+this.outro}trimEnd(e){if(this.outro=this.outro.replace(e,""),this.outro.length)return!0;const n=this.content.replace(e,"");if(n.length)return n!==this.content&&(this.split(this.start+n.length).edit("",void 0,!0),this.edited&&this.edit(n,this.storeName,!0)),!0;if(this.edit("",void 0,!0),this.intro=this.intro.replace(e,""),this.intro.length)return!0}trimStart(e){if(this.intro=this.intro.replace(e,""),this.intro.length)return!0;const n=this.content.replace(e,"");if(n.length){if(n!==this.content){const i=this.split(this.end-n.length);this.edited&&i.edit(n,this.storeName,!0),this.edit("",void 0,!0)}return!0}else if(this.edit("",void 0,!0),this.outro=this.outro.replace(e,""),this.outro.length)return!0}}function ln(){return typeof globalThis<"u"&&typeof globalThis.btoa=="function"?s=>globalThis.btoa(unescape(encodeURIComponent(s))):typeof Buffer=="function"?s=>Buffer.from(s,"utf-8").toString("base64"):()=>{throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.")}}l(ln,"getBtoa");const fn=ln();let hn=class{static{l(this,"SourceMap")}constructor(e){this.version=3,this.file=e.file,this.sources=e.sources,this.sourcesContent=e.sourcesContent,this.names=e.names,this.mappings=un(e.mappings),typeof e.x_google_ignoreList<"u"&&(this.x_google_ignoreList=e.x_google_ignoreList),typeof e.debugId<"u"&&(this.debugId=e.debugId)}toString(){return JSON.stringify(this)}toUrl(){return"data:application/json;charset=utf-8;base64,"+fn(this.toString())}};function dn(s){const e=s.split(`
|
||||
`),n=e.filter(a=>/^\t+/.test(a)),i=e.filter(a=>/^ {2,}/.test(a));if(n.length===0&&i.length===0)return null;if(n.length>=i.length)return" ";const o=i.reduce((a,u)=>{const p=/^ +/.exec(u)[0].length;return Math.min(p,a)},1/0);return new Array(o+1).join(" ")}l(dn,"guessIndent");function gn(s,e){const n=s.split(/[/\\]/),i=e.split(/[/\\]/);for(n.pop();n[0]===i[0];)n.shift(),i.shift();if(n.length){let o=n.length;for(;o--;)n[o]=".."}return n.concat(i).join("/")}l(gn,"getRelativePath");const bn=Object.prototype.toString;function pn(s){return bn.call(s)==="[object Object]"}l(pn,"isObject");function Ke(s){const e=s.split(`
|
||||
`),n=[];for(let i=0,o=0;i<e.length;i++)n.push(o),o+=e[i].length+1;return l(function(o){let a=0,u=n.length;for(;a<u;){const b=a+u>>1;o<n[b]?u=b:a=b+1}const p=a-1,g=o-n[p];return{line:p,column:g}},"locate")}l(Ke,"getLocator");const mn=/\w/;class wn{static{l(this,"Mappings")}constructor(e){this.hires=e,this.generatedCodeLine=0,this.generatedCodeColumn=0,this.raw=[],this.rawSegments=this.raw[this.generatedCodeLine]=[],this.pending=null}addEdit(e,n,i,o){if(n.length){const a=n.length-1;let u=n.indexOf(`
|
||||
`,0),p=-1;for(;u>=0&&a>u;){const b=[this.generatedCodeColumn,e,i.line,i.column];o>=0&&b.push(o),this.rawSegments.push(b),this.generatedCodeLine+=1,this.raw[this.generatedCodeLine]=this.rawSegments=[],this.generatedCodeColumn=0,p=u,u=n.indexOf(`
|
||||
`,u+1)}const g=[this.generatedCodeColumn,e,i.line,i.column];o>=0&&g.push(o),this.rawSegments.push(g),this.advance(n.slice(p+1))}else this.pending&&(this.rawSegments.push(this.pending),this.advance(n));this.pending=null}addUneditedChunk(e,n,i,o,a){let u=n.start,p=!0,g=!1;for(;u<n.end;){if(i[u]===`
|
||||
`)o.line+=1,o.column=0,this.generatedCodeLine+=1,this.raw[this.generatedCodeLine]=this.rawSegments=[],this.generatedCodeColumn=0,p=!0,g=!1;else{if(this.hires||p||a.has(u)){const b=[this.generatedCodeColumn,e,o.line,o.column];this.hires==="boundary"?mn.test(i[u])?g||(this.rawSegments.push(b),g=!0):(this.rawSegments.push(b),g=!1):this.rawSegments.push(b)}o.column+=1,this.generatedCodeColumn+=1,p=!1}u+=1}this.pending=null}advance(e){if(!e)return;const n=e.split(`
|
||||
`);if(n.length>1){for(let i=0;i<n.length-1;i++)this.generatedCodeLine++,this.raw[this.generatedCodeLine]=this.rawSegments=[];this.generatedCodeColumn=0}this.generatedCodeColumn+=n[n.length-1].length}}const V=`
|
||||
`,z={insertLeft:!1,insertRight:!1,storeName:!1};class De{static{l(this,"MagicString")}constructor(e,n={}){const i=new ie(0,e.length,e);Object.defineProperties(this,{original:{writable:!0,value:e},outro:{writable:!0,value:""},intro:{writable:!0,value:""},firstChunk:{writable:!0,value:i},lastChunk:{writable:!0,value:i},lastSearchedChunk:{writable:!0,value:i},byStart:{writable:!0,value:{}},byEnd:{writable:!0,value:{}},filename:{writable:!0,value:n.filename},indentExclusionRanges:{writable:!0,value:n.indentExclusionRanges},sourcemapLocations:{writable:!0,value:new he},storedNames:{writable:!0,value:{}},indentStr:{writable:!0,value:void 0},ignoreList:{writable:!0,value:n.ignoreList},offset:{writable:!0,value:n.offset||0}}),this.byStart[0]=i,this.byEnd[e.length]=i}addSourcemapLocation(e){this.sourcemapLocations.add(e)}append(e){if(typeof e!="string")throw new TypeError("outro content must be a string");return this.outro+=e,this}appendLeft(e,n){if(e=e+this.offset,typeof n!="string")throw new TypeError("inserted content must be a string");this._split(e);const i=this.byEnd[e];return i?i.appendLeft(n):this.intro+=n,this}appendRight(e,n){if(e=e+this.offset,typeof n!="string")throw new TypeError("inserted content must be a string");this._split(e);const i=this.byStart[e];return i?i.appendRight(n):this.outro+=n,this}clone(){const e=new De(this.original,{filename:this.filename,offset:this.offset});let n=this.firstChunk,i=e.firstChunk=e.lastSearchedChunk=n.clone();for(;n;){e.byStart[i.start]=i,e.byEnd[i.end]=i;const o=n.next,a=o&&o.clone();a&&(i.next=a,a.previous=i,i=a),n=o}return e.lastChunk=i,this.indentExclusionRanges&&(e.indentExclusionRanges=this.indentExclusionRanges.slice()),e.sourcemapLocations=new he(this.sourcemapLocations),e.intro=this.intro,e.outro=this.outro,e}generateDecodedMap(e){e=e||{};const n=0,i=Object.keys(this.storedNames),o=new wn(e.hires),a=Ke(this.original);return this.intro&&o.advance(this.intro),this.firstChunk.eachNext(u=>{const p=a(u.start);u.intro.length&&o.advance(u.intro),u.edited?o.addEdit(n,u.content,p,u.storeName?i.indexOf(u.original):-1):o.addUneditedChunk(n,u,this.original,p,this.sourcemapLocations),u.outro.length&&o.advance(u.outro)}),{file:e.file?e.file.split(/[/\\]/).pop():void 0,sources:[e.source?gn(e.file||"",e.source):e.file||""],sourcesContent:e.includeContent?[this.original]:void 0,names:i,mappings:o.raw,x_google_ignoreList:this.ignoreList?[n]:void 0}}generateMap(e){return new hn(this.generateDecodedMap(e))}_ensureindentStr(){this.indentStr===void 0&&(this.indentStr=dn(this.original))}_getRawIndentString(){return this._ensureindentStr(),this.indentStr}getIndentString(){return this._ensureindentStr(),this.indentStr===null?" ":this.indentStr}indent(e,n){const i=/^[^\r\n]/gm;if(pn(e)&&(n=e,e=void 0),e===void 0&&(this._ensureindentStr(),e=this.indentStr||" "),e==="")return this;n=n||{};const o={};n.exclude&&(typeof n.exclude[0]=="number"?[n.exclude]:n.exclude).forEach(d=>{for(let r=d[0];r<d[1];r+=1)o[r]=!0});let a=n.indentStart!==!1;const u=l(b=>a?`${e}${b}`:(a=!0,b),"replacer");this.intro=this.intro.replace(i,u);let p=0,g=this.firstChunk;for(;g;){const b=g.end;if(g.edited)o[p]||(g.content=g.content.replace(i,u),g.content.length&&(a=g.content[g.content.length-1]===`
|
||||
`));else for(p=g.start;p<b;){if(!o[p]){const d=this.original[p];d===`
|
||||
`?a=!0:d!=="\r"&&a&&(a=!1,p===g.start||(this._splitChunk(g,p),g=g.next),g.prependRight(e))}p+=1}p=g.end,g=g.next}return this.outro=this.outro.replace(i,u),this}insert(){throw new Error("magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)")}insertLeft(e,n){return z.insertLeft||(console.warn("magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead"),z.insertLeft=!0),this.appendLeft(e,n)}insertRight(e,n){return z.insertRight||(console.warn("magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead"),z.insertRight=!0),this.prependRight(e,n)}move(e,n,i){if(e=e+this.offset,n=n+this.offset,i=i+this.offset,i>=e&&i<=n)throw new Error("Cannot move a selection inside itself");this._split(e),this._split(n),this._split(i);const o=this.byStart[e],a=this.byEnd[n],u=o.previous,p=a.next,g=this.byStart[i];if(!g&&a===this.lastChunk)return this;const b=g?g.previous:this.lastChunk;return u&&(u.next=p),p&&(p.previous=u),b&&(b.next=o),g&&(g.previous=a),o.previous||(this.firstChunk=a.next),a.next||(this.lastChunk=o.previous,this.lastChunk.next=null),o.previous=b,a.next=g||null,b||(this.firstChunk=o),g||(this.lastChunk=a),this}overwrite(e,n,i,o){return o=o||{},this.update(e,n,i,{...o,overwrite:!o.contentOnly})}update(e,n,i,o){if(e=e+this.offset,n=n+this.offset,typeof i!="string")throw new TypeError("replacement content must be a string");if(this.original.length!==0){for(;e<0;)e+=this.original.length;for(;n<0;)n+=this.original.length}if(n>this.original.length)throw new Error("end is out of bounds");if(e===n)throw new Error("Cannot overwrite a zero-length range \u2013 use appendLeft or prependRight instead");this._split(e),this._split(n),o===!0&&(z.storeName||(console.warn("The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string"),z.storeName=!0),o={storeName:!0});const a=o!==void 0?o.storeName:!1,u=o!==void 0?o.overwrite:!1;if(a){const b=this.original.slice(e,n);Object.defineProperty(this.storedNames,b,{writable:!0,value:!0,enumerable:!0})}const p=this.byStart[e],g=this.byEnd[n];if(p){let b=p;for(;b!==g;){if(b.next!==this.byStart[b.end])throw new Error("Cannot overwrite across a split point");b=b.next,b.edit("",!1)}p.edit(i,a,!u)}else{const b=new ie(e,n,"").edit(i,a);g.next=b,b.previous=g}return this}prepend(e){if(typeof e!="string")throw new TypeError("outro content must be a string");return this.intro=e+this.intro,this}prependLeft(e,n){if(e=e+this.offset,typeof n!="string")throw new TypeError("inserted content must be a string");this._split(e);const i=this.byEnd[e];return i?i.prependLeft(n):this.intro=n+this.intro,this}prependRight(e,n){if(e=e+this.offset,typeof n!="string")throw new TypeError("inserted content must be a string");this._split(e);const i=this.byStart[e];return i?i.prependRight(n):this.outro=n+this.outro,this}remove(e,n){if(e=e+this.offset,n=n+this.offset,this.original.length!==0){for(;e<0;)e+=this.original.length;for(;n<0;)n+=this.original.length}if(e===n)return this;if(e<0||n>this.original.length)throw new Error("Character is out of bounds");if(e>n)throw new Error("end must be greater than start");this._split(e),this._split(n);let i=this.byStart[e];for(;i;)i.intro="",i.outro="",i.edit(""),i=n>i.end?this.byStart[i.end]:null;return this}reset(e,n){if(e=e+this.offset,n=n+this.offset,this.original.length!==0){for(;e<0;)e+=this.original.length;for(;n<0;)n+=this.original.length}if(e===n)return this;if(e<0||n>this.original.length)throw new Error("Character is out of bounds");if(e>n)throw new Error("end must be greater than start");this._split(e),this._split(n);let i=this.byStart[e];for(;i;)i.reset(),i=n>i.end?this.byStart[i.end]:null;return this}lastChar(){if(this.outro.length)return this.outro[this.outro.length-1];let e=this.lastChunk;do{if(e.outro.length)return e.outro[e.outro.length-1];if(e.content.length)return e.content[e.content.length-1];if(e.intro.length)return e.intro[e.intro.length-1]}while(e=e.previous);return this.intro.length?this.intro[this.intro.length-1]:""}lastLine(){let e=this.outro.lastIndexOf(V);if(e!==-1)return this.outro.substr(e+1);let n=this.outro,i=this.lastChunk;do{if(i.outro.length>0){if(e=i.outro.lastIndexOf(V),e!==-1)return i.outro.substr(e+1)+n;n=i.outro+n}if(i.content.length>0){if(e=i.content.lastIndexOf(V),e!==-1)return i.content.substr(e+1)+n;n=i.content+n}if(i.intro.length>0){if(e=i.intro.lastIndexOf(V),e!==-1)return i.intro.substr(e+1)+n;n=i.intro+n}}while(i=i.previous);return e=this.intro.lastIndexOf(V),e!==-1?this.intro.substr(e+1)+n:this.intro+n}slice(e=0,n=this.original.length-this.offset){if(e=e+this.offset,n=n+this.offset,this.original.length!==0){for(;e<0;)e+=this.original.length;for(;n<0;)n+=this.original.length}let i="",o=this.firstChunk;for(;o&&(o.start>e||o.end<=e);){if(o.start<n&&o.end>=n)return i;o=o.next}if(o&&o.edited&&o.start!==e)throw new Error(`Cannot use replaced character ${e} as slice start anchor.`);const a=o;for(;
Line truncated
|
||||
Did you specify these with the most recent transformation maps first?`);let o=Ct(i,e,"",0);for(let a=n.length-1;a>=0;a--)o=wt(n[a],[o]);return o}l(mr,"buildSourceMapTree");function Ct(s,e,n,i){const{resolvedSources:o,sourcesContent:a,ignoreList:u}=s,p=i+1,g=o.map((b,d)=>{const r={importer:n,depth:p,source:b||"",content:void 0,ignore:void 0},S=e(r.source,r),{source:O,content:_,ignore:N}=r;if(S)return Ct(new ut(S,O),e,O,p);const D=_!==void 0?_:a?a[d]:null,P=N!==void 0?N:u?u.includes(d):!1;return gr(O,D,P)});return wt(s,g)}l(Ct,"build");class wr{static{l(this,"SourceMap")}constructor(e,n){const i=n.decodedMappings?dt(e):or(e);this.version=i.version,this.file=i.file,this.mappings=i.mappings,this.names=i.names,this.ignoreList=i.ignoreList,this.sourceRoot=i.sourceRoot,this.sources=i.sources,n.excludeContent||(this.sourcesContent=i.sourcesContent)}toString(){return JSON.stringify(this)}}function yt(s,e,n){const i={excludeContent:!!n,decodedMappings:!1},o=mr(s,e);return new wr(br(o),i)}l(yt,"remapping");const St=l((s,e,n)=>{const i=[],o={code:e};for(const a of n){const u=a(s,o.code);u&&(Object.assign(o,u),i.unshift(u.map))}return{...o,map:yt(i,()=>null)}},"applyTransformersSync"),kr=l(async(s,e,n)=>{const i=[],o={code:e};for(const a of n){const u=await a(s,o.code);u&&(Object.assign(o,u),i.unshift(u.map))}return{...o,map:yt(i,()=>null)}},"applyTransformers"),Cr=l(s=>{const e=[];let n=!1,i=!0;for(let o=0;o<s.length;o+=1){let a=s[o];if(a==="\\"&&n){if(o+1===s.length)return e;o+=1,a=s[o]}else if(a===" "&&!n){i=!0;continue}else if(a==='"'){n=!n;continue}i?(e.push(a),i=!1):e[e.length-1]+=a}return e},"tokenizeNodeOptionsEnv"),vt=l((s,e,n)=>{for(let i=0;i<e.length;i+=1){const o=e[i];if(o.length<=1||o[0]!=="-")continue;const a=o[1]==="-"?o.indexOf("="):-1;let u=a===-1?o:o.slice(0,a);u.includes("_",2)&&(u=u.slice(0,2)+u.slice(2).replaceAll("_","-"));for(const p of s.forms){const[g,b]=p;if(u!==g||(b===3||b===5)&&a===-1)continue;const d=b===4||b===5,r=b>=3?0:b;let S=d?p[2]:"";r===0&&!d&&(a===-1?(i+=1,S=e[i]??"",S[0]==="\\"&&S[1]==="-"&&(S=S.slice(1))):S=o.slice(a+1)),n=s.fold(S,n,r);break}}return n},"scanSource"),yr=l(s=>{let e=s.init();const n=process.env.NODE_OPTIONS;return n&&(e=vt(s,Cr(n),e)),e=vt(s,process.execArgv,e),e},"getOptionValue"),Sr=l((s,e,n)=>n===1,"setByEffect"),vr=l((s,e)=>({forms:e,init:l(()=>s,"init"),fold:Sr}),"booleanFlag"),xr=vr(!1,[["--inspect-brk-node",1],["--inspect-brk",1],["--inspect-wait",1],["--inspect",1],["--no-inspect",2]]),Er=Object.freeze({target:`node${process.versions.node}`,loader:"default"}),_r=yr(xr),Ne={...Er,sourcemap:!0,sourcesContent:!!process.env.NODE_V8_COVERAGE||_r,minifyWhitespace:!0,keepNames:!0},Re=l(s=>{const e=s.sourcefile;if(e){const n=q.extname(e.split("?")[0]);n?n===".cts"||n===".mts"?s.sourcefile=`${e.slice(0,-3)}ts`:n===".mjs"&&(s.sourcefile=`${e.slice(0,-3)}js`):s.sourcefile+=".js"}return n=>(n.map&&(s.sourcefile!==e&&(n.map=n.map.replace(JSON.stringify(s.sourcefile),JSON.stringify(e))),n.map=JSON.parse(n.map)),n)},"patchOptions"),Me=l(s=>{throw s.name="TransformError",delete s.errors,delete s.warnings,s},"formatEsbuildError"),Ir=l((s,e)=>({...Pe.isFeatureSupported(Pe.importMetaPathProperties)?{dirname:q.dirname(s),filename:s}:{},url:e}),"getImportMeta"),Lr=l((s,e)=>{if(!s.includes("import"))return!1;try{return ce(s,e)[0].some(n=>n.d===-2)}catch{return!0}},"hasImportMeta"),Or=l((s,e,n)=>{let i,o,a;if(e.startsWith("file://")){i=e;const r=new URL(e);o=Fe.fileURLToPath(r)}else[o,a]=e.split("?"),i=Fe.pathToFileURL(o)+(a?`?${a}`:"");const{cjsBanner:u,...p}=n??{},g={...Ne,format:"cjs",sourcefile:o,banner:`__filename=${JSON.stringify(o)};(()=>{${u??""}`,footer:"})()",platform:"node",...p};g.format==="cjs"&&!o.endsWith(".cjs")&&!o.endsWith(".cts")&&Lr(s,o)&&(g.define={...g.define,"import.meta":JSON.stringify(Ir(o,i))});const b=ve([s,i,JSON.stringify(g),J.version,Le].join("-"));let d=H.get(b);return d||(d=St(e,s,[(r,S)=>{const O=Re(g);let _;try{_=J.transformSync(S,g)}catch(N){throw Me(N)}return O(_)},(r,S)=>ue(r,S,!0)]),H.set(b,d)),d},"transformSync"),Ar=l(async(s,e,n)=>{const i={...Ne,format:"esm",sourcefile:e,...n},o=ve([s,JSON.stringify(i),J.version,Le].join("-"));let a=H.get(o);return a||(a=await kr(e,s,[async(u,p)=>{const g=Re(i);let b;try{b=await J.transform(p,i)}catch(d){throw Me(d)}return g(b)},(u,p)=>ue(u,p,!0)]),H.set(o,a)),a},"transform"),Nr=l((s,e,n)=>{const i={...Ne,format:"esm",sourcefile:e,...n},o=ve([s,JSON.stringify(i),J.version,Le].join("-"));let a=H.get(o);return a||(a=St(e,s,[(u,p)=>{const g=Re(i);let b;try{b=J.transformSync(p,i)}catch(d){throw Me(d)}return g(b)},(u,p)=>ue(u,p,!0)]),H.set(o,a)),a},"transformEsmSync");exports.isESM=rn,exports.parseEsm=ce,exports.readJsonFile=Xe,exports.transform=Ar,exports.transformDynamicImport=ue,exports.transformEsmSync=Nr,exports.transformSync=Or;
|
||||
Reference in new issue
Block a user