{"version":3,"sources":["../../src/trace/trace-uploader.ts"],"names":["EVENT_FILTER","Set","NEXT_TRACE_UPLOAD_DEBUG","NEXT_TRACE_UPLOAD_FULL","process","env","isDebugEnabled","shouldUploadFullTrace","traceUploadUrl","mode","_isTurboSession","projectDir","distDir","argv","isTurboSession","upload","nextVersion","JSON","parse","fsPromise","readFile","path","resolve","__dirname","version","telemetry","Telemetry","projectPkgJsonPath","findUp","assert","projectPkgJson","pkgName","name","commit","child_process","spawnSync","os","platform","shell","stdout","toString","trimEnd","readLineInterface","createInterface","input","createReadStream","join","crlfDelay","Infinity","traces","Map","line","lineEvents","event","parentId","undefined","has","tags","trigger","isAbsolute","relative","replaceAll","sep","trace","get","traceId","set","push","body","metadata","anonymousId","arch","cpus","length","sessionId","values","console","log","stringify","res","fetch","method","headers","status","json"],"mappings":";;;;+DAAmB;iEACG;sEACI;+DACP;kEACD;2DACH;0BACiB;oBACC;6DAChB;yBACS;;;;;;AAE1B,iEAAiE;AACjE,yEAAyE;AACzE,yCAAyC;AACzC,MAAMA,eAAe,IAAIC,IAAI;IAC3B;IACA;IACA;IACA;IACA;CACD;AAED,MAAM,EACJC,uBAAuB,EACvB,uFAAuF;AACvF,sGAAsG;AACtG,mFAAmF;AACnFC,sBAAsB,EACvB,GAAGC,QAAQC,GAAG;AAEf,MAAMC,iBAAiB,CAAC,CAACJ,2BAA2B,CAAC,CAACC;AACtD,MAAMI,wBAAwB,CAAC,CAACJ;AAEhC,MAAM,KAAKK,gBAAgBC,MAAMC,iBAAiBC,YAAYC,QAAQ,GACpER,QAAQS,IAAI;AACd,MAAMC,iBAAiBJ,oBAAoB;AA+BzC,CAAA,eAAeK;IACf,MAAMC,cAAcC,KAAKC,KAAK,CAC5B,MAAMC,iBAAS,CAACC,QAAQ,CACtBC,aAAI,CAACC,OAAO,CAACC,WAAW,uBACxB,SAEFC,OAAO;IAET,MAAMC,YAAY,IAAIC,kBAAS,CAAC;QAAEd;IAAQ;IAE1C,MAAMe,qBAAqB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