/** * Minified by jsDelivr using Terser v5.15.1. * Original file: /npm/neatjson@0.10.5/javascript/neatjson.js * * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files */ !function(n){function o(n,o){"wrap"in(o=o||{})||(o.wrap=80),1==o.wrap&&(o.wrap=-1),"indent"in o||(o.indent=" "),"arrayPadding"in o||(o.arrayPadding="padding"in o?o.padding:0),"objectPadding"in o||(o.objectPadding="padding"in o?o.padding:0),"beforeComma"in o||(o.beforeComma="aroundComma"in o?o.aroundComma:0),"afterComma"in o||(o.afterComma="aroundComma"in o?o.aroundComma:0),"beforeColon"in o||(o.beforeColon="aroundColon"in o?o.aroundColon:0),"afterColon"in o||(o.afterColon="aroundColon"in o?o.aroundColon:0),"beforeColon1"in o||(o.beforeColon1="aroundColon1"in o?o.aroundColon1:"beforeColon"in o?o.beforeColon:0),"afterColon1"in o||(o.afterColon1="aroundColon1"in o?o.aroundColon1:"afterColon"in o?o.afterColon:0),"beforeColonN"in o||(o.beforeColonN="aroundColonN"in o?o.aroundColonN:"beforeColon"in o?o.beforeColon:0),"afterColonN"in o||(o.afterColonN="aroundColonN"in o?o.aroundColonN:"afterColon"in o?o.afterColon:0),"forceFloatsIn"in o||(o.forceFloatsIn=[]);const e=f(" ",o.arrayPadding),t=f(" ",o.objectPadding),r=f(" ",o.beforeComma)+","+f(" ",o.afterComma),i=f(" ",o.beforeColon1)+":"+f(" ",o.afterColon1),a=f(" ",o.beforeColonN)+":"+f(" ",o.afterColonN),l=function(){const n=new Map;return function(c,s,d){const C=d?{o:c,floatsForced:d}:c;let g=n.get(C);return g||n.set(C,g={}),g[s]||(g[s]=function(n,c,s){if(null==n)return c+"null";if("number"==typeof n){if(n===1/0)return c+"9e9999";if(n===-1/0)return c+"-9e9999";if(Number.isNaN(n))return c+'"NaN"';{let e=(s||n===+n&&n!==(0|n))&&"decimals"in o?n.toFixed(o.decimals):n+"";return o.trimTrailingZeros&&(e=+e+""),s&&-1==e.indexOf(".")&&(e+=".0"),c+e}}if(n instanceof Array){if(!n.length)return c+"[]";let t=n.map((function(n){return l(n,"",s)}));const i=c+"["+e+t.join(r)+e+"]";if(!1===o.wrap||i.length<=o.wrap)return i;if(o.short){const o=c+" "+e;return t=n.map((function(n){return l(n,o,s)})),t[0]=t[0].replace(o,c+"["+e),t[t.length-1]=t[t.length-1]+e+"]",t.join(",\n")}{const e=c+o.indent;return c+"[\n"+n.map((function(n){return l(n,e,s)})).join(",\n")+"\n"+(o.indentLast?e:c)+"]"}}if(n instanceof Object){let e=[],d=0;const C=o.sort||o.sorted;for(let o in n){const t=e[d++]=[o,n[o]];!0===C?t[2]=o:"function"==typeof C&&(t[2]=C(o,n[o],n))}if(!e.length)return c+"{}";C&&(e=e.sort((function(n,o){return(n=n[2])<(o=o[2])?-1:n>o?1:0})));const g=e.map((([n])=>n));let p=e.map((([n,e],t)=>[JSON.stringify(n),l(e,"",o.forceFloats||o.forceFloatsIn.includes(n))].join(i))).join(r);const m=c+"{"+t+p+t+"}";if(!1===o.wrap||m.lengthn&&(n=p[o][0].length);const o=f(" ",n);for(let n=p.length;n--;)p[n][0]=u(o,p[n][0])}for(let n=p.length;n--;){let e=p[n][0],t=p[n][1];const r=f(" ",(e+a).length);s=o.forceFloats||o.forceFloatsIn.includes(g[n]);const i=e+a+l(t,"",s);p[n]=!1===o.wrap||i.length<=o.wrap||!t||"object"!=typeof t?i:e+a+l(t,r,s).replace(/^\s+/,"")}return p.join(",\n")+t+"}"}{const n=e.map((function(n){return n[0]=c+o.indent+JSON.stringify(n[0]),n}));if(o.aligned){let o=0;for(let e=n.length;e--;)n[e][0].length>o&&(o=n[e][0].length);const e=f(" ",o);for(let o=n.length;o--;)n[o][0]=u(e,n[o][0])}const t=c+o.indent;for(let e=n.length;e--;){const r=n[e][0],i=n[e][1];s=o.forceFloats||o.forceFloatsIn.includes(g[e]);const f=r+a+l(i,"",s);n[e]=!1===o.wrap||f.length<=o.wrap||!i||"object"!=typeof i?f:r+a+l(i,t,s).replace(/^\s+/,"")}return c+"{\n"+n.join(",\n")+"\n"+(o.indentLast?t:c)+"}"}}return c+JSON.stringify(n)}(c,s,d)),g[s]}}();return l(n,"",o.forceFloats);function f(n,o){let e="";for(;1&o&&(e+=n),o>>=1;)n+=n;return e}function u(n,o){return(o+n).substring(0,n.length)}}n.neatJSON=o,o.version="0.10.5"}("undefined"==typeof exports?this:exports);