gl-draw 0.2.7 → 0.2.10

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