import{__exports as e}from"../../../../_virtual/index59.mjs";import{__require as t}from"../../../picocolors/picocolors.mjs";import{__require as r}from"../../../js-tokens/index.mjs";import{__require as n}from"../../helper-validator-identifier/lib/index.mjs";var o;function s(){if(o)return e;o=1,Object.defineProperty(e,"__esModule",{value:!0});var s=t(),i=r(),a=n();const l=(e,t)=>r=>e(t(r));function c(e){return{keyword:e.cyan,capitalized:e.yellow,jsxIdentifier:e.yellow,punctuator:e.yellow,number:e.magenta,string:e.green,regex:e.magenta,comment:e.gray,invalid:l(l(e.white,e.bgRed),e.bold),gutter:e.gray,marker:l(e.red,e.bold),message:l(e.red,e.bold),reset:e.reset}}const u=c(s.createColors(!0)),m=c(s.createColors(!1));function f(e){return e?u:m}const d=new Set(["as","async","from","get","of","set"]),p=/\r\n|[\n\r\u2028\u2029]/,g=/^[()[\]{}]$/;let y;const h=/^[a-z][\w-]*$/i,v=function(e,t,r){if("name"===e.type){const n=e.value;if(a.isKeyword(n)||a.isStrictReservedWord(n,!0)||d.has(n))return"keyword";if(h.test(n)&&("<"===r[t-1]||"</"===r.slice(t-2,t)))return"jsxIdentifier";const o=String.fromCodePoint(n.codePointAt(0));if(o!==o.toLowerCase())return"capitalized"}return"punctuator"===e.type&&g.test(e.value)?"bracket":"invalid"!==e.type||"@"!==e.value&&"#"!==e.value?e.type:"punctuator"};function b(e){if(""===e)return"";const t=f(!0);let r="";for(const{type:n,value:o}of y(e))r+=n in t?o.split(p).map(e=>t[n](e)).join("\n"):o;return r}y=function*(e){let t;for(;t=i.default.exec(e);){const r=i.matchToToken(t);yield{type:v(r,t.index,e),value:r.value}}};let j=!1;const _=/\r\n|[\n\r\u2028\u2029]/;function x(e,t,r={}){const n=r.forceColor||("object"!=typeof process||"0"!==process.env.FORCE_COLOR&&"false"!==process.env.FORCE_COLOR)&&s.isColorSupported&&r.highlightCode,o=f(n),i=e.split(_),{start:a,end:l,markerLines:c}=function(e,t,r){const n=Object.assign({column:0,line:-1},e.start),o=Object.assign({},n,e.end),{linesAbove:s=2,linesBelow:i=3}=r||{},a=n.line,l=n.column,c=o.line,u=o.column;let m=Math.max(a-(s+1),0),f=Math.min(t.length,c+i);-1===a&&(m=0),-1===c&&(f=t.length);const d=c-a,p={};if(d)for(let e=0;e<=d;e++){const r=e+a;if(l)if(0===e){const e=t[r-1].length;p[r]=[l,e-l+1]}else if(e===d)p[r]=[0,u];else{const n=t[r-e].length;p[r]=[0,n]}else p[r]=!0}else p[a]=l===u?!l||[l,0]:[l,u-l];return{start:m,end:f,markerLines:p}}(t,i,r),u=t.start&&"number"==typeof t.start.column,m=String(l).length;let d=(n?b(e):e).split(_,l).slice(a,l).map((e,t)=>{const n=a+1+t,s=` ${` ${n}`.slice(-m)} |`,i=c[n],l=!c[n+1];if(i){let t="";if(Array.isArray(i)){const n=e.slice(0,Math.max(i[0]-1,0)).replace(/[^\t]/g," "),a=i[1]||1;t=["\n ",o.gutter(s.replace(/\d/g," "))," ",n,o.marker("^").repeat(a)].join(""),l&&r.message&&(t+=" "+o.message(r.message))}return[o.marker(">"),o.gutter(s),e.length>0?` ${e}`:"",t].join("")}return` ${o.gutter(s)}${e.length>0?` ${e}`:""}`}).join("\n");return r.message&&!u&&(d=`${" ".repeat(m+1)}${r.message}\n${d}`),n?o.reset(d):d}return e.codeFrameColumns=x,e.default=function(e,t,r,n={}){if(!j){j=!0;const e="Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";if(process.emitWarning)process.emitWarning(e,"DeprecationWarning");else{new Error(e).name="DeprecationWarning"}}return x(e,{start:{column:r=Math.max(r,0),line:t}},n)},e.highlight=b,e}export{s as __require};