function getArg(e,r,t){if(r in e)return e[r];if(3===arguments.length)return t;throw new Error('"'+r+'" is a required argument.')}exports.getArg=getArg;var urlRegexp=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,dataUrlRegexp=/^data:.+\,.+$/;function urlParse(e){var r=e.match(urlRegexp);return r?{scheme:r[1],auth:r[2],host:r[3],port:r[4],path:r[5]}:null}function urlGenerate(e){var r="";return e.scheme&&(r+=e.scheme+":"),r+="//",e.auth&&(r+=e.auth+"@"),e.host&&(r+=e.host),e.port&&(r+=":"+e.port),e.path&&(r+=e.path),r}function normalize(e){var r=e,t=urlParse(e);if(t){if(!t.path)return e;r=t.path}for(var n,o=exports.isAbsolute(r),a=r.split(/\/+/),i=0,u=a.length-1;u>=0;u--)"."===(n=a[u])?a.splice(u,1):".."===n?i++:i>0&&(""===n?(a.splice(u+1,i),i=0):(a.splice(u,2),i--));return""===(r=a.join("/"))&&(r=o?"/":"."),t?(t.path=r,urlGenerate(t)):r}function join(e,r){""===e&&(e="."),""===r&&(r=".");var t=urlParse(r),n=urlParse(e);if(n&&(e=n.path||"/"),t&&!t.scheme)return n&&(t.scheme=n.scheme),urlGenerate(t);if(t||r.match(dataUrlRegexp))return r;if(n&&!n.host&&!n.path)return n.host=r,urlGenerate(n);var o="/"===r.charAt(0)?r:normalize(e.replace(/\/+$/,"")+"/"+r);return n?(n.path=o,urlGenerate(n)):o}function relative(e,r){""===e&&(e="."),e=e.replace(/\/$/,"");for(var t=0;0!==r.indexOf(e+"/");){var n=e.lastIndexOf("/");if(n<0)return r;if((e=e.slice(0,n)).match(/^([^\/]+:\/)?\/*$/))return r;++t}return Array(t+1).join("../")+r.substr(e.length+1)}exports.urlParse=urlParse,exports.urlGenerate=urlGenerate,exports.normalize=normalize,exports.join=join,exports.isAbsolute=function(e){return"/"===e.charAt(0)||urlRegexp.test(e)},exports.relative=relative;var supportsNullProto=!("__proto__"in Object.create(null));function identity(e){return e}function toSetString(e){return isProtoString(e)?"$"+e:e}function fromSetString(e){return isProtoString(e)?e.slice(1):e}function isProtoString(e){if(!e)return!1;var r=e.length;if(r<9)return!1;if(95!==e.charCodeAt(r-1)||95!==e.charCodeAt(r-2)||111!==e.charCodeAt(r-3)||116!==e.charCodeAt(r-4)||111!==e.charCodeAt(r-5)||114!==e.charCodeAt(r-6)||112!==e.charCodeAt(r-7)||95!==e.charCodeAt(r-8)||95!==e.charCodeAt(r-9))return!1;for(var t=r-10;t>=0;t--)if(36!==e.charCodeAt(t))return!1;return!0}function compareByOriginalPositions(e,r,t){var n=strcmp(e.source,r.source);return 0!==n?n:0!==(n=e.originalLine-r.originalLine)?n:0!==(n=e.originalColumn-r.originalColumn)||t?n:0!==(n=e.generatedColumn-r.generatedColumn)?n:0!==(n=e.generatedLine-r.generatedLine)?n:strcmp(e.name,r.name)}function compareByGeneratedPositionsDeflated(e,r,t){var n=e.generatedLine-r.generatedLine;return 0!==n?n:0!==(n=e.generatedColumn-r.generatedColumn)||t?n:0!==(n=strcmp(e.source,r.source))?n:0!==(n=e.originalLine-r.originalLine)?n:0!==(n=e.originalColumn-r.originalColumn)?n:strcmp(e.name,r.name)}function strcmp(e,r){return e===r?0:null===e?1:null===r?-1:e>r?1:-1}function compareByGeneratedPositionsInflated(e,r){var t=e.generatedLine-r.generatedLine;return 0!==t?t:0!==(t=e.generatedColumn-r.generatedColumn)?t:0!==(t=strcmp(e.source,r.source))?t:0!==(t=e.originalLine-r.originalLine)?t:0!==(t=e.originalColumn-r.originalColumn)?t:strcmp(e.name,r.name)}function parseSourceMapInput(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}function computeSourceURL(e,r,t){if(r=r||"",e&&("/"!==e[e.length-1]&&"/"!==r[0]&&(e+="/"),r=e+r),t){var n=urlParse(t);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var o=n.path.lastIndexOf("/");o>=0&&(n.path=n.path.substring(0,o+1))}r=join(urlGenerate(n),r)}return normalize(r)}exports.toSetString=supportsNullProto?identity:toSetString,exports.fromSetString=supportsNullProto?identity:fromSetString,exports.compareByOriginalPositions=compareByOriginalPositions,exports.compareByGeneratedPositionsDeflated=compareByGeneratedPositionsDeflated,exports.compareByGeneratedPositionsInflated=compareByGeneratedPositionsInflated,exports.parseSourceMapInput=parseSourceMapInput,exports.computeSourceURL=computeSourceURL;