gl-draw 0.3.1 → 0.3.2

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,b=o.attributes;if(m!==null)for(var g=m.array,y=b.position.array,_=b.width.array,f=0,S=g.length-1;f<S;f+=d){var k=g[f],te=g[f+1];c.fromArray(y,k*3),h.fromArray(y,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,Pe=fe*fe,ve=n.distanceSqToSegment(c,h,t,v);if(!(ve>Pe)){t.applyMatrix4(this.matrixWorld);var ye=e.ray.origin.distanceTo(t);ye<e.near||ye>e.far||(i.push({distance:ye,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 Ee(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;Ee(i,0,r,0,a),Ee(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,Ee(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=Ce,s.ShaderChunk.meshline_frag=Se;var Be=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);Be.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,b=o.nodes,g=o.nodesArr,y=o.worker,_=o.useGroups,f=tt(o,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","worker","useGroups"]),S=this.pencil.getSize(),k=S.width,te=S.height,E=new Be(j((0,O.Z)({},f),{resolution:new s.Vector2(k,te)}));if(this.material=E,b)this.createMesh(Ne({nodes:b,setPointWidth:d}),E);else if(g&&y){var fe=typeof y=="string"?new Worker(y):y;return fe.postMessage({nodesArr:g,useGroups:_}),new Promise(function(ve){fe.onmessage=function(ye){var we=ye.data,he=new s.BufferGeometry;Object.keys(we).forEach(function(pe){pe==="index"?he.setIndex(new s.BufferAttribute(we[pe].array,we[pe].itemSize)):he.setAttribute(pe,new s.BufferAttribute(we[pe].array,we[pe].itemSize))}),t.createMesh(he,E),ve(""),fe.terminate()}})}else if(g){var Pe=Ze.mergeBufferGeometries(g.map(function(ve){return Ne({nodes:ve,setPointWidth:d})}),_!=null?_:!1);this.createMesh(Pe,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(R(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 ge(e,i){return at(e)||$(e,i)||ee(e,i)||ot()}var je=require("d3-array"),st=require("earcut"),Ge=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),Le=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,Le.geoDistance)(t,a)*180/Math.PI;if(o>i)for(var c=(0,Le.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],b=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=[],y=m[0];y<=m[1];y++){var _=h(y);b(_)&&g.push([_,v(y)])}return g}function Ve(e,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,Le.geoContains)(i,e):vt()(e,i)}function yt(e,i){var r={type:"Polygon",coordinates:e},n=ge((0,Le.geoBounds)(r),2),a=ge(n[0],2),t=a[0],o=a[1],c=ge(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 Ve(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,je.merge)(a),o=yt(e,n),c=N(t).concat(N(o)),h={type:"Polygon",coordinates:e},v=ge((0,Le.geoBounds)(h),2),d=ge(v[0],2),m=d[0],b=d[1],g=ge(v[1],2),y=g[0],_=g[1],f=m>y||_>=89||b<=-89,S=[];if(f){var k=(0,dt.geoVoronoi)(c).triangles(),te=new Map(c.map(function(de,xe){var Ae=ge(de,2),me=Ae[0],Oe=Ae[1];return["".concat(me,"-").concat(Oe),xe]}));k.features.forEach(function(de){var xe,Ae=de.geometry.coordinates[0].slice(0,3).reverse(),me=[];if(Ae.forEach(function(ke){var Re=ge(ke,2),Me=Re[0],Ue=Re[1],Qe="".concat(Me,"-").concat(Ue);te.has(Qe)&&me.push(te.get(Qe))}),me.length===3){if(me.some(function(ke){return ke<t.length})){var Oe=de.properties.circumcenter;if(!Ve(Oe,h,f))return}(xe=S).push.apply(xe,N(me))}})}else if(o.length)for(var ye=function(xe,Ae){var me,Oe=[2,1,0].map(function(Me){return we.triangles[xe+Me]}),ke=Oe.map(function(Me){return c[Me]});if(Oe.some(function(Me){return Me<t.length})){var Re=[0,1].map(function(Me){return(0,je.mean)(ke,function(Ue){return Ue[Me]})});if(!Ve(Re,h,f))return"continue"}(me=S).push.apply(me,N(Oe))},we=ht().from(c),he=0,pe=we.triangles.length;he<pe;he+=3)ye(he,pe);else{var E=Ge().flatten(a),fe=E.vertices,Pe=E.holes,ve=Pe===void 0?[]:Pe;S=Ge()(fe,ve,2)}var ze=(0,He.scaleLinear)((0,je.extent)(c,function(de){return de[0]}),[0,1]),De=(0,He.scaleLinear)((0,je.extent)(c,function(de){return de[1]}),[0,1]),Pt=c.map(function(de){var xe=ge(de,2),Ae=xe[0],me=xe[1];return[ze(Ae),De(me)]}),St={points:c,indices:S,uvs:Pt};return{contour:a,triangles:St}}var _t=bt,$e=new s.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function We(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=ge(t,2),c=o[0],h=o[1];return r?lt(c,h,i):[c,h,i]})});return Ge().flatten(n)}function qe(e,i,r){for(var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=We(e,i,n),t=a.vertices,o=a.holes,c=We(e,r,n),h=c.vertices,v=(0,je.merge)([h,t]),d=Math.round(h.length/3),m=new Set(o),b=0,g=[],y=0;y<d;y++){var _=y+1;if(_===d)_=b;else if(m.has(_)){var f=_;_=b,b=f}g.push(y,y+d,_+d),g.push(_+d,_,y)}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:We([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,b=o.curvatureResolution,g=o.cartesian,y=o.userDataRsoOffset;ct()(n[0])||n[0].reverse();var _=_t(n,{resolution:b}),f=_.contour,S=_.triangles,k=(0,je.merge)(S.uvs),te=[],E=[],fe=[],Pe=0,ve=function(he){var pe=Math.round(te.length/3),ze=fe.length;te=te.concat(he.vertices),E=E.concat(he.uvs),fe=fe.concat(pe?he.indices.map(function(De){return De+pe}):he.indices),t.addGroup(ze,fe.length-ze,Pe++)};if(m){var ye=qe(f,c,h,g);ve(ye),t.userData.rso=y?qe(f,c,h+y,g):ye}return v&&ve(Ke(S,c,k,!1,g)),d&&ve(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,b=t.cartesian,g=new wt(this.options.geojson,{startHeight:o,endHeight:o+c,closedBottom:h,closedTop:v,curvatureResolution:d,cartesian:b,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,b=o.split,g=o.worker;if(c)this.createMesh(Ye({points:c,depth:m,split:b}),v);else if(h&&g){var y=typeof g=="string"?new Worker(g):g;return y.postMessage({pointsArr:h,depth:m,split:b,useGroups:d}),new Promise(function(f){y.onmessage=function(S){var k=S.data,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(""),y.terminate()}})}else if(h){var _=Ze.mergeBufferGeometries(h.map(function(f){return Ye({points:f,depth:m,split:b})}),d!=null?d:!1);this.createMesh(_,v)}},r}(D)})(),module.exports=Te})();
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,b=o.attributes;if(m!==null)for(var g=m.array,y=b.position.array,_=b.width.array,f=0,S=g.length-1;f<S;f+=d){var k=g[f],te=g[f+1];c.fromArray(y,k*3),h.fromArray(y,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,Pe=fe*fe,ve=n.distanceSqToSegment(c,h,t,v);if(!(ve>Pe)){t.applyMatrix4(this.matrixWorld);var ye=e.ray.origin.distanceTo(t);ye<e.near||ye>e.far||(i.push({distance:ye,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 Ee(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;Ee(i,0,r,0,a),Ee(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,Ee(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=Ce,s.ShaderChunk.meshline_frag=Se;var Be=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);Be.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,b=o.nodes,g=o.nodesArr,y=o.worker,_=o.useGroups,f=tt(o,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","worker","useGroups"]),S=this.pencil.getSize(),k=S.width,te=S.height,E=new Be(j((0,O.Z)({},f),{resolution:new s.Vector2(k,te)}));if(this.material=E,b)this.createMesh(Ne({nodes:b,setPointWidth:d}),E);else if(g&&y){var fe=typeof y=="string"?new Worker(y):y;return fe.postMessage({nodesArr:g,useGroups:_}),new Promise(function(ve){fe.onmessage=function(ye){var we=ye.data,he=new s.BufferGeometry;Object.keys(we).forEach(function(pe){pe==="index"?he.setIndex(new s.BufferAttribute(we[pe].array,we[pe].itemSize)):he.setAttribute(pe,new s.BufferAttribute(we[pe].array,we[pe].itemSize))}),t.createMesh(he,E),ve("")}})}else if(g){var Pe=Ze.mergeBufferGeometries(g.map(function(ve){return Ne({nodes:ve,setPointWidth:d})}),_!=null?_:!1);this.createMesh(Pe,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(R(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 ge(e,i){return at(e)||$(e,i)||ee(e,i)||ot()}var je=require("d3-array"),st=require("earcut"),Ge=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),Le=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,Le.geoDistance)(t,a)*180/Math.PI;if(o>i)for(var c=(0,Le.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],b=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=[],y=m[0];y<=m[1];y++){var _=h(y);b(_)&&g.push([_,v(y)])}return g}function Ve(e,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,Le.geoContains)(i,e):vt()(e,i)}function yt(e,i){var r={type:"Polygon",coordinates:e},n=ge((0,Le.geoBounds)(r),2),a=ge(n[0],2),t=a[0],o=a[1],c=ge(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 Ve(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,je.merge)(a),o=yt(e,n),c=N(t).concat(N(o)),h={type:"Polygon",coordinates:e},v=ge((0,Le.geoBounds)(h),2),d=ge(v[0],2),m=d[0],b=d[1],g=ge(v[1],2),y=g[0],_=g[1],f=m>y||_>=89||b<=-89,S=[];if(f){var k=(0,dt.geoVoronoi)(c).triangles(),te=new Map(c.map(function(de,xe){var Ae=ge(de,2),me=Ae[0],Oe=Ae[1];return["".concat(me,"-").concat(Oe),xe]}));k.features.forEach(function(de){var xe,Ae=de.geometry.coordinates[0].slice(0,3).reverse(),me=[];if(Ae.forEach(function(ke){var Re=ge(ke,2),Me=Re[0],Ue=Re[1],Qe="".concat(Me,"-").concat(Ue);te.has(Qe)&&me.push(te.get(Qe))}),me.length===3){if(me.some(function(ke){return ke<t.length})){var Oe=de.properties.circumcenter;if(!Ve(Oe,h,f))return}(xe=S).push.apply(xe,N(me))}})}else if(o.length)for(var ye=function(xe,Ae){var me,Oe=[2,1,0].map(function(Me){return we.triangles[xe+Me]}),ke=Oe.map(function(Me){return c[Me]});if(Oe.some(function(Me){return Me<t.length})){var Re=[0,1].map(function(Me){return(0,je.mean)(ke,function(Ue){return Ue[Me]})});if(!Ve(Re,h,f))return"continue"}(me=S).push.apply(me,N(Oe))},we=ht().from(c),he=0,pe=we.triangles.length;he<pe;he+=3)ye(he,pe);else{var E=Ge().flatten(a),fe=E.vertices,Pe=E.holes,ve=Pe===void 0?[]:Pe;S=Ge()(fe,ve,2)}var ze=(0,He.scaleLinear)((0,je.extent)(c,function(de){return de[0]}),[0,1]),De=(0,He.scaleLinear)((0,je.extent)(c,function(de){return de[1]}),[0,1]),Pt=c.map(function(de){var xe=ge(de,2),Ae=xe[0],me=xe[1];return[ze(Ae),De(me)]}),St={points:c,indices:S,uvs:Pt};return{contour:a,triangles:St}}var _t=bt,$e=new s.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function We(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=ge(t,2),c=o[0],h=o[1];return r?lt(c,h,i):[c,h,i]})});return Ge().flatten(n)}function qe(e,i,r){for(var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=We(e,i,n),t=a.vertices,o=a.holes,c=We(e,r,n),h=c.vertices,v=(0,je.merge)([h,t]),d=Math.round(h.length/3),m=new Set(o),b=0,g=[],y=0;y<d;y++){var _=y+1;if(_===d)_=b;else if(m.has(_)){var f=_;_=b,b=f}g.push(y,y+d,_+d),g.push(_+d,_,y)}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:We([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,b=o.curvatureResolution,g=o.cartesian,y=o.userDataRsoOffset;ct()(n[0])||n[0].reverse();var _=_t(n,{resolution:b}),f=_.contour,S=_.triangles,k=(0,je.merge)(S.uvs),te=[],E=[],fe=[],Pe=0,ve=function(he){var pe=Math.round(te.length/3),ze=fe.length;te=te.concat(he.vertices),E=E.concat(he.uvs),fe=fe.concat(pe?he.indices.map(function(De){return De+pe}):he.indices),t.addGroup(ze,fe.length-ze,Pe++)};if(m){var ye=qe(f,c,h,g);ve(ye),t.userData.rso=y?qe(f,c,h+y,g):ye}return v&&ve(Ke(S,c,k,!1,g)),d&&ve(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,b=t.cartesian,g=new wt(this.options.geojson,{startHeight:o,endHeight:o+c,closedBottom:h,closedTop:v,curvatureResolution:d,cartesian:b,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,b=o.split,g=o.worker;if(c)this.createMesh(Ye({points:c,depth:m,split:b}),v);else if(h&&g){var y=typeof g=="string"?new Worker(g):g;return y.postMessage({pointsArr:h,depth:m,split:b,useGroups:d}),new Promise(function(f){y.onmessage=function(S){var k=S.data,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("")}})}else if(h){var _=Ze.mergeBufferGeometries(h.map(function(f){return Ye({points:f,depth:m,split:b})}),d!=null?d:!1);this.createMesh(_,v)}},r}(D)})(),module.exports=Te})();
@@ -1,4 +1,4 @@
1
- import*as rt from"idb-keyval";import*as z from"three";import*as Vt from"three/examples/jsm/renderers/CSS2DRenderer";import*as nt from"three/examples/jsm/renderers/CSS3DRenderer";import*as Ut from"popmotion";import*as Nt from"three/examples/jsm//utils/BufferGeometryUtils";import*as Ze from"d3-array";import*as It from"earcut";import*as Ft from"@turf/boolean-clockwise";import*as Zt from"delaunator";import*as Xt from"@turf/boolean-point-in-polygon";import*as ze from"d3-geo";import*as Ht from"d3-geo-voronoi";import*as Kt from"d3-scale";var $t={666:function(j){var B=function(x){"use strict";var S=Object.prototype,A=S.hasOwnProperty,R,P=typeof Symbol=="function"?Symbol:{},I=P.iterator||"@@iterator",D=P.asyncIterator||"@@asyncIterator",W=P.toStringTag||"@@toStringTag";function k(l,u,p){return Object.defineProperty(l,u,{value:p,enumerable:!0,configurable:!0,writable:!0}),l[u]}try{k({},"")}catch(l){k=function(u,p,M){return u[p]=M}}function C(l,u,p,M){var b=u&&u.prototype instanceof ae?u:ae,Q=Object.create(b.prototype),H=new X(M||[]);return Q._invoke=oe(l,p,H),Q}x.wrap=C;function $(l,u,p){try{return{type:"normal",arg:l.call(u,p)}}catch(M){return{type:"throw",arg:M}}}var T="suspendedStart",s="suspendedYield",ce="executing",te="completed",K={};function ae(){}function V(){}function F(){}var L={};k(L,I,function(){return this});var Z=Object.getPrototypeOf,Y=Z&&Z(Z(ee([])));Y&&Y!==S&&A.call(Y,I)&&(L=Y);var J=F.prototype=ae.prototype=Object.create(L);V.prototype=F,k(J,"constructor",F),k(F,"constructor",V),V.displayName=k(F,W,"GeneratorFunction");function U(l){["next","throw","return"].forEach(function(u){k(l,u,function(p){return this._invoke(u,p)})})}x.isGeneratorFunction=function(l){var u=typeof l=="function"&&l.constructor;return u?u===V||(u.displayName||u.name)==="GeneratorFunction":!1},x.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,F):(l.__proto__=F,k(l,W,"GeneratorFunction")),l.prototype=Object.create(J),l},x.awrap=function(l){return{__await:l}};function q(l,u){function p(Q,H,ue,le){var ne=$(l[Q],l,H);if(ne.type==="throw")le(ne.arg);else{var Oe=ne.arg,Ce=Oe.value;return Ce&&typeof Ce=="object"&&A.call(Ce,"__await")?u.resolve(Ce.__await).then(function(we){p("next",we,ue,le)},function(we){p("throw",we,ue,le)}):u.resolve(Ce).then(function(we){Oe.value=we,ue(Oe)},function(we){return p("throw",we,ue,le)})}}var M;function b(Q,H){function ue(){return new u(function(le,ne){p(Q,H,le,ne)})}return M=M?M.then(ue,ue):ue()}this._invoke=b}U(q.prototype),k(q.prototype,D,function(){return this}),x.AsyncIterator=q,x.async=function(l,u,p,M,b){b===void 0&&(b=Promise);var Q=new q(C(l,u,p,M),b);return x.isGeneratorFunction(u)?Q:Q.next().then(function(H){return H.done?H.value:Q.next()})};function oe(l,u,p){var M=T;return function(Q,H){if(M===ce)throw new Error("Generator is already running");if(M===te){if(Q==="throw")throw H;return Be()}for(p.method=Q,p.arg=H;;){var ue=p.delegate;if(ue){var le=se(ue,p);if(le){if(le===K)continue;return le}}if(p.method==="next")p.sent=p._sent=p.arg;else if(p.method==="throw"){if(M===T)throw M=te,p.arg;p.dispatchException(p.arg)}else p.method==="return"&&p.abrupt("return",p.arg);M=ce;var ne=$(l,u,p);if(ne.type==="normal"){if(M=p.done?te:s,ne.arg===K)continue;return{value:ne.arg,done:p.done}}else ne.type==="throw"&&(M=te,p.method="throw",p.arg=ne.arg)}}}function se(l,u){var p=l.iterator[u.method];if(p===R){if(u.delegate=null,u.method==="throw"){if(l.iterator.return&&(u.method="return",u.arg=R,se(l,u),u.method==="throw"))return K;u.method="throw",u.arg=new TypeError("The iterator does not provide a 'throw' method")}return K}var M=$(p,l.iterator,u.arg);if(M.type==="throw")return u.method="throw",u.arg=M.arg,u.delegate=null,K;var b=M.arg;if(!b)return u.method="throw",u.arg=new TypeError("iterator result is not an object"),u.delegate=null,K;if(b.done)u[l.resultName]=b.value,u.next=l.nextLoc,u.method!=="return"&&(u.method="next",u.arg=R);else return b;return u.delegate=null,K}U(J),k(J,W,"Generator"),k(J,I,function(){return this}),k(J,"toString",function(){return"[object Generator]"});function Pe(l){var u={tryLoc:l[0]};1 in l&&(u.catchLoc=l[1]),2 in l&&(u.finallyLoc=l[2],u.afterLoc=l[3]),this.tryEntries.push(u)}function re(l){var u=l.completion||{};u.type="normal",delete u.arg,l.completion=u}function X(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(Pe,this),this.reset(!0)}x.keys=function(l){var u=[];for(var p in l)u.push(p);return u.reverse(),function M(){for(;u.length;){var b=u.pop();if(b in l)return M.value=b,M.done=!1,M}return M.done=!0,M}};function ee(l){if(l){var u=l[I];if(u)return u.call(l);if(typeof l.next=="function")return l;if(!isNaN(l.length)){var p=-1,M=function b(){for(;++p<l.length;)if(A.call(l,p))return b.value=l[p],b.done=!1,b;return b.value=R,b.done=!0,b};return M.next=M}}return{next:Be}}x.values=ee;function Be(){return{value:R,done:!0}}return X.prototype={constructor:X,reset:function(l){if(this.prev=0,this.next=0,this.sent=this._sent=R,this.done=!1,this.delegate=null,this.method="next",this.arg=R,this.tryEntries.forEach(re),!l)for(var u in this)u.charAt(0)==="t"&&A.call(this,u)&&!isNaN(+u.slice(1))&&(this[u]=R)},stop:function(){this.done=!0;var l=this.tryEntries[0],u=l.completion;if(u.type==="throw")throw u.arg;return this.rval},dispatchException:function(l){if(this.done)throw l;var u=this;function p(le,ne){return Q.type="throw",Q.arg=l,u.next=le,ne&&(u.method="next",u.arg=R),!!ne}for(var M=this.tryEntries.length-1;M>=0;--M){var b=this.tryEntries[M],Q=b.completion;if(b.tryLoc==="root")return p("end");if(b.tryLoc<=this.prev){var H=A.call(b,"catchLoc"),ue=A.call(b,"finallyLoc");if(H&&ue){if(this.prev<b.catchLoc)return p(b.catchLoc,!0);if(this.prev<b.finallyLoc)return p(b.finallyLoc)}else if(H){if(this.prev<b.catchLoc)return p(b.catchLoc,!0)}else if(ue){if(this.prev<b.finallyLoc)return p(b.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(l,u){for(var p=this.tryEntries.length-1;p>=0;--p){var M=this.tryEntries[p];if(M.tryLoc<=this.prev&&A.call(M,"finallyLoc")&&this.prev<M.finallyLoc){var b=M;break}}b&&(l==="break"||l==="continue")&&b.tryLoc<=u&&u<=b.finallyLoc&&(b=null);var Q=b?b.completion:{};return Q.type=l,Q.arg=u,b?(this.method="next",this.next=b.finallyLoc,K):this.complete(Q)},complete:function(l,u){if(l.type==="throw")throw l.arg;return l.type==="break"||l.type==="continue"?this.next=l.arg:l.type==="return"?(this.rval=this.arg=l.arg,this.method="return",this.next="end"):l.type==="normal"&&u&&(this.next=u),K},finish:function(l){for(var u=this.tryEntries.length-1;u>=0;--u){var p=this.tryEntries[u];if(p.finallyLoc===l)return this.complete(p.completion,p.afterLoc),re(p),K}},catch:function(l){for(var u=this.tryEntries.length-1;u>=0;--u){var p=this.tryEntries[u];if(p.tryLoc===l){var M=p.completion;if(M.type==="throw"){var b=M.arg;re(p)}return b}}throw new Error("illegal catch attempt")},delegateYield:function(l,u,p){return this.delegate={iterator:ee(l),resultName:u,nextLoc:p},this.method==="next"&&(this.arg=R),K}},x}(j.exports);try{regeneratorRuntime=B}catch(x){typeof globalThis=="object"?globalThis.regeneratorRuntime=B:Function("r","regeneratorRuntime = r")(B)}},44:function(j,B,x){x.d(B,{Z:function(){return S}});function S(A){if(A.geometry&&A.geometry.dispose(),A.material){var R=Array.isArray(A.material)?A.material:[A.material];R.forEach(function(P){var I,D,W,k,C,$,T,s,ce,te,K,ae,V;(I=P.map)===null||I===void 0||I.dispose(),(D=P.lightMap)===null||D===void 0||D.dispose(),(W=P.bumpMap)===null||W===void 0||W.dispose(),(k=P.normalMap)===null||k===void 0||k.dispose(),(C=P.specularMap)===null||C===void 0||C.dispose(),($=P.envMap)===null||$===void 0||$.dispose(),(T=P.alphaMap)===null||T===void 0||T.dispose(),(s=P.aoMap)===null||s===void 0||s.dispose(),(ce=P.displacementMap)===null||ce===void 0||ce.dispose(),(te=P.emissiveMap)===null||te===void 0||te.dispose(),(K=P.gradientMap)===null||K===void 0||K.dispose(),(ae=P.metalnessMap)===null||ae===void 0||ae.dispose(),(V=P.roughnessMap)===null||V===void 0||V.dispose(),P.dispose()})}}},218:function(j,B,x){x.d(B,{wf:function(){return P.Z}});var S=x(666),A=x.n(S),R=null,P=x(44),I=x(949);function D(V){if(V.material){var F=Array.isArray(V.material)?V.material:[V.material];F.forEach(function(L){var Z,Y;(Z=L.color)===null||Z===void 0||Z.convertSRGBToLinear(),(Y=L.emissive)===null||Y===void 0||Y.convertSRGBToLinear(),L.map&&(L.map.encoding=THREE.sRGBEncoding),L.emissiveMap&&(L.emissiveMap.encoding=THREE.sRGBEncoding)})}}var W=x(568),k=x(924),C=V=>{var F={};return x.d(F,V),F},$=V=>()=>V,T=C({get:()=>rt.get,set:()=>rt.set}),s=x(485),ce=null,te=null,K=function(){var V=(0,W.Z)(A().mark(function F(L,Z){var Y,J,U,q,oe,se;return A().wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return Y=Z.version,re.next=4,(0,T.get)(L);case 4:if(U=re.sent,!(U&&U[Y])){re.next=9;break}J=U[Y],re.next=15;break;case 9:return re.next=11,(0,s.Z)(fetch(L).then(function(X){if(X.ok)return X.blob();throw new Error}));case 11:q=re.sent,oe=q.res,se=q.err,se||(J=oe,(0,T.set)(L,(0,k.Z)({},Y,oe)));case 15:return re.abrupt("return",J?{url:URL.createObjectURL(J)}:{url:L});case 16:case"end":return re.stop()}},F)}));return function(L,Z){return V.apply(this,arguments)}}(),ae=x(818)},485:function(j,B,x){x.d(B,{Z:function(){return A}});var S=x(42);function A(R){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return R.then(function(I){return(0,S.Z)({err:null,res:I},P)}).catch(function(I){return(0,S.Z)({err:I,res:void 0},P)})}},818:function(j,B,x){x.d(B,{C:function(){return P},y:function(){return R}});var S=x(949),A=new Map,R=function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(k,C,$,T,s){var ce=C[$*3],te=C[$*3+1],K=C[T*3],ae=C[T*3+1],V=C[s*3],F=C[s*3+1],L;if(A.has(k))L=A.get(k);else{var Z=D.box3||new S.Box3;if(!D.box3){var Y=k.parameters.shapes.getPoints();Z.setFromArray(Y.map(function(se){return[se.x,se.y,0]}).flat())}var J=Z.getSize(new S.Vector3);D.split&&(J.y/=D.split),L={box:Z,size:J},A.set(k,L)}var U=L.box,q=L.size,oe=D.split?1-D.split:0;return[new S.Vector2((ce-U.min.x)/q.x,(te-U.min.y)/q.y+oe),new S.Vector2((K-U.min.x)/q.x,(ae-U.min.y)/q.y+oe),new S.Vector2((V-U.min.x)/q.x,(F-U.min.y)/q.y+oe)]},generateSideWallUV:function(k,C,$,T,s,ce){var te=C[$*3],K=C[$*3+1],ae=C[$*3+2],V=C[T*3],F=C[T*3+1],L=C[T*3+2],Z=C[s*3],Y=C[s*3+1],J=C[s*3+2],U=C[ce*3],q=C[ce*3+1],oe=C[ce*3+2],se;if(A.has(C))se=A.get(C);else{var Pe=new S.Box3;Pe.setFromArray(C);var re=Pe.getSize(new S.Vector3);D.split&&(re.z/=1-D.split),se={box:Pe,size:re},A.set(C,se)}var X=se.box,ee=se.size;return Math.abs(K-F)<Math.abs(te-V)?[new S.Vector2((te-X.min.x)/ee.x,(ae-X.min.z)/ee.z),new S.Vector2((V-X.min.x)/ee.x,(L-X.min.z)/ee.z),new S.Vector2((Z-X.min.x)/ee.x,(J-X.min.z)/ee.z),new S.Vector2((U-X.min.x)/ee.x,(oe-X.min.z)/ee.z)]:[new S.Vector2((K-X.min.y)/ee.x,(ae-X.min.z)/ee.z),new S.Vector2((F-X.min.y)/ee.x,(L-X.min.z)/ee.z),new S.Vector2((Y-X.min.y)/ee.x,(J-X.min.z)/ee.z),new S.Vector2((q-X.min.y)/ee.x,(oe-X.min.z)/ee.z)]}}},P=function(){A.clear()}},949:function(j,B,x){var S=R=>{var P={};return x.d(P,R),P},A=R=>()=>R;j.exports=S({Box3:()=>z.Box3,BufferAttribute:()=>z.BufferAttribute,BufferGeometry:()=>z.BufferGeometry,CanvasTexture:()=>z.CanvasTexture,Color:()=>z.Color,DoubleSide:()=>z.DoubleSide,ExtrudeGeometry:()=>z.ExtrudeGeometry,Float32BufferAttribute:()=>z.Float32BufferAttribute,Group:()=>z.Group,LineSegments:()=>z.LineSegments,Matrix4:()=>z.Matrix4,Mesh:()=>z.Mesh,MeshBasicMaterial:()=>z.MeshBasicMaterial,NormalBlending:()=>z.NormalBlending,PlaneBufferGeometry:()=>z.PlaneBufferGeometry,PlaneGeometry:()=>z.PlaneGeometry,Points:()=>z.Points,RGBAFormat:()=>z.RGBAFormat,Ray:()=>z.Ray,ShaderChunk:()=>z.ShaderChunk,ShaderMaterial:()=>z.ShaderMaterial,Shape:()=>z.Shape,Sphere:()=>z.Sphere,Sprite:()=>z.Sprite,SpriteMaterial:()=>z.SpriteMaterial,Texture:()=>z.Texture,TextureLoader:()=>z.TextureLoader,UniformsLib:()=>z.UniformsLib,Vector2:()=>z.Vector2,Vector3:()=>z.Vector3,VideoTexture:()=>z.VideoTexture})},568:function(j,B,x){x.d(B,{Z:function(){return A}});function S(R,P,I,D,W,k,C){try{var $=R[k](C),T=$.value}catch(s){I(s);return}$.done?P(T):Promise.resolve(T).then(D,W)}function A(R){return function(){var P=this,I=arguments;return new Promise(function(D,W){var k=R.apply(P,I);function C(T){S(k,D,W,C,$,"next",T)}function $(T){S(k,D,W,C,$,"throw",T)}C(void 0)})}}},924:function(j,B,x){x.d(B,{Z:function(){return S}});function S(A,R,P){return R in A?Object.defineProperty(A,R,{value:P,enumerable:!0,configurable:!0,writable:!0}):A[R]=P,A}},42:function(j,B,x){x.d(B,{Z:function(){return A}});var S=x(924);function A(R){for(var P=1;P<arguments.length;P++){var I=arguments[P]!=null?arguments[P]:{},D=Object.keys(I);typeof Object.getOwnPropertySymbols=="function"&&(D=D.concat(Object.getOwnPropertySymbols(I).filter(function(W){return Object.getOwnPropertyDescriptor(I,W).enumerable}))),D.forEach(function(W){(0,S.Z)(R,W,I[W])})}return R}}},it={};function N(j){var B=it[j];if(B!==void 0)return B.exports;var x=it[j]={exports:{}};return $t[j](x,x.exports,N),x.exports}(function(){N.n=function(j){var B=j&&j.__esModule?function(){return j.default}:function(){return j};return N.d(B,{a:B}),B}})(),function(){N.d=function(j,B){for(var x in B)N.o(B,x)&&!N.o(j,x)&&Object.defineProperty(j,x,{enumerable:!0,get:B[x]})}}(),function(){N.o=function(j,B){return Object.prototype.hasOwnProperty.call(j,B)}}();var _e={};(function(){N.d(_e,{Ei:function(){return Gt},Yo:function(){return zt},Ee:function(){return ue},x1:function(){return vt},VJ:function(){return ge},r7:function(){return We},XA:function(){return Xe},NB:function(){return at},xv:function(){return M},nk:function(){return Ce}});function j(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function B(e,n){return B=Object.setPrototypeOf||function(i,a){return i.__proto__=a,i},B(e,n)}function x(e,n){return B(e,n)}function S(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&x(e,n)}var A=N(42);function R(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function P(e,n){return n=n!=null?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}),e}function I(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function D(e){return D=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},D(e)}function W(e){return D(e)}function k(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function C(e){return e&&e.constructor===Symbol?"symbol":typeof e}function $(e,n){return n&&(C(n)==="object"||typeof n=="function")?n:k(e)}function T(e){var n=I();return function(){var i=W(e),a;if(n){var t=W(this).constructor;a=Reflect.construct(i,arguments,t)}else a=i.apply(this,arguments);return $(this,a)}}var s=N(949);function ce(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function te(e,n,r){return ce()?te=Reflect.construct:te=function(a,t,o){var c=[null];c.push.apply(c,t);var h=Function.bind.apply(a,c),v=new h;return o&&x(v,o.prototype),v},te.apply(null,arguments)}function K(e,n,r){return te.apply(null,arguments)}function ae(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function V(e,n,r){return n&&ae(e.prototype,n),r&&ae(e,r),e}function F(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=new Array(n);r<n;r++)i[r]=e[r];return i}function L(e){if(Array.isArray(e))return F(e)}function Z(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Y(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function J(e,n){if(!!e){if(typeof e=="string")return F(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return F(e,n)}}function U(e){return L(e)||Z(e)||J(e)||Y()}var q=N(485);function oe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={};return r.promise=new Promise(function(i,a){r.resolve=i,r.reject=a}),e&&(r.promise=(0,q.Z)(r.promise,n)),r}var se=e=>{var n={};return N.d(n,e),n},Pe=e=>()=>e,re=se({CSS2DObject:()=>Vt.CSS2DObject}),X=e=>{var n={};return N.d(n,e),n},ee=e=>()=>e,Be=X({CSS3DObject:()=>nt.CSS3DObject,CSS3DSprite:()=>nt.CSS3DSprite}),l=N(218),u=function(e){e&&((0,l.wf)(e),e.children.forEach(function(n){n.userData.BaseObject_||u(n)}))},p=function(){"use strict";function e(){j(this,e),this.objecttype__="BaseObject",this.userData={},this.pm=oe(),this.visible=!1}var n=e.prototype;return n.init=function(){},n.create=function(){},n.render=function(){},n.update=function(i,a){},n.resize=function(i,a){},n.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},n.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},n.isVisible=function(){return this.visible},n.createMesh=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];return this.object3d=K(s.Mesh,U(a)),this},n.createGroup=function(){return this.object3d=new s.Group,this},n.createPoints=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];return this.object3d=K(s.Points,U(a)),this},n.createCSS2DObject=function(i){return this.object3d=new re.CSS2DObject(i),this},n.createCSS3DObject=function(i){return this.object3d=new Be.CSS3DObject(i),this},n.createCSS3DSprite=function(i){return this.object3d=new Be.CSS3DSprite(i),this},n.createSprite=function(i){return this.object3d=new s.Sprite(i),this},n.add=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];var o;return(o=this.object3d).add.apply(o,U(a)),this},n.remove=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];var o;return(o=this.object3d).remove.apply(o,U(a)),this},n.getSize=function(){var i=new s.Box3().setFromObject(this.object3d);return{min:i.min,max:i.max,size:i.getSize(new s.Vector3)}},n.traverse=function(i){i(this),this.children.forEach(function(a){a.traverse(i)})},n.dispose=function(){u(this.object3d)},V(e,[{key:"parent",get:function(){var i=this.object3d.parent;return(i==null?void 0:i.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(i){return i.userData.BaseObject_}).filter(function(i){return!!i})}}]),e}(),M=function(e){"use strict";S(r,e);var n=T(r);function r(a){j(this,r);var t;return t=n.call(this),t.width=0,t.canvas=document.createElement("canvas"),t.options=(0,A.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.position,c=t.lookAt,h=t.sprite,v=t.text,d=t.sizeAttenuation;if(h){var m=new s.Sprite(new s.SpriteMaterial({transparent:!0,sizeAttenuation:d}));this.object3d=m}else{var y=new s.MeshBasicMaterial({side:s.DoubleSide,transparent:!0}),_=new s.PlaneGeometry(1,1,1,1);this.createMesh(_,y)}this.object3d.position.copy(o),c&&this.object3d.lookAt(c),this.setText(v)},i.setText=function(t,o){var c=(0,A.Z)(P((0,A.Z)({},this.options),{text:t}),o||{}),h=c.text,v=c.fontSize,d=c.fontFamily,m=c.fontWeight,y=c.flipX,_=c.scale,g=this.canvas;g.width=v*h.length*2,g.height=v;var w=g.getContext("2d");w.font="".concat(m," ").concat(v,"px/1 ").concat(d);var f=w.measureText(h).width;g.width=f,this.width=f,w=g.getContext("2d"),w.clearRect(0,0,g.width,g.height),y&&w.scale(-1,1),w.font="".concat(m," ").concat(v,"px/1 ").concat(d),w.textBaseline="middle",w.fillStyle="#ffffff",w.fillText(h,y?f*-1:0,g.height/2),w.restore();var O=new s.Texture(g);O.anisotropy=16,O.needsUpdate=!0;var E=this.object3d;E.material.map&&E.material.map.dispose(),E.material.map=O,E.material.needsUpdate=!0,E.scale.set(O.image.width*_,O.image.height*_,1)},r}(p),b=N(568),Q=N(666),H=N.n(Q),ue=function(e){"use strict";S(r,e);var n=T(r);function r(a){j(this,r);var t;return t=n.call(this),t.options=a,t}var i=r.prototype;return i.getMaterial=function(){var t=this;return(0,b.Z)(H().mark(function o(){var c,h,v,d,m,y,_,g,w,f;return H().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return c=t.options,h=c.transparent,v=c.blending,d=c.src,m=c.depthWrite,y=c.alphaTest,_=c.sprite,g=c.sizeAttenuation,E.next=3,new s.TextureLoader().loadAsync(d);case 3:return w=E.sent,f=_?new s.SpriteMaterial({map:w,transparent:h!=null?h:!1,blending:v!=null?v:s.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:y!=null?y:0,sizeAttenuation:g!=null?g:!0}):new s.MeshBasicMaterial({map:w,transparent:h!=null?h:!1,blending:v!=null?v:s.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:y!=null?y:0}),E.abrupt("return",f);case 6:case"end":return E.stop()}},o)}))()},i.create=function(){var t=this;return(0,b.Z)(H().mark(function o(){var c,h,v,d,m,y,_,g;return H().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(c=t.options,h=c.scale,v=c.position,d=c.src,m=c.cache,y=c.sprite,!(m&&!m.get(d))){f.next=7;break}return m.init(d),f.next=5,t.getMaterial();case 5:_=f.sent,m.set(d,_);case 7:if(!m){f.next=13;break}return f.next=10,m.get(d);case 10:f.t0=f.sent,f.next=16;break;case 13:return f.next=15,t.getMaterial();case 15:f.t0=f.sent;case 16:g=f.t0,t.texture=g.map,y?t.createSprite(g):t.createMesh(new s.PlaneBufferGeometry(1,1),g),h&&t.setScale(h),v&&t.object3d.position.copy(v);case 21:case"end":return f.stop()}},o)}))()},i.setScale=function(t){this.object3d.scale.set(this.texture.image.width*t,this.texture.image.height*t,1)},r}(p);function le(e,n){for(;!Object.prototype.hasOwnProperty.call(e,n)&&(e=W(e),e!==null););return e}function ne(e,n,r){return typeof Reflect!="undefined"&&Reflect.get?ne=Reflect.get:ne=function(a,t,o){var c=le(a,t);if(!!c){var h=Object.getOwnPropertyDescriptor(c,t);return h.get?h.get.call(o||a):h.value}},ne(e,n,r)}function Oe(e,n,r){return ne(e,n,r)}var Ce=function(e){"use strict";S(r,e);var n=T(r);function r(a){j(this,r);var t;return t=n.call(this),t.options=(0,A.Z)({},{autoPlay:!0,loop:!0},a),t}var i=r.prototype;return i.getMaterial=function(){var t=this.options,o=t.src,c=t.transparent,h=t.blending,v=t.depthWrite,d=t.format,m=t.autoPlay,y=t.loop,_=t.alphaTest,g=t.sprite,w=oe(),f=document.createElement("video");return f.addEventListener("loadedmetadata",function(){var O=new s.VideoTexture(f);O.format=d!=null?d:s.RGBAFormat,O.needsUpdate=!0;var E=g?new s.SpriteMaterial({map:O,transparent:c!=null?c:!1,blending:h!=null?h:s.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:_!=null?_:0}):new s.MeshBasicMaterial({map:O,transparent:c!=null?c:!1,blending:h!=null?h:s.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:_!=null?_:0});w.resolve(E)},!1),f.src=o,f.muted=!0,f.autoplay=m,f.loop=y,f.preload="auto",w.promise},i.create=function(){var t=this;return(0,b.Z)(H().mark(function o(){var c,h,v,d,m,y,_,g;return H().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(c=t.options,h=c.scale,v=c.position,d=c.src,m=c.cache,y=c.sprite,!(m&&!m.get(d))){f.next=7;break}return m.init(d),f.next=5,t.getMaterial();case 5:_=f.sent,m.set(d,_);case 7:if(!m){f.next=13;break}return f.next=10,m.get(d);case 10:f.t0=f.sent,f.next=16;break;case 13:return f.next=15,t.getMaterial();case 15:f.t0=f.sent;case 16:g=f.t0,t.video=g.map.image,y?t.createSprite(g):t.createMesh(new s.PlaneBufferGeometry(1,1),g),h&&t.setScale(h),v&&t.object3d.position.copy(v);case 21:case"end":return f.stop()}},o)}))()},i.setScale=function(t){this.object3d.scale.set(this.video.videoWidth*t,this.video.videoHeight*t,1)},i.render=function(){var t=this.options.autoPlay;t&&this.video.play()},i.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),Oe(W(r.prototype),"dispose",this).call(this)},r}(p),we=function(e){"use strict";S(r,e);var n=T(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.options,o=t.position,c=t.children,h=t.onClick,v=t.zIndexFix,d=document.createElement("div");this.element=d,d.appendChild(c),this.createCSS2DObject(d),o&&this.object3d.position.copy(o),h&&this.clickTarge.forEach(function(m){m.addEventListener("click",h)}),v&&(this.object3d.userData.zIndexFix=v)},i.getMaterial=function(t){return(0,b.Z)(H().mark(function o(){var c,h,v,d;return H().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return c=document.createElement("canvas"),c.width=256,c.height=256,h=c.getContext("2d"),h.fillStyle="#ff0000",h.fillRect(0,0,256,256),v=new s.CanvasTexture(c),d=new s.SpriteMaterial({map:v,opacity:t?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),y.abrupt("return",d);case 9:case"end":return y.stop()}},o)}))()},i.createPickObject=function(t){var o=t.show,c=o===void 0?!1:o,h=t.scale,v=h===void 0?new s.Vector3(1,1,1):h,d=t.position,m=d===void 0?new s.Vector3(0,0,0):d,y=t.cache,_=this;return(0,b.Z)(H().mark(function g(){var w,f,O,E;return H().wrap(function(G){for(;;)switch(G.prev=G.next){case 0:if(w="node-create-pick-object",!(y&&!y.get(w))){G.next=7;break}return y.init(w),G.next=5,_.getMaterial(c);case 5:f=G.sent,y.set(w,f);case 7:if(!y){G.next=13;break}return G.next=10,y.get(w);case 10:G.t0=G.sent,G.next=16;break;case 13:return G.next=15,_.getMaterial(c);case 15:G.t0=G.sent;case 16:O=G.t0,E=new s.Sprite(O),E.scale.set(O.map.image.width*v.x,O.map.image.height*v.y,1),E.position.copy(m),_.add(E),_.pickObject=E;case 22:case"end":return G.stop()}},g)}))()},i.dispose=function(){var t=this.options.onClick;t&&this.clickTarge.forEach(function(o){o.removeEventListener("click",t)}),Oe(W(r.prototype),"dispose",this).call(this)},V(r,[{key:"clickTarge",get:function(){var t=this,o=this.options.clickTarge;if(o){var c=o.map(function(h){return U(t.element.querySelectorAll(h))}).flat();return c}return[this.element]}}]),r}(p),at=we,ot=`
1
+ import*as rt from"idb-keyval";import*as z from"three";import*as Vt from"three/examples/jsm/renderers/CSS2DRenderer";import*as nt from"three/examples/jsm/renderers/CSS3DRenderer";import*as Ut from"popmotion";import*as Nt from"three/examples/jsm//utils/BufferGeometryUtils";import*as Ze from"d3-array";import*as It from"earcut";import*as Ft from"@turf/boolean-clockwise";import*as Zt from"delaunator";import*as Xt from"@turf/boolean-point-in-polygon";import*as ze from"d3-geo";import*as Ht from"d3-geo-voronoi";import*as Kt from"d3-scale";var $t={666:function(j){var B=function(x){"use strict";var S=Object.prototype,A=S.hasOwnProperty,k,P=typeof Symbol=="function"?Symbol:{},I=P.iterator||"@@iterator",D=P.asyncIterator||"@@asyncIterator",W=P.toStringTag||"@@toStringTag";function T(l,u,p){return Object.defineProperty(l,u,{value:p,enumerable:!0,configurable:!0,writable:!0}),l[u]}try{T({},"")}catch(l){T=function(u,p,M){return u[p]=M}}function C(l,u,p,M){var b=u&&u.prototype instanceof ae?u:ae,Q=Object.create(b.prototype),H=new X(M||[]);return Q._invoke=oe(l,p,H),Q}x.wrap=C;function $(l,u,p){try{return{type:"normal",arg:l.call(u,p)}}catch(M){return{type:"throw",arg:M}}}var R="suspendedStart",s="suspendedYield",ce="executing",te="completed",K={};function ae(){}function V(){}function F(){}var L={};T(L,I,function(){return this});var Z=Object.getPrototypeOf,Y=Z&&Z(Z(ee([])));Y&&Y!==S&&A.call(Y,I)&&(L=Y);var J=F.prototype=ae.prototype=Object.create(L);V.prototype=F,T(J,"constructor",F),T(F,"constructor",V),V.displayName=T(F,W,"GeneratorFunction");function U(l){["next","throw","return"].forEach(function(u){T(l,u,function(p){return this._invoke(u,p)})})}x.isGeneratorFunction=function(l){var u=typeof l=="function"&&l.constructor;return u?u===V||(u.displayName||u.name)==="GeneratorFunction":!1},x.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,F):(l.__proto__=F,T(l,W,"GeneratorFunction")),l.prototype=Object.create(J),l},x.awrap=function(l){return{__await:l}};function q(l,u){function p(Q,H,ue,le){var ne=$(l[Q],l,H);if(ne.type==="throw")le(ne.arg);else{var Oe=ne.arg,Ce=Oe.value;return Ce&&typeof Ce=="object"&&A.call(Ce,"__await")?u.resolve(Ce.__await).then(function(we){p("next",we,ue,le)},function(we){p("throw",we,ue,le)}):u.resolve(Ce).then(function(we){Oe.value=we,ue(Oe)},function(we){return p("throw",we,ue,le)})}}var M;function b(Q,H){function ue(){return new u(function(le,ne){p(Q,H,le,ne)})}return M=M?M.then(ue,ue):ue()}this._invoke=b}U(q.prototype),T(q.prototype,D,function(){return this}),x.AsyncIterator=q,x.async=function(l,u,p,M,b){b===void 0&&(b=Promise);var Q=new q(C(l,u,p,M),b);return x.isGeneratorFunction(u)?Q:Q.next().then(function(H){return H.done?H.value:Q.next()})};function oe(l,u,p){var M=R;return function(Q,H){if(M===ce)throw new Error("Generator is already running");if(M===te){if(Q==="throw")throw H;return Be()}for(p.method=Q,p.arg=H;;){var ue=p.delegate;if(ue){var le=se(ue,p);if(le){if(le===K)continue;return le}}if(p.method==="next")p.sent=p._sent=p.arg;else if(p.method==="throw"){if(M===R)throw M=te,p.arg;p.dispatchException(p.arg)}else p.method==="return"&&p.abrupt("return",p.arg);M=ce;var ne=$(l,u,p);if(ne.type==="normal"){if(M=p.done?te:s,ne.arg===K)continue;return{value:ne.arg,done:p.done}}else ne.type==="throw"&&(M=te,p.method="throw",p.arg=ne.arg)}}}function se(l,u){var p=l.iterator[u.method];if(p===k){if(u.delegate=null,u.method==="throw"){if(l.iterator.return&&(u.method="return",u.arg=k,se(l,u),u.method==="throw"))return K;u.method="throw",u.arg=new TypeError("The iterator does not provide a 'throw' method")}return K}var M=$(p,l.iterator,u.arg);if(M.type==="throw")return u.method="throw",u.arg=M.arg,u.delegate=null,K;var b=M.arg;if(!b)return u.method="throw",u.arg=new TypeError("iterator result is not an object"),u.delegate=null,K;if(b.done)u[l.resultName]=b.value,u.next=l.nextLoc,u.method!=="return"&&(u.method="next",u.arg=k);else return b;return u.delegate=null,K}U(J),T(J,W,"Generator"),T(J,I,function(){return this}),T(J,"toString",function(){return"[object Generator]"});function Pe(l){var u={tryLoc:l[0]};1 in l&&(u.catchLoc=l[1]),2 in l&&(u.finallyLoc=l[2],u.afterLoc=l[3]),this.tryEntries.push(u)}function re(l){var u=l.completion||{};u.type="normal",delete u.arg,l.completion=u}function X(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(Pe,this),this.reset(!0)}x.keys=function(l){var u=[];for(var p in l)u.push(p);return u.reverse(),function M(){for(;u.length;){var b=u.pop();if(b in l)return M.value=b,M.done=!1,M}return M.done=!0,M}};function ee(l){if(l){var u=l[I];if(u)return u.call(l);if(typeof l.next=="function")return l;if(!isNaN(l.length)){var p=-1,M=function b(){for(;++p<l.length;)if(A.call(l,p))return b.value=l[p],b.done=!1,b;return b.value=k,b.done=!0,b};return M.next=M}}return{next:Be}}x.values=ee;function Be(){return{value:k,done:!0}}return X.prototype={constructor:X,reset:function(l){if(this.prev=0,this.next=0,this.sent=this._sent=k,this.done=!1,this.delegate=null,this.method="next",this.arg=k,this.tryEntries.forEach(re),!l)for(var u in this)u.charAt(0)==="t"&&A.call(this,u)&&!isNaN(+u.slice(1))&&(this[u]=k)},stop:function(){this.done=!0;var l=this.tryEntries[0],u=l.completion;if(u.type==="throw")throw u.arg;return this.rval},dispatchException:function(l){if(this.done)throw l;var u=this;function p(le,ne){return Q.type="throw",Q.arg=l,u.next=le,ne&&(u.method="next",u.arg=k),!!ne}for(var M=this.tryEntries.length-1;M>=0;--M){var b=this.tryEntries[M],Q=b.completion;if(b.tryLoc==="root")return p("end");if(b.tryLoc<=this.prev){var H=A.call(b,"catchLoc"),ue=A.call(b,"finallyLoc");if(H&&ue){if(this.prev<b.catchLoc)return p(b.catchLoc,!0);if(this.prev<b.finallyLoc)return p(b.finallyLoc)}else if(H){if(this.prev<b.catchLoc)return p(b.catchLoc,!0)}else if(ue){if(this.prev<b.finallyLoc)return p(b.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(l,u){for(var p=this.tryEntries.length-1;p>=0;--p){var M=this.tryEntries[p];if(M.tryLoc<=this.prev&&A.call(M,"finallyLoc")&&this.prev<M.finallyLoc){var b=M;break}}b&&(l==="break"||l==="continue")&&b.tryLoc<=u&&u<=b.finallyLoc&&(b=null);var Q=b?b.completion:{};return Q.type=l,Q.arg=u,b?(this.method="next",this.next=b.finallyLoc,K):this.complete(Q)},complete:function(l,u){if(l.type==="throw")throw l.arg;return l.type==="break"||l.type==="continue"?this.next=l.arg:l.type==="return"?(this.rval=this.arg=l.arg,this.method="return",this.next="end"):l.type==="normal"&&u&&(this.next=u),K},finish:function(l){for(var u=this.tryEntries.length-1;u>=0;--u){var p=this.tryEntries[u];if(p.finallyLoc===l)return this.complete(p.completion,p.afterLoc),re(p),K}},catch:function(l){for(var u=this.tryEntries.length-1;u>=0;--u){var p=this.tryEntries[u];if(p.tryLoc===l){var M=p.completion;if(M.type==="throw"){var b=M.arg;re(p)}return b}}throw new Error("illegal catch attempt")},delegateYield:function(l,u,p){return this.delegate={iterator:ee(l),resultName:u,nextLoc:p},this.method==="next"&&(this.arg=k),K}},x}(j.exports);try{regeneratorRuntime=B}catch(x){typeof globalThis=="object"?globalThis.regeneratorRuntime=B:Function("r","regeneratorRuntime = r")(B)}},44:function(j,B,x){x.d(B,{Z:function(){return S}});function S(A){if(A.geometry&&A.geometry.dispose(),A.material){var k=Array.isArray(A.material)?A.material:[A.material];k.forEach(function(P){var I,D,W,T,C,$,R,s,ce,te,K,ae,V;(I=P.map)===null||I===void 0||I.dispose(),(D=P.lightMap)===null||D===void 0||D.dispose(),(W=P.bumpMap)===null||W===void 0||W.dispose(),(T=P.normalMap)===null||T===void 0||T.dispose(),(C=P.specularMap)===null||C===void 0||C.dispose(),($=P.envMap)===null||$===void 0||$.dispose(),(R=P.alphaMap)===null||R===void 0||R.dispose(),(s=P.aoMap)===null||s===void 0||s.dispose(),(ce=P.displacementMap)===null||ce===void 0||ce.dispose(),(te=P.emissiveMap)===null||te===void 0||te.dispose(),(K=P.gradientMap)===null||K===void 0||K.dispose(),(ae=P.metalnessMap)===null||ae===void 0||ae.dispose(),(V=P.roughnessMap)===null||V===void 0||V.dispose(),P.dispose()})}}},218:function(j,B,x){x.d(B,{wf:function(){return P.Z}});var S=x(666),A=x.n(S),k=null,P=x(44),I=x(949);function D(V){if(V.material){var F=Array.isArray(V.material)?V.material:[V.material];F.forEach(function(L){var Z,Y;(Z=L.color)===null||Z===void 0||Z.convertSRGBToLinear(),(Y=L.emissive)===null||Y===void 0||Y.convertSRGBToLinear(),L.map&&(L.map.encoding=THREE.sRGBEncoding),L.emissiveMap&&(L.emissiveMap.encoding=THREE.sRGBEncoding)})}}var W=x(568),T=x(924),C=V=>{var F={};return x.d(F,V),F},$=V=>()=>V,R=C({get:()=>rt.get,set:()=>rt.set}),s=x(485),ce=null,te=null,K=function(){var V=(0,W.Z)(A().mark(function F(L,Z){var Y,J,U,q,oe,se;return A().wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return Y=Z.version,re.next=4,(0,R.get)(L);case 4:if(U=re.sent,!(U&&U[Y])){re.next=9;break}J=U[Y],re.next=15;break;case 9:return re.next=11,(0,s.Z)(fetch(L).then(function(X){if(X.ok)return X.blob();throw new Error}));case 11:q=re.sent,oe=q.res,se=q.err,se||(J=oe,(0,R.set)(L,(0,T.Z)({},Y,oe)));case 15:return re.abrupt("return",J?{url:URL.createObjectURL(J)}:{url:L});case 16:case"end":return re.stop()}},F)}));return function(L,Z){return V.apply(this,arguments)}}(),ae=x(818)},485:function(j,B,x){x.d(B,{Z:function(){return A}});var S=x(42);function A(k){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return k.then(function(I){return(0,S.Z)({err:null,res:I},P)}).catch(function(I){return(0,S.Z)({err:I,res:void 0},P)})}},818:function(j,B,x){x.d(B,{C:function(){return P},y:function(){return k}});var S=x(949),A=new Map,k=function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(T,C,$,R,s){var ce=C[$*3],te=C[$*3+1],K=C[R*3],ae=C[R*3+1],V=C[s*3],F=C[s*3+1],L;if(A.has(T))L=A.get(T);else{var Z=D.box3||new S.Box3;if(!D.box3){var Y=T.parameters.shapes.getPoints();Z.setFromArray(Y.map(function(se){return[se.x,se.y,0]}).flat())}var J=Z.getSize(new S.Vector3);D.split&&(J.y/=D.split),L={box:Z,size:J},A.set(T,L)}var U=L.box,q=L.size,oe=D.split?1-D.split:0;return[new S.Vector2((ce-U.min.x)/q.x,(te-U.min.y)/q.y+oe),new S.Vector2((K-U.min.x)/q.x,(ae-U.min.y)/q.y+oe),new S.Vector2((V-U.min.x)/q.x,(F-U.min.y)/q.y+oe)]},generateSideWallUV:function(T,C,$,R,s,ce){var te=C[$*3],K=C[$*3+1],ae=C[$*3+2],V=C[R*3],F=C[R*3+1],L=C[R*3+2],Z=C[s*3],Y=C[s*3+1],J=C[s*3+2],U=C[ce*3],q=C[ce*3+1],oe=C[ce*3+2],se;if(A.has(C))se=A.get(C);else{var Pe=new S.Box3;Pe.setFromArray(C);var re=Pe.getSize(new S.Vector3);D.split&&(re.z/=1-D.split),se={box:Pe,size:re},A.set(C,se)}var X=se.box,ee=se.size;return Math.abs(K-F)<Math.abs(te-V)?[new S.Vector2((te-X.min.x)/ee.x,(ae-X.min.z)/ee.z),new S.Vector2((V-X.min.x)/ee.x,(L-X.min.z)/ee.z),new S.Vector2((Z-X.min.x)/ee.x,(J-X.min.z)/ee.z),new S.Vector2((U-X.min.x)/ee.x,(oe-X.min.z)/ee.z)]:[new S.Vector2((K-X.min.y)/ee.x,(ae-X.min.z)/ee.z),new S.Vector2((F-X.min.y)/ee.x,(L-X.min.z)/ee.z),new S.Vector2((Y-X.min.y)/ee.x,(J-X.min.z)/ee.z),new S.Vector2((q-X.min.y)/ee.x,(oe-X.min.z)/ee.z)]}}},P=function(){A.clear()}},949:function(j,B,x){var S=k=>{var P={};return x.d(P,k),P},A=k=>()=>k;j.exports=S({Box3:()=>z.Box3,BufferAttribute:()=>z.BufferAttribute,BufferGeometry:()=>z.BufferGeometry,CanvasTexture:()=>z.CanvasTexture,Color:()=>z.Color,DoubleSide:()=>z.DoubleSide,ExtrudeGeometry:()=>z.ExtrudeGeometry,Float32BufferAttribute:()=>z.Float32BufferAttribute,Group:()=>z.Group,LineSegments:()=>z.LineSegments,Matrix4:()=>z.Matrix4,Mesh:()=>z.Mesh,MeshBasicMaterial:()=>z.MeshBasicMaterial,NormalBlending:()=>z.NormalBlending,PlaneBufferGeometry:()=>z.PlaneBufferGeometry,PlaneGeometry:()=>z.PlaneGeometry,Points:()=>z.Points,RGBAFormat:()=>z.RGBAFormat,Ray:()=>z.Ray,ShaderChunk:()=>z.ShaderChunk,ShaderMaterial:()=>z.ShaderMaterial,Shape:()=>z.Shape,Sphere:()=>z.Sphere,Sprite:()=>z.Sprite,SpriteMaterial:()=>z.SpriteMaterial,Texture:()=>z.Texture,TextureLoader:()=>z.TextureLoader,UniformsLib:()=>z.UniformsLib,Vector2:()=>z.Vector2,Vector3:()=>z.Vector3,VideoTexture:()=>z.VideoTexture})},568:function(j,B,x){x.d(B,{Z:function(){return A}});function S(k,P,I,D,W,T,C){try{var $=k[T](C),R=$.value}catch(s){I(s);return}$.done?P(R):Promise.resolve(R).then(D,W)}function A(k){return function(){var P=this,I=arguments;return new Promise(function(D,W){var T=k.apply(P,I);function C(R){S(T,D,W,C,$,"next",R)}function $(R){S(T,D,W,C,$,"throw",R)}C(void 0)})}}},924:function(j,B,x){x.d(B,{Z:function(){return S}});function S(A,k,P){return k in A?Object.defineProperty(A,k,{value:P,enumerable:!0,configurable:!0,writable:!0}):A[k]=P,A}},42:function(j,B,x){x.d(B,{Z:function(){return A}});var S=x(924);function A(k){for(var P=1;P<arguments.length;P++){var I=arguments[P]!=null?arguments[P]:{},D=Object.keys(I);typeof Object.getOwnPropertySymbols=="function"&&(D=D.concat(Object.getOwnPropertySymbols(I).filter(function(W){return Object.getOwnPropertyDescriptor(I,W).enumerable}))),D.forEach(function(W){(0,S.Z)(k,W,I[W])})}return k}}},it={};function N(j){var B=it[j];if(B!==void 0)return B.exports;var x=it[j]={exports:{}};return $t[j](x,x.exports,N),x.exports}(function(){N.n=function(j){var B=j&&j.__esModule?function(){return j.default}:function(){return j};return N.d(B,{a:B}),B}})(),function(){N.d=function(j,B){for(var x in B)N.o(B,x)&&!N.o(j,x)&&Object.defineProperty(j,x,{enumerable:!0,get:B[x]})}}(),function(){N.o=function(j,B){return Object.prototype.hasOwnProperty.call(j,B)}}();var _e={};(function(){N.d(_e,{Ei:function(){return Gt},Yo:function(){return zt},Ee:function(){return ue},x1:function(){return vt},VJ:function(){return ge},r7:function(){return We},XA:function(){return Xe},NB:function(){return at},xv:function(){return M},nk:function(){return Ce}});function j(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function B(e,n){return B=Object.setPrototypeOf||function(i,a){return i.__proto__=a,i},B(e,n)}function x(e,n){return B(e,n)}function S(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&x(e,n)}var A=N(42);function k(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function P(e,n){return n=n!=null?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}),e}function I(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function D(e){return D=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},D(e)}function W(e){return D(e)}function T(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function C(e){return e&&e.constructor===Symbol?"symbol":typeof e}function $(e,n){return n&&(C(n)==="object"||typeof n=="function")?n:T(e)}function R(e){var n=I();return function(){var i=W(e),a;if(n){var t=W(this).constructor;a=Reflect.construct(i,arguments,t)}else a=i.apply(this,arguments);return $(this,a)}}var s=N(949);function ce(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function te(e,n,r){return ce()?te=Reflect.construct:te=function(a,t,o){var c=[null];c.push.apply(c,t);var h=Function.bind.apply(a,c),v=new h;return o&&x(v,o.prototype),v},te.apply(null,arguments)}function K(e,n,r){return te.apply(null,arguments)}function ae(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function V(e,n,r){return n&&ae(e.prototype,n),r&&ae(e,r),e}function F(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=new Array(n);r<n;r++)i[r]=e[r];return i}function L(e){if(Array.isArray(e))return F(e)}function Z(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Y(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function J(e,n){if(!!e){if(typeof e=="string")return F(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return F(e,n)}}function U(e){return L(e)||Z(e)||J(e)||Y()}var q=N(485);function oe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={};return r.promise=new Promise(function(i,a){r.resolve=i,r.reject=a}),e&&(r.promise=(0,q.Z)(r.promise,n)),r}var se=e=>{var n={};return N.d(n,e),n},Pe=e=>()=>e,re=se({CSS2DObject:()=>Vt.CSS2DObject}),X=e=>{var n={};return N.d(n,e),n},ee=e=>()=>e,Be=X({CSS3DObject:()=>nt.CSS3DObject,CSS3DSprite:()=>nt.CSS3DSprite}),l=N(218),u=function(e){e&&((0,l.wf)(e),e.children.forEach(function(n){n.userData.BaseObject_||u(n)}))},p=function(){"use strict";function e(){j(this,e),this.objecttype__="BaseObject",this.userData={},this.pm=oe(),this.visible=!1}var n=e.prototype;return n.init=function(){},n.create=function(){},n.render=function(){},n.update=function(i,a){},n.resize=function(i,a){},n.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},n.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},n.isVisible=function(){return this.visible},n.createMesh=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];return this.object3d=K(s.Mesh,U(a)),this},n.createGroup=function(){return this.object3d=new s.Group,this},n.createPoints=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];return this.object3d=K(s.Points,U(a)),this},n.createCSS2DObject=function(i){return this.object3d=new re.CSS2DObject(i),this},n.createCSS3DObject=function(i){return this.object3d=new Be.CSS3DObject(i),this},n.createCSS3DSprite=function(i){return this.object3d=new Be.CSS3DSprite(i),this},n.createSprite=function(i){return this.object3d=new s.Sprite(i),this},n.add=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];var o;return(o=this.object3d).add.apply(o,U(a)),this},n.remove=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];var o;return(o=this.object3d).remove.apply(o,U(a)),this},n.getSize=function(){var i=new s.Box3().setFromObject(this.object3d);return{min:i.min,max:i.max,size:i.getSize(new s.Vector3)}},n.traverse=function(i){i(this),this.children.forEach(function(a){a.traverse(i)})},n.dispose=function(){u(this.object3d)},V(e,[{key:"parent",get:function(){var i=this.object3d.parent;return(i==null?void 0:i.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(i){return i.userData.BaseObject_}).filter(function(i){return!!i})}}]),e}(),M=function(e){"use strict";S(r,e);var n=R(r);function r(a){j(this,r);var t;return t=n.call(this),t.width=0,t.canvas=document.createElement("canvas"),t.options=(0,A.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.position,c=t.lookAt,h=t.sprite,v=t.text,d=t.sizeAttenuation;if(h){var m=new s.Sprite(new s.SpriteMaterial({transparent:!0,sizeAttenuation:d}));this.object3d=m}else{var y=new s.MeshBasicMaterial({side:s.DoubleSide,transparent:!0}),_=new s.PlaneGeometry(1,1,1,1);this.createMesh(_,y)}this.object3d.position.copy(o),c&&this.object3d.lookAt(c),this.setText(v)},i.setText=function(t,o){var c=(0,A.Z)(P((0,A.Z)({},this.options),{text:t}),o||{}),h=c.text,v=c.fontSize,d=c.fontFamily,m=c.fontWeight,y=c.flipX,_=c.scale,g=this.canvas;g.width=v*h.length*2,g.height=v;var w=g.getContext("2d");w.font="".concat(m," ").concat(v,"px/1 ").concat(d);var f=w.measureText(h).width;g.width=f,this.width=f,w=g.getContext("2d"),w.clearRect(0,0,g.width,g.height),y&&w.scale(-1,1),w.font="".concat(m," ").concat(v,"px/1 ").concat(d),w.textBaseline="middle",w.fillStyle="#ffffff",w.fillText(h,y?f*-1:0,g.height/2),w.restore();var O=new s.Texture(g);O.anisotropy=16,O.needsUpdate=!0;var E=this.object3d;E.material.map&&E.material.map.dispose(),E.material.map=O,E.material.needsUpdate=!0,E.scale.set(O.image.width*_,O.image.height*_,1)},r}(p),b=N(568),Q=N(666),H=N.n(Q),ue=function(e){"use strict";S(r,e);var n=R(r);function r(a){j(this,r);var t;return t=n.call(this),t.options=a,t}var i=r.prototype;return i.getMaterial=function(){var t=this;return(0,b.Z)(H().mark(function o(){var c,h,v,d,m,y,_,g,w,f;return H().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return c=t.options,h=c.transparent,v=c.blending,d=c.src,m=c.depthWrite,y=c.alphaTest,_=c.sprite,g=c.sizeAttenuation,E.next=3,new s.TextureLoader().loadAsync(d);case 3:return w=E.sent,f=_?new s.SpriteMaterial({map:w,transparent:h!=null?h:!1,blending:v!=null?v:s.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:y!=null?y:0,sizeAttenuation:g!=null?g:!0}):new s.MeshBasicMaterial({map:w,transparent:h!=null?h:!1,blending:v!=null?v:s.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:y!=null?y:0}),E.abrupt("return",f);case 6:case"end":return E.stop()}},o)}))()},i.create=function(){var t=this;return(0,b.Z)(H().mark(function o(){var c,h,v,d,m,y,_,g;return H().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(c=t.options,h=c.scale,v=c.position,d=c.src,m=c.cache,y=c.sprite,!(m&&!m.get(d))){f.next=7;break}return m.init(d),f.next=5,t.getMaterial();case 5:_=f.sent,m.set(d,_);case 7:if(!m){f.next=13;break}return f.next=10,m.get(d);case 10:f.t0=f.sent,f.next=16;break;case 13:return f.next=15,t.getMaterial();case 15:f.t0=f.sent;case 16:g=f.t0,t.texture=g.map,y?t.createSprite(g):t.createMesh(new s.PlaneBufferGeometry(1,1),g),h&&t.setScale(h),v&&t.object3d.position.copy(v);case 21:case"end":return f.stop()}},o)}))()},i.setScale=function(t){this.object3d.scale.set(this.texture.image.width*t,this.texture.image.height*t,1)},r}(p);function le(e,n){for(;!Object.prototype.hasOwnProperty.call(e,n)&&(e=W(e),e!==null););return e}function ne(e,n,r){return typeof Reflect!="undefined"&&Reflect.get?ne=Reflect.get:ne=function(a,t,o){var c=le(a,t);if(!!c){var h=Object.getOwnPropertyDescriptor(c,t);return h.get?h.get.call(o||a):h.value}},ne(e,n,r)}function Oe(e,n,r){return ne(e,n,r)}var Ce=function(e){"use strict";S(r,e);var n=R(r);function r(a){j(this,r);var t;return t=n.call(this),t.options=(0,A.Z)({},{autoPlay:!0,loop:!0},a),t}var i=r.prototype;return i.getMaterial=function(){var t=this.options,o=t.src,c=t.transparent,h=t.blending,v=t.depthWrite,d=t.format,m=t.autoPlay,y=t.loop,_=t.alphaTest,g=t.sprite,w=oe(),f=document.createElement("video");return f.addEventListener("loadedmetadata",function(){var O=new s.VideoTexture(f);O.format=d!=null?d:s.RGBAFormat,O.needsUpdate=!0;var E=g?new s.SpriteMaterial({map:O,transparent:c!=null?c:!1,blending:h!=null?h:s.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:_!=null?_:0}):new s.MeshBasicMaterial({map:O,transparent:c!=null?c:!1,blending:h!=null?h:s.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:_!=null?_:0});w.resolve(E)},!1),f.src=o,f.muted=!0,f.autoplay=m,f.loop=y,f.preload="auto",w.promise},i.create=function(){var t=this;return(0,b.Z)(H().mark(function o(){var c,h,v,d,m,y,_,g;return H().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(c=t.options,h=c.scale,v=c.position,d=c.src,m=c.cache,y=c.sprite,!(m&&!m.get(d))){f.next=7;break}return m.init(d),f.next=5,t.getMaterial();case 5:_=f.sent,m.set(d,_);case 7:if(!m){f.next=13;break}return f.next=10,m.get(d);case 10:f.t0=f.sent,f.next=16;break;case 13:return f.next=15,t.getMaterial();case 15:f.t0=f.sent;case 16:g=f.t0,t.video=g.map.image,y?t.createSprite(g):t.createMesh(new s.PlaneBufferGeometry(1,1),g),h&&t.setScale(h),v&&t.object3d.position.copy(v);case 21:case"end":return f.stop()}},o)}))()},i.setScale=function(t){this.object3d.scale.set(this.video.videoWidth*t,this.video.videoHeight*t,1)},i.render=function(){var t=this.options.autoPlay;t&&this.video.play()},i.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),Oe(W(r.prototype),"dispose",this).call(this)},r}(p),we=function(e){"use strict";S(r,e);var n=R(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.options,o=t.position,c=t.children,h=t.onClick,v=t.zIndexFix,d=document.createElement("div");this.element=d,d.appendChild(c),this.createCSS2DObject(d),o&&this.object3d.position.copy(o),h&&this.clickTarge.forEach(function(m){m.addEventListener("click",h)}),v&&(this.object3d.userData.zIndexFix=v)},i.getMaterial=function(t){return(0,b.Z)(H().mark(function o(){var c,h,v,d;return H().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return c=document.createElement("canvas"),c.width=256,c.height=256,h=c.getContext("2d"),h.fillStyle="#ff0000",h.fillRect(0,0,256,256),v=new s.CanvasTexture(c),d=new s.SpriteMaterial({map:v,opacity:t?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),y.abrupt("return",d);case 9:case"end":return y.stop()}},o)}))()},i.createPickObject=function(t){var o=t.show,c=o===void 0?!1:o,h=t.scale,v=h===void 0?new s.Vector3(1,1,1):h,d=t.position,m=d===void 0?new s.Vector3(0,0,0):d,y=t.cache,_=this;return(0,b.Z)(H().mark(function g(){var w,f,O,E;return H().wrap(function(G){for(;;)switch(G.prev=G.next){case 0:if(w="node-create-pick-object",!(y&&!y.get(w))){G.next=7;break}return y.init(w),G.next=5,_.getMaterial(c);case 5:f=G.sent,y.set(w,f);case 7:if(!y){G.next=13;break}return G.next=10,y.get(w);case 10:G.t0=G.sent,G.next=16;break;case 13:return G.next=15,_.getMaterial(c);case 15:G.t0=G.sent;case 16:O=G.t0,E=new s.Sprite(O),E.scale.set(O.map.image.width*v.x,O.map.image.height*v.y,1),E.position.copy(m),_.add(E),_.pickObject=E;case 22:case"end":return G.stop()}},g)}))()},i.dispose=function(){var t=this.options.onClick;t&&this.clickTarge.forEach(function(o){o.removeEventListener("click",t)}),Oe(W(r.prototype),"dispose",this).call(this)},V(r,[{key:"clickTarge",get:function(){var t=this,o=this.options.clickTarge;if(o){var c=o.map(function(h){return U(t.element.querySelectorAll(h))}).flat();return c}return[this.element]}}]),r}(p),at=we,ot=`
2
2
  `.concat(s.ShaderChunk.logdepthbuf_pars_vertex,`
