gl-draw 0.1.0 → 0.1.1

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