gl-draw 0.4.6 → 0.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/objects/index.js +2 -2
- package/dist/objects/index.module.js +2 -2
- package/dist/objects/node/index.d.ts +3 -2
- package/dist/plugins/index.js +1 -1
- package/dist/plugins/index.module.js +1 -1
- package/dist/workers/extrudePolygon.js +1 -1
- package/dist/workers/line.js +1 -1
- package/package.json +1 -1
package/dist/objects/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){var rt={666:function(k){var T=function(A){"use strict";var C=Object.prototype,j=C.hasOwnProperty,E,L=typeof Symbol=="function"?Symbol:{},Z=L.iterator||"@@iterator",U=L.asyncIterator||"@@asyncIterator",G=L.toStringTag||"@@toStringTag";function M(f,l,v){return Object.defineProperty(f,l,{value:v,enumerable:!0,configurable:!0,writable:!0}),f[l]}try{M({},"")}catch(f){M=function(l,v,S){return l[v]=S}}function N(f,l,v,S){var P=l&&l.prototype instanceof Q?l:Q,X=Object.create(P.prototype),ce=new B(S||[]);return X._invoke=ie(f,v,ce),X}A.wrap=N;function H(f,l,v){try{return{type:"normal",arg:f.call(l,v)}}catch(S){return{type:"throw",arg:S}}}var V="suspendedStart",c="suspendedYield",pe="executing",J="completed",W={};function Q(){}function R(){}function z(){}var $={};M($,Z,function(){return this});var ue=Object.getPrototypeOf,ee=ue&&ue(ue(ve([])));ee&&ee!==C&&j.call(ee,Z)&&($=ee);var F=z.prototype=Q.prototype=Object.create($);R.prototype=z,M(F,"constructor",z),M(z,"constructor",R),R.displayName=M(z,G,"GeneratorFunction");function I(f){["next","throw","return"].forEach(function(l){M(f,l,function(v){return this._invoke(l,v)})})}A.isGeneratorFunction=function(f){var l=typeof f=="function"&&f.constructor;return l?l===R||(l.displayName||l.name)==="GeneratorFunction":!1},A.mark=function(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,z):(f.__proto__=z,M(f,G,"GeneratorFunction")),f.prototype=Object.create(F),f},A.awrap=function(f){return{__await:f}};function te(f,l){function v(X,ce,le,ae){var re=H(f[X],f,ce);if(re.type==="throw")ae(re.arg);else{var ke=re.arg,Ce=ke.value;return Ce&&typeof Ce=="object"&&j.call(Ce,"__await")?l.resolve(Ce.__await).then(function(Oe){v("next",Oe,le,ae)},function(Oe){v("throw",Oe,le,ae)}):l.resolve(Ce).then(function(Oe){ke.value=Oe,le(ke)},function(Oe){return v("throw",Oe,le,ae)})}}var S;function P(X,ce){function le(){return new l(function(ae,re){v(X,ce,ae,re)})}return S=S?S.then(le,le):le()}this._invoke=P}I(te.prototype),M(te.prototype,U,function(){return this}),A.AsyncIterator=te,A.async=function(f,l,v,S,P){P===void 0&&(P=Promise);var X=new te(N(f,l,v,S),P);return A.isGeneratorFunction(l)?X:X.next().then(function(ce){return ce.done?ce.value:X.next()})};function ie(f,l,v){var S=V;return function(X,ce){if(S===pe)throw new Error("Generator is already running");if(S===J){if(X==="throw")throw ce;return ze()}for(v.method=X,v.arg=ce;;){var le=v.delegate;if(le){var ae=we(le,v);if(ae){if(ae===W)continue;return ae}}if(v.method==="next")v.sent=v._sent=v.arg;else if(v.method==="throw"){if(S===V)throw S=J,v.arg;v.dispatchException(v.arg)}else v.method==="return"&&v.abrupt("return",v.arg);S=pe;var re=H(f,l,v);if(re.type==="normal"){if(S=v.done?J:c,re.arg===W)continue;return{value:re.arg,done:v.done}}else re.type==="throw"&&(S=J,v.method="throw",v.arg=re.arg)}}}function we(f,l){var v=f.iterator[l.method];if(v===E){if(l.delegate=null,l.method==="throw"){if(f.iterator.return&&(l.method="return",l.arg=E,we(f,l),l.method==="throw"))return W;l.method="throw",l.arg=new TypeError("The iterator does not provide a 'throw' method")}return W}var S=H(v,f.iterator,l.arg);if(S.type==="throw")return l.method="throw",l.arg=S.arg,l.delegate=null,W;var P=S.arg;if(!P)return l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,W;if(P.done)l[f.resultName]=P.value,l.next=f.nextLoc,l.method!=="return"&&(l.method="next",l.arg=E);else return P;return l.delegate=null,W}I(F),M(F,G,"Generator"),M(F,Z,function(){return this}),M(F,"toString",function(){return"[object Generator]"});function xe(f){var l={tryLoc:f[0]};1 in f&&(l.catchLoc=f[1]),2 in f&&(l.finallyLoc=f[2],l.afterLoc=f[3]),this.tryEntries.push(l)}function q(f){var l=f.completion||{};l.type="normal",delete l.arg,f.completion=l}function B(f){this.tryEntries=[{tryLoc:"root"}],f.forEach(xe,this),this.reset(!0)}A.keys=function(f){var l=[];for(var v in f)l.push(v);return l.reverse(),function S(){for(;l.length;){var P=l.pop();if(P in f)return S.value=P,S.done=!1,S}return S.done=!0,S}};function ve(f){if(f){var l=f[Z];if(l)return l.call(f);if(typeof f.next=="function")return f;if(!isNaN(f.length)){var v=-1,S=function P(){for(;++v<f.length;)if(j.call(f,v))return P.value=f[v],P.done=!1,P;return P.value=E,P.done=!0,P};return S.next=S}}return{next:ze}}A.values=ve;function ze(){return{value:E,done:!0}}return B.prototype={constructor:B,reset:function(f){if(this.prev=0,this.next=0,this.sent=this._sent=E,this.done=!1,this.delegate=null,this.method="next",this.arg=E,this.tryEntries.forEach(q),!f)for(var l in this)l.charAt(0)==="t"&&j.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=E)},stop:function(){this.done=!0;var f=this.tryEntries[0],l=f.completion;if(l.type==="throw")throw l.arg;return this.rval},dispatchException:function(f){if(this.done)throw f;var l=this;function v(ae,re){return X.type="throw",X.arg=f,l.next=ae,re&&(l.method="next",l.arg=E),!!re}for(var S=this.tryEntries.length-1;S>=0;--S){var P=this.tryEntries[S],X=P.completion;if(P.tryLoc==="root")return v("end");if(P.tryLoc<=this.prev){var ce=j.call(P,"catchLoc"),le=j.call(P,"finallyLoc");if(ce&&le){if(this.prev<P.catchLoc)return v(P.catchLoc,!0);if(this.prev<P.finallyLoc)return v(P.finallyLoc)}else if(ce){if(this.prev<P.catchLoc)return v(P.catchLoc,!0)}else if(le){if(this.prev<P.finallyLoc)return v(P.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(f,l){for(var v=this.tryEntries.length-1;v>=0;--v){var S=this.tryEntries[v];if(S.tryLoc<=this.prev&&j.call(S,"finallyLoc")&&this.prev<S.finallyLoc){var P=S;break}}P&&(f==="break"||f==="continue")&&P.tryLoc<=l&&l<=P.finallyLoc&&(P=null);var X=P?P.completion:{};return X.type=f,X.arg=l,P?(this.method="next",this.next=P.finallyLoc,W):this.complete(X)},complete:function(f,l){if(f.type==="throw")throw f.arg;return f.type==="break"||f.type==="continue"?this.next=f.arg:f.type==="return"?(this.rval=this.arg=f.arg,this.method="return",this.next="end"):f.type==="normal"&&l&&(this.next=l),W},finish:function(f){for(var l=this.tryEntries.length-1;l>=0;--l){var v=this.tryEntries[l];if(v.finallyLoc===f)return this.complete(v.completion,v.afterLoc),q(v),W}},catch:function(f){for(var l=this.tryEntries.length-1;l>=0;--l){var v=this.tryEntries[l];if(v.tryLoc===f){var S=v.completion;if(S.type==="throw"){var P=S.arg;q(v)}return P}}throw new Error("illegal catch attempt")},delegateYield:function(f,l,v){return this.delegate={iterator:ve(f),resultName:l,nextLoc:v},this.method==="next"&&(this.arg=E),W}},A}(k.exports);try{regeneratorRuntime=T}catch(A){typeof globalThis=="object"?globalThis.regeneratorRuntime=T:Function("r","regeneratorRuntime = r")(T)}},695:function(k,T,A){"use strict";A.d(T,{Z:function(){return C}});function C(j){if(j.geometry&&j.geometry.dispose(),j.material){var E=Array.isArray(j.material)?j.material:[j.material];E.forEach(function(L){var Z,U,G,M,N,H,V,c,pe,J,W,Q,R;(Z=L.map)===null||Z===void 0||Z.dispose(),(U=L.lightMap)===null||U===void 0||U.dispose(),(G=L.bumpMap)===null||G===void 0||G.dispose(),(M=L.normalMap)===null||M===void 0||M.dispose(),(N=L.specularMap)===null||N===void 0||N.dispose(),(H=L.envMap)===null||H===void 0||H.dispose(),(V=L.alphaMap)===null||V===void 0||V.dispose(),(c=L.aoMap)===null||c===void 0||c.dispose(),(pe=L.displacementMap)===null||pe===void 0||pe.dispose(),(J=L.emissiveMap)===null||J===void 0||J.dispose(),(W=L.gradientMap)===null||W===void 0||W.dispose(),(Q=L.metalnessMap)===null||Q===void 0||Q.dispose(),(R=L.roughnessMap)===null||R===void 0||R.dispose(),L.dispose()})}}},584:function(k,T,A){"use strict";A.d(T,{disposeMesh:function(){return L.Z}});var C=A(666),j=A.n(C),E=null,L=A(695),Z=A(644);function U(W){if(W.material){var Q=Array.isArray(W.material)?W.material:[W.material];Q.forEach(function(R){var z,$;(z=R.color)===null||z===void 0||z.convertSRGBToLinear(),($=R.emissive)===null||$===void 0||$.convertSRGBToLinear(),R.map&&(R.map.encoding=THREE.sRGBEncoding),R.emissiveMap&&(R.emissiveMap.encoding=THREE.sRGBEncoding)})}}var G=A(568),M=A(924),N=A(360),H=A(484),V=null,c=null,pe=function(){var W=(0,G.Z)(j().mark(function Q(R,z){var $,ue,ee,F,I,te,ie,we,xe;return j().wrap(function(B){for(;;)switch(B.prev=B.next){case 0:return $=z.type,ue=$===void 0?"blob":$,ee=z.version,F=ee===void 0?"1":ee,B.next=4,(0,N.get)(R);case 4:if(te=B.sent,!(te&&te[F])){B.next=9;break}I=te[F],B.next=15;break;case 9:return B.next=11,(0,H.Z)(fetch(R).then(function(ve){if(ve.ok)return ve[ue]();throw new Error}));case 11:ie=B.sent,we=ie.res,xe=ie.err,xe||(I=we,(0,N.set)(R,(0,M.Z)({},F,we)));case 15:return B.abrupt("return",I?{url:ue==="json"?R:URL.createObjectURL(I),store:I}:{url:R});case 16:case"end":return B.stop()}},Q)}));return function(R,z){return W.apply(this,arguments)}}(),J=A(705)},484:function(k,T,A){"use strict";A.d(T,{Z:function(){return j}});var C=A(42);function j(E){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return E.then(function(Z){return(0,C.Z)({err:null,res:Z},L)}).catch(function(Z){return(0,C.Z)({err:Z,res:void 0},L)})}},705:function(k,T,A){"use strict";A.d(T,{C:function(){return Z},y:function(){return L}});var C=A(644),j=A.n(C),E=new Map,L=function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(G,M,N,H,V){var c=M[N*3],pe=M[N*3+1],J=M[H*3],W=M[H*3+1],Q=M[V*3],R=M[V*3+1],z;if(E.has(G))z=E.get(G);else{var $=U.box3||new C.Box3;if(!U.box3){var ue=G.parameters.shapes.getPoints();$.setFromArray(ue.map(function(ie){return[ie.x,ie.y,0]}).flat())}var ee=$.getSize(new C.Vector3);U.split&&(ee.y/=U.split),z={box:$,size:ee},E.set(G,z)}var F=z.box,I=z.size,te=U.split?1-U.split:0;return[new C.Vector2((c-F.min.x)/I.x,(pe-F.min.y)/I.y+te),new C.Vector2((J-F.min.x)/I.x,(W-F.min.y)/I.y+te),new C.Vector2((Q-F.min.x)/I.x,(R-F.min.y)/I.y+te)]},generateSideWallUV:function(G,M,N,H,V,c){var pe=M[N*3],J=M[N*3+1],W=M[N*3+2],Q=M[H*3],R=M[H*3+1],z=M[H*3+2],$=M[V*3],ue=M[V*3+1],ee=M[V*3+2],F=M[c*3],I=M[c*3+1],te=M[c*3+2],ie;if(E.has(M))ie=E.get(M);else{var we=new C.Box3;we.setFromArray(M);var xe=we.getSize(new C.Vector3);U.split&&(xe.z/=1-U.split),ie={box:we,size:xe},E.set(M,ie)}var q=ie.box,B=ie.size;return Math.abs(J-R)<Math.abs(pe-Q)?[new C.Vector2((pe-q.min.x)/B.x,(W-q.min.z)/B.z),new C.Vector2((Q-q.min.x)/B.x,(z-q.min.z)/B.z),new C.Vector2(($-q.min.x)/B.x,(ee-q.min.z)/B.z),new C.Vector2((F-q.min.x)/B.x,(te-q.min.z)/B.z)]:[new C.Vector2((J-q.min.y)/B.y,(W-q.min.z)/B.z),new C.Vector2((R-q.min.y)/B.y,(z-q.min.z)/B.z),new C.Vector2((ue-q.min.y)/B.y,(ee-q.min.z)/B.z),new C.Vector2((I-q.min.y)/B.y,(te-q.min.z)/B.z)]}}},Z=function(){E.clear()}},360:function(k){"use strict";k.exports=require("idb-keyval")},644:function(k){"use strict";k.exports=require("three")},568:function(k,T,A){"use strict";A.d(T,{Z:function(){return j}});function C(E,L,Z,U,G,M,N){try{var H=E[M](N),V=H.value}catch(c){Z(c);return}H.done?L(V):Promise.resolve(V).then(U,G)}function j(E){return function(){var L=this,Z=arguments;return new Promise(function(U,G){var M=E.apply(L,Z);function N(V){C(M,U,G,N,H,"next",V)}function H(V){C(M,U,G,N,H,"throw",V)}N(void 0)})}}},924:function(k,T,A){"use strict";A.d(T,{Z:function(){return C}});function C(j,E,L){return E in j?Object.defineProperty(j,E,{value:L,enumerable:!0,configurable:!0,writable:!0}):j[E]=L,j}},42:function(k,T,A){"use strict";A.d(T,{Z:function(){return j}});var C=A(924);function j(E){for(var L=1;L<arguments.length;L++){var Z=arguments[L]!=null?arguments[L]:{},U=Object.keys(Z);typeof Object.getOwnPropertySymbols=="function"&&(U=U.concat(Object.getOwnPropertySymbols(Z).filter(function(G){return Object.getOwnPropertyDescriptor(Z,G).enumerable}))),U.forEach(function(G){(0,C.Z)(E,G,Z[G])})}return E}}},Ze={};function Y(k){var T=Ze[k];if(T!==void 0)return T.exports;var A=Ze[k]={exports:{}};return rt[k](A,A.exports,Y),A.exports}(function(){Y.n=function(k){var T=k&&k.__esModule?function(){return k.default}:function(){return k};return Y.d(T,{a:T}),T}})(),function(){Y.d=function(k,T){for(var A in T)Y.o(T,A)&&!Y.o(k,A)&&Object.defineProperty(k,A,{enumerable:!0,get:T[A]})}}(),function(){Y.o=function(k,T){return Object.prototype.hasOwnProperty.call(k,T)}}(),function(){Y.r=function(k){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(k,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(k,"__esModule",{value:!0})}}();var Be={};(function(){"use strict";Y.r(Be),Y.d(Be,{ConicPolygon:function(){return St},ExtrudePolygon:function(){return Ot},Image:function(){return ce},Line:function(){return ut},MeshLine:function(){return Ae},MeshLineMaterial:function(){return Ve},MeshLineRaycast:function(){return Fe},Node:function(){return Oe},Text:function(){return ze},Video:function(){return ke}});function k(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function T(t,i){return T=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},T(t,i)}function A(t,i){return T(t,i)}function C(t,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(i&&i.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),i&&A(t,i)}var j=Y(42);function E(t,i){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);i&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function L(t,i){return i=i!=null?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):E(Object(i)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(i,r))}),t}function Z(){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(t){return!1}}function U(t){return U=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},U(t)}function G(t){return U(t)}function M(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function N(t){return t&&t.constructor===Symbol?"symbol":typeof t}function H(t,i){return i&&(N(i)==="object"||typeof i=="function")?i:M(t)}function V(t){var i=Z();return function(){var n=G(t),a;if(i){var e=G(this).constructor;a=Reflect.construct(n,arguments,e)}else a=n.apply(this,arguments);return H(this,a)}}var c=Y(644);function pe(){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(t){return!1}}function J(t,i,r){return pe()?J=Reflect.construct:J=function(a,e,o){var s=[null];s.push.apply(s,e);var h=Function.bind.apply(a,s),p=new h;return o&&A(p,o.prototype),p},J.apply(null,arguments)}function W(t,i,r){return J.apply(null,arguments)}function Q(t,i){for(var r=0;r<i.length;r++){var n=i[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function R(t,i,r){return i&&Q(t.prototype,i),r&&Q(t,r),t}function z(t,i){(i==null||i>t.length)&&(i=t.length);for(var r=0,n=new Array(i);r<i;r++)n[r]=t[r];return n}function $(t){if(Array.isArray(t))return z(t)}function ue(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ee(){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 F(t,i){if(!!t){if(typeof t=="string")return z(t,i);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return z(t,i)}}function I(t){return $(t)||ue(t)||F(t)||ee()}var te=Y(484);function ie(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={};return r.promise=new Promise(function(n,a){r.resolve=n,r.reject=a}),t&&(r.promise=(0,te.Z)(r.promise,i)),r}var we=require("three/examples/jsm/renderers/CSS2DRenderer"),xe=require("three/examples/jsm/renderers/CSS3DRenderer"),q=Y(584),B=function(t){t&&((0,q.disposeMesh)(t),t.children.forEach(function(i){i.userData.BaseObject_||B(i)}))},ve=function(){"use strict";function t(){k(this,t),this.objecttype__="BaseObject",this.userData={},this.pm=ie(),this.visible=!1}var i=t.prototype;return i.init=function(){},i.create=function(){},i.render=function(){},i.update=function(n,a){},i.resize=function(n,a){},i.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},i.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},i.isVisible=function(){return this.visible},i.createMesh=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];return this.object3d=W(c.Mesh,I(a)),this},i.createGroup=function(){return this.object3d=new c.Group,this},i.createPoints=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];return this.object3d=W(c.Points,I(a)),this},i.createCSS2DObject=function(n){return this.object3d=new we.CSS2DObject(n),this},i.createCSS3DObject=function(n){return this.object3d=new xe.CSS3DObject(n),this},i.createCSS3DSprite=function(n){return this.object3d=new xe.CSS3DSprite(n),this},i.createSprite=function(n){return this.object3d=new c.Sprite(n),this},i.add=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];var o;return(o=this.object3d).add.apply(o,I(a)),this},i.remove=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];var o;return(o=this.object3d).remove.apply(o,I(a)),this},i.getSize=function(){var n=new c.Box3().setFromObject(this.object3d);return{min:n.min,max:n.max,size:n.getSize(new c.Vector3)}},i.traverse=function(n){n(this),this.children.forEach(function(a){a.traverse(n)})},i.dispose=function(){B(this.object3d)},R(t,[{key:"parent",get:function(){var n=this.object3d.parent;return(n==null?void 0:n.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(n){return n.userData.BaseObject_}).filter(function(n){return!!n})}}]),t}(),ze=function(t){"use strict";C(r,t);var i=V(r);function r(a){k(this,r);var e;return e=i.call(this),e.width=0,e.canvas=document.createElement("canvas"),e.options=(0,j.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.position,s=e.lookAt,h=e.sprite,p=e.text,d=e.sizeAttenuation;if(h){var g=new c.Sprite(new c.SpriteMaterial({transparent:!0,sizeAttenuation:d}));this.object3d=g}else{var y=new c.MeshBasicMaterial({side:c.DoubleSide,transparent:!0}),b=new c.PlaneGeometry(1,1,1,1);this.createMesh(b,y)}this.object3d.position.copy(o),s&&this.object3d.lookAt(s),this.setText(p)},n.setText=function(e,o){var s=(0,j.Z)(L((0,j.Z)({},this.options),{text:e}),o||{}),h=s.text,p=s.fontSize,d=s.fontFamily,g=s.fontWeight,y=s.flipX,b=s.scale,m=this.canvas;m.width=p*h.length*2,m.height=p;var w=m.getContext("2d");w.font="".concat(g," ").concat(p,"px/1 ").concat(d);var u=w.measureText(h).width;m.width=u,this.width=u,w=m.getContext("2d"),w.clearRect(0,0,m.width,m.height),y&&w.scale(-1,1),w.font="".concat(g," ").concat(p,"px/1 ").concat(d),w.textBaseline="middle",w.fillStyle="#ffffff",w.fillText(h,y?u*-1:0,m.height/2),w.restore();var O=new c.Texture(m);O.anisotropy=16,O.needsUpdate=!0;var _=this.object3d;_.material.map&&_.material.map.dispose(),_.material.map=O,_.material.needsUpdate=!0,_.scale.set(O.image.width*b,O.image.height*b,1)},r}(ve),f=Y(568),l=Y(666),v=Y.n(l),S=+c.REVISION<144,P=S?"ExtrudeBufferGeometry":"ExtrudeGeometry",X=S?"PlaneBufferGeometry":"PlaneGeometry",ce=function(t){"use strict";C(r,t);var i=V(r);function r(a){k(this,r);var e;return e=i.call(this),e.options=a,e}var n=r.prototype;return n.getMaterial=function(){var e=this;return(0,f.Z)(v().mark(function o(){var s,h,p,d,g,y,b,m,w,u;return v().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return s=e.options,h=s.transparent,p=s.blending,d=s.src,g=s.depthWrite,y=s.alphaTest,b=s.sprite,m=s.sizeAttenuation,_.next=3,new c.TextureLoader().loadAsync(d);case 3:return w=_.sent,u=b?new c.SpriteMaterial({map:w,transparent:h!=null?h:!1,blending:p!=null?p:c.NormalBlending,depthWrite:g!=null?g:!0,alphaTest:y!=null?y:0,sizeAttenuation:m!=null?m:!0}):new c.MeshBasicMaterial({map:w,transparent:h!=null?h:!1,blending:p!=null?p:c.NormalBlending,depthWrite:g!=null?g:!0,alphaTest:y!=null?y:0}),_.abrupt("return",u);case 6:case"end":return _.stop()}},o)}))()},n.create=function(){var e=this;return(0,f.Z)(v().mark(function o(){var s,h,p,d,g,y,b,m;return v().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(s=e.options,h=s.scale,p=s.position,d=s.src,g=s.cache,y=s.sprite,!(g&&!g.get(d))){u.next=7;break}return g.init(d),u.next=5,e.getMaterial();case 5:b=u.sent,g.set(d,b);case 7:if(!g){u.next=13;break}return u.next=10,g.get(d);case 10:u.t0=u.sent,u.next=16;break;case 13:return u.next=15,e.getMaterial();case 15:u.t0=u.sent;case 16:m=u.t0,e.texture=m.map,y?e.createSprite(m):e.createMesh(new c[X](1,1),m),h&&e.setScale(h),p&&e.object3d.position.copy(p);case 21:case"end":return u.stop()}},o)}))()},n.setScale=function(e){this.object3d.scale.set(this.texture.image.width*e,this.texture.image.height*e,1)},r}(ve);function le(t,i){for(;!Object.prototype.hasOwnProperty.call(t,i)&&(t=G(t),t!==null););return t}function ae(t,i,r){return typeof Reflect!="undefined"&&Reflect.get?ae=Reflect.get:ae=function(a,e,o){var s=le(a,e);if(!!s){var h=Object.getOwnPropertyDescriptor(s,e);return h.get?h.get.call(o||a):h.value}},ae(t,i,r)}function re(t,i,r){return ae(t,i,r)}var ke=function(t){"use strict";C(r,t);var i=V(r);function r(a){k(this,r);var e;return e=i.call(this),e.options=(0,j.Z)({},{autoPlay:!0,loop:!0},a),e}var n=r.prototype;return n.getMaterial=function(){var e=this.options,o=e.src,s=e.transparent,h=e.blending,p=e.depthWrite,d=e.format,g=e.autoPlay,y=e.loop,b=e.alphaTest,m=e.sprite,w=ie(),u=document.createElement("video");return u.addEventListener("loadedmetadata",function(){var O=new c.VideoTexture(u);O.format=d!=null?d:c.RGBAFormat,O.needsUpdate=!0;var _=m?new c.SpriteMaterial({map:O,transparent:s!=null?s:!1,blending:h!=null?h:c.NormalBlending,depthWrite:p!=null?p:!0,alphaTest:b!=null?b:0}):new c.MeshBasicMaterial({map:O,transparent:s!=null?s:!1,blending:h!=null?h:c.NormalBlending,depthWrite:p!=null?p:!0,alphaTest:b!=null?b:0});w.resolve(_)},!1),u.src=o,u.muted=!0,u.autoplay=g,u.loop=y,u.preload="auto",w.promise},n.create=function(){var e=this;return(0,f.Z)(v().mark(function o(){var s,h,p,d,g,y,b,m;return v().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(s=e.options,h=s.scale,p=s.position,d=s.src,g=s.cache,y=s.sprite,!(g&&!g.get(d))){u.next=7;break}return g.init(d),u.next=5,e.getMaterial();case 5:b=u.sent,g.set(d,b);case 7:if(!g){u.next=13;break}return u.next=10,g.get(d);case 10:u.t0=u.sent,u.next=16;break;case 13:return u.next=15,e.getMaterial();case 15:u.t0=u.sent;case 16:m=u.t0,e.video=m.map.image,y?e.createSprite(m):e.createMesh(new c[X](1,1),m),h&&e.setScale(h),p&&e.object3d.position.copy(p);case 21:case"end":return u.stop()}},o)}))()},n.setScale=function(e){this.object3d.scale.set(this.video.videoWidth*e,this.video.videoHeight*e,1)},n.render=function(){var e=this.options.autoPlay;e&&this.video.play()},n.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),re(G(r.prototype),"dispose",this).call(this)},r}(ve),Ce=function(t){"use strict";C(r,t);var i=V(r);function r(a){k(this,r);var e;return e=i.call(this),e.options=(0,j.Z)({},a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.position,s=e.children,h=e.onClick,p=e.zIndexFix,d=document.createElement("div");this.element=d,d.appendChild(s),this.createCSS2DObject(d),o&&this.object3d.position.copy(o),h&&this.clickTarge.forEach(function(g){g.addEventListener("click",h)}),p&&(this.object3d.userData.zIndexFix=p)},n.getMaterial=function(e){return(0,f.Z)(v().mark(function o(){var s,h,p,d;return v().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return s=document.createElement("canvas"),s.width=256,s.height=256,h=s.getContext("2d"),h.fillStyle="#ff0000",h.fillRect(0,0,256,256),p=new c.CanvasTexture(s),d=new c.SpriteMaterial({map:p,opacity:e?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),y.abrupt("return",d);case 9:case"end":return y.stop()}},o)}))()},n.createPickObject=function(e){var o=e.show,s=o===void 0?!1:o,h=e.scale,p=h===void 0?new c.Vector3(1,1,1):h,d=e.position,g=d===void 0?new c.Vector3(0,0,0):d,y=e.cache,b=this;return(0,f.Z)(v().mark(function m(){var w,u,O,_;return v().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:if(w="node-create-pick-object",!(y&&!y.get(w))){x.next=7;break}return y.init(w),x.next=5,b.getMaterial(s);case 5:u=x.sent,y.set(w,u);case 7:if(!y){x.next=13;break}return x.next=10,y.get(w);case 10:x.t0=x.sent,x.next=16;break;case 13:return x.next=15,b.getMaterial(s);case 15:x.t0=x.sent;case 16:O=x.t0,_=new c.Sprite(O),_.scale.set(O.map.image.width*p.x,O.map.image.height*p.y,1),_.position.copy(g),b.add(_),b.pickObject=_;case 22:case"end":return x.stop()}},m)}))()},n.dispose=function(){var e=this.options.onClick;e&&this.clickTarge.forEach(function(o){o.removeEventListener("click",e)}),re(G(r.prototype),"dispose",this).call(this)},R(r,[{key:"clickTarge",get:function(){var e=this,o=this.options.clickTarge;if(o){var s=o.map(function(h){return I(e.element.querySelectorAll(h))}).flat();return s}return[this.element]}}]),r}(ve),Oe=Ce,nt=`
|
|
1
|
+
(function(){var rt={666:function(k){var T=function(A){"use strict";var C=Object.prototype,j=C.hasOwnProperty,E,L=typeof Symbol=="function"?Symbol:{},Z=L.iterator||"@@iterator",U=L.asyncIterator||"@@asyncIterator",G=L.toStringTag||"@@toStringTag";function M(f,l,v){return Object.defineProperty(f,l,{value:v,enumerable:!0,configurable:!0,writable:!0}),f[l]}try{M({},"")}catch(f){M=function(l,v,S){return l[v]=S}}function N(f,l,v,S){var P=l&&l.prototype instanceof Q?l:Q,X=Object.create(P.prototype),ce=new B(S||[]);return X._invoke=ie(f,v,ce),X}A.wrap=N;function H(f,l,v){try{return{type:"normal",arg:f.call(l,v)}}catch(S){return{type:"throw",arg:S}}}var V="suspendedStart",c="suspendedYield",pe="executing",J="completed",W={};function Q(){}function R(){}function z(){}var $={};M($,Z,function(){return this});var ue=Object.getPrototypeOf,ee=ue&&ue(ue(ve([])));ee&&ee!==C&&j.call(ee,Z)&&($=ee);var F=z.prototype=Q.prototype=Object.create($);R.prototype=z,M(F,"constructor",z),M(z,"constructor",R),R.displayName=M(z,G,"GeneratorFunction");function I(f){["next","throw","return"].forEach(function(l){M(f,l,function(v){return this._invoke(l,v)})})}A.isGeneratorFunction=function(f){var l=typeof f=="function"&&f.constructor;return l?l===R||(l.displayName||l.name)==="GeneratorFunction":!1},A.mark=function(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,z):(f.__proto__=z,M(f,G,"GeneratorFunction")),f.prototype=Object.create(F),f},A.awrap=function(f){return{__await:f}};function te(f,l){function v(X,ce,le,ae){var re=H(f[X],f,ce);if(re.type==="throw")ae(re.arg);else{var ke=re.arg,Ce=ke.value;return Ce&&typeof Ce=="object"&&j.call(Ce,"__await")?l.resolve(Ce.__await).then(function(Oe){v("next",Oe,le,ae)},function(Oe){v("throw",Oe,le,ae)}):l.resolve(Ce).then(function(Oe){ke.value=Oe,le(ke)},function(Oe){return v("throw",Oe,le,ae)})}}var S;function P(X,ce){function le(){return new l(function(ae,re){v(X,ce,ae,re)})}return S=S?S.then(le,le):le()}this._invoke=P}I(te.prototype),M(te.prototype,U,function(){return this}),A.AsyncIterator=te,A.async=function(f,l,v,S,P){P===void 0&&(P=Promise);var X=new te(N(f,l,v,S),P);return A.isGeneratorFunction(l)?X:X.next().then(function(ce){return ce.done?ce.value:X.next()})};function ie(f,l,v){var S=V;return function(X,ce){if(S===pe)throw new Error("Generator is already running");if(S===J){if(X==="throw")throw ce;return ze()}for(v.method=X,v.arg=ce;;){var le=v.delegate;if(le){var ae=we(le,v);if(ae){if(ae===W)continue;return ae}}if(v.method==="next")v.sent=v._sent=v.arg;else if(v.method==="throw"){if(S===V)throw S=J,v.arg;v.dispatchException(v.arg)}else v.method==="return"&&v.abrupt("return",v.arg);S=pe;var re=H(f,l,v);if(re.type==="normal"){if(S=v.done?J:c,re.arg===W)continue;return{value:re.arg,done:v.done}}else re.type==="throw"&&(S=J,v.method="throw",v.arg=re.arg)}}}function we(f,l){var v=f.iterator[l.method];if(v===E){if(l.delegate=null,l.method==="throw"){if(f.iterator.return&&(l.method="return",l.arg=E,we(f,l),l.method==="throw"))return W;l.method="throw",l.arg=new TypeError("The iterator does not provide a 'throw' method")}return W}var S=H(v,f.iterator,l.arg);if(S.type==="throw")return l.method="throw",l.arg=S.arg,l.delegate=null,W;var P=S.arg;if(!P)return l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,W;if(P.done)l[f.resultName]=P.value,l.next=f.nextLoc,l.method!=="return"&&(l.method="next",l.arg=E);else return P;return l.delegate=null,W}I(F),M(F,G,"Generator"),M(F,Z,function(){return this}),M(F,"toString",function(){return"[object Generator]"});function xe(f){var l={tryLoc:f[0]};1 in f&&(l.catchLoc=f[1]),2 in f&&(l.finallyLoc=f[2],l.afterLoc=f[3]),this.tryEntries.push(l)}function q(f){var l=f.completion||{};l.type="normal",delete l.arg,f.completion=l}function B(f){this.tryEntries=[{tryLoc:"root"}],f.forEach(xe,this),this.reset(!0)}A.keys=function(f){var l=[];for(var v in f)l.push(v);return l.reverse(),function S(){for(;l.length;){var P=l.pop();if(P in f)return S.value=P,S.done=!1,S}return S.done=!0,S}};function ve(f){if(f){var l=f[Z];if(l)return l.call(f);if(typeof f.next=="function")return f;if(!isNaN(f.length)){var v=-1,S=function P(){for(;++v<f.length;)if(j.call(f,v))return P.value=f[v],P.done=!1,P;return P.value=E,P.done=!0,P};return S.next=S}}return{next:ze}}A.values=ve;function ze(){return{value:E,done:!0}}return B.prototype={constructor:B,reset:function(f){if(this.prev=0,this.next=0,this.sent=this._sent=E,this.done=!1,this.delegate=null,this.method="next",this.arg=E,this.tryEntries.forEach(q),!f)for(var l in this)l.charAt(0)==="t"&&j.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=E)},stop:function(){this.done=!0;var f=this.tryEntries[0],l=f.completion;if(l.type==="throw")throw l.arg;return this.rval},dispatchException:function(f){if(this.done)throw f;var l=this;function v(ae,re){return X.type="throw",X.arg=f,l.next=ae,re&&(l.method="next",l.arg=E),!!re}for(var S=this.tryEntries.length-1;S>=0;--S){var P=this.tryEntries[S],X=P.completion;if(P.tryLoc==="root")return v("end");if(P.tryLoc<=this.prev){var ce=j.call(P,"catchLoc"),le=j.call(P,"finallyLoc");if(ce&&le){if(this.prev<P.catchLoc)return v(P.catchLoc,!0);if(this.prev<P.finallyLoc)return v(P.finallyLoc)}else if(ce){if(this.prev<P.catchLoc)return v(P.catchLoc,!0)}else if(le){if(this.prev<P.finallyLoc)return v(P.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(f,l){for(var v=this.tryEntries.length-1;v>=0;--v){var S=this.tryEntries[v];if(S.tryLoc<=this.prev&&j.call(S,"finallyLoc")&&this.prev<S.finallyLoc){var P=S;break}}P&&(f==="break"||f==="continue")&&P.tryLoc<=l&&l<=P.finallyLoc&&(P=null);var X=P?P.completion:{};return X.type=f,X.arg=l,P?(this.method="next",this.next=P.finallyLoc,W):this.complete(X)},complete:function(f,l){if(f.type==="throw")throw f.arg;return f.type==="break"||f.type==="continue"?this.next=f.arg:f.type==="return"?(this.rval=this.arg=f.arg,this.method="return",this.next="end"):f.type==="normal"&&l&&(this.next=l),W},finish:function(f){for(var l=this.tryEntries.length-1;l>=0;--l){var v=this.tryEntries[l];if(v.finallyLoc===f)return this.complete(v.completion,v.afterLoc),q(v),W}},catch:function(f){for(var l=this.tryEntries.length-1;l>=0;--l){var v=this.tryEntries[l];if(v.tryLoc===f){var S=v.completion;if(S.type==="throw"){var P=S.arg;q(v)}return P}}throw new Error("illegal catch attempt")},delegateYield:function(f,l,v){return this.delegate={iterator:ve(f),resultName:l,nextLoc:v},this.method==="next"&&(this.arg=E),W}},A}(k.exports);try{regeneratorRuntime=T}catch(A){typeof globalThis=="object"?globalThis.regeneratorRuntime=T:Function("r","regeneratorRuntime = r")(T)}},695:function(k,T,A){"use strict";A.d(T,{Z:function(){return C}});function C(j){if(j.geometry&&j.geometry.dispose(),j.material){var E=Array.isArray(j.material)?j.material:[j.material];E.forEach(function(L){var Z,U,G,M,N,H,V,c,pe,J,W,Q,R;(Z=L.map)===null||Z===void 0||Z.dispose(),(U=L.lightMap)===null||U===void 0||U.dispose(),(G=L.bumpMap)===null||G===void 0||G.dispose(),(M=L.normalMap)===null||M===void 0||M.dispose(),(N=L.specularMap)===null||N===void 0||N.dispose(),(H=L.envMap)===null||H===void 0||H.dispose(),(V=L.alphaMap)===null||V===void 0||V.dispose(),(c=L.aoMap)===null||c===void 0||c.dispose(),(pe=L.displacementMap)===null||pe===void 0||pe.dispose(),(J=L.emissiveMap)===null||J===void 0||J.dispose(),(W=L.gradientMap)===null||W===void 0||W.dispose(),(Q=L.metalnessMap)===null||Q===void 0||Q.dispose(),(R=L.roughnessMap)===null||R===void 0||R.dispose(),L.dispose()})}}},584:function(k,T,A){"use strict";A.d(T,{disposeMesh:function(){return L.Z}});var C=A(666),j=A.n(C),E=null,L=A(695),Z=A(644);function U(W){if(W.material){var Q=Array.isArray(W.material)?W.material:[W.material];Q.forEach(function(R){var z,$;(z=R.color)===null||z===void 0||z.convertSRGBToLinear(),($=R.emissive)===null||$===void 0||$.convertSRGBToLinear(),R.map&&(R.map.encoding=THREE.sRGBEncoding),R.emissiveMap&&(R.emissiveMap.encoding=THREE.sRGBEncoding)})}}var G=A(568),M=A(924),N=A(360),H=A(484),V=null,c=null,pe=function(){var W=(0,G.Z)(j().mark(function Q(R,z){var $,ue,ee,F,I,te,ie,we,xe;return j().wrap(function(B){for(;;)switch(B.prev=B.next){case 0:return $=z.type,ue=$===void 0?"blob":$,ee=z.version,F=ee===void 0?"1":ee,B.next=4,(0,N.get)(R);case 4:if(te=B.sent,!(te&&te[F])){B.next=9;break}I=te[F],B.next=15;break;case 9:return B.next=11,(0,H.Z)(fetch(R).then(function(ve){if(ve.ok)return ve[ue]();throw new Error}));case 11:ie=B.sent,we=ie.res,xe=ie.err,xe||(I=we,(0,N.set)(R,(0,M.Z)({},F,we)));case 15:return B.abrupt("return",I?{url:ue==="json"?R:URL.createObjectURL(I),store:I}:{url:R});case 16:case"end":return B.stop()}},Q)}));return function(R,z){return W.apply(this,arguments)}}(),J=A(705)},484:function(k,T,A){"use strict";A.d(T,{Z:function(){return j}});var C=A(42);function j(E){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return E.then(function(Z){return(0,C.Z)({err:null,res:Z},L)}).catch(function(Z){return(0,C.Z)({err:Z,res:void 0},L)})}},705:function(k,T,A){"use strict";A.d(T,{C:function(){return Z},y:function(){return L}});var C=A(644),j=A.n(C),E=new Map,L=function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(G,M,N,H,V){var c=M[N*3],pe=M[N*3+1],J=M[H*3],W=M[H*3+1],Q=M[V*3],R=M[V*3+1],z;if(E.has(G))z=E.get(G);else{var $=U.box3||new C.Box3;if(!U.box3){var ue=G.parameters.shapes.getPoints();$.setFromArray(ue.map(function(ie){return[ie.x,ie.y,0]}).flat())}var ee=$.getSize(new C.Vector3);U.split&&(ee.y/=U.split),z={box:$,size:ee},E.set(G,z)}var F=z.box,I=z.size,te=U.split?1-U.split:0;return[new C.Vector2((c-F.min.x)/I.x,(pe-F.min.y)/I.y+te),new C.Vector2((J-F.min.x)/I.x,(W-F.min.y)/I.y+te),new C.Vector2((Q-F.min.x)/I.x,(R-F.min.y)/I.y+te)]},generateSideWallUV:function(G,M,N,H,V,c){var pe=M[N*3],J=M[N*3+1],W=M[N*3+2],Q=M[H*3],R=M[H*3+1],z=M[H*3+2],$=M[V*3],ue=M[V*3+1],ee=M[V*3+2],F=M[c*3],I=M[c*3+1],te=M[c*3+2],ie;if(E.has(M))ie=E.get(M);else{var we=new C.Box3;we.setFromArray(M);var xe=we.getSize(new C.Vector3);U.split&&(xe.z/=1-U.split),ie={box:we,size:xe},E.set(M,ie)}var q=ie.box,B=ie.size;return Math.abs(J-R)<Math.abs(pe-Q)?[new C.Vector2((pe-q.min.x)/B.x,(W-q.min.z)/B.z),new C.Vector2((Q-q.min.x)/B.x,(z-q.min.z)/B.z),new C.Vector2(($-q.min.x)/B.x,(ee-q.min.z)/B.z),new C.Vector2((F-q.min.x)/B.x,(te-q.min.z)/B.z)]:[new C.Vector2((J-q.min.y)/B.y,(W-q.min.z)/B.z),new C.Vector2((R-q.min.y)/B.y,(z-q.min.z)/B.z),new C.Vector2((ue-q.min.y)/B.y,(ee-q.min.z)/B.z),new C.Vector2((I-q.min.y)/B.y,(te-q.min.z)/B.z)]}}},Z=function(){E.clear()}},360:function(k){"use strict";k.exports=require("idb-keyval")},644:function(k){"use strict";k.exports=require("three")},568:function(k,T,A){"use strict";A.d(T,{Z:function(){return j}});function C(E,L,Z,U,G,M,N){try{var H=E[M](N),V=H.value}catch(c){Z(c);return}H.done?L(V):Promise.resolve(V).then(U,G)}function j(E){return function(){var L=this,Z=arguments;return new Promise(function(U,G){var M=E.apply(L,Z);function N(V){C(M,U,G,N,H,"next",V)}function H(V){C(M,U,G,N,H,"throw",V)}N(void 0)})}}},924:function(k,T,A){"use strict";A.d(T,{Z:function(){return C}});function C(j,E,L){return E in j?Object.defineProperty(j,E,{value:L,enumerable:!0,configurable:!0,writable:!0}):j[E]=L,j}},42:function(k,T,A){"use strict";A.d(T,{Z:function(){return j}});var C=A(924);function j(E){for(var L=1;L<arguments.length;L++){var Z=arguments[L]!=null?arguments[L]:{},U=Object.keys(Z);typeof Object.getOwnPropertySymbols=="function"&&(U=U.concat(Object.getOwnPropertySymbols(Z).filter(function(G){return Object.getOwnPropertyDescriptor(Z,G).enumerable}))),U.forEach(function(G){(0,C.Z)(E,G,Z[G])})}return E}}},Ze={};function Y(k){var T=Ze[k];if(T!==void 0)return T.exports;var A=Ze[k]={exports:{}};return rt[k](A,A.exports,Y),A.exports}(function(){Y.n=function(k){var T=k&&k.__esModule?function(){return k.default}:function(){return k};return Y.d(T,{a:T}),T}})(),function(){Y.d=function(k,T){for(var A in T)Y.o(T,A)&&!Y.o(k,A)&&Object.defineProperty(k,A,{enumerable:!0,get:T[A]})}}(),function(){Y.o=function(k,T){return Object.prototype.hasOwnProperty.call(k,T)}}(),function(){Y.r=function(k){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(k,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(k,"__esModule",{value:!0})}}();var Be={};(function(){"use strict";Y.r(Be),Y.d(Be,{ConicPolygon:function(){return St},ExtrudePolygon:function(){return Ot},Image:function(){return ce},Line:function(){return ut},MeshLine:function(){return Ae},MeshLineMaterial:function(){return Ve},MeshLineRaycast:function(){return Fe},Node:function(){return Oe},Text:function(){return ze},Video:function(){return ke}});function k(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function T(t,i){return T=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},T(t,i)}function A(t,i){return T(t,i)}function C(t,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(i&&i.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),i&&A(t,i)}var j=Y(42);function E(t,i){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);i&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function L(t,i){return i=i!=null?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):E(Object(i)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(i,r))}),t}function Z(){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(t){return!1}}function U(t){return U=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},U(t)}function G(t){return U(t)}function M(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function N(t){return t&&t.constructor===Symbol?"symbol":typeof t}function H(t,i){return i&&(N(i)==="object"||typeof i=="function")?i:M(t)}function V(t){var i=Z();return function(){var n=G(t),a;if(i){var e=G(this).constructor;a=Reflect.construct(n,arguments,e)}else a=n.apply(this,arguments);return H(this,a)}}var c=Y(644);function pe(){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(t){return!1}}function J(t,i,r){return pe()?J=Reflect.construct:J=function(a,e,o){var s=[null];s.push.apply(s,e);var h=Function.bind.apply(a,s),p=new h;return o&&A(p,o.prototype),p},J.apply(null,arguments)}function W(t,i,r){return J.apply(null,arguments)}function Q(t,i){for(var r=0;r<i.length;r++){var n=i[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function R(t,i,r){return i&&Q(t.prototype,i),r&&Q(t,r),t}function z(t,i){(i==null||i>t.length)&&(i=t.length);for(var r=0,n=new Array(i);r<i;r++)n[r]=t[r];return n}function $(t){if(Array.isArray(t))return z(t)}function ue(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ee(){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 F(t,i){if(!!t){if(typeof t=="string")return z(t,i);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return z(t,i)}}function I(t){return $(t)||ue(t)||F(t)||ee()}var te=Y(484);function ie(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={};return r.promise=new Promise(function(n,a){r.resolve=n,r.reject=a}),t&&(r.promise=(0,te.Z)(r.promise,i)),r}var we=require("three/examples/jsm/renderers/CSS2DRenderer"),xe=require("three/examples/jsm/renderers/CSS3DRenderer"),q=Y(584),B=function(t){t&&((0,q.disposeMesh)(t),t.children.forEach(function(i){i.userData.BaseObject_||B(i)}))},ve=function(){"use strict";function t(){k(this,t),this.objecttype__="BaseObject",this.userData={},this.pm=ie(),this.visible=!1}var i=t.prototype;return i.init=function(){},i.create=function(){},i.render=function(){},i.update=function(n,a){},i.resize=function(n,a){},i.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},i.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},i.isVisible=function(){return this.visible},i.createMesh=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];return this.object3d=W(c.Mesh,I(a)),this},i.createGroup=function(){return this.object3d=new c.Group,this},i.createPoints=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];return this.object3d=W(c.Points,I(a)),this},i.createCSS2DObject=function(n){return this.object3d=new we.CSS2DObject(n),this},i.createCSS3DObject=function(n){return this.object3d=new xe.CSS3DObject(n),this},i.createCSS3DSprite=function(n){return this.object3d=new xe.CSS3DSprite(n),this},i.createSprite=function(n){return this.object3d=new c.Sprite(n),this},i.add=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];var o;return(o=this.object3d).add.apply(o,I(a)),this},i.remove=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];var o;return(o=this.object3d).remove.apply(o,I(a)),this},i.getSize=function(){var n=new c.Box3().setFromObject(this.object3d);return{min:n.min,max:n.max,size:n.getSize(new c.Vector3)}},i.traverse=function(n){n(this),this.children.forEach(function(a){a.traverse(n)})},i.dispose=function(){B(this.object3d)},R(t,[{key:"parent",get:function(){var n=this.object3d.parent;return(n==null?void 0:n.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(n){return n.userData.BaseObject_}).filter(function(n){return!!n})}}]),t}(),ze=function(t){"use strict";C(r,t);var i=V(r);function r(a){k(this,r);var e;return e=i.call(this),e.width=0,e.canvas=document.createElement("canvas"),e.options=(0,j.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.position,s=e.lookAt,h=e.sprite,p=e.text,d=e.sizeAttenuation;if(h){var m=new c.Sprite(new c.SpriteMaterial({transparent:!0,sizeAttenuation:d}));this.object3d=m}else{var y=new c.MeshBasicMaterial({side:c.DoubleSide,transparent:!0}),b=new c.PlaneGeometry(1,1,1,1);this.createMesh(b,y)}this.object3d.position.copy(o),s&&this.object3d.lookAt(s),this.setText(p)},n.setText=function(e,o){var s=(0,j.Z)(L((0,j.Z)({},this.options),{text:e}),o||{}),h=s.text,p=s.fontSize,d=s.fontFamily,m=s.fontWeight,y=s.flipX,b=s.scale,g=this.canvas;g.width=p*h.length*2,g.height=p;var w=g.getContext("2d");w.font="".concat(m," ").concat(p,"px/1 ").concat(d);var u=w.measureText(h).width;g.width=u,this.width=u,w=g.getContext("2d"),w.clearRect(0,0,g.width,g.height),y&&w.scale(-1,1),w.font="".concat(m," ").concat(p,"px/1 ").concat(d),w.textBaseline="middle",w.fillStyle="#ffffff",w.fillText(h,y?u*-1:0,g.height/2),w.restore();var O=new c.Texture(g);O.anisotropy=16,O.needsUpdate=!0;var _=this.object3d;_.material.map&&_.material.map.dispose(),_.material.map=O,_.material.needsUpdate=!0,_.scale.set(O.image.width*b,O.image.height*b,1)},r}(ve),f=Y(568),l=Y(666),v=Y.n(l),S=+c.REVISION<144,P=S?"ExtrudeBufferGeometry":"ExtrudeGeometry",X=S?"PlaneBufferGeometry":"PlaneGeometry",ce=function(t){"use strict";C(r,t);var i=V(r);function r(a){k(this,r);var e;return e=i.call(this),e.options=a,e}var n=r.prototype;return n.getMaterial=function(){var e=this;return(0,f.Z)(v().mark(function o(){var s,h,p,d,m,y,b,g,w,u;return v().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return s=e.options,h=s.transparent,p=s.blending,d=s.src,m=s.depthWrite,y=s.alphaTest,b=s.sprite,g=s.sizeAttenuation,_.next=3,new c.TextureLoader().loadAsync(d);case 3:return w=_.sent,u=b?new c.SpriteMaterial({map:w,transparent:h!=null?h:!1,blending:p!=null?p:c.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:y!=null?y:0,sizeAttenuation:g!=null?g:!0}):new c.MeshBasicMaterial({map:w,transparent:h!=null?h:!1,blending:p!=null?p:c.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:y!=null?y:0}),_.abrupt("return",u);case 6:case"end":return _.stop()}},o)}))()},n.create=function(){var e=this;return(0,f.Z)(v().mark(function o(){var s,h,p,d,m,y,b,g;return v().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(s=e.options,h=s.scale,p=s.position,d=s.src,m=s.cache,y=s.sprite,!(m&&!m.get(d))){u.next=7;break}return m.init(d),u.next=5,e.getMaterial();case 5:b=u.sent,m.set(d,b);case 7:if(!m){u.next=13;break}return u.next=10,m.get(d);case 10:u.t0=u.sent,u.next=16;break;case 13:return u.next=15,e.getMaterial();case 15:u.t0=u.sent;case 16:g=u.t0,e.texture=g.map,y?e.createSprite(g):e.createMesh(new c[X](1,1),g),h&&e.setScale(h),p&&e.object3d.position.copy(p);case 21:case"end":return u.stop()}},o)}))()},n.setScale=function(e){this.object3d.scale.set(this.texture.image.width*e,this.texture.image.height*e,1)},r}(ve);function le(t,i){for(;!Object.prototype.hasOwnProperty.call(t,i)&&(t=G(t),t!==null););return t}function ae(t,i,r){return typeof Reflect!="undefined"&&Reflect.get?ae=Reflect.get:ae=function(a,e,o){var s=le(a,e);if(!!s){var h=Object.getOwnPropertyDescriptor(s,e);return h.get?h.get.call(o||a):h.value}},ae(t,i,r)}function re(t,i,r){return ae(t,i,r)}var ke=function(t){"use strict";C(r,t);var i=V(r);function r(a){k(this,r);var e;return e=i.call(this),e.options=(0,j.Z)({},{autoPlay:!0,loop:!0},a),e}var n=r.prototype;return n.getMaterial=function(){var e=this.options,o=e.src,s=e.transparent,h=e.blending,p=e.depthWrite,d=e.format,m=e.autoPlay,y=e.loop,b=e.alphaTest,g=e.sprite,w=ie(),u=document.createElement("video");return u.addEventListener("loadedmetadata",function(){var O=new c.VideoTexture(u);O.format=d!=null?d:c.RGBAFormat,O.needsUpdate=!0;var _=g?new c.SpriteMaterial({map:O,transparent:s!=null?s:!1,blending:h!=null?h:c.NormalBlending,depthWrite:p!=null?p:!0,alphaTest:b!=null?b:0}):new c.MeshBasicMaterial({map:O,transparent:s!=null?s:!1,blending:h!=null?h:c.NormalBlending,depthWrite:p!=null?p:!0,alphaTest:b!=null?b:0});w.resolve(_)},!1),u.src=o,u.muted=!0,u.autoplay=m,u.loop=y,u.preload="auto",w.promise},n.create=function(){var e=this;return(0,f.Z)(v().mark(function o(){var s,h,p,d,m,y,b,g;return v().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(s=e.options,h=s.scale,p=s.position,d=s.src,m=s.cache,y=s.sprite,!(m&&!m.get(d))){u.next=7;break}return m.init(d),u.next=5,e.getMaterial();case 5:b=u.sent,m.set(d,b);case 7:if(!m){u.next=13;break}return u.next=10,m.get(d);case 10:u.t0=u.sent,u.next=16;break;case 13:return u.next=15,e.getMaterial();case 15:u.t0=u.sent;case 16:g=u.t0,e.video=g.map.image,y?e.createSprite(g):e.createMesh(new c[X](1,1),g),h&&e.setScale(h),p&&e.object3d.position.copy(p);case 21:case"end":return u.stop()}},o)}))()},n.setScale=function(e){this.object3d.scale.set(this.video.videoWidth*e,this.video.videoHeight*e,1)},n.render=function(){var e=this.options.autoPlay;e&&this.video.play()},n.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),re(G(r.prototype),"dispose",this).call(this)},r}(ve),Ce=function(t){"use strict";C(r,t);var i=V(r);function r(a){k(this,r);var e;return e=i.call(this),e.options=(0,j.Z)({},{event:"click"},a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.position,s=e.children,h=e.handler,p=e.event,d=e.zIndexFix,m=document.createElement("div");this.element=m,m.appendChild(s),this.createCSS2DObject(m),o&&this.object3d.position.copy(o),h&&p&&this.clickTarge.forEach(function(y){y.addEventListener(p,h)}),d&&(this.object3d.userData.zIndexFix=d)},n.getMaterial=function(e){return(0,f.Z)(v().mark(function o(){var s,h,p,d;return v().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return s=document.createElement("canvas"),s.width=256,s.height=256,h=s.getContext("2d"),h.fillStyle="#ff0000",h.fillRect(0,0,256,256),p=new c.CanvasTexture(s),d=new c.SpriteMaterial({map:p,opacity:e?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),y.abrupt("return",d);case 9:case"end":return y.stop()}},o)}))()},n.createPickObject=function(e){var o=e.show,s=o===void 0?!1:o,h=e.scale,p=h===void 0?new c.Vector3(1,1,1):h,d=e.position,m=d===void 0?new c.Vector3(0,0,0):d,y=e.cache,b=this;return(0,f.Z)(v().mark(function g(){var w,u,O,_;return v().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:if(w="node-create-pick-object",!(y&&!y.get(w))){x.next=7;break}return y.init(w),x.next=5,b.getMaterial(s);case 5:u=x.sent,y.set(w,u);case 7:if(!y){x.next=13;break}return x.next=10,y.get(w);case 10:x.t0=x.sent,x.next=16;break;case 13:return x.next=15,b.getMaterial(s);case 15:x.t0=x.sent;case 16:O=x.t0,_=new c.Sprite(O),_.scale.set(O.map.image.width*p.x,O.map.image.height*p.y,1),_.position.copy(m),b.add(_),b.pickObject=_;case 22:case"end":return x.stop()}},g)}))()},n.dispose=function(){var e=this.options,o=e.handler,s=e.event;o&&s&&this.clickTarge.forEach(function(h){h.removeEventListener(s,o)}),re(G(r.prototype),"dispose",this).call(this)},R(r,[{key:"clickTarge",get:function(){var e=this,o=this.options.eventTarge;if(o){var s=o.map(function(h){return I(e.element.querySelectorAll(h))}).flat();return s}return[this.element]}}]),r}(ve),Oe=Ce,nt=`
|
|
2
2
|
`.concat(c.ShaderChunk.logdepthbuf_pars_vertex,`
|
|
3
3
|
`).concat(c.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(c.ShaderChunk.fog_fragment,`
|
|
131
131
|
}
|
|
132
|
-
`),Ae=function(t){"use strict";C(r,t);var i=V(r);function r(){k(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 c.Matrix4,Object.defineProperties(M(n),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(e){this.setGeometry(e,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(e){this.setPoints(e,this.widthCallback)}}}),n}return r}(c.BufferGeometry);Ae.prototype.setMatrixWorld=function(t){this.matrixWorld=t},Ae.prototype.setGeometry=function(t,i){this._geometry=t,this.setPoints(t.getAttribute("position").array,i)},Ae.prototype.setPoints=function(t,i){if(!(t instanceof Float32Array)&&!(t instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=t,this.widthCallback=i,this.positions=[],this.counters=[],t.length&&t[0]instanceof c.Vector3)for(var r=0;r<t.length;r++){var n=t[r],a=r/t.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<t.length;r+=3){var a=r/t.length;this.positions.push(t[r],t[r+1],t[r+2]),this.positions.push(t[r],t[r+1],t[r+2]),this.counters.push(a),this.counters.push(a)}this.process()};function Fe(t,i){var r=new c.Matrix4,n=new c.Ray,a=new c.Sphere,e=new c.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),a.copy(o.boundingSphere),a.applyMatrix4(this.matrixWorld),t.ray.intersectSphere(a,e)!==!1){r.copy(this.matrixWorld).invert(),n.copy(t.ray).applyMatrix4(r);var s=new c.Vector3,h=new c.Vector3,p=new c.Vector3,d=this instanceof c.LineSegments?2:1,g=o.index,y=o.attributes;if(g!==null)for(var b=g.array,m=y.position.array,w=y.width.array,u=0,O=b.length-1;u<O;u+=d){var _=b[u],D=b[u+1];s.fromArray(m,_*3),h.fromArray(m,D*3);var x=w[Math.floor(u/3)]!==void 0?w[Math.floor(u/3)]:1,oe=t.params.Line.threshold+this.material.lineWidth*x/2,me=oe*oe,he=n.distanceSqToSegment(s,h,e,p);if(!(he>me)){e.applyMatrix4(this.matrixWorld);var fe=t.ray.origin.distanceTo(e);fe<t.near||fe>t.far||(i.push({distance:fe,point:p.clone().applyMatrix4(this.matrixWorld),index:u,face:null,faceIndex:null,object:this}),u=O)}}}}Ae.prototype.raycast=Fe,Ae.prototype.compareV3=function(t,i){var r=t*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]},Ae.prototype.copyV3=function(t){var i=t*6;return[this.positions[i],this.positions[i+1],this.positions[i+2]]},Ae.prototype.process=function(){var t=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var i,r;this.compareV3(0,t-1)?r=this.copyV3(t-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<t;n++){if(this.side.push(1),this.side.push(-1),this.widthCallback?i=this.widthCallback(n/(t-1)):i=1,this.width.push(i),this.width.push(i),this.uvs.push(n/(t-1),0),this.uvs.push(n/(t-1),1),n<t-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(t-1,0)?r=this.copyV3(1):r=this.copyV3(t-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 c.BufferAttribute(new Float32Array(this.positions),3),previous:new c.BufferAttribute(new Float32Array(this.previous),3),next:new c.BufferAttribute(new Float32Array(this.next),3),side:new c.BufferAttribute(new Float32Array(this.side),1),width:new c.BufferAttribute(new Float32Array(this.width),1),uv:new c.BufferAttribute(new Float32Array(this.uvs),2),index:new c.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new c.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 Ge(t,i,r,n,a){var e;if(t=t.subarray||t.slice?t:t.buffer,r=r.subarray||r.slice?r:r.buffer,t=i?t.subarray?t.subarray(i,a&&i+a):t.slice(i,a&&i+a):t,r.set)r.set(t,n);else for(e=0;e<t.length;e++)r[e+n]=t[e];return r}Ae.prototype.advance=function(t){var i=this._attributes.position.array,r=this._attributes.previous.array,n=this._attributes.next.array,a=i.length;Ge(i,0,r,0,a),Ge(i,6,i,0,a-6),i[a-6]=t.x,i[a-5]=t.y,i[a-4]=t.z,i[a-3]=t.x,i[a-2]=t.y,i[a-1]=t.z,Ge(i,6,n,0,a-6),n[a-6]=t.x,n[a-5]=t.y,n[a-4]=t.z,n[a-3]=t.x,n[a-2]=t.y,n[a-1]=t.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},c.ShaderChunk.meshline_vert=nt,c.ShaderChunk.meshline_frag=it;var Ve=function(t){"use strict";C(r,t);var i=V(r);function r(n){k(this,r);var a;return a=i.call(this,{uniforms:Object.assign({},c.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new c.Color(16777215)},opacity:{value:1},resolution:{value:new c.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 c.Vector2(1,1)},offset:{value:new c.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new c.Vector2(0,0)},lightColor:{value:new c.Color(16777215)}}),vertexShader:c.ShaderChunk.meshline_vert,fragmentShader:c.ShaderChunk.meshline_frag}),a.isMeshLineMaterial=!0,a.type="MeshLineMaterial",Object.defineProperties(M(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}(c.ShaderMaterial);Ve.prototype.copy=function(t){return c.ShaderMaterial.prototype.copy.call(this,t),this.lineWidth=t.lineWidth,this.map=t.map,this.useMap=t.useMap,this.alphaMap=t.alphaMap,this.useAlphaMap=t.useAlphaMap,this.color.copy(t.color),this.opacity=t.opacity,this.resolution.copy(t.resolution),this.sizeAttenuation=t.sizeAttenuation,this.dashArray.copy(t.dashArray),this.dashOffset.copy(t.dashOffset),this.dashRatio.copy(t.dashRatio),this.useDash=t.useDash,this.visibility=t.visibility,this.alphaTest=t.alphaTest,this.repeat.copy(t.repeat),this};function at(t,i){if(t==null)return{};var r={},n=Object.keys(t),a,e;for(e=0;e<n.length;e++)a=n[e],!(i.indexOf(a)>=0)&&(r[a]=t[a]);return r}function ot(t,i){if(t==null)return{};var r=at(t,i),n,a;if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);for(a=0;a<e.length;a++)n=e[a],!(i.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,n)||(r[n]=t[n]))}return r}var Ne=require("popmotion"),He=require("three/examples/jsm//utils/BufferGeometryUtils");function Ke(t){var i=t.setPointWidth,r=t.nodes,n=new c.BufferGeometry,a=new Ae;return n.setFromPoints(r),a.setGeometry(n,i),a}var st={color:new c.Color("#ffffff"),lineWidth:3,sizeAttenuation:0},ut=function(t){"use strict";C(r,t);var i=V(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};k(this,r);var e;return e=i.call(this),e.options=(0,j.Z)({},st,a),e}var n=r.prototype;return n.create=function(){var e=this,o=this.options,s=o.duration,h=o.delay,p=o.onComplete,d=o.setPointWidth,g=o.key,y=o.nodes,b=o.nodesArr,m=o.coordinatesArr,w=o.projection,u=o.worker,O=o.workerKey,_=o.useGroups,D=ot(o,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","coordinatesArr","projection","worker","workerKey","useGroups"]),x=this.pencil.getSize(),oe=x.width,me=x.height,he=new Ve(L((0,j.Z)({},D),{resolution:new c.Vector2(oe,me)}));if(this.material=he,y)this.createMesh(Ke({nodes:y,setPointWidth:d}),he);else if(b){var fe=He.mergeBufferGeometries(b.map(function(de){return Ke({nodes:de,setPointWidth:d})}),_!=null?_:!1);this.createMesh(fe,he)}else if(m&&u)return new Promise(function(de){u.postMessage({coordinatesArr:m,projection:w,useGroups:_,workerKey:O},function(se){var ge=new c.BufferGeometry;Object.keys(se).forEach(function(ye){ye==="index"?ge.setIndex(new c.BufferAttribute(se[ye].array,se[ye].itemSize)):ge.setAttribute(ye,new c.BufferAttribute(se[ye].array,se[ye].itemSize))}),e.createMesh(ge,he),de("")})})},n.resize=function(e,o){this.material.uniforms.resolution.value.set(e,o)},n.animate=function(){var e=this.options,o=e.duration,s=e.delay,h=e.onComplete,p=this.material.uniforms.offset,d=s!=null?s:0,g=(0,Ne.animate)({from:p.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-d,repeat:1/0,onComplete:h,ease:Ne.linear,onUpdate:function(y){p.value.x=y.x}});this.tween=g},n.dispose=function(){var e;re(G(r.prototype),"dispose",this).call(this),(e=this.tween)===null||e===void 0||e.stop()},r}(ve);function ct(t){if(Array.isArray(t))return t}function lt(){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 Pe(t,i){return ct(t)||ue(t,i)||F(t,i)||lt()}var je=require("d3-array"),ft=require("earcut"),We=Y.n(ft),ht=require("@turf/boolean-clockwise"),pt=Y.n(ht);function vt(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=(90-i)*Math.PI/180,a=(90-t)*Math.PI/180;return[r*Math.sin(n)*Math.cos(a),r*Math.cos(n),r*Math.sin(n)*Math.sin(a)]}var dt=require("delaunator"),mt=Y.n(dt),gt=require("@turf/boolean-point-in-polygon"),yt=Y.n(gt),Le=require("d3-geo"),bt=require("d3-geo-voronoi"),$e=require("d3-scale");function wt(t,i){return t.map(function(r){var n=[],a;return r.forEach(function(e){if(a){var o=(0,Le.geoDistance)(e,a)*180/Math.PI;if(o>i)for(var s=(0,Le.geoInterpolate)(a,e),h=1/Math.ceil(o/i),p=h;p<1;)n.push(s(p)),p+=h}n.push(a=e)}),n})}function _t(t){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.minLng,n=i.maxLng,a=i.minLat,e=i.maxLat,o=Math.round(Math.pow(360/t,2)/Math.PI),s=(1+Math.sqrt(5))/2,h=function(u){return u/s*360%360-180},p=function(u){return Math.acos(2*u/o-1)/Math.PI*180-90},d=function(u){return o*(Math.cos((u+90)*Math.PI/180)+1)/2},g=[e!==void 0?Math.ceil(d(e)):0,a!==void 0?Math.floor(d(a)):o-1],y=r===void 0&&n===void 0?function(){return!0}:r===void 0?function(u){return u<=n}:n===void 0?function(u){return u>=r}:n>=r?function(u){return u>=r&&u<=n}:function(u){return u>=r||u<=n},b=[],m=g[0];m<=g[1];m++){var w=h(m);y(w)&&b.push([w,p(m)])}return b}function De(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,Le.geoContains)(i,t):yt()(t,i)}function Mt(t,i){var r={type:"Polygon",coordinates:t},n=Pe((0,Le.geoBounds)(r),2),a=Pe(n[0],2),e=a[0],o=a[1],s=Pe(n[1],2),h=s[0],p=s[1];if(Math.min(Math.abs(h-e),Math.abs(p-o))<i)return[];var d=e>h||p>=89||o<=-89;return _t(i,{minLng:e,maxLng:h,minLat:o,maxLat:p}).filter(function(g){return De(g,r,d)})}function xt(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.resolution,n=r===void 0?1/0:r,a=wt(t,n),e=(0,je.merge)(a),o=Mt(t,n),s=I(e).concat(I(o)),h={type:"Polygon",coordinates:t},p=Pe((0,Le.geoBounds)(h),2),d=Pe(p[0],2),g=d[0],y=d[1],b=Pe(p[1],2),m=b[0],w=b[1],u=g>m||w>=89||y<=-89,O=[];if(u){var _=(0,bt.geoVoronoi)(s).triangles(),D=new Map(s.map(function(ne,Me){var be=Pe(ne,2),_e=be[0],Ee=be[1];return["".concat(_e,"-").concat(Ee),Me]}));_.features.forEach(function(ne){var Me,be=ne.geometry.coordinates[0].slice(0,3).reverse(),_e=[];if(be.forEach(function(Te){var Se=Pe(Te,2),Ie=Se[0],Ct=Se[1],tt="".concat(Ie,"-").concat(Ct);D.has(tt)&&_e.push(D.get(tt))}),_e.length===3){if(_e.some(function(Te){return Te<e.length})){var Ee=ne.properties.circumcenter;if(!De(Ee,h,u))return}(Me=O).push.apply(Me,I(_e))}})}else if(o.length)for(var fe=function(ne,Me){var be,_e=[2,1,0].map(function(Se){return de.triangles[ne+Se]}),Ee=_e.map(function(Se){return s[Se]});if(_e.some(function(Se){return Se<e.length})){var Te=[0,1].map(function(Se){return(0,je.mean)(Ee,function(Ie){return Ie[Se]})});if(!De(Te,h,u))return"continue"}(be=O).push.apply(be,I(_e))},de=mt().from(s),se=0,ge=de.triangles.length;se<ge;se+=3)fe(se,ge);else{var x=We().flatten(a),oe=x.vertices,me=x.holes,he=me===void 0?[]:me;O=We()(oe,he,2)}var ye=(0,$e.scaleLinear)((0,je.extent)(s,function(ne){return ne[0]}),[0,1]),et=(0,$e.scaleLinear)((0,je.extent)(s,function(ne){return ne[1]}),[0,1]),K=s.map(function(ne){var Me=Pe(ne,2),be=Me[0],_e=Me[1];return[ye(be),et(_e)]}),Re={points:s,indices:O,uvs:K};return{contour:a,triangles:Re}}var At=xt,qe=new c.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function Ue(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=t.map(function(a){return a.map(function(e){var o=Pe(e,2),s=o[0],h=o[1];return r?vt(s,h,i):[s,h,i]})});return We().flatten(n)}function Xe(t,i,r){for(var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=Ue(t,i,n),e=a.vertices,o=a.holes,s=Ue(t,r,n),h=s.vertices,p=(0,je.merge)([h,e]),d=Math.round(h.length/3),g=new Set(o),y=0,b=[],m=0;m<d;m++){var w=m+1;if(w===d)w=y;else if(g.has(w)){var u=w;w=y,y=u}b.push(m,m+d,w+d),b.push(w+d,w,m)}for(var O=[],_=1;_>=0;_--)for(var D=0;D<d;D+=1)O.push(D/(d-1),_);return{indices:b,vertices:p,uvs:O,topVerts:h}}function Ye(t,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?t.indices:t.indices.slice().reverse(),vertices:Ue([t.points],i,a).vertices,uvs:r}}var Pt=function(t){"use strict";C(r,t);var i=V(r);function r(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};k(this,r);var e;e=i.call(this),e.type="PolygonBufferGeometry",e.parameters=(0,j.Z)({},{polygonGeoJson:n,startHeight:0,endHeight:1,closedBottom:!0,closedTop:!0,includeSides:!0,curvatureResolution:5,cartesian:!0,userDataRsoOffset:0},a);var o=e.parameters,s=o.startHeight,h=o.endHeight,p=o.closedBottom,d=o.closedTop,g=o.includeSides,y=o.curvatureResolution,b=o.cartesian,m=o.userDataRsoOffset;pt()(n[0])||n[0].reverse();var w=At(n,{resolution:y}),u=w.contour,O=w.triangles,_=(0,je.merge)(O.uvs),D=[],x=[],oe=[],me=0,he=function(de){var se=Math.round(D.length/3),ge=oe.length;D=D.concat(de.vertices),x=x.concat(de.uvs),oe=oe.concat(se?de.indices.map(function(ye){return ye+se}):de.indices),e.addGroup(ge,oe.length-ge,me++)};if(g){var fe=Xe(u,s,h,b);he(fe),e.userData.rso=m?Xe(u,s,h+m,b):fe}return p&&he(Ye(O,s,_,!1,b)),d&&he(Ye(O,h,_,!0,b)),e.setIndex(oe),e[qe]("position",new c.Float32BufferAttribute(D,3)),e[qe]("uv",new c.Float32BufferAttribute(x,2)),e.computeVertexNormals(),e}return r}(c.BufferGeometry),St=function(t){"use strict";C(r,t);var i=V(r);function r(a){k(this,r);var e;return e=i.call(this),e.options=(0,j.Z)({},{geojson:[[[]]],startHeight:0,height:5,closedBottom:!0,closedTop:!0,curvatureResolution:1,cartesian:!0,userDataRsoOffset:0},a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.startHeight,s=e.height,h=e.closedBottom,p=e.closedTop,d=e.curvatureResolution,g=e.userDataRsoOffset,y=e.cartesian,b=new Pt(this.options.geojson,{startHeight:o,endHeight:o+s,closedBottom:h,closedTop:p,curvatureResolution:d,cartesian:y,userDataRsoOffset:g});this.createMesh(b,this.options.material)},r}(ve),Qe=Y(705);function Je(t){var i=t.split,r=t.depth,n=t.points,a=new c[P](new c.Shape(n),{depth:r,bevelEnabled:!1,UVGenerator:(0,Qe.y)({split:i})});return(0,Qe.C)(),a}var Ot=function(t){"use strict";C(r,t);var i=V(r);function r(a){k(this,r);var e;return e=i.call(this),e.options=L((0,j.Z)({},a),{materialOptions:(0,j.Z)({},{split:.1},a.materialOptions||{})}),e}var n=r.prototype;return n.create=function(){var e=this;return(0,f.Z)(v().mark(function o(){var s,h,p,d,g,y,b,m,w,u,O,_,D,x,oe,me,he,fe,de,se,ge,ye;return v().wrap(function(K){for(;;)switch(K.prev=K.next){case 0:if(s=e.options,h=s.points,p=s.pointsArr,d=s.coordinatesArr,g=s.useGroups,y=s.depth,b=s.material,m=s.materialOptions,w=s.worker,u=s.workerKey,O=s.projection,_=s.cache,D=0,x=b,!(!b&&m)){K.next=23;break}if(D=m.split,oe=m.topColor,me=m.sideColor,he=m.sideMap,fe="ExtrudePolygonMaterial:".concat(me||he).concat(oe||""),!(_&&!_.get(fe))){K.next=13;break}return _.init(fe),K.next=11,e.getMaterial(m);case 11:de=K.sent,_.set(fe,de);case 13:if(!_){K.next=19;break}return K.next=16,_.get(fe);case 16:K.t0=K.sent,K.next=22;break;case 19:return K.next=21,e.getMaterial(m);case 21:K.t0=K.sent;case 22:x=K.t0;case 23:if(se=Array.isArray(y)?y:[y],!h){K.next=28;break}e.createMesh(Je({points:h,depth:se[0],split:D}),b),K.next=34;break;case 28:if(!p){K.next=32;break}ye=He.mergeBufferGeometries(p.map(function(Re,ne){return Je({points:Re,depth:(ge=se[ne])!==null&&ge!==void 0?ge:se[0],split:D})}),g!=null?g:!1),e.createMesh(ye,b),K.next=34;break;case 32:if(!(d&&w)){K.next=34;break}return K.abrupt("return",new Promise(function(Re){w.postMessage({coordinatesArr:d,depth:y,split:D,useGroups:g,projection:O,workerKey:u},function(ne){var Me=new c.BufferGeometry;Object.keys(ne).forEach(function(be){Me.setAttribute(be,new c.BufferAttribute(ne[be].array,ne[be].itemSize))}),e.createMesh(Me,x),Re("")})}));case 34:case"end":return K.stop()}},o)}))()},n.getMaterial=function(e){var o=this,s=e.topColor,h=e.sideColor,p=e.sideMap,d=e.type,g=e.parameters,y=e.createCanvasObjectURL,b=e.split,m=e.maxAnisotropy;return new Promise(function(w){var u=p?document.createElement("img"):{src:"",onload:function(){},width:1024,height:1024};u.onload=function(){var O=b,_=document.createElement("canvas"),D=_.getContext("2d");_.height=u.height/(1-O),_.width=u.width,O&&s&&(D.fillStyle=s,D.fillRect(0,0,u.width,_.height*O)),p&&u instanceof HTMLImageElement?D.drawImage(u,0,_.height*O,u.width,u.height):h&&(D.fillStyle=h,D.fillRect(0,_.height*O,u.width,u.height)),y&&_.toBlob(function(me){console.log(URL.createObjectURL(me))});var x=new c.CanvasTexture(_);x.anisotropy=m||o.pencil.renderer.capabilities.getMaxAnisotropy();var oe=new c[d||"MeshBasicMaterial"]((0,j.Z)({map:x},g||{}));w(oe)},p?u.src=p:u instanceof HTMLImageElement||u.onload()})},n.setMaterialColor=function(e){var o=this;return(0,f.Z)(v().mark(function s(){var h,p,d,g,y,b,m,w,u,O,_;return v().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:if(h=o.options,p=h.materialOptions,d=h.cache,g=p.sideColor,y=p.sideMap,b=p.topColor,m=e.sideColor,w=e.topColor,!(w||m)){x.next=22;break}if(u="ExtrudePolygonMaterial:".concat(m||g||y||"").concat(w||b||""),!(d&&!d.get(u))){x.next=11;break}return d.init(u),x.next=9,o.getMaterial((0,j.Z)({},p,e));case 9:O=x.sent,d.set(u,O);case 11:if(!d){x.next=17;break}return x.next=14,d.get(u);case 14:x.t0=x.sent,x.next=20;break;case 17:return x.next=19,o.getMaterial((0,j.Z)({},p,e));case 19:x.t0=x.sent;case 20:_=x.t0,o.object3d.material=_;case 22:case"end":return x.stop()}},s)}))()},r}(ve)})(),module.exports=Be})();
|
|
132
|
+
`),Ae=function(t){"use strict";C(r,t);var i=V(r);function r(){k(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 c.Matrix4,Object.defineProperties(M(n),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(e){this.setGeometry(e,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(e){this.setPoints(e,this.widthCallback)}}}),n}return r}(c.BufferGeometry);Ae.prototype.setMatrixWorld=function(t){this.matrixWorld=t},Ae.prototype.setGeometry=function(t,i){this._geometry=t,this.setPoints(t.getAttribute("position").array,i)},Ae.prototype.setPoints=function(t,i){if(!(t instanceof Float32Array)&&!(t instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=t,this.widthCallback=i,this.positions=[],this.counters=[],t.length&&t[0]instanceof c.Vector3)for(var r=0;r<t.length;r++){var n=t[r],a=r/t.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<t.length;r+=3){var a=r/t.length;this.positions.push(t[r],t[r+1],t[r+2]),this.positions.push(t[r],t[r+1],t[r+2]),this.counters.push(a),this.counters.push(a)}this.process()};function Fe(t,i){var r=new c.Matrix4,n=new c.Ray,a=new c.Sphere,e=new c.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),a.copy(o.boundingSphere),a.applyMatrix4(this.matrixWorld),t.ray.intersectSphere(a,e)!==!1){r.copy(this.matrixWorld).invert(),n.copy(t.ray).applyMatrix4(r);var s=new c.Vector3,h=new c.Vector3,p=new c.Vector3,d=this instanceof c.LineSegments?2:1,m=o.index,y=o.attributes;if(m!==null)for(var b=m.array,g=y.position.array,w=y.width.array,u=0,O=b.length-1;u<O;u+=d){var _=b[u],D=b[u+1];s.fromArray(g,_*3),h.fromArray(g,D*3);var x=w[Math.floor(u/3)]!==void 0?w[Math.floor(u/3)]:1,oe=t.params.Line.threshold+this.material.lineWidth*x/2,me=oe*oe,he=n.distanceSqToSegment(s,h,e,p);if(!(he>me)){e.applyMatrix4(this.matrixWorld);var fe=t.ray.origin.distanceTo(e);fe<t.near||fe>t.far||(i.push({distance:fe,point:p.clone().applyMatrix4(this.matrixWorld),index:u,face:null,faceIndex:null,object:this}),u=O)}}}}Ae.prototype.raycast=Fe,Ae.prototype.compareV3=function(t,i){var r=t*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]},Ae.prototype.copyV3=function(t){var i=t*6;return[this.positions[i],this.positions[i+1],this.positions[i+2]]},Ae.prototype.process=function(){var t=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var i,r;this.compareV3(0,t-1)?r=this.copyV3(t-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<t;n++){if(this.side.push(1),this.side.push(-1),this.widthCallback?i=this.widthCallback(n/(t-1)):i=1,this.width.push(i),this.width.push(i),this.uvs.push(n/(t-1),0),this.uvs.push(n/(t-1),1),n<t-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(t-1,0)?r=this.copyV3(1):r=this.copyV3(t-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 c.BufferAttribute(new Float32Array(this.positions),3),previous:new c.BufferAttribute(new Float32Array(this.previous),3),next:new c.BufferAttribute(new Float32Array(this.next),3),side:new c.BufferAttribute(new Float32Array(this.side),1),width:new c.BufferAttribute(new Float32Array(this.width),1),uv:new c.BufferAttribute(new Float32Array(this.uvs),2),index:new c.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new c.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 Ge(t,i,r,n,a){var e;if(t=t.subarray||t.slice?t:t.buffer,r=r.subarray||r.slice?r:r.buffer,t=i?t.subarray?t.subarray(i,a&&i+a):t.slice(i,a&&i+a):t,r.set)r.set(t,n);else for(e=0;e<t.length;e++)r[e+n]=t[e];return r}Ae.prototype.advance=function(t){var i=this._attributes.position.array,r=this._attributes.previous.array,n=this._attributes.next.array,a=i.length;Ge(i,0,r,0,a),Ge(i,6,i,0,a-6),i[a-6]=t.x,i[a-5]=t.y,i[a-4]=t.z,i[a-3]=t.x,i[a-2]=t.y,i[a-1]=t.z,Ge(i,6,n,0,a-6),n[a-6]=t.x,n[a-5]=t.y,n[a-4]=t.z,n[a-3]=t.x,n[a-2]=t.y,n[a-1]=t.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},c.ShaderChunk.meshline_vert=nt,c.ShaderChunk.meshline_frag=it;var Ve=function(t){"use strict";C(r,t);var i=V(r);function r(n){k(this,r);var a;return a=i.call(this,{uniforms:Object.assign({},c.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new c.Color(16777215)},opacity:{value:1},resolution:{value:new c.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 c.Vector2(1,1)},offset:{value:new c.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new c.Vector2(0,0)},lightColor:{value:new c.Color(16777215)}}),vertexShader:c.ShaderChunk.meshline_vert,fragmentShader:c.ShaderChunk.meshline_frag}),a.isMeshLineMaterial=!0,a.type="MeshLineMaterial",Object.defineProperties(M(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}(c.ShaderMaterial);Ve.prototype.copy=function(t){return c.ShaderMaterial.prototype.copy.call(this,t),this.lineWidth=t.lineWidth,this.map=t.map,this.useMap=t.useMap,this.alphaMap=t.alphaMap,this.useAlphaMap=t.useAlphaMap,this.color.copy(t.color),this.opacity=t.opacity,this.resolution.copy(t.resolution),this.sizeAttenuation=t.sizeAttenuation,this.dashArray.copy(t.dashArray),this.dashOffset.copy(t.dashOffset),this.dashRatio.copy(t.dashRatio),this.useDash=t.useDash,this.visibility=t.visibility,this.alphaTest=t.alphaTest,this.repeat.copy(t.repeat),this};function at(t,i){if(t==null)return{};var r={},n=Object.keys(t),a,e;for(e=0;e<n.length;e++)a=n[e],!(i.indexOf(a)>=0)&&(r[a]=t[a]);return r}function ot(t,i){if(t==null)return{};var r=at(t,i),n,a;if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);for(a=0;a<e.length;a++)n=e[a],!(i.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,n)||(r[n]=t[n]))}return r}var Ne=require("popmotion"),He=require("three/examples/jsm//utils/BufferGeometryUtils");function Ke(t){var i=t.setPointWidth,r=t.nodes,n=new c.BufferGeometry,a=new Ae;return n.setFromPoints(r),a.setGeometry(n,i),a}var st={color:new c.Color("#ffffff"),lineWidth:3,sizeAttenuation:0},ut=function(t){"use strict";C(r,t);var i=V(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};k(this,r);var e;return e=i.call(this),e.options=(0,j.Z)({},st,a),e}var n=r.prototype;return n.create=function(){var e=this,o=this.options,s=o.duration,h=o.delay,p=o.onComplete,d=o.setPointWidth,m=o.key,y=o.nodes,b=o.nodesArr,g=o.coordinatesArr,w=o.projection,u=o.worker,O=o.workerKey,_=o.useGroups,D=ot(o,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","coordinatesArr","projection","worker","workerKey","useGroups"]),x=this.pencil.getSize(),oe=x.width,me=x.height,he=new Ve(L((0,j.Z)({},D),{resolution:new c.Vector2(oe,me)}));if(this.material=he,y)this.createMesh(Ke({nodes:y,setPointWidth:d}),he);else if(b){var fe=He.mergeBufferGeometries(b.map(function(de){return Ke({nodes:de,setPointWidth:d})}),_!=null?_:!1);this.createMesh(fe,he)}else if(g&&u)return new Promise(function(de){u.postMessage({coordinatesArr:g,projection:w,useGroups:_,workerKey:O},function(se){var ge=new c.BufferGeometry;Object.keys(se).forEach(function(ye){ye==="index"?ge.setIndex(new c.BufferAttribute(se[ye].array,se[ye].itemSize)):ge.setAttribute(ye,new c.BufferAttribute(se[ye].array,se[ye].itemSize))}),e.createMesh(ge,he),de("")})})},n.resize=function(e,o){this.material.uniforms.resolution.value.set(e,o)},n.animate=function(){var e=this.options,o=e.duration,s=e.delay,h=e.onComplete,p=this.material.uniforms.offset,d=s!=null?s:0,m=(0,Ne.animate)({from:p.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-d,repeat:1/0,onComplete:h,ease:Ne.linear,onUpdate:function(y){p.value.x=y.x}});this.tween=m},n.dispose=function(){var e;re(G(r.prototype),"dispose",this).call(this),(e=this.tween)===null||e===void 0||e.stop()},r}(ve);function ct(t){if(Array.isArray(t))return t}function lt(){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 Pe(t,i){return ct(t)||ue(t,i)||F(t,i)||lt()}var je=require("d3-array"),ft=require("earcut"),We=Y.n(ft),ht=require("@turf/boolean-clockwise"),pt=Y.n(ht);function vt(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=(90-i)*Math.PI/180,a=(90-t)*Math.PI/180;return[r*Math.sin(n)*Math.cos(a),r*Math.cos(n),r*Math.sin(n)*Math.sin(a)]}var dt=require("delaunator"),mt=Y.n(dt),gt=require("@turf/boolean-point-in-polygon"),yt=Y.n(gt),Le=require("d3-geo"),bt=require("d3-geo-voronoi"),$e=require("d3-scale");function wt(t,i){return t.map(function(r){var n=[],a;return r.forEach(function(e){if(a){var o=(0,Le.geoDistance)(e,a)*180/Math.PI;if(o>i)for(var s=(0,Le.geoInterpolate)(a,e),h=1/Math.ceil(o/i),p=h;p<1;)n.push(s(p)),p+=h}n.push(a=e)}),n})}function _t(t){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.minLng,n=i.maxLng,a=i.minLat,e=i.maxLat,o=Math.round(Math.pow(360/t,2)/Math.PI),s=(1+Math.sqrt(5))/2,h=function(u){return u/s*360%360-180},p=function(u){return Math.acos(2*u/o-1)/Math.PI*180-90},d=function(u){return o*(Math.cos((u+90)*Math.PI/180)+1)/2},m=[e!==void 0?Math.ceil(d(e)):0,a!==void 0?Math.floor(d(a)):o-1],y=r===void 0&&n===void 0?function(){return!0}:r===void 0?function(u){return u<=n}:n===void 0?function(u){return u>=r}:n>=r?function(u){return u>=r&&u<=n}:function(u){return u>=r||u<=n},b=[],g=m[0];g<=m[1];g++){var w=h(g);y(w)&&b.push([w,p(g)])}return b}function De(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,Le.geoContains)(i,t):yt()(t,i)}function Mt(t,i){var r={type:"Polygon",coordinates:t},n=Pe((0,Le.geoBounds)(r),2),a=Pe(n[0],2),e=a[0],o=a[1],s=Pe(n[1],2),h=s[0],p=s[1];if(Math.min(Math.abs(h-e),Math.abs(p-o))<i)return[];var d=e>h||p>=89||o<=-89;return _t(i,{minLng:e,maxLng:h,minLat:o,maxLat:p}).filter(function(m){return De(m,r,d)})}function xt(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.resolution,n=r===void 0?1/0:r,a=wt(t,n),e=(0,je.merge)(a),o=Mt(t,n),s=I(e).concat(I(o)),h={type:"Polygon",coordinates:t},p=Pe((0,Le.geoBounds)(h),2),d=Pe(p[0],2),m=d[0],y=d[1],b=Pe(p[1],2),g=b[0],w=b[1],u=m>g||w>=89||y<=-89,O=[];if(u){var _=(0,bt.geoVoronoi)(s).triangles(),D=new Map(s.map(function(ne,Me){var be=Pe(ne,2),_e=be[0],Ee=be[1];return["".concat(_e,"-").concat(Ee),Me]}));_.features.forEach(function(ne){var Me,be=ne.geometry.coordinates[0].slice(0,3).reverse(),_e=[];if(be.forEach(function(Te){var Se=Pe(Te,2),Ie=Se[0],Ct=Se[1],tt="".concat(Ie,"-").concat(Ct);D.has(tt)&&_e.push(D.get(tt))}),_e.length===3){if(_e.some(function(Te){return Te<e.length})){var Ee=ne.properties.circumcenter;if(!De(Ee,h,u))return}(Me=O).push.apply(Me,I(_e))}})}else if(o.length)for(var fe=function(ne,Me){var be,_e=[2,1,0].map(function(Se){return de.triangles[ne+Se]}),Ee=_e.map(function(Se){return s[Se]});if(_e.some(function(Se){return Se<e.length})){var Te=[0,1].map(function(Se){return(0,je.mean)(Ee,function(Ie){return Ie[Se]})});if(!De(Te,h,u))return"continue"}(be=O).push.apply(be,I(_e))},de=mt().from(s),se=0,ge=de.triangles.length;se<ge;se+=3)fe(se,ge);else{var x=We().flatten(a),oe=x.vertices,me=x.holes,he=me===void 0?[]:me;O=We()(oe,he,2)}var ye=(0,$e.scaleLinear)((0,je.extent)(s,function(ne){return ne[0]}),[0,1]),et=(0,$e.scaleLinear)((0,je.extent)(s,function(ne){return ne[1]}),[0,1]),K=s.map(function(ne){var Me=Pe(ne,2),be=Me[0],_e=Me[1];return[ye(be),et(_e)]}),Re={points:s,indices:O,uvs:K};return{contour:a,triangles:Re}}var At=xt,qe=new c.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function Ue(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=t.map(function(a){return a.map(function(e){var o=Pe(e,2),s=o[0],h=o[1];return r?vt(s,h,i):[s,h,i]})});return We().flatten(n)}function Xe(t,i,r){for(var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=Ue(t,i,n),e=a.vertices,o=a.holes,s=Ue(t,r,n),h=s.vertices,p=(0,je.merge)([h,e]),d=Math.round(h.length/3),m=new Set(o),y=0,b=[],g=0;g<d;g++){var w=g+1;if(w===d)w=y;else if(m.has(w)){var u=w;w=y,y=u}b.push(g,g+d,w+d),b.push(w+d,w,g)}for(var O=[],_=1;_>=0;_--)for(var D=0;D<d;D+=1)O.push(D/(d-1),_);return{indices:b,vertices:p,uvs:O,topVerts:h}}function Ye(t,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?t.indices:t.indices.slice().reverse(),vertices:Ue([t.points],i,a).vertices,uvs:r}}var Pt=function(t){"use strict";C(r,t);var i=V(r);function r(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};k(this,r);var e;e=i.call(this),e.type="PolygonBufferGeometry",e.parameters=(0,j.Z)({},{polygonGeoJson:n,startHeight:0,endHeight:1,closedBottom:!0,closedTop:!0,includeSides:!0,curvatureResolution:5,cartesian:!0,userDataRsoOffset:0},a);var o=e.parameters,s=o.startHeight,h=o.endHeight,p=o.closedBottom,d=o.closedTop,m=o.includeSides,y=o.curvatureResolution,b=o.cartesian,g=o.userDataRsoOffset;pt()(n[0])||n[0].reverse();var w=At(n,{resolution:y}),u=w.contour,O=w.triangles,_=(0,je.merge)(O.uvs),D=[],x=[],oe=[],me=0,he=function(de){var se=Math.round(D.length/3),ge=oe.length;D=D.concat(de.vertices),x=x.concat(de.uvs),oe=oe.concat(se?de.indices.map(function(ye){return ye+se}):de.indices),e.addGroup(ge,oe.length-ge,me++)};if(m){var fe=Xe(u,s,h,b);he(fe),e.userData.rso=g?Xe(u,s,h+g,b):fe}return p&&he(Ye(O,s,_,!1,b)),d&&he(Ye(O,h,_,!0,b)),e.setIndex(oe),e[qe]("position",new c.Float32BufferAttribute(D,3)),e[qe]("uv",new c.Float32BufferAttribute(x,2)),e.computeVertexNormals(),e}return r}(c.BufferGeometry),St=function(t){"use strict";C(r,t);var i=V(r);function r(a){k(this,r);var e;return e=i.call(this),e.options=(0,j.Z)({},{geojson:[[[]]],startHeight:0,height:5,closedBottom:!0,closedTop:!0,curvatureResolution:1,cartesian:!0,userDataRsoOffset:0},a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.startHeight,s=e.height,h=e.closedBottom,p=e.closedTop,d=e.curvatureResolution,m=e.userDataRsoOffset,y=e.cartesian,b=new Pt(this.options.geojson,{startHeight:o,endHeight:o+s,closedBottom:h,closedTop:p,curvatureResolution:d,cartesian:y,userDataRsoOffset:m});this.createMesh(b,this.options.material)},r}(ve),Qe=Y(705);function Je(t){var i=t.split,r=t.depth,n=t.points,a=new c[P](new c.Shape(n),{depth:r,bevelEnabled:!1,UVGenerator:(0,Qe.y)({split:i})});return(0,Qe.C)(),a}var Ot=function(t){"use strict";C(r,t);var i=V(r);function r(a){k(this,r);var e;return e=i.call(this),e.options=L((0,j.Z)({},a),{materialOptions:(0,j.Z)({},{split:.1},a.materialOptions||{})}),e}var n=r.prototype;return n.create=function(){var e=this;return(0,f.Z)(v().mark(function o(){var s,h,p,d,m,y,b,g,w,u,O,_,D,x,oe,me,he,fe,de,se,ge,ye;return v().wrap(function(K){for(;;)switch(K.prev=K.next){case 0:if(s=e.options,h=s.points,p=s.pointsArr,d=s.coordinatesArr,m=s.useGroups,y=s.depth,b=s.material,g=s.materialOptions,w=s.worker,u=s.workerKey,O=s.projection,_=s.cache,D=0,x=b,!(!b&&g)){K.next=23;break}if(D=g.split,oe=g.topColor,me=g.sideColor,he=g.sideMap,fe="ExtrudePolygonMaterial:".concat(me||he).concat(oe||""),!(_&&!_.get(fe))){K.next=13;break}return _.init(fe),K.next=11,e.getMaterial(g);case 11:de=K.sent,_.set(fe,de);case 13:if(!_){K.next=19;break}return K.next=16,_.get(fe);case 16:K.t0=K.sent,K.next=22;break;case 19:return K.next=21,e.getMaterial(g);case 21:K.t0=K.sent;case 22:x=K.t0;case 23:if(se=Array.isArray(y)?y:[y],!h){K.next=28;break}e.createMesh(Je({points:h,depth:se[0],split:D}),b),K.next=34;break;case 28:if(!p){K.next=32;break}ye=He.mergeBufferGeometries(p.map(function(Re,ne){return Je({points:Re,depth:(ge=se[ne])!==null&&ge!==void 0?ge:se[0],split:D})}),m!=null?m:!1),e.createMesh(ye,b),K.next=34;break;case 32:if(!(d&&w)){K.next=34;break}return K.abrupt("return",new Promise(function(Re){w.postMessage({coordinatesArr:d,depth:y,split:D,useGroups:m,projection:O,workerKey:u},function(ne){var Me=new c.BufferGeometry;Object.keys(ne).forEach(function(be){Me.setAttribute(be,new c.BufferAttribute(ne[be].array,ne[be].itemSize))}),e.createMesh(Me,x),Re("")})}));case 34:case"end":return K.stop()}},o)}))()},n.getMaterial=function(e){var o=this,s=e.topColor,h=e.sideColor,p=e.sideMap,d=e.type,m=e.parameters,y=e.createCanvasObjectURL,b=e.split,g=e.maxAnisotropy;return new Promise(function(w){var u=p?document.createElement("img"):{src:"",onload:function(){},width:1024,height:1024};u.onload=function(){var O=b,_=document.createElement("canvas"),D=_.getContext("2d");_.height=u.height/(1-O),_.width=u.width,O&&s&&(D.fillStyle=s,D.fillRect(0,0,u.width,_.height*O)),p&&u instanceof HTMLImageElement?D.drawImage(u,0,_.height*O,u.width,u.height):h&&(D.fillStyle=h,D.fillRect(0,_.height*O,u.width,u.height)),y&&_.toBlob(function(me){console.log(URL.createObjectURL(me))});var x=new c.CanvasTexture(_);x.anisotropy=g||o.pencil.renderer.capabilities.getMaxAnisotropy();var oe=new c[d||"MeshBasicMaterial"]((0,j.Z)({map:x},m||{}));w(oe)},p?u.src=p:u instanceof HTMLImageElement||u.onload()})},n.setMaterialColor=function(e){var o=this;return(0,f.Z)(v().mark(function s(){var h,p,d,m,y,b,g,w,u,O,_;return v().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:if(h=o.options,p=h.materialOptions,d=h.cache,m=p.sideColor,y=p.sideMap,b=p.topColor,g=e.sideColor,w=e.topColor,!(w||g)){x.next=22;break}if(u="ExtrudePolygonMaterial:".concat(g||m||y||"").concat(w||b||""),!(d&&!d.get(u))){x.next=11;break}return d.init(u),x.next=9,o.getMaterial((0,j.Z)({},p,e));case 9:O=x.sent,d.set(u,O);case 11:if(!d){x.next=17;break}return x.next=14,d.get(u);case 14:x.t0=x.sent,x.next=20;break;case 17:return x.next=19,o.getMaterial((0,j.Z)({},p,e));case 19:x.t0=x.sent;case 20:_=x.t0,o.object3d.material=_;case 22:case"end":return x.stop()}},s)}))()},r}(ve)})(),module.exports=Be})();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import*as it from"idb-keyval";import*as It from"three";import*as Zt from"three/examples/jsm/renderers/CSS2DRenderer";import*as at from"three/examples/jsm/renderers/CSS3DRenderer";import*as ot from"popmotion";import*as Ft from"three/examples/jsm//utils/BufferGeometryUtils";import*as Fe from"d3-array";import*as Kt from"earcut";import*as Xt from"@turf/boolean-clockwise";import*as Ht from"delaunator";import*as $t from"@turf/boolean-point-in-polygon";import*as De from"d3-geo";import*as Yt from"d3-geo-voronoi";import*as Jt from"d3-scale";var Qt={666:function(k){var R=function(A){"use strict";var C=Object.prototype,M=C.hasOwnProperty,T,L=typeof Symbol=="function"?Symbol:{},z=L.iterator||"@@iterator",Z=L.asyncIterator||"@@asyncIterator",S=L.toStringTag||"@@toStringTag";function B(h,l,v){return Object.defineProperty(h,l,{value:v,enumerable:!0,configurable:!0,writable:!0}),h[l]}try{B({},"")}catch(h){B=function(l,v,O){return l[v]=O}}function K(h,l,v,O){var w=l&&l.prototype instanceof Q?l:Q,J=Object.create(w.prototype),V=new ce(O||[]);return J._invoke=ye(h,v,V),J}A.wrap=K;function X(h,l,v){try{return{type:"normal",arg:h.call(l,v)}}catch(O){return{type:"throw",arg:O}}}var D="suspendedStart",c="suspendedYield",he="executing",re="completed",W={};function Q(){}function j(){}function G(){}var q={};B(q,z,function(){return this});var ne=Object.getPrototypeOf,ee=ne&&ne(ne(Oe([])));ee&&ee!==C&&M.call(ee,z)&&(q=ee);var F=G.prototype=Q.prototype=Object.create(q);j.prototype=G,B(F,"constructor",G),B(G,"constructor",j),j.displayName=B(G,S,"GeneratorFunction");function I(h){["next","throw","return"].forEach(function(l){B(h,l,function(v){return this._invoke(l,v)})})}A.isGeneratorFunction=function(h){var l=typeof h=="function"&&h.constructor;return l?l===j||(l.displayName||l.name)==="GeneratorFunction":!1},A.mark=function(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,G):(h.__proto__=G,B(h,S,"GeneratorFunction")),h.prototype=Object.create(F),h},A.awrap=function(h){return{__await:h}};function te(h,l){function v(J,V,ae,pe){var oe=X(h[J],h,V);if(oe.type==="throw")pe(oe.arg);else{var ke=oe.arg,Ee=ke.value;return Ee&&typeof Ee=="object"&&M.call(Ee,"__await")?l.resolve(Ee.__await).then(function(be){v("next",be,ae,pe)},function(be){v("throw",be,ae,pe)}):l.resolve(Ee).then(function(be){ke.value=be,ae(ke)},function(be){return v("throw",be,ae,pe)})}}var O;function w(J,V){function ae(){return new l(function(pe,oe){v(J,V,pe,oe)})}return O=O?O.then(ae,ae):ae()}this._invoke=w}I(te.prototype),B(te.prototype,Z,function(){return this}),A.AsyncIterator=te,A.async=function(h,l,v,O,w){w===void 0&&(w=Promise);var J=new te(K(h,l,v,O),w);return A.isGeneratorFunction(l)?J:J.next().then(function(V){return V.done?V.value:J.next()})};function ye(h,l,v){var O=D;return function(J,V){if(O===he)throw new Error("Generator is already running");if(O===re){if(J==="throw")throw V;return je()}for(v.method=J,v.arg=V;;){var ae=v.delegate;if(ae){var pe=xe(ae,v);if(pe){if(pe===W)continue;return pe}}if(v.method==="next")v.sent=v._sent=v.arg;else if(v.method==="throw"){if(O===D)throw O=re,v.arg;v.dispatchException(v.arg)}else v.method==="return"&&v.abrupt("return",v.arg);O=he;var oe=X(h,l,v);if(oe.type==="normal"){if(O=v.done?re:c,oe.arg===W)continue;return{value:oe.arg,done:v.done}}else oe.type==="throw"&&(O=re,v.method="throw",v.arg=oe.arg)}}}function xe(h,l){var v=h.iterator[l.method];if(v===T){if(l.delegate=null,l.method==="throw"){if(h.iterator.return&&(l.method="return",l.arg=T,xe(h,l),l.method==="throw"))return W;l.method="throw",l.arg=new TypeError("The iterator does not provide a 'throw' method")}return W}var O=X(v,h.iterator,l.arg);if(O.type==="throw")return l.method="throw",l.arg=O.arg,l.delegate=null,W;var w=O.arg;if(!w)return l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,W;if(w.done)l[h.resultName]=w.value,l.next=h.nextLoc,l.method!=="return"&&(l.method="next",l.arg=T);else return w;return l.delegate=null,W}I(F),B(F,S,"Generator"),B(F,z,function(){return this}),B(F,"toString",function(){return"[object Generator]"});function Y(h){var l={tryLoc:h[0]};1 in h&&(l.catchLoc=h[1]),2 in h&&(l.finallyLoc=h[2],l.afterLoc=h[3]),this.tryEntries.push(l)}function $(h){var l=h.completion||{};l.type="normal",delete l.arg,h.completion=l}function ce(h){this.tryEntries=[{tryLoc:"root"}],h.forEach(Y,this),this.reset(!0)}A.keys=function(h){var l=[];for(var v in h)l.push(v);return l.reverse(),function O(){for(;l.length;){var w=l.pop();if(w in h)return O.value=w,O.done=!1,O}return O.done=!0,O}};function Oe(h){if(h){var l=h[z];if(l)return l.call(h);if(typeof h.next=="function")return h;if(!isNaN(h.length)){var v=-1,O=function w(){for(;++v<h.length;)if(M.call(h,v))return w.value=h[v],w.done=!1,w;return w.value=T,w.done=!0,w};return O.next=O}}return{next:je}}A.values=Oe;function je(){return{value:T,done:!0}}return ce.prototype={constructor:ce,reset:function(h){if(this.prev=0,this.next=0,this.sent=this._sent=T,this.done=!1,this.delegate=null,this.method="next",this.arg=T,this.tryEntries.forEach($),!h)for(var l in this)l.charAt(0)==="t"&&M.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=T)},stop:function(){this.done=!0;var h=this.tryEntries[0],l=h.completion;if(l.type==="throw")throw l.arg;return this.rval},dispatchException:function(h){if(this.done)throw h;var l=this;function v(pe,oe){return J.type="throw",J.arg=h,l.next=pe,oe&&(l.method="next",l.arg=T),!!oe}for(var O=this.tryEntries.length-1;O>=0;--O){var w=this.tryEntries[O],J=w.completion;if(w.tryLoc==="root")return v("end");if(w.tryLoc<=this.prev){var V=M.call(w,"catchLoc"),ae=M.call(w,"finallyLoc");if(V&&ae){if(this.prev<w.catchLoc)return v(w.catchLoc,!0);if(this.prev<w.finallyLoc)return v(w.finallyLoc)}else if(V){if(this.prev<w.catchLoc)return v(w.catchLoc,!0)}else if(ae){if(this.prev<w.finallyLoc)return v(w.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(h,l){for(var v=this.tryEntries.length-1;v>=0;--v){var O=this.tryEntries[v];if(O.tryLoc<=this.prev&&M.call(O,"finallyLoc")&&this.prev<O.finallyLoc){var w=O;break}}w&&(h==="break"||h==="continue")&&w.tryLoc<=l&&l<=w.finallyLoc&&(w=null);var J=w?w.completion:{};return J.type=h,J.arg=l,w?(this.method="next",this.next=w.finallyLoc,W):this.complete(J)},complete:function(h,l){if(h.type==="throw")throw h.arg;return h.type==="break"||h.type==="continue"?this.next=h.arg:h.type==="return"?(this.rval=this.arg=h.arg,this.method="return",this.next="end"):h.type==="normal"&&l&&(this.next=l),W},finish:function(h){for(var l=this.tryEntries.length-1;l>=0;--l){var v=this.tryEntries[l];if(v.finallyLoc===h)return this.complete(v.completion,v.afterLoc),$(v),W}},catch:function(h){for(var l=this.tryEntries.length-1;l>=0;--l){var v=this.tryEntries[l];if(v.tryLoc===h){var O=v.completion;if(O.type==="throw"){var w=O.arg;$(v)}return w}}throw new Error("illegal catch attempt")},delegateYield:function(h,l,v){return this.delegate={iterator:Oe(h),resultName:l,nextLoc:v},this.method==="next"&&(this.arg=T),W}},A}(k.exports);try{regeneratorRuntime=R}catch(A){typeof globalThis=="object"?globalThis.regeneratorRuntime=R:Function("r","regeneratorRuntime = r")(R)}},695:function(k,R,A){A.d(R,{Z:function(){return C}});function C(M){if(M.geometry&&M.geometry.dispose(),M.material){var T=Array.isArray(M.material)?M.material:[M.material];T.forEach(function(L){var z,Z,S,B,K,X,D,c,he,re,W,Q,j;(z=L.map)===null||z===void 0||z.dispose(),(Z=L.lightMap)===null||Z===void 0||Z.dispose(),(S=L.bumpMap)===null||S===void 0||S.dispose(),(B=L.normalMap)===null||B===void 0||B.dispose(),(K=L.specularMap)===null||K===void 0||K.dispose(),(X=L.envMap)===null||X===void 0||X.dispose(),(D=L.alphaMap)===null||D===void 0||D.dispose(),(c=L.aoMap)===null||c===void 0||c.dispose(),(he=L.displacementMap)===null||he===void 0||he.dispose(),(re=L.emissiveMap)===null||re===void 0||re.dispose(),(W=L.gradientMap)===null||W===void 0||W.dispose(),(Q=L.metalnessMap)===null||Q===void 0||Q.dispose(),(j=L.roughnessMap)===null||j===void 0||j.dispose(),L.dispose()})}}},584:function(k,R,A){A.d(R,{wf:function(){return L.Z}});var C=A(666),M=A.n(C),T=null,L=A(695),z=A(949);function Z(W){if(W.material){var Q=Array.isArray(W.material)?W.material:[W.material];Q.forEach(function(j){var G,q;(G=j.color)===null||G===void 0||G.convertSRGBToLinear(),(q=j.emissive)===null||q===void 0||q.convertSRGBToLinear(),j.map&&(j.map.encoding=THREE.sRGBEncoding),j.emissiveMap&&(j.emissiveMap.encoding=THREE.sRGBEncoding)})}}var S=A(568),B=A(924),K=A(77),X=A(484),D=null,c=null,he=function(){var W=(0,S.Z)(M().mark(function Q(j,G){var q,ne,ee,F,I,te,ye,xe,Y;return M().wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return q=G.type,ne=q===void 0?"blob":q,ee=G.version,F=ee===void 0?"1":ee,ce.next=4,(0,K.get)(j);case 4:if(te=ce.sent,!(te&&te[F])){ce.next=9;break}I=te[F],ce.next=15;break;case 9:return ce.next=11,(0,X.Z)(fetch(j).then(function(Oe){if(Oe.ok)return Oe[ne]();throw new Error}));case 11:ye=ce.sent,xe=ye.res,Y=ye.err,Y||(I=xe,(0,K.set)(j,(0,B.Z)({},F,xe)));case 15:return ce.abrupt("return",I?{url:ne==="json"?j:URL.createObjectURL(I),store:I}:{url:j});case 16:case"end":return ce.stop()}},Q)}));return function(j,G){return W.apply(this,arguments)}}(),re=A(705)},484:function(k,R,A){A.d(R,{Z:function(){return M}});var C=A(42);function M(T){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return T.then(function(z){return(0,C.Z)({err:null,res:z},L)}).catch(function(z){return(0,C.Z)({err:z,res:void 0},L)})}},705:function(k,R,A){A.d(R,{C:function(){return L},y:function(){return T}});var C=A(949),M=new Map,T=function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(Z,S,B,K,X){var D=S[B*3],c=S[B*3+1],he=S[K*3],re=S[K*3+1],W=S[X*3],Q=S[X*3+1],j;if(M.has(Z))j=M.get(Z);else{var G=z.box3||new C.Box3;if(!z.box3){var q=Z.parameters.shapes.getPoints();G.setFromArray(q.map(function(te){return[te.x,te.y,0]}).flat())}var ne=G.getSize(new C.Vector3);z.split&&(ne.y/=z.split),j={box:G,size:ne},M.set(Z,j)}var ee=j.box,F=j.size,I=z.split?1-z.split:0;return[new C.Vector2((D-ee.min.x)/F.x,(c-ee.min.y)/F.y+I),new C.Vector2((he-ee.min.x)/F.x,(re-ee.min.y)/F.y+I),new C.Vector2((W-ee.min.x)/F.x,(Q-ee.min.y)/F.y+I)]},generateSideWallUV:function(Z,S,B,K,X,D){var c=S[B*3],he=S[B*3+1],re=S[B*3+2],W=S[K*3],Q=S[K*3+1],j=S[K*3+2],G=S[X*3],q=S[X*3+1],ne=S[X*3+2],ee=S[D*3],F=S[D*3+1],I=S[D*3+2],te;if(M.has(S))te=M.get(S);else{var ye=new C.Box3;ye.setFromArray(S);var xe=ye.getSize(new C.Vector3);z.split&&(xe.z/=1-z.split),te={box:ye,size:xe},M.set(S,te)}var Y=te.box,$=te.size;return Math.abs(he-Q)<Math.abs(c-W)?[new C.Vector2((c-Y.min.x)/$.x,(re-Y.min.z)/$.z),new C.Vector2((W-Y.min.x)/$.x,(j-Y.min.z)/$.z),new C.Vector2((G-Y.min.x)/$.x,(ne-Y.min.z)/$.z),new C.Vector2((ee-Y.min.x)/$.x,(I-Y.min.z)/$.z)]:[new C.Vector2((he-Y.min.y)/$.y,(re-Y.min.z)/$.z),new C.Vector2((Q-Y.min.y)/$.y,(j-Y.min.z)/$.z),new C.Vector2((q-Y.min.y)/$.y,(ne-Y.min.z)/$.z),new C.Vector2((F-Y.min.y)/$.y,(I-Y.min.z)/$.z)]}}},L=function(){M.clear()}},77:function(k,R,A){var C=T=>{var L={};return A.d(L,T),L},M=T=>()=>T;k.exports=C({get:()=>it.get,set:()=>it.set})},949:function(k){var R=C=>{var M={};return N.d(M,C),M},A=C=>()=>C;k.exports=It},568:function(k,R,A){A.d(R,{Z:function(){return M}});function C(T,L,z,Z,S,B,K){try{var X=T[B](K),D=X.value}catch(c){z(c);return}X.done?L(D):Promise.resolve(D).then(Z,S)}function M(T){return function(){var L=this,z=arguments;return new Promise(function(Z,S){var B=T.apply(L,z);function K(D){C(B,Z,S,K,X,"next",D)}function X(D){C(B,Z,S,K,X,"throw",D)}K(void 0)})}}},924:function(k,R,A){A.d(R,{Z:function(){return C}});function C(M,T,L){return T in M?Object.defineProperty(M,T,{value:L,enumerable:!0,configurable:!0,writable:!0}):M[T]=L,M}},42:function(k,R,A){A.d(R,{Z:function(){return M}});var C=A(924);function M(T){for(var L=1;L<arguments.length;L++){var z=arguments[L]!=null?arguments[L]:{},Z=Object.keys(z);typeof Object.getOwnPropertySymbols=="function"&&(Z=Z.concat(Object.getOwnPropertySymbols(z).filter(function(S){return Object.getOwnPropertyDescriptor(z,S).enumerable}))),Z.forEach(function(S){(0,C.Z)(T,S,z[S])})}return T}}},st={};function N(k){var R=st[k];if(R!==void 0)return R.exports;var A=st[k]={exports:{}};return Qt[k](A,A.exports,N),A.exports}(function(){N.n=function(k){var R=k&&k.__esModule?function(){return k.default}:function(){return k};return N.d(R,{a:R}),R}})(),function(){N.d=function(k,R){for(var A in R)N.o(R,A)&&!N.o(k,A)&&Object.defineProperty(k,A,{enumerable:!0,get:R[A]})}}(),function(){N.o=function(k,R){return Object.prototype.hasOwnProperty.call(k,R)}}();var Ae={};(function(){N.d(Ae,{Ei:function(){return Vt},Yo:function(){return Ut},Ee:function(){return ke},x1:function(){return _t},VJ:function(){return Pe},r7:function(){return Ve},XA:function(){return Ke},NB:function(){return lt},xv:function(){return O},nk:function(){return ut}});function k(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function R(e,n){return R=Object.setPrototypeOf||function(i,a){return i.__proto__=a,i},R(e,n)}function A(e,n){return R(e,n)}function C(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&&A(e,n)}var M=N(42);function T(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 L(e,n){return n=n!=null?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}),e}function z(){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 Z(e){return Z=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Z(e)}function S(e){return Z(e)}function B(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function K(e){return e&&e.constructor===Symbol?"symbol":typeof e}function X(e,n){return n&&(K(n)==="object"||typeof n=="function")?n:B(e)}function D(e){var n=z();return function(){var i=S(e),a;if(n){var t=S(this).constructor;a=Reflect.construct(i,arguments,t)}else a=i.apply(this,arguments);return X(this,a)}}var c=N(949);function he(){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 re(e,n,r){return he()?re=Reflect.construct:re=function(a,t,o){var s=[null];s.push.apply(s,t);var f=Function.bind.apply(a,s),p=new f;return o&&A(p,o.prototype),p},re.apply(null,arguments)}function W(e,n,r){return re.apply(null,arguments)}function Q(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 j(e,n,r){return n&&Q(e.prototype,n),r&&Q(e,r),e}function G(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 q(e){if(Array.isArray(e))return G(e)}function ne(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ee(){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 F(e,n){if(!!e){if(typeof e=="string")return G(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 G(e,n)}}function I(e){return q(e)||ne(e)||F(e)||ee()}var te=N(484);function ye(){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,te.Z)(r.promise,n)),r}var xe=e=>{var n={};return N.d(n,e),n},Y=e=>()=>e,$=xe({CSS2DObject:()=>Zt.CSS2DObject}),ce=e=>{var n={};return N.d(n,e),n},Oe=e=>()=>e,je=ce({CSS3DObject:()=>at.CSS3DObject,CSS3DSprite:()=>at.CSS3DSprite}),h=N(584),l=function(e){e&&((0,h.wf)(e),e.children.forEach(function(n){n.userData.BaseObject_||l(n)}))},v=function(){"use strict";function e(){k(this,e),this.objecttype__="BaseObject",this.userData={},this.pm=ye(),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=W(c.Mesh,I(a)),this},n.createGroup=function(){return this.object3d=new c.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=W(c.Points,I(a)),this},n.createCSS2DObject=function(i){return this.object3d=new $.CSS2DObject(i),this},n.createCSS3DObject=function(i){return this.object3d=new je.CSS3DObject(i),this},n.createCSS3DSprite=function(i){return this.object3d=new je.CSS3DSprite(i),this},n.createSprite=function(i){return this.object3d=new c.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,I(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,I(a)),this},n.getSize=function(){var i=new c.Box3().setFromObject(this.object3d);return{min:i.min,max:i.max,size:i.getSize(new c.Vector3)}},n.traverse=function(i){i(this),this.children.forEach(function(a){a.traverse(i)})},n.dispose=function(){l(this.object3d)},j(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}(),O=function(e){"use strict";C(r,e);var n=D(r);function r(a){k(this,r);var t;return t=n.call(this),t.width=0,t.canvas=document.createElement("canvas"),t.options=(0,M.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,s=t.lookAt,f=t.sprite,p=t.text,d=t.sizeAttenuation;if(f){var g=new c.Sprite(new c.SpriteMaterial({transparent:!0,sizeAttenuation:d}));this.object3d=g}else{var _=new c.MeshBasicMaterial({side:c.DoubleSide,transparent:!0}),y=new c.PlaneGeometry(1,1,1,1);this.createMesh(y,_)}this.object3d.position.copy(o),s&&this.object3d.lookAt(s),this.setText(p)},i.setText=function(t,o){var s=(0,M.Z)(L((0,M.Z)({},this.options),{text:t}),o||{}),f=s.text,p=s.fontSize,d=s.fontFamily,g=s.fontWeight,_=s.flipX,y=s.scale,m=this.canvas;m.width=p*f.length*2,m.height=p;var b=m.getContext("2d");b.font="".concat(g," ").concat(p,"px/1 ").concat(d);var u=b.measureText(f).width;m.width=u,this.width=u,b=m.getContext("2d"),b.clearRect(0,0,m.width,m.height),_&&b.scale(-1,1),b.font="".concat(g," ").concat(p,"px/1 ").concat(d),b.textBaseline="middle",b.fillStyle="#ffffff",b.fillText(f,_?u*-1:0,m.height/2),b.restore();var E=new c.Texture(m);E.anisotropy=16,E.needsUpdate=!0;var x=this.object3d;x.material.map&&x.material.map.dispose(),x.material.map=E,x.material.needsUpdate=!0,x.scale.set(E.image.width*y,E.image.height*y,1)},r}(v),w=N(568),J=N(666),V=N.n(J),ae=+c.REVISION<144,pe=ae?"ExtrudeBufferGeometry":"ExtrudeGeometry",oe=ae?"PlaneBufferGeometry":"PlaneGeometry",ke=function(e){"use strict";C(r,e);var n=D(r);function r(a){k(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,w.Z)(V().mark(function o(){var s,f,p,d,g,_,y,m,b,u;return V().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return s=t.options,f=s.transparent,p=s.blending,d=s.src,g=s.depthWrite,_=s.alphaTest,y=s.sprite,m=s.sizeAttenuation,x.next=3,new c.TextureLoader().loadAsync(d);case 3:return b=x.sent,u=y?new c.SpriteMaterial({map:b,transparent:f!=null?f:!1,blending:p!=null?p:c.NormalBlending,depthWrite:g!=null?g:!0,alphaTest:_!=null?_:0,sizeAttenuation:m!=null?m:!0}):new c.MeshBasicMaterial({map:b,transparent:f!=null?f:!1,blending:p!=null?p:c.NormalBlending,depthWrite:g!=null?g:!0,alphaTest:_!=null?_:0}),x.abrupt("return",u);case 6:case"end":return x.stop()}},o)}))()},i.create=function(){var t=this;return(0,w.Z)(V().mark(function o(){var s,f,p,d,g,_,y,m;return V().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(s=t.options,f=s.scale,p=s.position,d=s.src,g=s.cache,_=s.sprite,!(g&&!g.get(d))){u.next=7;break}return g.init(d),u.next=5,t.getMaterial();case 5:y=u.sent,g.set(d,y);case 7:if(!g){u.next=13;break}return u.next=10,g.get(d);case 10:u.t0=u.sent,u.next=16;break;case 13:return u.next=15,t.getMaterial();case 15:u.t0=u.sent;case 16:m=u.t0,t.texture=m.map,_?t.createSprite(m):t.createMesh(new c[oe](1,1),m),f&&t.setScale(f),p&&t.object3d.position.copy(p);case 21:case"end":return u.stop()}},o)}))()},i.setScale=function(t){this.object3d.scale.set(this.texture.image.width*t,this.texture.image.height*t,1)},r}(v);function Ee(e,n){for(;!Object.prototype.hasOwnProperty.call(e,n)&&(e=S(e),e!==null););return e}function be(e,n,r){return typeof Reflect!="undefined"&&Reflect.get?be=Reflect.get:be=function(a,t,o){var s=Ee(a,t);if(!!s){var f=Object.getOwnPropertyDescriptor(s,t);return f.get?f.get.call(o||a):f.value}},be(e,n,r)}function We(e,n,r){return be(e,n,r)}var ut=function(e){"use strict";C(r,e);var n=D(r);function r(a){k(this,r);var t;return t=n.call(this),t.options=(0,M.Z)({},{autoPlay:!0,loop:!0},a),t}var i=r.prototype;return i.getMaterial=function(){var t=this.options,o=t.src,s=t.transparent,f=t.blending,p=t.depthWrite,d=t.format,g=t.autoPlay,_=t.loop,y=t.alphaTest,m=t.sprite,b=ye(),u=document.createElement("video");return u.addEventListener("loadedmetadata",function(){var E=new c.VideoTexture(u);E.format=d!=null?d:c.RGBAFormat,E.needsUpdate=!0;var x=m?new c.SpriteMaterial({map:E,transparent:s!=null?s:!1,blending:f!=null?f:c.NormalBlending,depthWrite:p!=null?p:!0,alphaTest:y!=null?y:0}):new c.MeshBasicMaterial({map:E,transparent:s!=null?s:!1,blending:f!=null?f:c.NormalBlending,depthWrite:p!=null?p:!0,alphaTest:y!=null?y:0});b.resolve(x)},!1),u.src=o,u.muted=!0,u.autoplay=g,u.loop=_,u.preload="auto",b.promise},i.create=function(){var t=this;return(0,w.Z)(V().mark(function o(){var s,f,p,d,g,_,y,m;return V().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(s=t.options,f=s.scale,p=s.position,d=s.src,g=s.cache,_=s.sprite,!(g&&!g.get(d))){u.next=7;break}return g.init(d),u.next=5,t.getMaterial();case 5:y=u.sent,g.set(d,y);case 7:if(!g){u.next=13;break}return u.next=10,g.get(d);case 10:u.t0=u.sent,u.next=16;break;case 13:return u.next=15,t.getMaterial();case 15:u.t0=u.sent;case 16:m=u.t0,t.video=m.map.image,_?t.createSprite(m):t.createMesh(new c[oe](1,1),m),f&&t.setScale(f),p&&t.object3d.position.copy(p);case 21:case"end":return u.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(),We(S(r.prototype),"dispose",this).call(this)},r}(v),ct=function(e){"use strict";C(r,e);var n=D(r);function r(a){k(this,r);var t;return t=n.call(this),t.options=(0,M.Z)({},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.position,s=t.children,f=t.onClick,p=t.zIndexFix,d=document.createElement("div");this.element=d,d.appendChild(s),this.createCSS2DObject(d),o&&this.object3d.position.copy(o),f&&this.clickTarge.forEach(function(g){g.addEventListener("click",f)}),p&&(this.object3d.userData.zIndexFix=p)},i.getMaterial=function(t){return(0,w.Z)(V().mark(function o(){var s,f,p,d;return V().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return s=document.createElement("canvas"),s.width=256,s.height=256,f=s.getContext("2d"),f.fillStyle="#ff0000",f.fillRect(0,0,256,256),p=new c.CanvasTexture(s),d=new c.SpriteMaterial({map:p,opacity:t?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),_.abrupt("return",d);case 9:case"end":return _.stop()}},o)}))()},i.createPickObject=function(t){var o=t.show,s=o===void 0?!1:o,f=t.scale,p=f===void 0?new c.Vector3(1,1,1):f,d=t.position,g=d===void 0?new c.Vector3(0,0,0):d,_=t.cache,y=this;return(0,w.Z)(V().mark(function m(){var b,u,E,x;return V().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:if(b="node-create-pick-object",!(_&&!_.get(b))){P.next=7;break}return _.init(b),P.next=5,y.getMaterial(s);case 5:u=P.sent,_.set(b,u);case 7:if(!_){P.next=13;break}return P.next=10,_.get(b);case 10:P.t0=P.sent,P.next=16;break;case 13:return P.next=15,y.getMaterial(s);case 15:P.t0=P.sent;case 16:E=P.t0,x=new c.Sprite(E),x.scale.set(E.map.image.width*p.x,E.map.image.height*p.y,1),x.position.copy(g),y.add(x),y.pickObject=x;case 22:case"end":return P.stop()}},m)}))()},i.dispose=function(){var t=this.options.onClick;t&&this.clickTarge.forEach(function(o){o.removeEventListener("click",t)}),We(S(r.prototype),"dispose",this).call(this)},j(r,[{key:"clickTarge",get:function(){var t=this,o=this.options.clickTarge;if(o){var s=o.map(function(f){return I(t.element.querySelectorAll(f))}).flat();return s}return[this.element]}}]),r}(v),lt=ct,ft=`
|
|
1
|
+
import*as it from"idb-keyval";import*as It from"three";import*as Zt from"three/examples/jsm/renderers/CSS2DRenderer";import*as at from"three/examples/jsm/renderers/CSS3DRenderer";import*as ot from"popmotion";import*as Ft from"three/examples/jsm//utils/BufferGeometryUtils";import*as Fe from"d3-array";import*as Kt from"earcut";import*as Xt from"@turf/boolean-clockwise";import*as Ht from"delaunator";import*as $t from"@turf/boolean-point-in-polygon";import*as De from"d3-geo";import*as Yt from"d3-geo-voronoi";import*as Jt from"d3-scale";var Qt={666:function(k){var R=function(A){"use strict";var O=Object.prototype,M=O.hasOwnProperty,T,L=typeof Symbol=="function"?Symbol:{},z=L.iterator||"@@iterator",Z=L.asyncIterator||"@@asyncIterator",S=L.toStringTag||"@@toStringTag";function B(h,l,v){return Object.defineProperty(h,l,{value:v,enumerable:!0,configurable:!0,writable:!0}),h[l]}try{B({},"")}catch(h){B=function(l,v,C){return l[v]=C}}function K(h,l,v,C){var w=l&&l.prototype instanceof Q?l:Q,J=Object.create(w.prototype),V=new ce(C||[]);return J._invoke=ye(h,v,V),J}A.wrap=K;function X(h,l,v){try{return{type:"normal",arg:h.call(l,v)}}catch(C){return{type:"throw",arg:C}}}var D="suspendedStart",c="suspendedYield",he="executing",re="completed",W={};function Q(){}function j(){}function G(){}var q={};B(q,z,function(){return this});var ne=Object.getPrototypeOf,ee=ne&&ne(ne(Ce([])));ee&&ee!==O&&M.call(ee,z)&&(q=ee);var F=G.prototype=Q.prototype=Object.create(q);j.prototype=G,B(F,"constructor",G),B(G,"constructor",j),j.displayName=B(G,S,"GeneratorFunction");function I(h){["next","throw","return"].forEach(function(l){B(h,l,function(v){return this._invoke(l,v)})})}A.isGeneratorFunction=function(h){var l=typeof h=="function"&&h.constructor;return l?l===j||(l.displayName||l.name)==="GeneratorFunction":!1},A.mark=function(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,G):(h.__proto__=G,B(h,S,"GeneratorFunction")),h.prototype=Object.create(F),h},A.awrap=function(h){return{__await:h}};function te(h,l){function v(J,V,ae,pe){var oe=X(h[J],h,V);if(oe.type==="throw")pe(oe.arg);else{var ke=oe.arg,Ee=ke.value;return Ee&&typeof Ee=="object"&&M.call(Ee,"__await")?l.resolve(Ee.__await).then(function(be){v("next",be,ae,pe)},function(be){v("throw",be,ae,pe)}):l.resolve(Ee).then(function(be){ke.value=be,ae(ke)},function(be){return v("throw",be,ae,pe)})}}var C;function w(J,V){function ae(){return new l(function(pe,oe){v(J,V,pe,oe)})}return C=C?C.then(ae,ae):ae()}this._invoke=w}I(te.prototype),B(te.prototype,Z,function(){return this}),A.AsyncIterator=te,A.async=function(h,l,v,C,w){w===void 0&&(w=Promise);var J=new te(K(h,l,v,C),w);return A.isGeneratorFunction(l)?J:J.next().then(function(V){return V.done?V.value:J.next()})};function ye(h,l,v){var C=D;return function(J,V){if(C===he)throw new Error("Generator is already running");if(C===re){if(J==="throw")throw V;return je()}for(v.method=J,v.arg=V;;){var ae=v.delegate;if(ae){var pe=xe(ae,v);if(pe){if(pe===W)continue;return pe}}if(v.method==="next")v.sent=v._sent=v.arg;else if(v.method==="throw"){if(C===D)throw C=re,v.arg;v.dispatchException(v.arg)}else v.method==="return"&&v.abrupt("return",v.arg);C=he;var oe=X(h,l,v);if(oe.type==="normal"){if(C=v.done?re:c,oe.arg===W)continue;return{value:oe.arg,done:v.done}}else oe.type==="throw"&&(C=re,v.method="throw",v.arg=oe.arg)}}}function xe(h,l){var v=h.iterator[l.method];if(v===T){if(l.delegate=null,l.method==="throw"){if(h.iterator.return&&(l.method="return",l.arg=T,xe(h,l),l.method==="throw"))return W;l.method="throw",l.arg=new TypeError("The iterator does not provide a 'throw' method")}return W}var C=X(v,h.iterator,l.arg);if(C.type==="throw")return l.method="throw",l.arg=C.arg,l.delegate=null,W;var w=C.arg;if(!w)return l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,W;if(w.done)l[h.resultName]=w.value,l.next=h.nextLoc,l.method!=="return"&&(l.method="next",l.arg=T);else return w;return l.delegate=null,W}I(F),B(F,S,"Generator"),B(F,z,function(){return this}),B(F,"toString",function(){return"[object Generator]"});function Y(h){var l={tryLoc:h[0]};1 in h&&(l.catchLoc=h[1]),2 in h&&(l.finallyLoc=h[2],l.afterLoc=h[3]),this.tryEntries.push(l)}function $(h){var l=h.completion||{};l.type="normal",delete l.arg,h.completion=l}function ce(h){this.tryEntries=[{tryLoc:"root"}],h.forEach(Y,this),this.reset(!0)}A.keys=function(h){var l=[];for(var v in h)l.push(v);return l.reverse(),function C(){for(;l.length;){var w=l.pop();if(w in h)return C.value=w,C.done=!1,C}return C.done=!0,C}};function Ce(h){if(h){var l=h[z];if(l)return l.call(h);if(typeof h.next=="function")return h;if(!isNaN(h.length)){var v=-1,C=function w(){for(;++v<h.length;)if(M.call(h,v))return w.value=h[v],w.done=!1,w;return w.value=T,w.done=!0,w};return C.next=C}}return{next:je}}A.values=Ce;function je(){return{value:T,done:!0}}return ce.prototype={constructor:ce,reset:function(h){if(this.prev=0,this.next=0,this.sent=this._sent=T,this.done=!1,this.delegate=null,this.method="next",this.arg=T,this.tryEntries.forEach($),!h)for(var l in this)l.charAt(0)==="t"&&M.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=T)},stop:function(){this.done=!0;var h=this.tryEntries[0],l=h.completion;if(l.type==="throw")throw l.arg;return this.rval},dispatchException:function(h){if(this.done)throw h;var l=this;function v(pe,oe){return J.type="throw",J.arg=h,l.next=pe,oe&&(l.method="next",l.arg=T),!!oe}for(var C=this.tryEntries.length-1;C>=0;--C){var w=this.tryEntries[C],J=w.completion;if(w.tryLoc==="root")return v("end");if(w.tryLoc<=this.prev){var V=M.call(w,"catchLoc"),ae=M.call(w,"finallyLoc");if(V&&ae){if(this.prev<w.catchLoc)return v(w.catchLoc,!0);if(this.prev<w.finallyLoc)return v(w.finallyLoc)}else if(V){if(this.prev<w.catchLoc)return v(w.catchLoc,!0)}else if(ae){if(this.prev<w.finallyLoc)return v(w.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(h,l){for(var v=this.tryEntries.length-1;v>=0;--v){var C=this.tryEntries[v];if(C.tryLoc<=this.prev&&M.call(C,"finallyLoc")&&this.prev<C.finallyLoc){var w=C;break}}w&&(h==="break"||h==="continue")&&w.tryLoc<=l&&l<=w.finallyLoc&&(w=null);var J=w?w.completion:{};return J.type=h,J.arg=l,w?(this.method="next",this.next=w.finallyLoc,W):this.complete(J)},complete:function(h,l){if(h.type==="throw")throw h.arg;return h.type==="break"||h.type==="continue"?this.next=h.arg:h.type==="return"?(this.rval=this.arg=h.arg,this.method="return",this.next="end"):h.type==="normal"&&l&&(this.next=l),W},finish:function(h){for(var l=this.tryEntries.length-1;l>=0;--l){var v=this.tryEntries[l];if(v.finallyLoc===h)return this.complete(v.completion,v.afterLoc),$(v),W}},catch:function(h){for(var l=this.tryEntries.length-1;l>=0;--l){var v=this.tryEntries[l];if(v.tryLoc===h){var C=v.completion;if(C.type==="throw"){var w=C.arg;$(v)}return w}}throw new Error("illegal catch attempt")},delegateYield:function(h,l,v){return this.delegate={iterator:Ce(h),resultName:l,nextLoc:v},this.method==="next"&&(this.arg=T),W}},A}(k.exports);try{regeneratorRuntime=R}catch(A){typeof globalThis=="object"?globalThis.regeneratorRuntime=R:Function("r","regeneratorRuntime = r")(R)}},695:function(k,R,A){A.d(R,{Z:function(){return O}});function O(M){if(M.geometry&&M.geometry.dispose(),M.material){var T=Array.isArray(M.material)?M.material:[M.material];T.forEach(function(L){var z,Z,S,B,K,X,D,c,he,re,W,Q,j;(z=L.map)===null||z===void 0||z.dispose(),(Z=L.lightMap)===null||Z===void 0||Z.dispose(),(S=L.bumpMap)===null||S===void 0||S.dispose(),(B=L.normalMap)===null||B===void 0||B.dispose(),(K=L.specularMap)===null||K===void 0||K.dispose(),(X=L.envMap)===null||X===void 0||X.dispose(),(D=L.alphaMap)===null||D===void 0||D.dispose(),(c=L.aoMap)===null||c===void 0||c.dispose(),(he=L.displacementMap)===null||he===void 0||he.dispose(),(re=L.emissiveMap)===null||re===void 0||re.dispose(),(W=L.gradientMap)===null||W===void 0||W.dispose(),(Q=L.metalnessMap)===null||Q===void 0||Q.dispose(),(j=L.roughnessMap)===null||j===void 0||j.dispose(),L.dispose()})}}},584:function(k,R,A){A.d(R,{wf:function(){return L.Z}});var O=A(666),M=A.n(O),T=null,L=A(695),z=A(949);function Z(W){if(W.material){var Q=Array.isArray(W.material)?W.material:[W.material];Q.forEach(function(j){var G,q;(G=j.color)===null||G===void 0||G.convertSRGBToLinear(),(q=j.emissive)===null||q===void 0||q.convertSRGBToLinear(),j.map&&(j.map.encoding=THREE.sRGBEncoding),j.emissiveMap&&(j.emissiveMap.encoding=THREE.sRGBEncoding)})}}var S=A(568),B=A(924),K=A(77),X=A(484),D=null,c=null,he=function(){var W=(0,S.Z)(M().mark(function Q(j,G){var q,ne,ee,F,I,te,ye,xe,Y;return M().wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return q=G.type,ne=q===void 0?"blob":q,ee=G.version,F=ee===void 0?"1":ee,ce.next=4,(0,K.get)(j);case 4:if(te=ce.sent,!(te&&te[F])){ce.next=9;break}I=te[F],ce.next=15;break;case 9:return ce.next=11,(0,X.Z)(fetch(j).then(function(Ce){if(Ce.ok)return Ce[ne]();throw new Error}));case 11:ye=ce.sent,xe=ye.res,Y=ye.err,Y||(I=xe,(0,K.set)(j,(0,B.Z)({},F,xe)));case 15:return ce.abrupt("return",I?{url:ne==="json"?j:URL.createObjectURL(I),store:I}:{url:j});case 16:case"end":return ce.stop()}},Q)}));return function(j,G){return W.apply(this,arguments)}}(),re=A(705)},484:function(k,R,A){A.d(R,{Z:function(){return M}});var O=A(42);function M(T){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return T.then(function(z){return(0,O.Z)({err:null,res:z},L)}).catch(function(z){return(0,O.Z)({err:z,res:void 0},L)})}},705:function(k,R,A){A.d(R,{C:function(){return L},y:function(){return T}});var O=A(949),M=new Map,T=function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(Z,S,B,K,X){var D=S[B*3],c=S[B*3+1],he=S[K*3],re=S[K*3+1],W=S[X*3],Q=S[X*3+1],j;if(M.has(Z))j=M.get(Z);else{var G=z.box3||new O.Box3;if(!z.box3){var q=Z.parameters.shapes.getPoints();G.setFromArray(q.map(function(te){return[te.x,te.y,0]}).flat())}var ne=G.getSize(new O.Vector3);z.split&&(ne.y/=z.split),j={box:G,size:ne},M.set(Z,j)}var ee=j.box,F=j.size,I=z.split?1-z.split:0;return[new O.Vector2((D-ee.min.x)/F.x,(c-ee.min.y)/F.y+I),new O.Vector2((he-ee.min.x)/F.x,(re-ee.min.y)/F.y+I),new O.Vector2((W-ee.min.x)/F.x,(Q-ee.min.y)/F.y+I)]},generateSideWallUV:function(Z,S,B,K,X,D){var c=S[B*3],he=S[B*3+1],re=S[B*3+2],W=S[K*3],Q=S[K*3+1],j=S[K*3+2],G=S[X*3],q=S[X*3+1],ne=S[X*3+2],ee=S[D*3],F=S[D*3+1],I=S[D*3+2],te;if(M.has(S))te=M.get(S);else{var ye=new O.Box3;ye.setFromArray(S);var xe=ye.getSize(new O.Vector3);z.split&&(xe.z/=1-z.split),te={box:ye,size:xe},M.set(S,te)}var Y=te.box,$=te.size;return Math.abs(he-Q)<Math.abs(c-W)?[new O.Vector2((c-Y.min.x)/$.x,(re-Y.min.z)/$.z),new O.Vector2((W-Y.min.x)/$.x,(j-Y.min.z)/$.z),new O.Vector2((G-Y.min.x)/$.x,(ne-Y.min.z)/$.z),new O.Vector2((ee-Y.min.x)/$.x,(I-Y.min.z)/$.z)]:[new O.Vector2((he-Y.min.y)/$.y,(re-Y.min.z)/$.z),new O.Vector2((Q-Y.min.y)/$.y,(j-Y.min.z)/$.z),new O.Vector2((q-Y.min.y)/$.y,(ne-Y.min.z)/$.z),new O.Vector2((F-Y.min.y)/$.y,(I-Y.min.z)/$.z)]}}},L=function(){M.clear()}},77:function(k,R,A){var O=T=>{var L={};return A.d(L,T),L},M=T=>()=>T;k.exports=O({get:()=>it.get,set:()=>it.set})},949:function(k){var R=O=>{var M={};return N.d(M,O),M},A=O=>()=>O;k.exports=It},568:function(k,R,A){A.d(R,{Z:function(){return M}});function O(T,L,z,Z,S,B,K){try{var X=T[B](K),D=X.value}catch(c){z(c);return}X.done?L(D):Promise.resolve(D).then(Z,S)}function M(T){return function(){var L=this,z=arguments;return new Promise(function(Z,S){var B=T.apply(L,z);function K(D){O(B,Z,S,K,X,"next",D)}function X(D){O(B,Z,S,K,X,"throw",D)}K(void 0)})}}},924:function(k,R,A){A.d(R,{Z:function(){return O}});function O(M,T,L){return T in M?Object.defineProperty(M,T,{value:L,enumerable:!0,configurable:!0,writable:!0}):M[T]=L,M}},42:function(k,R,A){A.d(R,{Z:function(){return M}});var O=A(924);function M(T){for(var L=1;L<arguments.length;L++){var z=arguments[L]!=null?arguments[L]:{},Z=Object.keys(z);typeof Object.getOwnPropertySymbols=="function"&&(Z=Z.concat(Object.getOwnPropertySymbols(z).filter(function(S){return Object.getOwnPropertyDescriptor(z,S).enumerable}))),Z.forEach(function(S){(0,O.Z)(T,S,z[S])})}return T}}},st={};function N(k){var R=st[k];if(R!==void 0)return R.exports;var A=st[k]={exports:{}};return Qt[k](A,A.exports,N),A.exports}(function(){N.n=function(k){var R=k&&k.__esModule?function(){return k.default}:function(){return k};return N.d(R,{a:R}),R}})(),function(){N.d=function(k,R){for(var A in R)N.o(R,A)&&!N.o(k,A)&&Object.defineProperty(k,A,{enumerable:!0,get:R[A]})}}(),function(){N.o=function(k,R){return Object.prototype.hasOwnProperty.call(k,R)}}();var Ae={};(function(){N.d(Ae,{Ei:function(){return Vt},Yo:function(){return Ut},Ee:function(){return ke},x1:function(){return _t},VJ:function(){return Pe},r7:function(){return Ve},XA:function(){return Ke},NB:function(){return lt},xv:function(){return C},nk:function(){return ut}});function k(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function R(e,n){return R=Object.setPrototypeOf||function(i,a){return i.__proto__=a,i},R(e,n)}function A(e,n){return R(e,n)}function O(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&&A(e,n)}var M=N(42);function T(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 L(e,n){return n=n!=null?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}),e}function z(){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 Z(e){return Z=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Z(e)}function S(e){return Z(e)}function B(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function K(e){return e&&e.constructor===Symbol?"symbol":typeof e}function X(e,n){return n&&(K(n)==="object"||typeof n=="function")?n:B(e)}function D(e){var n=z();return function(){var i=S(e),a;if(n){var t=S(this).constructor;a=Reflect.construct(i,arguments,t)}else a=i.apply(this,arguments);return X(this,a)}}var c=N(949);function he(){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 re(e,n,r){return he()?re=Reflect.construct:re=function(a,t,o){var s=[null];s.push.apply(s,t);var f=Function.bind.apply(a,s),p=new f;return o&&A(p,o.prototype),p},re.apply(null,arguments)}function W(e,n,r){return re.apply(null,arguments)}function Q(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 j(e,n,r){return n&&Q(e.prototype,n),r&&Q(e,r),e}function G(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 q(e){if(Array.isArray(e))return G(e)}function ne(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ee(){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 F(e,n){if(!!e){if(typeof e=="string")return G(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 G(e,n)}}function I(e){return q(e)||ne(e)||F(e)||ee()}var te=N(484);function ye(){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,te.Z)(r.promise,n)),r}var xe=e=>{var n={};return N.d(n,e),n},Y=e=>()=>e,$=xe({CSS2DObject:()=>Zt.CSS2DObject}),ce=e=>{var n={};return N.d(n,e),n},Ce=e=>()=>e,je=ce({CSS3DObject:()=>at.CSS3DObject,CSS3DSprite:()=>at.CSS3DSprite}),h=N(584),l=function(e){e&&((0,h.wf)(e),e.children.forEach(function(n){n.userData.BaseObject_||l(n)}))},v=function(){"use strict";function e(){k(this,e),this.objecttype__="BaseObject",this.userData={},this.pm=ye(),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=W(c.Mesh,I(a)),this},n.createGroup=function(){return this.object3d=new c.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=W(c.Points,I(a)),this},n.createCSS2DObject=function(i){return this.object3d=new $.CSS2DObject(i),this},n.createCSS3DObject=function(i){return this.object3d=new je.CSS3DObject(i),this},n.createCSS3DSprite=function(i){return this.object3d=new je.CSS3DSprite(i),this},n.createSprite=function(i){return this.object3d=new c.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,I(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,I(a)),this},n.getSize=function(){var i=new c.Box3().setFromObject(this.object3d);return{min:i.min,max:i.max,size:i.getSize(new c.Vector3)}},n.traverse=function(i){i(this),this.children.forEach(function(a){a.traverse(i)})},n.dispose=function(){l(this.object3d)},j(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}(),C=function(e){"use strict";O(r,e);var n=D(r);function r(a){k(this,r);var t;return t=n.call(this),t.width=0,t.canvas=document.createElement("canvas"),t.options=(0,M.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,s=t.lookAt,f=t.sprite,p=t.text,d=t.sizeAttenuation;if(f){var m=new c.Sprite(new c.SpriteMaterial({transparent:!0,sizeAttenuation:d}));this.object3d=m}else{var _=new c.MeshBasicMaterial({side:c.DoubleSide,transparent:!0}),y=new c.PlaneGeometry(1,1,1,1);this.createMesh(y,_)}this.object3d.position.copy(o),s&&this.object3d.lookAt(s),this.setText(p)},i.setText=function(t,o){var s=(0,M.Z)(L((0,M.Z)({},this.options),{text:t}),o||{}),f=s.text,p=s.fontSize,d=s.fontFamily,m=s.fontWeight,_=s.flipX,y=s.scale,g=this.canvas;g.width=p*f.length*2,g.height=p;var b=g.getContext("2d");b.font="".concat(m," ").concat(p,"px/1 ").concat(d);var u=b.measureText(f).width;g.width=u,this.width=u,b=g.getContext("2d"),b.clearRect(0,0,g.width,g.height),_&&b.scale(-1,1),b.font="".concat(m," ").concat(p,"px/1 ").concat(d),b.textBaseline="middle",b.fillStyle="#ffffff",b.fillText(f,_?u*-1:0,g.height/2),b.restore();var E=new c.Texture(g);E.anisotropy=16,E.needsUpdate=!0;var x=this.object3d;x.material.map&&x.material.map.dispose(),x.material.map=E,x.material.needsUpdate=!0,x.scale.set(E.image.width*y,E.image.height*y,1)},r}(v),w=N(568),J=N(666),V=N.n(J),ae=+c.REVISION<144,pe=ae?"ExtrudeBufferGeometry":"ExtrudeGeometry",oe=ae?"PlaneBufferGeometry":"PlaneGeometry",ke=function(e){"use strict";O(r,e);var n=D(r);function r(a){k(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,w.Z)(V().mark(function o(){var s,f,p,d,m,_,y,g,b,u;return V().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return s=t.options,f=s.transparent,p=s.blending,d=s.src,m=s.depthWrite,_=s.alphaTest,y=s.sprite,g=s.sizeAttenuation,x.next=3,new c.TextureLoader().loadAsync(d);case 3:return b=x.sent,u=y?new c.SpriteMaterial({map:b,transparent:f!=null?f:!1,blending:p!=null?p:c.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:_!=null?_:0,sizeAttenuation:g!=null?g:!0}):new c.MeshBasicMaterial({map:b,transparent:f!=null?f:!1,blending:p!=null?p:c.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:_!=null?_:0}),x.abrupt("return",u);case 6:case"end":return x.stop()}},o)}))()},i.create=function(){var t=this;return(0,w.Z)(V().mark(function o(){var s,f,p,d,m,_,y,g;return V().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(s=t.options,f=s.scale,p=s.position,d=s.src,m=s.cache,_=s.sprite,!(m&&!m.get(d))){u.next=7;break}return m.init(d),u.next=5,t.getMaterial();case 5:y=u.sent,m.set(d,y);case 7:if(!m){u.next=13;break}return u.next=10,m.get(d);case 10:u.t0=u.sent,u.next=16;break;case 13:return u.next=15,t.getMaterial();case 15:u.t0=u.sent;case 16:g=u.t0,t.texture=g.map,_?t.createSprite(g):t.createMesh(new c[oe](1,1),g),f&&t.setScale(f),p&&t.object3d.position.copy(p);case 21:case"end":return u.stop()}},o)}))()},i.setScale=function(t){this.object3d.scale.set(this.texture.image.width*t,this.texture.image.height*t,1)},r}(v);function Ee(e,n){for(;!Object.prototype.hasOwnProperty.call(e,n)&&(e=S(e),e!==null););return e}function be(e,n,r){return typeof Reflect!="undefined"&&Reflect.get?be=Reflect.get:be=function(a,t,o){var s=Ee(a,t);if(!!s){var f=Object.getOwnPropertyDescriptor(s,t);return f.get?f.get.call(o||a):f.value}},be(e,n,r)}function We(e,n,r){return be(e,n,r)}var ut=function(e){"use strict";O(r,e);var n=D(r);function r(a){k(this,r);var t;return t=n.call(this),t.options=(0,M.Z)({},{autoPlay:!0,loop:!0},a),t}var i=r.prototype;return i.getMaterial=function(){var t=this.options,o=t.src,s=t.transparent,f=t.blending,p=t.depthWrite,d=t.format,m=t.autoPlay,_=t.loop,y=t.alphaTest,g=t.sprite,b=ye(),u=document.createElement("video");return u.addEventListener("loadedmetadata",function(){var E=new c.VideoTexture(u);E.format=d!=null?d:c.RGBAFormat,E.needsUpdate=!0;var x=g?new c.SpriteMaterial({map:E,transparent:s!=null?s:!1,blending:f!=null?f:c.NormalBlending,depthWrite:p!=null?p:!0,alphaTest:y!=null?y:0}):new c.MeshBasicMaterial({map:E,transparent:s!=null?s:!1,blending:f!=null?f:c.NormalBlending,depthWrite:p!=null?p:!0,alphaTest:y!=null?y:0});b.resolve(x)},!1),u.src=o,u.muted=!0,u.autoplay=m,u.loop=_,u.preload="auto",b.promise},i.create=function(){var t=this;return(0,w.Z)(V().mark(function o(){var s,f,p,d,m,_,y,g;return V().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(s=t.options,f=s.scale,p=s.position,d=s.src,m=s.cache,_=s.sprite,!(m&&!m.get(d))){u.next=7;break}return m.init(d),u.next=5,t.getMaterial();case 5:y=u.sent,m.set(d,y);case 7:if(!m){u.next=13;break}return u.next=10,m.get(d);case 10:u.t0=u.sent,u.next=16;break;case 13:return u.next=15,t.getMaterial();case 15:u.t0=u.sent;case 16:g=u.t0,t.video=g.map.image,_?t.createSprite(g):t.createMesh(new c[oe](1,1),g),f&&t.setScale(f),p&&t.object3d.position.copy(p);case 21:case"end":return u.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(),We(S(r.prototype),"dispose",this).call(this)},r}(v),ct=function(e){"use strict";O(r,e);var n=D(r);function r(a){k(this,r);var t;return t=n.call(this),t.options=(0,M.Z)({},{event:"click"},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.position,s=t.children,f=t.handler,p=t.event,d=t.zIndexFix,m=document.createElement("div");this.element=m,m.appendChild(s),this.createCSS2DObject(m),o&&this.object3d.position.copy(o),f&&p&&this.clickTarge.forEach(function(_){_.addEventListener(p,f)}),d&&(this.object3d.userData.zIndexFix=d)},i.getMaterial=function(t){return(0,w.Z)(V().mark(function o(){var s,f,p,d;return V().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return s=document.createElement("canvas"),s.width=256,s.height=256,f=s.getContext("2d"),f.fillStyle="#ff0000",f.fillRect(0,0,256,256),p=new c.CanvasTexture(s),d=new c.SpriteMaterial({map:p,opacity:t?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),_.abrupt("return",d);case 9:case"end":return _.stop()}},o)}))()},i.createPickObject=function(t){var o=t.show,s=o===void 0?!1:o,f=t.scale,p=f===void 0?new c.Vector3(1,1,1):f,d=t.position,m=d===void 0?new c.Vector3(0,0,0):d,_=t.cache,y=this;return(0,w.Z)(V().mark(function g(){var b,u,E,x;return V().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:if(b="node-create-pick-object",!(_&&!_.get(b))){P.next=7;break}return _.init(b),P.next=5,y.getMaterial(s);case 5:u=P.sent,_.set(b,u);case 7:if(!_){P.next=13;break}return P.next=10,_.get(b);case 10:P.t0=P.sent,P.next=16;break;case 13:return P.next=15,y.getMaterial(s);case 15:P.t0=P.sent;case 16:E=P.t0,x=new c.Sprite(E),x.scale.set(E.map.image.width*p.x,E.map.image.height*p.y,1),x.position.copy(m),y.add(x),y.pickObject=x;case 22:case"end":return P.stop()}},g)}))()},i.dispose=function(){var t=this.options,o=t.handler,s=t.event;o&&s&&this.clickTarge.forEach(function(f){f.removeEventListener(s,o)}),We(S(r.prototype),"dispose",this).call(this)},j(r,[{key:"clickTarge",get:function(){var t=this,o=this.options.eventTarge;if(o){var s=o.map(function(f){return I(t.element.querySelectorAll(f))}).flat();return s}return[this.element]}}]),r}(v),lt=ct,ft=`
|
|
2
2
|
`.concat(c.ShaderChunk.logdepthbuf_pars_vertex,`
|
|
3
3
|
`).concat(c.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(c.ShaderChunk.fog_fragment,`
|
|
131
131
|
}
|
|
132
|
-
`),Pe=function(e){"use strict";C(r,e);var n=D(r);function r(){k(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 c.Matrix4,Object.defineProperties(B(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}(c.BufferGeometry);Pe.prototype.setMatrixWorld=function(e){this.matrixWorld=e},Pe.prototype.setGeometry=function(e,n){this._geometry=e,this.setPoints(e.getAttribute("position").array,n)},Pe.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 c.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 Ke(e,n){var r=new c.Matrix4,i=new c.Ray,a=new c.Sphere,t=new c.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 s=new c.Vector3,f=new c.Vector3,p=new c.Vector3,d=this instanceof c.LineSegments?2:1,g=o.index,_=o.attributes;if(g!==null)for(var y=g.array,m=_.position.array,b=_.width.array,u=0,E=y.length-1;u<E;u+=d){var x=y[u],U=y[u+1];s.fromArray(m,x*3),f.fromArray(m,U*3);var P=b[Math.floor(u/3)]!==void 0?b[Math.floor(u/3)]:1,se=e.params.Line.threshold+this.material.lineWidth*P/2,de=se*se,fe=i.distanceSqToSegment(s,f,t,p);if(!(fe>de)){t.applyMatrix4(this.matrixWorld);var le=e.ray.origin.distanceTo(t);le<e.near||le>e.far||(n.push({distance:le,point:p.clone().applyMatrix4(this.matrixWorld),index:u,face:null,faceIndex:null,object:this}),u=E)}}}}Pe.prototype.raycast=Ke,Pe.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]},Pe.prototype.copyV3=function(e){var n=e*6;return[this.positions[n],this.positions[n+1],this.positions[n+2]]},Pe.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 c.BufferAttribute(new Float32Array(this.positions),3),previous:new c.BufferAttribute(new Float32Array(this.previous),3),next:new c.BufferAttribute(new Float32Array(this.next),3),side:new c.BufferAttribute(new Float32Array(this.side),1),width:new c.BufferAttribute(new Float32Array(this.width),1),uv:new c.BufferAttribute(new Float32Array(this.uvs),2),index:new c.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new c.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 Ge(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}Pe.prototype.advance=function(e){var n=this._attributes.position.array,r=this._attributes.previous.array,i=this._attributes.next.array,a=n.length;Ge(n,0,r,0,a),Ge(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,Ge(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},c.ShaderChunk.meshline_vert=ft,c.ShaderChunk.meshline_frag=ht;var Ve=function(e){"use strict";C(r,e);var n=D(r);function r(i){k(this,r);var a;return a=n.call(this,{uniforms:Object.assign({},c.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new c.Color(16777215)},opacity:{value:1},resolution:{value:new c.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 c.Vector2(1,1)},offset:{value:new c.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new c.Vector2(0,0)},lightColor:{value:new c.Color(16777215)}}),vertexShader:c.ShaderChunk.meshline_vert,fragmentShader:c.ShaderChunk.meshline_frag}),a.isMeshLineMaterial=!0,a.type="MeshLineMaterial",Object.defineProperties(B(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}(c.ShaderMaterial);Ve.prototype.copy=function(e){return c.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 pt(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 vt(e,n){if(e==null)return{};var r=pt(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 dt=e=>{var n={};return N.d(n,e),n},cr=e=>()=>e,Xe=dt({animate:()=>ot.animate,linear:()=>ot.linear}),mt=e=>{var n={};return N.d(n,e),n},lr=e=>()=>e,He=mt({mergeBufferGeometries:()=>Ft.mergeBufferGeometries});function $e(e){var n=e.setPointWidth,r=e.nodes,i=new c.BufferGeometry,a=new Pe;return i.setFromPoints(r),a.setGeometry(i,n),a}var gt={color:new c.Color("#ffffff"),lineWidth:3,sizeAttenuation:0},_t=function(e){"use strict";C(r,e);var n=D(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};k(this,r);var t;return t=n.call(this),t.options=(0,M.Z)({},gt,a),t}var i=r.prototype;return i.create=function(){var t=this,o=this.options,s=o.duration,f=o.delay,p=o.onComplete,d=o.setPointWidth,g=o.key,_=o.nodes,y=o.nodesArr,m=o.coordinatesArr,b=o.projection,u=o.worker,E=o.workerKey,x=o.useGroups,U=vt(o,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","coordinatesArr","projection","worker","workerKey","useGroups"]),P=this.pencil.getSize(),se=P.width,de=P.height,fe=new Ve(L((0,M.Z)({},U),{resolution:new c.Vector2(se,de)}));if(this.material=fe,_)this.createMesh($e({nodes:_,setPointWidth:d}),fe);else if(y){var le=He.mergeBufferGeometries(y.map(function(ve){return $e({nodes:ve,setPointWidth:d})}),x!=null?x:!1);this.createMesh(le,fe)}else if(m&&u)return new Promise(function(ve){u.postMessage({coordinatesArr:m,projection:b,useGroups:x,workerKey:E},function(ue){var me=new c.BufferGeometry;Object.keys(ue).forEach(function(ge){ge==="index"?me.setIndex(new c.BufferAttribute(ue[ge].array,ue[ge].itemSize)):me.setAttribute(ge,new c.BufferAttribute(ue[ge].array,ue[ge].itemSize))}),t.createMesh(me,fe),ve("")})})},i.resize=function(t,o){this.material.uniforms.resolution.value.set(t,o)},i.animate=function(){var t=this.options,o=t.duration,s=t.delay,f=t.onComplete,p=this.material.uniforms.offset,d=s!=null?s:0,g=(0,Xe.animate)({from:p.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-d,repeat:1/0,onComplete:f,ease:Xe.linear,onUpdate:function(_){p.value.x=_.x}});this.tween=g},i.dispose=function(){var t;We(S(r.prototype),"dispose",this).call(this),(t=this.tween)===null||t===void 0||t.stop()},r}(v);function yt(e){if(Array.isArray(e))return e}function bt(){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 Se(e,n){return yt(e)||ne(e,n)||F(e,n)||bt()}var wt=e=>{var n={};return N.d(n,e),n},fr=e=>()=>e,Le=wt({extent:()=>Fe.extent,mean:()=>Fe.mean,merge:()=>Fe.merge}),xt=e=>{var n={};return N.d(n,e),n},hr=e=>()=>e,Ue=xt({default:()=>Kt.default}),Mt=e=>{var n={};return N.d(n,e),n},pr=e=>()=>e,At=Mt({default:()=>Xt.default});function Pt(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 St=e=>{var n={};return N.d(n,e),n},vr=e=>()=>e,Ct=St({default:()=>Ht.default}),Ot=e=>{var n={};return N.d(n,e),n},dr=e=>()=>e,Et=Ot({default:()=>$t.default}),Lt=e=>{var n={};return N.d(n,e),n},mr=e=>()=>e,Re=Lt({geoBounds:()=>De.geoBounds,geoContains:()=>De.geoContains,geoDistance:()=>De.geoDistance,geoInterpolate:()=>De.geoInterpolate}),jt=e=>{var n={};return N.d(n,e),n},gr=e=>()=>e,kt=jt({geoVoronoi:()=>Yt.geoVoronoi}),Rt=e=>{var n={};return N.d(n,e),n},_r=e=>()=>e,Ye=Rt({scaleLinear:()=>Jt.scaleLinear});function Tt(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 s=(0,Re.geoInterpolate)(a,t),f=1/Math.ceil(o/n),p=f;p<1;)i.push(s(p)),p+=f}i.push(a=t)}),i})}function Bt(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),s=(1+Math.sqrt(5))/2,f=function(u){return u/s*360%360-180},p=function(u){return Math.acos(2*u/o-1)/Math.PI*180-90},d=function(u){return o*(Math.cos((u+90)*Math.PI/180)+1)/2},g=[t!==void 0?Math.ceil(d(t)):0,a!==void 0?Math.floor(d(a)):o-1],_=r===void 0&&i===void 0?function(){return!0}:r===void 0?function(u){return u<=i}:i===void 0?function(u){return u>=r}:i>=r?function(u){return u>=r&&u<=i}:function(u){return u>=r||u<=i},y=[],m=g[0];m<=g[1];m++){var b=f(m);_(b)&&y.push([b,p(m)])}return y}function Ne(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,Re.geoContains)(n,e):(0,Et.default)(e,n)}function zt(e,n){var r={type:"Polygon",coordinates:e},i=Se((0,Re.geoBounds)(r),2),a=Se(i[0],2),t=a[0],o=a[1],s=Se(i[1],2),f=s[0],p=s[1];if(Math.min(Math.abs(f-t),Math.abs(p-o))<n)return[];var d=t>f||p>=89||o<=-89;return Bt(n,{minLng:t,maxLng:f,minLat:o,maxLat:p}).filter(function(g){return Ne(g,r,d)})}function Dt(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.resolution,i=r===void 0?1/0:r,a=Tt(e,i),t=(0,Le.merge)(a),o=zt(e,i),s=I(t).concat(I(o)),f={type:"Polygon",coordinates:e},p=Se((0,Re.geoBounds)(f),2),d=Se(p[0],2),g=d[0],_=d[1],y=Se(p[1],2),m=y[0],b=y[1],u=g>m||b>=89||_<=-89,E=[];if(u){var x=(0,kt.geoVoronoi)(s).triangles(),U=new Map(s.map(function(ie,Me){var _e=Se(ie,2),we=_e[0],Be=_e[1];return["".concat(we,"-").concat(Be),Me]}));x.features.forEach(function(ie){var Me,_e=ie.geometry.coordinates[0].slice(0,3).reverse(),we=[];if(_e.forEach(function(ze){var Ce=Se(ze,2),Ze=Ce[0],Nt=Ce[1],nt="".concat(Ze,"-").concat(Nt);U.has(nt)&&we.push(U.get(nt))}),we.length===3){if(we.some(function(ze){return ze<t.length})){var Be=ie.properties.circumcenter;if(!Ne(Be,f,u))return}(Me=E).push.apply(Me,I(we))}})}else if(o.length)for(var le=function(ie,Me){var _e,we=[2,1,0].map(function(Ce){return ve.triangles[ie+Ce]}),Be=we.map(function(Ce){return s[Ce]});if(we.some(function(Ce){return Ce<t.length})){var ze=[0,1].map(function(Ce){return(0,Le.mean)(Be,function(Ze){return Ze[Ce]})});if(!Ne(ze,f,u))return"continue"}(_e=E).push.apply(_e,I(we))},ve=Ct.default.from(s),ue=0,me=ve.triangles.length;ue<me;ue+=3)le(ue,me);else{var P=Ue.default.flatten(a),se=P.vertices,de=P.holes,fe=de===void 0?[]:de;E=(0,Ue.default)(se,fe,2)}var ge=(0,Ye.scaleLinear)((0,Le.extent)(s,function(ie){return ie[0]}),[0,1]),rt=(0,Ye.scaleLinear)((0,Le.extent)(s,function(ie){return ie[1]}),[0,1]),H=s.map(function(ie){var Me=Se(ie,2),_e=Me[0],we=Me[1];return[ge(_e),rt(we)]}),Te={points:s,indices:E,uvs:H};return{contour:a,triangles:Te}}var Wt=Dt,Je=new c.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function Ie(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=e.map(function(a){return a.map(function(t){var o=Se(t,2),s=o[0],f=o[1];return r?Pt(s,f,n):[s,f,n]})});return Ue.default.flatten(i)}function Qe(e,n,r){for(var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=Ie(e,n,i),t=a.vertices,o=a.holes,s=Ie(e,r,i),f=s.vertices,p=(0,Le.merge)([f,t]),d=Math.round(f.length/3),g=new Set(o),_=0,y=[],m=0;m<d;m++){var b=m+1;if(b===d)b=_;else if(g.has(b)){var u=b;b=_,_=u}y.push(m,m+d,b+d),y.push(b+d,b,m)}for(var E=[],x=1;x>=0;x--)for(var U=0;U<d;U+=1)E.push(U/(d-1),x);return{indices:y,vertices:p,uvs:E,topVerts:f}}function qe(e,n,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return{indices:i?e.indices:e.indices.slice().reverse(),vertices:Ie([e.points],n,a).vertices,uvs:r}}var Gt=function(e){"use strict";C(r,e);var n=D(r);function r(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};k(this,r);var t;t=n.call(this),t.type="PolygonBufferGeometry",t.parameters=(0,M.Z)({},{polygonGeoJson:i,startHeight:0,endHeight:1,closedBottom:!0,closedTop:!0,includeSides:!0,curvatureResolution:5,cartesian:!0,userDataRsoOffset:0},a);var o=t.parameters,s=o.startHeight,f=o.endHeight,p=o.closedBottom,d=o.closedTop,g=o.includeSides,_=o.curvatureResolution,y=o.cartesian,m=o.userDataRsoOffset;(0,At.default)(i[0])||i[0].reverse();var b=Wt(i,{resolution:_}),u=b.contour,E=b.triangles,x=(0,Le.merge)(E.uvs),U=[],P=[],se=[],de=0,fe=function(ve){var ue=Math.round(U.length/3),me=se.length;U=U.concat(ve.vertices),P=P.concat(ve.uvs),se=se.concat(ue?ve.indices.map(function(ge){return ge+ue}):ve.indices),t.addGroup(me,se.length-me,de++)};if(g){var le=Qe(u,s,f,y);fe(le),t.userData.rso=m?Qe(u,s,f+m,y):le}return p&&fe(qe(E,s,x,!1,y)),d&&fe(qe(E,f,x,!0,y)),t.setIndex(se),t[Je]("position",new c.Float32BufferAttribute(U,3)),t[Je]("uv",new c.Float32BufferAttribute(P,2)),t.computeVertexNormals(),t}return r}(c.BufferGeometry),Vt=function(e){"use strict";C(r,e);var n=D(r);function r(a){k(this,r);var t;return t=n.call(this),t.options=(0,M.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,s=t.height,f=t.closedBottom,p=t.closedTop,d=t.curvatureResolution,g=t.userDataRsoOffset,_=t.cartesian,y=new Gt(this.options.geojson,{startHeight:o,endHeight:o+s,closedBottom:f,closedTop:p,curvatureResolution:d,cartesian:_,userDataRsoOffset:g});this.createMesh(y,this.options.material)},r}(v),et=N(705);function tt(e){var n=e.split,r=e.depth,i=e.points,a=new c[pe](new c.Shape(i),{depth:r,bevelEnabled:!1,UVGenerator:(0,et.y)({split:n})});return(0,et.C)(),a}var Ut=function(e){"use strict";C(r,e);var n=D(r);function r(a){k(this,r);var t;return t=n.call(this),t.options=L((0,M.Z)({},a),{materialOptions:(0,M.Z)({},{split:.1},a.materialOptions||{})}),t}var i=r.prototype;return i.create=function(){var t=this;return(0,w.Z)(V().mark(function o(){var s,f,p,d,g,_,y,m,b,u,E,x,U,P,se,de,fe,le,ve,ue,me,ge;return V().wrap(function(H){for(;;)switch(H.prev=H.next){case 0:if(s=t.options,f=s.points,p=s.pointsArr,d=s.coordinatesArr,g=s.useGroups,_=s.depth,y=s.material,m=s.materialOptions,b=s.worker,u=s.workerKey,E=s.projection,x=s.cache,U=0,P=y,!(!y&&m)){H.next=23;break}if(U=m.split,se=m.topColor,de=m.sideColor,fe=m.sideMap,le="ExtrudePolygonMaterial:".concat(de||fe).concat(se||""),!(x&&!x.get(le))){H.next=13;break}return x.init(le),H.next=11,t.getMaterial(m);case 11:ve=H.sent,x.set(le,ve);case 13:if(!x){H.next=19;break}return H.next=16,x.get(le);case 16:H.t0=H.sent,H.next=22;break;case 19:return H.next=21,t.getMaterial(m);case 21:H.t0=H.sent;case 22:P=H.t0;case 23:if(ue=Array.isArray(_)?_:[_],!f){H.next=28;break}t.createMesh(tt({points:f,depth:ue[0],split:U}),y),H.next=34;break;case 28:if(!p){H.next=32;break}ge=He.mergeBufferGeometries(p.map(function(Te,ie){return tt({points:Te,depth:(me=ue[ie])!==null&&me!==void 0?me:ue[0],split:U})}),g!=null?g:!1),t.createMesh(ge,y),H.next=34;break;case 32:if(!(d&&b)){H.next=34;break}return H.abrupt("return",new Promise(function(Te){b.postMessage({coordinatesArr:d,depth:_,split:U,useGroups:g,projection:E,workerKey:u},function(ie){var Me=new c.BufferGeometry;Object.keys(ie).forEach(function(_e){Me.setAttribute(_e,new c.BufferAttribute(ie[_e].array,ie[_e].itemSize))}),t.createMesh(Me,P),Te("")})}));case 34:case"end":return H.stop()}},o)}))()},i.getMaterial=function(t){var o=this,s=t.topColor,f=t.sideColor,p=t.sideMap,d=t.type,g=t.parameters,_=t.createCanvasObjectURL,y=t.split,m=t.maxAnisotropy;return new Promise(function(b){var u=p?document.createElement("img"):{src:"",onload:function(){},width:1024,height:1024};u.onload=function(){var E=y,x=document.createElement("canvas"),U=x.getContext("2d");x.height=u.height/(1-E),x.width=u.width,E&&s&&(U.fillStyle=s,U.fillRect(0,0,u.width,x.height*E)),p&&u instanceof HTMLImageElement?U.drawImage(u,0,x.height*E,u.width,u.height):f&&(U.fillStyle=f,U.fillRect(0,x.height*E,u.width,u.height)),_&&x.toBlob(function(de){console.log(URL.createObjectURL(de))});var P=new c.CanvasTexture(x);P.anisotropy=m||o.pencil.renderer.capabilities.getMaxAnisotropy();var se=new c[d||"MeshBasicMaterial"]((0,M.Z)({map:P},g||{}));b(se)},p?u.src=p:u instanceof HTMLImageElement||u.onload()})},i.setMaterialColor=function(t){var o=this;return(0,w.Z)(V().mark(function s(){var f,p,d,g,_,y,m,b,u,E,x;return V().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:if(f=o.options,p=f.materialOptions,d=f.cache,g=p.sideColor,_=p.sideMap,y=p.topColor,m=t.sideColor,b=t.topColor,!(b||m)){P.next=22;break}if(u="ExtrudePolygonMaterial:".concat(m||g||_||"").concat(b||y||""),!(d&&!d.get(u))){P.next=11;break}return d.init(u),P.next=9,o.getMaterial((0,M.Z)({},p,t));case 9:E=P.sent,d.set(u,E);case 11:if(!d){P.next=17;break}return P.next=14,d.get(u);case 14:P.t0=P.sent,P.next=20;break;case 17:return P.next=19,o.getMaterial((0,M.Z)({},p,t));case 19:P.t0=P.sent;case 20:x=P.t0,o.object3d.material=x;case 22:case"end":return P.stop()}},s)}))()},r}(v)})();var qt=Ae.Ei,er=Ae.Yo,tr=Ae.Ee,rr=Ae.x1,nr=Ae.VJ,ir=Ae.r7,ar=Ae.XA,or=Ae.NB,sr=Ae.xv,ur=Ae.nk;export{qt as ConicPolygon,er as ExtrudePolygon,tr as Image,rr as Line,nr as MeshLine,ir as MeshLineMaterial,ar as MeshLineRaycast,or as Node,sr as Text,ur as Video};
|
|
132
|
+
`),Pe=function(e){"use strict";O(r,e);var n=D(r);function r(){k(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 c.Matrix4,Object.defineProperties(B(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}(c.BufferGeometry);Pe.prototype.setMatrixWorld=function(e){this.matrixWorld=e},Pe.prototype.setGeometry=function(e,n){this._geometry=e,this.setPoints(e.getAttribute("position").array,n)},Pe.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 c.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 Ke(e,n){var r=new c.Matrix4,i=new c.Ray,a=new c.Sphere,t=new c.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 s=new c.Vector3,f=new c.Vector3,p=new c.Vector3,d=this instanceof c.LineSegments?2:1,m=o.index,_=o.attributes;if(m!==null)for(var y=m.array,g=_.position.array,b=_.width.array,u=0,E=y.length-1;u<E;u+=d){var x=y[u],U=y[u+1];s.fromArray(g,x*3),f.fromArray(g,U*3);var P=b[Math.floor(u/3)]!==void 0?b[Math.floor(u/3)]:1,se=e.params.Line.threshold+this.material.lineWidth*P/2,de=se*se,fe=i.distanceSqToSegment(s,f,t,p);if(!(fe>de)){t.applyMatrix4(this.matrixWorld);var le=e.ray.origin.distanceTo(t);le<e.near||le>e.far||(n.push({distance:le,point:p.clone().applyMatrix4(this.matrixWorld),index:u,face:null,faceIndex:null,object:this}),u=E)}}}}Pe.prototype.raycast=Ke,Pe.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]},Pe.prototype.copyV3=function(e){var n=e*6;return[this.positions[n],this.positions[n+1],this.positions[n+2]]},Pe.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 c.BufferAttribute(new Float32Array(this.positions),3),previous:new c.BufferAttribute(new Float32Array(this.previous),3),next:new c.BufferAttribute(new Float32Array(this.next),3),side:new c.BufferAttribute(new Float32Array(this.side),1),width:new c.BufferAttribute(new Float32Array(this.width),1),uv:new c.BufferAttribute(new Float32Array(this.uvs),2),index:new c.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new c.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 Ge(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}Pe.prototype.advance=function(e){var n=this._attributes.position.array,r=this._attributes.previous.array,i=this._attributes.next.array,a=n.length;Ge(n,0,r,0,a),Ge(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,Ge(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},c.ShaderChunk.meshline_vert=ft,c.ShaderChunk.meshline_frag=ht;var Ve=function(e){"use strict";O(r,e);var n=D(r);function r(i){k(this,r);var a;return a=n.call(this,{uniforms:Object.assign({},c.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new c.Color(16777215)},opacity:{value:1},resolution:{value:new c.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 c.Vector2(1,1)},offset:{value:new c.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new c.Vector2(0,0)},lightColor:{value:new c.Color(16777215)}}),vertexShader:c.ShaderChunk.meshline_vert,fragmentShader:c.ShaderChunk.meshline_frag}),a.isMeshLineMaterial=!0,a.type="MeshLineMaterial",Object.defineProperties(B(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}(c.ShaderMaterial);Ve.prototype.copy=function(e){return c.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 pt(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 vt(e,n){if(e==null)return{};var r=pt(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 dt=e=>{var n={};return N.d(n,e),n},cr=e=>()=>e,Xe=dt({animate:()=>ot.animate,linear:()=>ot.linear}),mt=e=>{var n={};return N.d(n,e),n},lr=e=>()=>e,He=mt({mergeBufferGeometries:()=>Ft.mergeBufferGeometries});function $e(e){var n=e.setPointWidth,r=e.nodes,i=new c.BufferGeometry,a=new Pe;return i.setFromPoints(r),a.setGeometry(i,n),a}var gt={color:new c.Color("#ffffff"),lineWidth:3,sizeAttenuation:0},_t=function(e){"use strict";O(r,e);var n=D(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};k(this,r);var t;return t=n.call(this),t.options=(0,M.Z)({},gt,a),t}var i=r.prototype;return i.create=function(){var t=this,o=this.options,s=o.duration,f=o.delay,p=o.onComplete,d=o.setPointWidth,m=o.key,_=o.nodes,y=o.nodesArr,g=o.coordinatesArr,b=o.projection,u=o.worker,E=o.workerKey,x=o.useGroups,U=vt(o,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","coordinatesArr","projection","worker","workerKey","useGroups"]),P=this.pencil.getSize(),se=P.width,de=P.height,fe=new Ve(L((0,M.Z)({},U),{resolution:new c.Vector2(se,de)}));if(this.material=fe,_)this.createMesh($e({nodes:_,setPointWidth:d}),fe);else if(y){var le=He.mergeBufferGeometries(y.map(function(ve){return $e({nodes:ve,setPointWidth:d})}),x!=null?x:!1);this.createMesh(le,fe)}else if(g&&u)return new Promise(function(ve){u.postMessage({coordinatesArr:g,projection:b,useGroups:x,workerKey:E},function(ue){var me=new c.BufferGeometry;Object.keys(ue).forEach(function(ge){ge==="index"?me.setIndex(new c.BufferAttribute(ue[ge].array,ue[ge].itemSize)):me.setAttribute(ge,new c.BufferAttribute(ue[ge].array,ue[ge].itemSize))}),t.createMesh(me,fe),ve("")})})},i.resize=function(t,o){this.material.uniforms.resolution.value.set(t,o)},i.animate=function(){var t=this.options,o=t.duration,s=t.delay,f=t.onComplete,p=this.material.uniforms.offset,d=s!=null?s:0,m=(0,Xe.animate)({from:p.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-d,repeat:1/0,onComplete:f,ease:Xe.linear,onUpdate:function(_){p.value.x=_.x}});this.tween=m},i.dispose=function(){var t;We(S(r.prototype),"dispose",this).call(this),(t=this.tween)===null||t===void 0||t.stop()},r}(v);function yt(e){if(Array.isArray(e))return e}function bt(){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 Se(e,n){return yt(e)||ne(e,n)||F(e,n)||bt()}var wt=e=>{var n={};return N.d(n,e),n},fr=e=>()=>e,Le=wt({extent:()=>Fe.extent,mean:()=>Fe.mean,merge:()=>Fe.merge}),xt=e=>{var n={};return N.d(n,e),n},hr=e=>()=>e,Ue=xt({default:()=>Kt.default}),Mt=e=>{var n={};return N.d(n,e),n},pr=e=>()=>e,At=Mt({default:()=>Xt.default});function Pt(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 St=e=>{var n={};return N.d(n,e),n},vr=e=>()=>e,Ot=St({default:()=>Ht.default}),Ct=e=>{var n={};return N.d(n,e),n},dr=e=>()=>e,Et=Ct({default:()=>$t.default}),Lt=e=>{var n={};return N.d(n,e),n},mr=e=>()=>e,Re=Lt({geoBounds:()=>De.geoBounds,geoContains:()=>De.geoContains,geoDistance:()=>De.geoDistance,geoInterpolate:()=>De.geoInterpolate}),jt=e=>{var n={};return N.d(n,e),n},gr=e=>()=>e,kt=jt({geoVoronoi:()=>Yt.geoVoronoi}),Rt=e=>{var n={};return N.d(n,e),n},_r=e=>()=>e,Ye=Rt({scaleLinear:()=>Jt.scaleLinear});function Tt(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 s=(0,Re.geoInterpolate)(a,t),f=1/Math.ceil(o/n),p=f;p<1;)i.push(s(p)),p+=f}i.push(a=t)}),i})}function Bt(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),s=(1+Math.sqrt(5))/2,f=function(u){return u/s*360%360-180},p=function(u){return Math.acos(2*u/o-1)/Math.PI*180-90},d=function(u){return o*(Math.cos((u+90)*Math.PI/180)+1)/2},m=[t!==void 0?Math.ceil(d(t)):0,a!==void 0?Math.floor(d(a)):o-1],_=r===void 0&&i===void 0?function(){return!0}:r===void 0?function(u){return u<=i}:i===void 0?function(u){return u>=r}:i>=r?function(u){return u>=r&&u<=i}:function(u){return u>=r||u<=i},y=[],g=m[0];g<=m[1];g++){var b=f(g);_(b)&&y.push([b,p(g)])}return y}function Ne(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,Re.geoContains)(n,e):(0,Et.default)(e,n)}function zt(e,n){var r={type:"Polygon",coordinates:e},i=Se((0,Re.geoBounds)(r),2),a=Se(i[0],2),t=a[0],o=a[1],s=Se(i[1],2),f=s[0],p=s[1];if(Math.min(Math.abs(f-t),Math.abs(p-o))<n)return[];var d=t>f||p>=89||o<=-89;return Bt(n,{minLng:t,maxLng:f,minLat:o,maxLat:p}).filter(function(m){return Ne(m,r,d)})}function Dt(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.resolution,i=r===void 0?1/0:r,a=Tt(e,i),t=(0,Le.merge)(a),o=zt(e,i),s=I(t).concat(I(o)),f={type:"Polygon",coordinates:e},p=Se((0,Re.geoBounds)(f),2),d=Se(p[0],2),m=d[0],_=d[1],y=Se(p[1],2),g=y[0],b=y[1],u=m>g||b>=89||_<=-89,E=[];if(u){var x=(0,kt.geoVoronoi)(s).triangles(),U=new Map(s.map(function(ie,Me){var _e=Se(ie,2),we=_e[0],Be=_e[1];return["".concat(we,"-").concat(Be),Me]}));x.features.forEach(function(ie){var Me,_e=ie.geometry.coordinates[0].slice(0,3).reverse(),we=[];if(_e.forEach(function(ze){var Oe=Se(ze,2),Ze=Oe[0],Nt=Oe[1],nt="".concat(Ze,"-").concat(Nt);U.has(nt)&&we.push(U.get(nt))}),we.length===3){if(we.some(function(ze){return ze<t.length})){var Be=ie.properties.circumcenter;if(!Ne(Be,f,u))return}(Me=E).push.apply(Me,I(we))}})}else if(o.length)for(var le=function(ie,Me){var _e,we=[2,1,0].map(function(Oe){return ve.triangles[ie+Oe]}),Be=we.map(function(Oe){return s[Oe]});if(we.some(function(Oe){return Oe<t.length})){var ze=[0,1].map(function(Oe){return(0,Le.mean)(Be,function(Ze){return Ze[Oe]})});if(!Ne(ze,f,u))return"continue"}(_e=E).push.apply(_e,I(we))},ve=Ot.default.from(s),ue=0,me=ve.triangles.length;ue<me;ue+=3)le(ue,me);else{var P=Ue.default.flatten(a),se=P.vertices,de=P.holes,fe=de===void 0?[]:de;E=(0,Ue.default)(se,fe,2)}var ge=(0,Ye.scaleLinear)((0,Le.extent)(s,function(ie){return ie[0]}),[0,1]),rt=(0,Ye.scaleLinear)((0,Le.extent)(s,function(ie){return ie[1]}),[0,1]),H=s.map(function(ie){var Me=Se(ie,2),_e=Me[0],we=Me[1];return[ge(_e),rt(we)]}),Te={points:s,indices:E,uvs:H};return{contour:a,triangles:Te}}var Wt=Dt,Je=new c.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function Ie(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=e.map(function(a){return a.map(function(t){var o=Se(t,2),s=o[0],f=o[1];return r?Pt(s,f,n):[s,f,n]})});return Ue.default.flatten(i)}function Qe(e,n,r){for(var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=Ie(e,n,i),t=a.vertices,o=a.holes,s=Ie(e,r,i),f=s.vertices,p=(0,Le.merge)([f,t]),d=Math.round(f.length/3),m=new Set(o),_=0,y=[],g=0;g<d;g++){var b=g+1;if(b===d)b=_;else if(m.has(b)){var u=b;b=_,_=u}y.push(g,g+d,b+d),y.push(b+d,b,g)}for(var E=[],x=1;x>=0;x--)for(var U=0;U<d;U+=1)E.push(U/(d-1),x);return{indices:y,vertices:p,uvs:E,topVerts:f}}function qe(e,n,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return{indices:i?e.indices:e.indices.slice().reverse(),vertices:Ie([e.points],n,a).vertices,uvs:r}}var Gt=function(e){"use strict";O(r,e);var n=D(r);function r(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};k(this,r);var t;t=n.call(this),t.type="PolygonBufferGeometry",t.parameters=(0,M.Z)({},{polygonGeoJson:i,startHeight:0,endHeight:1,closedBottom:!0,closedTop:!0,includeSides:!0,curvatureResolution:5,cartesian:!0,userDataRsoOffset:0},a);var o=t.parameters,s=o.startHeight,f=o.endHeight,p=o.closedBottom,d=o.closedTop,m=o.includeSides,_=o.curvatureResolution,y=o.cartesian,g=o.userDataRsoOffset;(0,At.default)(i[0])||i[0].reverse();var b=Wt(i,{resolution:_}),u=b.contour,E=b.triangles,x=(0,Le.merge)(E.uvs),U=[],P=[],se=[],de=0,fe=function(ve){var ue=Math.round(U.length/3),me=se.length;U=U.concat(ve.vertices),P=P.concat(ve.uvs),se=se.concat(ue?ve.indices.map(function(ge){return ge+ue}):ve.indices),t.addGroup(me,se.length-me,de++)};if(m){var le=Qe(u,s,f,y);fe(le),t.userData.rso=g?Qe(u,s,f+g,y):le}return p&&fe(qe(E,s,x,!1,y)),d&&fe(qe(E,f,x,!0,y)),t.setIndex(se),t[Je]("position",new c.Float32BufferAttribute(U,3)),t[Je]("uv",new c.Float32BufferAttribute(P,2)),t.computeVertexNormals(),t}return r}(c.BufferGeometry),Vt=function(e){"use strict";O(r,e);var n=D(r);function r(a){k(this,r);var t;return t=n.call(this),t.options=(0,M.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,s=t.height,f=t.closedBottom,p=t.closedTop,d=t.curvatureResolution,m=t.userDataRsoOffset,_=t.cartesian,y=new Gt(this.options.geojson,{startHeight:o,endHeight:o+s,closedBottom:f,closedTop:p,curvatureResolution:d,cartesian:_,userDataRsoOffset:m});this.createMesh(y,this.options.material)},r}(v),et=N(705);function tt(e){var n=e.split,r=e.depth,i=e.points,a=new c[pe](new c.Shape(i),{depth:r,bevelEnabled:!1,UVGenerator:(0,et.y)({split:n})});return(0,et.C)(),a}var Ut=function(e){"use strict";O(r,e);var n=D(r);function r(a){k(this,r);var t;return t=n.call(this),t.options=L((0,M.Z)({},a),{materialOptions:(0,M.Z)({},{split:.1},a.materialOptions||{})}),t}var i=r.prototype;return i.create=function(){var t=this;return(0,w.Z)(V().mark(function o(){var s,f,p,d,m,_,y,g,b,u,E,x,U,P,se,de,fe,le,ve,ue,me,ge;return V().wrap(function(H){for(;;)switch(H.prev=H.next){case 0:if(s=t.options,f=s.points,p=s.pointsArr,d=s.coordinatesArr,m=s.useGroups,_=s.depth,y=s.material,g=s.materialOptions,b=s.worker,u=s.workerKey,E=s.projection,x=s.cache,U=0,P=y,!(!y&&g)){H.next=23;break}if(U=g.split,se=g.topColor,de=g.sideColor,fe=g.sideMap,le="ExtrudePolygonMaterial:".concat(de||fe).concat(se||""),!(x&&!x.get(le))){H.next=13;break}return x.init(le),H.next=11,t.getMaterial(g);case 11:ve=H.sent,x.set(le,ve);case 13:if(!x){H.next=19;break}return H.next=16,x.get(le);case 16:H.t0=H.sent,H.next=22;break;case 19:return H.next=21,t.getMaterial(g);case 21:H.t0=H.sent;case 22:P=H.t0;case 23:if(ue=Array.isArray(_)?_:[_],!f){H.next=28;break}t.createMesh(tt({points:f,depth:ue[0],split:U}),y),H.next=34;break;case 28:if(!p){H.next=32;break}ge=He.mergeBufferGeometries(p.map(function(Te,ie){return tt({points:Te,depth:(me=ue[ie])!==null&&me!==void 0?me:ue[0],split:U})}),m!=null?m:!1),t.createMesh(ge,y),H.next=34;break;case 32:if(!(d&&b)){H.next=34;break}return H.abrupt("return",new Promise(function(Te){b.postMessage({coordinatesArr:d,depth:_,split:U,useGroups:m,projection:E,workerKey:u},function(ie){var Me=new c.BufferGeometry;Object.keys(ie).forEach(function(_e){Me.setAttribute(_e,new c.BufferAttribute(ie[_e].array,ie[_e].itemSize))}),t.createMesh(Me,P),Te("")})}));case 34:case"end":return H.stop()}},o)}))()},i.getMaterial=function(t){var o=this,s=t.topColor,f=t.sideColor,p=t.sideMap,d=t.type,m=t.parameters,_=t.createCanvasObjectURL,y=t.split,g=t.maxAnisotropy;return new Promise(function(b){var u=p?document.createElement("img"):{src:"",onload:function(){},width:1024,height:1024};u.onload=function(){var E=y,x=document.createElement("canvas"),U=x.getContext("2d");x.height=u.height/(1-E),x.width=u.width,E&&s&&(U.fillStyle=s,U.fillRect(0,0,u.width,x.height*E)),p&&u instanceof HTMLImageElement?U.drawImage(u,0,x.height*E,u.width,u.height):f&&(U.fillStyle=f,U.fillRect(0,x.height*E,u.width,u.height)),_&&x.toBlob(function(de){console.log(URL.createObjectURL(de))});var P=new c.CanvasTexture(x);P.anisotropy=g||o.pencil.renderer.capabilities.getMaxAnisotropy();var se=new c[d||"MeshBasicMaterial"]((0,M.Z)({map:P},m||{}));b(se)},p?u.src=p:u instanceof HTMLImageElement||u.onload()})},i.setMaterialColor=function(t){var o=this;return(0,w.Z)(V().mark(function s(){var f,p,d,m,_,y,g,b,u,E,x;return V().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:if(f=o.options,p=f.materialOptions,d=f.cache,m=p.sideColor,_=p.sideMap,y=p.topColor,g=t.sideColor,b=t.topColor,!(b||g)){P.next=22;break}if(u="ExtrudePolygonMaterial:".concat(g||m||_||"").concat(b||y||""),!(d&&!d.get(u))){P.next=11;break}return d.init(u),P.next=9,o.getMaterial((0,M.Z)({},p,t));case 9:E=P.sent,d.set(u,E);case 11:if(!d){P.next=17;break}return P.next=14,d.get(u);case 14:P.t0=P.sent,P.next=20;break;case 17:return P.next=19,o.getMaterial((0,M.Z)({},p,t));case 19:P.t0=P.sent;case 20:x=P.t0,o.object3d.material=x;case 22:case"end":return P.stop()}},s)}))()},r}(v)})();var qt=Ae.Ei,er=Ae.Yo,tr=Ae.Ee,rr=Ae.x1,nr=Ae.VJ,ir=Ae.r7,ar=Ae.XA,or=Ae.NB,sr=Ae.xv,ur=Ae.nk;export{qt as ConicPolygon,er as ExtrudePolygon,tr as Image,rr as Line,nr as MeshLine,ir as MeshLineMaterial,ar as MeshLineRaycast,or as Node,sr as Text,ur as Video};
|
|
@@ -5,8 +5,9 @@ import { CSS2DObject } from 'three/examples/jsm/renderers/CSS2DRenderer';
|
|
|
5
5
|
interface Options {
|
|
6
6
|
children: HTMLElement;
|
|
7
7
|
position?: THREE.Vector3;
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
event?: string;
|
|
9
|
+
eventTarge?: string[];
|
|
10
|
+
handler?: (event: Event) => void;
|
|
10
11
|
zIndexFix?: number;
|
|
11
12
|
}
|
|
12
13
|
export declare class Node extends BaseObject {
|