From 659cdaad6f9b9eee2858ba3c89fe19d418c1ef7c Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 4 May 2018 10:58:52 -0600 Subject: [PATCH 1/4] Replace URL parser with real URL Fixes #275 --- dist/source-map.js | 2 +- lib/source-map-consumer.js | 4 +- lib/util.js | 73 ++++++++++---------------------- test/test-source-map-consumer.js | 4 +- test/test-util.js | 44 +++++++++---------- 5 files changed, 49 insertions(+), 78 deletions(-) diff --git a/dist/source-map.js b/dist/source-map.js index 16b740ce..01f0a4d5 100644 --- a/dist/source-map.js +++ b/dist/source-map.js @@ -1 +1 @@ -!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("path"),require("fs")):"function"==typeof define&&define.amd?define(["path","fs"],n):"object"==typeof exports?exports.sourceMap=n(require("path"),require("fs")):e.sourceMap=n(e.path,e.fs)}(window,function(e,n){return function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(n){return e[n]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=13)}([function(e,n){n.getArg=function(e,n,t){if(n in e)return e[n];if(3===arguments.length)return t;throw new Error('"'+n+'" is a required argument.')};const t=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,r=/^data:.+\,.+$/;function o(e){const n=e.match(t);return n?{scheme:n[1],auth:n[2],host:n[3],port:n[4],path:n[5]}:null}function i(e){let 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}n.urlParse=o,n.urlGenerate=i;const s=32;const l=function(e){const n=[];return function(t){for(let e=0;es&&n.pop(),r}}(function(e){let t=e;const r=o(e);if(r){if(!r.path)return e;t=r.path}const s=n.isAbsolute(t),l=[];let a=0,u=0;for(;;){if(a=u,-1===(u=t.indexOf("/",a))){l.push(t.slice(a));break}for(l.push(t.slice(a,u));u=0;u--){const e=l[u];"."===e?l.splice(u,1):".."===e?c++:c>0&&(""===e?(l.splice(u+1,c),c=0):(l.splice(u,2),c--))}return""===(t=l.join("/"))&&(t=s?"/":"."),r?(r.path=t,i(r)):t});function a(e,n){""===e&&(e="."),""===n&&(n=".");const t=o(n),s=o(e);if(s&&(e=s.path||"/"),t&&!t.scheme)return s&&(t.scheme=s.scheme),i(t);if(t||n.match(r))return n;if(s&&!s.host&&!s.path)return s.host=n,i(s);const a="/"===n.charAt(0)?n:l(e.replace(/\/+$/,"")+"/"+n);return s?(s.path=a,i(s)):a}n.normalize=l,n.join=a,n.isAbsolute=function(e){return"/"===e.charAt(0)||t.test(e)},n.relative=function(e,n){""===e&&(e="."),e=e.replace(/\/$/,"");let t=0;for(;0!==n.indexOf(e+"/");){const r=e.lastIndexOf("/");if(r<0)return n;if((e=e.slice(0,r)).match(/^([^\/]+:\/)?\/*$/))return n;++t}return Array(t+1).join("../")+n.substr(e.length+1)};const u=!("__proto__"in Object.create(null));function c(e){return e}function g(e){if(!e)return!1;const 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(let t=n-10;t>=0;t--)if(36!==e.charCodeAt(t))return!1;return!0}function p(e,n){return e===n?0:null===e?1:null===n?-1:e>n?1:-1}n.toSetString=u?c:function(e){return g(e)?"$"+e:e},n.fromSetString=u?c:function(e){return g(e)?e.slice(1):e},n.compareByOriginalPositions=function(e,n,t){let r=p(e.source,n.source);return 0!==r?r:0!=(r=e.originalLine-n.originalLine)?r:0!=(r=e.originalColumn-n.originalColumn)||t?r:0!=(r=e.generatedColumn-n.generatedColumn)?r:0!=(r=e.generatedLine-n.generatedLine)?r:p(e.name,n.name)},n.compareByGeneratedPositionsDeflated=function(e,n,t){let r=e.generatedLine-n.generatedLine;return 0!==r?r:0!=(r=e.generatedColumn-n.generatedColumn)||t?r:0!==(r=p(e.source,n.source))?r:0!=(r=e.originalLine-n.originalLine)?r:0!=(r=e.originalColumn-n.originalColumn)?r:p(e.name,n.name)},n.compareByGeneratedPositionsInflated=function(e,n){let t=e.generatedLine-n.generatedLine;return 0!==t?t:0!=(t=e.generatedColumn-n.generatedColumn)?t:0!==(t=p(e.source,n.source))?t:0!=(t=e.originalLine-n.originalLine)?t:0!=(t=e.originalColumn-n.originalColumn)?t:p(e.name,n.name)},n.parseSourceMapInput=function(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))},n.computeSourceURL=function(e,n,t){if(n=n||"",e&&("/"!==e[e.length-1]&&"/"!==n[0]&&(e+="/"),n=e+n),t){const e=o(t);if(!e)throw new Error("sourceMapURL could not be parsed");if(e.path){const n=e.path.lastIndexOf("/");n>=0&&(e.path=e.path.substring(0,n+1))}n=a(i(e),n)}return l(n)}},function(e,n,t){(function(n){if(function(){return"undefined"!=typeof window&&this===window}.call()){let n=null;e.exports=function(){if("string"==typeof n)return fetch(n).then(e=>e.arrayBuffer());if(n instanceof ArrayBuffer)return Promise.resolve(n);throw new Error("You must provide the string URL or ArrayBuffer contents of lib/mappings.wasm by calling SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using SourceMapConsumer")},e.exports.initialize=(e=>n=e)}else{const r=t(8),o=t(7);e.exports=function(){return new Promise((e,t)=>{const i=o.join(n,"mappings.wasm");r.readFile(i,null,(n,r)=>{n?t(n):e(r.buffer)})})},e.exports.initialize=(e=>{console.debug("SourceMapConsumer.initialize is a no-op when running in node.js")})}}).call(this,"/")},function(e,n){class t{constructor(){this._array=[],this._set=new Map}static fromArray(e,n){const r=new t;for(let t=0,o=e.length;t=0)return n;throw new Error('"'+e+'" is not in the set.')}at(e){if(e>=0&&e>>=5)>0&&(n|=32),t+=r.encode(n)}while(o>0);return t}},function(e,n,t){const r=t(3),o=t(0),i=t(2).ArraySet,s=t(11).MappingList;class l{constructor(e){e||(e={}),this._file=o.getArg(e,"file",null),this._sourceRoot=o.getArg(e,"sourceRoot",null),this._skipValidation=o.getArg(e,"skipValidation",!1),this._sources=new i,this._names=new i,this._mappings=new s,this._sourcesContents=null}static fromSourceMap(e){const n=e.sourceRoot,t=new l({file:e.file,sourceRoot:n});return e.eachMapping(function(e){const r={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(r.source=e.source,null!=n&&(r.source=o.relative(n,r.source)),r.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(r.name=e.name)),t.addMapping(r)}),e.sources.forEach(function(r){let i=r;null!==n&&(i=o.relative(n,r)),t._sources.has(i)||t._sources.add(i);const s=e.sourceContentFor(r);null!=s&&t.setSourceContent(r,s)}),t}addMapping(e){const n=o.getArg(e,"generated"),t=o.getArg(e,"original",null);let r=o.getArg(e,"source",null),i=o.getArg(e,"name",null);this._skipValidation||this._validateMapping(n,t,r,i),null!=r&&(r=String(r),this._sources.has(r)||this._sources.add(r)),null!=i&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:n.line,generatedColumn:n.column,originalLine:null!=t&&t.line,originalColumn:null!=t&&t.column,source:r,name:i})}setSourceContent(e,n){let t=e;null!=this._sourceRoot&&(t=o.relative(this._sourceRoot,t)),null!=n?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[o.toSetString(t)]=n):this._sourcesContents&&(delete this._sourcesContents[o.toSetString(t)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))}applySourceMap(e,n,t){let r=n;if(null==n){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');r=e.file}const s=this._sourceRoot;null!=s&&(r=o.relative(s,r));const l=this._mappings.toArray().length>0?new i:this._sources,a=new i;this._mappings.unsortedForEach(function(n){if(n.source===r&&null!=n.originalLine){const r=e.originalPositionFor({line:n.originalLine,column:n.originalColumn});null!=r.source&&(n.source=r.source,null!=t&&(n.source=o.join(t,n.source)),null!=s&&(n.source=o.relative(s,n.source)),n.originalLine=r.line,n.originalColumn=r.column,null!=r.name&&(n.name=r.name))}const i=n.source;null==i||l.has(i)||l.add(i);const u=n.name;null==u||a.has(u)||a.add(u)},this),this._sources=l,this._names=a,e.sources.forEach(function(n){const r=e.sourceContentFor(n);null!=r&&(null!=t&&(n=o.join(t,n)),null!=s&&(n=o.relative(s,n)),this.setSourceContent(n,r))},this)}_validateMapping(e,n,t,r){if(n&&"number"!=typeof n.line&&"number"!=typeof n.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!n&&!t&&!r);else if(!(e&&"line"in e&&"column"in e&&n&&"line"in n&&"column"in n&&e.line>0&&e.column>=0&&n.line>0&&n.column>=0&&t))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:t,original:n,name:r}))}_serializeMappings(){let e,n,t,i,s=0,l=1,a=0,u=0,c=0,g=0,p="";const h=this._mappings.toArray();for(let m=0,d=h.length;m0){if(!o.compareByGeneratedPositionsInflated(n,h[m-1]))continue;e+=","}e+=r.encode(n.generatedColumn-s),s=n.generatedColumn,null!=n.source&&(i=this._sources.indexOf(n.source),e+=r.encode(i-g),g=i,e+=r.encode(n.originalLine-1-u),u=n.originalLine-1,e+=r.encode(n.originalColumn-a),a=n.originalColumn,null!=n.name&&(t=this._names.indexOf(n.name),e+=r.encode(t-c),c=t)),p+=e}return p}_generateSourcesContent(e,n){return e.map(function(e){if(!this._sourcesContents)return null;null!=n&&(e=o.relative(n,e));const t=o.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,t)?this._sourcesContents[t]:null},this)}toJSON(){const e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e}toString(){return JSON.stringify(this.toJSON())}}l.prototype._version=3,n.SourceMapGenerator=l},function(e,n,t){const r=t(4).SourceMapGenerator,o=t(0),i=/(\r?\n)/,s=10,l="$$$isSourceNode$$$";class a{constructor(e,n,t,r,o){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==n?null:n,this.source=null==t?null:t,this.name=null==o?null:o,this[l]=!0,null!=r&&this.add(r)}static fromStringWithSourceMap(e,n,t){const r=new a,s=e.split(i);let l=0;const u=function(){return e()+(e()||"");function e(){return l=0;n--)this.prepend(e[n]);else{if(!e[l]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this}walk(e){let n;for(let t=0,r=this.children.length;t0){for(n=[],t=0;tWebAssembly.instantiate(n,{env:{mapping_callback(n,t,r,o,i,s,l,a,u,c){const g=new function(){this.generatedLine=0,this.generatedColumn=0,this.lastGeneratedColumn=null,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null};g.generatedLine=n+1,g.generatedColumn=t,r&&(g.lastGeneratedColumn=o-1),i&&(g.source=s,g.originalLine=l+1,g.originalColumn=a,u&&(g.name=c)),e[e.length-1](g)},start_all_generated_locations_for(){console.time("all_generated_locations_for")},end_all_generated_locations_for(){console.timeEnd("all_generated_locations_for")},start_compute_column_spans(){console.time("compute_column_spans")},end_compute_column_spans(){console.timeEnd("compute_column_spans")},start_generated_location_for(){console.time("generated_location_for")},end_generated_location_for(){console.timeEnd("generated_location_for")},start_original_location_for(){console.time("original_location_for")},end_original_location_for(){console.timeEnd("original_location_for")},start_parse_mappings(){console.time("parse_mappings")},end_parse_mappings(){console.timeEnd("parse_mappings")},start_sort_by_generated_location(){console.time("sort_by_generated_location")},end_sort_by_generated_location(){console.timeEnd("sort_by_generated_location")},start_sort_by_original_location(){console.time("sort_by_original_location")},end_sort_by_original_location(){console.timeEnd("sort_by_original_location")}}})).then(n=>({exports:n.instance.exports,withMappingCallback:(n,t)=>{e.push(n);try{t()}finally{e.pop()}}})).then(null,e=>{throw o=null,e})}},function(n,t){n.exports=e},function(e,t){e.exports=n},function(e,n){n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.search=function(e,t,r,o){if(0===t.length)return-1;let i=function e(t,r,o,i,s,l){const a=Math.floor((r-t)/2)+t,u=s(o,i[a],!0);return 0===u?a:u>0?r-a>1?e(a,r,o,i,s,l):l==n.LEAST_UPPER_BOUND?r1?e(t,a,o,i,s,l):l==n.LEAST_UPPER_BOUND?a:t<0?-1:t}(-1,t.length,e,t,r,o||n.GREATEST_LOWER_BOUND);if(i<0)return-1;for(;i-1>=0&&0===r(t[i],t[i-1],!0);)--i;return i}},function(e,n,t){const r=t(0),o=t(9),i=t(2).ArraySet,s=(t(3),t(1)),l=t(6),a=Symbol("smcInternal");class u{constructor(e,n){return e==a?Promise.resolve(this):function(e,n){let t=e;"string"==typeof e&&(t=r.parseSourceMapInput(e));const o=null!=t.sections?new g(t,n):new c(t,n);return Promise.resolve(o)}(e,n)}static initialize(e){s.initialize(e["lib/mappings.wasm"])}static fromSourceMap(e,n){return function(e,n){return c.fromSourceMap(e,n)}(e,n)}static async with(e,n,t){const r=await new u(e,n);try{return await t(r)}finally{r.destroy()}}_parseMappings(e,n){throw new Error("Subclasses must implement _parseMappings")}eachMapping(e,n,t){throw new Error("Subclasses must implement eachMapping")}allGeneratedPositionsFor(e){throw new Error("Subclasses must implement allGeneratedPositionsFor")}destroy(){throw new Error("Subclasses must implement destroy")}}u.prototype._version=3,u.GENERATED_ORDER=1,u.ORIGINAL_ORDER=2,u.GREATEST_LOWER_BOUND=1,u.LEAST_UPPER_BOUND=2,n.SourceMapConsumer=u;class c extends u{constructor(e,n){return super(a).then(t=>{let o=e;"string"==typeof e&&(o=r.parseSourceMapInput(e));const s=r.getArg(o,"version");let a=r.getArg(o,"sources");const u=r.getArg(o,"names",[]);let c=r.getArg(o,"sourceRoot",null);const g=r.getArg(o,"sourcesContent",null),p=r.getArg(o,"mappings"),h=r.getArg(o,"file",null);if(s!=t._version)throw new Error("Unsupported version: "+s);return c&&(c=r.normalize(c)),a=a.map(String).map(r.normalize).map(function(e){return c&&r.isAbsolute(c)&&r.isAbsolute(e)?r.relative(c,e):e}),t._names=i.fromArray(u.map(String),!0),t._sources=i.fromArray(a,!0),t._absoluteSources=t._sources.toArray().map(function(e){return r.computeSourceURL(c,e,n)}),t.sourceRoot=c,t.sourcesContent=g,t._mappings=p,t._sourceMapURL=n,t.file=h,t._computedColumnSpans=!1,t._mappingsPtr=0,t._wasm=null,l().then(e=>(t._wasm=e,t))})}_findSourceIndex(e){let n=e;if(null!=this.sourceRoot&&(n=r.relative(this.sourceRoot,n)),this._sources.has(n))return this._sources.indexOf(n);for(let n=0;n{null!==n.source&&(n.source=this._sources.at(n.source),n.source=r.computeSourceURL(s,n.source,this._sourceMapURL),null!==n.name&&(n.name=this._names.at(n.name))),e.call(o,n)},()=>{switch(i){case u.GENERATED_ORDER:this._wasm.exports.by_generated_location(this._getMappingsPtr());break;case u.ORIGINAL_ORDER:this._wasm.exports.by_original_location(this._getMappingsPtr());break;default:throw new Error("Unknown order of iteration.")}})}allGeneratedPositionsFor(e){let n=r.getArg(e,"source");const t=r.getArg(e,"line"),o=e.column||0;if((n=this._findSourceIndex(n))<0)return[];if(t<1)throw new Error("Line numbers must be >= 1");if(o<0)throw new Error("Column numbers must be >= 0");const i=[];return this._wasm.withMappingCallback(e=>{let n=e.lastGeneratedColumn;this._computedColumnSpans&&null===n&&(n=1/0),i.push({line:e.generatedLine,column:e.generatedColumn,lastColumn:n})},()=>{this._wasm.exports.all_generated_locations_for(this._getMappingsPtr(),n,t-1,"column"in e,o)}),i}destroy(){0!==this._mappingsPtr&&(this._wasm.exports.free_mappings(this._mappingsPtr),this._mappingsPtr=0)}computeColumnSpans(){this._computedColumnSpans||(this._wasm.exports.compute_column_spans(this._getMappingsPtr()),this._computedColumnSpans=!0)}originalPositionFor(e){const n={generatedLine:r.getArg(e,"line"),generatedColumn:r.getArg(e,"column")};if(n.generatedLine<1)throw new Error("Line numbers must be >= 1");if(n.generatedColumn<0)throw new Error("Column numbers must be >= 0");let t,o=r.getArg(e,"bias",u.GREATEST_LOWER_BOUND);if(null==o&&(o=u.GREATEST_LOWER_BOUND),this._wasm.withMappingCallback(e=>t=e,()=>{this._wasm.exports.original_location_for(this._getMappingsPtr(),n.generatedLine-1,n.generatedColumn,o)}),t&&t.generatedLine===n.generatedLine){let e=r.getArg(t,"source",null);null!==e&&(e=this._sources.at(e),e=r.computeSourceURL(this.sourceRoot,e,this._sourceMapURL));let n=r.getArg(t,"name",null);return null!==n&&(n=this._names.at(n)),{source:e,line:r.getArg(t,"originalLine",null),column:r.getArg(t,"originalColumn",null),name:n}}return{source:null,line:null,column:null,name:null}}hasContentsOfAllSources(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))}sourceContentFor(e,n){if(!this.sourcesContent)return null;const t=this._findSourceIndex(e);if(t>=0)return this.sourcesContent[t];let o,i=e;if(null!=this.sourceRoot&&(i=r.relative(this.sourceRoot,i)),null!=this.sourceRoot&&(o=r.urlParse(this.sourceRoot))){const e=i.replace(/^file:\/\//,"");if("file"==o.scheme&&this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];if((!o.path||"/"==o.path)&&this._sources.has("/"+i))return this.sourcesContent[this._sources.indexOf("/"+i)]}if(n)return null;throw new Error('"'+i+'" is not in the SourceMap.')}generatedPositionFor(e){let n=r.getArg(e,"source");if((n=this._findSourceIndex(n))<0)return{line:null,column:null,lastColumn:null};const t={source:n,originalLine:r.getArg(e,"line"),originalColumn:r.getArg(e,"column")};if(t.originalLine<1)throw new Error("Line numbers must be >= 1");if(t.originalColumn<0)throw new Error("Column numbers must be >= 0");let o,i=r.getArg(e,"bias",u.GREATEST_LOWER_BOUND);if(null==i&&(i=u.GREATEST_LOWER_BOUND),this._wasm.withMappingCallback(e=>o=e,()=>{this._wasm.exports.generated_location_for(this._getMappingsPtr(),t.source,t.originalLine-1,t.originalColumn,i)}),o&&o.source===t.source){let e=o.lastGeneratedColumn;return this._computedColumnSpans&&null===e&&(e=1/0),{line:r.getArg(o,"generatedLine",null),column:r.getArg(o,"generatedColumn",null),lastColumn:e}}return{line:null,column:null,lastColumn:null}}}c.prototype.consumer=u,n.BasicSourceMapConsumer=c;class g extends u{constructor(e,n){return super(a).then(t=>{let o=e;"string"==typeof e&&(o=r.parseSourceMapInput(e));const s=r.getArg(o,"version"),l=r.getArg(o,"sections");if(s!=t._version)throw new Error("Unsupported version: "+s);t._sources=new i,t._names=new i,t.__generatedMappings=null,t.__originalMappings=null,t.__generatedMappingsUnsorted=null,t.__originalMappingsUnsorted=null;let a={line:-1,column:0};return Promise.all(l.map(e=>{if(e.url)throw new Error("Support for url field in sections not implemented.");const t=r.getArg(e,"offset"),o=r.getArg(t,"line"),i=r.getArg(t,"column");if(o({generatedOffset:{generatedLine:o+1,generatedColumn:i+1},consumer:e}))})).then(e=>(t._sections=e,t))})}get _generatedMappings(){return this.__generatedMappings||this._sortGeneratedMappings(),this.__generatedMappings}get _originalMappings(){return this.__originalMappings||this._sortOriginalMappings(),this.__originalMappings}get _generatedMappingsUnsorted(){return this.__generatedMappingsUnsorted||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappingsUnsorted}get _originalMappingsUnsorted(){return this.__originalMappingsUnsorted||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappingsUnsorted}_sortGeneratedMappings(){const e=this._generatedMappingsUnsorted;e.sort(r.compareByGeneratedPositionsDeflated),this.__generatedMappings=e}_sortOriginalMappings(){const e=this._originalMappingsUnsorted;e.sort(r.compareByOriginalPositions),this.__originalMappings=e}get sources(){const e=[];for(let n=0;ni.push(e));for(let e=0;e= 1");if(t.originalColumn<0)throw new Error("Column numbers must be >= 0");const i=[];let s=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",r.compareByOriginalPositions,o.LEAST_UPPER_BOUND);if(s>=0){let t=this._originalMappings[s];if(void 0===e.column){const e=t.originalLine;for(;t&&t.originalLine===e;){let e=t.lastGeneratedColumn;this._computedColumnSpans&&null===e&&(e=1/0),i.push({line:r.getArg(t,"generatedLine",null),column:r.getArg(t,"generatedColumn",null),lastColumn:e}),t=this._originalMappings[++s]}}else{const e=t.originalColumn;for(;t&&t.originalLine===n&&t.originalColumn==e;){let e=t.lastGeneratedColumn;this._computedColumnSpans&&null===e&&(e=1/0),i.push({line:r.getArg(t,"generatedLine",null),column:r.getArg(t,"generatedColumn",null),lastColumn:e}),t=this._originalMappings[++s]}}}return i}destroy(){for(let e=0;et||o==t&&s>=i||r.compareByGeneratedPositionsInflated(e,n)<=0}(this._last,e)?(this._sorted=!1,this._array.push(e)):(this._last=e,this._array.push(e))}toArray(){return this._sorted||(this._array.sort(r.compareByGeneratedPositionsInflated),this._sorted=!0),this._array}}},function(e,n){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");n.encode=function(e){if(0<=e&&ei&&n.pop(),r}}(function(e){let t=e;const r=s(e);if(r){if(!r.pathname)return e;t=r.pathname}const o=n.isAbsolute(t),i=[];let a=0,l=0;for(;;){if(a=l,-1===(l=t.indexOf("/",a))){i.push(t.slice(a));break}for(i.push(t.slice(a,l));l=0;l--){const e=i[l];"."===e?i.splice(l,1):".."===e?u++:u>0&&(""===e?(i.splice(l+1,u),u=0):(i.splice(l,2),u--))}return""===(t=i.join("/"))&&(t=o?"/":"."),r?(r.pathname=t,r.toString()):t});function l(e,n){""===e&&(e="."),""===n&&(n=".");const t=s(n),r=s(e);if(r&&(e=r.pathname||"/"),t&&!t.protocol)return r&&(t.protocol=r.protocol),t.toString();if(t||n.match(o))return n;if(r&&!r.host&&!r.pathname)return r.host=n,r.toString();const i="/"===n.charAt(0)?n:a(e.replace(/\/+$/,"")+"/"+n);return r?(r.pathname=i,r.toString()):i}n.normalize=a,n.join=l,n.isAbsolute=function(e){return"/"===e.charAt(0)||!!s(e)},n.relative=function(e,n){""===e&&(e="."),e=e.replace(/\/$/,"");let t=0;for(;0!==n.indexOf(e+"/");){const r=e.lastIndexOf("/");if(r<0)return n;if((e=e.slice(0,r)).match(/^([^\/]+:\/)?\/*$/))return n;++t}return Array(t+1).join("../")+n.substr(e.length+1)};const u=!("__proto__"in Object.create(null));function c(e){return e}function h(e){if(!e)return!1;const 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(let t=n-10;t>=0;t--)if(36!==e.charCodeAt(t))return!1;return!0}function p(e,n){return e===n?0:null===e?1:null===n?-1:e>n?1:-1}n.toSetString=u?c:function(e){return h(e)?"$"+e:e},n.fromSetString=u?c:function(e){return h(e)?e.slice(1):e},n.compareByOriginalPositions=function(e,n,t){let r=p(e.source,n.source);return 0!==r?r:0!=(r=e.originalLine-n.originalLine)?r:0!=(r=e.originalColumn-n.originalColumn)||t?r:0!=(r=e.generatedColumn-n.generatedColumn)?r:0!=(r=e.generatedLine-n.generatedLine)?r:p(e.name,n.name)},n.compareByGeneratedPositionsDeflated=function(e,n,t){let r=e.generatedLine-n.generatedLine;return 0!==r?r:0!=(r=e.generatedColumn-n.generatedColumn)||t?r:0!==(r=p(e.source,n.source))?r:0!=(r=e.originalLine-n.originalLine)?r:0!=(r=e.originalColumn-n.originalColumn)?r:p(e.name,n.name)},n.compareByGeneratedPositionsInflated=function(e,n){let t=e.generatedLine-n.generatedLine;return 0!==t?t:0!=(t=e.generatedColumn-n.generatedColumn)?t:0!==(t=p(e.source,n.source))?t:0!=(t=e.originalLine-n.originalLine)?t:0!=(t=e.originalColumn-n.originalColumn)?t:p(e.name,n.name)},n.parseSourceMapInput=function(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))},n.computeSourceURL=function(e,n,t){if(n=n||"",e&&("/"!==e[e.length-1]&&"/"!==n[0]&&(e+="/"),n=e+n),t){const e=s(t);if(!e)throw new Error("sourceMapURL could not be parsed");if(e.pathname){const n=e.pathname.lastIndexOf("/");n>=0&&(e.pathname=e.pathname.substring(0,n+1))}n=l(e.toString(),n)}return a(n)}},function(e,n,t){const r=t(2),o=t(0),s=t(3).ArraySet,i=t(15).MappingList;class a{constructor(e){e||(e={}),this._file=o.getArg(e,"file",null),this._sourceRoot=o.getArg(e,"sourceRoot",null),this._skipValidation=o.getArg(e,"skipValidation",!1),this._sources=new s,this._names=new s,this._mappings=new i,this._sourcesContents=null}static fromSourceMap(e){const n=e.sourceRoot,t=new a({file:e.file,sourceRoot:n});return e.eachMapping(function(e){const r={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(r.source=e.source,null!=n&&(r.source=o.relative(n,r.source)),r.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(r.name=e.name)),t.addMapping(r)}),e.sources.forEach(function(r){let s=r;null!==n&&(s=o.relative(n,r)),t._sources.has(s)||t._sources.add(s);const i=e.sourceContentFor(r);null!=i&&t.setSourceContent(r,i)}),t}addMapping(e){const n=o.getArg(e,"generated"),t=o.getArg(e,"original",null);let r=o.getArg(e,"source",null),s=o.getArg(e,"name",null);this._skipValidation||this._validateMapping(n,t,r,s),null!=r&&(r=String(r),this._sources.has(r)||this._sources.add(r)),null!=s&&(s=String(s),this._names.has(s)||this._names.add(s)),this._mappings.add({generatedLine:n.line,generatedColumn:n.column,originalLine:null!=t&&t.line,originalColumn:null!=t&&t.column,source:r,name:s})}setSourceContent(e,n){let t=e;null!=this._sourceRoot&&(t=o.relative(this._sourceRoot,t)),null!=n?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[o.toSetString(t)]=n):this._sourcesContents&&(delete this._sourcesContents[o.toSetString(t)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))}applySourceMap(e,n,t){let r=n;if(null==n){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');r=e.file}const i=this._sourceRoot;null!=i&&(r=o.relative(i,r));const a=this._mappings.toArray().length>0?new s:this._sources,l=new s;this._mappings.unsortedForEach(function(n){if(n.source===r&&null!=n.originalLine){const r=e.originalPositionFor({line:n.originalLine,column:n.originalColumn});null!=r.source&&(n.source=r.source,null!=t&&(n.source=o.join(t,n.source)),null!=i&&(n.source=o.relative(i,n.source)),n.originalLine=r.line,n.originalColumn=r.column,null!=r.name&&(n.name=r.name))}const s=n.source;null==s||a.has(s)||a.add(s);const u=n.name;null==u||l.has(u)||l.add(u)},this),this._sources=a,this._names=l,e.sources.forEach(function(n){const r=e.sourceContentFor(n);null!=r&&(null!=t&&(n=o.join(t,n)),null!=i&&(n=o.relative(i,n)),this.setSourceContent(n,r))},this)}_validateMapping(e,n,t,r){if(n&&"number"!=typeof n.line&&"number"!=typeof n.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!n&&!t&&!r);else if(!(e&&"line"in e&&"column"in e&&n&&"line"in n&&"column"in n&&e.line>0&&e.column>=0&&n.line>0&&n.column>=0&&t))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:t,original:n,name:r}))}_serializeMappings(){let e,n,t,s,i=0,a=1,l=0,u=0,c=0,h=0,p="";const g=this._mappings.toArray();for(let f=0,m=g.length;f0){if(!o.compareByGeneratedPositionsInflated(n,g[f-1]))continue;e+=","}e+=r.encode(n.generatedColumn-i),i=n.generatedColumn,null!=n.source&&(s=this._sources.indexOf(n.source),e+=r.encode(s-h),h=s,e+=r.encode(n.originalLine-1-u),u=n.originalLine-1,e+=r.encode(n.originalColumn-l),l=n.originalColumn,null!=n.name&&(t=this._names.indexOf(n.name),e+=r.encode(t-c),c=t)),p+=e}return p}_generateSourcesContent(e,n){return e.map(function(e){if(!this._sourcesContents)return null;null!=n&&(e=o.relative(n,e));const t=o.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,t)?this._sourcesContents[t]:null},this)}toJSON(){const e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e}toString(){return JSON.stringify(this.toJSON())}}a.prototype._version=3,n.SourceMapGenerator=a},function(e,n,t){const r=t(6);n.encode=function(e){let n,t="",o=function(e){return e<0?1+(-e<<1):0+(e<<1)}(e);do{n=31&o,(o>>>=5)>0&&(n|=32),t+=r.encode(n)}while(o>0);return t}},function(e,n){class t{constructor(){this._array=[],this._set=new Map}static fromArray(e,n){const r=new t;for(let t=0,o=e.length;t=0)return n;throw new Error('"'+e+'" is not in the set.')}at(e){if(e>=0&&ee.arrayBuffer());if(n instanceof ArrayBuffer)return Promise.resolve(n);throw new Error("You must provide the string URL or ArrayBuffer contents of lib/mappings.wasm by calling SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using SourceMapConsumer")},e.exports.initialize=(e=>n=e)}else{const r=t(18),o=t(19);e.exports=function(){return new Promise((e,t)=>{const s=o.join(n,"mappings.wasm");r.readFile(s,null,(n,r)=>{n?t(n):e(r.buffer)})})},e.exports.initialize=(e=>{console.debug("SourceMapConsumer.initialize is a no-op when running in node.js")})}}).call(this,"/")},function(e,n,t){n.SourceMapGenerator=t(1).SourceMapGenerator,n.SourceMapConsumer=t(16).SourceMapConsumer,n.SourceNode=t(21).SourceNode},function(e,n){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");n.encode=function(e){if(0<=e&&e",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(u),h=["%","/","?",";","#"].concat(c),p=["/","?","#"],g=/^[+a-z0-9A-Z_-]{0,63}$/,f=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},d={javascript:!0,"javascript:":!0},_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},C=t(12);function y(e,n,t){if(e&&o.isObject(e)&&e instanceof s)return e;var r=new s;return r.parse(e,n,t),r}s.prototype.parse=function(e,n,t){if(!o.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var s=e.indexOf("?"),a=-1!==s&&s127?U+="x":U+=P[I];if(!U.match(g)){var G=x.slice(0,M),k=x.slice(M+1),T=P.match(f);T&&(G.push(T[1]),k.unshift(T[2])),k.length&&(y="/"+k.join(".")+y),this.hostname=G.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),R||(this.hostname=r.toASCII(this.hostname));var q=this.port?":"+this.port:"",D=this.hostname||"";this.host=D+q,this.href+=this.host,R&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==y[0]&&(y="/"+y))}if(!m[S])for(M=0,j=c.length;M0)&&t.host.split("@"))&&(t.auth=R.shift(),t.host=t.hostname=R.shift());return t.search=e.search,t.query=e.query,o.isNull(t.pathname)&&o.isNull(t.search)||(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.href=t.format(),t}if(!v.length)return t.pathname=null,t.search?t.path="/"+t.search:t.path=null,t.href=t.format(),t;for(var O=v.slice(-1)[0],L=(t.host||e.host||v.length>1)&&("."===O||".."===O)||""===O,M=0,E=v.length;E>=0;E--)"."===(O=v[E])?v.splice(E,1):".."===O?(v.splice(E,1),M++):M&&(v.splice(E,1),M--);if(!b&&!S)for(;M--;M)v.unshift("..");!b||""===v[0]||v[0]&&"/"===v[0].charAt(0)||v.unshift(""),L&&"/"!==v.join("/").substr(-1)&&v.push("");var R,x=""===v[0]||v[0]&&"/"===v[0].charAt(0);A&&(t.hostname=t.host=x?"":v.length?v.shift():"",(R=!!(t.host&&t.host.indexOf("@")>0)&&t.host.split("@"))&&(t.auth=R.shift(),t.host=t.hostname=R.shift()));return(b=b||t.host&&v.length)&&!x&&v.unshift(""),v.length?t.pathname=v.join("/"):(t.pathname=null,t.path=null),o.isNull(t.pathname)&&o.isNull(t.search)||(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.auth=e.auth||t.auth,t.slashes=t.slashes||e.slashes,t.href=t.format(),t},s.prototype.parseHost=function(){var e=this.host,n=a.exec(e);n&&(":"!==(n=n[0])&&(this.port=n.substr(1)),e=e.substr(0,e.length-n.length)),e&&(this.hostname=e)}},function(e,n,t){(function(e,r){var o;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(s){"object"==typeof n&&n&&n.nodeType,"object"==typeof e&&e&&e.nodeType;var i="object"==typeof r&&r;i.global!==i&&i.window!==i&&i.self;var a,l=2147483647,u=36,c=1,h=26,p=38,g=700,f=72,m=128,d="-",_=/^xn--/,C=/[^\x20-\x7E]/,y=/[\x2E\u3002\uFF0E\uFF61]/g,w={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},b=u-c,S=Math.floor,v=String.fromCharCode;function A(e){throw new RangeError(w[e])}function O(e,n){for(var t=e.length,r=[];t--;)r[t]=n(e[t]);return r}function L(e,n){var t=e.split("@"),r="";return t.length>1&&(r=t[0]+"@",e=t[1]),r+O((e=e.replace(y,".")).split("."),n).join(".")}function M(e){for(var n,t,r=[],o=0,s=e.length;o=55296&&n<=56319&&o65535&&(n+=v((e-=65536)>>>10&1023|55296),e=56320|1023&e),n+=v(e)}).join("")}function R(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:u}function x(e,n){return e+22+75*(e<26)-((0!=n)<<5)}function j(e,n,t){var r=0;for(e=t?S(e/g):e>>1,e+=S(e/n);e>b*h>>1;r+=u)e=S(e/b);return S(r+(b+1)*e/(e+p))}function P(e){var n,t,r,o,s,i,a,p,g,_,C=[],y=e.length,w=0,b=m,v=f;for((t=e.lastIndexOf(d))<0&&(t=0),r=0;r=128&&A("not-basic"),C.push(e.charCodeAt(r));for(o=t>0?t+1:0;o=y&&A("invalid-input"),((p=R(e.charCodeAt(o++)))>=u||p>S((l-w)/i))&&A("overflow"),w+=p*i,!(p<(g=a<=v?c:a>=v+h?h:a-v));a+=u)i>S(l/(_=u-g))&&A("overflow"),i*=_;v=j(w-s,n=C.length+1,0==s),S(w/n)>l-b&&A("overflow"),b+=S(w/n),w%=n,C.splice(w++,0,b)}return E(C)}function U(e){var n,t,r,o,s,i,a,p,g,_,C,y,w,b,O,L=[];for(y=(e=M(e)).length,n=m,t=0,s=f,i=0;i=n&&CS((l-t)/(w=r+1))&&A("overflow"),t+=(a-n)*w,n=a,i=0;il&&A("overflow"),C==n){for(p=t,g=u;!(p<(_=g<=s?c:g>=s+h?h:g-s));g+=u)O=p-_,b=u-_,L.push(v(x(_+O%b,0))),p=S(O/b);L.push(v(x(p,0))),s=j(t,w,r==o),t=0,++r}++t,++n}return L.join("")}a={version:"1.4.1",ucs2:{decode:M,encode:E},decode:P,encode:U,toASCII:function(e){return L(e,function(e){return C.test(e)?"xn--"+U(e):e})},toUnicode:function(e){return L(e,function(e){return _.test(e)?P(e.slice(4).toLowerCase()):e})}},void 0===(o=function(){return a}.call(n,t,n,e))||(e.exports=o)}()}).call(this,t(9)(e),t(10))},function(e,n){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,n){var t;t=function(){return this}();try{t=t||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(t=window)}e.exports=t},function(e,n,t){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,n,t){"use strict";n.decode=n.parse=t(13),n.encode=n.stringify=t(14)},function(e,n,t){"use strict";function r(e,n){return Object.prototype.hasOwnProperty.call(e,n)}e.exports=function(e,n,t,s){n=n||"&",t=t||"=";var i={};if("string"!=typeof e||0===e.length)return i;var a=/\+/g;e=e.split(n);var l=1e3;s&&"number"==typeof s.maxKeys&&(l=s.maxKeys);var u=e.length;l>0&&u>l&&(u=l);for(var c=0;c=0?(h=m.substr(0,d),p=m.substr(d+1)):(h=m,p=""),g=decodeURIComponent(h),f=decodeURIComponent(p),r(i,g)?o(i[g])?i[g].push(f):i[g]=[i[g],f]:i[g]=f}return i};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,n,t){"use strict";var r=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,n,t,a){return n=n||"&",t=t||"=",null===e&&(e=void 0),"object"==typeof e?s(i(e),function(i){var a=encodeURIComponent(r(i))+t;return o(e[i])?s(e[i],function(e){return a+encodeURIComponent(r(e))}).join(n):a+encodeURIComponent(r(e[i]))}).join(n):a?encodeURIComponent(r(a))+t+encodeURIComponent(r(e)):""};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function s(e,n){if(e.map)return e.map(n);for(var t=[],r=0;rt||o==t&&i>=s||r.compareByGeneratedPositionsInflated(e,n)<=0}(this._last,e)?(this._sorted=!1,this._array.push(e)):(this._last=e,this._array.push(e))}toArray(){return this._sorted||(this._array.sort(r.compareByGeneratedPositionsInflated),this._sorted=!0),this._array}}},function(e,n,t){const r=t(0),o=t(17),s=t(3).ArraySet,i=(t(2),t(4)),a=t(20),l=Symbol("smcInternal");class u{constructor(e,n){return e==l?Promise.resolve(this):function(e,n){let t=e;"string"==typeof e&&(t=r.parseSourceMapInput(e));const o=null!=t.sections?new h(t,n):new c(t,n);return Promise.resolve(o)}(e,n)}static initialize(e){i.initialize(e["lib/mappings.wasm"])}static fromSourceMap(e,n){return function(e,n){return c.fromSourceMap(e,n)}(e,n)}static async with(e,n,t){const r=await new u(e,n);try{return await t(r)}finally{r.destroy()}}_parseMappings(e,n){throw new Error("Subclasses must implement _parseMappings")}eachMapping(e,n,t){throw new Error("Subclasses must implement eachMapping")}allGeneratedPositionsFor(e){throw new Error("Subclasses must implement allGeneratedPositionsFor")}destroy(){throw new Error("Subclasses must implement destroy")}}u.prototype._version=3,u.GENERATED_ORDER=1,u.ORIGINAL_ORDER=2,u.GREATEST_LOWER_BOUND=1,u.LEAST_UPPER_BOUND=2,n.SourceMapConsumer=u;class c extends u{constructor(e,n){return super(l).then(t=>{let o=e;"string"==typeof e&&(o=r.parseSourceMapInput(e));const i=r.getArg(o,"version");let l=r.getArg(o,"sources");const u=r.getArg(o,"names",[]);let c=r.getArg(o,"sourceRoot",null);const h=r.getArg(o,"sourcesContent",null),p=r.getArg(o,"mappings"),g=r.getArg(o,"file",null);if(i!=t._version)throw new Error("Unsupported version: "+i);return c&&(c=r.normalize(c)),l=l.map(String).map(r.normalize).map(function(e){return c&&r.isAbsolute(c)&&r.isAbsolute(e)?r.relative(c,e):e}),t._names=s.fromArray(u.map(String),!0),t._sources=s.fromArray(l,!0),t._absoluteSources=t._sources.toArray().map(function(e){return r.computeSourceURL(c,e,n)}),t.sourceRoot=c,t.sourcesContent=h,t._mappings=p,t._sourceMapURL=n,t.file=g,t._computedColumnSpans=!1,t._mappingsPtr=0,t._wasm=null,a().then(e=>(t._wasm=e,t))})}_findSourceIndex(e){let n=e;if(null!=this.sourceRoot&&(n=r.relative(this.sourceRoot,n)),this._sources.has(n))return this._sources.indexOf(n);for(let n=0;n{null!==n.source&&(n.source=this._sources.at(n.source),n.source=r.computeSourceURL(i,n.source,this._sourceMapURL),null!==n.name&&(n.name=this._names.at(n.name))),e.call(o,n)},()=>{switch(s){case u.GENERATED_ORDER:this._wasm.exports.by_generated_location(this._getMappingsPtr());break;case u.ORIGINAL_ORDER:this._wasm.exports.by_original_location(this._getMappingsPtr());break;default:throw new Error("Unknown order of iteration.")}})}allGeneratedPositionsFor(e){let n=r.getArg(e,"source");const t=r.getArg(e,"line"),o=e.column||0;if((n=this._findSourceIndex(n))<0)return[];if(t<1)throw new Error("Line numbers must be >= 1");if(o<0)throw new Error("Column numbers must be >= 0");const s=[];return this._wasm.withMappingCallback(e=>{let n=e.lastGeneratedColumn;this._computedColumnSpans&&null===n&&(n=1/0),s.push({line:e.generatedLine,column:e.generatedColumn,lastColumn:n})},()=>{this._wasm.exports.all_generated_locations_for(this._getMappingsPtr(),n,t-1,"column"in e,o)}),s}destroy(){0!==this._mappingsPtr&&(this._wasm.exports.free_mappings(this._mappingsPtr),this._mappingsPtr=0)}computeColumnSpans(){this._computedColumnSpans||(this._wasm.exports.compute_column_spans(this._getMappingsPtr()),this._computedColumnSpans=!0)}originalPositionFor(e){const n={generatedLine:r.getArg(e,"line"),generatedColumn:r.getArg(e,"column")};if(n.generatedLine<1)throw new Error("Line numbers must be >= 1");if(n.generatedColumn<0)throw new Error("Column numbers must be >= 0");let t,o=r.getArg(e,"bias",u.GREATEST_LOWER_BOUND);if(null==o&&(o=u.GREATEST_LOWER_BOUND),this._wasm.withMappingCallback(e=>t=e,()=>{this._wasm.exports.original_location_for(this._getMappingsPtr(),n.generatedLine-1,n.generatedColumn,o)}),t&&t.generatedLine===n.generatedLine){let e=r.getArg(t,"source",null);null!==e&&(e=this._sources.at(e),e=r.computeSourceURL(this.sourceRoot,e,this._sourceMapURL));let n=r.getArg(t,"name",null);return null!==n&&(n=this._names.at(n)),{source:e,line:r.getArg(t,"originalLine",null),column:r.getArg(t,"originalColumn",null),name:n}}return{source:null,line:null,column:null,name:null}}hasContentsOfAllSources(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))}sourceContentFor(e,n){if(!this.sourcesContent)return null;const t=this._findSourceIndex(e);if(t>=0)return this.sourcesContent[t];let o,s=e;if(null!=this.sourceRoot&&(s=r.relative(this.sourceRoot,s)),null!=this.sourceRoot&&(o=r.urlParse(this.sourceRoot))){const e=s.replace(/^file:\/\//,"");if("file:"==o.protocol&&this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];if((!o.pathname||"/"==o.pathname)&&this._sources.has("/"+s))return this.sourcesContent[this._sources.indexOf("/"+s)]}if(n)return null;throw new Error('"'+s+'" is not in the SourceMap.')}generatedPositionFor(e){let n=r.getArg(e,"source");if((n=this._findSourceIndex(n))<0)return{line:null,column:null,lastColumn:null};const t={source:n,originalLine:r.getArg(e,"line"),originalColumn:r.getArg(e,"column")};if(t.originalLine<1)throw new Error("Line numbers must be >= 1");if(t.originalColumn<0)throw new Error("Column numbers must be >= 0");let o,s=r.getArg(e,"bias",u.GREATEST_LOWER_BOUND);if(null==s&&(s=u.GREATEST_LOWER_BOUND),this._wasm.withMappingCallback(e=>o=e,()=>{this._wasm.exports.generated_location_for(this._getMappingsPtr(),t.source,t.originalLine-1,t.originalColumn,s)}),o&&o.source===t.source){let e=o.lastGeneratedColumn;return this._computedColumnSpans&&null===e&&(e=1/0),{line:r.getArg(o,"generatedLine",null),column:r.getArg(o,"generatedColumn",null),lastColumn:e}}return{line:null,column:null,lastColumn:null}}}c.prototype.consumer=u,n.BasicSourceMapConsumer=c;class h extends u{constructor(e,n){return super(l).then(t=>{let o=e;"string"==typeof e&&(o=r.parseSourceMapInput(e));const i=r.getArg(o,"version"),a=r.getArg(o,"sections");if(i!=t._version)throw new Error("Unsupported version: "+i);t._sources=new s,t._names=new s,t.__generatedMappings=null,t.__originalMappings=null,t.__generatedMappingsUnsorted=null,t.__originalMappingsUnsorted=null;let l={line:-1,column:0};return Promise.all(a.map(e=>{if(e.url)throw new Error("Support for url field in sections not implemented.");const t=r.getArg(e,"offset"),o=r.getArg(t,"line"),s=r.getArg(t,"column");if(o({generatedOffset:{generatedLine:o+1,generatedColumn:s+1},consumer:e}))})).then(e=>(t._sections=e,t))})}get _generatedMappings(){return this.__generatedMappings||this._sortGeneratedMappings(),this.__generatedMappings}get _originalMappings(){return this.__originalMappings||this._sortOriginalMappings(),this.__originalMappings}get _generatedMappingsUnsorted(){return this.__generatedMappingsUnsorted||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappingsUnsorted}get _originalMappingsUnsorted(){return this.__originalMappingsUnsorted||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappingsUnsorted}_sortGeneratedMappings(){const e=this._generatedMappingsUnsorted;e.sort(r.compareByGeneratedPositionsDeflated),this.__generatedMappings=e}_sortOriginalMappings(){const e=this._originalMappingsUnsorted;e.sort(r.compareByOriginalPositions),this.__originalMappings=e}get sources(){const e=[];for(let n=0;ns.push(e));for(let e=0;e= 1");if(t.originalColumn<0)throw new Error("Column numbers must be >= 0");const s=[];let i=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",r.compareByOriginalPositions,o.LEAST_UPPER_BOUND);if(i>=0){let t=this._originalMappings[i];if(void 0===e.column){const e=t.originalLine;for(;t&&t.originalLine===e;){let e=t.lastGeneratedColumn;this._computedColumnSpans&&null===e&&(e=1/0),s.push({line:r.getArg(t,"generatedLine",null),column:r.getArg(t,"generatedColumn",null),lastColumn:e}),t=this._originalMappings[++i]}}else{const e=t.originalColumn;for(;t&&t.originalLine===n&&t.originalColumn==e;){let e=t.lastGeneratedColumn;this._computedColumnSpans&&null===e&&(e=1/0),s.push({line:r.getArg(t,"generatedLine",null),column:r.getArg(t,"generatedColumn",null),lastColumn:e}),t=this._originalMappings[++i]}}}return s}destroy(){for(let e=0;e0?r-l>1?e(l,r,o,s,i,a):a==n.LEAST_UPPER_BOUND?r1?e(t,l,o,s,i,a):a==n.LEAST_UPPER_BOUND?l:t<0?-1:t}(-1,t.length,e,t,r,o||n.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&0===r(t[s],t[s-1],!0);)--s;return s}},function(n,t){n.exports=e},function(e,t){e.exports=n},function(e,n,t){const r=t(4);let o=null;e.exports=function(){if(o)return o;const e=[];return o=r().then(n=>WebAssembly.instantiate(n,{env:{mapping_callback(n,t,r,o,s,i,a,l,u,c){const h=new function(){this.generatedLine=0,this.generatedColumn=0,this.lastGeneratedColumn=null,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null};h.generatedLine=n+1,h.generatedColumn=t,r&&(h.lastGeneratedColumn=o-1),s&&(h.source=i,h.originalLine=a+1,h.originalColumn=l,u&&(h.name=c)),e[e.length-1](h)},start_all_generated_locations_for(){console.time("all_generated_locations_for")},end_all_generated_locations_for(){console.timeEnd("all_generated_locations_for")},start_compute_column_spans(){console.time("compute_column_spans")},end_compute_column_spans(){console.timeEnd("compute_column_spans")},start_generated_location_for(){console.time("generated_location_for")},end_generated_location_for(){console.timeEnd("generated_location_for")},start_original_location_for(){console.time("original_location_for")},end_original_location_for(){console.timeEnd("original_location_for")},start_parse_mappings(){console.time("parse_mappings")},end_parse_mappings(){console.timeEnd("parse_mappings")},start_sort_by_generated_location(){console.time("sort_by_generated_location")},end_sort_by_generated_location(){console.timeEnd("sort_by_generated_location")},start_sort_by_original_location(){console.time("sort_by_original_location")},end_sort_by_original_location(){console.timeEnd("sort_by_original_location")}}})).then(n=>({exports:n.instance.exports,withMappingCallback:(n,t)=>{e.push(n);try{t()}finally{e.pop()}}})).then(null,e=>{throw o=null,e})}},function(e,n,t){const r=t(1).SourceMapGenerator,o=t(0),s=/(\r?\n)/,i=10,a="$$$isSourceNode$$$";class l{constructor(e,n,t,r,o){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==n?null:n,this.source=null==t?null:t,this.name=null==o?null:o,this[a]=!0,null!=r&&this.add(r)}static fromStringWithSourceMap(e,n,t){const r=new l,i=e.split(s);let a=0;const u=function(){return e()+(e()||"");function e(){return a=0;n--)this.prepend(e[n]);else{if(!e[a]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this}walk(e){let n;for(let t=0,r=this.children.length;t0){for(n=[],t=0;t= 0) { - parsed.path = parsed.path.substring(0, index + 1); + parsed.pathname = parsed.pathname.substring(0, index + 1); } } - sourceURL = join(urlGenerate(parsed), sourceURL); + sourceURL = join(parsed.toString(), sourceURL); } return normalize(sourceURL); diff --git a/test/test-source-map-consumer.js b/test/test-source-map-consumer.js index 6d6d47d4..3eddcdfe 100644 --- a/test/test-source-map-consumer.js +++ b/test/test-source-map-consumer.js @@ -1295,7 +1295,7 @@ exports["test webpack URL resolution"] = async function(assert) { const consumer = await new SourceMapConsumer(map); assert.equal(consumer.sources.length, 1); - assert.equal(consumer.sources[0], "webpack:///webpack/bootstrap 67e184f9679733298d44"); + assert.equal(consumer.sources[0], "webpack:///webpack/bootstrap%2067e184f9679733298d44"); consumer.destroy(); }; @@ -1312,7 +1312,7 @@ exports["test webpack URL resolution with sourceMapURL"] = async function(assert const consumer = await new SourceMapConsumer(map, "http://www.example.com/q.js.map"); assert.equal(consumer.sources.length, 1); - assert.equal(consumer.sources[0], "webpack:///webpack/bootstrap 67e184f9679733298d44"); + assert.equal(consumer.sources[0], "webpack:///webpack/bootstrap%2067e184f9679733298d44"); consumer.destroy(); }; diff --git a/test/test-util.js b/test/test-util.js index e665847c..c2cbb4a5 100644 --- a/test/test-util.js +++ b/test/test-util.js @@ -8,20 +8,22 @@ const libUtil = require("../lib/util"); exports["test urls"] = function(assert) { - const assertUrl = function(url) { - assert.equal(url, libUtil.urlGenerate(libUtil.urlParse(url))); + const assertUrl = function(url, expect) { + expect = expect || url; + assert.equal(expect, libUtil.urlParse(url).toString()); }; - assertUrl("http://"); - assertUrl("http://www.example.com"); - assertUrl("http://user:pass@www.example.com"); - assertUrl("http://www.example.com:80"); + assertUrl("http://www.example.com", "http://www.example.com/"); + assertUrl("http://user:pass@www.example.com", "http://user:pass@www.example.com/"); + assertUrl("http://www.example.com:80", "http://www.example.com/"); assertUrl("http://www.example.com/"); assertUrl("http://www.example.com/foo/bar"); assertUrl("http://www.example.com/foo/bar/"); - assertUrl("http://user:pass@www.example.com:80/foo/bar/"); + assertUrl("http://user:pass@www.example.com:80/foo/bar/", + "http://user:pass@www.example.com/foo/bar/"); + + // From https://bugzilla.mozilla.org/show_bug.cgi?id=1451274 + assertUrl("data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9rdWQvUHJvamVjdHMvX2NvbnRleHRlL2xvaXMtd2ViYXBwL3NyYy9zdHlsZXMvc2VsZWN0aW9uLmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNFLHVDQUF1QztFQUN2QyxlQUFlO0NBQ2hCOztBQUVEO0VBQ0UsdUNBQXVDO0VBQ3ZDLGVBQWU7Q0FDaEIiLCJmaWxlIjoic2VsZWN0aW9uLmNzcyIsInNvdXJjZXNDb250ZW50IjpbIjo6LW1vei1zZWxlY3Rpb24ge1xuICBiYWNrZ3JvdW5kLWNvbG9yOiB2YXIoLS1jb2xvci0tYWN0aW9uKTtcbiAgY29sb3I6ICNmZmZmZmY7XG59XG5cbjo6c2VsZWN0aW9uIHtcbiAgYmFja2dyb3VuZC1jb2xvcjogdmFyKC0tY29sb3ItLWFjdGlvbik7XG4gIGNvbG9yOiAjZmZmZmZmO1xufVxuIl0sInNvdXJjZVJvb3QiOiIifQ=="); - assertUrl("//"); - assertUrl("//www.example.com"); assertUrl("file:///www.example.com"); assert.equal(libUtil.urlParse(""), null); @@ -31,19 +33,19 @@ exports["test urls"] = function(assert) { assert.equal(libUtil.urlParse("a/b"), null); assert.equal(libUtil.urlParse("a//b"), null); assert.equal(libUtil.urlParse("/a"), null); - assert.equal(libUtil.urlParse("data:foo,bar"), null); + assertUrl("data:foo,bar"); let parsed = libUtil.urlParse("http://x-y.com/bar"); - assert.equal(parsed.scheme, "http"); + assert.equal(parsed.protocol, "http:"); assert.equal(parsed.host, "x-y.com"); - assert.equal(parsed.path, "/bar"); + assert.equal(parsed.pathname, "/bar"); const webpackURL = "webpack:///webpack/bootstrap 67e184f9679733298d44"; parsed = libUtil.urlParse(webpackURL); - assert.equal(parsed.scheme, "webpack"); + assert.equal(parsed.protocol, "webpack:"); assert.equal(parsed.host, ""); - assert.equal(parsed.path, "/webpack/bootstrap 67e184f9679733298d44"); - assert.equal(webpackURL, libUtil.urlGenerate(parsed)); + assert.equal(parsed.pathname, "/webpack/bootstrap%2067e184f9679733298d44"); + assert.equal(webpackURL, parsed.toString().replace(/%20/, " ")); }; exports["test normalize()"] = function(assert) { @@ -73,12 +75,12 @@ exports["test normalize()"] = function(assert) { assert.equal(libUtil.normalize("a/././."), "a"); assert.equal(libUtil.normalize("/a/b//c////d/////"), "/a/b/c/d/"); - assert.equal(libUtil.normalize("///a/b//c////d/////"), "///a/b/c/d/"); + assert.equal(libUtil.normalize("///a/b//c////d/////"), "/a/b/c/d/"); assert.equal(libUtil.normalize("a/b//c////d"), "a/b/c/d"); assert.equal(libUtil.normalize(".///.././../a/b//./.."), "../../a"); - assert.equal(libUtil.normalize("http://www.example.com"), "http://www.example.com"); + assert.equal(libUtil.normalize("http://www.example.com"), "http://www.example.com/"); assert.equal(libUtil.normalize("http://www.example.com/"), "http://www.example.com/"); assert.equal(libUtil.normalize("http://www.example.com/./..//a/b/c/.././d//"), "http://www.example.com/a/b/d/"); }; @@ -167,8 +169,8 @@ exports["test join()"] = function(assert) { assert.equal(libUtil.join("http://foo.org/", "."), "http://foo.org/"); assert.equal(libUtil.join("http://foo.org//", ""), "http://foo.org/"); assert.equal(libUtil.join("http://foo.org//", "."), "http://foo.org/"); - assert.equal(libUtil.join("//www.example.com", ""), "//www.example.com/"); - assert.equal(libUtil.join("//www.example.com", "."), "//www.example.com/"); + assert.equal(libUtil.join("//www.example.com", ""), "/www.example.com"); + assert.equal(libUtil.join("//www.example.com", "."), "/www.example.com"); assert.equal(libUtil.join("http://foo.org/a", "b"), "http://foo.org/a/b"); @@ -177,7 +179,6 @@ exports["test join()"] = function(assert) { assert.equal(libUtil.join("http://foo.org/a", "b/"), "http://foo.org/a/b/"); assert.equal(libUtil.join("http://foo.org/a", "b//"), "http://foo.org/a/b/"); assert.equal(libUtil.join("http://foo.org/a/", "/b"), "http://foo.org/b"); - assert.equal(libUtil.join("http://foo.org/a//", "//b"), "http://b"); assert.equal(libUtil.join("http://foo.org/a", ".."), "http://foo.org/"); assert.equal(libUtil.join("http://foo.org/a", "../b"), "http://foo.org/b"); @@ -199,11 +200,10 @@ exports["test join()"] = function(assert) { assert.equal(libUtil.join("http://foo.org//", "/a"), "http://foo.org/a"); - assert.equal(libUtil.join("http://", "www.example.com"), "http://www.example.com"); + assert.equal(libUtil.join("http://", "www.example.com"), "http://www.example.com/"); assert.equal(libUtil.join("file:///", "www.example.com"), "file:///www.example.com"); assert.equal(libUtil.join("http://", "ftp://example.com"), "ftp://example.com"); - assert.equal(libUtil.join("http://www.example.com", "//foo.org/bar"), "http://foo.org/bar"); assert.equal(libUtil.join("//www.example.com", "//foo.org/bar"), "//foo.org/bar"); }; From e35487dd487eceade2d5e3790dc612a62d35f1f6 Mon Sep 17 00:00:00 2001 From: redeyes2015 Date: Tue, 25 Sep 2018 17:52:17 +0800 Subject: [PATCH 2/4] Fix which "URL" to use If the global "URL" is a function, use it. This should be the case in browser environments. In [node] environment, `require('url').URL`, which follows WHATWG URL Standard, was added in v7, and `URL` became available in global object since v10.0. To support the version before v10, we need to check the global object, and then fallback to `require('url').URL`. However, note one thing: the version packed in by webpack-v3 ([npm-url]) only supports the "legacy version of Url API", which is not compatible with "WHATWG URL Standard", must not be used as a replacement for `URL`. [node]: https://nodejs.org/dist/latest-v10.x/docs/api/url.html [npm-url]: https://www.npmjs.com/package/url --- dist/source-map.js | 2 +- lib/util.js | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/dist/source-map.js b/dist/source-map.js index 01f0a4d5..133c53e4 100644 --- a/dist/source-map.js +++ b/dist/source-map.js @@ -1 +1 @@ -!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("fs"),require("path")):"function"==typeof define&&define.amd?define(["fs","path"],n):"object"==typeof exports?exports.sourceMap=n(require("fs"),require("path")):e.sourceMap=n(e.fs,e.path)}(window,function(e,n){return function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(n){return e[n]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=5)}([function(e,n,t){const r=t(7).URL;n.getArg=function(e,n,t){if(n in e)return e[n];if(3===arguments.length)return t;throw new Error('"'+n+'" is a required argument.')};const o=/^data:.+\,.+$/;function s(e){try{return new r(e)}catch(e){return null}}n.urlParse=s;const i=32;const a=function(e){const n=[];return function(t){for(let e=0;ei&&n.pop(),r}}(function(e){let t=e;const r=s(e);if(r){if(!r.pathname)return e;t=r.pathname}const o=n.isAbsolute(t),i=[];let a=0,l=0;for(;;){if(a=l,-1===(l=t.indexOf("/",a))){i.push(t.slice(a));break}for(i.push(t.slice(a,l));l=0;l--){const e=i[l];"."===e?i.splice(l,1):".."===e?u++:u>0&&(""===e?(i.splice(l+1,u),u=0):(i.splice(l,2),u--))}return""===(t=i.join("/"))&&(t=o?"/":"."),r?(r.pathname=t,r.toString()):t});function l(e,n){""===e&&(e="."),""===n&&(n=".");const t=s(n),r=s(e);if(r&&(e=r.pathname||"/"),t&&!t.protocol)return r&&(t.protocol=r.protocol),t.toString();if(t||n.match(o))return n;if(r&&!r.host&&!r.pathname)return r.host=n,r.toString();const i="/"===n.charAt(0)?n:a(e.replace(/\/+$/,"")+"/"+n);return r?(r.pathname=i,r.toString()):i}n.normalize=a,n.join=l,n.isAbsolute=function(e){return"/"===e.charAt(0)||!!s(e)},n.relative=function(e,n){""===e&&(e="."),e=e.replace(/\/$/,"");let t=0;for(;0!==n.indexOf(e+"/");){const r=e.lastIndexOf("/");if(r<0)return n;if((e=e.slice(0,r)).match(/^([^\/]+:\/)?\/*$/))return n;++t}return Array(t+1).join("../")+n.substr(e.length+1)};const u=!("__proto__"in Object.create(null));function c(e){return e}function h(e){if(!e)return!1;const 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(let t=n-10;t>=0;t--)if(36!==e.charCodeAt(t))return!1;return!0}function p(e,n){return e===n?0:null===e?1:null===n?-1:e>n?1:-1}n.toSetString=u?c:function(e){return h(e)?"$"+e:e},n.fromSetString=u?c:function(e){return h(e)?e.slice(1):e},n.compareByOriginalPositions=function(e,n,t){let r=p(e.source,n.source);return 0!==r?r:0!=(r=e.originalLine-n.originalLine)?r:0!=(r=e.originalColumn-n.originalColumn)||t?r:0!=(r=e.generatedColumn-n.generatedColumn)?r:0!=(r=e.generatedLine-n.generatedLine)?r:p(e.name,n.name)},n.compareByGeneratedPositionsDeflated=function(e,n,t){let r=e.generatedLine-n.generatedLine;return 0!==r?r:0!=(r=e.generatedColumn-n.generatedColumn)||t?r:0!==(r=p(e.source,n.source))?r:0!=(r=e.originalLine-n.originalLine)?r:0!=(r=e.originalColumn-n.originalColumn)?r:p(e.name,n.name)},n.compareByGeneratedPositionsInflated=function(e,n){let t=e.generatedLine-n.generatedLine;return 0!==t?t:0!=(t=e.generatedColumn-n.generatedColumn)?t:0!==(t=p(e.source,n.source))?t:0!=(t=e.originalLine-n.originalLine)?t:0!=(t=e.originalColumn-n.originalColumn)?t:p(e.name,n.name)},n.parseSourceMapInput=function(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))},n.computeSourceURL=function(e,n,t){if(n=n||"",e&&("/"!==e[e.length-1]&&"/"!==n[0]&&(e+="/"),n=e+n),t){const e=s(t);if(!e)throw new Error("sourceMapURL could not be parsed");if(e.pathname){const n=e.pathname.lastIndexOf("/");n>=0&&(e.pathname=e.pathname.substring(0,n+1))}n=l(e.toString(),n)}return a(n)}},function(e,n,t){const r=t(2),o=t(0),s=t(3).ArraySet,i=t(15).MappingList;class a{constructor(e){e||(e={}),this._file=o.getArg(e,"file",null),this._sourceRoot=o.getArg(e,"sourceRoot",null),this._skipValidation=o.getArg(e,"skipValidation",!1),this._sources=new s,this._names=new s,this._mappings=new i,this._sourcesContents=null}static fromSourceMap(e){const n=e.sourceRoot,t=new a({file:e.file,sourceRoot:n});return e.eachMapping(function(e){const r={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(r.source=e.source,null!=n&&(r.source=o.relative(n,r.source)),r.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(r.name=e.name)),t.addMapping(r)}),e.sources.forEach(function(r){let s=r;null!==n&&(s=o.relative(n,r)),t._sources.has(s)||t._sources.add(s);const i=e.sourceContentFor(r);null!=i&&t.setSourceContent(r,i)}),t}addMapping(e){const n=o.getArg(e,"generated"),t=o.getArg(e,"original",null);let r=o.getArg(e,"source",null),s=o.getArg(e,"name",null);this._skipValidation||this._validateMapping(n,t,r,s),null!=r&&(r=String(r),this._sources.has(r)||this._sources.add(r)),null!=s&&(s=String(s),this._names.has(s)||this._names.add(s)),this._mappings.add({generatedLine:n.line,generatedColumn:n.column,originalLine:null!=t&&t.line,originalColumn:null!=t&&t.column,source:r,name:s})}setSourceContent(e,n){let t=e;null!=this._sourceRoot&&(t=o.relative(this._sourceRoot,t)),null!=n?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[o.toSetString(t)]=n):this._sourcesContents&&(delete this._sourcesContents[o.toSetString(t)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))}applySourceMap(e,n,t){let r=n;if(null==n){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');r=e.file}const i=this._sourceRoot;null!=i&&(r=o.relative(i,r));const a=this._mappings.toArray().length>0?new s:this._sources,l=new s;this._mappings.unsortedForEach(function(n){if(n.source===r&&null!=n.originalLine){const r=e.originalPositionFor({line:n.originalLine,column:n.originalColumn});null!=r.source&&(n.source=r.source,null!=t&&(n.source=o.join(t,n.source)),null!=i&&(n.source=o.relative(i,n.source)),n.originalLine=r.line,n.originalColumn=r.column,null!=r.name&&(n.name=r.name))}const s=n.source;null==s||a.has(s)||a.add(s);const u=n.name;null==u||l.has(u)||l.add(u)},this),this._sources=a,this._names=l,e.sources.forEach(function(n){const r=e.sourceContentFor(n);null!=r&&(null!=t&&(n=o.join(t,n)),null!=i&&(n=o.relative(i,n)),this.setSourceContent(n,r))},this)}_validateMapping(e,n,t,r){if(n&&"number"!=typeof n.line&&"number"!=typeof n.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!n&&!t&&!r);else if(!(e&&"line"in e&&"column"in e&&n&&"line"in n&&"column"in n&&e.line>0&&e.column>=0&&n.line>0&&n.column>=0&&t))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:t,original:n,name:r}))}_serializeMappings(){let e,n,t,s,i=0,a=1,l=0,u=0,c=0,h=0,p="";const g=this._mappings.toArray();for(let f=0,m=g.length;f0){if(!o.compareByGeneratedPositionsInflated(n,g[f-1]))continue;e+=","}e+=r.encode(n.generatedColumn-i),i=n.generatedColumn,null!=n.source&&(s=this._sources.indexOf(n.source),e+=r.encode(s-h),h=s,e+=r.encode(n.originalLine-1-u),u=n.originalLine-1,e+=r.encode(n.originalColumn-l),l=n.originalColumn,null!=n.name&&(t=this._names.indexOf(n.name),e+=r.encode(t-c),c=t)),p+=e}return p}_generateSourcesContent(e,n){return e.map(function(e){if(!this._sourcesContents)return null;null!=n&&(e=o.relative(n,e));const t=o.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,t)?this._sourcesContents[t]:null},this)}toJSON(){const e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e}toString(){return JSON.stringify(this.toJSON())}}a.prototype._version=3,n.SourceMapGenerator=a},function(e,n,t){const r=t(6);n.encode=function(e){let n,t="",o=function(e){return e<0?1+(-e<<1):0+(e<<1)}(e);do{n=31&o,(o>>>=5)>0&&(n|=32),t+=r.encode(n)}while(o>0);return t}},function(e,n){class t{constructor(){this._array=[],this._set=new Map}static fromArray(e,n){const r=new t;for(let t=0,o=e.length;t=0)return n;throw new Error('"'+e+'" is not in the set.')}at(e){if(e>=0&&ee.arrayBuffer());if(n instanceof ArrayBuffer)return Promise.resolve(n);throw new Error("You must provide the string URL or ArrayBuffer contents of lib/mappings.wasm by calling SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using SourceMapConsumer")},e.exports.initialize=(e=>n=e)}else{const r=t(18),o=t(19);e.exports=function(){return new Promise((e,t)=>{const s=o.join(n,"mappings.wasm");r.readFile(s,null,(n,r)=>{n?t(n):e(r.buffer)})})},e.exports.initialize=(e=>{console.debug("SourceMapConsumer.initialize is a no-op when running in node.js")})}}).call(this,"/")},function(e,n,t){n.SourceMapGenerator=t(1).SourceMapGenerator,n.SourceMapConsumer=t(16).SourceMapConsumer,n.SourceNode=t(21).SourceNode},function(e,n){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");n.encode=function(e){if(0<=e&&e",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(u),h=["%","/","?",";","#"].concat(c),p=["/","?","#"],g=/^[+a-z0-9A-Z_-]{0,63}$/,f=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},d={javascript:!0,"javascript:":!0},_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},C=t(12);function y(e,n,t){if(e&&o.isObject(e)&&e instanceof s)return e;var r=new s;return r.parse(e,n,t),r}s.prototype.parse=function(e,n,t){if(!o.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var s=e.indexOf("?"),a=-1!==s&&s127?U+="x":U+=P[I];if(!U.match(g)){var G=x.slice(0,M),k=x.slice(M+1),T=P.match(f);T&&(G.push(T[1]),k.unshift(T[2])),k.length&&(y="/"+k.join(".")+y),this.hostname=G.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),R||(this.hostname=r.toASCII(this.hostname));var q=this.port?":"+this.port:"",D=this.hostname||"";this.host=D+q,this.href+=this.host,R&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==y[0]&&(y="/"+y))}if(!m[S])for(M=0,j=c.length;M0)&&t.host.split("@"))&&(t.auth=R.shift(),t.host=t.hostname=R.shift());return t.search=e.search,t.query=e.query,o.isNull(t.pathname)&&o.isNull(t.search)||(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.href=t.format(),t}if(!v.length)return t.pathname=null,t.search?t.path="/"+t.search:t.path=null,t.href=t.format(),t;for(var O=v.slice(-1)[0],L=(t.host||e.host||v.length>1)&&("."===O||".."===O)||""===O,M=0,E=v.length;E>=0;E--)"."===(O=v[E])?v.splice(E,1):".."===O?(v.splice(E,1),M++):M&&(v.splice(E,1),M--);if(!b&&!S)for(;M--;M)v.unshift("..");!b||""===v[0]||v[0]&&"/"===v[0].charAt(0)||v.unshift(""),L&&"/"!==v.join("/").substr(-1)&&v.push("");var R,x=""===v[0]||v[0]&&"/"===v[0].charAt(0);A&&(t.hostname=t.host=x?"":v.length?v.shift():"",(R=!!(t.host&&t.host.indexOf("@")>0)&&t.host.split("@"))&&(t.auth=R.shift(),t.host=t.hostname=R.shift()));return(b=b||t.host&&v.length)&&!x&&v.unshift(""),v.length?t.pathname=v.join("/"):(t.pathname=null,t.path=null),o.isNull(t.pathname)&&o.isNull(t.search)||(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.auth=e.auth||t.auth,t.slashes=t.slashes||e.slashes,t.href=t.format(),t},s.prototype.parseHost=function(){var e=this.host,n=a.exec(e);n&&(":"!==(n=n[0])&&(this.port=n.substr(1)),e=e.substr(0,e.length-n.length)),e&&(this.hostname=e)}},function(e,n,t){(function(e,r){var o;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(s){"object"==typeof n&&n&&n.nodeType,"object"==typeof e&&e&&e.nodeType;var i="object"==typeof r&&r;i.global!==i&&i.window!==i&&i.self;var a,l=2147483647,u=36,c=1,h=26,p=38,g=700,f=72,m=128,d="-",_=/^xn--/,C=/[^\x20-\x7E]/,y=/[\x2E\u3002\uFF0E\uFF61]/g,w={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},b=u-c,S=Math.floor,v=String.fromCharCode;function A(e){throw new RangeError(w[e])}function O(e,n){for(var t=e.length,r=[];t--;)r[t]=n(e[t]);return r}function L(e,n){var t=e.split("@"),r="";return t.length>1&&(r=t[0]+"@",e=t[1]),r+O((e=e.replace(y,".")).split("."),n).join(".")}function M(e){for(var n,t,r=[],o=0,s=e.length;o=55296&&n<=56319&&o65535&&(n+=v((e-=65536)>>>10&1023|55296),e=56320|1023&e),n+=v(e)}).join("")}function R(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:u}function x(e,n){return e+22+75*(e<26)-((0!=n)<<5)}function j(e,n,t){var r=0;for(e=t?S(e/g):e>>1,e+=S(e/n);e>b*h>>1;r+=u)e=S(e/b);return S(r+(b+1)*e/(e+p))}function P(e){var n,t,r,o,s,i,a,p,g,_,C=[],y=e.length,w=0,b=m,v=f;for((t=e.lastIndexOf(d))<0&&(t=0),r=0;r=128&&A("not-basic"),C.push(e.charCodeAt(r));for(o=t>0?t+1:0;o=y&&A("invalid-input"),((p=R(e.charCodeAt(o++)))>=u||p>S((l-w)/i))&&A("overflow"),w+=p*i,!(p<(g=a<=v?c:a>=v+h?h:a-v));a+=u)i>S(l/(_=u-g))&&A("overflow"),i*=_;v=j(w-s,n=C.length+1,0==s),S(w/n)>l-b&&A("overflow"),b+=S(w/n),w%=n,C.splice(w++,0,b)}return E(C)}function U(e){var n,t,r,o,s,i,a,p,g,_,C,y,w,b,O,L=[];for(y=(e=M(e)).length,n=m,t=0,s=f,i=0;i=n&&CS((l-t)/(w=r+1))&&A("overflow"),t+=(a-n)*w,n=a,i=0;il&&A("overflow"),C==n){for(p=t,g=u;!(p<(_=g<=s?c:g>=s+h?h:g-s));g+=u)O=p-_,b=u-_,L.push(v(x(_+O%b,0))),p=S(O/b);L.push(v(x(p,0))),s=j(t,w,r==o),t=0,++r}++t,++n}return L.join("")}a={version:"1.4.1",ucs2:{decode:M,encode:E},decode:P,encode:U,toASCII:function(e){return L(e,function(e){return C.test(e)?"xn--"+U(e):e})},toUnicode:function(e){return L(e,function(e){return _.test(e)?P(e.slice(4).toLowerCase()):e})}},void 0===(o=function(){return a}.call(n,t,n,e))||(e.exports=o)}()}).call(this,t(9)(e),t(10))},function(e,n){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,n){var t;t=function(){return this}();try{t=t||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(t=window)}e.exports=t},function(e,n,t){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,n,t){"use strict";n.decode=n.parse=t(13),n.encode=n.stringify=t(14)},function(e,n,t){"use strict";function r(e,n){return Object.prototype.hasOwnProperty.call(e,n)}e.exports=function(e,n,t,s){n=n||"&",t=t||"=";var i={};if("string"!=typeof e||0===e.length)return i;var a=/\+/g;e=e.split(n);var l=1e3;s&&"number"==typeof s.maxKeys&&(l=s.maxKeys);var u=e.length;l>0&&u>l&&(u=l);for(var c=0;c=0?(h=m.substr(0,d),p=m.substr(d+1)):(h=m,p=""),g=decodeURIComponent(h),f=decodeURIComponent(p),r(i,g)?o(i[g])?i[g].push(f):i[g]=[i[g],f]:i[g]=f}return i};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,n,t){"use strict";var r=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,n,t,a){return n=n||"&",t=t||"=",null===e&&(e=void 0),"object"==typeof e?s(i(e),function(i){var a=encodeURIComponent(r(i))+t;return o(e[i])?s(e[i],function(e){return a+encodeURIComponent(r(e))}).join(n):a+encodeURIComponent(r(e[i]))}).join(n):a?encodeURIComponent(r(a))+t+encodeURIComponent(r(e)):""};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function s(e,n){if(e.map)return e.map(n);for(var t=[],r=0;rt||o==t&&i>=s||r.compareByGeneratedPositionsInflated(e,n)<=0}(this._last,e)?(this._sorted=!1,this._array.push(e)):(this._last=e,this._array.push(e))}toArray(){return this._sorted||(this._array.sort(r.compareByGeneratedPositionsInflated),this._sorted=!0),this._array}}},function(e,n,t){const r=t(0),o=t(17),s=t(3).ArraySet,i=(t(2),t(4)),a=t(20),l=Symbol("smcInternal");class u{constructor(e,n){return e==l?Promise.resolve(this):function(e,n){let t=e;"string"==typeof e&&(t=r.parseSourceMapInput(e));const o=null!=t.sections?new h(t,n):new c(t,n);return Promise.resolve(o)}(e,n)}static initialize(e){i.initialize(e["lib/mappings.wasm"])}static fromSourceMap(e,n){return function(e,n){return c.fromSourceMap(e,n)}(e,n)}static async with(e,n,t){const r=await new u(e,n);try{return await t(r)}finally{r.destroy()}}_parseMappings(e,n){throw new Error("Subclasses must implement _parseMappings")}eachMapping(e,n,t){throw new Error("Subclasses must implement eachMapping")}allGeneratedPositionsFor(e){throw new Error("Subclasses must implement allGeneratedPositionsFor")}destroy(){throw new Error("Subclasses must implement destroy")}}u.prototype._version=3,u.GENERATED_ORDER=1,u.ORIGINAL_ORDER=2,u.GREATEST_LOWER_BOUND=1,u.LEAST_UPPER_BOUND=2,n.SourceMapConsumer=u;class c extends u{constructor(e,n){return super(l).then(t=>{let o=e;"string"==typeof e&&(o=r.parseSourceMapInput(e));const i=r.getArg(o,"version");let l=r.getArg(o,"sources");const u=r.getArg(o,"names",[]);let c=r.getArg(o,"sourceRoot",null);const h=r.getArg(o,"sourcesContent",null),p=r.getArg(o,"mappings"),g=r.getArg(o,"file",null);if(i!=t._version)throw new Error("Unsupported version: "+i);return c&&(c=r.normalize(c)),l=l.map(String).map(r.normalize).map(function(e){return c&&r.isAbsolute(c)&&r.isAbsolute(e)?r.relative(c,e):e}),t._names=s.fromArray(u.map(String),!0),t._sources=s.fromArray(l,!0),t._absoluteSources=t._sources.toArray().map(function(e){return r.computeSourceURL(c,e,n)}),t.sourceRoot=c,t.sourcesContent=h,t._mappings=p,t._sourceMapURL=n,t.file=g,t._computedColumnSpans=!1,t._mappingsPtr=0,t._wasm=null,a().then(e=>(t._wasm=e,t))})}_findSourceIndex(e){let n=e;if(null!=this.sourceRoot&&(n=r.relative(this.sourceRoot,n)),this._sources.has(n))return this._sources.indexOf(n);for(let n=0;n{null!==n.source&&(n.source=this._sources.at(n.source),n.source=r.computeSourceURL(i,n.source,this._sourceMapURL),null!==n.name&&(n.name=this._names.at(n.name))),e.call(o,n)},()=>{switch(s){case u.GENERATED_ORDER:this._wasm.exports.by_generated_location(this._getMappingsPtr());break;case u.ORIGINAL_ORDER:this._wasm.exports.by_original_location(this._getMappingsPtr());break;default:throw new Error("Unknown order of iteration.")}})}allGeneratedPositionsFor(e){let n=r.getArg(e,"source");const t=r.getArg(e,"line"),o=e.column||0;if((n=this._findSourceIndex(n))<0)return[];if(t<1)throw new Error("Line numbers must be >= 1");if(o<0)throw new Error("Column numbers must be >= 0");const s=[];return this._wasm.withMappingCallback(e=>{let n=e.lastGeneratedColumn;this._computedColumnSpans&&null===n&&(n=1/0),s.push({line:e.generatedLine,column:e.generatedColumn,lastColumn:n})},()=>{this._wasm.exports.all_generated_locations_for(this._getMappingsPtr(),n,t-1,"column"in e,o)}),s}destroy(){0!==this._mappingsPtr&&(this._wasm.exports.free_mappings(this._mappingsPtr),this._mappingsPtr=0)}computeColumnSpans(){this._computedColumnSpans||(this._wasm.exports.compute_column_spans(this._getMappingsPtr()),this._computedColumnSpans=!0)}originalPositionFor(e){const n={generatedLine:r.getArg(e,"line"),generatedColumn:r.getArg(e,"column")};if(n.generatedLine<1)throw new Error("Line numbers must be >= 1");if(n.generatedColumn<0)throw new Error("Column numbers must be >= 0");let t,o=r.getArg(e,"bias",u.GREATEST_LOWER_BOUND);if(null==o&&(o=u.GREATEST_LOWER_BOUND),this._wasm.withMappingCallback(e=>t=e,()=>{this._wasm.exports.original_location_for(this._getMappingsPtr(),n.generatedLine-1,n.generatedColumn,o)}),t&&t.generatedLine===n.generatedLine){let e=r.getArg(t,"source",null);null!==e&&(e=this._sources.at(e),e=r.computeSourceURL(this.sourceRoot,e,this._sourceMapURL));let n=r.getArg(t,"name",null);return null!==n&&(n=this._names.at(n)),{source:e,line:r.getArg(t,"originalLine",null),column:r.getArg(t,"originalColumn",null),name:n}}return{source:null,line:null,column:null,name:null}}hasContentsOfAllSources(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))}sourceContentFor(e,n){if(!this.sourcesContent)return null;const t=this._findSourceIndex(e);if(t>=0)return this.sourcesContent[t];let o,s=e;if(null!=this.sourceRoot&&(s=r.relative(this.sourceRoot,s)),null!=this.sourceRoot&&(o=r.urlParse(this.sourceRoot))){const e=s.replace(/^file:\/\//,"");if("file:"==o.protocol&&this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];if((!o.pathname||"/"==o.pathname)&&this._sources.has("/"+s))return this.sourcesContent[this._sources.indexOf("/"+s)]}if(n)return null;throw new Error('"'+s+'" is not in the SourceMap.')}generatedPositionFor(e){let n=r.getArg(e,"source");if((n=this._findSourceIndex(n))<0)return{line:null,column:null,lastColumn:null};const t={source:n,originalLine:r.getArg(e,"line"),originalColumn:r.getArg(e,"column")};if(t.originalLine<1)throw new Error("Line numbers must be >= 1");if(t.originalColumn<0)throw new Error("Column numbers must be >= 0");let o,s=r.getArg(e,"bias",u.GREATEST_LOWER_BOUND);if(null==s&&(s=u.GREATEST_LOWER_BOUND),this._wasm.withMappingCallback(e=>o=e,()=>{this._wasm.exports.generated_location_for(this._getMappingsPtr(),t.source,t.originalLine-1,t.originalColumn,s)}),o&&o.source===t.source){let e=o.lastGeneratedColumn;return this._computedColumnSpans&&null===e&&(e=1/0),{line:r.getArg(o,"generatedLine",null),column:r.getArg(o,"generatedColumn",null),lastColumn:e}}return{line:null,column:null,lastColumn:null}}}c.prototype.consumer=u,n.BasicSourceMapConsumer=c;class h extends u{constructor(e,n){return super(l).then(t=>{let o=e;"string"==typeof e&&(o=r.parseSourceMapInput(e));const i=r.getArg(o,"version"),a=r.getArg(o,"sections");if(i!=t._version)throw new Error("Unsupported version: "+i);t._sources=new s,t._names=new s,t.__generatedMappings=null,t.__originalMappings=null,t.__generatedMappingsUnsorted=null,t.__originalMappingsUnsorted=null;let l={line:-1,column:0};return Promise.all(a.map(e=>{if(e.url)throw new Error("Support for url field in sections not implemented.");const t=r.getArg(e,"offset"),o=r.getArg(t,"line"),s=r.getArg(t,"column");if(o({generatedOffset:{generatedLine:o+1,generatedColumn:s+1},consumer:e}))})).then(e=>(t._sections=e,t))})}get _generatedMappings(){return this.__generatedMappings||this._sortGeneratedMappings(),this.__generatedMappings}get _originalMappings(){return this.__originalMappings||this._sortOriginalMappings(),this.__originalMappings}get _generatedMappingsUnsorted(){return this.__generatedMappingsUnsorted||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappingsUnsorted}get _originalMappingsUnsorted(){return this.__originalMappingsUnsorted||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappingsUnsorted}_sortGeneratedMappings(){const e=this._generatedMappingsUnsorted;e.sort(r.compareByGeneratedPositionsDeflated),this.__generatedMappings=e}_sortOriginalMappings(){const e=this._originalMappingsUnsorted;e.sort(r.compareByOriginalPositions),this.__originalMappings=e}get sources(){const e=[];for(let n=0;ns.push(e));for(let e=0;e= 1");if(t.originalColumn<0)throw new Error("Column numbers must be >= 0");const s=[];let i=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",r.compareByOriginalPositions,o.LEAST_UPPER_BOUND);if(i>=0){let t=this._originalMappings[i];if(void 0===e.column){const e=t.originalLine;for(;t&&t.originalLine===e;){let e=t.lastGeneratedColumn;this._computedColumnSpans&&null===e&&(e=1/0),s.push({line:r.getArg(t,"generatedLine",null),column:r.getArg(t,"generatedColumn",null),lastColumn:e}),t=this._originalMappings[++i]}}else{const e=t.originalColumn;for(;t&&t.originalLine===n&&t.originalColumn==e;){let e=t.lastGeneratedColumn;this._computedColumnSpans&&null===e&&(e=1/0),s.push({line:r.getArg(t,"generatedLine",null),column:r.getArg(t,"generatedColumn",null),lastColumn:e}),t=this._originalMappings[++i]}}}return s}destroy(){for(let e=0;e0?r-l>1?e(l,r,o,s,i,a):a==n.LEAST_UPPER_BOUND?r1?e(t,l,o,s,i,a):a==n.LEAST_UPPER_BOUND?l:t<0?-1:t}(-1,t.length,e,t,r,o||n.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&0===r(t[s],t[s-1],!0);)--s;return s}},function(n,t){n.exports=e},function(e,t){e.exports=n},function(e,n,t){const r=t(4);let o=null;e.exports=function(){if(o)return o;const e=[];return o=r().then(n=>WebAssembly.instantiate(n,{env:{mapping_callback(n,t,r,o,s,i,a,l,u,c){const h=new function(){this.generatedLine=0,this.generatedColumn=0,this.lastGeneratedColumn=null,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null};h.generatedLine=n+1,h.generatedColumn=t,r&&(h.lastGeneratedColumn=o-1),s&&(h.source=i,h.originalLine=a+1,h.originalColumn=l,u&&(h.name=c)),e[e.length-1](h)},start_all_generated_locations_for(){console.time("all_generated_locations_for")},end_all_generated_locations_for(){console.timeEnd("all_generated_locations_for")},start_compute_column_spans(){console.time("compute_column_spans")},end_compute_column_spans(){console.timeEnd("compute_column_spans")},start_generated_location_for(){console.time("generated_location_for")},end_generated_location_for(){console.timeEnd("generated_location_for")},start_original_location_for(){console.time("original_location_for")},end_original_location_for(){console.timeEnd("original_location_for")},start_parse_mappings(){console.time("parse_mappings")},end_parse_mappings(){console.timeEnd("parse_mappings")},start_sort_by_generated_location(){console.time("sort_by_generated_location")},end_sort_by_generated_location(){console.timeEnd("sort_by_generated_location")},start_sort_by_original_location(){console.time("sort_by_original_location")},end_sort_by_original_location(){console.timeEnd("sort_by_original_location")}}})).then(n=>({exports:n.instance.exports,withMappingCallback:(n,t)=>{e.push(n);try{t()}finally{e.pop()}}})).then(null,e=>{throw o=null,e})}},function(e,n,t){const r=t(1).SourceMapGenerator,o=t(0),s=/(\r?\n)/,i=10,a="$$$isSourceNode$$$";class l{constructor(e,n,t,r,o){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==n?null:n,this.source=null==t?null:t,this.name=null==o?null:o,this[a]=!0,null!=r&&this.add(r)}static fromStringWithSourceMap(e,n,t){const r=new l,i=e.split(s);let a=0;const u=function(){return e()+(e()||"");function e(){return a=0;n--)this.prepend(e[n]);else{if(!e[a]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this}walk(e){let n;for(let t=0,r=this.children.length;t0){for(n=[],t=0;ti&&n.pop(),r}}(function(e){let t=e;const r=s(e);if(r){if(!r.pathname)return e;t=r.pathname}const o=n.isAbsolute(t),i=[];let a=0,l=0;for(;;){if(a=l,-1===(l=t.indexOf("/",a))){i.push(t.slice(a));break}for(i.push(t.slice(a,l));l=0;l--){const e=i[l];"."===e?i.splice(l,1):".."===e?u++:u>0&&(""===e?(i.splice(l+1,u),u=0):(i.splice(l,2),u--))}return""===(t=i.join("/"))&&(t=o?"/":"."),r?(r.pathname=t,r.toString()):t});function l(e,n){""===e&&(e="."),""===n&&(n=".");const t=s(n),o=s(e);if(o&&(e=o.pathname||"/"),t&&!t.protocol)return o&&(t.protocol=o.protocol),t.toString();if(t||n.match(r))return n;if(o&&!o.host&&!o.pathname)return o.host=n,o.toString();const i="/"===n.charAt(0)?n:a(e.replace(/\/+$/,"")+"/"+n);return o?(o.pathname=i,o.toString()):i}n.normalize=a,n.join=l,n.isAbsolute=function(e){return"/"===e.charAt(0)||!!s(e)},n.relative=function(e,n){""===e&&(e="."),e=e.replace(/\/$/,"");let t=0;for(;0!==n.indexOf(e+"/");){const r=e.lastIndexOf("/");if(r<0)return n;if((e=e.slice(0,r)).match(/^([^\/]+:\/)?\/*$/))return n;++t}return Array(t+1).join("../")+n.substr(e.length+1)};const u=!("__proto__"in Object.create(null));function c(e){return e}function h(e){if(!e)return!1;const 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(let t=n-10;t>=0;t--)if(36!==e.charCodeAt(t))return!1;return!0}function p(e,n){return e===n?0:null===e?1:null===n?-1:e>n?1:-1}n.toSetString=u?c:function(e){return h(e)?"$"+e:e},n.fromSetString=u?c:function(e){return h(e)?e.slice(1):e},n.compareByOriginalPositions=function(e,n,t){let r=p(e.source,n.source);return 0!==r?r:0!=(r=e.originalLine-n.originalLine)?r:0!=(r=e.originalColumn-n.originalColumn)||t?r:0!=(r=e.generatedColumn-n.generatedColumn)?r:0!=(r=e.generatedLine-n.generatedLine)?r:p(e.name,n.name)},n.compareByGeneratedPositionsDeflated=function(e,n,t){let r=e.generatedLine-n.generatedLine;return 0!==r?r:0!=(r=e.generatedColumn-n.generatedColumn)||t?r:0!==(r=p(e.source,n.source))?r:0!=(r=e.originalLine-n.originalLine)?r:0!=(r=e.originalColumn-n.originalColumn)?r:p(e.name,n.name)},n.compareByGeneratedPositionsInflated=function(e,n){let t=e.generatedLine-n.generatedLine;return 0!==t?t:0!=(t=e.generatedColumn-n.generatedColumn)?t:0!==(t=p(e.source,n.source))?t:0!=(t=e.originalLine-n.originalLine)?t:0!=(t=e.originalColumn-n.originalColumn)?t:p(e.name,n.name)},n.parseSourceMapInput=function(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))},n.computeSourceURL=function(e,n,t){if(n=n||"",e&&("/"!==e[e.length-1]&&"/"!==n[0]&&(e+="/"),n=e+n),t){const e=s(t);if(!e)throw new Error("sourceMapURL could not be parsed");if(e.pathname){const n=e.pathname.lastIndexOf("/");n>=0&&(e.pathname=e.pathname.substring(0,n+1))}n=l(e.toString(),n)}return a(n)}},function(e,n,t){const r=t(2),o=t(0),s=t(3).ArraySet,i=t(15).MappingList;class a{constructor(e){e||(e={}),this._file=o.getArg(e,"file",null),this._sourceRoot=o.getArg(e,"sourceRoot",null),this._skipValidation=o.getArg(e,"skipValidation",!1),this._sources=new s,this._names=new s,this._mappings=new i,this._sourcesContents=null}static fromSourceMap(e){const n=e.sourceRoot,t=new a({file:e.file,sourceRoot:n});return e.eachMapping(function(e){const r={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(r.source=e.source,null!=n&&(r.source=o.relative(n,r.source)),r.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(r.name=e.name)),t.addMapping(r)}),e.sources.forEach(function(r){let s=r;null!==n&&(s=o.relative(n,r)),t._sources.has(s)||t._sources.add(s);const i=e.sourceContentFor(r);null!=i&&t.setSourceContent(r,i)}),t}addMapping(e){const n=o.getArg(e,"generated"),t=o.getArg(e,"original",null);let r=o.getArg(e,"source",null),s=o.getArg(e,"name",null);this._skipValidation||this._validateMapping(n,t,r,s),null!=r&&(r=String(r),this._sources.has(r)||this._sources.add(r)),null!=s&&(s=String(s),this._names.has(s)||this._names.add(s)),this._mappings.add({generatedLine:n.line,generatedColumn:n.column,originalLine:null!=t&&t.line,originalColumn:null!=t&&t.column,source:r,name:s})}setSourceContent(e,n){let t=e;null!=this._sourceRoot&&(t=o.relative(this._sourceRoot,t)),null!=n?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[o.toSetString(t)]=n):this._sourcesContents&&(delete this._sourcesContents[o.toSetString(t)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))}applySourceMap(e,n,t){let r=n;if(null==n){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');r=e.file}const i=this._sourceRoot;null!=i&&(r=o.relative(i,r));const a=this._mappings.toArray().length>0?new s:this._sources,l=new s;this._mappings.unsortedForEach(function(n){if(n.source===r&&null!=n.originalLine){const r=e.originalPositionFor({line:n.originalLine,column:n.originalColumn});null!=r.source&&(n.source=r.source,null!=t&&(n.source=o.join(t,n.source)),null!=i&&(n.source=o.relative(i,n.source)),n.originalLine=r.line,n.originalColumn=r.column,null!=r.name&&(n.name=r.name))}const s=n.source;null==s||a.has(s)||a.add(s);const u=n.name;null==u||l.has(u)||l.add(u)},this),this._sources=a,this._names=l,e.sources.forEach(function(n){const r=e.sourceContentFor(n);null!=r&&(null!=t&&(n=o.join(t,n)),null!=i&&(n=o.relative(i,n)),this.setSourceContent(n,r))},this)}_validateMapping(e,n,t,r){if(n&&"number"!=typeof n.line&&"number"!=typeof n.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!n&&!t&&!r);else if(!(e&&"line"in e&&"column"in e&&n&&"line"in n&&"column"in n&&e.line>0&&e.column>=0&&n.line>0&&n.column>=0&&t))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:t,original:n,name:r}))}_serializeMappings(){let e,n,t,s,i=0,a=1,l=0,u=0,c=0,h=0,p="";const g=this._mappings.toArray();for(let f=0,m=g.length;f0){if(!o.compareByGeneratedPositionsInflated(n,g[f-1]))continue;e+=","}e+=r.encode(n.generatedColumn-i),i=n.generatedColumn,null!=n.source&&(s=this._sources.indexOf(n.source),e+=r.encode(s-h),h=s,e+=r.encode(n.originalLine-1-u),u=n.originalLine-1,e+=r.encode(n.originalColumn-l),l=n.originalColumn,null!=n.name&&(t=this._names.indexOf(n.name),e+=r.encode(t-c),c=t)),p+=e}return p}_generateSourcesContent(e,n){return e.map(function(e){if(!this._sourcesContents)return null;null!=n&&(e=o.relative(n,e));const t=o.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,t)?this._sourcesContents[t]:null},this)}toJSON(){const e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e}toString(){return JSON.stringify(this.toJSON())}}a.prototype._version=3,n.SourceMapGenerator=a},function(e,n,t){const r=t(6);n.encode=function(e){let n,t="",o=function(e){return e<0?1+(-e<<1):0+(e<<1)}(e);do{n=31&o,(o>>>=5)>0&&(n|=32),t+=r.encode(n)}while(o>0);return t}},function(e,n){class t{constructor(){this._array=[],this._set=new Map}static fromArray(e,n){const r=new t;for(let t=0,o=e.length;t=0)return n;throw new Error('"'+e+'" is not in the set.')}at(e){if(e>=0&&ee.arrayBuffer());if(n instanceof ArrayBuffer)return Promise.resolve(n);throw new Error("You must provide the string URL or ArrayBuffer contents of lib/mappings.wasm by calling SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using SourceMapConsumer")},e.exports.initialize=(e=>n=e)}else{const r=t(18),o=t(19);e.exports=function(){return new Promise((e,t)=>{const s=o.join(n,"mappings.wasm");r.readFile(s,null,(n,r)=>{n?t(n):e(r.buffer)})})},e.exports.initialize=(e=>{console.debug("SourceMapConsumer.initialize is a no-op when running in node.js")})}}).call(this,"/")},function(e,n,t){n.SourceMapGenerator=t(1).SourceMapGenerator,n.SourceMapConsumer=t(16).SourceMapConsumer,n.SourceNode=t(21).SourceNode},function(e,n){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");n.encode=function(e){if(0<=e&&e",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(u),h=["%","/","?",";","#"].concat(c),p=["/","?","#"],g=/^[+a-z0-9A-Z_-]{0,63}$/,f=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},d={javascript:!0,"javascript:":!0},_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=t(12);function C(e,n,t){if(e&&o.isObject(e)&&e instanceof s)return e;var r=new s;return r.parse(e,n,t),r}s.prototype.parse=function(e,n,t){if(!o.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var s=e.indexOf("?"),a=-1!==s&&s127?P+="x":P+=U[I];if(!P.match(g)){var G=x.slice(0,M),k=x.slice(M+1),T=U.match(f);T&&(G.push(T[1]),k.unshift(T[2])),k.length&&(C="/"+k.join(".")+C),this.hostname=G.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),R||(this.hostname=r.toASCII(this.hostname));var q=this.port?":"+this.port:"",D=this.hostname||"";this.host=D+q,this.href+=this.host,R&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==C[0]&&(C="/"+C))}if(!m[S])for(M=0,j=c.length;M0)&&t.host.split("@"))&&(t.auth=R.shift(),t.host=t.hostname=R.shift());return t.search=e.search,t.query=e.query,o.isNull(t.pathname)&&o.isNull(t.search)||(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.href=t.format(),t}if(!v.length)return t.pathname=null,t.search?t.path="/"+t.search:t.path=null,t.href=t.format(),t;for(var O=v.slice(-1)[0],L=(t.host||e.host||v.length>1)&&("."===O||".."===O)||""===O,M=0,E=v.length;E>=0;E--)"."===(O=v[E])?v.splice(E,1):".."===O?(v.splice(E,1),M++):M&&(v.splice(E,1),M--);if(!b&&!S)for(;M--;M)v.unshift("..");!b||""===v[0]||v[0]&&"/"===v[0].charAt(0)||v.unshift(""),L&&"/"!==v.join("/").substr(-1)&&v.push("");var R,x=""===v[0]||v[0]&&"/"===v[0].charAt(0);A&&(t.hostname=t.host=x?"":v.length?v.shift():"",(R=!!(t.host&&t.host.indexOf("@")>0)&&t.host.split("@"))&&(t.auth=R.shift(),t.host=t.hostname=R.shift()));return(b=b||t.host&&v.length)&&!x&&v.unshift(""),v.length?t.pathname=v.join("/"):(t.pathname=null,t.path=null),o.isNull(t.pathname)&&o.isNull(t.search)||(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.auth=e.auth||t.auth,t.slashes=t.slashes||e.slashes,t.href=t.format(),t},s.prototype.parseHost=function(){var e=this.host,n=a.exec(e);n&&(":"!==(n=n[0])&&(this.port=n.substr(1)),e=e.substr(0,e.length-n.length)),e&&(this.hostname=e)}},function(e,n,t){(function(e,r){var o;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(s){"object"==typeof n&&n&&n.nodeType,"object"==typeof e&&e&&e.nodeType;var i="object"==typeof r&&r;i.global!==i&&i.window!==i&&i.self;var a,l=2147483647,u=36,c=1,h=26,p=38,g=700,f=72,m=128,d="-",_=/^xn--/,y=/[^\x20-\x7E]/,C=/[\x2E\u3002\uFF0E\uFF61]/g,w={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},b=u-c,S=Math.floor,v=String.fromCharCode;function A(e){throw new RangeError(w[e])}function O(e,n){for(var t=e.length,r=[];t--;)r[t]=n(e[t]);return r}function L(e,n){var t=e.split("@"),r="";return t.length>1&&(r=t[0]+"@",e=t[1]),r+O((e=e.replace(C,".")).split("."),n).join(".")}function M(e){for(var n,t,r=[],o=0,s=e.length;o=55296&&n<=56319&&o65535&&(n+=v((e-=65536)>>>10&1023|55296),e=56320|1023&e),n+=v(e)}).join("")}function R(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:u}function x(e,n){return e+22+75*(e<26)-((0!=n)<<5)}function j(e,n,t){var r=0;for(e=t?S(e/g):e>>1,e+=S(e/n);e>b*h>>1;r+=u)e=S(e/b);return S(r+(b+1)*e/(e+p))}function U(e){var n,t,r,o,s,i,a,p,g,_,y=[],C=e.length,w=0,b=m,v=f;for((t=e.lastIndexOf(d))<0&&(t=0),r=0;r=128&&A("not-basic"),y.push(e.charCodeAt(r));for(o=t>0?t+1:0;o=C&&A("invalid-input"),((p=R(e.charCodeAt(o++)))>=u||p>S((l-w)/i))&&A("overflow"),w+=p*i,!(p<(g=a<=v?c:a>=v+h?h:a-v));a+=u)i>S(l/(_=u-g))&&A("overflow"),i*=_;v=j(w-s,n=y.length+1,0==s),S(w/n)>l-b&&A("overflow"),b+=S(w/n),w%=n,y.splice(w++,0,b)}return E(y)}function P(e){var n,t,r,o,s,i,a,p,g,_,y,C,w,b,O,L=[];for(C=(e=M(e)).length,n=m,t=0,s=f,i=0;i=n&&yS((l-t)/(w=r+1))&&A("overflow"),t+=(a-n)*w,n=a,i=0;il&&A("overflow"),y==n){for(p=t,g=u;!(p<(_=g<=s?c:g>=s+h?h:g-s));g+=u)O=p-_,b=u-_,L.push(v(x(_+O%b,0))),p=S(O/b);L.push(v(x(p,0))),s=j(t,w,r==o),t=0,++r}++t,++n}return L.join("")}a={version:"1.4.1",ucs2:{decode:M,encode:E},decode:U,encode:P,toASCII:function(e){return L(e,function(e){return y.test(e)?"xn--"+P(e):e})},toUnicode:function(e){return L(e,function(e){return _.test(e)?U(e.slice(4).toLowerCase()):e})}},void 0===(o=function(){return a}.call(n,t,n,e))||(e.exports=o)}()}).call(this,t(9)(e),t(10))},function(e,n){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,n){var t;t=function(){return this}();try{t=t||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(t=window)}e.exports=t},function(e,n,t){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,n,t){"use strict";n.decode=n.parse=t(13),n.encode=n.stringify=t(14)},function(e,n,t){"use strict";function r(e,n){return Object.prototype.hasOwnProperty.call(e,n)}e.exports=function(e,n,t,s){n=n||"&",t=t||"=";var i={};if("string"!=typeof e||0===e.length)return i;var a=/\+/g;e=e.split(n);var l=1e3;s&&"number"==typeof s.maxKeys&&(l=s.maxKeys);var u=e.length;l>0&&u>l&&(u=l);for(var c=0;c=0?(h=m.substr(0,d),p=m.substr(d+1)):(h=m,p=""),g=decodeURIComponent(h),f=decodeURIComponent(p),r(i,g)?o(i[g])?i[g].push(f):i[g]=[i[g],f]:i[g]=f}return i};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,n,t){"use strict";var r=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,n,t,a){return n=n||"&",t=t||"=",null===e&&(e=void 0),"object"==typeof e?s(i(e),function(i){var a=encodeURIComponent(r(i))+t;return o(e[i])?s(e[i],function(e){return a+encodeURIComponent(r(e))}).join(n):a+encodeURIComponent(r(e[i]))}).join(n):a?encodeURIComponent(r(a))+t+encodeURIComponent(r(e)):""};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function s(e,n){if(e.map)return e.map(n);for(var t=[],r=0;rt||o==t&&i>=s||r.compareByGeneratedPositionsInflated(e,n)<=0}(this._last,e)?(this._sorted=!1,this._array.push(e)):(this._last=e,this._array.push(e))}toArray(){return this._sorted||(this._array.sort(r.compareByGeneratedPositionsInflated),this._sorted=!0),this._array}}},function(e,n,t){const r=t(0),o=t(17),s=t(3).ArraySet,i=(t(2),t(4)),a=t(20),l=Symbol("smcInternal");class u{constructor(e,n){return e==l?Promise.resolve(this):function(e,n){let t=e;"string"==typeof e&&(t=r.parseSourceMapInput(e));const o=null!=t.sections?new h(t,n):new c(t,n);return Promise.resolve(o)}(e,n)}static initialize(e){i.initialize(e["lib/mappings.wasm"])}static fromSourceMap(e,n){return function(e,n){return c.fromSourceMap(e,n)}(e,n)}static async with(e,n,t){const r=await new u(e,n);try{return await t(r)}finally{r.destroy()}}_parseMappings(e,n){throw new Error("Subclasses must implement _parseMappings")}eachMapping(e,n,t){throw new Error("Subclasses must implement eachMapping")}allGeneratedPositionsFor(e){throw new Error("Subclasses must implement allGeneratedPositionsFor")}destroy(){throw new Error("Subclasses must implement destroy")}}u.prototype._version=3,u.GENERATED_ORDER=1,u.ORIGINAL_ORDER=2,u.GREATEST_LOWER_BOUND=1,u.LEAST_UPPER_BOUND=2,n.SourceMapConsumer=u;class c extends u{constructor(e,n){return super(l).then(t=>{let o=e;"string"==typeof e&&(o=r.parseSourceMapInput(e));const i=r.getArg(o,"version");let l=r.getArg(o,"sources");const u=r.getArg(o,"names",[]);let c=r.getArg(o,"sourceRoot",null);const h=r.getArg(o,"sourcesContent",null),p=r.getArg(o,"mappings"),g=r.getArg(o,"file",null);if(i!=t._version)throw new Error("Unsupported version: "+i);return c&&(c=r.normalize(c)),l=l.map(String).map(r.normalize).map(function(e){return c&&r.isAbsolute(c)&&r.isAbsolute(e)?r.relative(c,e):e}),t._names=s.fromArray(u.map(String),!0),t._sources=s.fromArray(l,!0),t._absoluteSources=t._sources.toArray().map(function(e){return r.computeSourceURL(c,e,n)}),t.sourceRoot=c,t.sourcesContent=h,t._mappings=p,t._sourceMapURL=n,t.file=g,t._computedColumnSpans=!1,t._mappingsPtr=0,t._wasm=null,a().then(e=>(t._wasm=e,t))})}_findSourceIndex(e){let n=e;if(null!=this.sourceRoot&&(n=r.relative(this.sourceRoot,n)),this._sources.has(n))return this._sources.indexOf(n);for(let n=0;n{null!==n.source&&(n.source=this._sources.at(n.source),n.source=r.computeSourceURL(i,n.source,this._sourceMapURL),null!==n.name&&(n.name=this._names.at(n.name))),e.call(o,n)},()=>{switch(s){case u.GENERATED_ORDER:this._wasm.exports.by_generated_location(this._getMappingsPtr());break;case u.ORIGINAL_ORDER:this._wasm.exports.by_original_location(this._getMappingsPtr());break;default:throw new Error("Unknown order of iteration.")}})}allGeneratedPositionsFor(e){let n=r.getArg(e,"source");const t=r.getArg(e,"line"),o=e.column||0;if((n=this._findSourceIndex(n))<0)return[];if(t<1)throw new Error("Line numbers must be >= 1");if(o<0)throw new Error("Column numbers must be >= 0");const s=[];return this._wasm.withMappingCallback(e=>{let n=e.lastGeneratedColumn;this._computedColumnSpans&&null===n&&(n=1/0),s.push({line:e.generatedLine,column:e.generatedColumn,lastColumn:n})},()=>{this._wasm.exports.all_generated_locations_for(this._getMappingsPtr(),n,t-1,"column"in e,o)}),s}destroy(){0!==this._mappingsPtr&&(this._wasm.exports.free_mappings(this._mappingsPtr),this._mappingsPtr=0)}computeColumnSpans(){this._computedColumnSpans||(this._wasm.exports.compute_column_spans(this._getMappingsPtr()),this._computedColumnSpans=!0)}originalPositionFor(e){const n={generatedLine:r.getArg(e,"line"),generatedColumn:r.getArg(e,"column")};if(n.generatedLine<1)throw new Error("Line numbers must be >= 1");if(n.generatedColumn<0)throw new Error("Column numbers must be >= 0");let t,o=r.getArg(e,"bias",u.GREATEST_LOWER_BOUND);if(null==o&&(o=u.GREATEST_LOWER_BOUND),this._wasm.withMappingCallback(e=>t=e,()=>{this._wasm.exports.original_location_for(this._getMappingsPtr(),n.generatedLine-1,n.generatedColumn,o)}),t&&t.generatedLine===n.generatedLine){let e=r.getArg(t,"source",null);null!==e&&(e=this._sources.at(e),e=r.computeSourceURL(this.sourceRoot,e,this._sourceMapURL));let n=r.getArg(t,"name",null);return null!==n&&(n=this._names.at(n)),{source:e,line:r.getArg(t,"originalLine",null),column:r.getArg(t,"originalColumn",null),name:n}}return{source:null,line:null,column:null,name:null}}hasContentsOfAllSources(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))}sourceContentFor(e,n){if(!this.sourcesContent)return null;const t=this._findSourceIndex(e);if(t>=0)return this.sourcesContent[t];let o,s=e;if(null!=this.sourceRoot&&(s=r.relative(this.sourceRoot,s)),null!=this.sourceRoot&&(o=r.urlParse(this.sourceRoot))){const e=s.replace(/^file:\/\//,"");if("file:"==o.protocol&&this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];if((!o.pathname||"/"==o.pathname)&&this._sources.has("/"+s))return this.sourcesContent[this._sources.indexOf("/"+s)]}if(n)return null;throw new Error('"'+s+'" is not in the SourceMap.')}generatedPositionFor(e){let n=r.getArg(e,"source");if((n=this._findSourceIndex(n))<0)return{line:null,column:null,lastColumn:null};const t={source:n,originalLine:r.getArg(e,"line"),originalColumn:r.getArg(e,"column")};if(t.originalLine<1)throw new Error("Line numbers must be >= 1");if(t.originalColumn<0)throw new Error("Column numbers must be >= 0");let o,s=r.getArg(e,"bias",u.GREATEST_LOWER_BOUND);if(null==s&&(s=u.GREATEST_LOWER_BOUND),this._wasm.withMappingCallback(e=>o=e,()=>{this._wasm.exports.generated_location_for(this._getMappingsPtr(),t.source,t.originalLine-1,t.originalColumn,s)}),o&&o.source===t.source){let e=o.lastGeneratedColumn;return this._computedColumnSpans&&null===e&&(e=1/0),{line:r.getArg(o,"generatedLine",null),column:r.getArg(o,"generatedColumn",null),lastColumn:e}}return{line:null,column:null,lastColumn:null}}}c.prototype.consumer=u,n.BasicSourceMapConsumer=c;class h extends u{constructor(e,n){return super(l).then(t=>{let o=e;"string"==typeof e&&(o=r.parseSourceMapInput(e));const i=r.getArg(o,"version"),a=r.getArg(o,"sections");if(i!=t._version)throw new Error("Unsupported version: "+i);t._sources=new s,t._names=new s,t.__generatedMappings=null,t.__originalMappings=null,t.__generatedMappingsUnsorted=null,t.__originalMappingsUnsorted=null;let l={line:-1,column:0};return Promise.all(a.map(e=>{if(e.url)throw new Error("Support for url field in sections not implemented.");const t=r.getArg(e,"offset"),o=r.getArg(t,"line"),s=r.getArg(t,"column");if(o({generatedOffset:{generatedLine:o+1,generatedColumn:s+1},consumer:e}))})).then(e=>(t._sections=e,t))})}get _generatedMappings(){return this.__generatedMappings||this._sortGeneratedMappings(),this.__generatedMappings}get _originalMappings(){return this.__originalMappings||this._sortOriginalMappings(),this.__originalMappings}get _generatedMappingsUnsorted(){return this.__generatedMappingsUnsorted||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappingsUnsorted}get _originalMappingsUnsorted(){return this.__originalMappingsUnsorted||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappingsUnsorted}_sortGeneratedMappings(){const e=this._generatedMappingsUnsorted;e.sort(r.compareByGeneratedPositionsDeflated),this.__generatedMappings=e}_sortOriginalMappings(){const e=this._originalMappingsUnsorted;e.sort(r.compareByOriginalPositions),this.__originalMappings=e}get sources(){const e=[];for(let n=0;ns.push(e));for(let e=0;e= 1");if(t.originalColumn<0)throw new Error("Column numbers must be >= 0");const s=[];let i=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",r.compareByOriginalPositions,o.LEAST_UPPER_BOUND);if(i>=0){let t=this._originalMappings[i];if(void 0===e.column){const e=t.originalLine;for(;t&&t.originalLine===e;){let e=t.lastGeneratedColumn;this._computedColumnSpans&&null===e&&(e=1/0),s.push({line:r.getArg(t,"generatedLine",null),column:r.getArg(t,"generatedColumn",null),lastColumn:e}),t=this._originalMappings[++i]}}else{const e=t.originalColumn;for(;t&&t.originalLine===n&&t.originalColumn==e;){let e=t.lastGeneratedColumn;this._computedColumnSpans&&null===e&&(e=1/0),s.push({line:r.getArg(t,"generatedLine",null),column:r.getArg(t,"generatedColumn",null),lastColumn:e}),t=this._originalMappings[++i]}}}return s}destroy(){for(let e=0;e0?r-l>1?e(l,r,o,s,i,a):a==n.LEAST_UPPER_BOUND?r1?e(t,l,o,s,i,a):a==n.LEAST_UPPER_BOUND?l:t<0?-1:t}(-1,t.length,e,t,r,o||n.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&0===r(t[s],t[s-1],!0);)--s;return s}},function(n,t){n.exports=e},function(e,t){e.exports=n},function(e,n,t){const r=t(4);let o=null;e.exports=function(){if(o)return o;const e=[];return o=r().then(n=>WebAssembly.instantiate(n,{env:{mapping_callback(n,t,r,o,s,i,a,l,u,c){const h=new function(){this.generatedLine=0,this.generatedColumn=0,this.lastGeneratedColumn=null,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null};h.generatedLine=n+1,h.generatedColumn=t,r&&(h.lastGeneratedColumn=o-1),s&&(h.source=i,h.originalLine=a+1,h.originalColumn=l,u&&(h.name=c)),e[e.length-1](h)},start_all_generated_locations_for(){console.time("all_generated_locations_for")},end_all_generated_locations_for(){console.timeEnd("all_generated_locations_for")},start_compute_column_spans(){console.time("compute_column_spans")},end_compute_column_spans(){console.timeEnd("compute_column_spans")},start_generated_location_for(){console.time("generated_location_for")},end_generated_location_for(){console.timeEnd("generated_location_for")},start_original_location_for(){console.time("original_location_for")},end_original_location_for(){console.timeEnd("original_location_for")},start_parse_mappings(){console.time("parse_mappings")},end_parse_mappings(){console.timeEnd("parse_mappings")},start_sort_by_generated_location(){console.time("sort_by_generated_location")},end_sort_by_generated_location(){console.timeEnd("sort_by_generated_location")},start_sort_by_original_location(){console.time("sort_by_original_location")},end_sort_by_original_location(){console.timeEnd("sort_by_original_location")}}})).then(n=>({exports:n.instance.exports,withMappingCallback:(n,t)=>{e.push(n);try{t()}finally{e.pop()}}})).then(null,e=>{throw o=null,e})}},function(e,n,t){const r=t(1).SourceMapGenerator,o=t(0),s=/(\r?\n)/,i=10,a="$$$isSourceNode$$$";class l{constructor(e,n,t,r,o){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==n?null:n,this.source=null==t?null:t,this.name=null==o?null:o,this[a]=!0,null!=r&&this.add(r)}static fromStringWithSourceMap(e,n,t){const r=new l,i=e.split(s);let a=0;const u=function(){return e()+(e()||"");function e(){return a=0;n--)this.prepend(e[n]);else{if(!e[a]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this}walk(e){let n;for(let t=0,r=this.children.length;t0){for(n=[],t=0;t Date: Fri, 12 Oct 2018 11:34:24 +0800 Subject: [PATCH 3/4] Test SourceMapConsumer against "blob:" sourceMapURL --- test/test-source-map-consumer.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/test-source-map-consumer.js b/test/test-source-map-consumer.js index 3eddcdfe..fb026d53 100644 --- a/test/test-source-map-consumer.js +++ b/test/test-source-map-consumer.js @@ -1368,6 +1368,22 @@ exports["test absolute sourceURL resolution with sourceMapURL"] = async function consumer.destroy(); }; +exports["test sourceURL resolution with null sourceRoot and blob sourceMapURL"] = async function(assert) { + const map = { + version: 3, + sources: ["something.js"], + names: [], + mappings: "CAAS", + file: "static/js/manifest.b7cf97680f7a50fa150f.js", + sourceRoot: null, + }; + const consumer = await new SourceMapConsumer(map, "blob:http://exmaple.com/12345-12345-12345"); + + assert.equal(consumer.sources.length, 1); + assert.equal(consumer.sources[0], "something.js"); + + consumer.destroy(); +}; exports["test line numbers > 2**32"] = async function(assert) { const map = await new SourceMapConsumer({ version: 3, From e4c4e7b2193b61ea52fd6b1fe1cfd6608a04828d Mon Sep 17 00:00:00 2001 From: redeyes2015 Date: Fri, 12 Oct 2018 11:44:20 +0800 Subject: [PATCH 4/4] Prevent computeSourceURL fail on invalid resolution --- lib/util.js | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/lib/util.js b/lib/util.js index 22b6cfb0..0ae7b8cd 100644 --- a/lib/util.js +++ b/lib/util.js @@ -489,26 +489,17 @@ function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { // this code block is conditional. However, it's preferable to pass // the source map URL to SourceMapConsumer, so that this function // can implement the source URL resolution algorithm as outlined in - // the spec. This block is basically the equivalent of: - // new URL(sourceURL, sourceMapURL).toString() + // the spec. // // The spec says: // If the sources are not absolute URLs after prepending of the // “sourceRoot”, the sources are resolved relative to the // SourceMap (like resolving script src in a html document). if (sourceMapURL) { - const parsed = urlParse(sourceMapURL); - if (!parsed) { - throw new Error("sourceMapURL could not be parsed"); + try { + sourceURL = (new URLConstructor(sourceURL, sourceMapURL)).toString(); + } catch (e) { } - if (parsed.pathname) { - // Strip the last path component, but keep the "/". - const index = parsed.pathname.lastIndexOf("/"); - if (index >= 0) { - parsed.pathname = parsed.pathname.substring(0, index + 1); - } - } - sourceURL = join(parsed.toString(), sourceURL); } return normalize(sourceURL);