"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var c,m;function O(){if(m)return c;m=1;const h=e=>{const r=e.charCodeAt(0).toString(16).toUpperCase();return"0x"+(r.length%2?"0":"")+r},d=(e,r,t)=>{if(!r)return{message:e.message+" while parsing empty string",position:0};const s=e.message.match(/^Unexpected token (.) .*position\s+(\d+)/i),n=s?+s[2]:e.message.match(/^Unexpected end of JSON.*/i)?r.length-1:null,o=s?e.message.replace(/^Unexpected token ./,`Unexpected token ${JSON.stringify(s[1])} (${h(s[1])})`):e.message;if(n!=null){const a=n<=t?0:n-t,u=n+t>=r.length?r.length:n+t,l=(a===0?"":"...")+r.slice(a,u)+(u===r.length?"":"...");return{message:o+` while parsing ${r===l?"":"near "}${JSON.stringify(l)}`,position:n}}else return{message:o+` while parsing '${r.slice(0,t*2)}'`,position:0}};class g extends SyntaxError{constructor(r,t,s,n){s=s||20;const o=d(r,t,s);super(o.message),Object.assign(this,o),this.code="EJSONPARSE",this.systemError=r,Error.captureStackTrace(this,n||this.constructor)}get name(){return this.constructor.name}set name(r){}get[Symbol.toStringTag](){return this.constructor.name}}const y=Symbol.for("indent"),E=Symbol.for("newline"),S=/^\s*[{\[]((?:\r?\n)+)([\s\t]*)/,f=/^(?:\{\}|\[\])((?:\r?\n)+)?$/,i=(e,r,t)=>{const s=p(e);t=t||20;try{const[,n=`
`,o="  "]=s.match(f)||s.match(S)||[,"",""],a=JSON.parse(s,r);return a&&typeof a=="object"&&(a[E]=n,a[y]=o),a}catch(n){if(typeof e!="string"&&!Buffer.isBuffer(e)){const o=Array.isArray(e)&&e.length===0;throw Object.assign(new TypeError(`Cannot parse ${o?"an empty array":String(e)}`),{code:"EJSONPARSE",systemError:n})}throw new g(n,s,t,i)}},p=e=>String(e).replace(/^\uFEFF/,"");return c=i,i.JSONParseError=g,i.noExceptions=(e,r)=>{try{return JSON.parse(p(e),r)}catch{}},c}exports.__require=O;
//# sourceMappingURL=index.js.map
