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