"use strict";var e,r,t,n,i,o,l=require("node:path"),a=require("node:process"),u=require("picocolors"),s=require("os"),c=require("tty"),f=require("ci-info"),p=require("node:url"),d=require("node:os");function h(e){var r=Object.create(null);return e&&Object.keys(e).forEach(function(t){if("default"!==t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}}),r.default=e,Object.freeze(r)}var m=h(s),E=h(c);const y=e=>161===e||164===e||167===e||168===e||170===e||173===e||174===e||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||198===e||208===e||215===e||216===e||e>=222&&e<=225||230===e||e>=232&&e<=234||236===e||237===e||240===e||242===e||243===e||e>=247&&e<=250||252===e||254===e||257===e||273===e||275===e||283===e||294===e||295===e||299===e||e>=305&&e<=307||312===e||e>=319&&e<=322||324===e||e>=328&&e<=331||333===e||338===e||339===e||358===e||359===e||363===e||462===e||464===e||466===e||468===e||470===e||472===e||474===e||476===e||593===e||609===e||708===e||711===e||e>=713&&e<=715||717===e||720===e||e>=728&&e<=731||733===e||735===e||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||1025===e||e>=1040&&e<=1103||1105===e||8208===e||e>=8211&&e<=8214||8216===e||8217===e||8220===e||8221===e||e>=8224&&e<=8226||e>=8228&&e<=8231||8240===e||8242===e||8243===e||8245===e||8251===e||8254===e||8308===e||8319===e||e>=8321&&e<=8324||8364===e||8451===e||8453===e||8457===e||8467===e||8470===e||8481===e||8482===e||8486===e||8491===e||8531===e||8532===e||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||8585===e||e>=8592&&e<=8601||8632===e||8633===e||8658===e||8660===e||8679===e||8704===e||8706===e||8707===e||8711===e||8712===e||8715===e||8719===e||8721===e||8725===e||8730===e||e>=8733&&e<=8736||8739===e||8741===e||e>=8743&&e<=8748||8750===e||e>=8756&&e<=8759||8764===e||8765===e||8776===e||8780===e||8786===e||8800===e||8801===e||e>=8804&&e<=8807||8810===e||8811===e||8814===e||8815===e||8834===e||8835===e||8838===e||8839===e||8853===e||8857===e||8869===e||8895===e||8978===e||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||9632===e||9633===e||e>=9635&&e<=9641||9650===e||9651===e||9654===e||9655===e||9660===e||9661===e||9664===e||9665===e||e>=9670&&e<=9672||9675===e||e>=9678&&e<=9681||e>=9698&&e<=9701||9711===e||9733===e||9734===e||9737===e||9742===e||9743===e||9756===e||9758===e||9792===e||9794===e||9824===e||9825===e||e>=9827&&e<=9829||e>=9831&&e<=9834||9836===e||9837===e||9839===e||9886===e||9887===e||9919===e||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||9955===e||9960===e||9961===e||e>=9963&&e<=9969||9972===e||e>=9974&&e<=9977||9979===e||9980===e||9982===e||9983===e||10045===e||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||65533===e||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||127375===e||127376===e||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109,O=e=>12288===e||e>=65281&&e<=65376||e>=65504&&e<=65510,I=e=>e>=4352&&e<=4447||8986===e||8987===e||9001===e||9002===e||e>=9193&&e<=9196||9200===e||9203===e||9725===e||9726===e||9748===e||9749===e||e>=9800&&e<=9811||9855===e||9875===e||9889===e||9898===e||9899===e||9917===e||9918===e||9924===e||9925===e||9934===e||9940===e||9962===e||9970===e||9971===e||9973===e||9978===e||9981===e||9989===e||9994===e||9995===e||10024===e||10060===e||10062===e||e>=10067&&e<=10069||10071===e||e>=10133&&e<=10135||10160===e||10175===e||11035===e||11036===e||11088===e||11093===e||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||94192===e||94193===e||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101632&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||110589===e||110590===e||e>=110592&&e<=110882||110898===e||e>=110928&&e<=110930||110933===e||e>=110948&&e<=110951||e>=110960&&e<=111355||126980===e||127183===e||127374===e||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||127568===e||127569===e||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||127988===e||e>=127992&&e<=128062||128064===e||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||128378===e||128405===e||128406===e||128420===e||e>=128507&&e<=128591||e>=128640&&e<=128709||128716===e||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||128747===e||128748===e||e>=128756&&e<=128764||e>=128992&&e<=129003||129008===e||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129672||e>=129680&&e<=129725||e>=129727&&e<=129733||e>=129742&&e<=129755||e>=129760&&e<=129768||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141,g=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,x=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,C=/\t{1,1000}/y,b=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,M=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,R=/\p{M}+/gu,v={limit:1/0,ellipsis:""},j=(e,r={},t={})=>{let n=r.limit??1/0,i=r.ellipsis??"",o=r?.ellipsisWidth??(i?j(i,v,t).width:0),l=t.ansiWidth??0,a=t.controlWidth??0,u=t.tabWidth??8,s=t.ambiguousWidth??1,c=t.emojiWidth??2,f=t.fullWidthWidth??2,p=t.regularWidth??1,d=t.wideWidth??2,h=0,m=0,E=e.length,T=0,_=!1,F=E,w=Math.max(0,n-o),A=0,P=0,W=0,k=0;e:for(;;){if(P>A||m>=E&&m>h){for(let r of(T=0,(e.slice(A,P)||e.slice(h,m)).replaceAll(R,""))){let e=r.codePointAt(0)||0;if(W+(k=O(e)?f:I(e)?d:s!==p&&y(e)?s:p)>w&&(F=Math.min(F,Math.max(A,h)+T)),W+k>n){_=!0;break e}T+=r.length,W+=k}A=P=0}if(m>=E)break;if(M.lastIndex=m,M.test(e)){if(W+(k=(T=M.lastIndex-m)*p)>w&&(F=Math.min(F,m+Math.floor((w-W)/p))),W+k>n){_=!0;break}W+=k,A=h,P=m,m=h=M.lastIndex;continue}if(g.lastIndex=m,g.test(e)){if(W+l>w&&(F=Math.min(F,m)),W+l>n){_=!0;break}W+=l,A=h,P=m,m=h=g.lastIndex;continue}if(x.lastIndex=m,x.test(e)){if(W+(k=(T=x.lastIndex-m)*a)>w&&(F=Math.min(F,m+Math.floor((w-W)/a))),W+k>n){_=!0;break}W+=k,A=h,P=m,m=h=x.lastIndex;continue}if(C.lastIndex=m,C.test(e)){if(W+(k=(T=C.lastIndex-m)*u)>w&&(F=Math.min(F,m+Math.floor((w-W)/u))),W+k>n){_=!0;break}W+=k,A=h,P=m,m=h=C.lastIndex;continue}if(b.lastIndex=m,b.test(e)){if(W+c>w&&(F=Math.min(F,m)),W+c>n){_=!0;break}W+=c,A=h,P=m,m=h=b.lastIndex;continue}m+=1}return{width:_?w:W,index:_?F:E,truncated:_,ellipsed:_&&n>=o}},T={limit:1/0,ellipsis:"",ellipsisWidth:0},_=(e,r={})=>j(e,T,r).width;function F(e){if(e.__esModule)return e;var r=e.default;if("function"==typeof r){var t=function e(){return this instanceof e?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};t.prototype=r.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}),t}var w=F(m),A=F(E);function P(){return r?e:(r=1,e=(e,r=process.argv)=>{let t=e.startsWith("-")?"":1===e.length?"-":"--",n=r.indexOf(t+e),i=r.indexOf("--");return -1!==n&&(-1===i||n=2,has16m:e>=3}}function l(t,n){if(0===e)return 0;if(r("color=16m")||r("color=full")||r("color=truecolor"))return 3;if(r("color=256"))return 2;if(t&&!n&&void 0===e)return 0;let o=e||0;if("dumb"===i.TERM)return o;if("win32"===process.platform){let e=w.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in i)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(e=>e in i)||"codeship"===i.CI_NAME?1:o;if("TEAMCITY_VERSION"in i)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(i.TEAMCITY_VERSION);if("truecolor"===i.COLORTERM)return 3;if("TERM_PROGRAM"in i){let e=parseInt((i.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(i.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(i.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(i.TERM)||"COLORTERM"in i?1:o}return r("no-color")||r("no-colors")||r("color=false")||r("color=never")?e=0:(r("color")||r("colors")||r("color=true")||r("color=always"))&&(e=1),"FORCE_COLOR"in i&&(e="true"===i.FORCE_COLOR?1:"false"===i.FORCE_COLOR?0:0===i.FORCE_COLOR.length?1:Math.min(parseInt(i.FORCE_COLOR,10),3)),t={supportsColor:function(e){return o(l(e,e&&e.isTTY))},stdout:o(l(!0,A.isatty(1))),stderr:o(l(!0,A.isatty(2)))}}(),r=P();function l(e){if(/^\d{3,4}$/.test(e)){let r=/(\d{1,2})(\d{2})/.exec(e)||[];return{major:0,minor:parseInt(r[1],10),patch:parseInt(r[2],10)}}let r=(e||"").split(".").map(e=>parseInt(e,10));return{major:r[0],minor:r[1],patch:r[2]}}function a(t){let{CI:n,FORCE_HYPERLINK:i,NETLIFY:o,TEAMCITY_VERSION:a,TERM_PROGRAM:u,TERM_PROGRAM_VERSION:s,VTE_VERSION:c}=process.env;if(i)return!(i.length>0&&0===parseInt(i,10));if(r("no-hyperlink")||r("no-hyperlinks")||r("hyperlink=false")||r("hyperlink=never"))return!1;if(r("hyperlink=true")||r("hyperlink=always")||o)return!0;if(!e.supportsColor(t)||t&&!t.isTTY)return!1;if("WT_SESSION"in process.env)return!0;if("win32"===process.platform||n||a)return!1;if(u){let e=l(s||"");switch(u){case"iTerm.app":if(3===e.major)return e.minor>=1;return e.major>3;case"WezTerm":return e.major>=0x1343cac;case"vscode":return e.major>1||1===e.major&&e.minor>=72}}if(c){if("0.50.0"===c)return!1;let e=l(c);return e.major>0||e.minor>=50}return!1}return i={supportsHyperlink:a,stdout:a(process.stdout),stderr:a(process.stderr)}}();function k(e,r,t={}){return"\x1b]8;"+Object.keys(t).map(e=>e+"="+t[e]).join(":")+";"+r+"\x07"+e+"\x1b]8;;\x07"}const L={type:"separator"};module.exports=(e,r)=>{let t=[],n=0,i=0,o=0,s=0,c=0,h={},m=0,E=0,y=0,O=!1;e.sort((e,r)=>e.errorCount===r.errorCount?r.warningCount-e.warningCount:0===e.errorCount?-1:0===r.errorCount?1:r.errorCount-e.errorCount).forEach(e=>{let{messages:r,filePath:a,usedDeprecatedRules:f}=e;if(0===r.length)return;n+=e.errorCount,i+=e.warningCount,o+=e.fatalErrorCount,s+=e.fixableWarningCount,c+=e.fixableErrorCount,f.forEach(e=>{var r;h[r=e.ruleId]||(h[r]=e.replacedBy)}),0!==t.length&&t.push(L);let p=r.find(({severity:e})=>2===e)||r[0];t.push({type:"header",filePath:a,relativeFilePath:l.relative(".",a),firstLineCol:`${p.line}:${p.column}`}),r.sort((e,r)=>e.fatal===r.fatal&&e.severity===r.severity?e.line===r.line?e.column{let r=e.message.replaceAll(/\B`(.*?)`\B|\B'(.*?)'\B/g,(e,r,t)=>u.bold(r||t)),n=String(e.line||0),i=String(e.column||0),o=_(n),l=_(i),a=_(r);o>m&&(m=o),l>E&&(E=l),a>y&&(y=a),O||(O=e.line||e.column),t.push({type:"message",severity:e.fatal?"fatal":2===e.severity||"error"===e.severity?"error":"warning",line:n,lineWidth:o,column:i,columnWidth:l,message:r,messageWidth:a,ruleId:e.ruleId||""})})});let I="\n";a.stdout.isTTY&&!f.isCI&&"iTerm.app"===a.env.TERM_PROGRAM&&(I+=function(e=a.cwd()){return"\x1b]50;CurrentDir="+e+"\x07"}());let g=!f.isCI&&W.supportsHyperlink(a.stdout),x=d.hostname(),C=a.env.GNOME_TERMINAL_SCREEN;I+=`${t.map(e=>{if("header"===e.type){let r=O?u.hidden(u.dim(u.gray(`:${e.firstLineCol}`))):"";if(C){let t=p.pathToFileURL(e.filePath,{});return t.hostname=x,k(e.relativeFilePath,t.href)+r}return u.underline(e.relativeFilePath)+r}if("message"===e.type){let t;try{r&&"rulesMeta"in r&&(t=r.rulesMeta[e.ruleId].docs?.url)}catch{}let n=["","warning"===e.severity?u.yellow("warn "):u.red("error")," ".repeat(m-e.lineWidth)+u.dim(e.line+u.gray(":")+e.column)," ".repeat(E-e.columnWidth)+e.message," ".repeat(y-e.messageWidth)+(t&&g?k(u.dim(e.ruleId),t):u.dim(e.ruleId))];return O||n.splice(2,1),n.join(" ")}return""}).join("\n")} `;let b=Object.entries(h),M=b.length,R=Object.entries({problem:[!0,n+i+o],warning:[!0,i>0?u.yellow(i):u.green(0)],error:[!0,n>0?u.red(n):u.green(0)],fatal:[o>0,u.red(o)],fixable:[c+s>0,c+s],deprecated:[M>0,u.bold(u.gray(M))]}).filter(([,[e]])=>e),v=Math.max(...R.map(([e])=>e.length));return R.forEach(e=>{let[r,[,t]]=e;I+=`${" ".repeat(v-r.length)}${u.bold(`${r}:`)} ${t} `}),M>0&&b.forEach(([e,r])=>{I+="\n",I+=`${u.gray("deprecated:")} ${e}`,I+=r.length>0?u.gray(` (replaced by ${r.map(u.white).join(", ")})`):""}),I+="\n",n+i+o+M>0?I:""};