autumnplot-gl 4.0.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/812.autumnplot-gl.js +2 -0
- package/dist/812.autumnplot-gl.js.map +1 -0
- package/dist/983.autumnplot-gl.js +1 -1
- package/dist/983.autumnplot-gl.js.map +1 -1
- package/dist/autumnplot-gl.js +1 -1
- package/dist/autumnplot-gl.js.map +1 -1
- package/dist/marchingsquares.wasm +0 -0
- package/lib/AutumnTypes.d.ts +6 -4
- package/lib/AutumnTypes.js +4 -1
- package/lib/Barbs.d.ts +11 -2
- package/lib/Barbs.js +9 -0
- package/lib/BillboardCollection.d.ts +2 -2
- package/lib/BillboardCollection.js +14 -14
- package/lib/ColorBar.d.ts +6 -1
- package/lib/ColorBar.js +10 -4
- package/lib/Colormap.d.ts +8 -1
- package/lib/Colormap.js +24 -1
- package/lib/Contour.d.ts +16 -1
- package/lib/Contour.js +14 -2
- package/lib/{ContourCreator.d.ts → ContourCreator.worker.d.ts} +10 -11
- package/lib/{ContourCreator.js → ContourCreator.worker.js} +15 -14
- package/lib/Fill.d.ts +29 -11
- package/lib/Fill.js +38 -18
- package/lib/Hodographs.d.ts +13 -3
- package/lib/Hodographs.js +11 -1
- package/lib/Map.d.ts +3 -4
- package/lib/Map.js +49 -51
- package/lib/Paintball.d.ts +13 -5
- package/lib/Paintball.js +96 -46
- package/lib/PlotComponent.d.ts +8 -3
- package/lib/PlotComponent.js +35 -1
- package/lib/PlotLayer.worker.js +1 -1
- package/lib/RawField.d.ts +221 -27
- package/lib/RawField.js +405 -58
- package/lib/StationPlot.d.ts +22 -6
- package/lib/StationPlot.js +88 -22
- package/lib/TextCollection.d.ts +5 -0
- package/lib/TextCollection.js +79 -9
- package/lib/WasmInterface.d.ts +7 -0
- package/lib/WasmInterface.js +11 -0
- package/lib/WorkerPool.d.ts +8 -0
- package/lib/WorkerPool.js +77 -0
- package/lib/cpp/marchingsquares.js +127 -13
- package/lib/cpp/marchingsquares.wasm +0 -0
- package/lib/cpp/marchingsquares_embind.d.ts +16 -3
- package/lib/grids/AutoZoom.d.ts +21 -0
- package/lib/grids/AutoZoom.js +63 -0
- package/lib/grids/DomainBuffer.d.ts +14 -0
- package/lib/grids/DomainBuffer.js +16 -0
- package/lib/grids/Geostationary.d.ts +35 -0
- package/lib/grids/Geostationary.js +47 -0
- package/lib/grids/Grid.d.ts +36 -0
- package/lib/grids/Grid.js +12 -0
- package/lib/grids/GridCoordinates.d.ts +10 -0
- package/lib/grids/GridCoordinates.js +64 -0
- package/lib/grids/LambertGrid.d.ts +73 -0
- package/lib/grids/LambertGrid.js +92 -0
- package/lib/grids/PlateCarreeGrid.d.ts +46 -0
- package/lib/grids/PlateCarreeGrid.js +55 -0
- package/lib/grids/PlateCarreeRotatedGrid.d.ts +53 -0
- package/lib/grids/PlateCarreeRotatedGrid.js +65 -0
- package/lib/grids/RadarSweepGrid.d.ts +46 -0
- package/lib/grids/RadarSweepGrid.js +74 -0
- package/lib/grids/StructuredGrid.d.ts +49 -0
- package/lib/grids/StructuredGrid.js +103 -0
- package/lib/grids/UnstructuredGrid.d.ts +56 -0
- package/lib/grids/UnstructuredGrid.js +102 -0
- package/lib/index.d.ts +15 -4
- package/lib/index.js +15 -7
- package/lib/utils.d.ts +11 -2
- package/lib/utils.js +63 -1
- package/package.json +3 -2
- package/lib/Grid.d.ts +0 -270
- package/lib/Grid.js +0 -600
- package/lib/ParticleTracer.d.ts +0 -19
- package/lib/ParticleTracer.js +0 -37
package/dist/autumnplot-gl.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see autumnplot-gl.js.LICENSE.txt */
|
|
2
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.apgl=e():t.apgl=e()}(this,()=>(()=>{var t={251:(t,e)=>{e.read=function(t,e,n,r,o){var i,a,s=8*o-r-1,l=(1<<s)-1,c=l>>1,u=-7,f=n?o-1:0,h=n?-1:1,d=t[e+f];for(f+=h,i=d&(1<<-u)-1,d>>=-u,u+=s;u>0;i=256*i+t[e+f],f+=h,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=r;u>0;a=256*a+t[e+f],f+=h,u-=8);if(0===i)i=1-c;else{if(i===l)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),i-=c}return(d?-1:1)*a*Math.pow(2,i-r)},e.write=function(t,e,n,r,o,i){var a,s,l,c=8*i-o-1,u=(1<<c)-1,f=u>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:i-1,p=r?1:-1,_=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+f>=1?h/l:h*Math.pow(2,1-f))*l>=2&&(a++,l/=2),a+f>=u?(s=0,a=u):a+f>=1?(s=(e*l-1)*Math.pow(2,o),a+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[n+d]=255&s,d+=p,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;t[n+d]=255&a,d+=p,a/=256,c-=8);t[n+d-p]|=128*_}},254:t=>{t.exports="#version 300 es\n\nin highp vec2 v_tex_coord;\n\n#ifdef COLORMAP\nin highp float v_mag;\n#else\nuniform lowp vec4 u_bb_color;\n#endif\n\nuniform sampler2D u_sampler;\n\nout highp vec4 fragColor;\n\nvoid main() {\n lowp vec4 tex_color = texture(u_sampler, v_tex_coord);\n\n lowp vec4 color;\n#ifdef COLORMAP\n color = apply_colormap(v_mag);\n#else\n color = u_bb_color;\n#endif\n\n color.a *= tex_color.a;\n fragColor = color; // mix(vec4(1.0, 0.0, 0.0, 0.5), color, tex_color.a);\n}"},303:t=>{t.exports="#version 300 es\n\nuniform int u_offset;\n\nin vec2 a_pos;\nin vec2 a_tex_coord;\n\nout highp vec2 v_tex_coord;\n\nvoid main() {\n float globe_width = 1.;\n vec2 globe_offset = vec2(globe_width * float(u_offset), 0.);\n\n gl_Position = projectTile(a_pos.xy + globe_offset);\n v_tex_coord = a_tex_coord;\n}"},317:function(t,e){var n,r;void 0===(r="function"==typeof(n=function(t){function e(t,e,n){this.obj=t,this.left=null,this.right=null,this.parent=n,this.dimension=e}function n(t){this.content=[],this.scoreFunction=t}n.prototype={push:function(t){this.content.push(t),this.bubbleUp(this.content.length-1)},pop:function(){var t=this.content[0],e=this.content.pop();return this.content.length>0&&(this.content[0]=e,this.sinkDown(0)),t},peek:function(){return this.content[0]},remove:function(t){for(var e=this.content.length,n=0;n<e;n++)if(this.content[n]==t){var r=this.content.pop();return void(n!=e-1&&(this.content[n]=r,this.scoreFunction(r)<this.scoreFunction(t)?this.bubbleUp(n):this.sinkDown(n)))}throw new Error("Node not found.")},size:function(){return this.content.length},bubbleUp:function(t){for(var e=this.content[t];t>0;){var n=Math.floor((t+1)/2)-1,r=this.content[n];if(!(this.scoreFunction(e)<this.scoreFunction(r)))break;this.content[n]=e,this.content[t]=r,t=n}},sinkDown:function(t){for(var e=this.content.length,n=this.content[t],r=this.scoreFunction(n);;){var o=2*(t+1),i=o-1,a=null;if(i<e){var s=this.content[i],l=this.scoreFunction(s);l<r&&(a=i)}if(o<e){var c=this.content[o];this.scoreFunction(c)<(null==a?r:l)&&(a=o)}if(null==a)break;this.content[t]=this.content[a],this.content[a]=n,t=a}}},t.kdTree=function(t,r,o){var i=this;Array.isArray(t)?this.root=function t(n,r,i){var a,s,l=r%o.length;return 0===n.length?null:1===n.length?new e(n[0],l,i):(n.sort(function(t,e){return t[o[l]]-e[o[l]]}),(s=new e(n[a=Math.floor(n.length/2)],l,i)).left=t(n.slice(0,a),r+1,s),s.right=t(n.slice(a+1),r+1,s),s)}(t,0,null):function(t){i.root=t,function t(e){e.left&&(e.left.parent=e,t(e.left)),e.right&&(e.right.parent=e,t(e.right))}(i.root)}(t),this.toJSON=function(t){t||(t=this.root);var n=new e(t.obj,t.dimension,null);return t.left&&(n.left=i.toJSON(t.left)),t.right&&(n.right=i.toJSON(t.right)),n},this.insert=function(t){var n,r,i=function e(n,r){if(null===n)return r;var i=o[n.dimension];return t[i]<n.obj[i]?e(n.left,n):e(n.right,n)}(this.root,null);null!==i?(n=new e(t,(i.dimension+1)%o.length,i),r=o[i.dimension],t[r]<i.obj[r]?i.left=n:i.right=n):this.root=new e(t,0,null)},this.remove=function(t){var e;null!==(e=function e(n){if(null===n)return null;if(n.obj===t)return n;var r=o[n.dimension];return t[r]<n.obj[r]?e(n.left):e(n.right)}(i.root))&&function t(e){function n(t,e){var r,i,a,s,l;return null===t?null:(r=o[e],t.dimension===e?null!==t.left?n(t.left,e):t:(i=t.obj[r],a=n(t.left,e),s=n(t.right,e),l=t,null!==a&&a.obj[r]<i&&(l=a),null!==s&&s.obj[r]<l.obj[r]&&(l=s),l))}var r,a,s;if(null===e.left&&null===e.right)return null===e.parent?void(i.root=null):(s=o[e.parent.dimension],void(e.obj[s]<e.parent.obj[s]?e.parent.left=null:e.parent.right=null));null!==e.right?(a=(r=n(e.right,e.dimension)).obj,t(r),e.obj=a):(a=(r=n(e.left,e.dimension)).obj,t(r),e.right=e.left,e.left=null,e.obj=a)}(e)},this.nearest=function(t,e,a){var s,l,c;if(c=new n(function(t){return-t[1]}),a)for(s=0;s<e;s+=1)c.push([null,a]);for(i.root&&function n(i){function a(t,n){c.push([t,n]),c.size()>e&&c.pop()}var s,l,u,f,h=o[i.dimension],d=r(t,i.obj),p={};for(f=0;f<o.length;f+=1)f===i.dimension?p[o[f]]=t[o[f]]:p[o[f]]=i.obj[o[f]];l=r(p,i.obj),null!==i.right||null!==i.left?(n(s=null===i.right?i.left:null===i.left?i.right:t[h]<i.obj[h]?i.left:i.right),(c.size()<e||d<c.peek()[1])&&a(i,d),(c.size()<e||Math.abs(l)<c.peek()[1])&&null!==(u=s===i.left?i.right:i.left)&&n(u)):(c.size()<e||d<c.peek()[1])&&a(i,d)}(i.root),l=[],s=0;s<Math.min(e,c.content.length);s+=1)c.content[s][0]&&l.push([c.content[s][0].obj,c.content[s][1]]);return l},this.balanceFactor=function(){return function t(e){return null===e?0:Math.max(t(e.left),t(e.right))+1}(i.root)/(Math.log(function t(e){return null===e?0:t(e.left)+t(e.right)+1}(i.root))/Math.log(2))}},t.BinaryHeap=n})?n.apply(e,[e]):n)||(t.exports=r)},335:(t,e,n)=>{"use strict";t.exports=o;var r=n(251);function o(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}o.Varint=0,o.Fixed64=1,o.Bytes=2,o.Fixed32=5;var i=4294967296,a=1/i,s="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function l(t){return t.type===o.Bytes?t.readVarint()+t.pos:t.pos+1}function c(t,e,n){return n?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function u(t,e,n){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));n.realloc(r);for(var o=n.pos-1;o>=t;o--)n.buf[o+r]=n.buf[o]}function f(t,e){for(var n=0;n<t.length;n++)e.writeVarint(t[n])}function h(t,e){for(var n=0;n<t.length;n++)e.writeSVarint(t[n])}function d(t,e){for(var n=0;n<t.length;n++)e.writeFloat(t[n])}function p(t,e){for(var n=0;n<t.length;n++)e.writeDouble(t[n])}function _(t,e){for(var n=0;n<t.length;n++)e.writeBoolean(t[n])}function m(t,e){for(var n=0;n<t.length;n++)e.writeFixed32(t[n])}function g(t,e){for(var n=0;n<t.length;n++)e.writeSFixed32(t[n])}function v(t,e){for(var n=0;n<t.length;n++)e.writeFixed64(t[n])}function b(t,e){for(var n=0;n<t.length;n++)e.writeSFixed64(t[n])}function y(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function w(t,e,n){t[n]=e,t[n+1]=e>>>8,t[n+2]=e>>>16,t[n+3]=e>>>24}function x(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}o.prototype={destroy:function(){this.buf=null},readFields:function(t,e,n){for(n=n||this.length;this.pos<n;){var r=this.readVarint(),o=r>>3,i=this.pos;this.type=7&r,t(o,e,this),this.pos===i&&this.skip(r)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=y(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=x(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=y(this.buf,this.pos)+y(this.buf,this.pos+4)*i;return this.pos+=8,t},readSFixed64:function(){var t=y(this.buf,this.pos)+x(this.buf,this.pos+4)*i;return this.pos+=8,t},readFloat:function(){var t=r.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=r.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,n,r=this.buf;return e=127&(n=r[this.pos++]),n<128?e:(e|=(127&(n=r[this.pos++]))<<7,n<128?e:(e|=(127&(n=r[this.pos++]))<<14,n<128?e:(e|=(127&(n=r[this.pos++]))<<21,n<128?e:function(t,e,n){var r,o,i=n.buf;if(r=(112&(o=i[n.pos++]))>>4,o<128)return c(t,r,e);if(r|=(127&(o=i[n.pos++]))<<3,o<128)return c(t,r,e);if(r|=(127&(o=i[n.pos++]))<<10,o<128)return c(t,r,e);if(r|=(127&(o=i[n.pos++]))<<17,o<128)return c(t,r,e);if(r|=(127&(o=i[n.pos++]))<<24,o<128)return c(t,r,e);if(r|=(1&(o=i[n.pos++]))<<31,o<128)return c(t,r,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(n=r[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&s?function(t,e,n){return s.decode(t.subarray(e,n))}(this.buf,e,t):function(t,e,n){for(var r="",o=e;o<n;){var i,a,s,l=t[o],c=null,u=l>239?4:l>223?3:l>191?2:1;if(o+u>n)break;1===u?l<128&&(c=l):2===u?128==(192&(i=t[o+1]))&&(c=(31&l)<<6|63&i)<=127&&(c=null):3===u?(i=t[o+1],a=t[o+2],128==(192&i)&&128==(192&a)&&((c=(15&l)<<12|(63&i)<<6|63&a)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(i=t[o+1],a=t[o+2],s=t[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&((c=(15&l)<<18|(63&i)<<12|(63&a)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,r+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),r+=String.fromCharCode(c),o+=u}return r}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==o.Bytes)return t.push(this.readVarint(e));var n=l(this);for(t=t||[];this.pos<n;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==o.Bytes)return t.push(this.readSVarint());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==o.Bytes)return t.push(this.readBoolean());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==o.Bytes)return t.push(this.readFloat());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==o.Bytes)return t.push(this.readDouble());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==o.Bytes)return t.push(this.readFixed32());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==o.Bytes)return t.push(this.readSFixed32());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==o.Bytes)return t.push(this.readFixed64());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==o.Bytes)return t.push(this.readSFixed64());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===o.Varint)for(;this.buf[this.pos++]>127;);else if(e===o.Bytes)this.pos=this.readVarint()+this.pos;else if(e===o.Fixed32)this.pos+=4;else{if(e!==o.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var n=new Uint8Array(e);n.set(this.buf),this.buf=n,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),w(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),w(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),w(this.buf,-1&t,this.pos),w(this.buf,Math.floor(t*a),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),w(this.buf,-1&t,this.pos),w(this.buf,Math.floor(t*a),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var n,r;if(t>=0?(n=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(n=~(-t%4294967296))?n=n+1|0:(n=0,r=r+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,n){n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos]=127&t}(n,0,e),function(t,e){var n=(7&t)<<4;e.buf[e.pos++]|=n|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(r,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,n){for(var r,o,i=0;i<e.length;i++){if((r=e.charCodeAt(i))>55295&&r<57344){if(!o){r>56319||i+1===e.length?(t[n++]=239,t[n++]=191,t[n++]=189):o=r;continue}if(r<56320){t[n++]=239,t[n++]=191,t[n++]=189,o=r;continue}r=o-55296<<10|r-56320|65536,o=null}else o&&(t[n++]=239,t[n++]=191,t[n++]=189,o=null);r<128?t[n++]=r:(r<2048?t[n++]=r>>6|192:(r<65536?t[n++]=r>>12|224:(t[n++]=r>>18|240,t[n++]=r>>12&63|128),t[n++]=r>>6&63|128),t[n++]=63&r|128)}return n}(this.buf,t,this.pos);var n=this.pos-e;n>=128&&u(e,n,this),this.pos=e-1,this.writeVarint(n),this.pos+=n},writeFloat:function(t){this.realloc(4),r.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),r.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var n=0;n<e;n++)this.buf[this.pos++]=t[n]},writeRawMessage:function(t,e){this.pos++;var n=this.pos;t(e,this);var r=this.pos-n;r>=128&&u(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,n){this.writeTag(t,o.Bytes),this.writeRawMessage(e,n)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,f,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,h,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,_,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,d,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,p,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,m,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,g,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,v,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,b,e)},writeBytesField:function(t,e){this.writeTag(t,o.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,o.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,o.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,o.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,o.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,o.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,o.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,o.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,o.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,o.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}},374:t=>{t.exports="\nuniform sampler2D u_cmap_sampler;\nuniform sampler2D u_cmap_nonlin_sampler;\nuniform highp float u_cmap_min;\nuniform highp float u_cmap_max;\nuniform highp vec4 u_underflow_color;\nuniform highp vec4 u_overflow_color;\nuniform int u_n_index;\n\nlowp vec4 apply_colormap(highp float value) {\n lowp float normed_val = (value - u_cmap_min) / (u_cmap_max - u_cmap_min);\n \n lowp vec4 color;\n if (normed_val < 0.0) {\n color = u_underflow_color;\n }\n else if (normed_val > 1.0) {\n color = u_overflow_color;\n }\n else {\n lowp float index_buffer = 1. / (2. * float(u_n_index));\n normed_val = index_buffer + normed_val * (1. - 2. * index_buffer); // Chop off the half pixels on either end of the texture\n highp float nonlin_val = texture(u_cmap_nonlin_sampler, vec2(normed_val, 0.5)).r;\n color = texture(u_cmap_sampler, vec2(nonlin_val, 0.5));\n }\n\n return color;\n}"},375:t=>{t.exports="#version 300 es\n\n#define MAX_N_COLORS 24\n\nin highp vec2 v_tex_coord;\n\nuniform sampler2D u_fill_sampler;\nuniform lowp vec4 u_colors[MAX_N_COLORS];\nuniform int u_num_colors;\nuniform highp float u_opacity;\n\nout highp vec4 fragColor;\n\nvoid main() {\n highp float fill_val = texture(u_fill_sampler, v_tex_coord).r;\n \n if (fill_val < 0.5) {\n discard;\n }\n\n lowp vec4 color = vec4(0., 0., 0., 0.);\n\n for (int nclr = 0; nclr < MAX_N_COLORS ; nclr++) {\n if (nclr >= u_num_colors || fill_val < 0.99) { break; }\n\n lowp float mem_active = mod(fill_val, 2.);\n color = mix(color, u_colors[nclr], mem_active);\n fill_val = floor(fill_val / 2.);\n }\n\n color.a = color.a * u_opacity;\n fragColor = color;\n}"},401:t=>{t.exports="#version 300 es\n\nin highp vec2 v_tex_coord;\n\nuniform sampler2D u_fill_sampler;\n\n#ifdef MASK\nuniform sampler2D u_mask_sampler;\n#endif\n\nuniform highp float u_opacity;\n#ifdef MASK\nuniform int u_mask_val;\n#endif\n\nout highp vec4 fragColor;\n\nvoid main() {\n highp float fill_val = texture(u_fill_sampler, v_tex_coord).r;\n\n int draw_mask = 1;\n\n#ifdef MASK\n highp float mask_val = texture(u_mask_sampler, v_tex_coord).r;\n draw_mask = int(mask_val * 255.0) == u_mask_val ? 1 : 0;\n#endif\n\n if (isnan(fill_val) || draw_mask == 0) {\n discard;\n }\n\n lowp vec4 color = apply_colormap(fill_val);\n color.a = color.a * u_opacity;\n fragColor = color;\n}"},533:t=>{var e,n=(e="undefined"!=typeof document?document.currentScript?.src:void 0,function(t={}){var n,r,o,i=t,a=new Promise((t,e)=>{r=t,o=e});if(["getExceptionMessage","incrementExceptionRefcount","decrementExceptionRefcount","_memory","___indirect_function_table","onRuntimeInitialized"].forEach(t=>{Object.getOwnPropertyDescriptor(a,t)||Object.defineProperty(a,t,{get:()=>G("You are getting "+t+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js"),set:()=>G("You are setting "+t+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")})}),i.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");var s,l=Object.assign({},i),c="";if("undefined"!=typeof document&&document.currentScript&&(c=document.currentScript.src),e&&(c=e),c=c.startsWith("blob:")?"":c.substr(0,c.replace(/[?#].*/,"").lastIndexOf("/")+1),"object"!=typeof window&&"function"!=typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");s=t=>(E(!U(t),"readAsync does not work with file:// URLs"),fetch(t,{credentials:"same-origin"}).then(t=>t.ok?t.arrayBuffer():Promise.reject(new Error(t.status+" : "+t.url))));var u,f,h,d=i.print||console.log.bind(console),p=i.printErr||console.error.bind(console);Object.assign(i,l),l=null,u="fetchSettings",Object.getOwnPropertyDescriptor(i,u)&&G(`\`Module.${u}\` was supplied but \`${u}\` not included in INCOMING_MODULE_JS_API`),i.arguments&&i.arguments,X("arguments","arguments_"),i.thisProgram&&i.thisProgram,X("thisProgram","thisProgram"),i.quit&&i.quit,X("quit","quit_"),E(void 0===i.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),E(void 0===i.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),E(void 0===i.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),E(void 0===i.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),E(void 0===i.read,"Module.read option was removed"),E(void 0===i.readAsync,"Module.readAsync option was removed (modify readAsync in JS)"),E(void 0===i.readBinary,"Module.readBinary option was removed (modify readBinary in JS)"),E(void 0===i.setWindowTitle,"Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)"),E(void 0===i.TOTAL_MEMORY,"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),X("asm","wasmExports"),X("readAsync","readAsync"),X("readBinary","readBinary"),X("setWindowTitle","setWindowTitle"),E(!0,"worker environment detected but not enabled at build time. Add `worker` to `-sENVIRONMENT` to enable."),E(!0,"node environment detected but not enabled at build time. Add `node` to `-sENVIRONMENT` to enable."),E(!0,"shell environment detected but not enabled at build time. Add `shell` to `-sENVIRONMENT` to enable."),i.wasmBinary&&(f=i.wasmBinary),X("wasmBinary","wasmBinary"),"object"!=typeof WebAssembly&&p("no native wasm support detected");var _,m,g,v,b,y,w,x,T=!1;function E(t,e){t||G("Assertion failed"+(e?": "+e:""))}function A(){var t=h.buffer;i.HEAP8=_=new Int8Array(t),i.HEAP16=g=new Int16Array(t),i.HEAPU8=m=new Uint8Array(t),i.HEAPU16=v=new Uint16Array(t),i.HEAP32=b=new Int32Array(t),i.HEAPU32=y=new Uint32Array(t),i.HEAPF32=w=new Float32Array(t),i.HEAPF64=x=new Float64Array(t)}function S(){if(!T){var t=me();0==t&&(t+=4);var e=y[t>>2],n=y[t+4>>2];34821223==e&&2310721022==n||G(`Stack overflow! Stack cookie has been overwritten at ${K(t)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${K(n)} ${K(e)}`),1668509029!=y[0]&&G("Runtime error: The application has corrupted its heap memory area (address zero)!")}}E(!i.STACK_SIZE,"STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time"),E("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,"JS engine does not provide full typed array support"),E(!i.wasmMemory,"Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally"),E(!i.INITIAL_MEMORY,"Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically"),function(){var t=new Int16Array(1),e=new Int8Array(t.buffer);if(t[0]=25459,115!==e[0]||99!==e[1])throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)"}();var M=[],R=[],P=[],F=!1;function I(t){M.unshift(t)}function O(t){P.unshift(t)}E(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),E(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),E(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),E(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var k=0,C=null,N=null,B={};function G(t){i.onAbort?.(t),p(t="Aborted("+t+")"),T=!0;var e=new WebAssembly.RuntimeError(t);throw o(e),e}var L={error(){G("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM")},init(){L.error()},createDataFile(){L.error()},createPreloadedFile(){L.error()},createLazyFile(){L.error()},open(){L.error()},mkdev(){L.error()},registerDevice(){L.error()},analyzePath(){L.error()},ErrnoError(){L.error()}};i.FS_createDataFile=L.createDataFile,i.FS_createPreloadedFile=L.createPreloadedFile;var j,D=t=>t.startsWith("data:application/octet-stream;base64,"),U=t=>t.startsWith("file://");function z(t,e){return(...n)=>{E(F,`native function \`${t}\` called before runtime initialization`);var r=ce[t];return E(r,`exported native function \`${t}\` not found`),E(n.length<=e,`native function \`${t}\` called with ${n.length} args but expects ${e}`),r(...n)}}class H extends Error{}class V extends H{constructor(t){super(t),this.excPtr=t;const e=ae(t);this.name=e[0],this.message=e[1]}}function W(t){if(t==j&&f)return new Uint8Array(f);throw"both async and sync fetching of the wasm failed"}function $(t,e,n){return function(t){return f?Promise.resolve().then(()=>W(t)):s(t).then(t=>new Uint8Array(t),()=>W(t))}(t).then(t=>WebAssembly.instantiate(t,e)).then(n,t=>{p(`failed to asynchronously prepare wasm: ${t}`),U(j)&&p(`warning: Loading from a file URI (${j}) is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing`),G(t)})}function X(t,e,n=!0){Object.getOwnPropertyDescriptor(i,t)||Object.defineProperty(i,t,{configurable:!0,get(){G(`\`Module.${t}\` has been replaced by \`${e}\``+(n?" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)":""))}})}function Y(t){return"FS_createPath"===t||"FS_createDataFile"===t||"FS_createPreloadedFile"===t||"FS_unlink"===t||"addRunDependency"===t||"FS_createLazyFile"===t||"FS_createDevice"===t||"removeRunDependency"===t}function Z(t,e){"undefined"!=typeof globalThis&&Object.defineProperty(globalThis,t,{configurable:!0,get(){et(`\`${t}\` is not longer defined by emscripten. ${e}`)}})}function J(t){Object.getOwnPropertyDescriptor(i,t)||Object.defineProperty(i,t,{configurable:!0,get(){var e=`'${t}' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)`;Y(t)&&(e+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),G(e)}})}Z("buffer","Please use HEAP8.buffer or wasmMemory.buffer"),Z("asm","Please use wasmExports instead");var q=t=>{for(;t.length>0;)t.shift()(i)};i.noExitRuntime;var K=t=>(E("number"==typeof t),"0x"+(t>>>=0).toString(16).padStart(8,"0")),Q=t=>ge(t),tt=()=>be(),et=t=>{et.shown||={},et.shown[t]||(et.shown[t]=1,p(t))},nt="undefined"!=typeof TextDecoder?new TextDecoder:void 0,rt=(t,e,n)=>{for(var r=e+n,o=e;t[o]&&!(o>=r);)++o;if(o-e>16&&t.buffer&&nt)return nt.decode(t.subarray(e,o));for(var i="";e<o;){var a=t[e++];if(128&a){var s=63&t[e++];if(192!=(224&a)){var l=63&t[e++];if(224==(240&a)?a=(15&a)<<12|s<<6|l:(240!=(248&a)&&et("Invalid UTF-8 leading byte "+K(a)+" encountered when deserializing a UTF-8 string in wasm memory to a JS string!"),a=(7&a)<<18|s<<12|l<<6|63&t[e++]),a<65536)i+=String.fromCharCode(a);else{var c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i},ot=(t,e)=>(E("number"==typeof t,`UTF8ToString expects a number (got ${typeof t})`),t?rt(m,t,e):""),it=[],at=0;class st{constructor(t){this.excPtr=t,this.ptr=t-24}set_type(t){y[this.ptr+4>>2]=t}get_type(){return y[this.ptr+4>>2]}set_destructor(t){y[this.ptr+8>>2]=t}get_destructor(){return y[this.ptr+8>>2]}set_caught(t){t=t?1:0,_[this.ptr+12]=t}get_caught(){return 0!=_[this.ptr+12]}set_rethrown(t){t=t?1:0,_[this.ptr+13]=t}get_rethrown(){return 0!=_[this.ptr+13]}init(t,e){this.set_adjusted_ptr(0),this.set_type(t),this.set_destructor(e)}set_adjusted_ptr(t){y[this.ptr+16>>2]=t}get_adjusted_ptr(){return y[this.ptr+16>>2]}get_exception_ptr(){if(Ee(this.get_type()))return y[this.excPtr>>2];var t=this.get_adjusted_ptr();return 0!==t?t:this.excPtr}}var lt,ct,ut,ft=t=>pe(t),ht=t=>{var e=at?.excPtr;if(!e)return ft(0),0;var n=new st(e);n.set_adjusted_ptr(e);var r=n.get_type();if(!r)return ft(0),e;for(var o of t){if(0===o||o===r)break;var i=n.ptr+16;if(Te(o,r,i))return ft(o),e}return ft(r),e},dt=t=>{for(var e="",n=t;m[n];)e+=lt[m[n++]];return e},pt={},_t={},mt={},gt=t=>{throw new ct(t)},vt=t=>{throw new ut(t)};function bt(t,e,n={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(t,e,n={}){var r=e.name;if(t||gt(`type "${r}" must have a positive integer typeid pointer`),_t.hasOwnProperty(t)){if(n.ignoreDuplicateRegistrations)return;gt(`Cannot register type '${r}' twice`)}if(_t[t]=e,delete mt[t],pt.hasOwnProperty(t)){var o=pt[t];delete pt[t],o.forEach(t=>t())}}(t,e,n)}var yt=[],wt=[],xt=t=>{t>9&&0===--wt[t+1]&&(E(void 0!==wt[t],"Decref for unallocated handle."),wt[t]=void 0,yt.push(t))},Tt=t=>(t||gt("Cannot use deleted val. handle = "+t),E(2===t||void 0!==wt[t]&&t%2==0,`invalid handle: ${t}`),wt[t]),Et=t=>{switch(t){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const e=yt.pop()||wt.length;return wt[e]=t,wt[e+1]=1,e}}};function At(t){return this.fromWireType(y[t>>2])}var St={name:"emscripten::val",fromWireType:t=>{var e=Tt(t);return xt(t),e},toWireType:(t,e)=>Et(e),argPackAdvance:8,readValueFromPointer:At,destructorFunction:null},Mt=t=>{if(null===t)return"null";var e=typeof t;return"object"===e||"array"===e||"function"===e?t.toString():""+t},Rt=(t,e)=>{switch(e){case 4:return function(t){return this.fromWireType(w[t>>2])};case 8:return function(t){return this.fromWireType(x[t>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},Pt=(t,e)=>Object.defineProperty(e,"name",{value:t}),Ft=t=>{for(;t.length;){var e=t.pop();t.pop()(e)}};function It(t){for(var e=1;e<t.length;++e)if(null!==t[e]&&void 0===t[e].destructorFunction)return!0;return!1}function Ot(t,e){if(!(t instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof t} which is not a function`);var n=Pt(t.name||"unknownFunctionName",function(){});n.prototype=t.prototype;var r=new n,o=t.apply(r,e);return o instanceof Object?o:r}var kt,Ct,Nt,Bt=(t,e,n)=>{if(void 0===t[e].overloadTable){var r=t[e];t[e]=function(...r){return t[e].overloadTable.hasOwnProperty(r.length)||gt(`Function '${n}' called with an invalid number of arguments (${r.length}) - expects one of (${t[e].overloadTable})!`),t[e].overloadTable[r.length].apply(this,r)},t[e].overloadTable=[],t[e].overloadTable[r.argCount]=r}},Gt=[],Lt=t=>{var e=Gt[t];return e||(t>=Gt.length&&(Gt.length=t+1),Gt[t]=e=kt.get(t)),E(kt.get(t)==e,"JavaScript-side Wasm function table mirror is out of date!"),e},jt=(t,e)=>{var n,r,o=(t=dt(t)).includes("j")?(r=e,E((n=t).includes("j")||n.includes("p"),"getDynCaller should only be called with i64 sigs"),(...t)=>((t,e,n=[])=>t.includes("j")?((t,e,n)=>(E("dynCall_"+(t=t.replace(/p/g,"i"))in i,`bad function pointer type - dynCall function not found for sig '${t}'`),E(n?.length?n.length===t.substring(1).replace(/j/g,"--").length:1==t.length),(0,i["dynCall_"+t])(e,...n)))(t,e,n):(E(Lt(e),`missing table entry in dynCall: ${e}`),Lt(e)(...n)))(n,r,t)):Lt(e);return"function"!=typeof o&>(`unknown function pointer with signature ${t}: ${e}`),o},Dt=t=>{var e=ue(t),n=dt(e);return he(e),n},Ut=(t,e,n)=>{switch(e){case 1:return n?t=>_[t]:t=>m[t];case 2:return n?t=>g[t>>1]:t=>v[t>>1];case 4:return n?t=>b[t>>2]:t=>y[t>>2];default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},zt="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,Ht=(t,e)=>{E(t%2==0,"Pointer passed to UTF16ToString must be aligned to two bytes!");for(var n=t,r=n>>1,o=r+e/2;!(r>=o)&&v[r];)++r;if((n=r<<1)-t>32&&zt)return zt.decode(m.subarray(t,n));for(var i="",a=0;!(a>=e/2);++a){var s=g[t+2*a>>1];if(0==s)break;i+=String.fromCharCode(s)}return i},Vt=(t,e,n)=>{if(E(e%2==0,"Pointer passed to stringToUTF16 must be aligned to two bytes!"),E("number"==typeof n,"stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),n??=2147483647,n<2)return 0;for(var r=e,o=(n-=2)<2*t.length?n/2:t.length,i=0;i<o;++i){var a=t.charCodeAt(i);g[e>>1]=a,e+=2}return g[e>>1]=0,e-r},Wt=t=>2*t.length,$t=(t,e)=>{E(t%4==0,"Pointer passed to UTF32ToString must be aligned to four bytes!");for(var n=0,r="";!(n>=e/4);){var o=b[t+4*n>>2];if(0==o)break;if(++n,o>=65536){var i=o-65536;r+=String.fromCharCode(55296|i>>10,56320|1023&i)}else r+=String.fromCharCode(o)}return r},Xt=(t,e,n)=>{if(E(e%4==0,"Pointer passed to stringToUTF32 must be aligned to four bytes!"),E("number"==typeof n,"stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),n??=2147483647,n<4)return 0;for(var r=e,o=r+n-4,i=0;i<t.length;++i){var a=t.charCodeAt(i);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++i)),b[e>>2]=a,(e+=4)+4>o)break}return b[e>>2]=0,e-r},Yt=t=>{for(var e=0,n=0;n<t.length;++n){var r=t.charCodeAt(n);r>=55296&&r<=57343&&++n,e+=4}return e},Zt=(t,e)=>{var n=_t[t];return void 0===n&>(`${e} has unknown type ${Dt(t)}`),n},Jt=(t,e,n)=>{var r=[],o=t.toWireType(r,n);return r.length&&(y[e>>2]=Et(r)),o},qt=[],Kt={},Qt=t=>{var e=Kt[t];return void 0===e?dt(t):e};Reflect.construct,Nt=()=>performance.now();var te=t=>{var e=h.buffer,n=(t-e.byteLength+65535)/65536;try{return h.grow(n),A(),1}catch(n){p(`growMemory: Attempted to grow heap from ${e.byteLength} bytes to ${t} bytes, but got error: ${n}`)}},ee=[null,[],[]],ne=(t,e)=>{var n=ee[t];E(n),0===e||10===e?((1===t?d:p)(rt(n,0)),n.length=0):n.push(e)};i.incrementExceptionRefcount=t=>ye(t),i.decrementExceptionRefcount=t=>we(t);var re,oe,ie=t=>ve(t),ae=t=>(t=>{var e=tt(),n=ie(4),r=ie(4);xe(t,n,r);var o,i=y[n>>2],a=y[r>>2],s=ot(i);return he(i),a&&(o=ot(a),he(a)),Q(e),[s,o]})(t);i.getExceptionMessage=ae,(()=>{for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);lt=t})(),ct=i.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError"}},ut=i.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError"}},wt.push(0,1,void 0,1,null,1,!0,1,!1,1),E(10===wt.length),i.count_emval_handles=()=>wt.length/2-5-yt.length,Ct=i.UnboundTypeError=(re=Error,(oe=Pt("UnboundTypeError",function(t){this.name="UnboundTypeError",this.message=t;var e=new Error(t).stack;void 0!==e&&(this.stack=this.toString()+"\n"+e.replace(/^Error(:[^\n]*)?\n/,""))})).prototype=Object.create(re.prototype),oe.prototype.constructor=oe,oe.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},oe);var se,le={__assert_fail:(t,e,n,r)=>{G(`Assertion failed: ${ot(t)}, at: `+[e?ot(e):"unknown filename",n,r?ot(r):"unknown function"])},__cxa_begin_catch:t=>{var e=new st(t);return e.get_caught()||e.set_caught(!0),e.set_rethrown(!1),it.push(e),ye(e.excPtr),e.get_exception_ptr()},__cxa_find_matching_catch_2:()=>ht([]),__cxa_find_matching_catch_3:t=>ht([t]),__cxa_throw:(t,e,n)=>{throw new st(t).init(e,n),at=new V(t)},__resumeException:t=>{throw at||(at=new V(t)),at},_abort_js:()=>{G("native code called abort()")},_embind_register_bigint:(t,e,n,r,o)=>{},_embind_register_bool:(t,e,n,r)=>{bt(t,{name:e=dt(e),fromWireType:function(t){return!!t},toWireType:function(t,e){return e?n:r},argPackAdvance:8,readValueFromPointer:function(t){return this.fromWireType(m[t])},destructorFunction:null})},_embind_register_emval:t=>bt(t,St),_embind_register_float:(t,e,n)=>{bt(t,{name:e=dt(e),fromWireType:t=>t,toWireType:(t,e)=>{if("number"!=typeof e&&"boolean"!=typeof e)throw new TypeError(`Cannot convert ${Mt(e)} to ${this.name}`);return e},argPackAdvance:8,readValueFromPointer:Rt(e,n),destructorFunction:null})},_embind_register_function:(t,e,n,r,o,a,s)=>{var l=((t,e)=>{for(var n=[],r=0;r<t;r++)n.push(y[e+4*r>>2]);return n})(e,n);t=(t=>{const e=(t=t.trim()).indexOf("(");return-1!==e?(E(")"==t[t.length-1],"Parentheses for argument names should match."),t.substr(0,e)):t})(t=dt(t)),o=jt(r,o),((t,e,n)=>{i.hasOwnProperty(t)?((void 0===n||void 0!==i[t].overloadTable&&void 0!==i[t].overloadTable[n])&>(`Cannot register public name '${t}' twice`),Bt(i,t,t),i.hasOwnProperty(n)&>(`Cannot register multiple overloads of a function with the same number of arguments (${n})!`),i[t].overloadTable[n]=e):(i[t]=e,void 0!==n&&(i[t].numArguments=n))})(t,function(){((t,e)=>{var n=[],r={};throw e.forEach(function t(e){r[e]||_t[e]||(mt[e]?mt[e].forEach(t):(n.push(e),r[e]=!0))}),new Ct(`${t}: `+n.map(Dt).join([", "]))})(`Cannot call ${t} due to unbound types`,l)},e-1),((n,r)=>{function l(r){var l=(n=>{var r=[n[0],null].concat(n.slice(1));return((t,e,n)=>{i.hasOwnProperty(t)||vt("Replacing nonexistent public symbol"),void 0!==i[t].overloadTable&&void 0!==n?i[t].overloadTable[n]=e:(i[t]=e,i[t].argCount=n)})(t,function(t,e,n,r,o,i){var a=e.length;a<2&>("argTypes array size mismatch! Must at least get return value and 'this' types!"),E(!i,"Async bindings are only supported with JSPI.");for(var s=null!==e[1]&&null!==n,l=It(e),c="void"!==e[0].name,u=[t,gt,r,o,Ft,e[0],e[1]],f=0;f<a-2;++f)u.push(e[f+2]);if(!l)for(f=s?1:2;f<e.length;++f)null!==e[f].destructorFunction&&u.push(e[f].destructorFunction);let[h,d]=function(t,e,n,r){for(var o=It(t),i=t.length,a="",s="",l=0;l<i-2;++l)a+=(0!==l?", ":"")+"arg"+l,s+=(0!==l?", ":"")+"arg"+l+"Wired";var c=`\n return function (${a}) {\n if (arguments.length !== ${i-2}) {\n throwBindingError('function ' + humanName + ' called with ' + arguments.length + ' arguments, expected ${i-2}');\n }`;o&&(c+="var destructors = [];\n");var u=o?"destructors":"null",f=["humanName","throwBindingError","invoker","fn","runDestructors","retType","classParam"];for(e&&(c+="var thisWired = classParam['toWireType']("+u+", this);\n"),l=0;l<i-2;++l)c+="var arg"+l+"Wired = argType"+l+"['toWireType']("+u+", arg"+l+");\n",f.push("argType"+l);if(e&&(s="thisWired"+(s.length>0?", ":"")+s),c+=(n||r?"var rv = ":"")+"invoker(fn"+(s.length>0?", ":"")+s+");\n",o)c+="runDestructors(destructors);\n";else for(l=e?1:2;l<t.length;++l){var h=1===l?"thisWired":"arg"+(l-2)+"Wired";null!==t[l].destructorFunction&&(c+=`${h}_dtor(${h});\n`,f.push(`${h}_dtor`))}return n&&(c+="var ret = retType['fromWireType'](rv);\nreturn ret;\n"),c+="}\n",[f,c=`if (arguments.length !== ${f.length}){ throw new Error(humanName + "Expected ${f.length} closure arguments " + arguments.length + " given."); }\n${c}`]}(e,s,c,i);h.push(d);var p=Ot(Function,h)(...u);return Pt(t,p)}(t,r,null,o,a,s),e-1),[]})(r);l.length!==n.length&&vt("Mismatched type converter count");for(var c=0;c<n.length;++c)bt(n[c],l[c])}n.forEach(function(t){mt[t]=r});var c=new Array(r.length),u=[],f=0;r.forEach((t,e)=>{_t.hasOwnProperty(t)?c[e]=_t[t]:(u.push(t),pt.hasOwnProperty(t)||(pt[t]=[]),pt[t].push(()=>{c[e]=_t[t],++f===u.length&&l(c)}))}),0===u.length&&l(c)})([],l)},_embind_register_integer:(t,e,n,r,o)=>{e=dt(e),-1===o&&(o=4294967295);var i=t=>t;if(0===r){var a=32-8*n;i=t=>t<<a>>>a}var s=e.includes("unsigned"),l=(t,n)=>{if("number"!=typeof t&&"boolean"!=typeof t)throw new TypeError(`Cannot convert "${Mt(t)}" to ${n}`);if(t<r||t>o)throw new TypeError(`Passing a number "${Mt(t)}" from JS side to C/C++ side to an argument of type "${e}", which is outside the valid range [${r}, ${o}]!`)};bt(t,{name:e,fromWireType:i,toWireType:s?function(t,e){return l(e,this.name),e>>>0}:function(t,e){return l(e,this.name),e},argPackAdvance:8,readValueFromPointer:Ut(e,n,0!==r),destructorFunction:null})},_embind_register_memory_view:(t,e,n)=>{var r=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][e];function o(t){var e=y[t>>2],n=y[t+4>>2];return new r(_.buffer,n,e)}bt(t,{name:n=dt(n),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},_embind_register_std_string:(t,e)=>{var n="std::string"===(e=dt(e));bt(t,{name:e,fromWireType(t){var e,r=y[t>>2],o=t+4;if(n)for(var i=o,a=0;a<=r;++a){var s=o+a;if(a==r||0==m[s]){var l=ot(i,s-i);void 0===e?e=l:(e+=String.fromCharCode(0),e+=l),i=s+1}}else{var c=new Array(r);for(a=0;a<r;++a)c[a]=String.fromCharCode(m[o+a]);e=c.join("")}return he(t),e},toWireType(t,e){var r;e instanceof ArrayBuffer&&(e=new Uint8Array(e));var o="string"==typeof e;o||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int8Array||gt("Cannot pass non-string to std::string"),r=n&&o?(t=>{for(var e=0,n=0;n<t.length;++n){var r=t.charCodeAt(n);r<=127?e++:r<=2047?e+=2:r>=55296&&r<=57343?(e+=4,++n):e+=3}return e})(e):e.length;var i,a,s,l=fe(4+r+1),c=l+4;if(y[l>>2]=r,n&&o)i=e,a=c,E("number"==typeof(s=r+1),"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),((t,e,n,r)=>{if(E("string"==typeof t,`stringToUTF8Array expects a string (got ${typeof t})`),!(r>0))return 0;for(var o=n,i=n+r-1,a=0;a<t.length;++a){var s=t.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&t.charCodeAt(++a)),s<=127){if(n>=i)break;e[n++]=s}else if(s<=2047){if(n+1>=i)break;e[n++]=192|s>>6,e[n++]=128|63&s}else if(s<=65535){if(n+2>=i)break;e[n++]=224|s>>12,e[n++]=128|s>>6&63,e[n++]=128|63&s}else{if(n+3>=i)break;s>1114111&&et("Invalid Unicode code point "+K(s)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."),e[n++]=240|s>>18,e[n++]=128|s>>12&63,e[n++]=128|s>>6&63,e[n++]=128|63&s}}e[n]=0})(i,m,a,s);else if(o)for(var u=0;u<r;++u){var f=e.charCodeAt(u);f>255&&(he(c),gt("String has UTF-16 code units that do not fit in 8 bits")),m[c+u]=f}else for(u=0;u<r;++u)m[c+u]=e[u];return null!==t&&t.push(he,l),l},argPackAdvance:8,readValueFromPointer:At,destructorFunction(t){he(t)}})},_embind_register_std_wstring:(t,e,n)=>{var r,o,i,a;n=dt(n),2===e?(r=Ht,o=Vt,a=Wt,i=t=>v[t>>1]):4===e&&(r=$t,o=Xt,a=Yt,i=t=>y[t>>2]),bt(t,{name:n,fromWireType:t=>{for(var n,o=y[t>>2],a=t+4,s=0;s<=o;++s){var l=t+4+s*e;if(s==o||0==i(l)){var c=r(a,l-a);void 0===n?n=c:(n+=String.fromCharCode(0),n+=c),a=l+e}}return he(t),n},toWireType:(t,r)=>{"string"!=typeof r&>(`Cannot pass non-string to C++ string type ${n}`);var i=a(r),s=fe(4+i+e);return y[s>>2]=i/e,o(r,s+4,i+e),null!==t&&t.push(he,s),s},argPackAdvance:8,readValueFromPointer:At,destructorFunction(t){he(t)}})},_embind_register_void:(t,e)=>{bt(t,{isVoid:!0,name:e=dt(e),argPackAdvance:0,fromWireType:()=>{},toWireType:(t,e)=>{}})},_emscripten_get_now_is_monotonic:()=>1,_emscripten_memcpy_js:(t,e,n)=>m.copyWithin(t,e,e+n),_emval_as:(t,e,n)=>(t=Tt(t),e=Zt(e,"emval::as"),Jt(e,n,t)),_emval_call:(t,e,n,r)=>(t=qt[t])(null,e=Tt(e),n,r),_emval_call_method:(t,e,n,r,o)=>(t=qt[t])(e=Tt(e),e[n=Qt(n)],r,o),_emval_decref:xt,_emval_get_method_caller:(t,e,n)=>{var r=((t,e)=>{for(var n=new Array(t),r=0;r<t;++r)n[r]=Zt(y[e+4*r>>2],"parameter "+r);return n})(t,e),o=r.shift();t--;var i="return function (obj, func, destructorsRef, args) {\n",a=0,s=[];0===n&&s.push("obj");for(var l=["retType"],c=[o],u=0;u<t;++u)s.push("arg"+u),l.push("argType"+u),c.push(r[u]),i+=` var arg${u} = argType${u}.readValueFromPointer(args${a?"+"+a:""});\n`,a+=r[u].argPackAdvance;i+=` var rv = ${1===n?"new func":"func.call"}(${s.join(", ")});\n`,o.isVoid||(l.push("emval_returnValue"),c.push(Jt),i+=" return emval_returnValue(retType, destructorsRef, rv);\n"),i+="};\n",l.push(i);var f,h,d=Ot(Function,l)(...c),p=`methodCaller<(${r.map(t=>t.name).join(", ")}) => ${o.name}>`;return f=Pt(p,d),h=qt.length,qt.push(f),h},_emval_get_module_property:t=>(t=Qt(t),Et(i[t])),_emval_get_property:(t,e)=>(t=Tt(t),e=Tt(e),Et(t[e])),_emval_incref:t=>{t>9&&(wt[t+1]+=1)},_emval_new_array:()=>Et([]),_emval_new_cstring:t=>Et(Qt(t)),_emval_new_object:()=>Et({}),_emval_run_destructors:t=>{var e=Tt(t);Ft(e),xt(t)},_emval_set_property:(t,e,n)=>{t=Tt(t),e=Tt(e),n=Tt(n),t[e]=n},_emval_take_value:(t,e)=>{var n=(t=Zt(t,"_emval_take_value")).readValueFromPointer(e);return Et(n)},emscripten_date_now:()=>Date.now(),emscripten_get_now:Nt,emscripten_resize_heap:t=>{var e=m.length;E((t>>>=0)>e);var n=2147483648;if(t>n)return p(`Cannot enlarge memory, requested ${t} bytes, but the limit is 2147483648 bytes!`),!1;for(var r=(t,e)=>t+(e-t%e)%e,o=1;o<=4;o*=2){var i=e*(1+.2/o);i=Math.min(i,t+100663296);var a=Math.min(n,r(Math.max(t,i),65536));if(te(a))return!0}return p(`Failed to grow the heap from ${e} bytes to ${a} bytes, not enough memory!`),!1},fd_close:t=>{G("fd_close called without SYSCALLS_REQUIRE_FILESYSTEM")},fd_seek:function(t,e,n,r,o){var i,a;return a=n,E((i=e)==i>>>0||i==(0|i)),E(a===(0|a)),70},fd_write:(t,e,n,r)=>{for(var o=0,i=0;i<n;i++){var a=y[e>>2],s=y[e+4>>2];e+=8;for(var l=0;l<s;l++)ne(t,m[a+l]);o+=s}return y[r>>2]=o,0},invoke_ii:function(t,e){var n=tt();try{return Lt(t)(e)}catch(t){if(Q(n),!(t instanceof H))throw t;de(1,0)}},invoke_iii:function(t,e,n){var r=tt();try{return Lt(t)(e,n)}catch(t){if(Q(r),!(t instanceof H))throw t;de(1,0)}},invoke_iiii:function(t,e,n,r){var o=tt();try{return Lt(t)(e,n,r)}catch(t){if(Q(o),!(t instanceof H))throw t;de(1,0)}},invoke_j:function(t){var e=tt();try{return Ae(t)}catch(t){if(Q(e),!(t instanceof H))throw t;de(1,0)}},invoke_v:function(t){var e=tt();try{Lt(t)()}catch(t){if(Q(e),!(t instanceof H))throw t;de(1,0)}},invoke_vi:function(t,e){var n=tt();try{Lt(t)(e)}catch(t){if(Q(n),!(t instanceof H))throw t;de(1,0)}},invoke_vii:function(t,e,n){var r=tt();try{Lt(t)(e,n)}catch(t){if(Q(r),!(t instanceof H))throw t;de(1,0)}},invoke_viii:function(t,e,n,r){var o=tt();try{Lt(t)(e,n,r)}catch(t){if(Q(o),!(t instanceof H))throw t;de(1,0)}},invoke_viiii:function(t,e,n,r,o){var i=tt();try{Lt(t)(e,n,r,o)}catch(t){if(Q(i),!(t instanceof H))throw t;de(1,0)}}},ce=function(){var t,e={env:le,wasi_snapshot_preview1:le};function n(t,e){var n;return ce=t.exports,E(h=ce.memory,"memory not found in wasm exports"),A(),E(kt=ce.__indirect_function_table,"table not found in wasm exports"),n=ce.__wasm_call_ctors,R.unshift(n),function(t){if(k--,i.monitorRunDependencies?.(k),t?(E(B[t]),delete B[t]):p("warning: run dependency removed without ID"),0==k&&(null!==C&&(clearInterval(C),C=null),N)){var e=N;N=null,e()}}("wasm-instantiate"),ce}t="wasm-instantiate",k++,i.monitorRunDependencies?.(k),t?(E(!B[t]),B[t]=1,null===C&&"undefined"!=typeof setInterval&&(C=setInterval(()=>{if(T)return clearInterval(C),void(C=null);var t=!1;for(var e in B)t||(t=!0,p("still waiting on run dependencies:")),p(`dependency: ${e}`);t&&p("(end of list)")},1e4))):p("warning: run dependency added without ID");var r,a,s,l,u,d,_=i;if(i.instantiateWasm)try{return i.instantiateWasm(e,n)}catch(t){p(`Module.instantiateWasm callback failed with error: ${t}`),o(t)}return j||(j=D(d="marchingsquares.wasm")?d:(u=d,i.locateFile?i.locateFile(u,c):c+u)),(r=f,a=j,s=e,l=function(t){E(i===_,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),_=null,n(t.instance)},r||"function"!=typeof WebAssembly.instantiateStreaming||D(a)||"function"!=typeof fetch?$(a,s,l):fetch(a,{credentials:"same-origin"}).then(t=>WebAssembly.instantiateStreaming(t,s).then(l,function(t){return p(`wasm streaming compile failed: ${t}`),p("falling back to ArrayBuffer instantiation"),$(a,s,l)}))).catch(o),{}}(),ue=(z("__wasm_call_ctors",0),z("__getTypeName",1)),fe=(z("fflush",1),z("malloc",1)),he=(z("strerror",1),z("free",1)),de=z("setThrew",2),pe=z("_emscripten_tempret_set",1),_e=()=>(_e=ce.emscripten_stack_init)(),me=()=>(me=ce.emscripten_stack_get_end)(),ge=t=>(ge=ce._emscripten_stack_restore)(t),ve=t=>(ve=ce._emscripten_stack_alloc)(t),be=()=>(be=ce.emscripten_stack_get_current)(),ye=(z("__cxa_free_exception",1),z("__cxa_increment_exception_refcount",1)),we=z("__cxa_decrement_exception_refcount",1),xe=z("__get_exception_message",3),Te=z("__cxa_can_catch",3),Ee=z("__cxa_is_pointer_type",1),Ae=i.dynCall_j=z("dynCall_j",1);function Se(){function t(){se||(se=!0,i.calledRun=!0,T||(E(!F),F=!0,S(),q(R),r(i),i.onRuntimeInitialized?.(),E(!i._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(S(),i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)O(i.postRun.shift());q(P)}()))}var e;k>0||(_e(),E(!(3&(e=me()))),0==e&&(e+=4),y[e>>2]=34821223,y[e+4>>2]=2310721022,y[0]=1668509029,function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)I(i.preRun.shift());q(M)}(),k>0||(i.setStatus?(i.setStatus("Running..."),setTimeout(function(){setTimeout(function(){i.setStatus("")},1),t()},1)):t(),S()))}if(i.dynCall_jiji=z("dynCall_jiji",5),["writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromI64","readI53FromU64","convertI32PairToI53","convertU32PairToI53","getTempRet0","zeroMemory","exitJS","isLeapYear","ydayFromDate","arraySum","addDays","strError","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","initRandomFill","randomFill","emscriptenLog","readEmAsmArgs","jstoi_q","getExecutableName","listenOnce","autoResumeAudioContext","handleException","keepRuntimeAlive","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","asmjsMangle","asyncLoad","alignMemory","mmapAlloc","HandleAllocator","getNativeTypeSize","STACK_SIZE","STACK_ALIGN","POINTER_SIZE","ASSERTIONS","getCFunc","ccall","cwrap","uleb128Encode","sigToWasmTypes","generateFuncType","convertJsFunctionToWasm","getEmptyTableSlot","updateTableMap","getFunctionAddress","addFunction","removeFunction","reallyNegative","unSign","strLen","reSign","formatString","intArrayFromString","intArrayToString","AsciiToString","stringToAscii","stringToNewUTF8","stringToUTF8OnStack","writeArrayToMemory","registerKeyEventCallback","maybeCStringToJsString","findEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","jsStackTrace","getCallstack","convertPCtoSourceLocation","getEnvStrings","checkWasiClock","wasiRightsToMuslOFlags","wasiOFlagsToMuslOFlags","createDyncallWrapper","safeSetTimeout","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","getPromise","makePromise","idsToPromises","makePromiseCallback","Browser_asyncPrepareDataCounter","setMainLoop","getSocketFromFD","getSocketAddress","FS_createPreloadedFile","FS_modeStringToFlags","FS_getMode","FS_stdin_getChar","FS_unlink","FS_createDataFile","FS_mkdirTree","_setNetworkCallback","heapObjectForWebGLType","toTypedArrayIndex","webgl_enable_ANGLE_instanced_arrays","webgl_enable_OES_vertex_array_object","webgl_enable_WEBGL_draw_buffers","webgl_enable_WEBGL_multi_draw","emscriptenWebGLGet","computeUnpackAlignedImageSize","colorChannelsInGlTextureFormat","emscriptenWebGLGetTexPixelData","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","__glGetActiveAttribOrUniform","writeGLArray","registerWebGlEventCallback","runAndAbortIfError","ALLOC_NORMAL","ALLOC_STACK","allocate","writeStringToMemory","writeAsciiToMemory","setErrNo","demangle","stackTrace","getFunctionArgsName","createJsInvokerSignature","init_embind","getBasestPointer","registerInheritedInstance","unregisterInheritedInstance","getInheritedInstance","getInheritedInstanceCount","getLiveInheritedInstances","enumReadValueFromPointer","genericPointerToWireType","constNoSmartPtrRawPointerToWireType","nonConstNoSmartPtrRawPointerToWireType","init_RegisteredPointer","RegisteredPointer","RegisteredPointer_fromWireType","runDestructor","releaseClassHandle","detachFinalizer","attachFinalizer","makeClassHandle","init_ClassHandle","ClassHandle","throwInstanceAlreadyDeleted","flushPendingDeletes","setDelayFunction","RegisteredClass","shallowCopyInternalPointer","downcastPointer","upcastPointer","validateThis","char_0","char_9","makeLegalFunctionName","emval_get_global"].forEach(function(t){"undefined"==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get(){var e=`\`${t}\` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line`,n=t;n.startsWith("_")||(n="$"+t),e+=` (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='${n}')`,Y(t)&&(e+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),et(e)}}),J(t)}),["run","addOnPreRun","addOnInit","addOnPreMain","addOnExit","addOnPostRun","addRunDependency","removeRunDependency","out","err","callMain","abort","wasmMemory","wasmExports","writeStackCookie","checkStackCookie","convertI32PairToI53Checked","stackSave","stackRestore","stackAlloc","setTempRet0","ptrToString","getHeapMax","growMemory","ENV","MONTH_DAYS_REGULAR","MONTH_DAYS_LEAP","MONTH_DAYS_REGULAR_CUMULATIVE","MONTH_DAYS_LEAP_CUMULATIVE","ERRNO_CODES","DNS","Protocols","Sockets","timers","warnOnce","readEmAsmArgsArray","jstoi_s","dynCallLegacy","getDynCaller","dynCall","wasmTable","noExitRuntime","freeTableIndexes","functionsInTableMap","setValue","getValue","PATH","PATH_FS","UTF8Decoder","UTF8ArrayToString","UTF8ToString","stringToUTF8Array","stringToUTF8","lengthBytesUTF8","UTF16Decoder","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","JSEvents","specialHTMLTargets","findCanvasEventTarget","currentFullscreenStrategy","restoreOldWindowedStyle","UNWIND_CACHE","ExitStatus","flush_NO_FILESYSTEM","promiseMap","uncaughtExceptionCount","exceptionLast","exceptionCaught","ExceptionInfo","findMatchingCatch","getExceptionMessageCommon","incrementExceptionRefcount","decrementExceptionRefcount","getExceptionMessage","Browser","getPreloadedImageData__data","wget","SYSCALLS","preloadPlugins","FS_stdin_getChar_buffer","FS_createPath","FS_createDevice","FS_readFile","FS","FS_createLazyFile","MEMFS","TTY","PIPEFS","SOCKFS","tempFixedLengthArray","miniTempWebGLFloatBuffers","miniTempWebGLIntBuffers","GL","AL","GLUT","EGL","GLEW","IDBStore","SDL","SDL_gfx","allocateUTF8","allocateUTF8OnStack","print","printErr","InternalError","BindingError","throwInternalError","throwBindingError","registeredTypes","awaitingDependencies","typeDependencies","tupleRegistrations","structRegistrations","sharedRegisterType","whenDependentTypesAreResolved","embind_charCodes","embind_init_charCodes","readLatin1String","getTypeName","getFunctionName","heap32VectorToArray","requireRegisteredType","usesDestructorStack","createJsInvoker","UnboundTypeError","PureVirtualError","GenericWireTypeSize","EmValType","throwUnboundTypeError","ensureOverloadTable","exposePublicSymbol","replacePublicSymbol","extendError","createNamedFunction","embindRepr","registeredInstances","registeredPointers","registerType","integerReadValueFromPointer","floatReadValueFromPointer","readPointer","runDestructors","newFunc","craftInvokerFunction","embind__requireFunction","finalizationRegistry","detachFinalizer_deps","deletionQueue","delayFunction","emval_freelist","emval_handles","emval_symbols","init_emval","count_emval_handles","getStringOrSymbol","Emval","emval_returnValue","emval_lookupTypes","emval_methodCallers","emval_addMethodCaller","reflectConstruct"].forEach(J),N=function t(){se||Se(),se||(N=t)},i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();Se(),n=a;for(const e of Object.keys(i))e in t||Object.defineProperty(t,e,{configurable:!0,get(){G(`Access to module property ('${e}') is no longer possible via the module constructor argument; Instead, use the result of the module constructor.`)}});return n});t.exports=n},631:t=>{t.exports="#version 300 es\n\nuniform int u_offset;\n\nin vec2 a_pos; // Has grid point position\nin vec2 a_tex_coord; // zoom info is on the x coordinate\nin lowp float a_geom; // Has corner info\nuniform lowp float u_bb_size;\nuniform lowp float u_map_aspect;\nuniform lowp float u_zoom;\nuniform lowp float u_bb_width; // Normalized by texture width\nuniform lowp float u_bb_height; // Normalized by texture height\nuniform highp float u_bb_mag_bin_size;\nuniform highp float u_bb_mag_wrap;\nuniform int u_rotate_with_map;\n\nuniform sampler2D u_u_sampler;\nuniform sampler2D u_v_sampler;\nuniform sampler2D u_rot_sampler;\n\nout highp vec2 v_tex_coord;\n#ifdef COLORMAP\nout highp float v_mag;\n#endif\n\nmat4 scalingMatrix(float x_scale, float y_scale, float z_scale) {\n return mat4(x_scale, 0.0, 0.0, 0.0,\n 0.0, y_scale, 0.0, 0.0,\n 0.0, 0.0, z_scale, 0.0,\n 0.0, 0.0, 0.0, 1.0);\n}\n\nmat4 rotationZMatrix(float angle) {\n float s = sin(angle);\n float c = cos(angle);\n\n return mat4( c, s, 0., 0.,\n -s, c, 0., 0.,\n 0., 0., 1., 0.,\n 0., 0., 0., 1.);\n}\n\nmat4 rotationXMatrix(float angle) {\n float s = sin(angle);\n float c = cos(angle);\n\n return mat4( 1., 0., 0., 0.,\n 0., c, s, 0.,\n 0., -s, c, 0.,\n 0., 0., 0., 1.);\n}\n\nvoid main() {\n float globe_width = 1.;\n vec2 globe_offset = vec2(globe_width * float(u_offset), 0.);\n\n mat4 map_stretch_matrix = scalingMatrix(1.0, 1. / u_map_aspect, 1.0);\n\n vec4 pivot_pos = projectTile(a_pos.xy + globe_offset);\n float globe_rotation = 0.0;\n\n if (u_rotate_with_map == 1) {\n vec4 pivot_pos_ihat = projectTile(a_pos.xy + globe_offset + vec2(1e-5, 0.));\n // Surely there's a more linear-algebra-y way to do this than converting all the rotations to an angle.\n vec2 pivot_east = normalize((inverse(map_stretch_matrix) * (pivot_pos_ihat - pivot_pos)).xy);\n globe_rotation = atan(pivot_east.x, pivot_east.y) - 3.141592654 / 2.0;\n }\n\n highp float min_zoom = floor(a_tex_coord.x);\n lowp float corner = a_geom;\n\n vec2 data_texcoord = a_tex_coord;\n data_texcoord.x = fract(data_texcoord.x);\n\n highp float u = texture(u_u_sampler, data_texcoord).r;\n highp float v = texture(u_v_sampler, data_texcoord).r;\n highp float rot = texture(u_rot_sampler, data_texcoord).r;\n\n lowp float bb_aspect = u_bb_width / u_bb_height;\n lowp float ang = (abs(u) < 1e-6 && abs(v) < 1e-6) ? 0. : atan(v, u) - 3.141592654 / 2.0;\n highp float mag = length(vec2(u, v));\n#ifdef COLORMAP\n v_mag = mag;\n#endif\n mag = floor(mag / u_bb_mag_bin_size + 0.5) * u_bb_mag_bin_size;\n\n vec4 offset = vec4(0.0, 0.0, 0.0, 0.0);\n vec2 texcoord = vec2(0.0, 0.0);\n \n if (u_zoom >= min_zoom) {\n // Subtracting a small number off of u_bb_mag_wrap fixes (I think) a precision issue on some GPUs\n vec2 tex_loc = vec2(mod(mag, u_bb_mag_wrap - 1e-5) / u_bb_mag_bin_size * u_bb_width, floor(mag / (u_bb_mag_wrap - 1e-5)) * u_bb_height);\n\n if (corner < 0.5) {\n offset = vec4(-u_bb_size, u_bb_size, 0., 0.);\n texcoord = tex_loc;\n }\n else if (corner < 1.5) {\n offset = vec4(u_bb_size, u_bb_size, 0., 0.);\n texcoord = tex_loc + vec2(u_bb_width, 0.0);\n }\n else if (corner < 2.5) {\n offset = vec4(-u_bb_size, -u_bb_size * (2. / bb_aspect - 1.), 0., 0.);\n texcoord = tex_loc + vec2(0.0, u_bb_height);\n }\n else if (corner < 3.5) {\n offset = vec4(u_bb_size, -u_bb_size * (2. / bb_aspect - 1.), 0., 0.);\n texcoord = tex_loc + vec2(u_bb_width, u_bb_height);\n }\n\n mat4 barb_rotation = rotationZMatrix(ang - globe_rotation - rot);\n offset = map_stretch_matrix * barb_rotation * offset;\n }\n\n gl_Position = pivot_pos + offset;\n v_tex_coord = texcoord;\n}"},829:t=>{t.exports="#version 300 es\n\nuniform int u_offset;\n\nin vec2 a_pos;\nin vec2 a_tex_coord;\n\nout highp vec2 v_tex_coord;\n\nvoid main() {\n float globe_width = 1.;\n vec2 globe_offset = vec2(globe_width * float(u_offset), 0.);\n\n gl_Position = projectTile(a_pos.xy + globe_offset);\n v_tex_coord = a_tex_coord;\n}"},840:t=>{t.exports="#version 300 es\n\nuniform int u_offset;\n\nin vec3 a_pos;\nin vec2 a_extrusion;\nin float a_data;\n\n#ifdef ZOOM\nin float a_min_zoom;\n#endif\n\n#ifdef OFFSET\nin vec2 a_offset;\n#endif\n\nuniform lowp float u_line_width;\nuniform lowp float u_map_width;\nuniform lowp float u_map_height;\n//uniform highp float u_map_bearing;\n\n#ifdef ZOOM\nuniform lowp float u_zoom;\n#endif\n\n#ifdef OFFSET\nuniform int u_offset_rotates_with_map;\nuniform lowp float u_offset_scale;\n#endif\n\n#ifdef DATA\nout highp float v_data;\n#endif\n\nout highp float v_dist;\nout lowp float v_cross;\n\nmat4 scalingMatrix(float x_scale, float y_scale, float z_scale) {\n return mat4(x_scale, 0.0, 0.0, 0.0,\n 0.0, y_scale, 0.0, 0.0,\n 0.0, 0.0, z_scale, 0.0,\n 0.0, 0.0, 0.0, 1.0);\n}\n\nmat4 rotationZMatrix(float angle) {\n float s = sin(angle);\n float c = cos(angle);\n\n return mat4( c, s, 0., 0.,\n -s, c, 0., 0.,\n 0., 0., 1., 0.,\n 0., 0., 0., 1.);\n}\n\nmat4 rotationXMatrix(float angle) {\n float s = sin(angle);\n float c = cos(angle);\n\n return mat4( 1., 0., 0., 0.,\n 0., c, s, 0.,\n 0., -s, c, 0.,\n 0., 0., 0., 1.);\n}\n\nvoid main() {\n float globe_width = 1.;\n vec2 globe_offset = vec2(globe_width * float(u_offset), 0.);\n\n v_dist = abs(a_pos.z);\n v_cross = sign(a_pos.z);\n vec4 center_pos = projectTile(a_pos.xy + globe_offset);\n vec4 offset = vec4(0.0, 0.0, 0.0, 0.0);\n\n#ifdef ZOOM\n if (u_zoom >= a_min_zoom) {\n#endif\n\n vec2 offset_ext = u_line_width * 2. * a_extrusion;\n\n mat4 map_stretch_matrix = scalingMatrix(u_map_height / u_map_width, 1., 1.);\n \n vec4 center_pos_ihat = projectTile(a_pos.xy + globe_offset + vec2(1e-5, 0.));\n // Surely there's a more linear-algebra-y way to do this than converting all the rotations to an angle.\n vec2 center_east = normalize((inverse(map_stretch_matrix) * (center_pos_ihat - center_pos)).xy);\n float globe_rotation = atan(center_east.x, center_east.y) - 3.141592654 / 2.0;\n mat4 rotation_matrix = rotationZMatrix(-globe_rotation);\n\n offset = map_stretch_matrix * rotation_matrix * vec4(offset_ext, 0., 0.);\n\n#ifdef OFFSET\n mat4 offset_matrix = scalingMatrix(1., u_map_width / u_map_height, 1.);\n if (u_offset_rotates_with_map == 1) {\n offset_matrix = offset_matrix * rotation_matrix;\n }\n else {\n offset = map_stretch_matrix * vec4(offset_ext, 0., 0.);\n }\n\n vec2 offset_offset = u_offset_scale * a_offset;\n offset += offset_matrix * vec4(offset_offset, 0., 0.);\n#endif\n\n#ifdef ZOOM\n }\n#endif\n\n gl_Position = center_pos + offset;\n\n#ifdef DATA\n v_data = a_data;\n#endif\n}"},873:t=>{t.exports="#version 300 es\n\nuniform int u_offset;\nuniform highp float u_map_width;\nuniform highp float u_map_height;\nuniform highp float u_map_zoom;\nuniform highp float u_font_size;\n\nin vec3 a_pos;\nin vec2 a_offset;\nin vec2 a_tex_coord;\n\nout highp vec2 v_tex_coord;\n\nmat4 scalingMatrix(float x_scale, float y_scale, float z_scale) {\n return mat4(x_scale, 0.0, 0.0, 0.0,\n 0.0, y_scale, 0.0, 0.0,\n 0.0, 0.0, z_scale, 0.0,\n 0.0, 0.0, 0.0, 1.0);\n}\n\nvoid main() {\n float min_zoom = a_pos.z;\n\n vec2 offset = a_offset;\n if (u_map_zoom < min_zoom)\n offset = vec2(0., 0.);\n\n float globe_width = 1.;\n vec2 globe_offset = vec2(globe_width * float(u_offset), 0.);\n\n mat4 map_stretch_matrix = scalingMatrix(u_map_height / u_map_width, 1., 1.);\n\n gl_Position = projectTile(a_pos.xy + globe_offset) + u_font_size / 12. * 1.5 * map_stretch_matrix * vec4(offset, 0., 0.);\n v_tex_coord = a_tex_coord;\n}"},934:t=>{t.exports="#version 300 es\n\nuniform sampler2D u_dash_sampler;\n\n#ifndef DATA\nuniform lowp vec4 u_color;\n#endif\n\nuniform lowp float u_line_width;\nuniform lowp float u_zoom;\nuniform int u_dash_pattern_length;\n\n#ifdef DATA\nin highp float v_data;\n#endif\n\nin highp float v_dist;\nin lowp float v_cross;\n\nout highp vec4 fragColor;\n\nvoid main() {\n lowp float dash_x = fract(v_dist * 2e2 * pow(2., floor(u_zoom)) / float(u_dash_pattern_length));\n lowp float dash = texture(u_dash_sampler, vec2(dash_x, 0.5)).r;\n\n lowp vec4 color;\n#ifdef DATA\n color = apply_colormap(v_data);\n#else\n color = u_color;\n#endif\n\n lowp float feather = clamp((1. - abs(v_cross)) * u_line_width, 0., 1.);\n color.a *= (dash >= 1. ? 1. : 0.) * feather;\n\n fragColor = color;\n}"},947:t=>{t.exports="#version 300 es\n\nin highp vec2 v_tex_coord;\nuniform sampler2D u_sdf_sampler;\nuniform int u_is_halo;\n\nuniform lowp vec4 u_text_color;\nuniform lowp vec4 u_halo_color;\n\n#define SDF_FILL 0.75\n#define SDF_HALO 0.45\n\nout highp vec4 fragColor;\n\nvoid main() {\n highp float sdf_val = texture(u_sdf_sampler, v_tex_coord).r;\n\n lowp float step_width = 0.08;\n lowp float alpha = smoothstep(SDF_FILL - step_width, SDF_FILL + step_width, sdf_val);\n\n lowp vec4 color = u_is_halo == 1 ? u_halo_color : u_text_color;\n\n if (u_is_halo == 1) {\n alpha = min(smoothstep(SDF_HALO - step_width, SDF_HALO + step_width, sdf_val), 1.0 - alpha);\n }\n\n color.a *= alpha;\n fragColor = color;\n}"}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}n.m=t,n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.u=t=>t+".autumnplot-gl.js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;n.g.importScripts&&(t=n.g.location+"");var e=n.g.document;if(!t&&e&&(e.currentScript&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");if(r.length)for(var o=r.length-1;o>-1&&(!t||!/^http(s?):/.test(t));)t=r[o--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=t})(),n.b=document.baseURI||self.location.href;var r={};return(()=>{"use strict";n.r(r),n.d(r,{Barbs:()=>lo,Color:()=>An,ColorMap:()=>Rn,Contour:()=>Rr,ContourFill:()=>Kr,ContourLabels:()=>Mr,Grid:()=>dr,Hodographs:()=>Ao,LambertGrid:()=>gr,MultiPlotLayer:()=>Lo,Paintball:()=>go,PlateCarreeGrid:()=>_r,PlateCarreeRotatedGrid:()=>mr,PlotComponent:()=>k,PlotLayer:()=>Go,Raster:()=>qr,RawObsField:()=>zr,RawProfileField:()=>Ur,RawScalarField:()=>jr,RawVectorField:()=>Dr,StationPlot:()=>Co,StructuredGrid:()=>pr,UnstructuredGrid:()=>vr,colormaps:()=>Ho,initAutumnPlot:()=>Vo,makeColorBar:()=>Uo,makePaintballKey:()=>zo});const t=Symbol("Comlink.proxy"),e=Symbol("Comlink.endpoint"),o=Symbol("Comlink.releaseProxy"),i=Symbol("Comlink.thrown"),a=t=>"object"==typeof t&&null!==t||"function"==typeof t,s=new Map([["proxy",{canHandle:e=>a(e)&&e[t],serialize(t){const{port1:e,port2:n}=new MessageChannel;return l(t,e),[n,[n]]},deserialize:t=>(t.start(),u(t))}],["throw",{canHandle:t=>a(t)&&i in t,serialize({value:t}){let e;return e=t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[e,[]]},deserialize(t){if(t.isError)throw Object.assign(new Error(t.value.message),t.value);throw t.value}}]]);function l(e,n=self){n.addEventListener("message",function r(o){if(!o||!o.data)return;const{id:a,type:s,path:u}=Object.assign({path:[]},o.data),f=(o.data.argumentList||[]).map(m);let h;try{const n=u.slice(0,-1).reduce((t,e)=>t[e],e),r=u.reduce((t,e)=>t[e],e);switch(s){case"GET":h=r;break;case"SET":n[u.slice(-1)[0]]=m(o.data.value),h=!0;break;case"APPLY":h=r.apply(n,f);break;case"CONSTRUCT":h=function(e){return Object.assign(e,{[t]:!0})}(new r(...f));break;case"ENDPOINT":{const{port1:t,port2:n}=new MessageChannel;l(e,n),h=function(t,e){return p.set(t,e),t}(t,[t])}break;case"RELEASE":h=void 0;break;default:return}}catch(t){h={value:t,[i]:0}}Promise.resolve(h).catch(t=>({value:t,[i]:0})).then(t=>{const[e,o]=_(t);n.postMessage(Object.assign(Object.assign({},e),{id:a}),o),"RELEASE"===s&&(n.removeEventListener("message",r),c(n))})}),n.start&&n.start()}function c(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function u(t,e){return h(t,[],e)}function f(t){if(t)throw new Error("Proxy has been released and is not useable")}function h(t,n=[],r=function(){}){let i=!1;const a=new Proxy(r,{get(e,r){if(f(i),r===o)return()=>g(t,{type:"RELEASE",path:n.map(t=>t.toString())}).then(()=>{c(t),i=!0});if("then"===r){if(0===n.length)return{then:()=>a};const e=g(t,{type:"GET",path:n.map(t=>t.toString())}).then(m);return e.then.bind(e)}return h(t,[...n,r])},set(e,r,o){f(i);const[a,s]=_(o);return g(t,{type:"SET",path:[...n,r].map(t=>t.toString()),value:a},s).then(m)},apply(r,o,a){f(i);const s=n[n.length-1];if(s===e)return g(t,{type:"ENDPOINT"}).then(m);if("bind"===s)return h(t,n.slice(0,-1));const[l,c]=d(a);return g(t,{type:"APPLY",path:n.map(t=>t.toString()),argumentList:l},c).then(m)},construct(e,r){f(i);const[o,a]=d(r);return g(t,{type:"CONSTRUCT",path:n.map(t=>t.toString()),argumentList:o},a).then(m)}});return a}function d(t){const e=t.map(_);return[e.map(t=>t[0]),(n=e.map(t=>t[1]),Array.prototype.concat.apply([],n))];var n}const p=new WeakMap;function _(t){for(const[e,n]of s)if(n.canHandle(t)){const[r,o]=n.serialize(t);return[{type:"HANDLER",name:e,value:r},o]}return[{type:"RAW",value:t},p.get(t)||[]]}function m(t){switch(t.type){case"HANDLER":return s.get(t.name).deserialize(t.value);case"RAW":return t.value}}function g(t,e,n){return new Promise(r=>{const o=new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");t.addEventListener("message",function e(n){n.data&&n.data.id&&n.data.id===o&&(t.removeEventListener("message",e),r(n.data))}),t.start&&t.start(),t.postMessage(Object.assign({id:o},e),n)})}var v=function(){return v=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},v.apply(this,arguments)},b=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},y=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))};function w(t,e,n){for(var r=1,o=n;t%o!=0||e%o!=0;)r+=1,o/=2;return r}function x(){var t,e,n,r=[];for(t=0;t<arguments.length;t++)r[t]=arguments[t];return function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,function(t){switch(t.label){case 0:e=r.map(function(t){return t[Symbol.iterator]()}),t.label=1;case 1:return(n=e.map(function(t){return t.next()})).some(function(t){return t.done})?[3,3]:[4,n.map(function(t){return t.value})];case 2:return t.sent(),[3,1];case 3:return[2]}})}var T=function(){function t(t,e){this.cached_values={},this.compute_value=t,this.make_key=void 0===e?function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return JSON.stringify(t)}:e}return t.prototype.getValue=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.make_key.apply(this,y([],b(t),!1));return n in this.cached_values||(this.cached_values[n]=this.compute_value.apply(this,y([],b(t),!1))),this.cached_values[n]},t}();function E(t,e){var n=v({},e);return void 0!==t&&Object.entries(t).forEach(function(t){var e=b(t,2),r=e[0],o=e[1];n[r]=o}),n}function A(t){return t.constructor}function S(t,e){var n="#version 300 es\n";return e.startsWith(n)?n+t+"\n"+e.slice(16):t+"\n"+e}var M=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},R=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))};function P(t){return"smu"in t&&"smv"in t}function F(t){return t.getParameter(t.VERSION).includes("WebGL 2.0")}function I(t){return"modelViewProjectionMatrix"in(e=t)&&"defaultProjectionData"in e&&"mainMatrix"in e.defaultProjectionData?{type:"maplibre",defaultProjectionData:{clippingPlane:R([],M(t.defaultProjectionData.clippingPlane),!1),fallbackMatrix:R([],M(t.defaultProjectionData.fallbackMatrix),!1),mainMatrix:R([],M(t.defaultProjectionData.mainMatrix),!1),projectionTransition:t.defaultProjectionData.projectionTransition,tileMercatorCoords:R([],M(t.defaultProjectionData.tileMercatorCoords),!1)},farZ:t.farZ,fov:t.fov,modelViewProjectionMatrix:R([],M(t.modelViewProjectionMatrix),!1),nearZ:t.nearZ,projectionMatrix:R([],M(t.projectionMatrix),!1),shaderData:t.shaderData}:{type:"autumn",mainMatrix:R([],M(t),!1),shaderData:null};var e}var O=u(new Worker(new URL(n.p+n.u(983),n.b))),k=function(){};function C(t,e){var n,r,o,i,a,s,l,c=F(t);if("float16"==e){var u=t.getExtension("OES_texture_half_float"),f=t.getExtension("OES_texture_half_float_linear");if(c)n=t.R16F,r=t.HALF_FLOAT;else{if(null===u||null===f)throw"Float16 data are not supported on this hardware. Try Float32 data instead.";n=t.LUMINANCE,r=u.HALF_FLOAT_OES}o=2}else if("float32"==e){if(u=t.getExtension("OES_texture_float"),f=t.getExtension("OES_texture_float_linear"),!c&&null===u||!c&&null===f||"iOS"===(i=window.navigator.userAgent,a=window.navigator.platform,l=null,-1!==(s=["Macintosh","MacIntel","MacPPC","Mac68K"]).indexOf(a)&&navigator.maxTouchPoints<=1?l="Mac OS":-1!==["iPhone","iPad","iPod"].indexOf(a)||-1!==s.indexOf(a)&&navigator.maxTouchPoints>1?l="iOS":-1!==["Win32","Win64","Windows","WinCE"].indexOf(a)?l="Windows":/Android/.test(i)?l="Android":/Linux/.test(a)&&(l="Linux"),l))throw"Float32 data are not supported on this hardware. Try Float16 data instead.";n=c?t.R32F:t.LUMINANCE,r=t.FLOAT,o=4}else n=c?t.R8:t.LUMINANCE,r=t.UNSIGNED_BYTE,o=1;return{format:n,type:r,row_alignment:o}}function N(t){var e,n,r=function(t){var e=Math.sin(t);return Math.tan(Math.PI/4-t/2)*Math.pow((1+s*e)/(1-s*e),s/2)},o=function(t){var e=Math.sin(t);return Math.cos(t)/Math.sqrt(1-s*s*e*e)},i=t.a,a=t.b,s=Math.sqrt(1-a*a/(i*i)),l=Math.PI/180,c=t.lon_0,u=t.lat_0,f=t.lat_std;f=Array.isArray(f)&&f[0]==f[1]?f[0]:f,c*=l;var h=r(u*=l);if(Array.isArray(f)){var d=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}(f,2),p=d[0],_=d[1];_*=l;var m=r(p*=l),g=r(_),v=o(p),b=o(_);n=Math.log(v/b)/Math.log(m/g),e=v/(n*Math.pow(m,n))}else p=f,m=r(p*=l),v=o(p),n=Math.sin(p),e=v/(n*Math.pow(m,n));var y=i*e*Math.pow(h,n),w=s*s,x=w*w,T=x*w,E=T*w,A=w/2+5*x/24+3*T/120-73*E/2016,S=7*x/24+29*T/120+233*E/6720,M=7*T/30+81*E/280,R=4729*E/20160;return function(t,o,a){return(a=void 0===a?{inverse:!1}:a).inverse?(s=t,u=o,f=Math.atan2(s,y-u)/n+c,h=Math.hypot(s,y-u)*Math.sign(n),d=Math.pow(h/(i*e),1/n),p=Math.PI/2-2*Math.atan(d),_=Math.sin(2*p),m=Math.cos(2*p),[f/l,(p+_*(A+m*(S+m*(M+R*m))))/l]):function(t,o){t*=l;var a=r(o*=l),s=i*e*Math.pow(a,n),u=n*(t-c);return[s*Math.sin(u),y-s*Math.cos(u)]}(t,o);var s,u,f,h,d,p,_,m}}var B=function(){function t(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: (".concat(t,", ").concat(e,")"));if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}return t.prototype.toMercatorCoord=function(){return{x:(r=this.lng,(180+r)/360),y:(t=this.lat,e=Math.sin(t*Math.PI/180),n=(180-90/Math.PI*Math.log((1+e)/(1-e)))/360,Math.min(1.5,Math.max(-.5,n)))};var t,e,n,r},t.fromMercatorCoord=function(e,n){return new t(function(t){return 360*t-180}(e),function(t){return 180*Math.atan(Math.sinh((180-360*t)*Math.PI/180))/Math.PI}(n))},t}();function G(t){return t.getParameter(t.VERSION).includes("WebGL 2.0")}class L{constructor(t,e,n,r,o){this.gl=t,this.n_coords_per_vert=n,this.dtype=((t,e)=>({Float32Array:t.FLOAT,Uint8Array:t.UNSIGNED_BYTE,Uint16Array:t.UNSIGNED_SHORT,Uint32Array:t.UNSIGNED_INT}[e.constructor.name]))(t,e),this.n_verts=e.length/n,this.draw_mode=r;const i=t.createBuffer();if(null===i)throw"Could not create WebGL buffer";this.buffer=i,t.bindBuffer(o,this.buffer),t.bufferData(o,e,t.STATIC_DRAW)}}class j extends L{constructor(t,e,n,r,o){if(super(t,e,n,r,t.ARRAY_BUFFER),o=void 0===o?{}:o,this.is_per_instance=void 0!==o.per_instance&&o.per_instance,G(this.gl))this.vadFunc=this.gl.vertexAttribDivisor.bind(this.gl);else{const t=this.gl.getExtension("ANGLE_instanced_arrays");this.vadFunc=t.vertexAttribDivisorANGLE.bind(t)}}bindToProgram(t){this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.buffer),this.gl.enableVertexAttribArray(t),this.gl.vertexAttribPointer(t,this.n_coords_per_vert,this.dtype,!1,0,0);const e=this.is_per_instance?1:0;this.vadFunc(t,e)}}class D{constructor(t,e){this.gl=t;const n=t.createTexture();if(null===n)throw"Could not create WebGL texture";this.texture=n,this.tex_num=null,this.setImageData(e);const r=void 0===e.mag_filter?t.LINEAR:e.mag_filter;t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,r)}setImageData(t){const e=this.gl;this.spec=t,e.bindTexture(e.TEXTURE_2D,this.texture);const n=G(e)?function(t,e,n){switch(n){case t.UNSIGNED_BYTE:switch(e){case t.RGBA8:case t.RGB5_A1:case t.RGBA4:case t.SRGB8_ALPHA8:return t.RGBA;case t.RGBA8UI:return t.RGBA_INTEGER;case t.RGB8:case t.RGB565:case t.SRGB8:return t.RGB;case t.RGB8UI:return t.RGB_INTEGER;case t.RG8:return t.RG;case t.RG8UI:return t.RG_INTEGER;case t.R8:return t.RED;case t.R8UI:return t.RED_INTEGER;case t.RGBA:return t.RGBA;case t.RGB:return t.RGB;case t.LUMINANCE_ALPHA:return t.LUMINANCE_ALPHA;case t.LUMINANCE:return t.LUMINANCE;case t.ALPHA:return t.ALPHA}break;case t.BYTE:switch(e){case t.RGBA8_SNORM:return t.RGBA;case t.RGBA8I:return t.RGBA_INTEGER;case t.RGB8_SNORM:return t.RGB;case t.RGB8I:return t.RGB_INTEGER;case t.RG8_SNORM:return t.RG;case t.RG8I:return t.RG_INTEGER;case t.R8_SNORM:return t.RED;case t.R8I:return t.RED_INTEGER}break;case t.UNSIGNED_SHORT_4_4_4_4:switch(e){case t.RGBA4:case t.RGBA:return t.RGBA}break;case t.UNSIGNED_SHORT_5_5_5_1:switch(e){case t.RGB5_A1:case t.RGBA:return t.RGBA}break;case t.UNSIGNED_INT_2_10_10_10_REV:switch(e){case t.RGB10_A2:case t.RGB5_A1:return t.RGBA;case t.RGB10_A2UI:return t.RGBA_INTEGER}break;case t.HALF_FLOAT:switch(e){case t.RGBA16F:return t.RGBA;case t.RGB16F:case t.R11F_G11F_B10F:case t.RGB9_E5:return t.RGB;case t.RG16F:return t.RG;case t.R16F:return t.RED}break;case t.FLOAT:switch(e){case t.RGBA32F:case t.RGBA16F:return t.RGBA;case t.RGB32F:case t.RGB16F:case t.R11F_G11F_B10F:case t.RGB9_E5:return t.RGB;case t.RG32F:case t.RG16F:return t.RG;case t.R32F:case t.R16F:return t.RED;case t.DEPTH_COMPONENT32F:return t.DEPTH_COMPONENT}break;case t.UNSIGNED_SHORT:switch(e){case t.RGBA16UI:return t.RGBA_INTEGER;case t.RGB16UI:return t.RGB_INTEGER;case t.RG16UI:return t.RG_INTEGER;case t.R16UI:return t.RED_INTEGER;case t.DEPTH_COMPONENT16:return t.DEPTH_COMPONENT}break;case t.SHORT:switch(e){case t.RGBA16I:return t.RGBA_INTEGER;case t.RGB16I:return t.RGB_INTEGER;case t.RG16I:return t.RG_INTEGER;case t.R16I:return t.RED_INTEGER}break;case t.UNSIGNED_INT:switch(e){case t.RGBA32UI:return t.RGBA_INTEGER;case t.RGB32UI:return t.RGB_INTEGER;case t.RG32UI:return t.RG_INTEGER;case t.R32UI:return t.RED_INTEGER;case t.DEPTH_COMPONENT24:case t.DEPTH_COMPONENT16:return t.DEPTH_COMPONENT}break;case t.INT:switch(e){case t.RGBA32I:return t.RGBA_INTEGER;case t.RGB32I:return t.RGB_INTEGER;case t.RG32I:return t.RG_INTEGER;case t.R32I:return t.RED_INTEGER}break;case t.UNSIGNED_SHORT_5_6_5:switch(e){case t.RGB565:case t.RGB:return t.RGB}break;case t.UNSIGNED_INT_10F_11F_11F_REV:if(e===t.R11F_G11F_B10F)return t.RGB;break;case t.UNSIGNED_INT_5_9_9_9_REV:if(e===t.RGB9_E5)return t.RGB;break;case t.UNSIGNED_INT_24_8:if(e===t.DEPTH24_STENCIL8)return t.DEPTH_STENCIL;break;case t.FLOAT_32_UNSIGNED_INT_24_8_REV:if(e===t.DEPTH32F_STENCIL8)return t.DEPTH_STENCIL;break;default:throw"Unknown format in getWebGL2InternalFormat"}throw"Invalid combination of internal format and data type"}(e,t.format,t.type):t.format,r=void 0===t.row_alignment?4:t.row_alignment;var o;e.pixelStorei(e.UNPACK_ALIGNMENT,r),"width"in(o=t)&&"height"in o?e.texImage2D(e.TEXTURE_2D,0,t.format,t.width,t.height,0,n,t.type,t.image):e.texImage2D(e.TEXTURE_2D,0,t.format,n,t.type,t.image)}bindToProgram(t,e){this.activate(e),this.gl.uniform1i(t,e)}activate(t){this.tex_num=t,this.gl.activeTexture(this.gl.TEXTURE0+this.tex_num),this.gl.bindTexture(this.gl.TEXTURE_2D,this.texture)}deactivate(){null!==this.tex_num&&(this.gl.activeTexture(this.gl.TEXTURE0+this.tex_num),this.gl.bindTexture(this.gl.TEXTURE_2D,null),this.tex_num=null)}delete(){this.gl.deleteTexture(this.texture),this.tex_num=null}}function U(t,e){const n=void 0===(e=void 0===e?{}:e).define?[]:[...e.define],r=[],o={},i=t.split("\n").map(t=>{const e=t.match(/#define\s+([\w\d_]+)/i);null!==e&&n.push(e[1]);const i=t.match(/#ifdef\s+([\w\d_]+)/i);if(null!==i)return r.push(i[1]),o[i[1]]=!0,"";const a=t.match(/#ifndef\s+([\w\d_]+)/i);if(null!==a)return r.push(a[1]),o[a[1]]=!1,"";if(null!==t.match(/#else/i)){const t=r[r.length-1];return o[t]=!o[t],""}if(null!==t.match(/#endif/i)){const t=r.pop();return o[t]=void 0,""}return r.map(t=>n.includes(t)==o[t]).reduce((t,e)=>t&&e,!0)?t:""}).join("\n");if(r.length>0)throw"Unterminated #ifdef/#ifndef block in shader";return i}class z{constructor(t,e,n,r){e=U(e,r),n=U(n,r),this.gl=t,this.prog=((t,e,n)=>{const r=t.createShader(t.VERTEX_SHADER);if(null===r)throw"Could not create vertex shader";if(t.shaderSource(r,e),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS)){const e=t.getShaderInfoLog(r);console.log("Vertex shader compiler log: "+e)}const o=t.createShader(t.FRAGMENT_SHADER);if(null===o)throw"Could not create fragment shader";if(t.shaderSource(o,n),t.compileShader(o),!t.getShaderParameter(o,t.COMPILE_STATUS)){const e=t.getShaderInfoLog(o);console.log("Fragment shader compiler log: "+e)}const i=t.createProgram();if(null===i)throw"Could not create shader program";if(t.attachShader(i,r),t.attachShader(i,o),t.linkProgram(i),!t.getProgramParameter(i,t.LINK_STATUS)){const e=t.getProgramInfoLog(i);console.log("Linker log: "+e)}return i})(t,e,n),this.attributes={},this.uniforms={},this.n_verts=null,this.draw_mode=null,this.index_buffer=null,this.sampler_names=[],this.instance_count=0;const o=t=>{const e=t.indexOf("//");return e>=0&&(t=t.slice(0,e)),t};e=e.split("\n").map(o).join("\n"),n=n.split("\n").map(o).join("\n");const i=G(this.gl);if(!i&&(e.includes("#version 300 es")||n.includes("#version 300 es")))throw"WebGL2 context required for shader source containing '#version 300 es'";let a=i?/\b(?:in|attribute)+([\w ]+?) +([\w_]+);[\s]*/gm:/attribute +([\w ]+?) +([\w_]+);[\s]*/gm;for(const n of e.matchAll(a)){const[e,r,o]=n;this.attributes[o]={type:r,location:t.getAttribLocation(this.prog,o)}}for(const n of e.matchAll(/uniform +([\w ]+?) +([\w_]+)(?:[\s]*\[.*\])?;[\s]*/gm)){const[e,r,o]=n,i=r.split(" "),a=t.getUniformLocation(this.prog,o);if(null===a)throw`Could not get vertex shader uniform location for '${o}'`;this.uniforms[o]={type:i[i.length-1],location:a}}for(const e of n.matchAll(/uniform +([\w ]+?) +([\w_]+)(?:[\s]*\[.*\])?;[\s]*/gm)){const[n,r,o]=e,i=r.split(" "),a=t.getUniformLocation(this.prog,o);if(null===a)throw`Could not get fragment shader uniform location for '${o}'`;this.uniforms[o]={type:i[i.length-1],location:a}}if(Object.entries(this.uniforms).forEach(([t,e])=>{"sampler2d"==e.type.toLowerCase()&&this.sampler_names.push(t)}),G(this.gl))this.daiFunc=this.gl.drawArraysInstanced.bind(this.gl),this.deiFunc=this.gl.drawElementsInstanced.bind(this.gl);else{const t=this.gl.getExtension("ANGLE_instanced_arrays");this.daiFunc=t.drawArraysInstancedANGLE.bind(t),this.deiFunc=t.drawElementsInstancedANGLE.bind(t)}}use(t,e,n,r){this.gl.useProgram(this.prog),void 0!==r?(r.bind(),this.index_buffer=r):this.index_buffer=null,this.draw_mode=null,this.n_verts=null,this.instance_count=0,void 0!==t&&this.bindAttributes(t),void 0!==e&&this.setUniforms(e),void 0!==n&&this.bindTextures(n)}bindAttributes(t){Object.entries(t).forEach(([t,e])=>{if(void 0===this.attributes[t])return void console.warn(`Skipping attribute buffer provided for '${t}' because the attribute was not found in the program.`);if(this.draw_mode=null===this.draw_mode?e.draw_mode:this.draw_mode,e.is_per_instance){if(0==this.instance_count)this.instance_count=e.n_verts;else if(this.instance_count!=e.n_verts)throw`Unexpected number of instances for attribute buffer ${t} (expected ${this.instance_count}, got ${e.n_verts})`}else{if(this.n_verts=null===this.n_verts?e.n_verts:this.n_verts,this.n_verts!=e.n_verts)throw`Unexpected number of vertices for attribute buffer ${t} (expected ${this.n_verts}, got ${e.n_verts}).`;if(this.draw_mode!=e.draw_mode)throw`Unexpected draw mode for attribute buffer ${t} (expected ${this.draw_mode}, got ${e.draw_mode}).`}const{type:n,location:r}=this.attributes[t];e.bindToProgram(r)})}setUniforms(t){Object.entries(t).forEach(([t,e])=>{if(void 0===this.uniforms[t])return void console.warn(`Skipping uniform value provided for '${t}' because the uniform was not found in the program.`);const{type:n,location:r}=this.uniforms[t];if("int"===n&&"number"==typeof e)this.gl.uniform1i(r,e);else if("float"===n&&"number"==typeof e)this.gl.uniform1f(r,e);else if("float"===n&&e instanceof Array)this.gl.uniform1fv(r,e);else if("vec2"===n&&e instanceof Array)this.gl.uniform2fv(r,e);else if("vec3"===n&&e instanceof Array)this.gl.uniform3fv(r,e);else if("vec4"===n&&e instanceof Array)this.gl.uniform4fv(r,e);else{if(!("mat4"===n&&e instanceof Array))throw`Could not figure out uniform function for type '${n}' and value '${String(e)}'`;this.gl.uniformMatrix4fv(r,!1,e)}})}bindTextures(t){Object.entries(t).forEach(([t,e])=>{if(void 0===this.uniforms[t])return void console.warn(`Skipping texture provided for sampler '${t}' because the sampler was not found in the program.`);const n=this.sampler_names.indexOf(t),{type:r,location:o}=this.uniforms[t];e.bindToProgram(o,n)})}draw(){if(null===this.draw_mode||null===this.n_verts)throw"Cannot draw without binding attribute buffers";null===this.index_buffer?0==this.instance_count?this.gl.drawArrays(this.draw_mode,0,this.n_verts):this.daiFunc(this.draw_mode,0,this.n_verts,this.instance_count):0==this.instance_count?this.gl.drawElements(this.draw_mode,this.index_buffer.n_verts,this.index_buffer.dtype,0):this.deiFunc(this.draw_mode,this.index_buffer.n_verts,this.index_buffer.dtype,0,this.instance_count)}}class H{constructor(t,e){this.gl=t,this.framebuffer=e}clear(t){const e=this.gl;if(null===e)throw"Register WebGL drawing context using registerGLContext() first";e.clearColor(...t),e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer),e.clear(e.COLOR_BUFFER_BIT)}renderTo(t,e,n,r){const o=this.gl;if(null===o)throw"Register WebGL drawing context using registerGLContext() first";o.bindFramebuffer(o.FRAMEBUFFER,this.framebuffer),o.viewport(t,e,n,r)}copyToTexture(t,e,n,r,o){const i=this.gl;if(null===i)throw"Register WebGL drawing context using registerGLContext() first";i.bindFramebuffer(i.FRAMEBUFFER,this.framebuffer),t.activate(0),i.copyTexImage2D(i.TEXTURE_2D,0,t.spec.format,e,n,r,o,0)}}new class extends H{constructor(){super(null,null)}registerGLContext(t){this.gl=t}};const V=JSON.parse('{"levels":[20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140],"colors":["#e6f4ff","#dbf0fe","#d1ebfe","#c6e7fd","#bce3fd","#b1dffc","#a7dbfc","#9cd6fb","#92d2fb","#87cefa","#84c2f6","#81b7f1","#7eabed","#7ba0e8","#7994e4","#7688df","#737ddb","#7071d6","#6d66d2","#6a5acd","#7660cf","#8366d0","#8f6cd2","#9c72d3","#a878d5","#b47ed6","#c184d8","#cd8ad9","#da90db","#e696dc","#e390d9","#e08ad6","#dd84d3","#da7ed0","#d778cd","#d472ca","#d16cc7","#ce66c4","#cb60c1","#c85abe","#c453ba","#c04cb6","#bc45b2","#b83eae","#b437aa","#b030a6","#ac29a2","#a8229e","#a41b9a","#a01496","#a41080","#a80e75","#ac0e75","#b00c6a","#b4085f","#b80649","#bc043e","#c00233","#c80028","#c80028","#ca042a","#cc082c","#d00c2c","#d21432","#d41834","#d41834","#d61c36","#da243a","#dc283c","#de2c3e","#e03040","#e23442","#e43844","#e63c46","#e84048","#ea444a","#ec484c","#ee4c4e","#f05050","#f16052","#f27054","#f38056","#f49058","#f5a05a","#f6b05c","#f7c05e","#f8d060","#f9e062","#faf064","#f7eb61","#f4e65e","#f1e15b","#eedc58","#ebd755","#e8d252","#e5cd4f","#e2c84c","#dfc349","#dcbe46","#d9b943","#d6b440","#d3af3d","#d0aa3a","#cda537","#caa034","#c79b31","#c4962e","#c1912b","#be8c28","#bb8725","#b88222","#b57d1f","#b2781c","#af7319","#ac6e16","#a96913","#a66410","#a35f0d","#a05a0a","#a05a0a"]}'),W=JSON.parse('{"levels":[20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80],"colors":["#f0f8ff","#dbf0fe","#c6e7fd","#b1dffc","#9cd6fb","#87cefa","#81b7f1","#7ba0e8","#7688df","#7071d6","#6a5acd","#8366d0","#9c72d3","#b47ed6","#cd8ad9","#e696dc","#e08ad6","#da7ed0","#d472ca","#ce66c4","#c85abe","#c04cb6","#b83eae","#b030a6","#a8229e","#a01496","#a81080","#b00c6a","#b8043e","#c80028","#c80028","#d01030","#d41834","#d82038","#dc283c","#e03040","#e43844","#e84048","#ec484c","#f05050","#f27054","#f49058","#f6b05c","#f8d060","#faf064","#f4e65e","#eedc58","#e8d252","#e2c84c","#dcbe46","#d6b440","#d0aa3a","#caa034","#c4962e","#be8c28","#b88222","#b2781c","#ac6e16","#a66410","#a05a0a"]}'),$=JSON.parse('{"levels":[0,100,200,300,400,500,600,700,800,900,1000,1100,1200,1300,1400,1500,1600,1700,1800,1900,2000,2100,2200,2300,2400,2500,2600,2700,2800,2900,3000,3100,3200,3300,3400,3500,3600,3700,3800,3900,4000,4100,4200,4300,4400,4500,4600,4700,4800,4900,5000,5100,5200,5300,5400,5500,5600,5700,5800,5900,6000,6500,7000,7500,8000,8500,9000,9500,10000],"colors":["#ffffff","#f0f0f0","#e1e1e1","#d2d2d2","#c3c3c3","#a5a5a5","#969696","#878787","#787878","#696969","#37536a","#436075","#506d80","#5c7a8b","#698796","#7594a2","#82a1ad","#8eaeb8","#9bbbc3","#a7c8ce","#e9dd96","#e8d186","#e7c575","#e6b865","#e5ac54","#e5a044","#e49433","#e38723","#e27b12","#e16f02","#dc4110","#d33b17","#ca351e","#c12e25","#b8282c","#af2234","#a61c3b","#9d1542","#940f49","#8b0950","#73088a","#7e1894","#8a289f","#9538a9","#a148b3","#ac59be","#b869c8","#c379d2","#cf89dd","#da99e7","#e9bec3","#e3b0b7","#dda3ac","#d795a0","#d18894","#ca7a89","#c46d7d","#be5f71","#b85266","#b2445a","#893d48","#8f4752","#96525b","#9c5c65","#a2676f","#a97178","#af7c82","#b6868b"]}'),X=JSON.parse('{"levels":[-60,-59,-58,-57,-56,-55,-54,-53,-52,-51,-50,-49,-48,-47,-46,-45,-44,-43,-42,-41,-40,-39,-38,-37,-36,-35,-34,-33,-32,-31,-30,-29,-28,-27,-26,-25,-24,-23,-22,-21,-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120],"colors":["#235877","#2a5f7c","#316782","#396e87","#40768c","#477d91","#4e8497","#558c9c","#5d93a1","#649ba6","#6ba2ac","#72a9b1","#79b1b6","#81b8bb","#88c0c1","#8fc7c6","#96cecb","#9dd6d0","#a5ddd6","#ace5db","#b3ece0","#b3ece0","#b1e7df","#b0e1dd","#aedcdc","#add7da","#abd2d9","#aaccd8","#a8c7d6","#a7c2d5","#a5bcd4","#a4b7d2","#a2b2d1","#9fa7ce","#9ea2cd","#9c9dcb","#9c9dcb","#9b97ca","#9992c8","#988dc7","#9688c6","#9582c4","#9278c2","#9073c0","#8f6dbf","#8d68bd","#8c63bc","#8a5dbb","#8958b9","#8753b8","#864eb6","#8448b5","#8343b4","#813eb2","#8038b1","#7e33b0","#7d33ae","#7b29ad","#7a23ab","#781eaa","#a037af","#a443b3","#a74fb7","#ab5cbb","#af68bf","#b374c3","#b680c7","#ba8dcc","#be99d0","#c1a5d4","#c5b1d8","#c9bddc","#cdcae0","#d0d6e4","#d4e2e8","#deecf2","#d1e2ee","#c5d9ea","#b8cfe6","#acc5e3","#9fbbdf","#92b2db","#86a8d7","#799ed3","#6c94cf","#608bcb","#5381c7","#4777c4","#3a6dc0","#2d64bc","#215ab8","#1450b4","#0f4455","#1c4e5a","#2a585f","#376363","#456d68","#52776d","#5f8172","#6d8c77","#7a967c","#88a080","#95aa85","#a3b58a","#b0bf8f","#bdc994","#cbd399","#d8de9d","#e6e8a2","#f3f2a7","#f8eea2","#f0e199","#e8d591","#e1c888","#d9bc80","#d1af77","#c9a36f","#c19666","#ba8a5e","#b27d55","#aa714d","#a26444","#9b583c","#8b3f2b","#833222","#7b261a","#7b261a","#741911","#6c0d09","#640000","#5f0000","#630507","#670a0e","#6c0f15","#70141c","#741824","#781d2b","#7d2232","#812739","#852c40","#73372d","#7a4036","#80493f","#875349","#8e5c52","#94655b","#9b6e64","#a88177","#af8a80","#b69389","#bd9c92","#c3a69c","#caafa5","#d1b8ae","#d7c1b7","#decac0","#e5d4ca","#ebddd3","#f2e6dc","#e8dfd6","#e0d7cf","#d8d0c8","#d0c8c0","#c8c0b9","#c0b9b2","#b7b1ab","#afa9a4","#a7a29c","#9f9a95","#97938e","#8f8b87","#878380","#7f7c78","#777471","#6f6c6a","#666563","#5e5d5c","#565554","#4e4e4d","#464646"]}'),Y=JSON.parse('{"levels":[-40,-39,-38,-37,-36,-35,-34,-33,-32,-31,-30,-29,-28,-27,-26,-25,-24,-23,-22,-21,-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90],"colors":["#986d4d","#966c4c","#946b4c","#926a4b","#90694b","#8e684a","#8c664a","#8a6549","#886448","#866348","#846247","#826147","#806046","#7e5f46","#7c5e45","#7a5d44","#785b44","#765a43","#745943","#725842","#715742","#6f5641","#6d5540","#6b5440","#69533f","#67523f","#65503e","#634f3d","#614e3d","#5f4d3c","#5d4c3c","#5b4b3b","#594a3b","#57493a","#554839","#534739","#514538","#4f4438","#4d4337","#4b4237","#494136","#4d4334","#514738","#564c3c","#5a5041","#5e5545","#625949","#675e4d","#6b6251","#6f6755","#746b5a","#78705e","#7c7462","#807966","#857d6a","#89826f","#8d8673","#928b77","#968f7b","#9a947f","#9e9883","#a39d88","#a7a18c","#aba690","#afaa94","#b8b39c","#b8b39c","#bcb8a1","#c1bca5","#c9c5ad","#c9cab1","#d2ceb6","#d2ceb6","#d6d3ba","#dfdcc2","#e3e0c6","#e7e5ca","#ebe9cf","#f0eed3","#f4f2d7","#e6f5e6","#d7f0d7","#c8eac8","#b9e5b9","#aadfaa","#9bda9b","#8cd48c","#7dcf7d","#6ec96e","#5fc45f","#30ae30","#2ca32c","#279927","#238e23","#1e831e","#1a791a","#156e15","#116311","#0c590c","#084e08","#61a3af","#5896a0","#508992","#477b83","#3e6e74","#366166","#2d5457","#244648","#1c393a","#132c2b","#66669a","#605e94","#59568e","#534e88","#4d4682","#463e7c","#403676","#3a2e70","#33266a","#2d1e64","#724071","#784573","#7d4b75","#835076","#885678","#8e5b7a","#93617c","#99667d","#9e6c7f","#a47181"]}'),Z=JSON.parse('{"levels":[-15,-14.53608247,-14.07216495,-13.60824742,-13.1443299,-12.68041237,-12.21649485,-11.75257732,-11.28865979,-10.82474227,-10.36082474,-9.89690722,-9.43298969,-8.96907216,-8.50515464,-8.04123711,-7.57731959,-7.11340206,-6.64948454,-6.18556701,-5.72164948,-5.25773196,-4.79381443,-4.32989691,-3.86597938,-3.40206186,-2.93814433,-2.4742268,-2.01030928,-1.54639175,-1.08247423,-0.6185567,-0.15463918,0.30927835,0.77319588,1.2371134,1.70103093,2.16494845,2.62886598,3.09278351,3.55670103,4.02061856,4.48453608,4.94845361,5.41237113,5.87628866,6.34020619,6.80412371,7.26804124,7.73195876,8.19587629,8.65979381,9.12371134,9.58762887,10.05154639,10.51546392,10.97938144,11.44329897,11.90721649,12.37113402,12.83505155,13.29896907,13.7628866,14.22680412,14.69072165,15.15463918,15.6185567,16.08247423,16.54639175,17.01030928,17.4742268,17.93814433,18.40206186,18.86597938,19.32989691,19.79381443,20.25773196,20.72164948,21.18556701,21.64948454,22.11340206,22.57731959,23.04123711,23.50515464,23.96907216,24.43298969,24.89690722,25.36082474,25.82474227,26.28865979,26.75257732,27.21649485,27.68041237,28.1443299,28.60824742,29.07216495,29.53608247,30,30.46391753,30.92783505,31.39175258,31.8556701,32.31958763,32.78350515,33.24742268,33.71134021,34.17525773,34.63917526,35.10309278,35.56701031,36.03092784,36.49484536,36.95876289,37.42268041,37.88659794,38.35051546,38.81443299,39.27835052,39.74226804,40.20618557,40.67010309,41.13402062,41.59793814,42.06185567,42.5257732,42.98969072,43.45360825,43.91752577,44.3814433,44.84536082,45.30927835,45.77319588,46.2371134,46.70103093,47.16494845,47.62886598,48.09278351,48.55670103,49.02061856,49.48453608,49.94845361,50.41237113,50.87628866,51.34020619,51.80412371,52.26804124,52.73195876,53.19587629,53.65979381,54.12371134,54.58762887,55.05154639,55.51546392,55.97938144,56.44329897,56.90721649,57.37113402,57.83505155,58.29896907,58.7628866,59.22680412,59.69072165,60.15463918,60.6185567,61.08247423,61.54639175,62.01030928,62.4742268,62.93814433,63.40206186,63.86597938,64.32989691,64.79381443,65.25773196,65.72164948,66.18556701,66.64948454,67.11340206,67.57731959,68.04123711,68.50515464,68.96907216,69.43298969,69.89690722,70.36082474,70.82474227,71.28865979,71.75257732,72.21649485,72.68041237,73.1443299,73.60824742,74.07216495,74.53608247,75],"colors":["#959052","#979356","#9c9a60","#a09c64","#a3a067","#a8a570","#aaa875","#acac79","#b1b182","#b5b587","#b6b88c","#bcbd93","#bfc199","#c1c39c","#c1c39c","#c6caa5","#cacdaa","#cccfaf","#cfd1b3","#cccfb3","#c8ccb3","#c6c8b3","#bfc3b3","#bfc3b3","#bcc1b3","#b8bdb3","#b5bab3","#afb5b3","#acb3b3","#aaafb3","#a7aeb3","#a3aab3","#a0a8b3","#9ca5b3","#9aa1b3","#97a0b3","#939cb3","#909ab3","#939ab5","#8c95b3","#8791b1","#838eb1","#808caf","#7c89af","#7785ae","#7482ac","#7080aa","#6b7caa","#6275a8","#5e72a7","#5e72a7","#5b70a5","#566da3","#5269a3","#4f67a1","#4b64a1","#4660a0","#425d9e","#4260a1","#4467a5","#486eaa","#4975ae","#4d7cb1","#4f83b5","#508aba","#5491bf","#5699c3","#599ec6","#5ba5ca","#5daccf","#60b3d4","#62bad8","#64c1db","#67c8df","#69cfe4","#6ed6e8","#67d6d6","#60d6c4","#59d6b3","#52d6a1","#4bd690","#42d67e","#3bd66d","#34d65b","#11d418","#11d116","#0fcd16","#0fc816","#0fc316","#0fbf15","#0fbc15","#0fb613","#0eb313","#0eaf13","#0eaa13","#0ca511","#0ca111","#0c9e11","#0c9911","#0c950f","#0c900f","#0a8c0f","#0a870f","#0a830e","#0a800e","#0a7c0c","#0a770c","#08720c","#086e0c","#086b0a","#08660a","#08620a","#085d08","#1c6708","#317208","#467c08","#5b8707","#6e9107","#839c05","#97a805","#acb105","#c1bc05","#d6c603","#e9d103","#ffe200","#ffd800","#ffd300","#ffc800","#ffc300","#ffba00","#ffb500","#ffb000","#ffac00","#ffa700","#ff9e00","#ff9900","#ff9300","#ff8900","#ff8500","#ff7f00","#ff0000","#f70000","#f00000","#e90000","#e20000","#db0000","#d40000","#cd0000","#c60000","#bf0000","#b80000","#b10000","#aa0000","#a30000","#9a0000","#930000","#8c0000","#850000","#7e0000","#770000","#700000","#ffffff","#fff4ff","#ffe9ff","#ffdfff","#ffd4ff","#ffc8ff","#ffbdff","#ffb3ff","#ffa8ff","#ff9cff","#ff91ff","#ff75ff","#fb6bfd","#f960f9","#f656f6","#f24bf4","#ef3ff0","#ed36ef","#e92aeb","#e61fe8","#e416e6","#e10ae2","#b100ff","#ac00fb","#a300f6","#9a00f4","#9300ef","#8700e9","#8200e8","#7900e2","#7200dd","#6900db","#6200d6"]}'),J="This constructor is not a subclass of Float16Array",q="The constructor property value is not an object",K="Attempting to access detached ArrayBuffer",Q="Cannot convert undefined or null to object",tt="Cannot mix BigInt and other types, use explicit conversions",et="@@iterator property is not callable",nt="Reduce of empty array with no initial value",rt="Offset is out of bounds";function ot(t){return(e,...n)=>at(t,e,n)}function it(t,e){return ot(ut(t,e).get)}const{apply:at,construct:st,defineProperty:lt,get:ct,getOwnPropertyDescriptor:ut,getPrototypeOf:ft,has:ht,ownKeys:dt,set:pt,setPrototypeOf:_t}=Reflect,mt=Proxy,{EPSILON:gt,MAX_SAFE_INTEGER:vt,isFinite:bt,isNaN:yt}=Number,{iterator:wt,species:xt,toStringTag:Tt,for:Et}=Symbol,At=Object,{create:St,defineProperty:Mt,freeze:Rt,is:Pt}=At,Ft=At.prototype,It=Ft.__lookupGetter__?ot(Ft.__lookupGetter__):(t,e)=>{if(null==t)throw Ee(Q);let n=At(t);do{const t=ut(n,e);if(void 0!==t)return Ot(t,"get")?t.get:void 0}while(null!==(n=ft(n)))},Ot=At.hasOwn||ot(Ft.hasOwnProperty),kt=Array,Ct=kt.isArray,Nt=kt.prototype,Bt=ot(Nt.join),Gt=ot(Nt.push),Lt=ot(Nt.toLocaleString),jt=Nt[wt],Dt=ot(jt),{abs:Ut,trunc:zt}=Math,Ht=ArrayBuffer,Vt=Ht.isView,Wt=Ht.prototype,$t=ot(Wt.slice),Xt=it(Wt,"byteLength"),Yt="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:null,Zt=Yt&&it(Yt.prototype,"byteLength"),Jt=ft(Uint8Array),qt=Jt.from,Kt=Jt.prototype,Qt=Kt[wt],te=ot(Kt.keys),ee=ot(Kt.values),ne=ot(Kt.entries),re=ot(Kt.set),oe=ot(Kt.reverse),ie=ot(Kt.fill),ae=ot(Kt.copyWithin),se=ot(Kt.sort),le=ot(Kt.slice),ce=ot(Kt.subarray),ue=it(Kt,"buffer"),fe=it(Kt,"byteOffset"),he=it(Kt,"length"),de=it(Kt,Tt),pe=Uint8Array,_e=Uint16Array,me=(...t)=>at(qt,_e,t),ge=Uint32Array,ve=Float32Array,be=ft([][wt]()),ye=ot(be.next),we=ot(function*(){}().next),xe=ft(be),Te=DataView.prototype,Ee=(ot(Te.getUint16),ot(Te.setUint16),TypeError),Ae=RangeError,Se=WeakSet,Me=Se.prototype,Re=ot(Me.add),Pe=ot(Me.has),Fe=WeakMap,Ie=Fe.prototype,Oe=ot(Ie.get),ke=ot(Ie.has),Ce=ot(Ie.set),Ne=new Fe,Be=St(null,{next:{value:function(){const t=Oe(Ne,this);return ye(t)}},[wt]:{value:function(){return this}}});function Ge(t){if(t[wt]===jt&&be.next===ye)return t;const e=St(Be);return Ce(Ne,e,Dt(t)),e}const Le=new Fe,je=St(xe,{next:{value:function(){const t=Oe(Le,this);return we(t)},writable:!0,configurable:!0}});for(const t of dt(be))"next"!==t&&Mt(je,t,ut(be,t));function De(t){const e=St(je);return Ce(Le,e,t),e}function Ue(t){return null!==t&&"object"==typeof t||"function"==typeof t}function ze(t){return null!==t&&"object"==typeof t}function He(t){return void 0!==de(t)}function Ve(t){const e=de(t);return"BigInt64Array"===e||"BigUint64Array"===e}function We(t){if(null===Yt)return!1;try{return Zt(t),!0}catch(t){return!1}}function $e(t){return!!Ct(t)&&t[wt]===jt&&be.next===ye}function Xe(t){if("string"!=typeof t)return!1;const e=+t;return t===e+""&&!!bt(e)&&e===zt(e)}const Ye=Et("__Float16Array__"),Ze=1/gt,Je=5.960464477539063e-8,qe=.0009765625*Ze;const Ke=new Ht(4),Qe=new ve(Ke),tn=new ge(Ke),en=new _e(512),nn=new pe(512);for(let t=0;t<256;++t){const e=t-127;e<-27?(en[t]=0,en[256|t]=32768,nn[t]=24,nn[256|t]=24):e<-14?(en[t]=1024>>-e-14,en[256|t]=1024>>-e-14|32768,nn[t]=-e-1,nn[256|t]=-e-1):e<=15?(en[t]=e+15<<10,en[256|t]=e+15<<10|32768,nn[t]=13,nn[256|t]=13):e<128?(en[t]=31744,en[256|t]=64512,nn[t]=24,nn[256|t]=24):(en[t]=31744,en[256|t]=64512,nn[t]=13,nn[256|t]=13)}function rn(t){Qe[0]=function(t){const e=+t;if(!bt(e)||0===e)return e;const n=e>0?1:-1,r=Ut(e);if(r<6103515625e-14)return n*function(t){return t+Ze-Ze}(r/Je)*Je;const o=(1+qe)*r,i=o-(o-r);return i>65504||yt(i)?n*(1/0):n*i}(t);const e=tn[0],n=e>>23&511;return en[n]+((8388607&e)>>nn[n])}const on=new ge(2048);for(let t=1;t<1024;++t){let e=t<<13,n=0;for(;!(8388608&e);)e<<=1,n-=8388608;e&=-8388609,n+=947912704,on[t]=e|n}for(let t=1024;t<2048;++t)on[t]=939524096+(t-1024<<13);const an=new ge(64);for(let t=1;t<31;++t)an[t]=t<<23;an[31]=1199570944,an[32]=2147483648;for(let t=33;t<63;++t)an[t]=2147483648+(t-32<<23);an[63]=3347054592;const sn=new _e(64);for(let t=1;t<64;++t)32!==t&&(sn[t]=1024);function ln(t){const e=t>>10;return tn[0]=on[sn[e]+(1023&t)]+an[e],Qe[0]}function cn(t){const e=+t;return yt(e)||0===e?0:zt(e)}function un(t){const e=cn(t);return e<0?0:e<vt?e:vt}function fn(t,e){if(!Ue(t))throw Ee("This is not an object");const n=t.constructor;if(void 0===n)return e;if(!Ue(n))throw Ee(q);const r=n[xt];return null==r?e:r}function hn(t){if(We(t))return!1;try{return $t(t,0,0),!1}catch(t){}return!0}function dn(t,e){const n=yt(t),r=yt(e);if(n&&r)return 0;if(n)return 1;if(r)return-1;if(t<e)return-1;if(t>e)return 1;if(0===t&&0===e){const n=Pt(t,0),r=Pt(e,0);if(!n&&r)return-1;if(n&&!r)return 1}return 0}const pn=new Fe;function _n(t){return ke(pn,t)||!Vt(t)&&function(t){if(!ze(t))return!1;const e=ft(t);if(!ze(e))return!1;const n=e.constructor;if(void 0===n)return!1;if(!Ue(n))throw Ee(q);return ht(n,Ye)}(t)}function mn(t){if(!_n(t))throw Ee("This is not a Float16Array object")}function gn(t,e){const n=_n(t),r=He(t);if(!n&&!r)throw Ee("Species constructor didn't return TypedArray object");if("number"==typeof e){let r;if(n){const e=vn(t);r=he(e)}else r=he(t);if(r<e)throw Ee("Derived constructor created TypedArray object which was too small length")}if(Ve(t))throw Ee(tt)}function vn(t){const e=Oe(pn,t);if(void 0!==e){if(hn(ue(e)))throw Ee(K);return e}const n=t.buffer;if(hn(n))throw Ee(K);const r=st(xn,[n,t.byteOffset,t.length],t.constructor);return Oe(pn,r)}function bn(t){const e=he(t),n=[];for(let r=0;r<e;++r)n[r]=ln(t[r]);return n}const yn=new Se;for(const t of dt(Kt)){if(t===Tt)continue;const e=ut(Kt,t);Ot(e,"get")&&"function"==typeof e.get&&Re(yn,e.get)}const wn=Rt({get:(t,e,n)=>Xe(e)&&Ot(t,e)?ln(ct(t,e)):Pe(yn,It(t,e))?ct(t,e):ct(t,e,n),set:(t,e,n,r)=>Xe(e)&&Ot(t,e)?pt(t,e,rn(n)):pt(t,e,n,r),getOwnPropertyDescriptor(t,e){if(Xe(e)&&Ot(t,e)){const n=ut(t,e);return n.value=ln(n.value),n}return ut(t,e)},defineProperty:(t,e,n)=>Xe(e)&&Ot(t,e)&&Ot(n,"value")?(n.value=rn(n.value),lt(t,e,n)):lt(t,e,n)});class xn{constructor(t,e,n){let r;if(_n(t))r=st(_e,[vn(t)],new.target);else if(!Ue(t)||(function(t){try{return Xt(t),!0}catch(t){return!1}}(o=t)||We(o)))r=st(_e,arguments,new.target);else{let e,n;if(He(t)){if(e=t,n=he(t),hn(ue(t)))throw Ee(K);if(Ve(t))throw Ee(tt);const o=new Ht(2*n);r=st(_e,[o],new.target)}else{const o=t[wt];if(null!=o&&"function"!=typeof o)throw Ee(et);null!=o?$e(t)?(e=t,n=t.length):(e=[...t],n=e.length):(e=t,n=un(e.length)),r=st(_e,[n],new.target)}for(let t=0;t<n;++t)r[t]=rn(e[t])}var o;const i=new mt(r,wn);return Ce(pn,i,r),i}static from(t,...e){const n=this;if(!ht(n,Ye))throw Ee(J);if(n===xn){if(_n(t)&&0===e.length){const e=vn(t),n=new _e(ue(e),fe(e),he(e));return new xn(ue(le(n)))}if(0===e.length)return new xn(ue(me(t,rn)));const n=e[0],r=e[1];return new xn(ue(me(t,function(t,...e){return rn(at(n,this,[t,...Ge(e)]))},r)))}let r,o;const i=t[wt];if(null!=i&&"function"!=typeof i)throw Ee(et);if(null!=i)$e(t)?(r=t,o=t.length):He(a=t)&&a[wt]===Qt&&be.next===ye?(r=t,o=he(t)):(r=[...t],o=r.length);else{if(null==t)throw Ee(Q);r=At(t),o=un(r.length)}var a;const s=new n(o);if(0===e.length)for(let t=0;t<o;++t)s[t]=r[t];else{const t=e[0],n=e[1];for(let e=0;e<o;++e)s[e]=at(t,n,[r[e],e])}return s}static of(...t){const e=this;if(!ht(e,Ye))throw Ee(J);const n=t.length;if(e===xn){const e=new xn(n),r=vn(e);for(let e=0;e<n;++e)r[e]=rn(t[e]);return e}const r=new e(n);for(let e=0;e<n;++e)r[e]=t[e];return r}keys(){mn(this);const t=vn(this);return te(t)}values(){mn(this);const t=vn(this);return De(function*(){for(const e of ee(t))yield ln(e)}())}entries(){mn(this);const t=vn(this);return De(function*(){for(const[e,n]of ne(t))yield[e,ln(n)]}())}at(t){mn(this);const e=vn(this),n=he(e),r=cn(t),o=r>=0?r:n+r;if(!(o<0||o>=n))return ln(e[o])}with(t,e){mn(this);const n=vn(this),r=he(n),o=cn(t),i=o>=0?o:r+o,a=+e;if(i<0||i>=r)throw Ae(rt);const s=new _e(ue(n),fe(n),he(n)),l=new xn(ue(le(s)));return vn(l)[i]=rn(a),l}map(t,...e){mn(this);const n=vn(this),r=he(n),o=e[0],i=fn(n,xn);if(i===xn){const e=new xn(r),i=vn(e);for(let e=0;e<r;++e){const r=ln(n[e]);i[e]=rn(at(t,o,[r,e,this]))}return e}const a=new i(r);gn(a,r);for(let e=0;e<r;++e){const r=ln(n[e]);a[e]=at(t,o,[r,e,this])}return a}filter(t,...e){mn(this);const n=vn(this),r=he(n),o=e[0],i=[];for(let e=0;e<r;++e){const r=ln(n[e]);at(t,o,[r,e,this])&&Gt(i,r)}const a=new(fn(n,xn))(i);return gn(a),a}reduce(t,...e){mn(this);const n=vn(this),r=he(n);if(0===r&&0===e.length)throw Ee(nt);let o,i;0===e.length?(o=ln(n[0]),i=1):(o=e[0],i=0);for(let e=i;e<r;++e)o=t(o,ln(n[e]),e,this);return o}reduceRight(t,...e){mn(this);const n=vn(this),r=he(n);if(0===r&&0===e.length)throw Ee(nt);let o,i;0===e.length?(o=ln(n[r-1]),i=r-2):(o=e[0],i=r-1);for(let e=i;e>=0;--e)o=t(o,ln(n[e]),e,this);return o}forEach(t,...e){mn(this);const n=vn(this),r=he(n),o=e[0];for(let e=0;e<r;++e)at(t,o,[ln(n[e]),e,this])}find(t,...e){mn(this);const n=vn(this),r=he(n),o=e[0];for(let e=0;e<r;++e){const r=ln(n[e]);if(at(t,o,[r,e,this]))return r}}findIndex(t,...e){mn(this);const n=vn(this),r=he(n),o=e[0];for(let e=0;e<r;++e){const r=ln(n[e]);if(at(t,o,[r,e,this]))return e}return-1}findLast(t,...e){mn(this);const n=vn(this),r=he(n),o=e[0];for(let e=r-1;e>=0;--e){const r=ln(n[e]);if(at(t,o,[r,e,this]))return r}}findLastIndex(t,...e){mn(this);const n=vn(this),r=he(n),o=e[0];for(let e=r-1;e>=0;--e){const r=ln(n[e]);if(at(t,o,[r,e,this]))return e}return-1}every(t,...e){mn(this);const n=vn(this),r=he(n),o=e[0];for(let e=0;e<r;++e)if(!at(t,o,[ln(n[e]),e,this]))return!1;return!0}some(t,...e){mn(this);const n=vn(this),r=he(n),o=e[0];for(let e=0;e<r;++e)if(at(t,o,[ln(n[e]),e,this]))return!0;return!1}set(t,...e){mn(this);const n=vn(this),r=cn(e[0]);if(r<0)throw Ae(rt);if(null==t)throw Ee(Q);if(Ve(t))throw Ee(tt);if(_n(t))return re(vn(this),vn(t),r);if(He(t)&&hn(ue(t)))throw Ee(K);const o=he(n),i=At(t),a=un(i.length);if(r===1/0||a+r>o)throw Ae(rt);for(let t=0;t<a;++t)n[t+r]=rn(i[t])}reverse(){mn(this);const t=vn(this);return oe(t),this}toReversed(){mn(this);const t=vn(this),e=new _e(ue(t),fe(t),he(t)),n=new xn(ue(le(e))),r=vn(n);return oe(r),n}fill(t,...e){mn(this);const n=vn(this);return ie(n,rn(t),...Ge(e)),this}copyWithin(t,e,...n){mn(this);const r=vn(this);return ae(r,t,e,...Ge(n)),this}sort(t){mn(this);const e=vn(this),n=void 0!==t?t:dn;return se(e,(t,e)=>n(ln(t),ln(e))),this}toSorted(t){mn(this);const e=vn(this);if(void 0!==t&&"function"!=typeof t)throw new Ee("The comparison function must be either a function or undefined");const n=void 0!==t?t:dn,r=new _e(ue(e),fe(e),he(e)),o=new xn(ue(le(r))),i=vn(o);return se(i,(t,e)=>n(ln(t),ln(e))),o}slice(t,e){mn(this);const n=vn(this),r=fn(n,xn);if(r===xn){const r=new _e(ue(n),fe(n),he(n));return new xn(ue(le(r,t,e)))}const o=he(n),i=cn(t),a=void 0===e?o:cn(e);let s,l;s=i===-1/0?0:i<0?o+i>0?o+i:0:o<i?o:i,l=a===-1/0?0:a<0?o+a>0?o+a:0:o<a?o:a;const c=l-s>0?l-s:0,u=new r(c);if(gn(u,c),0===c)return u;if(hn(ue(n)))throw Ee(K);let f=0;for(;s<l;)u[f]=ln(n[s]),++s,++f;return u}subarray(t,e){mn(this);const n=vn(this),r=fn(n,xn),o=new _e(ue(n),fe(n),he(n)),i=ce(o,t,e),a=new r(ue(i),fe(i),he(i));return gn(a),a}indexOf(t,...e){mn(this);const n=vn(this),r=he(n);let o=cn(e[0]);if(o===1/0)return-1;o<0&&(o+=r,o<0&&(o=0));for(let e=o;e<r;++e)if(Ot(n,e)&&ln(n[e])===t)return e;return-1}lastIndexOf(t,...e){mn(this);const n=vn(this),r=he(n);let o=e.length>=1?cn(e[0]):r-1;if(o===-1/0)return-1;o>=0?o=o<r-1?o:r-1:o+=r;for(let e=o;e>=0;--e)if(Ot(n,e)&&ln(n[e])===t)return e;return-1}includes(t,...e){mn(this);const n=vn(this),r=he(n);let o=cn(e[0]);if(o===1/0)return!1;o<0&&(o+=r,o<0&&(o=0));const i=yt(t);for(let e=o;e<r;++e){const r=ln(n[e]);if(i&&yt(r))return!0;if(r===t)return!0}return!1}join(t){mn(this);const e=bn(vn(this));return Bt(e,t)}toLocaleString(...t){mn(this);const e=bn(vn(this));return Lt(e,...Ge(t))}get[Tt](){if(_n(this))return"Float16Array"}}Mt(xn,"BYTES_PER_ELEMENT",{value:2}),Mt(xn,Ye,{}),_t(xn,Jt);const Tn=xn.prototype;Mt(Tn,"BYTES_PER_ELEMENT",{value:2}),Mt(Tn,wt,{value:Tn.values,writable:!0,configurable:!0}),_t(Tn,Kt);var En=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},An=function(){function t(t){this.rgba=t}return Object.defineProperty(t.prototype,"r",{get:function(){return this.rgba[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"g",{get:function(){return this.rgba[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"b",{get:function(){return this.rgba[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"a",{get:function(){return this.rgba[3]},enumerable:!1,configurable:!0}),t.prototype.withOpacity=function(e){return new t([this.r,this.g,this.b,e])},t.prototype.toRGBHex=function(){return this.toRGBAHex().slice(0,-2)},t.prototype.toRGBAHex=function(){return e=this.rgba,"float"==(t=void 0===t?"float":t)&&(e=e.map(function(t){return Math.round(255*t)})),"#"+e.map(function(t){return t.toString(16).padStart(2,"0").toUpperCase()}).join("");var t,e},t.prototype.toRGBATuple=function(){return this.rgba},t.prototype.toHSVTuple=function(){return function(t){var e,n=En(t,3),r=n[0],o=n[1],i=n[2],a=Math.max(r,o,i),s=a-Math.min(r,o,i);if(0==s)e=0;else if(a==r)e=(o-i)/s*60%6;else if(a==o)e=60*((i-r)/s+2);else{if(a!=i)throw"You've messed something up in rgb2hsv()";e=60*((r-o)/s+4)}return[e,0==a?0:s/a,a]}([this.r,this.g,this.b])},t.fromHex=function(e){return new t(function(t,e){e=void 0===e?"float":e;var n=t.match(/#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?/i);if(null===n)throw"Got '".concat(t,"' in hex2rgba, which does not look like a hex color");var r=n.slice(1).filter(function(t){return void 0!==t}).map(function(t){return parseInt(t,16)});return"float"==e&&(r=r.map(function(t){return t/255})),void 0===r[3]?[r[0],r[1],r[2],1]:[r[0],r[1],r[2],r[3]]}(e))},t.fromHSVTuple=function(e){var n=function(t){var e,n,r,o=En(t,3),i=o[0],a=o[1],s=o[2],l=s*a,c=l*(1-Math.abs(i/60%2-1)),u=s-l;if(0<=i&&i<60)e=l,n=c,r=0;else if(60<=i&&i<120)e=c,n=l,r=0;else if(120<=i&&i<180)e=0,n=l,r=c;else if(180<=i&&i<240)e=0,n=c,r=l;else if(240<=i&&i<300)e=c,n=0,r=l;else{if(!(300<=i&&i<360))throw"H is out of bounds in hsv2rgb";e=l,n=0,r=c}return[e+u,n+u,r+u]}(e);return new t([n[0],n[1],n[2],1])},t.normalizeColor=function(e){return e instanceof t?e:t.fromHex(e)},t}(),Sn=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Mn=n(374),Rn=function(){function t(t,e,n){if(t.length!=e.length+1)throw"Mismatch between number of levels (".concat(t.length,") and number of colors (").concat(e.length,"; expected ").concat(t.length-1,")");this.levels=t,this.colors=e.map(function(t){return An.normalizeColor(t)}),n=void 0===n?{}:n,this.overflow_color=void 0===n.overflow_color?null:An.normalizeColor(n.overflow_color),this.underflow_color=void 0===n.underflow_color?null:An.normalizeColor(n.underflow_color)}return t.prototype.getColors=function(){return this.colors.map(function(t){return t.toRGBHex()})},t.prototype.getOpacities=function(){return this.colors.map(function(t){return t.a})},t.prototype.withOpacity=function(e){for(var n=[],r=[],o={},i=0;i<this.colors.length;i++){var a=this.colors[i],s=this.levels[i],l=this.levels[i+1],c=e(s,l),u=a.withOpacity(c);c>0&&(r[r.length-1]!=s&&r.push(s),r.push(l),n.push(u))}if(null!==this.underflow_color){var f=e(this.levels[0],this.levels[0]);f>0&&(o.underflow_color=this.underflow_color.withOpacity(f))}if(null!==this.overflow_color){var h=e(this.levels[this.levels.length-1],this.levels[this.levels.length-1]);h>0&&(o.overflow_color=this.overflow_color.withOpacity(h))}return new t(r,n,o)},t.diverging=function(e,n,r,o,i){for(var a,s,l=[],c=[],u=(o-r)/(i-1),f=(o+r)/2,h=[0,0,.9],d=An.fromHex(e).toHSVTuple(),p=An.fromHex(n).toHSVTuple(),_=0;_<i;_++){var m=r+_*u,g=void 0,v=void 0,b=void 0,y=void 0;m<f?(y=Math.pow((f-m)/(f-r),1.5),g=(a=Sn([d[0],h[1]+(d[1]-h[1])*y,h[2]+(d[2]-h[2])*y],3))[0],v=a[1],b=a[2]):(y=Math.pow((m-f)/(o-f),1.5),g=(s=Sn([p[0],h[1]+(p[1]-h[1])*y,h[2]+(p[2]-h[2])*y],3))[0],v=s[1],b=s[2]),l.push(An.fromHSVTuple([g,v,b]).withOpacity(Math.min(2*y,1)))}for(var w=0;w<=i;w++){var x=(o-r)/i;c.push(r+w*x)}return new t(c,l)},t}();function Pn(t,e){var n=t.colors.length,r={};return"over"!=e&&"both"!=e||(r.overflow_color=t.colors[n-1]),"under"!=e&&"both"!=e||(r.underflow_color=t.colors[0]),new Rn(t.levels,t.colors,r)}var Fn=Pn(V,"over").withOpacity(function(t,e){return Math.min((e-20)/10,1)}),In=Pn(W,"over").withOpacity(function(t,e){return Math.min((e-20)/10,1)}),On=Pn($,"over").withOpacity(function(t,e){return Math.min(e/1e3,1)}),kn=Pn(X,"both"),Cn=Pn(Y,"both"),Nn=Pn(Z,"over"),Bn=function(){function t(t){this.colormap=t,this.gl_elems=null}return t.applyShader=function(t){return S(Mn,t)},t.prototype.setupShaderVariables=function(t,e){var n=function(t){for(var e=[],n=0;n<101;n++)e.push(n/100);var r=t.levels,o=r.length-1,i=r.map(function(t,e){return e/o}),a=r.map(function(t){return(t-r[0])/(r[o]-r[0])}),s=e.map(function(t){var e;for(e=0;!(a[e]<=t&&t<=a[e+1]);e++);var n=(t-a[e])/(a[e+1]-a[e]);return i[e]*(1-n)+i[e+1]*n});return new xn(s)}(this.colormap),r=function(t){var e=document.createElement("canvas");e.width=t.colors.length,e.height=1;var n=e.getContext("2d");return t.colors.forEach(function(t,e){if(null===n)throw"Could not get rendering context for colormap image canvas";n.fillStyle=t.toRGBAHex(),n.fillRect(e,0,1,1)}),e}(this.colormap),o=C(t,"float16"),i=o.format,a=o.type,s=o.row_alignment,l={format:t.RGBA,type:t.UNSIGNED_BYTE,image:r,mag_filter:e},c=new D(t,l),u={format:i,type:a,width:n.length,height:1,image:new Uint16Array(n.buffer),mag_filter:t.LINEAR,row_alignment:s},f=new D(t,u);this.gl_elems={cmap_texture:c,cmap_nonlin_texture:f}},t.prototype.bindShaderVariables=function(t){if(null!==this.gl_elems){var e=this.colormap,n=null===e.underflow_color?[0,0,0,0]:e.underflow_color.toRGBATuple(),r=null===e.overflow_color?[0,0,0,0]:e.overflow_color.toRGBATuple();t.setUniforms({u_cmap_min:e.levels[0],u_cmap_max:e.levels[e.levels.length-1],u_n_index:101,u_underflow_color:n,u_overflow_color:r}),t.bindTextures({u_cmap_sampler:this.gl_elems.cmap_texture,u_cmap_nonlin_sampler:this.gl_elems.cmap_nonlin_texture})}},t}(),Gn=function(){function t(t,e,n){this.vertex_shader_src=t,this.fragment_shader_src=e,this.shader_defines=n,this.program_map=new Map}return t.prototype.getShaderProgram=function(t,e){var n=null===e?"default":e.variantName,r=this.program_map.get(n);if(void 0!==r)return r;var o=this.vertex_shader_src;o=S(null!==e?e.vertexShaderPrelude+"\n"+e.define:"\n uniform mat4 u_projection_matrix;\n\n vec4 projectTile(vec2 p) {\n vec4 result = u_projection_matrix * vec4(p, 0.0, 1.0);\n return result;\n }",o);var i=new z(t,o,this.fragment_shader_src,{define:this.shader_defines});return this.program_map.set(n,i),i},t.prototype.getShaderUniforms=function(t){return"maplibre"==t.type?t.shaderData.define.includes("GLOBE")?{u_projection_matrix:t.defaultProjectionData.mainMatrix,u_projection_fallback_matrix:t.defaultProjectionData.fallbackMatrix,u_projection_tile_mercator_coords:t.defaultProjectionData.tileMercatorCoords,u_projection_clipping_plane:t.defaultProjectionData.clippingPlane,u_projection_transition:t.defaultProjectionData.projectionTransition}:{u_projection_matrix:t.defaultProjectionData.mainMatrix}:{u_projection_matrix:t.mainMatrix}},t}(),Ln=function(){return Ln=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Ln.apply(this,arguments)},jn=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Dn=n(840),Un=n(934),zn={"-":[1],"--":[1,1,1,1,0,0],":":[1,0],"-.":[1,1,1,0,1,0]},Hn=function(){function t(t,e,n){var r,o=void 0===(n=void 0===n?{}:n).color?"#000000":n.color;this.color=An.fromHex(o);var i=void 0===n.line_width?1:n.line_width,a=void 0===n.line_style?"-":n.line_style;this.offset_rotates_with_map=void 0===n.offset_rotates_with_map||n.offset_rotates_with_map,this.width=i;var s=[];this.vertices=new j(t,e.vertices,3,t.TRIANGLE_STRIP),this.extrusion=new j(t,e.extrusion,2,t.TRIANGLE_STRIP),void 0!==e.offsets?(this.offset=new j(t,e.offsets,2,t.TRIANGLE_STRIP),this.scale=void 0===n.offset_scale?1:n.offset_scale,s.push("OFFSET")):(this.offset=null,this.scale=null),void 0!==e.zoom?(this.min_zoom=new j(t,e.zoom,1,t.TRIANGLE_STRIP),s.push("ZOOM")):this.min_zoom=null;var l=Un;if(void 0!==e.data){s.push("DATA"),this.line_data=new j(t,e.data,1,t.TRIANGLE_STRIP);var c=void 0===n.cmap?new Rn([0,1],[o],{overflow_color:o,underflow_color:o}):n.cmap;this.cmap_gpu=new Bn(c),this.cmap_gpu.setupShaderVariables(t,t.NEAREST),l=Bn.applyShader(l)}else this.line_data=null,this.cmap_gpu=null;r=jn(function(t,e){var n=Array.isArray(e)?e:zn[e],r={format:F(t)?t.R8:t.LUMINANCE,type:t.UNSIGNED_BYTE,width:n.length,height:1,image:new Uint8Array(n.map(function(t){return t>0?255:0})),mag_filter:t.NEAREST,row_alignment:1};return[n.length,new D(t,r)]}(t,a),2),this.n_dash=r[0],this.dash_texture=r[1],this.shader_manager=new Gn(Dn,l,s)}return t.make=function(e,n,r){return o=this,i=void 0,s=function(){var o;return function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,function(i){switch(i.label){case 0:return[4,O.makePolyLines(n)];case 1:return o=i.sent(),[2,new t(e,o,r)]}})},new((a=void 0)||(a=Promise))(function(t,e){function n(t){try{l(s.next(t))}catch(t){e(t)}}function r(t){try{l(s.throw(t))}catch(t){e(t)}}function l(e){var o;e.done?t(e.value):(o=e.value,o instanceof a?o:new a(function(t){t(o)})).then(n,r)}l((s=s.apply(o,i||[])).next())});var o,i,a,s},t.prototype.render=function(t,e,n,r,o,i){var a=jn(n,2),s=a[0],l=a[1],c=I(e),u=this.shader_manager.getShaderProgram(t,c.shaderData),f={a_pos:this.vertices,a_extrusion:this.extrusion},h=Ln({u_line_width:this.width,u_map_width:s,u_map_height:l,u_offset:0,u_zoom:r,u_dash_pattern_length:this.n_dash},this.shader_manager.getShaderUniforms(c)),d={u_dash_sampler:this.dash_texture};null!==this.offset&&null!==this.scale&&(f.a_offset=this.offset,h.u_offset_scale=this.scale*(l/s),h.u_offset_rotates_with_map=this.offset_rotates_with_map?1:0),null!==this.min_zoom&&(f.a_min_zoom=this.min_zoom),null!==this.line_data?f.a_data=this.line_data:h.u_color=this.color.toRGBATuple(),u.use(f,h,d),null!==this.cmap_gpu&&this.cmap_gpu.bindShaderVariables(u),t.enable(t.BLEND),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),u.draw(),"maplibre"==c.type&&c.shaderData.define.includes("GLOBE")||(u.setUniforms({u_offset:-2}),u.draw(),u.setUniforms({u_offset:-1}),u.draw(),u.setUniforms({u_offset:1}),u.draw())},t}(),Vn=n(335),Wn=n.n(Vn),$n=function(){return $n=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},$n.apply(this,arguments)},Xn=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function s(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,s)}l((r=r.apply(t,e||[])).next())})},Yn=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},Zn=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Jn=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},qn=n(873),Kn=n(947);function Qn(t){var e=t.filter(function(t){return void 0!==t.data}),n=[],r=function(t){let e=0,n=0;for(const r of t)e+=r.w*r.h,n=Math.max(n,r.w);t.sort((t,e)=>e.h-t.h);const r=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),n),h:1/0}];let o=0,i=0;for(const e of t)for(let t=r.length-1;t>=0;t--){const n=r[t];if(!(e.w>n.w||e.h>n.h)){if(e.x=n.x,e.y=n.y,i=Math.max(i,e.y+e.h),o=Math.max(o,e.x+e.w),e.w===n.w&&e.h===n.h){const e=r.pop();t<r.length&&(r[t]=e)}else e.h===n.h?(n.x+=e.w,n.w-=e.w):e.w===n.w?(n.y+=e.h,n.h-=e.h):(r.push({x:n.x+e.w,y:n.y,w:n.w-e.w,h:e.h}),n.y+=e.h,n.h-=e.h);break}}return{w:o,h:i,fill:e/(o*i)||0}}(e.map(function(t){var e={x:0,y:0,w:t.width,h:t.height};return n.push({glyph:t,bin:e}),e})),o=r.w,i=r.h,a=new Uint8Array(o*i),s={},l=0;n.forEach(function(t){var e=t.bin,n=t.glyph;if(void 0===e.x||void 0===e.y)throw"Potpack couldn't pack this pot, I guess?";s[n.id]={id:n.id,width:n.width,height:n.height,left:n.left,top:n.top,atlas_i:e.x,atlas_j:e.y,advance:n.advance},l=Math.max(l,n.height);for(var r=0;r<n.width;r++)for(var i=0;i<n.height;i++){var c=r+n.width*i,u=r+e.x+o*(i+e.y);a[u]=n.data[c]}});var c=s["M".charCodeAt(0)],u=void 0===c?l:c.height-c.top,f=void 0===c?0:-c.top;return{atlas:a,atlas_width:o,atlas_height:i,baseline:u,top:f,glyph_info:s}}var tr,er=new T(function(t){return Xn(void 0,void 0,void 0,function(){var e;return Yn(this,function(n){switch(n.label){case 0:return e=t.map(function(t){return Xn(void 0,void 0,void 0,function(){var e,n;return Yn(this,function(r){switch(r.label){case 0:return[4,fetch(t)];case 1:if(200!=(e=r.sent()).status)throw"Error ".concat(e.status," retrieving font pbf from '").concat(t,"'");return[4,e.blob()];case 2:return[4,r.sent().arrayBuffer()];case 3:return n=r.sent(),[2,(o=new Uint8Array(n),i=function(t,e,n){if(void 0!==n)switch(t){case 1:e.id=n.readVarint();break;case 2:e.data=n.readBytes();break;case 3:e.width=n.readVarint()+6;break;case 4:e.height=n.readVarint()+6;break;case 5:e.left=n.readSVarint();break;case 6:e.top=n.readSVarint();break;case 7:e.advance=n.readVarint()}},a=function(t,e,n){if(void 0!==e&&void 0!==n&&3==t){var r=n.readMessage(i,{});e.push(r)}},new(Wn())(o).readFields(function(t,e,n){void 0!==n&&1==t&&n.readMessage(a,e)},[]))]}var o,i,a})})}),[4,Promise.all(e)];case 1:return[2,Qn(n.sent().flat())]}})})}),nr={horizontal_align:"left",vertical_align:"baseline",font_size:12,text_color:new An([0,0,0,1]),halo_color:new An([0,0,0,1]),halo:!1,offset_x:0,offset_y:0},rr=function(){function t(t,e,n,r){var o=this;this.opts=E(r,nr);var i=F(t)?t.R8:t.LUMINANCE,a=t.UNSIGNED_BYTE,s=0==n.atlas_width||0==n.atlas_height||0==n.atlas.length,l={format:i,type:a,width:s?1:n.atlas_width,height:s?1:n.atlas_height,image:s?new Uint8Array([0,0,0,0]):n.atlas,row_alignment:1,mag_filter:t.LINEAR};this.texture=new D(t,l);var c=6*e.map(function(t){return t.text.length}).reduce(function(t,e){return t+e},0),u=new Float32Array(3*c),f=new Float32Array(2*c),h=new Float32Array(2*c),d=0,p=0,_=0;e.forEach(function(t){for(var e=t.lat,r=t.lon,i=t.text,a=void 0===t.min_zoom?0:t.min_zoom,s=new B(r,e).toMercatorCoord(),l=s.x,c=s.y,m=o.opts.offset_x,g=o.opts.offset_y,v=p,b=0;b<i.length;b++){var y=i.charCodeAt(b),w=n.glyph_info[y];void 0!==w?(m+=w.left,u[d++]=l,u[d++]=c,u[d++]=a,u[d++]=l,u[d++]=c,u[d++]=a,u[d++]=l,u[d++]=c,u[d++]=a,u[d++]=l,u[d++]=c,u[d++]=a,u[d++]=l,u[d++]=c,u[d++]=a,u[d++]=l,u[d++]=c,u[d++]=a,f[p++]=m,f[p++]=g+n.baseline+w.top-w.height,f[p++]=m,f[p++]=g+n.baseline+w.top-w.height,f[p++]=m+w.width,f[p++]=g+n.baseline+w.top-w.height,f[p++]=m,f[p++]=g+n.baseline+w.top,f[p++]=m+w.width,f[p++]=g+n.baseline+w.top,f[p++]=m+w.width,f[p++]=g+n.baseline+w.top,h[_++]=w.atlas_i/n.atlas_width,h[_++]=(w.atlas_j+w.height)/n.atlas_height,h[_++]=w.atlas_i/n.atlas_width,h[_++]=(w.atlas_j+w.height)/n.atlas_height,h[_++]=(w.atlas_i+w.width)/n.atlas_width,h[_++]=(w.atlas_j+w.height)/n.atlas_height,h[_++]=w.atlas_i/n.atlas_width,h[_++]=w.atlas_j/n.atlas_height,h[_++]=(w.atlas_i+w.width)/n.atlas_width,h[_++]=w.atlas_j/n.atlas_height,h[_++]=(w.atlas_i+w.width)/n.atlas_width,h[_++]=w.atlas_j/n.atlas_height,m+=w.advance-w.left):m+=7}if("center"==o.opts.horizontal_align)for(b=v;b<v+12*i.length;b+=2)f[b]-=(m-o.opts.offset_x)/2;else if("right"==o.opts.horizontal_align)for(b=v;b<v+12*i.length;b+=2)f[b]-=m-o.opts.offset_x;if("top"==o.opts.vertical_align)for(b=v+1;b<v+12*i.length;b+=2)f[b]-=n.baseline-n.top;else if("middle"==o.opts.vertical_align)for(b=v+1;b<v+12*i.length;b+=2)f[b]-=(n.baseline-n.top)/2}),this.shader_manager=new Gn(qn,Kn,[]),this.anchors=new j(t,u,3,t.TRIANGLE_STRIP),this.offsets=new j(t,f,2,t.TRIANGLE_STRIP),this.texcoords=new j(t,h,2,t.TRIANGLE_STRIP)}return t.make=function(e,n,r,o){return Xn(this,void 0,void 0,function(){var i,a,s,l,c,u,f,h,d;return Yn(this,function(p){switch(p.label){case 0:for(i=256,a=n.map(function(t){return Jn([],Zn(t.text),!1)}).flat().map(function(t){return t.charCodeAt(0)}).filter(function(t,e,n){return n.indexOf(t)==e}),s=Math.min.apply(Math,Jn([],Zn(a),!1)),l=Math.max.apply(Math,Jn([],Zn(a),!1)),c=Math.floor(s/i)*i,u=Math.floor(l/i)*i,f=[],h=c;h<=u;h+=i)f.push(r.replace("{range}","".concat(h,"-").concat(h+i-1)));return[4,er.getValue(f)];case 1:return 0!=(d=p.sent()).atlas_height&&0!=d.atlas_width&&0!=d.atlas.length||console.warn("No font data from '".concat(r,"'")),[2,new t(e,n,d,o)]}})})},t.prototype.render=function(t,e,n,r){var o=Zn(n,2),i=o[0],a=o[1],s=I(e),l=this.shader_manager.getShaderProgram(t,s.shaderData),c=$n({u_map_width:i,u_map_height:a,u_map_zoom:r,u_font_size:this.opts.font_size,u_text_color:this.opts.text_color.toRGBATuple(),u_halo_color:this.opts.halo_color.toRGBATuple(),u_offset:0},this.shader_manager.getShaderUniforms(s));c.u_is_halo=this.opts.halo?1:0,l.use({a_pos:this.anchors,a_offset:this.offsets,a_tex_coord:this.texcoords},c,{u_sdf_sampler:this.texture}),t.enable(t.BLEND),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),l.draw(),this.opts.halo&&(l.setUniforms({u_is_halo:0}),l.draw()),"maplibre"==s.type&&s.shaderData.define.includes("GLOBE")||(l.setUniforms({u_offset:-2,u_is_halo:this.opts.halo?1:0}),l.draw(),this.opts.halo&&(l.setUniforms({u_is_halo:0}),l.draw()),l.setUniforms({u_offset:-1,u_is_halo:this.opts.halo?1:0}),l.draw(),this.opts.halo&&(l.setUniforms({u_is_halo:0}),l.draw()),l.setUniforms({u_offset:1,u_is_halo:this.opts.halo?1:0}),l.draw(),this.opts.halo&&(l.setUniforms({u_is_halo:0}),l.draw()))},t}(),or=n(317),ir=(tr=function(t,e){return tr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},tr(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}tr(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),ar=function(){return ar=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},ar.apply(this,arguments)},sr=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function s(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,s)}l((r=r.apply(t,e||[])).next())})},lr=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},cr=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},ur=6378137,fr=6356752.314245;function hr(t){if(0===t.length)return-1;for(var e=t[0],n=0,r=1;r<t.length;r++)t[r]<e&&(n=r,e=t[r]);return n}var dr=function(){function t(t,e,n,r){var o=this;this.type=t,this.is_conformal=e,this.ni=n,this.nj=r,this.billboard_buffer_cache=new T(function(t,e,n){return function(t,e,n,r){return sr(this,void 0,void 0,function(){var o,i,a,s,l,c,u;return lr(this,function(f){switch(f.label){case 0:return o=e.getEarthCoords(),i=o.lats,a=o.lons,s=e.getMinVisibleZoom(n),[4,O.makeBBElements(i,a,s,e.ni,e.nj,r)];case 1:return l=f.sent(),c=new j(t,l.pts,2,t.POINTS,{per_instance:!0}),u=new j(t,l.tex_coords,2,t.POINTS,{per_instance:!0}),[2,{vertices:c,texcoords:u}]}})})}(t,o,e,n)}),this.vector_rotation_cache=new T(function(t,e){return function(t,e,n){var r=e.getEarthCoords(),o=new xn(e.ni*e.nj).fill(parseFloat("nan"));if(n)o.fill(0);else{e.is_conformal||console.warn("Vector rotations for non-conformal projections are not supported. The output may look incorrect.");for(var i=0;i<r.lats.length;i++){var a=r.lons[i],s=r.lats[i];o[i]=e.getVectorRotationAtPoint(a,s)}}var l=C(t,"float16"),c={format:l.format,type:l.type,row_alignment:l.row_alignment,image:new Uint16Array(o.buffer),width:e.ni,height:e.nj,mag_filter:t.LINEAR};return{rotation:new D(t,c)}}(t,o,e)})}return t.prototype.getWGLBillboardBuffers=function(t,e,n){return sr(this,void 0,void 0,function(){return lr(this,function(r){switch(r.label){case 0:return[4,this.billboard_buffer_cache.getValue(t,e,n)];case 1:return[2,r.sent()]}})})},t.prototype.getVectorRotationAtPoint=function(t,e){var n=cr(this.transform(t,e),2),r=n[0],o=n[1],i=cr(this.transform(t+.01,e),2),a=i[0],s=i[1];return Math.atan2(s-o,a-r)},t.prototype.getVectorRotationTexture=function(t,e){return this.vector_rotation_cache.getValue(t,e)},t}(),pr=function(t){function e(e,n,r,o,i,a){var s=t.call(this,e,n,r,o)||this;return s.thin_x=void 0===i?1:i,s.thin_y=void 0===a?1:a,s.buffer_cache=new T(function(t){var e=Math.max(Math.floor(s.ni/20),20),n=Math.max(Math.floor(s.nj/20),20);return function(t,e,n,r){return sr(this,void 0,void 0,function(){var o,i,a,s,l,c,u,f;return lr(this,function(h){switch(h.label){case 0:return o=1/(2*e.ni),i=1/(2*e.nj),a=e.getEarthCoords(n,r),s=a.lats,l=a.lons,[4,O.makeDomainVerticesAndTexCoords(s,l,n,r,o,i)];case 1:return c=h.sent(),u=new j(t,c.vertices,2,t.TRIANGLE_STRIP),f=new j(t,c.tex_coords,2,t.TRIANGLE_STRIP),[2,{vertices:u,texcoords:f}]}})})}(t,s,e,n)}),s}return ir(e,t),e.prototype.xyThinFromMaxZoom=function(t,e){var n=Math.log2(t),r=Math.max(n+1-e,0),o=Math.pow(2,r);return[o,o]},e.prototype.getMinVisibleZoom=function(t){for(var e=new Uint8Array(this.ni*this.nj),n=t/Math.max(this.thin_x,this.thin_y),r=0;r<this.nj*this.thin_y;r++)for(var o=0;o<this.ni*this.thin_x;o++)e[r*this.ni+o]=w(r,o,n);return e},e.prototype.thinDataArray=function(t,e){for(var n=new(A(e))(this.ni*this.nj),r=0;r<this.ni;r++)for(var o=0;o<this.nj;o++){var i=r*this.thin_x+t.ni*o*this.thin_y;n[r+this.ni*o]=e[i]}return n},e.prototype.getWGLBuffers=function(t){return sr(this,void 0,void 0,function(){return lr(this,function(e){switch(e.label){case 0:return[4,this.buffer_cache.getValue(t)];case 1:return[2,e.sent()]}})})},e.prototype.sampleNearestGridPoint=function(t,e,n){var r=cr(this.transform(t,e),2),o=r[0],i=r[1],a=this.getGridCoords(),s=a.x,l=a.y,c=s[0],u=s[s.length-1],f=s[1]-s[0],h=l[0],d=l[l.length-1],p=l[1]-l[0];if(o<c-.5*f||o>u+.5*f||i<h-.5*p||i>d+.5*p)return{sample:NaN,sample_lon:NaN,sample_lat:NaN};var _=hr(s.map(function(t){return Math.abs(t-o)})),m=hr(l.map(function(t){return Math.abs(t-i)})),g=_+m*this.ni,v=cr(this.transform(s[_],l[m],{inverse:!0}),2),b=v[0],y=v[1];return{sample:n[g],sample_lon:b,sample_lat:y}},e}(dr),_r=function(t){function e(e,n,r,o,i,a,s,l){var c=t.call(this,"latlon",!0,e,n,s,l)||this;c.ll_lon=r,c.ll_lat=o,c.ur_lon=i,c.ur_lat=a;var u=(c.ur_lon-c.ll_lon)/(c.ni-1),f=(c.ur_lat-c.ll_lat)/(c.nj-1);return c.ll_cache=new T(function(t,e){for(var n=new Float32Array(t*e),r=new Float32Array(t*e),o=(c.ni-1)/(t-1)*u,i=(c.nj-1)/(e-1)*f,a=0;a<t;a++)for(var s=0;s<e;s++){var l=a+s*t;n[l]=c.ll_lon+a*o,r[l]=c.ll_lat+s*i}return{lons:n,lats:r}}),c.gc_cache=new T(function(){for(var t=new Float32Array(c.ni),e=new Float32Array(c.nj),n=0;n<c.ni;n++)t[n]=c.ll_lon+n*u;for(var r=0;r<c.nj;r++)e[r]=c.ll_lat+r*f;return{x:t,y:e}}),c}return ir(e,t),e.prototype.copy=function(t){return new e(void 0!==(t=void 0!==t?t:{}).ni?t.ni:this.ni,void 0!==t.nj?t.nj:this.nj,void 0!==t.ll_lon?t.ll_lon:this.ll_lon,void 0!==t.ll_lat?t.ll_lat:this.ll_lat,void 0!==t.ur_lon?t.ur_lon:this.ur_lon,void 0!==t.ur_lat?t.ur_lat:this.ur_lat)},e.prototype.getEarthCoords=function(t,e){return t=void 0===t?this.ni:t,e=void 0===e?this.nj:e,this.ll_cache.getValue(t,e)},e.prototype.getGridCoords=function(){return this.gc_cache.getValue()},e.prototype.transform=function(t,e,n){return[t,e]},e.prototype.getThinnedGrid=function(t,n){var r=cr(this.xyThinFromMaxZoom(t,n),2),o=r[0],i=r[1],a=(this.ur_lon-this.ll_lon)/this.ni,s=(this.ur_lat-this.ll_lat)/this.nj,l=Math.ceil(this.ni/o),c=Math.ceil(this.nj/i),u=(this.ni-1)%o,f=(this.nj-1)%i;return new e(l,c,this.ll_lon,this.ll_lat,this.ur_lon-u*a,this.ur_lat-f*s,this.thin_x*o,this.thin_y*i)},e}(pr),mr=function(t){function e(e,n,r,o,i,a,s,l,c,u,f){var h=t.call(this,"latlonrot",!0,e,n,u,f)||this;h.np_lon=r,h.np_lat=o,h.lon_shift=i,h.ll_lon=a,h.ll_lat=s,h.ur_lon=l,h.ur_lat=c,h.llrot=function(t){var e=Math.PI/180,n=t.np_lat*e,r=t.np_lon*e,o=t.lon_shift*e,i=Math.sin(n),a=Math.cos(n);return function(t,n,s){return(s=void 0===s?{inverse:!1}:s).inverse?function(t,n){t*=e,n*=e;var s=Math.sin(n),l=Math.cos(n),c=Math.sin(t-r),u=Math.cos(t-r),f=Math.asin(i*s+a*l*u),h=o+Math.atan2(l*c,i*l*u-a*s);return t>Math.PI&&(t-=2*Math.PI),[h/e,f/e]}(t,n):function(t,n){t*=e,n*=e;var s=Math.sin(n),l=Math.cos(n),c=Math.sin(t-o),u=Math.cos(t-o),f=Math.asin(i*s-a*l*u),h=r+Math.atan2(l*c,i*l*u+a*s);return h>Math.PI&&(h-=2*Math.PI),[h/e,f/e]}(t,n)}}({np_lon:r,np_lat:o,lon_shift:i});var d=(h.ur_lon-h.ll_lon)/(h.ni-1),p=(h.ur_lat-h.ll_lat)/(h.nj-1);return h.ll_cache=new T(function(t,e){for(var n=new Float32Array(t*e),r=new Float32Array(t*e),o=(h.ni-1)/(t-1)*d,i=(h.nj-1)/(e-1)*p,a=0;a<t;a++)for(var s=h.ll_lon+a*o,l=0;l<e;l++){var c=h.ll_lat+l*i,u=cr(h.llrot(s,c),2),f=u[0],_=u[1],m=a+l*t;n[m]=f,r[m]=_}return{lons:n,lats:r}}),h.gc_cache=new T(function(){for(var t=new Float32Array(h.ni),e=new Float32Array(h.nj),n=0;n<h.ni;n++)t[n]=h.ll_lon+n*d;for(var r=0;r<h.nj;r++)e[r]=h.ll_lat+r*p;return{x:t,y:e}}),h}return ir(e,t),e.prototype.copy=function(t){var n=void 0!==(t=void 0!==t?t:{}).ni?t.ni:this.ni,r=void 0!==t.nj?t.nj:this.nj,o=void 0!==t.ll_lon?t.ll_lon:this.ll_lon,i=void 0!==t.ll_lat?t.ll_lat:this.ll_lat,a=void 0!==t.ur_lon?t.ur_lon:this.ur_lon,s=void 0!==t.ur_lat?t.ur_lat:this.ur_lat;return new e(n,r,this.np_lon,this.np_lat,this.lon_shift,o,i,a,s)},e.prototype.getEarthCoords=function(t,e){return t=void 0===t?this.ni:t,e=void 0===e?this.nj:e,this.ll_cache.getValue(t,e)},e.prototype.getGridCoords=function(){return this.gc_cache.getValue()},e.prototype.transform=function(t,e,n){var r="inverse"in(n=void 0===n?{}:n)&&n.inverse;return this.llrot(t,e,{inverse:!r})},e.prototype.getThinnedGrid=function(t,n){var r=cr(this.xyThinFromMaxZoom(t,n),2),o=r[0],i=r[1],a=(this.ur_lon-this.ll_lon)/this.ni,s=(this.ur_lat-this.ll_lat)/this.nj,l=Math.ceil(this.ni/o),c=Math.ceil(this.nj/i),u=(this.ni-1)%o,f=(this.nj-1)%i,h=this.ll_lon,d=this.ll_lat,p=this.ur_lon-u*a,_=this.ur_lat-f*s;return new e(l,c,this.np_lon,this.np_lat,this.lon_shift,h,d,p,_,this.thin_x*o,this.thin_y*i)},e}(pr),gr=function(t){function e(e,n,r,o,i,a,s,l,c,u,f,h,d){var p=t.call(this,"lcc",!0,e,n,h,d)||this;p.lon_0=r,p.lat_0=o,p.lat_std=i,p.ll_x=a,p.ll_y=s,p.ur_x=l,p.ur_y=c,p.a=void 0===u?ur:u,p.b=void 0===f?fr:f,p.lcc=N({lon_0:r,lat_0:o,lat_std:i,a:p.a,b:p.b});var _=(p.ur_x-p.ll_x)/p.ni,m=(p.ur_y-p.ll_y)/p.nj;return p.ll_cache=new T(function(t,e){for(var n=new Float32Array(t*e),r=new Float32Array(t*e),o=(p.ni-1)/(t-1)*_,i=(p.nj-1)/(e-1)*m,a=0;a<t;a++)for(var s=p.ll_x+a*o,l=0;l<e;l++){var c=p.ll_y+l*i,u=cr(p.lcc(s,c,{inverse:!0}),2),f=u[0],h=u[1],d=a+l*t;n[d]=f,r[d]=h}return{lons:n,lats:r}}),p.gc_cache=new T(function(){for(var t=new Float32Array(p.ni),e=new Float32Array(p.nj),n=0;n<p.ni;n++)t[n]=p.ll_x+n*_;for(var r=0;r<p.nj;r++)e[r]=p.ll_y+r*m;return{x:t,y:e}}),p}return ir(e,t),e.fromLLCornerLonLat=function(t,n,r,o,i,a,s,l,c,u,f){var h=N({lon_0:r,lat_0:o,lat_std:i,a:u=void 0===u?ur:u,b:f=void 0===f?fr:f}),d=cr(h(a,s),2),p=d[0],_=d[1];return new e(t,n,r,o,i,p,_,p+t*l,_+n*c,u,f)},e.prototype.copy=function(t){var n=void 0!==(t=void 0!==t?t:{}).ni?t.ni:this.ni,r=void 0!==t.nj?t.nj:this.nj,o=void 0!==t.ll_x?t.ll_x:this.ll_x,i=void 0!==t.ll_y?t.ll_y:this.ll_y,a=void 0!==t.ur_x?t.ur_x:this.ur_x,s=void 0!==t.ur_y?t.ur_y:this.ur_y;return new e(n,r,this.lon_0,this.lat_0,this.lat_std,o,i,a,s,this.a,this.b)},e.prototype.getEarthCoords=function(t,e){return t=void 0===t?this.ni:t,e=void 0===e?this.nj:e,this.ll_cache.getValue(t,e)},e.prototype.getGridCoords=function(){return this.gc_cache.getValue()},e.prototype.transform=function(t,e,n){var r=void 0!==(n=void 0===n?{}:n).inverse&&n.inverse;return this.lcc(t,e,{inverse:r})},e.prototype.getThinnedGrid=function(t,n){var r=cr(this.xyThinFromMaxZoom(t,n),2),o=r[0],i=r[1],a=(this.ur_x-this.ll_x)/this.ni,s=(this.ur_y-this.ll_y)/this.nj,l=Math.ceil(this.ni/o),c=Math.ceil(this.nj/i),u=(this.ni-1)%o,f=(this.nj-1)%i,h=this.ll_x,d=this.ll_y,p=this.ur_x-u*a,_=this.ur_y-f*s;return new e(l,c,this.lon_0,this.lat_0,this.lat_std,h,d,p,_,this.a,this.b,this.thin_x*o,this.thin_y*i)},e}(pr),vr=function(t){function e(e,n){var r=this;return(r=t.call(this,"unstructured",!0,Math.min(e.length,4096),Math.floor(e.length/4096)+1)||this).coords=e,r.zoom_arg=void 0===n?null:n,r.zoom_cache=new T(function(t){var e=Math.log2(t),n=r.coords.map(function(t){return ar(ar({},new B(t.lon,t.lat).toMercatorCoord()),{min_zoom:24})}),o=new or.kdTree(function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],cr(n),!1),function(t,e){return Math.max(Math.abs(t.x-e.x),Math.abs(t.y-e.y))},["x","y"]),i=function(t,n,r){var a=Math.pow(.5,r+1),s=o.nearest({x:t,y:n,min_zoom:0},2,a);if(s.length>0){var l=cr(s.sort(function(t,e){return t[1]-e[1]})[0],2),c=l[0];l[1],24==c.min_zoom&&(c.min_zoom=Math.max(r-e,0))}s.length>1&&r<24+e&&(i(t-a/2,n-a/2,r+1),i(t+a/2,n-a/2,r+1),i(t-a/2,n+a/2,r+1),i(t+a/2,n+a/2,r+1))};return i(.5,.5,0),new Uint8Array(n.map(function(t){return t.min_zoom}))}),r}return ir(e,t),e.prototype.copy=function(){return new e(this.coords)},e.prototype.getEarthCoords=function(){return{lons:new Float32Array(this.coords.map(function(t){return t.lon})),lats:new Float32Array(this.coords.map(function(t){return t.lat}))}},e.prototype.getGridCoords=function(){var t=this.getEarthCoords();return{x:t.lons,y:t.lats}},e.prototype.transform=function(t,e,n){return[t,e]},e.prototype.getMinVisibleZoom=function(t){return null!==this.zoom_arg?this.zoom_arg:this.zoom_cache.getValue(t)},e.prototype.getThinnedGrid=function(t,n){var r=this.getMinVisibleZoom(t);return new e(this.coords.filter(function(t,e){return r[e]<=n}),r.filter(function(t){return t<=n}))},e.prototype.thinDataArray=function(t,e){for(var n=0,r=new(A(e))(this.ni*this.nj),o=0;o<t.coords.length&&!(this.coords[n].lat==t.coords[o].lat&&this.coords[n].lon==t.coords[o].lon&&(r[n++]=e[o],n>=this.coords.length));o++);return r},e.prototype.sampleNearestGridPoint=function(t,e,n){var r=hr(this.coords.map(function(n){return(n.lon-t)*(n.lon-t)+(n.lat-e)*(n.lat-e)}));return{sample:n[r],sample_lon:this.coords[r].lon,sample_lat:this.coords[r].lat}},e}(dr),br=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),yr=function(){return yr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},yr.apply(this,arguments)},wr=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function s(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,s)}l((r=r.apply(t,e||[])).next())})},xr=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},Tr=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Er={color:"#000000",cmap:null,interval:1,levels:null,line_width:2,line_style:"-",quad_as_tri:!1},Ar=function(t){function e(e,n){var r=t.call(this)||this;return r.field=e,r.opts=E(n,Er),r.gl_elems=null,r.contours=null,r}return br(e,t),e.prototype.updateField=function(t){return wr(this,void 0,void 0,function(){var e,n,r,o,i=this;return xr(this,function(a){switch(a.label){case 0:return this.field=t,null===this.gl_elems?[2]:(e=this.gl_elems.gl,[4,this.getContours()]);case 1:return n=a.sent(),r=[],Object.entries(n).forEach(function(t){var e,n,o=Tr(t,2),a=o[0],s=o[1],l=parseFloat(a),c=(e=i.opts.line_style)in zn||Array.isArray(e)&&e.length>0&&e.map(function(t){return"number"==typeof t}).reduce(function(t,e){return t&&e},!0)?i.opts.line_style:i.opts.line_style(l),u="number"==typeof i.opts.line_width?i.opts.line_width:i.opts.line_width(l),f=s.map(function(t){var e={vertices:t};return null!==i.opts.cmap&&(e.data=t.map(function(){return l})),e}),h=r.filter(function(t){return t.line_style==c&&t.line_width==u});0==h.length?(n={data:[],line_width:u,line_style:c},r.push(n)):n=h[0],n.data=n.data.concat(f)}),o=r.map(function(t){return wr(i,void 0,void 0,function(){var n;return xr(this,function(r){switch(r.label){case 0:return n={line_width:t.line_width,line_style:t.line_style},null!==this.opts.cmap?n.cmap=this.opts.cmap:n.color=this.opts.color,[4,Hn.make(e,t.data,n)];case 1:return[2,r.sent()]}})})}),Promise.all(o).then(function(t){null!==i.gl_elems&&(i.contours=t,i.gl_elems.map.triggerRepaint())}),[2]}})})},e.prototype.getContours=function(){return wr(this,void 0,void 0,function(){var t;return xr(this,function(e){switch(e.label){case 0:return t=null===this.opts.levels?void 0:this.opts.levels,[4,this.field.getContours({interval:this.opts.interval,levels:t,quad_as_tri:this.opts.quad_as_tri})];case 1:return[2,e.sent()]}})})},e.prototype.onAdd=function(t,e){return wr(this,void 0,void 0,function(){return xr(this,function(n){switch(n.label){case 0:return this.gl_elems={gl:e,map:t},[4,this.updateField(this.field)];case 1:return n.sent(),[2]}})})},e.prototype.render=function(t,e){if(null!==this.gl_elems&&null!==this.contours){var n=this.gl_elems,r=n.map.getZoom(),o=n.map.getCanvas().width,i=n.map.getCanvas().height,a=n.map.getBearing(),s=n.map.getPitch();this.contours.forEach(function(n){return n.render(t,e,[o,i],r,a,s)})}},e}(k),Sr={n_decimal_places:0,font_face:"Trebuchet MS",font_size:12,font_url_template:"",text_color:"#000000",halo_color:"#000000",halo:!1,density:1},Mr=function(t){function e(e,n){var r=t.call(this)||this;return r.opts=E(n,Sr),r.contours=e,r.text_collection=null,r.gl_elems=null,r}return br(e,t),e.prototype.updateField=function(){return wr(this,void 0,void 0,function(){var t,e,n,r,o,i,a,s,l,c,u,f,h,d,p;return xr(this,function(_){switch(_.label){case 0:if(null===this.gl_elems)return[2];if(t=this.gl_elems.map,e=this.gl_elems.gl,n=t.getStyle(),void 0===(r=""==this.opts.font_url_template?n.glyphs:this.opts.font_url_template))throw"The map style doesn't have any glyph information. Please pass the font_url_template option to ContourLabels";return o=r.replace("{fontstack}",this.opts.font_face),i=[],[4,this.contours.getContours()];case 1:return a=_.sent(),(s=Object.keys(a).map(parseFloat)).sort(function(t,e){return t-e}),l=t.getMaxZoom(),c=.006/this.opts.density*Math.pow(2,7-l),Object.entries(a).forEach(function(t){var e=Tr(t,2),n=e[0],r=e[1],o=parseFloat(n)-s[0],a=n.toString();r.forEach(function(t){var e=t.map(function(t){var e=(new(B.bind.apply(B,function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([void 0],Tr(t),!1)))).toMercatorCoord();return[e.x,e.y]}),n=[];e.forEach(function(t,r){if(0==r)n.push(0);else{var o=e[r-1],i=Math.hypot(o[0]-t[0],o[1]-t[1]);n.push(n[r-1]+i)}});for(var r=0,s=1;s<n.length;s++){var l=c*(r+o/2%1);if(n[s-1]<=l&&l<n[s]){var u=t[s-1],f=t[s],h=(l-n[s-1])/(n[s]-n[s-1]),d=(1-h)*u[0]+h*f[0],p=(1-h)*u[1]+h*f[1];i.push({coord:{lon:d,lat:p},text:a}),r++}}})}),u=new vr(i.map(function(t){return t.coord})),f=u.getMinVisibleZoom(4),h=i.map(function(t,e){return yr(yr({},t.coord),{min_zoom:f[e],text:t.text})}),d={horizontal_align:"center",vertical_align:"middle",font_size:this.opts.font_size,halo:this.opts.halo,text_color:An.fromHex(this.opts.text_color),halo_color:An.fromHex(this.opts.halo_color)},p=this,[4,rr.make(e,h,o,d)];case 2:return p.text_collection=_.sent(),t.triggerRepaint(),[2]}})})},e.prototype.onAdd=function(t,e){return wr(this,void 0,void 0,function(){return xr(this,function(n){return this.gl_elems={gl:e,map:t},this.updateField(),[2]})})},e.prototype.render=function(t,e){if(null!==this.gl_elems&&null!==this.text_collection){var n=this.gl_elems,r=n.map.getCanvas().width,o=n.map.getCanvas().height,i=n.map.getZoom();this.text_collection.render(t,e,[r,o],i)}},e}(k);const Rr=Ar;var Pr=n(533),Fr=n.n(Pr);n.p;var Ir=null;function Or(t){return null===Ir&&(Ir=Fr()({locateFile:function(e,n){return(void 0===t.document_script?n:t.document_script)+e}})),Ir}function kr(t,e,n){return r=this,o=void 0,a=function(){var r,o,i,a,s,l,c;return function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,function(u){switch(u.label){case 0:if(void 0===n.interval&&void 0===n.levels)throw"Must supply either an interval or levels to contourCreator()";return r=void 0===n.interval?0:n.interval,o=void 0!==n.quad_as_tri&&n.quad_as_tri,[4,Or({})];case 1:return i=u.sent(),a=e.getGridCoords(),s=t instanceof Float32Array?i.getContourLevelsFloat32:i.getContourLevelsFloat16,l=t instanceof Float32Array?i.makeContoursFloat32:i.makeContoursFloat16,c=void 0===n.levels?s(t,e.ni,e.nj,r):n.levels,[2,l(t,a.x,a.y,c,function(t,n){return e.transform(t,n,{inverse:!0})},o)]}})},new((i=void 0)||(i=Promise))(function(t,e){function n(t){try{l(a.next(t))}catch(t){e(t)}}function s(t){try{l(a.throw(t))}catch(t){e(t)}}function l(e){var r;e.done?t(e.value):(r=e.value,r instanceof i?r:new i(function(t){t(r)})).then(n,s)}l((a=a.apply(r,o||[])).next())});var r,o,i,a}var Cr=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function s(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,s)}l((r=r.apply(t,e||[])).next())})},Nr=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},Br=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Gr=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))};function Lr(t){return t instanceof Float32Array?"float32":t instanceof Uint8Array?"uint8":"float16"}var jr=function(){function t(t,e){var n=this;if(this.grid=t,this.data=e,t.ni*t.nj!=e.length)throw"Data size (".concat(e.length,") doesn't match the grid dimensions (").concat(t.ni," x ").concat(t.nj,"; expected ").concat(t.ni*t.nj," points)");this.contour_cache=new T(function(t){return Cr(n,void 0,void 0,function(){return Nr(this,function(e){switch(e.label){case 0:return[4,kr(this.data,this.grid,t)];case 1:return[2,e.sent()]}})})})}return t.prototype.getTextureData=function(){var t=this.data,e=Lr(t);return"float32"==e||"uint8"==e?t:new Uint16Array(t.buffer)},t.prototype.getWGLTextureSpec=function(t,e){var n=this.getTextureData(),r=C(t,Lr(this.data)),o=r.format,i=r.type,a=r.row_alignment;return{format:o,type:i,width:this.grid.ni,height:this.grid.nj,image:n,mag_filter:e,row_alignment:a}},t.prototype.getContours=function(t){return Cr(this,void 0,void 0,function(){return Nr(this,function(e){switch(e.label){case 0:return[4,this.contour_cache.getValue(t)];case 1:return[2,e.sent()]}})})},t.aggregateFields=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=new(A(n[0].data))(function(t,e){var n,r,o,i,a,s;return Nr(this,function(l){switch(l.label){case 0:l.trys.push([0,5,6,7]),n=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t),r=n.next(),l.label=1;case 1:return r.done?[3,4]:(o=r.value,[4,e(o)]);case 2:l.sent(),l.label=3;case 3:return r=n.next(),[3,1];case 4:return[3,7];case 5:return i=l.sent(),a={error:i},[3,7];case 6:try{r&&!r.done&&(s=n.return)&&s.call(n)}finally{if(a)throw a.error}return[7];case 7:return[2]}})}(x.apply(void 0,Gr([],Br(n.map(function(t){return t.data})),!1)),function(t){return e.apply(void 0,Gr([],Br(t),!1))}));return new t(n[0].grid,o)},t.prototype.sampleField=function(t,e){return this.grid.sampleNearestGridPoint(t,e,this.data).sample},t}(),Dr=function(){function t(t,e,n,r){r=void 0===r?{}:r,this.u=new jr(t,e),this.v=new jr(t,n),this.relative_to=void 0===r.relative_to?"grid":r.relative_to}return t.prototype.getTextureData=function(){var t=this.u.data,e=this.v.data,n=Lr(t),r=Lr(t);return{u:"float32"==n||"uint8"==n?t:new Uint16Array(t.buffer),v:"float32"==r||"uint8"==r?e:new Uint16Array(e.buffer)}},t.prototype.getWGLTextureSpecs=function(t,e){var n=this.getTextureData(),r=n.u,o=n.v,i=C(t,Lr(this.u.data)),a=i.format,s=i.type,l=i.row_alignment;return{u:{format:a,type:s,width:this.grid.ni,height:this.grid.nj,image:r,mag_filter:e,row_alignment:l},v:{format:a,type:s,width:this.grid.ni,height:this.grid.nj,image:o,mag_filter:e,row_alignment:l}}},t.prototype.getThinnedField=function(e,n){var r=this.grid.getThinnedGrid(e,n),o=r.thinDataArray(this.grid,this.u.data),i=r.thinDataArray(this.grid,this.v.data);return new t(r,o,i,{relative_to:this.relative_to})},Object.defineProperty(t.prototype,"grid",{get:function(){return this.u.grid},enumerable:!1,configurable:!0}),t.prototype.sampleField=function(t,e){var n=this.grid.sampleNearestGridPoint(t,e,this.u.data),r=this.grid.sampleNearestGridPoint(t,e,this.v.data),o="earth"==this.relative_to?0:this.grid.getVectorRotationAtPoint(n.sample_lon,n.sample_lat),i=Math.hypot(n.sample,r.sample),a=180*(Math.PI/2-Math.atan2(-r.sample,-n.sample)+o)/Math.PI;return a>360&&(a-=360),a<0&&(a+=360),[a,i]},t}(),Ur=function(){function t(t,e){this.profiles=e,this.grid=t}return t.prototype.getStormMotionGrid=function(){var t=this,e=this.profiles,n=new xn(this.grid.ni*this.grid.nj).fill(parseFloat("nan")),r=new xn(this.grid.ni*this.grid.nj).fill(parseFloat("nan"));return e.forEach(function(e){var o=e.ilon+t.grid.ni*e.jlat;P(e)?(n[o]=e.smu,r[o]=e.smv):(n[o]=0,r[o]=0)}),new Dr(this.grid,n,r,{relative_to:"grid"})},t.prototype.getProfileCoords=function(){var t=this,e=this.grid.getEarthCoords(),n=e.lats,r=e.lons,o=new Float32Array(this.profiles.length),i=new Float32Array(this.profiles.length);return this.profiles.forEach(function(e,a){var s=e.ilon+e.jlat*t.grid.ni;o[a]=n[s],i[a]=r[s]}),{lats:o,lons:i}},t}(),zr=function(){function t(t,e){this.grid=t,this.data=e}return t.prototype.getScalar=function(t){var e=this.data.map(function(e){return e[t]});if(!e.map(function(t){return"number"==typeof t||null===t}).reduce(function(t,e){return t&&e},!0))throw"It doesn't look like ".concat(t," contains scalar numerical data");return e},t.prototype.getStrings=function(t){var e=this.data.map(function(e){return e[t]});if(!e.map(function(t){return"string"==typeof t||null===t}).reduce(function(t,e){return t&&e},!0))throw"It doesn't look like ".concat(t," contains string data");return e},t.prototype.getVector=function(t){var e=this.data.map(function(e){return e[t]});if(!e.map(function(t){return Array.isArray(t)}).reduce(function(t,e){return t&&e},!0))throw"It doesn't look like ".concat(t," contains vector data");var n=e,r=new xn(this.grid.ni*this.grid.nj).fill(parseFloat("nan")),o=new xn(this.grid.ni*this.grid.nj).fill(parseFloat("nan"));return n.forEach(function(t,e){var n=Br(t,2),i=n[0],a=n[1];if(null!==i&&null!==a){var s=Br(function(t,e){return[-t*Math.sin(e*Math.PI/180),-t*Math.cos(e*Math.PI/180)]}(i,a),2),l=s[0],c=s[1];r[e]=l,o[e]=c}}),new Dr(this.grid,r,o,{relative_to:"earth"})},t}(),Hr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Vr=function(){return Vr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Vr.apply(this,arguments)},Wr=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function s(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,s)}l((r=r.apply(t,e||[])).next())})},$r=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},Xr=n(303),Yr=n(401),Zr={cmap:[new Rn([0,1],["#000000"],{overflow_color:"#000000",underflow_color:"#000000"})],cmap_mask:null,opacity:1},Jr=function(t){function e(e,n){var r=t.call(this)||this;return r.field=e,r.opts=E(n,Zr),r.opts.cmap=Array.isArray(r.opts.cmap)?r.opts.cmap:[r.opts.cmap],r.cmap_gpu=r.opts.cmap.map(function(t){return new Bn(t)}),r.gl_elems=null,r.fill_texture=null,r.mask_texture=null,r.image_mag_filter=null,r.cmap_mag_filter=null,r}return Hr(e,t),e.prototype.updateField=function(t,e){return Wr(this,void 0,void 0,function(){var n,r,o,i,a;return $r(this,function(s){if(this.field=t,null===this.image_mag_filter||null===this.cmap_mag_filter)throw"Implement magnification filters in a subclass";if(null===this.gl_elems)return[2];if(n=this.gl_elems.gl,r=this.gl_elems.map,o=this.field.getWGLTextureSpec(n,this.image_mag_filter),null===this.fill_texture?this.fill_texture=new D(n,o):this.fill_texture.setImageData(o),void 0!==e){if(null===this.opts.cmap_mask)return console.warn("A mask was passed to updateField on a Fill component that didn't have a mask. The updated mask will be ignored."),[2];i=new jr(this.field.grid,e),a=i.getWGLTextureSpec(n,n.NEAREST),null===this.mask_texture?this.mask_texture=new D(n,a):this.mask_texture.setImageData(a)}return r.triggerRepaint(),[2]})})},e.prototype.onAdd=function(t,e){return Wr(this,void 0,void 0,function(){var n,r,o,i,a,s=this;return $r(this,function(l){switch(l.label){case 0:return[4,this.field.grid.getWGLBuffers(e)];case 1:return n=l.sent(),r=n.vertices,o=n.texcoords,this.cmap_gpu.forEach(function(t){if(null===s.image_mag_filter||null===s.cmap_mag_filter)throw"Implement magnification filters in a subclass";t.setupShaderVariables(e,s.cmap_mag_filter)}),i=[],null!==this.opts.cmap_mask&&i.push("MASK"),a=new Gn(Xr,Bn.applyShader(Yr),i),this.gl_elems={gl:e,shader_manager:a,map:t,vertices:r,texcoords:o},this.updateField(this.field,null===this.opts.cmap_mask?void 0:this.opts.cmap_mask),[2]}})})},e.prototype.render=function(t,e){var n=this;if(null!==this.gl_elems&&null!==this.fill_texture){var r=this.gl_elems,o=I(e),i=this.gl_elems.shader_manager.getShaderProgram(t,o.shaderData);i.use({a_pos:r.vertices,a_tex_coord:r.texcoords},Vr({u_opacity:this.opts.opacity},this.gl_elems.shader_manager.getShaderUniforms(o)),{u_fill_sampler:this.fill_texture}),this.cmap_gpu.forEach(function(e,r){i.setUniforms({u_offset:0}),null!==n.opts.cmap_mask&&null!==n.mask_texture&&(i.setUniforms({u_mask_val:r+1}),i.bindTextures({u_mask_sampler:n.mask_texture})),e.bindShaderVariables(i),t.enable(t.BLEND),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),i.draw(),"maplibre"==o.type&&o.shaderData.define.includes("GLOBE")||(i.setUniforms({u_offset:-2}),i.draw(),i.setUniforms({u_offset:-1}),i.draw(),i.setUniforms({u_offset:1}),i.draw())})}},e}(k),qr=function(t){function e(e,n){return t.call(this,e,n)||this}return Hr(e,t),e.prototype.updateField=function(e,n){return Wr(this,void 0,void 0,function(){return $r(this,function(r){switch(r.label){case 0:return[4,t.prototype.updateField.call(this,e,n)];case 1:return r.sent(),[2]}})})},e.prototype.onAdd=function(e,n){return Wr(this,void 0,void 0,function(){return $r(this,function(r){switch(r.label){case 0:return this.image_mag_filter=n.NEAREST,this.cmap_mag_filter=n.LINEAR,[4,t.prototype.onAdd.call(this,e,n)];case 1:return r.sent(),[2]}})})},e.prototype.render=function(e,n){t.prototype.render.call(this,e,n)},e}(Jr),Kr=function(t){function e(e,n){return t.call(this,e,n)||this}return Hr(e,t),e.prototype.updateField=function(e,n){return Wr(this,void 0,void 0,function(){return $r(this,function(r){switch(r.label){case 0:return[4,t.prototype.updateField.call(this,e,n)];case 1:return r.sent(),[2]}})})},e.prototype.onAdd=function(e,n){return Wr(this,void 0,void 0,function(){return $r(this,function(r){switch(r.label){case 0:return this.image_mag_filter=n.LINEAR,this.cmap_mag_filter=n.NEAREST,[4,t.prototype.onAdd.call(this,e,n)];case 1:return r.sent(),[2]}})})},e.prototype.render=function(e,n){t.prototype.render.call(this,e,n)},e}(Jr),Qr=function(){return Qr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Qr.apply(this,arguments)},to=n(631),eo=n(254),no=function(){function t(t,e,n,r,o,i,a){a=void 0===a?{}:a,this.color=void 0===a.color?new An([0,0,0,1]):a.color,this.cmap=void 0===a.cmap?null:a.cmap,this.rotate_with_map=void 0===a.rotate_with_map||a.rotate_with_map,this.field=t,this.spec=o,this.size_multiplier=i,this.thin_fac=e,this.max_zoom=n,this.billboard_image=r,this.gl_elems=null,this.wind_textures=null}return t.prototype.updateField=function(t){if(this.field=t,null!==this.gl_elems){var e=this.gl_elems.gl,n=this.field.getThinnedField(this.thin_fac,this.max_zoom).getWGLTextureSpecs(e,e.NEAREST),r=n.u,o=n.v;null===this.wind_textures?this.wind_textures={u:new D(e,r),v:new D(e,o)}:(this.wind_textures.u.setImageData(r),this.wind_textures.v.setImageData(o))}},t.prototype.setup=function(t){return e=this,n=void 0,o=function(){var e,n,r,o,i,a,s,l,c,u,f,h;return function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,function(d){switch(d.label){case 0:return e=this.field.grid.getThinnedGrid(this.thin_fac,this.max_zoom),n=new Float32Array([0,1,2,3]),r=new j(t,n,1,t.TRIANGLE_STRIP),[4,e.getWGLBillboardBuffers(t,this.thin_fac,this.max_zoom)];case 1:return o=d.sent(),i=o.vertices,a=o.texcoords,s=e.getVectorRotationTexture(t,"earth"==this.field.relative_to).rotation,l=new D(t,this.billboard_image),c=[],u=eo,f=null,null!==this.cmap&&(u=Bn.applyShader(u),(f=new Bn(this.cmap)).setupShaderVariables(t,t.NEAREST),c.push("COLORMAP")),h=new Gn(to,u,c),this.gl_elems={gl:t,shader_manager:h,geom_vertices:r,vertices:i,texcoords:a,texture:l,proj_rot_texture:s,cmap_gpu:f},[2]}})},new((r=void 0)||(r=Promise))(function(t,i){function a(t){try{l(o.next(t))}catch(t){i(t)}}function s(t){try{l(o.throw(t))}catch(t){i(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r(function(t){t(n)})).then(a,s)}l((o=o.apply(e,n||[])).next())});var e,n,r,o},t.prototype.render=function(t,e,n,r,o,i){var a=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}(n,2),s=a[0],l=a[1];if(null!==this.gl_elems&&null!==this.wind_textures){var c=I(e),u=this.gl_elems.shader_manager.getShaderProgram(t,c.shaderData),f=this.gl_elems,h=this.spec.BB_HEIGHT*(l/s)*this.size_multiplier,d=this.spec.BB_WIDTH/this.spec.BB_TEX_WIDTH,p=this.spec.BB_HEIGHT/this.spec.BB_TEX_HEIGHT;u.use({a_geom:f.geom_vertices,a_pos:f.vertices,a_tex_coord:f.texcoords},Qr({u_bb_size:h,u_bb_width:d,u_bb_height:p,u_bb_mag_bin_size:this.spec.BB_MAG_BIN_SIZE,u_bb_mag_wrap:this.spec.BB_MAG_WRAP,u_offset:0,u_map_aspect:l/s,u_zoom:r,u_rotate_with_map:this.rotate_with_map?1:0},this.gl_elems.shader_manager.getShaderUniforms(c)),{u_sampler:f.texture,u_u_sampler:this.wind_textures.u,u_v_sampler:this.wind_textures.v,u_rot_sampler:f.proj_rot_texture}),null!==f.cmap_gpu?f.cmap_gpu.bindShaderVariables(u):u.setUniforms({u_bb_color:this.color.toRGBATuple()}),t.enable(t.BLEND),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),u.draw(),"maplibre"==c.type&&c.shaderData.define.includes("GLOBE")||(u.setUniforms({u_offset:-2}),u.draw(),u.setUniforms({u_offset:-1}),u.draw(),u.setUniforms({u_offset:1}),u.draw())}},t}(),ro=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),oo=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function s(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,s)}l((r=r.apply(t,e||[])).next())})},io=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},ao={BB_WIDTH:85,BB_HEIGHT:256,BB_TEX_WIDTH:1024,BB_TEX_HEIGHT:1024,BB_MAG_MAX:235,BB_MAG_WRAP:60,BB_MAG_BIN_SIZE:5},so={color:"#000000",cmap:null,line_width:2,barb_size_multiplier:1,thin_fac:1};const lo=function(t){function e(e,n){var r=t.call(this)||this;return r.fields=e,r.opts=E(n,so),r.color=An.fromHex(r.opts.color),r.barb_texture=function(t,e){var n=document.createElement("canvas");function r(e,n,r,o){var i=t.BB_WIDTH/2-4,a=i/2;if(o<2.5)e.beginPath(),e.arc(n,r,i/2,0,2*Math.PI),e.stroke();else{var s=0,l=o,c=0,u=Math.floor((l+2.5)/50);c+=u*i/2+a+(u-1)*a/2,l-=50*u;var f=Math.floor((l+2.5)/10);c+=f*a,l-=10*f,c+=Math.floor((l+2.5)/5)*a,o<7.5&&(c+=a),c=Math.max(120,c),e.beginPath(),e.moveTo(n,r),e.lineTo(n,r+c),l=o,s=r+c;for(var h=!1,d=!0;l>47.5;)h&&(s+=a/2),d||e.moveTo(n,s),e.lineTo(n-i,s),e.lineTo(n,s-i/2),s-=i/2+a,l-=50,h=!0,d=!1;for(;l>7.5;)d||e.moveTo(n,s),e.lineTo(n-i,s+i/2),s-=a,l-=10,d=!1;for(o<7.5&&(s-=a);l>2.5;)e.moveTo(n,s),e.lineTo(n-i/2,s+i/4),l-=5;e.stroke()}}n.width=t.BB_TEX_WIDTH,n.height=t.BB_TEX_HEIGHT;var o=n.getContext("2d");if(null===o)throw"Could not get rendering context for the wind barb canvas";o.lineWidth=e,o.miterLimit=4;for(var i=0;i<=t.BB_MAG_MAX;i+=t.BB_MAG_BIN_SIZE)r(o,i%t.BB_MAG_WRAP/t.BB_MAG_BIN_SIZE*t.BB_WIDTH+t.BB_WIDTH/2,Math.floor(i/t.BB_MAG_WRAP)*t.BB_HEIGHT+t.BB_WIDTH/2,i);return n}(ao,r.opts.line_width/r.opts.barb_size_multiplier*4),r.gl_elems=null,r}return ro(e,t),e.prototype.updateField=function(t){return oo(this,void 0,void 0,function(){return io(this,function(e){return this.fields=t,null===this.gl_elems||(this.gl_elems.barb_billboards.updateField(t),this.gl_elems.map.triggerRepaint()),[2]})})},e.prototype.onAdd=function(t,e){return oo(this,void 0,void 0,function(){var n,r,o,i;return io(this,function(a){switch(a.label){case 0:return e.getExtension("OES_texture_float"),e.getExtension("OES_texture_float_linear"),n=t.getMaxZoom(),r={format:e.RGBA,type:e.UNSIGNED_BYTE,image:this.barb_texture,mag_filter:e.NEAREST},o=null===this.opts.cmap?void 0:this.opts.cmap,[4,(i=new no(this.fields,this.opts.thin_fac,n,r,ao,.1*this.opts.barb_size_multiplier,{color:this.color,cmap:o})).setup(e)];case 1:return a.sent(),this.gl_elems={map:t,barb_billboards:i},this.updateField(this.fields),[2]}})})},e.prototype.render=function(t,e){if(null!==this.gl_elems){var n=this.gl_elems,r=n.map.getZoom(),o=n.map.getCanvas().width,i=n.map.getCanvas().height,a=n.map.getBearing(),s=n.map.getPitch();n.barb_billboards.render(t,e,[o,i],r,a,s)}},e}(k);var co=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),uo=function(){return uo=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},uo.apply(this,arguments)},fo=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function s(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,s)}l((r=r.apply(t,e||[])).next())})},ho=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},po=n(829),_o=n(375),mo={colors:["#000000"],opacity:1};const go=function(t){function e(e,n){var r=t.call(this)||this;return r.field=e,r.opts=E(n,mo),r.color_components=r.opts.colors.map(function(t){return An.fromHex(t).toRGBATuple()}).flat(),r.gl_elems=null,r.fill_texture=null,r}return co(e,t),e.prototype.updateField=function(t){return fo(this,void 0,void 0,function(){var e,n;return ho(this,function(r){return this.field=t,null===this.gl_elems||((e=this.gl_elems.gl).pixelStorei(e.UNPACK_ALIGNMENT,2),n=this.field.getWGLTextureSpec(e,e.NEAREST),null===this.fill_texture?this.fill_texture=new D(e,n):this.fill_texture.setImageData(n)),[2]})})},e.prototype.onAdd=function(t,e){return fo(this,void 0,void 0,function(){var t,n,r,o,i,a;return ho(this,function(s){switch(s.label){case 0:return e.getExtension("OES_texture_float"),[4,this.field.grid.getWGLBuffers(e)];case 1:return t=s.sent(),n=t.vertices,r=t.texcoords,o=n,i=r,a=new Gn(po,_o,[]),this.gl_elems={gl:e,shader_manager:a,vertices:o,texcoords:i},this.updateField(this.field),[2]}})})},e.prototype.render=function(t,e){if(null!==this.gl_elems&&null!==this.fill_texture){var n=this.gl_elems,r=I(e),o=this.gl_elems.shader_manager.getShaderProgram(t,r.shaderData);o.use({a_pos:n.vertices,a_tex_coord:n.texcoords},uo({u_opacity:this.opts.opacity,u_colors:this.color_components,u_num_colors:this.opts.colors.length,u_offset:0},this.gl_elems.shader_manager.getShaderUniforms(r)),{u_fill_sampler:this.fill_texture}),t.enable(t.BLEND),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),o.draw(),"maplibre"==r.type&&r.shaderData.define.includes("GLOBE")||(o.setUniforms({u_offset:-2}),o.draw(),o.setUniforms({u_offset:-1}),o.draw(),o.setUniforms({u_offset:1}),o.draw())}},e}(k);var vo=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),bo=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function s(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,s)}l((r=r.apply(t,e||[])).next())})},yo=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},wo=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},xo=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},To={BB_WIDTH:256,BB_HEIGHT:256,BB_TEX_WIDTH:256,BB_TEX_HEIGHT:256,BB_MAG_MAX:1e3,BB_MAG_WRAP:1e3,BB_MAG_BIN_SIZE:1e3},Eo={bgcolor:"#000000",thin_fac:1,hodo_line_width:2.5,background_line_width:1.5,height_cmap:new Rn([0,1,3,6,9],["#ffffcc","#a1dab4","#41b6c4","#225ea8"]),max_wind_speed_ring:80};const Ao=function(t){function e(e,n){var r=t.call(this)||this;return r.profile_field=e,r.opts=E(n,Eo),r.hodo_bg_texture=function(t,e){var n=document.createElement("canvas");n.width=To.BB_TEX_WIDTH,n.height=To.BB_TEX_HEIGHT;var r=n.getContext("2d");if(null===r)throw"Could not get rendering context for the hodograph background canvas";r.lineWidth=t;for(var o=To.BB_TEX_WIDTH/4;o<=To.BB_TEX_WIDTH/2;o+=To.BB_TEX_WIDTH/4)r.beginPath(),r.arc(To.BB_TEX_WIDTH/2,To.BB_TEX_WIDTH/2,o-t/2,0,2*Math.PI),r.stroke();if(e){var i=To.BB_TEX_WIDTH/2,a=To.BB_TEX_WIDTH/2;r.beginPath(),r.moveTo(i,a),r.lineTo(i+10,a+20),r.lineTo(i-10,a+20),r.lineTo(i,a),r.fill()}else r.beginPath(),r.arc(To.BB_TEX_WIDTH/2,To.BB_TEX_WIDTH/2,t,0,2*Math.PI),r.fill();return n}(2.5*r.opts.background_line_width,P(e.profiles[0])),r.hodo_scale=(To.BB_TEX_WIDTH-r.opts.background_line_width/2)/(To.BB_TEX_WIDTH*r.opts.max_wind_speed_ring),r.bg_size=140,r.gl_elems=null,r.line_elems=null,r}return vo(e,t),e.prototype.updateField=function(t){return bo(this,void 0,void 0,function(){var e,n,r,o,i,a,s,l,c,u;return yo(this,function(f){switch(f.label){case 0:return this.profile_field=t,null===this.gl_elems?[2]:(e=this.gl_elems.gl,this.gl_elems.bg_billboard.updateField(t.getStormMotionGrid()),n=this.profile_field.profiles,r=this.profile_field.getProfileCoords(),o=r.lats,i=r.lons,a=this.profile_field.grid.getMinVisibleZoom(this.opts.thin_fac),s=n.map(function(t,e){return{offsets:xo([],wo(t.u),!1).map(function(e,n){return P(t)?[e-t.smu,t.v[n]-t.smv]:[e,t.v[n]]}),vertices:xo([],wo(t.u),!1).map(function(t){return[i[e],o[e]]}),zoom:a[e],data:xo([],wo(t.z),!1)}}),[4,Hn.make(e,s,{line_width:this.opts.hodo_line_width,cmap:this.opts.height_cmap,offset_scale:this.hodo_scale*this.bg_size,offset_rotates_with_map:!1})]);case 1:return l=f.sent(),c=n.map(function(t,e){if(!P(t))return{vertices:[]};var n=Math.hypot(t.smu,t.smv),r=Math.PI/2-Math.atan2(-t.smv,-t.smu);return{offsets:[[2*Math.sin(r),2*Math.cos(r)],[n*Math.sin(r),n*Math.cos(r)]],vertices:[[i[e],o[e]],[i[e],o[e]]],zoom:a[e]}}),[4,Hn.make(e,c,{line_width:this.opts.background_line_width,color:this.opts.bgcolor,offset_scale:this.hodo_scale*this.bg_size,offset_rotates_with_map:!1})];case 2:return u=f.sent(),this.line_elems={hodo_line:l,sm_line:u},[2]}})})},e.prototype.onAdd=function(t,e){return bo(this,void 0,void 0,function(){var n,r,o;return yo(this,function(i){switch(i.label){case 0:return n={format:e.RGBA,type:e.UNSIGNED_BYTE,image:this.hodo_bg_texture,mag_filter:e.NEAREST},r=t.getMaxZoom(),[4,(o=new no(this.profile_field.getStormMotionGrid(),this.opts.thin_fac,r,n,To,.004*this.bg_size,{color:An.fromHex(this.opts.bgcolor),rotate_with_map:!1})).setup(e)];case 1:return i.sent(),this.gl_elems={gl:e,map:t,bg_billboard:o},this.updateField(this.profile_field),[2]}})})},e.prototype.render=function(t,e){if(null!==this.gl_elems&&null!==this.line_elems){var n=this.gl_elems,r=this.line_elems,o=n.map.getZoom(),i=n.map.getCanvas().width,a=n.map.getCanvas().height,s=n.map.getBearing(),l=n.map.getPitch();r.hodo_line.render(t,e,[i,a],o,s,l),r.sm_line.render(t,e,[i,a],o,s,s),n.bg_billboard.render(t,e,[i,a],o,s,l)}},e}(k);var So=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Mo=function(){return Mo=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Mo.apply(this,arguments)},Ro=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function s(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,s)}l((r=r.apply(t,e||[])).next())})},Po=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},Fo=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Io={"0/8":59658,"1/8":59659,"2/8":59660,"3/8":59661,"4/8":59662,"5/8":59663,"6/8":59664,"7/8":59665,"8/8":59666,clr:59658,few:59660,sct:59662,bkn:59664,ovc:59666,obsc:59667,va:59810,fu:59810,hz:59811,du:59812,bldu:59814,sa:59814,blsa:59814,vcblsa:59814,vcbldu:59814,blpy:59814,po:59816,vcpo:59816,vcds:59817,vcss:59817,br:59818,bcbr:59818,bc:59819,mifg:59820,vcts:59821,virga:59822,vcsh:59824,ts:59825,thdr:59825,vctshz:59825,tsfzfg:59825,tsbr:59825,tsdz:59825,vctsup:59825,"-tsup":59825,tsup:59825,"+tsup":59825,sq:59826,fc:59827,"+fc":59827,ds:59839,ss:59839,drsa:59839,drdu:59839,"+ds":59842,"+ss":59842,drsn:59844,"+drsn":59845,"-blsn":59846,blsn:59846,"+blsn":59847,vcblsn:59846,vcfg:59848,bcfg:59849,prfg:59852,fg:59853,fzfg:59857,"-vctsdz":59859,"-dz":59859,"-dzbr":59859,vctsdz:59861,dz:59861,"+vctsdz":59863,"+dz":59863,"-fzdz":59864,"-fzdzsn":59864,fzdz:59865,"+fzdz":59865,fzdzsn:59865,"-dzra":59866,dzra:59867,"+dzra":59867,"-ra":59869,"-rabr":59869,ra:59871,rabr:59871,rafg:59871,vcra:59871,"+ra":59873,"-fzra":59874,"-fzrasn":59874,"-fzrabr":59874,"-fzrapl":59874,"-fzrasnpl":59874,tsfzrapl:59875,"-tsfzra":59875,fzra:59875,"+fzra":59875,fzrasn:59875,tsfzra:59875,"-dzsn":59876,"-rasn":59876,"-snra":59876,"-sndz":59876,rasn:59877,"+rasn":59877,snra:59877,dzsn:59877,sndz:59877,"+dzsn":59877,"+sndz":59877,"-sn":59879,"-snbr":59879,sn:59881,"+sn":59883,"-snsg":59885,sg:59885,"-sg":59885,ic:59886,"-fzdzpl":59887,"-fzdzplsn":59887,fzdzpl:59887,"-fzraplsn":59887,fzrapl:59887,"+fzrapl":59887,"-rapl":59887,"-rasnpl":59887,"-raplsn":59887,"+rapl":59887,rapl:59887,"-snpl":59887,snpl:59887,"-pl":59887,pl:59887,"-plsn":59887,"-plra":59887,plra:59887,"-pldz":59887,"+pl":59887,plsn:59887,plup:59887,"+plsn":59887,"-sh":59888,"-shra":59888,sh:59889,shra:59889,"+sh":59889,"+shra":59889,"-shrasn":59891,"-shsnra":59891,"+shrabr":59892,shrasn:59892,"+shrasn":59892,shsnra:59892,"+shsnra":59892,"-shsn":59893,shsn:59894,"+shsn":59894,"-gs":59895,"-shgs":59895,fzraplgs:59896,"-sngs":59896,gsplsn:59896,gspl:59896,plgssn:59896,gs:59896,shgs:59896,"+gs":59896,"+shgs":59896,"-gr":59897,"-shgr":59897,"-sngr":59898,gr:59898,shgr:59898,"+gr":59898,"+shgr":59898,"-tsrasn":59907,tsrasn:59907,"-tssnra":59907,tssnra:59907,"-vctsra":59908,"-tsra":59908,tsra:59908,"-tsdz":59908,vctsra:59908,tspl:59909,"-tssn":59909,"-tspl":59909,tssn:59909,"-vctssn":59909,vctssn:59909,tsplsn:59909,tssnpl:59909,"-tssnpl":59909,"-tsragr":59910,tsrags:59910,tsragr:59910,tsgs:59910,tsgr:59910,"+tsfzrapl":59911,"+vctsra":59912,"+tsra":59912,"+tsfzra":59912,"+tssn":59913,"+tspl":59913,"+tsplsn":59913,"+vctssn":59913,tssa:59914,tsds:59914,tsdu:59914,"+tsgs":59915,"+tsgr":59915,"+tsrags":59915,"+tsragr":59915,in:59750,"-up":59750,up:59750,"+up":59751,"-fzup":59756,fzup:59756,"+fzup":59757},Oo={config:{},thin_fac:1,font_face:"Trebuchet MS",font_size:12,font_url_template:""};function ko(t,e){var n,r,o,i;return e=void 0===e?10:e,"ll"==t||"cl"==t||"ul"==t?(n="right",o=-e):"lc"==t||"c"==t||"uc"==t?(n="center",o=0):(n="left",o=e),"ll"==t||"lc"==t||"lr"==t?(r="top",i=-e):"cl"==t||"c"==t||"cr"==t?(r="middle",i=0):(r="baseline",i=e),{horizontal_align:n,vertical_align:r,offset_x:o,offset_y:i}}const Co=function(t){function e(e,n){var r=t.call(this)||this;return r.field=e,r.opts=E(n,Oo),r.gl_elems=null,r.text_components=null,r}return So(e,t),e.prototype.updateField=function(t){return Ro(this,void 0,void 0,function(){var e,n,r,o,i,a,s,l,c,u=this;return Po(this,function(f){switch(f.label){case 0:if(this.field=t,null===this.gl_elems)return[2];if(e=this.gl_elems.map,n=this.gl_elems.gl,r=this.gl_elems.barb_components,o=e.getStyle(),void 0===(i=""==this.opts.font_url_template?o.glyphs:this.opts.font_url_template))throw"The map style doesn't have any glyph information. Please pass the font_url_template option to StationPlot";return a=i.replace("{fontstack}",this.opts.font_face),s=0,l=Object.entries(this.opts.config).map(function(t){return Ro(u,[t],void 0,function(t){var e,o,l,c,u,f,h,d,p,_,m,g,v,b,y=Fo(t,2),w=y[0],x=y[1];return Po(this,function(t){switch(t.label){case 0:return e=w,"number"!=x.type&&"string"!=x.type?[3,2]:(u=x.pos,f=void 0===x.color?An.fromHex("#000000"):An.normalizeColor(x.color),h=void 0===x.halo_color?An.fromHex("#ffffff"):An.normalizeColor(x.halo_color),d=void 0===x.halo||x.halo,o=this.field.grid.getEarthCoords(),l=this.field.grid.getMinVisibleZoom(this.opts.thin_fac),v=void 0,"number"==x.type?(p=this.field.getScalar(e),c=void 0===x.formatter?function(t){return null===t?"null":t.toString()}:x.formatter,v=p.map(function(t,e){return{text:c(t),lat:o.lats[e],lon:o.lons[e],min_zoom:l[e]}})):(p=this.field.getStrings(e),v=p.map(function(t,e){return{text:null===t?"":t,lat:o.lats[e],lon:o.lons[e],min_zoom:l[e]}})),b=Mo(Mo({},ko(u)),{font_size:this.opts.font_size,halo:d,text_color:f,halo_color:h}),[4,rr.make(n,v,a,b)]);case 1:case 4:return[2,t.sent()];case 2:return"barb"!=x.type?[3,3]:(p=this.field.getVector(e),r[s++].updateField(p),[3,6]);case 3:return"symbol"!=x.type?[3,5]:(u=x.pos,f=void 0===x.color?An.fromHex("#000000"):An.normalizeColor(x.color),h=void 0===x.halo_color?An.fromHex("#ffffff"):An.normalizeColor(x.halo_color),d=void 0===x.halo||x.halo,p=this.field.getStrings(e),_=this.field.grid.getEarthCoords(),m=this.field.grid.getMinVisibleZoom(this.opts.thin_fac),g=i.replace("{fontstack}","wx_symbols"),v=p.map(function(t,e){return{text:null===t?"":String.fromCharCode(Io[t]),lat:_.lats[e],lon:_.lons[e],min_zoom:m[e]}}),void 0!==(b=Mo(Mo({},ko(u)),{font_size:this.opts.font_size,halo:d,text_color:f,halo_color:h})).offset_x&&(b.offset_x-=3),[4,rr.make(n,v,g,b)]);case 5:throw"Unknown station plot configuration type ".concat(x.type);case 6:return[2]}})})}),c=this,[4,Promise.all(l)];case 1:return c.text_components=f.sent().filter(function(t){return void 0!==t}),e.triggerRepaint(),[2]}})})},e.prototype.onAdd=function(t,e){return Ro(this,void 0,void 0,function(){var n,r,o=this;return Po(this,function(i){switch(i.label){case 0:return n=Object.entries(this.opts.config).map(function(n){return Ro(o,[n],void 0,function(n){var r,o,i,a,s,l=Fo(n,2),c=l[0],u=l[1];return Po(this,function(n){switch(n.label){case 0:return r=c,"barb"!=u.type?[3,2]:(o=this.field.getVector(r),i=void 0===u.color?"#000000":u.color,a=void 0===u.barb_size_multipler?1:u.barb_size_multipler,[4,(s=new lo(o,{thin_fac:this.opts.thin_fac,color:i,barb_size_multiplier:a})).onAdd(t,e)]);case 1:return n.sent(),[2,s];case 2:return[2]}})})}),[4,Promise.all(n)];case 1:return r=i.sent().filter(function(t){return void 0!==t}),this.gl_elems={map:t,gl:e,barb_components:r},this.updateField(this.field),[2]}})})},e.prototype.render=function(t,e){if(null!==this.gl_elems&&null!==this.text_components){var n=this.gl_elems,r=this.text_components,o=this.gl_elems.barb_components,i=n.map.getCanvas().width,a=n.map.getCanvas().height,s=n.map.getZoom(),l=0,c=0;Object.values(this.opts.config).forEach(function(n){"barb"==n.type?o[c++].render(t,e):r[l++].render(t,e,[i,a],s)})}},e}(k);var No=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Bo=function(){function t(t){this.type="custom",this.id=t,this.map=null}return t.prototype.repaint=function(){null!==this.map&&this.map.triggerRepaint()},t}(),Go=function(t){function e(e,n){var r=t.call(this,e)||this;return r.field=n,r}return No(e,t),e.prototype.onAdd=function(t,e){return n=this,r=void 0,i=function(){return function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,function(n){switch(n.label){case 0:return this.map=t,[4,this.field.onAdd(t,e)];case 1:return n.sent(),[2]}})},new((o=void 0)||(o=Promise))(function(t,e){function a(t){try{l(i.next(t))}catch(t){e(t)}}function s(t){try{l(i.throw(t))}catch(t){e(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof o?n:new o(function(t){t(n)})).then(a,s)}l((i=i.apply(n,r||[])).next())});var n,r,o,i},e.prototype.render=function(t,e){this.field.render(t,e)},e}(Bo),Lo=function(t){function e(e){var n=t.call(this,e)||this;return n.fields={},n.field_key=null,n.map=null,n.gl=null,n}return No(e,t),e.prototype.onAdd=function(t,e){var n=this;this.map=t,this.gl=e,Object.values(this.fields).forEach(function(r){r.onAdd(t,e).then(function(t){n.repaint()})}),this.repaint()},e.prototype.render=function(t,e){null!==this.map&&null!==this.gl&&null!==this.field_key&&this.fields.hasOwnProperty(this.field_key)&&null!==this.fields[this.field_key]&&this.fields[this.field_key].render(t,e)},e.prototype.setActiveKey=function(t){this.field_key,this.field_key=t,this.repaint()},e.prototype.getKeys=function(){return Object.keys(this.fields)},e.prototype.addField=function(t,e){var n=this;this.field_key,null!==this.map&&null!==this.gl&&null!==t&&t.onAdd(this.map,this.gl).then(function(t){n.repaint()}),this.fields[e]=t,null===this.field_key&&(this.field_key=e)},e}(Bo),jo=function(){return jo=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},jo.apply(this,arguments)},Do=function(t,e,n){var r=document.createElementNS("http://www.w3.org/2000/svg",t);return void 0!==e&&Object.entries(e).forEach(function(t){var e=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}(t,2),n=e[0],o=e[1];r.setAttribute(n,o.toString())}),void 0!==n&&n.appendChild(r),r};function Uo(t,e){var n=e.label||"",r=e.ticks||t.levels,o=e.orientation||"vertical",i=e.fontface||"sans-serif",a=e.ticklabelsize||12,s=e.size_long||600,l=e.size_short||s/9,c=e.outline_and_text_color||"#000000",u=e.tick_direction||("vertical"==o?"left":"bottom");if("vertical"==o&&("top"==u||"bottom"==u)||"horizontal"==o&&("left"==u||"right"==u))throw"tick_direction of '".concat(u," doesn't match an orientation of ").concat(o);var f,h,d,p,_,m,g,v,b,y,w,x=function(t){return t.toString().length},T=x(r[0]),E=x(r[r.length-1]),A=null!==t.underflow_color||null!==t.overflow_color,S=s,M=l,R=Math.max("horizontal"==o?6*Math.max(T,E):8,A?M/(2*Math.sqrt(3)):0);"vertical"==o?(f=S,h=M,g=(d="left"==u?M-3-10:3)+(_=10),b=d+_/2,v=(p=R)+(m=S-2*R),y=null===t.underflow_color?v:v+M/(2*Math.sqrt(3)),w=null===t.overflow_color?p:p-M/(2*Math.sqrt(3))):(h=S,f=M-6,g=(d=R)+(_=S-2*R),b=(p="bottom"==u?3:M-6-3-10)+(m=10)/2,v=p+m,y=null===t.underflow_color?d:d-M/(2*Math.sqrt(3)),w=null===t.overflow_color?g:g+M/(2*Math.sqrt(3)));var P,F=t.colors.length,I=Do("svg",{width:h,height:f}),O=Do("g",{},I);P="vertical"==o?"left"==u?{"text-anchor":"end",transform:"translate(".concat(d,", ").concat(p,")")}:{transform:"translate(".concat(d+_,", ").concat(p,")")}:"bottom"==u?{"text-anchor":"middle",transform:"translate(".concat(d,", ").concat(p+m,")")}:{"text-anchor":"middle",transform:"translate(".concat(d,", ").concat(p,")")};var k=Do("g",P,I);if(t.colors.forEach(function(t,e){Do("rect",jo(jo({},"vertical"==o?{x:d,y:p+m*(1-(e+1)/F),width:_,height:m/F}:{x:d+_*e/F,y:p,width:_/F,height:m}),{fill:t.toRGBHex(),opacity:t.a}),O)}),null!==t.underflow_color){var C={points:"vertical"==o?"".concat(g," ").concat(v,", ").concat(b," ").concat(y,", ").concat(d," ").concat(v,", ").concat(g," ").concat(v):"".concat(d," ").concat(v,", ").concat(y," ").concat(b,", ").concat(d," ").concat(p,", ").concat(d," ").concat(v),fill:t.underflow_color.toRGBHex(),opacity:t.underflow_color.a};Do("polygon",C,O)}if(null!==t.overflow_color){var N={points:"vertical"==o?"".concat(d," ").concat(p,", ").concat(b," ").concat(w,", ").concat(g," ").concat(p,", ").concat(d," ").concat(p):"".concat(g," ").concat(p,", ").concat(w," ").concat(b,", ").concat(g," ").concat(v,", ").concat(g," ").concat(p),fill:t.overflow_color.toRGBHex(),opacity:t.overflow_color.a};Do("polygon",N,O)}var B,G,L=t.levels[0],j=t.levels[t.levels.length-1];return r.filter(function(t){return L<=t&&t<=j}).forEach(function(e){var n=t.levels.map(function(t){return Math.abs(t-e)}),r=n.indexOf(n.reduce(function(t,e){return Math.min(t,e)}));e<=t.levels[r]&&r>0&&(r-=1),r+=(e-t.levels[r])/(t.levels[r+1]-t.levels[r]);var s="vertical"==o?{transform:"translate(0, ".concat(m*(1-r/F),")")}:{transform:"translate(".concat(_*r/F,", 0)")},l=Do("g",s,k);Do("line",jo(jo({},"vertical"==o?"left"==u?{x2:-6}:{x2:6}:"bottom"==u?{y2:6}:{y2:-6}),{stroke:c,"stroke-width":1.5}),l),Do("text",jo(jo({},"vertical"==o?"left"==u?{x:-9,dy:"0.32em"}:{x:9,dy:"0.32em"}:"bottom"==u?{y:9,dy:"0.8em"}:{y:-9,dy:"0em"}),{fill:c,style:"font-family: ".concat(i,"; font-size: ").concat(a,"pt")}),l).textContent=e.toString()}),B="vertical"==o?"".concat(d," ").concat(p,", ").concat(b," ").concat(w,", ").concat(g," ").concat(p,", ").concat(g," ").concat(v,", ")+"".concat(b," ").concat(y,", ").concat(d," ").concat(v,", ").concat(d," ").concat(p):"".concat(d," ").concat(p,", ").concat(g," ").concat(p,", ").concat(w," ").concat(b,", ").concat(g," ").concat(v,", ")+"".concat(d," ").concat(v,", ").concat(y," ").concat(b,", ").concat(d," ").concat(p),Do("polygon",{points:B,stroke:c,"stroke-width":1.5,fill:"none"},I),G="vertical"==o?"left"==u?{transform:"translate(15, ".concat(f/2,") rotate(-90)")}:{transform:"translate(".concat(h-6,", ").concat(f/2,") rotate(-90)")}:"bottom"==u?{transform:"translate(".concat(h/2,", ").concat(f-5,")")}:{transform:"translate(".concat(h/2,", 15)")},Do("text",jo(jo({},G),{fill:c,"text-anchor":"middle",style:"font-family: ".concat(i,";")}),I).textContent=n,I}function zo(t,e,n){if(t.length!=e.length)throw"Mismatch between the number of colors (".concat(t.length,") and the number of labels (").concat(e.length,")");var r=void 0===(n=void 0===n?{}:n).n_cols?1:n.n_cols,o=void 0===n.fontface?"sans-serif":n.fontface,i=Math.ceil(t.length/r),a=Do("svg",{width:123*r+5*(r+1),height:20*i+5*(i+1)}),s=Do("g",{},a);return t.forEach(function(t,n){var r=e[n],a=n%i,l=Math.floor(n/i),c=1;"string"!=typeof t&&(c=t.a,t=t.toRGBHex());var u=5+128*l,f=5+25*a;Do("rect",{x:u,y:f,fill:t,opacity:c,width:20,height:20},s),Do("text",jo(jo({},{x:u+20+3,y:f+10,dy:"0.32em"}),{fill:"#000000",style:"font-size: 0.8em; font-family: ".concat(o,";")}),s).textContent=r}),a}var Ho={bluered:function(t,e,n){return Rn.diverging("#0000ff","#ff0000",t,e,n)},redblue:function(t,e,n){return Rn.diverging("#ff0000","#0000ff",t,e,n)},pw_speed500mb:Fn,pw_speed850mb:In,pw_cape:On,pw_t2m:kn,pw_td2m:Cn,nws_storm_clear_refl:Nn};function Vo(t){Or({document_script:(t=void 0===t?{}:t).wasm_base_url})}})(),r})());
|
|
2
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.apgl=e():t.apgl=e()}(this,()=>(()=>{var t={187:t=>{t.exports="#version 300 es\n\nin vec2 a_pos;\n\nout highp vec2 v_tex_coord;\n\nvoid main() {\n gl_Position = vec4(a_pos.xy, 0., 1.);\n v_tex_coord = 0.5 * a_pos.xy + vec2(0.5, 0.5);\n}"},251:(t,e)=>{e.read=function(t,e,i,s,n){var r,o,a=8*n-s-1,l=(1<<a)-1,h=l>>1,c=-7,f=i?n-1:0,u=i?-1:1,_=t[e+f];for(f+=u,r=_&(1<<-c)-1,_>>=-c,c+=a;c>0;r=256*r+t[e+f],f+=u,c-=8);for(o=r&(1<<-c)-1,r>>=-c,c+=s;c>0;o=256*o+t[e+f],f+=u,c-=8);if(0===r)r=1-h;else{if(r===l)return o?NaN:1/0*(_?-1:1);o+=Math.pow(2,s),r-=h}return(_?-1:1)*o*Math.pow(2,r-s)},e.write=function(t,e,i,s,n,r){var o,a,l,h=8*r-n-1,c=(1<<h)-1,f=c>>1,u=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,_=s?0:r-1,d=s?1:-1,p=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+f>=1?u/l:u*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=c?(a=0,o=c):o+f>=1?(a=(e*l-1)*Math.pow(2,n),o+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,n),o=0));n>=8;t[i+_]=255&a,_+=d,a/=256,n-=8);for(o=o<<n|a,h+=n;h>0;t[i+_]=255&o,_+=d,o/=256,h-=8);t[i+_-d]|=128*p}},254:t=>{t.exports="#version 300 es\n\nin highp vec2 v_tex_coord;\n\n#ifdef COLORMAP\nin highp float v_mag;\n#else\nuniform lowp vec4 u_bb_color;\n#endif\n\nuniform sampler2D u_sampler;\n\nout highp vec4 fragColor;\n\nvoid main() {\n lowp vec4 tex_color = texture(u_sampler, v_tex_coord);\n\n lowp vec4 color;\n#ifdef COLORMAP\n color = apply_colormap(v_mag);\n#else\n color = u_bb_color;\n#endif\n\n color.a *= tex_color.a;\n fragColor = color; // mix(vec4(1.0, 0.0, 0.0, 0.5), color, tex_color.a);\n}"},303:t=>{t.exports="#version 300 es\n\nuniform int u_offset;\n\nin vec2 a_pos;\nin vec2 a_tex_coord;\n\nout highp vec2 v_tex_coord;\n\nvoid main() {\n float globe_width = 1.;\n vec2 globe_offset = vec2(globe_width * float(u_offset), 0.);\n\n gl_Position = projectTile(a_pos.xy + globe_offset);\n v_tex_coord = a_tex_coord;\n}"},314:t=>{t.exports="#version 300 es\n\nin highp vec2 v_tex_coord;\n\nuniform sampler2D u_fill_sampler;\nuniform lowp vec4 u_color;\nuniform highp float u_opacity;\n\nout highp vec4 fragColor;\n\nvoid main() {\n highp float fill_val = texture(u_fill_sampler, v_tex_coord).r;\n \n if (fill_val < 0.4) {\n discard;\n }\n\n lowp vec4 color = u_color;\n\n color.a = color.a * u_opacity;\n fragColor = color;\n}"},317:function(t,e){var i,s;void 0===(s="function"==typeof(i=function(t){function e(t,e,i){this.obj=t,this.left=null,this.right=null,this.parent=i,this.dimension=e}function i(t){this.content=[],this.scoreFunction=t}i.prototype={push:function(t){this.content.push(t),this.bubbleUp(this.content.length-1)},pop:function(){var t=this.content[0],e=this.content.pop();return this.content.length>0&&(this.content[0]=e,this.sinkDown(0)),t},peek:function(){return this.content[0]},remove:function(t){for(var e=this.content.length,i=0;i<e;i++)if(this.content[i]==t){var s=this.content.pop();return void(i!=e-1&&(this.content[i]=s,this.scoreFunction(s)<this.scoreFunction(t)?this.bubbleUp(i):this.sinkDown(i)))}throw new Error("Node not found.")},size:function(){return this.content.length},bubbleUp:function(t){for(var e=this.content[t];t>0;){var i=Math.floor((t+1)/2)-1,s=this.content[i];if(!(this.scoreFunction(e)<this.scoreFunction(s)))break;this.content[i]=e,this.content[t]=s,t=i}},sinkDown:function(t){for(var e=this.content.length,i=this.content[t],s=this.scoreFunction(i);;){var n=2*(t+1),r=n-1,o=null;if(r<e){var a=this.content[r],l=this.scoreFunction(a);l<s&&(o=r)}if(n<e){var h=this.content[n];this.scoreFunction(h)<(null==o?s:l)&&(o=n)}if(null==o)break;this.content[t]=this.content[o],this.content[o]=i,t=o}}},t.kdTree=function(t,s,n){var r=this;Array.isArray(t)?this.root=function t(i,s,r){var o,a,l=s%n.length;return 0===i.length?null:1===i.length?new e(i[0],l,r):(i.sort(function(t,e){return t[n[l]]-e[n[l]]}),(a=new e(i[o=Math.floor(i.length/2)],l,r)).left=t(i.slice(0,o),s+1,a),a.right=t(i.slice(o+1),s+1,a),a)}(t,0,null):function(t){r.root=t,function t(e){e.left&&(e.left.parent=e,t(e.left)),e.right&&(e.right.parent=e,t(e.right))}(r.root)}(t),this.toJSON=function(t){t||(t=this.root);var i=new e(t.obj,t.dimension,null);return t.left&&(i.left=r.toJSON(t.left)),t.right&&(i.right=r.toJSON(t.right)),i},this.insert=function(t){var i,s,r=function e(i,s){if(null===i)return s;var r=n[i.dimension];return t[r]<i.obj[r]?e(i.left,i):e(i.right,i)}(this.root,null);null!==r?(i=new e(t,(r.dimension+1)%n.length,r),s=n[r.dimension],t[s]<r.obj[s]?r.left=i:r.right=i):this.root=new e(t,0,null)},this.remove=function(t){var e;null!==(e=function e(i){if(null===i)return null;if(i.obj===t)return i;var s=n[i.dimension];return t[s]<i.obj[s]?e(i.left):e(i.right)}(r.root))&&function t(e){function i(t,e){var s,r,o,a,l;return null===t?null:(s=n[e],t.dimension===e?null!==t.left?i(t.left,e):t:(r=t.obj[s],o=i(t.left,e),a=i(t.right,e),l=t,null!==o&&o.obj[s]<r&&(l=o),null!==a&&a.obj[s]<l.obj[s]&&(l=a),l))}var s,o,a;if(null===e.left&&null===e.right)return null===e.parent?void(r.root=null):(a=n[e.parent.dimension],void(e.obj[a]<e.parent.obj[a]?e.parent.left=null:e.parent.right=null));null!==e.right?(o=(s=i(e.right,e.dimension)).obj,t(s),e.obj=o):(o=(s=i(e.left,e.dimension)).obj,t(s),e.right=e.left,e.left=null,e.obj=o)}(e)},this.nearest=function(t,e,o){var a,l,h;if(h=new i(function(t){return-t[1]}),o)for(a=0;a<e;a+=1)h.push([null,o]);for(r.root&&function i(r){function o(t,i){h.push([t,i]),h.size()>e&&h.pop()}var a,l,c,f,u=n[r.dimension],_=s(t,r.obj),d={};for(f=0;f<n.length;f+=1)f===r.dimension?d[n[f]]=t[n[f]]:d[n[f]]=r.obj[n[f]];l=s(d,r.obj),null!==r.right||null!==r.left?(i(a=null===r.right?r.left:null===r.left?r.right:t[u]<r.obj[u]?r.left:r.right),(h.size()<e||_<h.peek()[1])&&o(r,_),(h.size()<e||Math.abs(l)<h.peek()[1])&&null!==(c=a===r.left?r.right:r.left)&&i(c)):(h.size()<e||_<h.peek()[1])&&o(r,_)}(r.root),l=[],a=0;a<Math.min(e,h.content.length);a+=1)h.content[a][0]&&l.push([h.content[a][0].obj,h.content[a][1]]);return l},this.balanceFactor=function(){return function t(e){return null===e?0:Math.max(t(e.left),t(e.right))+1}(r.root)/(Math.log(function t(e){return null===e?0:t(e.left)+t(e.right)+1}(r.root))/Math.log(2))}},t.BinaryHeap=i})?i.apply(e,[e]):i)||(t.exports=s)},325:t=>{t.exports="#version 300 es\n\nin highp vec2 v_tex_coord;\n\nuniform int u_imem;\n\nout highp vec4 fragColor;\n\nvoid main() {\n uint fill_val = uint(get_field_value(v_tex_coord));\n \n if (fill_val < uint(1)) {\n discard;\n }\n\n lowp vec4 off_color = vec4(0., 0., 0., 1.);\n lowp vec4 on_color = vec4(1., 1., 1., 1.);\n\n uint mask = uint(1) << u_imem;\n lowp float mem_active = float((fill_val & mask) > uint(0));\n fragColor = mix(off_color, on_color, mem_active);\n}"},335:(t,e,i)=>{"use strict";t.exports=n;var s=i(251);function n(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}n.Varint=0,n.Fixed64=1,n.Bytes=2,n.Fixed32=5;var r=4294967296,o=1/r,a="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function l(t){return t.type===n.Bytes?t.readVarint()+t.pos:t.pos+1}function h(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function c(t,e,i){var s=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(s);for(var n=i.pos-1;n>=t;n--)i.buf[n+s]=i.buf[n]}function f(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function u(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function _(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function d(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function p(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function m(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function g(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function b(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function v(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function w(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function y(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function x(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}n.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var s=this.readVarint(),n=s>>3,r=this.pos;this.type=7&s,t(n,e,this),this.pos===r&&this.skip(s)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=w(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=x(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=w(this.buf,this.pos)+w(this.buf,this.pos+4)*r;return this.pos+=8,t},readSFixed64:function(){var t=w(this.buf,this.pos)+x(this.buf,this.pos+4)*r;return this.pos+=8,t},readFloat:function(){var t=s.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=s.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,s=this.buf;return e=127&(i=s[this.pos++]),i<128?e:(e|=(127&(i=s[this.pos++]))<<7,i<128?e:(e|=(127&(i=s[this.pos++]))<<14,i<128?e:(e|=(127&(i=s[this.pos++]))<<21,i<128?e:function(t,e,i){var s,n,r=i.buf;if(s=(112&(n=r[i.pos++]))>>4,n<128)return h(t,s,e);if(s|=(127&(n=r[i.pos++]))<<3,n<128)return h(t,s,e);if(s|=(127&(n=r[i.pos++]))<<10,n<128)return h(t,s,e);if(s|=(127&(n=r[i.pos++]))<<17,n<128)return h(t,s,e);if(s|=(127&(n=r[i.pos++]))<<24,n<128)return h(t,s,e);if(s|=(1&(n=r[i.pos++]))<<31,n<128)return h(t,s,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=s[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&a?function(t,e,i){return a.decode(t.subarray(e,i))}(this.buf,e,t):function(t,e,i){for(var s="",n=e;n<i;){var r,o,a,l=t[n],h=null,c=l>239?4:l>223?3:l>191?2:1;if(n+c>i)break;1===c?l<128&&(h=l):2===c?128==(192&(r=t[n+1]))&&(h=(31&l)<<6|63&r)<=127&&(h=null):3===c?(r=t[n+1],o=t[n+2],128==(192&r)&&128==(192&o)&&((h=(15&l)<<12|(63&r)<<6|63&o)<=2047||h>=55296&&h<=57343)&&(h=null)):4===c&&(r=t[n+1],o=t[n+2],a=t[n+3],128==(192&r)&&128==(192&o)&&128==(192&a)&&((h=(15&l)<<18|(63&r)<<12|(63&o)<<6|63&a)<=65535||h>=1114112)&&(h=null)),null===h?(h=65533,c=1):h>65535&&(h-=65536,s+=String.fromCharCode(h>>>10&1023|55296),h=56320|1023&h),s+=String.fromCharCode(h),n+=c}return s}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==n.Bytes)return t.push(this.readVarint(e));var i=l(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==n.Bytes)return t.push(this.readSVarint());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==n.Bytes)return t.push(this.readBoolean());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==n.Bytes)return t.push(this.readFloat());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==n.Bytes)return t.push(this.readDouble());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==n.Bytes)return t.push(this.readFixed32());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==n.Bytes)return t.push(this.readSFixed32());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==n.Bytes)return t.push(this.readFixed64());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==n.Bytes)return t.push(this.readSFixed64());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===n.Varint)for(;this.buf[this.pos++]>127;);else if(e===n.Bytes)this.pos=this.readVarint()+this.pos;else if(e===n.Fixed32)this.pos+=4;else{if(e!==n.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),y(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),y(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),y(this.buf,-1&t,this.pos),y(this.buf,Math.floor(t*o),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),y(this.buf,-1&t,this.pos),y(this.buf,Math.floor(t*o),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var i,s;if(t>=0?(i=t%4294967296|0,s=t/4294967296|0):(s=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,s=s+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,i){i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos]=127&t}(i,0,e),function(t,e){var i=(7&t)<<4;e.buf[e.pos++]|=i|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(s,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,i){for(var s,n,r=0;r<e.length;r++){if((s=e.charCodeAt(r))>55295&&s<57344){if(!n){s>56319||r+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):n=s;continue}if(s<56320){t[i++]=239,t[i++]=191,t[i++]=189,n=s;continue}s=n-55296<<10|s-56320|65536,n=null}else n&&(t[i++]=239,t[i++]=191,t[i++]=189,n=null);s<128?t[i++]=s:(s<2048?t[i++]=s>>6|192:(s<65536?t[i++]=s>>12|224:(t[i++]=s>>18|240,t[i++]=s>>12&63|128),t[i++]=s>>6&63|128),t[i++]=63&s|128)}return i}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&c(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),s.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),s.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var s=this.pos-i;s>=128&&c(i,s,this),this.pos=i-1,this.writeVarint(s),this.pos+=s},writeMessage:function(t,e,i){this.writeTag(t,n.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,f,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,u,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,p,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,_,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,d,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,m,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,g,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,b,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,v,e)},writeBytesField:function(t,e){this.writeTag(t,n.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,n.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,n.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,n.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}},374:t=>{t.exports="\nuniform sampler2D u_cmap_sampler;\nuniform sampler2D u_cmap_nonlin_sampler;\nuniform highp float u_cmap_min;\nuniform highp float u_cmap_max;\nuniform highp vec4 u_underflow_color;\nuniform highp vec4 u_overflow_color;\nuniform int u_n_index;\n\nlowp vec4 apply_colormap(highp float value) {\n lowp float normed_val = (value - u_cmap_min) / (u_cmap_max - u_cmap_min);\n \n lowp vec4 color;\n if (normed_val < 0.0) {\n color = u_underflow_color;\n }\n else if (normed_val > 1.0) {\n color = u_overflow_color;\n }\n else {\n lowp float index_buffer = 1. / (2. * float(u_n_index));\n normed_val = index_buffer + normed_val * (1. - 2. * index_buffer); // Chop off the half pixels on either end of the texture\n highp float nonlin_val = texture(u_cmap_nonlin_sampler, vec2(normed_val, 0.5)).r;\n color = texture(u_cmap_sampler, vec2(nonlin_val, 0.5));\n }\n\n return color;\n}"},387:(t,e)=>{var i,s,n;(n={}).Constants={},n.Math={},n.Accumulator={},function(t){"use strict";t.WGS84={a:6378137,f:1/298.257223563},t.version={major:2,minor:2,patch:0},t.version_string="2.2.0"}(n.Constants),function(t){"use strict";t.digits=53,t.epsilon=Math.pow(.5,t.digits-1),t.degree=Math.PI/180,t.sq=function(t){return t*t},t.hypot=function(t,e){return Math.sqrt(t*t+e*e)},t.cbrt=Math.cbrt||function(t){var e=Math.pow(Math.abs(t),1/3);return t>0?e:t<0?-e:t},t.log1p=Math.log1p||function(t){var e=1+t,i=e-1;return 0===i?t:t*Math.log(e)/i},t.atanh=Math.atanh||function(e){var i=Math.abs(e);return i=t.log1p(2*i/(1-i))/2,e>0?i:e<0?-i:e},t.copysign=function(t,e){return Math.abs(t)*(e<0||0===e&&1/e<0?-1:1)},t.sum=function(t,e){var i=t+e,s=i-e,n=i-s;return s-=t,{s:i,t:i?0-(s+(n-=e)):i}},t.polyval=function(t,e,i,s){for(var n=t<0?0:e[i++];--t>=0;)n=n*s+e[i++];return n},t.AngRound=function(e){var i=1/16,s=Math.abs(e);return s=s<i?i-(i-s):s,t.copysign(s,e)},t.remainder=function(t,e){return(t%=e)<-e/2?t+e:t<e/2?t:t-e},t.AngNormalize=function(e){var i=t.remainder(e,360);return 180===Math.abs(i)?t.copysign(180,e):i},t.LatFix=function(t){return Math.abs(t)>90?NaN:t},t.AngDiff=function(e,i){var s,n,r=t.sum(t.remainder(-e,360),t.remainder(i,360));return s=(r=t.sum(t.remainder(r.s,360),r.t)).s,n=r.t,0!==s&&180!==Math.abs(s)||(s=t.copysign(s,0===n?i-e:-n)),{d:s,e:n}},t.sincosd=function(e){var i,s,n,r,o,a,l;switch(i=e%360,s=(i-=90*(n=Math.round(i/90)))*this.degree,r=Math.sin(s),o=Math.cos(s),45===Math.abs(i)?(o=Math.sqrt(.5),r=t.copysign(o,s)):30===Math.abs(i)&&(o=Math.sqrt(.75),r=t.copysign(.5,s)),3&n){case 0:a=r,l=o;break;case 1:a=o,l=-r;break;case 2:a=-r,l=-o;break;default:a=-o,l=r}return l+=0,0===a&&(a=t.copysign(a,e)),{s:a,c:l}},t.sincosde=function(e,i){var s,n,r,o,a,l,h;switch(s=e%360,r=Math.round(s/90),n=(s=t.AngRound(s-90*r+i))*this.degree,o=Math.sin(n),a=Math.cos(n),45===Math.abs(s)?(a=Math.sqrt(.5),o=t.copysign(a,n)):30===Math.abs(s)&&(a=Math.sqrt(.75),o=t.copysign(.5,n)),3&r){case 0:l=o,h=a;break;case 1:l=a,h=-o;break;case 2:l=-o,h=-a;break;default:l=-a,h=o}return h+=0,0===l&&(l=t.copysign(l,e+i)),{s:l,c:h}},t.atan2d=function(e,i){var s,n=0;switch(Math.abs(e)>Math.abs(i)&&([e,i]=[i,e],n=2),t.copysign(1,i)<0&&(i=-i,++n),s=Math.atan2(e,i)/this.degree,n){case 1:s=t.copysign(180,e)-s;break;case 2:s=90-s;break;case 3:s=-90+s}return s}}(n.Math),function(t,e){"use strict";t.Accumulator=function(t){this.Set(t)},t.Accumulator.prototype.Set=function(e){e||(e=0),e.constructor===t.Accumulator?(this._s=e._s,this._t=e._t):(this._s=e,this._t=0)},t.Accumulator.prototype.Add=function(t){var i=e.sum(t,this._t),s=e.sum(i.s,this._s);i=i.t,this._s=s.s,this._t=s.t,0===this._s?this._s=i:this._t+=i},t.Accumulator.prototype.Sum=function(e){var i;return e?((i=new t.Accumulator(this)).Add(e),i._s):this._s},t.Accumulator.prototype.Negate=function(){this._s*=-1,this._t*=-1},t.Accumulator.prototype.Remainder=function(t){this._s=e.remainder(this._s,t),this.Add(0)}}(n.Accumulator,n.Math),n.Geodesic={},n.GeodesicLine={},n.PolygonArea={},function(t,e,i,s,n){"use strict";var r,o,a,l,h,c,f,u,_,d,p,m=20+s.digits+10,g=s.epsilon,b=200*g,v=Math.sqrt(g),w=g,y=1e3*v;t.tiny_=Math.sqrt(Number.MIN_VALUE/Number.EPSILON),t.nC1_=6,t.nC1p_=6,t.nC2_=6,t.nC3_=6,t.nC4_=6,r=t.nC3_*(t.nC3_-1)/2,o=t.nC4_*(t.nC4_+1)/2,t.CAP_C1=1,t.CAP_C1p=2,t.CAP_C2=4,t.CAP_C3=8,t.CAP_C4=16,t.NONE=0,t.ARC=64,t.LATITUDE=128,t.LONGITUDE=256|t.CAP_C3,t.AZIMUTH=512,t.DISTANCE=1024|t.CAP_C1,t.STANDARD=t.LATITUDE|t.LONGITUDE|t.AZIMUTH|t.DISTANCE,t.DISTANCE_IN=2048|t.CAP_C1|t.CAP_C1p,t.REDUCEDLENGTH=4096|t.CAP_C1|t.CAP_C2,t.GEODESICSCALE=8192|t.CAP_C1|t.CAP_C2,t.AREA=16384|t.CAP_C4,t.ALL=32671,t.LONG_UNROLL=32768,t.OUT_MASK=32640|t.LONG_UNROLL,t.SinCosSeries=function(t,e,i,s){var n=s.length,r=n-(t?1:0),o=2*(i-e)*(i+e),a=1&r?s[--n]:0,l=0;for(r=Math.floor(r/2);r--;)a=o*(l=o*a-l+s[--n])-a+s[--n];return t?2*e*i*a:i*(a-l)},a=function(t,e){var i,n,r,o,a,l,h,c,f,u,_,d,p=s.sq(t),m=s.sq(e),g=(p+m-1)/6;return 0===m&&g<=0?i=0:(l=g,(a=(n=p*m/4)*(n+2*(o=g*(r=s.sq(g)))))>=0?(h=n+o,h+=h<0?-Math.sqrt(a):Math.sqrt(a),l+=(c=s.cbrt(h))+(0!==c?r/c:0)):(f=Math.atan2(Math.sqrt(-a),-(n+o)),l+=2*g*Math.cos(f/3)),u=Math.sqrt(s.sq(l)+m),d=((_=l<0?m/(u-l):l+u)-m)/(2*u),i=_/(Math.sqrt(_+s.sq(d))+d)),i},l=[1,4,64,0,256],t.A1m1f=function(t){var e=Math.floor(3);return(s.polyval(e,l,0,s.sq(t))/l[e+1]+t)/(1-t)},h=[-1,6,-16,32,-9,64,-128,2048,9,-16,768,3,-5,512,-7,1280,-7,2048],t.C1f=function(e,i){var n,r,o=s.sq(e),a=e,l=0;for(n=1;n<=t.nC1_;++n)r=Math.floor((t.nC1_-n)/2),i[n]=a*s.polyval(r,h,l,o)/h[l+r+1],l+=r+2,a*=e},c=[205,-432,768,1536,4005,-4736,3840,12288,-225,116,384,-7173,2695,7680,3467,7680,38081,61440],t.C1pf=function(e,i){var n,r,o=s.sq(e),a=e,l=0;for(n=1;n<=t.nC1p_;++n)r=Math.floor((t.nC1p_-n)/2),i[n]=a*s.polyval(r,c,l,o)/c[l+r+1],l+=r+2,a*=e},f=[-11,-28,-192,0,256],t.A2m1f=function(t){var e=Math.floor(3);return(s.polyval(e,f,0,s.sq(t))/f[e+1]-t)/(1+t)},u=[1,2,16,32,35,64,384,2048,15,80,768,7,35,512,63,1280,77,2048],t.C2f=function(e,i){var n,r,o=s.sq(e),a=e,l=0;for(n=1;n<=t.nC2_;++n)r=Math.floor((t.nC2_-n)/2),i[n]=a*s.polyval(r,u,l,o)/u[l+r+1],l+=r+2,a*=e},t.Geodesic=function(t,e){if(this.a=t,this.f=e,this._f1=1-this.f,this._e2=this.f*(2-this.f),this._ep2=this._e2/s.sq(this._f1),this._n=this.f/(2-this.f),this._b=this.a*this._f1,this._c2=(s.sq(this.a)+s.sq(this._b)*(0===this._e2?1:(this._e2>0?s.atanh(Math.sqrt(this._e2)):Math.atan(Math.sqrt(-this._e2)))/Math.sqrt(Math.abs(this._e2))))/2,this._etol2=.1*v/Math.sqrt(Math.max(.001,Math.abs(this.f))*Math.min(1,1-this.f/2)/2),!(isFinite(this.a)&&this.a>0))throw new Error("Equatorial radius is not positive");if(!(isFinite(this._b)&&this._b>0))throw new Error("Polar semi-axis is not positive");this._A3x=new Array(6),this._C3x=new Array(r),this._C4x=new Array(o),this.A3coeff(),this.C3coeff(),this.C4coeff()},_=[-3,128,-2,-3,64,-1,-3,-1,16,3,-1,-2,8,1,-1,2,1,1],t.Geodesic.prototype.A3coeff=function(){var t,e,i=0,n=0;for(t=5;t>=0;--t)e=Math.min(6-t-1,t),this._A3x[n++]=s.polyval(e,_,i,this._n)/_[i+e+1],i+=e+2},d=[3,128,2,5,128,-1,3,3,64,-1,0,1,8,-1,1,4,5,256,1,3,128,-3,-2,3,64,1,-3,2,32,7,512,-10,9,384,5,-9,5,192,7,512,-14,7,512,21,2560],t.Geodesic.prototype.C3coeff=function(){var e,i,n,r=0,o=0;for(e=1;e<t.nC3_;++e)for(i=t.nC3_-1;i>=e;--i)n=Math.min(t.nC3_-i-1,i),this._C3x[o++]=s.polyval(n,d,r,this._n)/d[r+n+1],r+=n+2},p=[97,15015,1088,156,45045,-224,-4784,1573,45045,-10656,14144,-4576,-858,45045,64,624,-4576,6864,-3003,15015,100,208,572,3432,-12012,30030,45045,1,9009,-2944,468,135135,5792,1040,-1287,135135,5952,-11648,9152,-2574,135135,-64,-624,4576,-6864,3003,135135,8,10725,1856,-936,225225,-8448,4992,-1144,225225,-1440,4160,-4576,1716,225225,-136,63063,1024,-208,105105,3584,-3328,1144,315315,-128,135135,-2560,832,405405,128,99099],t.Geodesic.prototype.C4coeff=function(){var e,i,n,r=0,o=0;for(e=0;e<t.nC4_;++e)for(i=t.nC4_-1;i>=e;--i)n=t.nC4_-i-1,this._C4x[o++]=s.polyval(n,p,r,this._n)/p[r+n+1],r+=n+2},t.Geodesic.prototype.A3f=function(t){return s.polyval(5,this._A3x,0,t)},t.Geodesic.prototype.C3f=function(e,i){var n,r,o=1,a=0;for(n=1;n<t.nC3_;++n)r=t.nC3_-n-1,o*=e,i[n]=o*s.polyval(r,this._C3x,a,e),a+=r+1},t.Geodesic.prototype.C4f=function(e,i){var n,r,o=1,a=0;for(n=0;n<t.nC4_;++n)r=t.nC4_-n-1,i[n]=o*s.polyval(r,this._C4x,a,e),a+=r+1,o*=e},t.Geodesic.prototype.Lengths=function(e,i,s,n,r,o,a,l,h,c,f,u,_){var d,p,m,g,b={},v=0,w=0,y=0,x=0;if((f&=t.OUT_MASK)&(t.DISTANCE|t.REDUCEDLENGTH|t.GEODESICSCALE)&&(y=t.A1m1f(e),t.C1f(e,u),f&(t.REDUCEDLENGTH|t.GEODESICSCALE)&&(x=t.A2m1f(e),t.C2f(e,_),v=y-x,x=1+x),y=1+y),f&t.DISTANCE)d=t.SinCosSeries(!0,o,a,u)-t.SinCosSeries(!0,s,n,u),b.s12b=y*(i+d),f&(t.REDUCEDLENGTH|t.GEODESICSCALE)&&(w=v*i+(y*d-x*(t.SinCosSeries(!0,o,a,_)-t.SinCosSeries(!0,s,n,_))));else if(f&(t.REDUCEDLENGTH|t.GEODESICSCALE)){for(p=1;p<=t.nC2_;++p)_[p]=y*u[p]-x*_[p];w=v*i+(t.SinCosSeries(!0,o,a,_)-t.SinCosSeries(!0,s,n,_))}return f&t.REDUCEDLENGTH?(b.m0=v,b.m12b=l*(n*o)-r*(s*a)-n*a*w):b.m12b=NaN,f&t.GEODESICSCALE&&(m=n*a+s*o,g=this._ep2*(h-c)*(h+c)/(r+l),b.M12=m+(g*o-a*w)*s/r,b.M21=m-(g*s-n*w)*o/l),b},t.Geodesic.prototype.InverseStart=function(e,i,n,r,o,l,h,c,f,u,_){var d,p,m,g,v,w,x,A,E,M,S,T,C,N,R,G,I,D,B,P,F={},L=r*i-o*e,z=o*i+r*e;return F.sig12=-1,d=r*i,d+=o*e,(p=z>=0&&L<.5&&o*h<.5)?(g=s.sq(e+r),g/=g+s.sq(i+o),F.dnm=Math.sqrt(1+this._ep2*g),m=h/(this._f1*F.dnm),v=Math.sin(m),w=Math.cos(m)):(v=c,w=f),F.salp1=o*v,F.calp1=w>=0?L+o*e*s.sq(v)/(1+w):d-o*e*s.sq(v)/(1-w),A=s.hypot(F.salp1,F.calp1),E=e*r+i*o*w,p&&A<this._etol2?(F.salp2=i*v,F.calp2=L-i*r*(w>=0?s.sq(v)/(1+w):1-w),x=s.hypot(F.salp2,F.calp2),F.salp2/=x,F.calp2/=x,F.sig12=Math.atan2(A,E)):Math.abs(this._n)>.1||E>=0||A>=6*Math.abs(this._n)*Math.PI*s.sq(i)||(P=Math.atan2(-c,-f),this.f>=0?(N=(C=s.sq(e)*this._ep2)/(2*(1+Math.sqrt(1+C))+C),M=P/(T=this.f*i*this.A3f(N)*Math.PI),S=d/(T*i)):(R=o*i-r*e,G=Math.atan2(d,R),S=h/(T=((M=(I=this.Lengths(this._n,Math.PI+G,e,-i,n,r,o,l,i,o,t.REDUCEDLENGTH,u,_)).m12b/(i*o*I.m0*Math.PI)-1)<-.01?d/M:-this.f*s.sq(i)*Math.PI)/i)),S>-b&&M>-1-y?this.f>=0?(F.salp1=Math.min(1,-M),F.calp1=-Math.sqrt(1-s.sq(F.salp1))):(F.calp1=Math.max(M>-b?0:-1,M),F.salp1=Math.sqrt(1-s.sq(F.calp1))):(D=a(M,S),B=T*(this.f>=0?-M*D/(1+D):-S*(1+D)/D),v=Math.sin(B),w=-Math.cos(B),F.salp1=o*v,F.calp1=d-o*e*s.sq(v)/(1-w))),F.salp1<=0?(F.salp1=1,F.calp1=0):(x=s.hypot(F.salp1,F.calp1),F.salp1/=x,F.calp1/=x),F},t.Geodesic.prototype.Lambda12=function(e,i,n,r,o,a,l,h,c,f,u,_,d,p){var m,g,b,v,w,y,x,A,E,M,S,T,C,N={};return 0===e&&0===h&&(h=-t.tiny_),g=l*i,b=s.hypot(h,l*e),N.ssig1=e,v=g*e,N.csig1=w=h*i,m=s.hypot(N.ssig1,N.csig1),N.ssig1/=m,N.csig1/=m,N.salp2=o!==i?g/o:l,N.calp2=o!==i||Math.abs(r)!==-e?Math.sqrt(s.sq(h*i)+(i<-e?(o-i)*(i+o):(e-r)*(e+r)))/o:Math.abs(h),N.ssig2=r,y=g*r,N.csig2=x=N.calp2*o,m=s.hypot(N.ssig2,N.csig2),N.ssig2/=m,N.csig2/=m,N.sig12=Math.atan2(Math.max(0,N.csig1*N.ssig2-N.ssig1*N.csig2),N.csig1*N.csig2+N.ssig1*N.ssig2),A=Math.max(0,w*y-v*x),E=w*x+v*y,S=Math.atan2(A*f-E*c,E*f+A*c),T=s.sq(b)*this._ep2,N.eps=T/(2*(1+Math.sqrt(1+T))+T),this.C3f(N.eps,p),M=t.SinCosSeries(!0,N.ssig2,N.csig2,p)-t.SinCosSeries(!0,N.ssig1,N.csig1,p),N.domg12=-this.f*this.A3f(N.eps)*g*(N.sig12+M),N.lam12=S+N.domg12,u&&(0===N.calp2?N.dlam12=-2*this._f1*n/e:(C=this.Lengths(N.eps,N.sig12,N.ssig1,N.csig1,n,N.ssig2,N.csig2,a,i,o,t.REDUCEDLENGTH,_,d),N.dlam12=C.m12b,N.dlam12*=this._f1/(N.calp2*o))),N},t.Geodesic.prototype.Inverse=function(e,i,n,r,o){var a,l;return o||(o=t.STANDARD),o===t.LONG_UNROLL&&(o|=t.STANDARD),o&=t.OUT_MASK,l=(a=this.InverseInt(e,i,n,r,o)).vals,o&t.AZIMUTH&&(l.azi1=s.atan2d(a.salp1,a.calp1),l.azi2=s.atan2d(a.salp2,a.calp2)),l},t.Geodesic.prototype.InverseInt=function(e,i,n,r,o){var a,l,h,c,f,u,_,d,p,b,y,x,A,E,M,S,T,C,N,R,G,I,D,B,P,F,L,z,O,U,k,j,$,H,V,q,W,X,Z,K,Y,J,Q,tt,et,it,st,nt,rt,ot,at,lt,ht,ct,ft,ut,_t,dt,pt,mt,gt,bt,vt,wt,yt,xt={};if(xt.lat1=e=s.LatFix(e),xt.lat2=n=s.LatFix(n),e=s.AngRound(e),n=s.AngRound(n),l=(a=s.AngDiff(i,r)).e,a=a.d,o&t.LONG_UNROLL?(xt.lon1=i,xt.lon2=i+a+l):(xt.lon1=s.AngNormalize(i),xt.lon2=s.AngNormalize(r)),l*=h=s.copysign(1,a),M=(a*=h)*s.degree,S=(c=s.sincosde(a,l)).s,T=c.c,l=180-a-l,(f=Math.abs(e)<Math.abs(n)||isNaN(n)?-1:1)<0&&(h*=-1,[n,e]=[e,n]),e*=u=s.copysign(1,-e),n*=u,c=s.sincosd(e),_=this._f1*c.s,d=c.c,_/=c=s.hypot(_,d),d/=c,d=Math.max(t.tiny_,d),c=s.sincosd(n),p=this._f1*c.s,b=c.c,p/=c=s.hypot(p,b),b/=c,b=Math.max(t.tiny_,b),d<-_?b===d&&(p=s.copysign(_,p)):Math.abs(p)===-_&&(b=d),A=Math.sqrt(1+this._ep2*s.sq(_)),E=Math.sqrt(1+this._ep2*s.sq(p)),D=new Array(t.nC1_+1),B=new Array(t.nC2_+1),P=new Array(t.nC3_),(F=-90===e||0===S)&&(R=S,I=0,z=_,O=(N=T)*d,U=p,k=(G=1)*b,C=Math.atan2(Math.max(0,O*U-z*k),O*k+z*U),y=(L=this.Lengths(this._n,C,z,O,A,U,k,E,d,b,o|t.DISTANCE|t.REDUCEDLENGTH,D,B)).s12b,x=L.m12b,o&t.GEODESICSCALE&&(xt.M12=L.M12,xt.M21=L.M21),C<v||x>=0?((C<3*t.tiny_||C<g&&(y<0||x<0))&&(C=x=y=0),x*=this._b,y*=this._b,xt.a12=C/s.degree):F=!1),_t=2,!F&&0===_&&(this.f<=0||l>=180*this.f))N=G=0,R=I=1,y=this.a*M,C=$=M/this._f1,x=this._b*Math.sin(C),o&t.GEODESICSCALE&&(xt.M12=xt.M21=Math.cos(C)),xt.a12=a/this._f1;else if(!F)if(C=(L=this.InverseStart(_,d,A,p,b,E,M,S,T,D,B)).sig12,R=L.salp1,N=L.calp1,C>=0)I=L.salp2,G=L.calp2,H=L.dnm,y=C*this._b*H,x=s.sq(H)*this._b*Math.sin(C/H),o&t.GEODESICSCALE&&(xt.M12=xt.M21=Math.cos(C/H)),xt.a12=C/s.degree,$=M/(this._f1*H);else{for(V=0,q=t.tiny_,W=1,X=t.tiny_,Z=-1,K=!1,Y=!1;J=(L=this.Lambda12(_,d,A,p,b,E,R,N,S,T,V<20,D,B,P)).lam12,I=L.salp2,G=L.calp2,C=L.sig12,z=L.ssig1,O=L.csig1,U=L.ssig2,k=L.csig2,j=L.eps,pt=L.domg12,Q=L.dlam12,!Y&&Math.abs(J)>=(K?8:1)*g&&V!=m;++V)J>0&&(V<20||N/R>Z/X)?(X=R,Z=N):J<0&&(V<20||N/R<W/q)&&(q=R,W=N),V<20&&Q>0&&(tt=-J/Q,Math.abs(tt)<Math.PI&&(et=Math.sin(tt),(st=R*(it=Math.cos(tt))+N*et)>0))?(N=N*it-R*et,R=st,R/=c=s.hypot(R,N),N/=c,K=Math.abs(J)<=16*g):(R=(q+X)/2,N=(W+Z)/2,R/=c=s.hypot(R,N),N/=c,K=!1,Y=Math.abs(q-R)+(W-N)<w||Math.abs(R-X)+(N-Z)<w);nt=o|(o&(t.REDUCEDLENGTH|t.GEODESICSCALE)?t.DISTANCE:t.NONE),y=(L=this.Lengths(j,C,z,O,A,U,k,E,d,b,nt,D,B)).s12b,x=L.m12b,o&t.GEODESICSCALE&&(xt.M12=L.M12,xt.M21=L.M21),x*=this._b,y*=this._b,xt.a12=C/s.degree,o&t.AREA&&(wt=Math.sin(pt),_t=S*(yt=Math.cos(pt))-T*wt,dt=T*yt+S*wt)}return o&t.DISTANCE&&(xt.s12=0+y),o&t.REDUCEDLENGTH&&(xt.m12=0+x),o&t.AREA&&(rt=R*d,0!==(ot=s.hypot(N,R*_))&&0!==rt?(z=_,O=N*d,U=p,k=G*b,j=(lt=s.sq(ot)*this._ep2)/(2*(1+Math.sqrt(1+lt))+lt),ht=s.sq(this.a)*ot*rt*this._e2,z/=c=s.hypot(z,O),O/=c,U/=c=s.hypot(U,k),k/=c,ct=new Array(t.nC4_),this.C4f(j,ct),ft=t.SinCosSeries(!1,z,O,ct),ut=t.SinCosSeries(!1,U,k,ct),xt.S12=ht*(ut-ft)):xt.S12=0,F||2!=_t||(_t=Math.sin($),dt=Math.cos($)),!F&&dt>-.7071&&p-_<1.75?(pt=1+dt,mt=1+d,gt=1+b,at=2*Math.atan2(_t*(_*gt+p*mt),pt*(_*p+mt*gt))):(vt=G*N+I*R,0===(bt=I*N-G*R)&&vt<0&&(bt=t.tiny_*N,vt=-1),at=Math.atan2(bt,vt)),xt.S12+=this._c2*at,xt.S12*=f*h*u,xt.S12+=0),f<0&&([I,R]=[R,I],[G,N]=[N,G],o&t.GEODESICSCALE&&([xt.M21,xt.M12]=[xt.M12,xt.M21])),{vals:xt,salp1:R*=f*h,calp1:N*=f*u,salp2:I*=f*h,calp2:G*=f*u}},t.Geodesic.prototype.GenDirect=function(i,s,n,r,o,a){return a?a===t.LONG_UNROLL&&(a|=t.STANDARD):a=t.STANDARD,r||(a|=t.DISTANCE_IN),new e.GeodesicLine(this,i,s,n,a).GenPosition(r,o,a)},t.Geodesic.prototype.Direct=function(t,e,i,s,n){return this.GenDirect(t,e,i,!1,s,n)},t.Geodesic.prototype.ArcDirect=function(t,e,i,s,n){return this.GenDirect(t,e,i,!0,s,n)},t.Geodesic.prototype.Line=function(t,i,s,n){return new e.GeodesicLine(this,t,i,s,n)},t.Geodesic.prototype.DirectLine=function(t,e,i,s,n){return this.GenDirectLine(t,e,i,!1,s,n)},t.Geodesic.prototype.ArcDirectLine=function(t,e,i,s,n){return this.GenDirectLine(t,e,i,!0,s,n)},t.Geodesic.prototype.GenDirectLine=function(i,s,n,r,o,a){var l;return a||(a=t.STANDARD|t.DISTANCE_IN),r||(a|=t.DISTANCE_IN),(l=new e.GeodesicLine(this,i,s,n,a)).GenSetDistance(r,o),l},t.Geodesic.prototype.InverseLine=function(i,n,r,o,a){var l,h,c;return a||(a=t.STANDARD|t.DISTANCE_IN),l=this.InverseInt(i,n,r,o,t.ARC),c=s.atan2d(l.salp1,l.calp1),a&t.OUT_MASK&t.DISTANCE_IN&&(a|=t.DISTANCE),(h=new e.GeodesicLine(this,i,n,c,a,l.salp1,l.calp1)).SetArc(l.vals.a12),h},t.Geodesic.prototype.Polygon=function(t){return new i.PolygonArea(this,t)},t.WGS84=new t.Geodesic(n.WGS84.a,n.WGS84.f)}(n.Geodesic,n.GeodesicLine,n.PolygonArea,n.Math,n.Constants),function(t,e,i){"use strict";e.GeodesicLine=function(e,s,n,r,o,a,l){var h,c,f,u,_,d;o||(o=t.STANDARD|t.DISTANCE_IN),this.a=e.a,this.f=e.f,this._b=e._b,this._c2=e._c2,this._f1=e._f1,this.caps=o|t.LATITUDE|t.AZIMUTH|t.LONG_UNROLL,this.lat1=i.LatFix(s),this.lon1=n,void 0===a||void 0===l?(this.azi1=i.AngNormalize(r),h=i.sincosd(i.AngRound(this.azi1)),this.salp1=h.s,this.calp1=h.c):(this.azi1=r,this.salp1=a,this.calp1=l),h=i.sincosd(i.AngRound(this.lat1)),f=this._f1*h.s,c=h.c,f/=h=i.hypot(f,c),c/=h,c=Math.max(t.tiny_,c),this._dn1=Math.sqrt(1+e._ep2*i.sq(f)),this._salp0=this.salp1*c,this._calp0=i.hypot(this.calp1,this.salp1*f),this._ssig1=f,this._somg1=this._salp0*f,this._csig1=this._comg1=0!==f||0!==this.calp1?c*this.calp1:1,h=i.hypot(this._ssig1,this._csig1),this._ssig1/=h,this._csig1/=h,this._k2=i.sq(this._calp0)*e._ep2,u=this._k2/(2*(1+Math.sqrt(1+this._k2))+this._k2),this.caps&t.CAP_C1&&(this._A1m1=t.A1m1f(u),this._C1a=new Array(t.nC1_+1),t.C1f(u,this._C1a),this._B11=t.SinCosSeries(!0,this._ssig1,this._csig1,this._C1a),_=Math.sin(this._B11),d=Math.cos(this._B11),this._stau1=this._ssig1*d+this._csig1*_,this._ctau1=this._csig1*d-this._ssig1*_),this.caps&t.CAP_C1p&&(this._C1pa=new Array(t.nC1p_+1),t.C1pf(u,this._C1pa)),this.caps&t.CAP_C2&&(this._A2m1=t.A2m1f(u),this._C2a=new Array(t.nC2_+1),t.C2f(u,this._C2a),this._B21=t.SinCosSeries(!0,this._ssig1,this._csig1,this._C2a)),this.caps&t.CAP_C3&&(this._C3a=new Array(t.nC3_),e.C3f(u,this._C3a),this._A3c=-this.f*this._salp0*e.A3f(u),this._B31=t.SinCosSeries(!0,this._ssig1,this._csig1,this._C3a)),this.caps&t.CAP_C4&&(this._C4a=new Array(t.nC4_),e.C4f(u,this._C4a),this._A4=i.sq(this.a)*this._calp0*this._salp0*e._e2,this._B41=t.SinCosSeries(!1,this._ssig1,this._csig1,this._C4a)),this.a13=this.s13=NaN},e.GeodesicLine.prototype.GenPosition=function(e,s,n){var r,o,a,l,h,c,f,u,_,d,p,m,g,b,v,w,y,x,A,E,M,S,T,C,N,R,G={};return n?n===t.LONG_UNROLL&&(n|=t.STANDARD):n=t.STANDARD,n&=this.caps&t.OUT_MASK,G.lat1=this.lat1,G.azi1=this.azi1,G.lon1=n&t.LONG_UNROLL?this.lon1:i.AngNormalize(this.lon1),e?G.a12=s:G.s12=s,e||this.caps&t.DISTANCE_IN&t.OUT_MASK?(l=0,h=0,e?(r=s*i.degree,o=(T=i.sincosd(s)).s,a=T.c):(u=s/(this._b*(1+this._A1m1)),_=Math.sin(u),d=Math.cos(u),r=u-((l=-t.SinCosSeries(!0,this._stau1*d+this._ctau1*_,this._ctau1*d-this._stau1*_,this._C1pa))-this._B11),o=Math.sin(r),a=Math.cos(r),Math.abs(this.f)>.01&&(c=this._ssig1*a+this._csig1*o,f=this._csig1*a-this._ssig1*o,l=t.SinCosSeries(!0,c,f,this._C1a),r-=((1+this._A1m1)*(r+(l-this._B11))-s/this._b)/Math.sqrt(1+this._k2*i.sq(c)),o=Math.sin(r),a=Math.cos(r))),c=this._ssig1*a+this._csig1*o,f=this._csig1*a-this._ssig1*o,A=Math.sqrt(1+this._k2*i.sq(c)),n&(t.DISTANCE|t.REDUCEDLENGTH|t.GEODESICSCALE)&&((e||Math.abs(this.f)>.01)&&(l=t.SinCosSeries(!0,c,f,this._C1a)),h=(1+this._A1m1)*(l-this._B11)),g=this._calp0*c,0===(b=i.hypot(this._salp0,this._calp0*f))&&(b=f=t.tiny_),y=this._salp0,x=this._calp0*f,e&&n&t.DISTANCE&&(G.s12=this._b*((1+this._A1m1)*r+h)),n&t.LONGITUDE&&(v=this._salp0*c,w=f,m=i.copysign(1,this._salp0),p=((n&t.LONG_UNROLL?m*(r-(Math.atan2(c,f)-Math.atan2(this._ssig1,this._csig1))+(Math.atan2(m*v,w)-Math.atan2(m*this._somg1,this._comg1))):Math.atan2(v*this._comg1-w*this._somg1,w*this._comg1+v*this._somg1))+this._A3c*(r+(t.SinCosSeries(!0,c,f,this._C3a)-this._B31)))/i.degree,G.lon2=n&t.LONG_UNROLL?this.lon1+p:i.AngNormalize(i.AngNormalize(this.lon1)+i.AngNormalize(p))),n&t.LATITUDE&&(G.lat2=i.atan2d(g,this._f1*b)),n&t.AZIMUTH&&(G.azi2=i.atan2d(y,x)),n&(t.REDUCEDLENGTH|t.GEODESICSCALE)&&(E=t.SinCosSeries(!0,c,f,this._C2a),M=(1+this._A2m1)*(E-this._B21),S=(this._A1m1-this._A2m1)*r+(h-M),n&t.REDUCEDLENGTH&&(G.m12=this._b*(A*(this._csig1*c)-this._dn1*(this._ssig1*f)-this._csig1*f*S)),n&t.GEODESICSCALE&&(T=this._k2*(c-this._ssig1)*(c+this._ssig1)/(this._dn1+A),G.M12=a+(T*c-f*S)*this._ssig1/this._dn1,G.M21=a-(T*this._ssig1-this._csig1*S)*c/A)),n&t.AREA&&(C=t.SinCosSeries(!1,c,f,this._C4a),0===this._calp0||0===this._salp0?(N=y*this.calp1-x*this.salp1,R=x*this.calp1+y*this.salp1):(N=this._calp0*this._salp0*(a<=0?this._csig1*(1-a)+o*this._ssig1:o*(this._csig1*o/(1+a)+this._ssig1)),R=i.sq(this._salp0)+i.sq(this._calp0)*this._csig1*f),G.S12=this._c2*Math.atan2(N,R)+this._A4*(C-this._B41)),e||(G.a12=r/i.degree),G):(G.a12=NaN,G)},e.GeodesicLine.prototype.Position=function(t,e){return this.GenPosition(!1,t,e)},e.GeodesicLine.prototype.ArcPosition=function(t,e){return this.GenPosition(!0,t,e)},e.GeodesicLine.prototype.GenSetDistance=function(t,e){t?this.SetArc(e):this.SetDistance(e)},e.GeodesicLine.prototype.SetDistance=function(e){var i;this.s13=e,i=this.GenPosition(!1,this.s13,t.ARC),this.a13=0+i.a12},e.GeodesicLine.prototype.SetArc=function(e){var i;this.a13=e,i=this.GenPosition(!0,this.a13,t.DISTANCE),this.s13=0+i.s12}}(n.Geodesic,n.GeodesicLine,n.Math),function(t,e,i,s){"use strict";var n,r,o,a;n=function(t,e){var s=i.AngDiff(t,e).d;return t=i.AngNormalize(t),e=i.AngNormalize(e),s>0&&(t<0&&e>=0||t>0&&0===e)?1:s<0&&t>=0&&e<0?-1:0},r=function(t,e){return(0<=(e%=720)&&e<360||e<-360?0:1)-(0<=(t%=720)&&t<360||t<-360?0:1)},o=function(t,e,i,s,n){return t.Remainder(e),1&i&&t.Add((t.Sum()<0?1:-1)*e/2),s||t.Negate(),n?t.Sum()>e/2?t.Add(-e):t.Sum()<=-e/2&&t.Add(+e):t.Sum()>=e?t.Add(-e):t.Sum()<0&&t.Add(+e),0+t.Sum()},a=function(t,e,s,n,r){return t=i.remainder(t,e),1&s&&(t+=(t<0?1:-1)*e/2),n||(t*=-1),r?t>e/2?t-=e:t<=-e/2&&(t+=e):t>=e?t-=e:t<0&&(t+=e),0+t},t.PolygonArea=function(t,i){this._geod=t,this.a=this._geod.a,this.f=this._geod.f,this._area0=4*Math.PI*t._c2,this.polyline=i||!1,this._mask=e.LATITUDE|e.LONGITUDE|e.DISTANCE|(this.polyline?e.NONE:e.AREA|e.LONG_UNROLL),this.polyline||(this._areasum=new s.Accumulator(0)),this._perimetersum=new s.Accumulator(0),this.Clear()},t.PolygonArea.prototype.Clear=function(){this.num=0,this._crossings=0,this.polyline||this._areasum.Set(0),this._perimetersum.Set(0),this._lat0=this._lon0=this.lat=this.lon=NaN},t.PolygonArea.prototype.AddPoint=function(t,e){var i;0===this.num?(this._lat0=this.lat=t,this._lon0=this.lon=e):(i=this._geod.Inverse(this.lat,this.lon,t,e,this._mask),this._perimetersum.Add(i.s12),this.polyline||(this._areasum.Add(i.S12),this._crossings+=n(this.lon,e)),this.lat=t,this.lon=e),++this.num},t.PolygonArea.prototype.AddEdge=function(t,e){var i;this.num&&(i=this._geod.Direct(this.lat,this.lon,t,e,this._mask),this._perimetersum.Add(e),this.polyline||(this._areasum.Add(i.S12),this._crossings+=r(this.lon,i.lon2)),this.lat=i.lat2,this.lon=i.lon2),++this.num},t.PolygonArea.prototype.Compute=function(t,e){var i,r,a={number:this.num};return this.num<2?(a.perimeter=0,this.polyline||(a.area=0),a):this.polyline?(a.perimeter=this._perimetersum.Sum(),a):(i=this._geod.Inverse(this.lat,this.lon,this._lat0,this._lon0,this._mask),a.perimeter=this._perimetersum.Sum(i.s12),(r=new s.Accumulator(this._areasum)).Add(i.S12),a.area=o(r,this._area0,this._crossings+n(this.lon,this._lon0),t,e),a)},t.PolygonArea.prototype.TestPoint=function(t,e,i,s){var r,o,l,h,c={number:this.num+1};if(0===this.num)return c.perimeter=0,this.polyline||(c.area=0),c;for(c.perimeter=this._perimetersum.Sum(),o=this.polyline?0:this._areasum.Sum(),l=this._crossings,h=0;h<(this.polyline?1:2);++h)r=this._geod.Inverse(0===h?this.lat:t,0===h?this.lon:e,0!==h?this._lat0:t,0!==h?this._lon0:e,this._mask),c.perimeter+=r.s12,this.polyline||(o+=r.S12,l+=n(0===h?this.lon:e,0!==h?this._lon0:e));return this.polyline||(c.area=a(o,this._area0,l,i,s)),c},t.PolygonArea.prototype.TestEdge=function(t,e,i,s){var o,l,h,c={number:this.num?this.num+1:0};return 0===this.num||(c.perimeter=this._perimetersum.Sum()+e,this.polyline||(l=this._areasum.Sum(),h=this._crossings,l+=(o=this._geod.Direct(this.lat,this.lon,t,e,this._mask)).S12,h+=r(this.lon,o.lon2),h+=n(o.lon2,this._lon0),o=this._geod.Inverse(o.lat2,o.lon2,this._lat0,this._lon0,this._mask),c.perimeter+=o.s12,l+=o.S12,c.area=a(l,this._area0,h,i,s))),c}}(n.PolygonArea,n.Geodesic,n.Math,n.Accumulator),s=n,t.exports?t.exports=s:void 0===(i=function(){return s}.apply(e,[]))||(t.exports=i)},401:t=>{t.exports="#version 300 es\n\nin highp vec2 v_tex_coord;\n\n#ifdef MASK\nuniform sampler2D u_mask_sampler;\n#endif\n\nuniform highp float u_opacity;\n#ifdef MASK\nuniform int u_mask_val;\n#endif\n\nout highp vec4 fragColor;\n\nvoid main() {\n highp float fill_val = get_field_value(v_tex_coord);\n\n int draw_mask = 1;\n\n#ifdef MASK\n highp float mask_val = texture(u_mask_sampler, v_tex_coord).r;\n draw_mask = int(mask_val * 255.0) == u_mask_val ? 1 : 0;\n#endif\n\n if (isnan(fill_val) || draw_mask == 0) {\n discard;\n }\n\n lowp vec4 color = apply_colormap(fill_val);\n color.a = color.a * u_opacity;\n fragColor = color;\n}"},631:t=>{t.exports="#version 300 es\n\nuniform int u_offset;\n\nin vec2 a_pos; // Has grid point position\nin vec2 a_tex_coord; // zoom info is on the x coordinate\nin lowp float a_geom; // Has corner info\nuniform lowp float u_bb_size;\nuniform lowp float u_map_aspect;\nuniform lowp float u_zoom;\nuniform lowp float u_bb_width; // Normalized by texture width\nuniform lowp float u_bb_height; // Normalized by texture height\nuniform highp float u_bb_mag_bin_size;\nuniform highp float u_bb_mag_wrap;\nuniform int u_rotate_with_map;\n\nuniform sampler2D u_rot_sampler;\n\nout highp vec2 v_tex_coord;\n#ifdef COLORMAP\nout highp float v_mag;\n#endif\n\nmat4 scalingMatrix(float x_scale, float y_scale, float z_scale) {\n return mat4(x_scale, 0.0, 0.0, 0.0,\n 0.0, y_scale, 0.0, 0.0,\n 0.0, 0.0, z_scale, 0.0,\n 0.0, 0.0, 0.0, 1.0);\n}\n\nmat4 rotationZMatrix(float angle) {\n float s = sin(angle);\n float c = cos(angle);\n\n return mat4( c, s, 0., 0.,\n -s, c, 0., 0.,\n 0., 0., 1., 0.,\n 0., 0., 0., 1.);\n}\n\nmat4 rotationXMatrix(float angle) {\n float s = sin(angle);\n float c = cos(angle);\n\n return mat4( 1., 0., 0., 0.,\n 0., c, s, 0.,\n 0., -s, c, 0.,\n 0., 0., 0., 1.);\n}\n\nvoid main() {\n float globe_width = 1.;\n vec2 globe_offset = vec2(globe_width * float(u_offset), 0.);\n\n mat4 map_stretch_matrix = scalingMatrix(1.0, 1. / u_map_aspect, 1.0);\n\n vec4 pivot_pos = projectTile(a_pos.xy + globe_offset);\n float globe_rotation = 0.0;\n\n if (u_rotate_with_map == 1) {\n vec4 pivot_pos_ihat = projectTile(a_pos.xy + globe_offset + vec2(1e-5, 0.));\n // Surely there's a more linear-algebra-y way to do this than converting all the rotations to an angle.\n vec2 pivot_east = normalize((inverse(map_stretch_matrix) * (pivot_pos_ihat - pivot_pos)).xy);\n globe_rotation = atan(pivot_east.x, pivot_east.y) - 3.141592654 / 2.0;\n }\n\n highp float min_zoom = floor(a_tex_coord.x);\n lowp float corner = a_geom;\n\n vec2 data_texcoord = a_tex_coord;\n data_texcoord.x = fract(data_texcoord.x);\n\n highp float u = get_field_value_u(data_texcoord);\n highp float v = get_field_value_v(data_texcoord);\n highp float rot = texture(u_rot_sampler, data_texcoord).r;\n\n lowp float bb_aspect = u_bb_width / u_bb_height;\n lowp float ang = (abs(u) < 1e-6 && abs(v) < 1e-6) ? 0. : atan(v, u) - 3.141592654 / 2.0;\n highp float mag = length(vec2(u, v));\n#ifdef COLORMAP\n v_mag = mag;\n#endif\n mag = floor(mag / u_bb_mag_bin_size + 0.5) * u_bb_mag_bin_size;\n\n vec4 offset = vec4(0.0, 0.0, 0.0, 0.0);\n vec2 texcoord = vec2(0.0, 0.0);\n \n if (u_zoom >= min_zoom) {\n // Subtracting a small number off of u_bb_mag_wrap fixes (I think) a precision issue on some GPUs\n vec2 tex_loc = vec2(mod(mag, u_bb_mag_wrap - 1e-5) / u_bb_mag_bin_size * u_bb_width, floor(mag / (u_bb_mag_wrap - 1e-5)) * u_bb_height);\n\n if (corner < 0.5) {\n offset = vec4(-u_bb_size, u_bb_size, 0., 0.);\n texcoord = tex_loc;\n }\n else if (corner < 1.5) {\n offset = vec4(u_bb_size, u_bb_size, 0., 0.);\n texcoord = tex_loc + vec2(u_bb_width, 0.0);\n }\n else if (corner < 2.5) {\n offset = vec4(-u_bb_size, -u_bb_size * (2. / bb_aspect - 1.), 0., 0.);\n texcoord = tex_loc + vec2(0.0, u_bb_height);\n }\n else if (corner < 3.5) {\n offset = vec4(u_bb_size, -u_bb_size * (2. / bb_aspect - 1.), 0., 0.);\n texcoord = tex_loc + vec2(u_bb_width, u_bb_height);\n }\n\n mat4 barb_rotation = rotationZMatrix(ang - globe_rotation - rot);\n offset = map_stretch_matrix * barb_rotation * offset;\n }\n\n gl_Position = pivot_pos + offset;\n v_tex_coord = texcoord;\n}"},820:t=>{t.exports="#version 300 es\n\nuniform int u_offset;\n\nin vec2 a_pos;\nin vec2 a_tex_coord;\n\nout highp vec2 v_tex_coord;\n\nvoid main() {\n float globe_width = 1.;\n vec2 globe_offset = vec2(globe_width * float(u_offset), 0.);\n\n gl_Position = projectTile(a_pos.xy + globe_offset);\n v_tex_coord = a_tex_coord;\n}"},840:t=>{t.exports="#version 300 es\n\nuniform int u_offset;\n\nin vec3 a_pos;\nin vec2 a_extrusion;\nin float a_data;\n\n#ifdef ZOOM\nin float a_min_zoom;\n#endif\n\n#ifdef OFFSET\nin vec2 a_offset;\n#endif\n\nuniform lowp float u_line_width;\nuniform lowp float u_map_width;\nuniform lowp float u_map_height;\n//uniform highp float u_map_bearing;\n\n#ifdef ZOOM\nuniform lowp float u_zoom;\n#endif\n\n#ifdef OFFSET\nuniform int u_offset_rotates_with_map;\nuniform lowp float u_offset_scale;\n#endif\n\n#ifdef DATA\nout highp float v_data;\n#endif\n\nout highp float v_dist;\nout lowp float v_cross;\n\nmat4 scalingMatrix(float x_scale, float y_scale, float z_scale) {\n return mat4(x_scale, 0.0, 0.0, 0.0,\n 0.0, y_scale, 0.0, 0.0,\n 0.0, 0.0, z_scale, 0.0,\n 0.0, 0.0, 0.0, 1.0);\n}\n\nmat4 rotationZMatrix(float angle) {\n float s = sin(angle);\n float c = cos(angle);\n\n return mat4( c, s, 0., 0.,\n -s, c, 0., 0.,\n 0., 0., 1., 0.,\n 0., 0., 0., 1.);\n}\n\nmat4 rotationXMatrix(float angle) {\n float s = sin(angle);\n float c = cos(angle);\n\n return mat4( 1., 0., 0., 0.,\n 0., c, s, 0.,\n 0., -s, c, 0.,\n 0., 0., 0., 1.);\n}\n\nvoid main() {\n float globe_width = 1.;\n vec2 globe_offset = vec2(globe_width * float(u_offset), 0.);\n\n v_dist = abs(a_pos.z);\n v_cross = sign(a_pos.z);\n vec4 center_pos = projectTile(a_pos.xy + globe_offset);\n vec4 offset = vec4(0.0, 0.0, 0.0, 0.0);\n\n#ifdef ZOOM\n if (u_zoom >= a_min_zoom) {\n#endif\n\n vec2 offset_ext = u_line_width * 2. * a_extrusion;\n\n mat4 map_stretch_matrix = scalingMatrix(u_map_height / u_map_width, 1., 1.);\n \n vec4 center_pos_ihat = projectTile(a_pos.xy + globe_offset + vec2(1e-5, 0.));\n // Surely there's a more linear-algebra-y way to do this than converting all the rotations to an angle.\n vec2 center_east = normalize((inverse(map_stretch_matrix) * (center_pos_ihat - center_pos)).xy);\n float globe_rotation = atan(center_east.x, center_east.y) - 3.141592654 / 2.0;\n mat4 rotation_matrix = rotationZMatrix(-globe_rotation);\n\n offset = map_stretch_matrix * rotation_matrix * vec4(offset_ext, 0., 0.);\n\n#ifdef OFFSET\n mat4 offset_matrix = scalingMatrix(1., u_map_width / u_map_height, 1.);\n if (u_offset_rotates_with_map == 1) {\n offset_matrix = offset_matrix * rotation_matrix;\n }\n else {\n offset = map_stretch_matrix * vec4(offset_ext, 0., 0.);\n }\n\n vec2 offset_offset = u_offset_scale * a_offset;\n offset += offset_matrix * vec4(offset_offset, 0., 0.);\n#endif\n\n#ifdef ZOOM\n }\n#endif\n\n gl_Position = center_pos + offset;\n\n#ifdef DATA\n v_data = a_data;\n#endif\n}"},873:t=>{t.exports="#version 300 es\n\nuniform int u_offset;\nuniform highp float u_map_width;\nuniform highp float u_map_height;\nuniform highp float u_map_zoom;\nuniform highp float u_font_size;\n\nin vec3 a_pos;\nin vec2 a_offset;\nin vec2 a_tex_coord;\n\n#ifdef DATA\nin highp float a_value;\n#endif\n\nout highp vec2 v_tex_coord;\n\n#ifdef DATA\nout highp float v_value;\n#endif\n\nmat4 scalingMatrix(float x_scale, float y_scale, float z_scale) {\n return mat4(x_scale, 0.0, 0.0, 0.0,\n 0.0, y_scale, 0.0, 0.0,\n 0.0, 0.0, z_scale, 0.0,\n 0.0, 0.0, 0.0, 1.0);\n}\n\nvoid main() {\n float min_zoom = a_pos.z;\n\n vec2 offset = a_offset;\n if (u_map_zoom < min_zoom)\n offset = vec2(0., 0.);\n\n float globe_width = 1.;\n vec2 globe_offset = vec2(globe_width * float(u_offset), 0.);\n\n mat4 map_stretch_matrix = scalingMatrix(u_map_height / u_map_width, 1., 1.);\n\n gl_Position = projectTile(a_pos.xy + globe_offset) + u_font_size / 12. * 1.5 * map_stretch_matrix * vec4(offset, 0., 0.);\n v_tex_coord = a_tex_coord;\n\n#ifdef DATA\n v_value = a_value;\n#endif\n}"},934:t=>{t.exports="#version 300 es\n\nuniform sampler2D u_dash_sampler;\n\n#ifndef DATA\nuniform lowp vec4 u_color;\n#endif\n\nuniform lowp float u_line_width;\nuniform lowp float u_zoom;\nuniform int u_dash_pattern_length;\n\n#ifdef DATA\nin highp float v_data;\n#endif\n\nin highp float v_dist;\nin lowp float v_cross;\n\nout highp vec4 fragColor;\n\nvoid main() {\n lowp float dash_x = fract(v_dist * 2e2 * pow(2., floor(u_zoom)) / float(u_dash_pattern_length));\n lowp float dash = texture(u_dash_sampler, vec2(dash_x, 0.5)).r;\n\n lowp vec4 color;\n#ifdef DATA\n color = apply_colormap(v_data);\n#else\n color = u_color;\n#endif\n\n lowp float feather = clamp((1. - abs(v_cross)) * u_line_width, 0., 1.);\n color.a *= (dash >= 1. ? 1. : 0.) * feather;\n\n fragColor = color;\n}"},947:t=>{t.exports="#version 300 es\n\nin highp vec2 v_tex_coord;\n\n#ifdef DATA\nin highp float v_value;\n#endif\n\nuniform sampler2D u_sdf_sampler;\nuniform int u_is_halo;\n\n#ifndef DATA\nuniform lowp vec4 u_text_color;\n#endif\nuniform lowp vec4 u_halo_color;\n\n#define SDF_FILL 0.75\n#define SDF_HALO 0.45\n\nout highp vec4 fragColor;\n\nvoid main() {\n highp float sdf_val = texture(u_sdf_sampler, v_tex_coord).r;\n\n lowp float step_width = 0.08;\n lowp float alpha = smoothstep(SDF_FILL - step_width, SDF_FILL + step_width, sdf_val);\n\n#ifdef DATA\n lowp vec4 text_color = apply_colormap(v_value);\n#else\n lowp vec4 text_color = u_text_color;\n#endif\n\n lowp vec4 color = u_is_halo == 1 ? u_halo_color : text_color;\n\n if (u_is_halo == 1) {\n alpha = min(smoothstep(SDF_HALO - step_width, SDF_HALO + step_width, sdf_val), 1.0 - alpha);\n }\n\n color.a *= alpha;\n fragColor = color;\n}"}},e={};function i(s){var n=e[s];if(void 0!==n)return n.exports;var r=e[s]={exports:{}};return t[s].call(r.exports,r,r.exports,i),r.exports}i.m=t,i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.u=t=>t+".autumnplot-gl.js",i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;i.g.importScripts&&(t=i.g.location+"");var e=i.g.document;if(!t&&e&&(e.currentScript&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var s=e.getElementsByTagName("script");if(s.length)for(var n=s.length-1;n>-1&&(!t||!/^http(s?):/.test(t));)t=s[n--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=t})(),i.b=document.baseURI||self.location.href;var s={};return(()=>{"use strict";i.r(s),i.d(s,{Barbs:()=>vs,Color:()=>Ci,ColorMap:()=>Ri,ComputedScalarField:()=>Hs,ComputedVectorField:()=>Zs,Contour:()=>as,ContourFill:()=>_s,ContourLabels:()=>os,GeostationaryImage:()=>an,Grid:()=>is,Hodographs:()=>Cs,LambertGrid:()=>nn,MultiPlotLayer:()=>Ps,Paintball:()=>Ms,PlateCarreeGrid:()=>en,PlateCarreeRotatedGrid:()=>sn,PlotComponent:()=>B,PlotLayer:()=>Bs,RadarSweepGrid:()=>on,Raster:()=>us,RawObsField:()=>Ys,RawProfileField:()=>Ks,RawScalarField:()=>js,RawVectorField:()=>Xs,StationPlot:()=>Is,StructuredGrid:()=>Qs,UnstructuredGrid:()=>ss,colormaps:()=>ln,initAutumnPlot:()=>hn,makeColorBar:()=>Ls,makePaintballKey:()=>Os});const t=Symbol("Comlink.proxy"),e=Symbol("Comlink.endpoint"),n=Symbol("Comlink.releaseProxy"),r=Symbol("Comlink.thrown"),o=t=>"object"==typeof t&&null!==t||"function"==typeof t,a=new Map([["proxy",{canHandle:e=>o(e)&&e[t],serialize(t){const{port1:e,port2:i}=new MessageChannel;return l(t,e),[i,[i]]},deserialize:t=>(t.start(),c(t))}],["throw",{canHandle:t=>o(t)&&r in t,serialize({value:t}){let e;return e=t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[e,[]]},deserialize(t){if(t.isError)throw Object.assign(new Error(t.value.message),t.value);throw t.value}}]]);function l(e,i=self){i.addEventListener("message",function s(n){if(!n||!n.data)return;const{id:o,type:a,path:c}=Object.assign({path:[]},n.data),f=(n.data.argumentList||[]).map(m);let u;try{const i=c.slice(0,-1).reduce((t,e)=>t[e],e),s=c.reduce((t,e)=>t[e],e);switch(a){case"GET":u=s;break;case"SET":i[c.slice(-1)[0]]=m(n.data.value),u=!0;break;case"APPLY":u=s.apply(i,f);break;case"CONSTRUCT":u=function(e){return Object.assign(e,{[t]:!0})}(new s(...f));break;case"ENDPOINT":{const{port1:t,port2:i}=new MessageChannel;l(e,i),u=function(t,e){return d.set(t,e),t}(t,[t])}break;case"RELEASE":u=void 0;break;default:return}}catch(t){u={value:t,[r]:0}}Promise.resolve(u).catch(t=>({value:t,[r]:0})).then(t=>{const[e,n]=p(t);i.postMessage(Object.assign(Object.assign({},e),{id:o}),n),"RELEASE"===a&&(i.removeEventListener("message",s),h(i))})}),i.start&&i.start()}function h(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function c(t,e){return u(t,[],e)}function f(t){if(t)throw new Error("Proxy has been released and is not useable")}function u(t,i=[],s=function(){}){let r=!1;const o=new Proxy(s,{get(e,s){if(f(r),s===n)return()=>g(t,{type:"RELEASE",path:i.map(t=>t.toString())}).then(()=>{h(t),r=!0});if("then"===s){if(0===i.length)return{then:()=>o};const e=g(t,{type:"GET",path:i.map(t=>t.toString())}).then(m);return e.then.bind(e)}return u(t,[...i,s])},set(e,s,n){f(r);const[o,a]=p(n);return g(t,{type:"SET",path:[...i,s].map(t=>t.toString()),value:o},a).then(m)},apply(s,n,o){f(r);const a=i[i.length-1];if(a===e)return g(t,{type:"ENDPOINT"}).then(m);if("bind"===a)return u(t,i.slice(0,-1));const[l,h]=_(o);return g(t,{type:"APPLY",path:i.map(t=>t.toString()),argumentList:l},h).then(m)},construct(e,s){f(r);const[n,o]=_(s);return g(t,{type:"CONSTRUCT",path:i.map(t=>t.toString()),argumentList:n},o).then(m)}});return o}function _(t){const e=t.map(p);return[e.map(t=>t[0]),(i=e.map(t=>t[1]),Array.prototype.concat.apply([],i))];var i}const d=new WeakMap;function p(t){for(const[e,i]of a)if(i.canHandle(t)){const[s,n]=i.serialize(t);return[{type:"HANDLER",name:e,value:s},n]}return[{type:"RAW",value:t},d.get(t)||[]]}function m(t){switch(t.type){case"HANDLER":return a.get(t.name).deserialize(t.value);case"RAW":return t.value}}function g(t,e,i){return new Promise(s=>{const n=new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");t.addEventListener("message",function e(i){i.data&&i.data.id&&i.data.id===n&&(t.removeEventListener("message",e),s(i.data))}),t.start&&t.start(),t.postMessage(Object.assign({id:n},e),i)})}function b(t,e,i){let s=1,n=i;for(;t%n!=0||e%n!=0;)s+=1,n/=2;return s}class v{constructor(t,e){this.cached_values={},this.compute_value=t,this.make_key=void 0===e?(...t)=>JSON.stringify(t):e}getValue(...t){const e=this.make_key(...t);return e in this.cached_values||(this.cached_values[e]=this.compute_value(...t)),this.cached_values[e]}}function w(t,e){const i={...e};return void 0!==t&&Object.entries(t).forEach(([t,e])=>{i[t]=e}),i}function y(t){return t.constructor}function x(t,e){const i="#version 300 es\n";return e.startsWith(i)?i+t+"\n"+e.slice(16):t+"\n"+e}function A(t,e,i,s){const n={float16:"sampler2D",float32:"sampler2D",uint8:"lowp usampler2D",uint16:"mediump usampler2D",uint32:"highp usampler2D",int16:"mediump isampler2D",int32:"highp isampler2D"},r={float16:"highp float",float32:"highp float",uint8:"uint",uint16:"uint",uint32:"uint",int16:"int",int32:"int"},o=e.map((t,e)=>`uniform ${n[s[e]]} ${t};`).join("\n"),a=e.map((t,e)=>` ${r[s[e]]} ${t}_val = texture(${t}, tex_coord).r;`).join("\n");return e.forEach(t=>i=i.replaceAll(t,`${t}_val`)),x(`\n${o}\n\n${r[s[0]]} get_field_value(lowp vec2 tex_coord) {\n${a}\n return ${i};\n}`,t)}function E(t){if(0===t.length)return-1;let e=t[0],i=0;for(let s=1;s<t.length;s++)t[s]<e&&(i=s,e=t[s]);return i}function M(t){return"smu"in t&&"smv"in t}function S(t){return t.getParameter(t.VERSION).includes("WebGL 2.0")}function T(t){return"modelViewProjectionMatrix"in(e=t)&&"defaultProjectionData"in e&&"mainMatrix"in e.defaultProjectionData?{type:"maplibre",defaultProjectionData:{clippingPlane:[...t.defaultProjectionData.clippingPlane],fallbackMatrix:[...t.defaultProjectionData.fallbackMatrix],mainMatrix:[...t.defaultProjectionData.mainMatrix],projectionTransition:t.defaultProjectionData.projectionTransition,tileMercatorCoords:[...t.defaultProjectionData.tileMercatorCoords]},farZ:t.farZ,fov:t.fov,modelViewProjectionMatrix:[...t.modelViewProjectionMatrix],nearZ:t.nearZ,projectionMatrix:[...t.projectionMatrix],shaderData:t.shaderData}:{type:"autumn",mainMatrix:[...t],shaderData:null};var e}class C{constructor(t,e){this.workers=t.map(t=>({worker:c(t),is_busy:!1})),e&&this.workers.forEach(t=>e(t.worker)),this.queue=new Map}call(t,e,i){const s=this.workers.map((t,e)=>[t,e]).filter(([t,e])=>!t.is_busy)[0];if(void 0===s)this.enqueue(t,e,i);else{const[n,r]=s,o=()=>{if(this.queueSize(t)>0){const e=this.dequeue(t);if(void 0===e)return;this.startRun(n,t,e.args).then(e.callback).then(o)}};this.startRun(n,t,e).then(i).then(o)}}enqueue(t,e,i){const s=t.join("."),n=this.queue.get(s)||[];n.push({args:e,callback:i}),this.queue.set(s,n)}dequeue(t){const e=t.join("."),i=this.queue.get(e);if(!i)return;const s=i.shift();return this.queue.set(e,i),s}queueSize(t){const e=t.join("."),i=this.queue.get(e);return i?i.length:0}async startRun(t,e,i){let s=t.worker;e.forEach(t=>s=s[t]),t.is_busy=!0;const n=await s(...i);return t.is_busy=!1,n}}function N(t,e,i){return new Proxy(i,{get:(i,s)=>N(t,[...e,s],()=>{}),apply:(i,s,n)=>new Promise((i,s)=>t.call(e,n,i))})}function R(t,e){return N(new C(t,e),[],()=>{})}const G=c(new Worker(new URL(i.p+i.u(983),i.b)));let I=null;function D(t,e){if(null!==I)return I;const s=[];for(let t=0;t<e;t++)s.push(new Worker(new URL(i.p+i.u(812),i.b)));const n=R(s,e=>e.init(t));return I=n,n}class B{}function P(t,e){let i,s,n;const r=S(t);if("float16"==e){const e=t.getExtension("OES_texture_half_float"),o=t.getExtension("OES_texture_half_float_linear");if(r)i=t.R16F,s=t.HALF_FLOAT;else{if(null===e||null===o)throw"Float16 data are not supported on this hardware. Try Float32 data instead.";i=t.LUMINANCE,s=e.HALF_FLOAT_OES}n=2}else if("float32"==e){const e=t.getExtension("OES_texture_float"),o=t.getExtension("OES_texture_float_linear");if(!r&&null===e||!r&&null===o||"iOS"===function(){const t=window.navigator.userAgent,e=window.navigator.platform,i=["Macintosh","MacIntel","MacPPC","Mac68K"];let s=null;return-1!==i.indexOf(e)&&navigator.maxTouchPoints<=1?s="Mac OS":-1!==["iPhone","iPad","iPod"].indexOf(e)||-1!==i.indexOf(e)&&navigator.maxTouchPoints>1?s="iOS":-1!==["Win32","Win64","Windows","WinCE"].indexOf(e)?s="Windows":/Android/.test(t)?s="Android":/Linux/.test(e)&&(s="Linux"),s}())throw"Float32 data are not supported on this hardware. Try Float16 data instead.";i=r?t.R32F:t.LUMINANCE,s=t.FLOAT,n=4}else"uint16"==e?(i=r?t.R16UI:t.LUMINANCE,s=t.UNSIGNED_SHORT,n=2):"uint32"==e?(i=r?t.R32UI:t.LUMINANCE,s=t.UNSIGNED_INT,n=4):"int16"==e?(i=r?t.R16I:t.LUMINANCE,s=t.SHORT,n=2):"int32"==e?(i=r?t.R32I:t.LUMINANCE,s=t.INT,n=4):(i=r?t.R8:t.LUMINANCE,s=t.UNSIGNED_BYTE,n=1);return{format:i,type:s,row_alignment:n}}function F(t){const e=t=>{const e=Math.sin(t);return Math.tan(Math.PI/4-t/2)*Math.pow((1+r*e)/(1-r*e),r/2)},i=t=>{const e=Math.sin(t);return Math.cos(t)/Math.sqrt(1-r*r*e*e)},s=t.a,n=t.b,r=Math.sqrt(1-n*n/(s*s)),o=Math.PI/180;let a,l,{lon_0:h,lat_0:c,lat_std:f}=t;f=Array.isArray(f)&&f[0]==f[1]?f[0]:f,h*=o,c*=o;const u=e(c);if(Array.isArray(f)){let[t,s]=f;t*=o,s*=o;const n=e(t),r=e(s),h=i(t),c=i(s);l=Math.log(h/c)/Math.log(n/r),a=h/(l*Math.pow(n,l))}else{let t=f;t*=o;const s=e(t),n=i(t);l=Math.sin(t),a=n/(l*Math.pow(s,l))}const _=s*a*Math.pow(u,l),d=r*r,p=d*d,m=p*d,g=m*d,b=d/2+5*p/24+3*m/120-73*g/2016,v=7*p/24+29*m/120+233*g/6720,w=7*m/30+81*g/280,y=4729*g/20160;return(t,i,n)=>(n=void 0===n?{inverse:!1}:n).inverse?((t,e)=>{const i=Math.atan2(t,_-e)/l+h,n=Math.hypot(t,_-e)*Math.sign(l),r=Math.pow(n/(s*a),1/l),c=Math.PI/2-2*Math.atan(r),f=Math.sin(2*c),u=Math.cos(2*c);return[i/o,(c+f*(b+u*(v+u*(w+y*u))))/o]})(t,i):((t,i)=>{t*=o;const n=e(i*=o),r=s*a*Math.pow(n,l),c=l*(t-h);return[r*Math.sin(c),_-r*Math.cos(c)]})(t,i)}function L(t){const e=Math.sin(t*Math.PI/180),i=(180-90/Math.PI*Math.log((1+e)/(1-e)))/360;return Math.min(1.5,Math.max(-.5,i))}class z{constructor(t,e){if(isNaN(t)||isNaN(e))this.lng=NaN,this.lat=NaN;else if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}toMercatorCoord(){return isNaN(this.lng)||isNaN(this.lng)?{x:NaN,y:NaN}:{x:(t=this.lng,(180+t)/360),y:L(this.lat)};var t}static fromMercatorCoord(t,e){return isNaN(t)||isNaN(e)?new z(NaN,NaN):new z(function(t){return 360*t-180}(t),function(t){return 180*Math.atan(Math.sinh((180-360*t)*Math.PI/180))/Math.PI}(e))}}function O(t){return t.getParameter(t.VERSION).includes("WebGL 2.0")}class U{constructor(t,e,i,s,n,r){this.gl=t,this.n_coords_per_vert=i,this.dtype=((t,e)=>({Float32Array:t.FLOAT,Uint8Array:t.UNSIGNED_BYTE,Uint16Array:t.UNSIGNED_SHORT,Uint32Array:t.UNSIGNED_INT}[e.constructor.name]))(t,e),this.n_verts=e.length/i,this.draw_mode=s;const o=t.createBuffer();if(null===o)throw"Could not create WebGL buffer";this.buffer=o,t.bindBuffer(n,this.buffer),t.bufferData(n,e,r)}getDataSync(){const t=this.gl;if(!O(t))throw"getDataSync() needs webgl2";const e=new Float32Array(this.n_verts*this.n_coords_per_vert);return t.bindBuffer(t.ARRAY_BUFFER,this.buffer),t.getBufferSubData(t.ARRAY_BUFFER,0,e),e}}class k extends U{constructor(t,e,i,s,n){const r=void 0===(n=void 0===n?{}:n).usage?t.STATIC_DRAW:n.usage;if(super(t,e,i,s,t.ARRAY_BUFFER,r),this.is_per_instance=void 0!==n.per_instance&&n.per_instance,O(this.gl))this.vadFunc=this.gl.vertexAttribDivisor.bind(this.gl);else{const t=this.gl.getExtension("ANGLE_instanced_arrays");this.vadFunc=t.vertexAttribDivisorANGLE.bind(t)}}setPerInstance(t){this.is_per_instance=t}bindToProgram(t){this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.buffer),this.gl.enableVertexAttribArray(t),this.gl.vertexAttribPointer(t,this.n_coords_per_vert,this.dtype,!1,0,0);const e=this.is_per_instance?1:0;this.vadFunc(t,e)}bindToTransformFeedback(t){if(!O(this.gl))throw"Transform feedbacks are a webgl2-only function";this.gl.bindTransformFeedback(this.gl.TRANSFORM_FEEDBACK,void 0===t?null:t),this.gl.bindBufferBase(this.gl.TRANSFORM_FEEDBACK_BUFFER,0,this.buffer)}}class j{constructor(t,e){this.gl=t;const i=t.createTexture();if(null===i)throw"Could not create WebGL texture";this.texture=i,this.tex_num=null,this.setImageData(e);const s=void 0===e.mag_filter?t.LINEAR:e.mag_filter,n=void 0===e.min_filter?t.LINEAR:e.min_filter;t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,s)}setImageData(t){const e=this.gl;this.spec=t,e.bindTexture(e.TEXTURE_2D,this.texture);const i=O(e)?function(t,e,i){switch(i){case t.UNSIGNED_BYTE:switch(e){case t.RGBA8:case t.RGB5_A1:case t.RGBA4:case t.SRGB8_ALPHA8:return t.RGBA;case t.RGBA8UI:return t.RGBA_INTEGER;case t.RGB8:case t.RGB565:case t.SRGB8:return t.RGB;case t.RGB8UI:return t.RGB_INTEGER;case t.RG8:return t.RG;case t.RG8UI:return t.RG_INTEGER;case t.R8:return t.RED;case t.R8UI:return t.RED_INTEGER;case t.RGBA:return t.RGBA;case t.RGB:return t.RGB;case t.LUMINANCE_ALPHA:return t.LUMINANCE_ALPHA;case t.LUMINANCE:return t.LUMINANCE;case t.ALPHA:return t.ALPHA}break;case t.BYTE:switch(e){case t.RGBA8_SNORM:return t.RGBA;case t.RGBA8I:return t.RGBA_INTEGER;case t.RGB8_SNORM:return t.RGB;case t.RGB8I:return t.RGB_INTEGER;case t.RG8_SNORM:return t.RG;case t.RG8I:return t.RG_INTEGER;case t.R8_SNORM:return t.RED;case t.R8I:return t.RED_INTEGER}break;case t.UNSIGNED_SHORT_4_4_4_4:switch(e){case t.RGBA4:case t.RGBA:return t.RGBA}break;case t.UNSIGNED_SHORT_5_5_5_1:switch(e){case t.RGB5_A1:case t.RGBA:return t.RGBA}break;case t.UNSIGNED_INT_2_10_10_10_REV:switch(e){case t.RGB10_A2:case t.RGB5_A1:return t.RGBA;case t.RGB10_A2UI:return t.RGBA_INTEGER}break;case t.HALF_FLOAT:switch(e){case t.RGBA16F:return t.RGBA;case t.RGB16F:case t.R11F_G11F_B10F:case t.RGB9_E5:return t.RGB;case t.RG16F:return t.RG;case t.R16F:return t.RED}break;case t.FLOAT:switch(e){case t.RGBA32F:case t.RGBA16F:return t.RGBA;case t.RGB32F:case t.RGB16F:case t.R11F_G11F_B10F:case t.RGB9_E5:return t.RGB;case t.RG32F:case t.RG16F:return t.RG;case t.R32F:case t.R16F:return t.RED;case t.DEPTH_COMPONENT32F:return t.DEPTH_COMPONENT}break;case t.UNSIGNED_SHORT:switch(e){case t.RGBA16UI:return t.RGBA_INTEGER;case t.RGB16UI:return t.RGB_INTEGER;case t.RG16UI:return t.RG_INTEGER;case t.R16UI:return t.RED_INTEGER;case t.DEPTH_COMPONENT16:return t.DEPTH_COMPONENT}break;case t.SHORT:switch(e){case t.RGBA16I:return t.RGBA_INTEGER;case t.RGB16I:return t.RGB_INTEGER;case t.RG16I:return t.RG_INTEGER;case t.R16I:return t.RED_INTEGER}break;case t.UNSIGNED_INT:switch(e){case t.RGBA32UI:return t.RGBA_INTEGER;case t.RGB32UI:return t.RGB_INTEGER;case t.RG32UI:return t.RG_INTEGER;case t.R32UI:return t.RED_INTEGER;case t.DEPTH_COMPONENT24:case t.DEPTH_COMPONENT16:return t.DEPTH_COMPONENT}break;case t.INT:switch(e){case t.RGBA32I:return t.RGBA_INTEGER;case t.RGB32I:return t.RGB_INTEGER;case t.RG32I:return t.RG_INTEGER;case t.R32I:return t.RED_INTEGER}break;case t.UNSIGNED_SHORT_5_6_5:switch(e){case t.RGB565:case t.RGB:return t.RGB}break;case t.UNSIGNED_INT_10F_11F_11F_REV:if(e===t.R11F_G11F_B10F)return t.RGB;break;case t.UNSIGNED_INT_5_9_9_9_REV:if(e===t.RGB9_E5)return t.RGB;break;case t.UNSIGNED_INT_24_8:if(e===t.DEPTH24_STENCIL8)return t.DEPTH_STENCIL;break;case t.FLOAT_32_UNSIGNED_INT_24_8_REV:if(e===t.DEPTH32F_STENCIL8)return t.DEPTH_STENCIL;break;default:throw"Unknown format in getWebGL2InternalFormat"}throw"Invalid combination of internal format and data type"}(e,t.format,t.type):t.format,s=void 0===t.row_alignment?4:t.row_alignment;var n;e.pixelStorei(e.UNPACK_ALIGNMENT,s),"width"in(n=t)&&"height"in n?e.texImage2D(e.TEXTURE_2D,0,t.format,t.width,t.height,0,i,t.type,t.image):e.texImage2D(e.TEXTURE_2D,0,t.format,i,t.type,t.image)}bindToProgram(t,e){this.activate(e),this.gl.uniform1i(t,e)}activate(t){this.tex_num=t,this.gl.activeTexture(this.gl.TEXTURE0+this.tex_num),this.gl.bindTexture(this.gl.TEXTURE_2D,this.texture)}deactivate(){null!==this.tex_num&&(this.gl.activeTexture(this.gl.TEXTURE0+this.tex_num),this.gl.bindTexture(this.gl.TEXTURE_2D,null),this.tex_num=null)}delete(){this.gl.deleteTexture(this.texture),this.tex_num=null}}function $(t,e){const i=void 0===(e=void 0===e?{}:e).define?[]:[...e.define],s=[],n={},r=t.split("\n").map(t=>{const e=t.match(/#define\s+([\w\d_]+)/i);null!==e&&i.push(e[1]);const r=t.match(/#ifdef\s+([\w\d_]+)/i);if(null!==r)return s.push(r[1]),n[r[1]]=!0,"";const o=t.match(/#ifndef\s+([\w\d_]+)/i);if(null!==o)return s.push(o[1]),n[o[1]]=!1,"";if(null!==t.match(/#else/i)){const t=s[s.length-1];return n[t]=!n[t],""}if(null!==t.match(/#endif/i)){const t=s.pop();return n[t]=void 0,""}return s.map(t=>i.includes(t)==n[t]).reduce((t,e)=>t&&e,!0)?t:""}).join("\n");if(s.length>0)throw"Unterminated #ifdef/#ifndef block in shader";return r}class H{constructor(t,e,i,s){const n=void 0===(s=void 0===s?{}:s).define?[]:s.define,r=void 0===s.tf_varyings?null:s.tf_varyings;e=$(e,{define:n}),i=$(i,{define:n}),this.gl=t,this.prog=((t,e,i,s)=>{const n=t.createShader(t.VERTEX_SHADER);if(null===n)throw"Could not create vertex shader";if(t.shaderSource(n,e),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS)){const e=t.getShaderInfoLog(n);console.log("Vertex shader compiler log: "+e)}const r=t.createShader(t.FRAGMENT_SHADER);if(null===r)throw"Could not create fragment shader";if(t.shaderSource(r,i),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS)){const e=t.getShaderInfoLog(r);console.log("Fragment shader compiler log: "+e)}const o=t.createProgram();if(null===o)throw"Could not create shader program";if(t.attachShader(o,n),t.attachShader(o,r),null!==s){if(!O(t))throw"Transform feedback only supported in WebGL2";t.transformFeedbackVaryings(o,s,t.INTERLEAVED_ATTRIBS)}if(t.linkProgram(o),!t.getProgramParameter(o,t.LINK_STATUS)){const e=t.getProgramInfoLog(o);console.log("Linker log: "+e)}return o})(t,e,i,r),this.attributes={},this.uniforms={},this.n_verts=null,this.draw_mode=null,this.index_buffer=null,this.sampler_names=[],this.instance_count=0;const o=t=>{const e=t.indexOf("//");return e>=0&&(t=t.slice(0,e)),t};e=e.split("\n").map(o).join("\n"),i=i.split("\n").map(o).join("\n");const a=O(this.gl);if(!a&&(e.includes("#version 300 es")||i.includes("#version 300 es")))throw"WebGL2 context required for shader source containing '#version 300 es'";let l=a?/\b(?:in|attribute)+([\w ]+?) +([\w_]+);[\s]*/gm:/attribute +([\w ]+?) +([\w_]+);[\s]*/gm;for(const i of e.matchAll(l)){const[e,s,n]=i;this.attributes[n]={type:s,location:t.getAttribLocation(this.prog,n)}}for(const i of e.matchAll(/uniform +([\w ]+?) +([\w_]+)(?:[\s]*\[.*\])?;[\s]*/gm)){const[e,s,n]=i,r=s.split(" "),o=t.getUniformLocation(this.prog,n);if(null===o)throw`Could not get vertex shader uniform location for '${n}'`;this.uniforms[n]={type:r[r.length-1],location:o}}for(const e of i.matchAll(/uniform +([\w ]+?) +([\w_]+)(?:[\s]*\[.*\])?;[\s]*/gm)){const[i,s,n]=e,r=s.split(" "),o=t.getUniformLocation(this.prog,n);if(null===o)throw`Could not get fragment shader uniform location for '${n}'`;this.uniforms[n]={type:r[r.length-1],location:o}}if(Object.entries(this.uniforms).forEach(([t,e])=>{e.type.toLowerCase().endsWith("sampler2d")&&this.sampler_names.push(t)}),O(this.gl))this.daiFunc=this.gl.drawArraysInstanced.bind(this.gl),this.deiFunc=this.gl.drawElementsInstanced.bind(this.gl);else{const t=this.gl.getExtension("ANGLE_instanced_arrays");this.daiFunc=t.drawArraysInstancedANGLE.bind(t),this.deiFunc=t.drawElementsInstancedANGLE.bind(t)}}use(t,e,i,s){this.gl.useProgram(this.prog),void 0!==s?(s.bind(),this.index_buffer=s):this.index_buffer=null,this.draw_mode=null,this.n_verts=null,this.instance_count=0,void 0!==t&&this.bindAttributes(t),void 0!==e&&this.setUniforms(e),void 0!==i&&this.bindTextures(i)}bindAttributes(t){Object.entries(t).forEach(([t,e])=>{if(void 0===this.attributes[t])return void console.warn(`Skipping attribute buffer provided for '${t}' because the attribute was not found in the program.`);if(this.draw_mode=null===this.draw_mode?e.draw_mode:this.draw_mode,e.is_per_instance){if(0==this.instance_count)this.instance_count=e.n_verts;else if(this.instance_count!=e.n_verts)throw`Unexpected number of instances for attribute buffer ${t} (expected ${this.instance_count}, got ${e.n_verts})`}else{if(this.n_verts=null===this.n_verts?e.n_verts:this.n_verts,this.n_verts!=e.n_verts)throw`Unexpected number of vertices for attribute buffer ${t} (expected ${this.n_verts}, got ${e.n_verts}).`;if(this.draw_mode!=e.draw_mode)throw`Unexpected draw mode for attribute buffer ${t} (expected ${this.draw_mode}, got ${e.draw_mode}).`}const{type:i,location:s}=this.attributes[t];e.bindToProgram(s)})}setUniforms(t){Object.entries(t).forEach(([t,e])=>{if(void 0===this.uniforms[t])return void console.warn(`Skipping uniform value provided for '${t}' because the uniform was not found in the program.`);const{type:i,location:s}=this.uniforms[t];if("int"===i&&"number"==typeof e)this.gl.uniform1i(s,e);else if("float"===i&&"number"==typeof e)this.gl.uniform1f(s,e);else if("float"===i&&e instanceof Array)this.gl.uniform1fv(s,e);else if("vec2"===i&&e instanceof Array)this.gl.uniform2fv(s,e);else if("vec3"===i&&e instanceof Array)this.gl.uniform3fv(s,e);else if("vec4"===i&&e instanceof Array)this.gl.uniform4fv(s,e);else{if(!("mat4"===i&&e instanceof Array))throw`Could not figure out uniform function for type '${i}' and value '${String(e)}'`;this.gl.uniformMatrix4fv(s,!1,e)}})}bindTextures(t){Object.entries(t).forEach(([t,e])=>{if(void 0===this.uniforms[t])return void console.warn(`Skipping texture provided for sampler '${t}' because the sampler was not found in the program.`);const i=this.sampler_names.indexOf(t),{type:s,location:n}=this.uniforms[t];e.bindToProgram(n,i)})}draw(){if(null===this.draw_mode||null===this.n_verts)throw"Cannot draw without binding attribute buffers";null===this.index_buffer?0==this.instance_count?this.gl.drawArrays(this.draw_mode,0,this.n_verts):this.daiFunc(this.draw_mode,0,this.n_verts,this.instance_count):0==this.instance_count?this.gl.drawElements(this.draw_mode,this.index_buffer.n_verts,this.index_buffer.dtype,0):this.deiFunc(this.draw_mode,this.index_buffer.n_verts,this.index_buffer.dtype,0,this.instance_count)}}class V{constructor(t,e){this.gl=t,this.framebuffer=e}clear(t){const e=this.gl;if(null===e)throw"Register WebGL drawing context using registerGLContext() first";e.clearColor(...t),e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer),e.clear(e.COLOR_BUFFER_BIT)}renderTo(t,e,i,s){const n=this.gl;if(null===n)throw"Register WebGL drawing context using registerGLContext() first";n.bindFramebuffer(n.FRAMEBUFFER,this.framebuffer),n.viewport(t,e,i,s)}copyToTexture(t,e,i,s,n){const r=this.gl;if(null===r)throw"Register WebGL drawing context using registerGLContext() first";r.bindFramebuffer(r.FRAMEBUFFER,this.framebuffer),t.activate(0),r.copyTexImage2D(r.TEXTURE_2D,0,t.spec.format,e,i,s,n,0)}}const q=new class extends V{constructor(){super(null,null)}registerGLContext(t){this.gl=t}};class W extends V{constructor(t,e){const i=t.createFramebuffer();if(null===i)throw"Could not create WebGL Framebuffer";super(t,i),this.texture=e,t.bindFramebuffer(t.FRAMEBUFFER,this.framebuffer),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e.texture,0)}static screen(t){return q.registerGLContext(t),q}}const X=JSON.parse('{"levels":[20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140],"colors":["#e6f4ff","#dbf0fe","#d1ebfe","#c6e7fd","#bce3fd","#b1dffc","#a7dbfc","#9cd6fb","#92d2fb","#87cefa","#84c2f6","#81b7f1","#7eabed","#7ba0e8","#7994e4","#7688df","#737ddb","#7071d6","#6d66d2","#6a5acd","#7660cf","#8366d0","#8f6cd2","#9c72d3","#a878d5","#b47ed6","#c184d8","#cd8ad9","#da90db","#e696dc","#e390d9","#e08ad6","#dd84d3","#da7ed0","#d778cd","#d472ca","#d16cc7","#ce66c4","#cb60c1","#c85abe","#c453ba","#c04cb6","#bc45b2","#b83eae","#b437aa","#b030a6","#ac29a2","#a8229e","#a41b9a","#a01496","#a41080","#a80e75","#ac0e75","#b00c6a","#b4085f","#b80649","#bc043e","#c00233","#c80028","#c80028","#ca042a","#cc082c","#d00c2c","#d21432","#d41834","#d41834","#d61c36","#da243a","#dc283c","#de2c3e","#e03040","#e23442","#e43844","#e63c46","#e84048","#ea444a","#ec484c","#ee4c4e","#f05050","#f16052","#f27054","#f38056","#f49058","#f5a05a","#f6b05c","#f7c05e","#f8d060","#f9e062","#faf064","#f7eb61","#f4e65e","#f1e15b","#eedc58","#ebd755","#e8d252","#e5cd4f","#e2c84c","#dfc349","#dcbe46","#d9b943","#d6b440","#d3af3d","#d0aa3a","#cda537","#caa034","#c79b31","#c4962e","#c1912b","#be8c28","#bb8725","#b88222","#b57d1f","#b2781c","#af7319","#ac6e16","#a96913","#a66410","#a35f0d","#a05a0a","#a05a0a"]}'),Z=JSON.parse('{"levels":[20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80],"colors":["#f0f8ff","#dbf0fe","#c6e7fd","#b1dffc","#9cd6fb","#87cefa","#81b7f1","#7ba0e8","#7688df","#7071d6","#6a5acd","#8366d0","#9c72d3","#b47ed6","#cd8ad9","#e696dc","#e08ad6","#da7ed0","#d472ca","#ce66c4","#c85abe","#c04cb6","#b83eae","#b030a6","#a8229e","#a01496","#a81080","#b00c6a","#b8043e","#c80028","#c80028","#d01030","#d41834","#d82038","#dc283c","#e03040","#e43844","#e84048","#ec484c","#f05050","#f27054","#f49058","#f6b05c","#f8d060","#faf064","#f4e65e","#eedc58","#e8d252","#e2c84c","#dcbe46","#d6b440","#d0aa3a","#caa034","#c4962e","#be8c28","#b88222","#b2781c","#ac6e16","#a66410","#a05a0a"]}'),K=JSON.parse('{"levels":[0,100,200,300,400,500,600,700,800,900,1000,1100,1200,1300,1400,1500,1600,1700,1800,1900,2000,2100,2200,2300,2400,2500,2600,2700,2800,2900,3000,3100,3200,3300,3400,3500,3600,3700,3800,3900,4000,4100,4200,4300,4400,4500,4600,4700,4800,4900,5000,5100,5200,5300,5400,5500,5600,5700,5800,5900,6000,6500,7000,7500,8000,8500,9000,9500,10000],"colors":["#ffffff","#f0f0f0","#e1e1e1","#d2d2d2","#c3c3c3","#a5a5a5","#969696","#878787","#787878","#696969","#37536a","#436075","#506d80","#5c7a8b","#698796","#7594a2","#82a1ad","#8eaeb8","#9bbbc3","#a7c8ce","#e9dd96","#e8d186","#e7c575","#e6b865","#e5ac54","#e5a044","#e49433","#e38723","#e27b12","#e16f02","#dc4110","#d33b17","#ca351e","#c12e25","#b8282c","#af2234","#a61c3b","#9d1542","#940f49","#8b0950","#73088a","#7e1894","#8a289f","#9538a9","#a148b3","#ac59be","#b869c8","#c379d2","#cf89dd","#da99e7","#e9bec3","#e3b0b7","#dda3ac","#d795a0","#d18894","#ca7a89","#c46d7d","#be5f71","#b85266","#b2445a","#893d48","#8f4752","#96525b","#9c5c65","#a2676f","#a97178","#af7c82","#b6868b"]}'),Y=JSON.parse('{"levels":[-60,-59,-58,-57,-56,-55,-54,-53,-52,-51,-50,-49,-48,-47,-46,-45,-44,-43,-42,-41,-40,-39,-38,-37,-36,-35,-34,-33,-32,-31,-30,-29,-28,-27,-26,-25,-24,-23,-22,-21,-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120],"colors":["#235877","#2a5f7c","#316782","#396e87","#40768c","#477d91","#4e8497","#558c9c","#5d93a1","#649ba6","#6ba2ac","#72a9b1","#79b1b6","#81b8bb","#88c0c1","#8fc7c6","#96cecb","#9dd6d0","#a5ddd6","#ace5db","#b3ece0","#b3ece0","#b1e7df","#b0e1dd","#aedcdc","#add7da","#abd2d9","#aaccd8","#a8c7d6","#a7c2d5","#a5bcd4","#a4b7d2","#a2b2d1","#9fa7ce","#9ea2cd","#9c9dcb","#9c9dcb","#9b97ca","#9992c8","#988dc7","#9688c6","#9582c4","#9278c2","#9073c0","#8f6dbf","#8d68bd","#8c63bc","#8a5dbb","#8958b9","#8753b8","#864eb6","#8448b5","#8343b4","#813eb2","#8038b1","#7e33b0","#7d33ae","#7b29ad","#7a23ab","#781eaa","#a037af","#a443b3","#a74fb7","#ab5cbb","#af68bf","#b374c3","#b680c7","#ba8dcc","#be99d0","#c1a5d4","#c5b1d8","#c9bddc","#cdcae0","#d0d6e4","#d4e2e8","#deecf2","#d1e2ee","#c5d9ea","#b8cfe6","#acc5e3","#9fbbdf","#92b2db","#86a8d7","#799ed3","#6c94cf","#608bcb","#5381c7","#4777c4","#3a6dc0","#2d64bc","#215ab8","#1450b4","#0f4455","#1c4e5a","#2a585f","#376363","#456d68","#52776d","#5f8172","#6d8c77","#7a967c","#88a080","#95aa85","#a3b58a","#b0bf8f","#bdc994","#cbd399","#d8de9d","#e6e8a2","#f3f2a7","#f8eea2","#f0e199","#e8d591","#e1c888","#d9bc80","#d1af77","#c9a36f","#c19666","#ba8a5e","#b27d55","#aa714d","#a26444","#9b583c","#8b3f2b","#833222","#7b261a","#7b261a","#741911","#6c0d09","#640000","#5f0000","#630507","#670a0e","#6c0f15","#70141c","#741824","#781d2b","#7d2232","#812739","#852c40","#73372d","#7a4036","#80493f","#875349","#8e5c52","#94655b","#9b6e64","#a88177","#af8a80","#b69389","#bd9c92","#c3a69c","#caafa5","#d1b8ae","#d7c1b7","#decac0","#e5d4ca","#ebddd3","#f2e6dc","#e8dfd6","#e0d7cf","#d8d0c8","#d0c8c0","#c8c0b9","#c0b9b2","#b7b1ab","#afa9a4","#a7a29c","#9f9a95","#97938e","#8f8b87","#878380","#7f7c78","#777471","#6f6c6a","#666563","#5e5d5c","#565554","#4e4e4d","#464646"]}'),J=JSON.parse('{"levels":[-40,-39,-38,-37,-36,-35,-34,-33,-32,-31,-30,-29,-28,-27,-26,-25,-24,-23,-22,-21,-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90],"colors":["#986d4d","#966c4c","#946b4c","#926a4b","#90694b","#8e684a","#8c664a","#8a6549","#886448","#866348","#846247","#826147","#806046","#7e5f46","#7c5e45","#7a5d44","#785b44","#765a43","#745943","#725842","#715742","#6f5641","#6d5540","#6b5440","#69533f","#67523f","#65503e","#634f3d","#614e3d","#5f4d3c","#5d4c3c","#5b4b3b","#594a3b","#57493a","#554839","#534739","#514538","#4f4438","#4d4337","#4b4237","#494136","#4d4334","#514738","#564c3c","#5a5041","#5e5545","#625949","#675e4d","#6b6251","#6f6755","#746b5a","#78705e","#7c7462","#807966","#857d6a","#89826f","#8d8673","#928b77","#968f7b","#9a947f","#9e9883","#a39d88","#a7a18c","#aba690","#afaa94","#b8b39c","#b8b39c","#bcb8a1","#c1bca5","#c9c5ad","#c9cab1","#d2ceb6","#d2ceb6","#d6d3ba","#dfdcc2","#e3e0c6","#e7e5ca","#ebe9cf","#f0eed3","#f4f2d7","#e6f5e6","#d7f0d7","#c8eac8","#b9e5b9","#aadfaa","#9bda9b","#8cd48c","#7dcf7d","#6ec96e","#5fc45f","#30ae30","#2ca32c","#279927","#238e23","#1e831e","#1a791a","#156e15","#116311","#0c590c","#084e08","#61a3af","#5896a0","#508992","#477b83","#3e6e74","#366166","#2d5457","#244648","#1c393a","#132c2b","#66669a","#605e94","#59568e","#534e88","#4d4682","#463e7c","#403676","#3a2e70","#33266a","#2d1e64","#724071","#784573","#7d4b75","#835076","#885678","#8e5b7a","#93617c","#99667d","#9e6c7f","#a47181"]}'),Q=JSON.parse('{"levels":[-15,-14.53608247,-14.07216495,-13.60824742,-13.1443299,-12.68041237,-12.21649485,-11.75257732,-11.28865979,-10.82474227,-10.36082474,-9.89690722,-9.43298969,-8.96907216,-8.50515464,-8.04123711,-7.57731959,-7.11340206,-6.64948454,-6.18556701,-5.72164948,-5.25773196,-4.79381443,-4.32989691,-3.86597938,-3.40206186,-2.93814433,-2.4742268,-2.01030928,-1.54639175,-1.08247423,-0.6185567,-0.15463918,0.30927835,0.77319588,1.2371134,1.70103093,2.16494845,2.62886598,3.09278351,3.55670103,4.02061856,4.48453608,4.94845361,5.41237113,5.87628866,6.34020619,6.80412371,7.26804124,7.73195876,8.19587629,8.65979381,9.12371134,9.58762887,10.05154639,10.51546392,10.97938144,11.44329897,11.90721649,12.37113402,12.83505155,13.29896907,13.7628866,14.22680412,14.69072165,15.15463918,15.6185567,16.08247423,16.54639175,17.01030928,17.4742268,17.93814433,18.40206186,18.86597938,19.32989691,19.79381443,20.25773196,20.72164948,21.18556701,21.64948454,22.11340206,22.57731959,23.04123711,23.50515464,23.96907216,24.43298969,24.89690722,25.36082474,25.82474227,26.28865979,26.75257732,27.21649485,27.68041237,28.1443299,28.60824742,29.07216495,29.53608247,30,30.46391753,30.92783505,31.39175258,31.8556701,32.31958763,32.78350515,33.24742268,33.71134021,34.17525773,34.63917526,35.10309278,35.56701031,36.03092784,36.49484536,36.95876289,37.42268041,37.88659794,38.35051546,38.81443299,39.27835052,39.74226804,40.20618557,40.67010309,41.13402062,41.59793814,42.06185567,42.5257732,42.98969072,43.45360825,43.91752577,44.3814433,44.84536082,45.30927835,45.77319588,46.2371134,46.70103093,47.16494845,47.62886598,48.09278351,48.55670103,49.02061856,49.48453608,49.94845361,50.41237113,50.87628866,51.34020619,51.80412371,52.26804124,52.73195876,53.19587629,53.65979381,54.12371134,54.58762887,55.05154639,55.51546392,55.97938144,56.44329897,56.90721649,57.37113402,57.83505155,58.29896907,58.7628866,59.22680412,59.69072165,60.15463918,60.6185567,61.08247423,61.54639175,62.01030928,62.4742268,62.93814433,63.40206186,63.86597938,64.32989691,64.79381443,65.25773196,65.72164948,66.18556701,66.64948454,67.11340206,67.57731959,68.04123711,68.50515464,68.96907216,69.43298969,69.89690722,70.36082474,70.82474227,71.28865979,71.75257732,72.21649485,72.68041237,73.1443299,73.60824742,74.07216495,74.53608247,75],"colors":["#959052","#979356","#9c9a60","#a09c64","#a3a067","#a8a570","#aaa875","#acac79","#b1b182","#b5b587","#b6b88c","#bcbd93","#bfc199","#c1c39c","#c1c39c","#c6caa5","#cacdaa","#cccfaf","#cfd1b3","#cccfb3","#c8ccb3","#c6c8b3","#bfc3b3","#bfc3b3","#bcc1b3","#b8bdb3","#b5bab3","#afb5b3","#acb3b3","#aaafb3","#a7aeb3","#a3aab3","#a0a8b3","#9ca5b3","#9aa1b3","#97a0b3","#939cb3","#909ab3","#939ab5","#8c95b3","#8791b1","#838eb1","#808caf","#7c89af","#7785ae","#7482ac","#7080aa","#6b7caa","#6275a8","#5e72a7","#5e72a7","#5b70a5","#566da3","#5269a3","#4f67a1","#4b64a1","#4660a0","#425d9e","#4260a1","#4467a5","#486eaa","#4975ae","#4d7cb1","#4f83b5","#508aba","#5491bf","#5699c3","#599ec6","#5ba5ca","#5daccf","#60b3d4","#62bad8","#64c1db","#67c8df","#69cfe4","#6ed6e8","#67d6d6","#60d6c4","#59d6b3","#52d6a1","#4bd690","#42d67e","#3bd66d","#34d65b","#11d418","#11d116","#0fcd16","#0fc816","#0fc316","#0fbf15","#0fbc15","#0fb613","#0eb313","#0eaf13","#0eaa13","#0ca511","#0ca111","#0c9e11","#0c9911","#0c950f","#0c900f","#0a8c0f","#0a870f","#0a830e","#0a800e","#0a7c0c","#0a770c","#08720c","#086e0c","#086b0a","#08660a","#08620a","#085d08","#1c6708","#317208","#467c08","#5b8707","#6e9107","#839c05","#97a805","#acb105","#c1bc05","#d6c603","#e9d103","#ffe200","#ffd800","#ffd300","#ffc800","#ffc300","#ffba00","#ffb500","#ffb000","#ffac00","#ffa700","#ff9e00","#ff9900","#ff9300","#ff8900","#ff8500","#ff7f00","#ff0000","#f70000","#f00000","#e90000","#e20000","#db0000","#d40000","#cd0000","#c60000","#bf0000","#b80000","#b10000","#aa0000","#a30000","#9a0000","#930000","#8c0000","#850000","#7e0000","#770000","#700000","#ffffff","#fff4ff","#ffe9ff","#ffdfff","#ffd4ff","#ffc8ff","#ffbdff","#ffb3ff","#ffa8ff","#ff9cff","#ff91ff","#ff75ff","#fb6bfd","#f960f9","#f656f6","#f24bf4","#ef3ff0","#ed36ef","#e92aeb","#e61fe8","#e416e6","#e10ae2","#b100ff","#ac00fb","#a300f6","#9a00f4","#9300ef","#8700e9","#8200e8","#7900e2","#7200dd","#6900db","#6200d6"]}'),tt=JSON.parse('{"levels":[164,164.75694444,165.51388889,166.27083333,167.02777778,167.78472222,168.54166667,169.29861111,170.05555556,170.8125,171.56944444,172.32638889,173.08333333,173.84027778,174.59722222,175.35416667,176.11111111,176.86805556,177.625,178.38194444,179.13888889,179.89583333,180.65277778,181.40972222,182.16666667,182.92361111,183.68055556,184.4375,185.19444444,185.95138889,186.70833333,187.46527778,188.22222222,188.97916667,189.73611111,190.49305556,191.25,192.00694444,192.76388889,193.52083333,194.27777778,195.03472222,195.79166667,196.54861111,197.30555556,198.0625,198.81944444,199.57638889,200.33333333,201.09027778,201.84722222,202.60416667,203.36111111,204.11805556,204.875,205.63194444,206.38888889,207.14583333,207.90277778,208.65972222,209.41666667,210.17361111,210.93055556,211.6875,212.44444444,213.20138889,213.95833333,214.71527778,215.47222222,216.22916667,216.98611111,217.74305556,218.5,219.25694444,220.01388889,220.77083333,221.52777778,222.28472222,223.04166667,223.79861111,224.55555556,225.3125,226.06944444,226.82638889,227.58333333,228.34027778,229.09722222,229.85416667,230.61111111,231.36805556,232.125,232.88194444,233.63888889,234.39583333,235.15277778,235.90972222,236.66666667,237.42361111,238.18055556,238.9375,239.69444444,240.45138889,241.20833333,241.96527778,242.72222222,243.47916667,244.23611111,244.99305556,245.75,246.50694444,247.26388889,248.02083333,248.77777778,249.53472222,250.29166667,251.04861111,251.80555556,252.5625,253.31944444,254.07638889,254.83333333,255.59027778,256.34722222,257.10416667,257.86111111,258.61805556,259.375,260.13194444,260.88888889,261.64583333,262.40277778,263.15972222,263.91666667,264.67361111,265.43055556,266.1875,266.94444444,267.70138889,268.45833333,269.21527778,269.97222222,270.72916667,271.48611111,272.24305556,273],"colors":["#ff0000","#ff0800","#ff0f00","#ff1800","#ff1f00","#ff2800","#ff2f00","#ff3800","#ff3f00","#ff4800","#ff4f00","#ff5901","#ff6001","#ff6901","#ff7001","#ff7901","#ff8901","#ff9001","#ff9901","#ffa101","#ffaa01","#ffb101","#ffba01","#ffc101","#ffca01","#ffd101","#ffda01","#ffe201","#ffe901","#fff201","#fffb03","#f6f208","#efeb0c","#e6e213","#ddda18","#d4d11d","#cdc823","#c4c128","#bcb82d","#b3af33","#aaa838","#a39e3d","#9a9744","#918e49","#89854f","#827e54","#797559","#706d5e","#676464","#605d69","#56546e","#4f4b75","#464279","#3d3b7e","#363385","#2d2a89","#242190","#1c1a95","#13119a","#0c08a0","#0300a5","#0f0caa","#1c18ae","#2826b3","#3433b6","#423fbc","#4d4bbf","#5b59c4","#6766c8","#7472cd","#807ed1","#8c8cd6","#9a99db","#a5a5df","#b3b1e4","#bfbfe8","#cccced","#d8d8f0","#e4e4f6","#f2f2f9","#ffffff","#f6f9f6","#edf4ed","#e2efe2","#dae9da","#cfe4cf","#c6dfc6","#bdd8bd","#b3d4b3","#aacdaa","#a1c8a1","#97c397","#8ebd8e","#85b885","#7cb37c","#72ac72","#69a869","#60a160","#569c56","#4d974d","#429142","#3a8c3a","#318731","#268026","#1d7c1d","#137513","#0a700a","#016b01","#016e07","#01720e","#017515","#01791c","#017e23","#01822a","#018531","#018936","#018e3d","#019044","#01954b","#019952","#019c59","#01a160","#01a567","#01a86e","#01ac75","#01b17c","#03b382","#03b889","#03bc90","#03bf97","#03c39e","#03c8a5","#03ccac","#03cfb3","#03d4ba","#03d6c1","#03dbc8","#03dfcd","#03e2d4","#03e6db","#03ebe2","#03efe9","#03f2f0","#03f6f7"]}'),et="This constructor is not a subclass of Float16Array",it="The constructor property value is not an object",st="Attempting to access detached ArrayBuffer",nt="Cannot convert undefined or null to object",rt="Cannot mix BigInt and other types, use explicit conversions",ot="@@iterator property is not callable",at="Reduce of empty array with no initial value",lt="Offset is out of bounds";function ht(t){return(e,...i)=>ft(t,e,i)}function ct(t,e){return ht(pt(t,e).get)}const{apply:ft,construct:ut,defineProperty:_t,get:dt,getOwnPropertyDescriptor:pt,getPrototypeOf:mt,has:gt,ownKeys:bt,set:vt,setPrototypeOf:wt}=Reflect,yt=Proxy,{EPSILON:xt,MAX_SAFE_INTEGER:At,isFinite:Et,isNaN:Mt}=Number,{iterator:St,species:Tt,toStringTag:Ct,for:Nt}=Symbol,Rt=Object,{create:Gt,defineProperty:It,freeze:Dt,is:Bt}=Rt,Pt=Rt.prototype,Ft=Pt.__lookupGetter__?ht(Pt.__lookupGetter__):(t,e)=>{if(null==t)throw Ne(nt);let i=Rt(t);do{const t=pt(i,e);if(void 0!==t)return Lt(t,"get")?t.get:void 0}while(null!==(i=mt(i)))},Lt=Rt.hasOwn||ht(Pt.hasOwnProperty),zt=Array,Ot=zt.isArray,Ut=zt.prototype,kt=ht(Ut.join),jt=ht(Ut.push),$t=ht(Ut.toLocaleString),Ht=Ut[St],Vt=ht(Ht),{abs:qt,trunc:Wt}=Math,Xt=ArrayBuffer,Zt=Xt.isView,Kt=Xt.prototype,Yt=ht(Kt.slice),Jt=ct(Kt,"byteLength"),Qt="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:null,te=Qt&&ct(Qt.prototype,"byteLength"),ee=mt(Uint8Array),ie=ee.from,se=ee.prototype,ne=se[St],re=ht(se.keys),oe=ht(se.values),ae=ht(se.entries),le=ht(se.set),he=ht(se.reverse),ce=ht(se.fill),fe=ht(se.copyWithin),ue=ht(se.sort),_e=ht(se.slice),de=ht(se.subarray),pe=ct(se,"buffer"),me=ct(se,"byteOffset"),ge=ct(se,"length"),be=ct(se,Ct),ve=Uint8Array,we=Uint16Array,ye=(...t)=>ft(ie,we,t),xe=Uint32Array,Ae=Float32Array,Ee=mt([][St]()),Me=ht(Ee.next),Se=ht(function*(){}().next),Te=mt(Ee),Ce=DataView.prototype,Ne=(ht(Ce.getUint16),ht(Ce.setUint16),TypeError),Re=RangeError,Ge=WeakSet,Ie=Ge.prototype,De=ht(Ie.add),Be=ht(Ie.has),Pe=WeakMap,Fe=Pe.prototype,Le=ht(Fe.get),ze=ht(Fe.has),Oe=ht(Fe.set),Ue=new Pe,ke=Gt(null,{next:{value:function(){const t=Le(Ue,this);return Me(t)}},[St]:{value:function(){return this}}});function je(t){if(t[St]===Ht&&Ee.next===Me)return t;const e=Gt(ke);return Oe(Ue,e,Vt(t)),e}const $e=new Pe,He=Gt(Te,{next:{value:function(){const t=Le($e,this);return Se(t)},writable:!0,configurable:!0}});for(const t of bt(Ee))"next"!==t&&It(He,t,pt(Ee,t));function Ve(t){const e=Gt(He);return Oe($e,e,t),e}function qe(t){return null!==t&&"object"==typeof t||"function"==typeof t}function We(t){return null!==t&&"object"==typeof t}function Xe(t){return void 0!==be(t)}function Ze(t){const e=be(t);return"BigInt64Array"===e||"BigUint64Array"===e}function Ke(t){if(null===Qt)return!1;try{return te(t),!0}catch(t){return!1}}function Ye(t){return!!Ot(t)&&t[St]===Ht&&Ee.next===Me}function Je(t){if("string"!=typeof t)return!1;const e=+t;return t===e+""&&!!Et(e)&&e===Wt(e)}const Qe=Nt("__Float16Array__"),ti=1/xt,ei=5.960464477539063e-8,ii=.0009765625*ti;const si=new Xt(4),ni=new Ae(si),ri=new xe(si),oi=new we(512),ai=new ve(512);for(let t=0;t<256;++t){const e=t-127;e<-27?(oi[t]=0,oi[256|t]=32768,ai[t]=24,ai[256|t]=24):e<-14?(oi[t]=1024>>-e-14,oi[256|t]=1024>>-e-14|32768,ai[t]=-e-1,ai[256|t]=-e-1):e<=15?(oi[t]=e+15<<10,oi[256|t]=e+15<<10|32768,ai[t]=13,ai[256|t]=13):e<128?(oi[t]=31744,oi[256|t]=64512,ai[t]=24,ai[256|t]=24):(oi[t]=31744,oi[256|t]=64512,ai[t]=13,ai[256|t]=13)}function li(t){ni[0]=function(t){const e=+t;if(!Et(e)||0===e)return e;const i=e>0?1:-1,s=qt(e);if(s<6103515625e-14)return i*function(t){return t+ti-ti}(s/ei)*ei;const n=(1+ii)*s,r=n-(n-s);return r>65504||Mt(r)?i*(1/0):i*r}(t);const e=ri[0],i=e>>23&511;return oi[i]+((8388607&e)>>ai[i])}const hi=new xe(2048);for(let t=1;t<1024;++t){let e=t<<13,i=0;for(;!(8388608&e);)e<<=1,i-=8388608;e&=-8388609,i+=947912704,hi[t]=e|i}for(let t=1024;t<2048;++t)hi[t]=939524096+(t-1024<<13);const ci=new xe(64);for(let t=1;t<31;++t)ci[t]=t<<23;ci[31]=1199570944,ci[32]=2147483648;for(let t=33;t<63;++t)ci[t]=2147483648+(t-32<<23);ci[63]=3347054592;const fi=new we(64);for(let t=1;t<64;++t)32!==t&&(fi[t]=1024);function ui(t){const e=t>>10;return ri[0]=hi[fi[e]+(1023&t)]+ci[e],ni[0]}function _i(t){const e=+t;return Mt(e)||0===e?0:Wt(e)}function di(t){const e=_i(t);return e<0?0:e<At?e:At}function pi(t,e){if(!qe(t))throw Ne("This is not an object");const i=t.constructor;if(void 0===i)return e;if(!qe(i))throw Ne(it);const s=i[Tt];return null==s?e:s}function mi(t){if(Ke(t))return!1;try{return Yt(t,0,0),!1}catch(t){}return!0}function gi(t,e){const i=Mt(t),s=Mt(e);if(i&&s)return 0;if(i)return 1;if(s)return-1;if(t<e)return-1;if(t>e)return 1;if(0===t&&0===e){const i=Bt(t,0),s=Bt(e,0);if(!i&&s)return-1;if(i&&!s)return 1}return 0}const bi=new Pe;function vi(t){return ze(bi,t)||!Zt(t)&&function(t){if(!We(t))return!1;const e=mt(t);if(!We(e))return!1;const i=e.constructor;if(void 0===i)return!1;if(!qe(i))throw Ne(it);return gt(i,Qe)}(t)}function wi(t){if(!vi(t))throw Ne("This is not a Float16Array object")}function yi(t,e){const i=vi(t),s=Xe(t);if(!i&&!s)throw Ne("Species constructor didn't return TypedArray object");if("number"==typeof e){let s;if(i){const e=xi(t);s=ge(e)}else s=ge(t);if(s<e)throw Ne("Derived constructor created TypedArray object which was too small length")}if(Ze(t))throw Ne(rt)}function xi(t){const e=Le(bi,t);if(void 0!==e){if(mi(pe(e)))throw Ne(st);return e}const i=t.buffer;if(mi(i))throw Ne(st);const s=ut(Si,[i,t.byteOffset,t.length],t.constructor);return Le(bi,s)}function Ai(t){const e=ge(t),i=[];for(let s=0;s<e;++s)i[s]=ui(t[s]);return i}const Ei=new Ge;for(const t of bt(se)){if(t===Ct)continue;const e=pt(se,t);Lt(e,"get")&&"function"==typeof e.get&&De(Ei,e.get)}const Mi=Dt({get:(t,e,i)=>Je(e)&&Lt(t,e)?ui(dt(t,e)):Be(Ei,Ft(t,e))?dt(t,e):dt(t,e,i),set:(t,e,i,s)=>Je(e)&&Lt(t,e)?vt(t,e,li(i)):vt(t,e,i,s),getOwnPropertyDescriptor(t,e){if(Je(e)&&Lt(t,e)){const i=pt(t,e);return i.value=ui(i.value),i}return pt(t,e)},defineProperty:(t,e,i)=>Je(e)&&Lt(t,e)&&Lt(i,"value")?(i.value=li(i.value),_t(t,e,i)):_t(t,e,i)});class Si{constructor(t,e,i){let s;if(vi(t))s=ut(we,[xi(t)],new.target);else if(!qe(t)||(function(t){try{return Jt(t),!0}catch(t){return!1}}(n=t)||Ke(n)))s=ut(we,arguments,new.target);else{let e,i;if(Xe(t)){if(e=t,i=ge(t),mi(pe(t)))throw Ne(st);if(Ze(t))throw Ne(rt);const n=new Xt(2*i);s=ut(we,[n],new.target)}else{const n=t[St];if(null!=n&&"function"!=typeof n)throw Ne(ot);null!=n?Ye(t)?(e=t,i=t.length):(e=[...t],i=e.length):(e=t,i=di(e.length)),s=ut(we,[i],new.target)}for(let t=0;t<i;++t)s[t]=li(e[t])}var n;const r=new yt(s,Mi);return Oe(bi,r,s),r}static from(t,...e){const i=this;if(!gt(i,Qe))throw Ne(et);if(i===Si){if(vi(t)&&0===e.length){const e=xi(t),i=new we(pe(e),me(e),ge(e));return new Si(pe(_e(i)))}if(0===e.length)return new Si(pe(ye(t,li)));const i=e[0],s=e[1];return new Si(pe(ye(t,function(t,...e){return li(ft(i,this,[t,...je(e)]))},s)))}let s,n;const r=t[St];if(null!=r&&"function"!=typeof r)throw Ne(ot);if(null!=r)Ye(t)?(s=t,n=t.length):Xe(o=t)&&o[St]===ne&&Ee.next===Me?(s=t,n=ge(t)):(s=[...t],n=s.length);else{if(null==t)throw Ne(nt);s=Rt(t),n=di(s.length)}var o;const a=new i(n);if(0===e.length)for(let t=0;t<n;++t)a[t]=s[t];else{const t=e[0],i=e[1];for(let e=0;e<n;++e)a[e]=ft(t,i,[s[e],e])}return a}static of(...t){const e=this;if(!gt(e,Qe))throw Ne(et);const i=t.length;if(e===Si){const e=new Si(i),s=xi(e);for(let e=0;e<i;++e)s[e]=li(t[e]);return e}const s=new e(i);for(let e=0;e<i;++e)s[e]=t[e];return s}keys(){wi(this);const t=xi(this);return re(t)}values(){wi(this);const t=xi(this);return Ve(function*(){for(const e of oe(t))yield ui(e)}())}entries(){wi(this);const t=xi(this);return Ve(function*(){for(const[e,i]of ae(t))yield[e,ui(i)]}())}at(t){wi(this);const e=xi(this),i=ge(e),s=_i(t),n=s>=0?s:i+s;if(!(n<0||n>=i))return ui(e[n])}with(t,e){wi(this);const i=xi(this),s=ge(i),n=_i(t),r=n>=0?n:s+n,o=+e;if(r<0||r>=s)throw Re(lt);const a=new we(pe(i),me(i),ge(i)),l=new Si(pe(_e(a)));return xi(l)[r]=li(o),l}map(t,...e){wi(this);const i=xi(this),s=ge(i),n=e[0],r=pi(i,Si);if(r===Si){const e=new Si(s),r=xi(e);for(let e=0;e<s;++e){const s=ui(i[e]);r[e]=li(ft(t,n,[s,e,this]))}return e}const o=new r(s);yi(o,s);for(let e=0;e<s;++e){const s=ui(i[e]);o[e]=ft(t,n,[s,e,this])}return o}filter(t,...e){wi(this);const i=xi(this),s=ge(i),n=e[0],r=[];for(let e=0;e<s;++e){const s=ui(i[e]);ft(t,n,[s,e,this])&&jt(r,s)}const o=new(pi(i,Si))(r);return yi(o),o}reduce(t,...e){wi(this);const i=xi(this),s=ge(i);if(0===s&&0===e.length)throw Ne(at);let n,r;0===e.length?(n=ui(i[0]),r=1):(n=e[0],r=0);for(let e=r;e<s;++e)n=t(n,ui(i[e]),e,this);return n}reduceRight(t,...e){wi(this);const i=xi(this),s=ge(i);if(0===s&&0===e.length)throw Ne(at);let n,r;0===e.length?(n=ui(i[s-1]),r=s-2):(n=e[0],r=s-1);for(let e=r;e>=0;--e)n=t(n,ui(i[e]),e,this);return n}forEach(t,...e){wi(this);const i=xi(this),s=ge(i),n=e[0];for(let e=0;e<s;++e)ft(t,n,[ui(i[e]),e,this])}find(t,...e){wi(this);const i=xi(this),s=ge(i),n=e[0];for(let e=0;e<s;++e){const s=ui(i[e]);if(ft(t,n,[s,e,this]))return s}}findIndex(t,...e){wi(this);const i=xi(this),s=ge(i),n=e[0];for(let e=0;e<s;++e){const s=ui(i[e]);if(ft(t,n,[s,e,this]))return e}return-1}findLast(t,...e){wi(this);const i=xi(this),s=ge(i),n=e[0];for(let e=s-1;e>=0;--e){const s=ui(i[e]);if(ft(t,n,[s,e,this]))return s}}findLastIndex(t,...e){wi(this);const i=xi(this),s=ge(i),n=e[0];for(let e=s-1;e>=0;--e){const s=ui(i[e]);if(ft(t,n,[s,e,this]))return e}return-1}every(t,...e){wi(this);const i=xi(this),s=ge(i),n=e[0];for(let e=0;e<s;++e)if(!ft(t,n,[ui(i[e]),e,this]))return!1;return!0}some(t,...e){wi(this);const i=xi(this),s=ge(i),n=e[0];for(let e=0;e<s;++e)if(ft(t,n,[ui(i[e]),e,this]))return!0;return!1}set(t,...e){wi(this);const i=xi(this),s=_i(e[0]);if(s<0)throw Re(lt);if(null==t)throw Ne(nt);if(Ze(t))throw Ne(rt);if(vi(t))return le(xi(this),xi(t),s);if(Xe(t)&&mi(pe(t)))throw Ne(st);const n=ge(i),r=Rt(t),o=di(r.length);if(s===1/0||o+s>n)throw Re(lt);for(let t=0;t<o;++t)i[t+s]=li(r[t])}reverse(){wi(this);const t=xi(this);return he(t),this}toReversed(){wi(this);const t=xi(this),e=new we(pe(t),me(t),ge(t)),i=new Si(pe(_e(e))),s=xi(i);return he(s),i}fill(t,...e){wi(this);const i=xi(this);return ce(i,li(t),...je(e)),this}copyWithin(t,e,...i){wi(this);const s=xi(this);return fe(s,t,e,...je(i)),this}sort(t){wi(this);const e=xi(this),i=void 0!==t?t:gi;return ue(e,(t,e)=>i(ui(t),ui(e))),this}toSorted(t){wi(this);const e=xi(this);if(void 0!==t&&"function"!=typeof t)throw new Ne("The comparison function must be either a function or undefined");const i=void 0!==t?t:gi,s=new we(pe(e),me(e),ge(e)),n=new Si(pe(_e(s))),r=xi(n);return ue(r,(t,e)=>i(ui(t),ui(e))),n}slice(t,e){wi(this);const i=xi(this),s=pi(i,Si);if(s===Si){const s=new we(pe(i),me(i),ge(i));return new Si(pe(_e(s,t,e)))}const n=ge(i),r=_i(t),o=void 0===e?n:_i(e);let a,l;a=r===-1/0?0:r<0?n+r>0?n+r:0:n<r?n:r,l=o===-1/0?0:o<0?n+o>0?n+o:0:n<o?n:o;const h=l-a>0?l-a:0,c=new s(h);if(yi(c,h),0===h)return c;if(mi(pe(i)))throw Ne(st);let f=0;for(;a<l;)c[f]=ui(i[a]),++a,++f;return c}subarray(t,e){wi(this);const i=xi(this),s=pi(i,Si),n=new we(pe(i),me(i),ge(i)),r=de(n,t,e),o=new s(pe(r),me(r),ge(r));return yi(o),o}indexOf(t,...e){wi(this);const i=xi(this),s=ge(i);let n=_i(e[0]);if(n===1/0)return-1;n<0&&(n+=s,n<0&&(n=0));for(let e=n;e<s;++e)if(Lt(i,e)&&ui(i[e])===t)return e;return-1}lastIndexOf(t,...e){wi(this);const i=xi(this),s=ge(i);let n=e.length>=1?_i(e[0]):s-1;if(n===-1/0)return-1;n>=0?n=n<s-1?n:s-1:n+=s;for(let e=n;e>=0;--e)if(Lt(i,e)&&ui(i[e])===t)return e;return-1}includes(t,...e){wi(this);const i=xi(this),s=ge(i);let n=_i(e[0]);if(n===1/0)return!1;n<0&&(n+=s,n<0&&(n=0));const r=Mt(t);for(let e=n;e<s;++e){const s=ui(i[e]);if(r&&Mt(s))return!0;if(s===t)return!0}return!1}join(t){wi(this);const e=Ai(xi(this));return kt(e,t)}toLocaleString(...t){wi(this);const e=Ai(xi(this));return $t(e,...je(t))}get[Ct](){if(vi(this))return"Float16Array"}}It(Si,"BYTES_PER_ELEMENT",{value:2}),It(Si,Qe,{}),wt(Si,ee);const Ti=Si.prototype;It(Ti,"BYTES_PER_ELEMENT",{value:2}),It(Ti,St,{value:Ti.values,writable:!0,configurable:!0}),wt(Ti,se);class Ci{constructor(t){this.rgba=t}get r(){return this.rgba[0]}get g(){return this.rgba[1]}get b(){return this.rgba[2]}get a(){return this.rgba[3]}withOpacity(t){return new Ci([this.r,this.g,this.b,t])}toRGBHex(){return this.toRGBAHex().slice(0,-2)}toRGBAHex(){return((t,e)=>{let i=this.rgba;return"float"==(e=void 0===e?"float":e)&&(i=i.map(t=>Math.round(255*t))),"#"+i.map(t=>t.toString(16).padStart(2,"0").toUpperCase()).join("")})()}toRGBATuple(){return this.rgba}toHSVTuple(){return(t=>{const[e,i,s]=t,n=Math.max(e,i,s),r=n-Math.min(e,i,s);let o;if(0==r)o=0;else if(n==e)o=(i-s)/r*60%6;else if(n==i)o=60*((s-e)/r+2);else{if(n!=s)throw"You've messed something up in rgb2hsv()";o=60*((e-i)/r+4)}return[o,0==n?0:r/n,n]})([this.r,this.g,this.b])}static fromHex(t){return new Ci(((t,e)=>{e=void 0===e?"float":e;const i=t.match(/#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?/i);if(null===i)throw`Got '${t}' in hex2rgba, which does not look like a hex color`;let s=i.slice(1).filter(t=>void 0!==t).map(t=>parseInt(t,16));return"float"==e&&(s=s.map(t=>t/255)),void 0===s[3]?[s[0],s[1],s[2],1]:[s[0],s[1],s[2],s[3]]})(t))}static fromHSVTuple(t){const e=(t=>{const[e,i,s]=t,n=s*i,r=n*(1-Math.abs(e/60%2-1)),o=s-n;let a,l,h;if(0<=e&&e<60)a=n,l=r,h=0;else if(60<=e&&e<120)a=r,l=n,h=0;else if(120<=e&&e<180)a=0,l=n,h=r;else if(180<=e&&e<240)a=0,l=r,h=n;else if(240<=e&&e<300)a=r,l=0,h=n;else{if(!(300<=e&&e<360))throw"H is out of bounds in hsv2rgb";a=n,l=0,h=r}return[a+o,l+o,h+o]})(t);return new Ci([e[0],e[1],e[2],1])}static normalizeColor(t){return t instanceof Ci?t:Ci.fromHex(t)}}const Ni=i(374);class Ri{constructor(t,e,i){if(t.length!=e.length+1)throw`Mismatch between number of levels (${t.length}) and number of colors (${e.length}; expected ${t.length-1})`;this.levels=t,this.colors=e.map(t=>Ci.normalizeColor(t)),i=void 0===i?{}:i,this.overflow_color=void 0===i.overflow_color?null:Ci.normalizeColor(i.overflow_color),this.underflow_color=void 0===i.underflow_color?null:Ci.normalizeColor(i.underflow_color)}getColors(){return this.colors.map(t=>t.toRGBHex())}getOpacities(){return this.colors.map(t=>t.a)}getColor(t){if(t<this.levels[0])return null===this.underflow_color?"#00000000":this.underflow_color.toRGBAHex();if(t>this.levels[this.levels.length-1])return null===this.overflow_color?"#00000000":this.overflow_color.toRGBAHex();let e=-1;for(e=0;e<this.levels.length-1&&!(this.levels[e]<=t&&t<this.levels[e+1]);e++);return this.colors[Math.min(e,this.levels.length-2)].toRGBAHex()}withOpacity(t){const e=[],i=[],s={};for(let s=0;s<this.colors.length;s++){const n=this.colors[s],r=this.levels[s],o=this.levels[s+1],a=t(r,o),l=n.withOpacity(a);a>0&&(i[i.length-1]!=r&&i.push(r),i.push(o),e.push(l))}if(null!==this.underflow_color){const e=t(this.levels[0],this.levels[0]);e>0&&(s.underflow_color=this.underflow_color.withOpacity(e))}if(null!==this.overflow_color){const e=t(this.levels[this.levels.length-1],this.levels[this.levels.length-1]);e>0&&(s.overflow_color=this.overflow_color.withOpacity(e))}return new Ri(i,e,s)}static diverging(t,e,i,s,n){const r=[],o=[],a=(s-i)/(n-1),l=(s+i)/2,h=[0,0,.9],c=Ci.fromHex(t).toHSVTuple(),f=Ci.fromHex(e).toHSVTuple();for(let t=0;t<n;t++){const e=i+t*a;let n,o,u,_;e<l?(_=Math.pow((l-e)/(l-i),1.5),[n,o,u]=[c[0],h[1]+(c[1]-h[1])*_,h[2]+(c[2]-h[2])*_]):(_=Math.pow((e-l)/(s-l),1.5),[n,o,u]=[f[0],h[1]+(f[1]-h[1])*_,h[2]+(f[2]-h[2])*_]),r.push(Ci.fromHSVTuple([n,o,u]).withOpacity(Math.min(2*_,1)))}for(let t=0;t<=n;t++){const e=(s-i)/n;o.push(i+t*e)}return new Ri(o,r)}}function Gi(t,e){const i=t.colors.length,s={};return"over"!=e&&"both"!=e||(s.overflow_color=t.colors[i-1]),"under"!=e&&"both"!=e||(s.underflow_color=t.colors[0]),new Ri(t.levels,t.colors,s)}tt.colors=tt.colors.reverse();const Ii=Gi(X,"over").withOpacity((t,e)=>Math.min((e-20)/10,1)),Di=Gi(Z,"over").withOpacity((t,e)=>Math.min((e-20)/10,1)),Bi=Gi(K,"over").withOpacity((t,e)=>Math.min(e/1e3,1)),Pi=Gi(Y,"both"),Fi=Gi(J,"both"),Li=Gi(Q,"over"),zi=Gi(tt,"neither");class Oi{constructor(t){this.colormap=t,this.gl_elems=null}static applyShader(t){return x(Ni,t)}setupShaderVariables(t,e){const i=function(t){const e=[];for(let t=0;t<101;t++)e.push(t/100);const i=t.levels,s=i.length-1,n=i.map((t,e)=>e/s),r=i.map(t=>(t-i[0])/(i[s]-i[0])),o=e.map(t=>{let e;for(e=0;!(r[e]<=t&&t<=r[e+1]);e++);const i=(t-r[e])/(r[e+1]-r[e]);return n[e]*(1-i)+n[e+1]*i});return new Si(o)}(this.colormap),s=function(t){const e=document.createElement("canvas");e.width=t.colors.length,e.height=1;let i=e.getContext("2d");return t.colors.forEach((t,e)=>{if(null===i)throw"Could not get rendering context for colormap image canvas";i.fillStyle=t.toRGBAHex(),i.fillRect(e,0,1,1)}),e}(this.colormap),{format:n,type:r,row_alignment:o}=P(t,"float16"),a={format:t.RGBA,type:t.UNSIGNED_BYTE,image:s,mag_filter:e},l=new j(t,a),h={format:n,type:r,width:i.length,height:1,image:new Uint16Array(i.buffer),mag_filter:t.LINEAR,row_alignment:o},c=new j(t,h);this.gl_elems={cmap_texture:l,cmap_nonlin_texture:c}}bindShaderVariables(t){if(null===this.gl_elems)return;const e=this.colormap,i=null===e.underflow_color?[0,0,0,0]:e.underflow_color.toRGBATuple(),s=null===e.overflow_color?[0,0,0,0]:e.overflow_color.toRGBATuple();t.setUniforms({u_cmap_min:e.levels[0],u_cmap_max:e.levels[e.levels.length-1],u_n_index:101,u_underflow_color:i,u_overflow_color:s}),t.bindTextures({u_cmap_sampler:this.gl_elems.cmap_texture,u_cmap_nonlin_sampler:this.gl_elems.cmap_nonlin_texture})}}class Ui{constructor(t,e,i){this.vertex_shader_src=t,this.fragment_shader_src=e,this.shader_defines=i,this.program_map=new Map}getShaderProgram(t,e){const i=null===e?"default":e.variantName,s=this.program_map.get(i);if(void 0!==s)return s;let n=this.vertex_shader_src;n=x(null!==e?e.vertexShaderPrelude+"\n"+e.define:"\n uniform mat4 u_projection_matrix;\n\n vec4 projectTile(vec2 p) {\n vec4 result = u_projection_matrix * vec4(p, 0.0, 1.0);\n return result;\n }",n);const r=new H(t,n,this.fragment_shader_src,{define:this.shader_defines});return this.program_map.set(i,r),r}getShaderUniforms(t){return"maplibre"==t.type?t.shaderData.define.includes("GLOBE")?{u_projection_matrix:t.defaultProjectionData.mainMatrix,u_projection_fallback_matrix:t.defaultProjectionData.fallbackMatrix,u_projection_tile_mercator_coords:t.defaultProjectionData.tileMercatorCoords,u_projection_clipping_plane:t.defaultProjectionData.clippingPlane,u_projection_transition:t.defaultProjectionData.projectionTransition}:{u_projection_matrix:t.defaultProjectionData.mainMatrix}:{u_projection_matrix:t.mainMatrix}}}const ki=i(840),ji=i(934),$i={"-":[1],"--":[1,1,1,1,0,0],":":[1,0],"-.":[1,1,1,0,1,0]};class Hi{constructor(t,e,i){const s=void 0===(i=void 0===i?{}:i).color?"#000000":i.color;this.color=Ci.fromHex(s);const n=void 0===i.line_width?1:i.line_width,r=void 0===i.line_style?"-":i.line_style;this.offset_rotates_with_map=void 0===i.offset_rotates_with_map||i.offset_rotates_with_map,this.width=n;const o=[];this.vertices=new k(t,e.vertices,3,t.TRIANGLE_STRIP),this.extrusion=new k(t,e.extrusion,2,t.TRIANGLE_STRIP),void 0!==e.offsets?(this.offset=new k(t,e.offsets,2,t.TRIANGLE_STRIP),this.scale=void 0===i.offset_scale?1:i.offset_scale,o.push("OFFSET")):(this.offset=null,this.scale=null),void 0!==e.zoom?(this.min_zoom=new k(t,e.zoom,1,t.TRIANGLE_STRIP),o.push("ZOOM")):this.min_zoom=null;let a=ji;if(void 0!==e.data){o.push("DATA"),this.line_data=new k(t,e.data,1,t.TRIANGLE_STRIP);const n=void 0===i.cmap?new Ri([0,1],[s],{overflow_color:s,underflow_color:s}):i.cmap;this.cmap_gpu=new Oi(n),this.cmap_gpu.setupShaderVariables(t,t.NEAREST),a=Oi.applyShader(a)}else this.line_data=null,this.cmap_gpu=null;[this.n_dash,this.dash_texture]=function(t,e){const i=Array.isArray(e)?e:$i[e],s={format:S(t)?t.R8:t.LUMINANCE,type:t.UNSIGNED_BYTE,width:i.length,height:1,image:new Uint8Array(i.map(t=>t>0?255:0)),mag_filter:t.NEAREST,row_alignment:1};return[i.length,new j(t,s)]}(t,r),this.shader_manager=new Ui(ki,a,o)}static async make(t,e,i){const s=await G.makePolyLines(e);return new Hi(t,s,i)}render(t,e,[i,s],n,r,o){const a=T(e),l=this.shader_manager.getShaderProgram(t,a.shaderData),h={a_pos:this.vertices,a_extrusion:this.extrusion},c={u_line_width:this.width,u_map_width:i,u_map_height:s,u_offset:0,u_zoom:n,u_dash_pattern_length:this.n_dash,...this.shader_manager.getShaderUniforms(a)},f={u_dash_sampler:this.dash_texture};null!==this.offset&&null!==this.scale&&(h.a_offset=this.offset,c.u_offset_scale=this.scale*(s/i),c.u_offset_rotates_with_map=this.offset_rotates_with_map?1:0),null!==this.min_zoom&&(h.a_min_zoom=this.min_zoom),null!==this.line_data?h.a_data=this.line_data:c.u_color=this.color.toRGBATuple(),l.use(h,c,f),null!==this.cmap_gpu&&this.cmap_gpu.bindShaderVariables(l),t.enable(t.BLEND),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),l.draw(),"maplibre"==a.type&&a.shaderData.define.includes("GLOBE")||(l.setUniforms({u_offset:-2}),l.draw(),l.setUniforms({u_offset:-1}),l.draw(),l.setUniforms({u_offset:1}),l.draw())}}var Vi=i(335),qi=i.n(Vi);const Wi=i(873),Xi=i(947);const Zi=new v(async t=>{const e=t.map(async t=>{const e=await fetch(t);if(200!=e.status)throw`Error ${e.status} retrieving font pbf from '${t}'`;const i=await e.blob(),s=await i.arrayBuffer();return function(t){const e=(t,e,i)=>{if(void 0!==i)switch(t){case 1:e.id=i.readVarint();break;case 2:e.data=i.readBytes();break;case 3:e.width=i.readVarint()+6;break;case 4:e.height=i.readVarint()+6;break;case 5:e.left=i.readSVarint();break;case 6:e.top=i.readSVarint();break;case 7:e.advance=i.readVarint()}},i=(t,i,s)=>{if(void 0!==i&&void 0!==s&&3==t){const t=s.readMessage(e,{});i.push(t)}};return new(qi())(t).readFields((t,e,s)=>{void 0!==s&&1==t&&s.readMessage(i,e)},[])}(new Uint8Array(s))});return function(t){const e=t.filter(t=>void 0!==t.data),i=[],s=e.map(t=>{const e={x:0,y:0,w:t.width,h:t.height};return i.push({glyph:t,bin:e}),e}),{w:n,h:r}=function(t){let e=0,i=0;for(const s of t)e+=s.w*s.h,i=Math.max(i,s.w);t.sort((t,e)=>e.h-t.h);const s=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),i),h:1/0}];let n=0,r=0;for(const e of t)for(let t=s.length-1;t>=0;t--){const i=s[t];if(!(e.w>i.w||e.h>i.h)){if(e.x=i.x,e.y=i.y,r=Math.max(r,e.y+e.h),n=Math.max(n,e.x+e.w),e.w===i.w&&e.h===i.h){const e=s.pop();t<s.length&&(s[t]=e)}else e.h===i.h?(i.x+=e.w,i.w-=e.w):e.w===i.w?(i.y+=e.h,i.h-=e.h):(s.push({x:i.x+e.w,y:i.y,w:i.w-e.w,h:e.h}),i.y+=e.h,i.h-=e.h);break}}return{w:n,h:r,fill:e/(n*r)||0}}(s),o=new Uint8Array(n*r),a={};let l=0;i.forEach(t=>{const{bin:e,glyph:i}=t;if(void 0===e.x||void 0===e.y)throw"Potpack couldn't pack this pot, I guess?";a[i.id]={id:i.id,width:i.width,height:i.height,left:i.left,top:i.top,atlas_i:e.x,atlas_j:e.y,advance:i.advance},l=Math.max(l,i.height);for(let t=0;t<i.width;t++)for(let s=0;s<i.height;s++){const r=t+i.width*s,a=t+e.x+n*(s+e.y);o[a]=i.data[r]}});const h=a["M".charCodeAt(0)],c=void 0===h?l:h.height-h.top,f=void 0===h?0:-h.top;return{atlas:o,atlas_width:n,atlas_height:r,baseline:c,top:f,glyph_info:a}}((await Promise.all(e)).flat())}),Ki={horizontal_align:"left",vertical_align:"baseline",font_size:12,text_color:new Ci([0,0,0,1]),cmap:null,halo_color:new Ci([0,0,0,1]),halo:!1,offset_x:0,offset_y:0};class Yi{constructor(t,e,i,s){this.opts=w(s,Ki);const n=void 0===this.opts.text_color?new Ci([0,0,0,1]):this.opts.text_color,r=S(t)?t.R8:t.LUMINANCE,o=t.UNSIGNED_BYTE,a=0==i.atlas_width||0==i.atlas_height||0==i.atlas.length,l={format:r,type:o,width:a?1:i.atlas_width,height:a?1:i.atlas_height,image:a?new Uint8Array([0,0,0,0]):i.atlas,row_alignment:1,mag_filter:t.LINEAR};this.texture=new j(t,l);const h=6*e.map(t=>t.text.length).reduce((t,e)=>t+e,0),c=new Float32Array(3*h),f=new Float32Array(2*h),u=new Float32Array(2*h),_=new Float32Array(h);let d=0,p=0,m=0,g=0,b=!1;e.forEach(t=>{const{lat:e,lon:s,text:n}=t,r=void 0===t.min_zoom?0:t.min_zoom,o=void 0===t.data_value?NaN:t.data_value,{x:a,y:l}=new z(s,e).toMercatorCoord();b=b||void 0!==t.data_value;let h=this.opts.offset_x,v=this.opts.offset_y;const w=p;for(let t=0;t<n.length;t++){const e=n.charCodeAt(t),s=i.glyph_info[e];void 0!==s?(h+=s.left,c[d++]=a,c[d++]=l,c[d++]=r,c[d++]=a,c[d++]=l,c[d++]=r,c[d++]=a,c[d++]=l,c[d++]=r,c[d++]=a,c[d++]=l,c[d++]=r,c[d++]=a,c[d++]=l,c[d++]=r,c[d++]=a,c[d++]=l,c[d++]=r,f[p++]=h,f[p++]=v+i.baseline+s.top-s.height,f[p++]=h,f[p++]=v+i.baseline+s.top-s.height,f[p++]=h+s.width,f[p++]=v+i.baseline+s.top-s.height,f[p++]=h,f[p++]=v+i.baseline+s.top,f[p++]=h+s.width,f[p++]=v+i.baseline+s.top,f[p++]=h+s.width,f[p++]=v+i.baseline+s.top,u[m++]=s.atlas_i/i.atlas_width,u[m++]=(s.atlas_j+s.height)/i.atlas_height,u[m++]=s.atlas_i/i.atlas_width,u[m++]=(s.atlas_j+s.height)/i.atlas_height,u[m++]=(s.atlas_i+s.width)/i.atlas_width,u[m++]=(s.atlas_j+s.height)/i.atlas_height,u[m++]=s.atlas_i/i.atlas_width,u[m++]=s.atlas_j/i.atlas_height,u[m++]=(s.atlas_i+s.width)/i.atlas_width,u[m++]=s.atlas_j/i.atlas_height,u[m++]=(s.atlas_i+s.width)/i.atlas_width,u[m++]=s.atlas_j/i.atlas_height,_[g++]=o,_[g++]=o,_[g++]=o,_[g++]=o,_[g++]=o,_[g++]=o,h+=s.advance-s.left):h+=7}if("center"==this.opts.horizontal_align)for(let t=w;t<w+12*n.length;t+=2)f[t]-=(h-this.opts.offset_x)/2;else if("right"==this.opts.horizontal_align)for(let t=w;t<w+12*n.length;t+=2)f[t]-=h-this.opts.offset_x;if("top"==this.opts.vertical_align)for(let t=w+1;t<w+12*n.length;t+=2)f[t]-=i.baseline-i.top;else if("middle"==this.opts.vertical_align)for(let t=w+1;t<w+12*n.length;t+=2)f[t]-=(i.baseline-i.top)/2});const v=[];let y=Xi;if(b){v.push("DATA"),this.data=new k(t,_,1,t.TRIANGLE_STRIP);const e=null===this.opts.cmap?new Ri([0,1],[n],{overflow_color:n,underflow_color:n}):this.opts.cmap;this.cmap_gpu=new Oi(e),this.cmap_gpu.setupShaderVariables(t,t.NEAREST),y=Oi.applyShader(y)}else this.data=null,this.cmap_gpu=null;this.shader_manager=new Ui(Wi,y,v),this.anchors=new k(t,c,3,t.TRIANGLE_STRIP),this.offsets=new k(t,f,2,t.TRIANGLE_STRIP),this.texcoords=new k(t,u,2,t.TRIANGLE_STRIP),this.data=b?new k(t,_,1,t.TRIANGLE_STRIP):null}static async make(t,e,i,s){const n=256,r=e.map(t=>[...t.text]).flat().map(t=>t.charCodeAt(0)).filter((t,e,i)=>i.indexOf(t)==e);let o,a;if(r.length>0){const t=Math.min(...r),e=Math.max(...r);o=Math.floor(t/n)*n,a=Math.floor(e/n)*n}else o=0,a=0;const l=[];for(let t=o;t<=a;t+=n)l.push(i.replace("{range}",`${t}-${t+n-1}`));const h=await Zi.getValue(l);return 0!=h.atlas_height&&0!=h.atlas_width&&0!=h.atlas.length||console.warn(`No font data from '${i}'`),new Yi(t,e,h,s)}render(t,e,[i,s],n){const r=T(e),o=this.shader_manager.getShaderProgram(t,r.shaderData),a={a_pos:this.anchors,a_offset:this.offsets,a_tex_coord:this.texcoords},l={u_map_width:i,u_map_height:s,u_map_zoom:n,u_font_size:this.opts.font_size,u_halo_color:this.opts.halo_color.toRGBATuple(),u_offset:0,...this.shader_manager.getShaderUniforms(r)};null!==this.data?a.a_value=this.data:l.u_text_color=this.opts.text_color.toRGBATuple(),l.u_is_halo=this.opts.halo?1:0,o.use(a,l,{u_sdf_sampler:this.texture}),null!==this.cmap_gpu&&this.cmap_gpu.bindShaderVariables(o),t.enable(t.BLEND),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),o.draw(),this.opts.halo&&(o.setUniforms({u_is_halo:0}),o.draw()),"maplibre"==r.type&&r.shaderData.define.includes("GLOBE")||(o.setUniforms({u_offset:-2,u_is_halo:this.opts.halo?1:0}),o.draw(),this.opts.halo&&(o.setUniforms({u_is_halo:0}),o.draw()),o.setUniforms({u_offset:-1,u_is_halo:this.opts.halo?1:0}),o.draw(),this.opts.halo&&(o.setUniforms({u_is_halo:0}),o.draw()),o.setUniforms({u_offset:1,u_is_halo:this.opts.halo?1:0}),o.draw(),this.opts.halo&&(o.setUniforms({u_is_halo:0}),o.draw()))}}var Ji=i(317);function Qi(t){return class extends t{constructor(...t){super(...t),this.billboard_buffer_cache=new v((t,e,i)=>async function(t,e,i,s){const{lats:n,lons:r}=e.getEarthCoords(),o=e.getMinVisibleZoom(i),a=await G.makeBBElements(n,r,o,e.ni,e.nj,s);return{vertices:new k(t,a.pts,2,t.POINTS,{per_instance:!0}),texcoords:new k(t,a.tex_coords,2,t.POINTS,{per_instance:!0})}}(t,this,e,i)),this.vector_rotation_cache=new v((t,e)=>function(t,e,i){const s=e.getEarthCoords(),n=new Si(e.ni*e.nj).fill(parseFloat("nan"));if(i)n.fill(0);else{e.is_conformal||console.warn("Vector rotations for non-conformal projections are not supported. The output may look incorrect.");for(let t=0;t<s.lats.length;t++){const i=s.lons[t],r=s.lats[t];n[t]=e.getVectorRotationAtPoint(i,r)}}const{format:r,type:o,row_alignment:a}=P(t,"float16"),l={format:r,type:o,row_alignment:a,image:new Uint16Array(n.buffer),width:e.ni,height:e.nj,mag_filter:t.LINEAR};return{rotation:new j(t,l)}}(t,this,e))}async getWGLBillboardBuffers(t,e,i){return await this.billboard_buffer_cache.getValue(t,e,i)}getVectorRotationTexture(t,e){return this.vector_rotation_cache.getValue(t,e)}getVectorRotationAtPoint(t,e){const[i,s]=this.transform(t,e),[n,r]=this.transform(t+.01,e);return Math.atan2(r-s,n-i)}}}const ts=6378137,es=6356752.314245;class is{constructor(t,e,i,s){this.type=t,this.is_conformal=e,this.ni=i,this.nj=s}}class ss extends(Qi(is)){constructor(t,e){super("unstructured",!0,Math.min(t.length,4096),Math.floor(t.length/4096)+1),this.coords=t,this.zoom_arg=void 0===e?null:e,this.zoom_cache=new v(t=>{const e=Math.log2(t),i=this.coords.map(t=>({...new z(t.lon,t.lat).toMercatorCoord(),min_zoom:24})),s=new Ji.kdTree([...i],(t,e)=>Math.max(Math.abs(t.x-e.x),Math.abs(t.y-e.y)),["x","y"]),n=(t,i,r)=>{const o=Math.pow(.5,r+1),a=s.nearest({x:t,y:i,min_zoom:0},2,o);if(a.length>0){const[t,i]=a.sort((t,e)=>t[1]-e[1])[0];24==t.min_zoom&&(t.min_zoom=Math.max(r-e,0))}a.length>1&&r<24+e&&(n(t-o/2,i-o/2,r+1),n(t+o/2,i-o/2,r+1),n(t-o/2,i+o/2,r+1),n(t+o/2,i+o/2,r+1))};return n(.5,.5,-1),new Uint8Array(i.map(t=>t.min_zoom))})}copy(){return new ss(this.coords)}getEarthCoords(){return{lons:new Float32Array(this.coords.map(t=>t.lon)),lats:new Float32Array(this.coords.map(t=>t.lat))}}getGridCoords(){const{lons:t,lats:e}=this.getEarthCoords();return{x:t,y:e}}transform(t,e,i){return[t,e]}getMinVisibleZoom(t){return null!==this.zoom_arg?this.zoom_arg:this.zoom_cache.getValue(t)}getThinnedGrid(t,e){const i=this.getMinVisibleZoom(t);return new ss(this.coords.filter((t,s)=>i[s]<=e),i.filter(t=>t<=e))}thinDataArray(t,e){let i=0;const s=new(y(e))(this.ni*this.nj);for(let n=0;n<t.coords.length&&!(this.coords[i].lat==t.coords[n].lat&&this.coords[i].lon==t.coords[n].lon&&(s[i++]=e[n],i>=this.coords.length));n++);return s}sampleNearestGridPoint(t,e,i){const s=E(this.coords.map(i=>(i.lon-t)*(i.lon-t)+(i.lat-e)*(i.lat-e)));return{sample:i[s],sample_lon:this.coords[s].lon,sample_lat:this.coords[s].lat}}}const ns={color:"#000000",cmap:null,interval:1,levels:null,line_width:2,line_style:"-",quad_as_tri:!1},rs={n_decimal_places:0,font_face:"Trebuchet MS",font_size:12,font_url_template:"",label_formatter:t=>t.toString(),text_color:"#000000",halo_color:"#000000",halo:!1,density:1};class os extends B{constructor(t,e){super(),this.opts=w(e,rs),this.contours=t,this.text_collection=null,this.gl_elems=null}async updateField(){if(null===this.gl_elems)return;const t=this.gl_elems.map,e=this.gl_elems.gl,i=t.getStyle(),s=""==this.opts.font_url_template?i.glyphs:this.opts.font_url_template;if(void 0===s)throw"The map style doesn't have any glyph information. Please pass the font_url_template option to ContourLabels";const n=s.replace("{fontstack}",this.opts.font_face),r=[],o=await this.contours.getContours(),a=Object.keys(o).map(parseFloat);a.sort((t,e)=>t-e);const l=t.getMaxZoom(),h=.006/this.opts.density*Math.pow(2,7-l);Object.entries(o).forEach(([t,e])=>{const i=parseFloat(t)-a[0],s=this.opts.label_formatter(t);e.forEach(t=>{const e=t.map(t=>{const e=new z(...t).toMercatorCoord();return[e.x,e.y]}),n=[];e.forEach((t,i)=>{if(0==i)n.push(0);else{const s=e[i-1],r=Math.hypot(s[0]-t[0],s[1]-t[1]);n.push(n[i-1]+r)}});let o=0;for(let e=1;e<n.length;e++){const a=h*(o+i/2%1);if(n[e-1]<=a&&a<n[e]){const i=t[e-1],l=t[e],h=(a-n[e-1])/(n[e]-n[e-1]),c=(1-h)*i[0]+h*l[0],f=(1-h)*i[1]+h*l[1];r.push({coord:{lon:c,lat:f},text:s}),o++}}})});const c=new ss(r.map(t=>t.coord)).getMinVisibleZoom(4),f=r.map((t,e)=>({...t.coord,min_zoom:c[e],text:t.text})),u={horizontal_align:"center",vertical_align:"middle",font_size:this.opts.font_size,halo:this.opts.halo,text_color:Ci.fromHex(this.opts.text_color),halo_color:Ci.fromHex(this.opts.halo_color)};this.text_collection=await Yi.make(e,f,n,u),t.triggerRepaint()}async onAdd(t,e){this.gl_elems={gl:e,map:t},this.updateField()}render(t,e){if(null===this.gl_elems||null===this.text_collection)return;const i=this.gl_elems,s=i.map.getCanvas().width,n=i.map.getCanvas().height,r=i.map.getZoom();this.text_collection.render(t,e,[s,n],r)}}const as=class extends B{constructor(t,e){super(),this.field=t,this.opts=w(e,ns),this.gl_elems=null,this.contours=null}async updateField(t){if(this.field=t,null===this.gl_elems)return;const e=this.gl_elems.gl,i=await this.getContours(),s=[];Object.entries(i).forEach(([t,e])=>{const i=parseFloat(t),n=(r=this.opts.line_style)in $i||Array.isArray(r)&&r.length>0&&r.map(t=>"number"==typeof t).reduce((t,e)=>t&&e,!0)?this.opts.line_style:this.opts.line_style(i);var r;const o="number"==typeof this.opts.line_width?this.opts.line_width:this.opts.line_width(i),a=e.map(t=>{const e={vertices:t};return null!==this.opts.cmap&&(e.data=t.map(()=>i)),e}),l=s.filter(t=>t.line_style==n&&t.line_width==o);let h;0==l.length?(h={data:[],line_width:o,line_style:n},s.push(h)):h=l[0],h.data=h.data.concat(a)});const n=s.map(async t=>{const i={line_width:t.line_width,line_style:t.line_style};return null!==this.opts.cmap?i.cmap=this.opts.cmap:i.color=this.opts.color,await Hi.make(e,t.data,i)});Promise.all(n).then(t=>{null!==this.gl_elems&&(this.contours=t,this.gl_elems.map.triggerRepaint())})}async getContours(){const t=null===this.opts.levels?void 0:this.opts.levels;return await this.field.getContours({interval:this.opts.interval,levels:t,quad_as_tri:this.opts.quad_as_tri})}async onAdd(t,e){this.gl_elems={gl:e,map:t},await this.updateField(this.field)}render(t,e){if(null===this.gl_elems||null===this.contours)return;const i=this.gl_elems,s=i.map.getZoom(),n=i.map.getCanvas().width,r=i.map.getCanvas().height,o=i.map.getBearing(),a=i.map.getPitch();this.contours.forEach(i=>i.render(t,e,[n,r],s,o,a))}},ls=i(303),hs=i(401),cs={cmap:[new Ri([0,1],["#000000"],{overflow_color:"#000000",underflow_color:"#000000"})],cmap_mask:null,opacity:1};class fs extends B{constructor(t,e){super(),this.field=t,this.opts=w(e,cs),this.opts.cmap=Array.isArray(this.opts.cmap)?this.opts.cmap:[this.opts.cmap],this.cmap_gpu=this.opts.cmap.map(t=>new Oi(t)),this.gl_elems=null,this.fill_texture=null,this.mask_texture=null,this.image_mag_filter=null,this.cmap_mag_filter=null}async updateField(t,e){if(this.field=t,null===this.image_mag_filter||null===this.cmap_mag_filter)throw"Implement magnification filters in a subclass";if(null===this.gl_elems)return;const i=this.gl_elems.gl,s=this.gl_elems.map;if(this.fill_texture=this.field.updateTexImageData(i,this.image_mag_filter,this.fill_texture),void 0!==e){if(null===this.opts.cmap_mask)return void console.warn("A mask was passed to updateField on a Fill component that didn't have a mask. The updated mask will be ignored.");const{format:t,type:s,row_alignment:n}=P(i,"uint8"),r={format:t,type:s,width:this.field.grid.ni,height:this.field.grid.nj,image:e,mag_filter:i.NEAREST,row_alignment:n};null===this.mask_texture?this.mask_texture=new j(i,r):this.mask_texture.setImageData(r)}s.triggerRepaint()}async onAdd(t,e){const{vertices:i,texcoords:s}=await this.field.grid.getDomainBuffers(e);this.cmap_gpu.forEach(t=>{if(null===this.image_mag_filter||null===this.cmap_mag_filter)throw"Implement magnification filters in a subclass";t.setupShaderVariables(e,this.cmap_mag_filter)});const n=[];if(null!==this.opts.cmap_mask&&n.push("MASK"),null===this.image_mag_filter||null===this.cmap_mag_filter)throw"Implement magnification filters in a subclass";const r=this.field.getSamplerIds(),o=this.field.getExpression(),a=this.field.dtypes,l=A(Oi.applyShader(hs),r,o,a),h=new Ui(ls,l,n);this.gl_elems={gl:e,shader_manager:h,map:t,vertices:i,texcoords:s},this.updateField(this.field,null===this.opts.cmap_mask?void 0:this.opts.cmap_mask)}render(t,e){if(null===this.gl_elems||null===this.fill_texture)return;const i=this.gl_elems,s=T(e),n=this.gl_elems.shader_manager.getShaderProgram(t,s.shaderData),r=Object.fromEntries([...this.fill_texture.entries()]);n.use({a_pos:i.vertices,a_tex_coord:i.texcoords},{u_opacity:this.opts.opacity,...this.gl_elems.shader_manager.getShaderUniforms(s)},r),this.cmap_gpu.forEach((e,i)=>{n.setUniforms({u_offset:0}),null!==this.opts.cmap_mask&&null!==this.mask_texture&&(n.setUniforms({u_mask_val:i+1}),n.bindTextures({u_mask_sampler:this.mask_texture})),e.bindShaderVariables(n),t.enable(t.BLEND),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),n.draw(),"maplibre"==s.type&&s.shaderData.define.includes("GLOBE")||(n.setUniforms({u_offset:-2}),n.draw(),n.setUniforms({u_offset:-1}),n.draw(),n.setUniforms({u_offset:1}),n.draw())})}}class us extends fs{constructor(t,e){super(t,e)}async updateField(t,e){await super.updateField(t,e)}async onAdd(t,e){this.image_mag_filter=e.NEAREST,this.cmap_mag_filter=e.LINEAR,await super.onAdd(t,e)}render(t,e){super.render(t,e)}}class _s extends fs{constructor(t,e){super(t,e)}async updateField(t,e){await super.updateField(t,e)}async onAdd(t,e){this.image_mag_filter=e.LINEAR,this.cmap_mag_filter=e.NEAREST,await super.onAdd(t,e)}render(t,e){super.render(t,e)}}const ds=i(631),ps=i(254);class ms{constructor(t,e,i,s,n,r,o){o=void 0===o?{}:o,this.color=void 0===o.color?new Ci([0,0,0,1]):o.color,this.cmap=void 0===o.cmap?null:o.cmap,this.rotate_with_map=void 0===o.rotate_with_map||o.rotate_with_map,this.field=t,this.spec=n,this.size_multiplier=r,this.thin_fac=e,this.max_zoom=i,this.billboard_image=s,this.gl_elems=null,this.wind_textures=null}updateField(t){if(this.field=t,null===this.gl_elems)return;const e=this.gl_elems.gl,i=this.field.getThinnedField(this.thin_fac,this.max_zoom);this.wind_textures=i.updateTexImageData(e,e.NEAREST,this.wind_textures)}async setup(t){const e=this.field.grid.getThinnedGrid(this.thin_fac,this.max_zoom),i=new Float32Array([0,1,2,3]),s=new k(t,i,1,t.TRIANGLE_STRIP),{vertices:n,texcoords:r}=await e.getWGLBillboardBuffers(t,this.thin_fac,this.max_zoom),{rotation:o}=e.getVectorRotationTexture(t,"earth"==this.field.relative_to),a=new j(t,this.billboard_image),l=[];let h=ps,c=null;null!==this.cmap&&(h=Oi.applyShader(h),c=new Oi(this.cmap),c.setupShaderVariables(t,t.NEAREST),l.push("COLORMAP"));const f=this.field.getSamplerIds(),u=this.field.getExpressions(),_=function(t,e,i){const s=e.u.map(t=>`uniform sampler2D ${t};`).join("\n")+"\n"+e.v.map(t=>`uniform sampler2D ${t};`).join("\n"),n=e.u.map(t=>` highp float ${t}_val = texture(${t}, tex_coord).r;`).join("\n"),r=e.v.map(t=>` highp float ${t}_val = texture(${t}, tex_coord).r;`).join("\n");let o=i.u;e.u.forEach(t=>o=o.replaceAll(t,`${t}_val`));let a=i.v;return e.v.forEach(t=>a=a.replaceAll(t,`${t}_val`)),x(`\n${s}\n\nhighp float get_field_value_u(lowp vec2 tex_coord) {\n${n}\n return ${o};\n}\n\nhighp float get_field_value_v(lowp vec2 tex_coord) {\n${r}\n return ${a};\n}`,t)}(ds,f,u),d=new Ui(_,h,l);this.gl_elems={gl:t,shader_manager:d,geom_vertices:s,vertices:n,texcoords:r,texture:a,proj_rot_texture:o,cmap_gpu:c}}render(t,e,[i,s],n,r,o){if(null===this.gl_elems||null===this.wind_textures)return;const a=T(e),l=this.gl_elems.shader_manager.getShaderProgram(t,a.shaderData),h=this.gl_elems,c=this.spec.BB_HEIGHT*(s/i)*this.size_multiplier,f=this.spec.BB_WIDTH/this.spec.BB_TEX_WIDTH,u=this.spec.BB_HEIGHT/this.spec.BB_TEX_HEIGHT,_={u_sampler:h.texture,u_rot_sampler:h.proj_rot_texture,...Object.fromEntries([...this.wind_textures.u.entries()]),...Object.fromEntries([...this.wind_textures.v.entries()])};l.use({a_geom:h.geom_vertices,a_pos:h.vertices,a_tex_coord:h.texcoords},{u_bb_size:c,u_bb_width:f,u_bb_height:u,u_bb_mag_bin_size:this.spec.BB_MAG_BIN_SIZE,u_bb_mag_wrap:this.spec.BB_MAG_WRAP,u_offset:0,u_map_aspect:s/i,u_zoom:n,u_rotate_with_map:this.rotate_with_map?1:0,...this.gl_elems.shader_manager.getShaderUniforms(a)},_),null!==h.cmap_gpu?h.cmap_gpu.bindShaderVariables(l):l.setUniforms({u_bb_color:this.color.toRGBATuple()}),t.enable(t.BLEND),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),l.draw(),"maplibre"==a.type&&a.shaderData.define.includes("GLOBE")||(l.setUniforms({u_offset:-2}),l.draw(),l.setUniforms({u_offset:-1}),l.draw(),l.setUniforms({u_offset:1}),l.draw())}}const gs={BB_WIDTH:85,BB_HEIGHT:256,BB_TEX_WIDTH:1024,BB_TEX_HEIGHT:1024,BB_MAG_MAX:235,BB_MAG_WRAP:60,BB_MAG_BIN_SIZE:5},bs={color:"#000000",cmap:null,line_width:2,barb_size_multiplier:1,thin_fac:1},vs=class extends B{constructor(t,e){super(),this.fields=t,this.opts=w(e,bs),this.color=Ci.fromHex(this.opts.color),this.barb_texture=function(t,e){let i=document.createElement("canvas");function s(e,i,s,n){const r=t.BB_WIDTH/2-4,o=r/2;if(n<2.5)e.beginPath(),e.arc(i,s,r/2,0,2*Math.PI),e.stroke();else{let t=0,a=n,l=0;const h=Math.floor((a+2.5)/50);l+=h*r/2+o+(h-1)*o/2,a-=50*h;const c=Math.floor((a+2.5)/10);l+=c*o,a-=10*c,l+=Math.floor((a+2.5)/5)*o,n<7.5&&(l+=o),l=Math.max(120,l),e.beginPath(),e.moveTo(i,s),e.lineTo(i,s+l),a=n,t=s+l;let f=!1,u=!0;for(;a>47.5;)f&&(t+=o/2),u||e.moveTo(i,t),e.lineTo(i-r,t),e.lineTo(i,t-r/2),t-=r/2+o,a-=50,f=!0,u=!1;for(;a>7.5;)u||e.moveTo(i,t),e.lineTo(i-r,t+r/2),t-=o,a-=10,u=!1;for(n<7.5&&(t-=o);a>2.5;)e.moveTo(i,t),e.lineTo(i-r/2,t+r/4),a-=5;e.stroke()}}i.width=t.BB_TEX_WIDTH,i.height=t.BB_TEX_HEIGHT;let n=i.getContext("2d");if(null===n)throw"Could not get rendering context for the wind barb canvas";n.lineWidth=e,n.miterLimit=4;for(let e=0;e<=t.BB_MAG_MAX;e+=t.BB_MAG_BIN_SIZE)s(n,e%t.BB_MAG_WRAP/t.BB_MAG_BIN_SIZE*t.BB_WIDTH+t.BB_WIDTH/2,Math.floor(e/t.BB_MAG_WRAP)*t.BB_HEIGHT+t.BB_WIDTH/2,e);return i}(gs,this.opts.line_width/this.opts.barb_size_multiplier*4),this.gl_elems=null}async updateField(t){this.fields=t,null!==this.gl_elems&&(this.gl_elems.barb_billboards.updateField(t),this.gl_elems.map.triggerRepaint())}async onAdd(t,e){e.getExtension("OES_texture_float"),e.getExtension("OES_texture_float_linear");const i=t.getMaxZoom(),s={format:e.RGBA,type:e.UNSIGNED_BYTE,image:this.barb_texture,mag_filter:e.NEAREST},n=null===this.opts.cmap?void 0:this.opts.cmap,r=new ms(this.fields,this.opts.thin_fac,i,s,gs,.1*this.opts.barb_size_multiplier,{color:this.color,cmap:n});await r.setup(e),this.gl_elems={map:t,barb_billboards:r},this.updateField(this.fields)}render(t,e){if(null===this.gl_elems)return;const i=this.gl_elems,s=i.map.getZoom(),n=i.map.getCanvas().width,r=i.map.getCanvas().height,o=i.map.getBearing(),a=i.map.getPitch();i.barb_billboards.render(t,e,[n,r],s,o,a)}},ws=i(187),ys=i(820),xs=i(325),As=i(314),Es={colors:["#000000"],opacity:1},Ms=class extends B{constructor(t,e){super(),this.field=t,this.opts=w(e,Es),this.color_components=this.opts.colors.map(t=>Ci.fromHex(t).toRGBATuple()),this.gl_elems=null,this.fill_texture=null}async updateField(t){if(this.field=t,null===this.gl_elems)return;const e=this.gl_elems.gl;e.pixelStorei(e.UNPACK_ALIGNMENT,2),this.fill_texture=this.field.updateTexImageData(e,e.NEAREST,this.fill_texture)}async onAdd(t,e){e.getExtension("OES_texture_float");const i=new k(e,new Float32Array([-1,-1,1,-1,-1,1,1,1]),2,e.TRIANGLE_STRIP),{vertices:s,texcoords:n}=await this.field.grid.getDomainBuffers(e),r=this.field.getSamplerIds(),o=this.field.getExpression(),a=this.field.dtypes,l=A(xs,r,o,a),h=new H(e,ws,l),c=new Ui(ys,As,[]),{format:f,type:u,row_alignment:_}=P(e,"float16"),d=new j(e,{format:f,type:u,width:this.field.grid.ni,height:this.field.grid.nj,image:null,mag_filter:e.LINEAR,row_alignment:_}),p=new W(e,d);this.gl_elems={gl:e,map:t,shader_program_1:h,shader_manager_2:c,vertices_step1:i,vertices_step2:s,texcoords_step2:n,framebuffer:p},this.updateField(this.field)}render(t,e){if(null===this.gl_elems||null===this.fill_texture)return;const i=this.gl_elems,s=(this.fill_texture,i.map),n=s.getCanvas().width,r=s.getCanvas().height,o=T(e),a=this.gl_elems.shader_program_1,l=this.gl_elems.shader_manager_2.getShaderProgram(t,o.shaderData),h=Object.fromEntries([...this.fill_texture.entries()]);this.color_components.forEach((e,s)=>{a.use({a_pos:i.vertices_step1},{u_imem:s},h),i.framebuffer.clear([0,0,0,1]),i.framebuffer.renderTo(0,0,this.field.grid.ni,this.field.grid.nj),t.enable(t.BLEND),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),a.draw(),l.use({a_pos:i.vertices_step2,a_tex_coord:i.texcoords_step2},{u_opacity:this.opts.opacity,u_color:e,u_offset:0,...i.shader_manager_2.getShaderUniforms(o)},{u_fill_sampler:i.framebuffer.texture}),W.screen(t).renderTo(0,0,n,r),t.enable(t.BLEND),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),l.draw(),"maplibre"==o.type&&o.shaderData.define.includes("GLOBE")||(l.setUniforms({u_offset:-2}),l.draw(),l.setUniforms({u_offset:-1}),l.draw(),l.setUniforms({u_offset:1}),l.draw())})}},Ss={BB_WIDTH:256,BB_HEIGHT:256,BB_TEX_WIDTH:256,BB_TEX_HEIGHT:256,BB_MAG_MAX:1e3,BB_MAG_WRAP:1e3,BB_MAG_BIN_SIZE:1e3},Ts={bgcolor:"#000000",thin_fac:1,hodo_line_width:2.5,background_line_width:1.5,height_cmap:new Ri([0,1,3,6,9],["#ffffcc","#a1dab4","#41b6c4","#225ea8"]),max_wind_speed_ring:80},Cs=class extends B{constructor(t,e){super(),this.profile_field=t,this.opts=w(e,Ts),this.hodo_bg_texture=function(t,e){let i=document.createElement("canvas");i.width=Ss.BB_TEX_WIDTH,i.height=Ss.BB_TEX_HEIGHT;let s=i.getContext("2d");if(null===s)throw"Could not get rendering context for the hodograph background canvas";s.lineWidth=t;for(let e=Ss.BB_TEX_WIDTH/4;e<=Ss.BB_TEX_WIDTH/2;e+=Ss.BB_TEX_WIDTH/4)s.beginPath(),s.arc(Ss.BB_TEX_WIDTH/2,Ss.BB_TEX_WIDTH/2,e-t/2,0,2*Math.PI),s.stroke();if(e){const t=Ss.BB_TEX_WIDTH/2,e=Ss.BB_TEX_WIDTH/2,i=20;s.beginPath(),s.moveTo(t,e),s.lineTo(t+i/2,e+i),s.lineTo(t-i/2,e+i),s.lineTo(t,e),s.fill()}else s.beginPath(),s.arc(Ss.BB_TEX_WIDTH/2,Ss.BB_TEX_WIDTH/2,t,0,2*Math.PI),s.fill();return i}(2.5*this.opts.background_line_width,M(t.profiles[0])),this.hodo_scale=(Ss.BB_TEX_WIDTH-this.opts.background_line_width/2)/(Ss.BB_TEX_WIDTH*this.opts.max_wind_speed_ring),this.bg_size=140,this.gl_elems=null,this.line_elems=null}async updateField(t){if(this.profile_field=t,null===this.gl_elems)return;const e=this.gl_elems.gl;this.gl_elems.bg_billboard.updateField(t.getStormMotionGrid());const i=this.profile_field.profiles,{lats:s,lons:n}=this.profile_field.getProfileCoords(),r=this.profile_field.grid.getMinVisibleZoom(this.opts.thin_fac),o=i.map((t,e)=>({offsets:[...t.u].map((e,i)=>M(t)?[e-t.smu,t.v[i]-t.smv]:[e,t.v[i]]),vertices:[...t.u].map(t=>[n[e],s[e]]),zoom:r[e],data:[...t.z]})),a=await Hi.make(e,o,{line_width:this.opts.hodo_line_width,cmap:this.opts.height_cmap,offset_scale:this.hodo_scale*this.bg_size,offset_rotates_with_map:!1}),l=i.map((t,e)=>{if(!M(t))return{vertices:[]};const i=Math.hypot(t.smu,t.smv),o=Math.PI/2-Math.atan2(-t.smv,-t.smu);return{offsets:[[2*Math.sin(o),2*Math.cos(o)],[i*Math.sin(o),i*Math.cos(o)]],vertices:[[n[e],s[e]],[n[e],s[e]]],zoom:r[e]}}),h=await Hi.make(e,l,{line_width:this.opts.background_line_width,color:this.opts.bgcolor,offset_scale:this.hodo_scale*this.bg_size,offset_rotates_with_map:!1});this.line_elems={hodo_line:a,sm_line:h}}async onAdd(t,e){const i={format:e.RGBA,type:e.UNSIGNED_BYTE,image:this.hodo_bg_texture,mag_filter:e.NEAREST},s=t.getMaxZoom(),n=new ms(this.profile_field.getStormMotionGrid(),this.opts.thin_fac,s,i,Ss,.004*this.bg_size,{color:Ci.fromHex(this.opts.bgcolor),rotate_with_map:!1});await n.setup(e),this.gl_elems={gl:e,map:t,bg_billboard:n},this.updateField(this.profile_field)}render(t,e){if(null===this.gl_elems||null===this.line_elems)return;const i=this.gl_elems,s=this.line_elems,n=i.map.getZoom(),r=i.map.getCanvas().width,o=i.map.getCanvas().height,a=i.map.getBearing(),l=i.map.getPitch();s.hodo_line.render(t,e,[r,o],n,a,l),s.sm_line.render(t,e,[r,o],n,a,a),i.bg_billboard.render(t,e,[r,o],n,a,l)}},Ns={"0/8":59658,"1/8":59659,"2/8":59660,"3/8":59661,"4/8":59662,"5/8":59663,"6/8":59664,"7/8":59665,"8/8":59666,clr:59658,few:59660,sct:59662,bkn:59664,ovc:59666,obsc:59667,va:59810,fu:59810,hz:59811,du:59812,bldu:59814,sa:59814,blsa:59814,vcblsa:59814,vcbldu:59814,blpy:59814,po:59816,vcpo:59816,vcds:59817,vcss:59817,br:59818,bcbr:59818,bc:59819,mifg:59820,vcts:59821,virga:59822,vcsh:59824,ts:59825,thdr:59825,vctshz:59825,tsfzfg:59825,tsbr:59825,tsdz:59825,vctsup:59825,"-tsup":59825,tsup:59825,"+tsup":59825,sq:59826,fc:59827,"+fc":59827,ds:59839,ss:59839,drsa:59839,drdu:59839,"+ds":59842,"+ss":59842,drsn:59844,"+drsn":59845,"-blsn":59846,blsn:59846,"+blsn":59847,vcblsn:59846,vcfg:59848,bcfg:59849,prfg:59852,fg:59853,fzfg:59857,"-vctsdz":59859,"-dz":59859,"-dzbr":59859,vctsdz:59861,dz:59861,"+vctsdz":59863,"+dz":59863,"-fzdz":59864,"-fzdzsn":59864,fzdz:59865,"+fzdz":59865,fzdzsn:59865,"-dzra":59866,dzra:59867,"+dzra":59867,"-ra":59869,"-rabr":59869,ra:59871,rabr:59871,rafg:59871,vcra:59871,"+ra":59873,"-fzra":59874,"-fzrasn":59874,"-fzrabr":59874,"-fzrapl":59874,"-fzrasnpl":59874,tsfzrapl:59875,"-tsfzra":59875,fzra:59875,"+fzra":59875,fzrasn:59875,tsfzra:59875,"-dzsn":59876,"-rasn":59876,"-snra":59876,"-sndz":59876,rasn:59877,"+rasn":59877,snra:59877,dzsn:59877,sndz:59877,"+dzsn":59877,"+sndz":59877,"-sn":59879,"-snbr":59879,sn:59881,"+sn":59883,"-snsg":59885,sg:59885,"-sg":59885,ic:59886,"-fzdzpl":59887,"-fzdzplsn":59887,fzdzpl:59887,"-fzraplsn":59887,fzrapl:59887,"+fzrapl":59887,"-rapl":59887,"-rasnpl":59887,"-raplsn":59887,"+rapl":59887,rapl:59887,"-snpl":59887,snpl:59887,"-pl":59887,pl:59887,"-plsn":59887,"-plra":59887,plra:59887,"-pldz":59887,"+pl":59887,plsn:59887,plup:59887,"+plsn":59887,"-sh":59888,"-shra":59888,sh:59889,shra:59889,"+sh":59889,"+shra":59889,"-shrasn":59891,"-shsnra":59891,"+shrabr":59892,shrasn:59892,"+shrasn":59892,shsnra:59892,"+shsnra":59892,"-shsn":59893,shsn:59894,"+shsn":59894,"-gs":59895,"-shgs":59895,fzraplgs:59896,"-sngs":59896,gsplsn:59896,gspl:59896,plgssn:59896,gs:59896,shgs:59896,"+gs":59896,"+shgs":59896,"-gr":59897,"-shgr":59897,"-sngr":59898,gr:59898,shgr:59898,"+gr":59898,"+shgr":59898,"-tsrasn":59907,tsrasn:59907,"-tssnra":59907,tssnra:59907,"-vctsra":59908,"-tsra":59908,tsra:59908,"-tsdz":59908,vctsra:59908,tspl:59909,"-tssn":59909,"-tspl":59909,tssn:59909,"-vctssn":59909,vctssn:59909,tsplsn:59909,tssnpl:59909,"-tssnpl":59909,"-tsragr":59910,tsrags:59910,tsragr:59910,tsgs:59910,tsgr:59910,"+tsfzrapl":59911,"+vctsra":59912,"+tsra":59912,"+tsfzra":59912,"+tssn":59913,"+tspl":59913,"+tsplsn":59913,"+vctssn":59913,tssa:59914,tsds:59914,tsdu:59914,"+tsgs":59915,"+tsgr":59915,"+tsrags":59915,"+tsragr":59915,in:59750,"-up":59750,up:59750,"+up":59751,"-fzup":59756,fzup:59756,"+fzup":59757},Rs={config:{},thin_fac:1,font_face:"Trebuchet MS",font_size:12,font_url_template:""};function Gs(t,e){let i,s,n,r;return e=void 0===e?10:e,"ll"==t||"cl"==t||"ul"==t?(i="right",n=-e):"lc"==t||"c"==t||"uc"==t?(i="center",n=0):(i="left",n=e),"ll"==t||"lc"==t||"lr"==t?(s="top",r=-e):"cl"==t||"c"==t||"cr"==t?(s="middle",r=0):(s="baseline",r=e),{horizontal_align:i,vertical_align:s,offset_x:n,offset_y:r}}const Is=class extends B{constructor(t,e){super(),this.field=t,this.opts=w(e,Rs),this.gl_elems=null,this.text_components=null}async updateField(t){if(this.field=t,null===this.gl_elems)return;const e=this.gl_elems.map,i=this.gl_elems.gl,s=this.gl_elems.barb_components,n=e.getStyle(),r=""==this.opts.font_url_template?n.glyphs:this.opts.font_url_template;if(void 0===r)throw"The map style doesn't have any glyph information. Please pass the font_url_template option to StationPlot";const o=r.replace("{fontstack}",this.opts.font_face),a=this.field.grid.getEarthCoords(),l=this.field.grid.getMinVisibleZoom(this.opts.thin_fac);let h=0,c=[];Object.entries(this.opts.config).forEach(async([t,e])=>{const n=t;if("number"==e.type||"string"==e.type){const t=e.pos,s=void 0===e.color?Ci.fromHex("#000000"):Ci.normalizeColor(e.color),r=void 0===e.halo_color?Ci.fromHex("#ffffff"):Ci.normalizeColor(e.halo_color),h=void 0===e.halo||e.halo;let f,u=null;if("number"==e.type){u=void 0===e.cmap?null:e.cmap;const t=this.field.getScalar(n),i=void 0===e.formatter?t=>null===t?"null":t.toString():e.formatter;f=t.map((t,e)=>{const s={text:i(t),lat:a.lats[e],lon:a.lons[e],min_zoom:l[e]};return null!==t&&(s.data_value=t),s})}else f=this.field.getStrings(n).map((t,e)=>({text:null===t?"":t,lat:a.lats[e],lon:a.lons[e],min_zoom:l[e]}));const _={...Gs(t),font_size:this.opts.font_size,halo:h,text_color:s,halo_color:r,cmap:u};c.push([Yi.make(i,f,o,_)])}else if("barb"==e.type){const t=this.field.getVector(n);s[h++].updateField(t)}else{if("symbol"!=e.type)throw`Unknown station plot configuration type ${e.type}`;{const t=e.pos,s=void 0===e.color?"#000000":e.color,o=void 0===e.halo_color?Ci.fromHex("#ffffff"):Ci.normalizeColor(e.halo_color),h=void 0===e.halo||e.halo,f=this.field.getStrings(n),u=r.replace("{fontstack}","wx_symbols"),_=[];f.forEach((t,e)=>{const i=null===t?"none":function(t){const e=t.toLowerCase();return e.includes("fzra")||e.includes("fz")&&e.includes("ra")?"freezing_rain":e.includes("pl")?"sleet":e.includes("sn")||e.includes("sg")||e.includes("gs")?"snow":e.includes("ra")||e.includes("dz")?"rain":e.includes("du")||e.includes("ds")||e.includes("ss")||e.includes("blsa")||e.includes("bldu")||e.includes("blpy")?"blowing_dust":e.includes("ts")||e.includes("thdr")?"thunder":e.includes("fg")?"fog":"none"}(t),n="string"==typeof s?s:s(t,i),r=_.filter(t=>t.color==n);let o;0==r.length?(o={specs:[],color:n},_.push(o)):o=r[0],o.specs.push({text:null===t?"":String.fromCharCode(Ns[t]),lat:a.lats[e],lon:a.lons[e],min_zoom:l[e]})});const d=[];_.forEach(e=>{const s={...Gs(t),font_size:this.opts.font_size,halo:h,text_color:Ci.normalizeColor(e.color),halo_color:o};void 0!==s.offset_x&&(s.offset_x-=3),d.push(Yi.make(i,e.specs,u,s))}),c.push(d)}}}),this.text_components=await Promise.all(c.map(t=>Promise.all(t))),e.triggerRepaint()}async onAdd(t,e){const i=Object.entries(this.opts.config).map(async([i,s])=>{const n=i;if("barb"==s.type){const i=this.field.getVector(n),r=void 0===s.color?"#000000":s.color,o=void 0===s.barb_size_multipler?1:s.barb_size_multipler,a=new vs(i,{thin_fac:this.opts.thin_fac,color:r,barb_size_multiplier:o});return await a.onAdd(t,e),a}}),s=(await Promise.all(i)).filter(t=>void 0!==t);this.gl_elems={map:t,gl:e,barb_components:s},this.updateField(this.field)}render(t,e){if(null===this.gl_elems||null===this.text_components)return;const i=this.gl_elems,s=this.text_components,n=this.gl_elems.barb_components,r=i.map.getCanvas().width,o=i.map.getCanvas().height,a=i.map.getZoom();let l=0,h=0;Object.values(this.opts.config).forEach((i,c)=>{"barb"==i.type?n[h++].render(t,e):s[l++].forEach(i=>i.render(t,e,[r,o],a))})}};class Ds{constructor(t){this.type="custom",this.id=t,this.map=null}repaint(){null!==this.map&&this.map.triggerRepaint()}}class Bs extends Ds{constructor(t,e){super(t),this.field=e}async onAdd(t,e){this.map=t,await this.field.onAdd(t,e)}render(t,e){this.field.render(t,e)}}class Ps extends Ds{constructor(t){super(t),this.fields={},this.field_key=null,this.map=null,this.gl=null}onAdd(t,e){this.map=t,this.gl=e,Object.values(this.fields).forEach(i=>{i.onAdd(t,e).then(t=>{this.repaint()})}),this.repaint()}render(t,e){null!==this.map&&null!==this.gl&&null!==this.field_key&&this.fields.hasOwnProperty(this.field_key)&&null!==this.fields[this.field_key]&&this.fields[this.field_key].render(t,e)}setActiveKey(t){this.field_key,this.field_key=t,this.repaint()}getKeys(){return Object.keys(this.fields)}addField(t,e){this.field_key,null!==this.map&&null!==this.gl&&null!==t&&t.onAdd(this.map,this.gl).then(t=>{this.repaint()}),this.fields[e]=t,null===this.field_key&&(this.field_key=e)}}const Fs=(t,e,i)=>{const s=document.createElementNS("http://www.w3.org/2000/svg",t);return void 0!==e&&Object.entries(e).forEach(([t,e])=>{s.setAttribute(t,e.toString())}),void 0!==i&&i.appendChild(s),s};function Ls(t,e){const i=e.label||"",s=e.ticks||t.levels,n=e.orientation||"vertical",r=e.fontface||"sans-serif",o=e.ticklabelsize||12,a=e.size_long||600,l=e.size_short||a/9,h=e.outline_and_text_color||"#000000",c=e.tick_direction||("vertical"==n?"left":"bottom");if("vertical"==n&&("top"==c||"bottom"==c)||"horizontal"==n&&("left"==c||"right"==c))throw`tick_direction of '${c} doesn't match an orientation of ${n}`;const f=t=>t.toString().length,u=f(s[0]),_=f(s[s.length-1]),d=null!==t.underflow_color||null!==t.overflow_color,p=a,m=l,g=Math.max("horizontal"==n?6*Math.max(u,_):8,d?m/(2*Math.sqrt(3)):0);let b,v,w,y,x,A,E,M,S,T,C;"vertical"==n?(b=p,v=m,w="left"==c?m-3-10:3,y=g,x=10,A=p-2*g,E=w+x,S=w+x/2,M=y+A,T=null===t.underflow_color?M:M+m/(2*Math.sqrt(3)),C=null===t.overflow_color?y:y-m/(2*Math.sqrt(3))):(v=p,b=m-6,w=g,y="bottom"==c?3:m-6-3-10,A=10,x=p-2*g,E=w+x,S=y+A/2,M=y+A,T=null===t.underflow_color?w:w-m/(2*Math.sqrt(3)),C=null===t.overflow_color?E:E+m/(2*Math.sqrt(3)));const N=t.colors.length,R=Fs("svg",{width:v,height:b}),G=Fs("g",{},R);let I;I="vertical"==n?"left"==c?{"text-anchor":"end",transform:`translate(${w}, ${y})`}:{transform:`translate(${w+x}, ${y})`}:"bottom"==c?{"text-anchor":"middle",transform:`translate(${w}, ${y+A})`}:{"text-anchor":"middle",transform:`translate(${w}, ${y})`};const D=Fs("g",I,R);if(t.colors.forEach((t,e)=>{let i={};i="vertical"==n?{x:w,y:y+A*(1-(e+1)/N),width:x,height:A/N}:{x:w+x*e/N,y,width:x/N,height:A},Fs("rect",{...i,fill:t.toRGBHex(),opacity:t.a},G)}),null!==t.underflow_color){let e;e="vertical"==n?`${E} ${M}, ${S} ${T}, ${w} ${M}, ${E} ${M}`:`${w} ${M}, ${T} ${S}, ${w} ${y}, ${w} ${M}`;const i={points:e,fill:t.underflow_color.toRGBHex(),opacity:t.underflow_color.a};Fs("polygon",i,G)}if(null!==t.overflow_color){let e;e="vertical"==n?`${w} ${y}, ${S} ${C}, ${E} ${y}, ${w} ${y}`:`${E} ${y}, ${C} ${S}, ${E} ${M}, ${E} ${y}`;const i={points:e,fill:t.overflow_color.toRGBHex(),opacity:t.overflow_color.a};Fs("polygon",i,G)}const B=t.levels[0],P=t.levels[t.levels.length-1];let F,L;return s.filter(t=>B<=t&&t<=P).forEach(e=>{const i=t.levels.map(t=>Math.abs(t-e));let s=i.indexOf(i.reduce((t,e)=>Math.min(t,e)));e<=t.levels[s]&&s>0&&(s-=1),s+=(e-t.levels[s])/(t.levels[s+1]-t.levels[s]);const a=Fs("g","vertical"==n?{transform:`translate(0, ${A*(1-s/N)})`}:{transform:`translate(${x*s/N}, 0)`},D);let l,f;l="vertical"==n?"left"==c?{x2:-6}:{x2:6}:"bottom"==c?{y2:6}:{y2:-6},Fs("line",{...l,stroke:h,"stroke-width":1.5},a),f="vertical"==n?"left"==c?{x:-9,dy:"0.32em"}:{x:9,dy:"0.32em"}:"bottom"==c?{y:9,dy:"0.8em"}:{y:-9,dy:"0em"},Fs("text",{...f,fill:h,style:`font-family: ${r}; font-size: ${o}pt`},a).textContent=e.toString()}),F="vertical"==n?`${w} ${y}, ${S} ${C}, ${E} ${y}, ${E} ${M}, ${S} ${T}, ${w} ${M}, ${w} ${y}`:`${w} ${y}, ${E} ${y}, ${C} ${S}, ${E} ${M}, ${w} ${M}, ${T} ${S}, ${w} ${y}`,Fs("polygon",{points:F,stroke:h,"stroke-width":1.5,fill:"none"},R),L="vertical"==n?"left"==c?{transform:`translate(15, ${b/2}) rotate(-90)`}:{transform:`translate(${v-6}, ${b/2}) rotate(-90)`}:"bottom"==c?{transform:`translate(${v/2}, ${b-5})`}:{transform:`translate(${v/2}, 15)`},Fs("text",{...L,fill:h,"text-anchor":"middle",style:`font-family: ${r};`},R).textContent=i,R}const zs={n_cols:1,swatch_text_space:100,fontface:"sans-serif"};function Os(t,e,i){if(t.length!=e.length)throw`Mismatch between the number of colors (${t.length}) and the number of labels (${e.length})`;const s=w(i,zs);let n,r;const o=s.swatch_text_space,a=s.n_cols,l=s.fontface,h=Math.ceil(t.length/a);r=(23+o)*a+5*(a+1),n=20*h+5*(h+1);const c=Fs("svg",{width:r,height:n}),f=Fs("g",{},c);return t.forEach((t,i)=>{const s=e[i],n=i%h,r=Math.floor(i/h);let a=1;"string"!=typeof t&&(a=t.a,t=t.toRGBHex());const c=5+r*(23+o+5),u=5+25*n;Fs("rect",{x:c,y:u,fill:t,opacity:a,width:20,height:20},f),Fs("text",{x:c+20+3,y:u+10,dy:"0.32em",fill:"#000000",style:`font-size: 0.8em; font-family: ${l};`},f).textContent=s}),c}function Us(t){return t instanceof Float32Array?"float32":t instanceof Uint8Array?"uint8":t instanceof Uint16Array?"uint16":t instanceof Uint32Array?"uint32":t instanceof Int16Array?"int16":t instanceof Int32Array?"int32":"float16"}class ks{operand(t,e){const i={"+":(t,e)=>t+e,"-":(t,e)=>t-e,"*":(t,e)=>t*e,"/":(t,e)=>t/e};return"number"==typeof t?new Hs([this],`{0} ${e} ${t.toFixed(100)}`,s=>i[e](s,t)):new Hs([this,t],`{0} ${e} {1}`,i[e])}multiply(t){return this.operand(t,"*")}divide(t){return this.operand(t,"/")}add(t){return this.operand(t,"+")}subtract(t){return this.operand(t,"-")}}class js extends ks{constructor(t,e){if(super(),this.grid=t,this.data=e,t.ni*t.nj!=e.length)throw`Data size (${e.length}) doesn't match the grid dimensions (${t.ni} x ${t.nj}; expected ${t.ni*t.nj} points)`;this.contour_cache=new v(async e=>{if("float16"!=Us(this.data)&&"float32"!=Us(this.data))throw`Grid is of type ${Us(this.data)}, which is not contourable (should be either float16 or float32)`;const i=this.getTextureData();if(!((s=i)instanceof Uint16Array||s instanceof Float32Array))throw"Type check for contourable array failed";var s;const n=D(void 0,1),r=await n.contourCreator(i,t.getGridCoords(),e);for(const e in r)for(let i=0;i<r[e].length;i++)for(let s=0;s<r[e][i].length;s++){const[n,o]=r[e][i][s];r[e][i][s]=t.transform(n,o,{inverse:!0})}return r})}get aryConstructor(){return y(this.data)}get dtypes(){return[Us(this.data)]}getTextureData(){const t=this.data,e=Us(t);return["float32","uint8","uint32","uint16","int32","int16"].includes(e)?t:new Uint16Array(t.buffer)}getWGLTextureSpec(t,e){const i=this.getTextureData(),{format:s,type:n,row_alignment:r}=P(t,Us(this.data));return new Map([["_0",{format:s,type:n,width:this.grid.ni,height:this.grid.nj,image:i,mag_filter:e,min_filter:e,row_alignment:r}]])}updateTexImageData(t,e,i){const s=this.getWGLTextureSpec(t,e);return null===i?i=new Map(this.getSamplerIds().map(e=>{const i=s.get(e);if(void 0===i)throw`Missing key '${e}' in fill_texture_specs`;return[e,new j(t,i)]})):this.getSamplerIds().forEach(t=>{const e=s.get(t);if(void 0===e)throw`Missing key '${t}' in fill_texture_specs`;const n=i?.get(t);if(void 0===n)throw`Missing key '${t}' in fill_textures`;n.setImageData(e)}),i}getSamplerIds(){return["_0"]}getExpression(){return"_0"}async getContours(t){return await this.contour_cache.getValue(t)}static aggregateFields(t,...e){return new Hs(e,"",t).renderCPU()}renderCPU(){return this}*iterateCPU(){for(let t=0;t<this.data.length;t++)yield this.data[t]}getThinnedField(t,e){const i=this.grid.getThinnedGrid(t,e),s=i.thinDataArray(this.grid,this.data);return new js(i,s)}sampleFieldWithCoord(t,e){return this.grid.sampleNearestGridPoint(t,e,this.data)}sampleField(t,e){return this.sampleFieldWithCoord(t,e).sample}}const $s="abcdefghijklmnopqrstuvwxyz";class Hs extends ks{constructor(t,e,i){super(),this.raw_fields=t,this.expression=e,this.cpu_func=i}get grid(){return this.raw_fields[0].grid}get aryConstructor(){return this.raw_fields[0].aryConstructor}get dtypes(){return this.raw_fields.map(t=>t.dtypes).flat()}updateTexImageData(t,e,i){const s=new Map;return this.raw_fields.forEach((n,r)=>{let o=null;if(null!==i){o=new Map;for(let[t,e]of i)t[t.length-1]==$s[r]&&o.set(t.slice(0,-1),e)}const a=n.updateTexImageData(t,e,o);for(let[t,e]of a)s.set(`${t}${$s[r]}`,e)}),s}getSamplerIds(){return this.raw_fields.map((t,e)=>t.getSamplerIds().map(t=>`${t}${$s[e]}`)).flat()}getExpression(){let t=this.expression;return this.raw_fields.forEach((e,i)=>{let s=e.getExpression();const n=s.match(/_0[a-z]*/g);if(null===n)throw"Field expression not found";n.forEach(t=>s=s.replace(t,`${t}${$s[i]}`)),t=t.replace(`{${i}}`,s)}),`(${t})`}getThinnedField(t,e){return new Hs(this.raw_fields.map(i=>i.getThinnedField(t,e)),this.expression,this.cpu_func)}sampleFieldWithCoord(t,e){const i=this.raw_fields.map(i=>i.sampleFieldWithCoord(t,e));return{sample:this.cpu_func(...i.map(t=>t.sample)),sample_lon:i[0].sample_lon,sample_lat:i[0].sample_lat}}sampleField(t,e){return this.sampleFieldWithCoord(t,e).sample}renderCPU(){const t=new this.aryConstructor([...this.iterateCPU()]);return new js(this.grid,t)}*iterateCPU(){const t=function*(...t){const e=t.map(t=>t[Symbol.iterator]());for(;;){const t=e.map(t=>t.next());if(t.some(t=>t.done))break;yield t.map(t=>t.value)}}(...this.raw_fields.map(t=>t.iterateCPU()));for(const e of function*(t,e){for(const i of t)yield e(...i)}(t,this.cpu_func))yield e}}function Vs(t,e){return`_${e}${t.slice(1)}`}function qs(t){return`_${t.slice(2)}`}class Ws{constructor(t,e,i){this.u=t,this.v=e,i=void 0===i?{}:i,this.relative_to=void 0===i.relative_to?"grid":i.relative_to}operandScalar(t,e){const i={"*":(t,e)=>t*e,"/":(t,e)=>t/e};if("number"==typeof t){const s=new Hs([this.u],`{0} ${e} ${t.toFixed(100)}`,s=>i[e](s,t)),n=new Hs([this.v],`{0} ${e} ${t.toFixed(100)}`,s=>i[e](s,t));return new Zs(s,n,{relative_to:this.relative_to})}const s=new Hs([this.u,t],`{0} ${e} {1}`,i[e]),n=new Hs([this.v,t],`{0} ${e} {1}`,i[e]);return new Zs(s,n,{relative_to:this.relative_to})}operandVector(t,e){const i={"+":(t,e)=>t+e,"-":(t,e)=>t-e},s=new Hs([this.u,t.u],`{0} ${e} {1}`,i[e]),n=new Hs([this.v,t.v],`{0} ${e} {1}`,i[e]);return new Zs(s,n,{relative_to:this.relative_to})}multiply(t){return this.operandScalar(t,"*")}divide(t){return this.operandScalar(t,"/")}add(t){return this.operandVector(t,"+")}subtract(t){return this.operandVector(t,"-")}updateTexImageData(t,e,i){const s=(t,e,i)=>{const s=new Map,n=i?qs:Vs;return t.forEach((t,i)=>{s.set(n(i,e),t)}),s},n=this.u.updateTexImageData(t,e,null===i?null:s(i.u,"u",!0)),r=this.v.updateTexImageData(t,e,null===i?null:s(i.v,"v",!0));return{u:s(n,"u",!1),v:s(r,"v",!1)}}magnitude(){return new Hs([this.u,this.v],"length(vec2({0}, {1}))",Math.hypot)}getThinnedField(t,e){const i=this.u.getThinnedField(t,e),s=this.v.getThinnedField(t,e);return new Zs(i,s,{relative_to:this.relative_to})}get grid(){return this.u.grid}sampleField(t,e){const i=this.u.sampleFieldWithCoord(t,e),s=this.v.sampleFieldWithCoord(t,e),n="earth"==this.relative_to?0:this.grid.getVectorRotationAtPoint(i.sample_lon,i.sample_lat),r=Math.hypot(i.sample,s.sample);let o=180*(Math.PI/2-Math.atan2(-s.sample,-i.sample)+n)/Math.PI;return o>360&&(o-=360),o<0&&(o+=360),[o,r]}getSamplerIds(){return{u:this.u.getSamplerIds().map(t=>Vs(t,"u")),v:this.v.getSamplerIds().map(t=>Vs(t,"v"))}}getExpressions(){const t=(t,e)=>{const i=t.match(/_0[a-z]*/g);if(null===i)throw"Field expression not found";return i.forEach(i=>t=t.replace(i,Vs(i,e))),t};return{u:t(this.u.getExpression(),"u"),v:t(this.v.getExpression(),"v")}}}class Xs extends Ws{constructor(t,e,i,s){super(new js(t,e),new js(t,i),s),this.u_ary=e,this.v_ary=i}getSamplerIds(){return{u:["_u0"],v:["_v0"]}}getExpressions(){return{u:"_u0",v:"_v0"}}}class Zs extends Ws{}class Ks{constructor(t,e){this.profiles=e,this.grid=t}getStormMotionGrid(){const t=this.profiles,e=new Si(this.grid.ni*this.grid.nj).fill(parseFloat("nan")),i=new Si(this.grid.ni*this.grid.nj).fill(parseFloat("nan"));return t.forEach(t=>{const s=t.ilon+this.grid.ni*t.jlat;M(t)?(e[s]=t.smu,i[s]=t.smv):(e[s]=0,i[s]=0)}),new Xs(this.grid,e,i,{relative_to:"grid"})}getProfileCoords(){const{lats:t,lons:e}=this.grid.getEarthCoords(),i=new Float32Array(this.profiles.length),s=new Float32Array(this.profiles.length);return this.profiles.forEach((n,r)=>{const o=n.ilon+n.jlat*this.grid.ni;i[r]=t[o],s[r]=e[o]}),{lats:i,lons:s}}}class Ys{constructor(t,e){this.grid=t,this.data=e}getScalar(t){const e=this.data.map(e=>e[t]);if(!e.map(t=>"number"==typeof t||null===t).reduce((t,e)=>t&&e,!0))throw`It doesn't look like ${t} contains scalar numerical data`;return e}getStrings(t){const e=this.data.map(e=>e[t]);if(!e.map(t=>"string"==typeof t||null===t).reduce((t,e)=>t&&e,!0))throw`It doesn't look like ${t} contains string data`;return e}getVector(t){const e=this.data.map(e=>e[t]);if(!e.map(t=>Array.isArray(t)).reduce((t,e)=>t&&e,!0))throw`It doesn't look like ${t} contains vector data`;const i=e,s=new Si(this.grid.ni*this.grid.nj).fill(parseFloat("nan")),n=new Si(this.grid.ni*this.grid.nj).fill(parseFloat("nan"));return i.forEach(([t,e],i)=>{if(null===t||null===e)return;const[r,o]=((t,e)=>[-t*Math.sin(e*Math.PI/180),-t*Math.cos(e*Math.PI/180)])(t,e);s[i]=r,n[i]=o}),new Xs(this.grid,s,n,{relative_to:"earth"})}}async function Js(t,e,i,s,n){const r=void 0===(n=void 0===n?{}:n).margin_r||n.margin_r,o=void 0===n.margin_s||n.margin_s,a=r?1/(2*e.ni):0,l=o?1/(2*e.nj):0,h=r?"center":"edge",c=o?"center":"edge",f=r?i:i+1,u=o?s:s+1,{lats:_,lons:d}=e.getEarthCoords(i,s,h,c),p=await G.makeDomainVerticesAndTexCoords(_,d,f,u,a,l);return{vertices:new k(t,p.vertices,2,t.TRIANGLE_STRIP),texcoords:new k(t,p.tex_coords,2,t.TRIANGLE_STRIP)}}class Qs extends(function(t){return class extends t{constructor(...t){super(...t),this.buffer_cache=new v(t=>this.makeDomainBuffers(t))}async getDomainBuffers(t){return await this.buffer_cache.getValue(t)}}}(is)){constructor(t,e,i,s,n,r){super(t,e,i,s),this.thin_x=void 0===n?1:n,this.thin_y=void 0===r?1:r}xyThinFromMaxZoom(t,e){const i=Math.log2(t),s=Math.max(i+1-e,0),n=Math.pow(2,s);return[n,n]}thinnedGridParameters(t,e,i,s,n,r){const[o,a]=this.xyThinFromMaxZoom(t,e),l=(n-i)/this.ni,h=(r-s)/this.nj;return{ni:Math.ceil(this.ni/o),nj:Math.ceil(this.nj/a),thin_x:o,thin_y:a,ll_x:i,ll_y:s,ur_x:n-(this.ni-1)%o*l,ur_y:r-(this.nj-1)%a*h}}getMinVisibleZoom(t){const e=new Uint8Array(this.ni*this.nj),i=t/Math.max(this.thin_x,this.thin_y);for(let t=0;t<this.nj*this.thin_y;t++)for(let s=0;s<this.ni*this.thin_x;s++)e[t*this.ni+s]=b(t,s,i);return e}thinDataArray(t,e){const i=new(y(e))(this.ni*this.nj);for(let s=0;s<this.ni;s++)for(let n=0;n<this.nj;n++){const r=s*this.thin_x+t.ni*n*this.thin_y;i[s+this.ni*n]=e[r]}return i}async makeDomainBuffers(t){return Js(t,this,Math.max(Math.floor(this.ni/20),20),Math.max(Math.floor(this.nj/20),20))}sampleNearestGridPoint(t,e,i){const[s,n]=this.transform(t,e),{x:r,y:o}=this.getGridCoords();let a=r[0],l=r[r.length-1];const h=r[1]-r[0];let c=o[0],f=o[o.length-1];const u=o[1]-o[0];if(h<0&&([a,l]=[l,a]),u<0&&([c,f]=[f,c]),s<a-.5*h||s>l+.5*h||n<c-.5*u||n>f+.5*u)return{sample:NaN,sample_lon:NaN,sample_lat:NaN};const _=E(r.map(t=>Math.abs(t-s))),d=E(o.map(t=>Math.abs(t-n))),p=_+d*this.ni,[m,g]=this.transform(r[_],o[d],{inverse:!0});return{sample:i[p],sample_lon:m,sample_lat:g}}}function tn(t){return class extends t{constructor(){super(...arguments),this.ll_cache=null,this.gc_cache=null}setupCoordinateCaches(t,e,i,s){const n=(e-t)/(this.ni-1),r=(s-i)/(this.nj-1);this.ll_cache=new v((e,s,o,a)=>{const l="center"==o?e:e+1,h="center"==a?s:s+1,c="center"==o?this.ni:this.ni+1,f="center"==a?this.nj:this.nj+1,u="center"==o?0:-n/2,_="center"==a?0:-r/2,d=new Float32Array(l*h),p=new Float32Array(l*h),m=(c-1)/(l-1)*n,g=(f-1)/(h-1)*r;for(let e=0;e<l;e++){const s=t+e*m+u;for(let t=0;t<h;t++){const n=i+t*g+_,[r,o]=this.transform(s,n,{inverse:!0}),a=e+t*l;d[a]=r,p[a]=o}}return{lons:d,lats:p}}),this.gc_cache=new v(()=>{const e=new Float32Array(this.ni),s=new Float32Array(this.nj);for(let i=0;i<this.ni;i++)e[i]=t+i*n;for(let t=0;t<this.nj;t++)s[t]=i+t*r;return{x:e,y:s}})}getEarthCoords(t,e,i,s){if(null===this.ll_cache)throw"Need to set up coordinate caches first";return t=void 0===t?this.ni:t,e=void 0===e?this.nj:e,i=void 0===i?"center":i,s=void 0===s?"center":s,this.ll_cache.getValue(t,e,i,s)}getGridCoords(){if(null===this.gc_cache)throw"Need to set up coordinate caches first";return this.gc_cache.getValue()}}}class en extends(Qi(tn(Qs))){constructor(t,e,i,s,n,r,o,a){super("latlon",!0,t,e,o,a),this.ll_lon=i,this.ll_lat=s,this.ur_lon=n,this.ur_lat=r,this.setupCoordinateCaches(i,n,s,r)}copy(t){const e=void 0!==(t=void 0!==t?t:{}).ni?t.ni:this.ni,i=void 0!==t.nj?t.nj:this.nj,s=void 0!==t.ll_lon?t.ll_lon:this.ll_lon,n=void 0!==t.ll_lat?t.ll_lat:this.ll_lat,r=void 0!==t.ur_lon?t.ur_lon:this.ur_lon,o=void 0!==t.ur_lat?t.ur_lat:this.ur_lat;return new en(e,i,s,n,r,o)}transform(t,e,i){return[t,e]}getThinnedGrid(t,e){const{ni:i,nj:s,thin_x:n,thin_y:r,ll_x:o,ll_y:a,ur_x:l,ur_y:h}=this.thinnedGridParameters(t,e,this.ll_lon,this.ll_lat,this.ur_lon,this.ur_lat);return new en(i,s,o,a,l,h,this.thin_x*n,this.thin_y*r)}}class sn extends(Qi(tn(Qs))){constructor(t,e,i,s,n,r,o,a,l,h,c){super("latlonrot",!0,t,e,h,c),this.np_lon=i,this.np_lat=s,this.lon_shift=n,this.ll_lon=r,this.ll_lat=o,this.ur_lon=a,this.ur_lat=l,this.llrot=function(t){const e=Math.PI/180,i=t.np_lat*e,s=t.np_lon*e,n=t.lon_shift*e,r=Math.sin(i),o=Math.cos(i);return(t,i,a)=>(a=void 0===a?{inverse:!1}:a).inverse?((t,i)=>{t*=e,i*=e;const a=Math.sin(i),l=Math.cos(i),h=Math.sin(t-s),c=Math.cos(t-s),f=Math.asin(r*a+o*l*c);let u=n+Math.atan2(l*h,r*l*c-o*a);return t>Math.PI&&(t-=2*Math.PI),[u/e,f/e]})(t,i):((t,i)=>{t*=e,i*=e;const a=Math.sin(i),l=Math.cos(i),h=Math.sin(t-n),c=Math.cos(t-n),f=Math.asin(r*a-o*l*c);let u=s+Math.atan2(l*h,r*l*c+o*a);return u>Math.PI&&(u-=2*Math.PI),[u/e,f/e]})(t,i)}({np_lon:i,np_lat:s,lon_shift:n}),this.setupCoordinateCaches(r,a,o,l)}copy(t){const e=void 0!==(t=void 0!==t?t:{}).ni?t.ni:this.ni,i=void 0!==t.nj?t.nj:this.nj,s=void 0!==t.ll_lon?t.ll_lon:this.ll_lon,n=void 0!==t.ll_lat?t.ll_lat:this.ll_lat,r=void 0!==t.ur_lon?t.ur_lon:this.ur_lon,o=void 0!==t.ur_lat?t.ur_lat:this.ur_lat;return new sn(e,i,this.np_lon,this.np_lat,this.lon_shift,s,n,r,o)}transform(t,e,i){const s="inverse"in(i=void 0===i?{}:i)&&i.inverse;return this.llrot(t,e,{inverse:!s})}getThinnedGrid(t,e){const{ni:i,nj:s,thin_x:n,thin_y:r,ll_x:o,ll_y:a,ur_x:l,ur_y:h}=this.thinnedGridParameters(t,e,this.ll_lon,this.ll_lat,this.ur_lon,this.ur_lat);return new sn(i,s,this.np_lon,this.np_lat,this.lon_shift,o,a,l,h,this.thin_x*n,this.thin_y*r)}}class nn extends(Qi(tn(Qs))){constructor(t,e,i,s,n,r,o,a,l,h,c,f,u){super("lcc",!0,t,e,f,u),this.lon_0=i,this.lat_0=s,this.lat_std=n,this.ll_x=r,this.ll_y=o,this.ur_x=a,this.ur_y=l,this.a=void 0===h?ts:h,this.b=void 0===c?es:c,this.lcc=F({lon_0:i,lat_0:s,lat_std:n,a:this.a,b:this.b}),this.setupCoordinateCaches(r,a,o,l)}static fromLLCornerLonLat(t,e,i,s,n,r,o,a,l,h,c){const f=F({lon_0:i,lat_0:s,lat_std:n,a:h=void 0===h?ts:h,b:c=void 0===c?es:c}),[u,_]=f(r,o);return new nn(t,e,i,s,n,u,_,u+t*a,_+e*l,h,c)}copy(t){const e=void 0!==(t=void 0!==t?t:{}).ni?t.ni:this.ni,i=void 0!==t.nj?t.nj:this.nj,s=void 0!==t.ll_x?t.ll_x:this.ll_x,n=void 0!==t.ll_y?t.ll_y:this.ll_y,r=void 0!==t.ur_x?t.ur_x:this.ur_x,o=void 0!==t.ur_y?t.ur_y:this.ur_y;return new nn(e,i,this.lon_0,this.lat_0,this.lat_std,s,n,r,o,this.a,this.b)}transform(t,e,i){const s=void 0!==(i=void 0===i?{}:i).inverse&&i.inverse;return this.lcc(t,e,{inverse:s})}getThinnedGrid(t,e){const{ni:i,nj:s,thin_x:n,thin_y:r,ll_x:o,ll_y:a,ur_x:l,ur_y:h}=this.thinnedGridParameters(t,e,this.ll_x,this.ll_y,this.ur_x,this.ur_y);return new nn(i,s,this.lon_0,this.lat_0,this.lat_std,o,a,l,h,this.a,this.b,this.thin_x*n,this.thin_y*r)}}var rn=i(387);class on extends(tn(Qs)){constructor(t,e,i,s,n,r,o,a,l,h){super("radar",!0,t,e,l,h),this.longitude=o,this.latitude=a,this.start_rn=i,this.end_rn=s,this.start_az=n,this.end_az=r,this.geod=rn.Geodesic.WGS84,this.setupCoordinateCaches(i,s,n,r)}copy(t){const e=void 0===(t=void 0===t?{}:t).ni?this.ni:t.ni,i=void 0===t.nj?this.nj:t.nj,s=void 0===t.longitude?this.longitude:t.longitude,n=void 0===t.latitude?this.latitude:t.latitude,r=void 0===t.start_rn?this.start_rn:t.start_rn,o=void 0===t.end_rn?this.end_rn:t.end_rn,a=void 0===t.start_az?this.start_az:t.start_az,l=void 0===t.end_az?this.end_az:t.end_az;return new on(e,i,r,o,a,l,s,n)}async makeDomainBuffers(t){return await Js(t,this,16,this.nj,{margin_r:!1,margin_s:!1})}transform(t,e,i){if(void 0!==(i=void 0===i?{}:i).inverse&&i.inverse){const i=this.geod.Direct(this.latitude,this.longitude,e,t);if(void 0===i.lon2||void 0===i.lat2)throw"Why are lon2 and lat2 not in the return value?";return[i.lon2,i.lat2]}{const i=this.geod.Inverse(this.latitude,this.longitude,e,t);if(void 0===i.azi1||void 0===i.s12)throw"Why are azi1 and s12 not in the return value?";if(!Number.isFinite(i.azi1)||!Number.isFinite(i.s12))return[NaN,NaN];const s=.5*(this.end_az-this.start_az)/this.ni;let n=i.azi1;for(;n<this.start_az-s;)n+=360;for(;n>=this.end_az+s;)n-=360;return[i.s12,n]}}getThinnedGrid(t,e){const{ni:i,nj:s,thin_x:n,thin_y:r,ll_x:o,ll_y:a,ur_x:l,ur_y:h}=this.thinnedGridParameters(t,e,this.end_az,this.end_rn,this.start_az,this.start_rn);return new on(i,s,a,h,o,l,this.longitude,this.latitude,n*this.thin_x,r*this.thin_y)}}class an extends(tn(Qs)){constructor(t,e,i,s,n,r,o,a,l){super("geostationary",!1,t,e,a,l),this.satellite_lon=o,this.ll_x=i,this.ll_y=s,this.ur_x=n,this.ur_y=r,this.vpp=function(t){const e=Math.PI/180,{lon_0:i,alt:s,a:n,b:r}=t,o=i*e,a=n*n,l=r*r,h=(t,i)=>{t*=e,i*=e;const n=Math.cos(i),h=Math.sin(i),c=Math.cos(t-o),f=Math.sin(t-o),u=r/Math.sqrt(1-(1-l/a)*n*n),_=u*n*c,d=u*n*f,p=u*h;return[Math.atan(-d/(s-_)),Math.atan(p/Math.sqrt((s-_)*(s-_)+d*d))]};return(t,i,n)=>n?.inverse?((t,i)=>{const n=Math.sin(t),r=Math.cos(t),h=Math.sin(i),c=Math.cos(i),f=n*n+r*r*(c*c+a/l*h*h),u=-2*s*r*c,_=u*u-4*f*(s*s-a);if(_<0)return[NaN,NaN];const d=(-u-Math.sqrt(_))/(2*f),p=d*r*c,m=-d*n,g=d*r*h,b=o-Math.atan(m/(s-p)),v=Math.atan(a/l*(g/Math.sqrt((s-p)*(s-p)+m*m)));return[b/e,v/e]})(t,i):h(t,i)}({lon_0:o,alt:42164160,a:6378137,b:6356752.31414}),this.setupCoordinateCaches(i,n,s,r)}async makeDomainBuffers(t){const e=Math.max(Math.floor(this.ni/20),20),i=Math.max(Math.floor(this.nj/20),20);return await Js(t,this,e,i,{margin_r:!1,margin_s:!1})}transform(t,e,i){const s=void 0!==(i=void 0===i?{}:i).inverse&&i.inverse;return this.vpp(t,e,{inverse:s})}copy(){return new an(this.ni,this.nj,this.ll_x,this.ll_y,this.ur_x,this.ur_y,this.satellite_lon)}getThinnedGrid(t,e){const{ni:i,nj:s,thin_x:n,thin_y:r,ll_x:o,ll_y:a,ur_x:l,ur_y:h}=this.thinnedGridParameters(t,e,this.ll_x,this.ll_y,this.ur_x,this.ur_y);return new an(i,s,o,a,l,h,this.satellite_lon,this.thin_x*n,this.thin_y*r)}}const ln={bluered:(t,e,i)=>Ri.diverging("#0000ff","#ff0000",t,e,i),redblue:(t,e,i)=>Ri.diverging("#ff0000","#0000ff",t,e,i),pw_speed500mb:Ii,pw_speed850mb:Di,pw_cape:Bi,pw_t2m:Pi,pw_td2m:Fi,nws_storm_clear_refl:Li,wv_cimss:zi};function hn(t){const e=void 0===(t=void 0===t?{}:t).contour_workers?1:t.contour_workers;D(t.wasm_base_url,e)}})(),s})());
|
|
3
3
|
//# sourceMappingURL=autumnplot-gl.js.map
|