@loaders.gl/json 3.0.10 → 3.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dist.es5.min.js +1 -1
- package/dist/dist.es5.min.js.map +1 -1
- package/dist/dist.min.js +1 -1
- package/dist/es5/geojson-loader.js +1 -1
- package/dist/es5/json-loader.js +1 -1
- package/dist/esm/geojson-loader.js +1 -1
- package/dist/esm/json-loader.js +1 -1
- package/dist/geojson-worker.js +1 -1
- package/dist/geojson-worker.js.map +1 -1
- package/package.json +5 -5
package/dist/dist.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var s=e();for(var o in s)("object"==typeof exports?exports:t)[o]=s[o]}}(window,(function(){return function(t){var e={};function s(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,s),i.l=!0,i.exports}return s.m=t,s.c=e,s.d=function(t,e,o){s.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.t=function(t,e){if(1&e&&(t=s(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(s.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)s.d(o,i,function(e){return t[e]}.bind(null,i));return o},s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="",s(s.s=0)}([function(t,e,s){(function(e){const o=s(2),i="undefined"==typeof window?e:window;i.loaders=i.loaders||{},t.exports=Object.assign(i.loaders,o)}).call(this,s(1))},function(t,e){var s;s=function(){return this}();try{s=s||new Function("return this")()}catch(t){"object"==typeof window&&(s=window)}t.exports=s},function(t,e,s){"use strict";function o(t,e){try{var s;const o=JSON.parse(t);return null!==(s=e.json)&&void 0!==s&&s.table&&function t(e){if(Array.isArray(e))return e;if(e&&"object"==typeof e)for(const s of Object.values(e)){const e=t(s);if(e)return e}return null}(o)||o}catch(t){throw new Error("JSONLoader: failed to parse JSON")}}function i(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}s.r(e),s.d(e,"JSONLoader",(function(){return at})),s.d(e,"_GeoJSONLoader",(function(){return Et})),s.d(e,"_GeoJSONWorkerLoader",(function(){return vt})),s.d(e,"_JSONPath",(function(){return et})),s.d(e,"_ClarinetParser",(function(){return q}));class n{constructor(t,e){if(i(this,"schema",void 0),i(this,"options",void 0),i(this,"length",0),i(this,"rows",null),i(this,"cursor",0),i(this,"_headers",[]),this.options=e,this.schema=t,!Array.isArray(t)){this._headers=[];for(const e in t)this._headers[t[e].index]=t[e].name}}rowCount(){return this.length}addArrayRow(t,e){Number.isFinite(e)&&(this.cursor=e),this.rows=this.rows||new Array(100),this.rows[this.length]=t,this.length++}addObjectRow(t,e){Number.isFinite(e)&&(this.cursor=e),this.rows=this.rows||new Array(100),this.rows[this.length]=t,this.length++}getBatch(){let t=this.rows;if(!t)return null;t=t.slice(0,this.length),this.rows=null;return{shape:this.options.shape,batchType:"data",data:t,length:this.length,schema:this.schema,cursor:this.cursor}}}function r(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}class a{constructor(t,e){if(r(this,"schema",void 0),r(this,"options",void 0),r(this,"length",0),r(this,"objectRows",null),r(this,"arrayRows",null),r(this,"cursor",0),r(this,"_headers",[]),this.options=e,this.schema=t,!Array.isArray(t)){this._headers=[];for(const e in t)this._headers[t[e].index]=t[e].name}}rowCount(){return this.length}addArrayRow(t,e){switch(Number.isFinite(e)&&(this.cursor=e),this.options.shape){case"object-row-table":const s=function(t,e){if(!t)throw new Error("null row");if(!e)throw new Error("no headers");const s={};for(let o=0;o<e.length;o++)s[e[o]]=t[o];return s}(t,this._headers);this.addObjectRow(s,e);break;case"array-row-table":this.arrayRows=this.arrayRows||new Array(100),this.arrayRows[this.length]=t,this.length++}}addObjectRow(t,e){switch(Number.isFinite(e)&&(this.cursor=e),this.options.shape){case"array-row-table":const s=function(t,e){if(!t)throw new Error("null row");if(!e)throw new Error("no headers");const s=new Array(e.length);for(let o=0;o<e.length;o++)s[o]=t[e[o]];return s}(t,this._headers);this.addArrayRow(s,e);break;case"object-row-table":this.objectRows=this.objectRows||new Array(100),this.objectRows[this.length]=t,this.length++}}getBatch(){let t=this.arrayRows||this.objectRows;return t?(t=t.slice(0,this.length),this.arrayRows=null,this.objectRows=null,{shape:this.options.shape,batchType:"data",data:t,length:this.length,schema:this.schema,cursor:this.cursor}):null}}function h(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}class c{constructor(t,e){h(this,"schema",void 0),h(this,"length",0),h(this,"allocated",0),h(this,"columns",{}),this.schema=t,this._reallocateColumns()}rowCount(){return this.length}addArrayRow(t){this._reallocateColumns();let e=0;for(const s in this.columns)this.columns[s][this.length]=t[e++];this.length++}addObjectRow(t){this._reallocateColumns();for(const e in t)this.columns[e][this.length]=t[e];this.length++}getBatch(){this._pruneColumns();const t=Array.isArray(this.schema)?this.columns:{};if(!Array.isArray(this.schema))for(const e in this.schema){const s=this.schema[e];t[s.name]=this.columns[s.index]}this.columns={};return{shape:"columnar-table",batchType:"data",data:t,schema:this.schema,length:this.length}}_reallocateColumns(){if(!(this.length<this.allocated)){this.allocated=this.allocated>0?this.allocated*=2:100,this.columns={};for(const t in this.schema){const e=this.schema[t],s=e.type||Float32Array,o=this.columns[e.index];if(o&&ArrayBuffer.isView(o)){const t=new s(this.allocated);t.set(o),this.columns[e.index]=t}else o?(o.length=this.allocated,this.columns[e.index]=o):this.columns[e.index]=new s(this.allocated)}}}_pruneColumns(){for(const[t,e]of Object.entries(this.columns))this.columns[t]=e.slice(0,this.length)}}function l(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}const u={shape:"array-row-table",batchSize:"auto",batchDebounceMs:0,limit:0,_limitMB:0};class p{constructor(t,e){l(this,"schema",void 0),l(this,"options",void 0),l(this,"aggregator",null),l(this,"batchCount",0),l(this,"bytesUsed",0),l(this,"isChunkComplete",!1),l(this,"lastBatchEmittedMs",Date.now()),l(this,"totalLength",0),l(this,"totalBytes",0),l(this,"rowBytes",0),this.schema=t,this.options={...u,...e}}limitReached(){var t,e;return!!(Boolean(null===(t=this.options)||void 0===t?void 0:t.limit)&&this.totalLength>=this.options.limit)||!!(Boolean(null===(e=this.options)||void 0===e?void 0:e._limitMB)&&this.totalBytes/1e6>=this.options._limitMB)}addRow(t){this.limitReached()||(this.totalLength++,this.rowBytes=this.rowBytes||this._estimateRowMB(t),this.totalBytes+=this.rowBytes,Array.isArray(t)?this.addArrayRow(t):this.addObjectRow(t))}addArrayRow(t){if(!this.aggregator){const t=this._getTableBatchType();this.aggregator=new t(this.schema,this.options)}this.aggregator.addArrayRow(t)}addObjectRow(t){if(!this.aggregator){const t=this._getTableBatchType();this.aggregator=new t(this.schema,this.options)}this.aggregator.addObjectRow(t)}chunkComplete(t){t instanceof ArrayBuffer&&(this.bytesUsed+=t.byteLength),"string"==typeof t&&(this.bytesUsed+=t.length),this.isChunkComplete=!0}getFullBatch(t){return this._isFull()?this._getBatch(t):null}getFinalBatch(t){return this._getBatch(t)}_estimateRowMB(t){return Array.isArray(t)?8*t.length:8*Object.keys(t).length}_isFull(){if(!this.aggregator||0===this.aggregator.rowCount())return!1;if("auto"===this.options.batchSize){if(!this.isChunkComplete)return!1}else if(this.options.batchSize>this.aggregator.rowCount())return!1;return!(this.options.batchDebounceMs>Date.now()-this.lastBatchEmittedMs)&&(this.isChunkComplete=!1,this.lastBatchEmittedMs=Date.now(),!0)}_getBatch(t){if(!this.aggregator)return null;null!=t&&t.bytesUsed&&(this.bytesUsed=t.bytesUsed);const e=this.aggregator.getBatch();return e.count=this.batchCount,e.bytesUsed=this.bytesUsed,Object.assign(e,t),this.batchCount++,this.aggregator=null,e}_getTableBatchType(){switch(this.options.shape){case"row-table":return n;case"array-row-table":case"object-row-table":return a;case"columnar-table":return c;case"arrow-table":if(!p.ArrowBatch)throw new Error("TableBatchBuilder");return p.ArrowBatch;default:throw new Error("TableBatchBuilder")}}}l(p,"ArrowBatch",void 0);const d=Number.MAX_SAFE_INTEGER,f="debug"==={}.CDEBUG,g={textNode:void 0,numberNode:""};let y=0;const b={BEGIN:y++,VALUE:y++,OPEN_OBJECT:y++,CLOSE_OBJECT:y++,OPEN_ARRAY:y++,CLOSE_ARRAY:y++,TEXT_ESCAPE:y++,STRING:y++,BACKSLASH:y++,END:y++,OPEN_KEY:y++,CLOSE_KEY:y++,TRUE:y++,TRUE2:y++,TRUE3:y++,FALSE:y++,FALSE2:y++,FALSE3:y++,FALSE4:y++,NULL:y++,NULL2:y++,NULL3:y++,NUMBER_DECIMAL_POINT:y++,NUMBER_DIGIT:y++};for(var w in b)b[b[w]]=w;y=b;const m=9,A=10,j=13,P=32,v=34,E=43,S=44,_=45,O=46,C=48,N=57,L=58,I=69,R=91,B=92,U=93,k=97,x=98,F=101,T=102,J=108,M=110,z=114,D=115,Y=116,G=117,V=123,K=125;var $=/[\\"\n]/g;class q{constructor(t={}){this._initialize(t)}_initialize(t){this._clearBuffers(this),this.bufferCheckPosition=d,this.q="",this.c="",this.p="",this.options=t||{},this.closed=!1,this.closedRoot=!1,this.sawRoot=!1,this.tag=null,this.error=null,this.state=y.BEGIN,this.stack=new Array,this.position=this.column=0,this.line=1,this.slashed=!1,this.unicodeI=0,this.unicodeS=null,this.depth=0,"onready"in t&&(this.onready=t.onready),"onopenobject"in t&&(this.onopenobject=t.onopenobject),"onkey"in t&&(this.onkey=t.onkey),"oncloseobject"in t&&(this.oncloseobject=t.oncloseobject),"onopenarray"in t&&(this.onopenarray=t.onopenarray),"onclosearray"in t&&(this.onclosearray=t.onclosearray),"onvalue"in t&&(this.onvalue=t.onvalue),"onerror"in t&&(this.onerror=t.onerror),"onend"in t&&(this.onend=t.onend),"onchunkparsed"in t&&(this.onchunkparsed=t.onchunkparsed),X(this,"onready")}_clearBuffers(){for(var t in g)this[t]=g[t]}end(){return this.state===y.VALUE&&0===this.depth||Z(this,"Unexpected end"),W(this),this.c="",this.closed=!0,X(this,"onend"),this._initialize(this.options),this}resume(){return this.error=null,this}close(){return this.write(null)}write(t){if(this.error)throw this.error;if(this.closed)return Z(this,"Cannot write after close. Assign an onready handler.");if(null===t)return this.end();var e=0,s=t.charCodeAt(0),o=this.p;for(f&&console.log("write -> ["+t+"]");s&&(o=s,this.c=s=t.charCodeAt(e++),o!==s?this.p=o:o=this.p,s);)switch(f&&console.log(e,s,b[this.state]),this.position++,s===A?(this.line++,this.column=0):this.column++,this.state){case y.BEGIN:s===V?this.state=y.OPEN_OBJECT:s===R?this.state=y.OPEN_ARRAY:tt(s)||Z(this,"Non-whitespace before {[.");continue;case y.OPEN_KEY:case y.OPEN_OBJECT:if(tt(s))continue;if(this.state===y.OPEN_KEY)this.stack.push(y.CLOSE_KEY);else{if(s===K){X(this,"onopenobject"),this.depth++,X(this,"oncloseobject"),this.depth--,this.state=this.stack.pop()||y.VALUE;continue}this.stack.push(y.CLOSE_OBJECT)}s===v?this.state=y.STRING:Z(this,'Malformed object key should start with "');continue;case y.CLOSE_KEY:case y.CLOSE_OBJECT:if(tt(s))continue;this.state,y.CLOSE_KEY;s===L?(this.state===y.CLOSE_OBJECT?(this.stack.push(y.CLOSE_OBJECT),W(this,"onopenobject"),this.depth++):W(this,"onkey"),this.state=y.VALUE):s===K?(H(this,"oncloseobject"),this.depth--,this.state=this.stack.pop()||y.VALUE):s===S?(this.state===y.CLOSE_OBJECT&&this.stack.push(y.CLOSE_OBJECT),W(this),this.state=y.OPEN_KEY):Z(this,"Bad object");continue;case y.OPEN_ARRAY:case y.VALUE:if(tt(s))continue;if(this.state===y.OPEN_ARRAY){if(X(this,"onopenarray"),this.depth++,this.state=y.VALUE,s===U){X(this,"onclosearray"),this.depth--,this.state=this.stack.pop()||y.VALUE;continue}this.stack.push(y.CLOSE_ARRAY)}s===v?this.state=y.STRING:s===V?this.state=y.OPEN_OBJECT:s===R?this.state=y.OPEN_ARRAY:s===Y?this.state=y.TRUE:s===T?this.state=y.FALSE:s===M?this.state=y.NULL:s===_?this.numberNode+="-":C<=s&&s<=N?(this.numberNode+=String.fromCharCode(s),this.state=y.NUMBER_DIGIT):Z(this,"Bad value");continue;case y.CLOSE_ARRAY:if(s===S)this.stack.push(y.CLOSE_ARRAY),W(this,"onvalue"),this.state=y.VALUE;else if(s===U)H(this,"onclosearray"),this.depth--,this.state=this.stack.pop()||y.VALUE;else{if(tt(s))continue;Z(this,"Bad array")}continue;case y.STRING:void 0===this.textNode&&(this.textNode="");var i=e-1,n=this.slashed,r=this.unicodeI;t:for(;;){for(f&&console.log(e,s,b[this.state],n);r>0;)if(this.unicodeS+=String.fromCharCode(s),s=t.charCodeAt(e++),this.position++,4===r?(this.textNode+=String.fromCharCode(parseInt(this.unicodeS,16)),r=0,i=e-1):r++,!s)break t;if(s===v&&!n){this.state=this.stack.pop()||y.VALUE,this.textNode+=t.substring(i,e-1),this.position+=e-1-i;break}if(s===B&&!n&&(n=!0,this.textNode+=t.substring(i,e-1),this.position+=e-1-i,s=t.charCodeAt(e++),this.position++,!s))break;if(n){if(n=!1,s===M?this.textNode+="\n":s===z?this.textNode+="\r":s===Y?this.textNode+="\t":s===T?this.textNode+="\f":s===x?this.textNode+="\b":s===G?(r=1,this.unicodeS=""):this.textNode+=String.fromCharCode(s),s=t.charCodeAt(e++),this.position++,i=e-1,s)continue;break}$.lastIndex=e;var a=$.exec(t);if(null===a){e=t.length+1,this.textNode+=t.substring(i,e-1),this.position+=e-1-i;break}if(e=a.index+1,!(s=t.charCodeAt(a.index))){this.textNode+=t.substring(i,e-1),this.position+=e-1-i;break}}this.slashed=n,this.unicodeI=r;continue;case y.TRUE:s===z?this.state=y.TRUE2:Z(this,"Invalid true started with t"+s);continue;case y.TRUE2:s===G?this.state=y.TRUE3:Z(this,"Invalid true started with tr"+s);continue;case y.TRUE3:s===F?(X(this,"onvalue",!0),this.state=this.stack.pop()||y.VALUE):Z(this,"Invalid true started with tru"+s);continue;case y.FALSE:s===k?this.state=y.FALSE2:Z(this,"Invalid false started with f"+s);continue;case y.FALSE2:s===J?this.state=y.FALSE3:Z(this,"Invalid false started with fa"+s);continue;case y.FALSE3:s===D?this.state=y.FALSE4:Z(this,"Invalid false started with fal"+s);continue;case y.FALSE4:s===F?(X(this,"onvalue",!1),this.state=this.stack.pop()||y.VALUE):Z(this,"Invalid false started with fals"+s);continue;case y.NULL:s===G?this.state=y.NULL2:Z(this,"Invalid null started with n"+s);continue;case y.NULL2:s===J?this.state=y.NULL3:Z(this,"Invalid null started with nu"+s);continue;case y.NULL3:s===J?(X(this,"onvalue",null),this.state=this.stack.pop()||y.VALUE):Z(this,"Invalid null started with nul"+s);continue;case y.NUMBER_DECIMAL_POINT:s===O?(this.numberNode+=".",this.state=y.NUMBER_DIGIT):Z(this,"Leading zero not followed by .");continue;case y.NUMBER_DIGIT:C<=s&&s<=N?this.numberNode+=String.fromCharCode(s):s===O?(-1!==this.numberNode.indexOf(".")&&Z(this,"Invalid number has two dots"),this.numberNode+="."):s===F||s===I?(-1===this.numberNode.indexOf("e")&&-1===this.numberNode.indexOf("E")||Z(this,"Invalid number has two exponential"),this.numberNode+="e"):s===E||s===_?(o!==F&&o!==I&&Z(this,"Invalid symbol in number"),this.numberNode+=String.fromCharCode(s)):(Q(this),e--,this.state=this.stack.pop()||y.VALUE);continue;default:Z(this,"Unknown state: "+this.state)}return this.position>=this.bufferCheckPosition&&function(t){const e=Math.max(d,10);let s=0;for(var o in g){var i=void 0===t[o]?0:t[o].length;if(i>e)switch(o){case"text":closeText(t);break;default:Z(t,"Max buffer length exceeded: "+o)}s=Math.max(s,i)}t.bufferCheckPosition=d-s+t.position}(this),X(this,"onchunkparsed"),this}}function X(t,e,s){f&&console.log("-- emit",e,s),t[e]&&t[e](s,t)}function H(t,e,s){W(t),X(t,e,s)}function W(t,e){t.textNode=function(t,e){if(void 0===e)return e;t.trim&&(e=e.trim());t.normalize&&(e=e.replace(/\s+/g," "));return e}(t.options,t.textNode),void 0!==t.textNode&&X(t,e||"onvalue",t.textNode),t.textNode=void 0}function Q(t){t.numberNode&&X(t,"onvalue",parseFloat(t.numberNode)),t.numberNode=""}function Z(t,e){return W(t),e+="\nLine: "+t.line+"\nColumn: "+t.column+"\nChar: "+t.c,e=new Error(e),t.error=e,X(t,"onerror",e),t}function tt(t){return t===j||t===A||t===P||t===m}class et{constructor(t=null){var e,s,o;if(o=void 0,(s="path")in(e=this)?Object.defineProperty(e,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[s]=o,this.path=["$"],t instanceof et)this.path=[...t.path];else if(Array.isArray(t))this.path.push(...t);else if("string"==typeof t&&(this.path=t.split("."),"$"!==this.path[0]))throw new Error("JSONPaths must start with $")}clone(){return new et(this)}toString(){return this.path.join(".")}push(t){this.path.push(t)}pop(){return this.path.pop()}set(t){this.path[this.path.length-1]=t}equals(t){if(!this||!t||this.path.length!==t.path.length)return!1;for(let e=0;e<this.path.length;++e)if(this.path[e]!==t.path[e])return!1;return!0}setFieldAtPath(t,e){const s=[...this.path];s.shift();const o=s.pop();for(const e of s)t=t[e];t[o]=e}getFieldAtPath(t){const e=[...this.path];e.shift();const s=e.pop();for(const s of e)t=t[s];return t[s]}}function st(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function ot(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}class it extends class{constructor(){st(this,"jsonpath",void 0),st(this,"_parser",void 0),this.reset(),this._initializeParser()}reset(){this.result=void 0,this.previousStates=[],this.currentState=Object.freeze({container:[],key:null}),this.jsonpath=new et}write(t){this.parser.write(t)}close(){this.parser.close()}_pushOrSet(t){const{container:e,key:s}=this.currentState;null!==s?(e[s]=t,this.currentState.key=null):e.push(t)}_openArray(t=[]){this.jsonpath.push(null),this._pushOrSet(t),this.previousStates.push(this.currentState),this.currentState={container:t,isArray:!0,key:null}}_closeArray(){this.jsonpath.pop(),this.currentState=this.previousStates.pop()}_openObject(t={}){this.jsonpath.push(null),this._pushOrSet(t),this.previousStates.push(this.currentState),this.currentState={container:t,isArray:!1,key:null}}_closeObject(){this.jsonpath.pop(),this.currentState=this.previousStates.pop()}_initializeParser(){this._parser=new q({onready:()=>{this.jsonpath=new et,this.previousStates.length=0,this.currentState.container.length=0},onopenobject:t=>{this._openObject({}),void 0!==t&&this.parser.onkey(t)},onkey:t=>{this.jsonpath.set(t),this.currentState.key=t},oncloseobject:()=>{this._closeObject()},onopenarray:()=>{this._openArray()},onclosearray:()=>{this._closeArray()},onvalue:t=>{this._pushOrSet(t)},onerror:t=>{throw t},onend:()=>{this.result=this.currentState.container.pop()}})}get parser(){return this._parser}}{constructor(t={}){super(),ot(this,"jsonPaths",void 0),ot(this,"streamingJsonPath",null),ot(this,"streamingArray",null),ot(this,"topLevelObject",null);const e=t.jsonpaths||[];this.jsonPaths=e.map(t=>new et(t)),this._extendParser()}write(t){super.write(t);let e=[];return this.streamingArray&&(e=[...this.streamingArray],this.streamingArray.length=0),e}getPartialResult(){return this.topLevelObject}getStreamingJsonPath(){return this.streamingJsonPath}getStreamingJsonPathAsString(){return this.streamingJsonPath&&this.streamingJsonPath.toString()}getJsonPath(){return this.jsonpath}_matchJSONPath(){const t=this.getJsonPath();if(0===this.jsonPaths.length)return!0;for(const e of this.jsonPaths)if(e.equals(t))return!0;return!1}_extendParser(){this.parser.onopenarray=()=>{if(!this.streamingArray&&this._matchJSONPath())return this.streamingJsonPath=this.getJsonPath().clone(),this.streamingArray=[],void this._openArray(this.streamingArray);this._openArray()},this.parser.onopenobject=t=>{this.topLevelObject?this._openObject({}):(this.topLevelObject={},this._openObject(this.topLevelObject)),void 0!==t&&this.parser.onkey(t)}}}async function*nt(t,e){var s;const o=async function*(t,e={}){const s=new TextDecoder(void 0,e);for await(const e of t)yield"string"==typeof e?e:s.decode(e,{stream:!0})}(t),{metadata:i}=e,{jsonpaths:n}=e.json||{};let r=!0;const a=(null==e||null===(s=e.json)||void 0===s?void 0:s.shape)||"row-table",h=new p(null,{...e,shape:a}),c=new it({jsonpaths:n});for await(const t of o){const e=c.write(t),s=e.length>0&&c.getStreamingJsonPathAsString();if(e.length>0&&r){if(i){const t={shape:a,batchType:"partial-result",data:[],length:0,bytesUsed:0,container:c.getPartialResult(),jsonpath:s};yield t}r=!1}for(const t of e){h.addRow(t);const e=h.getFullBatch({jsonpath:s});e&&(yield e)}h.chunkComplete(t);const o=h.getFullBatch({jsonpath:s});o&&(yield o)}const l=c.getStreamingJsonPathAsString(),u=h.getFinalBatch({jsonpath:l});if(u&&(yield u),i){const t={shape:a,batchType:"final-result",container:c.getPartialResult(),jsonpath:c.getStreamingJsonPathAsString(),data:[],length:0};yield t}}const rt={json:{shape:"row-table",table:!1,jsonpaths:[]}},at={name:"JSON",id:"json",module:"json",version:"3.0.10",extensions:["json","geojson"],mimeTypes:["application/json"],category:"table",text:!0,parse:async function(t,e){return ht((new TextDecoder).decode(t),e)},parseTextSync:ht,parseInBatches:function(t,e){const s={...e,json:{...rt.json,...null==e?void 0:e.json}};return nt(t,s)},options:rt};function ht(t,e){return o(t,{...e,json:{...rt.json,...null==e?void 0:e.json}})}function ct(t,e={}){const s=lt(t);return ut(t,s,{coordLength:e.coordLength||s.coordLength,numericPropKeys:e.numericPropKeys||s.numericPropKeys,PositionDataType:e.PositionDataType||Float32Array})}function lt(t){let e=0,s=0,o=0,i=0,n=0,r=0,a=0,h=0,c=0;const l=new Set,u={};for(const d of t){const t=d.geometry;switch(t.type){case"Point":s++,e++,l.add(t.coordinates.length);break;case"MultiPoint":s++,e+=t.coordinates.length;for(const e of t.coordinates)l.add(e.length);break;case"LineString":n++,o+=t.coordinates.length,i++;for(const e of t.coordinates)l.add(e.length);break;case"MultiLineString":n++;for(const e of t.coordinates){o+=e.length,i++;for(const t of e)l.add(t.length)}break;case"Polygon":c++,a++,h+=t.coordinates.length,r+=jt(t.coordinates).length;for(const e of jt(t.coordinates))l.add(e.length);break;case"MultiPolygon":c++;for(const e of t.coordinates){a++,h+=e.length,r+=jt(e).length;for(const t of jt(e))l.add(t.length)}break;default:throw new Error("Unsupported geometry type: "+t.type)}if(d.properties)for(const t in d.properties){const e=d.properties[t];u[t]=u[t]||void 0===u[t]?(p=e,Number.isFinite(p)):u[t]}}var p;return{coordLength:l.size>0?Math.max(...l):2,pointPositionsCount:e,pointFeaturesCount:s,linePositionsCount:o,linePathsCount:i,lineFeaturesCount:n,polygonPositionsCount:r,polygonObjectsCount:a,polygonRingsCount:h,polygonFeaturesCount:c,numericPropKeys:Object.keys(u).filter(t=>u[t])}}function ut(t,e,s){const{pointPositionsCount:o,pointFeaturesCount:i,linePositionsCount:n,linePathsCount:r,lineFeaturesCount:a,polygonPositionsCount:h,polygonObjectsCount:c,polygonRingsCount:l,polygonFeaturesCount:u}=e,{coordLength:p,numericPropKeys:d,PositionDataType:f=Float32Array}=s,g=t.length>65535?Uint32Array:Uint16Array,y={positions:new f(o*p),globalFeatureIds:new g(o),featureIds:i>65535?new Uint32Array(o):new Uint16Array(o),numericProps:{},properties:Array(),fields:Array()},b={positions:new f(n*p),pathIndices:n>65535?new Uint32Array(r+1):new Uint16Array(r+1),globalFeatureIds:new g(n),featureIds:a>65535?new Uint32Array(n):new Uint16Array(n),numericProps:{},properties:Array(),fields:Array()},w={positions:new f(h*p),polygonIndices:h>65535?new Uint32Array(c+1):new Uint16Array(c+1),primitivePolygonIndices:h>65535?new Uint32Array(l+1):new Uint16Array(l+1),globalFeatureIds:new g(h),featureIds:u>65535?new Uint32Array(h):new Uint16Array(h),numericProps:{},properties:Array(),fields:Array()};for(const t of[y,b,w])for(const e of d||[])t.numericProps[e]=new Float32Array(t.positions.length/p);b.pathIndices[r]=n,w.polygonIndices[c]=h,w.primitivePolygonIndices[l]=h;const m={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0};for(const e of t){const t=e.geometry,s=e.properties||{};switch(t.type){case"Point":pt(t.coordinates,y,m,p,s),y.properties.push(mt(s,d)),m.pointFeature++;break;case"MultiPoint":dt(t.coordinates,y,m,p,s),y.properties.push(mt(s,d)),m.pointFeature++;break;case"LineString":ft(t.coordinates,b,m,p,s),b.properties.push(mt(s,d)),m.lineFeature++;break;case"MultiLineString":gt(t.coordinates,b,m,p,s),b.properties.push(mt(s,d)),m.lineFeature++;break;case"Polygon":yt(t.coordinates,w,m,p,s),w.properties.push(mt(s,d)),m.polygonFeature++;break;case"MultiPolygon":bt(t.coordinates,w,m,p,s),w.properties.push(mt(s,d)),m.polygonFeature++;break;default:throw new Error("Invalid geometry type")}m.feature++}return function(t,e,s,o){const i={points:{...t,positions:{value:t.positions,size:o},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1},type:"Point"},lines:{...e,pathIndices:{value:e.pathIndices,size:1},positions:{value:e.positions,size:o},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},type:"LineString"},polygons:{...s,polygonIndices:{value:s.polygonIndices,size:1},primitivePolygonIndices:{value:s.primitivePolygonIndices,size:1},positions:{value:s.positions,size:o},globalFeatureIds:{value:s.globalFeatureIds,size:1},featureIds:{value:s.featureIds,size:1},type:"Polygon"}};for(const t in i)for(const e in i[t].numericProps)i[t].numericProps[e]={value:i[t].numericProps[e],size:1};return i}(y,b,w,p)}function pt(t,e,s,o,i){e.positions.set(t,s.pointPosition*o),e.globalFeatureIds[s.pointPosition]=s.feature,e.featureIds[s.pointPosition]=s.pointFeature,wt(e,i,s.pointPosition,1),s.pointPosition++}function dt(t,e,s,o,i){for(const n of t)pt(n,e,s,o,i)}function ft(t,e,s,o,i){e.pathIndices[s.linePath]=s.linePosition,s.linePath++,At(e.positions,t,s.linePosition,o);const n=t.length;wt(e,i,s.linePosition,n),e.globalFeatureIds.set(new Uint32Array(n).fill(s.feature),s.linePosition),e.featureIds.set(new Uint32Array(n).fill(s.lineFeature),s.linePosition),s.linePosition+=n}function gt(t,e,s,o,i){for(const n of t)ft(n,e,s,o,i)}function yt(t,e,s,o,i){e.polygonIndices[s.polygonObject]=s.polygonPosition,s.polygonObject++;for(const n of t){e.primitivePolygonIndices[s.polygonRing]=s.polygonPosition,s.polygonRing++,At(e.positions,n,s.polygonPosition,o);const t=n.length;wt(e,i,s.polygonPosition,t),e.globalFeatureIds.set(new Uint32Array(t).fill(s.feature),s.polygonPosition),e.featureIds.set(new Uint32Array(t).fill(s.polygonFeature),s.polygonPosition),s.polygonPosition+=t}}function bt(t,e,s,o,i){for(const n of t)yt(n,e,s,o,i)}function wt(t,e,s,o){for(const i in t.numericProps)i in e&&t.numericProps[i].set(new Array(o).fill(e[i]),s)}function mt(t,e){const s={};for(const o in t)e.includes(o)||(s[o]=t[o]);return s}function At(t,e,s,o){let i=s*o;for(const s of e)t.set(s,i),i+=o}function jt(t){return[].concat(...t)}const Pt={geojson:{shape:"object-row-table"},json:{jsonpaths:["$","$.features"]},gis:{format:"geojson"}},vt={name:"GeoJSON",id:"geojson",module:"geojson",version:"3.0.10",worker:!0,extensions:["geojson"],mimeTypes:["application/geo+json"],category:"geometry",text:!0,options:Pt},Et={...vt,parse:async function(t,e){return St((new TextDecoder).decode(t),e)},parseTextSync:St,parseInBatches:function(t,e){(e={...Pt,...e}).json={...Pt.geojson,...e.geojson};const s=nt(t,e);switch(e.gis.format){case"binary":return async function*(t){for await(const e of t)e.data=ct(e.data),yield e}(s);default:return s}}};function St(t,e){(e={...Pt,...e}).json={...Pt.geojson,...e.geojson},e.gis=e.gis||{};const s=o(t,e);switch(e.gis.format){case"binary":return ct(s);default:return s}}}])}));
|
|
1
|
+
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var s=e();for(var o in s)("object"==typeof exports?exports:t)[o]=s[o]}}(window,(function(){return function(t){var e={};function s(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,s),i.l=!0,i.exports}return s.m=t,s.c=e,s.d=function(t,e,o){s.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.t=function(t,e){if(1&e&&(t=s(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(s.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)s.d(o,i,function(e){return t[e]}.bind(null,i));return o},s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="",s(s.s=0)}([function(t,e,s){(function(e){const o=s(2),i="undefined"==typeof window?e:window;i.loaders=i.loaders||{},t.exports=Object.assign(i.loaders,o)}).call(this,s(1))},function(t,e){var s;s=function(){return this}();try{s=s||new Function("return this")()}catch(t){"object"==typeof window&&(s=window)}t.exports=s},function(t,e,s){"use strict";function o(t,e){try{var s;const o=JSON.parse(t);return null!==(s=e.json)&&void 0!==s&&s.table&&function t(e){if(Array.isArray(e))return e;if(e&&"object"==typeof e)for(const s of Object.values(e)){const e=t(s);if(e)return e}return null}(o)||o}catch(t){throw new Error("JSONLoader: failed to parse JSON")}}function i(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}s.r(e),s.d(e,"JSONLoader",(function(){return at})),s.d(e,"_GeoJSONLoader",(function(){return Et})),s.d(e,"_GeoJSONWorkerLoader",(function(){return vt})),s.d(e,"_JSONPath",(function(){return et})),s.d(e,"_ClarinetParser",(function(){return q}));class n{constructor(t,e){if(i(this,"schema",void 0),i(this,"options",void 0),i(this,"length",0),i(this,"rows",null),i(this,"cursor",0),i(this,"_headers",[]),this.options=e,this.schema=t,!Array.isArray(t)){this._headers=[];for(const e in t)this._headers[t[e].index]=t[e].name}}rowCount(){return this.length}addArrayRow(t,e){Number.isFinite(e)&&(this.cursor=e),this.rows=this.rows||new Array(100),this.rows[this.length]=t,this.length++}addObjectRow(t,e){Number.isFinite(e)&&(this.cursor=e),this.rows=this.rows||new Array(100),this.rows[this.length]=t,this.length++}getBatch(){let t=this.rows;if(!t)return null;t=t.slice(0,this.length),this.rows=null;return{shape:this.options.shape,batchType:"data",data:t,length:this.length,schema:this.schema,cursor:this.cursor}}}function r(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}class a{constructor(t,e){if(r(this,"schema",void 0),r(this,"options",void 0),r(this,"length",0),r(this,"objectRows",null),r(this,"arrayRows",null),r(this,"cursor",0),r(this,"_headers",[]),this.options=e,this.schema=t,!Array.isArray(t)){this._headers=[];for(const e in t)this._headers[t[e].index]=t[e].name}}rowCount(){return this.length}addArrayRow(t,e){switch(Number.isFinite(e)&&(this.cursor=e),this.options.shape){case"object-row-table":const s=function(t,e){if(!t)throw new Error("null row");if(!e)throw new Error("no headers");const s={};for(let o=0;o<e.length;o++)s[e[o]]=t[o];return s}(t,this._headers);this.addObjectRow(s,e);break;case"array-row-table":this.arrayRows=this.arrayRows||new Array(100),this.arrayRows[this.length]=t,this.length++}}addObjectRow(t,e){switch(Number.isFinite(e)&&(this.cursor=e),this.options.shape){case"array-row-table":const s=function(t,e){if(!t)throw new Error("null row");if(!e)throw new Error("no headers");const s=new Array(e.length);for(let o=0;o<e.length;o++)s[o]=t[e[o]];return s}(t,this._headers);this.addArrayRow(s,e);break;case"object-row-table":this.objectRows=this.objectRows||new Array(100),this.objectRows[this.length]=t,this.length++}}getBatch(){let t=this.arrayRows||this.objectRows;return t?(t=t.slice(0,this.length),this.arrayRows=null,this.objectRows=null,{shape:this.options.shape,batchType:"data",data:t,length:this.length,schema:this.schema,cursor:this.cursor}):null}}function h(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}class c{constructor(t,e){h(this,"schema",void 0),h(this,"length",0),h(this,"allocated",0),h(this,"columns",{}),this.schema=t,this._reallocateColumns()}rowCount(){return this.length}addArrayRow(t){this._reallocateColumns();let e=0;for(const s in this.columns)this.columns[s][this.length]=t[e++];this.length++}addObjectRow(t){this._reallocateColumns();for(const e in t)this.columns[e][this.length]=t[e];this.length++}getBatch(){this._pruneColumns();const t=Array.isArray(this.schema)?this.columns:{};if(!Array.isArray(this.schema))for(const e in this.schema){const s=this.schema[e];t[s.name]=this.columns[s.index]}this.columns={};return{shape:"columnar-table",batchType:"data",data:t,schema:this.schema,length:this.length}}_reallocateColumns(){if(!(this.length<this.allocated)){this.allocated=this.allocated>0?this.allocated*=2:100,this.columns={};for(const t in this.schema){const e=this.schema[t],s=e.type||Float32Array,o=this.columns[e.index];if(o&&ArrayBuffer.isView(o)){const t=new s(this.allocated);t.set(o),this.columns[e.index]=t}else o?(o.length=this.allocated,this.columns[e.index]=o):this.columns[e.index]=new s(this.allocated)}}}_pruneColumns(){for(const[t,e]of Object.entries(this.columns))this.columns[t]=e.slice(0,this.length)}}function l(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}const u={shape:"array-row-table",batchSize:"auto",batchDebounceMs:0,limit:0,_limitMB:0};class p{constructor(t,e){l(this,"schema",void 0),l(this,"options",void 0),l(this,"aggregator",null),l(this,"batchCount",0),l(this,"bytesUsed",0),l(this,"isChunkComplete",!1),l(this,"lastBatchEmittedMs",Date.now()),l(this,"totalLength",0),l(this,"totalBytes",0),l(this,"rowBytes",0),this.schema=t,this.options={...u,...e}}limitReached(){var t,e;return!!(Boolean(null===(t=this.options)||void 0===t?void 0:t.limit)&&this.totalLength>=this.options.limit)||!!(Boolean(null===(e=this.options)||void 0===e?void 0:e._limitMB)&&this.totalBytes/1e6>=this.options._limitMB)}addRow(t){this.limitReached()||(this.totalLength++,this.rowBytes=this.rowBytes||this._estimateRowMB(t),this.totalBytes+=this.rowBytes,Array.isArray(t)?this.addArrayRow(t):this.addObjectRow(t))}addArrayRow(t){if(!this.aggregator){const t=this._getTableBatchType();this.aggregator=new t(this.schema,this.options)}this.aggregator.addArrayRow(t)}addObjectRow(t){if(!this.aggregator){const t=this._getTableBatchType();this.aggregator=new t(this.schema,this.options)}this.aggregator.addObjectRow(t)}chunkComplete(t){t instanceof ArrayBuffer&&(this.bytesUsed+=t.byteLength),"string"==typeof t&&(this.bytesUsed+=t.length),this.isChunkComplete=!0}getFullBatch(t){return this._isFull()?this._getBatch(t):null}getFinalBatch(t){return this._getBatch(t)}_estimateRowMB(t){return Array.isArray(t)?8*t.length:8*Object.keys(t).length}_isFull(){if(!this.aggregator||0===this.aggregator.rowCount())return!1;if("auto"===this.options.batchSize){if(!this.isChunkComplete)return!1}else if(this.options.batchSize>this.aggregator.rowCount())return!1;return!(this.options.batchDebounceMs>Date.now()-this.lastBatchEmittedMs)&&(this.isChunkComplete=!1,this.lastBatchEmittedMs=Date.now(),!0)}_getBatch(t){if(!this.aggregator)return null;null!=t&&t.bytesUsed&&(this.bytesUsed=t.bytesUsed);const e=this.aggregator.getBatch();return e.count=this.batchCount,e.bytesUsed=this.bytesUsed,Object.assign(e,t),this.batchCount++,this.aggregator=null,e}_getTableBatchType(){switch(this.options.shape){case"row-table":return n;case"array-row-table":case"object-row-table":return a;case"columnar-table":return c;case"arrow-table":if(!p.ArrowBatch)throw new Error("TableBatchBuilder");return p.ArrowBatch;default:throw new Error("TableBatchBuilder")}}}l(p,"ArrowBatch",void 0);const d=Number.MAX_SAFE_INTEGER,f="debug"==={}.CDEBUG,g={textNode:void 0,numberNode:""};let y=0;const b={BEGIN:y++,VALUE:y++,OPEN_OBJECT:y++,CLOSE_OBJECT:y++,OPEN_ARRAY:y++,CLOSE_ARRAY:y++,TEXT_ESCAPE:y++,STRING:y++,BACKSLASH:y++,END:y++,OPEN_KEY:y++,CLOSE_KEY:y++,TRUE:y++,TRUE2:y++,TRUE3:y++,FALSE:y++,FALSE2:y++,FALSE3:y++,FALSE4:y++,NULL:y++,NULL2:y++,NULL3:y++,NUMBER_DECIMAL_POINT:y++,NUMBER_DIGIT:y++};for(var w in b)b[b[w]]=w;y=b;const m=9,A=10,j=13,P=32,v=34,E=43,S=44,_=45,O=46,C=48,N=57,L=58,I=69,R=91,B=92,U=93,k=97,x=98,F=101,T=102,J=108,M=110,z=114,D=115,Y=116,G=117,V=123,K=125;var $=/[\\"\n]/g;class q{constructor(t={}){this._initialize(t)}_initialize(t){this._clearBuffers(this),this.bufferCheckPosition=d,this.q="",this.c="",this.p="",this.options=t||{},this.closed=!1,this.closedRoot=!1,this.sawRoot=!1,this.tag=null,this.error=null,this.state=y.BEGIN,this.stack=new Array,this.position=this.column=0,this.line=1,this.slashed=!1,this.unicodeI=0,this.unicodeS=null,this.depth=0,"onready"in t&&(this.onready=t.onready),"onopenobject"in t&&(this.onopenobject=t.onopenobject),"onkey"in t&&(this.onkey=t.onkey),"oncloseobject"in t&&(this.oncloseobject=t.oncloseobject),"onopenarray"in t&&(this.onopenarray=t.onopenarray),"onclosearray"in t&&(this.onclosearray=t.onclosearray),"onvalue"in t&&(this.onvalue=t.onvalue),"onerror"in t&&(this.onerror=t.onerror),"onend"in t&&(this.onend=t.onend),"onchunkparsed"in t&&(this.onchunkparsed=t.onchunkparsed),X(this,"onready")}_clearBuffers(){for(var t in g)this[t]=g[t]}end(){return this.state===y.VALUE&&0===this.depth||Z(this,"Unexpected end"),W(this),this.c="",this.closed=!0,X(this,"onend"),this._initialize(this.options),this}resume(){return this.error=null,this}close(){return this.write(null)}write(t){if(this.error)throw this.error;if(this.closed)return Z(this,"Cannot write after close. Assign an onready handler.");if(null===t)return this.end();var e=0,s=t.charCodeAt(0),o=this.p;for(f&&console.log("write -> ["+t+"]");s&&(o=s,this.c=s=t.charCodeAt(e++),o!==s?this.p=o:o=this.p,s);)switch(f&&console.log(e,s,b[this.state]),this.position++,s===A?(this.line++,this.column=0):this.column++,this.state){case y.BEGIN:s===V?this.state=y.OPEN_OBJECT:s===R?this.state=y.OPEN_ARRAY:tt(s)||Z(this,"Non-whitespace before {[.");continue;case y.OPEN_KEY:case y.OPEN_OBJECT:if(tt(s))continue;if(this.state===y.OPEN_KEY)this.stack.push(y.CLOSE_KEY);else{if(s===K){X(this,"onopenobject"),this.depth++,X(this,"oncloseobject"),this.depth--,this.state=this.stack.pop()||y.VALUE;continue}this.stack.push(y.CLOSE_OBJECT)}s===v?this.state=y.STRING:Z(this,'Malformed object key should start with "');continue;case y.CLOSE_KEY:case y.CLOSE_OBJECT:if(tt(s))continue;this.state,y.CLOSE_KEY;s===L?(this.state===y.CLOSE_OBJECT?(this.stack.push(y.CLOSE_OBJECT),W(this,"onopenobject"),this.depth++):W(this,"onkey"),this.state=y.VALUE):s===K?(H(this,"oncloseobject"),this.depth--,this.state=this.stack.pop()||y.VALUE):s===S?(this.state===y.CLOSE_OBJECT&&this.stack.push(y.CLOSE_OBJECT),W(this),this.state=y.OPEN_KEY):Z(this,"Bad object");continue;case y.OPEN_ARRAY:case y.VALUE:if(tt(s))continue;if(this.state===y.OPEN_ARRAY){if(X(this,"onopenarray"),this.depth++,this.state=y.VALUE,s===U){X(this,"onclosearray"),this.depth--,this.state=this.stack.pop()||y.VALUE;continue}this.stack.push(y.CLOSE_ARRAY)}s===v?this.state=y.STRING:s===V?this.state=y.OPEN_OBJECT:s===R?this.state=y.OPEN_ARRAY:s===Y?this.state=y.TRUE:s===T?this.state=y.FALSE:s===M?this.state=y.NULL:s===_?this.numberNode+="-":C<=s&&s<=N?(this.numberNode+=String.fromCharCode(s),this.state=y.NUMBER_DIGIT):Z(this,"Bad value");continue;case y.CLOSE_ARRAY:if(s===S)this.stack.push(y.CLOSE_ARRAY),W(this,"onvalue"),this.state=y.VALUE;else if(s===U)H(this,"onclosearray"),this.depth--,this.state=this.stack.pop()||y.VALUE;else{if(tt(s))continue;Z(this,"Bad array")}continue;case y.STRING:void 0===this.textNode&&(this.textNode="");var i=e-1,n=this.slashed,r=this.unicodeI;t:for(;;){for(f&&console.log(e,s,b[this.state],n);r>0;)if(this.unicodeS+=String.fromCharCode(s),s=t.charCodeAt(e++),this.position++,4===r?(this.textNode+=String.fromCharCode(parseInt(this.unicodeS,16)),r=0,i=e-1):r++,!s)break t;if(s===v&&!n){this.state=this.stack.pop()||y.VALUE,this.textNode+=t.substring(i,e-1),this.position+=e-1-i;break}if(s===B&&!n&&(n=!0,this.textNode+=t.substring(i,e-1),this.position+=e-1-i,s=t.charCodeAt(e++),this.position++,!s))break;if(n){if(n=!1,s===M?this.textNode+="\n":s===z?this.textNode+="\r":s===Y?this.textNode+="\t":s===T?this.textNode+="\f":s===x?this.textNode+="\b":s===G?(r=1,this.unicodeS=""):this.textNode+=String.fromCharCode(s),s=t.charCodeAt(e++),this.position++,i=e-1,s)continue;break}$.lastIndex=e;var a=$.exec(t);if(null===a){e=t.length+1,this.textNode+=t.substring(i,e-1),this.position+=e-1-i;break}if(e=a.index+1,!(s=t.charCodeAt(a.index))){this.textNode+=t.substring(i,e-1),this.position+=e-1-i;break}}this.slashed=n,this.unicodeI=r;continue;case y.TRUE:s===z?this.state=y.TRUE2:Z(this,"Invalid true started with t"+s);continue;case y.TRUE2:s===G?this.state=y.TRUE3:Z(this,"Invalid true started with tr"+s);continue;case y.TRUE3:s===F?(X(this,"onvalue",!0),this.state=this.stack.pop()||y.VALUE):Z(this,"Invalid true started with tru"+s);continue;case y.FALSE:s===k?this.state=y.FALSE2:Z(this,"Invalid false started with f"+s);continue;case y.FALSE2:s===J?this.state=y.FALSE3:Z(this,"Invalid false started with fa"+s);continue;case y.FALSE3:s===D?this.state=y.FALSE4:Z(this,"Invalid false started with fal"+s);continue;case y.FALSE4:s===F?(X(this,"onvalue",!1),this.state=this.stack.pop()||y.VALUE):Z(this,"Invalid false started with fals"+s);continue;case y.NULL:s===G?this.state=y.NULL2:Z(this,"Invalid null started with n"+s);continue;case y.NULL2:s===J?this.state=y.NULL3:Z(this,"Invalid null started with nu"+s);continue;case y.NULL3:s===J?(X(this,"onvalue",null),this.state=this.stack.pop()||y.VALUE):Z(this,"Invalid null started with nul"+s);continue;case y.NUMBER_DECIMAL_POINT:s===O?(this.numberNode+=".",this.state=y.NUMBER_DIGIT):Z(this,"Leading zero not followed by .");continue;case y.NUMBER_DIGIT:C<=s&&s<=N?this.numberNode+=String.fromCharCode(s):s===O?(-1!==this.numberNode.indexOf(".")&&Z(this,"Invalid number has two dots"),this.numberNode+="."):s===F||s===I?(-1===this.numberNode.indexOf("e")&&-1===this.numberNode.indexOf("E")||Z(this,"Invalid number has two exponential"),this.numberNode+="e"):s===E||s===_?(o!==F&&o!==I&&Z(this,"Invalid symbol in number"),this.numberNode+=String.fromCharCode(s)):(Q(this),e--,this.state=this.stack.pop()||y.VALUE);continue;default:Z(this,"Unknown state: "+this.state)}return this.position>=this.bufferCheckPosition&&function(t){const e=Math.max(d,10);let s=0;for(var o in g){var i=void 0===t[o]?0:t[o].length;if(i>e)switch(o){case"text":closeText(t);break;default:Z(t,"Max buffer length exceeded: "+o)}s=Math.max(s,i)}t.bufferCheckPosition=d-s+t.position}(this),X(this,"onchunkparsed"),this}}function X(t,e,s){f&&console.log("-- emit",e,s),t[e]&&t[e](s,t)}function H(t,e,s){W(t),X(t,e,s)}function W(t,e){t.textNode=function(t,e){if(void 0===e)return e;t.trim&&(e=e.trim());t.normalize&&(e=e.replace(/\s+/g," "));return e}(t.options,t.textNode),void 0!==t.textNode&&X(t,e||"onvalue",t.textNode),t.textNode=void 0}function Q(t){t.numberNode&&X(t,"onvalue",parseFloat(t.numberNode)),t.numberNode=""}function Z(t,e){return W(t),e+="\nLine: "+t.line+"\nColumn: "+t.column+"\nChar: "+t.c,e=new Error(e),t.error=e,X(t,"onerror",e),t}function tt(t){return t===j||t===A||t===P||t===m}class et{constructor(t=null){var e,s,o;if(o=void 0,(s="path")in(e=this)?Object.defineProperty(e,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[s]=o,this.path=["$"],t instanceof et)this.path=[...t.path];else if(Array.isArray(t))this.path.push(...t);else if("string"==typeof t&&(this.path=t.split("."),"$"!==this.path[0]))throw new Error("JSONPaths must start with $")}clone(){return new et(this)}toString(){return this.path.join(".")}push(t){this.path.push(t)}pop(){return this.path.pop()}set(t){this.path[this.path.length-1]=t}equals(t){if(!this||!t||this.path.length!==t.path.length)return!1;for(let e=0;e<this.path.length;++e)if(this.path[e]!==t.path[e])return!1;return!0}setFieldAtPath(t,e){const s=[...this.path];s.shift();const o=s.pop();for(const e of s)t=t[e];t[o]=e}getFieldAtPath(t){const e=[...this.path];e.shift();const s=e.pop();for(const s of e)t=t[s];return t[s]}}function st(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function ot(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}class it extends class{constructor(){st(this,"jsonpath",void 0),st(this,"_parser",void 0),this.reset(),this._initializeParser()}reset(){this.result=void 0,this.previousStates=[],this.currentState=Object.freeze({container:[],key:null}),this.jsonpath=new et}write(t){this.parser.write(t)}close(){this.parser.close()}_pushOrSet(t){const{container:e,key:s}=this.currentState;null!==s?(e[s]=t,this.currentState.key=null):e.push(t)}_openArray(t=[]){this.jsonpath.push(null),this._pushOrSet(t),this.previousStates.push(this.currentState),this.currentState={container:t,isArray:!0,key:null}}_closeArray(){this.jsonpath.pop(),this.currentState=this.previousStates.pop()}_openObject(t={}){this.jsonpath.push(null),this._pushOrSet(t),this.previousStates.push(this.currentState),this.currentState={container:t,isArray:!1,key:null}}_closeObject(){this.jsonpath.pop(),this.currentState=this.previousStates.pop()}_initializeParser(){this._parser=new q({onready:()=>{this.jsonpath=new et,this.previousStates.length=0,this.currentState.container.length=0},onopenobject:t=>{this._openObject({}),void 0!==t&&this.parser.onkey(t)},onkey:t=>{this.jsonpath.set(t),this.currentState.key=t},oncloseobject:()=>{this._closeObject()},onopenarray:()=>{this._openArray()},onclosearray:()=>{this._closeArray()},onvalue:t=>{this._pushOrSet(t)},onerror:t=>{throw t},onend:()=>{this.result=this.currentState.container.pop()}})}get parser(){return this._parser}}{constructor(t={}){super(),ot(this,"jsonPaths",void 0),ot(this,"streamingJsonPath",null),ot(this,"streamingArray",null),ot(this,"topLevelObject",null);const e=t.jsonpaths||[];this.jsonPaths=e.map(t=>new et(t)),this._extendParser()}write(t){super.write(t);let e=[];return this.streamingArray&&(e=[...this.streamingArray],this.streamingArray.length=0),e}getPartialResult(){return this.topLevelObject}getStreamingJsonPath(){return this.streamingJsonPath}getStreamingJsonPathAsString(){return this.streamingJsonPath&&this.streamingJsonPath.toString()}getJsonPath(){return this.jsonpath}_matchJSONPath(){const t=this.getJsonPath();if(0===this.jsonPaths.length)return!0;for(const e of this.jsonPaths)if(e.equals(t))return!0;return!1}_extendParser(){this.parser.onopenarray=()=>{if(!this.streamingArray&&this._matchJSONPath())return this.streamingJsonPath=this.getJsonPath().clone(),this.streamingArray=[],void this._openArray(this.streamingArray);this._openArray()},this.parser.onopenobject=t=>{this.topLevelObject?this._openObject({}):(this.topLevelObject={},this._openObject(this.topLevelObject)),void 0!==t&&this.parser.onkey(t)}}}async function*nt(t,e){var s;const o=async function*(t,e={}){const s=new TextDecoder(void 0,e);for await(const e of t)yield"string"==typeof e?e:s.decode(e,{stream:!0})}(t),{metadata:i}=e,{jsonpaths:n}=e.json||{};let r=!0;const a=(null==e||null===(s=e.json)||void 0===s?void 0:s.shape)||"row-table",h=new p(null,{...e,shape:a}),c=new it({jsonpaths:n});for await(const t of o){const e=c.write(t),s=e.length>0&&c.getStreamingJsonPathAsString();if(e.length>0&&r){if(i){const t={shape:a,batchType:"partial-result",data:[],length:0,bytesUsed:0,container:c.getPartialResult(),jsonpath:s};yield t}r=!1}for(const t of e){h.addRow(t);const e=h.getFullBatch({jsonpath:s});e&&(yield e)}h.chunkComplete(t);const o=h.getFullBatch({jsonpath:s});o&&(yield o)}const l=c.getStreamingJsonPathAsString(),u=h.getFinalBatch({jsonpath:l});if(u&&(yield u),i){const t={shape:a,batchType:"final-result",container:c.getPartialResult(),jsonpath:c.getStreamingJsonPathAsString(),data:[],length:0};yield t}}const rt={json:{shape:"row-table",table:!1,jsonpaths:[]}},at={name:"JSON",id:"json",module:"json",version:"3.0.14",extensions:["json","geojson"],mimeTypes:["application/json"],category:"table",text:!0,parse:async function(t,e){return ht((new TextDecoder).decode(t),e)},parseTextSync:ht,parseInBatches:function(t,e){const s={...e,json:{...rt.json,...null==e?void 0:e.json}};return nt(t,s)},options:rt};function ht(t,e){return o(t,{...e,json:{...rt.json,...null==e?void 0:e.json}})}function ct(t,e={}){const s=lt(t);return ut(t,s,{coordLength:e.coordLength||s.coordLength,numericPropKeys:e.numericPropKeys||s.numericPropKeys,PositionDataType:e.PositionDataType||Float32Array})}function lt(t){let e=0,s=0,o=0,i=0,n=0,r=0,a=0,h=0,c=0;const l=new Set,u={};for(const d of t){const t=d.geometry;switch(t.type){case"Point":s++,e++,l.add(t.coordinates.length);break;case"MultiPoint":s++,e+=t.coordinates.length;for(const e of t.coordinates)l.add(e.length);break;case"LineString":n++,o+=t.coordinates.length,i++;for(const e of t.coordinates)l.add(e.length);break;case"MultiLineString":n++;for(const e of t.coordinates){o+=e.length,i++;for(const t of e)l.add(t.length)}break;case"Polygon":c++,a++,h+=t.coordinates.length,r+=jt(t.coordinates).length;for(const e of jt(t.coordinates))l.add(e.length);break;case"MultiPolygon":c++;for(const e of t.coordinates){a++,h+=e.length,r+=jt(e).length;for(const t of jt(e))l.add(t.length)}break;default:throw new Error("Unsupported geometry type: "+t.type)}if(d.properties)for(const t in d.properties){const e=d.properties[t];u[t]=u[t]||void 0===u[t]?(p=e,Number.isFinite(p)):u[t]}}var p;return{coordLength:l.size>0?Math.max(...l):2,pointPositionsCount:e,pointFeaturesCount:s,linePositionsCount:o,linePathsCount:i,lineFeaturesCount:n,polygonPositionsCount:r,polygonObjectsCount:a,polygonRingsCount:h,polygonFeaturesCount:c,numericPropKeys:Object.keys(u).filter(t=>u[t])}}function ut(t,e,s){const{pointPositionsCount:o,pointFeaturesCount:i,linePositionsCount:n,linePathsCount:r,lineFeaturesCount:a,polygonPositionsCount:h,polygonObjectsCount:c,polygonRingsCount:l,polygonFeaturesCount:u}=e,{coordLength:p,numericPropKeys:d,PositionDataType:f=Float32Array}=s,g=t.length>65535?Uint32Array:Uint16Array,y={positions:new f(o*p),globalFeatureIds:new g(o),featureIds:i>65535?new Uint32Array(o):new Uint16Array(o),numericProps:{},properties:Array(),fields:Array()},b={positions:new f(n*p),pathIndices:n>65535?new Uint32Array(r+1):new Uint16Array(r+1),globalFeatureIds:new g(n),featureIds:a>65535?new Uint32Array(n):new Uint16Array(n),numericProps:{},properties:Array(),fields:Array()},w={positions:new f(h*p),polygonIndices:h>65535?new Uint32Array(c+1):new Uint16Array(c+1),primitivePolygonIndices:h>65535?new Uint32Array(l+1):new Uint16Array(l+1),globalFeatureIds:new g(h),featureIds:u>65535?new Uint32Array(h):new Uint16Array(h),numericProps:{},properties:Array(),fields:Array()};for(const t of[y,b,w])for(const e of d||[])t.numericProps[e]=new Float32Array(t.positions.length/p);b.pathIndices[r]=n,w.polygonIndices[c]=h,w.primitivePolygonIndices[l]=h;const m={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0};for(const e of t){const t=e.geometry,s=e.properties||{};switch(t.type){case"Point":pt(t.coordinates,y,m,p,s),y.properties.push(mt(s,d)),m.pointFeature++;break;case"MultiPoint":dt(t.coordinates,y,m,p,s),y.properties.push(mt(s,d)),m.pointFeature++;break;case"LineString":ft(t.coordinates,b,m,p,s),b.properties.push(mt(s,d)),m.lineFeature++;break;case"MultiLineString":gt(t.coordinates,b,m,p,s),b.properties.push(mt(s,d)),m.lineFeature++;break;case"Polygon":yt(t.coordinates,w,m,p,s),w.properties.push(mt(s,d)),m.polygonFeature++;break;case"MultiPolygon":bt(t.coordinates,w,m,p,s),w.properties.push(mt(s,d)),m.polygonFeature++;break;default:throw new Error("Invalid geometry type")}m.feature++}return function(t,e,s,o){const i={points:{...t,positions:{value:t.positions,size:o},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1},type:"Point"},lines:{...e,pathIndices:{value:e.pathIndices,size:1},positions:{value:e.positions,size:o},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},type:"LineString"},polygons:{...s,polygonIndices:{value:s.polygonIndices,size:1},primitivePolygonIndices:{value:s.primitivePolygonIndices,size:1},positions:{value:s.positions,size:o},globalFeatureIds:{value:s.globalFeatureIds,size:1},featureIds:{value:s.featureIds,size:1},type:"Polygon"}};for(const t in i)for(const e in i[t].numericProps)i[t].numericProps[e]={value:i[t].numericProps[e],size:1};return i}(y,b,w,p)}function pt(t,e,s,o,i){e.positions.set(t,s.pointPosition*o),e.globalFeatureIds[s.pointPosition]=s.feature,e.featureIds[s.pointPosition]=s.pointFeature,wt(e,i,s.pointPosition,1),s.pointPosition++}function dt(t,e,s,o,i){for(const n of t)pt(n,e,s,o,i)}function ft(t,e,s,o,i){e.pathIndices[s.linePath]=s.linePosition,s.linePath++,At(e.positions,t,s.linePosition,o);const n=t.length;wt(e,i,s.linePosition,n),e.globalFeatureIds.set(new Uint32Array(n).fill(s.feature),s.linePosition),e.featureIds.set(new Uint32Array(n).fill(s.lineFeature),s.linePosition),s.linePosition+=n}function gt(t,e,s,o,i){for(const n of t)ft(n,e,s,o,i)}function yt(t,e,s,o,i){e.polygonIndices[s.polygonObject]=s.polygonPosition,s.polygonObject++;for(const n of t){e.primitivePolygonIndices[s.polygonRing]=s.polygonPosition,s.polygonRing++,At(e.positions,n,s.polygonPosition,o);const t=n.length;wt(e,i,s.polygonPosition,t),e.globalFeatureIds.set(new Uint32Array(t).fill(s.feature),s.polygonPosition),e.featureIds.set(new Uint32Array(t).fill(s.polygonFeature),s.polygonPosition),s.polygonPosition+=t}}function bt(t,e,s,o,i){for(const n of t)yt(n,e,s,o,i)}function wt(t,e,s,o){for(const i in t.numericProps)i in e&&t.numericProps[i].set(new Array(o).fill(e[i]),s)}function mt(t,e){const s={};for(const o in t)e.includes(o)||(s[o]=t[o]);return s}function At(t,e,s,o){let i=s*o;for(const s of e)t.set(s,i),i+=o}function jt(t){return[].concat(...t)}const Pt={geojson:{shape:"object-row-table"},json:{jsonpaths:["$","$.features"]},gis:{format:"geojson"}},vt={name:"GeoJSON",id:"geojson",module:"geojson",version:"3.0.14",worker:!0,extensions:["geojson"],mimeTypes:["application/geo+json"],category:"geometry",text:!0,options:Pt},Et={...vt,parse:async function(t,e){return St((new TextDecoder).decode(t),e)},parseTextSync:St,parseInBatches:function(t,e){(e={...Pt,...e}).json={...Pt.geojson,...e.geojson};const s=nt(t,e);switch(e.gis.format){case"binary":return async function*(t){for await(const e of t)e.data=ct(e.data),yield e}(s);default:return s}}};function St(t,e){(e={...Pt,...e}).json={...Pt.geojson,...e.geojson},e.gis=e.gis||{};const s=o(t,e);switch(e.gis.format){case"binary":return ct(s);default:return s}}}])}));
|
|
2
2
|
//# sourceMappingURL=dist.min.js.map
|
|
@@ -29,7 +29,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
29
29
|
|
|
30
30
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
31
31
|
|
|
32
|
-
var VERSION = typeof "3.0.
|
|
32
|
+
var VERSION = typeof "3.0.14" !== 'undefined' ? "3.0.14" : 'latest';
|
|
33
33
|
var DEFAULT_GEOJSON_LOADER_OPTIONS = {
|
|
34
34
|
geojson: {
|
|
35
35
|
shape: 'object-row-table'
|
package/dist/es5/json-loader.js
CHANGED
|
@@ -21,7 +21,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
21
21
|
|
|
22
22
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
23
23
|
|
|
24
|
-
var VERSION = typeof "3.0.
|
|
24
|
+
var VERSION = typeof "3.0.14" !== 'undefined' ? "3.0.14" : 'latest';
|
|
25
25
|
var DEFAULT_JSON_LOADER_OPTIONS = {
|
|
26
26
|
json: {
|
|
27
27
|
shape: 'row-table',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { geojsonToBinary } from '@loaders.gl/gis';
|
|
2
2
|
import parseJSONSync from './lib/parse-json';
|
|
3
3
|
import parseJSONInBatches from './lib/parse-json-in-batches';
|
|
4
|
-
const VERSION = typeof "3.0.
|
|
4
|
+
const VERSION = typeof "3.0.14" !== 'undefined' ? "3.0.14" : 'latest';
|
|
5
5
|
const DEFAULT_GEOJSON_LOADER_OPTIONS = {
|
|
6
6
|
geojson: {
|
|
7
7
|
shape: 'object-row-table'
|
package/dist/esm/json-loader.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import parseJSONSync from './lib/parse-json';
|
|
2
2
|
import parseJSONInBatches from './lib/parse-json-in-batches';
|
|
3
|
-
const VERSION = typeof "3.0.
|
|
3
|
+
const VERSION = typeof "3.0.14" !== 'undefined' ? "3.0.14" : 'latest';
|
|
4
4
|
const DEFAULT_JSON_LOADER_OPTIONS = {
|
|
5
5
|
json: {
|
|
6
6
|
shape: 'row-table',
|
package/dist/geojson-worker.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=30)}([function(t,e){t.exports=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){t.exports=r(20)},function(t,e,r){var n=r(12);t.exports=function(t){return new n(t)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(22),o=r(23),i=r(14),s=r(24);t.exports=function(t){return n(t)||o(t)||i(t)||s()},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(21);t.exports=function(t){return function(){return new n(t.apply(this,arguments))}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){var e;if("undefined"!=typeof Symbol&&(Symbol.asyncIterator&&(e=t[Symbol.asyncIterator]),null==e&&Symbol.iterator&&(e=t[Symbol.iterator])),null==e&&(e=t["@@asyncIterator"]),null==e&&(e=t["@@iterator"]),null==e)throw new TypeError("Object is not async iterable");return e.call(t)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(t.exports=r=function(t){return typeof t},t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.default=t.exports,t.exports.__esModule=!0),r(e)}t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function r(t,e,r,n,o,i,s){try{var a=t[i](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,o)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(o,i){var s=t.apply(e,n);function a(t){r(s,o,i,a,u,"next",t)}function u(t){r(s,o,i,a,u,"throw",t)}a(void 0)}))}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function r(e){return t.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports.default=t.exports,t.exports.__esModule=!0,r(e)}t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){this.wrapped=t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(13);t.exports=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(25),o=r(26),i=r(14),s=r(27);t.exports=function(t,e){return n(t)||o(t,e)||i(t,e)||s()},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(28);function o(e,r,i){return"undefined"!=typeof Reflect&&Reflect.get?(t.exports=o=Reflect.get,t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=o=function(t,e,r){var o=n(t,e);if(o){var i=Object.getOwnPropertyDescriptor(o,e);return i.get?i.get.call(r):i.value}},t.exports.default=t.exports,t.exports.__esModule=!0),o(e,r,i||e)}t.exports=o,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(29);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&n(t,e)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(9).default,o=r(8);t.exports=function(t,e){return!e||"object"!==n(e)&&"function"!=typeof e?o(t):e},t.exports.default=t.exports,t.exports.__esModule=!0},,function(t,e,r){var n=function(t){"use strict";var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",s=n.toStringTag||"@@toStringTag";function a(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{a({},"")}catch(t){a=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=e&&e.prototype instanceof h?e:h,i=Object.create(o.prototype),s=new j(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var s=r.delegate;if(s){var a=w(s,r);if(a){if(a===l)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=c(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,s),i}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function f(){}function p(){}var d={};d[o]=function(){return this};var y=Object.getPrototypeOf,v=y&&y(y(_([])));v&&v!==e&&r.call(v,o)&&(d=v);var g=p.prototype=h.prototype=Object.create(d);function b(t){["next","throw","return"].forEach((function(e){a(t,e,(function(t){return this._invoke(e,t)}))}))}function m(t,e){var n;this._invoke=function(o,i){function s(){return new e((function(n,s){!function n(o,i,s,a){var u=c(t[o],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,s,a)}),(function(t){n("throw",t,s,a)})):e.resolve(h).then((function(t){l.value=t,s(l)}),(function(t){return n("throw",t,s,a)}))}a(u.arg)}(o,i,n,s)}))}return n=n?n.then(s,s):s()}}function w(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=c(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function _(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=g.constructor=p,p.constructor=f,f.displayName=a(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,a(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(m.prototype),m.prototype[i]=function(){return this},t.AsyncIterator=m,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var s=new m(u(e,r,n,o),i);return t.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},b(g),a(g,s,"Generator"),g[o]=function(){return this},g.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=_,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return s.type="throw",s.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var a=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(a&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:_(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e,r){var n=r(12);function o(t){var e,r;function o(e,r){try{var s=t[e](r),a=s.value,u=a instanceof n;Promise.resolve(u?a.wrapped:a).then((function(t){u?o("return"===e?"return":"next",t):i(s.done?"return":"normal",t)}),(function(t){o("throw",t)}))}catch(t){i("throw",t)}}function i(t,n){switch(t){case"return":e.resolve({value:n,done:!0});break;case"throw":e.reject(n);break;default:e.resolve({value:n,done:!1})}(e=e.next)?o(e.key,e.arg):r=null}this._invoke=function(t,n){return new Promise((function(i,s){var a={key:t,arg:n,resolve:i,reject:s,next:null};r?r=r.next=a:(e=r=a,o(t,n))}))},"function"!=typeof t.return&&(this.return=void 0)}o.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},o.prototype.next=function(t){return this._invoke("next",t)},o.prototype.throw=function(t){return this._invoke("throw",t)},o.prototype.return=function(t){return this._invoke("return",t)},t.exports=o,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(13);t.exports=function(t){if(Array.isArray(t))return n(t)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){if(Array.isArray(t))return t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e){var r=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null!=r){var n,o,i=[],s=!0,a=!1;try{for(r=r.call(t);!(s=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);s=!0);}catch(t){a=!0,o=t}finally{try{s||null==r.return||r.return()}finally{if(a)throw o}}return i}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(11);t.exports=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=n(t)););return t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function r(e,n){return t.exports=r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},t.exports.default=t.exports,t.exports.__esModule=!0,r(e,n)}t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){"use strict";r.r(e);var n=r(0),o=r.n(n),i=r(10),s=r.n(i),a=r(1),u=r.n(a),c=r(3),l=r.n(c),h=r(4),f=r.n(h),p=r(9),d=r.n(p);function y(t){return!!t&&(t instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&t instanceof MessagePort||("undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas)))}var v=new Map,g=function(){function t(){l()(this,t)}return f()(t,null,[{key:"onmessage",set:function(t){self.onmessage=function(e){if(b(e)){var r=e.data,n=r.type,o=r.payload;t(n,o)}}}},{key:"addEventListener",value:function(t){var e=v.get(t);e||(e=function(e){if(b(e)){var r=e.data,n=r.type,o=r.payload;t(n,o)}}),self.addEventListener("message",e)}},{key:"removeEventListener",value:function(t){var e=v.get(t);v.delete(t),self.removeEventListener("message",e)}},{key:"postMessage",value:function(t,e){if(self){var r={source:"loaders.gl",type:t,payload:e},n=function t(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,o=n||new Set;if(e){if(y(e))o.add(e);else if(y(e.buffer))o.add(e.buffer);else if(ArrayBuffer.isView(e));else if(r&&"object"===d()(e))for(var i in e)t(e[i],r,o)}else;return void 0===n?Array.from(o):[]}(e);self.postMessage(r,n)}}}]),t}();function b(t){var e=t.type,r=t.data;return"message"===e&&r&&"string"==typeof r.source&&r.source.startsWith("loaders.gl")}function m(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function w(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?m(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var x=0;function O(t,e){return new Promise((function(r,n){var o=x++;g.addEventListener((function t(e,i){if(i.id===o)switch(e){case"done":g.removeEventListener(t),r(i.result);break;case"error":g.removeEventListener(t),n(i.error)}}));var i={id:o,input:t,options:e};g.postMessage("process",i)}))}function j(t){return _.apply(this,arguments)}function _(){return(_=s()(u.a.mark((function t(e){var r,n,o,i,s,a,c;return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.loader,n=e.arrayBuffer,o=e.options,i=e.context,!r.parseSync&&!r.parse){t.next=6;break}s=n,a=r.parseSync||r.parse,t.next=13;break;case 6:if(!r.parseTextSync){t.next=12;break}c=new TextDecoder,s=c.decode(n),a=r.parseTextSync,t.next=13;break;case 12:throw new Error("Could not load data with ".concat(r.name," loader"));case 13:return o=w(w({},o),{},{modules:r&&r.options&&r.options.modules||{},worker:!1}),t.next=16,a(s,w({},o),i,r);case 16:return t.abrupt("return",t.sent);case 17:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var k=r(2),A=r.n(k),P=r(6),E=r.n(P),S=r(7),L=r.n(S),C=r(5),I=r.n(C);function N(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function R(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?N(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):N(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function M(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return B(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return B(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw i}}}}function B(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function U(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=T(t);return F(t,r,{coordLength:e.coordLength||r.coordLength,numericPropKeys:e.numericPropKeys||r.numericPropKeys,PositionDataType:e.PositionDataType||Float32Array})}function T(t){var e,r,n=0,o=0,i=0,s=0,a=0,u=0,c=0,l=0,h=0,f=new Set,p={},d=M(t);try{for(d.s();!(e=d.n()).done;){var y=e.value,v=y.geometry;switch(v.type){case"Point":o++,n++,f.add(v.coordinates.length);break;case"MultiPoint":o++,n+=v.coordinates.length;var g,b=M(v.coordinates);try{for(b.s();!(g=b.n()).done;){var m=g.value;f.add(m.length)}}catch(t){b.e(t)}finally{b.f()}break;case"LineString":a++,i+=v.coordinates.length,s++;var w,x=M(v.coordinates);try{for(x.s();!(w=x.n()).done;){var O=w.value;f.add(O.length)}}catch(t){x.e(t)}finally{x.f()}break;case"MultiLineString":a++;var j,_=M(v.coordinates);try{for(_.s();!(j=_.n()).done;){var k=j.value;i+=k.length,s++;var A,P=M(k);try{for(P.s();!(A=P.n()).done;){var E=A.value;f.add(E.length)}}catch(t){P.e(t)}finally{P.f()}}}catch(t){_.e(t)}finally{_.f()}break;case"Polygon":h++,c++,l+=v.coordinates.length,u+=X(v.coordinates).length;var S,L=M(X(v.coordinates));try{for(L.s();!(S=L.n()).done;){var C=S.value;f.add(C.length)}}catch(t){L.e(t)}finally{L.f()}break;case"MultiPolygon":h++;var N,R=M(v.coordinates);try{for(R.s();!(N=R.n()).done;){var B=N.value;c++,l+=B.length,u+=X(B).length;var U,T=M(X(B));try{for(T.s();!(U=T.n()).done;){var F=U.value;f.add(F.length)}}catch(t){T.e(t)}finally{T.f()}}}catch(t){R.e(t)}finally{R.f()}break;default:throw new Error("Unsupported geometry type: ".concat(v.type))}if(y.properties)for(var D in y.properties){var J=y.properties[D];p[D]=p[D]||void 0===p[D]?(r=J,Number.isFinite(r)):p[D]}}}catch(t){d.e(t)}finally{d.f()}return{coordLength:f.size>0?Math.max.apply(Math,I()(f)):2,pointPositionsCount:n,pointFeaturesCount:o,linePositionsCount:i,linePathsCount:s,lineFeaturesCount:a,polygonPositionsCount:u,polygonObjectsCount:c,polygonRingsCount:l,polygonFeaturesCount:h,numericPropKeys:Object.keys(p).filter((function(t){return p[t]}))}}function F(t,e,r){for(var n=e.pointPositionsCount,o=e.pointFeaturesCount,i=e.linePositionsCount,s=e.linePathsCount,a=e.lineFeaturesCount,u=e.polygonPositionsCount,c=e.polygonObjectsCount,l=e.polygonRingsCount,h=e.polygonFeaturesCount,f=r.coordLength,p=r.numericPropKeys,d=r.PositionDataType,y=void 0===d?Float32Array:d,v=t.length>65535?Uint32Array:Uint16Array,g={positions:new y(n*f),globalFeatureIds:new v(n),featureIds:o>65535?new Uint32Array(n):new Uint16Array(n),numericProps:{},properties:Array(),fields:Array()},b={positions:new y(i*f),pathIndices:i>65535?new Uint32Array(s+1):new Uint16Array(s+1),globalFeatureIds:new v(i),featureIds:a>65535?new Uint32Array(i):new Uint16Array(i),numericProps:{},properties:Array(),fields:Array()},m={positions:new y(u*f),polygonIndices:u>65535?new Uint32Array(c+1):new Uint16Array(c+1),primitivePolygonIndices:u>65535?new Uint32Array(l+1):new Uint16Array(l+1),globalFeatureIds:new v(u),featureIds:h>65535?new Uint32Array(u):new Uint16Array(u),numericProps:{},properties:Array(),fields:Array()},w=0,x=[g,b,m];w<x.length;w++){var O,j=x[w],_=M(p||[]);try{for(_.s();!(O=_.n()).done;){var k=O.value;j.numericProps[k]=new Float32Array(j.positions.length/f)}}catch(t){_.e(t)}finally{_.f()}}b.pathIndices[s]=i,m.polygonIndices[c]=u,m.primitivePolygonIndices[l]=u;var A,P={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0},E=M(t);try{for(E.s();!(A=E.n()).done;){var S=A.value,L=S.geometry,C=S.properties||{};switch(L.type){case"Point":D(L.coordinates,g,P,f,C),g.properties.push($(C,p)),P.pointFeature++;break;case"MultiPoint":J(L.coordinates,g,P,f,C),g.properties.push($(C,p)),P.pointFeature++;break;case"LineString":z(L.coordinates,b,P,f,C),b.properties.push($(C,p)),P.lineFeature++;break;case"MultiLineString":G(L.coordinates,b,P,f,C),b.properties.push($(C,p)),P.lineFeature++;break;case"Polygon":Y(L.coordinates,m,P,f,C),m.properties.push($(C,p)),P.polygonFeature++;break;case"MultiPolygon":V(L.coordinates,m,P,f,C),m.properties.push($(C,p)),P.polygonFeature++;break;default:throw new Error("Invalid geometry type")}P.feature++}}catch(t){E.e(t)}finally{E.f()}return function(t,e,r,n){var o={points:R(R({},t),{},{positions:{value:t.positions,size:n},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1},type:"Point"}),lines:R(R({},e),{},{pathIndices:{value:e.pathIndices,size:1},positions:{value:e.positions,size:n},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},type:"LineString"}),polygons:R(R({},r),{},{polygonIndices:{value:r.polygonIndices,size:1},primitivePolygonIndices:{value:r.primitivePolygonIndices,size:1},positions:{value:r.positions,size:n},globalFeatureIds:{value:r.globalFeatureIds,size:1},featureIds:{value:r.featureIds,size:1},type:"Polygon"})};for(var i in o)for(var s in o[i].numericProps)o[i].numericProps[s]={value:o[i].numericProps[s],size:1};return o}(g,b,m,f)}function D(t,e,r,n,o){e.positions.set(t,r.pointPosition*n),e.globalFeatureIds[r.pointPosition]=r.feature,e.featureIds[r.pointPosition]=r.pointFeature,K(e,o,r.pointPosition,1),r.pointPosition++}function J(t,e,r,n,o){var i,s=M(t);try{for(s.s();!(i=s.n()).done;){D(i.value,e,r,n,o)}}catch(t){s.e(t)}finally{s.f()}}function z(t,e,r,n,o){e.pathIndices[r.linePath]=r.linePosition,r.linePath++,q(e.positions,t,r.linePosition,n);var i=t.length;K(e,o,r.linePosition,i),e.globalFeatureIds.set(new Uint32Array(i).fill(r.feature),r.linePosition),e.featureIds.set(new Uint32Array(i).fill(r.lineFeature),r.linePosition),r.linePosition+=i}function G(t,e,r,n,o){var i,s=M(t);try{for(s.s();!(i=s.n()).done;){z(i.value,e,r,n,o)}}catch(t){s.e(t)}finally{s.f()}}function Y(t,e,r,n,o){e.polygonIndices[r.polygonObject]=r.polygonPosition,r.polygonObject++;var i,s=M(t);try{for(s.s();!(i=s.n()).done;){var a=i.value;e.primitivePolygonIndices[r.polygonRing]=r.polygonPosition,r.polygonRing++,q(e.positions,a,r.polygonPosition,n);var u=a.length;K(e,o,r.polygonPosition,u),e.globalFeatureIds.set(new Uint32Array(u).fill(r.feature),r.polygonPosition),e.featureIds.set(new Uint32Array(u).fill(r.polygonFeature),r.polygonPosition),r.polygonPosition+=u}}catch(t){s.e(t)}finally{s.f()}}function V(t,e,r,n,o){var i,s=M(t);try{for(s.s();!(i=s.n()).done;){Y(i.value,e,r,n,o)}}catch(t){s.e(t)}finally{s.f()}}function K(t,e,r,n){for(var o in t.numericProps)o in e&&t.numericProps[o].set(new Array(n).fill(e[o]),r)}function $(t,e){var r={};for(var n in t)e.includes(n)||(r[n]=t[n]);return r}function q(t,e,r,n){var o,i=r*n,s=M(e);try{for(s.s();!(o=s.n()).done;){var a=o.value;t.set(a,i),i+=n}}catch(t){s.e(t)}finally{s.f()}}function X(t){var e;return(e=[]).concat.apply(e,I()(t))}function H(t,e){try{var r,n=JSON.parse(t);return null!==(r=e.json)&&void 0!==r&&r.table&&function t(e){if(Array.isArray(e))return e;if(e&&"object"===d()(e))for(var r=0,n=Object.values(e);r<n.length;r++){var o=n[r],i=t(o);if(i)return i}return null}(n)||n}catch(t){throw new Error("JSONLoader: failed to parse JSON")}}var W=function(){function t(e,r){if(l()(this,t),o()(this,"schema",void 0),o()(this,"options",void 0),o()(this,"length",0),o()(this,"rows",null),o()(this,"cursor",0),o()(this,"_headers",[]),this.options=r,this.schema=e,!Array.isArray(e))for(var n in this._headers=[],e)this._headers[e[n].index]=e[n].name}return f()(t,[{key:"rowCount",value:function(){return this.length}},{key:"addArrayRow",value:function(t,e){Number.isFinite(e)&&(this.cursor=e),this.rows=this.rows||new Array(100),this.rows[this.length]=t,this.length++}},{key:"addObjectRow",value:function(t,e){Number.isFinite(e)&&(this.cursor=e),this.rows=this.rows||new Array(100),this.rows[this.length]=t,this.length++}},{key:"getBatch",value:function(){var t=this.rows;return t?(t=t.slice(0,this.length),this.rows=null,{shape:this.options.shape,batchType:"data",data:t,length:this.length,schema:this.schema,cursor:this.cursor}):null}}]),t}();var Q=function(){function t(e,r){if(l()(this,t),o()(this,"schema",void 0),o()(this,"options",void 0),o()(this,"length",0),o()(this,"objectRows",null),o()(this,"arrayRows",null),o()(this,"cursor",0),o()(this,"_headers",[]),this.options=r,this.schema=e,!Array.isArray(e))for(var n in this._headers=[],e)this._headers[e[n].index]=e[n].name}return f()(t,[{key:"rowCount",value:function(){return this.length}},{key:"addArrayRow",value:function(t,e){switch(Number.isFinite(e)&&(this.cursor=e),this.options.shape){case"object-row-table":var r=function(t,e){if(!t)throw new Error("null row");if(!e)throw new Error("no headers");for(var r={},n=0;n<e.length;n++)r[e[n]]=t[n];return r}(t,this._headers);this.addObjectRow(r,e);break;case"array-row-table":this.arrayRows=this.arrayRows||new Array(100),this.arrayRows[this.length]=t,this.length++}}},{key:"addObjectRow",value:function(t,e){switch(Number.isFinite(e)&&(this.cursor=e),this.options.shape){case"array-row-table":var r=function(t,e){if(!t)throw new Error("null row");if(!e)throw new Error("no headers");for(var r=new Array(e.length),n=0;n<e.length;n++)r[n]=t[e[n]];return r}(t,this._headers);this.addArrayRow(r,e);break;case"object-row-table":this.objectRows=this.objectRows||new Array(100),this.objectRows[this.length]=t,this.length++}}},{key:"getBatch",value:function(){var t=this.arrayRows||this.objectRows;return t?(t=t.slice(0,this.length),this.arrayRows=null,this.objectRows=null,{shape:this.options.shape,batchType:"data",data:t,length:this.length,schema:this.schema,cursor:this.cursor}):null}}]),t}(),Z=r(15),tt=r.n(Z),et=function(){function t(e,r){l()(this,t),o()(this,"schema",void 0),o()(this,"length",0),o()(this,"allocated",0),o()(this,"columns",{}),this.schema=e,this._reallocateColumns()}return f()(t,[{key:"rowCount",value:function(){return this.length}},{key:"addArrayRow",value:function(t){this._reallocateColumns();var e=0;for(var r in this.columns)this.columns[r][this.length]=t[e++];this.length++}},{key:"addObjectRow",value:function(t){for(var e in this._reallocateColumns(),t)this.columns[e][this.length]=t[e];this.length++}},{key:"getBatch",value:function(){this._pruneColumns();var t=Array.isArray(this.schema)?this.columns:{};if(!Array.isArray(this.schema))for(var e in this.schema){var r=this.schema[e];t[r.name]=this.columns[r.index]}return this.columns={},{shape:"columnar-table",batchType:"data",data:t,schema:this.schema,length:this.length}}},{key:"_reallocateColumns",value:function(){if(!(this.length<this.allocated))for(var t in this.allocated=this.allocated>0?this.allocated*=2:100,this.columns={},this.schema){var e=this.schema[t],r=e.type||Float32Array,n=this.columns[e.index];if(n&&ArrayBuffer.isView(n)){var o=new r(this.allocated);o.set(n),this.columns[e.index]=o}else n?(n.length=this.allocated,this.columns[e.index]=n):this.columns[e.index]=new r(this.allocated)}}},{key:"_pruneColumns",value:function(){for(var t=0,e=Object.entries(this.columns);t<e.length;t++){var r=tt()(e[t],2),n=r[0],o=r[1];this.columns[n]=o.slice(0,this.length)}}}]),t}();function rt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function nt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?rt(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):rt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var ot={shape:"array-row-table",batchSize:"auto",batchDebounceMs:0,limit:0,_limitMB:0},it=function(){function t(e,r){l()(this,t),o()(this,"schema",void 0),o()(this,"options",void 0),o()(this,"aggregator",null),o()(this,"batchCount",0),o()(this,"bytesUsed",0),o()(this,"isChunkComplete",!1),o()(this,"lastBatchEmittedMs",Date.now()),o()(this,"totalLength",0),o()(this,"totalBytes",0),o()(this,"rowBytes",0),this.schema=e,this.options=nt(nt({},ot),r)}return f()(t,[{key:"limitReached",value:function(){var t,e;return!!(Boolean(null===(t=this.options)||void 0===t?void 0:t.limit)&&this.totalLength>=this.options.limit)||!!(Boolean(null===(e=this.options)||void 0===e?void 0:e._limitMB)&&this.totalBytes/1e6>=this.options._limitMB)}},{key:"addRow",value:function(t){this.limitReached()||(this.totalLength++,this.rowBytes=this.rowBytes||this._estimateRowMB(t),this.totalBytes+=this.rowBytes,Array.isArray(t)?this.addArrayRow(t):this.addObjectRow(t))}},{key:"addArrayRow",value:function(t){if(!this.aggregator){var e=this._getTableBatchType();this.aggregator=new e(this.schema,this.options)}this.aggregator.addArrayRow(t)}},{key:"addObjectRow",value:function(t){if(!this.aggregator){var e=this._getTableBatchType();this.aggregator=new e(this.schema,this.options)}this.aggregator.addObjectRow(t)}},{key:"chunkComplete",value:function(t){t instanceof ArrayBuffer&&(this.bytesUsed+=t.byteLength),"string"==typeof t&&(this.bytesUsed+=t.length),this.isChunkComplete=!0}},{key:"getFullBatch",value:function(t){return this._isFull()?this._getBatch(t):null}},{key:"getFinalBatch",value:function(t){return this._getBatch(t)}},{key:"_estimateRowMB",value:function(t){return Array.isArray(t)?8*t.length:8*Object.keys(t).length}},{key:"_isFull",value:function(){if(!this.aggregator||0===this.aggregator.rowCount())return!1;if("auto"===this.options.batchSize){if(!this.isChunkComplete)return!1}else if(this.options.batchSize>this.aggregator.rowCount())return!1;return!(this.options.batchDebounceMs>Date.now()-this.lastBatchEmittedMs)&&(this.isChunkComplete=!1,this.lastBatchEmittedMs=Date.now(),!0)}},{key:"_getBatch",value:function(t){if(!this.aggregator)return null;null!=t&&t.bytesUsed&&(this.bytesUsed=t.bytesUsed);var e=this.aggregator.getBatch();return e.count=this.batchCount,e.bytesUsed=this.bytesUsed,Object.assign(e,t),this.batchCount++,this.aggregator=null,e}},{key:"_getTableBatchType",value:function(){switch(this.options.shape){case"row-table":return W;case"array-row-table":case"object-row-table":return Q;case"columnar-table":return et;case"arrow-table":if(!t.ArrowBatch)throw new Error("TableBatchBuilder");return t.ArrowBatch;default:throw new Error("TableBatchBuilder")}}}]),t}();function st(t){return at.apply(this,arguments)}function at(){return(at=E()(u.a.mark((function t(e){var r,n,o,i,s,a,c,l,h,f=arguments;return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=f.length>1&&void 0!==f[1]?f[1]:{},n=new TextDecoder(void 0,r),o=!0,i=!1,t.prev=4,a=L()(e);case 6:return t.next=8,A()(a.next());case 8:return c=t.sent,o=c.done,t.next=12,A()(c.value);case 12:if(l=t.sent,o){t.next=20;break}return h=l,t.next=17,"string"==typeof h?h:n.decode(h,{stream:!0});case 17:o=!0,t.next=6;break;case 20:t.next=26;break;case 22:t.prev=22,t.t0=t.catch(4),i=!0,s=t.t0;case 26:if(t.prev=26,t.prev=27,o||null==a.return){t.next=31;break}return t.next=31,A()(a.return());case 31:if(t.prev=31,!i){t.next=34;break}throw s;case 34:return t.finish(31);case 35:return t.finish(26);case 36:case"end":return t.stop()}}),t,null,[[4,22,26,36],[27,,31,35]])})))).apply(this,arguments)}o()(it,"ArrowBatch",void 0);var ut=r(8),ct=r.n(ut),lt=r(16),ht=r.n(lt),ft=r(17),pt=r.n(ft),dt=r(18),yt=r.n(dt),vt=r(11),gt=r.n(vt),bt=Number.MAX_SAFE_INTEGER,mt="debug"==={}.CDEBUG,wt={textNode:void 0,numberNode:""},xt=0,Ot={BEGIN:xt++,VALUE:xt++,OPEN_OBJECT:xt++,CLOSE_OBJECT:xt++,OPEN_ARRAY:xt++,CLOSE_ARRAY:xt++,TEXT_ESCAPE:xt++,STRING:xt++,BACKSLASH:xt++,END:xt++,OPEN_KEY:xt++,CLOSE_KEY:xt++,TRUE:xt++,TRUE2:xt++,TRUE3:xt++,FALSE:xt++,FALSE2:xt++,FALSE3:xt++,FALSE4:xt++,NULL:xt++,NULL2:xt++,NULL3:xt++,NUMBER_DECIMAL_POINT:xt++,NUMBER_DIGIT:xt++};for(var jt in Ot)Ot[Ot[jt]]=jt;xt=Ot;var _t=9,kt=10,At=13,Pt=32,Et=34,St=43,Lt=44,Ct=45,It=46,Nt=48,Rt=57,Mt=58,Bt=69,Ut=91,Tt=92,Ft=93,Dt=97,Jt=98,zt=101,Gt=102,Yt=108,Vt=110,Kt=114,$t=115,qt=116,Xt=117,Ht=123,Wt=125;var Qt=/[\\"\n]/g,Zt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};l()(this,t),this._initialize(e)}return f()(t,[{key:"_initialize",value:function(t){this._clearBuffers(this),this.bufferCheckPosition=bt,this.q="",this.c="",this.p="",this.options=t||{},this.closed=!1,this.closedRoot=!1,this.sawRoot=!1,this.tag=null,this.error=null,this.state=xt.BEGIN,this.stack=new Array,this.position=this.column=0,this.line=1,this.slashed=!1,this.unicodeI=0,this.unicodeS=null,this.depth=0,"onready"in t&&(this.onready=t.onready),"onopenobject"in t&&(this.onopenobject=t.onopenobject),"onkey"in t&&(this.onkey=t.onkey),"oncloseobject"in t&&(this.oncloseobject=t.oncloseobject),"onopenarray"in t&&(this.onopenarray=t.onopenarray),"onclosearray"in t&&(this.onclosearray=t.onclosearray),"onvalue"in t&&(this.onvalue=t.onvalue),"onerror"in t&&(this.onerror=t.onerror),"onend"in t&&(this.onend=t.onend),"onchunkparsed"in t&&(this.onchunkparsed=t.onchunkparsed),te(this,"onready")}},{key:"_clearBuffers",value:function(){for(var t in wt)this[t]=wt[t]}},{key:"end",value:function(){return this.state===xt.VALUE&&0===this.depth||oe(this,"Unexpected end"),re(this),this.c="",this.closed=!0,te(this,"onend"),this._initialize(this.options),this}},{key:"resume",value:function(){return this.error=null,this}},{key:"close",value:function(){return this.write(null)}},{key:"write",value:function(t){if(this.error)throw this.error;if(this.closed)return oe(this,"Cannot write after close. Assign an onready handler.");if(null===t)return this.end();var e=0,r=t.charCodeAt(0),n=this.p;for(mt&&console.log("write -> ["+t+"]");r&&(n=r,this.c=r=t.charCodeAt(e++),n!==r?this.p=n:n=this.p,r);)switch(mt&&console.log(e,r,Ot[this.state]),this.position++,r===kt?(this.line++,this.column=0):this.column++,this.state){case xt.BEGIN:r===Ht?this.state=xt.OPEN_OBJECT:r===Ut?this.state=xt.OPEN_ARRAY:ie(r)||oe(this,"Non-whitespace before {[.");continue;case xt.OPEN_KEY:case xt.OPEN_OBJECT:if(ie(r))continue;if(this.state===xt.OPEN_KEY)this.stack.push(xt.CLOSE_KEY);else{if(r===Wt){te(this,"onopenobject"),this.depth++,te(this,"oncloseobject"),this.depth--,this.state=this.stack.pop()||xt.VALUE;continue}this.stack.push(xt.CLOSE_OBJECT)}r===Et?this.state=xt.STRING:oe(this,'Malformed object key should start with "');continue;case xt.CLOSE_KEY:case xt.CLOSE_OBJECT:if(ie(r))continue;this.state,xt.CLOSE_KEY;r===Mt?(this.state===xt.CLOSE_OBJECT?(this.stack.push(xt.CLOSE_OBJECT),re(this,"onopenobject"),this.depth++):re(this,"onkey"),this.state=xt.VALUE):r===Wt?(ee(this,"oncloseobject"),this.depth--,this.state=this.stack.pop()||xt.VALUE):r===Lt?(this.state===xt.CLOSE_OBJECT&&this.stack.push(xt.CLOSE_OBJECT),re(this),this.state=xt.OPEN_KEY):oe(this,"Bad object");continue;case xt.OPEN_ARRAY:case xt.VALUE:if(ie(r))continue;if(this.state===xt.OPEN_ARRAY){if(te(this,"onopenarray"),this.depth++,this.state=xt.VALUE,r===Ft){te(this,"onclosearray"),this.depth--,this.state=this.stack.pop()||xt.VALUE;continue}this.stack.push(xt.CLOSE_ARRAY)}r===Et?this.state=xt.STRING:r===Ht?this.state=xt.OPEN_OBJECT:r===Ut?this.state=xt.OPEN_ARRAY:r===qt?this.state=xt.TRUE:r===Gt?this.state=xt.FALSE:r===Vt?this.state=xt.NULL:r===Ct?this.numberNode+="-":Nt<=r&&r<=Rt?(this.numberNode+=String.fromCharCode(r),this.state=xt.NUMBER_DIGIT):oe(this,"Bad value");continue;case xt.CLOSE_ARRAY:if(r===Lt)this.stack.push(xt.CLOSE_ARRAY),re(this,"onvalue"),this.state=xt.VALUE;else if(r===Ft)ee(this,"onclosearray"),this.depth--,this.state=this.stack.pop()||xt.VALUE;else{if(ie(r))continue;oe(this,"Bad array")}continue;case xt.STRING:void 0===this.textNode&&(this.textNode="");var o=e-1,i=this.slashed,s=this.unicodeI;t:for(;;){for(mt&&console.log(e,r,Ot[this.state],i);s>0;)if(this.unicodeS+=String.fromCharCode(r),r=t.charCodeAt(e++),this.position++,4===s?(this.textNode+=String.fromCharCode(parseInt(this.unicodeS,16)),s=0,o=e-1):s++,!r)break t;if(r===Et&&!i){this.state=this.stack.pop()||xt.VALUE,this.textNode+=t.substring(o,e-1),this.position+=e-1-o;break}if(r===Tt&&!i&&(i=!0,this.textNode+=t.substring(o,e-1),this.position+=e-1-o,r=t.charCodeAt(e++),this.position++,!r))break;if(i){if(i=!1,r===Vt?this.textNode+="\n":r===Kt?this.textNode+="\r":r===qt?this.textNode+="\t":r===Gt?this.textNode+="\f":r===Jt?this.textNode+="\b":r===Xt?(s=1,this.unicodeS=""):this.textNode+=String.fromCharCode(r),r=t.charCodeAt(e++),this.position++,o=e-1,r)continue;break}Qt.lastIndex=e;var a=Qt.exec(t);if(null===a){e=t.length+1,this.textNode+=t.substring(o,e-1),this.position+=e-1-o;break}if(e=a.index+1,!(r=t.charCodeAt(a.index))){this.textNode+=t.substring(o,e-1),this.position+=e-1-o;break}}this.slashed=i,this.unicodeI=s;continue;case xt.TRUE:r===Kt?this.state=xt.TRUE2:oe(this,"Invalid true started with t"+r);continue;case xt.TRUE2:r===Xt?this.state=xt.TRUE3:oe(this,"Invalid true started with tr"+r);continue;case xt.TRUE3:r===zt?(te(this,"onvalue",!0),this.state=this.stack.pop()||xt.VALUE):oe(this,"Invalid true started with tru"+r);continue;case xt.FALSE:r===Dt?this.state=xt.FALSE2:oe(this,"Invalid false started with f"+r);continue;case xt.FALSE2:r===Yt?this.state=xt.FALSE3:oe(this,"Invalid false started with fa"+r);continue;case xt.FALSE3:r===$t?this.state=xt.FALSE4:oe(this,"Invalid false started with fal"+r);continue;case xt.FALSE4:r===zt?(te(this,"onvalue",!1),this.state=this.stack.pop()||xt.VALUE):oe(this,"Invalid false started with fals"+r);continue;case xt.NULL:r===Xt?this.state=xt.NULL2:oe(this,"Invalid null started with n"+r);continue;case xt.NULL2:r===Yt?this.state=xt.NULL3:oe(this,"Invalid null started with nu"+r);continue;case xt.NULL3:r===Yt?(te(this,"onvalue",null),this.state=this.stack.pop()||xt.VALUE):oe(this,"Invalid null started with nul"+r);continue;case xt.NUMBER_DECIMAL_POINT:r===It?(this.numberNode+=".",this.state=xt.NUMBER_DIGIT):oe(this,"Leading zero not followed by .");continue;case xt.NUMBER_DIGIT:Nt<=r&&r<=Rt?this.numberNode+=String.fromCharCode(r):r===It?(-1!==this.numberNode.indexOf(".")&&oe(this,"Invalid number has two dots"),this.numberNode+="."):r===zt||r===Bt?(-1===this.numberNode.indexOf("e")&&-1===this.numberNode.indexOf("E")||oe(this,"Invalid number has two exponential"),this.numberNode+="e"):r===St||r===Ct?(n!==zt&&n!==Bt&&oe(this,"Invalid symbol in number"),this.numberNode+=String.fromCharCode(r)):(ne(this),e--,this.state=this.stack.pop()||xt.VALUE);continue;default:oe(this,"Unknown state: "+this.state)}return this.position>=this.bufferCheckPosition&&function(t){var e=Math.max(bt,10),r=0;for(var n in wt){var o=void 0===t[n]?0:t[n].length;if(o>e)switch(n){case"text":closeText(t);break;default:oe(t,"Max buffer length exceeded: "+n)}r=Math.max(r,o)}t.bufferCheckPosition=bt-r+t.position}(this),te(this,"onchunkparsed"),this}}]),t}();function te(t,e,r){mt&&console.log("-- emit",e,r),t[e]&&t[e](r,t)}function ee(t,e,r){re(t),te(t,e,r)}function re(t,e){t.textNode=function(t,e){if(void 0===e)return e;t.trim&&(e=e.trim());t.normalize&&(e=e.replace(/\s+/g," "));return e}(t.options,t.textNode),void 0!==t.textNode&&te(t,e||"onvalue",t.textNode),t.textNode=void 0}function ne(t){t.numberNode&&te(t,"onvalue",parseFloat(t.numberNode)),t.numberNode=""}function oe(t,e){return re(t),e+="\nLine: "+t.line+"\nColumn: "+t.column+"\nChar: "+t.c,e=new Error(e),t.error=e,te(t,"onerror",e),t}function ie(t){return t===At||t===kt||t===Pt||t===_t}function se(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return ae(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ae(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw i}}}}function ae(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var ue=function(){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(l()(this,t),o()(this,"path",void 0),this.path=["$"],r instanceof t)this.path=I()(r.path);else if(Array.isArray(r))(e=this.path).push.apply(e,I()(r));else if("string"==typeof r&&(this.path=r.split("."),"$"!==this.path[0]))throw new Error("JSONPaths must start with $")}return f()(t,[{key:"clone",value:function(){return new t(this)}},{key:"toString",value:function(){return this.path.join(".")}},{key:"push",value:function(t){this.path.push(t)}},{key:"pop",value:function(){return this.path.pop()}},{key:"set",value:function(t){this.path[this.path.length-1]=t}},{key:"equals",value:function(t){if(!this||!t||this.path.length!==t.path.length)return!1;for(var e=0;e<this.path.length;++e)if(this.path[e]!==t.path[e])return!1;return!0}},{key:"setFieldAtPath",value:function(t,e){var r=I()(this.path);r.shift();var n,o=r.pop(),i=se(r);try{for(i.s();!(n=i.n()).done;){t=t[n.value]}}catch(t){i.e(t)}finally{i.f()}t[o]=e}},{key:"getFieldAtPath",value:function(t){var e=I()(this.path);e.shift();var r,n=e.pop(),o=se(e);try{for(o.s();!(r=o.n()).done;){t=t[r.value]}}catch(t){o.e(t)}finally{o.f()}return t[n]}}]),t}();function ce(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return le(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return le(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw i}}}}function le(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function he(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=gt()(t);if(e){var o=gt()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return yt()(this,r)}}var fe=function(t){pt()(r,t);var e=he(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};l()(this,r),t=e.call(this),o()(ct()(t),"jsonPaths",void 0),o()(ct()(t),"streamingJsonPath",null),o()(ct()(t),"streamingArray",null),o()(ct()(t),"topLevelObject",null);var i=n.jsonpaths||[];return t.jsonPaths=i.map((function(t){return new ue(t)})),t._extendParser(),t}return f()(r,[{key:"write",value:function(t){ht()(gt()(r.prototype),"write",this).call(this,t);var e=[];return this.streamingArray&&(e=I()(this.streamingArray),this.streamingArray.length=0),e}},{key:"getPartialResult",value:function(){return this.topLevelObject}},{key:"getStreamingJsonPath",value:function(){return this.streamingJsonPath}},{key:"getStreamingJsonPathAsString",value:function(){return this.streamingJsonPath&&this.streamingJsonPath.toString()}},{key:"getJsonPath",value:function(){return this.jsonpath}},{key:"_matchJSONPath",value:function(){var t=this.getJsonPath();if(0===this.jsonPaths.length)return!0;var e,r=ce(this.jsonPaths);try{for(r.s();!(e=r.n()).done;){if(e.value.equals(t))return!0}}catch(t){r.e(t)}finally{r.f()}return!1}},{key:"_extendParser",value:function(){var t=this;this.parser.onopenarray=function(){if(!t.streamingArray&&t._matchJSONPath())return t.streamingJsonPath=t.getJsonPath().clone(),t.streamingArray=[],void t._openArray(t.streamingArray);t._openArray()},this.parser.onopenobject=function(e){t.topLevelObject?t._openObject({}):(t.topLevelObject={},t._openObject(t.topLevelObject)),void 0!==e&&t.parser.onkey(e)}}}]),r}(function(){function t(){l()(this,t),o()(this,"jsonpath",void 0),o()(this,"_parser",void 0),this.reset(),this._initializeParser()}return f()(t,[{key:"reset",value:function(){this.result=void 0,this.previousStates=[],this.currentState=Object.freeze({container:[],key:null}),this.jsonpath=new ue}},{key:"write",value:function(t){this.parser.write(t)}},{key:"close",value:function(){this.parser.close()}},{key:"_pushOrSet",value:function(t){var e=this.currentState,r=e.container,n=e.key;null!==n?(r[n]=t,this.currentState.key=null):r.push(t)}},{key:"_openArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.jsonpath.push(null),this._pushOrSet(t),this.previousStates.push(this.currentState),this.currentState={container:t,isArray:!0,key:null}}},{key:"_closeArray",value:function(){this.jsonpath.pop(),this.currentState=this.previousStates.pop()}},{key:"_openObject",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.jsonpath.push(null),this._pushOrSet(t),this.previousStates.push(this.currentState),this.currentState={container:t,isArray:!1,key:null}}},{key:"_closeObject",value:function(){this.jsonpath.pop(),this.currentState=this.previousStates.pop()}},{key:"_initializeParser",value:function(){var t=this;this._parser=new Zt({onready:function(){t.jsonpath=new ue,t.previousStates.length=0,t.currentState.container.length=0},onopenobject:function(e){t._openObject({}),void 0!==e&&t.parser.onkey(e)},onkey:function(e){t.jsonpath.set(e),t.currentState.key=e},oncloseobject:function(){t._closeObject()},onopenarray:function(){t._openArray()},onclosearray:function(){t._closeArray()},onvalue:function(e){t._pushOrSet(e)},onerror:function(t){throw t},onend:function(){t.result=t.currentState.container.pop()}})}},{key:"parser",get:function(){return this._parser}}]),t}());function pe(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return de(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return de(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw i}}}}function de(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ye(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ve(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ye(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ye(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ge(){return(ge=E()(u.a.mark((function t(e,r){var n,o,i,s,a,c,l,h,f,p,d,y,v,g,b,m,w,x,O,j,_,k,P,E,S,C,I;return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=st(e),i=r.metadata,s=r.json||{},a=s.jsonpaths,c=!0,null,l=(null==r||null===(n=r.json)||void 0===n?void 0:n.shape)||"row-table",h=new it(null,ve(ve({},r),{},{shape:l})),f=new fe({jsonpaths:a}),p=!0,d=!1,t.prev=10,v=L()(o);case 12:return t.next=14,A()(v.next());case 14:return g=t.sent,p=g.done,t.next=18,A()(g.value);case 18:if(b=t.sent,p){t.next=57;break}if(m=b,w=f.write(m),x=w.length>0&&f.getStreamingJsonPathAsString(),!(w.length>0&&c)){t.next=29;break}if(!i){t.next=28;break}return O={shape:l,batchType:"partial-result",data:[],length:0,bytesUsed:0,container:f.getPartialResult(),jsonpath:x},t.next=28,O;case 28:c=!1;case 29:j=pe(w),t.prev=30,j.s();case 32:if((_=j.n()).done){t.next=41;break}if(k=_.value,h.addRow(k),!(P=h.getFullBatch({jsonpath:x}))){t.next=39;break}return t.next=39,P;case 39:t.next=32;break;case 41:t.next=46;break;case 43:t.prev=43,t.t0=t.catch(30),j.e(t.t0);case 46:return t.prev=46,j.f(),t.finish(46);case 49:if(h.chunkComplete(m),!(E=h.getFullBatch({jsonpath:x}))){t.next=54;break}return t.next=54,E;case 54:p=!0,t.next=12;break;case 57:t.next=63;break;case 59:t.prev=59,t.t1=t.catch(10),d=!0,y=t.t1;case 63:if(t.prev=63,t.prev=64,p||null==v.return){t.next=68;break}return t.next=68,A()(v.return());case 68:if(t.prev=68,!d){t.next=71;break}throw y;case 71:return t.finish(68);case 72:return t.finish(63);case 73:if(S=f.getStreamingJsonPathAsString(),!(C=h.getFinalBatch({jsonpath:S}))){t.next=78;break}return t.next=78,C;case 78:if(!i){t.next=82;break}return I={shape:l,batchType:"final-result",container:f.getPartialResult(),jsonpath:f.getStreamingJsonPathAsString(),data:[],length:0},t.next=82,I;case 82:case"end":return t.stop()}}),t,null,[[10,59,63,73],[30,43,46,49],[64,,68,72]])})))).apply(this,arguments)}function be(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function me(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?be(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):be(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var we,xe={geojson:{shape:"object-row-table"},json:{jsonpaths:["$","$.features"]},gis:{format:"geojson"}},Oe=me(me({},{name:"GeoJSON",id:"geojson",module:"geojson",version:"3.0.10",worker:!0,extensions:["geojson"],mimeTypes:["application/geo+json"],category:"geometry",text:!0,options:xe}),{},{parse:function(t,e){return je.apply(this,arguments)},parseTextSync:_e,parseInBatches:function(t,e){(e=me(me({},xe),e)).json=me(me({},xe.geojson),e.geojson);var r=function(t,e){return ge.apply(this,arguments)}(t,e);switch(e.gis.format){case"binary":return function(t){return ke.apply(this,arguments)}(r);default:return r}}});function je(){return(je=s()(u.a.mark((function t(e,r){return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",_e((new TextDecoder).decode(e),r));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function _e(t,e){(e=me(me({},xe),e)).json=me(me({},xe.geojson),e.geojson),e.gis=e.gis||{};var r=H(t,e);switch(e.gis.format){case"binary":return U(r);default:return r}}function ke(){return(ke=E()(u.a.mark((function t(e){var r,n,o,i,s,a,c;return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=!0,n=!1,t.prev=2,i=L()(e);case 4:return t.next=6,A()(i.next());case 6:return s=t.sent,r=s.done,t.next=10,A()(s.value);case 10:if(a=t.sent,r){t.next=19;break}return(c=a).data=U(c.data),t.next=16,c;case 16:r=!0,t.next=4;break;case 19:t.next=25;break;case 21:t.prev=21,t.t0=t.catch(2),n=!0,o=t.t0;case 25:if(t.prev=25,t.prev=26,r||null==i.return){t.next=30;break}return t.next=30,A()(i.return());case 30:if(t.prev=30,!n){t.next=33;break}throw o;case 33:return t.finish(30);case 34:return t.finish(25);case 35:case"end":return t.stop()}}),t,null,[[2,21,25,35],[26,,30,34]])})))).apply(this,arguments)}we=Oe,"undefined"!=typeof self&&(g.onmessage=function(){var t=s()(u.a.mark((function t(e,r){var n,o,i,s,a;return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=e,t.next="process"===t.t0?3:16;break;case 3:return t.prev=3,n=r.input,o=r.options,i=void 0===o?{}:o,t.next=7,j({loader:we,arrayBuffer:n,options:i,context:{parse:O}});case 7:s=t.sent,g.postMessage("done",{result:s}),t.next=15;break;case 11:t.prev=11,t.t1=t.catch(3),a=t.t1 instanceof Error?t.t1.message:"",g.postMessage("error",{error:a});case 15:return t.abrupt("break",16);case 16:case"end":return t.stop()}}),t,null,[[3,11]])})));return function(e,r){return t.apply(this,arguments)}}())}]);
|
|
1
|
+
!function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=30)}([function(t,e){t.exports=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){t.exports=r(20)},function(t,e,r){var n=r(12);t.exports=function(t){return new n(t)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(22),o=r(23),i=r(14),s=r(24);t.exports=function(t){return n(t)||o(t)||i(t)||s()},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(21);t.exports=function(t){return function(){return new n(t.apply(this,arguments))}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){var e;if("undefined"!=typeof Symbol&&(Symbol.asyncIterator&&(e=t[Symbol.asyncIterator]),null==e&&Symbol.iterator&&(e=t[Symbol.iterator])),null==e&&(e=t["@@asyncIterator"]),null==e&&(e=t["@@iterator"]),null==e)throw new TypeError("Object is not async iterable");return e.call(t)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(t.exports=r=function(t){return typeof t},t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.default=t.exports,t.exports.__esModule=!0),r(e)}t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function r(t,e,r,n,o,i,s){try{var a=t[i](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,o)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(o,i){var s=t.apply(e,n);function a(t){r(s,o,i,a,u,"next",t)}function u(t){r(s,o,i,a,u,"throw",t)}a(void 0)}))}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function r(e){return t.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports.default=t.exports,t.exports.__esModule=!0,r(e)}t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){this.wrapped=t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(13);t.exports=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(25),o=r(26),i=r(14),s=r(27);t.exports=function(t,e){return n(t)||o(t,e)||i(t,e)||s()},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(28);function o(e,r,i){return"undefined"!=typeof Reflect&&Reflect.get?(t.exports=o=Reflect.get,t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=o=function(t,e,r){var o=n(t,e);if(o){var i=Object.getOwnPropertyDescriptor(o,e);return i.get?i.get.call(r):i.value}},t.exports.default=t.exports,t.exports.__esModule=!0),o(e,r,i||e)}t.exports=o,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(29);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&n(t,e)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(9).default,o=r(8);t.exports=function(t,e){return!e||"object"!==n(e)&&"function"!=typeof e?o(t):e},t.exports.default=t.exports,t.exports.__esModule=!0},,function(t,e,r){var n=function(t){"use strict";var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",s=n.toStringTag||"@@toStringTag";function a(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{a({},"")}catch(t){a=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=e&&e.prototype instanceof h?e:h,i=Object.create(o.prototype),s=new j(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var s=r.delegate;if(s){var a=w(s,r);if(a){if(a===l)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=c(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,s),i}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function f(){}function p(){}var d={};d[o]=function(){return this};var y=Object.getPrototypeOf,v=y&&y(y(_([])));v&&v!==e&&r.call(v,o)&&(d=v);var g=p.prototype=h.prototype=Object.create(d);function b(t){["next","throw","return"].forEach((function(e){a(t,e,(function(t){return this._invoke(e,t)}))}))}function m(t,e){var n;this._invoke=function(o,i){function s(){return new e((function(n,s){!function n(o,i,s,a){var u=c(t[o],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,s,a)}),(function(t){n("throw",t,s,a)})):e.resolve(h).then((function(t){l.value=t,s(l)}),(function(t){return n("throw",t,s,a)}))}a(u.arg)}(o,i,n,s)}))}return n=n?n.then(s,s):s()}}function w(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=c(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function _(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=g.constructor=p,p.constructor=f,f.displayName=a(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,a(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(m.prototype),m.prototype[i]=function(){return this},t.AsyncIterator=m,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var s=new m(u(e,r,n,o),i);return t.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},b(g),a(g,s,"Generator"),g[o]=function(){return this},g.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=_,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return s.type="throw",s.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var a=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(a&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:_(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e,r){var n=r(12);function o(t){var e,r;function o(e,r){try{var s=t[e](r),a=s.value,u=a instanceof n;Promise.resolve(u?a.wrapped:a).then((function(t){u?o("return"===e?"return":"next",t):i(s.done?"return":"normal",t)}),(function(t){o("throw",t)}))}catch(t){i("throw",t)}}function i(t,n){switch(t){case"return":e.resolve({value:n,done:!0});break;case"throw":e.reject(n);break;default:e.resolve({value:n,done:!1})}(e=e.next)?o(e.key,e.arg):r=null}this._invoke=function(t,n){return new Promise((function(i,s){var a={key:t,arg:n,resolve:i,reject:s,next:null};r?r=r.next=a:(e=r=a,o(t,n))}))},"function"!=typeof t.return&&(this.return=void 0)}o.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},o.prototype.next=function(t){return this._invoke("next",t)},o.prototype.throw=function(t){return this._invoke("throw",t)},o.prototype.return=function(t){return this._invoke("return",t)},t.exports=o,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(13);t.exports=function(t){if(Array.isArray(t))return n(t)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){if(Array.isArray(t))return t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e){var r=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null!=r){var n,o,i=[],s=!0,a=!1;try{for(r=r.call(t);!(s=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);s=!0);}catch(t){a=!0,o=t}finally{try{s||null==r.return||r.return()}finally{if(a)throw o}}return i}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(11);t.exports=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=n(t)););return t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function r(e,n){return t.exports=r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},t.exports.default=t.exports,t.exports.__esModule=!0,r(e,n)}t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){"use strict";r.r(e);var n=r(0),o=r.n(n),i=r(10),s=r.n(i),a=r(1),u=r.n(a),c=r(3),l=r.n(c),h=r(4),f=r.n(h),p=r(9),d=r.n(p);function y(t){return!!t&&(t instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&t instanceof MessagePort||("undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas)))}var v=new Map,g=function(){function t(){l()(this,t)}return f()(t,null,[{key:"onmessage",set:function(t){self.onmessage=function(e){if(b(e)){var r=e.data,n=r.type,o=r.payload;t(n,o)}}}},{key:"addEventListener",value:function(t){var e=v.get(t);e||(e=function(e){if(b(e)){var r=e.data,n=r.type,o=r.payload;t(n,o)}}),self.addEventListener("message",e)}},{key:"removeEventListener",value:function(t){var e=v.get(t);v.delete(t),self.removeEventListener("message",e)}},{key:"postMessage",value:function(t,e){if(self){var r={source:"loaders.gl",type:t,payload:e},n=function t(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,o=n||new Set;if(e){if(y(e))o.add(e);else if(y(e.buffer))o.add(e.buffer);else if(ArrayBuffer.isView(e));else if(r&&"object"===d()(e))for(var i in e)t(e[i],r,o)}else;return void 0===n?Array.from(o):[]}(e);self.postMessage(r,n)}}}]),t}();function b(t){var e=t.type,r=t.data;return"message"===e&&r&&"string"==typeof r.source&&r.source.startsWith("loaders.gl")}function m(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function w(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?m(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var x=0;function O(t,e){return new Promise((function(r,n){var o=x++;g.addEventListener((function t(e,i){if(i.id===o)switch(e){case"done":g.removeEventListener(t),r(i.result);break;case"error":g.removeEventListener(t),n(i.error)}}));var i={id:o,input:t,options:e};g.postMessage("process",i)}))}function j(t){return _.apply(this,arguments)}function _(){return(_=s()(u.a.mark((function t(e){var r,n,o,i,s,a,c;return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.loader,n=e.arrayBuffer,o=e.options,i=e.context,!r.parseSync&&!r.parse){t.next=6;break}s=n,a=r.parseSync||r.parse,t.next=13;break;case 6:if(!r.parseTextSync){t.next=12;break}c=new TextDecoder,s=c.decode(n),a=r.parseTextSync,t.next=13;break;case 12:throw new Error("Could not load data with ".concat(r.name," loader"));case 13:return o=w(w({},o),{},{modules:r&&r.options&&r.options.modules||{},worker:!1}),t.next=16,a(s,w({},o),i,r);case 16:return t.abrupt("return",t.sent);case 17:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var k=r(2),A=r.n(k),P=r(6),E=r.n(P),S=r(7),L=r.n(S),C=r(5),I=r.n(C);function N(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function R(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?N(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):N(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function M(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return B(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return B(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw i}}}}function B(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function U(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=T(t);return F(t,r,{coordLength:e.coordLength||r.coordLength,numericPropKeys:e.numericPropKeys||r.numericPropKeys,PositionDataType:e.PositionDataType||Float32Array})}function T(t){var e,r,n=0,o=0,i=0,s=0,a=0,u=0,c=0,l=0,h=0,f=new Set,p={},d=M(t);try{for(d.s();!(e=d.n()).done;){var y=e.value,v=y.geometry;switch(v.type){case"Point":o++,n++,f.add(v.coordinates.length);break;case"MultiPoint":o++,n+=v.coordinates.length;var g,b=M(v.coordinates);try{for(b.s();!(g=b.n()).done;){var m=g.value;f.add(m.length)}}catch(t){b.e(t)}finally{b.f()}break;case"LineString":a++,i+=v.coordinates.length,s++;var w,x=M(v.coordinates);try{for(x.s();!(w=x.n()).done;){var O=w.value;f.add(O.length)}}catch(t){x.e(t)}finally{x.f()}break;case"MultiLineString":a++;var j,_=M(v.coordinates);try{for(_.s();!(j=_.n()).done;){var k=j.value;i+=k.length,s++;var A,P=M(k);try{for(P.s();!(A=P.n()).done;){var E=A.value;f.add(E.length)}}catch(t){P.e(t)}finally{P.f()}}}catch(t){_.e(t)}finally{_.f()}break;case"Polygon":h++,c++,l+=v.coordinates.length,u+=X(v.coordinates).length;var S,L=M(X(v.coordinates));try{for(L.s();!(S=L.n()).done;){var C=S.value;f.add(C.length)}}catch(t){L.e(t)}finally{L.f()}break;case"MultiPolygon":h++;var N,R=M(v.coordinates);try{for(R.s();!(N=R.n()).done;){var B=N.value;c++,l+=B.length,u+=X(B).length;var U,T=M(X(B));try{for(T.s();!(U=T.n()).done;){var F=U.value;f.add(F.length)}}catch(t){T.e(t)}finally{T.f()}}}catch(t){R.e(t)}finally{R.f()}break;default:throw new Error("Unsupported geometry type: ".concat(v.type))}if(y.properties)for(var D in y.properties){var J=y.properties[D];p[D]=p[D]||void 0===p[D]?(r=J,Number.isFinite(r)):p[D]}}}catch(t){d.e(t)}finally{d.f()}return{coordLength:f.size>0?Math.max.apply(Math,I()(f)):2,pointPositionsCount:n,pointFeaturesCount:o,linePositionsCount:i,linePathsCount:s,lineFeaturesCount:a,polygonPositionsCount:u,polygonObjectsCount:c,polygonRingsCount:l,polygonFeaturesCount:h,numericPropKeys:Object.keys(p).filter((function(t){return p[t]}))}}function F(t,e,r){for(var n=e.pointPositionsCount,o=e.pointFeaturesCount,i=e.linePositionsCount,s=e.linePathsCount,a=e.lineFeaturesCount,u=e.polygonPositionsCount,c=e.polygonObjectsCount,l=e.polygonRingsCount,h=e.polygonFeaturesCount,f=r.coordLength,p=r.numericPropKeys,d=r.PositionDataType,y=void 0===d?Float32Array:d,v=t.length>65535?Uint32Array:Uint16Array,g={positions:new y(n*f),globalFeatureIds:new v(n),featureIds:o>65535?new Uint32Array(n):new Uint16Array(n),numericProps:{},properties:Array(),fields:Array()},b={positions:new y(i*f),pathIndices:i>65535?new Uint32Array(s+1):new Uint16Array(s+1),globalFeatureIds:new v(i),featureIds:a>65535?new Uint32Array(i):new Uint16Array(i),numericProps:{},properties:Array(),fields:Array()},m={positions:new y(u*f),polygonIndices:u>65535?new Uint32Array(c+1):new Uint16Array(c+1),primitivePolygonIndices:u>65535?new Uint32Array(l+1):new Uint16Array(l+1),globalFeatureIds:new v(u),featureIds:h>65535?new Uint32Array(u):new Uint16Array(u),numericProps:{},properties:Array(),fields:Array()},w=0,x=[g,b,m];w<x.length;w++){var O,j=x[w],_=M(p||[]);try{for(_.s();!(O=_.n()).done;){var k=O.value;j.numericProps[k]=new Float32Array(j.positions.length/f)}}catch(t){_.e(t)}finally{_.f()}}b.pathIndices[s]=i,m.polygonIndices[c]=u,m.primitivePolygonIndices[l]=u;var A,P={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0},E=M(t);try{for(E.s();!(A=E.n()).done;){var S=A.value,L=S.geometry,C=S.properties||{};switch(L.type){case"Point":D(L.coordinates,g,P,f,C),g.properties.push($(C,p)),P.pointFeature++;break;case"MultiPoint":J(L.coordinates,g,P,f,C),g.properties.push($(C,p)),P.pointFeature++;break;case"LineString":z(L.coordinates,b,P,f,C),b.properties.push($(C,p)),P.lineFeature++;break;case"MultiLineString":G(L.coordinates,b,P,f,C),b.properties.push($(C,p)),P.lineFeature++;break;case"Polygon":Y(L.coordinates,m,P,f,C),m.properties.push($(C,p)),P.polygonFeature++;break;case"MultiPolygon":V(L.coordinates,m,P,f,C),m.properties.push($(C,p)),P.polygonFeature++;break;default:throw new Error("Invalid geometry type")}P.feature++}}catch(t){E.e(t)}finally{E.f()}return function(t,e,r,n){var o={points:R(R({},t),{},{positions:{value:t.positions,size:n},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1},type:"Point"}),lines:R(R({},e),{},{pathIndices:{value:e.pathIndices,size:1},positions:{value:e.positions,size:n},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},type:"LineString"}),polygons:R(R({},r),{},{polygonIndices:{value:r.polygonIndices,size:1},primitivePolygonIndices:{value:r.primitivePolygonIndices,size:1},positions:{value:r.positions,size:n},globalFeatureIds:{value:r.globalFeatureIds,size:1},featureIds:{value:r.featureIds,size:1},type:"Polygon"})};for(var i in o)for(var s in o[i].numericProps)o[i].numericProps[s]={value:o[i].numericProps[s],size:1};return o}(g,b,m,f)}function D(t,e,r,n,o){e.positions.set(t,r.pointPosition*n),e.globalFeatureIds[r.pointPosition]=r.feature,e.featureIds[r.pointPosition]=r.pointFeature,K(e,o,r.pointPosition,1),r.pointPosition++}function J(t,e,r,n,o){var i,s=M(t);try{for(s.s();!(i=s.n()).done;){D(i.value,e,r,n,o)}}catch(t){s.e(t)}finally{s.f()}}function z(t,e,r,n,o){e.pathIndices[r.linePath]=r.linePosition,r.linePath++,q(e.positions,t,r.linePosition,n);var i=t.length;K(e,o,r.linePosition,i),e.globalFeatureIds.set(new Uint32Array(i).fill(r.feature),r.linePosition),e.featureIds.set(new Uint32Array(i).fill(r.lineFeature),r.linePosition),r.linePosition+=i}function G(t,e,r,n,o){var i,s=M(t);try{for(s.s();!(i=s.n()).done;){z(i.value,e,r,n,o)}}catch(t){s.e(t)}finally{s.f()}}function Y(t,e,r,n,o){e.polygonIndices[r.polygonObject]=r.polygonPosition,r.polygonObject++;var i,s=M(t);try{for(s.s();!(i=s.n()).done;){var a=i.value;e.primitivePolygonIndices[r.polygonRing]=r.polygonPosition,r.polygonRing++,q(e.positions,a,r.polygonPosition,n);var u=a.length;K(e,o,r.polygonPosition,u),e.globalFeatureIds.set(new Uint32Array(u).fill(r.feature),r.polygonPosition),e.featureIds.set(new Uint32Array(u).fill(r.polygonFeature),r.polygonPosition),r.polygonPosition+=u}}catch(t){s.e(t)}finally{s.f()}}function V(t,e,r,n,o){var i,s=M(t);try{for(s.s();!(i=s.n()).done;){Y(i.value,e,r,n,o)}}catch(t){s.e(t)}finally{s.f()}}function K(t,e,r,n){for(var o in t.numericProps)o in e&&t.numericProps[o].set(new Array(n).fill(e[o]),r)}function $(t,e){var r={};for(var n in t)e.includes(n)||(r[n]=t[n]);return r}function q(t,e,r,n){var o,i=r*n,s=M(e);try{for(s.s();!(o=s.n()).done;){var a=o.value;t.set(a,i),i+=n}}catch(t){s.e(t)}finally{s.f()}}function X(t){var e;return(e=[]).concat.apply(e,I()(t))}function H(t,e){try{var r,n=JSON.parse(t);return null!==(r=e.json)&&void 0!==r&&r.table&&function t(e){if(Array.isArray(e))return e;if(e&&"object"===d()(e))for(var r=0,n=Object.values(e);r<n.length;r++){var o=n[r],i=t(o);if(i)return i}return null}(n)||n}catch(t){throw new Error("JSONLoader: failed to parse JSON")}}var W=function(){function t(e,r){if(l()(this,t),o()(this,"schema",void 0),o()(this,"options",void 0),o()(this,"length",0),o()(this,"rows",null),o()(this,"cursor",0),o()(this,"_headers",[]),this.options=r,this.schema=e,!Array.isArray(e))for(var n in this._headers=[],e)this._headers[e[n].index]=e[n].name}return f()(t,[{key:"rowCount",value:function(){return this.length}},{key:"addArrayRow",value:function(t,e){Number.isFinite(e)&&(this.cursor=e),this.rows=this.rows||new Array(100),this.rows[this.length]=t,this.length++}},{key:"addObjectRow",value:function(t,e){Number.isFinite(e)&&(this.cursor=e),this.rows=this.rows||new Array(100),this.rows[this.length]=t,this.length++}},{key:"getBatch",value:function(){var t=this.rows;return t?(t=t.slice(0,this.length),this.rows=null,{shape:this.options.shape,batchType:"data",data:t,length:this.length,schema:this.schema,cursor:this.cursor}):null}}]),t}();var Q=function(){function t(e,r){if(l()(this,t),o()(this,"schema",void 0),o()(this,"options",void 0),o()(this,"length",0),o()(this,"objectRows",null),o()(this,"arrayRows",null),o()(this,"cursor",0),o()(this,"_headers",[]),this.options=r,this.schema=e,!Array.isArray(e))for(var n in this._headers=[],e)this._headers[e[n].index]=e[n].name}return f()(t,[{key:"rowCount",value:function(){return this.length}},{key:"addArrayRow",value:function(t,e){switch(Number.isFinite(e)&&(this.cursor=e),this.options.shape){case"object-row-table":var r=function(t,e){if(!t)throw new Error("null row");if(!e)throw new Error("no headers");for(var r={},n=0;n<e.length;n++)r[e[n]]=t[n];return r}(t,this._headers);this.addObjectRow(r,e);break;case"array-row-table":this.arrayRows=this.arrayRows||new Array(100),this.arrayRows[this.length]=t,this.length++}}},{key:"addObjectRow",value:function(t,e){switch(Number.isFinite(e)&&(this.cursor=e),this.options.shape){case"array-row-table":var r=function(t,e){if(!t)throw new Error("null row");if(!e)throw new Error("no headers");for(var r=new Array(e.length),n=0;n<e.length;n++)r[n]=t[e[n]];return r}(t,this._headers);this.addArrayRow(r,e);break;case"object-row-table":this.objectRows=this.objectRows||new Array(100),this.objectRows[this.length]=t,this.length++}}},{key:"getBatch",value:function(){var t=this.arrayRows||this.objectRows;return t?(t=t.slice(0,this.length),this.arrayRows=null,this.objectRows=null,{shape:this.options.shape,batchType:"data",data:t,length:this.length,schema:this.schema,cursor:this.cursor}):null}}]),t}(),Z=r(15),tt=r.n(Z),et=function(){function t(e,r){l()(this,t),o()(this,"schema",void 0),o()(this,"length",0),o()(this,"allocated",0),o()(this,"columns",{}),this.schema=e,this._reallocateColumns()}return f()(t,[{key:"rowCount",value:function(){return this.length}},{key:"addArrayRow",value:function(t){this._reallocateColumns();var e=0;for(var r in this.columns)this.columns[r][this.length]=t[e++];this.length++}},{key:"addObjectRow",value:function(t){for(var e in this._reallocateColumns(),t)this.columns[e][this.length]=t[e];this.length++}},{key:"getBatch",value:function(){this._pruneColumns();var t=Array.isArray(this.schema)?this.columns:{};if(!Array.isArray(this.schema))for(var e in this.schema){var r=this.schema[e];t[r.name]=this.columns[r.index]}return this.columns={},{shape:"columnar-table",batchType:"data",data:t,schema:this.schema,length:this.length}}},{key:"_reallocateColumns",value:function(){if(!(this.length<this.allocated))for(var t in this.allocated=this.allocated>0?this.allocated*=2:100,this.columns={},this.schema){var e=this.schema[t],r=e.type||Float32Array,n=this.columns[e.index];if(n&&ArrayBuffer.isView(n)){var o=new r(this.allocated);o.set(n),this.columns[e.index]=o}else n?(n.length=this.allocated,this.columns[e.index]=n):this.columns[e.index]=new r(this.allocated)}}},{key:"_pruneColumns",value:function(){for(var t=0,e=Object.entries(this.columns);t<e.length;t++){var r=tt()(e[t],2),n=r[0],o=r[1];this.columns[n]=o.slice(0,this.length)}}}]),t}();function rt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function nt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?rt(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):rt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var ot={shape:"array-row-table",batchSize:"auto",batchDebounceMs:0,limit:0,_limitMB:0},it=function(){function t(e,r){l()(this,t),o()(this,"schema",void 0),o()(this,"options",void 0),o()(this,"aggregator",null),o()(this,"batchCount",0),o()(this,"bytesUsed",0),o()(this,"isChunkComplete",!1),o()(this,"lastBatchEmittedMs",Date.now()),o()(this,"totalLength",0),o()(this,"totalBytes",0),o()(this,"rowBytes",0),this.schema=e,this.options=nt(nt({},ot),r)}return f()(t,[{key:"limitReached",value:function(){var t,e;return!!(Boolean(null===(t=this.options)||void 0===t?void 0:t.limit)&&this.totalLength>=this.options.limit)||!!(Boolean(null===(e=this.options)||void 0===e?void 0:e._limitMB)&&this.totalBytes/1e6>=this.options._limitMB)}},{key:"addRow",value:function(t){this.limitReached()||(this.totalLength++,this.rowBytes=this.rowBytes||this._estimateRowMB(t),this.totalBytes+=this.rowBytes,Array.isArray(t)?this.addArrayRow(t):this.addObjectRow(t))}},{key:"addArrayRow",value:function(t){if(!this.aggregator){var e=this._getTableBatchType();this.aggregator=new e(this.schema,this.options)}this.aggregator.addArrayRow(t)}},{key:"addObjectRow",value:function(t){if(!this.aggregator){var e=this._getTableBatchType();this.aggregator=new e(this.schema,this.options)}this.aggregator.addObjectRow(t)}},{key:"chunkComplete",value:function(t){t instanceof ArrayBuffer&&(this.bytesUsed+=t.byteLength),"string"==typeof t&&(this.bytesUsed+=t.length),this.isChunkComplete=!0}},{key:"getFullBatch",value:function(t){return this._isFull()?this._getBatch(t):null}},{key:"getFinalBatch",value:function(t){return this._getBatch(t)}},{key:"_estimateRowMB",value:function(t){return Array.isArray(t)?8*t.length:8*Object.keys(t).length}},{key:"_isFull",value:function(){if(!this.aggregator||0===this.aggregator.rowCount())return!1;if("auto"===this.options.batchSize){if(!this.isChunkComplete)return!1}else if(this.options.batchSize>this.aggregator.rowCount())return!1;return!(this.options.batchDebounceMs>Date.now()-this.lastBatchEmittedMs)&&(this.isChunkComplete=!1,this.lastBatchEmittedMs=Date.now(),!0)}},{key:"_getBatch",value:function(t){if(!this.aggregator)return null;null!=t&&t.bytesUsed&&(this.bytesUsed=t.bytesUsed);var e=this.aggregator.getBatch();return e.count=this.batchCount,e.bytesUsed=this.bytesUsed,Object.assign(e,t),this.batchCount++,this.aggregator=null,e}},{key:"_getTableBatchType",value:function(){switch(this.options.shape){case"row-table":return W;case"array-row-table":case"object-row-table":return Q;case"columnar-table":return et;case"arrow-table":if(!t.ArrowBatch)throw new Error("TableBatchBuilder");return t.ArrowBatch;default:throw new Error("TableBatchBuilder")}}}]),t}();function st(t){return at.apply(this,arguments)}function at(){return(at=E()(u.a.mark((function t(e){var r,n,o,i,s,a,c,l,h,f=arguments;return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=f.length>1&&void 0!==f[1]?f[1]:{},n=new TextDecoder(void 0,r),o=!0,i=!1,t.prev=4,a=L()(e);case 6:return t.next=8,A()(a.next());case 8:return c=t.sent,o=c.done,t.next=12,A()(c.value);case 12:if(l=t.sent,o){t.next=20;break}return h=l,t.next=17,"string"==typeof h?h:n.decode(h,{stream:!0});case 17:o=!0,t.next=6;break;case 20:t.next=26;break;case 22:t.prev=22,t.t0=t.catch(4),i=!0,s=t.t0;case 26:if(t.prev=26,t.prev=27,o||null==a.return){t.next=31;break}return t.next=31,A()(a.return());case 31:if(t.prev=31,!i){t.next=34;break}throw s;case 34:return t.finish(31);case 35:return t.finish(26);case 36:case"end":return t.stop()}}),t,null,[[4,22,26,36],[27,,31,35]])})))).apply(this,arguments)}o()(it,"ArrowBatch",void 0);var ut=r(8),ct=r.n(ut),lt=r(16),ht=r.n(lt),ft=r(17),pt=r.n(ft),dt=r(18),yt=r.n(dt),vt=r(11),gt=r.n(vt),bt=Number.MAX_SAFE_INTEGER,mt="debug"==={}.CDEBUG,wt={textNode:void 0,numberNode:""},xt=0,Ot={BEGIN:xt++,VALUE:xt++,OPEN_OBJECT:xt++,CLOSE_OBJECT:xt++,OPEN_ARRAY:xt++,CLOSE_ARRAY:xt++,TEXT_ESCAPE:xt++,STRING:xt++,BACKSLASH:xt++,END:xt++,OPEN_KEY:xt++,CLOSE_KEY:xt++,TRUE:xt++,TRUE2:xt++,TRUE3:xt++,FALSE:xt++,FALSE2:xt++,FALSE3:xt++,FALSE4:xt++,NULL:xt++,NULL2:xt++,NULL3:xt++,NUMBER_DECIMAL_POINT:xt++,NUMBER_DIGIT:xt++};for(var jt in Ot)Ot[Ot[jt]]=jt;xt=Ot;var _t=9,kt=10,At=13,Pt=32,Et=34,St=43,Lt=44,Ct=45,It=46,Nt=48,Rt=57,Mt=58,Bt=69,Ut=91,Tt=92,Ft=93,Dt=97,Jt=98,zt=101,Gt=102,Yt=108,Vt=110,Kt=114,$t=115,qt=116,Xt=117,Ht=123,Wt=125;var Qt=/[\\"\n]/g,Zt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};l()(this,t),this._initialize(e)}return f()(t,[{key:"_initialize",value:function(t){this._clearBuffers(this),this.bufferCheckPosition=bt,this.q="",this.c="",this.p="",this.options=t||{},this.closed=!1,this.closedRoot=!1,this.sawRoot=!1,this.tag=null,this.error=null,this.state=xt.BEGIN,this.stack=new Array,this.position=this.column=0,this.line=1,this.slashed=!1,this.unicodeI=0,this.unicodeS=null,this.depth=0,"onready"in t&&(this.onready=t.onready),"onopenobject"in t&&(this.onopenobject=t.onopenobject),"onkey"in t&&(this.onkey=t.onkey),"oncloseobject"in t&&(this.oncloseobject=t.oncloseobject),"onopenarray"in t&&(this.onopenarray=t.onopenarray),"onclosearray"in t&&(this.onclosearray=t.onclosearray),"onvalue"in t&&(this.onvalue=t.onvalue),"onerror"in t&&(this.onerror=t.onerror),"onend"in t&&(this.onend=t.onend),"onchunkparsed"in t&&(this.onchunkparsed=t.onchunkparsed),te(this,"onready")}},{key:"_clearBuffers",value:function(){for(var t in wt)this[t]=wt[t]}},{key:"end",value:function(){return this.state===xt.VALUE&&0===this.depth||oe(this,"Unexpected end"),re(this),this.c="",this.closed=!0,te(this,"onend"),this._initialize(this.options),this}},{key:"resume",value:function(){return this.error=null,this}},{key:"close",value:function(){return this.write(null)}},{key:"write",value:function(t){if(this.error)throw this.error;if(this.closed)return oe(this,"Cannot write after close. Assign an onready handler.");if(null===t)return this.end();var e=0,r=t.charCodeAt(0),n=this.p;for(mt&&console.log("write -> ["+t+"]");r&&(n=r,this.c=r=t.charCodeAt(e++),n!==r?this.p=n:n=this.p,r);)switch(mt&&console.log(e,r,Ot[this.state]),this.position++,r===kt?(this.line++,this.column=0):this.column++,this.state){case xt.BEGIN:r===Ht?this.state=xt.OPEN_OBJECT:r===Ut?this.state=xt.OPEN_ARRAY:ie(r)||oe(this,"Non-whitespace before {[.");continue;case xt.OPEN_KEY:case xt.OPEN_OBJECT:if(ie(r))continue;if(this.state===xt.OPEN_KEY)this.stack.push(xt.CLOSE_KEY);else{if(r===Wt){te(this,"onopenobject"),this.depth++,te(this,"oncloseobject"),this.depth--,this.state=this.stack.pop()||xt.VALUE;continue}this.stack.push(xt.CLOSE_OBJECT)}r===Et?this.state=xt.STRING:oe(this,'Malformed object key should start with "');continue;case xt.CLOSE_KEY:case xt.CLOSE_OBJECT:if(ie(r))continue;this.state,xt.CLOSE_KEY;r===Mt?(this.state===xt.CLOSE_OBJECT?(this.stack.push(xt.CLOSE_OBJECT),re(this,"onopenobject"),this.depth++):re(this,"onkey"),this.state=xt.VALUE):r===Wt?(ee(this,"oncloseobject"),this.depth--,this.state=this.stack.pop()||xt.VALUE):r===Lt?(this.state===xt.CLOSE_OBJECT&&this.stack.push(xt.CLOSE_OBJECT),re(this),this.state=xt.OPEN_KEY):oe(this,"Bad object");continue;case xt.OPEN_ARRAY:case xt.VALUE:if(ie(r))continue;if(this.state===xt.OPEN_ARRAY){if(te(this,"onopenarray"),this.depth++,this.state=xt.VALUE,r===Ft){te(this,"onclosearray"),this.depth--,this.state=this.stack.pop()||xt.VALUE;continue}this.stack.push(xt.CLOSE_ARRAY)}r===Et?this.state=xt.STRING:r===Ht?this.state=xt.OPEN_OBJECT:r===Ut?this.state=xt.OPEN_ARRAY:r===qt?this.state=xt.TRUE:r===Gt?this.state=xt.FALSE:r===Vt?this.state=xt.NULL:r===Ct?this.numberNode+="-":Nt<=r&&r<=Rt?(this.numberNode+=String.fromCharCode(r),this.state=xt.NUMBER_DIGIT):oe(this,"Bad value");continue;case xt.CLOSE_ARRAY:if(r===Lt)this.stack.push(xt.CLOSE_ARRAY),re(this,"onvalue"),this.state=xt.VALUE;else if(r===Ft)ee(this,"onclosearray"),this.depth--,this.state=this.stack.pop()||xt.VALUE;else{if(ie(r))continue;oe(this,"Bad array")}continue;case xt.STRING:void 0===this.textNode&&(this.textNode="");var o=e-1,i=this.slashed,s=this.unicodeI;t:for(;;){for(mt&&console.log(e,r,Ot[this.state],i);s>0;)if(this.unicodeS+=String.fromCharCode(r),r=t.charCodeAt(e++),this.position++,4===s?(this.textNode+=String.fromCharCode(parseInt(this.unicodeS,16)),s=0,o=e-1):s++,!r)break t;if(r===Et&&!i){this.state=this.stack.pop()||xt.VALUE,this.textNode+=t.substring(o,e-1),this.position+=e-1-o;break}if(r===Tt&&!i&&(i=!0,this.textNode+=t.substring(o,e-1),this.position+=e-1-o,r=t.charCodeAt(e++),this.position++,!r))break;if(i){if(i=!1,r===Vt?this.textNode+="\n":r===Kt?this.textNode+="\r":r===qt?this.textNode+="\t":r===Gt?this.textNode+="\f":r===Jt?this.textNode+="\b":r===Xt?(s=1,this.unicodeS=""):this.textNode+=String.fromCharCode(r),r=t.charCodeAt(e++),this.position++,o=e-1,r)continue;break}Qt.lastIndex=e;var a=Qt.exec(t);if(null===a){e=t.length+1,this.textNode+=t.substring(o,e-1),this.position+=e-1-o;break}if(e=a.index+1,!(r=t.charCodeAt(a.index))){this.textNode+=t.substring(o,e-1),this.position+=e-1-o;break}}this.slashed=i,this.unicodeI=s;continue;case xt.TRUE:r===Kt?this.state=xt.TRUE2:oe(this,"Invalid true started with t"+r);continue;case xt.TRUE2:r===Xt?this.state=xt.TRUE3:oe(this,"Invalid true started with tr"+r);continue;case xt.TRUE3:r===zt?(te(this,"onvalue",!0),this.state=this.stack.pop()||xt.VALUE):oe(this,"Invalid true started with tru"+r);continue;case xt.FALSE:r===Dt?this.state=xt.FALSE2:oe(this,"Invalid false started with f"+r);continue;case xt.FALSE2:r===Yt?this.state=xt.FALSE3:oe(this,"Invalid false started with fa"+r);continue;case xt.FALSE3:r===$t?this.state=xt.FALSE4:oe(this,"Invalid false started with fal"+r);continue;case xt.FALSE4:r===zt?(te(this,"onvalue",!1),this.state=this.stack.pop()||xt.VALUE):oe(this,"Invalid false started with fals"+r);continue;case xt.NULL:r===Xt?this.state=xt.NULL2:oe(this,"Invalid null started with n"+r);continue;case xt.NULL2:r===Yt?this.state=xt.NULL3:oe(this,"Invalid null started with nu"+r);continue;case xt.NULL3:r===Yt?(te(this,"onvalue",null),this.state=this.stack.pop()||xt.VALUE):oe(this,"Invalid null started with nul"+r);continue;case xt.NUMBER_DECIMAL_POINT:r===It?(this.numberNode+=".",this.state=xt.NUMBER_DIGIT):oe(this,"Leading zero not followed by .");continue;case xt.NUMBER_DIGIT:Nt<=r&&r<=Rt?this.numberNode+=String.fromCharCode(r):r===It?(-1!==this.numberNode.indexOf(".")&&oe(this,"Invalid number has two dots"),this.numberNode+="."):r===zt||r===Bt?(-1===this.numberNode.indexOf("e")&&-1===this.numberNode.indexOf("E")||oe(this,"Invalid number has two exponential"),this.numberNode+="e"):r===St||r===Ct?(n!==zt&&n!==Bt&&oe(this,"Invalid symbol in number"),this.numberNode+=String.fromCharCode(r)):(ne(this),e--,this.state=this.stack.pop()||xt.VALUE);continue;default:oe(this,"Unknown state: "+this.state)}return this.position>=this.bufferCheckPosition&&function(t){var e=Math.max(bt,10),r=0;for(var n in wt){var o=void 0===t[n]?0:t[n].length;if(o>e)switch(n){case"text":closeText(t);break;default:oe(t,"Max buffer length exceeded: "+n)}r=Math.max(r,o)}t.bufferCheckPosition=bt-r+t.position}(this),te(this,"onchunkparsed"),this}}]),t}();function te(t,e,r){mt&&console.log("-- emit",e,r),t[e]&&t[e](r,t)}function ee(t,e,r){re(t),te(t,e,r)}function re(t,e){t.textNode=function(t,e){if(void 0===e)return e;t.trim&&(e=e.trim());t.normalize&&(e=e.replace(/\s+/g," "));return e}(t.options,t.textNode),void 0!==t.textNode&&te(t,e||"onvalue",t.textNode),t.textNode=void 0}function ne(t){t.numberNode&&te(t,"onvalue",parseFloat(t.numberNode)),t.numberNode=""}function oe(t,e){return re(t),e+="\nLine: "+t.line+"\nColumn: "+t.column+"\nChar: "+t.c,e=new Error(e),t.error=e,te(t,"onerror",e),t}function ie(t){return t===At||t===kt||t===Pt||t===_t}function se(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return ae(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ae(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw i}}}}function ae(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var ue=function(){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(l()(this,t),o()(this,"path",void 0),this.path=["$"],r instanceof t)this.path=I()(r.path);else if(Array.isArray(r))(e=this.path).push.apply(e,I()(r));else if("string"==typeof r&&(this.path=r.split("."),"$"!==this.path[0]))throw new Error("JSONPaths must start with $")}return f()(t,[{key:"clone",value:function(){return new t(this)}},{key:"toString",value:function(){return this.path.join(".")}},{key:"push",value:function(t){this.path.push(t)}},{key:"pop",value:function(){return this.path.pop()}},{key:"set",value:function(t){this.path[this.path.length-1]=t}},{key:"equals",value:function(t){if(!this||!t||this.path.length!==t.path.length)return!1;for(var e=0;e<this.path.length;++e)if(this.path[e]!==t.path[e])return!1;return!0}},{key:"setFieldAtPath",value:function(t,e){var r=I()(this.path);r.shift();var n,o=r.pop(),i=se(r);try{for(i.s();!(n=i.n()).done;){t=t[n.value]}}catch(t){i.e(t)}finally{i.f()}t[o]=e}},{key:"getFieldAtPath",value:function(t){var e=I()(this.path);e.shift();var r,n=e.pop(),o=se(e);try{for(o.s();!(r=o.n()).done;){t=t[r.value]}}catch(t){o.e(t)}finally{o.f()}return t[n]}}]),t}();function ce(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return le(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return le(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw i}}}}function le(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function he(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=gt()(t);if(e){var o=gt()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return yt()(this,r)}}var fe=function(t){pt()(r,t);var e=he(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};l()(this,r),t=e.call(this),o()(ct()(t),"jsonPaths",void 0),o()(ct()(t),"streamingJsonPath",null),o()(ct()(t),"streamingArray",null),o()(ct()(t),"topLevelObject",null);var i=n.jsonpaths||[];return t.jsonPaths=i.map((function(t){return new ue(t)})),t._extendParser(),t}return f()(r,[{key:"write",value:function(t){ht()(gt()(r.prototype),"write",this).call(this,t);var e=[];return this.streamingArray&&(e=I()(this.streamingArray),this.streamingArray.length=0),e}},{key:"getPartialResult",value:function(){return this.topLevelObject}},{key:"getStreamingJsonPath",value:function(){return this.streamingJsonPath}},{key:"getStreamingJsonPathAsString",value:function(){return this.streamingJsonPath&&this.streamingJsonPath.toString()}},{key:"getJsonPath",value:function(){return this.jsonpath}},{key:"_matchJSONPath",value:function(){var t=this.getJsonPath();if(0===this.jsonPaths.length)return!0;var e,r=ce(this.jsonPaths);try{for(r.s();!(e=r.n()).done;){if(e.value.equals(t))return!0}}catch(t){r.e(t)}finally{r.f()}return!1}},{key:"_extendParser",value:function(){var t=this;this.parser.onopenarray=function(){if(!t.streamingArray&&t._matchJSONPath())return t.streamingJsonPath=t.getJsonPath().clone(),t.streamingArray=[],void t._openArray(t.streamingArray);t._openArray()},this.parser.onopenobject=function(e){t.topLevelObject?t._openObject({}):(t.topLevelObject={},t._openObject(t.topLevelObject)),void 0!==e&&t.parser.onkey(e)}}}]),r}(function(){function t(){l()(this,t),o()(this,"jsonpath",void 0),o()(this,"_parser",void 0),this.reset(),this._initializeParser()}return f()(t,[{key:"reset",value:function(){this.result=void 0,this.previousStates=[],this.currentState=Object.freeze({container:[],key:null}),this.jsonpath=new ue}},{key:"write",value:function(t){this.parser.write(t)}},{key:"close",value:function(){this.parser.close()}},{key:"_pushOrSet",value:function(t){var e=this.currentState,r=e.container,n=e.key;null!==n?(r[n]=t,this.currentState.key=null):r.push(t)}},{key:"_openArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.jsonpath.push(null),this._pushOrSet(t),this.previousStates.push(this.currentState),this.currentState={container:t,isArray:!0,key:null}}},{key:"_closeArray",value:function(){this.jsonpath.pop(),this.currentState=this.previousStates.pop()}},{key:"_openObject",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.jsonpath.push(null),this._pushOrSet(t),this.previousStates.push(this.currentState),this.currentState={container:t,isArray:!1,key:null}}},{key:"_closeObject",value:function(){this.jsonpath.pop(),this.currentState=this.previousStates.pop()}},{key:"_initializeParser",value:function(){var t=this;this._parser=new Zt({onready:function(){t.jsonpath=new ue,t.previousStates.length=0,t.currentState.container.length=0},onopenobject:function(e){t._openObject({}),void 0!==e&&t.parser.onkey(e)},onkey:function(e){t.jsonpath.set(e),t.currentState.key=e},oncloseobject:function(){t._closeObject()},onopenarray:function(){t._openArray()},onclosearray:function(){t._closeArray()},onvalue:function(e){t._pushOrSet(e)},onerror:function(t){throw t},onend:function(){t.result=t.currentState.container.pop()}})}},{key:"parser",get:function(){return this._parser}}]),t}());function pe(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return de(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return de(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw i}}}}function de(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ye(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ve(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ye(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ye(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ge(){return(ge=E()(u.a.mark((function t(e,r){var n,o,i,s,a,c,l,h,f,p,d,y,v,g,b,m,w,x,O,j,_,k,P,E,S,C,I;return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=st(e),i=r.metadata,s=r.json||{},a=s.jsonpaths,c=!0,null,l=(null==r||null===(n=r.json)||void 0===n?void 0:n.shape)||"row-table",h=new it(null,ve(ve({},r),{},{shape:l})),f=new fe({jsonpaths:a}),p=!0,d=!1,t.prev=10,v=L()(o);case 12:return t.next=14,A()(v.next());case 14:return g=t.sent,p=g.done,t.next=18,A()(g.value);case 18:if(b=t.sent,p){t.next=57;break}if(m=b,w=f.write(m),x=w.length>0&&f.getStreamingJsonPathAsString(),!(w.length>0&&c)){t.next=29;break}if(!i){t.next=28;break}return O={shape:l,batchType:"partial-result",data:[],length:0,bytesUsed:0,container:f.getPartialResult(),jsonpath:x},t.next=28,O;case 28:c=!1;case 29:j=pe(w),t.prev=30,j.s();case 32:if((_=j.n()).done){t.next=41;break}if(k=_.value,h.addRow(k),!(P=h.getFullBatch({jsonpath:x}))){t.next=39;break}return t.next=39,P;case 39:t.next=32;break;case 41:t.next=46;break;case 43:t.prev=43,t.t0=t.catch(30),j.e(t.t0);case 46:return t.prev=46,j.f(),t.finish(46);case 49:if(h.chunkComplete(m),!(E=h.getFullBatch({jsonpath:x}))){t.next=54;break}return t.next=54,E;case 54:p=!0,t.next=12;break;case 57:t.next=63;break;case 59:t.prev=59,t.t1=t.catch(10),d=!0,y=t.t1;case 63:if(t.prev=63,t.prev=64,p||null==v.return){t.next=68;break}return t.next=68,A()(v.return());case 68:if(t.prev=68,!d){t.next=71;break}throw y;case 71:return t.finish(68);case 72:return t.finish(63);case 73:if(S=f.getStreamingJsonPathAsString(),!(C=h.getFinalBatch({jsonpath:S}))){t.next=78;break}return t.next=78,C;case 78:if(!i){t.next=82;break}return I={shape:l,batchType:"final-result",container:f.getPartialResult(),jsonpath:f.getStreamingJsonPathAsString(),data:[],length:0},t.next=82,I;case 82:case"end":return t.stop()}}),t,null,[[10,59,63,73],[30,43,46,49],[64,,68,72]])})))).apply(this,arguments)}function be(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function me(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?be(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):be(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var we,xe={geojson:{shape:"object-row-table"},json:{jsonpaths:["$","$.features"]},gis:{format:"geojson"}},Oe=me(me({},{name:"GeoJSON",id:"geojson",module:"geojson",version:"3.0.14",worker:!0,extensions:["geojson"],mimeTypes:["application/geo+json"],category:"geometry",text:!0,options:xe}),{},{parse:function(t,e){return je.apply(this,arguments)},parseTextSync:_e,parseInBatches:function(t,e){(e=me(me({},xe),e)).json=me(me({},xe.geojson),e.geojson);var r=function(t,e){return ge.apply(this,arguments)}(t,e);switch(e.gis.format){case"binary":return function(t){return ke.apply(this,arguments)}(r);default:return r}}});function je(){return(je=s()(u.a.mark((function t(e,r){return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",_e((new TextDecoder).decode(e),r));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function _e(t,e){(e=me(me({},xe),e)).json=me(me({},xe.geojson),e.geojson),e.gis=e.gis||{};var r=H(t,e);switch(e.gis.format){case"binary":return U(r);default:return r}}function ke(){return(ke=E()(u.a.mark((function t(e){var r,n,o,i,s,a,c;return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=!0,n=!1,t.prev=2,i=L()(e);case 4:return t.next=6,A()(i.next());case 6:return s=t.sent,r=s.done,t.next=10,A()(s.value);case 10:if(a=t.sent,r){t.next=19;break}return(c=a).data=U(c.data),t.next=16,c;case 16:r=!0,t.next=4;break;case 19:t.next=25;break;case 21:t.prev=21,t.t0=t.catch(2),n=!0,o=t.t0;case 25:if(t.prev=25,t.prev=26,r||null==i.return){t.next=30;break}return t.next=30,A()(i.return());case 30:if(t.prev=30,!n){t.next=33;break}throw o;case 33:return t.finish(30);case 34:return t.finish(25);case 35:case"end":return t.stop()}}),t,null,[[2,21,25,35],[26,,30,34]])})))).apply(this,arguments)}we=Oe,"undefined"!=typeof self&&(g.onmessage=function(){var t=s()(u.a.mark((function t(e,r){var n,o,i,s,a;return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=e,t.next="process"===t.t0?3:16;break;case 3:return t.prev=3,n=r.input,o=r.options,i=void 0===o?{}:o,t.next=7,j({loader:we,arrayBuffer:n,options:i,context:{parse:O}});case 7:s=t.sent,g.postMessage("done",{result:s}),t.next=15;break;case 11:t.prev=11,t.t1=t.catch(3),a=t.t1 instanceof Error?t.t1.message:"",g.postMessage("error",{error:a});case 15:return t.abrupt("break",16);case 16:case"end":return t.stop()}}),t,null,[[3,11]])})));return function(e,r){return t.apply(this,arguments)}}())}]);
|
|
2
2
|
//# sourceMappingURL=geojson-worker.js.map
|