import{__exports as r}from"../../../_virtual/es.json.parse.mjs";import{__require as e}from"../internals/export.mjs";import{__require as t}from"../internals/descriptors.mjs";import{__require as i}from"../internals/global-this.mjs";import{__require as n}from"../internals/get-built-in.mjs";import{__require as s}from"../internals/function-uncurry-this.mjs";import{__require as o}from"../internals/function-call.mjs";import{__require as a}from"../internals/is-callable.mjs";import{__require as u}from"../internals/is-object.mjs";import{__require as f}from"../internals/is-array.mjs";import{__require as c}from"../internals/has-own-property.mjs";import{__require as h}from"../internals/to-string.mjs";import{__require as l}from"../internals/length-of-array-like.mjs";import{__require as m}from"../internals/create-property.mjs";import{__require as p}from"../internals/fails.mjs";import{__require as d}from"../internals/parse-json-string.mjs";import{__require as _}from"../internals/symbol-constructor-detection.mjs";var v;function j(){if(v)return r;v=1;var j=e(),k=t(),w=i(),x=n(),b=s(),g=o(),q=a(),y=u(),O=f(),$=c(),F=h(),N=l(),S=m(),U=p(),E=d(),J=_(),A=w.JSON,D=w.Number,P=w.SyntaxError,z=A&&A.parse,B=x("Object","keys"),C=Object.getOwnPropertyDescriptor,G=b("".charAt),H=b("".slice),I=b(/./.exec),K=b([].push),L=/^\d$/,M=/^[1-9]$/,Q=/^[\d-]$/,R=/^[\t\n\r ]$/,T=function(r,e,t,i){var n,s,o,a,u,f=r[e],c=i&&f===i.value,h=c&&"string"==typeof i.source?{source:i.source}:{};if(y(f)){var l=O(f),m=c?i.nodes:l?[]:{};if(l)for(n=m.length,o=N(f),a=0;a<o;a++)V(f,a,T(f,""+a,t,a<n?m[a]:void 0));else for(s=B(f),o=N(s),a=0;a<o;a++)u=s[a],V(f,u,T(f,u,t,$(m,u)?m[u]:void 0))}return g(t,r,e,f,h)},V=function(r,e,t){if(k){var i=C(r,e);if(i&&!i.configurable)return}void 0===t?delete r[e]:S(r,e,t)},W=function(r,e,t,i){this.value=r,this.end=e,this.source=t,this.nodes=i},X=function(r,e){this.source=r,this.index=e};X.prototype={fork:function(r){return new X(this.source,r)},parse:function(){var r=this.source,e=this.skip(R,this.index),t=this.fork(e),i=G(r,e);if(I(Q,i))return t.number();switch(i){case"{":return t.object();case"[":return t.array();case'"':return t.string();case"t":return t.keyword(!0);case"f":return t.keyword(!1);case"n":return t.keyword(null)}throw new P('Unexpected character: "'+i+'" at: '+e)},node:function(r,e,t,i,n){return new W(e,i,r?null:H(this.source,t,i),n)},object:function(){for(var r=this.source,e=this.index+1,t=!1,i={},n={};e<r.length;){if(e=this.until(['"',"}"],e),"}"===G(r,e)&&!t){e++;break}var s=this.fork(e).string(),o=s.value;e=s.end,e=this.until([":"],e)+1,e=this.skip(R,e),s=this.fork(e).parse(),S(n,o,s),S(i,o,s.value),e=this.until([",","}"],s.end);var a=G(r,e);if(","===a)t=!0,e++;else if("}"===a){e++;break}}return this.node(1,i,this.index,e,n)},array:function(){for(var r=this.source,e=this.index+1,t=!1,i=[],n=[];e<r.length;){if(e=this.skip(R,e),"]"===G(r,e)&&!t){e++;break}var s=this.fork(e).parse();if(K(n,s),K(i,s.value),e=this.until([",","]"],s.end),","===G(r,e))t=!0,e++;else if("]"===G(r,e)){e++;break}}return this.node(1,i,this.index,e,n)},string:function(){var r=this.index,e=E(this.source,this.index+1);return this.node(0,e.value,r,e.end)},number:function(){var r=this.source,e=this.index,t=e;if("-"===G(r,t)&&t++,"0"===G(r,t))t++;else{if(!I(M,G(r,t)))throw new P("Failed to parse number at: "+t);t=this.skip(L,t+1)}if(("."===G(r,t)&&(t=this.skip(L,t+1)),"e"===G(r,t)||"E"===G(r,t))&&(t++,"+"!==G(r,t)&&"-"!==G(r,t)||t++,t===(t=this.skip(L,t))))throw new P("Failed to parse number's exponent value at: "+t);return this.node(0,D(H(r,e,t)),e,t)},keyword:function(r){var e=""+r,t=this.index,i=t+e.length;if(H(this.source,t,i)!==e)throw new P("Failed to parse value at: "+t);return this.node(0,r,t,i)},skip:function(r,e){for(var t=this.source;e<t.length&&I(r,G(t,e));e++);return e},until:function(r,e){e=this.skip(R,e);for(var t=G(this.source,e),i=0;i<r.length;i++)if(r[i]===t)return e;throw new P('Unexpected character: "'+t+'" at: '+e)}};var Y=U(function(){var r,e="9007199254740993";return z(e,function(e,t,i){r=i.source}),r!==e}),Z=J&&!U(function(){return 1/z("-0 \t")!=-1/0});return j({target:"JSON",stat:!0,forced:Y},{parse:function(r,e){return Z&&!q(e)?z(r):function(r,e){r=F(r);var t=new X(r,0),i=t.parse(),n=i.value,s=t.skip(R,i.end);if(s<r.length)throw new P('Unexpected extra character: "'+G(r,s)+'" after the parsed data at: '+s);return q(e)?T({"":n},"",e,i):n}(r,e)}}),r}export{j as __require};