gl-draw 0.3.5 → 0.3.6

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,4 +1,4 @@
1
- import*as rt from"idb-keyval";import*as G 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(w){"use strict";var P=Object.prototype,A=P.hasOwnProperty,R,O=typeof Symbol=="function"?Symbol:{},I=O.iterator||"@@iterator",D=O.asyncIterator||"@@asyncIterator",W=O.toStringTag||"@@toStringTag";function k(f,u,p){return Object.defineProperty(f,u,{value:p,enumerable:!0,configurable:!0,writable:!0}),f[u]}try{k({},"")}catch(f){k=function(u,p,M){return u[p]=M}}function C(f,u,p,M){var b=u&&u.prototype instanceof ae?u:ae,Q=Object.create(b.prototype),H=new X(M||[]);return Q._invoke=oe(f,p,H),Q}w.wrap=C;function $(f,u,p){try{return{type:"normal",arg:f.call(u,p)}}catch(M){return{type:"throw",arg:M}}}var T="suspendedStart",s="suspendedYield",ce="executing",te="completed",K={};function ae(){}function V(){}function F(){}var L={};k(L,I,function(){return this});var Z=Object.getPrototypeOf,Y=Z&&Z(Z(ee([])));Y&&Y!==P&&A.call(Y,I)&&(L=Y);var J=F.prototype=ae.prototype=Object.create(L);V.prototype=F,k(J,"constructor",F),k(F,"constructor",V),V.displayName=k(F,W,"GeneratorFunction");function U(f){["next","throw","return"].forEach(function(u){k(f,u,function(p){return this._invoke(u,p)})})}w.isGeneratorFunction=function(f){var u=typeof f=="function"&&f.constructor;return u?u===V||(u.displayName||u.name)==="GeneratorFunction":!1},w.mark=function(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,F):(f.__proto__=F,k(f,W,"GeneratorFunction")),f.prototype=Object.create(J),f},w.awrap=function(f){return{__await:f}};function q(f,u){function p(Q,H,ue,he){var ne=$(f[Q],f,H);if(ne.type==="throw")he(ne.arg);else{var Ce=ne.arg,Le=Ce.value;return Le&&typeof Le=="object"&&A.call(Le,"__await")?u.resolve(Le.__await).then(function(xe){p("next",xe,ue,he)},function(xe){p("throw",xe,ue,he)}):u.resolve(Le).then(function(xe){Ce.value=xe,ue(Ce)},function(xe){return p("throw",xe,ue,he)})}}var M;function b(Q,H){function ue(){return new u(function(he,ne){p(Q,H,he,ne)})}return M=M?M.then(ue,ue):ue()}this._invoke=b}U(q.prototype),k(q.prototype,D,function(){return this}),w.AsyncIterator=q,w.async=function(f,u,p,M,b){b===void 0&&(b=Promise);var Q=new q(C(f,u,p,M),b);return w.isGeneratorFunction(u)?Q:Q.next().then(function(H){return H.done?H.value:Q.next()})};function oe(f,u,p){var M=T;return function(Q,H){if(M===ce)throw new Error("Generator is already running");if(M===te){if(Q==="throw")throw H;return Te()}for(p.method=Q,p.arg=H;;){var ue=p.delegate;if(ue){var he=se(ue,p);if(he){if(he===K)continue;return he}}if(p.method==="next")p.sent=p._sent=p.arg;else if(p.method==="throw"){if(M===T)throw M=te,p.arg;p.dispatchException(p.arg)}else p.method==="return"&&p.abrupt("return",p.arg);M=ce;var ne=$(f,u,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(f,u){var p=f.iterator[u.method];if(p===R){if(u.delegate=null,u.method==="throw"){if(f.iterator.return&&(u.method="return",u.arg=R,se(f,u),u.method==="throw"))return K;u.method="throw",u.arg=new TypeError("The iterator does not provide a 'throw' method")}return K}var M=$(p,f.iterator,u.arg);if(M.type==="throw")return u.method="throw",u.arg=M.arg,u.delegate=null,K;var b=M.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[f.resultName]=b.value,u.next=f.nextLoc,u.method!=="return"&&(u.method="next",u.arg=R);else return b;return u.delegate=null,K}U(J),k(J,W,"Generator"),k(J,I,function(){return this}),k(J,"toString",function(){return"[object Generator]"});function Oe(f){var u={tryLoc:f[0]};1 in f&&(u.catchLoc=f[1]),2 in f&&(u.finallyLoc=f[2],u.afterLoc=f[3]),this.tryEntries.push(u)}function re(f){var u=f.completion||{};u.type="normal",delete u.arg,f.completion=u}function X(f){this.tryEntries=[{tryLoc:"root"}],f.forEach(Oe,this),this.reset(!0)}w.keys=function(f){var u=[];for(var p in f)u.push(p);return u.reverse(),function M(){for(;u.length;){var b=u.pop();if(b in f)return M.value=b,M.done=!1,M}return M.done=!0,M}};function ee(f){if(f){var u=f[I];if(u)return u.call(f);if(typeof f.next=="function")return f;if(!isNaN(f.length)){var p=-1,M=function b(){for(;++p<f.length;)if(A.call(f,p))return b.value=f[p],b.done=!1,b;return b.value=R,b.done=!0,b};return M.next=M}}return{next:Te}}w.values=ee;function Te(){return{value:R,done:!0}}return X.prototype={constructor:X,reset:function(f){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),!f)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 f=this.tryEntries[0],u=f.completion;if(u.type==="throw")throw u.arg;return this.rval},dispatchException:function(f){if(this.done)throw f;var u=this;function p(he,ne){return Q.type="throw",Q.arg=f,u.next=he,ne&&(u.method="next",u.arg=R),!!ne}for(var M=this.tryEntries.length-1;M>=0;--M){var b=this.tryEntries[M],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(f,u){for(var p=this.tryEntries.length-1;p>=0;--p){var M=this.tryEntries[p];if(M.tryLoc<=this.prev&&A.call(M,"finallyLoc")&&this.prev<M.finallyLoc){var b=M;break}}b&&(f==="break"||f==="continue")&&b.tryLoc<=u&&u<=b.finallyLoc&&(b=null);var Q=b?b.completion:{};return Q.type=f,Q.arg=u,b?(this.method="next",this.next=b.finallyLoc,K):this.complete(Q)},complete:function(f,u){if(f.type==="throw")throw f.arg;return f.type==="break"||f.type==="continue"?this.next=f.arg:f.type==="return"?(this.rval=this.arg=f.arg,this.method="return",this.next="end"):f.type==="normal"&&u&&(this.next=u),K},finish:function(f){for(var u=this.tryEntries.length-1;u>=0;--u){var p=this.tryEntries[u];if(p.finallyLoc===f)return this.complete(p.completion,p.afterLoc),re(p),K}},catch:function(f){for(var u=this.tryEntries.length-1;u>=0;--u){var p=this.tryEntries[u];if(p.tryLoc===f){var M=p.completion;if(M.type==="throw"){var b=M.arg;re(p)}return b}}throw new Error("illegal catch attempt")},delegateYield:function(f,u,p){return this.delegate={iterator:ee(f),resultName:u,nextLoc:p},this.method==="next"&&(this.arg=R),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 P}});function P(A){if(A.geometry&&A.geometry.dispose(),A.material){var R=Array.isArray(A.material)?A.material:[A.material];R.forEach(function(O){var I,D,W,k,C,$,T,s,ce,te,K,ae,V;(I=O.map)===null||I===void 0||I.dispose(),(D=O.lightMap)===null||D===void 0||D.dispose(),(W=O.bumpMap)===null||W===void 0||W.dispose(),(k=O.normalMap)===null||k===void 0||k.dispose(),(C=O.specularMap)===null||C===void 0||C.dispose(),($=O.envMap)===null||$===void 0||$.dispose(),(T=O.alphaMap)===null||T===void 0||T.dispose(),(s=O.aoMap)===null||s===void 0||s.dispose(),(ce=O.displacementMap)===null||ce===void 0||ce.dispose(),(te=O.emissiveMap)===null||te===void 0||te.dispose(),(K=O.gradientMap)===null||K===void 0||K.dispose(),(ae=O.metalnessMap)===null||ae===void 0||ae.dispose(),(V=O.roughnessMap)===null||V===void 0||V.dispose(),O.dispose()})}}},218:function(j,B,w){w.d(B,{wf:function(){return O.Z}});var P=w(666),A=w.n(P),R=null,O=w(44),I=w(949);function D(V){if(V.material){var F=Array.isArray(V.material)?V.material:[V.material];F.forEach(function(L){var Z,Y;(Z=L.color)===null||Z===void 0||Z.convertSRGBToLinear(),(Y=L.emissive)===null||Y===void 0||Y.convertSRGBToLinear(),L.map&&(L.map.encoding=THREE.sRGBEncoding),L.emissiveMap&&(L.emissiveMap.encoding=THREE.sRGBEncoding)})}}var W=w(568),k=w(924),C=V=>{var F={};return w.d(F,V),F},$=V=>()=>V,T=C({get:()=>rt.get,set:()=>rt.set}),s=w(485),ce=null,te=null,K=function(){var V=(0,W.Z)(A().mark(function F(L,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,T.get)(L);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(L).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,T.set)(L,(0,k.Z)({},Y,oe)));case 15:return re.abrupt("return",J?{url:URL.createObjectURL(J)}:{url:L});case 16:case"end":return re.stop()}},F)}));return function(L,Z){return V.apply(this,arguments)}}(),ae=w(818)},485:function(j,B,w){w.d(B,{Z:function(){return A}});var P=w(42);function A(R){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return R.then(function(I){return(0,P.Z)({err:null,res:I},O)}).catch(function(I){return(0,P.Z)({err:I,res:void 0},O)})}},818:function(j,B,w){w.d(B,{C:function(){return O},y:function(){return R}});var P=w(949),A=new Map,R=function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(k,C,$,T,s){var ce=C[$*3],te=C[$*3+1],K=C[T*3],ae=C[T*3+1],V=C[s*3],F=C[s*3+1],L;if(A.has(k))L=A.get(k);else{var Z=D.box3||new P.Box3;if(!D.box3){var Y=k.parameters.shapes.getPoints();Z.setFromArray(Y.map(function(se){return[se.x,se.y,0]}).flat())}var J=Z.getSize(new P.Vector3);D.split&&(J.y/=D.split),L={box:Z,size:J},A.set(k,L)}var U=L.box,q=L.size,oe=D.split?1-D.split:0;return[new P.Vector2((ce-U.min.x)/q.x,(te-U.min.y)/q.y+oe),new P.Vector2((K-U.min.x)/q.x,(ae-U.min.y)/q.y+oe),new P.Vector2((V-U.min.x)/q.x,(F-U.min.y)/q.y+oe)]},generateSideWallUV:function(k,C,$,T,s,ce){var te=C[$*3],K=C[$*3+1],ae=C[$*3+2],V=C[T*3],F=C[T*3+1],L=C[T*3+2],Z=C[s*3],Y=C[s*3+1],J=C[s*3+2],U=C[ce*3],q=C[ce*3+1],oe=C[ce*3+2],se;if(A.has(C))se=A.get(C);else{var Oe=new P.Box3;Oe.setFromArray(C);var re=Oe.getSize(new P.Vector3);D.split&&(re.z/=1-D.split),se={box:Oe,size:re},A.set(C,se)}var X=se.box,ee=se.size;return Math.abs(K-F)<Math.abs(te-V)?[new P.Vector2((te-X.min.x)/ee.x,(ae-X.min.z)/ee.z),new P.Vector2((V-X.min.x)/ee.x,(L-X.min.z)/ee.z),new P.Vector2((Z-X.min.x)/ee.x,(J-X.min.z)/ee.z),new P.Vector2((U-X.min.x)/ee.x,(oe-X.min.z)/ee.z)]:[new P.Vector2((K-X.min.y)/ee.x,(ae-X.min.z)/ee.z),new P.Vector2((F-X.min.y)/ee.x,(L-X.min.z)/ee.z),new P.Vector2((Y-X.min.y)/ee.x,(J-X.min.z)/ee.z),new P.Vector2((q-X.min.y)/ee.x,(oe-X.min.z)/ee.z)]}}},O=function(){A.clear()}},949:function(j,B,w){var P=R=>{var O={};return w.d(O,R),O},A=R=>()=>R;j.exports=P({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 P(R,O,I,D,W,k,C){try{var $=R[k](C),T=$.value}catch(s){I(s);return}$.done?O(T):Promise.resolve(T).then(D,W)}function A(R){return function(){var O=this,I=arguments;return new Promise(function(D,W){var k=R.apply(O,I);function C(T){P(k,D,W,C,$,"next",T)}function $(T){P(k,D,W,C,$,"throw",T)}C(void 0)})}}},924:function(j,B,w){w.d(B,{Z:function(){return P}});function P(A,R,O){return R in A?Object.defineProperty(A,R,{value:O,enumerable:!0,configurable:!0,writable:!0}):A[R]=O,A}},42:function(j,B,w){w.d(B,{Z:function(){return A}});var P=w(924);function A(R){for(var O=1;O<arguments.length;O++){var I=arguments[O]!=null?arguments[O]:{},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,P.Z)(R,W,I[W])})}return R}}},it={};function N(j){var B=it[j];if(B!==void 0)return B.exports;var w=it[j]={exports:{}};return $t[j](w,w.exports,N),w.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 w in B)N.o(B,w)&&!N.o(j,w)&&Object.defineProperty(j,w,{enumerable:!0,get:B[w]})}}(),function(){N.o=function(j,B){return Object.prototype.hasOwnProperty.call(j,B)}}();var _e={};(function(){N.d(_e,{Ei:function(){return Gt},Yo:function(){return zt},Ee:function(){return ue},x1:function(){return vt},VJ:function(){return ge},r7:function(){return Ve},XA:function(){return Xe},NB:function(){return at},xv:function(){return M},nk:function(){return Le}});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 P(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=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 O(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 k(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:k(e)}function T(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&&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 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 L(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 L(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,Te=X({CSS3DObject:()=>nt.CSS3DObject,CSS3DSprite:()=>nt.CSS3DSprite}),f=N(218),u=function(e){e&&((0,f.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 Te.CSS3DObject(i),this},n.createCSS3DSprite=function(i){return this.object3d=new Te.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}(),M=function(e){"use strict";P(r,e);var n=T(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}),y=new s.PlaneGeometry(1,1,1,1);this.createMesh(y,g)}this.object3d.position.copy(o),c&&this.object3d.lookAt(c),this.setText(v)},i.setText=function(t,o){var c=(0,A.Z)(O((0,A.Z)({},this.options),{text:t}),o||{}),h=c.text,v=c.fontSize,d=c.fontFamily,m=c.fontWeight,g=c.flipX,y=c.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 l=x.measureText(h).width;_.width=l,this.width=l,x=_.getContext("2d"),x.clearRect(0,0,_.width,_.height),g&&x.scale(-1,1),x.font="".concat(m," ").concat(v,"px/1 ").concat(d),x.textBaseline="middle",x.fillStyle="#ffffff",x.fillText(h,g?l*-1:0,_.height/2),x.restore();var S=new s.Texture(_);S.anisotropy=16,S.needsUpdate=!0;var E=this.object3d;E.material.map&&E.material.map.dispose(),E.material.map=S,E.material.needsUpdate=!0,E.scale.set(S.image.width*y,S.image.height*y,1)},r}(p),b=N(568),Q=N(666),H=N.n(Q),ue=function(e){"use strict";P(r,e);var n=T(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,_,x,l;return H().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return c=t.options,h=c.transparent,v=c.blending,d=c.src,m=c.depthWrite,g=c.alphaTest,y=c.sprite,_=c.sizeAttenuation,E.next=3,new s.TextureLoader().loadAsync(d);case 3:return x=E.sent,l=y?new s.SpriteMaterial({map:x,transparent:h!=null?h:!1,blending:v!=null?v:s.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:g!=null?g: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:g!=null?g:0}),E.abrupt("return",l);case 6:case"end":return E.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(l){for(;;)switch(l.prev=l.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))){l.next=7;break}return m.init(d),l.next=5,t.getMaterial();case 5:y=l.sent,m.set(d,y);case 7:if(!m){l.next=13;break}return l.next=10,m.get(d);case 10:l.t0=l.sent,l.next=16;break;case 13:return l.next=15,t.getMaterial();case 15:l.t0=l.sent;case 16:_=l.t0,t.texture=_.map,g?t.createSprite(_):t.createMesh(new s.PlaneBufferGeometry(1,1),_),h&&t.setScale(h),v&&t.object3d.position.copy(v);case 21:case"end":return l.stop()}},o)}))()},i.setScale=function(t){this.object3d.scale.set(this.texture.image.width*t,this.texture.image.height*t,1)},r}(p);function he(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=he(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 Ce(e,n,r){return ne(e,n,r)}var Le=function(e){"use strict";P(r,e);var n=T(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,y=t.alphaTest,_=t.sprite,x=oe(),l=document.createElement("video");return l.addEventListener("loadedmetadata",function(){var S=new s.VideoTexture(l);S.format=d!=null?d:s.RGBAFormat,S.needsUpdate=!0;var E=_?new s.SpriteMaterial({map:S,transparent:c!=null?c:!1,blending:h!=null?h:s.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:y!=null?y:0}):new s.MeshBasicMaterial({map:S,transparent:c!=null?c:!1,blending:h!=null?h:s.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:y!=null?y:0});x.resolve(E)},!1),l.src=o,l.muted=!0,l.autoplay=m,l.loop=g,l.preload="auto",x.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(l){for(;;)switch(l.prev=l.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))){l.next=7;break}return m.init(d),l.next=5,t.getMaterial();case 5:y=l.sent,m.set(d,y);case 7:if(!m){l.next=13;break}return l.next=10,m.get(d);case 10:l.t0=l.sent,l.next=16;break;case 13:return l.next=15,t.getMaterial();case 15:l.t0=l.sent;case 16:_=l.t0,t.video=_.map.image,g?t.createSprite(_):t.createMesh(new s.PlaneBufferGeometry(1,1),_),h&&t.setScale(h),v&&t.object3d.position.copy(v);case 21:case"end":return l.stop()}},o)}))()},i.setScale=function(t){this.object3d.scale.set(this.video.videoWidth*t,this.video.videoHeight*t,1)},i.render=function(){var t=this.options.autoPlay;t&&this.video.play()},i.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),Ce(W(r.prototype),"dispose",this).call(this)},r}(p),xe=function(e){"use strict";P(r,e);var n=T(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,y=this;return(0,b.Z)(H().mark(function _(){var x,l,S,E;return H().wrap(function(z){for(;;)switch(z.prev=z.next){case 0:if(x="node-create-pick-object",!(g&&!g.get(x))){z.next=7;break}return g.init(x),z.next=5,y.getMaterial(c);case 5:l=z.sent,g.set(x,l);case 7:if(!g){z.next=13;break}return z.next=10,g.get(x);case 10:z.t0=z.sent,z.next=16;break;case 13:return z.next=15,y.getMaterial(c);case 15:z.t0=z.sent;case 16:S=z.t0,E=new s.Sprite(S),E.scale.set(S.map.image.width*v.x,S.map.image.height*v.y,1),E.position.copy(m),y.add(E),y.pickObject=E;case 22:case"end":return z.stop()}},_)}))()},i.dispose=function(){var t=this.options.onClick;t&&this.clickTarge.forEach(function(o){o.removeEventListener("click",t)}),Ce(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=xe,ot=`
1
+ import*as et from"idb-keyval";import*as W from"three";import*as Vt from"three/examples/jsm/renderers/CSS2DRenderer";import*as tt from"three/examples/jsm/renderers/CSS3DRenderer";import*as Ut from"popmotion";import*as Nt from"three/examples/jsm//utils/BufferGeometryUtils";import*as Fe from"d3-array";import*as Ft from"earcut";import*as It from"@turf/boolean-clockwise";import*as Zt from"delaunator";import*as Xt from"@turf/boolean-point-in-polygon";import*as Re from"d3-geo";import*as Ht from"d3-geo-voronoi";import*as Kt from"d3-scale";var $t={666:function(L){var j=function(w){"use strict";var P=Object.prototype,M=P.hasOwnProperty,B,O=typeof Symbol=="function"?Symbol:{},T=O.iterator||"@@iterator",Z=O.asyncIterator||"@@asyncIterator",x=O.toStringTag||"@@toStringTag";function k(f,u,p){return Object.defineProperty(f,u,{value:p,enumerable:!0,configurable:!0,writable:!0}),f[u]}try{k({},"")}catch(f){k=function(u,p,S){return u[p]=S}}function Y(f,u,p,S){var g=u&&u.prototype instanceof ie?u:ie,Q=Object.create(g.prototype),K=new Se(S||[]);return Q._invoke=ue(f,p,K),Q}w.wrap=Y;function J(f,u,p){try{return{type:"normal",arg:f.call(u,p)}}catch(S){return{type:"throw",arg:S}}}var R="suspendedStart",s="suspendedYield",oe="executing",re="completed",$={};function ie(){}function G(){}function F(){}var D={};k(D,T,function(){return this});var X=Object.getPrototypeOf,U=X&&X(X(Te([])));U&&U!==P&&M.call(U,T)&&(D=U);var H=F.prototype=ie.prototype=Object.create(D);G.prototype=F,k(H,"constructor",F),k(F,"constructor",G),G.displayName=k(F,x,"GeneratorFunction");function I(f){["next","throw","return"].forEach(function(u){k(f,u,function(p){return this._invoke(u,p)})})}w.isGeneratorFunction=function(f){var u=typeof f=="function"&&f.constructor;return u?u===G||(u.displayName||u.name)==="GeneratorFunction":!1},w.mark=function(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,F):(f.__proto__=F,k(f,x,"GeneratorFunction")),f.prototype=Object.create(H),f},w.awrap=function(f){return{__await:f}};function q(f,u){function p(Q,K,ae,se){var ne=J(f[Q],f,K);if(ne.type==="throw")se(ne.arg);else{var Oe=ne.arg,Ce=Oe.value;return Ce&&typeof Ce=="object"&&M.call(Ce,"__await")?u.resolve(Ce.__await).then(function(xe){p("next",xe,ae,se)},function(xe){p("throw",xe,ae,se)}):u.resolve(Ce).then(function(xe){Oe.value=xe,ae(Oe)},function(xe){return p("throw",xe,ae,se)})}}var S;function g(Q,K){function ae(){return new u(function(se,ne){p(Q,K,se,ne)})}return S=S?S.then(ae,ae):ae()}this._invoke=g}I(q.prototype),k(q.prototype,Z,function(){return this}),w.AsyncIterator=q,w.async=function(f,u,p,S,g){g===void 0&&(g=Promise);var Q=new q(Y(f,u,p,S),g);return w.isGeneratorFunction(u)?Q:Q.next().then(function(K){return K.done?K.value:Q.next()})};function ue(f,u,p){var S=R;return function(Q,K){if(S===oe)throw new Error("Generator is already running");if(S===re){if(Q==="throw")throw K;return Le()}for(p.method=Q,p.arg=K;;){var ae=p.delegate;if(ae){var se=_e(ae,p);if(se){if(se===$)continue;return se}}if(p.method==="next")p.sent=p._sent=p.arg;else if(p.method==="throw"){if(S===R)throw S=re,p.arg;p.dispatchException(p.arg)}else p.method==="return"&&p.abrupt("return",p.arg);S=oe;var ne=J(f,u,p);if(ne.type==="normal"){if(S=p.done?re:s,ne.arg===$)continue;return{value:ne.arg,done:p.done}}else ne.type==="throw"&&(S=re,p.method="throw",p.arg=ne.arg)}}}function _e(f,u){var p=f.iterator[u.method];if(p===B){if(u.delegate=null,u.method==="throw"){if(f.iterator.return&&(u.method="return",u.arg=B,_e(f,u),u.method==="throw"))return $;u.method="throw",u.arg=new TypeError("The iterator does not provide a 'throw' method")}return $}var S=J(p,f.iterator,u.arg);if(S.type==="throw")return u.method="throw",u.arg=S.arg,u.delegate=null,$;var g=S.arg;if(!g)return u.method="throw",u.arg=new TypeError("iterator result is not an object"),u.delegate=null,$;if(g.done)u[f.resultName]=g.value,u.next=f.nextLoc,u.method!=="return"&&(u.method="next",u.arg=B);else return g;return u.delegate=null,$}I(H),k(H,x,"Generator"),k(H,T,function(){return this}),k(H,"toString",function(){return"[object Generator]"});function ee(f){var u={tryLoc:f[0]};1 in f&&(u.catchLoc=f[1]),2 in f&&(u.finallyLoc=f[2],u.afterLoc=f[3]),this.tryEntries.push(u)}function z(f){var u=f.completion||{};u.type="normal",delete u.arg,f.completion=u}function Se(f){this.tryEntries=[{tryLoc:"root"}],f.forEach(ee,this),this.reset(!0)}w.keys=function(f){var u=[];for(var p in f)u.push(p);return u.reverse(),function S(){for(;u.length;){var g=u.pop();if(g in f)return S.value=g,S.done=!1,S}return S.done=!0,S}};function Te(f){if(f){var u=f[T];if(u)return u.call(f);if(typeof f.next=="function")return f;if(!isNaN(f.length)){var p=-1,S=function g(){for(;++p<f.length;)if(M.call(f,p))return g.value=f[p],g.done=!1,g;return g.value=B,g.done=!0,g};return S.next=S}}return{next:Le}}w.values=Te;function Le(){return{value:B,done:!0}}return Se.prototype={constructor:Se,reset:function(f){if(this.prev=0,this.next=0,this.sent=this._sent=B,this.done=!1,this.delegate=null,this.method="next",this.arg=B,this.tryEntries.forEach(z),!f)for(var u in this)u.charAt(0)==="t"&&M.call(this,u)&&!isNaN(+u.slice(1))&&(this[u]=B)},stop:function(){this.done=!0;var f=this.tryEntries[0],u=f.completion;if(u.type==="throw")throw u.arg;return this.rval},dispatchException:function(f){if(this.done)throw f;var u=this;function p(se,ne){return Q.type="throw",Q.arg=f,u.next=se,ne&&(u.method="next",u.arg=B),!!ne}for(var S=this.tryEntries.length-1;S>=0;--S){var g=this.tryEntries[S],Q=g.completion;if(g.tryLoc==="root")return p("end");if(g.tryLoc<=this.prev){var K=M.call(g,"catchLoc"),ae=M.call(g,"finallyLoc");if(K&&ae){if(this.prev<g.catchLoc)return p(g.catchLoc,!0);if(this.prev<g.finallyLoc)return p(g.finallyLoc)}else if(K){if(this.prev<g.catchLoc)return p(g.catchLoc,!0)}else if(ae){if(this.prev<g.finallyLoc)return p(g.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(f,u){for(var p=this.tryEntries.length-1;p>=0;--p){var S=this.tryEntries[p];if(S.tryLoc<=this.prev&&M.call(S,"finallyLoc")&&this.prev<S.finallyLoc){var g=S;break}}g&&(f==="break"||f==="continue")&&g.tryLoc<=u&&u<=g.finallyLoc&&(g=null);var Q=g?g.completion:{};return Q.type=f,Q.arg=u,g?(this.method="next",this.next=g.finallyLoc,$):this.complete(Q)},complete:function(f,u){if(f.type==="throw")throw f.arg;return f.type==="break"||f.type==="continue"?this.next=f.arg:f.type==="return"?(this.rval=this.arg=f.arg,this.method="return",this.next="end"):f.type==="normal"&&u&&(this.next=u),$},finish:function(f){for(var u=this.tryEntries.length-1;u>=0;--u){var p=this.tryEntries[u];if(p.finallyLoc===f)return this.complete(p.completion,p.afterLoc),z(p),$}},catch:function(f){for(var u=this.tryEntries.length-1;u>=0;--u){var p=this.tryEntries[u];if(p.tryLoc===f){var S=p.completion;if(S.type==="throw"){var g=S.arg;z(p)}return g}}throw new Error("illegal catch attempt")},delegateYield:function(f,u,p){return this.delegate={iterator:Te(f),resultName:u,nextLoc:p},this.method==="next"&&(this.arg=B),$}},w}(L.exports);try{regeneratorRuntime=j}catch(w){typeof globalThis=="object"?globalThis.regeneratorRuntime=j:Function("r","regeneratorRuntime = r")(j)}},695:function(L,j,w){w.d(j,{Z:function(){return P}});function P(M){if(M.geometry&&M.geometry.dispose(),M.material){var B=Array.isArray(M.material)?M.material:[M.material];B.forEach(function(O){var T,Z,x,k,Y,J,R,s,oe,re,$,ie,G;(T=O.map)===null||T===void 0||T.dispose(),(Z=O.lightMap)===null||Z===void 0||Z.dispose(),(x=O.bumpMap)===null||x===void 0||x.dispose(),(k=O.normalMap)===null||k===void 0||k.dispose(),(Y=O.specularMap)===null||Y===void 0||Y.dispose(),(J=O.envMap)===null||J===void 0||J.dispose(),(R=O.alphaMap)===null||R===void 0||R.dispose(),(s=O.aoMap)===null||s===void 0||s.dispose(),(oe=O.displacementMap)===null||oe===void 0||oe.dispose(),(re=O.emissiveMap)===null||re===void 0||re.dispose(),($=O.gradientMap)===null||$===void 0||$.dispose(),(ie=O.metalnessMap)===null||ie===void 0||ie.dispose(),(G=O.roughnessMap)===null||G===void 0||G.dispose(),O.dispose()})}}},521:function(L,j,w){w.d(j,{wf:function(){return O.Z}});var P=w(666),M=w.n(P),B=null,O=w(695),T=w(949);function Z(G){if(G.material){var F=Array.isArray(G.material)?G.material:[G.material];F.forEach(function(D){var X,U;(X=D.color)===null||X===void 0||X.convertSRGBToLinear(),(U=D.emissive)===null||U===void 0||U.convertSRGBToLinear(),D.map&&(D.map.encoding=THREE.sRGBEncoding),D.emissiveMap&&(D.emissiveMap.encoding=THREE.sRGBEncoding)})}}var x=w(568),k=w(924),Y=G=>{var F={};return w.d(F,G),F},J=G=>()=>G,R=Y({get:()=>et.get,set:()=>et.set}),s=w(484),oe=null,re=null,$=function(){var G=(0,x.Z)(M().mark(function F(D,X){var U,H,I,q,ue,_e;return M().wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return U=X.version,z.next=4,(0,R.get)(D);case 4:if(I=z.sent,!(I&&I[U])){z.next=9;break}H=I[U],z.next=15;break;case 9:return z.next=11,(0,s.Z)(fetch(D).then(function(Se){if(Se.ok)return Se.blob();throw new Error}));case 11:q=z.sent,ue=q.res,_e=q.err,_e||(H=ue,(0,R.set)(D,(0,k.Z)({},U,ue)));case 15:return z.abrupt("return",H?{url:URL.createObjectURL(H)}:{url:D});case 16:case"end":return z.stop()}},F)}));return function(D,X){return G.apply(this,arguments)}}(),ie=w(705)},484:function(L,j,w){w.d(j,{Z:function(){return M}});var P=w(42);function M(B){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return B.then(function(T){return(0,P.Z)({err:null,res:T},O)}).catch(function(T){return(0,P.Z)({err:T,res:void 0},O)})}},705:function(L,j,w){w.d(j,{C:function(){return O},y:function(){return B}});var P=w(949),M=new Map,B=function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(Z,x,k,Y,J){var R=x[k*3],s=x[k*3+1],oe=x[Y*3],re=x[Y*3+1],$=x[J*3],ie=x[J*3+1],G;if(M.has(Z))G=M.get(Z);else{var F=T.box3||new P.Box3;if(!T.box3){var D=Z.parameters.shapes.getPoints();F.setFromArray(D.map(function(q){return[q.x,q.y,0]}).flat())}var X=F.getSize(new P.Vector3);T.split&&(X.y/=T.split),G={box:F,size:X},M.set(Z,G)}var U=G.box,H=G.size,I=T.split?1-T.split:0;return[new P.Vector2((R-U.min.x)/H.x,(s-U.min.y)/H.y+I),new P.Vector2((oe-U.min.x)/H.x,(re-U.min.y)/H.y+I),new P.Vector2(($-U.min.x)/H.x,(ie-U.min.y)/H.y+I)]},generateSideWallUV:function(Z,x,k,Y,J,R){var s=x[k*3],oe=x[k*3+1],re=x[k*3+2],$=x[Y*3],ie=x[Y*3+1],G=x[Y*3+2],F=x[J*3],D=x[J*3+1],X=x[J*3+2],U=x[R*3],H=x[R*3+1],I=x[R*3+2],q;if(M.has(x))q=M.get(x);else{var ue=new P.Box3;ue.setFromArray(x);var _e=ue.getSize(new P.Vector3);T.split&&(_e.z/=1-T.split),q={box:ue,size:_e},M.set(x,q)}var ee=q.box,z=q.size;return Math.abs(oe-ie)<Math.abs(s-$)?[new P.Vector2((s-ee.min.x)/z.x,(re-ee.min.z)/z.z),new P.Vector2(($-ee.min.x)/z.x,(G-ee.min.z)/z.z),new P.Vector2((F-ee.min.x)/z.x,(X-ee.min.z)/z.z),new P.Vector2((U-ee.min.x)/z.x,(I-ee.min.z)/z.z)]:[new P.Vector2((oe-ee.min.y)/z.x,(re-ee.min.z)/z.z),new P.Vector2((ie-ee.min.y)/z.x,(G-ee.min.z)/z.z),new P.Vector2((D-ee.min.y)/z.x,(X-ee.min.z)/z.z),new P.Vector2((H-ee.min.y)/z.x,(I-ee.min.z)/z.z)]}}},O=function(){M.clear()}},949:function(L,j,w){var P=B=>{var O={};return w.d(O,B),O},M=B=>()=>B;L.exports=P({Box3:()=>W.Box3,BufferAttribute:()=>W.BufferAttribute,BufferGeometry:()=>W.BufferGeometry,CanvasTexture:()=>W.CanvasTexture,Color:()=>W.Color,DoubleSide:()=>W.DoubleSide,ExtrudeGeometry:()=>W.ExtrudeGeometry,Float32BufferAttribute:()=>W.Float32BufferAttribute,Group:()=>W.Group,LineSegments:()=>W.LineSegments,Matrix4:()=>W.Matrix4,Mesh:()=>W.Mesh,MeshBasicMaterial:()=>W.MeshBasicMaterial,NormalBlending:()=>W.NormalBlending,PlaneBufferGeometry:()=>W.PlaneBufferGeometry,PlaneGeometry:()=>W.PlaneGeometry,Points:()=>W.Points,RGBAFormat:()=>W.RGBAFormat,Ray:()=>W.Ray,ShaderChunk:()=>W.ShaderChunk,ShaderMaterial:()=>W.ShaderMaterial,Shape:()=>W.Shape,Sphere:()=>W.Sphere,Sprite:()=>W.Sprite,SpriteMaterial:()=>W.SpriteMaterial,Texture:()=>W.Texture,TextureLoader:()=>W.TextureLoader,UniformsLib:()=>W.UniformsLib,Vector2:()=>W.Vector2,Vector3:()=>W.Vector3,VideoTexture:()=>W.VideoTexture})},568:function(L,j,w){w.d(j,{Z:function(){return M}});function P(B,O,T,Z,x,k,Y){try{var J=B[k](Y),R=J.value}catch(s){T(s);return}J.done?O(R):Promise.resolve(R).then(Z,x)}function M(B){return function(){var O=this,T=arguments;return new Promise(function(Z,x){var k=B.apply(O,T);function Y(R){P(k,Z,x,Y,J,"next",R)}function J(R){P(k,Z,x,Y,J,"throw",R)}Y(void 0)})}}},924:function(L,j,w){w.d(j,{Z:function(){return P}});function P(M,B,O){return B in M?Object.defineProperty(M,B,{value:O,enumerable:!0,configurable:!0,writable:!0}):M[B]=O,M}},42:function(L,j,w){w.d(j,{Z:function(){return M}});var P=w(924);function M(B){for(var O=1;O<arguments.length;O++){var T=arguments[O]!=null?arguments[O]:{},Z=Object.keys(T);typeof Object.getOwnPropertySymbols=="function"&&(Z=Z.concat(Object.getOwnPropertySymbols(T).filter(function(x){return Object.getOwnPropertyDescriptor(T,x).enumerable}))),Z.forEach(function(x){(0,P.Z)(B,x,T[x])})}return B}}},rt={};function N(L){var j=rt[L];if(j!==void 0)return j.exports;var w=rt[L]={exports:{}};return $t[L](w,w.exports,N),w.exports}(function(){N.n=function(L){var j=L&&L.__esModule?function(){return L.default}:function(){return L};return N.d(j,{a:j}),j}})(),function(){N.d=function(L,j){for(var w in j)N.o(j,w)&&!N.o(L,w)&&Object.defineProperty(L,w,{enumerable:!0,get:j[w]})}}(),function(){N.o=function(L,j){return Object.prototype.hasOwnProperty.call(L,j)}}();var me={};(function(){N.d(me,{Ei:function(){return Tt},Yo:function(){return Rt},Ee:function(){return ae},x1:function(){return ht},VJ:function(){return ge},r7:function(){return Ge},XA:function(){return Ie},NB:function(){return nt},xv:function(){return S},nk:function(){return Ce}});function L(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function j(e,n){return j=Object.setPrototypeOf||function(i,a){return i.__proto__=a,i},j(e,n)}function w(e,n){return j(e,n)}function P(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 M=N(42);function B(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 O(e,n){return n=n!=null?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}),e}function T(){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 x(e){return Z(e)}function k(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Y(e){return e&&e.constructor===Symbol?"symbol":typeof e}function J(e,n){return n&&(Y(n)==="object"||typeof n=="function")?n:k(e)}function R(e){var n=T();return function(){var i=x(e),a;if(n){var t=x(this).constructor;a=Reflect.construct(i,arguments,t)}else a=i.apply(this,arguments);return J(this,a)}}var s=N(949);function oe(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function re(e,n,r){return oe()?re=Reflect.construct:re=function(a,t,o){var c=[null];c.push.apply(c,t);var h=Function.bind.apply(a,c),v=new h;return o&&w(v,o.prototype),v},re.apply(null,arguments)}function $(e,n,r){return re.apply(null,arguments)}function ie(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 G(e,n,r){return n&&ie(e.prototype,n),r&&ie(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 D(e){if(Array.isArray(e))return F(e)}function X(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function U(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function H(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 I(e){return D(e)||X(e)||H(e)||U()}var q=N(484);function ue(){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 _e=e=>{var n={};return N.d(n,e),n},ee=e=>()=>e,z=_e({CSS2DObject:()=>Vt.CSS2DObject}),Se=e=>{var n={};return N.d(n,e),n},Te=e=>()=>e,Le=Se({CSS3DObject:()=>tt.CSS3DObject,CSS3DSprite:()=>tt.CSS3DSprite}),f=N(521),u=function(e){e&&((0,f.wf)(e),e.children.forEach(function(n){n.userData.BaseObject_||u(n)}))},p=function(){"use strict";function e(){L(this,e),this.objecttype__="BaseObject",this.userData={},this.pm=ue(),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=$(s.Mesh,I(a)),this},n.createGroup=function(){return this.object3d=new s.Group,this},n.createPoints=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];return this.object3d=$(s.Points,I(a)),this},n.createCSS2DObject=function(i){return this.object3d=new z.CSS2DObject(i),this},n.createCSS3DObject=function(i){return this.object3d=new Le.CSS3DObject(i),this},n.createCSS3DSprite=function(i){return this.object3d=new Le.CSS3DSprite(i),this},n.createSprite=function(i){return this.object3d=new s.Sprite(i),this},n.add=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];var o;return(o=this.object3d).add.apply(o,I(a)),this},n.remove=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];var o;return(o=this.object3d).remove.apply(o,I(a)),this},n.getSize=function(){var i=new s.Box3().setFromObject(this.object3d);return{min:i.min,max:i.max,size:i.getSize(new s.Vector3)}},n.traverse=function(i){i(this),this.children.forEach(function(a){a.traverse(i)})},n.dispose=function(){u(this.object3d)},G(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";P(r,e);var n=R(r);function r(a){L(this,r);var t;return t=n.call(this),t.width=0,t.canvas=document.createElement("canvas"),t.options=(0,M.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.position,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 _=new s.MeshBasicMaterial({side:s.DoubleSide,transparent:!0}),b=new s.PlaneGeometry(1,1,1,1);this.createMesh(b,_)}this.object3d.position.copy(o),c&&this.object3d.lookAt(c),this.setText(v)},i.setText=function(t,o){var c=(0,M.Z)(O((0,M.Z)({},this.options),{text:t}),o||{}),h=c.text,v=c.fontSize,d=c.fontFamily,m=c.fontWeight,_=c.flipX,b=c.scale,y=this.canvas;y.width=v*h.length*2,y.height=v;var A=y.getContext("2d");A.font="".concat(m," ").concat(v,"px/1 ").concat(d);var l=A.measureText(h).width;y.width=l,this.width=l,A=y.getContext("2d"),A.clearRect(0,0,y.width,y.height),_&&A.scale(-1,1),A.font="".concat(m," ").concat(v,"px/1 ").concat(d),A.textBaseline="middle",A.fillStyle="#ffffff",A.fillText(h,_?l*-1:0,y.height/2),A.restore();var C=new s.Texture(y);C.anisotropy=16,C.needsUpdate=!0;var E=this.object3d;E.material.map&&E.material.map.dispose(),E.material.map=C,E.material.needsUpdate=!0,E.scale.set(C.image.width*b,C.image.height*b,1)},r}(p),g=N(568),Q=N(666),K=N.n(Q),ae=function(e){"use strict";P(r,e);var n=R(r);function r(a){L(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)(K().mark(function o(){var c,h,v,d,m,_,b,y,A,l;return K().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return c=t.options,h=c.transparent,v=c.blending,d=c.src,m=c.depthWrite,_=c.alphaTest,b=c.sprite,y=c.sizeAttenuation,E.next=3,new s.TextureLoader().loadAsync(d);case 3:return A=E.sent,l=b?new s.SpriteMaterial({map:A,transparent:h!=null?h:!1,blending:v!=null?v:s.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:_!=null?_:0,sizeAttenuation:y!=null?y:!0}):new s.MeshBasicMaterial({map:A,transparent:h!=null?h:!1,blending:v!=null?v:s.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:_!=null?_:0}),E.abrupt("return",l);case 6:case"end":return E.stop()}},o)}))()},i.create=function(){var t=this;return(0,g.Z)(K().mark(function o(){var c,h,v,d,m,_,b,y;return K().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(c=t.options,h=c.scale,v=c.position,d=c.src,m=c.cache,_=c.sprite,!(m&&!m.get(d))){l.next=7;break}return m.init(d),l.next=5,t.getMaterial();case 5:b=l.sent,m.set(d,b);case 7:if(!m){l.next=13;break}return l.next=10,m.get(d);case 10:l.t0=l.sent,l.next=16;break;case 13:return l.next=15,t.getMaterial();case 15:l.t0=l.sent;case 16:y=l.t0,t.texture=y.map,_?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 l.stop()}},o)}))()},i.setScale=function(t){this.object3d.scale.set(this.texture.image.width*t,this.texture.image.height*t,1)},r}(p);function se(e,n){for(;!Object.prototype.hasOwnProperty.call(e,n)&&(e=x(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=se(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 Oe(e,n,r){return ne(e,n,r)}var Ce=function(e){"use strict";P(r,e);var n=R(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=(0,M.Z)({},{autoPlay:!0,loop:!0},a),t}var i=r.prototype;return i.getMaterial=function(){var t=this.options,o=t.src,c=t.transparent,h=t.blending,v=t.depthWrite,d=t.format,m=t.autoPlay,_=t.loop,b=t.alphaTest,y=t.sprite,A=ue(),l=document.createElement("video");return l.addEventListener("loadedmetadata",function(){var C=new s.VideoTexture(l);C.format=d!=null?d:s.RGBAFormat,C.needsUpdate=!0;var E=y?new s.SpriteMaterial({map:C,transparent:c!=null?c:!1,blending:h!=null?h:s.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:b!=null?b:0}):new s.MeshBasicMaterial({map:C,transparent:c!=null?c:!1,blending:h!=null?h:s.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:b!=null?b:0});A.resolve(E)},!1),l.src=o,l.muted=!0,l.autoplay=m,l.loop=_,l.preload="auto",A.promise},i.create=function(){var t=this;return(0,g.Z)(K().mark(function o(){var c,h,v,d,m,_,b,y;return K().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(c=t.options,h=c.scale,v=c.position,d=c.src,m=c.cache,_=c.sprite,!(m&&!m.get(d))){l.next=7;break}return m.init(d),l.next=5,t.getMaterial();case 5:b=l.sent,m.set(d,b);case 7:if(!m){l.next=13;break}return l.next=10,m.get(d);case 10:l.t0=l.sent,l.next=16;break;case 13:return l.next=15,t.getMaterial();case 15:l.t0=l.sent;case 16:y=l.t0,t.video=y.map.image,_?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 l.stop()}},o)}))()},i.setScale=function(t){this.object3d.scale.set(this.video.videoWidth*t,this.video.videoHeight*t,1)},i.render=function(){var t=this.options.autoPlay;t&&this.video.play()},i.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),Oe(x(r.prototype),"dispose",this).call(this)},r}(p),xe=function(e){"use strict";P(r,e);var n=R(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=(0,M.Z)({},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.position,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,g.Z)(K().mark(function o(){var c,h,v,d;return K().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return c=document.createElement("canvas"),c.width=256,c.height=256,h=c.getContext("2d"),h.fillStyle="#ff0000",h.fillRect(0,0,256,256),v=new s.CanvasTexture(c),d=new s.SpriteMaterial({map:v,opacity:t?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),_.abrupt("return",d);case 9:case"end":return _.stop()}},o)}))()},i.createPickObject=function(t){var o=t.show,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,_=t.cache,b=this;return(0,g.Z)(K().mark(function y(){var A,l,C,E;return K().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:if(A="node-create-pick-object",!(_&&!_.get(A))){V.next=7;break}return _.init(A),V.next=5,b.getMaterial(c);case 5:l=V.sent,_.set(A,l);case 7:if(!_){V.next=13;break}return V.next=10,_.get(A);case 10:V.t0=V.sent,V.next=16;break;case 13:return V.next=15,b.getMaterial(c);case 15:V.t0=V.sent;case 16:C=V.t0,E=new s.Sprite(C),E.scale.set(C.map.image.width*v.x,C.map.image.height*v.y,1),E.position.copy(m),b.add(E),b.pickObject=E;case 22:case"end":return V.stop()}},y)}))()},i.dispose=function(){var t=this.options.onClick;t&&this.clickTarge.forEach(function(o){o.removeEventListener("click",t)}),Oe(x(r.prototype),"dispose",this).call(this)},G(r,[{key:"clickTarge",get:function(){var t=this,o=this.options.clickTarge;if(o){var c=o.map(function(h){return I(t.element.querySelectorAll(h))}).flat();return c}return[this.element]}}]),r}(p),nt=xe,it=`
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 rt 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
- `),st=`
98
+ `),at=`
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
- `),ge=function(e){"use strict";P(r,e);var n=T(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(k(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);ge.prototype.setMatrixWorld=function(e){this.matrixWorld=e},ge.prototype.setGeometry=function(e,n){this._geometry=e,this.setPoints(e.getAttribute("position").array,n)},ge.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 y=m.array,_=g.position.array,x=g.width.array,l=0,S=y.length-1;l<S;l+=d){var E=y[l],ie=y[l+1];c.fromArray(_,E*3),h.fromArray(_,ie*3);var z=x[Math.floor(l/3)]!==void 0?x[Math.floor(l/3)]:1,le=e.params.Line.threshold+this.material.lineWidth*z/2,fe=le*le,Ae=i.distanceSqToSegment(c,h,t,v);if(!(Ae>fe)){t.applyMatrix4(this.matrixWorld);var pe=e.ray.origin.distanceTo(t);pe<e.near||pe>e.far||(n.push({distance:pe,point:v.clone().applyMatrix4(this.matrixWorld),index:l,face:null,faceIndex:null,object:this}),l=S)}}}}ge.prototype.raycast=Xe,ge.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]},ge.prototype.copyV3=function(e){var n=e*6;return[this.positions[n],this.positions[n+1],this.positions[n+2]]},ge.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}ge.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";P(r,e);var n=T(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(k(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 ge;return i.setFromPoints(r),a.setGeometry(i,n),a}var pt={color:new s.Color("#ffffff"),lineWidth:3,sizeAttenuation:0},vt=function(e){"use strict";P(r,e);var n=T(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,y=o.nodesArr,_=o.coordinatesArr,x=o.projection,l=o.worker,S=o.useGroups,E=ct(o,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","coordinatesArr","projection","worker","useGroups"]),ie=this.pencil.getSize(),z=ie.width,le=ie.height,fe=new Ve(O((0,A.Z)({},E),{resolution:new s.Vector2(z,le)}));if(this.material=fe,g)this.createMesh(Ke({nodes:g,setPointWidth:d}),fe);else if(y){var Ae=He.mergeBufferGeometries(y.map(function(Ee){return Ke({nodes:Ee,setPointWidth:d})}),S!=null?S:!1);this.createMesh(Ae,fe)}else if(_&&l){var pe=typeof l=="string"?new Worker(l):l;return pe.postMessage({coordinatesArr:_,projection:x,useGroups:S}),new Promise(function(Ee){pe.onmessage=function(be){var ve=be.data,Pe=new s.BufferGeometry;Object.keys(ve).forEach(function(we){we==="index"?Pe.setIndex(new s.BufferAttribute(ve[we].array,ve[we].itemSize)):Pe.setAttribute(we,new s.BufferAttribute(ve[we].array,ve[we].itemSize))}),t.createMesh(Pe,fe),Ee(""),pe.terminate()}})}},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(y){v.value.x=y.x}});this.tween=m},i.dispose=function(){var t;Ce(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 ye(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,Re=_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}),Mt=e=>{var n={};return N.d(n,e),n},hr=e=>()=>e,St=Mt({default:()=>Xt.default}),Pt=e=>{var n={};return N.d(n,e),n},pr=e=>()=>e,ke=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,Ct=Ot({geoVoronoi:()=>Ht.geoVoronoi}),Lt=e=>{var n={};return N.d(n,e),n},dr=e=>()=>e,$e=Lt({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,ke.geoDistance)(t,a)*180/Math.PI;if(o>n)for(var c=(0,ke.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(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],g=r===void 0&&i===void 0?function(){return!0}:r===void 0?function(l){return l<=i}:i===void 0?function(l){return l>=r}:i>=r?function(l){return l>=r&&l<=i}:function(l){return l>=r||l<=i},y=[],_=m[0];_<=m[1];_++){var x=h(_);g(x)&&y.push([x,v(_)])}return y}function Ne(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,ke.geoContains)(n,e):(0,St.default)(e,n)}function Bt(e,n){var r={type:"Polygon",coordinates:e},i=ye((0,ke.geoBounds)(r),2),a=ye(i[0],2),t=a[0],o=a[1],c=ye(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,Re.merge)(a),o=Bt(e,i),c=U(t).concat(U(o)),h={type:"Polygon",coordinates:e},v=ye((0,ke.geoBounds)(h),2),d=ye(v[0],2),m=d[0],g=d[1],y=ye(v[1],2),_=y[0],x=y[1],l=m>_||x>=89||g<=-89,S=[];if(l){var E=(0,Ct.geoVoronoi)(c).triangles(),ie=new Map(c.map(function(de,Me){var je=ye(de,2),me=je[0],Be=je[1];return["".concat(me,"-").concat(Be),Me]}));E.features.forEach(function(de){var Me,je=de.geometry.coordinates[0].slice(0,3).reverse(),me=[];if(je.forEach(function(Ge){var ze=ye(Ge,2),Se=ze[0],Fe=ze[1],tt="".concat(Se,"-").concat(Fe);ie.has(tt)&&me.push(ie.get(tt))}),me.length===3){if(me.some(function(Ge){return Ge<t.length})){var Be=de.properties.circumcenter;if(!Ne(Be,h,l))return}(Me=S).push.apply(Me,U(me))}})}else if(o.length)for(var pe=function(Me,je){var me,Be=[2,1,0].map(function(Se){return Ee.triangles[Me+Se]}),Ge=Be.map(function(Se){return c[Se]});if(Be.some(function(Se){return Se<t.length})){var ze=[0,1].map(function(Se){return(0,Re.mean)(Ge,function(Fe){return Fe[Se]})});if(!Ne(ze,h,l))return"continue"}(me=S).push.apply(me,U(Be))},Ee=At.default.from(c),be=0,ve=Ee.triangles.length;be<ve;be+=3)pe(be,ve);else{var z=Ue.default.flatten(a),le=z.vertices,fe=z.holes,Ae=fe===void 0?[]:fe;S=(0,Ue.default)(le,Ae,2)}var Pe=(0,$e.scaleLinear)((0,Re.extent)(c,function(de){return de[0]}),[0,1]),we=(0,$e.scaleLinear)((0,Re.extent)(c,function(de){return de[1]}),[0,1]),Dt=c.map(function(de){var Me=ye(de,2),je=Me[0],me=Me[1];return[Pe(je),we(me)]}),Wt={points:c,indices:S,uvs:Dt};return{contour:a,triangles:Wt}}var Tt=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=ye(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,Re.merge)([h,t]),d=Math.round(h.length/3),m=new Set(o),g=0,y=[],_=0;_<d;_++){var x=_+1;if(x===d)x=g;else if(m.has(x)){var l=x;x=g,g=l}y.push(_,_+d,x+d),y.push(x+d,x,_)}for(var S=[],E=1;E>=0;E--)for(var ie=0;ie<d;ie+=1)S.push(ie/(d-1),E);return{indices:y,vertices:v,uvs:S,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 kt=function(e){"use strict";P(r,e);var n=T(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,y=o.cartesian,_=o.userDataRsoOffset;(0,bt.default)(i[0])||i[0].reverse();var x=Tt(i,{resolution:g}),l=x.contour,S=x.triangles,E=(0,Re.merge)(S.uvs),ie=[],z=[],le=[],fe=0,Ae=function(be){var ve=Math.round(ie.length/3),Pe=le.length;ie=ie.concat(be.vertices),z=z.concat(be.uvs),le=le.concat(ve?be.indices.map(function(we){return we+ve}):be.indices),t.addGroup(Pe,le.length-Pe,fe++)};if(m){var pe=Je(l,c,h,y);Ae(pe),t.userData.rso=_?Je(l,c,h+_,y):pe}return v&&Ae(Qe(S,c,E,!1,y)),d&&Ae(Qe(S,h,E,!0,y)),t.setIndex(le),t[Ye]("position",new s.Float32BufferAttribute(ie,3)),t[Ye]("uv",new s.Float32BufferAttribute(z,2)),t.computeVertexNormals(),t}return r}(s.BufferGeometry),Gt=function(e){"use strict";P(r,e);var n=T(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,y=new kt(this.options.geojson,{startHeight:o,endHeight:o+c,closedBottom:h,closedTop:v,curvatureResolution:d,cartesian:g,userDataRsoOffset:m});this.createMesh(y,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";P(r,e);var n=T(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.coordinatesArr,d=o.material,m=o.useGroups,g=o.depth,y=o.split,_=o.worker,x=o.projection;if(c)this.createMesh(et({points:c,depth:g,split:y}),d);else if(h){var l=He.mergeBufferGeometries(h.map(function(E){return et({points:E,depth:g,split:y})}),m!=null?m:!1);this.createMesh(l,d)}else if(v&&_){var S=typeof _=="string"?new Worker(_):_;return S.postMessage({coordinatesArr:v,depth:g,split:y,useGroups:m,projection:x}),new Promise(function(E){S.onmessage=function(ie){var z=ie.data,le=new s.BufferGeometry;Object.keys(z).forEach(function(fe){le.setAttribute(fe,new s.BufferAttribute(z[fe].array,z[fe].itemSize))}),t.createMesh(le,d),E(""),S.terminate()}})}},r}(p)})();var Yt=_e.Ei,Jt=_e.Yo,Qt=_e.Ee,qt=_e.x1,er=_e.VJ,tr=_e.r7,rr=_e.XA,nr=_e.NB,ir=_e.xv,ar=_e.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};
132
+ `),ge=function(e){"use strict";P(r,e);var n=R(r);function r(){L(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(k(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);ge.prototype.setMatrixWorld=function(e){this.matrixWorld=e},ge.prototype.setGeometry=function(e,n){this._geometry=e,this.setPoints(e.getAttribute("position").array,n)},ge.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 Ie(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,_=o.attributes;if(m!==null)for(var b=m.array,y=_.position.array,A=_.width.array,l=0,C=b.length-1;l<C;l+=d){var E=b[l],te=b[l+1];c.fromArray(y,E*3),h.fromArray(y,te*3);var V=A[Math.floor(l/3)]!==void 0?A[Math.floor(l/3)]:1,le=e.params.Line.threshold+this.material.lineWidth*V/2,de=le*le,Ae=i.distanceSqToSegment(c,h,t,v);if(!(Ae>de)){t.applyMatrix4(this.matrixWorld);var fe=e.ray.origin.distanceTo(t);fe<e.near||fe>e.far||(n.push({distance:fe,point:v.clone().applyMatrix4(this.matrixWorld),index:l,face:null,faceIndex:null,object:this}),l=C)}}}}ge.prototype.raycast=Ie,ge.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]},ge.prototype.copyV3=function(e){var n=e*6;return[this.positions[n],this.positions[n+1],this.positions[n+2]]},ge.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}ge.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=it,s.ShaderChunk.meshline_frag=at;var Ge=function(e){"use strict";P(r,e);var n=R(r);function r(i){L(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(k(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);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 ot(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 st(e,n){if(e==null)return{};var r=ot(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 ut=e=>{var n={};return N.d(n,e),n},or=e=>()=>e,ct=ut({animate:()=>Ut.animate}),lt=e=>{var n={};return N.d(n,e),n},sr=e=>()=>e,Ze=lt({mergeBufferGeometries:()=>Nt.mergeBufferGeometries});function Xe(e){var n=e.setPointWidth,r=e.nodes,i=new s.BufferGeometry,a=new ge;return i.setFromPoints(r),a.setGeometry(i,n),a}var ft={color:new s.Color("#ffffff"),lineWidth:3,sizeAttenuation:0},ht=function(e){"use strict";P(r,e);var n=R(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};L(this,r);var t;return t=n.call(this),t.options=(0,M.Z)({},ft,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,_=o.nodes,b=o.nodesArr,y=o.coordinatesArr,A=o.projection,l=o.workerController,C=o.useGroups,E=st(o,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","coordinatesArr","projection","workerController","useGroups"]),te=this.pencil.getSize(),V=te.width,le=te.height,de=new Ge(O((0,M.Z)({},E),{resolution:new s.Vector2(V,le)}));if(this.material=de,_)this.createMesh(Xe({nodes:_,setPointWidth:d}),de);else if(b){var Ae=Ze.mergeBufferGeometries(b.map(function(fe){return Xe({nodes:fe,setPointWidth:d})}),C!=null?C:!1);this.createMesh(Ae,de)}else if(y&&l)return new Promise(function(fe){l.postMessage({coordinatesArr:y,projection:A,useGroups:C},function(ce){var be=new s.BufferGeometry;Object.keys(ce).forEach(function(he){he==="index"?be.setIndex(new s.BufferAttribute(ce[he].array,ce[he].itemSize)):be.setAttribute(he,new s.BufferAttribute(ce[he].array,ce[he].itemSize))}),t.createMesh(be,de),fe("")})})},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,ct.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;Oe(x(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 ye(e,n){return pt(e)||X(e,n)||H(e,n)||vt()}var dt=e=>{var n={};return N.d(n,e),n},ur=e=>()=>e,Ee=dt({extent:()=>Fe.extent,mean:()=>Fe.mean,merge:()=>Fe.merge}),mt=e=>{var n={};return N.d(n,e),n},cr=e=>()=>e,De=mt({default:()=>Ft.default}),_t=e=>{var n={};return N.d(n,e),n},lr=e=>()=>e,gt=_t({default:()=>It.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 N.d(n,e),n},fr=e=>()=>e,wt=bt({default:()=>Zt.default}),xt=e=>{var n={};return N.d(n,e),n},hr=e=>()=>e,At=xt({default:()=>Xt.default}),Mt=e=>{var n={};return N.d(n,e),n},pr=e=>()=>e,je=Mt({geoBounds:()=>Re.geoBounds,geoContains:()=>Re.geoContains,geoDistance:()=>Re.geoDistance,geoInterpolate:()=>Re.geoInterpolate}),St=e=>{var n={};return N.d(n,e),n},vr=e=>()=>e,Pt=St({geoVoronoi:()=>Ht.geoVoronoi}),Ot=e=>{var n={};return N.d(n,e),n},dr=e=>()=>e,He=Ot({scaleLinear:()=>Kt.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 c=(0,je.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 Et(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.minLng,i=n.maxLng,a=n.minLat,t=n.maxLat,o=Math.round(Math.pow(360/e,2)/Math.PI),c=(1+Math.sqrt(5))/2,h=function(l){return l/c*360%360-180},v=function(l){return Math.acos(2*l/o-1)/Math.PI*180-90},d=function(l){return o*(Math.cos((l+90)*Math.PI/180)+1)/2},m=[t!==void 0?Math.ceil(d(t)):0,a!==void 0?Math.floor(d(a)):o-1],_=r===void 0&&i===void 0?function(){return!0}:r===void 0?function(l){return l<=i}:i===void 0?function(l){return l>=r}:i>=r?function(l){return l>=r&&l<=i}:function(l){return l>=r||l<=i},b=[],y=m[0];y<=m[1];y++){var A=h(y);_(A)&&b.push([A,v(y)])}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 Lt(e,n){var r={type:"Polygon",coordinates:e},i=ye((0,je.geoBounds)(r),2),a=ye(i[0],2),t=a[0],o=a[1],c=ye(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 Et(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,Ee.merge)(a),o=Lt(e,i),c=I(t).concat(I(o)),h={type:"Polygon",coordinates:e},v=ye((0,je.geoBounds)(h),2),d=ye(v[0],2),m=d[0],_=d[1],b=ye(v[1],2),y=b[0],A=b[1],l=m>y||A>=89||_<=-89,C=[];if(l){var E=(0,Pt.geoVoronoi)(c).triangles(),te=new Map(c.map(function(pe,Pe){var Me=ye(pe,2),ve=Me[0],Be=Me[1];return["".concat(ve,"-").concat(Be),Pe]}));E.features.forEach(function(pe){var Pe,Me=pe.geometry.coordinates[0].slice(0,3).reverse(),ve=[];if(Me.forEach(function(ke){var we=ye(ke,2),Ne=we[0],Wt=we[1],qe="".concat(Ne,"-").concat(Wt);te.has(qe)&&ve.push(te.get(qe))}),ve.length===3){if(ve.some(function(ke){return ke<t.length})){var Be=pe.properties.circumcenter;if(!We(Be,h,l))return}(Pe=C).push.apply(Pe,I(ve))}})}else if(o.length)for(var fe=function(pe,Pe){var Me,ve=[2,1,0].map(function(we){return ce.triangles[pe+we]}),Be=ve.map(function(we){return c[we]});if(ve.some(function(we){return we<t.length})){var ke=[0,1].map(function(we){return(0,Ee.mean)(Be,function(Ne){return Ne[we]})});if(!We(ke,h,l))return"continue"}(Me=C).push.apply(Me,I(ve))},ce=wt.default.from(c),be=0,he=ce.triangles.length;be<he;be+=3)fe(be,he);else{var V=De.default.flatten(a),le=V.vertices,de=V.holes,Ae=de===void 0?[]:de;C=(0,De.default)(le,Ae,2)}var Ue=(0,He.scaleLinear)((0,Ee.extent)(c,function(pe){return pe[0]}),[0,1]),zt=(0,He.scaleLinear)((0,Ee.extent)(c,function(pe){return pe[1]}),[0,1]),Gt=c.map(function(pe){var Pe=ye(pe,2),Me=Pe[0],ve=Pe[1];return[Ue(Me),zt(ve)]}),Dt={points:c,indices:C,uvs:Gt};return{contour:a,triangles:Dt}}var Bt=jt,Ke=new s.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function Ve(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=ye(t,2),c=o[0],h=o[1];return r?yt(c,h,n):[c,h,n]})});return De.default.flatten(i)}function $e(e,n,r){for(var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=Ve(e,n,i),t=a.vertices,o=a.holes,c=Ve(e,r,i),h=c.vertices,v=(0,Ee.merge)([h,t]),d=Math.round(h.length/3),m=new Set(o),_=0,b=[],y=0;y<d;y++){var A=y+1;if(A===d)A=_;else if(m.has(A)){var l=A;A=_,_=l}b.push(y,y+d,A+d),b.push(A+d,A,y)}for(var C=[],E=1;E>=0;E--)for(var te=0;te<d;te+=1)C.push(te/(d-1),E);return{indices:b,vertices:v,uvs:C,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:Ve([e.points],n,a).vertices,uvs:r}}var kt=function(e){"use strict";P(r,e);var n=R(r);function r(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};L(this,r);var t;t=n.call(this),t.type="PolygonBufferGeometry",t.parameters=(0,M.Z)({},{polygonGeoJson:i,startHeight:0,endHeight:1,closedBottom:!0,closedTop:!0,includeSides:!0,curvatureResolution:5,cartesian:!0,userDataRsoOffset:0},a);var o=t.parameters,c=o.startHeight,h=o.endHeight,v=o.closedBottom,d=o.closedTop,m=o.includeSides,_=o.curvatureResolution,b=o.cartesian,y=o.userDataRsoOffset;(0,gt.default)(i[0])||i[0].reverse();var A=Bt(i,{resolution:_}),l=A.contour,C=A.triangles,E=(0,Ee.merge)(C.uvs),te=[],V=[],le=[],de=0,Ae=function(ce){var be=Math.round(te.length/3),he=le.length;te=te.concat(ce.vertices),V=V.concat(ce.uvs),le=le.concat(be?ce.indices.map(function(Ue){return Ue+be}):ce.indices),t.addGroup(he,le.length-he,de++)};if(m){var fe=$e(l,c,h,b);Ae(fe),t.userData.rso=y?$e(l,c,h+y,b):fe}return v&&Ae(Ye(C,c,E,!1,b)),d&&Ae(Ye(C,h,E,!0,b)),t.setIndex(le),t[Ke]("position",new s.Float32BufferAttribute(te,3)),t[Ke]("uv",new s.Float32BufferAttribute(V,2)),t.computeVertexNormals(),t}return r}(s.BufferGeometry),Tt=function(e){"use strict";P(r,e);var n=R(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=(0,M.Z)({},{geojson:[[[]]],startHeight:0,height:5,closedBottom:!0,closedTop:!0,curvatureResolution:1,cartesian:!0,userDataRsoOffset:0},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.startHeight,c=t.height,h=t.closedBottom,v=t.closedTop,d=t.curvatureResolution,m=t.userDataRsoOffset,_=t.cartesian,b=new kt(this.options.geojson,{startHeight:o,endHeight:o+c,closedBottom:h,closedTop:v,curvatureResolution:d,cartesian:_,userDataRsoOffset:m});this.createMesh(b,this.options.material)},r}(p),Je=N(705);function Qe(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 Rt=function(e){"use strict";P(r,e);var n=R(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=(0,M.Z)({},a),t}var i=r.prototype;return i.create=function(){var t=this,o=this.options,c=o.points,h=o.pointsArr,v=o.coordinatesArr,d=o.material,m=o.useGroups,_=o.depth,b=o.split,y=o.workerController,A=o.projection;if(c)this.createMesh(Qe({points:c,depth:_,split:b}),d);else if(h){var l=Ze.mergeBufferGeometries(h.map(function(C){return Qe({points:C,depth:_,split:b})}),m!=null?m:!1);this.createMesh(l,d)}else if(v&&y)return new Promise(function(C){y.postMessage({coordinatesArr:v,depth:_,split:b,useGroups:m,projection:A},function(E){var te=new s.BufferGeometry;Object.keys(E).forEach(function(V){te.setAttribute(V,new s.BufferAttribute(E[V].array,E[V].itemSize))}),t.createMesh(te,d),C("")})})},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};
@@ -1,6 +1,7 @@
1
1
  import * as THREE from 'three';
2
2
  import { PlaybackControls } from 'popmotion';
3
3
  import BaseObject from '../../core/BaseObject';
4
+ import type WorkerController from '../../plugins/Worker';
4
5
  import { MeshLineMaterial } from './meshLine';
5
6
  declare type Coordinate = [number, number];
6
7
  interface Options {
@@ -12,7 +13,7 @@ interface Options {
12
13
  scale: number;
13
14
  };
14
15
  key?: string;
15
- worker?: string | Worker;
16
+ workerController?: WorkerController;
16
17
  useGroups?: boolean;
17
18
  duration?: number;
18
19
  delay?: number;
@@ -0,0 +1,19 @@
1
+ declare type GetWk = () => Worker;
2
+ export default class {
3
+ workerList: {
4
+ worker: Worker;
5
+ inUse: boolean;
6
+ }[];
7
+ install(): void;
8
+ init(scriptURL: string | GetWk, length: number): void;
9
+ messageList: {
10
+ req: Record<string, any>;
11
+ cb: any;
12
+ uuid: string;
13
+ inUse: boolean;
14
+ }[];
15
+ postMessage(req: Record<string, any>, cb: any): void;
16
+ checkMessage(): void;
17
+ dispose(): void;
18
+ }
19
+ export {};
@@ -1,3 +1,4 @@
1
1
  export { default as Cache } from './Cache';
2
2
  export { default as Draw } from './Draw';
3
3
  export { default as Data } from './Data';
4
+ export { default as Wk } from './Worker';
@@ -1 +1 @@
1
- (function(){var X={666:function(_){var y=function(s){"use strict";var k=Object.prototype,j=k.hasOwnProperty,p,P=typeof Symbol=="function"?Symbol:{},E=P.iterator||"@@iterator",M=P.asyncIterator||"@@asyncIterator",b=P.toStringTag||"@@toStringTag";function A(e,t,a){return Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{A({},"")}catch(e){A=function(t,a,h){return t[a]=h}}function R(e,t,a,h){var c=t&&t.prototype instanceof G?t:G,L=Object.create(c.prototype),V=new F(h||[]);return L._invoke=g(e,a,V),L}s.wrap=R;function v(e,t,a){try{return{type:"normal",arg:e.call(t,a)}}catch(h){return{type:"throw",arg:h}}}var x="suspendedStart",U="suspendedYield",N="executing",z="completed",T={};function G(){}function d(){}function n(){}var o={};A(o,E,function(){return this});var i=Object.getPrototypeOf,r=i&&i(i(w([])));r&&r!==k&&j.call(r,E)&&(o=r);var u=n.prototype=G.prototype=Object.create(o);d.prototype=n,A(u,"constructor",n),A(n,"constructor",d),d.displayName=A(n,b,"GeneratorFunction");function l(e){["next","throw","return"].forEach(function(t){A(e,t,function(a){return this._invoke(t,a)})})}s.isGeneratorFunction=function(e){var t=typeof e=="function"&&e.constructor;return t?t===d||(t.displayName||t.name)==="GeneratorFunction":!1},s.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,n):(e.__proto__=n,A(e,b,"GeneratorFunction")),e.prototype=Object.create(u),e},s.awrap=function(e){return{__await:e}};function f(e,t){function a(L,V,H,Z){var I=v(e[L],e,V);if(I.type==="throw")Z(I.arg);else{var K=I.arg,B=K.value;return B&&typeof B=="object"&&j.call(B,"__await")?t.resolve(B.__await).then(function(W){a("next",W,H,Z)},function(W){a("throw",W,H,Z)}):t.resolve(B).then(function(W){K.value=W,H(K)},function(W){return a("throw",W,H,Z)})}}var h;function c(L,V){function H(){return new t(function(Z,I){a(L,V,Z,I)})}return h=h?h.then(H,H):H()}this._invoke=c}l(f.prototype),A(f.prototype,M,function(){return this}),s.AsyncIterator=f,s.async=function(e,t,a,h,c){c===void 0&&(c=Promise);var L=new f(R(e,t,a,h),c);return s.isGeneratorFunction(t)?L:L.next().then(function(V){return V.done?V.value:L.next()})};function g(e,t,a){var h=x;return function(L,V){if(h===N)throw new Error("Generator is already running");if(h===z){if(L==="throw")throw V;return O()}for(a.method=L,a.arg=V;;){var H=a.delegate;if(H){var Z=m(H,a);if(Z){if(Z===T)continue;return Z}}if(a.method==="next")a.sent=a._sent=a.arg;else if(a.method==="throw"){if(h===x)throw h=z,a.arg;a.dispatchException(a.arg)}else a.method==="return"&&a.abrupt("return",a.arg);h=N;var I=v(e,t,a);if(I.type==="normal"){if(h=a.done?z:U,I.arg===T)continue;return{value:I.arg,done:a.done}}else I.type==="throw"&&(h=z,a.method="throw",a.arg=I.arg)}}}function m(e,t){var a=e.iterator[t.method];if(a===p){if(t.delegate=null,t.method==="throw"){if(e.iterator.return&&(t.method="return",t.arg=p,m(e,t),t.method==="throw"))return T;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return T}var h=v(a,e.iterator,t.arg);if(h.type==="throw")return t.method="throw",t.arg=h.arg,t.delegate=null,T;var c=h.arg;if(!c)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,T;if(c.done)t[e.resultName]=c.value,t.next=e.nextLoc,t.method!=="return"&&(t.method="next",t.arg=p);else return c;return t.delegate=null,T}l(u),A(u,b,"Generator"),A(u,E,function(){return this}),A(u,"toString",function(){return"[object Generator]"});function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function F(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}s.keys=function(e){var t=[];for(var a in e)t.push(a);return t.reverse(),function h(){for(;t.length;){var c=t.pop();if(c in e)return h.value=c,h.done=!1,h}return h.done=!0,h}};function w(e){if(e){var t=e[E];if(t)return t.call(e);if(typeof e.next=="function")return e;if(!isNaN(e.length)){var a=-1,h=function c(){for(;++a<e.length;)if(j.call(e,a))return c.value=e[a],c.done=!1,c;return c.value=p,c.done=!0,c};return h.next=h}}return{next:O}}s.values=w;function O(){return{value:p,done:!0}}return F.prototype={constructor:F,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=p,this.done=!1,this.delegate=null,this.method="next",this.arg=p,this.tryEntries.forEach(C),!e)for(var t in this)t.charAt(0)==="t"&&j.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=p)},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function a(Z,I){return L.type="throw",L.arg=e,t.next=Z,I&&(t.method="next",t.arg=p),!!I}for(var h=this.tryEntries.length-1;h>=0;--h){var c=this.tryEntries[h],L=c.completion;if(c.tryLoc==="root")return a("end");if(c.tryLoc<=this.prev){var V=j.call(c,"catchLoc"),H=j.call(c,"finallyLoc");if(V&&H){if(this.prev<c.catchLoc)return a(c.catchLoc,!0);if(this.prev<c.finallyLoc)return a(c.finallyLoc)}else if(V){if(this.prev<c.catchLoc)return a(c.catchLoc,!0)}else if(H){if(this.prev<c.finallyLoc)return a(c.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(e,t){for(var a=this.tryEntries.length-1;a>=0;--a){var h=this.tryEntries[a];if(h.tryLoc<=this.prev&&j.call(h,"finallyLoc")&&this.prev<h.finallyLoc){var c=h;break}}c&&(e==="break"||e==="continue")&&c.tryLoc<=t&&t<=c.finallyLoc&&(c=null);var L=c?c.completion:{};return L.type=e,L.arg=t,c?(this.method="next",this.next=c.finallyLoc,T):this.complete(L)},complete:function(e,t){if(e.type==="throw")throw e.arg;return e.type==="break"||e.type==="continue"?this.next=e.arg:e.type==="return"?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):e.type==="normal"&&t&&(this.next=t),T},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.finallyLoc===e)return this.complete(a.completion,a.afterLoc),C(a),T}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.tryLoc===e){var h=a.completion;if(h.type==="throw"){var c=h.arg;C(a)}return c}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,a){return this.delegate={iterator:w(e),resultName:t,nextLoc:a},this.method==="next"&&(this.arg=p),T}},s}(_.exports);try{regeneratorRuntime=y}catch(s){typeof globalThis=="object"?globalThis.regeneratorRuntime=y:Function("r","regeneratorRuntime = r")(y)}},402:function(_,y,s){"use strict";s.d(y,{makePromiseCreator:function(){return k.Z}});var k=s(340),j=s(666),p=s.n(j),P=null,E=s(644);function M(T){if(T.material){var G=Array.isArray(T.material)?T.material:[T.material];G.forEach(function(d){var n,o;(n=d.color)===null||n===void 0||n.convertSRGBToLinear(),(o=d.emissive)===null||o===void 0||o.convertSRGBToLinear(),d.map&&(d.map.encoding=THREE.sRGBEncoding),d.emissiveMap&&(d.emissiveMap.encoding=THREE.sRGBEncoding)})}}var b=s(568),A=s(924),R=require("idb-keyval"),v=s(485),x=null,U=null,N=function(){var T=(0,b.Z)(p().mark(function G(d,n){var o,i,r,u,l,f;return p().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return o=n.version,m.next=4,(0,R.get)(d);case 4:if(r=m.sent,!(r&&r[o])){m.next=9;break}i=r[o],m.next=15;break;case 9:return m.next=11,(0,v.Z)(fetch(d).then(function(S){if(S.ok)return S.blob();throw new Error}));case 11:u=m.sent,l=u.res,f=u.err,f||(i=l,(0,R.set)(d,(0,A.Z)({},o,l)));case 15:return m.abrupt("return",i?{url:URL.createObjectURL(i)}:{url:d});case 16:case"end":return m.stop()}},G)}));return function(d,n){return T.apply(this,arguments)}}(),z=s(818)},340:function(_,y,s){"use strict";s.d(y,{Z:function(){return j}});var k=s(485);function j(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},E={};return E.promise=new Promise(function(M,b){E.resolve=M,E.reject=b}),p&&(E.promise=(0,k.Z)(E.promise,P)),E}},485:function(_,y,s){"use strict";s.d(y,{Z:function(){return j}});var k=s(42);function j(p){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return p.then(function(E){return(0,k.Z)({err:null,res:E},P)}).catch(function(E){return(0,k.Z)({err:E,res:void 0},P)})}},818:function(_,y,s){"use strict";var k=s(644),j=s.n(k),p=new Map,P=function(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(R,v,x,U,N){var z=v[x*3],T=v[x*3+1],G=v[U*3],d=v[U*3+1],n=v[N*3],o=v[N*3+1],i;if(p.has(R))i=p.get(R);else{var r=b.box3||new THREE.Box3;if(!b.box3){var u=R.parameters.shapes.getPoints();r.setFromArray(u.map(function(S){return[S.x,S.y,0]}).flat())}var l=r.getSize(new THREE.Vector3);b.split&&(l.y/=b.split),i={box:r,size:l},p.set(R,i)}var f=i.box,g=i.size,m=b.split?1-b.split:0;return[new THREE.Vector2((z-f.min.x)/g.x,(T-f.min.y)/g.y+m),new THREE.Vector2((G-f.min.x)/g.x,(d-f.min.y)/g.y+m),new THREE.Vector2((n-f.min.x)/g.x,(o-f.min.y)/g.y+m)]},generateSideWallUV:function(R,v,x,U,N,z){var T=v[x*3],G=v[x*3+1],d=v[x*3+2],n=v[U*3],o=v[U*3+1],i=v[U*3+2],r=v[N*3],u=v[N*3+1],l=v[N*3+2],f=v[z*3],g=v[z*3+1],m=v[z*3+2],S;if(p.has(v))S=p.get(v);else{var C=new THREE.Box3;C.setFromArray(v);var F=C.getSize(new THREE.Vector3);b.split&&(F.z/=1-b.split),S={box:C,size:F},p.set(v,S)}var w=S.box,O=S.size;return Math.abs(G-o)<Math.abs(T-n)?[new THREE.Vector2((T-w.min.x)/O.x,(d-w.min.z)/O.z),new THREE.Vector2((n-w.min.x)/O.x,(i-w.min.z)/O.z),new THREE.Vector2((r-w.min.x)/O.x,(l-w.min.z)/O.z),new THREE.Vector2((f-w.min.x)/O.x,(m-w.min.z)/O.z)]:[new THREE.Vector2((G-w.min.y)/O.x,(d-w.min.z)/O.z),new THREE.Vector2((o-w.min.y)/O.x,(i-w.min.z)/O.z),new THREE.Vector2((u-w.min.y)/O.x,(l-w.min.z)/O.z),new THREE.Vector2((g-w.min.y)/O.x,(m-w.min.z)/O.z)]}}},E=function(){p.clear()}},644:function(_){"use strict";_.exports=require("three")},568:function(_,y,s){"use strict";s.d(y,{Z:function(){return j}});function k(p,P,E,M,b,A,R){try{var v=p[A](R),x=v.value}catch(U){E(U);return}v.done?P(x):Promise.resolve(x).then(M,b)}function j(p){return function(){var P=this,E=arguments;return new Promise(function(M,b){var A=p.apply(P,E);function R(x){k(A,M,b,R,v,"next",x)}function v(x){k(A,M,b,R,v,"throw",x)}R(void 0)})}}},924:function(_,y,s){"use strict";s.d(y,{Z:function(){return k}});function k(j,p,P){return p in j?Object.defineProperty(j,p,{value:P,enumerable:!0,configurable:!0,writable:!0}):j[p]=P,j}},42:function(_,y,s){"use strict";s.d(y,{Z:function(){return j}});var k=s(924);function j(p){for(var P=1;P<arguments.length;P++){var E=arguments[P]!=null?arguments[P]:{},M=Object.keys(E);typeof Object.getOwnPropertySymbols=="function"&&(M=M.concat(Object.getOwnPropertySymbols(E).filter(function(b){return Object.getOwnPropertyDescriptor(E,b).enumerable}))),M.forEach(function(b){(0,k.Z)(p,b,E[b])})}return p}}},Y={};function D(_){var y=Y[_];if(y!==void 0)return y.exports;var s=Y[_]={exports:{}};return X[_](s,s.exports,D),s.exports}(function(){D.n=function(_){var y=_&&_.__esModule?function(){return _.default}:function(){return _};return D.d(y,{a:y}),y}})(),function(){D.d=function(_,y){for(var s in y)D.o(y,s)&&!D.o(_,s)&&Object.defineProperty(_,s,{enumerable:!0,get:y[s]})}}(),function(){D.o=function(_,y){return Object.prototype.hasOwnProperty.call(_,y)}}(),function(){D.r=function(_){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(_,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(_,"__esModule",{value:!0})}}();var $={};(function(){"use strict";D.r($),D.d($,{Cache:function(){return s},Data:function(){return d},Draw:function(){return G}});function _(n,o){if(!(n instanceof o))throw new TypeError("Cannot call a class as a function")}var y=D(402),s=function(){"use strict";function n(){_(this,n),this.cache=new Map}var o=n.prototype;return o.install=function(){},o.init=function(r){var u=(0,y.makePromiseCreator)();this.cache.set(r,u)},o.get=function(r){var u;return(u=this.cache.get(r))===null||u===void 0?void 0:u.promise},o.set=function(r,u){var l=this.cache.get(r);l?l.resolve(u):console.warn("init cache first")},o.dispose=function(){this.cache.forEach(function(r,u){r.reject("stop set cache:".concat(u))}),this.cache.clear()},n}(),k=D(568);function j(n,o){for(var i=0;i<o.length;i++){var r=o[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function p(n,o,i){return o&&j(n.prototype,o),i&&j(n,i),n}function P(n){if(Array.isArray(n))return n}function E(n){if(typeof Symbol!="undefined"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function M(){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 b(n,o){(o==null||o>n.length)&&(o=n.length);for(var i=0,r=new Array(o);i<o;i++)r[i]=n[i];return r}function A(n,o){if(!!n){if(typeof n=="string")return b(n,o);var i=Object.prototype.toString.call(n).slice(8,-1);if(i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set")return Array.from(i);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return b(n,o)}}function R(n,o){return P(n)||E(n,o)||A(n,o)||M()}function v(n){if(Array.isArray(n))return b(n)}function x(){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 U(n){return v(n)||E(n)||A(n)||x()}var N=D(666),z=D.n(N),T=D(644),G=function(){"use strict";function n(i){_(this,n),this.objectNamesToFactories=new Map,this.objects=new Map,this.objects_=i}var o=n.prototype;return o.install=function(r){this.pencil=r,this.initObjectFactories()},o.initObjectFactories=function(){var r=this,u=this.objects_;Object.keys(u).forEach(function(l){var f=function(){function g(){_(this,g)}var m=g.prototype;return m.create=function(){var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new u[l](C)},g}();r.objectNamesToFactories.set(l,f)})},o.getObject=function(r,u){r.includes("#")&&console.warn("getObject:err:\u4E0D\u652F\u6301 #",r);var l=(u||{}).key,f="".concat(r).concat(l?"#".concat(l):""),g=this.objects.get(f);return g},o.getAllObject=function(r,u){r.includes("#")&&console.warn("getAllObject:err:\u4E0D\u652F\u6301 #",r);var l=(u||{}).key,f="".concat(r).concat(l?"#".concat(l):""),g=[];return this.objects.forEach(function(m,S){(S.startsWith("".concat(f,"#"))||S===f)&&g.push(m)}),g},o.draw=function(r,u,l){var f=this;return(0,k.Z)(z().mark(function g(){var m,S,C,F,w,O,e;return z().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(m=f.objectNamesToFactories.get(r),!m){a.next=15;break}return S=(u||{}).key,C="".concat(r).concat(S?"#".concat(S):""),f.objects.has(C)&&(F=T.MathUtils.generateUUID(),C+="#".concat(F)),w=(u==null?void 0:u.target)||l,typeof w=="string"?O=f.objects.get(w):(w==null?void 0:w.objecttype__)==="BaseObject"?O=w:O=f.pencil.scene,e=new m().create(u),e.pencil=f.pencil,e.key=C,f.objects.set(C,e),a.next=14,f.addMesh(e,O);case 14:return a.abrupt("return",e);case 15:throw new Error("Unrecognized:".concat(r));case 16:case"end":return a.stop()}},g)}))()},o.addMesh=function(r,u){return(0,k.Z)(z().mark(function l(){return z().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,r.create();case 2:r.object3d&&(r.object3d.userData.BaseObject_=r,u.add(r.object3d)),r.visible=!0,r.render(),r.pm.resolve();case 6:case"end":return g.stop()}},l)}))()},o.erase=function(){for(var r=arguments.length,u=new Array(r),l=0;l<r;l++)u[l]=arguments[l];var f=this;U(u).forEach(function(g){var m=[];if(typeof g=="string"){var S,C=R(g.split("#"),2),F=C[0],w=C[1];(S=m).push.apply(S,U(f.getAllObject(F,{key:w})))}else m.push(g);m.forEach(function(O){f.removeMesh(O)})})},o.removeMesh=function(r){var u=this,l=r.parent;r.object3d&&l.remove(r.object3d),r.traverse(function(f){f.visible=!1,f.dispose(),u.objects.delete(f.key)})},o.update=function(r,u){this.objects.forEach(function(l){l.update(r,u)})},o.setSize=function(r,u){this.objects.forEach(function(l){l.resize(r,u)})},o.dispose=function(){this.objects.forEach(function(r,u){r.dispose(),r.pm.reject("stop draw:".concat(u))}),this.objects.clear(),this.objectNamesToFactories.clear()},p(n,[{key:"objectsPromise",get:function(){var r=[];return this.objects.forEach(function(u){r.push(u.pm.promise)}),r}}]),n}(),d=function(){"use strict";function n(){_(this,n),this.data={}}var o=n.prototype;return o.install=function(){},o.setData=function(r,u){var l,f;this.data[r]=u,(f=(l=this).cb)===null||f===void 0||f.call(l,r)},o.runAll=function(){var r=this;Object.keys(this.data).forEach(function(u){var l,f;(f=(l=r).cb)===null||f===void 0||f.call(l,u)})},o.dispose=function(){this.data={},this.cb=void 0},n}()})(),module.exports=$})();
1
+ (function(){var X={666:function(y){var b=function(f){"use strict";var A=Object.prototype,T=A.hasOwnProperty,d,O=typeof Symbol=="function"?Symbol:{},E=O.iterator||"@@iterator",L=O.asyncIterator||"@@asyncIterator",j=O.toStringTag||"@@toStringTag";function p(r,t,a){return Object.defineProperty(r,t,{value:a,enumerable:!0,configurable:!0,writable:!0}),r[t]}try{p({},"")}catch(r){p=function(t,a,c){return t[a]=c}}function S(r,t,a,c){var l=t&&t.prototype instanceof R?t:R,x=Object.create(l.prototype),D=new m(c||[]);return x._invoke=h(r,a,D),x}f.wrap=S;function M(r,t,a){try{return{type:"normal",arg:r.call(t,a)}}catch(c){return{type:"throw",arg:c}}}var C="suspendedStart",N="suspendedYield",W="executing",U="completed",k={};function R(){}function _(){}function w(){}var n={};p(n,E,function(){return this});var s=Object.getPrototypeOf,o=s&&s(s(Z([])));o&&o!==A&&T.call(o,E)&&(n=o);var e=w.prototype=R.prototype=Object.create(n);_.prototype=w,p(e,"constructor",w),p(w,"constructor",_),_.displayName=p(w,j,"GeneratorFunction");function i(r){["next","throw","return"].forEach(function(t){p(r,t,function(a){return this._invoke(t,a)})})}f.isGeneratorFunction=function(r){var t=typeof r=="function"&&r.constructor;return t?t===_||(t.displayName||t.name)==="GeneratorFunction":!1},f.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,w):(r.__proto__=w,p(r,j,"GeneratorFunction")),r.prototype=Object.create(e),r},f.awrap=function(r){return{__await:r}};function u(r,t){function a(x,D,I,V){var H=M(r[x],r,D);if(H.type==="throw")V(H.arg);else{var K=H.arg,B=K.value;return B&&typeof B=="object"&&T.call(B,"__await")?t.resolve(B.__await).then(function(F){a("next",F,I,V)},function(F){a("throw",F,I,V)}):t.resolve(B).then(function(F){K.value=F,I(K)},function(F){return a("throw",F,I,V)})}}var c;function l(x,D){function I(){return new t(function(V,H){a(x,D,V,H)})}return c=c?c.then(I,I):I()}this._invoke=l}i(u.prototype),p(u.prototype,L,function(){return this}),f.AsyncIterator=u,f.async=function(r,t,a,c,l){l===void 0&&(l=Promise);var x=new u(S(r,t,a,c),l);return f.isGeneratorFunction(t)?x:x.next().then(function(D){return D.done?D.value:x.next()})};function h(r,t,a){var c=C;return function(x,D){if(c===W)throw new Error("Generator is already running");if(c===U){if(x==="throw")throw D;return G()}for(a.method=x,a.arg=D;;){var I=a.delegate;if(I){var V=v(I,a);if(V){if(V===k)continue;return V}}if(a.method==="next")a.sent=a._sent=a.arg;else if(a.method==="throw"){if(c===C)throw c=U,a.arg;a.dispatchException(a.arg)}else a.method==="return"&&a.abrupt("return",a.arg);c=W;var H=M(r,t,a);if(H.type==="normal"){if(c=a.done?U:N,H.arg===k)continue;return{value:H.arg,done:a.done}}else H.type==="throw"&&(c=U,a.method="throw",a.arg=H.arg)}}}function v(r,t){var a=r.iterator[t.method];if(a===d){if(t.delegate=null,t.method==="throw"){if(r.iterator.return&&(t.method="return",t.arg=d,v(r,t),t.method==="throw"))return k;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return k}var c=M(a,r.iterator,t.arg);if(c.type==="throw")return t.method="throw",t.arg=c.arg,t.delegate=null,k;var l=c.arg;if(!l)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,k;if(l.done)t[r.resultName]=l.value,t.next=r.nextLoc,t.method!=="return"&&(t.method="next",t.arg=d);else return l;return t.delegate=null,k}i(e),p(e,j,"Generator"),p(e,E,function(){return this}),p(e,"toString",function(){return"[object Generator]"});function P(r){var t={tryLoc:r[0]};1 in r&&(t.catchLoc=r[1]),2 in r&&(t.finallyLoc=r[2],t.afterLoc=r[3]),this.tryEntries.push(t)}function g(r){var t=r.completion||{};t.type="normal",delete t.arg,r.completion=t}function m(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(P,this),this.reset(!0)}f.keys=function(r){var t=[];for(var a in r)t.push(a);return t.reverse(),function c(){for(;t.length;){var l=t.pop();if(l in r)return c.value=l,c.done=!1,c}return c.done=!0,c}};function Z(r){if(r){var t=r[E];if(t)return t.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length)){var a=-1,c=function l(){for(;++a<r.length;)if(T.call(r,a))return l.value=r[a],l.done=!1,l;return l.value=d,l.done=!0,l};return c.next=c}}return{next:G}}f.values=Z;function G(){return{value:d,done:!0}}return m.prototype={constructor:m,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=d,this.done=!1,this.delegate=null,this.method="next",this.arg=d,this.tryEntries.forEach(g),!r)for(var t in this)t.charAt(0)==="t"&&T.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=d)},stop:function(){this.done=!0;var r=this.tryEntries[0],t=r.completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var t=this;function a(V,H){return x.type="throw",x.arg=r,t.next=V,H&&(t.method="next",t.arg=d),!!H}for(var c=this.tryEntries.length-1;c>=0;--c){var l=this.tryEntries[c],x=l.completion;if(l.tryLoc==="root")return a("end");if(l.tryLoc<=this.prev){var D=T.call(l,"catchLoc"),I=T.call(l,"finallyLoc");if(D&&I){if(this.prev<l.catchLoc)return a(l.catchLoc,!0);if(this.prev<l.finallyLoc)return a(l.finallyLoc)}else if(D){if(this.prev<l.catchLoc)return a(l.catchLoc,!0)}else if(I){if(this.prev<l.finallyLoc)return a(l.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(r,t){for(var a=this.tryEntries.length-1;a>=0;--a){var c=this.tryEntries[a];if(c.tryLoc<=this.prev&&T.call(c,"finallyLoc")&&this.prev<c.finallyLoc){var l=c;break}}l&&(r==="break"||r==="continue")&&l.tryLoc<=t&&t<=l.finallyLoc&&(l=null);var x=l?l.completion:{};return x.type=r,x.arg=t,l?(this.method="next",this.next=l.finallyLoc,k):this.complete(x)},complete:function(r,t){if(r.type==="throw")throw r.arg;return r.type==="break"||r.type==="continue"?this.next=r.arg:r.type==="return"?(this.rval=this.arg=r.arg,this.method="return",this.next="end"):r.type==="normal"&&t&&(this.next=t),k},finish:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.finallyLoc===r)return this.complete(a.completion,a.afterLoc),g(a),k}},catch:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.tryLoc===r){var c=a.completion;if(c.type==="throw"){var l=c.arg;g(a)}return l}}throw new Error("illegal catch attempt")},delegateYield:function(r,t,a){return this.delegate={iterator:Z(r),resultName:t,nextLoc:a},this.method==="next"&&(this.arg=d),k}},f}(y.exports);try{regeneratorRuntime=b}catch(f){typeof globalThis=="object"?globalThis.regeneratorRuntime=b:Function("r","regeneratorRuntime = r")(b)}},519:function(y,b,f){"use strict";f.d(b,{makePromiseCreator:function(){return A.Z}});var A=f(282),T=f(666),d=f.n(T),O=null,E=f(644);function L(k){if(k.material){var R=Array.isArray(k.material)?k.material:[k.material];R.forEach(function(_){var w,n;(w=_.color)===null||w===void 0||w.convertSRGBToLinear(),(n=_.emissive)===null||n===void 0||n.convertSRGBToLinear(),_.map&&(_.map.encoding=THREE.sRGBEncoding),_.emissiveMap&&(_.emissiveMap.encoding=THREE.sRGBEncoding)})}}var j=f(568),p=f(924),S=require("idb-keyval"),M=f(484),C=null,N=null,W=function(){var k=(0,j.Z)(d().mark(function R(_,w){var n,s,o,e,i,u;return d().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return n=w.version,v.next=4,(0,S.get)(_);case 4:if(o=v.sent,!(o&&o[n])){v.next=9;break}s=o[n],v.next=15;break;case 9:return v.next=11,(0,M.Z)(fetch(_).then(function(P){if(P.ok)return P.blob();throw new Error}));case 11:e=v.sent,i=e.res,u=e.err,u||(s=i,(0,S.set)(_,(0,p.Z)({},n,i)));case 15:return v.abrupt("return",s?{url:URL.createObjectURL(s)}:{url:_});case 16:case"end":return v.stop()}},R)}));return function(_,w){return k.apply(this,arguments)}}(),U=f(705)},282:function(y,b,f){"use strict";f.d(b,{Z:function(){return T}});var A=f(484);function T(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},E={};return E.promise=new Promise(function(L,j){E.resolve=L,E.reject=j}),d&&(E.promise=(0,A.Z)(E.promise,O)),E}},484:function(y,b,f){"use strict";f.d(b,{Z:function(){return T}});var A=f(42);function T(d){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return d.then(function(E){return(0,A.Z)({err:null,res:E},O)}).catch(function(E){return(0,A.Z)({err:E,res:void 0},O)})}},705:function(y,b,f){"use strict";var A=f(644),T=f.n(A),d=new Map,O=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(j,p,S,M,C){var N=p[S*3],W=p[S*3+1],U=p[M*3],k=p[M*3+1],R=p[C*3],_=p[C*3+1],w;if(d.has(j))w=d.get(j);else{var n=L.box3||new THREE.Box3;if(!L.box3){var s=j.parameters.shapes.getPoints();n.setFromArray(s.map(function(h){return[h.x,h.y,0]}).flat())}var o=n.getSize(new THREE.Vector3);L.split&&(o.y/=L.split),w={box:n,size:o},d.set(j,w)}var e=w.box,i=w.size,u=L.split?1-L.split:0;return[new THREE.Vector2((N-e.min.x)/i.x,(W-e.min.y)/i.y+u),new THREE.Vector2((U-e.min.x)/i.x,(k-e.min.y)/i.y+u),new THREE.Vector2((R-e.min.x)/i.x,(_-e.min.y)/i.y+u)]},generateSideWallUV:function(j,p,S,M,C,N){var W=p[S*3],U=p[S*3+1],k=p[S*3+2],R=p[M*3],_=p[M*3+1],w=p[M*3+2],n=p[C*3],s=p[C*3+1],o=p[C*3+2],e=p[N*3],i=p[N*3+1],u=p[N*3+2],h;if(d.has(p))h=d.get(p);else{var v=new THREE.Box3;v.setFromArray(p);var P=v.getSize(new THREE.Vector3);L.split&&(P.z/=1-L.split),h={box:v,size:P},d.set(p,h)}var g=h.box,m=h.size;return Math.abs(U-_)<Math.abs(W-R)?[new THREE.Vector2((W-g.min.x)/m.x,(k-g.min.z)/m.z),new THREE.Vector2((R-g.min.x)/m.x,(w-g.min.z)/m.z),new THREE.Vector2((n-g.min.x)/m.x,(o-g.min.z)/m.z),new THREE.Vector2((e-g.min.x)/m.x,(u-g.min.z)/m.z)]:[new THREE.Vector2((U-g.min.y)/m.x,(k-g.min.z)/m.z),new THREE.Vector2((_-g.min.y)/m.x,(w-g.min.z)/m.z),new THREE.Vector2((s-g.min.y)/m.x,(o-g.min.z)/m.z),new THREE.Vector2((i-g.min.y)/m.x,(u-g.min.z)/m.z)]}}},E=function(){d.clear()}},644:function(y){"use strict";y.exports=require("three")},568:function(y,b,f){"use strict";f.d(b,{Z:function(){return T}});function A(d,O,E,L,j,p,S){try{var M=d[p](S),C=M.value}catch(N){E(N);return}M.done?O(C):Promise.resolve(C).then(L,j)}function T(d){return function(){var O=this,E=arguments;return new Promise(function(L,j){var p=d.apply(O,E);function S(C){A(p,L,j,S,M,"next",C)}function M(C){A(p,L,j,S,M,"throw",C)}S(void 0)})}}},924:function(y,b,f){"use strict";f.d(b,{Z:function(){return A}});function A(T,d,O){return d in T?Object.defineProperty(T,d,{value:O,enumerable:!0,configurable:!0,writable:!0}):T[d]=O,T}},42:function(y,b,f){"use strict";f.d(b,{Z:function(){return T}});var A=f(924);function T(d){for(var O=1;O<arguments.length;O++){var E=arguments[O]!=null?arguments[O]:{},L=Object.keys(E);typeof Object.getOwnPropertySymbols=="function"&&(L=L.concat(Object.getOwnPropertySymbols(E).filter(function(j){return Object.getOwnPropertyDescriptor(E,j).enumerable}))),L.forEach(function(j){(0,A.Z)(d,j,E[j])})}return d}}},Y={};function z(y){var b=Y[y];if(b!==void 0)return b.exports;var f=Y[y]={exports:{}};return X[y](f,f.exports,z),f.exports}(function(){z.n=function(y){var b=y&&y.__esModule?function(){return y.default}:function(){return y};return z.d(b,{a:b}),b}})(),function(){z.d=function(y,b){for(var f in b)z.o(b,f)&&!z.o(y,f)&&Object.defineProperty(y,f,{enumerable:!0,get:b[f]})}}(),function(){z.o=function(y,b){return Object.prototype.hasOwnProperty.call(y,b)}}(),function(){z.r=function(y){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(y,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(y,"__esModule",{value:!0})}}();var $={};(function(){"use strict";z.r($),z.d($,{Cache:function(){return f},Data:function(){return _},Draw:function(){return R},Wk:function(){return w}});function y(n,s){if(!(n instanceof s))throw new TypeError("Cannot call a class as a function")}var b=z(519),f=function(){"use strict";function n(){y(this,n),this.cache=new Map}var s=n.prototype;return s.install=function(){},s.init=function(e){var i=(0,b.makePromiseCreator)();this.cache.set(e,i)},s.get=function(e){var i;return(i=this.cache.get(e))===null||i===void 0?void 0:i.promise},s.set=function(e,i){var u=this.cache.get(e);u?u.resolve(i):console.warn("init cache first")},s.dispose=function(){this.cache.forEach(function(e,i){e.reject("stop set cache:".concat(i))}),this.cache.clear()},n}(),A=z(568);function T(n,s){for(var o=0;o<s.length;o++){var e=s[o];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(n,e.key,e)}}function d(n,s,o){return s&&T(n.prototype,s),o&&T(n,o),n}function O(n){if(Array.isArray(n))return n}function E(n){if(typeof Symbol!="undefined"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function L(){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 j(n,s){(s==null||s>n.length)&&(s=n.length);for(var o=0,e=new Array(s);o<s;o++)e[o]=n[o];return e}function p(n,s){if(!!n){if(typeof n=="string")return j(n,s);var o=Object.prototype.toString.call(n).slice(8,-1);if(o==="Object"&&n.constructor&&(o=n.constructor.name),o==="Map"||o==="Set")return Array.from(o);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return j(n,s)}}function S(n,s){return O(n)||E(n,s)||p(n,s)||L()}function M(n){if(Array.isArray(n))return j(n)}function C(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function N(n){return M(n)||E(n)||p(n)||C()}var W=z(666),U=z.n(W),k=z(644),R=function(){"use strict";function n(o){y(this,n),this.objectNamesToFactories=new Map,this.objects=new Map,this.objects_=o}var s=n.prototype;return s.install=function(e){this.pencil=e,this.initObjectFactories()},s.initObjectFactories=function(){var e=this,i=this.objects_;Object.keys(i).forEach(function(u){var h=function(){function v(){y(this,v)}var P=v.prototype;return P.create=function(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new i[u](m)},v}();e.objectNamesToFactories.set(u,h)})},s.getObject=function(e,i){e.includes("#")&&console.warn("getObject:err:\u4E0D\u652F\u6301 #",e);var u=(i||{}).key,h="".concat(e).concat(u?"#".concat(u):""),v=this.objects.get(h);return v},s.getAllObject=function(e,i){e.includes("#")&&console.warn("getAllObject:err:\u4E0D\u652F\u6301 #",e);var u=(i||{}).key,h="".concat(e).concat(u?"#".concat(u):""),v=[];return this.objects.forEach(function(P,g){(g.startsWith("".concat(h,"#"))||g===h)&&v.push(P)}),v},s.draw=function(e,i,u){var h=this;return(0,A.Z)(U().mark(function v(){var P,g,m,Z,G,r,t;return U().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(P=h.objectNamesToFactories.get(e),!P){c.next=15;break}return g=(i||{}).key,m="".concat(e).concat(g?"#".concat(g):""),h.objects.has(m)&&(Z=k.MathUtils.generateUUID(),m+="#".concat(Z)),G=(i==null?void 0:i.target)||u,typeof G=="string"?r=h.objects.get(G):(G==null?void 0:G.objecttype__)==="BaseObject"?r=G:r=h.pencil.scene,t=new P().create(i),t.pencil=h.pencil,t.key=m,h.objects.set(m,t),c.next=14,h.addMesh(t,r);case 14:return c.abrupt("return",t);case 15:throw new Error("Unrecognized:".concat(e));case 16:case"end":return c.stop()}},v)}))()},s.addMesh=function(e,i){return(0,A.Z)(U().mark(function u(){return U().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return v.next=2,e.create();case 2:e.object3d&&(e.object3d.userData.BaseObject_=e,i.add(e.object3d)),e.visible=!0,e.render(),e.pm.resolve();case 6:case"end":return v.stop()}},u)}))()},s.erase=function(){for(var e=arguments.length,i=new Array(e),u=0;u<e;u++)i[u]=arguments[u];var h=this;N(i).forEach(function(v){var P=[];if(typeof v=="string"){var g,m=S(v.split("#"),2),Z=m[0],G=m[1];(g=P).push.apply(g,N(h.getAllObject(Z,{key:G})))}else P.push(v);P.forEach(function(r){h.removeMesh(r)})})},s.removeMesh=function(e){var i=this,u=e.parent;e.object3d&&u.remove(e.object3d),e.traverse(function(h){h.visible=!1,h.dispose(),i.objects.delete(h.key)})},s.update=function(e,i){this.objects.forEach(function(u){u.update(e,i)})},s.setSize=function(e,i){this.objects.forEach(function(u){u.resize(e,i)})},s.dispose=function(){this.objects.forEach(function(e,i){e.dispose(),e.pm.reject("stop draw:".concat(i))}),this.objects.clear(),this.objectNamesToFactories.clear()},d(n,[{key:"objectsPromise",get:function(){var e=[];return this.objects.forEach(function(i){e.push(i.pm.promise)}),e}}]),n}(),_=function(){"use strict";function n(){y(this,n),this.data={}}var s=n.prototype;return s.install=function(){},s.setData=function(e,i){var u,h;this.data[e]=i,(h=(u=this).cb)===null||h===void 0||h.call(u,e)},s.runAll=function(){var e=this;Object.keys(this.data).forEach(function(i){var u,h;(h=(u=e).cb)===null||h===void 0||h.call(u,i)})},s.dispose=function(){this.data={},this.cb=void 0},n}(),w=function(){"use strict";function n(){y(this,n),this.messageList=[]}var s=n.prototype;return s.install=function(){},s.init=function(e,i){var u=this;this.workerList=Array.from({length:i},function(h,v){var P=typeof e=="string"?new Worker(e):e();return P.onmessage=function(g){var m=g.data,Z=m.res,G=m.uuid,r=u.messageList.find(function(t){var a=t.uuid;return G===a});r==null||r.cb(Z),u.workerList[v].inUse=!1,u.checkMessage()},{worker:P,inUse:!1}})},s.postMessage=function(e,i){this.messageList.push({req:e,cb:i,uuid:k.MathUtils.generateUUID(),inUse:!1}),this.checkMessage()},s.checkMessage=function(){var e=this.workerList.find(function(u){var h=u.inUse;return!h});if(e){var i=this.messageList.find(function(u){var h=u.inUse;return!h});i&&(i.inUse=!0,e.inUse=!0,e.worker.postMessage({req:i.req,uuid:i.uuid}))}},s.dispose=function(){this.workerList.forEach(function(e){var i=e.worker;i.terminate()}),this.workerList=[],this.messageList=[]},n}()})(),module.exports=$})();
@@ -1 +1 @@
1
- import*as X from"idb-keyval";import*as J from"three";var Q={666:function(b){var m=function(c){"use strict";var P=Object.prototype,_=P.hasOwnProperty,v,T=typeof Symbol=="function"?Symbol:{},y=T.iterator||"@@iterator",A=T.asyncIterator||"@@asyncIterator",k=T.toStringTag||"@@toStringTag";function w(e,t,a){return Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{w({},"")}catch(e){w=function(t,a,l){return t[a]=l}}function p(e,t,a,l){var h=t&&t.prototype instanceof Z?t:Z,S=Object.create(h.prototype),U=new j(l||[]);return S._invoke=d(e,a,U),S}c.wrap=p;function R(e,t,a){try{return{type:"normal",arg:e.call(t,a)}}catch(l){return{type:"throw",arg:l}}}var x="suspendedStart",z="suspendedYield",I="executing",G="completed",C={};function Z(){}function L(){}function o(){}var n={};w(n,y,function(){return this});var i=Object.getPrototypeOf,r=i&&i(i(g([])));r&&r!==P&&_.call(r,y)&&(n=r);var u=o.prototype=Z.prototype=Object.create(n);L.prototype=o,w(u,"constructor",o),w(o,"constructor",L),L.displayName=w(o,k,"GeneratorFunction");function s(e){["next","throw","return"].forEach(function(t){w(e,t,function(a){return this._invoke(t,a)})})}c.isGeneratorFunction=function(e){var t=typeof e=="function"&&e.constructor;return t?t===L||(t.displayName||t.name)==="GeneratorFunction":!1},c.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,o):(e.__proto__=o,w(e,k,"GeneratorFunction")),e.prototype=Object.create(u),e},c.awrap=function(e){return{__await:e}};function f(e,t){function a(S,U,D,N){var V=R(e[S],e,U);if(V.type==="throw")N(V.arg);else{var $=V.arg,F=$.value;return F&&typeof F=="object"&&_.call(F,"__await")?t.resolve(F.__await).then(function(B){a("next",B,D,N)},function(B){a("throw",B,D,N)}):t.resolve(F).then(function(B){$.value=B,D($)},function(B){return a("throw",B,D,N)})}}var l;function h(S,U){function D(){return new t(function(N,V){a(S,U,N,V)})}return l=l?l.then(D,D):D()}this._invoke=h}s(f.prototype),w(f.prototype,A,function(){return this}),c.AsyncIterator=f,c.async=function(e,t,a,l,h){h===void 0&&(h=Promise);var S=new f(p(e,t,a,l),h);return c.isGeneratorFunction(t)?S:S.next().then(function(U){return U.done?U.value:S.next()})};function d(e,t,a){var l=x;return function(S,U){if(l===I)throw new Error("Generator is already running");if(l===G){if(S==="throw")throw U;return W()}for(a.method=S,a.arg=U;;){var D=a.delegate;if(D){var N=O(D,a);if(N){if(N===C)continue;return N}}if(a.method==="next")a.sent=a._sent=a.arg;else if(a.method==="throw"){if(l===x)throw l=G,a.arg;a.dispatchException(a.arg)}else a.method==="return"&&a.abrupt("return",a.arg);l=I;var V=R(e,t,a);if(V.type==="normal"){if(l=a.done?G:z,V.arg===C)continue;return{value:V.arg,done:a.done}}else V.type==="throw"&&(l=G,a.method="throw",a.arg=V.arg)}}}function O(e,t){var a=e.iterator[t.method];if(a===v){if(t.delegate=null,t.method==="throw"){if(e.iterator.return&&(t.method="return",t.arg=v,O(e,t),t.method==="throw"))return C;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return C}var l=R(a,e.iterator,t.arg);if(l.type==="throw")return t.method="throw",t.arg=l.arg,t.delegate=null,C;var h=l.arg;if(!h)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,C;if(h.done)t[e.resultName]=h.value,t.next=e.nextLoc,t.method!=="return"&&(t.method="next",t.arg=v);else return h;return t.delegate=null,C}s(u),w(u,k,"Generator"),w(u,y,function(){return this}),w(u,"toString",function(){return"[object Generator]"});function M(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(M,this),this.reset(!0)}c.keys=function(e){var t=[];for(var a in e)t.push(a);return t.reverse(),function l(){for(;t.length;){var h=t.pop();if(h in e)return l.value=h,l.done=!1,l}return l.done=!0,l}};function g(e){if(e){var t=e[y];if(t)return t.call(e);if(typeof e.next=="function")return e;if(!isNaN(e.length)){var a=-1,l=function h(){for(;++a<e.length;)if(_.call(e,a))return h.value=e[a],h.done=!1,h;return h.value=v,h.done=!0,h};return l.next=l}}return{next:W}}c.values=g;function W(){return{value:v,done:!0}}return j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=v,this.done=!1,this.delegate=null,this.method="next",this.arg=v,this.tryEntries.forEach(E),!e)for(var t in this)t.charAt(0)==="t"&&_.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=v)},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function a(N,V){return S.type="throw",S.arg=e,t.next=N,V&&(t.method="next",t.arg=v),!!V}for(var l=this.tryEntries.length-1;l>=0;--l){var h=this.tryEntries[l],S=h.completion;if(h.tryLoc==="root")return a("end");if(h.tryLoc<=this.prev){var U=_.call(h,"catchLoc"),D=_.call(h,"finallyLoc");if(U&&D){if(this.prev<h.catchLoc)return a(h.catchLoc,!0);if(this.prev<h.finallyLoc)return a(h.finallyLoc)}else if(U){if(this.prev<h.catchLoc)return a(h.catchLoc,!0)}else if(D){if(this.prev<h.finallyLoc)return a(h.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(e,t){for(var a=this.tryEntries.length-1;a>=0;--a){var l=this.tryEntries[a];if(l.tryLoc<=this.prev&&_.call(l,"finallyLoc")&&this.prev<l.finallyLoc){var h=l;break}}h&&(e==="break"||e==="continue")&&h.tryLoc<=t&&t<=h.finallyLoc&&(h=null);var S=h?h.completion:{};return S.type=e,S.arg=t,h?(this.method="next",this.next=h.finallyLoc,C):this.complete(S)},complete:function(e,t){if(e.type==="throw")throw e.arg;return e.type==="break"||e.type==="continue"?this.next=e.arg:e.type==="return"?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):e.type==="normal"&&t&&(this.next=t),C},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.finallyLoc===e)return this.complete(a.completion,a.afterLoc),E(a),C}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.tryLoc===e){var l=a.completion;if(l.type==="throw"){var h=l.arg;E(a)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,a){return this.delegate={iterator:g(e),resultName:t,nextLoc:a},this.method==="next"&&(this.arg=v),C}},c}(b.exports);try{regeneratorRuntime=m}catch(c){typeof globalThis=="object"?globalThis.regeneratorRuntime=m:Function("r","regeneratorRuntime = r")(m)}},218:function(b,m,c){c.d(m,{Mf:function(){return P.Z}});var P=c(340),_=c(666),v=c.n(_),T=null,y=c(949);function A(L){if(L.material){var o=Array.isArray(L.material)?L.material:[L.material];o.forEach(function(n){var i,r;(i=n.color)===null||i===void 0||i.convertSRGBToLinear(),(r=n.emissive)===null||r===void 0||r.convertSRGBToLinear(),n.map&&(n.map.encoding=THREE.sRGBEncoding),n.emissiveMap&&(n.emissiveMap.encoding=THREE.sRGBEncoding)})}}var k=c(568),w=c(924),p=L=>{var o={};return c.d(o,L),o},R=L=>()=>L,x=p({get:()=>X.get,set:()=>X.set}),z=c(485),I=null,G=null,C=function(){var L=(0,k.Z)(v().mark(function o(n,i){var r,u,s,f,d,O;return v().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return r=i.version,E.next=4,(0,x.get)(n);case 4:if(s=E.sent,!(s&&s[r])){E.next=9;break}u=s[r],E.next=15;break;case 9:return E.next=11,(0,z.Z)(fetch(n).then(function(j){if(j.ok)return j.blob();throw new Error}));case 11:f=E.sent,d=f.res,O=f.err,O||(u=d,(0,x.set)(n,(0,w.Z)({},r,d)));case 15:return E.abrupt("return",u?{url:URL.createObjectURL(u)}:{url:n});case 16:case"end":return E.stop()}},o)}));return function(n,i){return L.apply(this,arguments)}}(),Z=c(818)},340:function(b,m,c){c.d(m,{Z:function(){return _}});var P=c(485);function _(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},y={};return y.promise=new Promise(function(A,k){y.resolve=A,y.reject=k}),v&&(y.promise=(0,P.Z)(y.promise,T)),y}},485:function(b,m,c){c.d(m,{Z:function(){return _}});var P=c(42);function _(v){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return v.then(function(y){return(0,P.Z)({err:null,res:y},T)}).catch(function(y){return(0,P.Z)({err:y,res:void 0},T)})}},818:function(b,m,c){var P=c(949),_=new Map,v=function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(w,p,R,x,z){var I=p[R*3],G=p[R*3+1],C=p[x*3],Z=p[x*3+1],L=p[z*3],o=p[z*3+1],n;if(_.has(w))n=_.get(w);else{var i=A.box3||new THREE.Box3;if(!A.box3){var r=w.parameters.shapes.getPoints();i.setFromArray(r.map(function(O){return[O.x,O.y,0]}).flat())}var u=i.getSize(new THREE.Vector3);A.split&&(u.y/=A.split),n={box:i,size:u},_.set(w,n)}var s=n.box,f=n.size,d=A.split?1-A.split:0;return[new THREE.Vector2((I-s.min.x)/f.x,(G-s.min.y)/f.y+d),new THREE.Vector2((C-s.min.x)/f.x,(Z-s.min.y)/f.y+d),new THREE.Vector2((L-s.min.x)/f.x,(o-s.min.y)/f.y+d)]},generateSideWallUV:function(w,p,R,x,z,I){var G=p[R*3],C=p[R*3+1],Z=p[R*3+2],L=p[x*3],o=p[x*3+1],n=p[x*3+2],i=p[z*3],r=p[z*3+1],u=p[z*3+2],s=p[I*3],f=p[I*3+1],d=p[I*3+2],O;if(_.has(p))O=_.get(p);else{var M=new THREE.Box3;M.setFromArray(p);var E=M.getSize(new THREE.Vector3);A.split&&(E.z/=1-A.split),O={box:M,size:E},_.set(p,O)}var j=O.box,g=O.size;return Math.abs(C-o)<Math.abs(G-L)?[new THREE.Vector2((G-j.min.x)/g.x,(Z-j.min.z)/g.z),new THREE.Vector2((L-j.min.x)/g.x,(n-j.min.z)/g.z),new THREE.Vector2((i-j.min.x)/g.x,(u-j.min.z)/g.z),new THREE.Vector2((s-j.min.x)/g.x,(d-j.min.z)/g.z)]:[new THREE.Vector2((C-j.min.y)/g.x,(Z-j.min.z)/g.z),new THREE.Vector2((o-j.min.y)/g.x,(n-j.min.z)/g.z),new THREE.Vector2((r-j.min.y)/g.x,(u-j.min.z)/g.z),new THREE.Vector2((f-j.min.y)/g.x,(d-j.min.z)/g.z)]}}},T=function(){_.clear()}},949:function(b,m,c){var P=v=>{var T={};return c.d(T,v),T},_=v=>()=>v;b.exports=P({MathUtils:()=>J.MathUtils})},568:function(b,m,c){c.d(m,{Z:function(){return _}});function P(v,T,y,A,k,w,p){try{var R=v[w](p),x=R.value}catch(z){y(z);return}R.done?T(x):Promise.resolve(x).then(A,k)}function _(v){return function(){var T=this,y=arguments;return new Promise(function(A,k){var w=v.apply(T,y);function p(x){P(w,A,k,p,R,"next",x)}function R(x){P(w,A,k,p,R,"throw",x)}p(void 0)})}}},924:function(b,m,c){c.d(m,{Z:function(){return P}});function P(_,v,T){return v in _?Object.defineProperty(_,v,{value:T,enumerable:!0,configurable:!0,writable:!0}):_[v]=T,_}},42:function(b,m,c){c.d(m,{Z:function(){return _}});var P=c(924);function _(v){for(var T=1;T<arguments.length;T++){var y=arguments[T]!=null?arguments[T]:{},A=Object.keys(y);typeof Object.getOwnPropertySymbols=="function"&&(A=A.concat(Object.getOwnPropertySymbols(y).filter(function(k){return Object.getOwnPropertyDescriptor(y,k).enumerable}))),A.forEach(function(k){(0,P.Z)(v,k,y[k])})}return v}}},Y={};function H(b){var m=Y[b];if(m!==void 0)return m.exports;var c=Y[b]={exports:{}};return Q[b](c,c.exports,H),c.exports}(function(){H.n=function(b){var m=b&&b.__esModule?function(){return b.default}:function(){return b};return H.d(m,{a:m}),m}})(),function(){H.d=function(b,m){for(var c in m)H.o(m,c)&&!H.o(b,c)&&Object.defineProperty(b,c,{enumerable:!0,get:m[c]})}}(),function(){H.o=function(b,m){return Object.prototype.hasOwnProperty.call(b,m)}}();var K={};(function(){H.d(K,{Ct:function(){return c},Vw:function(){return L},hG:function(){return Z}});function b(o,n){if(!(o instanceof n))throw new TypeError("Cannot call a class as a function")}var m=H(218),c=function(){"use strict";function o(){b(this,o),this.cache=new Map}var n=o.prototype;return n.install=function(){},n.init=function(r){var u=(0,m.Mf)();this.cache.set(r,u)},n.get=function(r){var u;return(u=this.cache.get(r))===null||u===void 0?void 0:u.promise},n.set=function(r,u){var s=this.cache.get(r);s?s.resolve(u):console.warn("init cache first")},n.dispose=function(){this.cache.forEach(function(r,u){r.reject("stop set cache:".concat(u))}),this.cache.clear()},o}(),P=H(568);function _(o,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(o,r.key,r)}}function v(o,n,i){return n&&_(o.prototype,n),i&&_(o,i),o}function T(o){if(Array.isArray(o))return o}function y(o){if(typeof Symbol!="undefined"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)}function A(){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 k(o,n){(n==null||n>o.length)&&(n=o.length);for(var i=0,r=new Array(n);i<n;i++)r[i]=o[i];return r}function w(o,n){if(!!o){if(typeof o=="string")return k(o,n);var i=Object.prototype.toString.call(o).slice(8,-1);if(i==="Object"&&o.constructor&&(i=o.constructor.name),i==="Map"||i==="Set")return Array.from(i);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return k(o,n)}}function p(o,n){return T(o)||y(o,n)||w(o,n)||A()}function R(o){if(Array.isArray(o))return k(o)}function x(){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 z(o){return R(o)||y(o)||w(o)||x()}var I=H(666),G=H.n(I),C=H(949),Z=function(){"use strict";function o(i){b(this,o),this.objectNamesToFactories=new Map,this.objects=new Map,this.objects_=i}var n=o.prototype;return n.install=function(r){this.pencil=r,this.initObjectFactories()},n.initObjectFactories=function(){var r=this,u=this.objects_;Object.keys(u).forEach(function(s){var f=function(){function d(){b(this,d)}var O=d.prototype;return O.create=function(){var E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new u[s](E)},d}();r.objectNamesToFactories.set(s,f)})},n.getObject=function(r,u){r.includes("#")&&console.warn("getObject:err:\u4E0D\u652F\u6301 #",r);var s=(u||{}).key,f="".concat(r).concat(s?"#".concat(s):""),d=this.objects.get(f);return d},n.getAllObject=function(r,u){r.includes("#")&&console.warn("getAllObject:err:\u4E0D\u652F\u6301 #",r);var s=(u||{}).key,f="".concat(r).concat(s?"#".concat(s):""),d=[];return this.objects.forEach(function(O,M){(M.startsWith("".concat(f,"#"))||M===f)&&d.push(O)}),d},n.draw=function(r,u,s){var f=this;return(0,P.Z)(G().mark(function d(){var O,M,E,j,g,W,e;return G().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(O=f.objectNamesToFactories.get(r),!O){a.next=15;break}return M=(u||{}).key,E="".concat(r).concat(M?"#".concat(M):""),f.objects.has(E)&&(j=C.MathUtils.generateUUID(),E+="#".concat(j)),g=(u==null?void 0:u.target)||s,typeof g=="string"?W=f.objects.get(g):(g==null?void 0:g.objecttype__)==="BaseObject"?W=g:W=f.pencil.scene,e=new O().create(u),e.pencil=f.pencil,e.key=E,f.objects.set(E,e),a.next=14,f.addMesh(e,W);case 14:return a.abrupt("return",e);case 15:throw new Error("Unrecognized:".concat(r));case 16:case"end":return a.stop()}},d)}))()},n.addMesh=function(r,u){return(0,P.Z)(G().mark(function s(){return G().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,r.create();case 2:r.object3d&&(r.object3d.userData.BaseObject_=r,u.add(r.object3d)),r.visible=!0,r.render(),r.pm.resolve();case 6:case"end":return d.stop()}},s)}))()},n.erase=function(){for(var r=arguments.length,u=new Array(r),s=0;s<r;s++)u[s]=arguments[s];var f=this;z(u).forEach(function(d){var O=[];if(typeof d=="string"){var M,E=p(d.split("#"),2),j=E[0],g=E[1];(M=O).push.apply(M,z(f.getAllObject(j,{key:g})))}else O.push(d);O.forEach(function(W){f.removeMesh(W)})})},n.removeMesh=function(r){var u=this,s=r.parent;r.object3d&&s.remove(r.object3d),r.traverse(function(f){f.visible=!1,f.dispose(),u.objects.delete(f.key)})},n.update=function(r,u){this.objects.forEach(function(s){s.update(r,u)})},n.setSize=function(r,u){this.objects.forEach(function(s){s.resize(r,u)})},n.dispose=function(){this.objects.forEach(function(r,u){r.dispose(),r.pm.reject("stop draw:".concat(u))}),this.objects.clear(),this.objectNamesToFactories.clear()},v(o,[{key:"objectsPromise",get:function(){var r=[];return this.objects.forEach(function(u){r.push(u.pm.promise)}),r}}]),o}(),L=function(){"use strict";function o(){b(this,o),this.data={}}var n=o.prototype;return n.install=function(){},n.setData=function(r,u){var s,f;this.data[r]=u,(f=(s=this).cb)===null||f===void 0||f.call(s,r)},n.runAll=function(){var r=this;Object.keys(this.data).forEach(function(u){var s,f;(f=(s=r).cb)===null||f===void 0||f.call(s,u)})},n.dispose=function(){this.data={},this.cb=void 0},o}()})();var q=K.Ct,tt=K.Vw,et=K.hG;export{q as Cache,tt as Data,et as Draw};
1
+ import*as X from"idb-keyval";import*as J from"three";var Q={666:function(b){var g=function(f){"use strict";var T=Object.prototype,m=T.hasOwnProperty,d,j=typeof Symbol=="function"?Symbol:{},_=j.iterator||"@@iterator",O=j.asyncIterator||"@@asyncIterator",p=j.toStringTag||"@@toStringTag";function E(r,t,o){return Object.defineProperty(r,t,{value:o,enumerable:!0,configurable:!0,writable:!0}),r[t]}try{E({},"")}catch(r){E=function(t,o,c){return t[o]=c}}function S(r,t,o,c){var h=t&&t.prototype instanceof V?t:V,P=Object.create(h.prototype),U=new M(c||[]);return P._invoke=l(r,o,U),P}f.wrap=S;function C(r,t,o){try{return{type:"normal",arg:r.call(t,o)}}catch(c){return{type:"throw",arg:c}}}var A="suspendedStart",H="suspendedYield",W="executing",R="completed",x={};function V(){}function k(){}function L(){}var n={};E(n,_,function(){return this});var i=Object.getPrototypeOf,a=i&&i(i(Z([])));a&&a!==T&&m.call(a,_)&&(n=a);var e=L.prototype=V.prototype=Object.create(n);k.prototype=L,E(e,"constructor",L),E(L,"constructor",k),k.displayName=E(L,p,"GeneratorFunction");function s(r){["next","throw","return"].forEach(function(t){E(r,t,function(o){return this._invoke(t,o)})})}f.isGeneratorFunction=function(r){var t=typeof r=="function"&&r.constructor;return t?t===k||(t.displayName||t.name)==="GeneratorFunction":!1},f.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,L):(r.__proto__=L,E(r,p,"GeneratorFunction")),r.prototype=Object.create(e),r},f.awrap=function(r){return{__await:r}};function u(r,t){function o(P,U,G,N){var D=C(r[P],r,U);if(D.type==="throw")N(D.arg);else{var $=D.arg,F=$.value;return F&&typeof F=="object"&&m.call(F,"__await")?t.resolve(F.__await).then(function(B){o("next",B,G,N)},function(B){o("throw",B,G,N)}):t.resolve(F).then(function(B){$.value=B,G($)},function(B){return o("throw",B,G,N)})}}var c;function h(P,U){function G(){return new t(function(N,D){o(P,U,N,D)})}return c=c?c.then(G,G):G()}this._invoke=h}s(u.prototype),E(u.prototype,O,function(){return this}),f.AsyncIterator=u,f.async=function(r,t,o,c,h){h===void 0&&(h=Promise);var P=new u(S(r,t,o,c),h);return f.isGeneratorFunction(t)?P:P.next().then(function(U){return U.done?U.value:P.next()})};function l(r,t,o){var c=A;return function(P,U){if(c===W)throw new Error("Generator is already running");if(c===R){if(P==="throw")throw U;return z()}for(o.method=P,o.arg=U;;){var G=o.delegate;if(G){var N=w(G,o);if(N){if(N===x)continue;return N}}if(o.method==="next")o.sent=o._sent=o.arg;else if(o.method==="throw"){if(c===A)throw c=R,o.arg;o.dispatchException(o.arg)}else o.method==="return"&&o.abrupt("return",o.arg);c=W;var D=C(r,t,o);if(D.type==="normal"){if(c=o.done?R:H,D.arg===x)continue;return{value:D.arg,done:o.done}}else D.type==="throw"&&(c=R,o.method="throw",o.arg=D.arg)}}}function w(r,t){var o=r.iterator[t.method];if(o===d){if(t.delegate=null,t.method==="throw"){if(r.iterator.return&&(t.method="return",t.arg=d,w(r,t),t.method==="throw"))return x;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return x}var c=C(o,r.iterator,t.arg);if(c.type==="throw")return t.method="throw",t.arg=c.arg,t.delegate=null,x;var h=c.arg;if(!h)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,x;if(h.done)t[r.resultName]=h.value,t.next=r.nextLoc,t.method!=="return"&&(t.method="next",t.arg=d);else return h;return t.delegate=null,x}s(e),E(e,p,"Generator"),E(e,_,function(){return this}),E(e,"toString",function(){return"[object Generator]"});function y(r){var t={tryLoc:r[0]};1 in r&&(t.catchLoc=r[1]),2 in r&&(t.finallyLoc=r[2],t.afterLoc=r[3]),this.tryEntries.push(t)}function v(r){var t=r.completion||{};t.type="normal",delete t.arg,r.completion=t}function M(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(y,this),this.reset(!0)}f.keys=function(r){var t=[];for(var o in r)t.push(o);return t.reverse(),function c(){for(;t.length;){var h=t.pop();if(h in r)return c.value=h,c.done=!1,c}return c.done=!0,c}};function Z(r){if(r){var t=r[_];if(t)return t.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length)){var o=-1,c=function h(){for(;++o<r.length;)if(m.call(r,o))return h.value=r[o],h.done=!1,h;return h.value=d,h.done=!0,h};return c.next=c}}return{next:z}}f.values=Z;function z(){return{value:d,done:!0}}return M.prototype={constructor:M,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=d,this.done=!1,this.delegate=null,this.method="next",this.arg=d,this.tryEntries.forEach(v),!r)for(var t in this)t.charAt(0)==="t"&&m.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=d)},stop:function(){this.done=!0;var r=this.tryEntries[0],t=r.completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var t=this;function o(N,D){return P.type="throw",P.arg=r,t.next=N,D&&(t.method="next",t.arg=d),!!D}for(var c=this.tryEntries.length-1;c>=0;--c){var h=this.tryEntries[c],P=h.completion;if(h.tryLoc==="root")return o("end");if(h.tryLoc<=this.prev){var U=m.call(h,"catchLoc"),G=m.call(h,"finallyLoc");if(U&&G){if(this.prev<h.catchLoc)return o(h.catchLoc,!0);if(this.prev<h.finallyLoc)return o(h.finallyLoc)}else if(U){if(this.prev<h.catchLoc)return o(h.catchLoc,!0)}else if(G){if(this.prev<h.finallyLoc)return o(h.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(r,t){for(var o=this.tryEntries.length-1;o>=0;--o){var c=this.tryEntries[o];if(c.tryLoc<=this.prev&&m.call(c,"finallyLoc")&&this.prev<c.finallyLoc){var h=c;break}}h&&(r==="break"||r==="continue")&&h.tryLoc<=t&&t<=h.finallyLoc&&(h=null);var P=h?h.completion:{};return P.type=r,P.arg=t,h?(this.method="next",this.next=h.finallyLoc,x):this.complete(P)},complete:function(r,t){if(r.type==="throw")throw r.arg;return r.type==="break"||r.type==="continue"?this.next=r.arg:r.type==="return"?(this.rval=this.arg=r.arg,this.method="return",this.next="end"):r.type==="normal"&&t&&(this.next=t),x},finish:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.finallyLoc===r)return this.complete(o.completion,o.afterLoc),v(o),x}},catch:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.tryLoc===r){var c=o.completion;if(c.type==="throw"){var h=c.arg;v(o)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(r,t,o){return this.delegate={iterator:Z(r),resultName:t,nextLoc:o},this.method==="next"&&(this.arg=d),x}},f}(b.exports);try{regeneratorRuntime=g}catch(f){typeof globalThis=="object"?globalThis.regeneratorRuntime=g:Function("r","regeneratorRuntime = r")(g)}},521:function(b,g,f){f.d(g,{Mf:function(){return T.Z}});var T=f(282),m=f(666),d=f.n(m),j=null,_=f(949);function O(k){if(k.material){var L=Array.isArray(k.material)?k.material:[k.material];L.forEach(function(n){var i,a;(i=n.color)===null||i===void 0||i.convertSRGBToLinear(),(a=n.emissive)===null||a===void 0||a.convertSRGBToLinear(),n.map&&(n.map.encoding=THREE.sRGBEncoding),n.emissiveMap&&(n.emissiveMap.encoding=THREE.sRGBEncoding)})}}var p=f(568),E=f(924),S=k=>{var L={};return f.d(L,k),L},C=k=>()=>k,A=S({get:()=>X.get,set:()=>X.set}),H=f(484),W=null,R=null,x=function(){var k=(0,p.Z)(d().mark(function L(n,i){var a,e,s,u,l,w;return d().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return a=i.version,v.next=4,(0,A.get)(n);case 4:if(s=v.sent,!(s&&s[a])){v.next=9;break}e=s[a],v.next=15;break;case 9:return v.next=11,(0,H.Z)(fetch(n).then(function(M){if(M.ok)return M.blob();throw new Error}));case 11:u=v.sent,l=u.res,w=u.err,w||(e=l,(0,A.set)(n,(0,E.Z)({},a,l)));case 15:return v.abrupt("return",e?{url:URL.createObjectURL(e)}:{url:n});case 16:case"end":return v.stop()}},L)}));return function(n,i){return k.apply(this,arguments)}}(),V=f(705)},282:function(b,g,f){f.d(g,{Z:function(){return m}});var T=f(484);function m(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_={};return _.promise=new Promise(function(O,p){_.resolve=O,_.reject=p}),d&&(_.promise=(0,T.Z)(_.promise,j)),_}},484:function(b,g,f){f.d(g,{Z:function(){return m}});var T=f(42);function m(d){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return d.then(function(_){return(0,T.Z)({err:null,res:_},j)}).catch(function(_){return(0,T.Z)({err:_,res:void 0},j)})}},705:function(b,g,f){var T=f(949),m=new Map,d=function(){var _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(O,p,E,S,C){var A=p[E*3],H=p[E*3+1],W=p[S*3],R=p[S*3+1],x=p[C*3],V=p[C*3+1],k;if(m.has(O))k=m.get(O);else{var L=_.box3||new THREE.Box3;if(!_.box3){var n=O.parameters.shapes.getPoints();L.setFromArray(n.map(function(u){return[u.x,u.y,0]}).flat())}var i=L.getSize(new THREE.Vector3);_.split&&(i.y/=_.split),k={box:L,size:i},m.set(O,k)}var a=k.box,e=k.size,s=_.split?1-_.split:0;return[new THREE.Vector2((A-a.min.x)/e.x,(H-a.min.y)/e.y+s),new THREE.Vector2((W-a.min.x)/e.x,(R-a.min.y)/e.y+s),new THREE.Vector2((x-a.min.x)/e.x,(V-a.min.y)/e.y+s)]},generateSideWallUV:function(O,p,E,S,C,A){var H=p[E*3],W=p[E*3+1],R=p[E*3+2],x=p[S*3],V=p[S*3+1],k=p[S*3+2],L=p[C*3],n=p[C*3+1],i=p[C*3+2],a=p[A*3],e=p[A*3+1],s=p[A*3+2],u;if(m.has(p))u=m.get(p);else{var l=new THREE.Box3;l.setFromArray(p);var w=l.getSize(new THREE.Vector3);_.split&&(w.z/=1-_.split),u={box:l,size:w},m.set(p,u)}var y=u.box,v=u.size;return Math.abs(W-V)<Math.abs(H-x)?[new THREE.Vector2((H-y.min.x)/v.x,(R-y.min.z)/v.z),new THREE.Vector2((x-y.min.x)/v.x,(k-y.min.z)/v.z),new THREE.Vector2((L-y.min.x)/v.x,(i-y.min.z)/v.z),new THREE.Vector2((a-y.min.x)/v.x,(s-y.min.z)/v.z)]:[new THREE.Vector2((W-y.min.y)/v.x,(R-y.min.z)/v.z),new THREE.Vector2((V-y.min.y)/v.x,(k-y.min.z)/v.z),new THREE.Vector2((n-y.min.y)/v.x,(i-y.min.z)/v.z),new THREE.Vector2((e-y.min.y)/v.x,(s-y.min.z)/v.z)]}}},j=function(){m.clear()}},949:function(b,g,f){var T=d=>{var j={};return f.d(j,d),j},m=d=>()=>d;b.exports=T({MathUtils:()=>J.MathUtils})},568:function(b,g,f){f.d(g,{Z:function(){return m}});function T(d,j,_,O,p,E,S){try{var C=d[E](S),A=C.value}catch(H){_(H);return}C.done?j(A):Promise.resolve(A).then(O,p)}function m(d){return function(){var j=this,_=arguments;return new Promise(function(O,p){var E=d.apply(j,_);function S(A){T(E,O,p,S,C,"next",A)}function C(A){T(E,O,p,S,C,"throw",A)}S(void 0)})}}},924:function(b,g,f){f.d(g,{Z:function(){return T}});function T(m,d,j){return d in m?Object.defineProperty(m,d,{value:j,enumerable:!0,configurable:!0,writable:!0}):m[d]=j,m}},42:function(b,g,f){f.d(g,{Z:function(){return m}});var T=f(924);function m(d){for(var j=1;j<arguments.length;j++){var _=arguments[j]!=null?arguments[j]:{},O=Object.keys(_);typeof Object.getOwnPropertySymbols=="function"&&(O=O.concat(Object.getOwnPropertySymbols(_).filter(function(p){return Object.getOwnPropertyDescriptor(_,p).enumerable}))),O.forEach(function(p){(0,T.Z)(d,p,_[p])})}return d}}},Y={};function I(b){var g=Y[b];if(g!==void 0)return g.exports;var f=Y[b]={exports:{}};return Q[b](f,f.exports,I),f.exports}(function(){I.n=function(b){var g=b&&b.__esModule?function(){return b.default}:function(){return b};return I.d(g,{a:g}),g}})(),function(){I.d=function(b,g){for(var f in g)I.o(g,f)&&!I.o(b,f)&&Object.defineProperty(b,f,{enumerable:!0,get:g[f]})}}(),function(){I.o=function(b,g){return Object.prototype.hasOwnProperty.call(b,g)}}();var K={};(function(){I.d(K,{Ct:function(){return f},Vw:function(){return k},hG:function(){return V},Wk:function(){return L}});function b(n,i){if(!(n instanceof i))throw new TypeError("Cannot call a class as a function")}var g=I(521),f=function(){"use strict";function n(){b(this,n),this.cache=new Map}var i=n.prototype;return i.install=function(){},i.init=function(e){var s=(0,g.Mf)();this.cache.set(e,s)},i.get=function(e){var s;return(s=this.cache.get(e))===null||s===void 0?void 0:s.promise},i.set=function(e,s){var u=this.cache.get(e);u?u.resolve(s):console.warn("init cache first")},i.dispose=function(){this.cache.forEach(function(e,s){e.reject("stop set cache:".concat(s))}),this.cache.clear()},n}(),T=I(568);function m(n,i){for(var a=0;a<i.length;a++){var e=i[a];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(n,e.key,e)}}function d(n,i,a){return i&&m(n.prototype,i),a&&m(n,a),n}function j(n){if(Array.isArray(n))return n}function _(n){if(typeof Symbol!="undefined"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function O(){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 p(n,i){(i==null||i>n.length)&&(i=n.length);for(var a=0,e=new Array(i);a<i;a++)e[a]=n[a];return e}function E(n,i){if(!!n){if(typeof n=="string")return p(n,i);var a=Object.prototype.toString.call(n).slice(8,-1);if(a==="Object"&&n.constructor&&(a=n.constructor.name),a==="Map"||a==="Set")return Array.from(a);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return p(n,i)}}function S(n,i){return j(n)||_(n,i)||E(n,i)||O()}function C(n){if(Array.isArray(n))return p(n)}function A(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function H(n){return C(n)||_(n)||E(n)||A()}var W=I(666),R=I.n(W),x=I(949),V=function(){"use strict";function n(a){b(this,n),this.objectNamesToFactories=new Map,this.objects=new Map,this.objects_=a}var i=n.prototype;return i.install=function(e){this.pencil=e,this.initObjectFactories()},i.initObjectFactories=function(){var e=this,s=this.objects_;Object.keys(s).forEach(function(u){var l=function(){function w(){b(this,w)}var y=w.prototype;return y.create=function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new s[u](M)},w}();e.objectNamesToFactories.set(u,l)})},i.getObject=function(e,s){e.includes("#")&&console.warn("getObject:err:\u4E0D\u652F\u6301 #",e);var u=(s||{}).key,l="".concat(e).concat(u?"#".concat(u):""),w=this.objects.get(l);return w},i.getAllObject=function(e,s){e.includes("#")&&console.warn("getAllObject:err:\u4E0D\u652F\u6301 #",e);var u=(s||{}).key,l="".concat(e).concat(u?"#".concat(u):""),w=[];return this.objects.forEach(function(y,v){(v.startsWith("".concat(l,"#"))||v===l)&&w.push(y)}),w},i.draw=function(e,s,u){var l=this;return(0,T.Z)(R().mark(function w(){var y,v,M,Z,z,r,t;return R().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(y=l.objectNamesToFactories.get(e),!y){c.next=15;break}return v=(s||{}).key,M="".concat(e).concat(v?"#".concat(v):""),l.objects.has(M)&&(Z=x.MathUtils.generateUUID(),M+="#".concat(Z)),z=(s==null?void 0:s.target)||u,typeof z=="string"?r=l.objects.get(z):(z==null?void 0:z.objecttype__)==="BaseObject"?r=z:r=l.pencil.scene,t=new y().create(s),t.pencil=l.pencil,t.key=M,l.objects.set(M,t),c.next=14,l.addMesh(t,r);case 14:return c.abrupt("return",t);case 15:throw new Error("Unrecognized:".concat(e));case 16:case"end":return c.stop()}},w)}))()},i.addMesh=function(e,s){return(0,T.Z)(R().mark(function u(){return R().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return w.next=2,e.create();case 2:e.object3d&&(e.object3d.userData.BaseObject_=e,s.add(e.object3d)),e.visible=!0,e.render(),e.pm.resolve();case 6:case"end":return w.stop()}},u)}))()},i.erase=function(){for(var e=arguments.length,s=new Array(e),u=0;u<e;u++)s[u]=arguments[u];var l=this;H(s).forEach(function(w){var y=[];if(typeof w=="string"){var v,M=S(w.split("#"),2),Z=M[0],z=M[1];(v=y).push.apply(v,H(l.getAllObject(Z,{key:z})))}else y.push(w);y.forEach(function(r){l.removeMesh(r)})})},i.removeMesh=function(e){var s=this,u=e.parent;e.object3d&&u.remove(e.object3d),e.traverse(function(l){l.visible=!1,l.dispose(),s.objects.delete(l.key)})},i.update=function(e,s){this.objects.forEach(function(u){u.update(e,s)})},i.setSize=function(e,s){this.objects.forEach(function(u){u.resize(e,s)})},i.dispose=function(){this.objects.forEach(function(e,s){e.dispose(),e.pm.reject("stop draw:".concat(s))}),this.objects.clear(),this.objectNamesToFactories.clear()},d(n,[{key:"objectsPromise",get:function(){var e=[];return this.objects.forEach(function(s){e.push(s.pm.promise)}),e}}]),n}(),k=function(){"use strict";function n(){b(this,n),this.data={}}var i=n.prototype;return i.install=function(){},i.setData=function(e,s){var u,l;this.data[e]=s,(l=(u=this).cb)===null||l===void 0||l.call(u,e)},i.runAll=function(){var e=this;Object.keys(this.data).forEach(function(s){var u,l;(l=(u=e).cb)===null||l===void 0||l.call(u,s)})},i.dispose=function(){this.data={},this.cb=void 0},n}(),L=function(){"use strict";function n(){b(this,n),this.messageList=[]}var i=n.prototype;return i.install=function(){},i.init=function(e,s){var u=this;this.workerList=Array.from({length:s},function(l,w){var y=typeof e=="string"?new Worker(e):e();return y.onmessage=function(v){var M=v.data,Z=M.res,z=M.uuid,r=u.messageList.find(function(t){var o=t.uuid;return z===o});r==null||r.cb(Z),u.workerList[w].inUse=!1,u.checkMessage()},{worker:y,inUse:!1}})},i.postMessage=function(e,s){this.messageList.push({req:e,cb:s,uuid:x.MathUtils.generateUUID(),inUse:!1}),this.checkMessage()},i.checkMessage=function(){var e=this.workerList.find(function(u){var l=u.inUse;return!l});if(e){var s=this.messageList.find(function(u){var l=u.inUse;return!l});s&&(s.inUse=!0,e.inUse=!0,e.worker.postMessage({req:s.req,uuid:s.uuid}))}},i.dispose=function(){this.workerList.forEach(function(e){var s=e.worker;s.terminate()}),this.workerList=[],this.messageList=[]},n}()})();var q=K.Ct,tt=K.Vw,et=K.hG,rt=K.Wk;export{q as Cache,tt as Data,et as Draw,rt as Wk};
@@ -1 +1 @@
1
- (function(){var H={666:function(d){var s=function(n){"use strict";var u=Object.prototype,c=u.hasOwnProperty,i,r=typeof Symbol=="function"?Symbol:{},a=r.iterator||"@@iterator",f=r.asyncIterator||"@@asyncIterator",h=r.toStringTag||"@@toStringTag";function y(e,t,o){return Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{y({},"")}catch(e){y=function(t,o,_){return t[o]=_}}function E(e,t,o,_){var l=t&&t.prototype instanceof z?t:z,C=Object.create(l.prototype),I=new N(_||[]);return C._invoke=k(e,o,I),C}n.wrap=E;function v(e,t,o){try{return{type:"normal",arg:e.call(t,o)}}catch(_){return{type:"throw",arg:_}}}var T="suspendedStart",Z="suspendedYield",G="executing",S="completed",L={};function z(){}function V(){}function U(){}var x={};y(x,a,function(){return this});var M=Object.getPrototypeOf,O=M&&M(M(A([])));O&&O!==u&&c.call(O,a)&&(x=O);var m=U.prototype=z.prototype=Object.create(x);V.prototype=U,y(m,"constructor",U),y(U,"constructor",V),V.displayName=y(U,h,"GeneratorFunction");function p(e){["next","throw","return"].forEach(function(t){y(e,t,function(o){return this._invoke(t,o)})})}n.isGeneratorFunction=function(e){var t=typeof e=="function"&&e.constructor;return t?t===V||(t.displayName||t.name)==="GeneratorFunction":!1},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,U):(e.__proto__=U,y(e,h,"GeneratorFunction")),e.prototype=Object.create(m),e},n.awrap=function(e){return{__await:e}};function g(e,t){function o(C,I,R,W){var B=v(e[C],e,I);if(B.type==="throw")W(B.arg);else{var Y=B.arg,$=Y.value;return $&&typeof $=="object"&&c.call($,"__await")?t.resolve($.__await).then(function(K){o("next",K,R,W)},function(K){o("throw",K,R,W)}):t.resolve($).then(function(K){Y.value=K,R(Y)},function(K){return o("throw",K,R,W)})}}var _;function l(C,I){function R(){return new t(function(W,B){o(C,I,W,B)})}return _=_?_.then(R,R):R()}this._invoke=l}p(g.prototype),y(g.prototype,f,function(){return this}),n.AsyncIterator=g,n.async=function(e,t,o,_,l){l===void 0&&(l=Promise);var C=new g(E(e,t,o,_),l);return n.isGeneratorFunction(t)?C:C.next().then(function(I){return I.done?I.value:C.next()})};function k(e,t,o){var _=T;return function(C,I){if(_===G)throw new Error("Generator is already running");if(_===S){if(C==="throw")throw I;return w()}for(o.method=C,o.arg=I;;){var R=o.delegate;if(R){var W=j(R,o);if(W){if(W===L)continue;return W}}if(o.method==="next")o.sent=o._sent=o.arg;else if(o.method==="throw"){if(_===T)throw _=S,o.arg;o.dispatchException(o.arg)}else o.method==="return"&&o.abrupt("return",o.arg);_=G;var B=v(e,t,o);if(B.type==="normal"){if(_=o.done?S:Z,B.arg===L)continue;return{value:B.arg,done:o.done}}else B.type==="throw"&&(_=S,o.method="throw",o.arg=B.arg)}}}function j(e,t){var o=e.iterator[t.method];if(o===i){if(t.delegate=null,t.method==="throw"){if(e.iterator.return&&(t.method="return",t.arg=i,j(e,t),t.method==="throw"))return L;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return L}var _=v(o,e.iterator,t.arg);if(_.type==="throw")return t.method="throw",t.arg=_.arg,t.delegate=null,L;var l=_.arg;if(!l)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,L;if(l.done)t[e.resultName]=l.value,t.next=e.nextLoc,t.method!=="return"&&(t.method="next",t.arg=i);else return l;return t.delegate=null,L}p(m),y(m,h,"Generator"),y(m,a,function(){return this}),y(m,"toString",function(){return"[object Generator]"});function b(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(b,this),this.reset(!0)}n.keys=function(e){var t=[];for(var o in e)t.push(o);return t.reverse(),function _(){for(;t.length;){var l=t.pop();if(l in e)return _.value=l,_.done=!1,_}return _.done=!0,_}};function A(e){if(e){var t=e[a];if(t)return t.call(e);if(typeof e.next=="function")return e;if(!isNaN(e.length)){var o=-1,_=function l(){for(;++o<e.length;)if(c.call(e,o))return l.value=e[o],l.done=!1,l;return l.value=i,l.done=!0,l};return _.next=_}}return{next:w}}n.values=A;function w(){return{value:i,done:!0}}return N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=i,this.done=!1,this.delegate=null,this.method="next",this.arg=i,this.tryEntries.forEach(D),!e)for(var t in this)t.charAt(0)==="t"&&c.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=i)},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function o(W,B){return C.type="throw",C.arg=e,t.next=W,B&&(t.method="next",t.arg=i),!!B}for(var _=this.tryEntries.length-1;_>=0;--_){var l=this.tryEntries[_],C=l.completion;if(l.tryLoc==="root")return o("end");if(l.tryLoc<=this.prev){var I=c.call(l,"catchLoc"),R=c.call(l,"finallyLoc");if(I&&R){if(this.prev<l.catchLoc)return o(l.catchLoc,!0);if(this.prev<l.finallyLoc)return o(l.finallyLoc)}else if(I){if(this.prev<l.catchLoc)return o(l.catchLoc,!0)}else if(R){if(this.prev<l.finallyLoc)return o(l.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(e,t){for(var o=this.tryEntries.length-1;o>=0;--o){var _=this.tryEntries[o];if(_.tryLoc<=this.prev&&c.call(_,"finallyLoc")&&this.prev<_.finallyLoc){var l=_;break}}l&&(e==="break"||e==="continue")&&l.tryLoc<=t&&t<=l.finallyLoc&&(l=null);var C=l?l.completion:{};return C.type=e,C.arg=t,l?(this.method="next",this.next=l.finallyLoc,L):this.complete(C)},complete:function(e,t){if(e.type==="throw")throw e.arg;return e.type==="break"||e.type==="continue"?this.next=e.arg:e.type==="return"?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):e.type==="normal"&&t&&(this.next=t),L},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.finallyLoc===e)return this.complete(o.completion,o.afterLoc),D(o),L}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.tryLoc===e){var _=o.completion;if(_.type==="throw"){var l=_.arg;D(o)}return l}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,o){return this.delegate={iterator:A(e),resultName:t,nextLoc:o},this.method==="next"&&(this.arg=i),L}},n}(d.exports);try{regeneratorRuntime=s}catch(n){typeof globalThis=="object"?globalThis.regeneratorRuntime=s:Function("r","regeneratorRuntime = r")(s)}},44:function(d,s,n){"use strict";n.d(s,{Z:function(){return u}});function u(c){if(c.geometry&&c.geometry.dispose(),c.material){var i=Array.isArray(c.material)?c.material:[c.material];i.forEach(function(r){var a,f,h,y,E,v,T,Z,G,S,L,z,V;(a=r.map)===null||a===void 0||a.dispose(),(f=r.lightMap)===null||f===void 0||f.dispose(),(h=r.bumpMap)===null||h===void 0||h.dispose(),(y=r.normalMap)===null||y===void 0||y.dispose(),(E=r.specularMap)===null||E===void 0||E.dispose(),(v=r.envMap)===null||v===void 0||v.dispose(),(T=r.alphaMap)===null||T===void 0||T.dispose(),(Z=r.aoMap)===null||Z===void 0||Z.dispose(),(G=r.displacementMap)===null||G===void 0||G.dispose(),(S=r.emissiveMap)===null||S===void 0||S.dispose(),(L=r.gradientMap)===null||L===void 0||L.dispose(),(z=r.metalnessMap)===null||z===void 0||z.dispose(),(V=r.roughnessMap)===null||V===void 0||V.dispose(),r.dispose()})}}},841:function(d,s,n){"use strict";n.d(s,{U:function(){return c},v:function(){return u}});var u=function(r){for(var a=r.offsetLeft,f=r.offsetParent;f!==null;)a+=f.offsetLeft,f=f.offsetParent;var h;return document.compatMode==="BackCompat"||document.documentElement.scrollTop===0?h=document.body.scrollLeft:h=document.documentElement.scrollLeft,a-h},c=function(r){for(var a=r.offsetTop,f=r.offsetParent;f!==null;)a+=f.offsetTop,f=f.offsetParent;var h;return document.compatMode==="BackCompat"||document.documentElement.scrollTop===0?h=document.body.scrollTop:h=document.documentElement.scrollTop,a-h}},417:function(d,s,n){"use strict";n.d(s,{Z:function(){return c}});function u(i){return Object.prototype.toString.call(i)==="[object Object]"}function c(i){if(u(i)===!1)return!1;var r=i.constructor;if(r===void 0)return!0;var a=r.prototype;return!(u(a)===!1||a.hasOwnProperty("isPrototypeOf")===!1)}},340:function(d,s,n){"use strict";n.d(s,{Z:function(){return c}});var u=n(485);function c(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a={};return a.promise=new Promise(function(f,h){a.resolve=f,a.reject=h}),i&&(a.promise=(0,u.Z)(a.promise,r)),a}},109:function(d,s,n){"use strict";n.d(s,{Z:function(){return u}});function u(c,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=(90-i)*Math.PI/180,f=(90-c)*Math.PI/180;return[r*Math.sin(a)*Math.cos(f),r*Math.cos(a),r*Math.sin(a)*Math.sin(f)]}},900:function(d,s,n){"use strict";n.d(s,{Z:function(){return i}});var u=n(438),c=function(){"use strict";function r(f){(0,u.Z)(this,r),this.onTick_=f,this.cancelPending_=null}var a=r.prototype;return a.tickAfter=function(h){var y=this;this.stop();var E=!0,v;this.cancelPending_=function(){clearTimeout(v),E=!1};var T=function(){E&&y.onTick_()};return v=window.setTimeout(T,h),this},a.stop=function(){this.cancelPending_&&(this.cancelPending_(),this.cancelPending_=null)},r}(),i=function(){"use strict";function r(f){(0,u.Z)(this,r),this.onTick_=f,this.ticker_=null}var a=r.prototype;return a.tickNow=function(){return this.stop(),this.onTick_(),this},a.tickAfter=function(h){var y=this;return this.stop(),this.ticker_=new c(function(){y.onTick_()}).tickAfter(h),this},a.tickEvery=function(h){var y=this;return this.stop(),this.ticker_=new c(function(){var E;(E=y.ticker_)===null||E===void 0||E.tickAfter(h),y.onTick_()}).tickAfter(h),this},a.stop=function(){this.ticker_&&(this.ticker_.stop(),this.ticker_=null)},r}()},485:function(d,s,n){"use strict";n.d(s,{Z:function(){return c}});var u=n(42);function c(i){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return i.then(function(a){return(0,u.Z)({err:null,res:a},r)}).catch(function(a){return(0,u.Z)({err:a,res:void 0},r)})}},818:function(d,s,n){"use strict";n.d(s,{C:function(){return a},y:function(){return r}});var u=n(644),c=n.n(u),i=new Map,r=function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(E,v,T,Z,G){var S=v[T*3],L=v[T*3+1],z=v[Z*3],V=v[Z*3+1],U=v[G*3],x=v[G*3+1],M;if(i.has(E))M=i.get(E);else{var O=h.box3||new u.Box3;if(!h.box3){var m=E.parameters.shapes.getPoints();O.setFromArray(m.map(function(b){return[b.x,b.y,0]}).flat())}var p=O.getSize(new u.Vector3);h.split&&(p.y/=h.split),M={box:O,size:p},i.set(E,M)}var g=M.box,k=M.size,j=h.split?1-h.split:0;return[new u.Vector2((S-g.min.x)/k.x,(L-g.min.y)/k.y+j),new u.Vector2((z-g.min.x)/k.x,(V-g.min.y)/k.y+j),new u.Vector2((U-g.min.x)/k.x,(x-g.min.y)/k.y+j)]},generateSideWallUV:function(E,v,T,Z,G,S){var L=v[T*3],z=v[T*3+1],V=v[T*3+2],U=v[Z*3],x=v[Z*3+1],M=v[Z*3+2],O=v[G*3],m=v[G*3+1],p=v[G*3+2],g=v[S*3],k=v[S*3+1],j=v[S*3+2],b;if(i.has(v))b=i.get(v);else{var D=new u.Box3;D.setFromArray(v);var N=D.getSize(new u.Vector3);h.split&&(N.z/=1-h.split),b={box:D,size:N},i.set(v,b)}var A=b.box,w=b.size;return Math.abs(z-x)<Math.abs(L-U)?[new u.Vector2((L-A.min.x)/w.x,(V-A.min.z)/w.z),new u.Vector2((U-A.min.x)/w.x,(M-A.min.z)/w.z),new u.Vector2((O-A.min.x)/w.x,(p-A.min.z)/w.z),new u.Vector2((g-A.min.x)/w.x,(j-A.min.z)/w.z)]:[new u.Vector2((z-A.min.y)/w.x,(V-A.min.z)/w.z),new u.Vector2((x-A.min.y)/w.x,(M-A.min.z)/w.z),new u.Vector2((m-A.min.y)/w.x,(p-A.min.z)/w.z),new u.Vector2((k-A.min.y)/w.x,(j-A.min.z)/w.z)]}}},a=function(){i.clear()}},644:function(d){"use strict";d.exports=require("three")},943:function(d,s,n){"use strict";n.d(s,{Z:function(){return u}});function u(c,i){(i==null||i>c.length)&&(i=c.length);for(var r=0,a=new Array(i);r<i;r++)a[r]=c[r];return a}},982:function(d,s,n){"use strict";n.d(s,{Z:function(){return c}});var u=n(943);function c(i){if(Array.isArray(i))return(0,u.Z)(i)}},568:function(d,s,n){"use strict";n.d(s,{Z:function(){return c}});function u(i,r,a,f,h,y,E){try{var v=i[y](E),T=v.value}catch(Z){a(Z);return}v.done?r(T):Promise.resolve(T).then(f,h)}function c(i){return function(){var r=this,a=arguments;return new Promise(function(f,h){var y=i.apply(r,a);function E(T){u(y,f,h,E,v,"next",T)}function v(T){u(y,f,h,E,v,"throw",T)}E(void 0)})}}},438:function(d,s,n){"use strict";n.d(s,{Z:function(){return u}});function u(c,i){if(!(c instanceof i))throw new TypeError("Cannot call a class as a function")}},924:function(d,s,n){"use strict";n.d(s,{Z:function(){return u}});function u(c,i,r){return i in c?Object.defineProperty(c,i,{value:r,enumerable:!0,configurable:!0,writable:!0}):c[i]=r,c}},375:function(d,s,n){"use strict";n.d(s,{Z:function(){return u}});function u(c){if(typeof Symbol!="undefined"&&c[Symbol.iterator]!=null||c["@@iterator"]!=null)return Array.from(c)}},270:function(d,s,n){"use strict";n.d(s,{Z:function(){return u}});function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},42:function(d,s,n){"use strict";n.d(s,{Z:function(){return c}});var u=n(924);function c(i){for(var r=1;r<arguments.length;r++){var a=arguments[r]!=null?arguments[r]:{},f=Object.keys(a);typeof Object.getOwnPropertySymbols=="function"&&(f=f.concat(Object.getOwnPropertySymbols(a).filter(function(h){return Object.getOwnPropertyDescriptor(a,h).enumerable}))),f.forEach(function(h){(0,u.Z)(i,h,a[h])})}return i}},342:function(d,s,n){"use strict";n.d(s,{Z:function(){return a}});var u=n(982),c=n(375),i=n(270),r=n(566);function a(f){return(0,u.Z)(f)||(0,c.Z)(f)||(0,r.Z)(f)||(0,i.Z)()}},566:function(d,s,n){"use strict";n.d(s,{Z:function(){return c}});var u=n(943);function c(i,r){if(!!i){if(typeof i=="string")return(0,u.Z)(i,r);var a=Object.prototype.toString.call(i).slice(8,-1);if(a==="Object"&&i.constructor&&(a=i.constructor.name),a==="Map"||a==="Set")return Array.from(a);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return(0,u.Z)(i,r)}}}},X={};function P(d){var s=X[d];if(s!==void 0)return s.exports;var n=X[d]={exports:{}};return H[d](n,n.exports,P),n.exports}(function(){P.n=function(d){var s=d&&d.__esModule?function(){return d.default}:function(){return d};return P.d(s,{a:s}),s}})(),function(){P.d=function(d,s){for(var n in s)P.o(s,n)&&!P.o(d,n)&&Object.defineProperty(d,n,{enumerable:!0,get:s[n]})}}(),function(){P.o=function(d,s){return Object.prototype.hasOwnProperty.call(d,s)}}(),function(){P.r=function(d){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(d,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(d,"__esModule",{value:!0})}}();var F={};(function(){"use strict";P.r(F),P.d(F,{Chain:function(){return h},Timer:function(){return n.Z},claerUVGenerator:function(){return x.C},clearAllCache:function(){return z},clearCache:function(){return L},colorCorrection:function(){return T},disposeMesh:function(){return E.Z},getCache:function(){return V},getElementViewLeft:function(){return U.v},getElementViewTop:function(){return U.U},getUVGenerator:function(){return x.y},isPlainObject:function(){return Z.Z},makePromiseCreator:function(){return d.Z},polar2Cartesian:function(){return y.Z},to:function(){return s.Z}});var d=P(340),s=P(485),n=P(900),u=P(568),c=P(438),i=P(42),r=P(342),a=P(666),f=P.n(a),h=function(){"use strict";function M(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(0,c.Z)(this,M),this.index=0,this.repeatCount=0,this.repeatNum=0,this.isPlaying=!1,this.chainedList=[],this.children=[],this.options=(0,i.Z)({},{isdev:!1},m)}var O=M.prototype;return O.start=function(){return this.isPlaying?this:(this.index=0,this.isPlaying=!0,this.play())},O.stop1=function(){return this.isPlaying?(this.isPlaying=!1,this.repeatCount=0,this):this},O.stop=function(){return this.traverse(function(p){return p.stop1()}),this},O.dispose=function(){return this.stop(),this.chainedList=[],this.children=[],this},O.play=function(){var p=this;return(0,u.Z)(f().mark(function g(){var k;return f().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(k=p.chainedList[p.index],!(k&&p.isPlaying)){b.next=9;break}return b.next=4,Promise.all(k.map(function(D){return typeof D=="function"?D(p.repeatCount):D.start()}));case 4:return p.index+=1,b.next=7,p.play();case 7:b.next=17;break;case 9:if(!(!k&&p.isPlaying&&p.repeatCount<p.repeatNum)){b.next=16;break}return p.repeatCount+=1,p.index=0,b.next=14,p.play();case 14:b.next=17;break;case 16:!k&&p.isPlaying&&p.repeatCount===p.repeatNum&&p.stop();case 17:case"end":return b.stop()}},g)}))()},O.chain=function(){for(var p=arguments.length,g=new Array(p),k=0;k<p;k++)g[k]=arguments[k];var j=this;return(0,r.Z)(g).forEach(function(b){b instanceof M&&j.children.push(b)}),this.chainedList.push((0,r.Z)(g)),this},O.repeat=function(p){return this.repeatNum=p,this},O.timeout=function(p){return this.chain(function(){return new Promise(function(g){return setTimeout(g,p)})}),this},O.traverse=function(p){p(this),this.children.forEach(function(g){g.traverse(p)})},M}(),y=P(109),E=P(44),v=P(644);function T(M){if(M.material){var O=Array.isArray(M.material)?M.material:[M.material];O.forEach(function(m){var p,g;(p=m.color)===null||p===void 0||p.convertSRGBToLinear(),(g=m.emissive)===null||g===void 0||g.convertSRGBToLinear(),m.map&&(m.map.encoding=v.sRGBEncoding),m.emissiveMap&&(m.emissiveMap.encoding=v.sRGBEncoding)})}}var Z=P(417),G=P(924),S=require("idb-keyval"),L=S.del,z=S.clear,V=function(){var M=(0,u.Z)(f().mark(function O(m,p){var g,k,j,b,D,N;return f().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return g=p.version,w.next=4,(0,S.get)(m);case 4:if(j=w.sent,!(j&&j[g])){w.next=9;break}k=j[g],w.next=15;break;case 9:return w.next=11,(0,s.Z)(fetch(m).then(function(e){if(e.ok)return e.blob();throw new Error}));case 11:b=w.sent,D=b.res,N=b.err,N||(k=D,(0,S.set)(m,(0,G.Z)({},g,D)));case 15:return w.abrupt("return",k?{url:URL.createObjectURL(k)}:{url:m});case 16:case"end":return w.stop()}},O)}));return function(m,p){return M.apply(this,arguments)}}(),U=P(841),x=P(818)})(),module.exports=F})();
1
+ (function(){var H={666:function(v){var c=function(i){"use strict";var u=Object.prototype,f=u.hasOwnProperty,e,n=typeof Symbol=="function"?Symbol:{},o=n.iterator||"@@iterator",s=n.asyncIterator||"@@asyncIterator",m=n.toStringTag||"@@toStringTag";function l(r,t,a){return Object.defineProperty(r,t,{value:a,enumerable:!0,configurable:!0,writable:!0}),r[t]}try{l({},"")}catch(r){l=function(t,a,_){return t[a]=_}}function g(r,t,a,_){var h=t&&t.prototype instanceof G?t:G,A=Object.create(h.prototype),I=new M(_||[]);return A._invoke=P(r,a,I),A}i.wrap=g;function E(r,t,a){try{return{type:"normal",arg:r.call(t,a)}}catch(_){return{type:"throw",arg:_}}}var O="suspendedStart",j="suspendedYield",R="executing",Z="completed",T={};function G(){}function D(){}function C(){}var W={};l(W,o,function(){return this});var S=Object.getPrototypeOf,k=S&&S(S($([])));k&&k!==u&&f.call(k,o)&&(W=k);var d=C.prototype=G.prototype=Object.create(W);D.prototype=C,l(d,"constructor",C),l(C,"constructor",D),D.displayName=l(C,m,"GeneratorFunction");function p(r){["next","throw","return"].forEach(function(t){l(r,t,function(a){return this._invoke(t,a)})})}i.isGeneratorFunction=function(r){var t=typeof r=="function"&&r.constructor;return t?t===D||(t.displayName||t.name)==="GeneratorFunction":!1},i.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,C):(r.__proto__=C,l(r,m,"GeneratorFunction")),r.prototype=Object.create(d),r},i.awrap=function(r){return{__await:r}};function y(r,t){function a(A,I,U,x){var V=E(r[A],r,I);if(V.type==="throw")x(V.arg);else{var Y=V.arg,K=Y.value;return K&&typeof K=="object"&&f.call(K,"__await")?t.resolve(K.__await).then(function(N){a("next",N,U,x)},function(N){a("throw",N,U,x)}):t.resolve(K).then(function(N){Y.value=N,U(Y)},function(N){return a("throw",N,U,x)})}}var _;function h(A,I){function U(){return new t(function(x,V){a(A,I,x,V)})}return _=_?_.then(U,U):U()}this._invoke=h}p(y.prototype),l(y.prototype,s,function(){return this}),i.AsyncIterator=y,i.async=function(r,t,a,_,h){h===void 0&&(h=Promise);var A=new y(g(r,t,a,_),h);return i.isGeneratorFunction(t)?A:A.next().then(function(I){return I.done?I.value:A.next()})};function P(r,t,a){var _=O;return function(A,I){if(_===R)throw new Error("Generator is already running");if(_===Z){if(A==="throw")throw I;return B()}for(a.method=A,a.arg=I;;){var U=a.delegate;if(U){var x=z(U,a);if(x){if(x===T)continue;return x}}if(a.method==="next")a.sent=a._sent=a.arg;else if(a.method==="throw"){if(_===O)throw _=Z,a.arg;a.dispatchException(a.arg)}else a.method==="return"&&a.abrupt("return",a.arg);_=R;var V=E(r,t,a);if(V.type==="normal"){if(_=a.done?Z:j,V.arg===T)continue;return{value:V.arg,done:a.done}}else V.type==="throw"&&(_=Z,a.method="throw",a.arg=V.arg)}}}function z(r,t){var a=r.iterator[t.method];if(a===e){if(t.delegate=null,t.method==="throw"){if(r.iterator.return&&(t.method="return",t.arg=e,z(r,t),t.method==="throw"))return T;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return T}var _=E(a,r.iterator,t.arg);if(_.type==="throw")return t.method="throw",t.arg=_.arg,t.delegate=null,T;var h=_.arg;if(!h)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,T;if(h.done)t[r.resultName]=h.value,t.next=r.nextLoc,t.method!=="return"&&(t.method="next",t.arg=e);else return h;return t.delegate=null,T}p(d),l(d,m,"Generator"),l(d,o,function(){return this}),l(d,"toString",function(){return"[object Generator]"});function L(r){var t={tryLoc:r[0]};1 in r&&(t.catchLoc=r[1]),2 in r&&(t.finallyLoc=r[2],t.afterLoc=r[3]),this.tryEntries.push(t)}function w(r){var t=r.completion||{};t.type="normal",delete t.arg,r.completion=t}function M(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(L,this),this.reset(!0)}i.keys=function(r){var t=[];for(var a in r)t.push(a);return t.reverse(),function _(){for(;t.length;){var h=t.pop();if(h in r)return _.value=h,_.done=!1,_}return _.done=!0,_}};function $(r){if(r){var t=r[o];if(t)return t.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length)){var a=-1,_=function h(){for(;++a<r.length;)if(f.call(r,a))return h.value=r[a],h.done=!1,h;return h.value=e,h.done=!0,h};return _.next=_}}return{next:B}}i.values=$;function B(){return{value:e,done:!0}}return M.prototype={constructor:M,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(w),!r)for(var t in this)t.charAt(0)==="t"&&f.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=e)},stop:function(){this.done=!0;var r=this.tryEntries[0],t=r.completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var t=this;function a(x,V){return A.type="throw",A.arg=r,t.next=x,V&&(t.method="next",t.arg=e),!!V}for(var _=this.tryEntries.length-1;_>=0;--_){var h=this.tryEntries[_],A=h.completion;if(h.tryLoc==="root")return a("end");if(h.tryLoc<=this.prev){var I=f.call(h,"catchLoc"),U=f.call(h,"finallyLoc");if(I&&U){if(this.prev<h.catchLoc)return a(h.catchLoc,!0);if(this.prev<h.finallyLoc)return a(h.finallyLoc)}else if(I){if(this.prev<h.catchLoc)return a(h.catchLoc,!0)}else if(U){if(this.prev<h.finallyLoc)return a(h.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(r,t){for(var a=this.tryEntries.length-1;a>=0;--a){var _=this.tryEntries[a];if(_.tryLoc<=this.prev&&f.call(_,"finallyLoc")&&this.prev<_.finallyLoc){var h=_;break}}h&&(r==="break"||r==="continue")&&h.tryLoc<=t&&t<=h.finallyLoc&&(h=null);var A=h?h.completion:{};return A.type=r,A.arg=t,h?(this.method="next",this.next=h.finallyLoc,T):this.complete(A)},complete:function(r,t){if(r.type==="throw")throw r.arg;return r.type==="break"||r.type==="continue"?this.next=r.arg:r.type==="return"?(this.rval=this.arg=r.arg,this.method="return",this.next="end"):r.type==="normal"&&t&&(this.next=t),T},finish:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.finallyLoc===r)return this.complete(a.completion,a.afterLoc),w(a),T}},catch:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.tryLoc===r){var _=a.completion;if(_.type==="throw"){var h=_.arg;w(a)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(r,t,a){return this.delegate={iterator:$(r),resultName:t,nextLoc:a},this.method==="next"&&(this.arg=e),T}},i}(v.exports);try{regeneratorRuntime=c}catch(i){typeof globalThis=="object"?globalThis.regeneratorRuntime=c:Function("r","regeneratorRuntime = r")(c)}},695:function(v,c,i){"use strict";i.d(c,{Z:function(){return u}});function u(f){if(f.geometry&&f.geometry.dispose(),f.material){var e=Array.isArray(f.material)?f.material:[f.material];e.forEach(function(n){var o,s,m,l,g,E,O,j,R,Z,T,G,D;(o=n.map)===null||o===void 0||o.dispose(),(s=n.lightMap)===null||s===void 0||s.dispose(),(m=n.bumpMap)===null||m===void 0||m.dispose(),(l=n.normalMap)===null||l===void 0||l.dispose(),(g=n.specularMap)===null||g===void 0||g.dispose(),(E=n.envMap)===null||E===void 0||E.dispose(),(O=n.alphaMap)===null||O===void 0||O.dispose(),(j=n.aoMap)===null||j===void 0||j.dispose(),(R=n.displacementMap)===null||R===void 0||R.dispose(),(Z=n.emissiveMap)===null||Z===void 0||Z.dispose(),(T=n.gradientMap)===null||T===void 0||T.dispose(),(G=n.metalnessMap)===null||G===void 0||G.dispose(),(D=n.roughnessMap)===null||D===void 0||D.dispose(),n.dispose()})}}},490:function(v,c,i){"use strict";i.d(c,{U:function(){return f},v:function(){return u}});var u=function(e){for(var n=e.offsetLeft,o=e.offsetParent;o!==null;)n+=o.offsetLeft,o=o.offsetParent;var s;return document.compatMode==="BackCompat"||document.documentElement.scrollTop===0?s=document.body.scrollLeft:s=document.documentElement.scrollLeft,n-s},f=function(e){for(var n=e.offsetTop,o=e.offsetParent;o!==null;)n+=o.offsetTop,o=o.offsetParent;var s;return document.compatMode==="BackCompat"||document.documentElement.scrollTop===0?s=document.body.scrollTop:s=document.documentElement.scrollTop,n-s}},738:function(v,c,i){"use strict";i.d(c,{Z:function(){return f}});function u(e){return Object.prototype.toString.call(e)==="[object Object]"}function f(e){if(u(e)===!1)return!1;var n=e.constructor;if(n===void 0)return!0;var o=n.prototype;return!(u(o)===!1||o.hasOwnProperty("isPrototypeOf")===!1)}},282:function(v,c,i){"use strict";i.d(c,{Z:function(){return f}});var u=i(484);function f(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o={};return o.promise=new Promise(function(s,m){o.resolve=s,o.reject=m}),e&&(o.promise=(0,u.Z)(o.promise,n)),o}},713:function(v,c,i){"use strict";i.d(c,{Z:function(){return u}});function u(f,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=(90-e)*Math.PI/180,s=(90-f)*Math.PI/180;return[n*Math.sin(o)*Math.cos(s),n*Math.cos(o),n*Math.sin(o)*Math.sin(s)]}},618:function(v,c,i){"use strict";i.d(c,{Z:function(){return e}});var u=i(438),f=function(){"use strict";function n(s){(0,u.Z)(this,n),this.onTick_=s,this.cancelPending_=null}var o=n.prototype;return o.tickAfter=function(m){var l=this;this.stop();var g=!0,E;this.cancelPending_=function(){clearTimeout(E),g=!1};var O=function(){g&&l.onTick_()};return E=window.setTimeout(O,m),this},o.stop=function(){this.cancelPending_&&(this.cancelPending_(),this.cancelPending_=null)},n}(),e=function(){"use strict";function n(s){(0,u.Z)(this,n),this.onTick_=s,this.ticker_=null}var o=n.prototype;return o.tickNow=function(){return this.stop(),this.onTick_(),this},o.tickAfter=function(m){var l=this;return this.stop(),this.ticker_=new f(function(){l.onTick_()}).tickAfter(m),this},o.tickEvery=function(m){var l=this;return this.stop(),this.ticker_=new f(function(){var g;(g=l.ticker_)===null||g===void 0||g.tickAfter(m),l.onTick_()}).tickAfter(m),this},o.stop=function(){this.ticker_&&(this.ticker_.stop(),this.ticker_=null)},n}()},484:function(v,c,i){"use strict";i.d(c,{Z:function(){return f}});var u=i(42);function f(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e.then(function(o){return(0,u.Z)({err:null,res:o},n)}).catch(function(o){return(0,u.Z)({err:o,res:void 0},n)})}},705:function(v,c,i){"use strict";i.d(c,{C:function(){return o},y:function(){return n}});var u=i(644),f=i.n(u),e=new Map,n=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(m,l,g,E,O){var j=l[g*3],R=l[g*3+1],Z=l[E*3],T=l[E*3+1],G=l[O*3],D=l[O*3+1],C;if(e.has(m))C=e.get(m);else{var W=s.box3||new u.Box3;if(!s.box3){var S=m.parameters.shapes.getPoints();W.setFromArray(S.map(function(P){return[P.x,P.y,0]}).flat())}var k=W.getSize(new u.Vector3);s.split&&(k.y/=s.split),C={box:W,size:k},e.set(m,C)}var d=C.box,p=C.size,y=s.split?1-s.split:0;return[new u.Vector2((j-d.min.x)/p.x,(R-d.min.y)/p.y+y),new u.Vector2((Z-d.min.x)/p.x,(T-d.min.y)/p.y+y),new u.Vector2((G-d.min.x)/p.x,(D-d.min.y)/p.y+y)]},generateSideWallUV:function(m,l,g,E,O,j){var R=l[g*3],Z=l[g*3+1],T=l[g*3+2],G=l[E*3],D=l[E*3+1],C=l[E*3+2],W=l[O*3],S=l[O*3+1],k=l[O*3+2],d=l[j*3],p=l[j*3+1],y=l[j*3+2],P;if(e.has(l))P=e.get(l);else{var z=new u.Box3;z.setFromArray(l);var L=z.getSize(new u.Vector3);s.split&&(L.z/=1-s.split),P={box:z,size:L},e.set(l,P)}var w=P.box,M=P.size;return Math.abs(Z-D)<Math.abs(R-G)?[new u.Vector2((R-w.min.x)/M.x,(T-w.min.z)/M.z),new u.Vector2((G-w.min.x)/M.x,(C-w.min.z)/M.z),new u.Vector2((W-w.min.x)/M.x,(k-w.min.z)/M.z),new u.Vector2((d-w.min.x)/M.x,(y-w.min.z)/M.z)]:[new u.Vector2((Z-w.min.y)/M.x,(T-w.min.z)/M.z),new u.Vector2((D-w.min.y)/M.x,(C-w.min.z)/M.z),new u.Vector2((S-w.min.y)/M.x,(k-w.min.z)/M.z),new u.Vector2((p-w.min.y)/M.x,(y-w.min.z)/M.z)]}}},o=function(){e.clear()}},644:function(v){"use strict";v.exports=require("three")},943:function(v,c,i){"use strict";i.d(c,{Z:function(){return u}});function u(f,e){(e==null||e>f.length)&&(e=f.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=f[n];return o}},982:function(v,c,i){"use strict";i.d(c,{Z:function(){return f}});var u=i(943);function f(e){if(Array.isArray(e))return(0,u.Z)(e)}},568:function(v,c,i){"use strict";i.d(c,{Z:function(){return f}});function u(e,n,o,s,m,l,g){try{var E=e[l](g),O=E.value}catch(j){o(j);return}E.done?n(O):Promise.resolve(O).then(s,m)}function f(e){return function(){var n=this,o=arguments;return new Promise(function(s,m){var l=e.apply(n,o);function g(O){u(l,s,m,g,E,"next",O)}function E(O){u(l,s,m,g,E,"throw",O)}g(void 0)})}}},438:function(v,c,i){"use strict";i.d(c,{Z:function(){return u}});function u(f,e){if(!(f instanceof e))throw new TypeError("Cannot call a class as a function")}},924:function(v,c,i){"use strict";i.d(c,{Z:function(){return u}});function u(f,e,n){return e in f?Object.defineProperty(f,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):f[e]=n,f}},375:function(v,c,i){"use strict";i.d(c,{Z:function(){return u}});function u(f){if(typeof Symbol!="undefined"&&f[Symbol.iterator]!=null||f["@@iterator"]!=null)return Array.from(f)}},270:function(v,c,i){"use strict";i.d(c,{Z:function(){return u}});function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},42:function(v,c,i){"use strict";i.d(c,{Z:function(){return f}});var u=i(924);function f(e){for(var n=1;n<arguments.length;n++){var o=arguments[n]!=null?arguments[n]:{},s=Object.keys(o);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(o).filter(function(m){return Object.getOwnPropertyDescriptor(o,m).enumerable}))),s.forEach(function(m){(0,u.Z)(e,m,o[m])})}return e}},342:function(v,c,i){"use strict";i.d(c,{Z:function(){return o}});var u=i(982),f=i(375),e=i(270),n=i(566);function o(s){return(0,u.Z)(s)||(0,f.Z)(s)||(0,n.Z)(s)||(0,e.Z)()}},566:function(v,c,i){"use strict";i.d(c,{Z:function(){return f}});var u=i(943);function f(e,n){if(!!e){if(typeof e=="string")return(0,u.Z)(e,n);var o=Object.prototype.toString.call(e).slice(8,-1);if(o==="Object"&&e.constructor&&(o=e.constructor.name),o==="Map"||o==="Set")return Array.from(o);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return(0,u.Z)(e,n)}}}},X={};function b(v){var c=X[v];if(c!==void 0)return c.exports;var i=X[v]={exports:{}};return H[v](i,i.exports,b),i.exports}(function(){b.n=function(v){var c=v&&v.__esModule?function(){return v.default}:function(){return v};return b.d(c,{a:c}),c}})(),function(){b.d=function(v,c){for(var i in c)b.o(c,i)&&!b.o(v,i)&&Object.defineProperty(v,i,{enumerable:!0,get:c[i]})}}(),function(){b.o=function(v,c){return Object.prototype.hasOwnProperty.call(v,c)}}(),function(){b.r=function(v){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(v,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(v,"__esModule",{value:!0})}}();var F={};(function(){"use strict";b.r(F),b.d(F,{Chain:function(){return m},Timer:function(){return i.Z},claerUVGenerator:function(){return W.C},clearAllCache:function(){return G},clearCache:function(){return T},colorCorrection:function(){return O},disposeMesh:function(){return g.Z},getCache:function(){return D},getElementViewLeft:function(){return C.v},getElementViewTop:function(){return C.U},getUVGenerator:function(){return W.y},isPlainObject:function(){return j.Z},makePromiseCreator:function(){return v.Z},polar2Cartesian:function(){return l.Z},to:function(){return c.Z}});var v=b(282),c=b(484),i=b(618),u=b(568),f=b(438),e=b(42),n=b(342),o=b(666),s=b.n(o),m=function(){"use strict";function S(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(0,f.Z)(this,S),this.index=0,this.repeatCount=0,this.repeatNum=0,this.isPlaying=!1,this.chainedList=[],this.children=[],this.options=(0,e.Z)({},{isdev:!1},d)}var k=S.prototype;return k.start=function(){return this.isPlaying?this:(this.index=0,this.isPlaying=!0,this.play())},k.stop1=function(){return this.isPlaying?(this.isPlaying=!1,this.repeatCount=0,this):this},k.stop=function(){return this.traverse(function(p){return p.stop1()}),this},k.dispose=function(){return this.stop(),this.chainedList=[],this.children=[],this},k.play=function(){var p=this;return(0,u.Z)(s().mark(function y(){var P;return s().wrap(function(L){for(;;)switch(L.prev=L.next){case 0:if(P=p.chainedList[p.index],!(P&&p.isPlaying)){L.next=9;break}return L.next=4,Promise.all(P.map(function(w){return typeof w=="function"?w(p.repeatCount):w.start()}));case 4:return p.index+=1,L.next=7,p.play();case 7:L.next=17;break;case 9:if(!(!P&&p.isPlaying&&p.repeatCount<p.repeatNum)){L.next=16;break}return p.repeatCount+=1,p.index=0,L.next=14,p.play();case 14:L.next=17;break;case 16:!P&&p.isPlaying&&p.repeatCount===p.repeatNum&&p.stop();case 17:case"end":return L.stop()}},y)}))()},k.chain=function(){for(var p=arguments.length,y=new Array(p),P=0;P<p;P++)y[P]=arguments[P];var z=this;return(0,n.Z)(y).forEach(function(L){L instanceof S&&z.children.push(L)}),this.chainedList.push((0,n.Z)(y)),this},k.repeat=function(p){return this.repeatNum=p,this},k.timeout=function(p){return this.chain(function(){return new Promise(function(y){return setTimeout(y,p)})}),this},k.traverse=function(p){p(this),this.children.forEach(function(y){y.traverse(p)})},S}(),l=b(713),g=b(695),E=b(644);function O(S){if(S.material){var k=Array.isArray(S.material)?S.material:[S.material];k.forEach(function(d){var p,y;(p=d.color)===null||p===void 0||p.convertSRGBToLinear(),(y=d.emissive)===null||y===void 0||y.convertSRGBToLinear(),d.map&&(d.map.encoding=E.sRGBEncoding),d.emissiveMap&&(d.emissiveMap.encoding=E.sRGBEncoding)})}}var j=b(738),R=b(924),Z=require("idb-keyval"),T=Z.del,G=Z.clear,D=function(){var S=(0,u.Z)(s().mark(function k(d,p){var y,P,z,L,w,M;return s().wrap(function(B){for(;;)switch(B.prev=B.next){case 0:return y=p.version,B.next=4,(0,Z.get)(d);case 4:if(z=B.sent,!(z&&z[y])){B.next=9;break}P=z[y],B.next=15;break;case 9:return B.next=11,(0,c.Z)(fetch(d).then(function(r){if(r.ok)return r.blob();throw new Error}));case 11:L=B.sent,w=L.res,M=L.err,M||(P=w,(0,Z.set)(d,(0,R.Z)({},y,w)));case 15:return B.abrupt("return",P?{url:URL.createObjectURL(P)}:{url:d});case 16:case"end":return B.stop()}},k)}));return function(d,p){return S.apply(this,arguments)}}(),C=b(490),W=b(705)})(),module.exports=F})();