3
3
  `).concat(s.ShaderChunk.fog_pars_vertex,`
4
4
  attribute vec3 previous;
@@ -129,4 +129,4 @@ void main() {
129
129
  gl_FragColor.a *= step(vCounters, visibility);
130
130
  `).concat(s.ShaderChunk.fog_fragment,`
131
131
  }
132
- `),ge=function(e){"use strict";S(r,e);var n=T(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(k(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);ge.prototype.setMatrixWorld=function(e){this.matrixWorld=e},ge.prototype.setGeometry=function(e,n){this._geometry=e,this.setPoints(e.getAttribute("position").array,n)},ge.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,y=o.attributes;if(m!==null)for(var _=m.array,g=y.position.array,w=y.width.array,f=0,O=_.length-1;f<O;f+=d){var E=_[f],ie=_[f+1];c.fromArray(g,E*3),h.fromArray(g,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,Se=fe*fe,ve=i.distanceSqToSegment(c,h,t,v);if(!(ve>Se)){t.applyMatrix4(this.matrixWorld);var be=e.ray.origin.distanceTo(t);be<e.near||be>e.far||(n.push({distance:be,point:v.clone().applyMatrix4(this.matrixWorld),index:f,face:null,faceIndex:null,object:this}),f=O)}}}}ge.prototype.raycast=Xe,ge.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]},ge.prototype.copyV3=function(e){var n=e*6;return[this.positions[n],this.positions[n+1],this.positions[n+2]]},ge.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 De(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}ge.prototype.advance=function(e){var n=this._attributes.position.array,r=this._attributes.previous.array,i=this._attributes.next.array,a=n.length;De(n,0,r,0,a),De(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,De(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 We=function(e){"use strict";S(r,e);var n=T(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(k(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);We.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 ge;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";S(r,e);var n=T(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,y=o.nodes,_=o.nodesArr,g=o.worker,w=o.useGroups,f=ct(o,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","worker","useGroups"]),O=this.pencil.getSize(),E=O.width,ie=O.height,G=new We(P((0,A.Z)({},f),{resolution:new s.Vector2(E,ie)}));if(this.material=G,y)this.createMesh(Ke({nodes:y,setPointWidth:d}),G);else if(_&&g){var fe=typeof g=="string"?new Worker(g):g;return fe.postMessage({nodesArr:_,useGroups:w}),new Promise(function(ve){fe.onmessage=function(be){var xe=be.data,he=new s.BufferGeometry;Object.keys(xe).forEach(function(pe){pe==="index"?he.setIndex(new s.BufferAttribute(xe[pe].array,xe[pe].itemSize)):he.setAttribute(pe,new s.BufferAttribute(xe[pe].array,xe[pe].itemSize))}),t.createMesh(he,G),ve(""),fe.terminate()}})}else if(_){var Se=He.mergeBufferGeometries(_.map(function(ve){return Ke({nodes:ve,setPointWidth:d})}),w!=null?w:!1);this.createMesh(Se,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 ye(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,je=_t({extent:()=>Ze.extent,mean:()=>Ze.mean,merge:()=>Ze.merge}),gt=e=>{var n={};return N.d(n,e),n},cr=e=>()=>e,Ve=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}),Mt=e=>{var n={};return N.d(n,e),n},hr=e=>()=>e,St=Mt({default:()=>Xt.default}),Pt=e=>{var n={};return N.d(n,e),n},pr=e=>()=>e,Re=Pt({geoBounds:()=>ze.geoBounds,geoContains:()=>ze.geoContains,geoDistance:()=>ze.geoDistance,geoInterpolate:()=>ze.geoInterpolate}),Ot=e=>{var n={};return N.d(n,e),n},vr=e=>()=>e,Ct=Ot({geoVoronoi:()=>Ht.geoVoronoi}),Lt=e=>{var n={};return N.d(n,e),n},dr=e=>()=>e,$e=Lt({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,Re.geoDistance)(t,a)*180/Math.PI;if(o>n)for(var c=(0,Re.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],y=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},_=[],g=m[0];g<=m[1];g++){var w=h(g);y(w)&&_.push([w,v(g)])}return _}function Ue(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,Re.geoContains)(n,e):(0,St.default)(e,n)}function Bt(e,n){var r={type:"Polygon",coordinates:e},i=ye((0,Re.geoBounds)(r),2),a=ye(i[0],2),t=a[0],o=a[1],c=ye(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 Ue(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,je.merge)(a),o=Bt(e,i),c=U(t).concat(U(o)),h={type:"Polygon",coordinates:e},v=ye((0,Re.geoBounds)(h),2),d=ye(v[0],2),m=d[0],y=d[1],_=ye(v[1],2),g=_[0],w=_[1],f=m>g||w>=89||y<=-89,O=[];if(f){var E=(0,Ct.geoVoronoi)(c).triangles(),ie=new Map(c.map(function(de,Ae){var Le=ye(de,2),me=Le[0],Ee=Le[1];return["".concat(me,"-").concat(Ee),Ae]}));E.features.forEach(function(de){var Ae,Le=de.geometry.coordinates[0].slice(0,3).reverse(),me=[];if(Le.forEach(function(Te){var Ge=ye(Te,2),Me=Ge[0],Fe=Ge[1],tt="".concat(Me,"-").concat(Fe);ie.has(tt)&&me.push(ie.get(tt))}),me.length===3){if(me.some(function(Te){return Te<t.length})){var Ee=de.properties.circumcenter;if(!Ue(Ee,h,f))return}(Ae=O).push.apply(Ae,U(me))}})}else if(o.length)for(var be=function(Ae,Le){var me,Ee=[2,1,0].map(function(Me){return xe.triangles[Ae+Me]}),Te=Ee.map(function(Me){return c[Me]});if(Ee.some(function(Me){return Me<t.length})){var Ge=[0,1].map(function(Me){return(0,je.mean)(Te,function(Fe){return Fe[Me]})});if(!Ue(Ge,h,f))return"continue"}(me=O).push.apply(me,U(Ee))},xe=At.default.from(c),he=0,pe=xe.triangles.length;he<pe;he+=3)be(he,pe);else{var G=Ve.default.flatten(a),fe=G.vertices,Se=G.holes,ve=Se===void 0?[]:Se;O=(0,Ve.default)(fe,ve,2)}var ke=(0,$e.scaleLinear)((0,je.extent)(c,function(de){return de[0]}),[0,1]),Ie=(0,$e.scaleLinear)((0,je.extent)(c,function(de){return de[1]}),[0,1]),Dt=c.map(function(de){var Ae=ye(de,2),Le=Ae[0],me=Ae[1];return[ke(Le),Ie(me)]}),Wt={points:c,indices:O,uvs:Dt};return{contour:a,triangles:Wt}}var Tt=Rt,Ye=new s.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function Ne(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=ye(t,2),c=o[0],h=o[1];return r?wt(c,h,n):[c,h,n]})});return Ve.default.flatten(i)}function Je(e,n,r){for(var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=Ne(e,n,i),t=a.vertices,o=a.holes,c=Ne(e,r,i),h=c.vertices,v=(0,je.merge)([h,t]),d=Math.round(h.length/3),m=new Set(o),y=0,_=[],g=0;g<d;g++){var w=g+1;if(w===d)w=y;else if(m.has(w)){var f=w;w=y,y=f}_.push(g,g+d,w+d),_.push(w+d,w,g)}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:Ne([e.points],n,a).vertices,uvs:r}}var kt=function(e){"use strict";S(r,e);var n=T(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,y=o.curvatureResolution,_=o.cartesian,g=o.userDataRsoOffset;(0,bt.default)(i[0])||i[0].reverse();var w=Tt(i,{resolution:y}),f=w.contour,O=w.triangles,E=(0,je.merge)(O.uvs),ie=[],G=[],fe=[],Se=0,ve=function(he){var pe=Math.round(ie.length/3),ke=fe.length;ie=ie.concat(he.vertices),G=G.concat(he.uvs),fe=fe.concat(pe?he.indices.map(function(Ie){return Ie+pe}):he.indices),t.addGroup(ke,fe.length-ke,Se++)};if(m){var be=Je(f,c,h,_);ve(be),t.userData.rso=g?Je(f,c,h+g,_):be}return v&&ve(Qe(O,c,E,!1,_)),d&&ve(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";S(r,e);var n=T(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,y=t.cartesian,_=new kt(this.options.geojson,{startHeight:o,endHeight:o+c,closedBottom:h,closedTop:v,curvatureResolution:d,cartesian:y,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";S(r,e);var n=T(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,y=o.split,_=o.worker;if(c)this.createMesh(et({points:c,depth:m,split:y}),v);else if(h&&_){var g=typeof _=="string"?new Worker(_):_;return g.postMessage({pointsArr:h,depth:m,split:y,useGroups:d}),new Promise(function(f){g.onmessage=function(O){var E=O.data,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(""),g.terminate()}})}else if(h){var w=He.mergeBufferGeometries(h.map(function(f){return et({points:f,depth:m,split:y})}),d!=null?d:!1);this.createMesh(w,v)}},r}(p)})();var Yt=_e.Ei,Jt=_e.Yo,Qt=_e.Ee,qt=_e.x1,er=_e.VJ,tr=_e.r7,rr=_e.XA,nr=_e.NB,ir=_e.xv,ar=_e.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
+ `),ge=function(e){"use strict";S(r,e);var n=R(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);ge.prototype.setMatrixWorld=function(e){this.matrixWorld=e},ge.prototype.setGeometry=function(e,n){this._geometry=e,this.setPoints(e.getAttribute("position").array,n)},ge.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,y=o.attributes;if(m!==null)for(var _=m.array,g=y.position.array,w=y.width.array,f=0,O=_.length-1;f<O;f+=d){var E=_[f],ie=_[f+1];c.fromArray(g,E*3),h.fromArray(g,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,Se=fe*fe,ve=i.distanceSqToSegment(c,h,t,v);if(!(ve>Se)){t.applyMatrix4(this.matrixWorld);var be=e.ray.origin.distanceTo(t);be<e.near||be>e.far||(n.push({distance:be,point:v.clone().applyMatrix4(this.matrixWorld),index:f,face:null,faceIndex:null,object:this}),f=O)}}}}ge.prototype.raycast=Xe,ge.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]},ge.prototype.copyV3=function(e){var n=e*6;return[this.positions[n],this.positions[n+1],this.positions[n+2]]},ge.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 De(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}ge.prototype.advance=function(e){var n=this._attributes.position.array,r=this._attributes.previous.array,i=this._attributes.next.array,a=n.length;De(n,0,r,0,a),De(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,De(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 We=function(e){"use strict";S(r,e);var n=R(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);We.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 ge;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";S(r,e);var n=R(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,y=o.nodes,_=o.nodesArr,g=o.worker,w=o.useGroups,f=ct(o,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","worker","useGroups"]),O=this.pencil.getSize(),E=O.width,ie=O.height,G=new We(P((0,A.Z)({},f),{resolution:new s.Vector2(E,ie)}));if(this.material=G,y)this.createMesh(Ke({nodes:y,setPointWidth:d}),G);else if(_&&g){var fe=typeof g=="string"?new Worker(g):g;return fe.postMessage({nodesArr:_,useGroups:w}),new Promise(function(ve){fe.onmessage=function(be){var xe=be.data,he=new s.BufferGeometry;Object.keys(xe).forEach(function(pe){pe==="index"?he.setIndex(new s.BufferAttribute(xe[pe].array,xe[pe].itemSize)):he.setAttribute(pe,new s.BufferAttribute(xe[pe].array,xe[pe].itemSize))}),t.createMesh(he,G),ve("")}})}else if(_){var Se=He.mergeBufferGeometries(_.map(function(ve){return Ke({nodes:ve,setPointWidth:d})}),w!=null?w:!1);this.createMesh(Se,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 ye(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,je=_t({extent:()=>Ze.extent,mean:()=>Ze.mean,merge:()=>Ze.merge}),gt=e=>{var n={};return N.d(n,e),n},cr=e=>()=>e,Ve=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}),Mt=e=>{var n={};return N.d(n,e),n},hr=e=>()=>e,St=Mt({default:()=>Xt.default}),Pt=e=>{var n={};return N.d(n,e),n},pr=e=>()=>e,ke=Pt({geoBounds:()=>ze.geoBounds,geoContains:()=>ze.geoContains,geoDistance:()=>ze.geoDistance,geoInterpolate:()=>ze.geoInterpolate}),Ot=e=>{var n={};return N.d(n,e),n},vr=e=>()=>e,Ct=Ot({geoVoronoi:()=>Ht.geoVoronoi}),Lt=e=>{var n={};return N.d(n,e),n},dr=e=>()=>e,$e=Lt({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,ke.geoDistance)(t,a)*180/Math.PI;if(o>n)for(var c=(0,ke.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],y=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},_=[],g=m[0];g<=m[1];g++){var w=h(g);y(w)&&_.push([w,v(g)])}return _}function Ue(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,ke.geoContains)(n,e):(0,St.default)(e,n)}function Bt(e,n){var r={type:"Polygon",coordinates:e},i=ye((0,ke.geoBounds)(r),2),a=ye(i[0],2),t=a[0],o=a[1],c=ye(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 Ue(m,r,d)})}function kt(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,je.merge)(a),o=Bt(e,i),c=U(t).concat(U(o)),h={type:"Polygon",coordinates:e},v=ye((0,ke.geoBounds)(h),2),d=ye(v[0],2),m=d[0],y=d[1],_=ye(v[1],2),g=_[0],w=_[1],f=m>g||w>=89||y<=-89,O=[];if(f){var E=(0,Ct.geoVoronoi)(c).triangles(),ie=new Map(c.map(function(de,Ae){var Le=ye(de,2),me=Le[0],Ee=Le[1];return["".concat(me,"-").concat(Ee),Ae]}));E.features.forEach(function(de){var Ae,Le=de.geometry.coordinates[0].slice(0,3).reverse(),me=[];if(Le.forEach(function(Re){var Ge=ye(Re,2),Me=Ge[0],Fe=Ge[1],tt="".concat(Me,"-").concat(Fe);ie.has(tt)&&me.push(ie.get(tt))}),me.length===3){if(me.some(function(Re){return Re<t.length})){var Ee=de.properties.circumcenter;if(!Ue(Ee,h,f))return}(Ae=O).push.apply(Ae,U(me))}})}else if(o.length)for(var be=function(Ae,Le){var me,Ee=[2,1,0].map(function(Me){return xe.triangles[Ae+Me]}),Re=Ee.map(function(Me){return c[Me]});if(Ee.some(function(Me){return Me<t.length})){var Ge=[0,1].map(function(Me){return(0,je.mean)(Re,function(Fe){return Fe[Me]})});if(!Ue(Ge,h,f))return"continue"}(me=O).push.apply(me,U(Ee))},xe=At.default.from(c),he=0,pe=xe.triangles.length;he<pe;he+=3)be(he,pe);else{var G=Ve.default.flatten(a),fe=G.vertices,Se=G.holes,ve=Se===void 0?[]:Se;O=(0,Ve.default)(fe,ve,2)}var Te=(0,$e.scaleLinear)((0,je.extent)(c,function(de){return de[0]}),[0,1]),Ie=(0,$e.scaleLinear)((0,je.extent)(c,function(de){return de[1]}),[0,1]),Dt=c.map(function(de){var Ae=ye(de,2),Le=Ae[0],me=Ae[1];return[Te(Le),Ie(me)]}),Wt={points:c,indices:O,uvs:Dt};return{contour:a,triangles:Wt}}var Rt=kt,Ye=new s.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function Ne(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=ye(t,2),c=o[0],h=o[1];return r?wt(c,h,n):[c,h,n]})});return Ve.default.flatten(i)}function Je(e,n,r){for(var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=Ne(e,n,i),t=a.vertices,o=a.holes,c=Ne(e,r,i),h=c.vertices,v=(0,je.merge)([h,t]),d=Math.round(h.length/3),m=new Set(o),y=0,_=[],g=0;g<d;g++){var w=g+1;if(w===d)w=y;else if(m.has(w)){var f=w;w=y,y=f}_.push(g,g+d,w+d),_.push(w+d,w,g)}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:Ne([e.points],n,a).vertices,uvs:r}}var Tt=function(e){"use strict";S(r,e);var n=R(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,y=o.curvatureResolution,_=o.cartesian,g=o.userDataRsoOffset;(0,bt.default)(i[0])||i[0].reverse();var w=Rt(i,{resolution:y}),f=w.contour,O=w.triangles,E=(0,je.merge)(O.uvs),ie=[],G=[],fe=[],Se=0,ve=function(he){var pe=Math.round(ie.length/3),Te=fe.length;ie=ie.concat(he.vertices),G=G.concat(he.uvs),fe=fe.concat(pe?he.indices.map(function(Ie){return Ie+pe}):he.indices),t.addGroup(Te,fe.length-Te,Se++)};if(m){var be=Je(f,c,h,_);ve(be),t.userData.rso=g?Je(f,c,h+g,_):be}return v&&ve(Qe(O,c,E,!1,_)),d&&ve(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";S(r,e);var n=R(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,y=t.cartesian,_=new Tt(this.options.geojson,{startHeight:o,endHeight:o+c,closedBottom:h,closedTop:v,curvatureResolution:d,cartesian:y,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";S(r,e);var n=R(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,y=o.split,_=o.worker;if(c)this.createMesh(et({points:c,depth:m,split:y}),v);else if(h&&_){var g=typeof _=="string"?new Worker(_):_;return g.postMessage({pointsArr:h,depth:m,split:y,useGroups:d}),new Promise(function(f){g.onmessage=function(O){var E=O.data,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("")}})}else if(h){var w=He.mergeBufferGeometries(h.map(function(f){return et({points:f,depth:m,split:y})}),d!=null?d:!1);this.createMesh(w,v)}},r}(p)})();var Yt=_e.Ei,Jt=_e.Yo,Qt=_e.Ee,qt=_e.x1,er=_e.VJ,tr=_e.r7,rr=_e.XA,nr=_e.NB,ir=_e.xv,ar=_e.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.3.1",
3
+ "version": "0.3.2",
4
4
  "author": "gitplus <hstits@gmail.com>",
5
5
  "scripts": {
6
6
  "start": "PORT=3002 bundler-dev",