gl-draw 0.2.14 → 0.2.15

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.
@@ -129,4 +129,4 @@ void main() {
129
129
  gl_FragColor.a *= step(vCounters, visibility);
130
130
  `).concat(s.ShaderChunk.fog_fragment,`
131
131
  }
132
- `),ie=function(e){"use strict";P(r,e);var i=B(r);function r(){C(this,r);var n;return n=i.call(this),n.isMeshLine=!0,n.type="MeshLine",n.positions=[],n.previous=[],n.next=[],n.side=[],n.width=[],n.indices_array=[],n.uvs=[],n.counters=[],n._points=[],n._geom=null,n.widthCallback=null,n.matrixWorld=new s.Matrix4,Object.defineProperties(V(n),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(t){this.setGeometry(t,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(t){this.setPoints(t,this.widthCallback)}}}),n}return r}(s.BufferGeometry);ie.prototype.setMatrixWorld=function(e){this.matrixWorld=e},ie.prototype.setGeometry=function(e,i){this._geometry=e,this.setPoints(e.getAttribute("position").array,i)},ie.prototype.setPoints=function(e,i){if(!(e instanceof Float32Array)&&!(e instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=e,this.widthCallback=i,this.positions=[],this.counters=[],e.length&&e[0]instanceof s.Vector3)for(var r=0;r<e.length;r++){var n=e[r],a=r/e.length;this.positions.push(n.x,n.y,n.z),this.positions.push(n.x,n.y,n.z),this.counters.push(a),this.counters.push(a)}else for(var r=0;r<e.length;r+=3){var a=r/e.length;this.positions.push(e[r],e[r+1],e[r+2]),this.positions.push(e[r],e[r+1],e[r+2]),this.counters.push(a),this.counters.push(a)}this.process()};function Fe(e,i){var r=new s.Matrix4,n=new s.Ray,a=new s.Sphere,t=new s.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),a.copy(o.boundingSphere),a.applyMatrix4(this.matrixWorld),e.ray.intersectSphere(a,t)!==!1){r.copy(this.matrixWorld).invert(),n.copy(e.ray).applyMatrix4(r);var c=new s.Vector3,h=new s.Vector3,v=new s.Vector3,d=this instanceof s.LineSegments?2:1,m=o.index,y=o.attributes;if(m!==null)for(var g=m.array,b=y.position.array,_=y.width.array,f=0,S=g.length-1;f<S;f+=d){var k=g[f],te=g[f+1];c.fromArray(b,k*3),h.fromArray(b,te*3);var E=_[Math.floor(f/3)]!==void 0?_[Math.floor(f/3)]:1,fe=e.params.Line.threshold+this.material.lineWidth*E/2,xe=fe*fe,pe=n.distanceSqToSegment(c,h,t,v);if(!(pe>xe)){t.applyMatrix4(this.matrixWorld);var ge=e.ray.origin.distanceTo(t);ge<e.near||ge>e.far||(i.push({distance:ge,point:v.clone().applyMatrix4(this.matrixWorld),index:f,face:null,faceIndex:null,object:this}),f=S)}}}}ie.prototype.raycast=Fe,ie.prototype.compareV3=function(e,i){var r=e*6,n=i*6;return this.positions[r]===this.positions[n]&&this.positions[r+1]===this.positions[n+1]&&this.positions[r+2]===this.positions[n+2]},ie.prototype.copyV3=function(e){var i=e*6;return[this.positions[i],this.positions[i+1],this.positions[i+2]]},ie.prototype.process=function(){var e=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var i,r;this.compareV3(0,e-1)?r=this.copyV3(e-2):r=this.copyV3(0),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);for(var n=0;n<e;n++){if(this.side.push(1),this.side.push(-1),this.widthCallback?i=this.widthCallback(n/(e-1)):i=1,this.width.push(i),this.width.push(i),this.uvs.push(n/(e-1),0),this.uvs.push(n/(e-1),1),n<e-1){r=this.copyV3(n),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var a=n*2;this.indices_array.push(a,a+1,a+2),this.indices_array.push(a+2,a+1,a+3)}n>0&&(r=this.copyV3(n),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}this.compareV3(e-1,0)?r=this.copyV3(1):r=this.copyV3(e-1),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new s.BufferAttribute(new Float32Array(this.positions),3),previous:new s.BufferAttribute(new Float32Array(this.previous),3),next:new s.BufferAttribute(new Float32Array(this.next),3),side:new s.BufferAttribute(new Float32Array(this.side),1),width:new s.BufferAttribute(new Float32Array(this.width),1),uv:new s.BufferAttribute(new Float32Array(this.uvs),2),index:new s.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new s.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function Be(e,i,r,n,a){var t;if(e=e.subarray||e.slice?e:e.buffer,r=r.subarray||r.slice?r:r.buffer,e=i?e.subarray?e.subarray(i,a&&i+a):e.slice(i,a&&i+a):e,r.set)r.set(e,n);else for(t=0;t<e.length;t++)r[t+n]=e[t];return r}ie.prototype.advance=function(e){var i=this._attributes.position.array,r=this._attributes.previous.array,n=this._attributes.next.array,a=i.length;Be(i,0,r,0,a),Be(i,6,i,0,a-6),i[a-6]=e.x,i[a-5]=e.y,i[a-4]=e.z,i[a-3]=e.x,i[a-2]=e.y,i[a-1]=e.z,Be(i,6,n,0,a-6),n[a-6]=e.x,n[a-5]=e.y,n[a-4]=e.z,n[a-3]=e.x,n[a-2]=e.y,n[a-1]=e.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},s.ShaderChunk.meshline_vert=ke,s.ShaderChunk.meshline_frag=Se;var Ge=function(e){"use strict";P(r,e);var i=B(r);function r(n){C(this,r);var a;return a=i.call(this,{uniforms:Object.assign({},s.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new s.Color(16777215)},opacity:{value:1},resolution:{value:new s.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new s.Vector2(1,1)},offset:{value:new s.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new s.Vector2(0,0)},lightColor:{value:new s.Color(16777215)}}),vertexShader:s.ShaderChunk.meshline_vert,fragmentShader:s.ShaderChunk.meshline_frag}),a.isMeshLineMaterial=!0,a.type="MeshLineMaterial",Object.defineProperties(V(a),{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(o){this.uniforms.lineWidth.value=o}},lineLightAnimation:{enumerable:!0,get:function(){return this.uniforms.lineLightAnimation.value},set:function(o){this.uniforms.lineLightAnimation.value=o}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(o){this.uniforms.map.value=o}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(o){this.uniforms.useMap.value=o}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(o){this.uniforms.alphaMap.value=o}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(o){this.uniforms.useAlphaMap.value=o}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(o){this.uniforms.color.value=o}},lightColor:{enumerable:!0,get:function(){return this.uniforms.lightColor.value},set:function(o){this.uniforms.lightColor.value=o}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(o){this.uniforms.time.value=o}},uCenter:{enumerable:!0,get:function(){return this.uniforms.uCenter.value},set:function(o){this.uniforms.uCenter.value=o}},size:{enumerable:!0,get:function(){return this.uniforms.size.value},set:function(o){this.uniforms.size.value=o}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(o){this.uniforms.opacity.value=o}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(o){this.uniforms.resolution.value.copy(o)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(o){this.uniforms.sizeAttenuation.value=o}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(o){this.uniforms.dashArray.value=o,this.useDash=o!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(o){this.uniforms.dashOffset.value=o}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(o){this.uniforms.dashRatio.value=o}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(o){this.uniforms.useDash.value=o}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(o){this.uniforms.visibility.value=o}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(o){this.uniforms.alphaTest.value=o}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(o){this.uniforms.repeat.value.copy(o)}}}),a.setValues(n),a}return r}(s.ShaderMaterial);Ge.prototype.copy=function(e){return s.ShaderMaterial.prototype.copy.call(this,e),this.lineWidth=e.lineWidth,this.map=e.map,this.useMap=e.useMap,this.alphaMap=e.alphaMap,this.useAlphaMap=e.useAlphaMap,this.color.copy(e.color),this.opacity=e.opacity,this.resolution.copy(e.resolution),this.sizeAttenuation=e.sizeAttenuation,this.dashArray.copy(e.dashArray),this.dashOffset.copy(e.dashOffset),this.dashRatio.copy(e.dashRatio),this.useDash=e.useDash,this.visibility=e.visibility,this.alphaTest=e.alphaTest,this.repeat.copy(e.repeat),this};function et(e,i){if(e==null)return{};var r={},n=Object.keys(e),a,t;for(t=0;t<n.length;t++)a=n[t],!(i.indexOf(a)>=0)&&(r[a]=e[a]);return r}function tt(e,i){if(e==null)return{};var r=et(e,i),n,a;if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);for(a=0;a<t.length;a++)n=t[a],!(i.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(e,n)||(r[n]=e[n]))}return r}var rt=require("popmotion"),Ze=require("three/examples/jsm//utils/BufferGeometryUtils");function Ne(e){var i=e.setPointWidth,r=e.nodes,n=new s.BufferGeometry,a=new ie;return n.setFromPoints(r),a.setGeometry(n,i),a}var nt={color:new s.Color("red"),lineWidth:3,sizeAttenuation:0},it=function(e){"use strict";P(r,e);var i=B(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};C(this,r);var t;return t=i.call(this),t.options=(0,O.Z)({},nt,a),t}var n=r.prototype;return n.create=function(){var t=this,o=this.options,c=o.duration,h=o.delay,v=o.onComplete,d=o.setPointWidth,m=o.key,y=o.nodes,g=o.nodesArr,b=o.workerScriptURL,_=o.useGroups,f=tt(o,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","workerScriptURL","useGroups"]),S=this.pencil.getSize(),k=S.width,te=S.height,E=new Ge(j((0,O.Z)({},f),{resolution:new s.Vector2(k,te)}));if(this.material=E,y)this.createMesh(Ne({nodes:y,setPointWidth:d}),E);else if(g&&b){var fe=new Worker(b);return fe.postMessage({nodesArr:g,useGroups:_}),new Promise(function(pe){fe.onmessage=function(ge){var Le=ge.data,he=Le.attributes,Me=Le.index,Pe=new s.BufferGeometry;Object.keys(he).forEach(function(Ae){Pe.setAttribute(Ae,new s.BufferAttribute(he[Ae].array,he[Ae].itemSize))}),Pe.setIndex(new s.BufferAttribute(Me.array,Me.itemSize)),t.createMesh(Pe,E),pe(""),fe.terminate()}})}else if(g){var xe=Ze.mergeBufferGeometries(g.map(function(pe){return Ne({nodes:pe,setPointWidth:d})}),_!=null?_:!1);this.createMesh(xe,E)}},n.resize=function(t,o){this.material.uniforms.resolution.value.set(t,o)},n.animate=function(){var t=this.options,o=t.duration,c=t.delay,h=t.onComplete,v=this.material.uniforms.offset,d=c!=null?c:0,m=(0,rt.animate)({from:v.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-d,repeat:1/0,onComplete:h,onUpdate:function(g){v.value.x=g.x}});this.tween=m},n.dispose=function(){var t;ne(z(r.prototype),"dispose",this).call(this),(t=this.tween)===null||t===void 0||t.stop()},r}(D);function at(e){if(Array.isArray(e))return e}function ot(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function me(e,i){return at(e)||$(e,i)||ee(e,i)||ot()}var Ce=require("d3-array"),st=require("earcut"),Ve=H.n(st),ut=require("@turf/boolean-clockwise"),ct=H.n(ut);function lt(e,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=(90-i)*Math.PI/180,a=(90-e)*Math.PI/180;return[r*Math.sin(n)*Math.cos(a),r*Math.cos(n),r*Math.sin(n)*Math.sin(a)]}var ft=require("delaunator"),ht=H.n(ft),pt=require("@turf/boolean-point-in-polygon"),vt=H.n(pt),Re=require("d3-geo"),dt=require("d3-geo-voronoi"),He=require("d3-scale");function mt(e,i){return e.map(function(r){var n=[],a;return r.forEach(function(t){if(a){var o=(0,Re.geoDistance)(t,a)*180/Math.PI;if(o>i)for(var c=(0,Re.geoInterpolate)(a,t),h=1/Math.ceil(o/i),v=h;v<1;)n.push(c(v)),v+=h}n.push(a=t)}),n})}function gt(e){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.minLng,n=i.maxLng,a=i.minLat,t=i.maxLat,o=Math.round(Math.pow(360/e,2)/Math.PI),c=(1+Math.sqrt(5))/2,h=function(S){return S/c*360%360-180},v=function(S){return Math.acos(2*S/o-1)/Math.PI*180-90},d=function(S){return o*(Math.cos((S+90)*Math.PI/180)+1)/2},m=[t!==void 0?Math.ceil(d(t)):0,a!==void 0?Math.floor(d(a)):o-1],y=r===void 0&&n===void 0?function(){return!0}:r===void 0?function(f){return f<=n}:n===void 0?function(f){return f>=r}:n>=r?function(f){return f>=r&&f<=n}:function(f){return f>=r||f<=n},g=[],b=m[0];b<=m[1];b++){var _=h(b);y(_)&&g.push([_,v(b)])}return g}function We(e,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,Re.geoContains)(i,e):vt()(e,i)}function yt(e,i){var r={type:"Polygon",coordinates:e},n=me((0,Re.geoBounds)(r),2),a=me(n[0],2),t=a[0],o=a[1],c=me(n[1],2),h=c[0],v=c[1];if(Math.min(Math.abs(h-t),Math.abs(v-o))<i)return[];var d=t>h||v>=89||o<=-89;return gt(i,{minLng:t,maxLng:h,minLat:o,maxLat:v}).filter(function(m){return We(m,r,d)})}function bt(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.resolution,n=r===void 0?1/0:r,a=mt(e,n),t=(0,Ce.merge)(a),o=yt(e,n),c=N(t).concat(N(o)),h={type:"Polygon",coordinates:e},v=me((0,Re.geoBounds)(h),2),d=me(v[0],2),m=d[0],y=d[1],g=me(v[1],2),b=g[0],_=g[1],f=m>b||_>=89||y<=-89,S=[];if(f){var k=(0,dt.geoVoronoi)(c).triangles(),te=new Map(c.map(function(ve,_e){var Oe=me(ve,2),de=Oe[0],je=Oe[1];return["".concat(de,"-").concat(je),_e]}));k.features.forEach(function(ve){var _e,Oe=ve.geometry.coordinates[0].slice(0,3).reverse(),de=[];if(Oe.forEach(function(ze){var Te=me(ze,2),we=Te[0],Ue=Te[1],Qe="".concat(we,"-").concat(Ue);te.has(Qe)&&de.push(te.get(Qe))}),de.length===3){if(de.some(function(ze){return ze<t.length})){var je=ve.properties.circumcenter;if(!We(je,h,f))return}(_e=S).push.apply(_e,N(de))}})}else if(o.length)for(var ge=function(_e,Oe){var de,je=[2,1,0].map(function(we){return Le.triangles[_e+we]}),ze=je.map(function(we){return c[we]});if(je.some(function(we){return we<t.length})){var Te=[0,1].map(function(we){return(0,Ce.mean)(ze,function(Ue){return Ue[we]})});if(!We(Te,h,f))return"continue"}(de=S).push.apply(de,N(je))},Le=ht().from(c),he=0,Me=Le.triangles.length;he<Me;he+=3)ge(he,Me);else{var E=Ve().flatten(a),fe=E.vertices,xe=E.holes,pe=xe===void 0?[]:xe;S=Ve()(fe,pe,2)}var Pe=(0,He.scaleLinear)((0,Ce.extent)(c,function(ve){return ve[0]}),[0,1]),Ae=(0,He.scaleLinear)((0,Ce.extent)(c,function(ve){return ve[1]}),[0,1]),Pt=c.map(function(ve){var _e=me(ve,2),Oe=_e[0],de=_e[1];return[Pe(Oe),Ae(de)]}),St={points:c,indices:S,uvs:Pt};return{contour:a,triangles:St}}var _t=bt,$e=new s.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function De(e,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=e.map(function(a){return a.map(function(t){var o=me(t,2),c=o[0],h=o[1];return r?lt(c,h,i):[c,h,i]})});return Ve().flatten(n)}function qe(e,i,r){for(var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=De(e,i,n),t=a.vertices,o=a.holes,c=De(e,r,n),h=c.vertices,v=(0,Ce.merge)([h,t]),d=Math.round(h.length/3),m=new Set(o),y=0,g=[],b=0;b<d;b++){var _=b+1;if(_===d)_=y;else if(m.has(_)){var f=_;_=y,y=f}g.push(b,b+d,_+d),g.push(_+d,_,b)}for(var S=[],k=1;k>=0;k--)for(var te=0;te<d;te+=1)S.push(te/(d-1),k);return{indices:g,vertices:v,uvs:S,topVerts:h}}function Ke(e,i,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return{indices:n?e.indices:e.indices.slice().reverse(),vertices:De([e.points],i,a).vertices,uvs:r}}var wt=function(e){"use strict";P(r,e);var i=B(r);function r(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};C(this,r);var t;t=i.call(this),t.type="PolygonBufferGeometry",t.parameters=(0,O.Z)({},{polygonGeoJson:n,startHeight:0,endHeight:1,closedBottom:!0,closedTop:!0,includeSides:!0,curvatureResolution:5,cartesian:!0,userDataRsoOffset:0},a);var o=t.parameters,c=o.startHeight,h=o.endHeight,v=o.closedBottom,d=o.closedTop,m=o.includeSides,y=o.curvatureResolution,g=o.cartesian,b=o.userDataRsoOffset;ct()(n[0])||n[0].reverse();var _=_t(n,{resolution:y}),f=_.contour,S=_.triangles,k=(0,Ce.merge)(S.uvs),te=[],E=[],fe=[],xe=0,pe=function(he){var Me=Math.round(te.length/3),Pe=fe.length;te=te.concat(he.vertices),E=E.concat(he.uvs),fe=fe.concat(Me?he.indices.map(function(Ae){return Ae+Me}):he.indices),t.addGroup(Pe,fe.length-Pe,xe++)};if(m){var ge=qe(f,c,h,g);pe(ge),t.userData.rso=b?qe(f,c,h+b,g):ge}return v&&pe(Ke(S,c,k,!1,g)),d&&pe(Ke(S,h,k,!0,g)),t.setIndex(fe),t[$e]("position",new s.Float32BufferAttribute(te,3)),t[$e]("uv",new s.Float32BufferAttribute(E,2)),t.computeVertexNormals(),t}return r}(s.BufferGeometry),xt=function(e){"use strict";P(r,e);var i=B(r);function r(a){C(this,r);var t;return t=i.call(this),t.options=(0,O.Z)({},{geojson:[[[]]],startHeight:0,height:5,closedBottom:!0,closedTop:!0,curvatureResolution:1,cartesian:!0,userDataRsoOffset:0},a),t}var n=r.prototype;return n.create=function(){var t=this.options,o=t.startHeight,c=t.height,h=t.closedBottom,v=t.closedTop,d=t.curvatureResolution,m=t.userDataRsoOffset,y=t.cartesian,g=new wt(this.options.geojson,{startHeight:o,endHeight:o+c,closedBottom:h,closedTop:v,curvatureResolution:d,cartesian:y,userDataRsoOffset:m});this.createMesh(g,this.options.material)},r}(D),Xe=H(818);function Ye(e){var i=e.split,r=e.depth,n=e.points,a=new s.ExtrudeGeometry(new s.Shape(n),{depth:r,bevelEnabled:!1,UVGenerator:(0,Xe.y)({split:i})});return(0,Xe.C)(),a}var Mt=function(e){"use strict";P(r,e);var i=B(r);function r(a){C(this,r);var t;return t=i.call(this),t.options=(0,O.Z)({},a),t}var n=r.prototype;return n.create=function(){var t=this,o=this.options,c=o.points,h=o.pointsArr,v=o.material,d=o.useGroups,m=o.depth,y=o.split,g=o.workerScriptURL;if(c)this.createMesh(Ye({points:c,depth:m,split:y}),v);else if(h&&g){var b=new Worker(g);return b.postMessage({pointsArr:h,depth:m,split:y,useGroups:d}),new Promise(function(f){b.onmessage=function(S){var k=S.data.attributes,te=new s.BufferGeometry;Object.keys(k).forEach(function(E){te.setAttribute(E,new s.BufferAttribute(k[E].array,k[E].itemSize))}),t.createMesh(te,v),f(""),b.terminate()}})}else if(h){var _=Ze.mergeBufferGeometries(h.map(function(f){return Ye({points:f,depth:m,split:y})}),d!=null?d:!1);this.createMesh(_,v)}},r}(D)})(),module.exports=Ee})();
132
+ `),ie=function(e){"use strict";P(r,e);var i=B(r);function r(){C(this,r);var n;return n=i.call(this),n.isMeshLine=!0,n.type="MeshLine",n.positions=[],n.previous=[],n.next=[],n.side=[],n.width=[],n.indices_array=[],n.uvs=[],n.counters=[],n._points=[],n._geom=null,n.widthCallback=null,n.matrixWorld=new s.Matrix4,Object.defineProperties(V(n),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(t){this.setGeometry(t,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(t){this.setPoints(t,this.widthCallback)}}}),n}return r}(s.BufferGeometry);ie.prototype.setMatrixWorld=function(e){this.matrixWorld=e},ie.prototype.setGeometry=function(e,i){this._geometry=e,this.setPoints(e.getAttribute("position").array,i)},ie.prototype.setPoints=function(e,i){if(!(e instanceof Float32Array)&&!(e instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=e,this.widthCallback=i,this.positions=[],this.counters=[],e.length&&e[0]instanceof s.Vector3)for(var r=0;r<e.length;r++){var n=e[r],a=r/e.length;this.positions.push(n.x,n.y,n.z),this.positions.push(n.x,n.y,n.z),this.counters.push(a),this.counters.push(a)}else for(var r=0;r<e.length;r+=3){var a=r/e.length;this.positions.push(e[r],e[r+1],e[r+2]),this.positions.push(e[r],e[r+1],e[r+2]),this.counters.push(a),this.counters.push(a)}this.process()};function Fe(e,i){var r=new s.Matrix4,n=new s.Ray,a=new s.Sphere,t=new s.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),a.copy(o.boundingSphere),a.applyMatrix4(this.matrixWorld),e.ray.intersectSphere(a,t)!==!1){r.copy(this.matrixWorld).invert(),n.copy(e.ray).applyMatrix4(r);var c=new s.Vector3,h=new s.Vector3,v=new s.Vector3,d=this instanceof s.LineSegments?2:1,m=o.index,y=o.attributes;if(m!==null)for(var g=m.array,b=y.position.array,_=y.width.array,f=0,S=g.length-1;f<S;f+=d){var k=g[f],te=g[f+1];c.fromArray(b,k*3),h.fromArray(b,te*3);var E=_[Math.floor(f/3)]!==void 0?_[Math.floor(f/3)]:1,fe=e.params.Line.threshold+this.material.lineWidth*E/2,xe=fe*fe,pe=n.distanceSqToSegment(c,h,t,v);if(!(pe>xe)){t.applyMatrix4(this.matrixWorld);var ge=e.ray.origin.distanceTo(t);ge<e.near||ge>e.far||(i.push({distance:ge,point:v.clone().applyMatrix4(this.matrixWorld),index:f,face:null,faceIndex:null,object:this}),f=S)}}}}ie.prototype.raycast=Fe,ie.prototype.compareV3=function(e,i){var r=e*6,n=i*6;return this.positions[r]===this.positions[n]&&this.positions[r+1]===this.positions[n+1]&&this.positions[r+2]===this.positions[n+2]},ie.prototype.copyV3=function(e){var i=e*6;return[this.positions[i],this.positions[i+1],this.positions[i+2]]},ie.prototype.process=function(){var e=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var i,r;this.compareV3(0,e-1)?r=this.copyV3(e-2):r=this.copyV3(0),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);for(var n=0;n<e;n++){if(this.side.push(1),this.side.push(-1),this.widthCallback?i=this.widthCallback(n/(e-1)):i=1,this.width.push(i),this.width.push(i),this.uvs.push(n/(e-1),0),this.uvs.push(n/(e-1),1),n<e-1){r=this.copyV3(n),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var a=n*2;this.indices_array.push(a,a+1,a+2),this.indices_array.push(a+2,a+1,a+3)}n>0&&(r=this.copyV3(n),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}this.compareV3(e-1,0)?r=this.copyV3(1):r=this.copyV3(e-1),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new s.BufferAttribute(new Float32Array(this.positions),3),previous:new s.BufferAttribute(new Float32Array(this.previous),3),next:new s.BufferAttribute(new Float32Array(this.next),3),side:new s.BufferAttribute(new Float32Array(this.side),1),width:new s.BufferAttribute(new Float32Array(this.width),1),uv:new s.BufferAttribute(new Float32Array(this.uvs),2),index:new s.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new s.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function Be(e,i,r,n,a){var t;if(e=e.subarray||e.slice?e:e.buffer,r=r.subarray||r.slice?r:r.buffer,e=i?e.subarray?e.subarray(i,a&&i+a):e.slice(i,a&&i+a):e,r.set)r.set(e,n);else for(t=0;t<e.length;t++)r[t+n]=e[t];return r}ie.prototype.advance=function(e){var i=this._attributes.position.array,r=this._attributes.previous.array,n=this._attributes.next.array,a=i.length;Be(i,0,r,0,a),Be(i,6,i,0,a-6),i[a-6]=e.x,i[a-5]=e.y,i[a-4]=e.z,i[a-3]=e.x,i[a-2]=e.y,i[a-1]=e.z,Be(i,6,n,0,a-6),n[a-6]=e.x,n[a-5]=e.y,n[a-4]=e.z,n[a-3]=e.x,n[a-2]=e.y,n[a-1]=e.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},s.ShaderChunk.meshline_vert=ke,s.ShaderChunk.meshline_frag=Se;var Ge=function(e){"use strict";P(r,e);var i=B(r);function r(n){C(this,r);var a;return a=i.call(this,{uniforms:Object.assign({},s.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new s.Color(16777215)},opacity:{value:1},resolution:{value:new s.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new s.Vector2(1,1)},offset:{value:new s.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new s.Vector2(0,0)},lightColor:{value:new s.Color(16777215)}}),vertexShader:s.ShaderChunk.meshline_vert,fragmentShader:s.ShaderChunk.meshline_frag}),a.isMeshLineMaterial=!0,a.type="MeshLineMaterial",Object.defineProperties(V(a),{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(o){this.uniforms.lineWidth.value=o}},lineLightAnimation:{enumerable:!0,get:function(){return this.uniforms.lineLightAnimation.value},set:function(o){this.uniforms.lineLightAnimation.value=o}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(o){this.uniforms.map.value=o}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(o){this.uniforms.useMap.value=o}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(o){this.uniforms.alphaMap.value=o}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(o){this.uniforms.useAlphaMap.value=o}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(o){this.uniforms.color.value=o}},lightColor:{enumerable:!0,get:function(){return this.uniforms.lightColor.value},set:function(o){this.uniforms.lightColor.value=o}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(o){this.uniforms.time.value=o}},uCenter:{enumerable:!0,get:function(){return this.uniforms.uCenter.value},set:function(o){this.uniforms.uCenter.value=o}},size:{enumerable:!0,get:function(){return this.uniforms.size.value},set:function(o){this.uniforms.size.value=o}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(o){this.uniforms.opacity.value=o}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(o){this.uniforms.resolution.value.copy(o)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(o){this.uniforms.sizeAttenuation.value=o}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(o){this.uniforms.dashArray.value=o,this.useDash=o!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(o){this.uniforms.dashOffset.value=o}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(o){this.uniforms.dashRatio.value=o}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(o){this.uniforms.useDash.value=o}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(o){this.uniforms.visibility.value=o}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(o){this.uniforms.alphaTest.value=o}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(o){this.uniforms.repeat.value.copy(o)}}}),a.setValues(n),a}return r}(s.ShaderMaterial);Ge.prototype.copy=function(e){return s.ShaderMaterial.prototype.copy.call(this,e),this.lineWidth=e.lineWidth,this.map=e.map,this.useMap=e.useMap,this.alphaMap=e.alphaMap,this.useAlphaMap=e.useAlphaMap,this.color.copy(e.color),this.opacity=e.opacity,this.resolution.copy(e.resolution),this.sizeAttenuation=e.sizeAttenuation,this.dashArray.copy(e.dashArray),this.dashOffset.copy(e.dashOffset),this.dashRatio.copy(e.dashRatio),this.useDash=e.useDash,this.visibility=e.visibility,this.alphaTest=e.alphaTest,this.repeat.copy(e.repeat),this};function et(e,i){if(e==null)return{};var r={},n=Object.keys(e),a,t;for(t=0;t<n.length;t++)a=n[t],!(i.indexOf(a)>=0)&&(r[a]=e[a]);return r}function tt(e,i){if(e==null)return{};var r=et(e,i),n,a;if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);for(a=0;a<t.length;a++)n=t[a],!(i.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(e,n)||(r[n]=e[n]))}return r}var rt=require("popmotion"),Ze=require("three/examples/jsm//utils/BufferGeometryUtils");function Ne(e){var i=e.setPointWidth,r=e.nodes,n=new s.BufferGeometry,a=new ie;return n.setFromPoints(r),a.setGeometry(n,i),a}var nt={color:new s.Color("#ffffff"),lineWidth:3,sizeAttenuation:0},it=function(e){"use strict";P(r,e);var i=B(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};C(this,r);var t;return t=i.call(this),t.options=(0,O.Z)({},nt,a),t}var n=r.prototype;return n.create=function(){var t=this,o=this.options,c=o.duration,h=o.delay,v=o.onComplete,d=o.setPointWidth,m=o.key,y=o.nodes,g=o.nodesArr,b=o.workerScriptURL,_=o.useGroups,f=tt(o,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","workerScriptURL","useGroups"]),S=this.pencil.getSize(),k=S.width,te=S.height,E=new Ge(j((0,O.Z)({},f),{resolution:new s.Vector2(k,te)}));if(this.material=E,y)this.createMesh(Ne({nodes:y,setPointWidth:d}),E);else if(g&&b){var fe=new Worker(b);return fe.postMessage({nodesArr:g,useGroups:_}),new Promise(function(pe){fe.onmessage=function(ge){var Le=ge.data,he=Le.attributes,Me=Le.index,Pe=new s.BufferGeometry;Object.keys(he).forEach(function(Ae){Pe.setAttribute(Ae,new s.BufferAttribute(he[Ae].array,he[Ae].itemSize))}),Pe.setIndex(new s.BufferAttribute(Me.array,Me.itemSize)),t.createMesh(Pe,E),pe(""),fe.terminate()}})}else if(g){var xe=Ze.mergeBufferGeometries(g.map(function(pe){return Ne({nodes:pe,setPointWidth:d})}),_!=null?_:!1);this.createMesh(xe,E)}},n.resize=function(t,o){this.material.uniforms.resolution.value.set(t,o)},n.animate=function(){var t=this.options,o=t.duration,c=t.delay,h=t.onComplete,v=this.material.uniforms.offset,d=c!=null?c:0,m=(0,rt.animate)({from:v.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-d,repeat:1/0,onComplete:h,onUpdate:function(g){v.value.x=g.x}});this.tween=m},n.dispose=function(){var t;ne(z(r.prototype),"dispose",this).call(this),(t=this.tween)===null||t===void 0||t.stop()},r}(D);function at(e){if(Array.isArray(e))return e}function ot(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function me(e,i){return at(e)||$(e,i)||ee(e,i)||ot()}var Ce=require("d3-array"),st=require("earcut"),Ve=H.n(st),ut=require("@turf/boolean-clockwise"),ct=H.n(ut);function lt(e,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=(90-i)*Math.PI/180,a=(90-e)*Math.PI/180;return[r*Math.sin(n)*Math.cos(a),r*Math.cos(n),r*Math.sin(n)*Math.sin(a)]}var ft=require("delaunator"),ht=H.n(ft),pt=require("@turf/boolean-point-in-polygon"),vt=H.n(pt),Re=require("d3-geo"),dt=require("d3-geo-voronoi"),He=require("d3-scale");function mt(e,i){return e.map(function(r){var n=[],a;return r.forEach(function(t){if(a){var o=(0,Re.geoDistance)(t,a)*180/Math.PI;if(o>i)for(var c=(0,Re.geoInterpolate)(a,t),h=1/Math.ceil(o/i),v=h;v<1;)n.push(c(v)),v+=h}n.push(a=t)}),n})}function gt(e){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.minLng,n=i.maxLng,a=i.minLat,t=i.maxLat,o=Math.round(Math.pow(360/e,2)/Math.PI),c=(1+Math.sqrt(5))/2,h=function(S){return S/c*360%360-180},v=function(S){return Math.acos(2*S/o-1)/Math.PI*180-90},d=function(S){return o*(Math.cos((S+90)*Math.PI/180)+1)/2},m=[t!==void 0?Math.ceil(d(t)):0,a!==void 0?Math.floor(d(a)):o-1],y=r===void 0&&n===void 0?function(){return!0}:r===void 0?function(f){return f<=n}:n===void 0?function(f){return f>=r}:n>=r?function(f){return f>=r&&f<=n}:function(f){return f>=r||f<=n},g=[],b=m[0];b<=m[1];b++){var _=h(b);y(_)&&g.push([_,v(b)])}return g}function We(e,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,Re.geoContains)(i,e):vt()(e,i)}function yt(e,i){var r={type:"Polygon",coordinates:e},n=me((0,Re.geoBounds)(r),2),a=me(n[0],2),t=a[0],o=a[1],c=me(n[1],2),h=c[0],v=c[1];if(Math.min(Math.abs(h-t),Math.abs(v-o))<i)return[];var d=t>h||v>=89||o<=-89;return gt(i,{minLng:t,maxLng:h,minLat:o,maxLat:v}).filter(function(m){return We(m,r,d)})}function bt(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.resolution,n=r===void 0?1/0:r,a=mt(e,n),t=(0,Ce.merge)(a),o=yt(e,n),c=N(t).concat(N(o)),h={type:"Polygon",coordinates:e},v=me((0,Re.geoBounds)(h),2),d=me(v[0],2),m=d[0],y=d[1],g=me(v[1],2),b=g[0],_=g[1],f=m>b||_>=89||y<=-89,S=[];if(f){var k=(0,dt.geoVoronoi)(c).triangles(),te=new Map(c.map(function(ve,_e){var Oe=me(ve,2),de=Oe[0],je=Oe[1];return["".concat(de,"-").concat(je),_e]}));k.features.forEach(function(ve){var _e,Oe=ve.geometry.coordinates[0].slice(0,3).reverse(),de=[];if(Oe.forEach(function(ze){var Te=me(ze,2),we=Te[0],Ue=Te[1],Qe="".concat(we,"-").concat(Ue);te.has(Qe)&&de.push(te.get(Qe))}),de.length===3){if(de.some(function(ze){return ze<t.length})){var je=ve.properties.circumcenter;if(!We(je,h,f))return}(_e=S).push.apply(_e,N(de))}})}else if(o.length)for(var ge=function(_e,Oe){var de,je=[2,1,0].map(function(we){return Le.triangles[_e+we]}),ze=je.map(function(we){return c[we]});if(je.some(function(we){return we<t.length})){var Te=[0,1].map(function(we){return(0,Ce.mean)(ze,function(Ue){return Ue[we]})});if(!We(Te,h,f))return"continue"}(de=S).push.apply(de,N(je))},Le=ht().from(c),he=0,Me=Le.triangles.length;he<Me;he+=3)ge(he,Me);else{var E=Ve().flatten(a),fe=E.vertices,xe=E.holes,pe=xe===void 0?[]:xe;S=Ve()(fe,pe,2)}var Pe=(0,He.scaleLinear)((0,Ce.extent)(c,function(ve){return ve[0]}),[0,1]),Ae=(0,He.scaleLinear)((0,Ce.extent)(c,function(ve){return ve[1]}),[0,1]),Pt=c.map(function(ve){var _e=me(ve,2),Oe=_e[0],de=_e[1];return[Pe(Oe),Ae(de)]}),St={points:c,indices:S,uvs:Pt};return{contour:a,triangles:St}}var _t=bt,$e=new s.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function De(e,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=e.map(function(a){return a.map(function(t){var o=me(t,2),c=o[0],h=o[1];return r?lt(c,h,i):[c,h,i]})});return Ve().flatten(n)}function qe(e,i,r){for(var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=De(e,i,n),t=a.vertices,o=a.holes,c=De(e,r,n),h=c.vertices,v=(0,Ce.merge)([h,t]),d=Math.round(h.length/3),m=new Set(o),y=0,g=[],b=0;b<d;b++){var _=b+1;if(_===d)_=y;else if(m.has(_)){var f=_;_=y,y=f}g.push(b,b+d,_+d),g.push(_+d,_,b)}for(var S=[],k=1;k>=0;k--)for(var te=0;te<d;te+=1)S.push(te/(d-1),k);return{indices:g,vertices:v,uvs:S,topVerts:h}}function Ke(e,i,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return{indices:n?e.indices:e.indices.slice().reverse(),vertices:De([e.points],i,a).vertices,uvs:r}}var wt=function(e){"use strict";P(r,e);var i=B(r);function r(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};C(this,r);var t;t=i.call(this),t.type="PolygonBufferGeometry",t.parameters=(0,O.Z)({},{polygonGeoJson:n,startHeight:0,endHeight:1,closedBottom:!0,closedTop:!0,includeSides:!0,curvatureResolution:5,cartesian:!0,userDataRsoOffset:0},a);var o=t.parameters,c=o.startHeight,h=o.endHeight,v=o.closedBottom,d=o.closedTop,m=o.includeSides,y=o.curvatureResolution,g=o.cartesian,b=o.userDataRsoOffset;ct()(n[0])||n[0].reverse();var _=_t(n,{resolution:y}),f=_.contour,S=_.triangles,k=(0,Ce.merge)(S.uvs),te=[],E=[],fe=[],xe=0,pe=function(he){var Me=Math.round(te.length/3),Pe=fe.length;te=te.concat(he.vertices),E=E.concat(he.uvs),fe=fe.concat(Me?he.indices.map(function(Ae){return Ae+Me}):he.indices),t.addGroup(Pe,fe.length-Pe,xe++)};if(m){var ge=qe(f,c,h,g);pe(ge),t.userData.rso=b?qe(f,c,h+b,g):ge}return v&&pe(Ke(S,c,k,!1,g)),d&&pe(Ke(S,h,k,!0,g)),t.setIndex(fe),t[$e]("position",new s.Float32BufferAttribute(te,3)),t[$e]("uv",new s.Float32BufferAttribute(E,2)),t.computeVertexNormals(),t}return r}(s.BufferGeometry),xt=function(e){"use strict";P(r,e);var i=B(r);function r(a){C(this,r);var t;return t=i.call(this),t.options=(0,O.Z)({},{geojson:[[[]]],startHeight:0,height:5,closedBottom:!0,closedTop:!0,curvatureResolution:1,cartesian:!0,userDataRsoOffset:0},a),t}var n=r.prototype;return n.create=function(){var t=this.options,o=t.startHeight,c=t.height,h=t.closedBottom,v=t.closedTop,d=t.curvatureResolution,m=t.userDataRsoOffset,y=t.cartesian,g=new wt(this.options.geojson,{startHeight:o,endHeight:o+c,closedBottom:h,closedTop:v,curvatureResolution:d,cartesian:y,userDataRsoOffset:m});this.createMesh(g,this.options.material)},r}(D),Xe=H(818);function Ye(e){var i=e.split,r=e.depth,n=e.points,a=new s.ExtrudeGeometry(new s.Shape(n),{depth:r,bevelEnabled:!1,UVGenerator:(0,Xe.y)({split:i})});return(0,Xe.C)(),a}var Mt=function(e){"use strict";P(r,e);var i=B(r);function r(a){C(this,r);var t;return t=i.call(this),t.options=(0,O.Z)({},a),t}var n=r.prototype;return n.create=function(){var t=this,o=this.options,c=o.points,h=o.pointsArr,v=o.material,d=o.useGroups,m=o.depth,y=o.split,g=o.workerScriptURL;if(c)this.createMesh(Ye({points:c,depth:m,split:y}),v);else if(h&&g){var b=new Worker(g);return b.postMessage({pointsArr:h,depth:m,split:y,useGroups:d}),new Promise(function(f){b.onmessage=function(S){var k=S.data.attributes,te=new s.BufferGeometry;Object.keys(k).forEach(function(E){te.setAttribute(E,new s.BufferAttribute(k[E].array,k[E].itemSize))}),t.createMesh(te,v),f(""),b.terminate()}})}else if(h){var _=Ze.mergeBufferGeometries(h.map(function(f){return Ye({points:f,depth:m,split:y})}),d!=null?d:!1);this.createMesh(_,v)}},r}(D)})(),module.exports=Ee})();
@@ -129,4 +129,4 @@ void main() {
129
129
  gl_FragColor.a *= step(vCounters, visibility);
130
130
  `).concat(s.ShaderChunk.fog_fragment,`
131
131
  }
132
- `),_e=function(e){"use strict";M(r,e);var n=k(r);function r(){j(this,r);var i;return i=n.call(this),i.isMeshLine=!0,i.type="MeshLine",i.positions=[],i.previous=[],i.next=[],i.side=[],i.width=[],i.indices_array=[],i.uvs=[],i.counters=[],i._points=[],i._geom=null,i.widthCallback=null,i.matrixWorld=new s.Matrix4,Object.defineProperties(T(i),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(t){this.setGeometry(t,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(t){this.setPoints(t,this.widthCallback)}}}),i}return r}(s.BufferGeometry);_e.prototype.setMatrixWorld=function(e){this.matrixWorld=e},_e.prototype.setGeometry=function(e,n){this._geometry=e,this.setPoints(e.getAttribute("position").array,n)},_e.prototype.setPoints=function(e,n){if(!(e instanceof Float32Array)&&!(e instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=e,this.widthCallback=n,this.positions=[],this.counters=[],e.length&&e[0]instanceof s.Vector3)for(var r=0;r<e.length;r++){var i=e[r],a=r/e.length;this.positions.push(i.x,i.y,i.z),this.positions.push(i.x,i.y,i.z),this.counters.push(a),this.counters.push(a)}else for(var r=0;r<e.length;r+=3){var a=r/e.length;this.positions.push(e[r],e[r+1],e[r+2]),this.positions.push(e[r],e[r+1],e[r+2]),this.counters.push(a),this.counters.push(a)}this.process()};function Xe(e,n){var r=new s.Matrix4,i=new s.Ray,a=new s.Sphere,t=new s.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),a.copy(o.boundingSphere),a.applyMatrix4(this.matrixWorld),e.ray.intersectSphere(a,t)!==!1){r.copy(this.matrixWorld).invert(),i.copy(e.ray).applyMatrix4(r);var c=new s.Vector3,h=new s.Vector3,v=new s.Vector3,d=this instanceof s.LineSegments?2:1,m=o.index,g=o.attributes;if(m!==null)for(var _=m.array,y=g.position.array,w=g.width.array,f=0,O=_.length-1;f<O;f+=d){var E=_[f],ie=_[f+1];c.fromArray(y,E*3),h.fromArray(y,ie*3);var G=w[Math.floor(f/3)]!==void 0?w[Math.floor(f/3)]:1,fe=e.params.Line.threshold+this.material.lineWidth*G/2,Ae=fe*fe,pe=i.distanceSqToSegment(c,h,t,v);if(!(pe>Ae)){t.applyMatrix4(this.matrixWorld);var ye=e.ray.origin.distanceTo(t);ye<e.near||ye>e.far||(n.push({distance:ye,point:v.clone().applyMatrix4(this.matrixWorld),index:f,face:null,faceIndex:null,object:this}),f=O)}}}}_e.prototype.raycast=Xe,_e.prototype.compareV3=function(e,n){var r=e*6,i=n*6;return this.positions[r]===this.positions[i]&&this.positions[r+1]===this.positions[i+1]&&this.positions[r+2]===this.positions[i+2]},_e.prototype.copyV3=function(e){var n=e*6;return[this.positions[n],this.positions[n+1],this.positions[n+2]]},_e.prototype.process=function(){var e=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var n,r;this.compareV3(0,e-1)?r=this.copyV3(e-2):r=this.copyV3(0),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);for(var i=0;i<e;i++){if(this.side.push(1),this.side.push(-1),this.widthCallback?n=this.widthCallback(i/(e-1)):n=1,this.width.push(n),this.width.push(n),this.uvs.push(i/(e-1),0),this.uvs.push(i/(e-1),1),i<e-1){r=this.copyV3(i),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var a=i*2;this.indices_array.push(a,a+1,a+2),this.indices_array.push(a+2,a+1,a+3)}i>0&&(r=this.copyV3(i),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}this.compareV3(e-1,0)?r=this.copyV3(1):r=this.copyV3(e-1),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new s.BufferAttribute(new Float32Array(this.positions),3),previous:new s.BufferAttribute(new Float32Array(this.previous),3),next:new s.BufferAttribute(new Float32Array(this.next),3),side:new s.BufferAttribute(new Float32Array(this.side),1),width:new s.BufferAttribute(new Float32Array(this.width),1),uv:new s.BufferAttribute(new Float32Array(this.uvs),2),index:new s.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new s.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function We(e,n,r,i,a){var t;if(e=e.subarray||e.slice?e:e.buffer,r=r.subarray||r.slice?r:r.buffer,e=n?e.subarray?e.subarray(n,a&&n+a):e.slice(n,a&&n+a):e,r.set)r.set(e,i);else for(t=0;t<e.length;t++)r[t+i]=e[t];return r}_e.prototype.advance=function(e){var n=this._attributes.position.array,r=this._attributes.previous.array,i=this._attributes.next.array,a=n.length;We(n,0,r,0,a),We(n,6,n,0,a-6),n[a-6]=e.x,n[a-5]=e.y,n[a-4]=e.z,n[a-3]=e.x,n[a-2]=e.y,n[a-1]=e.z,We(n,6,i,0,a-6),i[a-6]=e.x,i[a-5]=e.y,i[a-4]=e.z,i[a-3]=e.x,i[a-2]=e.y,i[a-1]=e.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},s.ShaderChunk.meshline_vert=ot,s.ShaderChunk.meshline_frag=st;var Ve=function(e){"use strict";M(r,e);var n=k(r);function r(i){j(this,r);var a;return a=n.call(this,{uniforms:Object.assign({},s.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new s.Color(16777215)},opacity:{value:1},resolution:{value:new s.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new s.Vector2(1,1)},offset:{value:new s.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new s.Vector2(0,0)},lightColor:{value:new s.Color(16777215)}}),vertexShader:s.ShaderChunk.meshline_vert,fragmentShader:s.ShaderChunk.meshline_frag}),a.isMeshLineMaterial=!0,a.type="MeshLineMaterial",Object.defineProperties(T(a),{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(o){this.uniforms.lineWidth.value=o}},lineLightAnimation:{enumerable:!0,get:function(){return this.uniforms.lineLightAnimation.value},set:function(o){this.uniforms.lineLightAnimation.value=o}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(o){this.uniforms.map.value=o}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(o){this.uniforms.useMap.value=o}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(o){this.uniforms.alphaMap.value=o}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(o){this.uniforms.useAlphaMap.value=o}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(o){this.uniforms.color.value=o}},lightColor:{enumerable:!0,get:function(){return this.uniforms.lightColor.value},set:function(o){this.uniforms.lightColor.value=o}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(o){this.uniforms.time.value=o}},uCenter:{enumerable:!0,get:function(){return this.uniforms.uCenter.value},set:function(o){this.uniforms.uCenter.value=o}},size:{enumerable:!0,get:function(){return this.uniforms.size.value},set:function(o){this.uniforms.size.value=o}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(o){this.uniforms.opacity.value=o}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(o){this.uniforms.resolution.value.copy(o)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(o){this.uniforms.sizeAttenuation.value=o}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(o){this.uniforms.dashArray.value=o,this.useDash=o!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(o){this.uniforms.dashOffset.value=o}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(o){this.uniforms.dashRatio.value=o}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(o){this.uniforms.useDash.value=o}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(o){this.uniforms.visibility.value=o}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(o){this.uniforms.alphaTest.value=o}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(o){this.uniforms.repeat.value.copy(o)}}}),a.setValues(i),a}return r}(s.ShaderMaterial);Ve.prototype.copy=function(e){return s.ShaderMaterial.prototype.copy.call(this,e),this.lineWidth=e.lineWidth,this.map=e.map,this.useMap=e.useMap,this.alphaMap=e.alphaMap,this.useAlphaMap=e.useAlphaMap,this.color.copy(e.color),this.opacity=e.opacity,this.resolution.copy(e.resolution),this.sizeAttenuation=e.sizeAttenuation,this.dashArray.copy(e.dashArray),this.dashOffset.copy(e.dashOffset),this.dashRatio.copy(e.dashRatio),this.useDash=e.useDash,this.visibility=e.visibility,this.alphaTest=e.alphaTest,this.repeat.copy(e.repeat),this};function ut(e,n){if(e==null)return{};var r={},i=Object.keys(e),a,t;for(t=0;t<i.length;t++)a=i[t],!(n.indexOf(a)>=0)&&(r[a]=e[a]);return r}function ct(e,n){if(e==null)return{};var r=ut(e,n),i,a;if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);for(a=0;a<t.length;a++)i=t[a],!(n.indexOf(i)>=0)&&(!Object.prototype.propertyIsEnumerable.call(e,i)||(r[i]=e[i]))}return r}var lt=e=>{var n={};return N.d(n,e),n},or=e=>()=>e,ft=lt({animate:()=>Ut.animate}),ht=e=>{var n={};return N.d(n,e),n},sr=e=>()=>e,He=ht({mergeBufferGeometries:()=>Nt.mergeBufferGeometries});function Ke(e){var n=e.setPointWidth,r=e.nodes,i=new s.BufferGeometry,a=new _e;return i.setFromPoints(r),a.setGeometry(i,n),a}var pt={color:new s.Color("red"),lineWidth:3,sizeAttenuation:0},vt=function(e){"use strict";M(r,e);var n=k(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};j(this,r);var t;return t=n.call(this),t.options=(0,A.Z)({},pt,a),t}var i=r.prototype;return i.create=function(){var t=this,o=this.options,c=o.duration,h=o.delay,v=o.onComplete,d=o.setPointWidth,m=o.key,g=o.nodes,_=o.nodesArr,y=o.workerScriptURL,w=o.useGroups,f=ct(o,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","workerScriptURL","useGroups"]),O=this.pencil.getSize(),E=O.width,ie=O.height,G=new Ve(P((0,A.Z)({},f),{resolution:new s.Vector2(E,ie)}));if(this.material=G,g)this.createMesh(Ke({nodes:g,setPointWidth:d}),G);else if(_&&y){var fe=new Worker(y);return fe.postMessage({nodesArr:_,useGroups:w}),new Promise(function(pe){fe.onmessage=function(ye){var Re=ye.data,he=Re.attributes,Se=Re.index,Me=new s.BufferGeometry;Object.keys(he).forEach(function(Ce){Me.setAttribute(Ce,new s.BufferAttribute(he[Ce].array,he[Ce].itemSize))}),Me.setIndex(new s.BufferAttribute(Se.array,Se.itemSize)),t.createMesh(Me,G),pe(""),fe.terminate()}})}else if(_){var Ae=He.mergeBufferGeometries(_.map(function(pe){return Ke({nodes:pe,setPointWidth:d})}),w!=null?w:!1);this.createMesh(Ae,G)}},i.resize=function(t,o){this.material.uniforms.resolution.value.set(t,o)},i.animate=function(){var t=this.options,o=t.duration,c=t.delay,h=t.onComplete,v=this.material.uniforms.offset,d=c!=null?c:0,m=(0,ft.animate)({from:v.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-d,repeat:1/0,onComplete:h,onUpdate:function(_){v.value.x=_.x}});this.tween=m},i.dispose=function(){var t;Oe(W(r.prototype),"dispose",this).call(this),(t=this.tween)===null||t===void 0||t.stop()},r}(p);function dt(e){if(Array.isArray(e))return e}function mt(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ge(e,n){return dt(e)||Z(e,n)||J(e,n)||mt()}var _t=e=>{var n={};return N.d(n,e),n},ur=e=>()=>e,Be=_t({extent:()=>Ze.extent,mean:()=>Ze.mean,merge:()=>Ze.merge}),gt=e=>{var n={};return N.d(n,e),n},cr=e=>()=>e,Ue=gt({default:()=>It.default}),yt=e=>{var n={};return N.d(n,e),n},lr=e=>()=>e,bt=yt({default:()=>Ft.default});function wt(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=(90-n)*Math.PI/180,a=(90-e)*Math.PI/180;return[r*Math.sin(i)*Math.cos(a),r*Math.cos(i),r*Math.sin(i)*Math.sin(a)]}var xt=e=>{var n={};return N.d(n,e),n},fr=e=>()=>e,At=xt({default:()=>Zt.default}),St=e=>{var n={};return N.d(n,e),n},hr=e=>()=>e,Mt=St({default:()=>Xt.default}),Pt=e=>{var n={};return N.d(n,e),n},pr=e=>()=>e,Te=Pt({geoBounds:()=>De.geoBounds,geoContains:()=>De.geoContains,geoDistance:()=>De.geoDistance,geoInterpolate:()=>De.geoInterpolate}),Ot=e=>{var n={};return N.d(n,e),n},vr=e=>()=>e,Lt=Ot({geoVoronoi:()=>Ht.geoVoronoi}),Ct=e=>{var n={};return N.d(n,e),n},dr=e=>()=>e,$e=Ct({scaleLinear:()=>Kt.scaleLinear});function Et(e,n){return e.map(function(r){var i=[],a;return r.forEach(function(t){if(a){var o=(0,Te.geoDistance)(t,a)*180/Math.PI;if(o>n)for(var c=(0,Te.geoInterpolate)(a,t),h=1/Math.ceil(o/n),v=h;v<1;)i.push(c(v)),v+=h}i.push(a=t)}),i})}function jt(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.minLng,i=n.maxLng,a=n.minLat,t=n.maxLat,o=Math.round(Math.pow(360/e,2)/Math.PI),c=(1+Math.sqrt(5))/2,h=function(O){return O/c*360%360-180},v=function(O){return Math.acos(2*O/o-1)/Math.PI*180-90},d=function(O){return o*(Math.cos((O+90)*Math.PI/180)+1)/2},m=[t!==void 0?Math.ceil(d(t)):0,a!==void 0?Math.floor(d(a)):o-1],g=r===void 0&&i===void 0?function(){return!0}:r===void 0?function(f){return f<=i}:i===void 0?function(f){return f>=r}:i>=r?function(f){return f>=r&&f<=i}:function(f){return f>=r||f<=i},_=[],y=m[0];y<=m[1];y++){var w=h(y);g(w)&&_.push([w,v(y)])}return _}function Ne(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,Te.geoContains)(n,e):(0,Mt.default)(e,n)}function Bt(e,n){var r={type:"Polygon",coordinates:e},i=ge((0,Te.geoBounds)(r),2),a=ge(i[0],2),t=a[0],o=a[1],c=ge(i[1],2),h=c[0],v=c[1];if(Math.min(Math.abs(h-t),Math.abs(v-o))<n)return[];var d=t>h||v>=89||o<=-89;return jt(n,{minLng:t,maxLng:h,minLat:o,maxLat:v}).filter(function(m){return Ne(m,r,d)})}function Rt(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.resolution,i=r===void 0?1/0:r,a=Et(e,i),t=(0,Be.merge)(a),o=Bt(e,i),c=U(t).concat(U(o)),h={type:"Polygon",coordinates:e},v=ge((0,Te.geoBounds)(h),2),d=ge(v[0],2),m=d[0],g=d[1],_=ge(v[1],2),y=_[0],w=_[1],f=m>y||w>=89||g<=-89,O=[];if(f){var E=(0,Lt.geoVoronoi)(c).triangles(),ie=new Map(c.map(function(ve,we){var Ee=ge(ve,2),de=Ee[0],je=Ee[1];return["".concat(de,"-").concat(je),we]}));E.features.forEach(function(ve){var we,Ee=ve.geometry.coordinates[0].slice(0,3).reverse(),de=[];if(Ee.forEach(function(Ge){var ze=ge(Ge,2),xe=ze[0],Fe=ze[1],tt="".concat(xe,"-").concat(Fe);ie.has(tt)&&de.push(ie.get(tt))}),de.length===3){if(de.some(function(Ge){return Ge<t.length})){var je=ve.properties.circumcenter;if(!Ne(je,h,f))return}(we=O).push.apply(we,U(de))}})}else if(o.length)for(var ye=function(we,Ee){var de,je=[2,1,0].map(function(xe){return Re.triangles[we+xe]}),Ge=je.map(function(xe){return c[xe]});if(je.some(function(xe){return xe<t.length})){var ze=[0,1].map(function(xe){return(0,Be.mean)(Ge,function(Fe){return Fe[xe]})});if(!Ne(ze,h,f))return"continue"}(de=O).push.apply(de,U(je))},Re=At.default.from(c),he=0,Se=Re.triangles.length;he<Se;he+=3)ye(he,Se);else{var G=Ue.default.flatten(a),fe=G.vertices,Ae=G.holes,pe=Ae===void 0?[]:Ae;O=(0,Ue.default)(fe,pe,2)}var Me=(0,$e.scaleLinear)((0,Be.extent)(c,function(ve){return ve[0]}),[0,1]),Ce=(0,$e.scaleLinear)((0,Be.extent)(c,function(ve){return ve[1]}),[0,1]),Dt=c.map(function(ve){var we=ge(ve,2),Ee=we[0],de=we[1];return[Me(Ee),Ce(de)]}),Wt={points:c,indices:O,uvs:Dt};return{contour:a,triangles:Wt}}var kt=Rt,Ye=new s.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function Ie(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=e.map(function(a){return a.map(function(t){var o=ge(t,2),c=o[0],h=o[1];return r?wt(c,h,n):[c,h,n]})});return Ue.default.flatten(i)}function Je(e,n,r){for(var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=Ie(e,n,i),t=a.vertices,o=a.holes,c=Ie(e,r,i),h=c.vertices,v=(0,Be.merge)([h,t]),d=Math.round(h.length/3),m=new Set(o),g=0,_=[],y=0;y<d;y++){var w=y+1;if(w===d)w=g;else if(m.has(w)){var f=w;w=g,g=f}_.push(y,y+d,w+d),_.push(w+d,w,y)}for(var O=[],E=1;E>=0;E--)for(var ie=0;ie<d;ie+=1)O.push(ie/(d-1),E);return{indices:_,vertices:v,uvs:O,topVerts:h}}function Qe(e,n,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return{indices:i?e.indices:e.indices.slice().reverse(),vertices:Ie([e.points],n,a).vertices,uvs:r}}var Tt=function(e){"use strict";M(r,e);var n=k(r);function r(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};j(this,r);var t;t=n.call(this),t.type="PolygonBufferGeometry",t.parameters=(0,A.Z)({},{polygonGeoJson:i,startHeight:0,endHeight:1,closedBottom:!0,closedTop:!0,includeSides:!0,curvatureResolution:5,cartesian:!0,userDataRsoOffset:0},a);var o=t.parameters,c=o.startHeight,h=o.endHeight,v=o.closedBottom,d=o.closedTop,m=o.includeSides,g=o.curvatureResolution,_=o.cartesian,y=o.userDataRsoOffset;(0,bt.default)(i[0])||i[0].reverse();var w=kt(i,{resolution:g}),f=w.contour,O=w.triangles,E=(0,Be.merge)(O.uvs),ie=[],G=[],fe=[],Ae=0,pe=function(he){var Se=Math.round(ie.length/3),Me=fe.length;ie=ie.concat(he.vertices),G=G.concat(he.uvs),fe=fe.concat(Se?he.indices.map(function(Ce){return Ce+Se}):he.indices),t.addGroup(Me,fe.length-Me,Ae++)};if(m){var ye=Je(f,c,h,_);pe(ye),t.userData.rso=y?Je(f,c,h+y,_):ye}return v&&pe(Qe(O,c,E,!1,_)),d&&pe(Qe(O,h,E,!0,_)),t.setIndex(fe),t[Ye]("position",new s.Float32BufferAttribute(ie,3)),t[Ye]("uv",new s.Float32BufferAttribute(G,2)),t.computeVertexNormals(),t}return r}(s.BufferGeometry),Gt=function(e){"use strict";M(r,e);var n=k(r);function r(a){j(this,r);var t;return t=n.call(this),t.options=(0,A.Z)({},{geojson:[[[]]],startHeight:0,height:5,closedBottom:!0,closedTop:!0,curvatureResolution:1,cartesian:!0,userDataRsoOffset:0},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.startHeight,c=t.height,h=t.closedBottom,v=t.closedTop,d=t.curvatureResolution,m=t.userDataRsoOffset,g=t.cartesian,_=new Tt(this.options.geojson,{startHeight:o,endHeight:o+c,closedBottom:h,closedTop:v,curvatureResolution:d,cartesian:g,userDataRsoOffset:m});this.createMesh(_,this.options.material)},r}(p),qe=N(818);function et(e){var n=e.split,r=e.depth,i=e.points,a=new s.ExtrudeGeometry(new s.Shape(i),{depth:r,bevelEnabled:!1,UVGenerator:(0,qe.y)({split:n})});return(0,qe.C)(),a}var zt=function(e){"use strict";M(r,e);var n=k(r);function r(a){j(this,r);var t;return t=n.call(this),t.options=(0,A.Z)({},a),t}var i=r.prototype;return i.create=function(){var t=this,o=this.options,c=o.points,h=o.pointsArr,v=o.material,d=o.useGroups,m=o.depth,g=o.split,_=o.workerScriptURL;if(c)this.createMesh(et({points:c,depth:m,split:g}),v);else if(h&&_){var y=new Worker(_);return y.postMessage({pointsArr:h,depth:m,split:g,useGroups:d}),new Promise(function(f){y.onmessage=function(O){var E=O.data.attributes,ie=new s.BufferGeometry;Object.keys(E).forEach(function(G){ie.setAttribute(G,new s.BufferAttribute(E[G].array,E[G].itemSize))}),t.createMesh(ie,v),f(""),y.terminate()}})}else if(h){var w=He.mergeBufferGeometries(h.map(function(f){return et({points:f,depth:m,split:g})}),d!=null?d:!1);this.createMesh(w,v)}},r}(p)})();var Yt=me.Ei,Jt=me.Yo,Qt=me.Ee,qt=me.x1,er=me.VJ,tr=me.r7,rr=me.XA,nr=me.NB,ir=me.xv,ar=me.nk;export{Yt as ConicPolygon,Jt as ExtrudePolygon,Qt as Image,qt as Line,er as MeshLine,tr as MeshLineMaterial,rr as MeshLineRaycast,nr as Node,ir as Text,ar as Video};
132
+ `),_e=function(e){"use strict";M(r,e);var n=k(r);function r(){j(this,r);var i;return i=n.call(this),i.isMeshLine=!0,i.type="MeshLine",i.positions=[],i.previous=[],i.next=[],i.side=[],i.width=[],i.indices_array=[],i.uvs=[],i.counters=[],i._points=[],i._geom=null,i.widthCallback=null,i.matrixWorld=new s.Matrix4,Object.defineProperties(T(i),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(t){this.setGeometry(t,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(t){this.setPoints(t,this.widthCallback)}}}),i}return r}(s.BufferGeometry);_e.prototype.setMatrixWorld=function(e){this.matrixWorld=e},_e.prototype.setGeometry=function(e,n){this._geometry=e,this.setPoints(e.getAttribute("position").array,n)},_e.prototype.setPoints=function(e,n){if(!(e instanceof Float32Array)&&!(e instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=e,this.widthCallback=n,this.positions=[],this.counters=[],e.length&&e[0]instanceof s.Vector3)for(var r=0;r<e.length;r++){var i=e[r],a=r/e.length;this.positions.push(i.x,i.y,i.z),this.positions.push(i.x,i.y,i.z),this.counters.push(a),this.counters.push(a)}else for(var r=0;r<e.length;r+=3){var a=r/e.length;this.positions.push(e[r],e[r+1],e[r+2]),this.positions.push(e[r],e[r+1],e[r+2]),this.counters.push(a),this.counters.push(a)}this.process()};function Xe(e,n){var r=new s.Matrix4,i=new s.Ray,a=new s.Sphere,t=new s.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),a.copy(o.boundingSphere),a.applyMatrix4(this.matrixWorld),e.ray.intersectSphere(a,t)!==!1){r.copy(this.matrixWorld).invert(),i.copy(e.ray).applyMatrix4(r);var c=new s.Vector3,h=new s.Vector3,v=new s.Vector3,d=this instanceof s.LineSegments?2:1,m=o.index,g=o.attributes;if(m!==null)for(var _=m.array,y=g.position.array,w=g.width.array,f=0,O=_.length-1;f<O;f+=d){var E=_[f],ie=_[f+1];c.fromArray(y,E*3),h.fromArray(y,ie*3);var G=w[Math.floor(f/3)]!==void 0?w[Math.floor(f/3)]:1,fe=e.params.Line.threshold+this.material.lineWidth*G/2,Ae=fe*fe,pe=i.distanceSqToSegment(c,h,t,v);if(!(pe>Ae)){t.applyMatrix4(this.matrixWorld);var ye=e.ray.origin.distanceTo(t);ye<e.near||ye>e.far||(n.push({distance:ye,point:v.clone().applyMatrix4(this.matrixWorld),index:f,face:null,faceIndex:null,object:this}),f=O)}}}}_e.prototype.raycast=Xe,_e.prototype.compareV3=function(e,n){var r=e*6,i=n*6;return this.positions[r]===this.positions[i]&&this.positions[r+1]===this.positions[i+1]&&this.positions[r+2]===this.positions[i+2]},_e.prototype.copyV3=function(e){var n=e*6;return[this.positions[n],this.positions[n+1],this.positions[n+2]]},_e.prototype.process=function(){var e=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var n,r;this.compareV3(0,e-1)?r=this.copyV3(e-2):r=this.copyV3(0),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);for(var i=0;i<e;i++){if(this.side.push(1),this.side.push(-1),this.widthCallback?n=this.widthCallback(i/(e-1)):n=1,this.width.push(n),this.width.push(n),this.uvs.push(i/(e-1),0),this.uvs.push(i/(e-1),1),i<e-1){r=this.copyV3(i),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var a=i*2;this.indices_array.push(a,a+1,a+2),this.indices_array.push(a+2,a+1,a+3)}i>0&&(r=this.copyV3(i),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}this.compareV3(e-1,0)?r=this.copyV3(1):r=this.copyV3(e-1),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new s.BufferAttribute(new Float32Array(this.positions),3),previous:new s.BufferAttribute(new Float32Array(this.previous),3),next:new s.BufferAttribute(new Float32Array(this.next),3),side:new s.BufferAttribute(new Float32Array(this.side),1),width:new s.BufferAttribute(new Float32Array(this.width),1),uv:new s.BufferAttribute(new Float32Array(this.uvs),2),index:new s.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new s.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function We(e,n,r,i,a){var t;if(e=e.subarray||e.slice?e:e.buffer,r=r.subarray||r.slice?r:r.buffer,e=n?e.subarray?e.subarray(n,a&&n+a):e.slice(n,a&&n+a):e,r.set)r.set(e,i);else for(t=0;t<e.length;t++)r[t+i]=e[t];return r}_e.prototype.advance=function(e){var n=this._attributes.position.array,r=this._attributes.previous.array,i=this._attributes.next.array,a=n.length;We(n,0,r,0,a),We(n,6,n,0,a-6),n[a-6]=e.x,n[a-5]=e.y,n[a-4]=e.z,n[a-3]=e.x,n[a-2]=e.y,n[a-1]=e.z,We(n,6,i,0,a-6),i[a-6]=e.x,i[a-5]=e.y,i[a-4]=e.z,i[a-3]=e.x,i[a-2]=e.y,i[a-1]=e.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},s.ShaderChunk.meshline_vert=ot,s.ShaderChunk.meshline_frag=st;var Ve=function(e){"use strict";M(r,e);var n=k(r);function r(i){j(this,r);var a;return a=n.call(this,{uniforms:Object.assign({},s.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new s.Color(16777215)},opacity:{value:1},resolution:{value:new s.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new s.Vector2(1,1)},offset:{value:new s.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new s.Vector2(0,0)},lightColor:{value:new s.Color(16777215)}}),vertexShader:s.ShaderChunk.meshline_vert,fragmentShader:s.ShaderChunk.meshline_frag}),a.isMeshLineMaterial=!0,a.type="MeshLineMaterial",Object.defineProperties(T(a),{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(o){this.uniforms.lineWidth.value=o}},lineLightAnimation:{enumerable:!0,get:function(){return this.uniforms.lineLightAnimation.value},set:function(o){this.uniforms.lineLightAnimation.value=o}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(o){this.uniforms.map.value=o}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(o){this.uniforms.useMap.value=o}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(o){this.uniforms.alphaMap.value=o}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(o){this.uniforms.useAlphaMap.value=o}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(o){this.uniforms.color.value=o}},lightColor:{enumerable:!0,get:function(){return this.uniforms.lightColor.value},set:function(o){this.uniforms.lightColor.value=o}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(o){this.uniforms.time.value=o}},uCenter:{enumerable:!0,get:function(){return this.uniforms.uCenter.value},set:function(o){this.uniforms.uCenter.value=o}},size:{enumerable:!0,get:function(){return this.uniforms.size.value},set:function(o){this.uniforms.size.value=o}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(o){this.uniforms.opacity.value=o}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(o){this.uniforms.resolution.value.copy(o)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(o){this.uniforms.sizeAttenuation.value=o}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(o){this.uniforms.dashArray.value=o,this.useDash=o!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(o){this.uniforms.dashOffset.value=o}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(o){this.uniforms.dashRatio.value=o}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(o){this.uniforms.useDash.value=o}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(o){this.uniforms.visibility.value=o}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(o){this.uniforms.alphaTest.value=o}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(o){this.uniforms.repeat.value.copy(o)}}}),a.setValues(i),a}return r}(s.ShaderMaterial);Ve.prototype.copy=function(e){return s.ShaderMaterial.prototype.copy.call(this,e),this.lineWidth=e.lineWidth,this.map=e.map,this.useMap=e.useMap,this.alphaMap=e.alphaMap,this.useAlphaMap=e.useAlphaMap,this.color.copy(e.color),this.opacity=e.opacity,this.resolution.copy(e.resolution),this.sizeAttenuation=e.sizeAttenuation,this.dashArray.copy(e.dashArray),this.dashOffset.copy(e.dashOffset),this.dashRatio.copy(e.dashRatio),this.useDash=e.useDash,this.visibility=e.visibility,this.alphaTest=e.alphaTest,this.repeat.copy(e.repeat),this};function ut(e,n){if(e==null)return{};var r={},i=Object.keys(e),a,t;for(t=0;t<i.length;t++)a=i[t],!(n.indexOf(a)>=0)&&(r[a]=e[a]);return r}function ct(e,n){if(e==null)return{};var r=ut(e,n),i,a;if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);for(a=0;a<t.length;a++)i=t[a],!(n.indexOf(i)>=0)&&(!Object.prototype.propertyIsEnumerable.call(e,i)||(r[i]=e[i]))}return r}var lt=e=>{var n={};return N.d(n,e),n},or=e=>()=>e,ft=lt({animate:()=>Ut.animate}),ht=e=>{var n={};return N.d(n,e),n},sr=e=>()=>e,He=ht({mergeBufferGeometries:()=>Nt.mergeBufferGeometries});function Ke(e){var n=e.setPointWidth,r=e.nodes,i=new s.BufferGeometry,a=new _e;return i.setFromPoints(r),a.setGeometry(i,n),a}var pt={color:new s.Color("#ffffff"),lineWidth:3,sizeAttenuation:0},vt=function(e){"use strict";M(r,e);var n=k(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};j(this,r);var t;return t=n.call(this),t.options=(0,A.Z)({},pt,a),t}var i=r.prototype;return i.create=function(){var t=this,o=this.options,c=o.duration,h=o.delay,v=o.onComplete,d=o.setPointWidth,m=o.key,g=o.nodes,_=o.nodesArr,y=o.workerScriptURL,w=o.useGroups,f=ct(o,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","workerScriptURL","useGroups"]),O=this.pencil.getSize(),E=O.width,ie=O.height,G=new Ve(P((0,A.Z)({},f),{resolution:new s.Vector2(E,ie)}));if(this.material=G,g)this.createMesh(Ke({nodes:g,setPointWidth:d}),G);else if(_&&y){var fe=new Worker(y);return fe.postMessage({nodesArr:_,useGroups:w}),new Promise(function(pe){fe.onmessage=function(ye){var Re=ye.data,he=Re.attributes,Se=Re.index,Me=new s.BufferGeometry;Object.keys(he).forEach(function(Ce){Me.setAttribute(Ce,new s.BufferAttribute(he[Ce].array,he[Ce].itemSize))}),Me.setIndex(new s.BufferAttribute(Se.array,Se.itemSize)),t.createMesh(Me,G),pe(""),fe.terminate()}})}else if(_){var Ae=He.mergeBufferGeometries(_.map(function(pe){return Ke({nodes:pe,setPointWidth:d})}),w!=null?w:!1);this.createMesh(Ae,G)}},i.resize=function(t,o){this.material.uniforms.resolution.value.set(t,o)},i.animate=function(){var t=this.options,o=t.duration,c=t.delay,h=t.onComplete,v=this.material.uniforms.offset,d=c!=null?c:0,m=(0,ft.animate)({from:v.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-d,repeat:1/0,onComplete:h,onUpdate:function(_){v.value.x=_.x}});this.tween=m},i.dispose=function(){var t;Oe(W(r.prototype),"dispose",this).call(this),(t=this.tween)===null||t===void 0||t.stop()},r}(p);function dt(e){if(Array.isArray(e))return e}function mt(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ge(e,n){return dt(e)||Z(e,n)||J(e,n)||mt()}var _t=e=>{var n={};return N.d(n,e),n},ur=e=>()=>e,Be=_t({extent:()=>Ze.extent,mean:()=>Ze.mean,merge:()=>Ze.merge}),gt=e=>{var n={};return N.d(n,e),n},cr=e=>()=>e,Ue=gt({default:()=>It.default}),yt=e=>{var n={};return N.d(n,e),n},lr=e=>()=>e,bt=yt({default:()=>Ft.default});function wt(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=(90-n)*Math.PI/180,a=(90-e)*Math.PI/180;return[r*Math.sin(i)*Math.cos(a),r*Math.cos(i),r*Math.sin(i)*Math.sin(a)]}var xt=e=>{var n={};return N.d(n,e),n},fr=e=>()=>e,At=xt({default:()=>Zt.default}),St=e=>{var n={};return N.d(n,e),n},hr=e=>()=>e,Mt=St({default:()=>Xt.default}),Pt=e=>{var n={};return N.d(n,e),n},pr=e=>()=>e,Te=Pt({geoBounds:()=>De.geoBounds,geoContains:()=>De.geoContains,geoDistance:()=>De.geoDistance,geoInterpolate:()=>De.geoInterpolate}),Ot=e=>{var n={};return N.d(n,e),n},vr=e=>()=>e,Lt=Ot({geoVoronoi:()=>Ht.geoVoronoi}),Ct=e=>{var n={};return N.d(n,e),n},dr=e=>()=>e,$e=Ct({scaleLinear:()=>Kt.scaleLinear});function Et(e,n){return e.map(function(r){var i=[],a;return r.forEach(function(t){if(a){var o=(0,Te.geoDistance)(t,a)*180/Math.PI;if(o>n)for(var c=(0,Te.geoInterpolate)(a,t),h=1/Math.ceil(o/n),v=h;v<1;)i.push(c(v)),v+=h}i.push(a=t)}),i})}function jt(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.minLng,i=n.maxLng,a=n.minLat,t=n.maxLat,o=Math.round(Math.pow(360/e,2)/Math.PI),c=(1+Math.sqrt(5))/2,h=function(O){return O/c*360%360-180},v=function(O){return Math.acos(2*O/o-1)/Math.PI*180-90},d=function(O){return o*(Math.cos((O+90)*Math.PI/180)+1)/2},m=[t!==void 0?Math.ceil(d(t)):0,a!==void 0?Math.floor(d(a)):o-1],g=r===void 0&&i===void 0?function(){return!0}:r===void 0?function(f){return f<=i}:i===void 0?function(f){return f>=r}:i>=r?function(f){return f>=r&&f<=i}:function(f){return f>=r||f<=i},_=[],y=m[0];y<=m[1];y++){var w=h(y);g(w)&&_.push([w,v(y)])}return _}function Ne(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,Te.geoContains)(n,e):(0,Mt.default)(e,n)}function Bt(e,n){var r={type:"Polygon",coordinates:e},i=ge((0,Te.geoBounds)(r),2),a=ge(i[0],2),t=a[0],o=a[1],c=ge(i[1],2),h=c[0],v=c[1];if(Math.min(Math.abs(h-t),Math.abs(v-o))<n)return[];var d=t>h||v>=89||o<=-89;return jt(n,{minLng:t,maxLng:h,minLat:o,maxLat:v}).filter(function(m){return Ne(m,r,d)})}function Rt(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.resolution,i=r===void 0?1/0:r,a=Et(e,i),t=(0,Be.merge)(a),o=Bt(e,i),c=U(t).concat(U(o)),h={type:"Polygon",coordinates:e},v=ge((0,Te.geoBounds)(h),2),d=ge(v[0],2),m=d[0],g=d[1],_=ge(v[1],2),y=_[0],w=_[1],f=m>y||w>=89||g<=-89,O=[];if(f){var E=(0,Lt.geoVoronoi)(c).triangles(),ie=new Map(c.map(function(ve,we){var Ee=ge(ve,2),de=Ee[0],je=Ee[1];return["".concat(de,"-").concat(je),we]}));E.features.forEach(function(ve){var we,Ee=ve.geometry.coordinates[0].slice(0,3).reverse(),de=[];if(Ee.forEach(function(Ge){var ze=ge(Ge,2),xe=ze[0],Fe=ze[1],tt="".concat(xe,"-").concat(Fe);ie.has(tt)&&de.push(ie.get(tt))}),de.length===3){if(de.some(function(Ge){return Ge<t.length})){var je=ve.properties.circumcenter;if(!Ne(je,h,f))return}(we=O).push.apply(we,U(de))}})}else if(o.length)for(var ye=function(we,Ee){var de,je=[2,1,0].map(function(xe){return Re.triangles[we+xe]}),Ge=je.map(function(xe){return c[xe]});if(je.some(function(xe){return xe<t.length})){var ze=[0,1].map(function(xe){return(0,Be.mean)(Ge,function(Fe){return Fe[xe]})});if(!Ne(ze,h,f))return"continue"}(de=O).push.apply(de,U(je))},Re=At.default.from(c),he=0,Se=Re.triangles.length;he<Se;he+=3)ye(he,Se);else{var G=Ue.default.flatten(a),fe=G.vertices,Ae=G.holes,pe=Ae===void 0?[]:Ae;O=(0,Ue.default)(fe,pe,2)}var Me=(0,$e.scaleLinear)((0,Be.extent)(c,function(ve){return ve[0]}),[0,1]),Ce=(0,$e.scaleLinear)((0,Be.extent)(c,function(ve){return ve[1]}),[0,1]),Dt=c.map(function(ve){var we=ge(ve,2),Ee=we[0],de=we[1];return[Me(Ee),Ce(de)]}),Wt={points:c,indices:O,uvs:Dt};return{contour:a,triangles:Wt}}var kt=Rt,Ye=new s.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function Ie(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=e.map(function(a){return a.map(function(t){var o=ge(t,2),c=o[0],h=o[1];return r?wt(c,h,n):[c,h,n]})});return Ue.default.flatten(i)}function Je(e,n,r){for(var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=Ie(e,n,i),t=a.vertices,o=a.holes,c=Ie(e,r,i),h=c.vertices,v=(0,Be.merge)([h,t]),d=Math.round(h.length/3),m=new Set(o),g=0,_=[],y=0;y<d;y++){var w=y+1;if(w===d)w=g;else if(m.has(w)){var f=w;w=g,g=f}_.push(y,y+d,w+d),_.push(w+d,w,y)}for(var O=[],E=1;E>=0;E--)for(var ie=0;ie<d;ie+=1)O.push(ie/(d-1),E);return{indices:_,vertices:v,uvs:O,topVerts:h}}function Qe(e,n,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return{indices:i?e.indices:e.indices.slice().reverse(),vertices:Ie([e.points],n,a).vertices,uvs:r}}var Tt=function(e){"use strict";M(r,e);var n=k(r);function r(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};j(this,r);var t;t=n.call(this),t.type="PolygonBufferGeometry",t.parameters=(0,A.Z)({},{polygonGeoJson:i,startHeight:0,endHeight:1,closedBottom:!0,closedTop:!0,includeSides:!0,curvatureResolution:5,cartesian:!0,userDataRsoOffset:0},a);var o=t.parameters,c=o.startHeight,h=o.endHeight,v=o.closedBottom,d=o.closedTop,m=o.includeSides,g=o.curvatureResolution,_=o.cartesian,y=o.userDataRsoOffset;(0,bt.default)(i[0])||i[0].reverse();var w=kt(i,{resolution:g}),f=w.contour,O=w.triangles,E=(0,Be.merge)(O.uvs),ie=[],G=[],fe=[],Ae=0,pe=function(he){var Se=Math.round(ie.length/3),Me=fe.length;ie=ie.concat(he.vertices),G=G.concat(he.uvs),fe=fe.concat(Se?he.indices.map(function(Ce){return Ce+Se}):he.indices),t.addGroup(Me,fe.length-Me,Ae++)};if(m){var ye=Je(f,c,h,_);pe(ye),t.userData.rso=y?Je(f,c,h+y,_):ye}return v&&pe(Qe(O,c,E,!1,_)),d&&pe(Qe(O,h,E,!0,_)),t.setIndex(fe),t[Ye]("position",new s.Float32BufferAttribute(ie,3)),t[Ye]("uv",new s.Float32BufferAttribute(G,2)),t.computeVertexNormals(),t}return r}(s.BufferGeometry),Gt=function(e){"use strict";M(r,e);var n=k(r);function r(a){j(this,r);var t;return t=n.call(this),t.options=(0,A.Z)({},{geojson:[[[]]],startHeight:0,height:5,closedBottom:!0,closedTop:!0,curvatureResolution:1,cartesian:!0,userDataRsoOffset:0},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.startHeight,c=t.height,h=t.closedBottom,v=t.closedTop,d=t.curvatureResolution,m=t.userDataRsoOffset,g=t.cartesian,_=new Tt(this.options.geojson,{startHeight:o,endHeight:o+c,closedBottom:h,closedTop:v,curvatureResolution:d,cartesian:g,userDataRsoOffset:m});this.createMesh(_,this.options.material)},r}(p),qe=N(818);function et(e){var n=e.split,r=e.depth,i=e.points,a=new s.ExtrudeGeometry(new s.Shape(i),{depth:r,bevelEnabled:!1,UVGenerator:(0,qe.y)({split:n})});return(0,qe.C)(),a}var zt=function(e){"use strict";M(r,e);var n=k(r);function r(a){j(this,r);var t;return t=n.call(this),t.options=(0,A.Z)({},a),t}var i=r.prototype;return i.create=function(){var t=this,o=this.options,c=o.points,h=o.pointsArr,v=o.material,d=o.useGroups,m=o.depth,g=o.split,_=o.workerScriptURL;if(c)this.createMesh(et({points:c,depth:m,split:g}),v);else if(h&&_){var y=new Worker(_);return y.postMessage({pointsArr:h,depth:m,split:g,useGroups:d}),new Promise(function(f){y.onmessage=function(O){var E=O.data.attributes,ie=new s.BufferGeometry;Object.keys(E).forEach(function(G){ie.setAttribute(G,new s.BufferAttribute(E[G].array,E[G].itemSize))}),t.createMesh(ie,v),f(""),y.terminate()}})}else if(h){var w=He.mergeBufferGeometries(h.map(function(f){return et({points:f,depth:m,split:g})}),d!=null?d:!1);this.createMesh(w,v)}},r}(p)})();var Yt=me.Ei,Jt=me.Yo,Qt=me.Ee,qt=me.x1,er=me.VJ,tr=me.r7,rr=me.XA,nr=me.NB,ir=me.xv,ar=me.nk;export{Yt as ConicPolygon,Jt as ExtrudePolygon,Qt as Image,qt as Line,er as MeshLine,tr as MeshLineMaterial,rr as MeshLineRaycast,nr as Node,ir as Text,ar as Video};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gl-draw",
3
- "version": "0.2.14",
3
+ "version": "0.2.15",
4
4
  "author": "gitplus <hstits@gmail.com>",
5
5
  "scripts": {
6
6
  "start": "PORT=3002 bundler-dev",