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