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

@loaders.gl/terrain

Package Overview
Dependencies
Maintainers
8
Versions
271
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@loaders.gl/terrain - npm Package Compare versions

Comparing version 3.0.0-alpha.2 to 3.0.0-alpha.3

2

dist/dist.min.js

@@ -1,1 +0,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 r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(window,(function(){return 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}return 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=5)}([function(t,e,r){t.exports=r(7)},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}},function(t,e){function r(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.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 a=t.apply(e,n);function c(t){r(a,o,i,c,u,"next",t)}function u(t){r(a,o,i,c,u,"throw",t)}c(void 0)}))}}},function(t,e,r){var n=r(8),o=r(9),i=r(10),a=r(12);t.exports=function(t,e){return n(t)||o(t,e)||i(t,e)||a()}},,function(t,e,r){(function(e){var n=r(13),o="undefined"==typeof window?e:window;o.loaders=o.loaders||{},t.exports=Object.assign(o.loaders,n)}).call(this,r(6))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},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",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=e&&e.prototype instanceof l?e:l,i=Object.create(o.prototype),a=new x(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 S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=m(a,r);if(c){if(c===f)continue;return c}}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=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,a),i}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f={};function l(){}function h(){}function d(){}var p={};p[o]=function(){return this};var y=Object.getPrototypeOf,v=y&&y(y(P([])));v&&v!==e&&r.call(v,o)&&(p=v);var g=d.prototype=l.prototype=Object.create(p);function E(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){var n;this._invoke=function(o,i){function a(){return new e((function(n,a){!function n(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var f=u.arg,l=f.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){f.value=t,a(f)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function m(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,m(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;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,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function w(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 x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function P(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:S}}function S(){return{value:void 0,done:!0}}return h.prototype=g.constructor=d,d.constructor=h,h.displayName=c(d,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},E(b.prototype),b.prototype[i]=function(){return this},t.AsyncIterator=b,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new b(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(g),c(g,a,"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=P,x.prototype={constructor:x,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 a.type="throw",a.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],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){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 a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},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),f},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),f}},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:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var r=[],n=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(n=(a=c.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==c.return||c.return()}finally{if(o)throw i}}return r}}},function(t,e,r){var n=r(11);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}}},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}},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.")}},function(t,e,r){"use strict";r.r(e),r.d(e,"TerrainLoader",(function(){return b})),r.d(e,"TerrainWorkerLoader",(function(){return E})),r.d(e,"QuantizedMeshLoader",(function(){return F})),r.d(e,"QuantizedMeshWorkerLoader",(function(){return R})),r.d(e,"_NPYLoader",(function(){return X})),r.d(e,"_NPYWorkerLoader",(function(){return q}));var n=r(1),o=r.n(n),i=r(0),a=r.n(i),c=r(2),u=r.n(c),s=r(3),f=r.n(s);class l{constructor(t=257){this.gridSize=t;const e=t-1;if(e&e-1)throw new Error(`Expected grid size to be 2^n+1, got ${t}.`);this.numTriangles=e*e*2-2,this.numParentTriangles=this.numTriangles-e*e,this.indices=new Uint32Array(this.gridSize*this.gridSize),this.coords=new Uint16Array(4*this.numTriangles);for(let t=0;t<this.numTriangles;t++){let r=t+2,n=0,o=0,i=0,a=0,c=0,u=0;for(1&r?i=a=c=e:n=o=u=e;(r>>=1)>1;){const t=n+i>>1,e=o+a>>1;1&r?(i=n,a=o,n=c,o=u):(n=i,o=a,i=c,a=u),c=t,u=e}const s=4*t;this.coords[s+0]=n,this.coords[s+1]=o,this.coords[s+2]=i,this.coords[s+3]=a}}createTile(t){return new h(t,this)}}class h{constructor(t,e){const r=e.gridSize;if(t.length!==r*r)throw new Error(`Expected terrain data of length ${r*r} (${r} x ${r}), got ${t.length}.`);this.terrain=t,this.martini=e,this.errors=new Float32Array(t.length),this.update()}update(){const{numTriangles:t,numParentTriangles:e,coords:r,gridSize:n}=this.martini,{terrain:o,errors:i}=this;for(let a=t-1;a>=0;a--){const t=4*a,c=r[t+0],u=r[t+1],s=r[t+2],f=r[t+3],l=c+s>>1,h=u+f>>1,d=l+h-u,p=h+c-l,y=(o[u*n+c]+o[f*n+s])/2,v=h*n+l,g=Math.abs(y-o[v]);if(i[v]=Math.max(i[v],g),a<e){const t=(u+p>>1)*n+(c+d>>1),e=(f+p>>1)*n+(s+d>>1);i[v]=Math.max(i[v],i[t],i[e])}}}getMesh(t=0){const{gridSize:e,indices:r}=this.martini,{errors:n}=this;let o=0,i=0;const a=e-1;function c(a,u,s,f,l,h){const d=a+s>>1,p=u+f>>1;Math.abs(a-l)+Math.abs(u-h)>1&&n[p*e+d]>t?(c(l,h,a,u,d,p),c(s,f,l,h,d,p)):(r[u*e+a]=r[u*e+a]||++o,r[f*e+s]=r[f*e+s]||++o,r[h*e+l]=r[h*e+l]||++o,i++)}r.fill(0),c(0,0,a,a,a,0),c(a,a,0,0,0,a);const u=new Uint16Array(2*o),s=new Uint32Array(3*i);let f=0;function l(o,i,a,c,h,d){const p=o+a>>1,y=i+c>>1;if(Math.abs(o-h)+Math.abs(i-d)>1&&n[y*e+p]>t)l(h,d,o,i,p,y),l(a,c,h,d,p,y);else{const t=r[i*e+o]-1,n=r[c*e+a]-1,l=r[d*e+h]-1;u[2*t]=o,u[2*t+1]=i,u[2*n]=a,u[2*n+1]=c,u[2*l]=h,u[2*l+1]=d,s[f++]=t,s[f++]=n,s[f++]=l}}return l(0,0,a,a,a,0),l(a,a,0,0,0,a),{vertices:u,triangles:s}}}function d(t){if(!t||!t.POSITION)return null;var e=1/0,r=1/0,n=1/0,o=-1/0,i=-1/0,a=-1/0,c=t.POSITION.value,u=c&&c.length;if(!u)return null;for(var s=0;s<u;s+=3){var f=c[s],l=c[s+1],h=c[s+2];e=f<e?f:e,r=l<r?l:r,n=h<n?h:n,o=f>o?f:o,i=l>i?l:i,a=h>a?h:a}return[[e,r,n],[o,i,a]]}function p(t,e){if(null===t)return null;var r=e.meshMaxError,n=e.bounds,o=e.elevationDecoder,i=t.data,a=t.width,c=a+1,u=function(t,e,r){for(var n=r.rScaler,o=r.bScaler,i=r.gScaler,a=r.offset,c=e+1,u=new Float32Array(c*c),s=0,f=0;f<e;f++)for(var l=0;l<e;l++,s++){var h=4*s,d=t[h+0],p=t[h+1],y=t[h+2];u[s+f]=d*n+p*i+y*o+a}for(var v=c*(c-1),g=0;g<c-1;g++,v++)u[v]=u[v-c];for(var E=c-1,b=0;b<c;b++,E+=c)u[E]=u[E-1];return u}(i,a,o),s=new l(c).createTile(u).getMesh(r),h=s.vertices,p=s.triangles,y=function(t,e,r,n){for(var o=r+1,i=t.length/2,a=new Float32Array(3*i),c=new Float32Array(2*i),u=n||[0,0,r,r],s=f()(u,4),l=s[0],h=s[1],d=s[2],p=s[3],y=(d-l)/r,v=(p-h)/r,g=0;g<i;g++){var E=t[2*g],b=t[2*g+1],m=b*o+E;a[3*g+0]=E*y+l,a[3*g+1]=-b*v+p,a[3*g+2]=e[m],c[2*g+0]=E/r,c[2*g+1]=b/r}return{POSITION:{value:a,size:3},TEXCOORD_0:{value:c,size:2}}}(h,u,a,n);return{loaderData:{header:{}},header:{vertexCount:p.length,boundingBox:d(y)},mode:4,indices:{value:p,size:1},attributes:y}}function y(){return(y=u()(a.a.mark((function t(e,r,n){var o;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r.image=r.image||{},r.image.type="data",t.next=4,n.parse(e,r,r.baseUri);case 4:return o=t.sent,t.abrupt("return",p(o,r.terrain));case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function v(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 g(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?v(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var E={id:"terrain",name:"Terrain",version:"3.0.0-alpha.2",extensions:["png","pngraw"],mimeTypes:["image/png"],options:{terrain:{bounds:null,workerUrl:"https://unpkg.com/@loaders.gl/terrain@".concat("3.0.0-alpha.2","/dist/terrain-loader.worker.js"),meshMaxError:10,elevationDecoder:{rScaler:1,gScaler:0,bScaler:0,offset:0}}}},b=g(g({},E),{},{parse:function(t,e,r){return y.apply(this,arguments)}});function m(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return w(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 w(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,a=!0,c=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function w(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 O=new Map([["centerX",Float64Array.BYTES_PER_ELEMENT],["centerY",Float64Array.BYTES_PER_ELEMENT],["centerZ",Float64Array.BYTES_PER_ELEMENT],["minHeight",Float32Array.BYTES_PER_ELEMENT],["maxHeight",Float32Array.BYTES_PER_ELEMENT],["boundingSphereCenterX",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterY",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterZ",Float64Array.BYTES_PER_ELEMENT],["boundingSphereRadius",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointX",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointY",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointZ",Float64Array.BYTES_PER_ELEMENT]]);function x(t){return t>>1^-(1&t)}function P(t,e,r,n){var o,i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];if(o=2===n?new Uint16Array(t,e,r):new Uint32Array(t,e,r),!i)return o;for(var a=0,c=0;c<o.length;++c){var u=o[c];o[c]=a-u,0===u&&++a}return o}function S(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}var T=1,_=2,j=3,A=4,L={maxDecodingStep:A};function M(t,e){var r=Object.assign({},L,e),n=new DataView(t),o=function(t){var e,r=0,n={},o=m(O);try{for(o.s();!(e=o.n()).done;){var i=f()(e.value,2),a=i[0],c=i[1],u=8===c?t.getFloat64:t.getFloat32;n[a]=u.call(t,r,!0),r+=c}}catch(t){o.e(t)}finally{o.f()}return{header:n,headerEndPosition:r}}(n),i=o.header,a=o.headerEndPosition;if(r.maxDecodingStep<T)return{header:i};var c=function(t,e){var r=e,n=t.getUint32(r,!0),o=new Uint16Array(3*n);r+=Uint32Array.BYTES_PER_ELEMENT;for(var i=Uint16Array.BYTES_PER_ELEMENT,a=n*i,c=r,u=c+a,s=u+a,f=0,l=0,h=0,d=0;d<n;d++)f+=x(t.getUint16(c+i*d,!0)),l+=x(t.getUint16(u+i*d,!0)),h+=x(t.getUint16(s+i*d,!0)),o[d]=f,o[d+n]=l,o[d+2*n]=h;return{vertexData:o,vertexDataEndPosition:r+=3*a}}(n,a),u=c.vertexData,s=c.vertexDataEndPosition;if(r.maxDecodingStep<_)return{header:i,vertexData:u};var l=function(t,e,r){var n=r,o=e.length/3>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT;n%o!=0&&(n+=o-n%o);var i=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var a=3*i,c=P(t.buffer,n,a,o);return{triangleIndicesEndPosition:n+=a*o,triangleIndices:c}}(n,u,s),h=l.triangleIndices,d=l.triangleIndicesEndPosition;if(r.maxDecodingStep<j)return{header:i,vertexData:u,triangleIndices:h};var p=function(t,e,r){var n=r,o=e.length/3>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT,i=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var a=P(t.buffer,n,i,o,!1);n+=i*o;var c=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var u=P(t.buffer,n,c,o,!1);n+=c*o;var s=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var f=P(t.buffer,n,s,o,!1);n+=s*o;var l=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var h=P(t.buffer,n,l,o,!1);return{edgeIndicesEndPosition:n+=l*o,westIndices:a,southIndices:u,eastIndices:f,northIndices:h}}(n,u,d),y=p.westIndices,v=p.southIndices,g=p.eastIndices,E=p.northIndices,b=p.edgeIndicesEndPosition;return r.maxDecodingStep<A?{header:i,vertexData:u,triangleIndices:h,westIndices:y,northIndices:E,eastIndices:g,southIndices:v}:{header:i,vertexData:u,triangleIndices:h,westIndices:y,northIndices:E,eastIndices:g,southIndices:v,extensions:function(t,e){var r={};if(t.byteLength<=e)return{extensions:r,extensionsEndPosition:e};for(var n,o=e;o<t.byteLength;){var i=t.getUint8(o,!0);o+=Uint8Array.BYTES_PER_ELEMENT;var a=t.getUint32(o,!0);o+=Uint32Array.BYTES_PER_ELEMENT;var c=new DataView(t.buffer,o,a);switch(i){case 1:r.vertexNormals=(n=c,new Uint8Array(n.buffer,n.byteOffset,n.byteLength));break;case 2:r.waterMask=S(c)}o+=a}return{extensions:r,extensionsEndPosition:o}}(n,b).extensions}}function U(t,e){if(!t)return null;var r=e.bounds,n=M(t,_),o=n.header,i=n.vertexData,a=n.triangleIndices,c=function(t,e,r){for(var n=e.minHeight,o=e.maxHeight,i=r||[0,0,1,1],a=f()(i,4),c=a[0],u=a[1],s=a[2]-c,l=a[3]-u,h=o-n,d=t.length/3,p=new Float32Array(3*d),y=new Float32Array(2*d),v=0;v<d;v++){var g=t[v]/32767,E=t[v+d]/32767,b=t[v+2*d]/32767;p[3*v+0]=g*s+c,p[3*v+1]=E*l+u,p[3*v+2]=b*h+n,y[2*v+0]=g,y[2*v+1]=E}return{POSITION:{value:p,size:3},TEXCOORD_0:{value:y,size:2}}}(i,o,r);return{loaderData:{header:{}},header:{vertexCount:a.length,boundingBox:d(c)},mode:4,indices:{value:a,size:1},attributes:c}}function I(t,e){return U(t,e["quantized-mesh"])}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 D(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}var Y,R={id:"quantized-mesh",name:"Quantized Mesh",version:"3.0.0-alpha.2",extensions:["terrain"],mimeTypes:["application/vnd.quantized-mesh"],options:{"quantized-mesh":{workerUrl:"https://unpkg.com/@loaders.gl/terrain@".concat("3.0.0-alpha.2","/dist/quantized-mesh-loader.worker.js"),bounds:[0,0,1,1]}}},F=D(D({},R),{},{parseSync:I,parse:(Y=u()(a.a.mark((function t(e,r){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",I(e,r));case 1:case"end":return t.stop()}}),t)}))),function(t,e){return Y.apply(this,arguments)})});var k,B=(k=new Uint32Array([305419896]),!(18===new Uint8Array(k.buffer,k.byteOffset,k.byteLength)[0])),z={u1:Uint8Array,i1:Int8Array,u2:Uint16Array,i2:Int16Array,u4:Uint32Array,i4:Int32Array,f4:Float32Array,f8:Float64Array};function C(t,e){if(!t)return null;var r=function(t){var e,r=t.getUint8(6),n=8;r>=2?(e=t.getUint32(8,!0),n+=4):(e=t.getUint16(8,!0),n+=2);var o=new TextDecoder(r<=2?"latin1":"utf-8"),i=new Uint8Array(t.buffer,n,e),a=o.decode(i);return n+=e,{header:JSON.parse(a.replace(/'/g,'"').replace("False","false").replace("(","[").replace(/,*\),*/g,"]")),headerEndOffset:n}}(new DataView(t)),n=r.header,o=r.headerEndOffset,i=n.descr,a=z[i.slice(1,3)];if(!a)return console.warn("Decoding of npy dtype not implemented: ".concat(i)),null;var c=n.shape.reduce((function(t,e){return t*e}))*a.BYTES_PER_ELEMENT,u=new a(t.slice(o,o+c));return(">"===i[0]&&B||"<"===i[0]&&!B)&&console.warn("Data is wrong endianness, byte swapping not yet implemented."),{data:u,header:n}}function G(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 $(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?G(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):G(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var q={id:"npy",name:"NPY",version:"3.0.0-alpha.2",extensions:["npy"],mimeTypes:[],tests:[new Uint8Array([147,78,85,77,80,89]).buffer],options:{npy:{workerUrl:"https://unpkg.com/@loaders.gl/terrain@".concat("3.0.0-alpha.2","/dist/npy-loader.worker.js")}}},X=$($({},q),{},{parseSync:C,parse:function(){var t=u()(a.a.mark((function t(e,r){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",C(e));case 1:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}()})}])}));
!function(t,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r();else if("function"==typeof define&&define.amd)define([],r);else{var e=r();for(var n in e)("object"==typeof exports?exports:t)[n]=e[n]}}(window,(function(){return function(t){var r={};function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:n})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,r){if(1&r&&(t=e(t)),8&r)return t;if(4&r&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&r&&"string"!=typeof t)for(var o in t)e.d(n,o,function(r){return t[r]}.bind(null,o));return n},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},e.p="",e(e.s=5)}([function(t,r,e){var n=e(8),o=e(9),i=e(10),a=e(12);t.exports=function(t,r){return n(t)||o(t,r)||i(t,r)||a()}},function(t,r,e){t.exports=e(7)},function(t,r){t.exports=function(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}},function(t,r){function e(t,r,e,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void e(t)}c.done?r(u):Promise.resolve(u).then(n,o)}t.exports=function(t){return function(){var r=this,n=arguments;return new Promise((function(o,i){var a=t.apply(r,n);function c(t){e(a,o,i,c,u,"next",t)}function u(t){e(a,o,i,c,u,"throw",t)}c(void 0)}))}}},,function(t,r,e){(function(r){var n=e(13),o="undefined"==typeof window?r:window;o.loaders=o.loaders||{},t.exports=Object.assign(o.loaders,n)}).call(this,e(6))},function(t,r){var e;e=function(){return this}();try{e=e||new Function("return this")()}catch(t){"object"==typeof window&&(e=window)}t.exports=e},function(t,r,e){var n=function(t){"use strict";var r=Object.prototype,e=r.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{c({},"")}catch(t){c=function(t,r,e){return t[r]=e}}function u(t,r,e,n){var o=r&&r.prototype instanceof l?r:l,i=Object.create(o.prototype),a=new O(n||[]);return i._invoke=function(t,r,e){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 T()}for(e.method=o,e.arg=i;;){var a=e.delegate;if(a){var c=b(a,e);if(c){if(c===f)continue;return c}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if("suspendedStart"===n)throw n="completed",e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);n="executing";var u=s(t,r,e);if("normal"===u.type){if(n=e.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:e.done}}"throw"===u.type&&(n="completed",e.method="throw",e.arg=u.arg)}}}(t,e,a),i}function s(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f={};function l(){}function h(){}function d(){}var p={};p[o]=function(){return this};var y=Object.getPrototypeOf,v=y&&y(y(S([])));v&&v!==r&&e.call(v,o)&&(p=v);var g=d.prototype=l.prototype=Object.create(p);function E(t){["next","throw","return"].forEach((function(r){c(t,r,(function(t){return this._invoke(r,t)}))}))}function m(t,r){var n;this._invoke=function(o,i){function a(){return new r((function(n,a){!function n(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var f=u.arg,l=f.value;return l&&"object"==typeof l&&e.call(l,"__await")?r.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):r.resolve(l).then((function(t){f.value=t,a(f)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function b(t,r){var e=t.iterator[r.method];if(void 0===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=void 0,b(t,r),"throw"===r.method))return f;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=s(e,t.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,f;var o=n.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,f):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,f)}function w(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function x(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function S(t){if(t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function r(){for(;++n<t.length;)if(e.call(t,n))return r.value=t[n],r.done=!1,r;return r.value=void 0,r.done=!0,r};return i.next=i}}return{next:T}}function T(){return{value:void 0,done:!0}}return h.prototype=g.constructor=d,d.constructor=h,h.displayName=c(d,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===h||"GeneratorFunction"===(r.displayName||r.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},E(m.prototype),m.prototype[i]=function(){return this},t.AsyncIterator=m,t.async=function(r,e,n,o,i){void 0===i&&(i=Promise);var a=new m(u(r,e,n,o),i);return t.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(g),c(g,a,"Generator"),g[o]=function(){return this},g.toString=function(){return"[object Generator]"},t.keys=function(t){var r=[];for(var e in t)r.push(e);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=S,O.prototype={constructor:O,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(x),!t)for(var r in this)"t"===r.charAt(0)&&e.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=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 r=this;function n(e,n){return a.type="throw",a.arg=t,r.next=e,n&&(r.method="next",r.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=e.call(i,"catchLoc"),u=e.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){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,r){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&e.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=r&&r<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=r,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,r){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&&r&&(this.next=r),f},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),x(e),f}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;x(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,e){return this.delegate={iterator:S(t),resultName:r,nextLoc:e},"next"===this.method&&(this.arg=void 0),f}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,r){t.exports=function(t){if(Array.isArray(t))return t}},function(t,r){t.exports=function(t,r){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var e=[],n=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(n=(a=c.next()).done)&&(e.push(a.value),!r||e.length!==r);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==c.return||c.return()}finally{if(o)throw i}}return e}}},function(t,r,e){var n=e(11);t.exports=function(t,r){if(t){if("string"==typeof t)return n(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?n(t,r):void 0}}},function(t,r){t.exports=function(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}},function(t,r){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.")}},function(t,r,e){"use strict";e.r(r),e.d(r,"TerrainLoader",(function(){return m})),e.d(r,"TerrainWorkerLoader",(function(){return E})),e.d(r,"QuantizedMeshLoader",(function(){return B})),e.d(r,"QuantizedMeshWorkerLoader",(function(){return Y}));var n=e(2),o=e.n(n),i=e(1),a=e.n(i),c=e(3),u=e.n(c),s=e(0),f=e.n(s);class l{constructor(t=257){this.gridSize=t;const r=t-1;if(r&r-1)throw new Error(`Expected grid size to be 2^n+1, got ${t}.`);this.numTriangles=r*r*2-2,this.numParentTriangles=this.numTriangles-r*r,this.indices=new Uint32Array(this.gridSize*this.gridSize),this.coords=new Uint16Array(4*this.numTriangles);for(let t=0;t<this.numTriangles;t++){let e=t+2,n=0,o=0,i=0,a=0,c=0,u=0;for(1&e?i=a=c=r:n=o=u=r;(e>>=1)>1;){const t=n+i>>1,r=o+a>>1;1&e?(i=n,a=o,n=c,o=u):(n=i,o=a,i=c,a=u),c=t,u=r}const s=4*t;this.coords[s+0]=n,this.coords[s+1]=o,this.coords[s+2]=i,this.coords[s+3]=a}}createTile(t){return new h(t,this)}}class h{constructor(t,r){const e=r.gridSize;if(t.length!==e*e)throw new Error(`Expected terrain data of length ${e*e} (${e} x ${e}), got ${t.length}.`);this.terrain=t,this.martini=r,this.errors=new Float32Array(t.length),this.update()}update(){const{numTriangles:t,numParentTriangles:r,coords:e,gridSize:n}=this.martini,{terrain:o,errors:i}=this;for(let a=t-1;a>=0;a--){const t=4*a,c=e[t+0],u=e[t+1],s=e[t+2],f=e[t+3],l=c+s>>1,h=u+f>>1,d=l+h-u,p=h+c-l,y=(o[u*n+c]+o[f*n+s])/2,v=h*n+l,g=Math.abs(y-o[v]);if(i[v]=Math.max(i[v],g),a<r){const t=(u+p>>1)*n+(c+d>>1),r=(f+p>>1)*n+(s+d>>1);i[v]=Math.max(i[v],i[t],i[r])}}}getMesh(t=0){const{gridSize:r,indices:e}=this.martini,{errors:n}=this;let o=0,i=0;const a=r-1;function c(a,u,s,f,l,h){const d=a+s>>1,p=u+f>>1;Math.abs(a-l)+Math.abs(u-h)>1&&n[p*r+d]>t?(c(l,h,a,u,d,p),c(s,f,l,h,d,p)):(e[u*r+a]=e[u*r+a]||++o,e[f*r+s]=e[f*r+s]||++o,e[h*r+l]=e[h*r+l]||++o,i++)}e.fill(0),c(0,0,a,a,a,0),c(a,a,0,0,0,a);const u=new Uint16Array(2*o),s=new Uint32Array(3*i);let f=0;function l(o,i,a,c,h,d){const p=o+a>>1,y=i+c>>1;if(Math.abs(o-h)+Math.abs(i-d)>1&&n[y*r+p]>t)l(h,d,o,i,p,y),l(a,c,h,d,p,y);else{const t=e[i*r+o]-1,n=e[c*r+a]-1,l=e[d*r+h]-1;u[2*t]=o,u[2*t+1]=i,u[2*n]=a,u[2*n+1]=c,u[2*l]=h,u[2*l+1]=d,s[f++]=t,s[f++]=n,s[f++]=l}}return l(0,0,a,a,a,0),l(a,a,0,0,0,a),{vertices:u,triangles:s}}}function d(t){if(!t||!t.POSITION)return null;var r=1/0,e=1/0,n=1/0,o=-1/0,i=-1/0,a=-1/0,c=t.POSITION.value,u=c&&c.length;if(!u)return null;for(var s=0;s<u;s+=3){var f=c[s],l=c[s+1],h=c[s+2];r=f<r?f:r,e=l<e?l:e,n=h<n?h:n,o=f>o?f:o,i=l>i?l:i,a=h>a?h:a}return[[r,e,n],[o,i,a]]}function p(t,r){if(null===t)return null;var e=r.meshMaxError,n=r.bounds,o=r.elevationDecoder,i=t.data,a=t.width,c=a+1,u=function(t,r,e){for(var n=e.rScaler,o=e.bScaler,i=e.gScaler,a=e.offset,c=r+1,u=new Float32Array(c*c),s=0,f=0;f<r;f++)for(var l=0;l<r;l++,s++){var h=4*s,d=t[h+0],p=t[h+1],y=t[h+2];u[s+f]=d*n+p*i+y*o+a}for(var v=c*(c-1),g=0;g<c-1;g++,v++)u[v]=u[v-c];for(var E=c-1,m=0;m<c;m++,E+=c)u[E]=u[E-1];return u}(i,a,o),s=new l(c).createTile(u).getMesh(e),h=s.vertices,p=s.triangles,y=function(t,r,e,n){for(var o=e+1,i=t.length/2,a=new Float32Array(3*i),c=new Float32Array(2*i),u=n||[0,0,e,e],s=f()(u,4),l=s[0],h=s[1],d=s[2],p=s[3],y=(d-l)/e,v=(p-h)/e,g=0;g<i;g++){var E=t[2*g],m=t[2*g+1],b=m*o+E;a[3*g+0]=E*y+l,a[3*g+1]=-m*v+p,a[3*g+2]=r[b],c[2*g+0]=E/e,c[2*g+1]=m/e}return{POSITION:{value:a,size:3},TEXCOORD_0:{value:c,size:2}}}(h,u,a,n);return{loaderData:{header:{}},header:{vertexCount:p.length,boundingBox:d(y)},mode:4,indices:{value:p,size:1},attributes:y}}function y(){return(y=u()(a.a.mark((function t(r,e,n){var o;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.image=e.image||{},e.image.type="data",t.next=4,n.parse(r,e,e.baseUri);case 4:return o=t.sent,t.abrupt("return",p(o,e.terrain));case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function v(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function g(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?v(Object(e),!0).forEach((function(r){o()(t,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):v(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}))}return t}var E={id:"terrain",name:"Terrain",version:"3.0.0-alpha.3",extensions:["png","pngraw"],mimeTypes:["image/png"],options:{terrain:{bounds:null,workerUrl:"https://unpkg.com/@loaders.gl/terrain@".concat("3.0.0-alpha.3","/dist/terrain-loader.worker.js"),meshMaxError:10,elevationDecoder:{rScaler:1,gScaler:0,bScaler:0,offset:0}}}},m=g(g({},E),{},{parse:function(t,r,e){return y.apply(this,arguments)}});function b(t,r){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=function(t,r){if(!t)return;if("string"==typeof t)return w(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return w(t,r)}(t))||r&&t&&"number"==typeof t.length){e&&(t=e);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,a=!0,c=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==e.return||e.return()}finally{if(c)throw i}}}}function w(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var x=new Map([["centerX",Float64Array.BYTES_PER_ELEMENT],["centerY",Float64Array.BYTES_PER_ELEMENT],["centerZ",Float64Array.BYTES_PER_ELEMENT],["minHeight",Float32Array.BYTES_PER_ELEMENT],["maxHeight",Float32Array.BYTES_PER_ELEMENT],["boundingSphereCenterX",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterY",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterZ",Float64Array.BYTES_PER_ELEMENT],["boundingSphereRadius",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointX",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointY",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointZ",Float64Array.BYTES_PER_ELEMENT]]);function O(t){return t>>1^-(1&t)}function S(t,r,e,n){var o,i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];if(o=2===n?new Uint16Array(t,r,e):new Uint32Array(t,r,e),!i)return o;for(var a=0,c=0;c<o.length;++c){var u=o[c];o[c]=a-u,0===u&&++a}return o}function T(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}var P=1,_=2,L=3,j=4,A={maxDecodingStep:j};function M(t,r){var e=Object.assign({},A,r),n=new DataView(t),o=function(t){var r,e=0,n={},o=b(x);try{for(o.s();!(r=o.n()).done;){var i=f()(r.value,2),a=i[0],c=i[1],u=8===c?t.getFloat64:t.getFloat32;n[a]=u.call(t,e,!0),e+=c}}catch(t){o.e(t)}finally{o.f()}return{header:n,headerEndPosition:e}}(n),i=o.header,a=o.headerEndPosition;if(e.maxDecodingStep<P)return{header:i};var c=function(t,r){var e=r,n=t.getUint32(e,!0),o=new Uint16Array(3*n);e+=Uint32Array.BYTES_PER_ELEMENT;for(var i=Uint16Array.BYTES_PER_ELEMENT,a=n*i,c=e,u=c+a,s=u+a,f=0,l=0,h=0,d=0;d<n;d++)f+=O(t.getUint16(c+i*d,!0)),l+=O(t.getUint16(u+i*d,!0)),h+=O(t.getUint16(s+i*d,!0)),o[d]=f,o[d+n]=l,o[d+2*n]=h;return{vertexData:o,vertexDataEndPosition:e+=3*a}}(n,a),u=c.vertexData,s=c.vertexDataEndPosition;if(e.maxDecodingStep<_)return{header:i,vertexData:u};var l=function(t,r,e){var n=e,o=r.length/3>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT;n%o!=0&&(n+=o-n%o);var i=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var a=3*i,c=S(t.buffer,n,a,o);return{triangleIndicesEndPosition:n+=a*o,triangleIndices:c}}(n,u,s),h=l.triangleIndices,d=l.triangleIndicesEndPosition;if(e.maxDecodingStep<L)return{header:i,vertexData:u,triangleIndices:h};var p=function(t,r,e){var n=e,o=r.length/3>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT,i=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var a=S(t.buffer,n,i,o,!1);n+=i*o;var c=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var u=S(t.buffer,n,c,o,!1);n+=c*o;var s=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var f=S(t.buffer,n,s,o,!1);n+=s*o;var l=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var h=S(t.buffer,n,l,o,!1);return{edgeIndicesEndPosition:n+=l*o,westIndices:a,southIndices:u,eastIndices:f,northIndices:h}}(n,u,d),y=p.westIndices,v=p.southIndices,g=p.eastIndices,E=p.northIndices,m=p.edgeIndicesEndPosition;return e.maxDecodingStep<j?{header:i,vertexData:u,triangleIndices:h,westIndices:y,northIndices:E,eastIndices:g,southIndices:v}:{header:i,vertexData:u,triangleIndices:h,westIndices:y,northIndices:E,eastIndices:g,southIndices:v,extensions:function(t,r){var e={};if(t.byteLength<=r)return{extensions:e,extensionsEndPosition:r};for(var n,o=r;o<t.byteLength;){var i=t.getUint8(o,!0);o+=Uint8Array.BYTES_PER_ELEMENT;var a=t.getUint32(o,!0);o+=Uint32Array.BYTES_PER_ELEMENT;var c=new DataView(t.buffer,o,a);switch(i){case 1:e.vertexNormals=(n=c,new Uint8Array(n.buffer,n.byteOffset,n.byteLength));break;case 2:e.waterMask=T(c)}o+=a}return{extensions:e,extensionsEndPosition:o}}(n,m).extensions}}function I(t,r){if(!t)return null;var e=r.bounds,n=M(t,_),o=n.header,i=n.vertexData,a=n.triangleIndices,c=function(t,r,e){for(var n=r.minHeight,o=r.maxHeight,i=e||[0,0,1,1],a=f()(i,4),c=a[0],u=a[1],s=a[2]-c,l=a[3]-u,h=o-n,d=t.length/3,p=new Float32Array(3*d),y=new Float32Array(2*d),v=0;v<d;v++){var g=t[v]/32767,E=t[v+d]/32767,m=t[v+2*d]/32767;p[3*v+0]=g*s+c,p[3*v+1]=E*l+u,p[3*v+2]=m*h+n,y[2*v+0]=g,y[2*v+1]=E}return{POSITION:{value:p,size:3},TEXCOORD_0:{value:y,size:2}}}(i,o,e);return{loaderData:{header:{}},header:{vertexCount:a.length,boundingBox:d(c)},mode:4,indices:{value:a,size:1},attributes:c}}function N(t,r){return I(t,r["quantized-mesh"])}function U(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function D(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?U(Object(e),!0).forEach((function(r){o()(t,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):U(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}))}return t}var R,Y={id:"quantized-mesh",name:"Quantized Mesh",version:"3.0.0-alpha.3",extensions:["terrain"],mimeTypes:["application/vnd.quantized-mesh"],options:{"quantized-mesh":{workerUrl:"https://unpkg.com/@loaders.gl/terrain@".concat("3.0.0-alpha.3","/dist/quantized-mesh-loader.worker.js"),bounds:[0,0,1,1]}}},B=D(D({},Y),{},{parseSync:N,parse:(R=u()(a.a.mark((function t(r,e){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",N(r,e));case 1:case"end":return t.stop()}}),t)}))),function(t,r){return R.apply(this,arguments)})})}])}));

@@ -30,14 +30,2 @@ "use strict";

});
Object.defineProperty(exports, "_NPYLoader", {
enumerable: true,
get: function get() {
return _npyLoader.NPYLoader;
}
});
Object.defineProperty(exports, "_NPYWorkerLoader", {
enumerable: true,
get: function get() {
return _npyLoader.NPYWorkerLoader;
}
});

@@ -47,4 +35,2 @@ var _terrainLoader = require("./terrain-loader");

var _quantizedMeshLoader = require("./quantized-mesh-loader");
var _npyLoader = require("./npy-loader");
//# sourceMappingURL=index.js.map

@@ -22,3 +22,3 @@ "use strict";

var VERSION = typeof "3.0.0-alpha.2" !== 'undefined' ? "3.0.0-alpha.2" : 'latest';
var VERSION = typeof "3.0.0-alpha.3" !== 'undefined' ? "3.0.0-alpha.3" : 'latest';
var QuantizedMeshWorkerLoader = {

@@ -25,0 +25,0 @@ id: 'quantized-mesh',

@@ -18,3 +18,3 @@ "use strict";

var VERSION = typeof "3.0.0-alpha.2" !== 'undefined' ? "3.0.0-alpha.2" : 'latest';
var VERSION = typeof "3.0.0-alpha.3" !== 'undefined' ? "3.0.0-alpha.3" : 'latest';
var TerrainWorkerLoader = {

@@ -21,0 +21,0 @@ id: 'terrain',

export { TerrainLoader, TerrainWorkerLoader } from './terrain-loader';
export { QuantizedMeshLoader, QuantizedMeshWorkerLoader } from './quantized-mesh-loader';
export { NPYLoader as _NPYLoader, NPYWorkerLoader as _NPYWorkerLoader } from './npy-loader';
//# sourceMappingURL=index.js.map
import parseQuantizedMesh from './lib/parse-quantized-mesh';
const VERSION = typeof "3.0.0-alpha.2" !== 'undefined' ? "3.0.0-alpha.2" : 'latest';
const VERSION = typeof "3.0.0-alpha.3" !== 'undefined' ? "3.0.0-alpha.3" : 'latest';
export const QuantizedMeshWorkerLoader = {

@@ -4,0 +4,0 @@ id: 'quantized-mesh',

import loadTerrain from './lib/parse-terrain';
const VERSION = typeof "3.0.0-alpha.2" !== 'undefined' ? "3.0.0-alpha.2" : 'latest';
const VERSION = typeof "3.0.0-alpha.3" !== 'undefined' ? "3.0.0-alpha.3" : 'latest';
export const TerrainWorkerLoader = {

@@ -4,0 +4,0 @@ id: 'terrain',

export { TerrainLoader, TerrainWorkerLoader } from './terrain-loader';
export { QuantizedMeshLoader, QuantizedMeshWorkerLoader } from './quantized-mesh-loader';
export { NPYLoader as _NPYLoader, NPYWorkerLoader as _NPYWorkerLoader } from './npy-loader';
//# sourceMappingURL=index.js.map

@@ -10,3 +10,3 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";

import parseQuantizedMesh from './lib/parse-quantized-mesh';
var VERSION = typeof "3.0.0-alpha.2" !== 'undefined' ? "3.0.0-alpha.2" : 'latest';
var VERSION = typeof "3.0.0-alpha.3" !== 'undefined' ? "3.0.0-alpha.3" : 'latest';
export var QuantizedMeshWorkerLoader = {

@@ -13,0 +13,0 @@ id: 'quantized-mesh',

@@ -8,3 +8,3 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";

import loadTerrain from './lib/parse-terrain';
var VERSION = typeof "3.0.0-alpha.2" !== 'undefined' ? "3.0.0-alpha.2" : 'latest';
var VERSION = typeof "3.0.0-alpha.3" !== 'undefined' ? "3.0.0-alpha.3" : 'latest';
export var TerrainWorkerLoader = {

@@ -11,0 +11,0 @@ id: 'terrain',

@@ -1,1 +0,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=12)}([function(t,e,r){t.exports=r(6)},function(t,e){function r(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(o,i){var a=t.apply(e,n);function u(t){r(a,o,i,u,c,"next",t)}function c(t){r(a,o,i,u,c,"throw",t)}u(void 0)}))}}},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}},function(t,e,r){var n=r(7),o=r(8),i=r(9),a=r(11);t.exports=function(t,e){return n(t)||o(t,e)||i(t,e)||a()}},function(t,e){function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=r=function(t){return typeof t}:t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(e)}t.exports=r},,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",a=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof l?e:l,i=Object.create(o.prototype),a=new O(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 P()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=m(a,r);if(u){if(u===f)continue;return u}}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 c=s(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(t,r,a),i}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function l(){}function p(){}function d(){}var h={};h[o]=function(){return this};var y=Object.getPrototypeOf,v=y&&y(y(S([])));v&&v!==e&&r.call(v,o)&&(h=v);var g=d.prototype=l.prototype=Object.create(h);function E(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){var n;this._invoke=function(o,i){function a(){return new e((function(n,a){!function n(o,i,a,u){var c=s(t[o],t,i);if("throw"!==c.type){var f=c.arg,l=f.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(l).then((function(t){f.value=t,a(f)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function m(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,m(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;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,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function w(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 x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function S(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:P}}function P(){return{value:void 0,done:!0}}return p.prototype=g.constructor=d,d.constructor=p,p.displayName=u(d,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,u(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},E(b.prototype),b.prototype[i]=function(){return this},t.AsyncIterator=b,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new b(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(g),u(g,a,"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=S,O.prototype={constructor:O,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(x),!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 a.type="throw",a.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],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)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 a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},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),f},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),x(r),f}},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;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:S(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var r=[],n=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}}},function(t,e,r){var n=r(10);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}}},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}},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.")}},function(t,e,r){"use strict";r.r(e);var n=r(0),o=r.n(n),i=r(1),a=r.n(i),u=r(2),c=r.n(u),s=r(3),f=r.n(s);function l(t){if(!t||!t.POSITION)return null;var e=1/0,r=1/0,n=1/0,o=-1/0,i=-1/0,a=-1/0,u=t.POSITION.value,c=u&&u.length;if(!c)return null;for(var s=0;s<c;s+=3){var f=u[s],l=u[s+1],p=u[s+2];e=f<e?f:e,r=l<r?l:r,n=p<n?p:n,o=f>o?f:o,i=l>i?l:i,a=p>a?p:a}return[[e,r,n],[o,i,a]]}function p(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return d(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 d(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,a=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function d(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 h=new Map([["centerX",Float64Array.BYTES_PER_ELEMENT],["centerY",Float64Array.BYTES_PER_ELEMENT],["centerZ",Float64Array.BYTES_PER_ELEMENT],["minHeight",Float32Array.BYTES_PER_ELEMENT],["maxHeight",Float32Array.BYTES_PER_ELEMENT],["boundingSphereCenterX",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterY",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterZ",Float64Array.BYTES_PER_ELEMENT],["boundingSphereRadius",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointX",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointY",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointZ",Float64Array.BYTES_PER_ELEMENT]]);function y(t){return t>>1^-(1&t)}function v(t,e,r,n){var o,i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];if(o=2===n?new Uint16Array(t,e,r):new Uint32Array(t,e,r),!i)return o;for(var a=0,u=0;u<o.length;++u){var c=o[u];o[u]=a-c,0===c&&++a}return o}function g(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}var E=1,b=2,m=3,w=4,x={maxDecodingStep:w};function O(t,e){var r=Object.assign({},x,e),n=new DataView(t),o=function(t){var e,r=0,n={},o=p(h);try{for(o.s();!(e=o.n()).done;){var i=f()(e.value,2),a=i[0],u=i[1],c=8===u?t.getFloat64:t.getFloat32;n[a]=c.call(t,r,!0),r+=u}}catch(t){o.e(t)}finally{o.f()}return{header:n,headerEndPosition:r}}(n),i=o.header,a=o.headerEndPosition;if(r.maxDecodingStep<E)return{header:i};var u=function(t,e){var r=e,n=t.getUint32(r,!0),o=new Uint16Array(3*n);r+=Uint32Array.BYTES_PER_ELEMENT;for(var i=Uint16Array.BYTES_PER_ELEMENT,a=n*i,u=r,c=u+a,s=c+a,f=0,l=0,p=0,d=0;d<n;d++)f+=y(t.getUint16(u+i*d,!0)),l+=y(t.getUint16(c+i*d,!0)),p+=y(t.getUint16(s+i*d,!0)),o[d]=f,o[d+n]=l,o[d+2*n]=p;return{vertexData:o,vertexDataEndPosition:r+=3*a}}(n,a),c=u.vertexData,s=u.vertexDataEndPosition;if(r.maxDecodingStep<b)return{header:i,vertexData:c};var l=function(t,e,r){var n=r,o=e.length/3>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT;n%o!=0&&(n+=o-n%o);var i=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var a=3*i,u=v(t.buffer,n,a,o);return{triangleIndicesEndPosition:n+=a*o,triangleIndices:u}}(n,c,s),d=l.triangleIndices,O=l.triangleIndicesEndPosition;if(r.maxDecodingStep<m)return{header:i,vertexData:c,triangleIndices:d};var S=function(t,e,r){var n=r,o=e.length/3>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT,i=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var a=v(t.buffer,n,i,o,!1);n+=i*o;var u=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var c=v(t.buffer,n,u,o,!1);n+=u*o;var s=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var f=v(t.buffer,n,s,o,!1);n+=s*o;var l=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var p=v(t.buffer,n,l,o,!1);return{edgeIndicesEndPosition:n+=l*o,westIndices:a,southIndices:c,eastIndices:f,northIndices:p}}(n,c,O),P=S.westIndices,_=S.southIndices,T=S.eastIndices,L=S.northIndices,j=S.edgeIndicesEndPosition;return r.maxDecodingStep<w?{header:i,vertexData:c,triangleIndices:d,westIndices:P,northIndices:L,eastIndices:T,southIndices:_}:{header:i,vertexData:c,triangleIndices:d,westIndices:P,northIndices:L,eastIndices:T,southIndices:_,extensions:function(t,e){var r={};if(t.byteLength<=e)return{extensions:r,extensionsEndPosition:e};for(var n,o=e;o<t.byteLength;){var i=t.getUint8(o,!0);o+=Uint8Array.BYTES_PER_ELEMENT;var a=t.getUint32(o,!0);o+=Uint32Array.BYTES_PER_ELEMENT;var u=new DataView(t.buffer,o,a);switch(i){case 1:r.vertexNormals=(n=u,new Uint8Array(n.buffer,n.byteOffset,n.byteLength));break;case 2:r.waterMask=g(u)}o+=a}return{extensions:r,extensionsEndPosition:o}}(n,j).extensions}}function S(t,e){if(!t)return null;var r=e.bounds,n=O(t,b),o=n.header,i=n.vertexData,a=n.triangleIndices,u=function(t,e,r){for(var n=e.minHeight,o=e.maxHeight,i=r||[0,0,1,1],a=f()(i,4),u=a[0],c=a[1],s=a[2]-u,l=a[3]-c,p=o-n,d=t.length/3,h=new Float32Array(3*d),y=new Float32Array(2*d),v=0;v<d;v++){var g=t[v]/32767,E=t[v+d]/32767,b=t[v+2*d]/32767;h[3*v+0]=g*s+u,h[3*v+1]=E*l+c,h[3*v+2]=b*p+n,y[2*v+0]=g,y[2*v+1]=E}return{POSITION:{value:h,size:3},TEXCOORD_0:{value:y,size:2}}}(i,o,r);return{loaderData:{header:{}},header:{vertexCount:a.length,boundingBox:l(u)},mode:4,indices:{value:a,size:1},attributes:u}}function P(t,e){return S(t,e["quantized-mesh"])}function _(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 T(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?_(Object(r),!0).forEach((function(e){c()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var L,j=T(T({},{id:"quantized-mesh",name:"Quantized Mesh",version:"3.0.0-alpha.2",extensions:["terrain"],mimeTypes:["application/vnd.quantized-mesh"],options:{"quantized-mesh":{workerUrl:"https://unpkg.com/@loaders.gl/terrain@".concat("3.0.0-alpha.2","/dist/quantized-mesh-loader.worker.js"),bounds:[0,0,1,1]}}}),{},{parseSync:P,parse:(L=a()(o.a.mark((function t(e,r){return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",P(e,r));case 1:case"end":return t.stop()}}),t)}))),function(t,e){return L.apply(this,arguments)})}),A=r(4),I=r.n(A);function M(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2?arguments[2]:void 0,n=r||new Set;if(t){if(N(t))n.add(t);else if(N(t.buffer))n.add(t.buffer);else if(ArrayBuffer.isView(t));else if(e&&"object"===I()(t))for(var o in t)M(t[o],e,n)}else;return void 0===r?Array.from(n):[]}function N(t){return!!t&&(t instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&t instanceof MessagePort||("undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas)))}function U(t,e){if(!t)throw new Error(e||"loader assertion failed.")}function B(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"3.0.0-alpha.2";U(t,"no loader provided");var r=t.version;e&&r&&(e=Y(e),r=Y(r))}function Y(t){var e=t.split(".").map(Number);return{major:e[0],minor:e[1]}}function R(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 D(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?R(Object(r),!0).forEach((function(e){c()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function k(t){return F.apply(this,arguments)}function F(){return(F=a()(o.a.mark((function t(e){var r,n,i,a,u,c,s;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.loader,n=e.arraybuffer,e.byteOffset,e.byteLength,i=e.options,a=e.context,!r.parseSync&&!r.parse){t.next=6;break}u=n,c=r.parseSync||r.parse,t.next=13;break;case 6:if(!r.parseTextSync){t.next=12;break}s=new TextDecoder,u=s.decode(n),c=r.parseTextSync,t.next=13;break;case 12:throw new Error("Could not load data with ".concat(r.name," loader"));case 13:return i=D(D({},i),{},{modules:r&&r.options&&r.options.modules||{},worker:!1}),t.next=16,c(u,D({},i),a,r);case 16:return t.abrupt("return",t.sent);case 17:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function z(t,e){return t&&"parse"===t.type&&t.source&&t.source.startsWith("loaders.gl")}!function(t){if("undefined"!=typeof self){var e=0,r=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return new Promise((function(o,i){var a=e++;self.addEventListener("message",(function t(e){var r=e.data;if(r&&r.id===a)switch(r.type){case"parse-done":self.removeEventListener("message",t),o(r.result);break;case"parse-error":self.removeEventListener("message",t),i(r.message)}})),self.postMessage({type:"parse",id:a,arraybuffer:t,options:r,url:n},[t])}))};self.onmessage=function(){var e=a()(o.a.mark((function e(n){var i,a,u,c,s,f,l,p,d,h;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=n.data,e.prev=1,z(i,t.name)){e.next=4;break}return e.abrupt("return");case 4:return B(t,i.source.split("@")[1]),a=i.arraybuffer,u=i.byteOffset,c=void 0===u?0:u,s=i.byteLength,f=void 0===s?0:s,l=i.options,p=void 0===l?{}:l,e.next=8,k({loader:t,arraybuffer:a,byteOffset:c,byteLength:f,options:p,context:{parse:r}});case 8:d=e.sent,h=M(d),self.postMessage({type:"done",result:d},h),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),self.postMessage({type:"error",message:e.t0.message});case 16:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t){return e.apply(this,arguments)}}()}}(j)}]);
!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=12)}([function(t,e,r){t.exports=r(6)},function(t,e){function r(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(o,i){var a=t.apply(e,n);function u(t){r(a,o,i,u,c,"next",t)}function c(t){r(a,o,i,u,c,"throw",t)}u(void 0)}))}}},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}},function(t,e,r){var n=r(7),o=r(8),i=r(9),a=r(11);t.exports=function(t,e){return n(t)||o(t,e)||i(t,e)||a()}},function(t,e){function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=r=function(t){return typeof t}:t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(e)}t.exports=r},,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",a=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof l?e:l,i=Object.create(o.prototype),a=new O(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 P()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=m(a,r);if(u){if(u===f)continue;return u}}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 c=s(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(t,r,a),i}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function l(){}function p(){}function d(){}var h={};h[o]=function(){return this};var y=Object.getPrototypeOf,v=y&&y(y(S([])));v&&v!==e&&r.call(v,o)&&(h=v);var g=d.prototype=l.prototype=Object.create(h);function E(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){var n;this._invoke=function(o,i){function a(){return new e((function(n,a){!function n(o,i,a,u){var c=s(t[o],t,i);if("throw"!==c.type){var f=c.arg,l=f.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(l).then((function(t){f.value=t,a(f)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function m(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,m(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;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,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function w(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 x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function S(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:P}}function P(){return{value:void 0,done:!0}}return p.prototype=g.constructor=d,d.constructor=p,p.displayName=u(d,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,u(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},E(b.prototype),b.prototype[i]=function(){return this},t.AsyncIterator=b,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new b(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(g),u(g,a,"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=S,O.prototype={constructor:O,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(x),!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 a.type="throw",a.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],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)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 a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},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),f},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),x(r),f}},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;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:S(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var r=[],n=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}}},function(t,e,r){var n=r(10);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}}},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}},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.")}},function(t,e,r){"use strict";r.r(e);var n=r(0),o=r.n(n),i=r(1),a=r.n(i),u=r(2),c=r.n(u),s=r(3),f=r.n(s);function l(t){if(!t||!t.POSITION)return null;var e=1/0,r=1/0,n=1/0,o=-1/0,i=-1/0,a=-1/0,u=t.POSITION.value,c=u&&u.length;if(!c)return null;for(var s=0;s<c;s+=3){var f=u[s],l=u[s+1],p=u[s+2];e=f<e?f:e,r=l<r?l:r,n=p<n?p:n,o=f>o?f:o,i=l>i?l:i,a=p>a?p:a}return[[e,r,n],[o,i,a]]}function p(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return d(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 d(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,a=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function d(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 h=new Map([["centerX",Float64Array.BYTES_PER_ELEMENT],["centerY",Float64Array.BYTES_PER_ELEMENT],["centerZ",Float64Array.BYTES_PER_ELEMENT],["minHeight",Float32Array.BYTES_PER_ELEMENT],["maxHeight",Float32Array.BYTES_PER_ELEMENT],["boundingSphereCenterX",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterY",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterZ",Float64Array.BYTES_PER_ELEMENT],["boundingSphereRadius",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointX",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointY",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointZ",Float64Array.BYTES_PER_ELEMENT]]);function y(t){return t>>1^-(1&t)}function v(t,e,r,n){var o,i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];if(o=2===n?new Uint16Array(t,e,r):new Uint32Array(t,e,r),!i)return o;for(var a=0,u=0;u<o.length;++u){var c=o[u];o[u]=a-c,0===c&&++a}return o}function g(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}var E=1,b=2,m=3,w=4,x={maxDecodingStep:w};function O(t,e){var r=Object.assign({},x,e),n=new DataView(t),o=function(t){var e,r=0,n={},o=p(h);try{for(o.s();!(e=o.n()).done;){var i=f()(e.value,2),a=i[0],u=i[1],c=8===u?t.getFloat64:t.getFloat32;n[a]=c.call(t,r,!0),r+=u}}catch(t){o.e(t)}finally{o.f()}return{header:n,headerEndPosition:r}}(n),i=o.header,a=o.headerEndPosition;if(r.maxDecodingStep<E)return{header:i};var u=function(t,e){var r=e,n=t.getUint32(r,!0),o=new Uint16Array(3*n);r+=Uint32Array.BYTES_PER_ELEMENT;for(var i=Uint16Array.BYTES_PER_ELEMENT,a=n*i,u=r,c=u+a,s=c+a,f=0,l=0,p=0,d=0;d<n;d++)f+=y(t.getUint16(u+i*d,!0)),l+=y(t.getUint16(c+i*d,!0)),p+=y(t.getUint16(s+i*d,!0)),o[d]=f,o[d+n]=l,o[d+2*n]=p;return{vertexData:o,vertexDataEndPosition:r+=3*a}}(n,a),c=u.vertexData,s=u.vertexDataEndPosition;if(r.maxDecodingStep<b)return{header:i,vertexData:c};var l=function(t,e,r){var n=r,o=e.length/3>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT;n%o!=0&&(n+=o-n%o);var i=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var a=3*i,u=v(t.buffer,n,a,o);return{triangleIndicesEndPosition:n+=a*o,triangleIndices:u}}(n,c,s),d=l.triangleIndices,O=l.triangleIndicesEndPosition;if(r.maxDecodingStep<m)return{header:i,vertexData:c,triangleIndices:d};var S=function(t,e,r){var n=r,o=e.length/3>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT,i=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var a=v(t.buffer,n,i,o,!1);n+=i*o;var u=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var c=v(t.buffer,n,u,o,!1);n+=u*o;var s=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var f=v(t.buffer,n,s,o,!1);n+=s*o;var l=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var p=v(t.buffer,n,l,o,!1);return{edgeIndicesEndPosition:n+=l*o,westIndices:a,southIndices:c,eastIndices:f,northIndices:p}}(n,c,O),P=S.westIndices,_=S.southIndices,T=S.eastIndices,L=S.northIndices,j=S.edgeIndicesEndPosition;return r.maxDecodingStep<w?{header:i,vertexData:c,triangleIndices:d,westIndices:P,northIndices:L,eastIndices:T,southIndices:_}:{header:i,vertexData:c,triangleIndices:d,westIndices:P,northIndices:L,eastIndices:T,southIndices:_,extensions:function(t,e){var r={};if(t.byteLength<=e)return{extensions:r,extensionsEndPosition:e};for(var n,o=e;o<t.byteLength;){var i=t.getUint8(o,!0);o+=Uint8Array.BYTES_PER_ELEMENT;var a=t.getUint32(o,!0);o+=Uint32Array.BYTES_PER_ELEMENT;var u=new DataView(t.buffer,o,a);switch(i){case 1:r.vertexNormals=(n=u,new Uint8Array(n.buffer,n.byteOffset,n.byteLength));break;case 2:r.waterMask=g(u)}o+=a}return{extensions:r,extensionsEndPosition:o}}(n,j).extensions}}function S(t,e){if(!t)return null;var r=e.bounds,n=O(t,b),o=n.header,i=n.vertexData,a=n.triangleIndices,u=function(t,e,r){for(var n=e.minHeight,o=e.maxHeight,i=r||[0,0,1,1],a=f()(i,4),u=a[0],c=a[1],s=a[2]-u,l=a[3]-c,p=o-n,d=t.length/3,h=new Float32Array(3*d),y=new Float32Array(2*d),v=0;v<d;v++){var g=t[v]/32767,E=t[v+d]/32767,b=t[v+2*d]/32767;h[3*v+0]=g*s+u,h[3*v+1]=E*l+c,h[3*v+2]=b*p+n,y[2*v+0]=g,y[2*v+1]=E}return{POSITION:{value:h,size:3},TEXCOORD_0:{value:y,size:2}}}(i,o,r);return{loaderData:{header:{}},header:{vertexCount:a.length,boundingBox:l(u)},mode:4,indices:{value:a,size:1},attributes:u}}function P(t,e){return S(t,e["quantized-mesh"])}function _(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 T(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?_(Object(r),!0).forEach((function(e){c()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var L,j=T(T({},{id:"quantized-mesh",name:"Quantized Mesh",version:"3.0.0-alpha.3",extensions:["terrain"],mimeTypes:["application/vnd.quantized-mesh"],options:{"quantized-mesh":{workerUrl:"https://unpkg.com/@loaders.gl/terrain@".concat("3.0.0-alpha.3","/dist/quantized-mesh-loader.worker.js"),bounds:[0,0,1,1]}}}),{},{parseSync:P,parse:(L=a()(o.a.mark((function t(e,r){return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",P(e,r));case 1:case"end":return t.stop()}}),t)}))),function(t,e){return L.apply(this,arguments)})}),A=r(4),I=r.n(A);function M(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2?arguments[2]:void 0,n=r||new Set;if(t){if(N(t))n.add(t);else if(N(t.buffer))n.add(t.buffer);else if(ArrayBuffer.isView(t));else if(e&&"object"===I()(t))for(var o in t)M(t[o],e,n)}else;return void 0===r?Array.from(n):[]}function N(t){return!!t&&(t instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&t instanceof MessagePort||("undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas)))}function U(t,e){if(!t)throw new Error(e||"loader assertion failed.")}function B(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"3.0.0-alpha.3";U(t,"no loader provided");var r=t.version;e&&r&&(e=Y(e),r=Y(r))}function Y(t){var e=t.split(".").map(Number);return{major:e[0],minor:e[1]}}function R(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 D(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?R(Object(r),!0).forEach((function(e){c()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function k(t){return F.apply(this,arguments)}function F(){return(F=a()(o.a.mark((function t(e){var r,n,i,a,u,c,s;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.loader,n=e.arraybuffer,e.byteOffset,e.byteLength,i=e.options,a=e.context,!r.parseSync&&!r.parse){t.next=6;break}u=n,c=r.parseSync||r.parse,t.next=13;break;case 6:if(!r.parseTextSync){t.next=12;break}s=new TextDecoder,u=s.decode(n),c=r.parseTextSync,t.next=13;break;case 12:throw new Error("Could not load data with ".concat(r.name," loader"));case 13:return i=D(D({},i),{},{modules:r&&r.options&&r.options.modules||{},worker:!1}),t.next=16,c(u,D({},i),a,r);case 16:return t.abrupt("return",t.sent);case 17:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function z(t,e){return t&&"parse"===t.type&&t.source&&t.source.startsWith("loaders.gl")}!function(t){if("undefined"!=typeof self){var e=0,r=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return new Promise((function(o,i){var a=e++;self.addEventListener("message",(function t(e){var r=e.data;if(r&&r.id===a)switch(r.type){case"parse-done":self.removeEventListener("message",t),o(r.result);break;case"parse-error":self.removeEventListener("message",t),i(r.message)}})),self.postMessage({type:"parse",id:a,arraybuffer:t,options:r,url:n},[t])}))};self.onmessage=function(){var e=a()(o.a.mark((function e(n){var i,a,u,c,s,f,l,p,d,h;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=n.data,e.prev=1,z(i,t.name)){e.next=4;break}return e.abrupt("return");case 4:return B(t,i.source.split("@")[1]),a=i.arraybuffer,u=i.byteOffset,c=void 0===u?0:u,s=i.byteLength,f=void 0===s?0:s,l=i.options,p=void 0===l?{}:l,e.next=8,k({loader:t,arraybuffer:a,byteOffset:c,byteLength:f,options:p,context:{parse:r}});case 8:d=e.sent,h=M(d),self.postMessage({type:"done",result:d},h),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),self.postMessage({type:"error",message:e.t0.message});case 16:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t){return e.apply(this,arguments)}}()}}(j)}]);

@@ -1,1 +0,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=12)}([function(t,e,r){t.exports=r(6)},function(t,e){function r(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,o)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(o,i){var a=t.apply(e,n);function c(t){r(a,o,i,c,s,"next",t)}function s(t){r(a,o,i,c,s,"throw",t)}c(void 0)}))}}},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}},function(t,e){function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=r=function(t){return typeof t}:t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(e)}t.exports=r},function(t,e,r){var n=r(7),o=r(8),i=r(9),a=r(11);t.exports=function(t,e){return n(t)||o(t,e)||i(t,e)||a()}},,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",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof l?e:l,i=Object.create(o.prototype),a=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 E()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=w(a,r);if(c){if(c===f)continue;return c}}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 s=u(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,a),i}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f={};function l(){}function p(){}function h(){}var d={};d[o]=function(){return this};var y=Object.getPrototypeOf,v=y&&y(y(S([])));v&&v!==e&&r.call(v,o)&&(d=v);var g=h.prototype=l.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){var n;this._invoke=function(o,i){function a(){return new e((function(n,a){!function n(o,i,a,c){var s=u(t[o],t,i);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){f.value=t,a(f)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}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 f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;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,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}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 S(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:E}}function E(){return{value:void 0,done:!0}}return p.prototype=g.constructor=h,h.constructor=p,p.displayName=c(h,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(b.prototype),b.prototype[i]=function(){return this},t.AsyncIterator=b,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new b(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"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=S,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 a.type="throw",a.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],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)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 a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},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),f},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),f}},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:S(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var r=[],n=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(n=(a=c.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==c.return||c.return()}finally{if(o)throw i}}return r}}},function(t,e,r){var n=r(10);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}}},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}},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.")}},function(t,e,r){"use strict";r.r(e);var n=r(2),o=r.n(n),i=r(0),a=r.n(i),c=r(1),s=r.n(c),u=r(4),f=r.n(u);class l{constructor(t=257){this.gridSize=t;const e=t-1;if(e&e-1)throw new Error(`Expected grid size to be 2^n+1, got ${t}.`);this.numTriangles=e*e*2-2,this.numParentTriangles=this.numTriangles-e*e,this.indices=new Uint32Array(this.gridSize*this.gridSize),this.coords=new Uint16Array(4*this.numTriangles);for(let t=0;t<this.numTriangles;t++){let r=t+2,n=0,o=0,i=0,a=0,c=0,s=0;for(1&r?i=a=c=e:n=o=s=e;(r>>=1)>1;){const t=n+i>>1,e=o+a>>1;1&r?(i=n,a=o,n=c,o=s):(n=i,o=a,i=c,a=s),c=t,s=e}const u=4*t;this.coords[u+0]=n,this.coords[u+1]=o,this.coords[u+2]=i,this.coords[u+3]=a}}createTile(t){return new p(t,this)}}class p{constructor(t,e){const r=e.gridSize;if(t.length!==r*r)throw new Error(`Expected terrain data of length ${r*r} (${r} x ${r}), got ${t.length}.`);this.terrain=t,this.martini=e,this.errors=new Float32Array(t.length),this.update()}update(){const{numTriangles:t,numParentTriangles:e,coords:r,gridSize:n}=this.martini,{terrain:o,errors:i}=this;for(let a=t-1;a>=0;a--){const t=4*a,c=r[t+0],s=r[t+1],u=r[t+2],f=r[t+3],l=c+u>>1,p=s+f>>1,h=l+p-s,d=p+c-l,y=(o[s*n+c]+o[f*n+u])/2,v=p*n+l,g=Math.abs(y-o[v]);if(i[v]=Math.max(i[v],g),a<e){const t=(s+d>>1)*n+(c+h>>1),e=(f+d>>1)*n+(u+h>>1);i[v]=Math.max(i[v],i[t],i[e])}}}getMesh(t=0){const{gridSize:e,indices:r}=this.martini,{errors:n}=this;let o=0,i=0;const a=e-1;function c(a,s,u,f,l,p){const h=a+u>>1,d=s+f>>1;Math.abs(a-l)+Math.abs(s-p)>1&&n[d*e+h]>t?(c(l,p,a,s,h,d),c(u,f,l,p,h,d)):(r[s*e+a]=r[s*e+a]||++o,r[f*e+u]=r[f*e+u]||++o,r[p*e+l]=r[p*e+l]||++o,i++)}r.fill(0),c(0,0,a,a,a,0),c(a,a,0,0,0,a);const s=new Uint16Array(2*o),u=new Uint32Array(3*i);let f=0;function l(o,i,a,c,p,h){const d=o+a>>1,y=i+c>>1;if(Math.abs(o-p)+Math.abs(i-h)>1&&n[y*e+d]>t)l(p,h,o,i,d,y),l(a,c,p,h,d,y);else{const t=r[i*e+o]-1,n=r[c*e+a]-1,l=r[h*e+p]-1;s[2*t]=o,s[2*t+1]=i,s[2*n]=a,s[2*n+1]=c,s[2*l]=p,s[2*l+1]=h,u[f++]=t,u[f++]=n,u[f++]=l}}return l(0,0,a,a,a,0),l(a,a,0,0,0,a),{vertices:s,triangles:u}}}function h(t){if(!t||!t.POSITION)return null;var e=1/0,r=1/0,n=1/0,o=-1/0,i=-1/0,a=-1/0,c=t.POSITION.value,s=c&&c.length;if(!s)return null;for(var u=0;u<s;u+=3){var f=c[u],l=c[u+1],p=c[u+2];e=f<e?f:e,r=l<r?l:r,n=p<n?p:n,o=f>o?f:o,i=l>i?l:i,a=p>a?p:a}return[[e,r,n],[o,i,a]]}function d(t,e){if(null===t)return null;var r=e.meshMaxError,n=e.bounds,o=e.elevationDecoder,i=t.data,a=t.width,c=a+1,s=function(t,e,r){for(var n=r.rScaler,o=r.bScaler,i=r.gScaler,a=r.offset,c=e+1,s=new Float32Array(c*c),u=0,f=0;f<e;f++)for(var l=0;l<e;l++,u++){var p=4*u,h=t[p+0],d=t[p+1],y=t[p+2];s[u+f]=h*n+d*i+y*o+a}for(var v=c*(c-1),g=0;g<c-1;g++,v++)s[v]=s[v-c];for(var m=c-1,b=0;b<c;b++,m+=c)s[m]=s[m-1];return s}(i,a,o),u=new l(c).createTile(s).getMesh(r),p=u.vertices,d=u.triangles,y=function(t,e,r,n){for(var o=r+1,i=t.length/2,a=new Float32Array(3*i),c=new Float32Array(2*i),s=n||[0,0,r,r],u=f()(s,4),l=u[0],p=u[1],h=u[2],d=u[3],y=(h-l)/r,v=(d-p)/r,g=0;g<i;g++){var m=t[2*g],b=t[2*g+1],w=b*o+m;a[3*g+0]=m*y+l,a[3*g+1]=-b*v+d,a[3*g+2]=e[w],c[2*g+0]=m/r,c[2*g+1]=b/r}return{POSITION:{value:a,size:3},TEXCOORD_0:{value:c,size:2}}}(p,s,a,n);return{loaderData:{header:{}},header:{vertexCount:d.length,boundingBox:h(y)},mode:4,indices:{value:d,size:1},attributes:y}}function y(){return(y=s()(a.a.mark((function t(e,r,n){var o;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r.image=r.image||{},r.image.type="data",t.next=4,n.parse(e,r,r.baseUri);case 4:return o=t.sent,t.abrupt("return",d(o,r.terrain));case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function v(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 g(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?v(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var m=g(g({},{id:"terrain",name:"Terrain",version:"3.0.0-alpha.2",extensions:["png","pngraw"],mimeTypes:["image/png"],options:{terrain:{bounds:null,workerUrl:"https://unpkg.com/@loaders.gl/terrain@".concat("3.0.0-alpha.2","/dist/terrain-loader.worker.js"),meshMaxError:10,elevationDecoder:{rScaler:1,gScaler:0,bScaler:0,offset:0}}}}),{},{parse:function(t,e,r){return y.apply(this,arguments)}}),b=r(3),w=r.n(b);function x(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2?arguments[2]:void 0,n=r||new Set;if(t){if(O(t))n.add(t);else if(O(t.buffer))n.add(t.buffer);else if(ArrayBuffer.isView(t));else if(e&&"object"===w()(t))for(var o in t)x(t[o],e,n)}else;return void 0===r?Array.from(n):[]}function O(t){return!!t&&(t instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&t instanceof MessagePort||("undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas)))}function j(t,e){if(!t)throw new Error(e||"loader assertion failed.")}function S(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"3.0.0-alpha.2";j(t,"no loader provided");var r=t.version;e&&r&&(e=E(e),r=E(r))}function E(t){var e=t.split(".").map(Number);return{major:e[0],minor:e[1]}}function P(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 L(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?P(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function T(t){return k.apply(this,arguments)}function k(){return(k=s()(a.a.mark((function t(e){var r,n,o,i,c,s,u;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.loader,n=e.arraybuffer,e.byteOffset,e.byteLength,o=e.options,i=e.context,!r.parseSync&&!r.parse){t.next=6;break}c=n,s=r.parseSync||r.parse,t.next=13;break;case 6:if(!r.parseTextSync){t.next=12;break}u=new TextDecoder,c=u.decode(n),s=r.parseTextSync,t.next=13;break;case 12:throw new Error("Could not load data with ".concat(r.name," loader"));case 13:return o=L(L({},o),{},{modules:r&&r.options&&r.options.modules||{},worker:!1}),t.next=16,s(c,L({},o),i,r);case 16:return t.abrupt("return",t.sent);case 17:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function _(t,e){return t&&"parse"===t.type&&t.source&&t.source.startsWith("loaders.gl")}!function(t){if("undefined"!=typeof self){var e=0,r=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return new Promise((function(o,i){var a=e++;self.addEventListener("message",(function t(e){var r=e.data;if(r&&r.id===a)switch(r.type){case"parse-done":self.removeEventListener("message",t),o(r.result);break;case"parse-error":self.removeEventListener("message",t),i(r.message)}})),self.postMessage({type:"parse",id:a,arraybuffer:t,options:r,url:n},[t])}))};self.onmessage=function(){var e=s()(a.a.mark((function e(n){var o,i,c,s,u,f,l,p,h,d;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=n.data,e.prev=1,_(o,t.name)){e.next=4;break}return e.abrupt("return");case 4:return S(t,o.source.split("@")[1]),i=o.arraybuffer,c=o.byteOffset,s=void 0===c?0:c,u=o.byteLength,f=void 0===u?0:u,l=o.options,p=void 0===l?{}:l,e.next=8,T({loader:t,arraybuffer:i,byteOffset:s,byteLength:f,options:p,context:{parse:r}});case 8:h=e.sent,d=x(h),self.postMessage({type:"done",result:h},d),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),self.postMessage({type:"error",message:e.t0.message});case 16:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t){return e.apply(this,arguments)}}()}}(m)}]);
!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=12)}([function(t,e,r){t.exports=r(6)},function(t,e){function r(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,o)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(o,i){var a=t.apply(e,n);function c(t){r(a,o,i,c,s,"next",t)}function s(t){r(a,o,i,c,s,"throw",t)}c(void 0)}))}}},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}},function(t,e){function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=r=function(t){return typeof t}:t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(e)}t.exports=r},function(t,e,r){var n=r(7),o=r(8),i=r(9),a=r(11);t.exports=function(t,e){return n(t)||o(t,e)||i(t,e)||a()}},,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",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof l?e:l,i=Object.create(o.prototype),a=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 E()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=w(a,r);if(c){if(c===f)continue;return c}}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 s=u(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,a),i}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f={};function l(){}function p(){}function h(){}var d={};d[o]=function(){return this};var y=Object.getPrototypeOf,v=y&&y(y(S([])));v&&v!==e&&r.call(v,o)&&(d=v);var g=h.prototype=l.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){var n;this._invoke=function(o,i){function a(){return new e((function(n,a){!function n(o,i,a,c){var s=u(t[o],t,i);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){f.value=t,a(f)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}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 f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;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,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}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 S(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:E}}function E(){return{value:void 0,done:!0}}return p.prototype=g.constructor=h,h.constructor=p,p.displayName=c(h,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(b.prototype),b.prototype[i]=function(){return this},t.AsyncIterator=b,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new b(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"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=S,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 a.type="throw",a.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],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)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 a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},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),f},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),f}},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:S(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var r=[],n=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(n=(a=c.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==c.return||c.return()}finally{if(o)throw i}}return r}}},function(t,e,r){var n=r(10);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}}},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}},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.")}},function(t,e,r){"use strict";r.r(e);var n=r(2),o=r.n(n),i=r(0),a=r.n(i),c=r(1),s=r.n(c),u=r(4),f=r.n(u);class l{constructor(t=257){this.gridSize=t;const e=t-1;if(e&e-1)throw new Error(`Expected grid size to be 2^n+1, got ${t}.`);this.numTriangles=e*e*2-2,this.numParentTriangles=this.numTriangles-e*e,this.indices=new Uint32Array(this.gridSize*this.gridSize),this.coords=new Uint16Array(4*this.numTriangles);for(let t=0;t<this.numTriangles;t++){let r=t+2,n=0,o=0,i=0,a=0,c=0,s=0;for(1&r?i=a=c=e:n=o=s=e;(r>>=1)>1;){const t=n+i>>1,e=o+a>>1;1&r?(i=n,a=o,n=c,o=s):(n=i,o=a,i=c,a=s),c=t,s=e}const u=4*t;this.coords[u+0]=n,this.coords[u+1]=o,this.coords[u+2]=i,this.coords[u+3]=a}}createTile(t){return new p(t,this)}}class p{constructor(t,e){const r=e.gridSize;if(t.length!==r*r)throw new Error(`Expected terrain data of length ${r*r} (${r} x ${r}), got ${t.length}.`);this.terrain=t,this.martini=e,this.errors=new Float32Array(t.length),this.update()}update(){const{numTriangles:t,numParentTriangles:e,coords:r,gridSize:n}=this.martini,{terrain:o,errors:i}=this;for(let a=t-1;a>=0;a--){const t=4*a,c=r[t+0],s=r[t+1],u=r[t+2],f=r[t+3],l=c+u>>1,p=s+f>>1,h=l+p-s,d=p+c-l,y=(o[s*n+c]+o[f*n+u])/2,v=p*n+l,g=Math.abs(y-o[v]);if(i[v]=Math.max(i[v],g),a<e){const t=(s+d>>1)*n+(c+h>>1),e=(f+d>>1)*n+(u+h>>1);i[v]=Math.max(i[v],i[t],i[e])}}}getMesh(t=0){const{gridSize:e,indices:r}=this.martini,{errors:n}=this;let o=0,i=0;const a=e-1;function c(a,s,u,f,l,p){const h=a+u>>1,d=s+f>>1;Math.abs(a-l)+Math.abs(s-p)>1&&n[d*e+h]>t?(c(l,p,a,s,h,d),c(u,f,l,p,h,d)):(r[s*e+a]=r[s*e+a]||++o,r[f*e+u]=r[f*e+u]||++o,r[p*e+l]=r[p*e+l]||++o,i++)}r.fill(0),c(0,0,a,a,a,0),c(a,a,0,0,0,a);const s=new Uint16Array(2*o),u=new Uint32Array(3*i);let f=0;function l(o,i,a,c,p,h){const d=o+a>>1,y=i+c>>1;if(Math.abs(o-p)+Math.abs(i-h)>1&&n[y*e+d]>t)l(p,h,o,i,d,y),l(a,c,p,h,d,y);else{const t=r[i*e+o]-1,n=r[c*e+a]-1,l=r[h*e+p]-1;s[2*t]=o,s[2*t+1]=i,s[2*n]=a,s[2*n+1]=c,s[2*l]=p,s[2*l+1]=h,u[f++]=t,u[f++]=n,u[f++]=l}}return l(0,0,a,a,a,0),l(a,a,0,0,0,a),{vertices:s,triangles:u}}}function h(t){if(!t||!t.POSITION)return null;var e=1/0,r=1/0,n=1/0,o=-1/0,i=-1/0,a=-1/0,c=t.POSITION.value,s=c&&c.length;if(!s)return null;for(var u=0;u<s;u+=3){var f=c[u],l=c[u+1],p=c[u+2];e=f<e?f:e,r=l<r?l:r,n=p<n?p:n,o=f>o?f:o,i=l>i?l:i,a=p>a?p:a}return[[e,r,n],[o,i,a]]}function d(t,e){if(null===t)return null;var r=e.meshMaxError,n=e.bounds,o=e.elevationDecoder,i=t.data,a=t.width,c=a+1,s=function(t,e,r){for(var n=r.rScaler,o=r.bScaler,i=r.gScaler,a=r.offset,c=e+1,s=new Float32Array(c*c),u=0,f=0;f<e;f++)for(var l=0;l<e;l++,u++){var p=4*u,h=t[p+0],d=t[p+1],y=t[p+2];s[u+f]=h*n+d*i+y*o+a}for(var v=c*(c-1),g=0;g<c-1;g++,v++)s[v]=s[v-c];for(var m=c-1,b=0;b<c;b++,m+=c)s[m]=s[m-1];return s}(i,a,o),u=new l(c).createTile(s).getMesh(r),p=u.vertices,d=u.triangles,y=function(t,e,r,n){for(var o=r+1,i=t.length/2,a=new Float32Array(3*i),c=new Float32Array(2*i),s=n||[0,0,r,r],u=f()(s,4),l=u[0],p=u[1],h=u[2],d=u[3],y=(h-l)/r,v=(d-p)/r,g=0;g<i;g++){var m=t[2*g],b=t[2*g+1],w=b*o+m;a[3*g+0]=m*y+l,a[3*g+1]=-b*v+d,a[3*g+2]=e[w],c[2*g+0]=m/r,c[2*g+1]=b/r}return{POSITION:{value:a,size:3},TEXCOORD_0:{value:c,size:2}}}(p,s,a,n);return{loaderData:{header:{}},header:{vertexCount:d.length,boundingBox:h(y)},mode:4,indices:{value:d,size:1},attributes:y}}function y(){return(y=s()(a.a.mark((function t(e,r,n){var o;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r.image=r.image||{},r.image.type="data",t.next=4,n.parse(e,r,r.baseUri);case 4:return o=t.sent,t.abrupt("return",d(o,r.terrain));case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function v(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 g(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?v(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var m=g(g({},{id:"terrain",name:"Terrain",version:"3.0.0-alpha.3",extensions:["png","pngraw"],mimeTypes:["image/png"],options:{terrain:{bounds:null,workerUrl:"https://unpkg.com/@loaders.gl/terrain@".concat("3.0.0-alpha.3","/dist/terrain-loader.worker.js"),meshMaxError:10,elevationDecoder:{rScaler:1,gScaler:0,bScaler:0,offset:0}}}}),{},{parse:function(t,e,r){return y.apply(this,arguments)}}),b=r(3),w=r.n(b);function x(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2?arguments[2]:void 0,n=r||new Set;if(t){if(O(t))n.add(t);else if(O(t.buffer))n.add(t.buffer);else if(ArrayBuffer.isView(t));else if(e&&"object"===w()(t))for(var o in t)x(t[o],e,n)}else;return void 0===r?Array.from(n):[]}function O(t){return!!t&&(t instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&t instanceof MessagePort||("undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas)))}function j(t,e){if(!t)throw new Error(e||"loader assertion failed.")}function S(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"3.0.0-alpha.3";j(t,"no loader provided");var r=t.version;e&&r&&(e=E(e),r=E(r))}function E(t){var e=t.split(".").map(Number);return{major:e[0],minor:e[1]}}function P(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 L(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?P(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function T(t){return k.apply(this,arguments)}function k(){return(k=s()(a.a.mark((function t(e){var r,n,o,i,c,s,u;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.loader,n=e.arraybuffer,e.byteOffset,e.byteLength,o=e.options,i=e.context,!r.parseSync&&!r.parse){t.next=6;break}c=n,s=r.parseSync||r.parse,t.next=13;break;case 6:if(!r.parseTextSync){t.next=12;break}u=new TextDecoder,c=u.decode(n),s=r.parseTextSync,t.next=13;break;case 12:throw new Error("Could not load data with ".concat(r.name," loader"));case 13:return o=L(L({},o),{},{modules:r&&r.options&&r.options.modules||{},worker:!1}),t.next=16,s(c,L({},o),i,r);case 16:return t.abrupt("return",t.sent);case 17:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function _(t,e){return t&&"parse"===t.type&&t.source&&t.source.startsWith("loaders.gl")}!function(t){if("undefined"!=typeof self){var e=0,r=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return new Promise((function(o,i){var a=e++;self.addEventListener("message",(function t(e){var r=e.data;if(r&&r.id===a)switch(r.type){case"parse-done":self.removeEventListener("message",t),o(r.result);break;case"parse-error":self.removeEventListener("message",t),i(r.message)}})),self.postMessage({type:"parse",id:a,arraybuffer:t,options:r,url:n},[t])}))};self.onmessage=function(){var e=s()(a.a.mark((function e(n){var o,i,c,s,u,f,l,p,h,d;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=n.data,e.prev=1,_(o,t.name)){e.next=4;break}return e.abrupt("return");case 4:return S(t,o.source.split("@")[1]),i=o.arraybuffer,c=o.byteOffset,s=void 0===c?0:c,u=o.byteLength,f=void 0===u?0:u,l=o.options,p=void 0===l?{}:l,e.next=8,T({loader:t,arraybuffer:i,byteOffset:s,byteLength:f,options:p,context:{parse:r}});case 8:h=e.sent,d=x(h),self.postMessage({type:"done",result:h},d),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),self.postMessage({type:"error",message:e.t0.message});case 16:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t){return e.apply(this,arguments)}}()}}(m)}]);
{
"name": "@loaders.gl/terrain",
"version": "3.0.0-alpha.2",
"version": "3.0.0-alpha.3",
"description": "Framework-independent loader for terrain raster formats",

@@ -33,10 +33,10 @@ "license": "MIT",

"build-bundle": "webpack --display=minimal --config ../../scripts/bundle.config.js",
"build-worker": "webpack --entry ./src/terrain-loader.worker.js --output ./dist/terrain-loader.worker.js --config ../../scripts/worker-webpack-config.js && webpack --entry ./src/quantized-mesh-loader.worker.js --output ./dist/quantized-mesh-loader.worker.js --config ../../scripts/worker-webpack-config.js && webpack --entry ./src/npy-loader.worker.js --output ./dist/npy-loader.worker.js --config ../../scripts/worker-webpack-config.js"
"build-worker": "webpack --entry ./src/terrain-loader.worker.js --output ./dist/terrain-loader.worker.js --config ../../scripts/worker-webpack-config.js && webpack --entry ./src/quantized-mesh-loader.worker.js --output ./dist/quantized-mesh-loader.worker.js --config ../../scripts/worker-webpack-config.js"
},
"dependencies": {
"@babel/runtime": "^7.3.1",
"@loaders.gl/loader-utils": "3.0.0-alpha.2",
"@loaders.gl/loader-utils": "3.0.0-alpha.3",
"@mapbox/martini": "^0.2.0"
},
"gitHead": "74087169b419b7c696330b42d6d3413147a87f37"
"gitHead": "4ada707368e9a0be11c296e34271b3e8b684f0cf"
}
export {TerrainLoader, TerrainWorkerLoader} from './terrain-loader';
export {QuantizedMeshLoader, QuantizedMeshWorkerLoader} from './quantized-mesh-loader';
export {NPYLoader as _NPYLoader, NPYWorkerLoader as _NPYWorkerLoader} from './npy-loader';

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc