function F(r){return ir.test(r)}var ir=/^-?[0-9]+$/;function H(r){return ar.test(r)}var ar=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function fr(r,e){var t=parseFloat(r),n=String(t),f=V(r),b=V(n);if(f===b)return!0;if((e==null?void 0:e.approx)===!0){var v=14;if(!F(r)&&b.length>=v&&f.startsWith(b.substring(0,v)))return!0}return!1}var w;(function(r){r.underflow="underflow",r.overflow="overflow",r.truncate_integer="truncate_integer",r.truncate_float="truncate_float"})(w||(w={}));function cr(r){if(!fr(r,{approx:!1})){if(F(r))return w.truncate_integer;var e=parseFloat(r);return isFinite(e)?e===0?w.underflow:w.truncate_float:w.overflow}}function V(r){return r.replace(ur,"").replace(sr,"").replace(dr,"").replace(lr,"")}var ur=/[eE][+-]?\d+$/,lr=/^-?(0*)?/,sr=/\./,dr=/0+$/;function E(r){return E=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E(r)}function yr(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function K(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,k(n.key),n)}}function pr(r,e,t){return e&&K(r.prototype,e),t&&K(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}function hr(r,e,t){return e=k(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function k(r){var e=vr(r,"string");return E(e)==="symbol"?e:String(e)}function vr(r,e){if(E(r)!=="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(E(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var mr=function(){function r(e){if(yr(this,r),hr(this,"isLosslessNumber",!0),!H(e))throw new Error('Invalid number (value: "'+e+'")');this.value=e}return pr(r,[{key:"valueOf",value:function(){var t=cr(this.value);if(t===void 0||t===w.truncate_float)return parseFloat(this.value);if(F(this.value))return BigInt(this.value);throw new Error("Cannot safely convert to number: "+"the value '".concat(this.value,"' would ").concat(t," and become ").concat(parseFloat(this.value)))}},{key:"toString",value:function(){return this.value}}]),r}();function br(r){return r&&E(r)==="object"&&r.isLosslessNumber===!0||!1}function gr(r){return new mr(r)}function T(r){return T=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},T(r)}function wr(r,e){return J({"":r},"",r,e)}function J(r,e,t,n){return Array.isArray(t)?n.call(r,e,Ar(t,n)):t&&T(t)==="object"&&!br(t)?n.call(r,e,Sr(t,n)):n.call(r,e,t)}function Sr(r,e){return Object.keys(r).forEach(function(t){var n=J(r,t,r[t],e);n!==void 0?r[t]=n:delete r[t]}),r}function Ar(r,e){for(var t=0;t<r.length;t++)r[t]=J(r,t+"",r[t],e);return r}function G(r){return G=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},G(r)}function D(r){return Or(r)||_r(r)||Cr(r)||Er()}function Er(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Cr(r,e){if(!!r){if(typeof r=="string")return B(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return B(r,e)}}function _r(r){if(typeof Symbol!="undefined"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function Or(r){if(Array.isArray(r))return B(r)}function B(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function zr(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:gr,n=0,f=C();return l(f),g(),e?wr(f,e):f;function b(){if(r.charCodeAt(n)===Dr){n++,m();for(var o={},a=!0;n<r.length&&r.charCodeAt(n)!==W;){a?a=!1:(d(),m());var s=n,h=i();h===void 0&&q(),m(),c();var A=C();Object.prototype.hasOwnProperty.call(o,h)&&!$(A,o[h])&&z(h,s+1),o[h]=A}return r.charCodeAt(n)!==W&&Y(),n++,o}}function v(){if(r.charCodeAt(n)===Pr){n++,m();for(var o=[],a=!0;n<r.length&&r.charCodeAt(n)!==Z;){a?a=!1:d();var s=C();y(s),o.push(s)}return r.charCodeAt(n)!==Z&&j(),n++,o}}function C(){var o,a,s,h,A,R;m();var or=(o=(a=(s=(h=(A=(R=i())!==null&&R!==void 0?R:u())!==null&&A!==void 0?A:b())!==null&&h!==void 0?h:v())!==null&&s!==void 0?s:_("true",!0))!==null&&a!==void 0?a:_("false",!1))!==null&&o!==void 0?o:_("null",null);return m(),or}function _(o,a){if(r.slice(n,n+o.length)===o)return n+=o.length,a}function m(){for(;Nr(r.charCodeAt(n));)n++}function i(){if(r.charCodeAt(n)===P){n++;for(var o="";n<r.length&&r.charCodeAt(n)!==P;){if(r.charCodeAt(n)===Rr){var a=r[n+1],s=Lr[a];s!==void 0?(o+=s,n++):a==="u"?I(r.charCodeAt(n+2))&&I(r.charCodeAt(n+3))&&I(r.charCodeAt(n+4))&&I(r.charCodeAt(n+5))?(o+=String.fromCharCode(parseInt(r.slice(n+2,n+6),16)),n+=5):er(n):nr(n)}else xr(r.charCodeAt(n))?o+=r[n]:rr(r[n]);n++}return O(),n++,o}}function u(){var o=n;if(r.charCodeAt(n)===Q&&(n++,S(o)),r.charCodeAt(n)===X)n++;else if(Ir(r.charCodeAt(n)))for(n++;x(r.charCodeAt(n));)n++;if(r.charCodeAt(n)===Ur)for(n++,S(o);x(r.charCodeAt(n));)n++;if(r.charCodeAt(n)===Zr||r.charCodeAt(n)===Wr)for(n++,(r.charCodeAt(n)===Q||r.charCodeAt(n)===Fr)&&n++,S(o);x(r.charCodeAt(n));)n++;if(n>o)return t(r.slice(o,n))}function d(){if(r.charCodeAt(n)!==Xr)throw new SyntaxError("Comma ',' expected after value ".concat(p()));n++}function c(){if(r.charCodeAt(n)!==Vr)throw new SyntaxError("Colon ':' expected after property name ".concat(p()));n++}function l(o){if(o===void 0)throw new SyntaxError("JSON value expected ".concat(p()))}function y(o){if(o===void 0)throw new SyntaxError("Array item expected ".concat(p()))}function g(){if(n<r.length)throw new SyntaxError("Expected end of input ".concat(p()))}function S(o){if(!x(r.charCodeAt(n))){var a=r.slice(o,n);throw new SyntaxError("Invalid number '".concat(a,"', expecting a digit ").concat(p()))}}function O(){if(r.charCodeAt(n)!==P)throw new SyntaxError(`End of string '"' expected `.concat(p()))}function q(){throw new SyntaxError("Quoted object key expected ".concat(p()))}function z(o,a){throw new SyntaxError("Duplicate key '".concat(o,"' encountered at position ").concat(a))}function Y(){throw new SyntaxError("Quoted object key or end of object '}' expected ".concat(p()))}function j(){throw new SyntaxError("Array item or end of array ']' expected ".concat(p()))}function rr(o){throw new SyntaxError("Invalid character '".concat(o,"' ").concat(N()))}function nr(o){var a=r.slice(o,o+2);throw new SyntaxError("Invalid escape character '".concat(a,"' ").concat(N()))}function er(o){for(var a=o+2;/\w/.test(r[a]);)a++;var s=r.slice(o,a);throw new SyntaxError("Invalid unicode character '".concat(s,"' ").concat(N()))}function N(){return"at position ".concat(n)}function tr(){return n<r.length?"but got '".concat(r[n],"'"):"but reached end of input"}function p(){return tr()+" "+N()}}function Nr(r){return r===Tr||r===Gr||r===Br||r===$r}function I(r){return r>=X&&r<=U||r>=Kr&&r<=Qr||r>=Mr&&r<=Hr}function x(r){return r>=X&&r<=U}function Ir(r){return r>=Jr&&r<=U}function xr(r){return r>=32&&r<=1114111}function $(r,e){if(r===e)return!0;if(Array.isArray(r)&&Array.isArray(e))return r.length===e.length&&r.every(function(n,f){return $(n,e[f])});if(M(r)&&M(e)){var t=D(new Set([].concat(D(Object.keys(r)),D(Object.keys(e)))));return t.every(function(n){return $(r[n],e[n])})}return!1}function M(r){return G(r)==="object"&&r!==null}var Lr={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
`,r:"\r",t:"	"},Rr=92,Dr=123,W=125,Pr=91,Z=93,Tr=32,Gr=10,Br=9,$r=13,P=34,Fr=43,Q=45,X=48,Jr=49,U=57,Xr=44,Ur=46,Vr=58,Kr=65,Mr=97,Wr=69,Zr=101,Qr=70,Hr=102;function L(r){return L=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},L(r)}function kr(r,e,t,n){var f=qr(t),b=typeof e=="function"?e.call({"":r},"",r):r;return v(b,"");function v(i,u){if(Array.isArray(n)){var d=n.find(function(l){return l.test(i)});if(d){var c=d.stringify(i);if(typeof c!="string"||!H(c))throw new Error("Invalid JSON number: output of a number stringifier must be a string containing a JSON number "+"(output: ".concat(c,")"));return c}}if(typeof i=="boolean"||typeof i=="number"||typeof i=="string"||i===null||i instanceof Date||i instanceof Boolean||i instanceof Number||i instanceof String)return JSON.stringify(i);if(i&&i.isLosslessNumber||typeof i=="bigint")return i.toString();if(Array.isArray(i))return C(i,u);if(i&&L(i)==="object")return _(i,u)}function C(i,u){if(i.length===0)return"[]";for(var d=f?u+f:void 0,c=f?`[
`:"[",l=0;l<i.length;l++){var y=typeof e=="function"?e.call(i,String(l),i[l]):i[l];f&&(c+=d),typeof y!="undefined"&&typeof y!="function"?c+=v(y,d):c+="null",l<i.length-1&&(c+=f?`,
`:",")}return c+=f?`
`+u+"]":"]",c}function _(i,u){if(typeof i.toJSON=="function")return kr(i.toJSON(),e,t,void 0);var d=Array.isArray(e)?e.map(String):Object.keys(i);if(d.length===0)return"{}";var c=f?u+f:void 0,l=!0,y=f?`{
`:"{";return d.forEach(function(g){var S=typeof e=="function"?e.call(i,g,i[g]):i[g];if(m(g,S)){l?l=!1:y+=f?`,
`:",";var O=JSON.stringify(g);y+=f?c+O+": ":O+":",y+=v(S,c)}}),y+=f?`
`+u+"}":"}",y}function m(i,u){return typeof u!="undefined"&&typeof u!="function"&&L(u)!=="symbol"}}function qr(r){if(typeof r=="number")return" ".repeat(r);if(typeof r=="string"&&r!=="")return r}export{zr as p,kr as s};
