Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

stacktrace-gps

Package Overview
Dependencies
Maintainers
2
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stacktrace-gps - npm Package Compare versions

Comparing version 2.4.4 to 3.0.0

21

CHANGELOG.md

@@ -1,6 +0,21 @@

## v2.2.1
## v3.0
* Upgrade to StackFrame v1.x for better representation of eval, constructor, and native functions (#44)
* Cache and reuse SourceMapConsumers for same source map (#43)
* Add function parsing for ES6 function definitions (#46)
* Handle file:// protocol when making ajax requests (#40)
* Improve function name parsing (#46)
## v2.4
* Resolve original StackFrame if source map resolution fails
* Allow users to provide `ajax` for custom source/sourcemap resolution (#26)
* Allow users to provide `atob` function definition (#28)
* Improved handling of inline source maps
## v2.3
* Cache Promises for remote requests to avoid multiple in-flight requests for same resource (#19)
* Cache sourceContent from source maps
## v2.2
* Upgrade source-map dependency
* Fix handling of webpack:// urls in source maps
## v2.2.0
* Add component(1) support

@@ -7,0 +22,0 @@

2

dist/stacktrace-gps-with-polyfills.min.js

@@ -1,2 +0,2 @@

(function(){"use strict";function e(e){return"function"==typeof e||"object"==typeof e&&null!==e}function n(e){return"function"==typeof e}function t(e){return"object"==typeof e&&null!==e}function r(e){I=e}function o(e){J=e}function i(){return function(){process.nextTick(l)}}function s(){return function(){k(l)}}function u(){var e=0,n=new Z(l),t=document.createTextNode("");return n.observe(t,{characterData:!0}),function(){t.data=e=++e%2}}function a(){var e=new MessageChannel;return e.port1.onmessage=l,function(){e.port2.postMessage(0)}}function c(){return function(){setTimeout(l,1)}}function l(){for(var e=0;z>e;e+=2){var n=Q[e],t=Q[e+1];n(t),Q[e]=void 0,Q[e+1]=void 0}z=0}function f(){try{var e=require,n=e("vertx");return k=n.runOnLoop||n.runOnContext,s()}catch(t){return c()}}function g(){}function p(){return new TypeError("You cannot resolve a promise with itself")}function h(){return new TypeError("A promises callback cannot return that same promise.")}function m(e){try{return e.then}catch(n){return ne.error=n,ne}}function d(e,n,t,r){try{e.call(n,t,r)}catch(o){return o}}function _(e,n,t){J(function(e){var r=!1,o=d(t,n,function(t){r||(r=!0,n!==t?b(e,t):A(e,t))},function(n){r||(r=!0,C(e,n))},"Settle: "+(e._label||" unknown promise"));!r&&o&&(r=!0,C(e,o))},e)}function v(e,n){n._state===X?A(e,n._result):n._state===ee?C(e,n._result):L(n,void 0,function(n){b(e,n)},function(n){C(e,n)})}function y(e,t){if(t.constructor===e.constructor)v(e,t);else{var r=m(t);r===ne?C(e,ne.error):void 0===r?A(e,t):n(r)?_(e,t,r):A(e,t)}}function b(n,t){n===t?C(n,p()):e(t)?y(n,t):A(n,t)}function w(e){e._onerror&&e._onerror(e._result),E(e)}function A(e,n){e._state===V&&(e._result=n,e._state=X,0!==e._subscribers.length&&J(E,e))}function C(e,n){e._state===V&&(e._state=ee,e._result=n,J(w,e))}function L(e,n,t,r){var o=e._subscribers,i=o.length;e._onerror=null,o[i]=n,o[i+X]=t,o[i+ee]=r,0===i&&e._state&&J(E,e)}function E(e){var n=e._subscribers,t=e._state;if(0!==n.length){for(var r,o,i=e._result,s=0;s<n.length;s+=3)r=n[s],o=n[s+t],r?N(t,r,o,i):o(i);e._subscribers.length=0}}function O(){this.error=null}function S(e,n){try{return e(n)}catch(t){return te.error=t,te}}function N(e,t,r,o){var i,s,u,a,c=n(r);if(c){if(i=S(r,o),i===te?(a=!0,s=i.error,i=null):u=!0,t===i)return void C(t,h())}else i=o,u=!0;t._state!==V||(c&&u?b(t,i):a?C(t,s):e===X?A(t,i):e===ee&&C(t,i))}function M(e,n){try{n(function(n){b(e,n)},function(n){C(e,n)})}catch(t){C(e,t)}}function R(e,n){var t=this;t._instanceConstructor=e,t.promise=new e(g),t._validateInput(n)?(t._input=n,t.length=n.length,t._remaining=n.length,t._init(),0===t.length?A(t.promise,t._result):(t.length=t.length||0,t._enumerate(),0===t._remaining&&A(t.promise,t._result))):C(t.promise,t._validationError())}function P(e){return new re(this,e).promise}function j(e){function n(e){b(o,e)}function t(e){C(o,e)}var r=this,o=new r(g);if(!$(e))return C(o,new TypeError("You must pass an array to race.")),o;for(var i=e.length,s=0;o._state===V&&i>s;s++)L(r.resolve(e[s]),void 0,n,t);return o}function x(e){var n=this;if(e&&"object"==typeof e&&e.constructor===n)return e;var t=new n(g);return b(t,e),t}function T(e){var n=this,t=new n(g);return C(t,e),t}function F(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function G(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function D(e){this._id=ae++,this._state=void 0,this._result=void 0,this._subscribers=[],g!==e&&(n(e)||F(),this instanceof D||G(),M(this,e))}function B(){var e;if("undefined"!=typeof global)e=global;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(n){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;(!t||"[object Promise]"!==Object.prototype.toString.call(t.resolve())||t.cast)&&(e.Promise=ce)}var U;U=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var k,I,q,$=U,z=0,J=({}.toString,function(e,n){Q[z]=e,Q[z+1]=n,z+=2,2===z&&(I?I(l):q())}),W="undefined"!=typeof window?window:void 0,Y=W||{},Z=Y.MutationObserver||Y.WebKitMutationObserver,H="undefined"!=typeof process&&"[object process]"==={}.toString.call(process),K="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,Q=new Array(1e3);q=H?i():Z?u():K?a():void 0===W&&"function"==typeof require?f():c();var V=void 0,X=1,ee=2,ne=new O,te=new O;R.prototype._validateInput=function(e){return $(e)},R.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},R.prototype._init=function(){this._result=new Array(this.length)};var re=R;R.prototype._enumerate=function(){for(var e=this,n=e.length,t=e.promise,r=e._input,o=0;t._state===V&&n>o;o++)e._eachEntry(r[o],o)},R.prototype._eachEntry=function(e,n){var r=this,o=r._instanceConstructor;t(e)?e.constructor===o&&e._state!==V?(e._onerror=null,r._settledAt(e._state,n,e._result)):r._willSettleAt(o.resolve(e),n):(r._remaining--,r._result[n]=e)},R.prototype._settledAt=function(e,n,t){var r=this,o=r.promise;o._state===V&&(r._remaining--,e===ee?C(o,t):r._result[n]=t),0===r._remaining&&A(o,r._result)},R.prototype._willSettleAt=function(e,n){var t=this;L(e,void 0,function(e){t._settledAt(X,n,e)},function(e){t._settledAt(ee,n,e)})};var oe=P,ie=j,se=x,ue=T,ae=0,ce=D;D.all=oe,D.race=ie,D.resolve=se,D.reject=ue,D._setScheduler=r,D._setAsap=o,D._asap=J,D.prototype={constructor:D,then:function(e,n){var t=this,r=t._state;if(r===X&&!e||r===ee&&!n)return this;var o=new this.constructor(g),i=t._result;if(r){var s=arguments[r-1];J(function(){N(r,o,s,i)})}else L(t,o,e,n);return o},"catch":function(e){return this.then(null,e)}};var le=B,fe={Promise:ce,polyfill:le};"function"==typeof define&&define.amd?define(function(){return fe}):"undefined"!=typeof module&&module.exports?module.exports=fe:"undefined"!=typeof this&&(this.ES6Promise=fe),le()}).call(this),function(){"undefined"==typeof Promise&&ES6Promise.polyfill()}(),function(e,n){"use strict";"function"==typeof define&&define.amd?define("stackframe",[],n):"object"==typeof exports?module.exports=n():e.StackFrame=n()}(this,function(){"use strict";function e(e){return!isNaN(parseFloat(e))&&isFinite(e)}function n(e,n,t,r,o,i){void 0!==e&&this.setFunctionName(e),void 0!==n&&this.setArgs(n),void 0!==t&&this.setFileName(t),void 0!==r&&this.setLineNumber(r),void 0!==o&&this.setColumnNumber(o),void 0!==i&&this.setSource(i)}return n.prototype={getFunctionName:function(){return this.functionName},setFunctionName:function(e){this.functionName=String(e)},getArgs:function(){return this.args},setArgs:function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("Args must be an Array");this.args=e},getFileName:function(){return this.fileName},setFileName:function(e){this.fileName=String(e)},getLineNumber:function(){return this.lineNumber},setLineNumber:function(n){if(!e(n))throw new TypeError("Line Number must be a Number");this.lineNumber=Number(n)},getColumnNumber:function(){return this.columnNumber},setColumnNumber:function(n){if(!e(n))throw new TypeError("Column Number must be a Number");this.columnNumber=Number(n)},getSource:function(){return this.source},setSource:function(e){this.source=String(e)},toString:function(){var n=this.getFunctionName()||"{anonymous}",t="("+(this.getArgs()||[]).join(",")+")",r=this.getFileName()?"@"+this.getFileName():"",o=e(this.getLineNumber())?":"+this.getLineNumber():"",i=e(this.getColumnNumber())?":"+this.getColumnNumber():"";return n+t+r+o+i}},n});var SourceMap=function(e){function n(r){if(t[r])return t[r].exports;var o=t[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var t={};return n.m=e,n.c=t,n.p="",n(0)}([function(e,n,t){function r(e){var n=e;return"string"==typeof e&&(n=JSON.parse(e.replace(/^\)\]\}'/,""))),null!=n.sections?new s(n):new o(n)}function o(e){var n=e;"string"==typeof e&&(n=JSON.parse(e.replace(/^\)\]\}'/,"")));var t=u.getArg(n,"version"),r=u.getArg(n,"sources"),o=u.getArg(n,"names",[]),i=u.getArg(n,"sourceRoot",null),s=u.getArg(n,"sourcesContent",null),a=u.getArg(n,"mappings"),l=u.getArg(n,"file",null);if(t!=this._version)throw new Error("Unsupported version: "+t);r=r.map(String).map(u.normalize).map(function(e){return i&&u.isAbsolute(i)&&u.isAbsolute(e)?u.relative(i,e):e}),this._names=c.fromArray(o.map(String),!0),this._sources=c.fromArray(r,!0),this.sourceRoot=i,this.sourcesContent=s,this._mappings=a,this.file=l}function i(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function s(e){var n=e;"string"==typeof e&&(n=JSON.parse(e.replace(/^\)\]\}'/,"")));var t=u.getArg(n,"version"),o=u.getArg(n,"sections");if(t!=this._version)throw new Error("Unsupported version: "+t);this._sources=new c,this._names=new c;var i={line:-1,column:0};this._sections=o.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var n=u.getArg(e,"offset"),t=u.getArg(n,"line"),o=u.getArg(n,"column");if(t<i.line||t===i.line&&o<i.column)throw new Error("Section offsets must be ordered and non-overlapping.");return i=n,{generatedOffset:{generatedLine:t+1,generatedColumn:o+1},consumer:new r(u.getArg(e,"map"))}})}var u=t(1),a=t(2),c=t(3).ArraySet,l=t(4),f=t(6).quickSort;r.fromSourceMap=function(e){return o.fromSourceMap(e)},r.prototype._version=3,r.prototype.__generatedMappings=null,Object.defineProperty(r.prototype,"_generatedMappings",{get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),r.prototype.__originalMappings=null,Object.defineProperty(r.prototype,"_originalMappings",{get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),r.prototype._charIsMappingSeparator=function(e,n){var t=e.charAt(n);return";"===t||","===t},r.prototype._parseMappings=function(e,n){throw new Error("Subclasses must implement _parseMappings")},r.GENERATED_ORDER=1,r.ORIGINAL_ORDER=2,r.GREATEST_LOWER_BOUND=1,r.LEAST_UPPER_BOUND=2,r.prototype.eachMapping=function(e,n,t){var o,i=n||null,s=t||r.GENERATED_ORDER;switch(s){case r.GENERATED_ORDER:o=this._generatedMappings;break;case r.ORIGINAL_ORDER:o=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var a=this.sourceRoot;o.map(function(e){var n=null===e.source?null:this._sources.at(e.source);return null!=n&&null!=a&&(n=u.join(a,n)),{source:n,generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:null===e.name?null:this._names.at(e.name)}},this).forEach(e,i)},r.prototype.allGeneratedPositionsFor=function(e){var n=u.getArg(e,"line"),t={source:u.getArg(e,"source"),originalLine:n,originalColumn:u.getArg(e,"column",0)};if(null!=this.sourceRoot&&(t.source=u.relative(this.sourceRoot,t.source)),!this._sources.has(t.source))return[];t.source=this._sources.indexOf(t.source);var r=[],o=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",u.compareByOriginalPositions,a.LEAST_UPPER_BOUND);if(o>=0){var i=this._originalMappings[o];if(void 0===e.column)for(var s=i.originalLine;i&&i.originalLine===s;)r.push({line:u.getArg(i,"generatedLine",null),column:u.getArg(i,"generatedColumn",null),lastColumn:u.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o];else for(var c=i.originalColumn;i&&i.originalLine===n&&i.originalColumn==c;)r.push({line:u.getArg(i,"generatedLine",null),column:u.getArg(i,"generatedColumn",null),lastColumn:u.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o]}return r},n.SourceMapConsumer=r,o.prototype=Object.create(r.prototype),o.prototype.consumer=r,o.fromSourceMap=function(e){var n=Object.create(o.prototype),t=n._names=c.fromArray(e._names.toArray(),!0),r=n._sources=c.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file;for(var s=e._mappings.toArray().slice(),a=n.__generatedMappings=[],l=n.__originalMappings=[],g=0,p=s.length;p>g;g++){var h=s[g],m=new i;m.generatedLine=h.generatedLine,m.generatedColumn=h.generatedColumn,h.source&&(m.source=r.indexOf(h.source),m.originalLine=h.originalLine,m.originalColumn=h.originalColumn,h.name&&(m.name=t.indexOf(h.name)),l.push(m)),a.push(m)}return f(n.__originalMappings,u.compareByOriginalPositions),n},o.prototype._version=3,Object.defineProperty(o.prototype,"sources",{get:function(){return this._sources.toArray().map(function(e){return null!=this.sourceRoot?u.join(this.sourceRoot,e):e},this)}}),o.prototype._parseMappings=function(e,n){for(var t,r,o,s,a,c=1,g=0,p=0,h=0,m=0,d=0,_=e.length,v=0,y={},b={},w=[],A=[];_>v;)if(";"===e.charAt(v))c++,v++,g=0;else if(","===e.charAt(v))v++;else{for(t=new i,t.generatedLine=c,s=v;_>s&&!this._charIsMappingSeparator(e,s);s++);if(r=e.slice(v,s),o=y[r])v+=r.length;else{for(o=[];s>v;)l.decode(e,v,b),a=b.value,v=b.rest,o.push(a);if(2===o.length)throw new Error("Found a source, but no line and column");if(3===o.length)throw new Error("Found a source and line, but no column");y[r]=o}t.generatedColumn=g+o[0],g=t.generatedColumn,o.length>1&&(t.source=m+o[1],m+=o[1],t.originalLine=p+o[2],p=t.originalLine,t.originalLine+=1,t.originalColumn=h+o[3],h=t.originalColumn,o.length>4&&(t.name=d+o[4],d+=o[4])),A.push(t),"number"==typeof t.originalLine&&w.push(t)}f(A,u.compareByGeneratedPositionsDeflated),this.__generatedMappings=A,f(w,u.compareByOriginalPositions),this.__originalMappings=w},o.prototype._findMapping=function(e,n,t,r,o,i){if(e[t]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[t]);if(e[r]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[r]);return a.search(e,n,o,i)},o.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var n=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var t=this._generatedMappings[e+1];if(n.generatedLine===t.generatedLine){n.lastGeneratedColumn=t.generatedColumn-1;continue}}n.lastGeneratedColumn=1/0}},o.prototype.originalPositionFor=function(e){var n={generatedLine:u.getArg(e,"line"),generatedColumn:u.getArg(e,"column")},t=this._findMapping(n,this._generatedMappings,"generatedLine","generatedColumn",u.compareByGeneratedPositionsDeflated,u.getArg(e,"bias",r.GREATEST_LOWER_BOUND));if(t>=0){var o=this._generatedMappings[t];if(o.generatedLine===n.generatedLine){var i=u.getArg(o,"source",null);null!==i&&(i=this._sources.at(i),null!=this.sourceRoot&&(i=u.join(this.sourceRoot,i)));var s=u.getArg(o,"name",null);return null!==s&&(s=this._names.at(s)),{source:i,line:u.getArg(o,"originalLine",null),column:u.getArg(o,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}},o.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}):!1},o.prototype.sourceContentFor=function(e,n){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=u.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var t;if(null!=this.sourceRoot&&(t=u.urlParse(this.sourceRoot))){var r=e.replace(/^file:\/\//,"");if("file"==t.scheme&&this._sources.has(r))return this.sourcesContent[this._sources.indexOf(r)];if((!t.path||"/"==t.path)&&this._sources.has("/"+e))return this.sourcesContent[this._sources.indexOf("/"+e)]}if(n)return null;throw new Error('"'+e+'" is not in the SourceMap.')},o.prototype.generatedPositionFor=function(e){var n=u.getArg(e,"source");if(null!=this.sourceRoot&&(n=u.relative(this.sourceRoot,n)),!this._sources.has(n))return{line:null,column:null,lastColumn:null};n=this._sources.indexOf(n);var t={source:n,originalLine:u.getArg(e,"line"),originalColumn:u.getArg(e,"column")},o=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",u.compareByOriginalPositions,u.getArg(e,"bias",r.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===t.source)return{line:u.getArg(i,"generatedLine",null),column:u.getArg(i,"generatedColumn",null),lastColumn:u.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},n.BasicSourceMapConsumer=o,s.prototype=Object.create(r.prototype),s.prototype.constructor=r,s.prototype._version=3,Object.defineProperty(s.prototype,"sources",{get:function(){for(var e=[],n=0;n<this._sections.length;n++)for(var t=0;t<this._sections[n].consumer.sources.length;t++)e.push(this._sections[n].consumer.sources[t]);return e}}),s.prototype.originalPositionFor=function(e){var n={generatedLine:u.getArg(e,"line"),generatedColumn:u.getArg(e,"column")},t=a.search(n,this._sections,function(e,n){var t=e.generatedLine-n.generatedOffset.generatedLine;return t?t:e.generatedColumn-n.generatedOffset.generatedColumn}),r=this._sections[t];return r?r.consumer.originalPositionFor({line:n.generatedLine-(r.generatedOffset.generatedLine-1),column:n.generatedColumn-(r.generatedOffset.generatedLine===n.generatedLine?r.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}},s.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})},s.prototype.sourceContentFor=function(e,n){for(var t=0;t<this._sections.length;t++){var r=this._sections[t],o=r.consumer.sourceContentFor(e,!0);if(o)return o}if(n)return null;throw new Error('"'+e+'" is not in the SourceMap.')},s.prototype.generatedPositionFor=function(e){for(var n=0;n<this._sections.length;n++){var t=this._sections[n];if(-1!==t.consumer.sources.indexOf(u.getArg(e,"source"))){var r=t.consumer.generatedPositionFor(e);if(r){var o={line:r.line+(t.generatedOffset.generatedLine-1),column:r.column+(t.generatedOffset.generatedLine===r.line?t.generatedOffset.generatedColumn-1:0)};return o}}}return{line:null,column:null}},s.prototype._parseMappings=function(e,n){this.__generatedMappings=[],this.__originalMappings=[];for(var t=0;t<this._sections.length;t++)for(var r=this._sections[t],o=r.consumer._generatedMappings,i=0;i<o.length;i++){var s=o[i],a=r.consumer._sources.at(s.source);null!==r.consumer.sourceRoot&&(a=u.join(r.consumer.sourceRoot,a)),this._sources.add(a),a=this._sources.indexOf(a);var c=r.consumer._names.at(s.name);this._names.add(c),c=this._names.indexOf(c);var l={source:a,generatedLine:s.generatedLine+(r.generatedOffset.generatedLine-1),generatedColumn:s.generatedColumn+(r.generatedOffset.generatedLine===s.generatedLine?r.generatedOffset.generatedColumn-1:0),originalLine:s.originalLine,originalColumn:s.originalColumn,name:c};this.__generatedMappings.push(l),"number"==typeof l.originalLine&&this.__originalMappings.push(l)}f(this.__generatedMappings,u.compareByGeneratedPositionsDeflated),f(this.__originalMappings,u.compareByOriginalPositions)},n.IndexedSourceMapConsumer=s},function(e,n){function t(e,n,t){if(n in e)return e[n];if(3===arguments.length)return t;throw new Error('"'+n+'" is a required argument.')}function r(e){var n=e.match(d);return n?{scheme:n[1],auth:n[2],host:n[3],port:n[4],path:n[5]}:null}function o(e){var n="";return e.scheme&&(n+=e.scheme+":"),n+="//",e.auth&&(n+=e.auth+"@"),e.host&&(n+=e.host),e.port&&(n+=":"+e.port),e.path&&(n+=e.path),n}function i(e){var t=e,i=r(e);if(i){if(!i.path)return e;t=i.path}for(var s,u=n.isAbsolute(t),a=t.split(/\/+/),c=0,l=a.length-1;l>=0;l--)s=a[l],"."===s?a.splice(l,1):".."===s?c++:c>0&&(""===s?(a.splice(l+1,c),c=0):(a.splice(l,2),c--));return t=a.join("/"),""===t&&(t=u?"/":"."),i?(i.path=t,o(i)):t}function s(e,n){""===e&&(e="."),""===n&&(n=".");var t=r(n),s=r(e);if(s&&(e=s.path||"/"),t&&!t.scheme)return s&&(t.scheme=s.scheme),o(t);if(t||n.match(_))return n;if(s&&!s.host&&!s.path)return s.host=n,o(s);var u="/"===n.charAt(0)?n:i(e.replace(/\/+$/,"")+"/"+n);return s?(s.path=u,o(s)):u}function u(e,n){""===e&&(e="."),e=e.replace(/\/$/,"");for(var t=0;0!==n.indexOf(e+"/");){var r=e.lastIndexOf("/");if(0>r)return n;if(e=e.slice(0,r),e.match(/^([^\/]+:\/)?\/*$/))return n;++t}return Array(t+1).join("../")+n.substr(e.length+1)}function a(e){return e}function c(e){return f(e)?"$"+e:e}function l(e){return f(e)?e.slice(1):e}function f(e){if(!e)return!1;var n=e.length;if(9>n)return!1;if(95!==e.charCodeAt(n-1)||95!==e.charCodeAt(n-2)||111!==e.charCodeAt(n-3)||116!==e.charCodeAt(n-4)||111!==e.charCodeAt(n-5)||114!==e.charCodeAt(n-6)||112!==e.charCodeAt(n-7)||95!==e.charCodeAt(n-8)||95!==e.charCodeAt(n-9))return!1;for(var t=n-10;t>=0;t--)if(36!==e.charCodeAt(t))return!1;return!0}function g(e,n,t){var r=e.source-n.source;return 0!==r?r:(r=e.originalLine-n.originalLine,0!==r?r:(r=e.originalColumn-n.originalColumn,0!==r||t?r:(r=e.generatedColumn-n.generatedColumn,0!==r?r:(r=e.generatedLine-n.generatedLine,0!==r?r:e.name-n.name))))}function p(e,n,t){var r=e.generatedLine-n.generatedLine;return 0!==r?r:(r=e.generatedColumn-n.generatedColumn,0!==r||t?r:(r=e.source-n.source,0!==r?r:(r=e.originalLine-n.originalLine,0!==r?r:(r=e.originalColumn-n.originalColumn,0!==r?r:e.name-n.name))))}function h(e,n){return e===n?0:e>n?1:-1}function m(e,n){var t=e.generatedLine-n.generatedLine;return 0!==t?t:(t=e.generatedColumn-n.generatedColumn,0!==t?t:(t=h(e.source,n.source),0!==t?t:(t=e.originalLine-n.originalLine,0!==t?t:(t=e.originalColumn-n.originalColumn,0!==t?t:h(e.name,n.name)))))}n.getArg=t;var d=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/,_=/^data:.+\,.+$/;n.urlParse=r,n.urlGenerate=o,n.normalize=i,n.join=s,n.isAbsolute=function(e){return"/"===e.charAt(0)||!!e.match(d)},n.relative=u;var v=function(){var e=Object.create(null);return!("__proto__"in e)}();n.toSetString=v?a:c,n.fromSetString=v?a:l,n.compareByOriginalPositions=g,n.compareByGeneratedPositionsDeflated=p,n.compareByGeneratedPositionsInflated=m},function(e,n){function t(e,r,o,i,s,u){var a=Math.floor((r-e)/2)+e,c=s(o,i[a],!0);return 0===c?a:c>0?r-a>1?t(a,r,o,i,s,u):u==n.LEAST_UPPER_BOUND?r<i.length?r:-1:a:a-e>1?t(e,a,o,i,s,u):u==n.LEAST_UPPER_BOUND?a:0>e?-1:e}n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.search=function(e,r,o,i){if(0===r.length)return-1;var s=t(-1,r.length,e,r,o,i||n.GREATEST_LOWER_BOUND);if(0>s)return-1;for(;s-1>=0&&0===o(r[s],r[s-1],!0);)--s;return s}},function(e,n,t){function r(){this._array=[],this._set=Object.create(null)}var o=t(1),i=Object.prototype.hasOwnProperty;r.fromArray=function(e,n){for(var t=new r,o=0,i=e.length;i>o;o++)t.add(e[o],n);return t},r.prototype.size=function(){return Object.getOwnPropertyNames(this._set).length},r.prototype.add=function(e,n){var t=o.toSetString(e),r=i.call(this._set,t),s=this._array.length;(!r||n)&&this._array.push(e),r||(this._set[t]=s)},r.prototype.has=function(e){var n=o.toSetString(e);return i.call(this._set,n)},r.prototype.indexOf=function(e){var n=o.toSetString(e);if(i.call(this._set,n))return this._set[n];throw new Error('"'+e+'" is not in the set.')},r.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},r.prototype.toArray=function(){return this._array.slice()},n.ArraySet=r},function(e,n,t){function r(e){return 0>e?(-e<<1)+1:(e<<1)+0}function o(e){var n=1===(1&e),t=e>>1;return n?-t:t}var i=t(5),s=5,u=1<<s,a=u-1,c=u;n.encode=function(e){var n,t="",o=r(e);do n=o&a,o>>>=s,o>0&&(n|=c),t+=i.encode(n);while(o>0);return t},n.decode=function(e,n,t){var r,u,l=e.length,f=0,g=0;do{if(n>=l)throw new Error("Expected more digits in base 64 VLQ value.");if(u=i.decode(e.charCodeAt(n++)),-1===u)throw new Error("Invalid base64 digit: "+e.charAt(n-1));r=!!(u&c),u&=a,f+=u<<g,g+=s}while(r);t.value=o(f),t.rest=n}},function(e,n){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");n.encode=function(e){if(e>=0&&e<t.length)return t[e];throw new TypeError("Must be between 0 and 63: "+e)},n.decode=function(e){var n=65,t=90,r=97,o=122,i=48,s=57,u=43,a=47,c=26,l=52;return e>=n&&t>=e?e-n:e>=r&&o>=e?e-r+c:e>=i&&s>=e?e-i+l:e==u?62:e==a?63:-1}},function(e,n){function t(e,n,t){var r=e[n];e[n]=e[t],e[t]=r}function r(e,n){return Math.round(e+Math.random()*(n-e))}function o(e,n,i,s){if(s>i){var u=r(i,s),a=i-1;t(e,u,s);for(var c=e[s],l=i;s>l;l++)n(e[l],c)<=0&&(a+=1,t(e,a,l));t(e,a+1,l);var f=a+1;o(e,n,i,f-1),o(e,n,f+1,s)}}n.quickSort=function(e,n){o(e,n,0,e.length-1)}}]);!function(e,n){"use strict";"function"==typeof define&&define.amd?define("stacktrace-gps",["source-map","stackframe"],n):"object"==typeof exports?module.exports=n(require("source-map/lib/source-map-consumer"),require("stackframe")):e.StackTraceGPS=n(e.SourceMap||e.sourceMap,e.StackFrame)}(this,function(e,n){"use strict";function t(e){return new Promise(function(n,t){var r=new XMLHttpRequest;r.open("get",e),r.onerror=t,r.onreadystatechange=function(){4===r.readyState&&(r.status>=200&&r.status<300?n(r.responseText):t(new Error("HTTP status: "+r.status+" retrieving "+e)))},r.send()})}function r(e){if("undefined"!=typeof window&&window.atob)return window.atob(e);throw new Error("You must supply a polyfill for window.atob in this environment")}function o(e){if("undefined"!=typeof JSON&&JSON.parse)return JSON.parse(e);throw new Error("You must supply a polyfill for JSON.parse in this environment")}function i(e,n){for(var t,r=/function\s+([^(]*?)\s*\(([^)]*)\)/,o=/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*function\b/,i=/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*(?:eval|new Function)\b/,s=e.split("\n"),u="",a=Math.min(n,20),c=0;a>c;++c){var l=s[n-c-1],f=l.indexOf("//");if(f>=0&&(l=l.substr(0,f)),l){if(u=l+u,t=o.exec(u),t&&t[1])return t[1];if(t=r.exec(u),t&&t[1])return t[1];if(t=i.exec(u),t&&t[1])return t[1]}}}function s(){if("function"!=typeof Object.defineProperty||"function"!=typeof Object.create)throw new Error("Unable to consume source maps in older browsers")}function u(e){if("object"!=typeof e)throw new TypeError("Given StackFrame is not an object");if("string"!=typeof e.fileName)throw new TypeError("Given file name is not a String");if("number"!=typeof e.lineNumber||e.lineNumber%1!==0||e.lineNumber<1)throw new TypeError("Given line number must be a positive integer");if("number"!=typeof e.columnNumber||e.columnNumber%1!==0||e.columnNumber<0)throw new TypeError("Given column number must be a non-negative integer");return!0}function a(e){var n=/\/\/[#@] ?sourceMappingURL=([^\s'"]+)\s*$/.exec(e);if(n&&n[1])return n[1];throw new Error("sourceMappingURL not found")}function c(t,r,o){return new Promise(function(i,s){var u=new e.SourceMapConsumer(r),a=u.originalPositionFor({line:t.lineNumber,column:t.columnNumber});if(a.source){var c=u.sourceContentFor(a.source);c&&(o[a.source]=c),i(new n(a.name||t.functionName,t.args,a.source,a.line,a.column))}else s(new Error("Could not get original source for given stackframe and source map"))})}return function l(e){return this instanceof l?(e=e||{},this.sourceCache=e.sourceCache||{},this.ajax=e.ajax||t,this._atob=e.atob||r,this._get=function(n){return new Promise(function(t,r){var o="data:"===n.substr(0,5);if(this.sourceCache[n])t(this.sourceCache[n]);else if(e.offline&&!o)r(new Error("Cannot make network requests in offline mode"));else if(o){var i=/^data:application\/json;([\w=:"-]+;)*base64,/,s=n.match(i);if(s){var u=s[0].length,a=n.substr(u),c=this._atob(a);this.sourceCache[n]=c,t(c)}else r(new Error("The encoding of the inline sourcemap is not supported"))}else{var l=this.ajax(n,{method:"get"});this.sourceCache[n]=l,l.then(t,r)}}.bind(this))},this.pinpoint=function(e){return new Promise(function(n,t){this.getMappedLocation(e).then(function(e){function t(){n(e)}this.findFunctionName(e).then(n,t)["catch"](t)}.bind(this),t)}.bind(this))},this.findFunctionName=function(e){return new Promise(function(t,r){u(e),this._get(e.fileName).then(function(r){var o=e.lineNumber,s=e.columnNumber,u=i(r,o,s);t(u?new n(u,e.args,e.fileName,o,s):e)},r)["catch"](r)}.bind(this))},void(this.getMappedLocation=function(e){return new Promise(function(n,t){s(),u(e);var r=this.sourceCache,i=e.fileName;this._get(i).then(function(s){var u=a(s),l="data:"===u.substr(0,5),f=i.substring(0,i.lastIndexOf("/")+1);"/"===u[0]||l||/^https?:\/\/|^\/\//i.test(u)||(u=f+u),this._get(u).then(function(t){"string"==typeof t&&(t=o(t.replace(/^\)\]\}'/,""))),"undefined"==typeof t.sourceRoot&&(t.sourceRoot=f),c(e,t,r).then(n)["catch"](function(){n(e)})},t)["catch"](t)}.bind(this),t)["catch"](t)}.bind(this))})):new l(e)}});
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):e.ES6Promise=n()}(this,function(){"use strict";function e(e){return"function"==typeof e||"object"==typeof e&&null!==e}function n(e){return"function"==typeof e}function t(e){W=e}function r(e){Z=e}function o(){return function(){return process.nextTick(c)}}function i(){return function(){J(c)}}function s(){var e=0,n=new K(c),t=document.createTextNode("");return n.observe(t,{characterData:!0}),function(){t.data=e=++e%2}}function u(){var e=new MessageChannel;return e.port1.onmessage=c,function(){return e.port2.postMessage(0)}}function a(){var e=setTimeout;return function(){return e(c,1)}}function c(){for(var e=0;e<z;e+=2){var n=X[e],t=X[e+1];n(t),X[e]=void 0,X[e+1]=void 0}z=0}function l(){try{var e=require,n=e("vertx");return J=n.runOnLoop||n.runOnContext,i()}catch(t){return a()}}function f(e,n){var t=arguments,r=this,o=new this.constructor(h);void 0===o[ne]&&j(o);var i=r._state;return i?!function(){var e=t[i-1];Z(function(){return N(i,o,e,r._result)})}():E(r,o,e,n),o}function p(e){var n=this;if(e&&"object"==typeof e&&e.constructor===n)return e;var t=new n(h);return b(t,e),t}function h(){}function g(){return new TypeError("You cannot resolve a promise with itself")}function m(){return new TypeError("A promises callback cannot return that same promise.")}function d(e){try{return e.then}catch(n){return ie.error=n,ie}}function _(e,n,t,r){try{e.call(n,t,r)}catch(o){return o}}function v(e,n,t){Z(function(e){var r=!1,o=_(t,n,function(t){r||(r=!0,n!==t?b(e,t):A(e,t))},function(n){r||(r=!0,O(e,n))},"Settle: "+(e._label||" unknown promise"));!r&&o&&(r=!0,O(e,o))},e)}function y(e,n){n._state===re?A(e,n._result):n._state===oe?O(e,n._result):E(n,void 0,function(n){return b(e,n)},function(n){return O(e,n)})}function w(e,t,r){t.constructor===e.constructor&&r===f&&t.constructor.resolve===p?y(e,t):r===ie?O(e,ie.error):void 0===r?A(e,t):n(r)?v(e,t,r):A(e,t)}function b(n,t){n===t?O(n,g()):e(t)?w(n,t,d(t)):A(n,t)}function C(e){e._onerror&&e._onerror(e._result),L(e)}function A(e,n){e._state===te&&(e._result=n,e._state=re,0!==e._subscribers.length&&Z(L,e))}function O(e,n){e._state===te&&(e._state=oe,e._result=n,Z(C,e))}function E(e,n,t,r){var o=e._subscribers,i=o.length;e._onerror=null,o[i]=n,o[i+re]=t,o[i+oe]=r,0===i&&e._state&&Z(L,e)}function L(e){var n=e._subscribers,t=e._state;if(0!==n.length){for(var r=void 0,o=void 0,i=e._result,s=0;s<n.length;s+=3)r=n[s],o=n[s+t],r?N(t,r,o,i):o(i);e._subscribers.length=0}}function M(){this.error=null}function S(e,n){try{return e(n)}catch(t){return se.error=t,se}}function N(e,t,r,o){var i=n(r),s=void 0,u=void 0,a=void 0,c=void 0;if(i){if(s=S(r,o),s===se?(c=!0,u=s.error,s=null):a=!0,t===s)return void O(t,m())}else s=o,a=!0;t._state!==te||(i&&a?b(t,s):c?O(t,u):e===re?A(t,s):e===oe&&O(t,s))}function P(e,n){try{n(function(n){b(e,n)},function(n){O(e,n)})}catch(t){O(e,t)}}function R(){return ue++}function j(e){e[ne]=ue++,e._state=void 0,e._result=void 0,e._subscribers=[]}function T(e,n){this._instanceConstructor=e,this.promise=new e(h),this.promise[ne]||j(this.promise),I(n)?(this._input=n,this.length=n.length,this._remaining=n.length,this._result=new Array(this.length),0===this.length?A(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&A(this.promise,this._result))):O(this.promise,x())}function x(){return new Error("Array Methods must be provided an Array")}function F(e){return new T(this,e).promise}function G(e){var n=this;return new n(I(e)?function(t,r){for(var o=e.length,i=0;i<o;i++)n.resolve(e[i]).then(t,r)}:function(e,n){return n(new TypeError("You must pass an array to race."))})}function B(e){var n=this,t=new n(h);return O(t,e),t}function D(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function U(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function k(e){this[ne]=R(),this._result=this._state=void 0,this._subscribers=[],h!==e&&("function"!=typeof e&&D(),this instanceof k?P(this,e):U())}function $(){var e=void 0;if("undefined"!=typeof global)e=global;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(n){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var r=null;try{r=Object.prototype.toString.call(t.resolve())}catch(n){}if("[object Promise]"===r&&!t.cast)return}e.Promise=k}var q=void 0;q=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var I=q,z=0,J=void 0,W=void 0,Z=function(e,n){X[z]=e,X[z+1]=n,z+=2,2===z&&(W?W(c):ee())},Y="undefined"!=typeof window?window:void 0,H=Y||{},K=H.MutationObserver||H.WebKitMutationObserver,Q="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),V="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,X=new Array(1e3),ee=void 0;ee=Q?o():K?s():V?u():void 0===Y&&"function"==typeof require?l():a();var ne=Math.random().toString(36).substring(16),te=void 0,re=1,oe=2,ie=new M,se=new M,ue=0;return T.prototype._enumerate=function(){for(var e=this.length,n=this._input,t=0;this._state===te&&t<e;t++)this._eachEntry(n[t],t)},T.prototype._eachEntry=function(e,n){var t=this._instanceConstructor,r=t.resolve;if(r===p){var o=d(e);if(o===f&&e._state!==te)this._settledAt(e._state,n,e._result);else if("function"!=typeof o)this._remaining--,this._result[n]=e;else if(t===k){var i=new t(h);w(i,e,o),this._willSettleAt(i,n)}else this._willSettleAt(new t(function(n){return n(e)}),n)}else this._willSettleAt(r(e),n)},T.prototype._settledAt=function(e,n,t){var r=this.promise;r._state===te&&(this._remaining--,e===oe?O(r,t):this._result[n]=t),0===this._remaining&&A(r,this._result)},T.prototype._willSettleAt=function(e,n){var t=this;E(e,void 0,function(e){return t._settledAt(re,n,e)},function(e){return t._settledAt(oe,n,e)})},k.all=F,k.race=G,k.resolve=p,k.reject=B,k._setScheduler=t,k._setAsap=r,k._asap=Z,k.prototype={constructor:k,then:f,"catch":function(e){return this.then(null,e)}},$(),k.polyfill=$,k.Promise=k,k}),function(){"undefined"==typeof Promise&&ES6Promise.polyfill()}(),function(e,n){"use strict";"function"==typeof define&&define.amd?define("stackframe",[],n):"object"==typeof exports?module.exports=n():e.StackFrame=n()}(this,function(){"use strict";function e(e){return!isNaN(parseFloat(e))&&isFinite(e)}function n(e){return e[0].toUpperCase()+e.substring(1)}function t(e){return function(){return this[e]}}function r(e){if(e instanceof Object)for(var t=o.concat(i.concat(s.concat(u))),r=0;r<t.length;r++)e.hasOwnProperty(t[r])&&void 0!==e[t[r]]&&this["set"+n(t[r])](e[t[r]])}var o=["isConstructor","isEval","isNative","isToplevel"],i=["columnNumber","lineNumber"],s=["fileName","functionName","source"],u=["args"];r.prototype={getArgs:function(){return this.args},setArgs:function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("Args must be an Array");this.args=e},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(e){if(e instanceof r)this.evalOrigin=e;else{if(!(e instanceof Object))throw new TypeError("Eval Origin must be an Object or StackFrame");this.evalOrigin=new r(e)}},toString:function(){var n=this.getFunctionName()||"{anonymous}",t="("+(this.getArgs()||[]).join(",")+")",r=this.getFileName()?"@"+this.getFileName():"",o=e(this.getLineNumber())?":"+this.getLineNumber():"",i=e(this.getColumnNumber())?":"+this.getColumnNumber():"";return n+t+r+o+i}};for(var a=0;a<o.length;a++)r.prototype["get"+n(o[a])]=t(o[a]),r.prototype["set"+n(o[a])]=function(e){return function(n){this[e]=Boolean(n)}}(o[a]);for(var c=0;c<i.length;c++)r.prototype["get"+n(i[c])]=t(i[c]),r.prototype["set"+n(i[c])]=function(n){return function(t){if(!e(t))throw new TypeError(n+" must be a Number");this[n]=Number(t)}}(i[c]);for(var l=0;l<s.length;l++)r.prototype["get"+n(s[l])]=t(s[l]),r.prototype["set"+n(s[l])]=function(e){return function(n){this[e]=String(n)}}(s[l]);return r});var SourceMap=function(e){function n(r){if(t[r])return t[r].exports;var o=t[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var t={};return n.m=e,n.c=t,n.p="",n(0)}([function(e,n,t){function r(e){var n=e;return"string"==typeof e&&(n=JSON.parse(e.replace(/^\)\]\}'/,""))),null!=n.sections?new s(n):new o(n)}function o(e){var n=e;"string"==typeof e&&(n=JSON.parse(e.replace(/^\)\]\}'/,"")));var t=u.getArg(n,"version"),r=u.getArg(n,"sources"),o=u.getArg(n,"names",[]),i=u.getArg(n,"sourceRoot",null),s=u.getArg(n,"sourcesContent",null),a=u.getArg(n,"mappings"),l=u.getArg(n,"file",null);if(t!=this._version)throw new Error("Unsupported version: "+t);r=r.map(String).map(u.normalize).map(function(e){return i&&u.isAbsolute(i)&&u.isAbsolute(e)?u.relative(i,e):e}),this._names=c.fromArray(o.map(String),!0),this._sources=c.fromArray(r,!0),this.sourceRoot=i,this.sourcesContent=s,this._mappings=a,this.file=l}function i(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function s(e){var n=e;"string"==typeof e&&(n=JSON.parse(e.replace(/^\)\]\}'/,"")));var t=u.getArg(n,"version"),o=u.getArg(n,"sections");if(t!=this._version)throw new Error("Unsupported version: "+t);this._sources=new c,this._names=new c;var i={line:-1,column:0};this._sections=o.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var n=u.getArg(e,"offset"),t=u.getArg(n,"line"),o=u.getArg(n,"column");if(t<i.line||t===i.line&&o<i.column)throw new Error("Section offsets must be ordered and non-overlapping.");return i=n,{generatedOffset:{generatedLine:t+1,generatedColumn:o+1},consumer:new r(u.getArg(e,"map"))}})}var u=t(1),a=t(2),c=t(3).ArraySet,l=t(4),f=t(6).quickSort;r.fromSourceMap=function(e){return o.fromSourceMap(e)},r.prototype._version=3,r.prototype.__generatedMappings=null,Object.defineProperty(r.prototype,"_generatedMappings",{get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),r.prototype.__originalMappings=null,Object.defineProperty(r.prototype,"_originalMappings",{get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),r.prototype._charIsMappingSeparator=function(e,n){var t=e.charAt(n);return";"===t||","===t},r.prototype._parseMappings=function(e,n){throw new Error("Subclasses must implement _parseMappings")},r.GENERATED_ORDER=1,r.ORIGINAL_ORDER=2,r.GREATEST_LOWER_BOUND=1,r.LEAST_UPPER_BOUND=2,r.prototype.eachMapping=function(e,n,t){var o,i=n||null,s=t||r.GENERATED_ORDER;switch(s){case r.GENERATED_ORDER:o=this._generatedMappings;break;case r.ORIGINAL_ORDER:o=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var a=this.sourceRoot;o.map(function(e){var n=null===e.source?null:this._sources.at(e.source);return null!=n&&null!=a&&(n=u.join(a,n)),{source:n,generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:null===e.name?null:this._names.at(e.name)}},this).forEach(e,i)},r.prototype.allGeneratedPositionsFor=function(e){var n=u.getArg(e,"line"),t={source:u.getArg(e,"source"),originalLine:n,originalColumn:u.getArg(e,"column",0)};if(null!=this.sourceRoot&&(t.source=u.relative(this.sourceRoot,t.source)),!this._sources.has(t.source))return[];t.source=this._sources.indexOf(t.source);var r=[],o=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",u.compareByOriginalPositions,a.LEAST_UPPER_BOUND);if(o>=0){var i=this._originalMappings[o];if(void 0===e.column)for(var s=i.originalLine;i&&i.originalLine===s;)r.push({line:u.getArg(i,"generatedLine",null),column:u.getArg(i,"generatedColumn",null),lastColumn:u.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o];else for(var c=i.originalColumn;i&&i.originalLine===n&&i.originalColumn==c;)r.push({line:u.getArg(i,"generatedLine",null),column:u.getArg(i,"generatedColumn",null),lastColumn:u.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o]}return r},n.SourceMapConsumer=r,o.prototype=Object.create(r.prototype),o.prototype.consumer=r,o.fromSourceMap=function(e){var n=Object.create(o.prototype),t=n._names=c.fromArray(e._names.toArray(),!0),r=n._sources=c.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file;for(var s=e._mappings.toArray().slice(),a=n.__generatedMappings=[],l=n.__originalMappings=[],p=0,h=s.length;p<h;p++){var g=s[p],m=new i;m.generatedLine=g.generatedLine,m.generatedColumn=g.generatedColumn,g.source&&(m.source=r.indexOf(g.source),m.originalLine=g.originalLine,m.originalColumn=g.originalColumn,g.name&&(m.name=t.indexOf(g.name)),l.push(m)),a.push(m)}return f(n.__originalMappings,u.compareByOriginalPositions),n},o.prototype._version=3,Object.defineProperty(o.prototype,"sources",{get:function(){return this._sources.toArray().map(function(e){return null!=this.sourceRoot?u.join(this.sourceRoot,e):e},this)}}),o.prototype._parseMappings=function(e,n){for(var t,r,o,s,a,c=1,p=0,h=0,g=0,m=0,d=0,_=e.length,v=0,y={},w={},b=[],C=[];v<_;)if(";"===e.charAt(v))c++,v++,p=0;else if(","===e.charAt(v))v++;else{for(t=new i,t.generatedLine=c,s=v;s<_&&!this._charIsMappingSeparator(e,s);s++);if(r=e.slice(v,s),o=y[r])v+=r.length;else{for(o=[];v<s;)l.decode(e,v,w),a=w.value,v=w.rest,o.push(a);if(2===o.length)throw new Error("Found a source, but no line and column");if(3===o.length)throw new Error("Found a source and line, but no column");y[r]=o}t.generatedColumn=p+o[0],p=t.generatedColumn,o.length>1&&(t.source=m+o[1],m+=o[1],t.originalLine=h+o[2],h=t.originalLine,t.originalLine+=1,t.originalColumn=g+o[3],g=t.originalColumn,o.length>4&&(t.name=d+o[4],d+=o[4])),C.push(t),"number"==typeof t.originalLine&&b.push(t)}f(C,u.compareByGeneratedPositionsDeflated),this.__generatedMappings=C,f(b,u.compareByOriginalPositions),this.__originalMappings=b},o.prototype._findMapping=function(e,n,t,r,o,i){if(e[t]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[t]);if(e[r]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[r]);return a.search(e,n,o,i)},o.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var n=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var t=this._generatedMappings[e+1];if(n.generatedLine===t.generatedLine){n.lastGeneratedColumn=t.generatedColumn-1;continue}}n.lastGeneratedColumn=1/0}},o.prototype.originalPositionFor=function(e){var n={generatedLine:u.getArg(e,"line"),generatedColumn:u.getArg(e,"column")},t=this._findMapping(n,this._generatedMappings,"generatedLine","generatedColumn",u.compareByGeneratedPositionsDeflated,u.getArg(e,"bias",r.GREATEST_LOWER_BOUND));if(t>=0){var o=this._generatedMappings[t];if(o.generatedLine===n.generatedLine){var i=u.getArg(o,"source",null);null!==i&&(i=this._sources.at(i),null!=this.sourceRoot&&(i=u.join(this.sourceRoot,i)));var s=u.getArg(o,"name",null);return null!==s&&(s=this._names.at(s)),{source:i,line:u.getArg(o,"originalLine",null),column:u.getArg(o,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}},o.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},o.prototype.sourceContentFor=function(e,n){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=u.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var t;if(null!=this.sourceRoot&&(t=u.urlParse(this.sourceRoot))){var r=e.replace(/^file:\/\//,"");if("file"==t.scheme&&this._sources.has(r))return this.sourcesContent[this._sources.indexOf(r)];if((!t.path||"/"==t.path)&&this._sources.has("/"+e))return this.sourcesContent[this._sources.indexOf("/"+e)]}if(n)return null;throw new Error('"'+e+'" is not in the SourceMap.')},o.prototype.generatedPositionFor=function(e){var n=u.getArg(e,"source");if(null!=this.sourceRoot&&(n=u.relative(this.sourceRoot,n)),!this._sources.has(n))return{line:null,column:null,lastColumn:null};n=this._sources.indexOf(n);var t={source:n,originalLine:u.getArg(e,"line"),originalColumn:u.getArg(e,"column")},o=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",u.compareByOriginalPositions,u.getArg(e,"bias",r.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===t.source)return{line:u.getArg(i,"generatedLine",null),column:u.getArg(i,"generatedColumn",null),lastColumn:u.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},n.BasicSourceMapConsumer=o,s.prototype=Object.create(r.prototype),s.prototype.constructor=r,s.prototype._version=3,Object.defineProperty(s.prototype,"sources",{get:function(){for(var e=[],n=0;n<this._sections.length;n++)for(var t=0;t<this._sections[n].consumer.sources.length;t++)e.push(this._sections[n].consumer.sources[t]);return e}}),s.prototype.originalPositionFor=function(e){var n={generatedLine:u.getArg(e,"line"),generatedColumn:u.getArg(e,"column")},t=a.search(n,this._sections,function(e,n){var t=e.generatedLine-n.generatedOffset.generatedLine;return t?t:e.generatedColumn-n.generatedOffset.generatedColumn}),r=this._sections[t];return r?r.consumer.originalPositionFor({line:n.generatedLine-(r.generatedOffset.generatedLine-1),column:n.generatedColumn-(r.generatedOffset.generatedLine===n.generatedLine?r.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}},s.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})},s.prototype.sourceContentFor=function(e,n){for(var t=0;t<this._sections.length;t++){var r=this._sections[t],o=r.consumer.sourceContentFor(e,!0);if(o)return o}if(n)return null;throw new Error('"'+e+'" is not in the SourceMap.')},s.prototype.generatedPositionFor=function(e){for(var n=0;n<this._sections.length;n++){var t=this._sections[n];if(t.consumer.sources.indexOf(u.getArg(e,"source"))!==-1){var r=t.consumer.generatedPositionFor(e);if(r){var o={line:r.line+(t.generatedOffset.generatedLine-1),column:r.column+(t.generatedOffset.generatedLine===r.line?t.generatedOffset.generatedColumn-1:0)};return o}}}return{line:null,column:null}},s.prototype._parseMappings=function(e,n){this.__generatedMappings=[],this.__originalMappings=[];for(var t=0;t<this._sections.length;t++)for(var r=this._sections[t],o=r.consumer._generatedMappings,i=0;i<o.length;i++){var s=o[i],a=r.consumer._sources.at(s.source);null!==r.consumer.sourceRoot&&(a=u.join(r.consumer.sourceRoot,a)),this._sources.add(a),a=this._sources.indexOf(a);var c=r.consumer._names.at(s.name);this._names.add(c),c=this._names.indexOf(c);var l={source:a,generatedLine:s.generatedLine+(r.generatedOffset.generatedLine-1),generatedColumn:s.generatedColumn+(r.generatedOffset.generatedLine===s.generatedLine?r.generatedOffset.generatedColumn-1:0),originalLine:s.originalLine,originalColumn:s.originalColumn,name:c};this.__generatedMappings.push(l),"number"==typeof l.originalLine&&this.__originalMappings.push(l)}f(this.__generatedMappings,u.compareByGeneratedPositionsDeflated),f(this.__originalMappings,u.compareByOriginalPositions)},n.IndexedSourceMapConsumer=s},function(e,n){function t(e,n,t){if(n in e)return e[n];if(3===arguments.length)return t;throw new Error('"'+n+'" is a required argument.')}function r(e){var n=e.match(d);return n?{scheme:n[1],auth:n[2],host:n[3],port:n[4],path:n[5]}:null}function o(e){var n="";return e.scheme&&(n+=e.scheme+":"),n+="//",e.auth&&(n+=e.auth+"@"),e.host&&(n+=e.host),e.port&&(n+=":"+e.port),e.path&&(n+=e.path),n}function i(e){var t=e,i=r(e);if(i){if(!i.path)return e;t=i.path}for(var s,u=n.isAbsolute(t),a=t.split(/\/+/),c=0,l=a.length-1;l>=0;l--)s=a[l],"."===s?a.splice(l,1):".."===s?c++:c>0&&(""===s?(a.splice(l+1,c),c=0):(a.splice(l,2),c--));return t=a.join("/"),""===t&&(t=u?"/":"."),i?(i.path=t,o(i)):t}function s(e,n){""===e&&(e="."),""===n&&(n=".");var t=r(n),s=r(e);if(s&&(e=s.path||"/"),t&&!t.scheme)return s&&(t.scheme=s.scheme),o(t);if(t||n.match(_))return n;if(s&&!s.host&&!s.path)return s.host=n,o(s);var u="/"===n.charAt(0)?n:i(e.replace(/\/+$/,"")+"/"+n);return s?(s.path=u,o(s)):u}function u(e,n){""===e&&(e="."),e=e.replace(/\/$/,"");for(var t=0;0!==n.indexOf(e+"/");){var r=e.lastIndexOf("/");if(r<0)return n;if(e=e.slice(0,r),e.match(/^([^\/]+:\/)?\/*$/))return n;++t}return Array(t+1).join("../")+n.substr(e.length+1)}function a(e){return e}function c(e){return f(e)?"$"+e:e}function l(e){return f(e)?e.slice(1):e}function f(e){if(!e)return!1;var n=e.length;if(n<9)return!1;if(95!==e.charCodeAt(n-1)||95!==e.charCodeAt(n-2)||111!==e.charCodeAt(n-3)||116!==e.charCodeAt(n-4)||111!==e.charCodeAt(n-5)||114!==e.charCodeAt(n-6)||112!==e.charCodeAt(n-7)||95!==e.charCodeAt(n-8)||95!==e.charCodeAt(n-9))return!1;for(var t=n-10;t>=0;t--)if(36!==e.charCodeAt(t))return!1;return!0}function p(e,n,t){var r=e.source-n.source;return 0!==r?r:(r=e.originalLine-n.originalLine,0!==r?r:(r=e.originalColumn-n.originalColumn,0!==r||t?r:(r=e.generatedColumn-n.generatedColumn,0!==r?r:(r=e.generatedLine-n.generatedLine,0!==r?r:e.name-n.name))))}function h(e,n,t){var r=e.generatedLine-n.generatedLine;return 0!==r?r:(r=e.generatedColumn-n.generatedColumn,0!==r||t?r:(r=e.source-n.source,0!==r?r:(r=e.originalLine-n.originalLine,0!==r?r:(r=e.originalColumn-n.originalColumn,0!==r?r:e.name-n.name))))}function g(e,n){return e===n?0:e>n?1:-1}function m(e,n){var t=e.generatedLine-n.generatedLine;return 0!==t?t:(t=e.generatedColumn-n.generatedColumn,0!==t?t:(t=g(e.source,n.source),0!==t?t:(t=e.originalLine-n.originalLine,0!==t?t:(t=e.originalColumn-n.originalColumn,0!==t?t:g(e.name,n.name)))))}n.getArg=t;var d=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/,_=/^data:.+\,.+$/;n.urlParse=r,n.urlGenerate=o,n.normalize=i,n.join=s,n.isAbsolute=function(e){return"/"===e.charAt(0)||!!e.match(d)},n.relative=u;var v=function(){var e=Object.create(null);return!("__proto__"in e)}();n.toSetString=v?a:c,n.fromSetString=v?a:l,n.compareByOriginalPositions=p,n.compareByGeneratedPositionsDeflated=h,n.compareByGeneratedPositionsInflated=m},function(e,n){function t(e,r,o,i,s,u){var a=Math.floor((r-e)/2)+e,c=s(o,i[a],!0);return 0===c?a:c>0?r-a>1?t(a,r,o,i,s,u):u==n.LEAST_UPPER_BOUND?r<i.length?r:-1:a:a-e>1?t(e,a,o,i,s,u):u==n.LEAST_UPPER_BOUND?a:e<0?-1:e}n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.search=function(e,r,o,i){if(0===r.length)return-1;var s=t(-1,r.length,e,r,o,i||n.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&0===o(r[s],r[s-1],!0);)--s;return s}},function(e,n,t){function r(){this._array=[],this._set=Object.create(null)}var o=t(1),i=Object.prototype.hasOwnProperty;r.fromArray=function(e,n){for(var t=new r,o=0,i=e.length;o<i;o++)t.add(e[o],n);return t},r.prototype.size=function(){return Object.getOwnPropertyNames(this._set).length},r.prototype.add=function(e,n){var t=o.toSetString(e),r=i.call(this._set,t),s=this._array.length;r&&!n||this._array.push(e),r||(this._set[t]=s)},r.prototype.has=function(e){var n=o.toSetString(e);return i.call(this._set,n)},r.prototype.indexOf=function(e){var n=o.toSetString(e);if(i.call(this._set,n))return this._set[n];throw new Error('"'+e+'" is not in the set.')},r.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},r.prototype.toArray=function(){return this._array.slice()},n.ArraySet=r},function(e,n,t){function r(e){return e<0?(-e<<1)+1:(e<<1)+0}function o(e){var n=1===(1&e),t=e>>1;return n?-t:t}var i=t(5),s=5,u=1<<s,a=u-1,c=u;n.encode=function(e){var n,t="",o=r(e);do n=o&a,o>>>=s,o>0&&(n|=c),t+=i.encode(n);while(o>0);return t},n.decode=function(e,n,t){var r,u,l=e.length,f=0,p=0;do{if(n>=l)throw new Error("Expected more digits in base 64 VLQ value.");if(u=i.decode(e.charCodeAt(n++)),u===-1)throw new Error("Invalid base64 digit: "+e.charAt(n-1));r=!!(u&c),u&=a,f+=u<<p,p+=s}while(r);t.value=o(f),t.rest=n}},function(e,n){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");n.encode=function(e){if(0<=e&&e<t.length)return t[e];throw new TypeError("Must be between 0 and 63: "+e)},n.decode=function(e){var n=65,t=90,r=97,o=122,i=48,s=57,u=43,a=47,c=26,l=52;return n<=e&&e<=t?e-n:r<=e&&e<=o?e-r+c:i<=e&&e<=s?e-i+l:e==u?62:e==a?63:-1}},function(e,n){function t(e,n,t){var r=e[n];e[n]=e[t],e[t]=r}function r(e,n){return Math.round(e+Math.random()*(n-e))}function o(e,n,i,s){if(i<s){var u=r(i,s),a=i-1;t(e,u,s);for(var c=e[s],l=i;l<s;l++)n(e[l],c)<=0&&(a+=1,t(e,a,l));t(e,a+1,l);var f=a+1;o(e,n,i,f-1),o(e,n,f+1,s)}}n.quickSort=function(e,n){o(e,n,0,e.length-1)}}]);!function(e,n){"use strict";"function"==typeof define&&define.amd?define("stacktrace-gps",["source-map","stackframe"],n):"object"==typeof exports?module.exports=n(require("source-map/lib/source-map-consumer"),require("stackframe")):e.StackTraceGPS=n(e.SourceMap||e.sourceMap,e.StackFrame)}(this,function(e,n){"use strict";function t(e){return new Promise(function(n,t){var r=new XMLHttpRequest;r.open("get",e),r.onerror=t,r.onreadystatechange=function(){4===r.readyState&&(r.status>=200&&r.status<300||"file://"===e.substr(0,7)&&r.responseText?n(r.responseText):t(new Error("HTTP status: "+r.status+" retrieving "+e)))},r.send()})}function r(e){if("undefined"!=typeof window&&window.atob)return window.atob(e);throw new Error("You must supply a polyfill for window.atob in this environment")}function o(e){if("undefined"!=typeof JSON&&JSON.parse)return JSON.parse(e);throw new Error("You must supply a polyfill for JSON.parse in this environment")}function i(e,n){for(var t=[/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*function\b/,/function\s+([^('"`]*?)\s*\(([^)]*)\)/,/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*(?:eval|new Function)\b/,/\b(?!(?:if|for|switch|while|with|catch)\b)(?:(?:static)\s+)?(\S+)\s*\(.*?\)\s*\{/,/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*\(.*?\)\s*=>/],r=e.split("\n"),o="",i=Math.min(n,20),s=0;s<i;++s){var u=r[n-s-1],a=u.indexOf("//");if(a>=0&&(u=u.substr(0,a)),u){o=u+o;for(var c=t.length,l=0;l<c;l++){var f=t[l].exec(o);if(f&&f[1])return f[1]}}}}function s(){if("function"!=typeof Object.defineProperty||"function"!=typeof Object.create)throw new Error("Unable to consume source maps in older browsers")}function u(e){if("object"!=typeof e)throw new TypeError("Given StackFrame is not an object");if("string"!=typeof e.fileName)throw new TypeError("Given file name is not a String");if("number"!=typeof e.lineNumber||e.lineNumber%1!==0||e.lineNumber<1)throw new TypeError("Given line number must be a positive integer");if("number"!=typeof e.columnNumber||e.columnNumber%1!==0||e.columnNumber<0)throw new TypeError("Given column number must be a non-negative integer");return!0}function a(e){var n=/\/\/[#@] ?sourceMappingURL=([^\s'"]+)\s*$/m.exec(e);if(n&&n[1])return n[1];throw new Error("sourceMappingURL not found")}function c(e,t,r){return new Promise(function(o,i){var s=t.originalPositionFor({line:e.lineNumber,column:e.columnNumber});if(s.source){var u=t.sourceContentFor(s.source);u&&(r[s.source]=u),o(new n({functionName:s.name||e.functionName,args:e.args,fileName:s.source,lineNumber:s.line,columnNumber:s.column}))}else i(new Error("Could not get original source for given stackframe and source map"))})}return function l(f){return this instanceof l?(f=f||{},this.sourceCache=f.sourceCache||{},this.sourceMapConsumerCache=f.sourceMapConsumerCache||{},this.ajax=f.ajax||t,this._atob=f.atob||r,this._get=function(e){return new Promise(function(n,t){var r="data:"===e.substr(0,5);if(this.sourceCache[e])n(this.sourceCache[e]);else if(f.offline&&!r)t(new Error("Cannot make network requests in offline mode"));else if(r){var o=/^data:application\/json;([\w=:"-]+;)*base64,/,i=e.match(o);if(i){var s=i[0].length,u=e.substr(s),a=this._atob(u);this.sourceCache[e]=a,n(a)}else t(new Error("The encoding of the inline sourcemap is not supported"))}else{var c=this.ajax(e,{method:"get"});this.sourceCache[e]=c,c.then(n,t)}}.bind(this))},this._getSourceMapConsumer=function(n,t){return new Promise(function(r,i){if(this.sourceMapConsumerCache[n])r(this.sourceMapConsumerCache[n]);else{var s=new Promise(function(r,i){return this._get(n).then(function(n){"string"==typeof n&&(n=o(n.replace(/^\)\]\}'/,""))),"undefined"==typeof n.sourceRoot&&(n.sourceRoot=t),r(new e.SourceMapConsumer(n))},i)}.bind(this));this.sourceMapConsumerCache[n]=s,r(s)}}.bind(this))},this.pinpoint=function(e){return new Promise(function(n,t){this.getMappedLocation(e).then(function(e){function t(){n(e)}this.findFunctionName(e).then(n,t)["catch"](t)}.bind(this),t)}.bind(this))},this.findFunctionName=function(e){return new Promise(function(t,r){u(e),this._get(e.fileName).then(function(r){var o=e.lineNumber,s=e.columnNumber,u=i(r,o,s);t(u?new n({functionName:u,args:e.args,fileName:e.fileName,lineNumber:o,columnNumber:s}):e)},r)["catch"](r)}.bind(this))},void(this.getMappedLocation=function(e){return new Promise(function(n,t){s(),u(e);var r=this.sourceCache,o=e.fileName;this._get(o).then(function(t){var i=a(t),s="data:"===i.substr(0,5),u=o.substring(0,o.lastIndexOf("/")+1);return"/"===i[0]||s||/^https?:\/\/|^\/\//i.test(i)||(i=u+i),this._getSourceMapConsumer(i,u).then(function(t){return c(e,t,r).then(n)["catch"](function(){n(e)})})}.bind(this),t)["catch"](t)}.bind(this))})):new l(f)}});
//# sourceMappingURL=stacktrace-gps-with-polyfills.min.js.map

@@ -29,3 +29,4 @@ (function(root, factory) {

if (req.readyState === 4) {
if (req.status >= 200 && req.status < 300) {
if ((req.status >= 200 && req.status < 300) ||
(url.substr(0, 7) === 'file://' && req.responseText)) {
resolve(req.responseText);

@@ -66,8 +67,14 @@ } else {

function _findFunctionName(source, lineNumber/*, columnNumber*/) {
// function {name}({args}) m[1]=name m[2]=args
var reFunctionDeclaration = /function\s+([^(]*?)\s*\(([^)]*)\)/;
// {name} = function ({args}) TODO args capture
var reFunctionExpression = /['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*function\b/;
// {name} = eval()
var reFunctionEvaluation = /['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*(?:eval|new Function)\b/;
var syntaxes = [
// {name} = function ({args}) TODO args capture
/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*function\b/,
// function {name}({args}) m[1]=name m[2]=args
/function\s+([^('"`]*?)\s*\(([^)]*)\)/,
// {name} = eval()
/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*(?:eval|new Function)\b/,
// fn_name() {
/\b(?!(?:if|for|switch|while|with|catch)\b)(?:(?:static)\s+)?(\S+)\s*\(.*?\)\s*\{/,
// {name} = () => {
/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*\(.*?\)\s*=>/
];
var lines = source.split('\n');

@@ -78,3 +85,2 @@

var maxLines = Math.min(lineNumber, 20);
var m;
for (var i = 0; i < maxLines; ++i) {

@@ -90,14 +96,9 @@ // lineNo is 1-based, source[] is 0-based

code = line + code;
m = reFunctionExpression.exec(code);
if (m && m[1]) {
return m[1];
var len = syntaxes.length;
for (var index = 0; index < len; index++) {
var m = syntaxes[index].exec(code);
if (m && m[1]) {
return m[1];
}
}
m = reFunctionDeclaration.exec(code);
if (m && m[1]) {
return m[1];
}
m = reFunctionEvaluation.exec(code);
if (m && m[1]) {
return m[1];
}
}

@@ -132,3 +133,3 @@ }

function _findSourceMappingURL(source) {
var m = /\/\/[#@] ?sourceMappingURL=([^\s'"]+)\s*$/.exec(source);
var m = /\/\/[#@] ?sourceMappingURL=([^\s'"]+)\s*$/m.exec(source);
if (m && m[1]) {

@@ -141,7 +142,5 @@ return m[1];

function _extractLocationInfoFromSourceMap(stackframe, rawSourceMap, sourceCache) {
function _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache) {
return new Promise(function(resolve, reject) {
var mapConsumer = new SourceMap.SourceMapConsumer(rawSourceMap);
var loc = mapConsumer.originalPositionFor({
var loc = sourceMapConsumer.originalPositionFor({
line: stackframe.lineNumber,

@@ -152,13 +151,17 @@ column: stackframe.columnNumber

if (loc.source) {
var mappedSource = mapConsumer.sourceContentFor(loc.source);
// cache mapped sources
var mappedSource = sourceMapConsumer.sourceContentFor(loc.source);
if (mappedSource) {
sourceCache[loc.source] = mappedSource;
}
resolve(
new StackFrame(
loc.name || stackframe.functionName,
stackframe.args,
loc.source,
loc.line,
loc.column));
// given stackframe and source location, update stackframe
new StackFrame({
functionName: loc.name || stackframe.functionName,
args: stackframe.args,
fileName: loc.source,
lineNumber: loc.line,
columnNumber: loc.column
}));
} else {

@@ -174,2 +177,3 @@ reject(new Error('Could not get original source for given stackframe and source map'));

* opts.sourceCache = {url: "Source String"} => preload source cache
* opts.sourceMapConsumerCache = {/path/file.js.map: SourceMapConsumer}
* opts.offline = True to prevent network requests.

@@ -186,2 +190,3 @@ * Best effort without sources or source maps.

this.sourceCache = opts.sourceCache || {};
this.sourceMapConsumerCache = opts.sourceMapConsumerCache || {};

@@ -226,2 +231,33 @@ this.ajax = opts.ajax || _xdr;

/**
* Creating SourceMapConsumers is expensive, so this wraps the creation of a
* SourceMapConsumer in a per-instance cache.
*
* @param sourceMappingURL = {String} URL to fetch source map from
* @param defaultSourceRoot = Default source root for source map if undefined
* @returns {Promise} that resolves a SourceMapConsumer
*/
this._getSourceMapConsumer = function _getSourceMapConsumer(sourceMappingURL, defaultSourceRoot) {
return new Promise(function(resolve, reject) {
if (this.sourceMapConsumerCache[sourceMappingURL]) {
resolve(this.sourceMapConsumerCache[sourceMappingURL]);
} else {
var sourceMapConsumerPromise = new Promise(function(resolve, reject) {
return this._get(sourceMappingURL).then(function(sourceMapSource) {
if (typeof sourceMapSource === 'string') {
sourceMapSource = _parseJson(sourceMapSource.replace(/^\)\]\}'/, ''));
}
if (typeof sourceMapSource.sourceRoot === 'undefined') {
sourceMapSource.sourceRoot = defaultSourceRoot;
}
resolve(new SourceMap.SourceMapConsumer(sourceMapSource));
}, reject);
}.bind(this));
this.sourceMapConsumerCache[sourceMappingURL] = sourceMapConsumerPromise;
resolve(sourceMapConsumerPromise);
}
}.bind(this));
};
/**
* Given a StackFrame, enhance function name and use source maps for a

@@ -262,7 +298,9 @@ * better StackFrame.

if (guessedFunctionName) {
resolve(new StackFrame(guessedFunctionName,
stackframe.args,
stackframe.fileName,
lineNumber,
columnNumber));
resolve(new StackFrame({
functionName: guessedFunctionName,
args: stackframe.args,
fileName: stackframe.fileName,
lineNumber: lineNumber,
columnNumber: columnNumber
}));
} else {

@@ -291,21 +329,14 @@ resolve(stackframe);

var isDataUrl = sourceMappingURL.substr(0, 5) === 'data:';
var base = fileName.substring(0, fileName.lastIndexOf('/') + 1);
var defaultSourceRoot = fileName.substring(0, fileName.lastIndexOf('/') + 1);
if (sourceMappingURL[0] !== '/' && !isDataUrl && !(/^https?:\/\/|^\/\//i).test(sourceMappingURL)) {
sourceMappingURL = base + sourceMappingURL;
sourceMappingURL = defaultSourceRoot + sourceMappingURL;
}
this._get(sourceMappingURL).then(function(sourceMap) {
if (typeof sourceMap === 'string') {
sourceMap = _parseJson(sourceMap.replace(/^\)\]\}'/, ''));
}
if (typeof sourceMap.sourceRoot === 'undefined') {
sourceMap.sourceRoot = base;
}
_extractLocationInfoFromSourceMap(stackframe, sourceMap, sourceCache)
return this._getSourceMapConsumer(sourceMappingURL, defaultSourceRoot).then(function(sourceMapConsumer) {
return _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache)
.then(resolve)['catch'](function() {
resolve(stackframe);
});
}, reject)['catch'](reject);
});
}.bind(this), reject)['catch'](reject);

@@ -312,0 +343,0 @@ }.bind(this));

@@ -1,2 +0,2 @@

!function(e,n){"use strict";"function"==typeof define&&define.amd?define("stackframe",[],n):"object"==typeof exports?module.exports=n():e.StackFrame=n()}(this,function(){"use strict";function e(e){return!isNaN(parseFloat(e))&&isFinite(e)}function n(e,n,r,t,o,i){void 0!==e&&this.setFunctionName(e),void 0!==n&&this.setArgs(n),void 0!==r&&this.setFileName(r),void 0!==t&&this.setLineNumber(t),void 0!==o&&this.setColumnNumber(o),void 0!==i&&this.setSource(i)}return n.prototype={getFunctionName:function(){return this.functionName},setFunctionName:function(e){this.functionName=String(e)},getArgs:function(){return this.args},setArgs:function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("Args must be an Array");this.args=e},getFileName:function(){return this.fileName},setFileName:function(e){this.fileName=String(e)},getLineNumber:function(){return this.lineNumber},setLineNumber:function(n){if(!e(n))throw new TypeError("Line Number must be a Number");this.lineNumber=Number(n)},getColumnNumber:function(){return this.columnNumber},setColumnNumber:function(n){if(!e(n))throw new TypeError("Column Number must be a Number");this.columnNumber=Number(n)},getSource:function(){return this.source},setSource:function(e){this.source=String(e)},toString:function(){var n=this.getFunctionName()||"{anonymous}",r="("+(this.getArgs()||[]).join(",")+")",t=this.getFileName()?"@"+this.getFileName():"",o=e(this.getLineNumber())?":"+this.getLineNumber():"",i=e(this.getColumnNumber())?":"+this.getColumnNumber():"";return n+r+t+o+i}},n});var SourceMap=function(e){function n(t){if(r[t])return r[t].exports;var o=r[t]={exports:{},id:t,loaded:!1};return e[t].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var r={};return n.m=e,n.c=r,n.p="",n(0)}([function(e,n,r){function t(e){var n=e;return"string"==typeof e&&(n=JSON.parse(e.replace(/^\)\]\}'/,""))),null!=n.sections?new s(n):new o(n)}function o(e){var n=e;"string"==typeof e&&(n=JSON.parse(e.replace(/^\)\]\}'/,"")));var r=a.getArg(n,"version"),t=a.getArg(n,"sources"),o=a.getArg(n,"names",[]),i=a.getArg(n,"sourceRoot",null),s=a.getArg(n,"sourcesContent",null),u=a.getArg(n,"mappings"),l=a.getArg(n,"file",null);if(r!=this._version)throw new Error("Unsupported version: "+r);t=t.map(String).map(a.normalize).map(function(e){return i&&a.isAbsolute(i)&&a.isAbsolute(e)?a.relative(i,e):e}),this._names=c.fromArray(o.map(String),!0),this._sources=c.fromArray(t,!0),this.sourceRoot=i,this.sourcesContent=s,this._mappings=u,this.file=l}function i(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function s(e){var n=e;"string"==typeof e&&(n=JSON.parse(e.replace(/^\)\]\}'/,"")));var r=a.getArg(n,"version"),o=a.getArg(n,"sections");if(r!=this._version)throw new Error("Unsupported version: "+r);this._sources=new c,this._names=new c;var i={line:-1,column:0};this._sections=o.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var n=a.getArg(e,"offset"),r=a.getArg(n,"line"),o=a.getArg(n,"column");if(r<i.line||r===i.line&&o<i.column)throw new Error("Section offsets must be ordered and non-overlapping.");return i=n,{generatedOffset:{generatedLine:r+1,generatedColumn:o+1},consumer:new t(a.getArg(e,"map"))}})}var a=r(1),u=r(2),c=r(3).ArraySet,l=r(4),g=r(6).quickSort;t.fromSourceMap=function(e){return o.fromSourceMap(e)},t.prototype._version=3,t.prototype.__generatedMappings=null,Object.defineProperty(t.prototype,"_generatedMappings",{get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),t.prototype.__originalMappings=null,Object.defineProperty(t.prototype,"_originalMappings",{get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),t.prototype._charIsMappingSeparator=function(e,n){var r=e.charAt(n);return";"===r||","===r},t.prototype._parseMappings=function(e,n){throw new Error("Subclasses must implement _parseMappings")},t.GENERATED_ORDER=1,t.ORIGINAL_ORDER=2,t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2,t.prototype.eachMapping=function(e,n,r){var o,i=n||null,s=r||t.GENERATED_ORDER;switch(s){case t.GENERATED_ORDER:o=this._generatedMappings;break;case t.ORIGINAL_ORDER:o=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var u=this.sourceRoot;o.map(function(e){var n=null===e.source?null:this._sources.at(e.source);return null!=n&&null!=u&&(n=a.join(u,n)),{source:n,generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:null===e.name?null:this._names.at(e.name)}},this).forEach(e,i)},t.prototype.allGeneratedPositionsFor=function(e){var n=a.getArg(e,"line"),r={source:a.getArg(e,"source"),originalLine:n,originalColumn:a.getArg(e,"column",0)};if(null!=this.sourceRoot&&(r.source=a.relative(this.sourceRoot,r.source)),!this._sources.has(r.source))return[];r.source=this._sources.indexOf(r.source);var t=[],o=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",a.compareByOriginalPositions,u.LEAST_UPPER_BOUND);if(o>=0){var i=this._originalMappings[o];if(void 0===e.column)for(var s=i.originalLine;i&&i.originalLine===s;)t.push({line:a.getArg(i,"generatedLine",null),column:a.getArg(i,"generatedColumn",null),lastColumn:a.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o];else for(var c=i.originalColumn;i&&i.originalLine===n&&i.originalColumn==c;)t.push({line:a.getArg(i,"generatedLine",null),column:a.getArg(i,"generatedColumn",null),lastColumn:a.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o]}return t},n.SourceMapConsumer=t,o.prototype=Object.create(t.prototype),o.prototype.consumer=t,o.fromSourceMap=function(e){var n=Object.create(o.prototype),r=n._names=c.fromArray(e._names.toArray(),!0),t=n._sources=c.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file;for(var s=e._mappings.toArray().slice(),u=n.__generatedMappings=[],l=n.__originalMappings=[],p=0,f=s.length;f>p;p++){var h=s[p],m=new i;m.generatedLine=h.generatedLine,m.generatedColumn=h.generatedColumn,h.source&&(m.source=t.indexOf(h.source),m.originalLine=h.originalLine,m.originalColumn=h.originalColumn,h.name&&(m.name=r.indexOf(h.name)),l.push(m)),u.push(m)}return g(n.__originalMappings,a.compareByOriginalPositions),n},o.prototype._version=3,Object.defineProperty(o.prototype,"sources",{get:function(){return this._sources.toArray().map(function(e){return null!=this.sourceRoot?a.join(this.sourceRoot,e):e},this)}}),o.prototype._parseMappings=function(e,n){for(var r,t,o,s,u,c=1,p=0,f=0,h=0,m=0,d=0,_=e.length,v=0,y={},C={},b=[],w=[];_>v;)if(";"===e.charAt(v))c++,v++,p=0;else if(","===e.charAt(v))v++;else{for(r=new i,r.generatedLine=c,s=v;_>s&&!this._charIsMappingSeparator(e,s);s++);if(t=e.slice(v,s),o=y[t])v+=t.length;else{for(o=[];s>v;)l.decode(e,v,C),u=C.value,v=C.rest,o.push(u);if(2===o.length)throw new Error("Found a source, but no line and column");if(3===o.length)throw new Error("Found a source and line, but no column");y[t]=o}r.generatedColumn=p+o[0],p=r.generatedColumn,o.length>1&&(r.source=m+o[1],m+=o[1],r.originalLine=f+o[2],f=r.originalLine,r.originalLine+=1,r.originalColumn=h+o[3],h=r.originalColumn,o.length>4&&(r.name=d+o[4],d+=o[4])),w.push(r),"number"==typeof r.originalLine&&b.push(r)}g(w,a.compareByGeneratedPositionsDeflated),this.__generatedMappings=w,g(b,a.compareByOriginalPositions),this.__originalMappings=b},o.prototype._findMapping=function(e,n,r,t,o,i){if(e[r]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[r]);if(e[t]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[t]);return u.search(e,n,o,i)},o.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var n=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var r=this._generatedMappings[e+1];if(n.generatedLine===r.generatedLine){n.lastGeneratedColumn=r.generatedColumn-1;continue}}n.lastGeneratedColumn=1/0}},o.prototype.originalPositionFor=function(e){var n={generatedLine:a.getArg(e,"line"),generatedColumn:a.getArg(e,"column")},r=this._findMapping(n,this._generatedMappings,"generatedLine","generatedColumn",a.compareByGeneratedPositionsDeflated,a.getArg(e,"bias",t.GREATEST_LOWER_BOUND));if(r>=0){var o=this._generatedMappings[r];if(o.generatedLine===n.generatedLine){var i=a.getArg(o,"source",null);null!==i&&(i=this._sources.at(i),null!=this.sourceRoot&&(i=a.join(this.sourceRoot,i)));var s=a.getArg(o,"name",null);return null!==s&&(s=this._names.at(s)),{source:i,line:a.getArg(o,"originalLine",null),column:a.getArg(o,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}},o.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}):!1},o.prototype.sourceContentFor=function(e,n){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=a.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var r;if(null!=this.sourceRoot&&(r=a.urlParse(this.sourceRoot))){var t=e.replace(/^file:\/\//,"");if("file"==r.scheme&&this._sources.has(t))return this.sourcesContent[this._sources.indexOf(t)];if((!r.path||"/"==r.path)&&this._sources.has("/"+e))return this.sourcesContent[this._sources.indexOf("/"+e)]}if(n)return null;throw new Error('"'+e+'" is not in the SourceMap.')},o.prototype.generatedPositionFor=function(e){var n=a.getArg(e,"source");if(null!=this.sourceRoot&&(n=a.relative(this.sourceRoot,n)),!this._sources.has(n))return{line:null,column:null,lastColumn:null};n=this._sources.indexOf(n);var r={source:n,originalLine:a.getArg(e,"line"),originalColumn:a.getArg(e,"column")},o=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",a.compareByOriginalPositions,a.getArg(e,"bias",t.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===r.source)return{line:a.getArg(i,"generatedLine",null),column:a.getArg(i,"generatedColumn",null),lastColumn:a.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},n.BasicSourceMapConsumer=o,s.prototype=Object.create(t.prototype),s.prototype.constructor=t,s.prototype._version=3,Object.defineProperty(s.prototype,"sources",{get:function(){for(var e=[],n=0;n<this._sections.length;n++)for(var r=0;r<this._sections[n].consumer.sources.length;r++)e.push(this._sections[n].consumer.sources[r]);return e}}),s.prototype.originalPositionFor=function(e){var n={generatedLine:a.getArg(e,"line"),generatedColumn:a.getArg(e,"column")},r=u.search(n,this._sections,function(e,n){var r=e.generatedLine-n.generatedOffset.generatedLine;return r?r:e.generatedColumn-n.generatedOffset.generatedColumn}),t=this._sections[r];return t?t.consumer.originalPositionFor({line:n.generatedLine-(t.generatedOffset.generatedLine-1),column:n.generatedColumn-(t.generatedOffset.generatedLine===n.generatedLine?t.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}},s.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})},s.prototype.sourceContentFor=function(e,n){for(var r=0;r<this._sections.length;r++){var t=this._sections[r],o=t.consumer.sourceContentFor(e,!0);if(o)return o}if(n)return null;throw new Error('"'+e+'" is not in the SourceMap.')},s.prototype.generatedPositionFor=function(e){for(var n=0;n<this._sections.length;n++){var r=this._sections[n];if(-1!==r.consumer.sources.indexOf(a.getArg(e,"source"))){var t=r.consumer.generatedPositionFor(e);if(t){var o={line:t.line+(r.generatedOffset.generatedLine-1),column:t.column+(r.generatedOffset.generatedLine===t.line?r.generatedOffset.generatedColumn-1:0)};return o}}}return{line:null,column:null}},s.prototype._parseMappings=function(e,n){this.__generatedMappings=[],this.__originalMappings=[];for(var r=0;r<this._sections.length;r++)for(var t=this._sections[r],o=t.consumer._generatedMappings,i=0;i<o.length;i++){var s=o[i],u=t.consumer._sources.at(s.source);null!==t.consumer.sourceRoot&&(u=a.join(t.consumer.sourceRoot,u)),this._sources.add(u),u=this._sources.indexOf(u);var c=t.consumer._names.at(s.name);this._names.add(c),c=this._names.indexOf(c);var l={source:u,generatedLine:s.generatedLine+(t.generatedOffset.generatedLine-1),generatedColumn:s.generatedColumn+(t.generatedOffset.generatedLine===s.generatedLine?t.generatedOffset.generatedColumn-1:0),originalLine:s.originalLine,originalColumn:s.originalColumn,name:c};this.__generatedMappings.push(l),"number"==typeof l.originalLine&&this.__originalMappings.push(l)}g(this.__generatedMappings,a.compareByGeneratedPositionsDeflated),g(this.__originalMappings,a.compareByOriginalPositions)},n.IndexedSourceMapConsumer=s},function(e,n){function r(e,n,r){if(n in e)return e[n];if(3===arguments.length)return r;throw new Error('"'+n+'" is a required argument.')}function t(e){var n=e.match(d);return n?{scheme:n[1],auth:n[2],host:n[3],port:n[4],path:n[5]}:null}function o(e){var n="";return e.scheme&&(n+=e.scheme+":"),n+="//",e.auth&&(n+=e.auth+"@"),e.host&&(n+=e.host),e.port&&(n+=":"+e.port),e.path&&(n+=e.path),n}function i(e){var r=e,i=t(e);if(i){if(!i.path)return e;r=i.path}for(var s,a=n.isAbsolute(r),u=r.split(/\/+/),c=0,l=u.length-1;l>=0;l--)s=u[l],"."===s?u.splice(l,1):".."===s?c++:c>0&&(""===s?(u.splice(l+1,c),c=0):(u.splice(l,2),c--));return r=u.join("/"),""===r&&(r=a?"/":"."),i?(i.path=r,o(i)):r}function s(e,n){""===e&&(e="."),""===n&&(n=".");var r=t(n),s=t(e);if(s&&(e=s.path||"/"),r&&!r.scheme)return s&&(r.scheme=s.scheme),o(r);if(r||n.match(_))return n;if(s&&!s.host&&!s.path)return s.host=n,o(s);var a="/"===n.charAt(0)?n:i(e.replace(/\/+$/,"")+"/"+n);return s?(s.path=a,o(s)):a}function a(e,n){""===e&&(e="."),e=e.replace(/\/$/,"");for(var r=0;0!==n.indexOf(e+"/");){var t=e.lastIndexOf("/");if(0>t)return n;if(e=e.slice(0,t),e.match(/^([^\/]+:\/)?\/*$/))return n;++r}return Array(r+1).join("../")+n.substr(e.length+1)}function u(e){return e}function c(e){return g(e)?"$"+e:e}function l(e){return g(e)?e.slice(1):e}function g(e){if(!e)return!1;var n=e.length;if(9>n)return!1;if(95!==e.charCodeAt(n-1)||95!==e.charCodeAt(n-2)||111!==e.charCodeAt(n-3)||116!==e.charCodeAt(n-4)||111!==e.charCodeAt(n-5)||114!==e.charCodeAt(n-6)||112!==e.charCodeAt(n-7)||95!==e.charCodeAt(n-8)||95!==e.charCodeAt(n-9))return!1;for(var r=n-10;r>=0;r--)if(36!==e.charCodeAt(r))return!1;return!0}function p(e,n,r){var t=e.source-n.source;return 0!==t?t:(t=e.originalLine-n.originalLine,0!==t?t:(t=e.originalColumn-n.originalColumn,0!==t||r?t:(t=e.generatedColumn-n.generatedColumn,0!==t?t:(t=e.generatedLine-n.generatedLine,0!==t?t:e.name-n.name))))}function f(e,n,r){var t=e.generatedLine-n.generatedLine;return 0!==t?t:(t=e.generatedColumn-n.generatedColumn,0!==t||r?t:(t=e.source-n.source,0!==t?t:(t=e.originalLine-n.originalLine,0!==t?t:(t=e.originalColumn-n.originalColumn,0!==t?t:e.name-n.name))))}function h(e,n){return e===n?0:e>n?1:-1}function m(e,n){var r=e.generatedLine-n.generatedLine;return 0!==r?r:(r=e.generatedColumn-n.generatedColumn,0!==r?r:(r=h(e.source,n.source),0!==r?r:(r=e.originalLine-n.originalLine,0!==r?r:(r=e.originalColumn-n.originalColumn,0!==r?r:h(e.name,n.name)))))}n.getArg=r;var d=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/,_=/^data:.+\,.+$/;n.urlParse=t,n.urlGenerate=o,n.normalize=i,n.join=s,n.isAbsolute=function(e){return"/"===e.charAt(0)||!!e.match(d)},n.relative=a;var v=function(){var e=Object.create(null);return!("__proto__"in e)}();n.toSetString=v?u:c,n.fromSetString=v?u:l,n.compareByOriginalPositions=p,n.compareByGeneratedPositionsDeflated=f,n.compareByGeneratedPositionsInflated=m},function(e,n){function r(e,t,o,i,s,a){var u=Math.floor((t-e)/2)+e,c=s(o,i[u],!0);return 0===c?u:c>0?t-u>1?r(u,t,o,i,s,a):a==n.LEAST_UPPER_BOUND?t<i.length?t:-1:u:u-e>1?r(e,u,o,i,s,a):a==n.LEAST_UPPER_BOUND?u:0>e?-1:e}n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.search=function(e,t,o,i){if(0===t.length)return-1;var s=r(-1,t.length,e,t,o,i||n.GREATEST_LOWER_BOUND);if(0>s)return-1;for(;s-1>=0&&0===o(t[s],t[s-1],!0);)--s;return s}},function(e,n,r){function t(){this._array=[],this._set=Object.create(null)}var o=r(1),i=Object.prototype.hasOwnProperty;t.fromArray=function(e,n){for(var r=new t,o=0,i=e.length;i>o;o++)r.add(e[o],n);return r},t.prototype.size=function(){return Object.getOwnPropertyNames(this._set).length},t.prototype.add=function(e,n){var r=o.toSetString(e),t=i.call(this._set,r),s=this._array.length;(!t||n)&&this._array.push(e),t||(this._set[r]=s)},t.prototype.has=function(e){var n=o.toSetString(e);return i.call(this._set,n)},t.prototype.indexOf=function(e){var n=o.toSetString(e);if(i.call(this._set,n))return this._set[n];throw new Error('"'+e+'" is not in the set.')},t.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},t.prototype.toArray=function(){return this._array.slice()},n.ArraySet=t},function(e,n,r){function t(e){return 0>e?(-e<<1)+1:(e<<1)+0}function o(e){var n=1===(1&e),r=e>>1;return n?-r:r}var i=r(5),s=5,a=1<<s,u=a-1,c=a;n.encode=function(e){var n,r="",o=t(e);do n=o&u,o>>>=s,o>0&&(n|=c),r+=i.encode(n);while(o>0);return r},n.decode=function(e,n,r){var t,a,l=e.length,g=0,p=0;do{if(n>=l)throw new Error("Expected more digits in base 64 VLQ value.");if(a=i.decode(e.charCodeAt(n++)),-1===a)throw new Error("Invalid base64 digit: "+e.charAt(n-1));t=!!(a&c),a&=u,g+=a<<p,p+=s}while(t);r.value=o(g),r.rest=n}},function(e,n){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");n.encode=function(e){if(e>=0&&e<r.length)return r[e];throw new TypeError("Must be between 0 and 63: "+e)},n.decode=function(e){var n=65,r=90,t=97,o=122,i=48,s=57,a=43,u=47,c=26,l=52;return e>=n&&r>=e?e-n:e>=t&&o>=e?e-t+c:e>=i&&s>=e?e-i+l:e==a?62:e==u?63:-1}},function(e,n){function r(e,n,r){var t=e[n];e[n]=e[r],e[r]=t}function t(e,n){return Math.round(e+Math.random()*(n-e))}function o(e,n,i,s){if(s>i){var a=t(i,s),u=i-1;r(e,a,s);for(var c=e[s],l=i;s>l;l++)n(e[l],c)<=0&&(u+=1,r(e,u,l));r(e,u+1,l);var g=u+1;o(e,n,i,g-1),o(e,n,g+1,s)}}n.quickSort=function(e,n){o(e,n,0,e.length-1)}}]);!function(e,n){"use strict";"function"==typeof define&&define.amd?define("stacktrace-gps",["source-map","stackframe"],n):"object"==typeof exports?module.exports=n(require("source-map/lib/source-map-consumer"),require("stackframe")):e.StackTraceGPS=n(e.SourceMap||e.sourceMap,e.StackFrame)}(this,function(e,n){"use strict";function r(e){return new Promise(function(n,r){var t=new XMLHttpRequest;t.open("get",e),t.onerror=r,t.onreadystatechange=function(){4===t.readyState&&(t.status>=200&&t.status<300?n(t.responseText):r(new Error("HTTP status: "+t.status+" retrieving "+e)))},t.send()})}function t(e){if("undefined"!=typeof window&&window.atob)return window.atob(e);throw new Error("You must supply a polyfill for window.atob in this environment")}function o(e){if("undefined"!=typeof JSON&&JSON.parse)return JSON.parse(e);throw new Error("You must supply a polyfill for JSON.parse in this environment")}function i(e,n){for(var r,t=/function\s+([^(]*?)\s*\(([^)]*)\)/,o=/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*function\b/,i=/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*(?:eval|new Function)\b/,s=e.split("\n"),a="",u=Math.min(n,20),c=0;u>c;++c){var l=s[n-c-1],g=l.indexOf("//");if(g>=0&&(l=l.substr(0,g)),l){if(a=l+a,r=o.exec(a),r&&r[1])return r[1];if(r=t.exec(a),r&&r[1])return r[1];if(r=i.exec(a),r&&r[1])return r[1]}}}function s(){if("function"!=typeof Object.defineProperty||"function"!=typeof Object.create)throw new Error("Unable to consume source maps in older browsers")}function a(e){if("object"!=typeof e)throw new TypeError("Given StackFrame is not an object");if("string"!=typeof e.fileName)throw new TypeError("Given file name is not a String");if("number"!=typeof e.lineNumber||e.lineNumber%1!==0||e.lineNumber<1)throw new TypeError("Given line number must be a positive integer");if("number"!=typeof e.columnNumber||e.columnNumber%1!==0||e.columnNumber<0)throw new TypeError("Given column number must be a non-negative integer");return!0}function u(e){var n=/\/\/[#@] ?sourceMappingURL=([^\s'"]+)\s*$/.exec(e);if(n&&n[1])return n[1];throw new Error("sourceMappingURL not found")}function c(r,t,o){return new Promise(function(i,s){var a=new e.SourceMapConsumer(t),u=a.originalPositionFor({line:r.lineNumber,column:r.columnNumber});if(u.source){var c=a.sourceContentFor(u.source);c&&(o[u.source]=c),i(new n(u.name||r.functionName,r.args,u.source,u.line,u.column))}else s(new Error("Could not get original source for given stackframe and source map"))})}return function l(e){return this instanceof l?(e=e||{},this.sourceCache=e.sourceCache||{},this.ajax=e.ajax||r,this._atob=e.atob||t,this._get=function(n){return new Promise(function(r,t){var o="data:"===n.substr(0,5);if(this.sourceCache[n])r(this.sourceCache[n]);else if(e.offline&&!o)t(new Error("Cannot make network requests in offline mode"));else if(o){var i=/^data:application\/json;([\w=:"-]+;)*base64,/,s=n.match(i);if(s){var a=s[0].length,u=n.substr(a),c=this._atob(u);this.sourceCache[n]=c,r(c)}else t(new Error("The encoding of the inline sourcemap is not supported"))}else{var l=this.ajax(n,{method:"get"});this.sourceCache[n]=l,l.then(r,t)}}.bind(this))},this.pinpoint=function(e){return new Promise(function(n,r){this.getMappedLocation(e).then(function(e){function r(){n(e)}this.findFunctionName(e).then(n,r)["catch"](r)}.bind(this),r)}.bind(this))},this.findFunctionName=function(e){return new Promise(function(r,t){a(e),this._get(e.fileName).then(function(t){var o=e.lineNumber,s=e.columnNumber,a=i(t,o,s);r(a?new n(a,e.args,e.fileName,o,s):e)},t)["catch"](t)}.bind(this))},void(this.getMappedLocation=function(e){return new Promise(function(n,r){s(),a(e);var t=this.sourceCache,i=e.fileName;this._get(i).then(function(s){var a=u(s),l="data:"===a.substr(0,5),g=i.substring(0,i.lastIndexOf("/")+1);"/"===a[0]||l||/^https?:\/\/|^\/\//i.test(a)||(a=g+a),this._get(a).then(function(r){"string"==typeof r&&(r=o(r.replace(/^\)\]\}'/,""))),"undefined"==typeof r.sourceRoot&&(r.sourceRoot=g),c(e,r,t).then(n)["catch"](function(){n(e)})},r)["catch"](r)}.bind(this),r)["catch"](r)}.bind(this))})):new l(e)}});
!function(e,n){"use strict";"function"==typeof define&&define.amd?define("stackframe",[],n):"object"==typeof exports?module.exports=n():e.StackFrame=n()}(this,function(){"use strict";function e(e){return!isNaN(parseFloat(e))&&isFinite(e)}function n(e){return e[0].toUpperCase()+e.substring(1)}function r(e){return function(){return this[e]}}function t(e){if(e instanceof Object)for(var r=o.concat(i.concat(s.concat(a))),t=0;t<r.length;t++)e.hasOwnProperty(r[t])&&void 0!==e[r[t]]&&this["set"+n(r[t])](e[r[t]])}var o=["isConstructor","isEval","isNative","isToplevel"],i=["columnNumber","lineNumber"],s=["fileName","functionName","source"],a=["args"];t.prototype={getArgs:function(){return this.args},setArgs:function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("Args must be an Array");this.args=e},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(e){if(e instanceof t)this.evalOrigin=e;else{if(!(e instanceof Object))throw new TypeError("Eval Origin must be an Object or StackFrame");this.evalOrigin=new t(e)}},toString:function(){var n=this.getFunctionName()||"{anonymous}",r="("+(this.getArgs()||[]).join(",")+")",t=this.getFileName()?"@"+this.getFileName():"",o=e(this.getLineNumber())?":"+this.getLineNumber():"",i=e(this.getColumnNumber())?":"+this.getColumnNumber():"";return n+r+t+o+i}};for(var u=0;u<o.length;u++)t.prototype["get"+n(o[u])]=r(o[u]),t.prototype["set"+n(o[u])]=function(e){return function(n){this[e]=Boolean(n)}}(o[u]);for(var c=0;c<i.length;c++)t.prototype["get"+n(i[c])]=r(i[c]),t.prototype["set"+n(i[c])]=function(n){return function(r){if(!e(r))throw new TypeError(n+" must be a Number");this[n]=Number(r)}}(i[c]);for(var l=0;l<s.length;l++)t.prototype["get"+n(s[l])]=r(s[l]),t.prototype["set"+n(s[l])]=function(e){return function(n){this[e]=String(n)}}(s[l]);return t});var SourceMap=function(e){function n(t){if(r[t])return r[t].exports;var o=r[t]={exports:{},id:t,loaded:!1};return e[t].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var r={};return n.m=e,n.c=r,n.p="",n(0)}([function(e,n,r){function t(e){var n=e;return"string"==typeof e&&(n=JSON.parse(e.replace(/^\)\]\}'/,""))),null!=n.sections?new s(n):new o(n)}function o(e){var n=e;"string"==typeof e&&(n=JSON.parse(e.replace(/^\)\]\}'/,"")));var r=a.getArg(n,"version"),t=a.getArg(n,"sources"),o=a.getArg(n,"names",[]),i=a.getArg(n,"sourceRoot",null),s=a.getArg(n,"sourcesContent",null),u=a.getArg(n,"mappings"),l=a.getArg(n,"file",null);if(r!=this._version)throw new Error("Unsupported version: "+r);t=t.map(String).map(a.normalize).map(function(e){return i&&a.isAbsolute(i)&&a.isAbsolute(e)?a.relative(i,e):e}),this._names=c.fromArray(o.map(String),!0),this._sources=c.fromArray(t,!0),this.sourceRoot=i,this.sourcesContent=s,this._mappings=u,this.file=l}function i(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function s(e){var n=e;"string"==typeof e&&(n=JSON.parse(e.replace(/^\)\]\}'/,"")));var r=a.getArg(n,"version"),o=a.getArg(n,"sections");if(r!=this._version)throw new Error("Unsupported version: "+r);this._sources=new c,this._names=new c;var i={line:-1,column:0};this._sections=o.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var n=a.getArg(e,"offset"),r=a.getArg(n,"line"),o=a.getArg(n,"column");if(r<i.line||r===i.line&&o<i.column)throw new Error("Section offsets must be ordered and non-overlapping.");return i=n,{generatedOffset:{generatedLine:r+1,generatedColumn:o+1},consumer:new t(a.getArg(e,"map"))}})}var a=r(1),u=r(2),c=r(3).ArraySet,l=r(4),g=r(6).quickSort;t.fromSourceMap=function(e){return o.fromSourceMap(e)},t.prototype._version=3,t.prototype.__generatedMappings=null,Object.defineProperty(t.prototype,"_generatedMappings",{get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),t.prototype.__originalMappings=null,Object.defineProperty(t.prototype,"_originalMappings",{get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),t.prototype._charIsMappingSeparator=function(e,n){var r=e.charAt(n);return";"===r||","===r},t.prototype._parseMappings=function(e,n){throw new Error("Subclasses must implement _parseMappings")},t.GENERATED_ORDER=1,t.ORIGINAL_ORDER=2,t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2,t.prototype.eachMapping=function(e,n,r){var o,i=n||null,s=r||t.GENERATED_ORDER;switch(s){case t.GENERATED_ORDER:o=this._generatedMappings;break;case t.ORIGINAL_ORDER:o=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var u=this.sourceRoot;o.map(function(e){var n=null===e.source?null:this._sources.at(e.source);return null!=n&&null!=u&&(n=a.join(u,n)),{source:n,generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:null===e.name?null:this._names.at(e.name)}},this).forEach(e,i)},t.prototype.allGeneratedPositionsFor=function(e){var n=a.getArg(e,"line"),r={source:a.getArg(e,"source"),originalLine:n,originalColumn:a.getArg(e,"column",0)};if(null!=this.sourceRoot&&(r.source=a.relative(this.sourceRoot,r.source)),!this._sources.has(r.source))return[];r.source=this._sources.indexOf(r.source);var t=[],o=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",a.compareByOriginalPositions,u.LEAST_UPPER_BOUND);if(o>=0){var i=this._originalMappings[o];if(void 0===e.column)for(var s=i.originalLine;i&&i.originalLine===s;)t.push({line:a.getArg(i,"generatedLine",null),column:a.getArg(i,"generatedColumn",null),lastColumn:a.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o];else for(var c=i.originalColumn;i&&i.originalLine===n&&i.originalColumn==c;)t.push({line:a.getArg(i,"generatedLine",null),column:a.getArg(i,"generatedColumn",null),lastColumn:a.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o]}return t},n.SourceMapConsumer=t,o.prototype=Object.create(t.prototype),o.prototype.consumer=t,o.fromSourceMap=function(e){var n=Object.create(o.prototype),r=n._names=c.fromArray(e._names.toArray(),!0),t=n._sources=c.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file;for(var s=e._mappings.toArray().slice(),u=n.__generatedMappings=[],l=n.__originalMappings=[],p=0,f=s.length;p<f;p++){var h=s[p],m=new i;m.generatedLine=h.generatedLine,m.generatedColumn=h.generatedColumn,h.source&&(m.source=t.indexOf(h.source),m.originalLine=h.originalLine,m.originalColumn=h.originalColumn,h.name&&(m.name=r.indexOf(h.name)),l.push(m)),u.push(m)}return g(n.__originalMappings,a.compareByOriginalPositions),n},o.prototype._version=3,Object.defineProperty(o.prototype,"sources",{get:function(){return this._sources.toArray().map(function(e){return null!=this.sourceRoot?a.join(this.sourceRoot,e):e},this)}}),o.prototype._parseMappings=function(e,n){for(var r,t,o,s,u,c=1,p=0,f=0,h=0,m=0,d=0,_=e.length,v=0,y={},C={},w=[],b=[];v<_;)if(";"===e.charAt(v))c++,v++,p=0;else if(","===e.charAt(v))v++;else{for(r=new i,r.generatedLine=c,s=v;s<_&&!this._charIsMappingSeparator(e,s);s++);if(t=e.slice(v,s),o=y[t])v+=t.length;else{for(o=[];v<s;)l.decode(e,v,C),u=C.value,v=C.rest,o.push(u);if(2===o.length)throw new Error("Found a source, but no line and column");if(3===o.length)throw new Error("Found a source and line, but no column");y[t]=o}r.generatedColumn=p+o[0],p=r.generatedColumn,o.length>1&&(r.source=m+o[1],m+=o[1],r.originalLine=f+o[2],f=r.originalLine,r.originalLine+=1,r.originalColumn=h+o[3],h=r.originalColumn,o.length>4&&(r.name=d+o[4],d+=o[4])),b.push(r),"number"==typeof r.originalLine&&w.push(r)}g(b,a.compareByGeneratedPositionsDeflated),this.__generatedMappings=b,g(w,a.compareByOriginalPositions),this.__originalMappings=w},o.prototype._findMapping=function(e,n,r,t,o,i){if(e[r]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[r]);if(e[t]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[t]);return u.search(e,n,o,i)},o.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var n=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var r=this._generatedMappings[e+1];if(n.generatedLine===r.generatedLine){n.lastGeneratedColumn=r.generatedColumn-1;continue}}n.lastGeneratedColumn=1/0}},o.prototype.originalPositionFor=function(e){var n={generatedLine:a.getArg(e,"line"),generatedColumn:a.getArg(e,"column")},r=this._findMapping(n,this._generatedMappings,"generatedLine","generatedColumn",a.compareByGeneratedPositionsDeflated,a.getArg(e,"bias",t.GREATEST_LOWER_BOUND));if(r>=0){var o=this._generatedMappings[r];if(o.generatedLine===n.generatedLine){var i=a.getArg(o,"source",null);null!==i&&(i=this._sources.at(i),null!=this.sourceRoot&&(i=a.join(this.sourceRoot,i)));var s=a.getArg(o,"name",null);return null!==s&&(s=this._names.at(s)),{source:i,line:a.getArg(o,"originalLine",null),column:a.getArg(o,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}},o.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},o.prototype.sourceContentFor=function(e,n){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=a.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var r;if(null!=this.sourceRoot&&(r=a.urlParse(this.sourceRoot))){var t=e.replace(/^file:\/\//,"");if("file"==r.scheme&&this._sources.has(t))return this.sourcesContent[this._sources.indexOf(t)];if((!r.path||"/"==r.path)&&this._sources.has("/"+e))return this.sourcesContent[this._sources.indexOf("/"+e)]}if(n)return null;throw new Error('"'+e+'" is not in the SourceMap.')},o.prototype.generatedPositionFor=function(e){var n=a.getArg(e,"source");if(null!=this.sourceRoot&&(n=a.relative(this.sourceRoot,n)),!this._sources.has(n))return{line:null,column:null,lastColumn:null};n=this._sources.indexOf(n);var r={source:n,originalLine:a.getArg(e,"line"),originalColumn:a.getArg(e,"column")},o=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",a.compareByOriginalPositions,a.getArg(e,"bias",t.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===r.source)return{line:a.getArg(i,"generatedLine",null),column:a.getArg(i,"generatedColumn",null),lastColumn:a.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},n.BasicSourceMapConsumer=o,s.prototype=Object.create(t.prototype),s.prototype.constructor=t,s.prototype._version=3,Object.defineProperty(s.prototype,"sources",{get:function(){for(var e=[],n=0;n<this._sections.length;n++)for(var r=0;r<this._sections[n].consumer.sources.length;r++)e.push(this._sections[n].consumer.sources[r]);return e}}),s.prototype.originalPositionFor=function(e){var n={generatedLine:a.getArg(e,"line"),generatedColumn:a.getArg(e,"column")},r=u.search(n,this._sections,function(e,n){var r=e.generatedLine-n.generatedOffset.generatedLine;return r?r:e.generatedColumn-n.generatedOffset.generatedColumn}),t=this._sections[r];return t?t.consumer.originalPositionFor({line:n.generatedLine-(t.generatedOffset.generatedLine-1),column:n.generatedColumn-(t.generatedOffset.generatedLine===n.generatedLine?t.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}},s.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})},s.prototype.sourceContentFor=function(e,n){for(var r=0;r<this._sections.length;r++){var t=this._sections[r],o=t.consumer.sourceContentFor(e,!0);if(o)return o}if(n)return null;throw new Error('"'+e+'" is not in the SourceMap.')},s.prototype.generatedPositionFor=function(e){for(var n=0;n<this._sections.length;n++){var r=this._sections[n];if(r.consumer.sources.indexOf(a.getArg(e,"source"))!==-1){var t=r.consumer.generatedPositionFor(e);if(t){var o={line:t.line+(r.generatedOffset.generatedLine-1),column:t.column+(r.generatedOffset.generatedLine===t.line?r.generatedOffset.generatedColumn-1:0)};return o}}}return{line:null,column:null}},s.prototype._parseMappings=function(e,n){this.__generatedMappings=[],this.__originalMappings=[];for(var r=0;r<this._sections.length;r++)for(var t=this._sections[r],o=t.consumer._generatedMappings,i=0;i<o.length;i++){var s=o[i],u=t.consumer._sources.at(s.source);null!==t.consumer.sourceRoot&&(u=a.join(t.consumer.sourceRoot,u)),this._sources.add(u),u=this._sources.indexOf(u);var c=t.consumer._names.at(s.name);this._names.add(c),c=this._names.indexOf(c);var l={source:u,generatedLine:s.generatedLine+(t.generatedOffset.generatedLine-1),generatedColumn:s.generatedColumn+(t.generatedOffset.generatedLine===s.generatedLine?t.generatedOffset.generatedColumn-1:0),originalLine:s.originalLine,originalColumn:s.originalColumn,name:c};this.__generatedMappings.push(l),"number"==typeof l.originalLine&&this.__originalMappings.push(l)}g(this.__generatedMappings,a.compareByGeneratedPositionsDeflated),g(this.__originalMappings,a.compareByOriginalPositions)},n.IndexedSourceMapConsumer=s},function(e,n){function r(e,n,r){if(n in e)return e[n];if(3===arguments.length)return r;throw new Error('"'+n+'" is a required argument.')}function t(e){var n=e.match(d);return n?{scheme:n[1],auth:n[2],host:n[3],port:n[4],path:n[5]}:null}function o(e){var n="";return e.scheme&&(n+=e.scheme+":"),n+="//",e.auth&&(n+=e.auth+"@"),e.host&&(n+=e.host),e.port&&(n+=":"+e.port),e.path&&(n+=e.path),n}function i(e){var r=e,i=t(e);if(i){if(!i.path)return e;r=i.path}for(var s,a=n.isAbsolute(r),u=r.split(/\/+/),c=0,l=u.length-1;l>=0;l--)s=u[l],"."===s?u.splice(l,1):".."===s?c++:c>0&&(""===s?(u.splice(l+1,c),c=0):(u.splice(l,2),c--));return r=u.join("/"),""===r&&(r=a?"/":"."),i?(i.path=r,o(i)):r}function s(e,n){""===e&&(e="."),""===n&&(n=".");var r=t(n),s=t(e);if(s&&(e=s.path||"/"),r&&!r.scheme)return s&&(r.scheme=s.scheme),o(r);if(r||n.match(_))return n;if(s&&!s.host&&!s.path)return s.host=n,o(s);var a="/"===n.charAt(0)?n:i(e.replace(/\/+$/,"")+"/"+n);return s?(s.path=a,o(s)):a}function a(e,n){""===e&&(e="."),e=e.replace(/\/$/,"");for(var r=0;0!==n.indexOf(e+"/");){var t=e.lastIndexOf("/");if(t<0)return n;if(e=e.slice(0,t),e.match(/^([^\/]+:\/)?\/*$/))return n;++r}return Array(r+1).join("../")+n.substr(e.length+1)}function u(e){return e}function c(e){return g(e)?"$"+e:e}function l(e){return g(e)?e.slice(1):e}function g(e){if(!e)return!1;var n=e.length;if(n<9)return!1;if(95!==e.charCodeAt(n-1)||95!==e.charCodeAt(n-2)||111!==e.charCodeAt(n-3)||116!==e.charCodeAt(n-4)||111!==e.charCodeAt(n-5)||114!==e.charCodeAt(n-6)||112!==e.charCodeAt(n-7)||95!==e.charCodeAt(n-8)||95!==e.charCodeAt(n-9))return!1;for(var r=n-10;r>=0;r--)if(36!==e.charCodeAt(r))return!1;return!0}function p(e,n,r){var t=e.source-n.source;return 0!==t?t:(t=e.originalLine-n.originalLine,0!==t?t:(t=e.originalColumn-n.originalColumn,0!==t||r?t:(t=e.generatedColumn-n.generatedColumn,0!==t?t:(t=e.generatedLine-n.generatedLine,0!==t?t:e.name-n.name))))}function f(e,n,r){var t=e.generatedLine-n.generatedLine;return 0!==t?t:(t=e.generatedColumn-n.generatedColumn,0!==t||r?t:(t=e.source-n.source,0!==t?t:(t=e.originalLine-n.originalLine,0!==t?t:(t=e.originalColumn-n.originalColumn,0!==t?t:e.name-n.name))))}function h(e,n){return e===n?0:e>n?1:-1}function m(e,n){var r=e.generatedLine-n.generatedLine;return 0!==r?r:(r=e.generatedColumn-n.generatedColumn,0!==r?r:(r=h(e.source,n.source),0!==r?r:(r=e.originalLine-n.originalLine,0!==r?r:(r=e.originalColumn-n.originalColumn,0!==r?r:h(e.name,n.name)))))}n.getArg=r;var d=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/,_=/^data:.+\,.+$/;n.urlParse=t,n.urlGenerate=o,n.normalize=i,n.join=s,n.isAbsolute=function(e){return"/"===e.charAt(0)||!!e.match(d)},n.relative=a;var v=function(){var e=Object.create(null);return!("__proto__"in e)}();n.toSetString=v?u:c,n.fromSetString=v?u:l,n.compareByOriginalPositions=p,n.compareByGeneratedPositionsDeflated=f,n.compareByGeneratedPositionsInflated=m},function(e,n){function r(e,t,o,i,s,a){var u=Math.floor((t-e)/2)+e,c=s(o,i[u],!0);return 0===c?u:c>0?t-u>1?r(u,t,o,i,s,a):a==n.LEAST_UPPER_BOUND?t<i.length?t:-1:u:u-e>1?r(e,u,o,i,s,a):a==n.LEAST_UPPER_BOUND?u:e<0?-1:e}n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.search=function(e,t,o,i){if(0===t.length)return-1;var s=r(-1,t.length,e,t,o,i||n.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&0===o(t[s],t[s-1],!0);)--s;return s}},function(e,n,r){function t(){this._array=[],this._set=Object.create(null)}var o=r(1),i=Object.prototype.hasOwnProperty;t.fromArray=function(e,n){for(var r=new t,o=0,i=e.length;o<i;o++)r.add(e[o],n);return r},t.prototype.size=function(){return Object.getOwnPropertyNames(this._set).length},t.prototype.add=function(e,n){var r=o.toSetString(e),t=i.call(this._set,r),s=this._array.length;t&&!n||this._array.push(e),t||(this._set[r]=s)},t.prototype.has=function(e){var n=o.toSetString(e);return i.call(this._set,n)},t.prototype.indexOf=function(e){var n=o.toSetString(e);if(i.call(this._set,n))return this._set[n];throw new Error('"'+e+'" is not in the set.')},t.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},t.prototype.toArray=function(){return this._array.slice()},n.ArraySet=t},function(e,n,r){function t(e){return e<0?(-e<<1)+1:(e<<1)+0}function o(e){var n=1===(1&e),r=e>>1;return n?-r:r}var i=r(5),s=5,a=1<<s,u=a-1,c=a;n.encode=function(e){var n,r="",o=t(e);do n=o&u,o>>>=s,o>0&&(n|=c),r+=i.encode(n);while(o>0);return r},n.decode=function(e,n,r){var t,a,l=e.length,g=0,p=0;do{if(n>=l)throw new Error("Expected more digits in base 64 VLQ value.");if(a=i.decode(e.charCodeAt(n++)),a===-1)throw new Error("Invalid base64 digit: "+e.charAt(n-1));t=!!(a&c),a&=u,g+=a<<p,p+=s}while(t);r.value=o(g),r.rest=n}},function(e,n){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");n.encode=function(e){if(0<=e&&e<r.length)return r[e];throw new TypeError("Must be between 0 and 63: "+e)},n.decode=function(e){var n=65,r=90,t=97,o=122,i=48,s=57,a=43,u=47,c=26,l=52;return n<=e&&e<=r?e-n:t<=e&&e<=o?e-t+c:i<=e&&e<=s?e-i+l:e==a?62:e==u?63:-1}},function(e,n){function r(e,n,r){var t=e[n];e[n]=e[r],e[r]=t}function t(e,n){return Math.round(e+Math.random()*(n-e))}function o(e,n,i,s){if(i<s){var a=t(i,s),u=i-1;r(e,a,s);for(var c=e[s],l=i;l<s;l++)n(e[l],c)<=0&&(u+=1,r(e,u,l));r(e,u+1,l);var g=u+1;o(e,n,i,g-1),o(e,n,g+1,s)}}n.quickSort=function(e,n){o(e,n,0,e.length-1)}}]);!function(e,n){"use strict";"function"==typeof define&&define.amd?define("stacktrace-gps",["source-map","stackframe"],n):"object"==typeof exports?module.exports=n(require("source-map/lib/source-map-consumer"),require("stackframe")):e.StackTraceGPS=n(e.SourceMap||e.sourceMap,e.StackFrame)}(this,function(e,n){"use strict";function r(e){return new Promise(function(n,r){var t=new XMLHttpRequest;t.open("get",e),t.onerror=r,t.onreadystatechange=function(){4===t.readyState&&(t.status>=200&&t.status<300||"file://"===e.substr(0,7)&&t.responseText?n(t.responseText):r(new Error("HTTP status: "+t.status+" retrieving "+e)))},t.send()})}function t(e){if("undefined"!=typeof window&&window.atob)return window.atob(e);throw new Error("You must supply a polyfill for window.atob in this environment")}function o(e){if("undefined"!=typeof JSON&&JSON.parse)return JSON.parse(e);throw new Error("You must supply a polyfill for JSON.parse in this environment")}function i(e,n){for(var r=[/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*function\b/,/function\s+([^('"`]*?)\s*\(([^)]*)\)/,/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*(?:eval|new Function)\b/,/\b(?!(?:if|for|switch|while|with|catch)\b)(?:(?:static)\s+)?(\S+)\s*\(.*?\)\s*\{/,/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*\(.*?\)\s*=>/],t=e.split("\n"),o="",i=Math.min(n,20),s=0;s<i;++s){var a=t[n-s-1],u=a.indexOf("//");if(u>=0&&(a=a.substr(0,u)),a){o=a+o;for(var c=r.length,l=0;l<c;l++){var g=r[l].exec(o);if(g&&g[1])return g[1]}}}}function s(){if("function"!=typeof Object.defineProperty||"function"!=typeof Object.create)throw new Error("Unable to consume source maps in older browsers")}function a(e){if("object"!=typeof e)throw new TypeError("Given StackFrame is not an object");if("string"!=typeof e.fileName)throw new TypeError("Given file name is not a String");if("number"!=typeof e.lineNumber||e.lineNumber%1!==0||e.lineNumber<1)throw new TypeError("Given line number must be a positive integer");if("number"!=typeof e.columnNumber||e.columnNumber%1!==0||e.columnNumber<0)throw new TypeError("Given column number must be a non-negative integer");return!0}function u(e){var n=/\/\/[#@] ?sourceMappingURL=([^\s'"]+)\s*$/m.exec(e);if(n&&n[1])return n[1];throw new Error("sourceMappingURL not found")}function c(e,r,t){return new Promise(function(o,i){var s=r.originalPositionFor({line:e.lineNumber,column:e.columnNumber});if(s.source){var a=r.sourceContentFor(s.source);a&&(t[s.source]=a),o(new n({functionName:s.name||e.functionName,args:e.args,fileName:s.source,lineNumber:s.line,columnNumber:s.column}))}else i(new Error("Could not get original source for given stackframe and source map"))})}return function l(g){return this instanceof l?(g=g||{},this.sourceCache=g.sourceCache||{},this.sourceMapConsumerCache=g.sourceMapConsumerCache||{},this.ajax=g.ajax||r,this._atob=g.atob||t,this._get=function(e){return new Promise(function(n,r){var t="data:"===e.substr(0,5);if(this.sourceCache[e])n(this.sourceCache[e]);else if(g.offline&&!t)r(new Error("Cannot make network requests in offline mode"));else if(t){var o=/^data:application\/json;([\w=:"-]+;)*base64,/,i=e.match(o);if(i){var s=i[0].length,a=e.substr(s),u=this._atob(a);this.sourceCache[e]=u,n(u)}else r(new Error("The encoding of the inline sourcemap is not supported"))}else{var c=this.ajax(e,{method:"get"});this.sourceCache[e]=c,c.then(n,r)}}.bind(this))},this._getSourceMapConsumer=function(n,r){return new Promise(function(t,i){if(this.sourceMapConsumerCache[n])t(this.sourceMapConsumerCache[n]);else{var s=new Promise(function(t,i){return this._get(n).then(function(n){"string"==typeof n&&(n=o(n.replace(/^\)\]\}'/,""))),"undefined"==typeof n.sourceRoot&&(n.sourceRoot=r),t(new e.SourceMapConsumer(n))},i)}.bind(this));this.sourceMapConsumerCache[n]=s,t(s)}}.bind(this))},this.pinpoint=function(e){return new Promise(function(n,r){this.getMappedLocation(e).then(function(e){function r(){n(e)}this.findFunctionName(e).then(n,r)["catch"](r)}.bind(this),r)}.bind(this))},this.findFunctionName=function(e){return new Promise(function(r,t){a(e),this._get(e.fileName).then(function(t){var o=e.lineNumber,s=e.columnNumber,a=i(t,o,s);r(a?new n({functionName:a,args:e.args,fileName:e.fileName,lineNumber:o,columnNumber:s}):e)},t)["catch"](t)}.bind(this))},void(this.getMappedLocation=function(e){return new Promise(function(n,r){s(),a(e);var t=this.sourceCache,o=e.fileName;this._get(o).then(function(r){var i=u(r),s="data:"===i.substr(0,5),a=o.substring(0,o.lastIndexOf("/")+1);return"/"===i[0]||s||/^https?:\/\/|^\/\//i.test(i)||(i=a+i),this._getSourceMapConsumer(i,a).then(function(r){return c(e,r,t).then(n)["catch"](function(){n(e)})})}.bind(this),r)["catch"](r)}.bind(this))})):new l(g)}});
//# sourceMappingURL=stacktrace-gps.min.js.map

@@ -5,7 +5,7 @@ {

"maintainers": [
"Eric Wendelin <me@eriwen.com> (http://www.eriwen.com)",
"Eric Wendelin <me@eriwen.com> (https://www.eriwen.com)",
"Victor Homyakov <vkhomyackov@gmail.com> (https://github.com/victor-homyakov)",
"Oliver Salzburg (https://github.com/oliversalzburg)"
],
"version": "2.4.4",
"version": "3.0.0",
"license": "Unlicense",

@@ -24,3 +24,3 @@ "keywords": [

"source-map": "0.5.6",
"stackframe": "~0.3"
"stackframe": "^1.0.2"
},

@@ -27,0 +27,0 @@ "devDependencies": {

@@ -5,8 +5,10 @@ stacktrace-gps - Turn partial code location into precise code location

This library accepts a code location (in the form of a [StackFrame](https://github.com/stacktracejs/stackframe)) and
This library accepts a code location (in the form of a [StackFrame](https://github.com/stacktracejs/stackframe)) and
returns a new StackFrame with a more accurate location (using [source maps](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/)) and guessed function names.
This is primarily a browser-centric library, but can be used with node.js. See the [Offline Usage section](#offline-usage) below.
## Usage
```js
var stackframe = new StackFrame(undefined, [], 'http://localhost:3000/file.min.js', 1, 3284);
var stackframe = new StackFrame({fileName: 'http://localhost:3000/file.min.js', lineNumber: 1, columnNumber: 3284});
var callback = function myCallback(foundFunctionName) { console.log(foundFunctionName); };

@@ -21,13 +23,32 @@

gps.pinpoint(stackframe).then(callback, errback);
=> Promise(StackFrame('fun', [], 'file.js', 203, 9), Error)
//===> Promise(StackFrame({functionName: 'fun', fileName: 'file.js', lineNumber: 203, columnNumber: 9}), Error)
// Better location/name information from source maps
gps.getMappedLocation(stackframe).then(callback, errback);
=> Promise(StackFrame(undefined, [], 'file.js', 203, 9), Error)
//===> Promise(StackFrame({fileName: 'file.js', lineNumber: 203, columnNumber: 9}), Error)
// Get function name from location information
gps.findFunctionName(stackframe).then(callback, errback);
=> Promise(StackFrame('fun', [], 'http://localhost:3000/file.min.js', 1, 3284), Error)
//===> Promise(StackFrame({functionName: 'fun', fileName: 'http://localhost:3000/file.min.js', lineNumber: 1, columnNumber: 3284}), Error)
```
### Offline Usage
With a bit of preparation, you can use this library offline in any environment. Any encountered fileNames not in the cache return resolved
Promises with the original StackFrame. StackTraceGPS will make a best effort to provide as good of response with what is given and will
fallback to the original StackFrame if nothing better could be found.
```js
var stack = ErrorStackParser.parse(new Error('boom'));
console.assert(stack[0] == new StackFrame({fileName: 'http://localhost:9999/file.min.js', lineNumber: 1, columnNumber: 32}));
var sourceCache = {'http://localhost:9999/file.min.js': 'var foo=function(){};function bar(){}var baz=eval("XXX");\n//# sourceMappingURL=file.js.map'};
var sourceMap = '{"version":3,"sources":["./file.js"],"sourceRoot":"http://localhost:4000/","names":["foo","bar","baz","eval"],"mappings":"AAAA,GAAIA,KAAM,YACV,SAASC,QACT,GAAIC,KAAMC,KAAK","file":"file.min.js"}';
var sourceMapConsumerCache = {'http://localhost:4000/file.js.map': new SourceMap.SourceMapConsumer(sourceMap)};
var gps = new StackTraceGPS({offline: true, sourceCache: sourceCache, sourceMapConsumerCache: sourceMapConsumerCache});
gps.pinpoint(stack[0]).then(function(betterStackFrame) {
console.assert(betterStackFrame === new StackFrame({functionName: 'bar', fileName: 'http://localhost:9999/file.js', lineNumber: 2, columnNumber: 9}));
});
```
## Installation

@@ -44,16 +65,17 @@ ```

options: Object
* **sourceCache: Object (String URL => String Source)** - Pre-populate source cache to avoid network requests
* **sourceCache: Object (String URL : String Source)** - Pre-populate source cache to avoid network requests
* **sourceMapConsumerCache: Object (Source Mapping URL : SourceMap.SourceMapConsumer)** - Pre-populate source cache to avoid network requests
* **offline: Boolean (default false)** - Set to `true` to prevent all network requests
* **ajax: Function (String URL => Promise(responseText))** - Function to be used for making X-Domain requests
* **atob: Function (String => String)** - Function to convert base64-encoded strings to their original representation
#### `.pinpoint(stackframe)` => Promise(StackFrame)
Enhance function name and use source maps to produce a better StackFrame.
* **stackframe** - [StackFrame](https://github.com/stacktracejs/stackframe) or like object
* **stackframe** - [StackFrame](https://github.com/stacktracejs/stackframe) or like object
e.g. {fileName: 'path/to/file.js', lineNumber: 100, columnNumber: 5}
#### `.findFunctionName(stackframe)` => Promise(StackFrame)
Enhance function name and use source maps to produce a better StackFrame.
* **stackframe** - [StackFrame](https://github.com/stacktracejs/stackframe) or like object
#### `.getMappedLocation(stackframe)` => Promise(StackFrame)

@@ -60,0 +82,0 @@ Enhance function name and use source maps to produce a better StackFrame.

@@ -29,3 +29,4 @@ (function(root, factory) {

if (req.readyState === 4) {
if (req.status >= 200 && req.status < 300) {
if ((req.status >= 200 && req.status < 300) ||
(url.substr(0, 7) === 'file://' && req.responseText)) {
resolve(req.responseText);

@@ -66,8 +67,14 @@ } else {

function _findFunctionName(source, lineNumber/*, columnNumber*/) {
// function {name}({args}) m[1]=name m[2]=args
var reFunctionDeclaration = /function\s+([^(]*?)\s*\(([^)]*)\)/;
// {name} = function ({args}) TODO args capture
var reFunctionExpression = /['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*function\b/;
// {name} = eval()
var reFunctionEvaluation = /['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*(?:eval|new Function)\b/;
var syntaxes = [
// {name} = function ({args}) TODO args capture
/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*function\b/,
// function {name}({args}) m[1]=name m[2]=args
/function\s+([^('"`]*?)\s*\(([^)]*)\)/,
// {name} = eval()
/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*(?:eval|new Function)\b/,
// fn_name() {
/\b(?!(?:if|for|switch|while|with|catch)\b)(?:(?:static)\s+)?(\S+)\s*\(.*?\)\s*\{/,
// {name} = () => {
/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*\(.*?\)\s*=>/
];
var lines = source.split('\n');

@@ -78,3 +85,2 @@

var maxLines = Math.min(lineNumber, 20);
var m;
for (var i = 0; i < maxLines; ++i) {

@@ -90,14 +96,9 @@ // lineNo is 1-based, source[] is 0-based

code = line + code;
m = reFunctionExpression.exec(code);
if (m && m[1]) {
return m[1];
var len = syntaxes.length;
for (var index = 0; index < len; index++) {
var m = syntaxes[index].exec(code);
if (m && m[1]) {
return m[1];
}
}
m = reFunctionDeclaration.exec(code);
if (m && m[1]) {
return m[1];
}
m = reFunctionEvaluation.exec(code);
if (m && m[1]) {
return m[1];
}
}

@@ -132,3 +133,3 @@ }

function _findSourceMappingURL(source) {
var m = /\/\/[#@] ?sourceMappingURL=([^\s'"]+)\s*$/.exec(source);
var m = /\/\/[#@] ?sourceMappingURL=([^\s'"]+)\s*$/m.exec(source);
if (m && m[1]) {

@@ -141,7 +142,5 @@ return m[1];

function _extractLocationInfoFromSourceMap(stackframe, rawSourceMap, sourceCache) {
function _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache) {
return new Promise(function(resolve, reject) {
var mapConsumer = new SourceMap.SourceMapConsumer(rawSourceMap);
var loc = mapConsumer.originalPositionFor({
var loc = sourceMapConsumer.originalPositionFor({
line: stackframe.lineNumber,

@@ -152,13 +151,17 @@ column: stackframe.columnNumber

if (loc.source) {
var mappedSource = mapConsumer.sourceContentFor(loc.source);
// cache mapped sources
var mappedSource = sourceMapConsumer.sourceContentFor(loc.source);
if (mappedSource) {
sourceCache[loc.source] = mappedSource;
}
resolve(
new StackFrame(
loc.name || stackframe.functionName,
stackframe.args,
loc.source,
loc.line,
loc.column));
// given stackframe and source location, update stackframe
new StackFrame({
functionName: loc.name || stackframe.functionName,
args: stackframe.args,
fileName: loc.source,
lineNumber: loc.line,
columnNumber: loc.column
}));
} else {

@@ -174,2 +177,3 @@ reject(new Error('Could not get original source for given stackframe and source map'));

* opts.sourceCache = {url: "Source String"} => preload source cache
* opts.sourceMapConsumerCache = {/path/file.js.map: SourceMapConsumer}
* opts.offline = True to prevent network requests.

@@ -186,2 +190,3 @@ * Best effort without sources or source maps.

this.sourceCache = opts.sourceCache || {};
this.sourceMapConsumerCache = opts.sourceMapConsumerCache || {};

@@ -226,2 +231,33 @@ this.ajax = opts.ajax || _xdr;

/**
* Creating SourceMapConsumers is expensive, so this wraps the creation of a
* SourceMapConsumer in a per-instance cache.
*
* @param sourceMappingURL = {String} URL to fetch source map from
* @param defaultSourceRoot = Default source root for source map if undefined
* @returns {Promise} that resolves a SourceMapConsumer
*/
this._getSourceMapConsumer = function _getSourceMapConsumer(sourceMappingURL, defaultSourceRoot) {
return new Promise(function(resolve, reject) {
if (this.sourceMapConsumerCache[sourceMappingURL]) {
resolve(this.sourceMapConsumerCache[sourceMappingURL]);
} else {
var sourceMapConsumerPromise = new Promise(function(resolve, reject) {
return this._get(sourceMappingURL).then(function(sourceMapSource) {
if (typeof sourceMapSource === 'string') {
sourceMapSource = _parseJson(sourceMapSource.replace(/^\)\]\}'/, ''));
}
if (typeof sourceMapSource.sourceRoot === 'undefined') {
sourceMapSource.sourceRoot = defaultSourceRoot;
}
resolve(new SourceMap.SourceMapConsumer(sourceMapSource));
}, reject);
}.bind(this));
this.sourceMapConsumerCache[sourceMappingURL] = sourceMapConsumerPromise;
resolve(sourceMapConsumerPromise);
}
}.bind(this));
};
/**
* Given a StackFrame, enhance function name and use source maps for a

@@ -262,7 +298,9 @@ * better StackFrame.

if (guessedFunctionName) {
resolve(new StackFrame(guessedFunctionName,
stackframe.args,
stackframe.fileName,
lineNumber,
columnNumber));
resolve(new StackFrame({
functionName: guessedFunctionName,
args: stackframe.args,
fileName: stackframe.fileName,
lineNumber: lineNumber,
columnNumber: columnNumber
}));
} else {

@@ -291,21 +329,14 @@ resolve(stackframe);

var isDataUrl = sourceMappingURL.substr(0, 5) === 'data:';
var base = fileName.substring(0, fileName.lastIndexOf('/') + 1);
var defaultSourceRoot = fileName.substring(0, fileName.lastIndexOf('/') + 1);
if (sourceMappingURL[0] !== '/' && !isDataUrl && !(/^https?:\/\/|^\/\//i).test(sourceMappingURL)) {
sourceMappingURL = base + sourceMappingURL;
sourceMappingURL = defaultSourceRoot + sourceMappingURL;
}
this._get(sourceMappingURL).then(function(sourceMap) {
if (typeof sourceMap === 'string') {
sourceMap = _parseJson(sourceMap.replace(/^\)\]\}'/, ''));
}
if (typeof sourceMap.sourceRoot === 'undefined') {
sourceMap.sourceRoot = base;
}
_extractLocationInfoFromSourceMap(stackframe, sourceMap, sourceCache)
return this._getSourceMapConsumer(sourceMappingURL, defaultSourceRoot).then(function(sourceMapConsumer) {
return _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache)
.then(resolve)['catch'](function() {
resolve(stackframe);
});
}, reject)['catch'](reject);
});
}.bind(this), reject)['catch'](reject);

@@ -312,0 +343,0 @@ }.bind(this));

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc