!function(){return function r(o,t,e){function n(i,c){if(!t[i]){if(!o[i]){var u="function"==typeof require&&require;if(!c&&u)return u(i,!0);if(s)return s(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var f=t[i]={exports:{}};o[i][0].call(f.exports,function(r){return n(o[i][1][r]||r)},f,f.exports,r,o,t,e)}return t[i].exports}for(var s="function"==typeof require&&require,i=0;i<e.length;i++)n(e[i]);return n}}()({1:[function(r,o,t){"use strict";window.jsonifyError=r("./index.js")},{"./index.js":2}],2:[function(r,o,t){"use strict";const e=r("./lib/jsonify-error"),n=r("./lib/override-console"),s=r("./lib/override-error-methods"),i=r("./lib/log"),c=r("./lib/to-string");o.exports=e,o.exports.overrideConsole=n,o.exports.overrideErrorMethods=s,o.exports.log=i,o.exports.asString=c},{"./lib/jsonify-error":6,"./lib/log":3,"./lib/override-console":7,"./lib/override-error-methods":8,"./lib/to-string":9}],3:[function(r,o,t){"use strict";const e=r("./../map-arg");o.exports=function(r){console.error(e(r))}},{"./../map-arg":4}],4:[function(r,o,t){"use strict";const e=r("./../jsonify-error");o.exports=function(r){return r instanceof Error?e(r):r}},{"./../jsonify-error":6}],5:[function(r,o,t){"use strict";o.exports=function(r){const o=[];let t=Object.getPrototypeOf(r);for(null!==t&&(t=Object.getPrototypeOf(t));null!==t;)o.push(t.constructor.name),t=Object.getPrototypeOf(t);return o}},{}],6:[function(r,o,t){"use strict";const e=r("./get-superclasses");o.exports=function(r){if(!(r instanceof Error))return r;const o={};o.name=r.name||"<no name available>",o.className=r.constructor.name||"<no class name available>",o.message=r.message||"<no message available>",o.superclasses=e(r),o.enumerableFields={};for(const t in r)"function"!=typeof r[t]&&(o.enumerableFields[t]=r[t]);return"string"==typeof r.stack&&r.stack.length>0?o.stack=r.stack.split("\n").map(r=>r.replace(/^\s+/,"")).filter(r=>r):o.stack=r.stack||"<no stack trace available>",o}},{"./get-superclasses":5}],7:[function(r,o,t){"use strict";const e=r("./map-arg"),n=["log","debug","info","warn","error"];let s=!1;o.exports=function(){if(s)return;s=!0;const r={};for(const o of n)console[o]&&(r[o]=console[o].bind(console),console[o]=function(...t){r[o](...t.map(e))})}},{"./map-arg":4}],8:[function(r,o,t){"use strict";const e=r("./jsonify-error"),n=r("./to-string");o.exports=function(){Error.prototype.toJSON=function(){return e(this)},Error.prototype.toString=function(r=4){return n(this,r)}}},{"./jsonify-error":6,"./to-string":9}],9:[function(r,o,t){"use strict";const e=r("./jsonify-error");o.exports=function(r,o=4){if(!(r instanceof Error))throw new TypeError("jsonifyError.toString() error: First argument must be instance of Error.");const t=e(r);return`${t.className}: ${t.message} ${JSON.stringify(t,null,o)}`}},{"./jsonify-error":6}]},{},[1]);