gl-draw 0.1.5 → 0.1.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.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(){var Be={187:function(j){"use strict";var A=typeof Reflect=="object"?Reflect:null,S=A&&typeof A.apply=="function"?A.apply:function(c,v,m){return Function.prototype.apply.call(c,v,m)},G;A&&typeof A.ownKeys=="function"?G=A.ownKeys:Object.getOwnPropertySymbols?G=function(c){return Object.getOwnPropertyNames(c).concat(Object.getOwnPropertySymbols(c))}:G=function(c){return Object.getOwnPropertyNames(c)};function D(f){console&&console.warn&&console.warn(f)}var E=Number.isNaN||function(c){return c!==c};function g(){g.init.call(this)}j.exports=g,j.exports.once=Q,g.EventEmitter=g,g.prototype._events=void 0,g.prototype._eventsCount=0,g.prototype._maxListeners=void 0;var B=10;function H(f){if(typeof f!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof f)}Object.defineProperty(g,"defaultMaxListeners",{enumerable:!0,get:function(){return B},set:function(f){if(typeof f!="number"||f<0||E(f))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+f+".");B=f}}),g.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},g.prototype.setMaxListeners=function(c){if(typeof c!="number"||c<0||E(c))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+c+".");return this._maxListeners=c,this};function U(f){return f._maxListeners===void 0?g.defaultMaxListeners:f._maxListeners}g.prototype.getMaxListeners=function(){return U(this)},g.prototype.emit=function(c){for(var v=[],m=1;m<arguments.length;m++)v.push(arguments[m]);var P=c==="error",L=this._events;if(L!==void 0)P=P&&L.error===void 0;else if(!P)return!1;if(P){var T;if(v.length>0&&(T=v[0]),T instanceof Error)throw T;var J=new Error("Unhandled error."+(T?" ("+T.message+")":""));throw J.context=T,J}var K=L[c];if(K===void 0)return!1;if(typeof K=="function")S(K,this,v);else for(var W=K.length,q=ae(K,W),m=0;m<W;++m)S(q[m],this,v);return!0};function x(f,c,v,m){var P,L,T;if(H(v),L=f._events,L===void 0?(L=f._events=Object.create(null),f._eventsCount=0):(L.newListener!==void 0&&(f.emit("newListener",c,v.listener?v.listener:v),L=f._events),T=L[c]),T===void 0)T=L[c]=v,++f._eventsCount;else if(typeof T=="function"?T=L[c]=m?[v,T]:[T,v]:m?T.unshift(v):T.push(v),P=U(f),P>0&&T.length>P&&!T.warned){T.warned=!0;var J=new Error("Possible EventEmitter memory leak detected. "+T.length+" "+String(c)+" listeners added. Use emitter.setMaxListeners() to increase limit");J.name="MaxListenersExceededWarning",J.emitter=f,J.type=c,J.count=T.length,D(J)}return f}g.prototype.addListener=function(c,v){return x(this,c,v,!1)},g.prototype.on=g.prototype.addListener,g.prototype.prependListener=function(c,v){return x(this,c,v,!0)};function k(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(f,c,v){var m={fired:!1,wrapFn:void 0,target:f,type:c,listener:v},P=k.bind(m);return P.listener=v,m.wrapFn=P,P}g.prototype.once=function(c,v){return H(v),this.on(c,l(this,c,v)),this},g.prototype.prependOnceListener=function(c,v){return H(v),this.prependListener(c,l(this,c,v)),this},g.prototype.removeListener=function(c,v){var m,P,L,T,J;if(H(v),P=this._events,P===void 0)return this;if(m=P[c],m===void 0)return this;if(m===v||m.listener===v)--this._eventsCount===0?this._events=Object.create(null):(delete P[c],P.removeListener&&this.emit("removeListener",c,m.listener||v));else if(typeof m!="function"){for(L=-1,T=m.length-1;T>=0;T--)if(m[T]===v||m[T].listener===v){J=m[T].listener,L=T;break}if(L<0)return this;L===0?m.shift():ne(m,L),m.length===1&&(P[c]=m[0]),P.removeListener!==void 0&&this.emit("removeListener",c,J||v)}return this},g.prototype.off=g.prototype.removeListener,g.prototype.removeAllListeners=function(c){var v,m,P;if(m=this._events,m===void 0)return this;if(m.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):m[c]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete m[c]),this;if(arguments.length===0){var L=Object.keys(m),T;for(P=0;P<L.length;++P)T=L[P],T!=="removeListener"&&this.removeAllListeners(T);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(v=m[c],typeof v=="function")this.removeListener(c,v);else if(v!==void 0)for(P=v.length-1;P>=0;P--)this.removeListener(c,v[P]);return this};function N(f,c,v){var m=f._events;if(m===void 0)return[];var P=m[c];return P===void 0?[]:typeof P=="function"?v?[P.listener||P]:[P]:v?X(P):ae(P,P.length)}g.prototype.listeners=function(c){return N(this,c,!0)},g.prototype.rawListeners=function(c){return N(this,c,!1)},g.listenerCount=function(f,c){return typeof f.listenerCount=="function"?f.listenerCount(c):ee.call(f,c)},g.prototype.listenerCount=ee;function ee(f){var c=this._events;if(c!==void 0){var v=c[f];if(typeof v=="function")return 1;if(v!==void 0)return v.length}return 0}g.prototype.eventNames=function(){return this._eventsCount>0?G(this._events):[]};function ae(f,c){for(var v=new Array(c),m=0;m<c;++m)v[m]=f[m];return v}function ne(f,c){for(;c+1<f.length;c++)f[c]=f[c+1];f.pop()}function X(f){for(var c=new Array(f.length),v=0;v<c.length;++v)c[v]=f[v].listener||f[v];return c}function Q(f,c){return new Promise(function(v,m){function P(T){f.removeListener(c,L),m(T)}function L(){typeof f.removeListener=="function"&&f.removeListener("error",P),v([].slice.call(arguments))}R(f,c,L,{once:!0}),c!=="error"&&Y(f,P,{once:!0})})}function Y(f,c,v){typeof f.on=="function"&&R(f,"error",c,v)}function R(f,c,v,m){if(typeof f.on=="function")m.once?f.once(c,v):f.on(c,v);else if(typeof f.addEventListener=="function")f.addEventListener(c,function P(L){m.once&&f.removeEventListener(c,P),v(L)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof f)}},666:function(j){var A=function(S){"use strict";var G=Object.prototype,D=G.hasOwnProperty,E,g=typeof Symbol=="function"?Symbol:{},B=g.iterator||"@@iterator",H=g.asyncIterator||"@@asyncIterator",U=g.toStringTag||"@@toStringTag";function x(p,d,b){return Object.defineProperty(p,d,{value:b,enumerable:!0,configurable:!0,writable:!0}),p[d]}try{x({},"")}catch(p){x=function(d,b,M){return d[b]=M}}function k(p,d,b,M){var O=d&&d.prototype instanceof Q?d:Q,$=Object.create(O.prototype),se=new q(M||[]);return $._invoke=T(p,b,se),$}S.wrap=k;function l(p,d,b){try{return{type:"normal",arg:p.call(d,b)}}catch(M){return{type:"throw",arg:M}}}var N="suspendedStart",ee="suspendedYield",ae="executing",ne="completed",X={};function Q(){}function Y(){}function R(){}var f={};x(f,B,function(){return this});var c=Object.getPrototypeOf,v=c&&c(c(ve([])));v&&v!==G&&D.call(v,B)&&(f=v);var m=R.prototype=Q.prototype=Object.create(f);Y.prototype=R,x(m,"constructor",R),x(R,"constructor",Y),Y.displayName=x(R,U,"GeneratorFunction");function P(p){["next","throw","return"].forEach(function(d){x(p,d,function(b){return this._invoke(d,b)})})}S.isGeneratorFunction=function(p){var d=typeof p=="function"&&p.constructor;return d?d===Y||(d.displayName||d.name)==="GeneratorFunction":!1},S.mark=function(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,R):(p.__proto__=R,x(p,U,"GeneratorFunction")),p.prototype=Object.create(m),p},S.awrap=function(p){return{__await:p}};function L(p,d){function b($,se,ie,oe){var te=l(p[$],p,se);if(te.type==="throw")oe(te.arg);else{var pe=te.arg,me=pe.value;return me&&typeof me=="object"&&D.call(me,"__await")?d.resolve(me.__await).then(function(he){b("next",he,ie,oe)},function(he){b("throw",he,ie,oe)}):d.resolve(me).then(function(he){pe.value=he,ie(pe)},function(he){return b("throw",he,ie,oe)})}}var M;function O($,se){function ie(){return new d(function(oe,te){b($,se,oe,te)})}return M=M?M.then(ie,ie):ie()}this._invoke=O}P(L.prototype),x(L.prototype,H,function(){return this}),S.AsyncIterator=L,S.async=function(p,d,b,M,O){O===void 0&&(O=Promise);var $=new L(k(p,d,b,M),O);return S.isGeneratorFunction(d)?$:$.next().then(function(se){return se.done?se.value:$.next()})};function T(p,d,b){var M=N;return function($,se){if(M===ae)throw new Error("Generator is already running");if(M===ne){if($==="throw")throw se;return de()}for(b.method=$,b.arg=se;;){var ie=b.delegate;if(ie){var oe=J(ie,b);if(oe){if(oe===X)continue;return oe}}if(b.method==="next")b.sent=b._sent=b.arg;else if(b.method==="throw"){if(M===N)throw M=ne,b.arg;b.dispatchException(b.arg)}else b.method==="return"&&b.abrupt("return",b.arg);M=ae;var te=l(p,d,b);if(te.type==="normal"){if(M=b.done?ne:ee,te.arg===X)continue;return{value:te.arg,done:b.done}}else te.type==="throw"&&(M=ne,b.method="throw",b.arg=te.arg)}}}function J(p,d){var b=p.iterator[d.method];if(b===E){if(d.delegate=null,d.method==="throw"){if(p.iterator.return&&(d.method="return",d.arg=E,J(p,d),d.method==="throw"))return X;d.method="throw",d.arg=new TypeError("The iterator does not provide a 'throw' method")}return X}var M=l(b,p.iterator,d.arg);if(M.type==="throw")return d.method="throw",d.arg=M.arg,d.delegate=null,X;var O=M.arg;if(!O)return d.method="throw",d.arg=new TypeError("iterator result is not an object"),d.delegate=null,X;if(O.done)d[p.resultName]=O.value,d.next=p.nextLoc,d.method!=="return"&&(d.method="next",d.arg=E);else return O;return d.delegate=null,X}P(m),x(m,U,"Generator"),x(m,B,function(){return this}),x(m,"toString",function(){return"[object Generator]"});function K(p){var d={tryLoc:p[0]};1 in p&&(d.catchLoc=p[1]),2 in p&&(d.finallyLoc=p[2],d.afterLoc=p[3]),this.tryEntries.push(d)}function W(p){var d=p.completion||{};d.type="normal",delete d.arg,p.completion=d}function q(p){this.tryEntries=[{tryLoc:"root"}],p.forEach(K,this),this.reset(!0)}S.keys=function(p){var d=[];for(var b in p)d.push(b);return d.reverse(),function M(){for(;d.length;){var O=d.pop();if(O in p)return M.value=O,M.done=!1,M}return M.done=!0,M}};function ve(p){if(p){var d=p[B];if(d)return d.call(p);if(typeof p.next=="function")return p;if(!isNaN(p.length)){var b=-1,M=function O(){for(;++b<p.length;)if(D.call(p,b))return O.value=p[b],O.done=!1,O;return O.value=E,O.done=!0,O};return M.next=M}}return{next:de}}S.values=ve;function de(){return{value:E,done:!0}}return q.prototype={constructor:q,reset:function(p){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),!p)for(var d in this)d.charAt(0)==="t"&&D.call(this,d)&&!isNaN(+d.slice(1))&&(this[d]=E)},stop:function(){this.done=!0;var p=this.tryEntries[0],d=p.completion;if(d.type==="throw")throw d.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var d=this;function b(oe,te){return $.type="throw",$.arg=p,d.next=oe,te&&(d.method="next",d.arg=E),!!te}for(var M=this.tryEntries.length-1;M>=0;--M){var O=this.tryEntries[M],$=O.completion;if(O.tryLoc==="root")return b("end");if(O.tryLoc<=this.prev){var se=D.call(O,"catchLoc"),ie=D.call(O,"finallyLoc");if(se&&ie){if(this.prev<O.catchLoc)return b(O.catchLoc,!0);if(this.prev<O.finallyLoc)return b(O.finallyLoc)}else if(se){if(this.prev<O.catchLoc)return b(O.catchLoc,!0)}else if(ie){if(this.prev<O.finallyLoc)return b(O.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(p,d){for(var b=this.tryEntries.length-1;b>=0;--b){var M=this.tryEntries[b];if(M.tryLoc<=this.prev&&D.call(M,"finallyLoc")&&this.prev<M.finallyLoc){var O=M;break}}O&&(p==="break"||p==="continue")&&O.tryLoc<=d&&d<=O.finallyLoc&&(O=null);var $=O?O.completion:{};return $.type=p,$.arg=d,O?(this.method="next",this.next=O.finallyLoc,X):this.complete($)},complete:function(p,d){if(p.type==="throw")throw p.arg;return p.type==="break"||p.type==="continue"?this.next=p.arg:p.type==="return"?(this.rval=this.arg=p.arg,this.method="return",this.next="end"):p.type==="normal"&&d&&(this.next=d),X},finish:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var b=this.tryEntries[d];if(b.finallyLoc===p)return this.complete(b.completion,b.afterLoc),W(b),X}},catch:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var b=this.tryEntries[d];if(b.tryLoc===p){var M=b.completion;if(M.type==="throw"){var O=M.arg;W(b)}return O}}throw new Error("illegal catch attempt")},delegateYield:function(p,d,b){return this.delegate={iterator:ve(p),resultName:d,nextLoc:b},this.method==="next"&&(this.arg=E),X}},S}(j.exports);try{regeneratorRuntime=A}catch(S){typeof globalThis=="object"?globalThis.regeneratorRuntime=A:Function("r","regeneratorRuntime = r")(A)}},182:function(j,A,S){"use strict";S.d(A,{Z:function(){return G}});function G(D){if(D.geometry&&D.geometry.dispose(),D.material){var E=Array.isArray(D.material)?D.material:[D.material];E.forEach(function(g){var B,H,U,x,k,l,N,ee,ae,ne,X,Q,Y;(B=g.map)===null||B===void 0||B.dispose(),(H=g.lightMap)===null||H===void 0||H.dispose(),(U=g.bumpMap)===null||U===void 0||U.dispose(),(x=g.normalMap)===null||x===void 0||x.dispose(),(k=g.specularMap)===null||k===void 0||k.dispose(),(l=g.envMap)===null||l===void 0||l.dispose(),(N=g.alphaMap)===null||N===void 0||N.dispose(),(ee=g.aoMap)===null||ee===void 0||ee.dispose(),(ae=g.displacementMap)===null||ae===void 0||ae.dispose(),(ne=g.emissiveMap)===null||ne===void 0||ne.dispose(),(X=g.gradientMap)===null||X===void 0||X.dispose(),(Q=g.metalnessMap)===null||Q===void 0||Q.dispose(),(Y=g.roughnessMap)===null||Y===void 0||Y.dispose(),g.dispose()})}}},54:function(j,A,S){"use strict";S.d(A,{disposeMesh:function(){return g.Z},isPlainObject:function(){return U.Z}});var G=S(666),D=S.n(G),E=null,g=S(182),B=S(644);function H(Q){if(Q.material){var Y=Array.isArray(Q.material)?Q.material:[Q.material];Y.forEach(function(R){var f,c;(f=R.color)===null||f===void 0||f.convertSRGBToLinear(),(c=R.emissive)===null||c===void 0||c.convertSRGBToLinear(),R.map&&(R.map.encoding=THREE.sRGBEncoding),R.emissiveMap&&(R.emissiveMap.encoding=THREE.sRGBEncoding)})}}var U=S(975),x=S(568),k=S(924),l=require("idb-keyval"),N=S(620),ee=null,ae=null,ne=function(){var Q=(0,x.Z)(D().mark(function Y(R,f){var c,v,m,P,L,T;return D().wrap(function(K){for(;;)switch(K.prev=K.next){case 0:return c=f.version,K.next=4,(0,l.get)(R);case 4:if(m=K.sent,!(m&&m[c])){K.next=9;break}v=m[c],K.next=15;break;case 9:return K.next=11,(0,N.Z)(fetch(R).then(function(W){if(W.ok)return W.blob();throw new Error}));case 11:P=K.sent,L=P.res,T=P.err,T||(v=L,(0,l.set)(R,(0,k.Z)({},c,L)));case 15:return K.abrupt("return",v?{url:URL.createObjectURL(v)}:{url:R});case 16:case"end":return K.stop()}},Y)}));return function(R,f){return Q.apply(this,arguments)}}(),X=S(977)},975:function(j,A,S){"use strict";S.d(A,{Z:function(){return D}});function G(E){return Object.prototype.toString.call(E)==="[object Object]"}function D(E){if(G(E)===!1)return!1;var g=E.constructor;if(g===void 0)return!0;var B=g.prototype;return!(G(B)===!1||B.hasOwnProperty("isPrototypeOf")===!1)}},620:function(j,A,S){"use strict";S.d(A,{Z:function(){return D}});var G=S(42);function D(E){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return E.then(function(B){return(0,G.Z)({err:null,res:B},g)}).catch(function(B){return(0,G.Z)({err:B,res:void 0},g)})}},977:function(j,A,S){"use strict";var G=S(644),D=S.n(G),E=new Map,g=function(H){return{generateTopUV:function(U,x,k,l,N){var ee=x[k*3],ae=x[k*3+1],ne=x[l*3],X=x[l*3+1],Q=x[N*3],Y=x[N*3+1],R;if(E.has(U))R=E.get(U);else{var f=H&&H.Box3||new THREE.Box3;if(!H||!H.Box3){var c=U.parameters.shapes.getPoints();f.setFromArray(c.map(function(L){return[L.x,L.y,0]}).flat())}var v=f.getSize(new THREE.Vector3);R={box:f,size:v},E.set(U,R)}var m=R.box,P=R.size;return[new THREE.Vector2((ee-m.min.x)/P.x,(ae-m.min.y)/P.y),new THREE.Vector2((ne-m.min.x)/P.x,(X-m.min.y)/P.y),new THREE.Vector2((Q-m.min.x)/P.x,(Y-m.min.y)/P.y)]},generateSideWallUV:function(U,x,k,l,N,ee){var ae=x[k*3],ne=x[k*3+1],X=x[k*3+2],Q=x[l*3],Y=x[l*3+1],R=x[l*3+2],f=x[N*3],c=x[N*3+1],v=x[N*3+2],m=x[ee*3],P=x[ee*3+1],L=x[ee*3+2],T;if(E.has(x))T=E.get(x);else{var J=new THREE.Box3;J.setFromArray(x);var K=J.getSize(new THREE.Vector3);T={box:J,size:K},E.set(x,T)}var W=T.box,q=T.size;return Math.abs(ne-Y)<.01?[new THREE.Vector2((ae-W.min.x)/q.x,(X-W.min.z)/q.z),new THREE.Vector2((Q-W.min.x)/q.x,(R-W.min.z)/q.z),new THREE.Vector2((f-W.min.x)/q.x,(v-W.min.z)/q.z),new THREE.Vector2((m-W.min.x)/q.x,(L-W.min.z)/q.z)]:[new THREE.Vector2((ne-W.min.y)/q.x,(X-W.min.z)/q.z),new THREE.Vector2((Y-W.min.y)/q.x,(R-W.min.z)/q.z),new THREE.Vector2((c-W.min.y)/q.x,(v-W.min.z)/q.z),new THREE.Vector2((P-W.min.y)/q.x,(L-W.min.z)/q.z)]}}},B=function(){E.clear()}},644:function(j){"use strict";j.exports=require("three")},568:function(j,A,S){"use strict";S.d(A,{Z:function(){return D}});function G(E,g,B,H,U,x,k){try{var l=E[x](k),N=l.value}catch(ee){B(ee);return}l.done?g(N):Promise.resolve(N).then(H,U)}function D(E){return function(){var g=this,B=arguments;return new Promise(function(H,U){var x=E.apply(g,B);function k(N){G(x,H,U,k,l,"next",N)}function l(N){G(x,H,U,k,l,"throw",N)}k(void 0)})}}},924:function(j,A,S){"use strict";S.d(A,{Z:function(){return G}});function G(D,E,g){return E in D?Object.defineProperty(D,E,{value:g,enumerable:!0,configurable:!0,writable:!0}):D[E]=g,D}},42:function(j,A,S){"use strict";S.d(A,{Z:function(){return D}});var G=S(924);function D(E){for(var g=1;g<arguments.length;g++){var B=arguments[g]!=null?arguments[g]:{},H=Object.keys(B);typeof Object.getOwnPropertySymbols=="function"&&(H=H.concat(Object.getOwnPropertySymbols(B).filter(function(U){return Object.getOwnPropertyDescriptor(B,U).enumerable}))),H.forEach(function(U){(0,G.Z)(E,U,B[U])})}return E}}},Oe={};function re(j){var A=Oe[j];if(A!==void 0)return A.exports;var S=Oe[j]={exports:{}};return Be[j](S,S.exports,re),S.exports}(function(){re.n=function(j){var A=j&&j.__esModule?function(){return j.default}:function(){return j};return re.d(A,{a:A}),A}})(),function(){re.d=function(j,A){for(var S in A)re.o(A,S)&&!re.o(j,S)&&Object.defineProperty(j,S,{enumerable:!0,get:A[S]})}}(),function(){re.o=function(j,A){return Object.prototype.hasOwnProperty.call(j,A)}}(),function(){re.r=function(j){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(j,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(j,"__esModule",{value:!0})}}();var Pe={};(function(){"use strict";re.r(Pe),re.d(Pe,{BaseObject:function(){return pt},GUIObject:function(){return R},Pencil:function(){return xe},default:function(){return xe}});function j(s,i){if(!(s instanceof i))throw new TypeError("Cannot call a class as a function")}function A(s,i){for(var n=0;n<i.length;n++){var e=i[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(s,e.key,e)}}function S(s,i,n){return i&&A(s.prototype,i),n&&A(s,n),s}var G=re(42);function D(s,i){var n=Object.keys(s);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(s);i&&(e=e.filter(function(t){return Object.getOwnPropertyDescriptor(s,t).enumerable})),n.push.apply(n,e)}return n}function E(s,i){return i=i!=null?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(i)):D(Object(i)).forEach(function(n){Object.defineProperty(s,n,Object.getOwnPropertyDescriptor(i,n))}),s}function g(s,i){(i==null||i>s.length)&&(i=s.length);for(var n=0,e=new Array(i);n<i;n++)e[n]=s[n];return e}function B(s){if(Array.isArray(s))return g(s)}function H(s){if(typeof Symbol!="undefined"&&s[Symbol.iterator]!=null||s["@@iterator"]!=null)return Array.from(s)}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 x(s,i){if(!!s){if(typeof s=="string")return g(s,i);var n=Object.prototype.toString.call(s).slice(8,-1);if(n==="Object"&&s.constructor&&(n=s.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return g(s,i)}}function k(s){return B(s)||H(s)||x(s)||U()}var l=re(644),N=re(187),ee=require("deepmerge"),ae=re.n(ee),ne=require("three/examples/jsm/libs/stats.module"),X=re.n(ne),Q=require("lil-gui"),Y=re.n(Q),R=function(){"use strict";function s(n){j(this,s),this.guiParams={},n&&(this.guiParams=n)}var i=s.prototype;return i.showGui=function(e){var t=this;!e||Object.keys(this.guiParams).forEach(function(r){var o=e.addFolder(r),u=t.guiParams[r];Object.keys(u).forEach(function(a){var h=u[a],C=h.min,_=h.max,y=h.step,w=h.name,z=h.paramMap,V=h.items,F=h.value,Z=h.target,le=a.toLowerCase().indexOf("color")>-1,I,ue=typeof F=="undefined"&&Z,ce=ue?Z():u[a],fe=ue?a:"value";V?I=o.add(ce,fe,V):le?I=o.addColor(ce,fe):I=o.add(ce,fe),I=I.name(w||a),typeof C!="undefined"&&(I=I.min(C)),typeof _!="undefined"&&(I=I.max(_)),typeof y!="undefined"&&(I=I.step(y)),I=I.onChange(function(){t.setTargetValue(r,a,ce[fe],z)}),ue&&I.listen()})})},i.setTargetValue=function(e,t,r,o){var u=this.guiParams[e][t],a=u.onChange,h=u.target,C=u.value,_=t.toLowerCase().indexOf("color")>-1,y=typeof C=="undefined"&&h;if(h&&!y){var w=h();Array.isArray(w)||(w=[w]),w.forEach(function(z){if(!!z)if(_)try{z[o||t].set(r)}catch(V){t!=="color"&&!o&&console.warn("".concat(t," is not a color,set paramMap"))}else z[o||t]=r})}a&&a(r)},i.setTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(t){Object.keys(e.guiParams[t]).forEach(function(r){var o=e.guiParams[t][r];typeof o.value!="undefined"&&e.setTargetValue(t,r,o.value,o.paramMap)})})},s}(),f={None:l.NoToneMapping,Linear:l.LinearToneMapping,Reinhard:l.ReinhardToneMapping,Cineon:l.CineonToneMapping,ACESFilmic:l.ACESFilmicToneMapping},c={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:l.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1,context:null},v=function(){"use strict";function s(n){j(this,s),this.options=n;var e=n.width,t=n.height,r=n.rendererParams,o=r.context,u=r.alpha,a=r.devicePixelRatio,h=r.antialias,C=r.powerPreference,_=r.toneMapping,y=r.toneMappingExposure,w=r.outputEncoding,z=r.logarithmicDepthBuffer,V=r.preserveDrawingBuffer,F=new l.WebGLRenderer({context:o,alpha:u,antialias:h,powerPreference:C,logarithmicDepthBuffer:z,preserveDrawingBuffer:V});F.setSize(e,t),F.setPixelRatio(a),F.autoClear=!1,F.toneMapping=f[_],F.toneMappingExposure=y,F.outputEncoding=w,this.renderer=F}var i=s.prototype;return i.setSize=function(e,t){this.renderer.setSize(e,t)},i.render=function(){var e=this.options,t=e.scene,r=e.camera;this.renderer.render(t,r)},i.setGui=function(e){var t=this,r=new R({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:f,target:function(){return t.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return t.renderer}}}});r.showGui(e)},i.dispose=function(){var e,t,r;(e=this.renderer)===null||e===void 0||e.clear(),(t=this.renderer)===null||t===void 0||t.dispose(),(r=this.renderer)===null||r===void 0||r.renderLists.dispose()},s}(),m={fov:45,near:1,far:1e3},P=function(){"use strict";function s(n){j(this,s),this.oldCameraPosition=new l.Vector3,this.oldCameraRotation=new l.Euler,this.customCamera=!1,this.options=n;var e=n.width,t=n.height,r=n.cameraParams;if(r instanceof l.Camera)this.camera=r,this.customCamera=!0;else{var o=r.fov,u=r.far,a=r.near,h=new l.PerspectiveCamera(o,e/t,a,u);h.position.set(0,0,400),h.lookAt(0,0,0),this.camera=h}}var i=s.prototype;return i.checkCameraChange=function(){var e=this.camera,t=this.oldCameraPosition.equals(e.position)&&this.oldCameraRotation.equals(e.rotation);return this.oldCameraPosition=e.position.clone(),this.oldCameraRotation=e.rotation.clone(),!t},i.setSize=function(e,t){this.camera instanceof l.PerspectiveCamera&&(this.camera.aspect=e/t),this.camera.updateProjectionMatrix()},i.setGui=function(e){var t=this,r=new R({camera:{x:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},y:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},z:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},near:{min:0,max:1e3,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}}}});this.camera instanceof l.PerspectiveCamera&&(r.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}}),r.showGui(e)},s}(),L=re(54),T={background:null},J=function(){"use strict";function s(n){j(this,s),this.options=n;var e=n.camera,t=n.sceneParams,r=t.background,o=new l.Scene;r&&(o.background=r),o.add(e),this.scene=o}var i=s.prototype;return i.addAxesHelper=function(){var e,t=new l.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(t)},i.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(t){(0,L.disposeMesh)(t)})},s}(),K=require("three/examples/jsm/controls/OrbitControls"),W={},q=function(){"use strict";function s(n){j(this,s),this.options=n;var e=n.camera,t=n.controlParams,r=n.mapControl,o=t.domElement,u=r?new K.MapControls(e,o):new K.OrbitControls(e,o);u.minPolarAngle=Math.PI*.15,u.maxPolarAngle=Math.PI*.85,u.enableDamping=!0,u.dampingFactor=.063,u.autoRotate=!1,u.autoRotateSpeed=-60,u.enableZoom=!0,u.zoomSpeed=.2,this.control=u}var i=s.prototype;return i.limitPan=function(e){var t=e.maxX,r=t===void 0?1/0:t,o=e.minX,u=o===void 0?-1/0:o,a=e.maxZ,h=a===void 0?1/0:a,C=e.minZ,_=C===void 0?-1/0:C,y=e.maxY,w=y===void 0?1/0:y,z=e.minY,V=z===void 0?-1/0:z,F=this.limitPanV||new l.Vector3,Z=this.control,le=this.options.camera,I=new l.Vector3(u,V,_),ue=new l.Vector3(r,w,h);this.limitPanV=F,F.copy(Z.target),Z.target.clamp(I,ue),F.sub(Z.target),le.position.sub(F)},i.update=function(){this.control.update()},i.dispose=function(){this.control.dispose()},s}(),ve=require("three/examples/jsm/renderers/CSS3DRenderer"),de=new l.Vector3,p=new l.Matrix4,d=new l.Matrix4,b=new l.Vector3,M=new l.Vector3,O=function s(){"use strict";var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};j(this,s);var n=function(z,V){return b.setFromMatrixPosition(z.matrixWorld),M.setFromMatrixPosition(V.matrixWorld),b.distanceToSquared(M)},e=function(z){var V=[];return z.traverse(function(F){F.isCSS2DObject&&V.push(F)}),V},t=function(z){for(var V=e(z).sort(function(ue,ce){if(ue.renderOrder!==ce.renderOrder)return ce.renderOrder-ue.renderOrder;var fe=C.objects.get(ue).distanceToCameraSquared,ye=C.objects.get(ce).distanceToCameraSquared;return fe-ye}),F=V.length,Z=0,le=V.length;Z<le;Z++){var I=V[Z].userData.zIndexFix||0;V[Z].element.style.zIndex=F-Z+I}},r=this,o,u,a,h,C={objects:new WeakMap},_=i.element!==void 0?i.element:document.createElement("div");_.style.overflow="hidden",this.domElement=_,this.getSize=function(){return{width:o,height:u}},this.render=function(w,z){w.autoUpdate===!0&&w.updateMatrixWorld(),z.parent===null&&z.updateMatrixWorld(),p.copy(z.matrixWorldInverse),d.multiplyMatrices(z.projectionMatrix,p),y(w,w,z),t(w)},this.setSize=function(w,z){o=w,u=z,a=o/2,h=u/2,_.style.width="".concat(w,"px"),_.style.height="".concat(z,"px")};function y(w,z,V){if(w.isCSS2DObject){de.setFromMatrixPosition(w.matrixWorld),de.applyMatrix4(d);var F=w.visible===!0&&de.z>=-1&&de.z<=1&&w.layers.test(V.layers)===!0;if(w.element.style.display=F===!0?"":"none",F===!0){w.onBeforeRender(r,z,V);var Z=w.element;Z.style.transform="translate(-50%,-50%) translate(".concat(de.x*a+a,"px,").concat(-de.y*h+h,"px)"),Z.parentNode!==_&&_.appendChild(Z),w.onAfterRender(r,z,V)}var le={distanceToCameraSquared:n(V,w)};C.objects.set(w,le)}for(var I=0,ue=w.children.length;I<ue;I++)y(w.children[I],z,V)}},$={zIndex:"auto"},se=function(){"use strict";function s(n){j(this,s),this.container=n}var i=s.prototype;return i.addRenderer=function(e,t){var r=this.container,o=r.offsetWidth,u=r.offsetHeight,a=e==="css2d"?new O:new ve.CSS3DRenderer;a.domElement.style.position="absolute",a.domElement.style.top="0",a.domElement.style.pointerEvents="none",a.domElement.style.zIndex=t.zIndex,a.setSize(o,u),r.appendChild(a.domElement),e==="css2d"?this.css2Drenderer=a:e==="css3d"&&(this.css3Drenderer=a)},i.setSize=function(e,t){var r,o;(r=this.css2Drenderer)===null||r===void 0||r.setSize(e,t),(o=this.css3Drenderer)===null||o===void 0||o.setSize(e,t)},i.render=function(e,t){var r,o;(r=this.css2Drenderer)===null||r===void 0||r.render(e,t),(o=this.css3Drenderer)===null||o===void 0||o.render(e,t)},i.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},s}(),ie=require("three/examples/jsm/postprocessing/EffectComposer"),oe=require("three/examples/jsm/postprocessing/RenderPass"),te=require("three/examples/jsm/postprocessing/ShaderPass"),pe=require("three/examples/jsm/shaders/CopyShader"),me=require("three/examples/jsm/shaders/GammaCorrectionShader"),he=require("three/examples/jsm/postprocessing/SMAAPass"),Ve=require("three/examples/jsm/postprocessing/SSAARenderPass"),Fe=require("three/examples/jsm/shaders/FXAAShader"),Ue=function(){try{var s=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&s.getContext("webgl2"))}catch(i){return!1}},bt=0,ke=1,ge=!1,Re=Ue()!==!1,Ie=`varying vec2 vUv;
1
+ (function(){var Be={187:function(j){"use strict";var A=typeof Reflect=="object"?Reflect:null,S=A&&typeof A.apply=="function"?A.apply:function(c,v,m){return Function.prototype.apply.call(c,v,m)},G;A&&typeof A.ownKeys=="function"?G=A.ownKeys:Object.getOwnPropertySymbols?G=function(c){return Object.getOwnPropertyNames(c).concat(Object.getOwnPropertySymbols(c))}:G=function(c){return Object.getOwnPropertyNames(c)};function D(f){console&&console.warn&&console.warn(f)}var E=Number.isNaN||function(c){return c!==c};function g(){g.init.call(this)}j.exports=g,j.exports.once=Q,g.EventEmitter=g,g.prototype._events=void 0,g.prototype._eventsCount=0,g.prototype._maxListeners=void 0;var B=10;function H(f){if(typeof f!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof f)}Object.defineProperty(g,"defaultMaxListeners",{enumerable:!0,get:function(){return B},set:function(f){if(typeof f!="number"||f<0||E(f))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+f+".");B=f}}),g.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},g.prototype.setMaxListeners=function(c){if(typeof c!="number"||c<0||E(c))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+c+".");return this._maxListeners=c,this};function U(f){return f._maxListeners===void 0?g.defaultMaxListeners:f._maxListeners}g.prototype.getMaxListeners=function(){return U(this)},g.prototype.emit=function(c){for(var v=[],m=1;m<arguments.length;m++)v.push(arguments[m]);var P=c==="error",L=this._events;if(L!==void 0)P=P&&L.error===void 0;else if(!P)return!1;if(P){var T;if(v.length>0&&(T=v[0]),T instanceof Error)throw T;var J=new Error("Unhandled error."+(T?" ("+T.message+")":""));throw J.context=T,J}var K=L[c];if(K===void 0)return!1;if(typeof K=="function")S(K,this,v);else for(var W=K.length,q=ae(K,W),m=0;m<W;++m)S(q[m],this,v);return!0};function x(f,c,v,m){var P,L,T;if(H(v),L=f._events,L===void 0?(L=f._events=Object.create(null),f._eventsCount=0):(L.newListener!==void 0&&(f.emit("newListener",c,v.listener?v.listener:v),L=f._events),T=L[c]),T===void 0)T=L[c]=v,++f._eventsCount;else if(typeof T=="function"?T=L[c]=m?[v,T]:[T,v]:m?T.unshift(v):T.push(v),P=U(f),P>0&&T.length>P&&!T.warned){T.warned=!0;var J=new Error("Possible EventEmitter memory leak detected. "+T.length+" "+String(c)+" listeners added. Use emitter.setMaxListeners() to increase limit");J.name="MaxListenersExceededWarning",J.emitter=f,J.type=c,J.count=T.length,D(J)}return f}g.prototype.addListener=function(c,v){return x(this,c,v,!1)},g.prototype.on=g.prototype.addListener,g.prototype.prependListener=function(c,v){return x(this,c,v,!0)};function k(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(f,c,v){var m={fired:!1,wrapFn:void 0,target:f,type:c,listener:v},P=k.bind(m);return P.listener=v,m.wrapFn=P,P}g.prototype.once=function(c,v){return H(v),this.on(c,l(this,c,v)),this},g.prototype.prependOnceListener=function(c,v){return H(v),this.prependListener(c,l(this,c,v)),this},g.prototype.removeListener=function(c,v){var m,P,L,T,J;if(H(v),P=this._events,P===void 0)return this;if(m=P[c],m===void 0)return this;if(m===v||m.listener===v)--this._eventsCount===0?this._events=Object.create(null):(delete P[c],P.removeListener&&this.emit("removeListener",c,m.listener||v));else if(typeof m!="function"){for(L=-1,T=m.length-1;T>=0;T--)if(m[T]===v||m[T].listener===v){J=m[T].listener,L=T;break}if(L<0)return this;L===0?m.shift():ne(m,L),m.length===1&&(P[c]=m[0]),P.removeListener!==void 0&&this.emit("removeListener",c,J||v)}return this},g.prototype.off=g.prototype.removeListener,g.prototype.removeAllListeners=function(c){var v,m,P;if(m=this._events,m===void 0)return this;if(m.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):m[c]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete m[c]),this;if(arguments.length===0){var L=Object.keys(m),T;for(P=0;P<L.length;++P)T=L[P],T!=="removeListener"&&this.removeAllListeners(T);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(v=m[c],typeof v=="function")this.removeListener(c,v);else if(v!==void 0)for(P=v.length-1;P>=0;P--)this.removeListener(c,v[P]);return this};function N(f,c,v){var m=f._events;if(m===void 0)return[];var P=m[c];return P===void 0?[]:typeof P=="function"?v?[P.listener||P]:[P]:v?X(P):ae(P,P.length)}g.prototype.listeners=function(c){return N(this,c,!0)},g.prototype.rawListeners=function(c){return N(this,c,!1)},g.listenerCount=function(f,c){return typeof f.listenerCount=="function"?f.listenerCount(c):ee.call(f,c)},g.prototype.listenerCount=ee;function ee(f){var c=this._events;if(c!==void 0){var v=c[f];if(typeof v=="function")return 1;if(v!==void 0)return v.length}return 0}g.prototype.eventNames=function(){return this._eventsCount>0?G(this._events):[]};function ae(f,c){for(var v=new Array(c),m=0;m<c;++m)v[m]=f[m];return v}function ne(f,c){for(;c+1<f.length;c++)f[c]=f[c+1];f.pop()}function X(f){for(var c=new Array(f.length),v=0;v<c.length;++v)c[v]=f[v].listener||f[v];return c}function Q(f,c){return new Promise(function(v,m){function P(T){f.removeListener(c,L),m(T)}function L(){typeof f.removeListener=="function"&&f.removeListener("error",P),v([].slice.call(arguments))}R(f,c,L,{once:!0}),c!=="error"&&Y(f,P,{once:!0})})}function Y(f,c,v){typeof f.on=="function"&&R(f,"error",c,v)}function R(f,c,v,m){if(typeof f.on=="function")m.once?f.once(c,v):f.on(c,v);else if(typeof f.addEventListener=="function")f.addEventListener(c,function P(L){m.once&&f.removeEventListener(c,P),v(L)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof f)}},666:function(j){var A=function(S){"use strict";var G=Object.prototype,D=G.hasOwnProperty,E,g=typeof Symbol=="function"?Symbol:{},B=g.iterator||"@@iterator",H=g.asyncIterator||"@@asyncIterator",U=g.toStringTag||"@@toStringTag";function x(p,d,b){return Object.defineProperty(p,d,{value:b,enumerable:!0,configurable:!0,writable:!0}),p[d]}try{x({},"")}catch(p){x=function(d,b,M){return d[b]=M}}function k(p,d,b,M){var O=d&&d.prototype instanceof Q?d:Q,$=Object.create(O.prototype),se=new q(M||[]);return $._invoke=T(p,b,se),$}S.wrap=k;function l(p,d,b){try{return{type:"normal",arg:p.call(d,b)}}catch(M){return{type:"throw",arg:M}}}var N="suspendedStart",ee="suspendedYield",ae="executing",ne="completed",X={};function Q(){}function Y(){}function R(){}var f={};x(f,B,function(){return this});var c=Object.getPrototypeOf,v=c&&c(c(ve([])));v&&v!==G&&D.call(v,B)&&(f=v);var m=R.prototype=Q.prototype=Object.create(f);Y.prototype=R,x(m,"constructor",R),x(R,"constructor",Y),Y.displayName=x(R,U,"GeneratorFunction");function P(p){["next","throw","return"].forEach(function(d){x(p,d,function(b){return this._invoke(d,b)})})}S.isGeneratorFunction=function(p){var d=typeof p=="function"&&p.constructor;return d?d===Y||(d.displayName||d.name)==="GeneratorFunction":!1},S.mark=function(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,R):(p.__proto__=R,x(p,U,"GeneratorFunction")),p.prototype=Object.create(m),p},S.awrap=function(p){return{__await:p}};function L(p,d){function b($,se,ie,oe){var te=l(p[$],p,se);if(te.type==="throw")oe(te.arg);else{var pe=te.arg,me=pe.value;return me&&typeof me=="object"&&D.call(me,"__await")?d.resolve(me.__await).then(function(he){b("next",he,ie,oe)},function(he){b("throw",he,ie,oe)}):d.resolve(me).then(function(he){pe.value=he,ie(pe)},function(he){return b("throw",he,ie,oe)})}}var M;function O($,se){function ie(){return new d(function(oe,te){b($,se,oe,te)})}return M=M?M.then(ie,ie):ie()}this._invoke=O}P(L.prototype),x(L.prototype,H,function(){return this}),S.AsyncIterator=L,S.async=function(p,d,b,M,O){O===void 0&&(O=Promise);var $=new L(k(p,d,b,M),O);return S.isGeneratorFunction(d)?$:$.next().then(function(se){return se.done?se.value:$.next()})};function T(p,d,b){var M=N;return function($,se){if(M===ae)throw new Error("Generator is already running");if(M===ne){if($==="throw")throw se;return de()}for(b.method=$,b.arg=se;;){var ie=b.delegate;if(ie){var oe=J(ie,b);if(oe){if(oe===X)continue;return oe}}if(b.method==="next")b.sent=b._sent=b.arg;else if(b.method==="throw"){if(M===N)throw M=ne,b.arg;b.dispatchException(b.arg)}else b.method==="return"&&b.abrupt("return",b.arg);M=ae;var te=l(p,d,b);if(te.type==="normal"){if(M=b.done?ne:ee,te.arg===X)continue;return{value:te.arg,done:b.done}}else te.type==="throw"&&(M=ne,b.method="throw",b.arg=te.arg)}}}function J(p,d){var b=p.iterator[d.method];if(b===E){if(d.delegate=null,d.method==="throw"){if(p.iterator.return&&(d.method="return",d.arg=E,J(p,d),d.method==="throw"))return X;d.method="throw",d.arg=new TypeError("The iterator does not provide a 'throw' method")}return X}var M=l(b,p.iterator,d.arg);if(M.type==="throw")return d.method="throw",d.arg=M.arg,d.delegate=null,X;var O=M.arg;if(!O)return d.method="throw",d.arg=new TypeError("iterator result is not an object"),d.delegate=null,X;if(O.done)d[p.resultName]=O.value,d.next=p.nextLoc,d.method!=="return"&&(d.method="next",d.arg=E);else return O;return d.delegate=null,X}P(m),x(m,U,"Generator"),x(m,B,function(){return this}),x(m,"toString",function(){return"[object Generator]"});function K(p){var d={tryLoc:p[0]};1 in p&&(d.catchLoc=p[1]),2 in p&&(d.finallyLoc=p[2],d.afterLoc=p[3]),this.tryEntries.push(d)}function W(p){var d=p.completion||{};d.type="normal",delete d.arg,p.completion=d}function q(p){this.tryEntries=[{tryLoc:"root"}],p.forEach(K,this),this.reset(!0)}S.keys=function(p){var d=[];for(var b in p)d.push(b);return d.reverse(),function M(){for(;d.length;){var O=d.pop();if(O in p)return M.value=O,M.done=!1,M}return M.done=!0,M}};function ve(p){if(p){var d=p[B];if(d)return d.call(p);if(typeof p.next=="function")return p;if(!isNaN(p.length)){var b=-1,M=function O(){for(;++b<p.length;)if(D.call(p,b))return O.value=p[b],O.done=!1,O;return O.value=E,O.done=!0,O};return M.next=M}}return{next:de}}S.values=ve;function de(){return{value:E,done:!0}}return q.prototype={constructor:q,reset:function(p){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),!p)for(var d in this)d.charAt(0)==="t"&&D.call(this,d)&&!isNaN(+d.slice(1))&&(this[d]=E)},stop:function(){this.done=!0;var p=this.tryEntries[0],d=p.completion;if(d.type==="throw")throw d.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var d=this;function b(oe,te){return $.type="throw",$.arg=p,d.next=oe,te&&(d.method="next",d.arg=E),!!te}for(var M=this.tryEntries.length-1;M>=0;--M){var O=this.tryEntries[M],$=O.completion;if(O.tryLoc==="root")return b("end");if(O.tryLoc<=this.prev){var se=D.call(O,"catchLoc"),ie=D.call(O,"finallyLoc");if(se&&ie){if(this.prev<O.catchLoc)return b(O.catchLoc,!0);if(this.prev<O.finallyLoc)return b(O.finallyLoc)}else if(se){if(this.prev<O.catchLoc)return b(O.catchLoc,!0)}else if(ie){if(this.prev<O.finallyLoc)return b(O.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(p,d){for(var b=this.tryEntries.length-1;b>=0;--b){var M=this.tryEntries[b];if(M.tryLoc<=this.prev&&D.call(M,"finallyLoc")&&this.prev<M.finallyLoc){var O=M;break}}O&&(p==="break"||p==="continue")&&O.tryLoc<=d&&d<=O.finallyLoc&&(O=null);var $=O?O.completion:{};return $.type=p,$.arg=d,O?(this.method="next",this.next=O.finallyLoc,X):this.complete($)},complete:function(p,d){if(p.type==="throw")throw p.arg;return p.type==="break"||p.type==="continue"?this.next=p.arg:p.type==="return"?(this.rval=this.arg=p.arg,this.method="return",this.next="end"):p.type==="normal"&&d&&(this.next=d),X},finish:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var b=this.tryEntries[d];if(b.finallyLoc===p)return this.complete(b.completion,b.afterLoc),W(b),X}},catch:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var b=this.tryEntries[d];if(b.tryLoc===p){var M=b.completion;if(M.type==="throw"){var O=M.arg;W(b)}return O}}throw new Error("illegal catch attempt")},delegateYield:function(p,d,b){return this.delegate={iterator:ve(p),resultName:d,nextLoc:b},this.method==="next"&&(this.arg=E),X}},S}(j.exports);try{regeneratorRuntime=A}catch(S){typeof globalThis=="object"?globalThis.regeneratorRuntime=A:Function("r","regeneratorRuntime = r")(A)}},182:function(j,A,S){"use strict";S.d(A,{Z:function(){return G}});function G(D){if(D.geometry&&D.geometry.dispose(),D.material){var E=Array.isArray(D.material)?D.material:[D.material];E.forEach(function(g){var B,H,U,x,k,l,N,ee,ae,ne,X,Q,Y;(B=g.map)===null||B===void 0||B.dispose(),(H=g.lightMap)===null||H===void 0||H.dispose(),(U=g.bumpMap)===null||U===void 0||U.dispose(),(x=g.normalMap)===null||x===void 0||x.dispose(),(k=g.specularMap)===null||k===void 0||k.dispose(),(l=g.envMap)===null||l===void 0||l.dispose(),(N=g.alphaMap)===null||N===void 0||N.dispose(),(ee=g.aoMap)===null||ee===void 0||ee.dispose(),(ae=g.displacementMap)===null||ae===void 0||ae.dispose(),(ne=g.emissiveMap)===null||ne===void 0||ne.dispose(),(X=g.gradientMap)===null||X===void 0||X.dispose(),(Q=g.metalnessMap)===null||Q===void 0||Q.dispose(),(Y=g.roughnessMap)===null||Y===void 0||Y.dispose(),g.dispose()})}}},54:function(j,A,S){"use strict";S.d(A,{disposeMesh:function(){return g.Z},isPlainObject:function(){return U.Z}});var G=S(666),D=S.n(G),E=null,g=S(182),B=S(644);function H(Q){if(Q.material){var Y=Array.isArray(Q.material)?Q.material:[Q.material];Y.forEach(function(R){var f,c;(f=R.color)===null||f===void 0||f.convertSRGBToLinear(),(c=R.emissive)===null||c===void 0||c.convertSRGBToLinear(),R.map&&(R.map.encoding=THREE.sRGBEncoding),R.emissiveMap&&(R.emissiveMap.encoding=THREE.sRGBEncoding)})}}var U=S(975),x=S(568),k=S(924),l=require("idb-keyval"),N=S(620),ee=null,ae=null,ne=function(){var Q=(0,x.Z)(D().mark(function Y(R,f){var c,v,m,P,L,T;return D().wrap(function(K){for(;;)switch(K.prev=K.next){case 0:return c=f.version,K.next=4,(0,l.get)(R);case 4:if(m=K.sent,!(m&&m[c])){K.next=9;break}v=m[c],K.next=15;break;case 9:return K.next=11,(0,N.Z)(fetch(R).then(function(W){if(W.ok)return W.blob();throw new Error}));case 11:P=K.sent,L=P.res,T=P.err,T||(v=L,(0,l.set)(R,(0,k.Z)({},c,L)));case 15:return K.abrupt("return",v?{url:URL.createObjectURL(v)}:{url:R});case 16:case"end":return K.stop()}},Y)}));return function(R,f){return Q.apply(this,arguments)}}(),X=S(977)},975:function(j,A,S){"use strict";S.d(A,{Z:function(){return D}});function G(E){return Object.prototype.toString.call(E)==="[object Object]"}function D(E){if(G(E)===!1)return!1;var g=E.constructor;if(g===void 0)return!0;var B=g.prototype;return!(G(B)===!1||B.hasOwnProperty("isPrototypeOf")===!1)}},620:function(j,A,S){"use strict";S.d(A,{Z:function(){return D}});var G=S(42);function D(E){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return E.then(function(B){return(0,G.Z)({err:null,res:B},g)}).catch(function(B){return(0,G.Z)({err:B,res:void 0},g)})}},977:function(j,A,S){"use strict";var G=S(644),D=S.n(G),E=new Map,g=function(H){return{generateTopUV:function(U,x,k,l,N){var ee=x[k*3],ae=x[k*3+1],ne=x[l*3],X=x[l*3+1],Q=x[N*3],Y=x[N*3+1],R;if(E.has(U))R=E.get(U);else{var f=H&&H.box3||new THREE.Box3;if(!H||!H.box3){var c=U.parameters.shapes.getPoints();f.setFromArray(c.map(function(L){return[L.x,L.y,0]}).flat())}var v=f.getSize(new THREE.Vector3);R={box:f,size:v},E.set(U,R)}var m=R.box,P=R.size;return[new THREE.Vector2((ee-m.min.x)/P.x,(ae-m.min.y)/P.y),new THREE.Vector2((ne-m.min.x)/P.x,(X-m.min.y)/P.y),new THREE.Vector2((Q-m.min.x)/P.x,(Y-m.min.y)/P.y)]},generateSideWallUV:function(U,x,k,l,N,ee){var ae=x[k*3],ne=x[k*3+1],X=x[k*3+2],Q=x[l*3],Y=x[l*3+1],R=x[l*3+2],f=x[N*3],c=x[N*3+1],v=x[N*3+2],m=x[ee*3],P=x[ee*3+1],L=x[ee*3+2],T;if(E.has(x))T=E.get(x);else{var J=new THREE.Box3;J.setFromArray(x);var K=J.getSize(new THREE.Vector3);T={box:J,size:K},E.set(x,T)}var W=T.box,q=T.size;return Math.abs(ne-Y)<.01?[new THREE.Vector2((ae-W.min.x)/q.x,(X-W.min.z)/q.z),new THREE.Vector2((Q-W.min.x)/q.x,(R-W.min.z)/q.z),new THREE.Vector2((f-W.min.x)/q.x,(v-W.min.z)/q.z),new THREE.Vector2((m-W.min.x)/q.x,(L-W.min.z)/q.z)]:[new THREE.Vector2((ne-W.min.y)/q.x,(X-W.min.z)/q.z),new THREE.Vector2((Y-W.min.y)/q.x,(R-W.min.z)/q.z),new THREE.Vector2((c-W.min.y)/q.x,(v-W.min.z)/q.z),new THREE.Vector2((P-W.min.y)/q.x,(L-W.min.z)/q.z)]}}},B=function(){E.clear()}},644:function(j){"use strict";j.exports=require("three")},568:function(j,A,S){"use strict";S.d(A,{Z:function(){return D}});function G(E,g,B,H,U,x,k){try{var l=E[x](k),N=l.value}catch(ee){B(ee);return}l.done?g(N):Promise.resolve(N).then(H,U)}function D(E){return function(){var g=this,B=arguments;return new Promise(function(H,U){var x=E.apply(g,B);function k(N){G(x,H,U,k,l,"next",N)}function l(N){G(x,H,U,k,l,"throw",N)}k(void 0)})}}},924:function(j,A,S){"use strict";S.d(A,{Z:function(){return G}});function G(D,E,g){return E in D?Object.defineProperty(D,E,{value:g,enumerable:!0,configurable:!0,writable:!0}):D[E]=g,D}},42:function(j,A,S){"use strict";S.d(A,{Z:function(){return D}});var G=S(924);function D(E){for(var g=1;g<arguments.length;g++){var B=arguments[g]!=null?arguments[g]:{},H=Object.keys(B);typeof Object.getOwnPropertySymbols=="function"&&(H=H.concat(Object.getOwnPropertySymbols(B).filter(function(U){return Object.getOwnPropertyDescriptor(B,U).enumerable}))),H.forEach(function(U){(0,G.Z)(E,U,B[U])})}return E}}},Oe={};function re(j){var A=Oe[j];if(A!==void 0)return A.exports;var S=Oe[j]={exports:{}};return Be[j](S,S.exports,re),S.exports}(function(){re.n=function(j){var A=j&&j.__esModule?function(){return j.default}:function(){return j};return re.d(A,{a:A}),A}})(),function(){re.d=function(j,A){for(var S in A)re.o(A,S)&&!re.o(j,S)&&Object.defineProperty(j,S,{enumerable:!0,get:A[S]})}}(),function(){re.o=function(j,A){return Object.prototype.hasOwnProperty.call(j,A)}}(),function(){re.r=function(j){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(j,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(j,"__esModule",{value:!0})}}();var Pe={};(function(){"use strict";re.r(Pe),re.d(Pe,{BaseObject:function(){return pt},GUIObject:function(){return R},Pencil:function(){return xe},default:function(){return xe}});function j(s,i){if(!(s instanceof i))throw new TypeError("Cannot call a class as a function")}function A(s,i){for(var n=0;n<i.length;n++){var e=i[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(s,e.key,e)}}function S(s,i,n){return i&&A(s.prototype,i),n&&A(s,n),s}var G=re(42);function D(s,i){var n=Object.keys(s);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(s);i&&(e=e.filter(function(t){return Object.getOwnPropertyDescriptor(s,t).enumerable})),n.push.apply(n,e)}return n}function E(s,i){return i=i!=null?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(i)):D(Object(i)).forEach(function(n){Object.defineProperty(s,n,Object.getOwnPropertyDescriptor(i,n))}),s}function g(s,i){(i==null||i>s.length)&&(i=s.length);for(var n=0,e=new Array(i);n<i;n++)e[n]=s[n];return e}function B(s){if(Array.isArray(s))return g(s)}function H(s){if(typeof Symbol!="undefined"&&s[Symbol.iterator]!=null||s["@@iterator"]!=null)return Array.from(s)}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 x(s,i){if(!!s){if(typeof s=="string")return g(s,i);var n=Object.prototype.toString.call(s).slice(8,-1);if(n==="Object"&&s.constructor&&(n=s.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return g(s,i)}}function k(s){return B(s)||H(s)||x(s)||U()}var l=re(644),N=re(187),ee=require("deepmerge"),ae=re.n(ee),ne=require("three/examples/jsm/libs/stats.module"),X=re.n(ne),Q=require("lil-gui"),Y=re.n(Q),R=function(){"use strict";function s(n){j(this,s),this.guiParams={},n&&(this.guiParams=n)}var i=s.prototype;return i.showGui=function(e){var t=this;!e||Object.keys(this.guiParams).forEach(function(r){var o=e.addFolder(r),u=t.guiParams[r];Object.keys(u).forEach(function(a){var h=u[a],C=h.min,_=h.max,y=h.step,w=h.name,z=h.paramMap,V=h.items,F=h.value,Z=h.target,le=a.toLowerCase().indexOf("color")>-1,I,ue=typeof F=="undefined"&&Z,ce=ue?Z():u[a],fe=ue?a:"value";V?I=o.add(ce,fe,V):le?I=o.addColor(ce,fe):I=o.add(ce,fe),I=I.name(w||a),typeof C!="undefined"&&(I=I.min(C)),typeof _!="undefined"&&(I=I.max(_)),typeof y!="undefined"&&(I=I.step(y)),I=I.onChange(function(){t.setTargetValue(r,a,ce[fe],z)}),ue&&I.listen()})})},i.setTargetValue=function(e,t,r,o){var u=this.guiParams[e][t],a=u.onChange,h=u.target,C=u.value,_=t.toLowerCase().indexOf("color")>-1,y=typeof C=="undefined"&&h;if(h&&!y){var w=h();Array.isArray(w)||(w=[w]),w.forEach(function(z){if(!!z)if(_)try{z[o||t].set(r)}catch(V){t!=="color"&&!o&&console.warn("".concat(t," is not a color,set paramMap"))}else z[o||t]=r})}a&&a(r)},i.setTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(t){Object.keys(e.guiParams[t]).forEach(function(r){var o=e.guiParams[t][r];typeof o.value!="undefined"&&e.setTargetValue(t,r,o.value,o.paramMap)})})},s}(),f={None:l.NoToneMapping,Linear:l.LinearToneMapping,Reinhard:l.ReinhardToneMapping,Cineon:l.CineonToneMapping,ACESFilmic:l.ACESFilmicToneMapping},c={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:l.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1,context:null},v=function(){"use strict";function s(n){j(this,s),this.options=n;var e=n.width,t=n.height,r=n.rendererParams,o=r.context,u=r.alpha,a=r.devicePixelRatio,h=r.antialias,C=r.powerPreference,_=r.toneMapping,y=r.toneMappingExposure,w=r.outputEncoding,z=r.logarithmicDepthBuffer,V=r.preserveDrawingBuffer,F=new l.WebGLRenderer({context:o,alpha:u,antialias:h,powerPreference:C,logarithmicDepthBuffer:z,preserveDrawingBuffer:V});F.setSize(e,t),F.setPixelRatio(a),F.autoClear=!1,F.toneMapping=f[_],F.toneMappingExposure=y,F.outputEncoding=w,this.renderer=F}var i=s.prototype;return i.setSize=function(e,t){this.renderer.setSize(e,t)},i.render=function(){var e=this.options,t=e.scene,r=e.camera;this.renderer.render(t,r)},i.setGui=function(e){var t=this,r=new R({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:f,target:function(){return t.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return t.renderer}}}});r.showGui(e)},i.dispose=function(){var e,t,r;(e=this.renderer)===null||e===void 0||e.clear(),(t=this.renderer)===null||t===void 0||t.dispose(),(r=this.renderer)===null||r===void 0||r.renderLists.dispose()},s}(),m={fov:45,near:1,far:1e3},P=function(){"use strict";function s(n){j(this,s),this.oldCameraPosition=new l.Vector3,this.oldCameraRotation=new l.Euler,this.customCamera=!1,this.options=n;var e=n.width,t=n.height,r=n.cameraParams;if(r instanceof l.Camera)this.camera=r,this.customCamera=!0;else{var o=r.fov,u=r.far,a=r.near,h=new l.PerspectiveCamera(o,e/t,a,u);h.position.set(0,0,400),h.lookAt(0,0,0),this.camera=h}}var i=s.prototype;return i.checkCameraChange=function(){var e=this.camera,t=this.oldCameraPosition.equals(e.position)&&this.oldCameraRotation.equals(e.rotation);return this.oldCameraPosition=e.position.clone(),this.oldCameraRotation=e.rotation.clone(),!t},i.setSize=function(e,t){this.camera instanceof l.PerspectiveCamera&&(this.camera.aspect=e/t),this.camera.updateProjectionMatrix()},i.setGui=function(e){var t=this,r=new R({camera:{x:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},y:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},z:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},near:{min:0,max:1e3,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}}}});this.camera instanceof l.PerspectiveCamera&&(r.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}}),r.showGui(e)},s}(),L=re(54),T={background:null},J=function(){"use strict";function s(n){j(this,s),this.options=n;var e=n.camera,t=n.sceneParams,r=t.background,o=new l.Scene;r&&(o.background=r),o.add(e),this.scene=o}var i=s.prototype;return i.addAxesHelper=function(){var e,t=new l.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(t)},i.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(t){(0,L.disposeMesh)(t)})},s}(),K=require("three/examples/jsm/controls/OrbitControls"),W={},q=function(){"use strict";function s(n){j(this,s),this.options=n;var e=n.camera,t=n.controlParams,r=n.mapControl,o=t.domElement,u=r?new K.MapControls(e,o):new K.OrbitControls(e,o);u.minPolarAngle=Math.PI*.15,u.maxPolarAngle=Math.PI*.85,u.enableDamping=!0,u.dampingFactor=.063,u.autoRotate=!1,u.autoRotateSpeed=-60,u.enableZoom=!0,u.zoomSpeed=.2,this.control=u}var i=s.prototype;return i.limitPan=function(e){var t=e.maxX,r=t===void 0?1/0:t,o=e.minX,u=o===void 0?-1/0:o,a=e.maxZ,h=a===void 0?1/0:a,C=e.minZ,_=C===void 0?-1/0:C,y=e.maxY,w=y===void 0?1/0:y,z=e.minY,V=z===void 0?-1/0:z,F=this.limitPanV||new l.Vector3,Z=this.control,le=this.options.camera,I=new l.Vector3(u,V,_),ue=new l.Vector3(r,w,h);this.limitPanV=F,F.copy(Z.target),Z.target.clamp(I,ue),F.sub(Z.target),le.position.sub(F)},i.update=function(){this.control.update()},i.dispose=function(){this.control.dispose()},s}(),ve=require("three/examples/jsm/renderers/CSS3DRenderer"),de=new l.Vector3,p=new l.Matrix4,d=new l.Matrix4,b=new l.Vector3,M=new l.Vector3,O=function s(){"use strict";var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};j(this,s);var n=function(z,V){return b.setFromMatrixPosition(z.matrixWorld),M.setFromMatrixPosition(V.matrixWorld),b.distanceToSquared(M)},e=function(z){var V=[];return z.traverse(function(F){F.isCSS2DObject&&V.push(F)}),V},t=function(z){for(var V=e(z).sort(function(ue,ce){if(ue.renderOrder!==ce.renderOrder)return ce.renderOrder-ue.renderOrder;var fe=C.objects.get(ue).distanceToCameraSquared,ye=C.objects.get(ce).distanceToCameraSquared;return fe-ye}),F=V.length,Z=0,le=V.length;Z<le;Z++){var I=V[Z].userData.zIndexFix||0;V[Z].element.style.zIndex=F-Z+I}},r=this,o,u,a,h,C={objects:new WeakMap},_=i.element!==void 0?i.element:document.createElement("div");_.style.overflow="hidden",this.domElement=_,this.getSize=function(){return{width:o,height:u}},this.render=function(w,z){w.autoUpdate===!0&&w.updateMatrixWorld(),z.parent===null&&z.updateMatrixWorld(),p.copy(z.matrixWorldInverse),d.multiplyMatrices(z.projectionMatrix,p),y(w,w,z),t(w)},this.setSize=function(w,z){o=w,u=z,a=o/2,h=u/2,_.style.width="".concat(w,"px"),_.style.height="".concat(z,"px")};function y(w,z,V){if(w.isCSS2DObject){de.setFromMatrixPosition(w.matrixWorld),de.applyMatrix4(d);var F=w.visible===!0&&de.z>=-1&&de.z<=1&&w.layers.test(V.layers)===!0;if(w.element.style.display=F===!0?"":"none",F===!0){w.onBeforeRender(r,z,V);var Z=w.element;Z.style.transform="translate(-50%,-50%) translate(".concat(de.x*a+a,"px,").concat(-de.y*h+h,"px)"),Z.parentNode!==_&&_.appendChild(Z),w.onAfterRender(r,z,V)}var le={distanceToCameraSquared:n(V,w)};C.objects.set(w,le)}for(var I=0,ue=w.children.length;I<ue;I++)y(w.children[I],z,V)}},$={zIndex:"auto"},se=function(){"use strict";function s(n){j(this,s),this.container=n}var i=s.prototype;return i.addRenderer=function(e,t){var r=this.container,o=r.offsetWidth,u=r.offsetHeight,a=e==="css2d"?new O:new ve.CSS3DRenderer;a.domElement.style.position="absolute",a.domElement.style.top="0",a.domElement.style.pointerEvents="none",a.domElement.style.zIndex=t.zIndex,a.setSize(o,u),r.appendChild(a.domElement),e==="css2d"?this.css2Drenderer=a:e==="css3d"&&(this.css3Drenderer=a)},i.setSize=function(e,t){var r,o;(r=this.css2Drenderer)===null||r===void 0||r.setSize(e,t),(o=this.css3Drenderer)===null||o===void 0||o.setSize(e,t)},i.render=function(e,t){var r,o;(r=this.css2Drenderer)===null||r===void 0||r.render(e,t),(o=this.css3Drenderer)===null||o===void 0||o.render(e,t)},i.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},s}(),ie=require("three/examples/jsm/postprocessing/EffectComposer"),oe=require("three/examples/jsm/postprocessing/RenderPass"),te=require("three/examples/jsm/postprocessing/ShaderPass"),pe=require("three/examples/jsm/shaders/CopyShader"),me=require("three/examples/jsm/shaders/GammaCorrectionShader"),he=require("three/examples/jsm/postprocessing/SMAAPass"),Ve=require("three/examples/jsm/postprocessing/SSAARenderPass"),Fe=require("three/examples/jsm/shaders/FXAAShader"),Ue=function(){try{var s=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&s.getContext("webgl2"))}catch(i){return!1}},bt=0,ke=1,ge=!1,Re=Ue()!==!1,Ie=`varying vec2 vUv;
2
2
 
3
3
  void main() {
4
4
 
@@ -1,4 +1,4 @@
1
- import*as Ne from"idb-keyval";import*as z from"three";import*as Wt from"deepmerge";import*as It from"three/examples/jsm/libs/stats.module";import*as Ht from"lil-gui";import*as ke from"three/examples/jsm/controls/OrbitControls";import*as Me from"three/examples/jsm/renderers/CSS3DRenderer";import*as Xt from"three/examples/jsm/postprocessing/EffectComposer";import*as Kt from"three/examples/jsm/postprocessing/RenderPass";import*as Zt from"three/examples/jsm/postprocessing/ShaderPass";import*as Qt from"three/examples/jsm/shaders/CopyShader";import*as Yt from"three/examples/jsm/shaders/GammaCorrectionShader";import*as $t from"three/examples/jsm/postprocessing/SMAAPass";import*as Jt from"three/examples/jsm/postprocessing/SSAARenderPass";import*as qt from"three/examples/jsm/shaders/FXAAShader";import*as We from"three/examples/jsm/postprocessing/Pass";import*as er from"three/examples/jsm/shaders/LuminosityHighPassShader";import*as tr from"three/examples/jsm/postprocessing/OutlinePass";import*as rr from"three/examples/jsm/postprocessing/SSRPass";import*as nr from"three/examples/jsm/objects/ReflectorForSSRPass";import*as ar from"three/examples/jsm/renderers/CSS2DRenderer";var ir={187:function(L){var j=typeof Reflect=="object"?Reflect:null,x=j&&typeof j.apply=="function"?j.apply:function(u,f,m){return Function.prototype.apply.call(u,f,m)},B;j&&typeof j.ownKeys=="function"?B=j.ownKeys:Object.getOwnPropertySymbols?B=function(u){return Object.getOwnPropertyNames(u).concat(Object.getOwnPropertySymbols(u))}:B=function(u){return Object.getOwnPropertyNames(u)};function A(h){console&&console.warn&&console.warn(h)}var T=Number.isNaN||function(u){return u!==u};function g(){g.init.call(this)}L.exports=g,L.exports.once=oe,g.EventEmitter=g,g.prototype._events=void 0,g.prototype._eventsCount=0,g.prototype._maxListeners=void 0;var G=10;function H(h){if(typeof h!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof h)}Object.defineProperty(g,"defaultMaxListeners",{enumerable:!0,get:function(){return G},set:function(h){if(typeof h!="number"||h<0||T(h))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+h+".");G=h}}),g.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},g.prototype.setMaxListeners=function(u){if(typeof u!="number"||u<0||T(u))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+u+".");return this._maxListeners=u,this};function R(h){return h._maxListeners===void 0?g.defaultMaxListeners:h._maxListeners}g.prototype.getMaxListeners=function(){return R(this)},g.prototype.emit=function(u){for(var f=[],m=1;m<arguments.length;m++)f.push(arguments[m]);var y=u==="error",O=this._events;if(O!==void 0)y=y&&O.error===void 0;else if(!y)return!1;if(y){var w;if(f.length>0&&(w=f[0]),w instanceof Error)throw w;var J=new Error("Unhandled error."+(w?" ("+w.message+")":""));throw J.context=w,J}var V=O[u];if(V===void 0)return!1;if(typeof V=="function")x(V,this,f);else for(var Z=V.length,ne=ae(V,Z),m=0;m<Z;++m)x(ne[m],this,f);return!0};function U(h,u,f,m){var y,O,w;if(H(f),O=h._events,O===void 0?(O=h._events=Object.create(null),h._eventsCount=0):(O.newListener!==void 0&&(h.emit("newListener",u,f.listener?f.listener:f),O=h._events),w=O[u]),w===void 0)w=O[u]=f,++h._eventsCount;else if(typeof w=="function"?w=O[u]=m?[f,w]:[w,f]:m?w.unshift(f):w.push(f),y=R(h),y>0&&w.length>y&&!w.warned){w.warned=!0;var J=new Error("Possible EventEmitter memory leak detected. "+w.length+" "+String(u)+" listeners added. Use emitter.setMaxListeners() to increase limit");J.name="MaxListenersExceededWarning",J.emitter=h,J.type=u,J.count=w.length,A(J)}return h}g.prototype.addListener=function(u,f){return U(this,u,f,!1)},g.prototype.on=g.prototype.addListener,g.prototype.prependListener=function(u,f){return U(this,u,f,!0)};function I(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function c(h,u,f){var m={fired:!1,wrapFn:void 0,target:h,type:u,listener:f},y=I.bind(m);return y.listener=f,m.wrapFn=y,y}g.prototype.once=function(u,f){return H(f),this.on(u,c(this,u,f)),this},g.prototype.prependOnceListener=function(u,f){return H(f),this.prependListener(u,c(this,u,f)),this},g.prototype.removeListener=function(u,f){var m,y,O,w,J;if(H(f),y=this._events,y===void 0)return this;if(m=y[u],m===void 0)return this;if(m===f||m.listener===f)--this._eventsCount===0?this._events=Object.create(null):(delete y[u],y.removeListener&&this.emit("removeListener",u,m.listener||f));else if(typeof m!="function"){for(O=-1,w=m.length-1;w>=0;w--)if(m[w]===f||m[w].listener===f){J=m[w].listener,O=w;break}if(O<0)return this;O===0?m.shift():re(m,O),m.length===1&&(y[u]=m[0]),y.removeListener!==void 0&&this.emit("removeListener",u,J||f)}return this},g.prototype.off=g.prototype.removeListener,g.prototype.removeAllListeners=function(u){var f,m,y;if(m=this._events,m===void 0)return this;if(m.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):m[u]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete m[u]),this;if(arguments.length===0){var O=Object.keys(m),w;for(y=0;y<O.length;++y)w=O[y],w!=="removeListener"&&this.removeAllListeners(w);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(f=m[u],typeof f=="function")this.removeListener(u,f);else if(f!==void 0)for(y=f.length-1;y>=0;y--)this.removeListener(u,f[y]);return this};function Q(h,u,f){var m=h._events;if(m===void 0)return[];var y=m[u];return y===void 0?[]:typeof y=="function"?f?[y.listener||y]:[y]:f?Y(y):ae(y,y.length)}g.prototype.listeners=function(u){return Q(this,u,!0)},g.prototype.rawListeners=function(u){return Q(this,u,!1)},g.listenerCount=function(h,u){return typeof h.listenerCount=="function"?h.listenerCount(u):te.call(h,u)},g.prototype.listenerCount=te;function te(h){var u=this._events;if(u!==void 0){var f=u[h];if(typeof f=="function")return 1;if(f!==void 0)return f.length}return 0}g.prototype.eventNames=function(){return this._eventsCount>0?B(this._events):[]};function ae(h,u){for(var f=new Array(u),m=0;m<u;++m)f[m]=h[m];return f}function re(h,u){for(;u+1<h.length;u++)h[u]=h[u+1];h.pop()}function Y(h){for(var u=new Array(h.length),f=0;f<u.length;++f)u[f]=h[f].listener||h[f];return u}function oe(h,u){return new Promise(function(f,m){function y(w){h.removeListener(u,O),m(w)}function O(){typeof h.removeListener=="function"&&h.removeListener("error",y),f([].slice.call(arguments))}W(h,u,O,{once:!0}),u!=="error"&&q(h,y,{once:!0})})}function q(h,u,f){typeof h.on=="function"&&W(h,"error",u,f)}function W(h,u,f,m){if(typeof h.on=="function")m.once?h.once(u,f):h.on(u,f);else if(typeof h.addEventListener=="function")h.addEventListener(u,function y(O){m.once&&h.removeEventListener(u,y),f(O)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof h)}},666:function(L){var j=function(x){"use strict";var B=Object.prototype,A=B.hasOwnProperty,T,g=typeof Symbol=="function"?Symbol:{},G=g.iterator||"@@iterator",H=g.asyncIterator||"@@asyncIterator",R=g.toStringTag||"@@toStringTag";function U(p,d,_){return Object.defineProperty(p,d,{value:_,enumerable:!0,configurable:!0,writable:!0}),p[d]}try{U({},"")}catch(p){U=function(d,_,M){return d[_]=M}}function I(p,d,_,M){var E=d&&d.prototype instanceof oe?d:oe,$=Object.create(E.prototype),ee=new ne(M||[]);return $._invoke=w(p,_,ee),$}x.wrap=I;function c(p,d,_){try{return{type:"normal",arg:p.call(d,_)}}catch(M){return{type:"throw",arg:M}}}var Q="suspendedStart",te="suspendedYield",ae="executing",re="completed",Y={};function oe(){}function q(){}function W(){}var h={};U(h,G,function(){return this});var u=Object.getPrototypeOf,f=u&&u(u(ve([])));f&&f!==B&&A.call(f,G)&&(h=f);var m=W.prototype=oe.prototype=Object.create(h);q.prototype=W,U(m,"constructor",W),U(W,"constructor",q),q.displayName=U(W,R,"GeneratorFunction");function y(p){["next","throw","return"].forEach(function(d){U(p,d,function(_){return this._invoke(d,_)})})}x.isGeneratorFunction=function(p){var d=typeof p=="function"&&p.constructor;return d?d===q||(d.displayName||d.name)==="GeneratorFunction":!1},x.mark=function(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,W):(p.__proto__=W,U(p,R,"GeneratorFunction")),p.prototype=Object.create(m),p},x.awrap=function(p){return{__await:p}};function O(p,d){function _($,ee,ie,ue){var se=c(p[$],p,ee);if(se.type==="throw")ue(se.arg);else{var me=se.arg,pe=me.value;return pe&&typeof pe=="object"&&A.call(pe,"__await")?d.resolve(pe.__await).then(function(fe){_("next",fe,ie,ue)},function(fe){_("throw",fe,ie,ue)}):d.resolve(pe).then(function(fe){me.value=fe,ie(me)},function(fe){return _("throw",fe,ie,ue)})}}var M;function E($,ee){function ie(){return new d(function(ue,se){_($,ee,ue,se)})}return M=M?M.then(ie,ie):ie()}this._invoke=E}y(O.prototype),U(O.prototype,H,function(){return this}),x.AsyncIterator=O,x.async=function(p,d,_,M,E){E===void 0&&(E=Promise);var $=new O(I(p,d,_,M),E);return x.isGeneratorFunction(d)?$:$.next().then(function(ee){return ee.done?ee.value:$.next()})};function w(p,d,_){var M=Q;return function($,ee){if(M===ae)throw new Error("Generator is already running");if(M===re){if($==="throw")throw ee;return Se()}for(_.method=$,_.arg=ee;;){var ie=_.delegate;if(ie){var ue=J(ie,_);if(ue){if(ue===Y)continue;return ue}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(M===Q)throw M=re,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);M=ae;var se=c(p,d,_);if(se.type==="normal"){if(M=_.done?re:te,se.arg===Y)continue;return{value:se.arg,done:_.done}}else se.type==="throw"&&(M=re,_.method="throw",_.arg=se.arg)}}}function J(p,d){var _=p.iterator[d.method];if(_===T){if(d.delegate=null,d.method==="throw"){if(p.iterator.return&&(d.method="return",d.arg=T,J(p,d),d.method==="throw"))return Y;d.method="throw",d.arg=new TypeError("The iterator does not provide a 'throw' method")}return Y}var M=c(_,p.iterator,d.arg);if(M.type==="throw")return d.method="throw",d.arg=M.arg,d.delegate=null,Y;var E=M.arg;if(!E)return d.method="throw",d.arg=new TypeError("iterator result is not an object"),d.delegate=null,Y;if(E.done)d[p.resultName]=E.value,d.next=p.nextLoc,d.method!=="return"&&(d.method="next",d.arg=T);else return E;return d.delegate=null,Y}y(m),U(m,R,"Generator"),U(m,G,function(){return this}),U(m,"toString",function(){return"[object Generator]"});function V(p){var d={tryLoc:p[0]};1 in p&&(d.catchLoc=p[1]),2 in p&&(d.finallyLoc=p[2],d.afterLoc=p[3]),this.tryEntries.push(d)}function Z(p){var d=p.completion||{};d.type="normal",delete d.arg,p.completion=d}function ne(p){this.tryEntries=[{tryLoc:"root"}],p.forEach(V,this),this.reset(!0)}x.keys=function(p){var d=[];for(var _ in p)d.push(_);return d.reverse(),function M(){for(;d.length;){var E=d.pop();if(E in p)return M.value=E,M.done=!1,M}return M.done=!0,M}};function ve(p){if(p){var d=p[G];if(d)return d.call(p);if(typeof p.next=="function")return p;if(!isNaN(p.length)){var _=-1,M=function E(){for(;++_<p.length;)if(A.call(p,_))return E.value=p[_],E.done=!1,E;return E.value=T,E.done=!0,E};return M.next=M}}return{next:Se}}x.values=ve;function Se(){return{value:T,done:!0}}return ne.prototype={constructor:ne,reset:function(p){if(this.prev=0,this.next=0,this.sent=this._sent=T,this.done=!1,this.delegate=null,this.method="next",this.arg=T,this.tryEntries.forEach(Z),!p)for(var d in this)d.charAt(0)==="t"&&A.call(this,d)&&!isNaN(+d.slice(1))&&(this[d]=T)},stop:function(){this.done=!0;var p=this.tryEntries[0],d=p.completion;if(d.type==="throw")throw d.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var d=this;function _(ue,se){return $.type="throw",$.arg=p,d.next=ue,se&&(d.method="next",d.arg=T),!!se}for(var M=this.tryEntries.length-1;M>=0;--M){var E=this.tryEntries[M],$=E.completion;if(E.tryLoc==="root")return _("end");if(E.tryLoc<=this.prev){var ee=A.call(E,"catchLoc"),ie=A.call(E,"finallyLoc");if(ee&&ie){if(this.prev<E.catchLoc)return _(E.catchLoc,!0);if(this.prev<E.finallyLoc)return _(E.finallyLoc)}else if(ee){if(this.prev<E.catchLoc)return _(E.catchLoc,!0)}else if(ie){if(this.prev<E.finallyLoc)return _(E.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(p,d){for(var _=this.tryEntries.length-1;_>=0;--_){var M=this.tryEntries[_];if(M.tryLoc<=this.prev&&A.call(M,"finallyLoc")&&this.prev<M.finallyLoc){var E=M;break}}E&&(p==="break"||p==="continue")&&E.tryLoc<=d&&d<=E.finallyLoc&&(E=null);var $=E?E.completion:{};return $.type=p,$.arg=d,E?(this.method="next",this.next=E.finallyLoc,Y):this.complete($)},complete:function(p,d){if(p.type==="throw")throw p.arg;return p.type==="break"||p.type==="continue"?this.next=p.arg:p.type==="return"?(this.rval=this.arg=p.arg,this.method="return",this.next="end"):p.type==="normal"&&d&&(this.next=d),Y},finish:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var _=this.tryEntries[d];if(_.finallyLoc===p)return this.complete(_.completion,_.afterLoc),Z(_),Y}},catch:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var _=this.tryEntries[d];if(_.tryLoc===p){var M=_.completion;if(M.type==="throw"){var E=M.arg;Z(_)}return E}}throw new Error("illegal catch attempt")},delegateYield:function(p,d,_){return this.delegate={iterator:ve(p),resultName:d,nextLoc:_},this.method==="next"&&(this.arg=T),Y}},x}(L.exports);try{regeneratorRuntime=j}catch(x){typeof globalThis=="object"?globalThis.regeneratorRuntime=j:Function("r","regeneratorRuntime = r")(j)}},182:function(L,j,x){x.d(j,{Z:function(){return B}});function B(A){if(A.geometry&&A.geometry.dispose(),A.material){var T=Array.isArray(A.material)?A.material:[A.material];T.forEach(function(g){var G,H,R,U,I,c,Q,te,ae,re,Y,oe,q;(G=g.map)===null||G===void 0||G.dispose(),(H=g.lightMap)===null||H===void 0||H.dispose(),(R=g.bumpMap)===null||R===void 0||R.dispose(),(U=g.normalMap)===null||U===void 0||U.dispose(),(I=g.specularMap)===null||I===void 0||I.dispose(),(c=g.envMap)===null||c===void 0||c.dispose(),(Q=g.alphaMap)===null||Q===void 0||Q.dispose(),(te=g.aoMap)===null||te===void 0||te.dispose(),(ae=g.displacementMap)===null||ae===void 0||ae.dispose(),(re=g.emissiveMap)===null||re===void 0||re.dispose(),(Y=g.gradientMap)===null||Y===void 0||Y.dispose(),(oe=g.metalnessMap)===null||oe===void 0||oe.dispose(),(q=g.roughnessMap)===null||q===void 0||q.dispose(),g.dispose()})}}},175:function(L,j,x){x.d(j,{wf:function(){return g.Z},PO:function(){return R.Z}});var B=x(666),A=x.n(B),T=null,g=x(182),G=x(949);function H(W){if(W.material){var h=Array.isArray(W.material)?W.material:[W.material];h.forEach(function(u){var f,m;(f=u.color)===null||f===void 0||f.convertSRGBToLinear(),(m=u.emissive)===null||m===void 0||m.convertSRGBToLinear(),u.map&&(u.map.encoding=THREE.sRGBEncoding),u.emissiveMap&&(u.emissiveMap.encoding=THREE.sRGBEncoding)})}}var R=x(975),U=x(568),I=x(924),c=W=>{var h={};return x.d(h,W),h},Q=W=>()=>W,te=c({get:()=>Ne.get,set:()=>Ne.set}),ae=x(620),re=null,Y=null,oe=function(){var W=(0,U.Z)(A().mark(function h(u,f){var m,y,O,w,J,V;return A().wrap(function(ne){for(;;)switch(ne.prev=ne.next){case 0:return m=f.version,ne.next=4,(0,te.get)(u);case 4:if(O=ne.sent,!(O&&O[m])){ne.next=9;break}y=O[m],ne.next=15;break;case 9:return ne.next=11,(0,ae.Z)(fetch(u).then(function(ve){if(ve.ok)return ve.blob();throw new Error}));case 11:w=ne.sent,J=w.res,V=w.err,V||(y=J,(0,te.set)(u,(0,I.Z)({},m,J)));case 15:return ne.abrupt("return",y?{url:URL.createObjectURL(y)}:{url:u});case 16:case"end":return ne.stop()}},h)}));return function(u,f){return W.apply(this,arguments)}}(),q=x(977)},975:function(L,j,x){x.d(j,{Z:function(){return A}});function B(T){return Object.prototype.toString.call(T)==="[object Object]"}function A(T){if(B(T)===!1)return!1;var g=T.constructor;if(g===void 0)return!0;var G=g.prototype;return!(B(G)===!1||G.hasOwnProperty("isPrototypeOf")===!1)}},620:function(L,j,x){x.d(j,{Z:function(){return A}});var B=x(42);function A(T){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return T.then(function(G){return(0,B.Z)({err:null,res:G},g)}).catch(function(G){return(0,B.Z)({err:G,res:void 0},g)})}},977:function(L,j,x){var B=x(949),A=new Map,T=function(G){return{generateTopUV:function(H,R,U,I,c){var Q=R[U*3],te=R[U*3+1],ae=R[I*3],re=R[I*3+1],Y=R[c*3],oe=R[c*3+1],q;if(A.has(H))q=A.get(H);else{var W=G&&G.Box3||new THREE.Box3;if(!G||!G.Box3){var h=H.parameters.shapes.getPoints();W.setFromArray(h.map(function(y){return[y.x,y.y,0]}).flat())}var u=W.getSize(new THREE.Vector3);q={box:W,size:u},A.set(H,q)}var f=q.box,m=q.size;return[new THREE.Vector2((Q-f.min.x)/m.x,(te-f.min.y)/m.y),new THREE.Vector2((ae-f.min.x)/m.x,(re-f.min.y)/m.y),new THREE.Vector2((Y-f.min.x)/m.x,(oe-f.min.y)/m.y)]},generateSideWallUV:function(H,R,U,I,c,Q){var te=R[U*3],ae=R[U*3+1],re=R[U*3+2],Y=R[I*3],oe=R[I*3+1],q=R[I*3+2],W=R[c*3],h=R[c*3+1],u=R[c*3+2],f=R[Q*3],m=R[Q*3+1],y=R[Q*3+2],O;if(A.has(R))O=A.get(R);else{var w=new THREE.Box3;w.setFromArray(R);var J=w.getSize(new THREE.Vector3);O={box:w,size:J},A.set(R,O)}var V=O.box,Z=O.size;return Math.abs(ae-oe)<.01?[new THREE.Vector2((te-V.min.x)/Z.x,(re-V.min.z)/Z.z),new THREE.Vector2((Y-V.min.x)/Z.x,(q-V.min.z)/Z.z),new THREE.Vector2((W-V.min.x)/Z.x,(u-V.min.z)/Z.z),new THREE.Vector2((f-V.min.x)/Z.x,(y-V.min.z)/Z.z)]:[new THREE.Vector2((ae-V.min.y)/Z.x,(re-V.min.z)/Z.z),new THREE.Vector2((oe-V.min.y)/Z.x,(q-V.min.z)/Z.z),new THREE.Vector2((h-V.min.y)/Z.x,(u-V.min.z)/Z.z),new THREE.Vector2((m-V.min.y)/Z.x,(y-V.min.z)/Z.z)]}}},g=function(){A.clear()}},949:function(L,j,x){var B=T=>{var g={};return x.d(g,T),g},A=T=>()=>T;L.exports=B({ACESFilmicToneMapping:()=>z.ACESFilmicToneMapping,AdditiveBlending:()=>z.AdditiveBlending,AxesHelper:()=>z.AxesHelper,Box3:()=>z.Box3,Camera:()=>z.Camera,CineonToneMapping:()=>z.CineonToneMapping,Clock:()=>z.Clock,Color:()=>z.Color,Euler:()=>z.Euler,Group:()=>z.Group,Layers:()=>z.Layers,LinearEncoding:()=>z.LinearEncoding,LinearFilter:()=>z.LinearFilter,LinearToneMapping:()=>z.LinearToneMapping,Matrix4:()=>z.Matrix4,Mesh:()=>z.Mesh,MeshBasicMaterial:()=>z.MeshBasicMaterial,NoToneMapping:()=>z.NoToneMapping,PerspectiveCamera:()=>z.PerspectiveCamera,PlaneGeometry:()=>z.PlaneGeometry,Points:()=>z.Points,REVISION:()=>z.REVISION,RGBAFormat:()=>z.RGBAFormat,Raycaster:()=>z.Raycaster,ReinhardToneMapping:()=>z.ReinhardToneMapping,Scene:()=>z.Scene,ShaderMaterial:()=>z.ShaderMaterial,Sprite:()=>z.Sprite,SpriteMaterial:()=>z.SpriteMaterial,UniformsUtils:()=>z.UniformsUtils,UnsignedByteType:()=>z.UnsignedByteType,Vector2:()=>z.Vector2,Vector3:()=>z.Vector3,WebGLMultisampleRenderTarget:()=>z.WebGLMultisampleRenderTarget,WebGLRenderTarget:()=>z.WebGLRenderTarget,WebGLRenderer:()=>z.WebGLRenderer,sRGBEncoding:()=>z.sRGBEncoding})},568:function(L,j,x){x.d(j,{Z:function(){return A}});function B(T,g,G,H,R,U,I){try{var c=T[U](I),Q=c.value}catch(te){G(te);return}c.done?g(Q):Promise.resolve(Q).then(H,R)}function A(T){return function(){var g=this,G=arguments;return new Promise(function(H,R){var U=T.apply(g,G);function I(Q){B(U,H,R,I,c,"next",Q)}function c(Q){B(U,H,R,I,c,"throw",Q)}I(void 0)})}}},924:function(L,j,x){x.d(j,{Z:function(){return B}});function B(A,T,g){return T in A?Object.defineProperty(A,T,{value:g,enumerable:!0,configurable:!0,writable:!0}):A[T]=g,A}},42:function(L,j,x){x.d(j,{Z:function(){return A}});var B=x(924);function A(T){for(var g=1;g<arguments.length;g++){var G=arguments[g]!=null?arguments[g]:{},H=Object.keys(G);typeof Object.getOwnPropertySymbols=="function"&&(H=H.concat(Object.getOwnPropertySymbols(G).filter(function(R){return Object.getOwnPropertyDescriptor(G,R).enumerable}))),H.forEach(function(R){(0,B.Z)(T,R,G[R])})}return T}}},Ie={};function F(L){var j=Ie[L];if(j!==void 0)return j.exports;var x=Ie[L]={exports:{}};return ir[L](x,x.exports,F),x.exports}(function(){F.n=function(L){var j=L&&L.__esModule?function(){return L.default}:function(){return L};return F.d(j,{a:j}),j}})(),function(){F.d=function(L,j){for(var x in j)F.o(j,x)&&!F.o(L,x)&&Object.defineProperty(L,x,{enumerable:!0,get:j[x]})}}(),function(){F.o=function(L,j){return Object.prototype.hasOwnProperty.call(L,j)}}();var _e={};(function(){F.d(_e,{L6:function(){return Vt},sb:function(){return f},z:function(){return Re},ZP:function(){return Re}});function L(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")}function j(n,r){for(var i=0;i<r.length;i++){var e=r[i];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(n,e.key,e)}}function x(n,r,i){return r&&j(n.prototype,r),i&&j(n,i),n}var B=F(42);function A(n,r){var i=Object.keys(n);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(n);r&&(e=e.filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})),i.push.apply(i,e)}return i}function T(n,r){return r=r!=null?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(r,i))}),n}function g(n,r){(r==null||r>n.length)&&(r=n.length);for(var i=0,e=new Array(r);i<r;i++)e[i]=n[i];return e}function G(n){if(Array.isArray(n))return g(n)}function H(n){if(typeof Symbol!="undefined"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function R(){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,r){if(!!n){if(typeof n=="string")return g(n,r);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 g(n,r)}}function I(n){return G(n)||H(n)||U(n)||R()}var c=F(949),Q=F(187),te=n=>{var r={};return F.d(r,n),r},ae=n=>()=>n,re=te({default:()=>Wt.default}),Y=n=>{var r={};return F.d(r,n),r},oe=n=>()=>n,q=Y({default:()=>It.default}),W=n=>{var r={};return F.d(r,n),r},h=n=>()=>n,u=W({default:()=>Ht.default}),f=function(){"use strict";function n(i){L(this,n),this.guiParams={},i&&(this.guiParams=i)}var r=n.prototype;return r.showGui=function(e){var t=this;!e||Object.keys(this.guiParams).forEach(function(a){var o=e.addFolder(a),l=t.guiParams[a];Object.keys(l).forEach(function(s){var v=l[s],C=v.min,P=v.max,b=v.step,S=v.name,D=v.paramMap,N=v.items,k=v.value,K=v.target,ce=s.toLowerCase().indexOf("color")>-1,X,le=typeof k=="undefined"&&K,de=le?K():l[s],he=le?s:"value";N?X=o.add(de,he,N):ce?X=o.addColor(de,he):X=o.add(de,he),X=X.name(S||s),typeof C!="undefined"&&(X=X.min(C)),typeof P!="undefined"&&(X=X.max(P)),typeof b!="undefined"&&(X=X.step(b)),X=X.onChange(function(){t.setTargetValue(a,s,de[he],D)}),le&&X.listen()})})},r.setTargetValue=function(e,t,a,o){var l=this.guiParams[e][t],s=l.onChange,v=l.target,C=l.value,P=t.toLowerCase().indexOf("color")>-1,b=typeof C=="undefined"&&v;if(v&&!b){var S=v();Array.isArray(S)||(S=[S]),S.forEach(function(D){if(!!D)if(P)try{D[o||t].set(a)}catch(N){t!=="color"&&!o&&console.warn("".concat(t," is not a color,set paramMap"))}else D[o||t]=a})}s&&s(a)},r.setTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(t){Object.keys(e.guiParams[t]).forEach(function(a){var o=e.guiParams[t][a];typeof o.value!="undefined"&&e.setTargetValue(t,a,o.value,o.paramMap)})})},n}(),m={None:c.NoToneMapping,Linear:c.LinearToneMapping,Reinhard:c.ReinhardToneMapping,Cineon:c.CineonToneMapping,ACESFilmic:c.ACESFilmicToneMapping},y={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:c.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1,context:null},O=function(){"use strict";function n(i){L(this,n),this.options=i;var e=i.width,t=i.height,a=i.rendererParams,o=a.context,l=a.alpha,s=a.devicePixelRatio,v=a.antialias,C=a.powerPreference,P=a.toneMapping,b=a.toneMappingExposure,S=a.outputEncoding,D=a.logarithmicDepthBuffer,N=a.preserveDrawingBuffer,k=new c.WebGLRenderer({context:o,alpha:l,antialias:v,powerPreference:C,logarithmicDepthBuffer:D,preserveDrawingBuffer:N});k.setSize(e,t),k.setPixelRatio(s),k.autoClear=!1,k.toneMapping=m[P],k.toneMappingExposure=b,k.outputEncoding=S,this.renderer=k}var r=n.prototype;return r.setSize=function(e,t){this.renderer.setSize(e,t)},r.render=function(){var e=this.options,t=e.scene,a=e.camera;this.renderer.render(t,a)},r.setGui=function(e){var t=this,a=new f({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:m,target:function(){return t.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return t.renderer}}}});a.showGui(e)},r.dispose=function(){var e,t,a;(e=this.renderer)===null||e===void 0||e.clear(),(t=this.renderer)===null||t===void 0||t.dispose(),(a=this.renderer)===null||a===void 0||a.renderLists.dispose()},n}(),w={fov:45,near:1,far:1e3},J=function(){"use strict";function n(i){L(this,n),this.oldCameraPosition=new c.Vector3,this.oldCameraRotation=new c.Euler,this.customCamera=!1,this.options=i;var e=i.width,t=i.height,a=i.cameraParams;if(a instanceof c.Camera)this.camera=a,this.customCamera=!0;else{var o=a.fov,l=a.far,s=a.near,v=new c.PerspectiveCamera(o,e/t,s,l);v.position.set(0,0,400),v.lookAt(0,0,0),this.camera=v}}var r=n.prototype;return r.checkCameraChange=function(){var e=this.camera,t=this.oldCameraPosition.equals(e.position)&&this.oldCameraRotation.equals(e.rotation);return this.oldCameraPosition=e.position.clone(),this.oldCameraRotation=e.rotation.clone(),!t},r.setSize=function(e,t){this.camera instanceof c.PerspectiveCamera&&(this.camera.aspect=e/t),this.camera.updateProjectionMatrix()},r.setGui=function(e){var t=this,a=new f({camera:{x:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},y:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},z:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},near:{min:0,max:1e3,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}}}});this.camera instanceof c.PerspectiveCamera&&(a.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}}),a.showGui(e)},n}(),V=F(175),Z={background:null},ne=function(){"use strict";function n(i){L(this,n),this.options=i;var e=i.camera,t=i.sceneParams,a=t.background,o=new c.Scene;a&&(o.background=a),o.add(e),this.scene=o}var r=n.prototype;return r.addAxesHelper=function(){var e,t=new c.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(t)},r.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(t){(0,V.wf)(t)})},n}(),ve=n=>{var r={};return F.d(r,n),r},Se=n=>()=>n,p=ve({MapControls:()=>ke.MapControls,OrbitControls:()=>ke.OrbitControls}),d={},_=function(){"use strict";function n(i){L(this,n),this.options=i;var e=i.camera,t=i.controlParams,a=i.mapControl,o=t.domElement,l=a?new p.MapControls(e,o):new p.OrbitControls(e,o);l.minPolarAngle=Math.PI*.15,l.maxPolarAngle=Math.PI*.85,l.enableDamping=!0,l.dampingFactor=.063,l.autoRotate=!1,l.autoRotateSpeed=-60,l.enableZoom=!0,l.zoomSpeed=.2,this.control=l}var r=n.prototype;return r.limitPan=function(e){var t=e.maxX,a=t===void 0?1/0:t,o=e.minX,l=o===void 0?-1/0:o,s=e.maxZ,v=s===void 0?1/0:s,C=e.minZ,P=C===void 0?-1/0:C,b=e.maxY,S=b===void 0?1/0:b,D=e.minY,N=D===void 0?-1/0:D,k=this.limitPanV||new c.Vector3,K=this.control,ce=this.options.camera,X=new c.Vector3(l,N,P),le=new c.Vector3(a,S,v);this.limitPanV=k,k.copy(K.target),K.target.clamp(X,le),k.sub(K.target),ce.position.sub(k)},r.update=function(){this.control.update()},r.dispose=function(){this.control.dispose()},n}(),M=n=>{var r={};return F.d(r,n),r},E=n=>()=>n,$=M({CSS3DObject:()=>Me.CSS3DObject,CSS3DRenderer:()=>Me.CSS3DRenderer,CSS3DSprite:()=>Me.CSS3DSprite}),ee=new c.Vector3,ie=new c.Matrix4,ue=new c.Matrix4,se=new c.Vector3,me=new c.Vector3,pe=function n(){"use strict";var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};L(this,n);var i=function(D,N){return se.setFromMatrixPosition(D.matrixWorld),me.setFromMatrixPosition(N.matrixWorld),se.distanceToSquared(me)},e=function(D){var N=[];return D.traverse(function(k){k.isCSS2DObject&&N.push(k)}),N},t=function(D){for(var N=e(D).sort(function(le,de){if(le.renderOrder!==de.renderOrder)return de.renderOrder-le.renderOrder;var he=C.objects.get(le).distanceToCameraSquared,ye=C.objects.get(de).distanceToCameraSquared;return he-ye}),k=N.length,K=0,ce=N.length;K<ce;K++){var X=N[K].userData.zIndexFix||0;N[K].element.style.zIndex=k-K+X}},a=this,o,l,s,v,C={objects:new WeakMap},P=r.element!==void 0?r.element:document.createElement("div");P.style.overflow="hidden",this.domElement=P,this.getSize=function(){return{width:o,height:l}},this.render=function(S,D){S.autoUpdate===!0&&S.updateMatrixWorld(),D.parent===null&&D.updateMatrixWorld(),ie.copy(D.matrixWorldInverse),ue.multiplyMatrices(D.projectionMatrix,ie),b(S,S,D),t(S)},this.setSize=function(S,D){o=S,l=D,s=o/2,v=l/2,P.style.width="".concat(S,"px"),P.style.height="".concat(D,"px")};function b(S,D,N){if(S.isCSS2DObject){ee.setFromMatrixPosition(S.matrixWorld),ee.applyMatrix4(ue);var k=S.visible===!0&&ee.z>=-1&&ee.z<=1&&S.layers.test(N.layers)===!0;if(S.element.style.display=k===!0?"":"none",k===!0){S.onBeforeRender(a,D,N);var K=S.element;K.style.transform="translate(-50%,-50%) translate(".concat(ee.x*s+s,"px,").concat(-ee.y*v+v,"px)"),K.parentNode!==P&&P.appendChild(K),S.onAfterRender(a,D,N)}var ce={distanceToCameraSquared:i(N,S)};C.objects.set(S,ce)}for(var X=0,le=S.children.length;X<le;X++)b(S.children[X],D,N)}},fe={zIndex:"auto"},He=function(){"use strict";function n(i){L(this,n),this.container=i}var r=n.prototype;return r.addRenderer=function(e,t){var a=this.container,o=a.offsetWidth,l=a.offsetHeight,s=e==="css2d"?new pe:new $.CSS3DRenderer;s.domElement.style.position="absolute",s.domElement.style.top="0",s.domElement.style.pointerEvents="none",s.domElement.style.zIndex=t.zIndex,s.setSize(o,l),a.appendChild(s.domElement),e==="css2d"?this.css2Drenderer=s:e==="css3d"&&(this.css3Drenderer=s)},r.setSize=function(e,t){var a,o;(a=this.css2Drenderer)===null||a===void 0||a.setSize(e,t),(o=this.css3Drenderer)===null||o===void 0||o.setSize(e,t)},r.render=function(e,t){var a,o;(a=this.css2Drenderer)===null||a===void 0||a.render(e,t),(o=this.css3Drenderer)===null||o===void 0||o.render(e,t)},r.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},n}(),Xe=n=>{var r={};return F.d(r,n),r},cr=n=>()=>n,Te=Xe({EffectComposer:()=>Xt.EffectComposer}),Ke=n=>{var r={};return F.d(r,n),r},fr=n=>()=>n,Ze=Ke({RenderPass:()=>Kt.RenderPass}),Qe=n=>{var r={};return F.d(r,n),r},dr=n=>()=>n,be=Qe({ShaderPass:()=>Zt.ShaderPass}),Ye=n=>{var r={};return F.d(r,n),r},hr=n=>()=>n,xe=Ye({CopyShader:()=>Qt.CopyShader}),$e=n=>{var r={};return F.d(r,n),r},vr=n=>()=>n,Je=$e({GammaCorrectionShader:()=>Yt.GammaCorrectionShader}),qe=n=>{var r={};return F.d(r,n),r},pr=n=>()=>n,et=qe({SMAAPass:()=>$t.SMAAPass}),tt=n=>{var r={};return F.d(r,n),r},mr=n=>()=>n,rt=tt({SSAARenderPass:()=>Jt.SSAARenderPass}),nt=n=>{var r={};return F.d(r,n),r},gr=n=>()=>n,at=nt({FXAAShader:()=>qt.FXAAShader}),it=function(){try{var n=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&n.getContext("webgl2"))}catch(r){return!1}},_r=0,st=1,ge=!1,Le=it()!==!1,ot=`varying vec2 vUv;
1
+ import*as Ne from"idb-keyval";import*as z from"three";import*as Wt from"deepmerge";import*as It from"three/examples/jsm/libs/stats.module";import*as Ht from"lil-gui";import*as ke from"three/examples/jsm/controls/OrbitControls";import*as Me from"three/examples/jsm/renderers/CSS3DRenderer";import*as Xt from"three/examples/jsm/postprocessing/EffectComposer";import*as Kt from"three/examples/jsm/postprocessing/RenderPass";import*as Zt from"three/examples/jsm/postprocessing/ShaderPass";import*as Qt from"three/examples/jsm/shaders/CopyShader";import*as Yt from"three/examples/jsm/shaders/GammaCorrectionShader";import*as $t from"three/examples/jsm/postprocessing/SMAAPass";import*as Jt from"three/examples/jsm/postprocessing/SSAARenderPass";import*as qt from"three/examples/jsm/shaders/FXAAShader";import*as We from"three/examples/jsm/postprocessing/Pass";import*as er from"three/examples/jsm/shaders/LuminosityHighPassShader";import*as tr from"three/examples/jsm/postprocessing/OutlinePass";import*as rr from"three/examples/jsm/postprocessing/SSRPass";import*as nr from"three/examples/jsm/objects/ReflectorForSSRPass";import*as ar from"three/examples/jsm/renderers/CSS2DRenderer";var ir={187:function(L){var j=typeof Reflect=="object"?Reflect:null,x=j&&typeof j.apply=="function"?j.apply:function(u,f,m){return Function.prototype.apply.call(u,f,m)},B;j&&typeof j.ownKeys=="function"?B=j.ownKeys:Object.getOwnPropertySymbols?B=function(u){return Object.getOwnPropertyNames(u).concat(Object.getOwnPropertySymbols(u))}:B=function(u){return Object.getOwnPropertyNames(u)};function A(h){console&&console.warn&&console.warn(h)}var T=Number.isNaN||function(u){return u!==u};function g(){g.init.call(this)}L.exports=g,L.exports.once=oe,g.EventEmitter=g,g.prototype._events=void 0,g.prototype._eventsCount=0,g.prototype._maxListeners=void 0;var G=10;function H(h){if(typeof h!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof h)}Object.defineProperty(g,"defaultMaxListeners",{enumerable:!0,get:function(){return G},set:function(h){if(typeof h!="number"||h<0||T(h))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+h+".");G=h}}),g.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},g.prototype.setMaxListeners=function(u){if(typeof u!="number"||u<0||T(u))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+u+".");return this._maxListeners=u,this};function R(h){return h._maxListeners===void 0?g.defaultMaxListeners:h._maxListeners}g.prototype.getMaxListeners=function(){return R(this)},g.prototype.emit=function(u){for(var f=[],m=1;m<arguments.length;m++)f.push(arguments[m]);var y=u==="error",O=this._events;if(O!==void 0)y=y&&O.error===void 0;else if(!y)return!1;if(y){var w;if(f.length>0&&(w=f[0]),w instanceof Error)throw w;var J=new Error("Unhandled error."+(w?" ("+w.message+")":""));throw J.context=w,J}var V=O[u];if(V===void 0)return!1;if(typeof V=="function")x(V,this,f);else for(var Z=V.length,ne=ae(V,Z),m=0;m<Z;++m)x(ne[m],this,f);return!0};function U(h,u,f,m){var y,O,w;if(H(f),O=h._events,O===void 0?(O=h._events=Object.create(null),h._eventsCount=0):(O.newListener!==void 0&&(h.emit("newListener",u,f.listener?f.listener:f),O=h._events),w=O[u]),w===void 0)w=O[u]=f,++h._eventsCount;else if(typeof w=="function"?w=O[u]=m?[f,w]:[w,f]:m?w.unshift(f):w.push(f),y=R(h),y>0&&w.length>y&&!w.warned){w.warned=!0;var J=new Error("Possible EventEmitter memory leak detected. "+w.length+" "+String(u)+" listeners added. Use emitter.setMaxListeners() to increase limit");J.name="MaxListenersExceededWarning",J.emitter=h,J.type=u,J.count=w.length,A(J)}return h}g.prototype.addListener=function(u,f){return U(this,u,f,!1)},g.prototype.on=g.prototype.addListener,g.prototype.prependListener=function(u,f){return U(this,u,f,!0)};function I(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function c(h,u,f){var m={fired:!1,wrapFn:void 0,target:h,type:u,listener:f},y=I.bind(m);return y.listener=f,m.wrapFn=y,y}g.prototype.once=function(u,f){return H(f),this.on(u,c(this,u,f)),this},g.prototype.prependOnceListener=function(u,f){return H(f),this.prependListener(u,c(this,u,f)),this},g.prototype.removeListener=function(u,f){var m,y,O,w,J;if(H(f),y=this._events,y===void 0)return this;if(m=y[u],m===void 0)return this;if(m===f||m.listener===f)--this._eventsCount===0?this._events=Object.create(null):(delete y[u],y.removeListener&&this.emit("removeListener",u,m.listener||f));else if(typeof m!="function"){for(O=-1,w=m.length-1;w>=0;w--)if(m[w]===f||m[w].listener===f){J=m[w].listener,O=w;break}if(O<0)return this;O===0?m.shift():re(m,O),m.length===1&&(y[u]=m[0]),y.removeListener!==void 0&&this.emit("removeListener",u,J||f)}return this},g.prototype.off=g.prototype.removeListener,g.prototype.removeAllListeners=function(u){var f,m,y;if(m=this._events,m===void 0)return this;if(m.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):m[u]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete m[u]),this;if(arguments.length===0){var O=Object.keys(m),w;for(y=0;y<O.length;++y)w=O[y],w!=="removeListener"&&this.removeAllListeners(w);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(f=m[u],typeof f=="function")this.removeListener(u,f);else if(f!==void 0)for(y=f.length-1;y>=0;y--)this.removeListener(u,f[y]);return this};function Q(h,u,f){var m=h._events;if(m===void 0)return[];var y=m[u];return y===void 0?[]:typeof y=="function"?f?[y.listener||y]:[y]:f?Y(y):ae(y,y.length)}g.prototype.listeners=function(u){return Q(this,u,!0)},g.prototype.rawListeners=function(u){return Q(this,u,!1)},g.listenerCount=function(h,u){return typeof h.listenerCount=="function"?h.listenerCount(u):te.call(h,u)},g.prototype.listenerCount=te;function te(h){var u=this._events;if(u!==void 0){var f=u[h];if(typeof f=="function")return 1;if(f!==void 0)return f.length}return 0}g.prototype.eventNames=function(){return this._eventsCount>0?B(this._events):[]};function ae(h,u){for(var f=new Array(u),m=0;m<u;++m)f[m]=h[m];return f}function re(h,u){for(;u+1<h.length;u++)h[u]=h[u+1];h.pop()}function Y(h){for(var u=new Array(h.length),f=0;f<u.length;++f)u[f]=h[f].listener||h[f];return u}function oe(h,u){return new Promise(function(f,m){function y(w){h.removeListener(u,O),m(w)}function O(){typeof h.removeListener=="function"&&h.removeListener("error",y),f([].slice.call(arguments))}W(h,u,O,{once:!0}),u!=="error"&&q(h,y,{once:!0})})}function q(h,u,f){typeof h.on=="function"&&W(h,"error",u,f)}function W(h,u,f,m){if(typeof h.on=="function")m.once?h.once(u,f):h.on(u,f);else if(typeof h.addEventListener=="function")h.addEventListener(u,function y(O){m.once&&h.removeEventListener(u,y),f(O)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof h)}},666:function(L){var j=function(x){"use strict";var B=Object.prototype,A=B.hasOwnProperty,T,g=typeof Symbol=="function"?Symbol:{},G=g.iterator||"@@iterator",H=g.asyncIterator||"@@asyncIterator",R=g.toStringTag||"@@toStringTag";function U(p,d,_){return Object.defineProperty(p,d,{value:_,enumerable:!0,configurable:!0,writable:!0}),p[d]}try{U({},"")}catch(p){U=function(d,_,M){return d[_]=M}}function I(p,d,_,M){var E=d&&d.prototype instanceof oe?d:oe,$=Object.create(E.prototype),ee=new ne(M||[]);return $._invoke=w(p,_,ee),$}x.wrap=I;function c(p,d,_){try{return{type:"normal",arg:p.call(d,_)}}catch(M){return{type:"throw",arg:M}}}var Q="suspendedStart",te="suspendedYield",ae="executing",re="completed",Y={};function oe(){}function q(){}function W(){}var h={};U(h,G,function(){return this});var u=Object.getPrototypeOf,f=u&&u(u(ve([])));f&&f!==B&&A.call(f,G)&&(h=f);var m=W.prototype=oe.prototype=Object.create(h);q.prototype=W,U(m,"constructor",W),U(W,"constructor",q),q.displayName=U(W,R,"GeneratorFunction");function y(p){["next","throw","return"].forEach(function(d){U(p,d,function(_){return this._invoke(d,_)})})}x.isGeneratorFunction=function(p){var d=typeof p=="function"&&p.constructor;return d?d===q||(d.displayName||d.name)==="GeneratorFunction":!1},x.mark=function(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,W):(p.__proto__=W,U(p,R,"GeneratorFunction")),p.prototype=Object.create(m),p},x.awrap=function(p){return{__await:p}};function O(p,d){function _($,ee,ie,ue){var se=c(p[$],p,ee);if(se.type==="throw")ue(se.arg);else{var me=se.arg,pe=me.value;return pe&&typeof pe=="object"&&A.call(pe,"__await")?d.resolve(pe.__await).then(function(fe){_("next",fe,ie,ue)},function(fe){_("throw",fe,ie,ue)}):d.resolve(pe).then(function(fe){me.value=fe,ie(me)},function(fe){return _("throw",fe,ie,ue)})}}var M;function E($,ee){function ie(){return new d(function(ue,se){_($,ee,ue,se)})}return M=M?M.then(ie,ie):ie()}this._invoke=E}y(O.prototype),U(O.prototype,H,function(){return this}),x.AsyncIterator=O,x.async=function(p,d,_,M,E){E===void 0&&(E=Promise);var $=new O(I(p,d,_,M),E);return x.isGeneratorFunction(d)?$:$.next().then(function(ee){return ee.done?ee.value:$.next()})};function w(p,d,_){var M=Q;return function($,ee){if(M===ae)throw new Error("Generator is already running");if(M===re){if($==="throw")throw ee;return Se()}for(_.method=$,_.arg=ee;;){var ie=_.delegate;if(ie){var ue=J(ie,_);if(ue){if(ue===Y)continue;return ue}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(M===Q)throw M=re,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);M=ae;var se=c(p,d,_);if(se.type==="normal"){if(M=_.done?re:te,se.arg===Y)continue;return{value:se.arg,done:_.done}}else se.type==="throw"&&(M=re,_.method="throw",_.arg=se.arg)}}}function J(p,d){var _=p.iterator[d.method];if(_===T){if(d.delegate=null,d.method==="throw"){if(p.iterator.return&&(d.method="return",d.arg=T,J(p,d),d.method==="throw"))return Y;d.method="throw",d.arg=new TypeError("The iterator does not provide a 'throw' method")}return Y}var M=c(_,p.iterator,d.arg);if(M.type==="throw")return d.method="throw",d.arg=M.arg,d.delegate=null,Y;var E=M.arg;if(!E)return d.method="throw",d.arg=new TypeError("iterator result is not an object"),d.delegate=null,Y;if(E.done)d[p.resultName]=E.value,d.next=p.nextLoc,d.method!=="return"&&(d.method="next",d.arg=T);else return E;return d.delegate=null,Y}y(m),U(m,R,"Generator"),U(m,G,function(){return this}),U(m,"toString",function(){return"[object Generator]"});function V(p){var d={tryLoc:p[0]};1 in p&&(d.catchLoc=p[1]),2 in p&&(d.finallyLoc=p[2],d.afterLoc=p[3]),this.tryEntries.push(d)}function Z(p){var d=p.completion||{};d.type="normal",delete d.arg,p.completion=d}function ne(p){this.tryEntries=[{tryLoc:"root"}],p.forEach(V,this),this.reset(!0)}x.keys=function(p){var d=[];for(var _ in p)d.push(_);return d.reverse(),function M(){for(;d.length;){var E=d.pop();if(E in p)return M.value=E,M.done=!1,M}return M.done=!0,M}};function ve(p){if(p){var d=p[G];if(d)return d.call(p);if(typeof p.next=="function")return p;if(!isNaN(p.length)){var _=-1,M=function E(){for(;++_<p.length;)if(A.call(p,_))return E.value=p[_],E.done=!1,E;return E.value=T,E.done=!0,E};return M.next=M}}return{next:Se}}x.values=ve;function Se(){return{value:T,done:!0}}return ne.prototype={constructor:ne,reset:function(p){if(this.prev=0,this.next=0,this.sent=this._sent=T,this.done=!1,this.delegate=null,this.method="next",this.arg=T,this.tryEntries.forEach(Z),!p)for(var d in this)d.charAt(0)==="t"&&A.call(this,d)&&!isNaN(+d.slice(1))&&(this[d]=T)},stop:function(){this.done=!0;var p=this.tryEntries[0],d=p.completion;if(d.type==="throw")throw d.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var d=this;function _(ue,se){return $.type="throw",$.arg=p,d.next=ue,se&&(d.method="next",d.arg=T),!!se}for(var M=this.tryEntries.length-1;M>=0;--M){var E=this.tryEntries[M],$=E.completion;if(E.tryLoc==="root")return _("end");if(E.tryLoc<=this.prev){var ee=A.call(E,"catchLoc"),ie=A.call(E,"finallyLoc");if(ee&&ie){if(this.prev<E.catchLoc)return _(E.catchLoc,!0);if(this.prev<E.finallyLoc)return _(E.finallyLoc)}else if(ee){if(this.prev<E.catchLoc)return _(E.catchLoc,!0)}else if(ie){if(this.prev<E.finallyLoc)return _(E.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(p,d){for(var _=this.tryEntries.length-1;_>=0;--_){var M=this.tryEntries[_];if(M.tryLoc<=this.prev&&A.call(M,"finallyLoc")&&this.prev<M.finallyLoc){var E=M;break}}E&&(p==="break"||p==="continue")&&E.tryLoc<=d&&d<=E.finallyLoc&&(E=null);var $=E?E.completion:{};return $.type=p,$.arg=d,E?(this.method="next",this.next=E.finallyLoc,Y):this.complete($)},complete:function(p,d){if(p.type==="throw")throw p.arg;return p.type==="break"||p.type==="continue"?this.next=p.arg:p.type==="return"?(this.rval=this.arg=p.arg,this.method="return",this.next="end"):p.type==="normal"&&d&&(this.next=d),Y},finish:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var _=this.tryEntries[d];if(_.finallyLoc===p)return this.complete(_.completion,_.afterLoc),Z(_),Y}},catch:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var _=this.tryEntries[d];if(_.tryLoc===p){var M=_.completion;if(M.type==="throw"){var E=M.arg;Z(_)}return E}}throw new Error("illegal catch attempt")},delegateYield:function(p,d,_){return this.delegate={iterator:ve(p),resultName:d,nextLoc:_},this.method==="next"&&(this.arg=T),Y}},x}(L.exports);try{regeneratorRuntime=j}catch(x){typeof globalThis=="object"?globalThis.regeneratorRuntime=j:Function("r","regeneratorRuntime = r")(j)}},182:function(L,j,x){x.d(j,{Z:function(){return B}});function B(A){if(A.geometry&&A.geometry.dispose(),A.material){var T=Array.isArray(A.material)?A.material:[A.material];T.forEach(function(g){var G,H,R,U,I,c,Q,te,ae,re,Y,oe,q;(G=g.map)===null||G===void 0||G.dispose(),(H=g.lightMap)===null||H===void 0||H.dispose(),(R=g.bumpMap)===null||R===void 0||R.dispose(),(U=g.normalMap)===null||U===void 0||U.dispose(),(I=g.specularMap)===null||I===void 0||I.dispose(),(c=g.envMap)===null||c===void 0||c.dispose(),(Q=g.alphaMap)===null||Q===void 0||Q.dispose(),(te=g.aoMap)===null||te===void 0||te.dispose(),(ae=g.displacementMap)===null||ae===void 0||ae.dispose(),(re=g.emissiveMap)===null||re===void 0||re.dispose(),(Y=g.gradientMap)===null||Y===void 0||Y.dispose(),(oe=g.metalnessMap)===null||oe===void 0||oe.dispose(),(q=g.roughnessMap)===null||q===void 0||q.dispose(),g.dispose()})}}},175:function(L,j,x){x.d(j,{wf:function(){return g.Z},PO:function(){return R.Z}});var B=x(666),A=x.n(B),T=null,g=x(182),G=x(949);function H(W){if(W.material){var h=Array.isArray(W.material)?W.material:[W.material];h.forEach(function(u){var f,m;(f=u.color)===null||f===void 0||f.convertSRGBToLinear(),(m=u.emissive)===null||m===void 0||m.convertSRGBToLinear(),u.map&&(u.map.encoding=THREE.sRGBEncoding),u.emissiveMap&&(u.emissiveMap.encoding=THREE.sRGBEncoding)})}}var R=x(975),U=x(568),I=x(924),c=W=>{var h={};return x.d(h,W),h},Q=W=>()=>W,te=c({get:()=>Ne.get,set:()=>Ne.set}),ae=x(620),re=null,Y=null,oe=function(){var W=(0,U.Z)(A().mark(function h(u,f){var m,y,O,w,J,V;return A().wrap(function(ne){for(;;)switch(ne.prev=ne.next){case 0:return m=f.version,ne.next=4,(0,te.get)(u);case 4:if(O=ne.sent,!(O&&O[m])){ne.next=9;break}y=O[m],ne.next=15;break;case 9:return ne.next=11,(0,ae.Z)(fetch(u).then(function(ve){if(ve.ok)return ve.blob();throw new Error}));case 11:w=ne.sent,J=w.res,V=w.err,V||(y=J,(0,te.set)(u,(0,I.Z)({},m,J)));case 15:return ne.abrupt("return",y?{url:URL.createObjectURL(y)}:{url:u});case 16:case"end":return ne.stop()}},h)}));return function(u,f){return W.apply(this,arguments)}}(),q=x(977)},975:function(L,j,x){x.d(j,{Z:function(){return A}});function B(T){return Object.prototype.toString.call(T)==="[object Object]"}function A(T){if(B(T)===!1)return!1;var g=T.constructor;if(g===void 0)return!0;var G=g.prototype;return!(B(G)===!1||G.hasOwnProperty("isPrototypeOf")===!1)}},620:function(L,j,x){x.d(j,{Z:function(){return A}});var B=x(42);function A(T){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return T.then(function(G){return(0,B.Z)({err:null,res:G},g)}).catch(function(G){return(0,B.Z)({err:G,res:void 0},g)})}},977:function(L,j,x){var B=x(949),A=new Map,T=function(G){return{generateTopUV:function(H,R,U,I,c){var Q=R[U*3],te=R[U*3+1],ae=R[I*3],re=R[I*3+1],Y=R[c*3],oe=R[c*3+1],q;if(A.has(H))q=A.get(H);else{var W=G&&G.box3||new THREE.Box3;if(!G||!G.box3){var h=H.parameters.shapes.getPoints();W.setFromArray(h.map(function(y){return[y.x,y.y,0]}).flat())}var u=W.getSize(new THREE.Vector3);q={box:W,size:u},A.set(H,q)}var f=q.box,m=q.size;return[new THREE.Vector2((Q-f.min.x)/m.x,(te-f.min.y)/m.y),new THREE.Vector2((ae-f.min.x)/m.x,(re-f.min.y)/m.y),new THREE.Vector2((Y-f.min.x)/m.x,(oe-f.min.y)/m.y)]},generateSideWallUV:function(H,R,U,I,c,Q){var te=R[U*3],ae=R[U*3+1],re=R[U*3+2],Y=R[I*3],oe=R[I*3+1],q=R[I*3+2],W=R[c*3],h=R[c*3+1],u=R[c*3+2],f=R[Q*3],m=R[Q*3+1],y=R[Q*3+2],O;if(A.has(R))O=A.get(R);else{var w=new THREE.Box3;w.setFromArray(R);var J=w.getSize(new THREE.Vector3);O={box:w,size:J},A.set(R,O)}var V=O.box,Z=O.size;return Math.abs(ae-oe)<.01?[new THREE.Vector2((te-V.min.x)/Z.x,(re-V.min.z)/Z.z),new THREE.Vector2((Y-V.min.x)/Z.x,(q-V.min.z)/Z.z),new THREE.Vector2((W-V.min.x)/Z.x,(u-V.min.z)/Z.z),new THREE.Vector2((f-V.min.x)/Z.x,(y-V.min.z)/Z.z)]:[new THREE.Vector2((ae-V.min.y)/Z.x,(re-V.min.z)/Z.z),new THREE.Vector2((oe-V.min.y)/Z.x,(q-V.min.z)/Z.z),new THREE.Vector2((h-V.min.y)/Z.x,(u-V.min.z)/Z.z),new THREE.Vector2((m-V.min.y)/Z.x,(y-V.min.z)/Z.z)]}}},g=function(){A.clear()}},949:function(L,j,x){var B=T=>{var g={};return x.d(g,T),g},A=T=>()=>T;L.exports=B({ACESFilmicToneMapping:()=>z.ACESFilmicToneMapping,AdditiveBlending:()=>z.AdditiveBlending,AxesHelper:()=>z.AxesHelper,Box3:()=>z.Box3,Camera:()=>z.Camera,CineonToneMapping:()=>z.CineonToneMapping,Clock:()=>z.Clock,Color:()=>z.Color,Euler:()=>z.Euler,Group:()=>z.Group,Layers:()=>z.Layers,LinearEncoding:()=>z.LinearEncoding,LinearFilter:()=>z.LinearFilter,LinearToneMapping:()=>z.LinearToneMapping,Matrix4:()=>z.Matrix4,Mesh:()=>z.Mesh,MeshBasicMaterial:()=>z.MeshBasicMaterial,NoToneMapping:()=>z.NoToneMapping,PerspectiveCamera:()=>z.PerspectiveCamera,PlaneGeometry:()=>z.PlaneGeometry,Points:()=>z.Points,REVISION:()=>z.REVISION,RGBAFormat:()=>z.RGBAFormat,Raycaster:()=>z.Raycaster,ReinhardToneMapping:()=>z.ReinhardToneMapping,Scene:()=>z.Scene,ShaderMaterial:()=>z.ShaderMaterial,Sprite:()=>z.Sprite,SpriteMaterial:()=>z.SpriteMaterial,UniformsUtils:()=>z.UniformsUtils,UnsignedByteType:()=>z.UnsignedByteType,Vector2:()=>z.Vector2,Vector3:()=>z.Vector3,WebGLMultisampleRenderTarget:()=>z.WebGLMultisampleRenderTarget,WebGLRenderTarget:()=>z.WebGLRenderTarget,WebGLRenderer:()=>z.WebGLRenderer,sRGBEncoding:()=>z.sRGBEncoding})},568:function(L,j,x){x.d(j,{Z:function(){return A}});function B(T,g,G,H,R,U,I){try{var c=T[U](I),Q=c.value}catch(te){G(te);return}c.done?g(Q):Promise.resolve(Q).then(H,R)}function A(T){return function(){var g=this,G=arguments;return new Promise(function(H,R){var U=T.apply(g,G);function I(Q){B(U,H,R,I,c,"next",Q)}function c(Q){B(U,H,R,I,c,"throw",Q)}I(void 0)})}}},924:function(L,j,x){x.d(j,{Z:function(){return B}});function B(A,T,g){return T in A?Object.defineProperty(A,T,{value:g,enumerable:!0,configurable:!0,writable:!0}):A[T]=g,A}},42:function(L,j,x){x.d(j,{Z:function(){return A}});var B=x(924);function A(T){for(var g=1;g<arguments.length;g++){var G=arguments[g]!=null?arguments[g]:{},H=Object.keys(G);typeof Object.getOwnPropertySymbols=="function"&&(H=H.concat(Object.getOwnPropertySymbols(G).filter(function(R){return Object.getOwnPropertyDescriptor(G,R).enumerable}))),H.forEach(function(R){(0,B.Z)(T,R,G[R])})}return T}}},Ie={};function F(L){var j=Ie[L];if(j!==void 0)return j.exports;var x=Ie[L]={exports:{}};return ir[L](x,x.exports,F),x.exports}(function(){F.n=function(L){var j=L&&L.__esModule?function(){return L.default}:function(){return L};return F.d(j,{a:j}),j}})(),function(){F.d=function(L,j){for(var x in j)F.o(j,x)&&!F.o(L,x)&&Object.defineProperty(L,x,{enumerable:!0,get:j[x]})}}(),function(){F.o=function(L,j){return Object.prototype.hasOwnProperty.call(L,j)}}();var _e={};(function(){F.d(_e,{L6:function(){return Vt},sb:function(){return f},z:function(){return Re},ZP:function(){return Re}});function L(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")}function j(n,r){for(var i=0;i<r.length;i++){var e=r[i];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(n,e.key,e)}}function x(n,r,i){return r&&j(n.prototype,r),i&&j(n,i),n}var B=F(42);function A(n,r){var i=Object.keys(n);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(n);r&&(e=e.filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})),i.push.apply(i,e)}return i}function T(n,r){return r=r!=null?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(r,i))}),n}function g(n,r){(r==null||r>n.length)&&(r=n.length);for(var i=0,e=new Array(r);i<r;i++)e[i]=n[i];return e}function G(n){if(Array.isArray(n))return g(n)}function H(n){if(typeof Symbol!="undefined"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function R(){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,r){if(!!n){if(typeof n=="string")return g(n,r);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 g(n,r)}}function I(n){return G(n)||H(n)||U(n)||R()}var c=F(949),Q=F(187),te=n=>{var r={};return F.d(r,n),r},ae=n=>()=>n,re=te({default:()=>Wt.default}),Y=n=>{var r={};return F.d(r,n),r},oe=n=>()=>n,q=Y({default:()=>It.default}),W=n=>{var r={};return F.d(r,n),r},h=n=>()=>n,u=W({default:()=>Ht.default}),f=function(){"use strict";function n(i){L(this,n),this.guiParams={},i&&(this.guiParams=i)}var r=n.prototype;return r.showGui=function(e){var t=this;!e||Object.keys(this.guiParams).forEach(function(a){var o=e.addFolder(a),l=t.guiParams[a];Object.keys(l).forEach(function(s){var v=l[s],C=v.min,P=v.max,b=v.step,S=v.name,D=v.paramMap,N=v.items,k=v.value,K=v.target,ce=s.toLowerCase().indexOf("color")>-1,X,le=typeof k=="undefined"&&K,de=le?K():l[s],he=le?s:"value";N?X=o.add(de,he,N):ce?X=o.addColor(de,he):X=o.add(de,he),X=X.name(S||s),typeof C!="undefined"&&(X=X.min(C)),typeof P!="undefined"&&(X=X.max(P)),typeof b!="undefined"&&(X=X.step(b)),X=X.onChange(function(){t.setTargetValue(a,s,de[he],D)}),le&&X.listen()})})},r.setTargetValue=function(e,t,a,o){var l=this.guiParams[e][t],s=l.onChange,v=l.target,C=l.value,P=t.toLowerCase().indexOf("color")>-1,b=typeof C=="undefined"&&v;if(v&&!b){var S=v();Array.isArray(S)||(S=[S]),S.forEach(function(D){if(!!D)if(P)try{D[o||t].set(a)}catch(N){t!=="color"&&!o&&console.warn("".concat(t," is not a color,set paramMap"))}else D[o||t]=a})}s&&s(a)},r.setTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(t){Object.keys(e.guiParams[t]).forEach(function(a){var o=e.guiParams[t][a];typeof o.value!="undefined"&&e.setTargetValue(t,a,o.value,o.paramMap)})})},n}(),m={None:c.NoToneMapping,Linear:c.LinearToneMapping,Reinhard:c.ReinhardToneMapping,Cineon:c.CineonToneMapping,ACESFilmic:c.ACESFilmicToneMapping},y={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:c.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1,context:null},O=function(){"use strict";function n(i){L(this,n),this.options=i;var e=i.width,t=i.height,a=i.rendererParams,o=a.context,l=a.alpha,s=a.devicePixelRatio,v=a.antialias,C=a.powerPreference,P=a.toneMapping,b=a.toneMappingExposure,S=a.outputEncoding,D=a.logarithmicDepthBuffer,N=a.preserveDrawingBuffer,k=new c.WebGLRenderer({context:o,alpha:l,antialias:v,powerPreference:C,logarithmicDepthBuffer:D,preserveDrawingBuffer:N});k.setSize(e,t),k.setPixelRatio(s),k.autoClear=!1,k.toneMapping=m[P],k.toneMappingExposure=b,k.outputEncoding=S,this.renderer=k}var r=n.prototype;return r.setSize=function(e,t){this.renderer.setSize(e,t)},r.render=function(){var e=this.options,t=e.scene,a=e.camera;this.renderer.render(t,a)},r.setGui=function(e){var t=this,a=new f({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:m,target:function(){return t.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return t.renderer}}}});a.showGui(e)},r.dispose=function(){var e,t,a;(e=this.renderer)===null||e===void 0||e.clear(),(t=this.renderer)===null||t===void 0||t.dispose(),(a=this.renderer)===null||a===void 0||a.renderLists.dispose()},n}(),w={fov:45,near:1,far:1e3},J=function(){"use strict";function n(i){L(this,n),this.oldCameraPosition=new c.Vector3,this.oldCameraRotation=new c.Euler,this.customCamera=!1,this.options=i;var e=i.width,t=i.height,a=i.cameraParams;if(a instanceof c.Camera)this.camera=a,this.customCamera=!0;else{var o=a.fov,l=a.far,s=a.near,v=new c.PerspectiveCamera(o,e/t,s,l);v.position.set(0,0,400),v.lookAt(0,0,0),this.camera=v}}var r=n.prototype;return r.checkCameraChange=function(){var e=this.camera,t=this.oldCameraPosition.equals(e.position)&&this.oldCameraRotation.equals(e.rotation);return this.oldCameraPosition=e.position.clone(),this.oldCameraRotation=e.rotation.clone(),!t},r.setSize=function(e,t){this.camera instanceof c.PerspectiveCamera&&(this.camera.aspect=e/t),this.camera.updateProjectionMatrix()},r.setGui=function(e){var t=this,a=new f({camera:{x:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},y:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},z:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},near:{min:0,max:1e3,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}}}});this.camera instanceof c.PerspectiveCamera&&(a.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}}),a.showGui(e)},n}(),V=F(175),Z={background:null},ne=function(){"use strict";function n(i){L(this,n),this.options=i;var e=i.camera,t=i.sceneParams,a=t.background,o=new c.Scene;a&&(o.background=a),o.add(e),this.scene=o}var r=n.prototype;return r.addAxesHelper=function(){var e,t=new c.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(t)},r.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(t){(0,V.wf)(t)})},n}(),ve=n=>{var r={};return F.d(r,n),r},Se=n=>()=>n,p=ve({MapControls:()=>ke.MapControls,OrbitControls:()=>ke.OrbitControls}),d={},_=function(){"use strict";function n(i){L(this,n),this.options=i;var e=i.camera,t=i.controlParams,a=i.mapControl,o=t.domElement,l=a?new p.MapControls(e,o):new p.OrbitControls(e,o);l.minPolarAngle=Math.PI*.15,l.maxPolarAngle=Math.PI*.85,l.enableDamping=!0,l.dampingFactor=.063,l.autoRotate=!1,l.autoRotateSpeed=-60,l.enableZoom=!0,l.zoomSpeed=.2,this.control=l}var r=n.prototype;return r.limitPan=function(e){var t=e.maxX,a=t===void 0?1/0:t,o=e.minX,l=o===void 0?-1/0:o,s=e.maxZ,v=s===void 0?1/0:s,C=e.minZ,P=C===void 0?-1/0:C,b=e.maxY,S=b===void 0?1/0:b,D=e.minY,N=D===void 0?-1/0:D,k=this.limitPanV||new c.Vector3,K=this.control,ce=this.options.camera,X=new c.Vector3(l,N,P),le=new c.Vector3(a,S,v);this.limitPanV=k,k.copy(K.target),K.target.clamp(X,le),k.sub(K.target),ce.position.sub(k)},r.update=function(){this.control.update()},r.dispose=function(){this.control.dispose()},n}(),M=n=>{var r={};return F.d(r,n),r},E=n=>()=>n,$=M({CSS3DObject:()=>Me.CSS3DObject,CSS3DRenderer:()=>Me.CSS3DRenderer,CSS3DSprite:()=>Me.CSS3DSprite}),ee=new c.Vector3,ie=new c.Matrix4,ue=new c.Matrix4,se=new c.Vector3,me=new c.Vector3,pe=function n(){"use strict";var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};L(this,n);var i=function(D,N){return se.setFromMatrixPosition(D.matrixWorld),me.setFromMatrixPosition(N.matrixWorld),se.distanceToSquared(me)},e=function(D){var N=[];return D.traverse(function(k){k.isCSS2DObject&&N.push(k)}),N},t=function(D){for(var N=e(D).sort(function(le,de){if(le.renderOrder!==de.renderOrder)return de.renderOrder-le.renderOrder;var he=C.objects.get(le).distanceToCameraSquared,ye=C.objects.get(de).distanceToCameraSquared;return he-ye}),k=N.length,K=0,ce=N.length;K<ce;K++){var X=N[K].userData.zIndexFix||0;N[K].element.style.zIndex=k-K+X}},a=this,o,l,s,v,C={objects:new WeakMap},P=r.element!==void 0?r.element:document.createElement("div");P.style.overflow="hidden",this.domElement=P,this.getSize=function(){return{width:o,height:l}},this.render=function(S,D){S.autoUpdate===!0&&S.updateMatrixWorld(),D.parent===null&&D.updateMatrixWorld(),ie.copy(D.matrixWorldInverse),ue.multiplyMatrices(D.projectionMatrix,ie),b(S,S,D),t(S)},this.setSize=function(S,D){o=S,l=D,s=o/2,v=l/2,P.style.width="".concat(S,"px"),P.style.height="".concat(D,"px")};function b(S,D,N){if(S.isCSS2DObject){ee.setFromMatrixPosition(S.matrixWorld),ee.applyMatrix4(ue);var k=S.visible===!0&&ee.z>=-1&&ee.z<=1&&S.layers.test(N.layers)===!0;if(S.element.style.display=k===!0?"":"none",k===!0){S.onBeforeRender(a,D,N);var K=S.element;K.style.transform="translate(-50%,-50%) translate(".concat(ee.x*s+s,"px,").concat(-ee.y*v+v,"px)"),K.parentNode!==P&&P.appendChild(K),S.onAfterRender(a,D,N)}var ce={distanceToCameraSquared:i(N,S)};C.objects.set(S,ce)}for(var X=0,le=S.children.length;X<le;X++)b(S.children[X],D,N)}},fe={zIndex:"auto"},He=function(){"use strict";function n(i){L(this,n),this.container=i}var r=n.prototype;return r.addRenderer=function(e,t){var a=this.container,o=a.offsetWidth,l=a.offsetHeight,s=e==="css2d"?new pe:new $.CSS3DRenderer;s.domElement.style.position="absolute",s.domElement.style.top="0",s.domElement.style.pointerEvents="none",s.domElement.style.zIndex=t.zIndex,s.setSize(o,l),a.appendChild(s.domElement),e==="css2d"?this.css2Drenderer=s:e==="css3d"&&(this.css3Drenderer=s)},r.setSize=function(e,t){var a,o;(a=this.css2Drenderer)===null||a===void 0||a.setSize(e,t),(o=this.css3Drenderer)===null||o===void 0||o.setSize(e,t)},r.render=function(e,t){var a,o;(a=this.css2Drenderer)===null||a===void 0||a.render(e,t),(o=this.css3Drenderer)===null||o===void 0||o.render(e,t)},r.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},n}(),Xe=n=>{var r={};return F.d(r,n),r},cr=n=>()=>n,Te=Xe({EffectComposer:()=>Xt.EffectComposer}),Ke=n=>{var r={};return F.d(r,n),r},fr=n=>()=>n,Ze=Ke({RenderPass:()=>Kt.RenderPass}),Qe=n=>{var r={};return F.d(r,n),r},dr=n=>()=>n,be=Qe({ShaderPass:()=>Zt.ShaderPass}),Ye=n=>{var r={};return F.d(r,n),r},hr=n=>()=>n,xe=Ye({CopyShader:()=>Qt.CopyShader}),$e=n=>{var r={};return F.d(r,n),r},vr=n=>()=>n,Je=$e({GammaCorrectionShader:()=>Yt.GammaCorrectionShader}),qe=n=>{var r={};return F.d(r,n),r},pr=n=>()=>n,et=qe({SMAAPass:()=>$t.SMAAPass}),tt=n=>{var r={};return F.d(r,n),r},mr=n=>()=>n,rt=tt({SSAARenderPass:()=>Jt.SSAARenderPass}),nt=n=>{var r={};return F.d(r,n),r},gr=n=>()=>n,at=nt({FXAAShader:()=>qt.FXAAShader}),it=function(){try{var n=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&n.getContext("webgl2"))}catch(r){return!1}},_r=0,st=1,ge=!1,Le=it()!==!1,ot=`varying vec2 vUv;
2
2
 
3
3
  void main() {
4
4
 
@@ -1,4 +1,4 @@
1
- (function(){var $e={666:function(C){var z=function(w){"use strict";var S=Object.prototype,A=S.hasOwnProperty,L,O=typeof Symbol=="function"?Symbol:{},W=O.iterator||"@@iterator",U=O.asyncIterator||"@@asyncIterator",R=O.toStringTag||"@@toStringTag";function y(l,s,h){return Object.defineProperty(l,s,{value:h,enumerable:!0,configurable:!0,writable:!0}),l[s]}try{y({},"")}catch(l){y=function(s,h,P){return s[h]=P}}function F(l,s,h,P){var b=s&&s.prototype instanceof X?s:X,G=Object.create(b.prototype),ee=new $(P||[]);return G._invoke=fe(l,h,ee),G}w.wrap=F;function I(l,s,h){try{return{type:"normal",arg:l.call(s,h)}}catch(P){return{type:"throw",arg:P}}}var T="suspendedStart",u="suspendedYield",ue="executing",Y="completed",E={};function X(){}function j(){}function k(){}var Z={};y(Z,W,function(){return this});var re=Object.getPrototypeOf,J=re&&re(re(he([])));J&&J!==S&&A.call(J,W)&&(Z=J);var N=k.prototype=X.prototype=Object.create(Z);j.prototype=k,y(N,"constructor",k),y(k,"constructor",j),j.displayName=y(k,R,"GeneratorFunction");function D(l){["next","throw","return"].forEach(function(s){y(l,s,function(h){return this._invoke(s,h)})})}w.isGeneratorFunction=function(l){var s=typeof l=="function"&&l.constructor;return s?s===j||(s.displayName||s.name)==="GeneratorFunction":!1},w.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,k):(l.__proto__=k,y(l,R,"GeneratorFunction")),l.prototype=Object.create(N),l},w.awrap=function(l){return{__await:l}};function ae(l,s){function h(G,ee,ne,oe){var ie=I(l[G],l,ee);if(ie.type==="throw")oe(ie.arg);else{var Ae=ie.arg,_e=Ae.value;return _e&&typeof _e=="object"&&A.call(_e,"__await")?s.resolve(_e.__await).then(function(te){h("next",te,ne,oe)},function(te){h("throw",te,ne,oe)}):s.resolve(_e).then(function(te){Ae.value=te,ne(Ae)},function(te){return h("throw",te,ne,oe)})}}var P;function b(G,ee){function ne(){return new s(function(oe,ie){h(G,ee,oe,ie)})}return P=P?P.then(ne,ne):ne()}this._invoke=b}D(ae.prototype),y(ae.prototype,U,function(){return this}),w.AsyncIterator=ae,w.async=function(l,s,h,P,b){b===void 0&&(b=Promise);var G=new ae(F(l,s,h,P),b);return w.isGeneratorFunction(s)?G:G.next().then(function(ee){return ee.done?ee.value:G.next()})};function fe(l,s,h){var P=T;return function(G,ee){if(P===ue)throw new Error("Generator is already running");if(P===Y){if(G==="throw")throw ee;return ze()}for(h.method=G,h.arg=ee;;){var ne=h.delegate;if(ne){var oe=Q(ne,h);if(oe){if(oe===E)continue;return oe}}if(h.method==="next")h.sent=h._sent=h.arg;else if(h.method==="throw"){if(P===T)throw P=Y,h.arg;h.dispatchException(h.arg)}else h.method==="return"&&h.abrupt("return",h.arg);P=ue;var ie=I(l,s,h);if(ie.type==="normal"){if(P=h.done?Y:u,ie.arg===E)continue;return{value:ie.arg,done:h.done}}else ie.type==="throw"&&(P=Y,h.method="throw",h.arg=ie.arg)}}}function Q(l,s){var h=l.iterator[s.method];if(h===L){if(s.delegate=null,s.method==="throw"){if(l.iterator.return&&(s.method="return",s.arg=L,Q(l,s),s.method==="throw"))return E;s.method="throw",s.arg=new TypeError("The iterator does not provide a 'throw' method")}return E}var P=I(h,l.iterator,s.arg);if(P.type==="throw")return s.method="throw",s.arg=P.arg,s.delegate=null,E;var b=P.arg;if(!b)return s.method="throw",s.arg=new TypeError("iterator result is not an object"),s.delegate=null,E;if(b.done)s[l.resultName]=b.value,s.next=l.nextLoc,s.method!=="return"&&(s.method="next",s.arg=L);else return b;return s.delegate=null,E}D(N),y(N,R,"Generator"),y(N,W,function(){return this}),y(N,"toString",function(){return"[object Generator]"});function me(l){var s={tryLoc:l[0]};1 in l&&(s.catchLoc=l[1]),2 in l&&(s.finallyLoc=l[2],s.afterLoc=l[3]),this.tryEntries.push(s)}function K(l){var s=l.completion||{};s.type="normal",delete s.arg,l.completion=s}function $(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(me,this),this.reset(!0)}w.keys=function(l){var s=[];for(var h in l)s.push(h);return s.reverse(),function P(){for(;s.length;){var b=s.pop();if(b in l)return P.value=b,P.done=!1,P}return P.done=!0,P}};function he(l){if(l){var s=l[W];if(s)return s.call(l);if(typeof l.next=="function")return l;if(!isNaN(l.length)){var h=-1,P=function b(){for(;++h<l.length;)if(A.call(l,h))return b.value=l[h],b.done=!1,b;return b.value=L,b.done=!0,b};return P.next=P}}return{next:ze}}w.values=he;function ze(){return{value:L,done:!0}}return $.prototype={constructor:$,reset:function(l){if(this.prev=0,this.next=0,this.sent=this._sent=L,this.done=!1,this.delegate=null,this.method="next",this.arg=L,this.tryEntries.forEach(K),!l)for(var s in this)s.charAt(0)==="t"&&A.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=L)},stop:function(){this.done=!0;var l=this.tryEntries[0],s=l.completion;if(s.type==="throw")throw s.arg;return this.rval},dispatchException:function(l){if(this.done)throw l;var s=this;function h(oe,ie){return G.type="throw",G.arg=l,s.next=oe,ie&&(s.method="next",s.arg=L),!!ie}for(var P=this.tryEntries.length-1;P>=0;--P){var b=this.tryEntries[P],G=b.completion;if(b.tryLoc==="root")return h("end");if(b.tryLoc<=this.prev){var ee=A.call(b,"catchLoc"),ne=A.call(b,"finallyLoc");if(ee&&ne){if(this.prev<b.catchLoc)return h(b.catchLoc,!0);if(this.prev<b.finallyLoc)return h(b.finallyLoc)}else if(ee){if(this.prev<b.catchLoc)return h(b.catchLoc,!0)}else if(ne){if(this.prev<b.finallyLoc)return h(b.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(l,s){for(var h=this.tryEntries.length-1;h>=0;--h){var P=this.tryEntries[h];if(P.tryLoc<=this.prev&&A.call(P,"finallyLoc")&&this.prev<P.finallyLoc){var b=P;break}}b&&(l==="break"||l==="continue")&&b.tryLoc<=s&&s<=b.finallyLoc&&(b=null);var G=b?b.completion:{};return G.type=l,G.arg=s,b?(this.method="next",this.next=b.finallyLoc,E):this.complete(G)},complete:function(l,s){if(l.type==="throw")throw l.arg;return l.type==="break"||l.type==="continue"?this.next=l.arg:l.type==="return"?(this.rval=this.arg=l.arg,this.method="return",this.next="end"):l.type==="normal"&&s&&(this.next=s),E},finish:function(l){for(var s=this.tryEntries.length-1;s>=0;--s){var h=this.tryEntries[s];if(h.finallyLoc===l)return this.complete(h.completion,h.afterLoc),K(h),E}},catch:function(l){for(var s=this.tryEntries.length-1;s>=0;--s){var h=this.tryEntries[s];if(h.tryLoc===l){var P=h.completion;if(P.type==="throw"){var b=P.arg;K(h)}return b}}throw new Error("illegal catch attempt")},delegateYield:function(l,s,h){return this.delegate={iterator:he(l),resultName:s,nextLoc:h},this.method==="next"&&(this.arg=L),E}},w}(C.exports);try{regeneratorRuntime=z}catch(w){typeof globalThis=="object"?globalThis.regeneratorRuntime=z:Function("r","regeneratorRuntime = r")(z)}},182:function(C,z,w){"use strict";w.d(z,{Z:function(){return S}});function S(A){if(A.geometry&&A.geometry.dispose(),A.material){var L=Array.isArray(A.material)?A.material:[A.material];L.forEach(function(O){var W,U,R,y,F,I,T,u,ue,Y,E,X,j;(W=O.map)===null||W===void 0||W.dispose(),(U=O.lightMap)===null||U===void 0||U.dispose(),(R=O.bumpMap)===null||R===void 0||R.dispose(),(y=O.normalMap)===null||y===void 0||y.dispose(),(F=O.specularMap)===null||F===void 0||F.dispose(),(I=O.envMap)===null||I===void 0||I.dispose(),(T=O.alphaMap)===null||T===void 0||T.dispose(),(u=O.aoMap)===null||u===void 0||u.dispose(),(ue=O.displacementMap)===null||ue===void 0||ue.dispose(),(Y=O.emissiveMap)===null||Y===void 0||Y.dispose(),(E=O.gradientMap)===null||E===void 0||E.dispose(),(X=O.metalnessMap)===null||X===void 0||X.dispose(),(j=O.roughnessMap)===null||j===void 0||j.dispose(),O.dispose()})}}},54:function(C,z,w){"use strict";w.d(z,{disposeMesh:function(){return O.Z}});var S=w(666),A=w.n(S),L=null,O=w(182),W=w(644);function U(E){if(E.material){var X=Array.isArray(E.material)?E.material:[E.material];X.forEach(function(j){var k,Z;(k=j.color)===null||k===void 0||k.convertSRGBToLinear(),(Z=j.emissive)===null||Z===void 0||Z.convertSRGBToLinear(),j.map&&(j.map.encoding=THREE.sRGBEncoding),j.emissiveMap&&(j.emissiveMap.encoding=THREE.sRGBEncoding)})}}var R=w(568),y=w(924),F=require("idb-keyval"),I=w(620),T=null,u=null,ue=function(){var E=(0,R.Z)(A().mark(function X(j,k){var Z,re,J,N,D,ae;return A().wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Z=k.version,Q.next=4,(0,F.get)(j);case 4:if(J=Q.sent,!(J&&J[Z])){Q.next=9;break}re=J[Z],Q.next=15;break;case 9:return Q.next=11,(0,I.Z)(fetch(j).then(function(me){if(me.ok)return me.blob();throw new Error}));case 11:N=Q.sent,D=N.res,ae=N.err,ae||(re=D,(0,F.set)(j,(0,y.Z)({},Z,D)));case 15:return Q.abrupt("return",re?{url:URL.createObjectURL(re)}:{url:j});case 16:case"end":return Q.stop()}},X)}));return function(j,k){return E.apply(this,arguments)}}(),Y=w(977)},620:function(C,z,w){"use strict";w.d(z,{Z:function(){return A}});var S=w(42);function A(L){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return L.then(function(W){return(0,S.Z)({err:null,res:W},O)}).catch(function(W){return(0,S.Z)({err:W,res:void 0},O)})}},977:function(C,z,w){"use strict";w.d(z,{y:function(){return O}});var S=w(644),A=w.n(S),L=new Map,O=function(U){return{generateTopUV:function(R,y,F,I,T){var u=y[F*3],ue=y[F*3+1],Y=y[I*3],E=y[I*3+1],X=y[T*3],j=y[T*3+1],k;if(L.has(R))k=L.get(R);else{var Z=U&&U.Box3||new S.Box3;if(!U||!U.Box3){var re=R.parameters.shapes.getPoints();Z.setFromArray(re.map(function(ae){return[ae.x,ae.y,0]}).flat())}var J=Z.getSize(new S.Vector3);k={box:Z,size:J},L.set(R,k)}var N=k.box,D=k.size;return[new S.Vector2((u-N.min.x)/D.x,(ue-N.min.y)/D.y),new S.Vector2((Y-N.min.x)/D.x,(E-N.min.y)/D.y),new S.Vector2((X-N.min.x)/D.x,(j-N.min.y)/D.y)]},generateSideWallUV:function(R,y,F,I,T,u){var ue=y[F*3],Y=y[F*3+1],E=y[F*3+2],X=y[I*3],j=y[I*3+1],k=y[I*3+2],Z=y[T*3],re=y[T*3+1],J=y[T*3+2],N=y[u*3],D=y[u*3+1],ae=y[u*3+2],fe;if(L.has(y))fe=L.get(y);else{var Q=new S.Box3;Q.setFromArray(y);var me=Q.getSize(new S.Vector3);fe={box:Q,size:me},L.set(y,fe)}var K=fe.box,$=fe.size;return Math.abs(Y-j)<.01?[new S.Vector2((ue-K.min.x)/$.x,(E-K.min.z)/$.z),new S.Vector2((X-K.min.x)/$.x,(k-K.min.z)/$.z),new S.Vector2((Z-K.min.x)/$.x,(J-K.min.z)/$.z),new S.Vector2((N-K.min.x)/$.x,(ae-K.min.z)/$.z)]:[new S.Vector2((Y-K.min.y)/$.x,(E-K.min.z)/$.z),new S.Vector2((j-K.min.y)/$.x,(k-K.min.z)/$.z),new S.Vector2((re-K.min.y)/$.x,(J-K.min.z)/$.z),new S.Vector2((D-K.min.y)/$.x,(ae-K.min.z)/$.z)]}}},W=function(){L.clear()}},644:function(C){"use strict";C.exports=require("three")},568:function(C,z,w){"use strict";w.d(z,{Z:function(){return A}});function S(L,O,W,U,R,y,F){try{var I=L[y](F),T=I.value}catch(u){W(u);return}I.done?O(T):Promise.resolve(T).then(U,R)}function A(L){return function(){var O=this,W=arguments;return new Promise(function(U,R){var y=L.apply(O,W);function F(T){S(y,U,R,F,I,"next",T)}function I(T){S(y,U,R,F,I,"throw",T)}F(void 0)})}}},924:function(C,z,w){"use strict";w.d(z,{Z:function(){return S}});function S(A,L,O){return L in A?Object.defineProperty(A,L,{value:O,enumerable:!0,configurable:!0,writable:!0}):A[L]=O,A}},42:function(C,z,w){"use strict";w.d(z,{Z:function(){return A}});var S=w(924);function A(L){for(var O=1;O<arguments.length;O++){var W=arguments[O]!=null?arguments[O]:{},U=Object.keys(W);typeof Object.getOwnPropertySymbols=="function"&&(U=U.concat(Object.getOwnPropertySymbols(W).filter(function(R){return Object.getOwnPropertyDescriptor(W,R).enumerable}))),U.forEach(function(R){(0,S.Z)(L,R,W[R])})}return L}}},Ge={};function q(C){var z=Ge[C];if(z!==void 0)return z.exports;var w=Ge[C]={exports:{}};return $e[C](w,w.exports,q),w.exports}(function(){q.n=function(C){var z=C&&C.__esModule?function(){return C.default}:function(){return C};return q.d(z,{a:z}),z}})(),function(){q.d=function(C,z){for(var w in z)q.o(z,w)&&!q.o(C,w)&&Object.defineProperty(C,w,{enumerable:!0,get:z[w]})}}(),function(){q.o=function(C,z){return Object.prototype.hasOwnProperty.call(C,z)}}(),function(){q.r=function(C){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(C,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(C,"__esModule",{value:!0})}}();var ke={};(function(){"use strict";q.r(ke),q.d(ke,{ConicPolygon:function(){return mt},ExtrudePolygon:function(){return yt},Image:function(){return P},Line:function(){return Qe},MeshLine:function(){return te},MeshLineMaterial:function(){return Te},MeshLineRaycast:function(){return Ue},Node:function(){return ie},Text:function(){return ze},Video:function(){return ne}});function C(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function z(t,i){return z=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},z(t,i)}function w(t,i){return z(t,i)}function S(t,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(i&&i.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),i&&w(t,i)}var A=q(42);function L(t,i){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);i&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function O(t,i){return i=i!=null?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):L(Object(i)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(i,r))}),t}function W(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function U(t){return U=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},U(t)}function R(t){return U(t)}function y(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function F(t){return t&&t.constructor===Symbol?"symbol":typeof t}function I(t,i){return i&&(F(i)==="object"||typeof i=="function")?i:y(t)}function T(t){var i=W();return function(){var n=R(t),a;if(i){var e=R(this).constructor;a=Reflect.construct(n,arguments,e)}else a=n.apply(this,arguments);return I(this,a)}}var u=q(644);function ue(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}function Y(t,i,r){return ue()?Y=Reflect.construct:Y=function(a,e,o){var c=[null];c.push.apply(c,e);var p=Function.bind.apply(a,c),v=new p;return o&&w(v,o.prototype),v},Y.apply(null,arguments)}function E(t,i,r){return Y.apply(null,arguments)}function X(t,i){for(var r=0;r<i.length;r++){var n=i[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function j(t,i,r){return i&&X(t.prototype,i),r&&X(t,r),t}function k(t,i){(i==null||i>t.length)&&(i=t.length);for(var r=0,n=new Array(i);r<i;r++)n[r]=t[r];return n}function Z(t){if(Array.isArray(t))return k(t)}function re(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function J(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function N(t,i){if(!!t){if(typeof t=="string")return k(t,i);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return k(t,i)}}function D(t){return Z(t)||re(t)||N(t)||J()}var ae=q(620);function fe(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={};return r.promise=new Promise(function(n,a){r.resolve=n,r.reject=a}),t&&(r.promise=(0,ae.Z)(r.promise,i)),r}var Q=require("three/examples/jsm/renderers/CSS2DRenderer"),me=require("three/examples/jsm/renderers/CSS3DRenderer"),K=q(54),$=function(t){t&&((0,K.disposeMesh)(t),t.children.forEach(function(i){i.userData.BaseObject_||$(i)}))},he=function(){"use strict";function t(){C(this,t),this.objecttype__="BaseObject",this.userData={},this.pm=fe(),this.visible=!1}var i=t.prototype;return i.init=function(){},i.create=function(){},i.render=function(){},i.update=function(n,a){},i.resize=function(n,a){},i.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},i.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},i.isVisible=function(){return this.visible},i.createMesh=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];return this.object3d=E(u.Mesh,D(a)),this},i.createGroup=function(){return this.object3d=new u.Group,this},i.createPoints=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];return this.object3d=E(u.Points,D(a)),this},i.createCSS2DObject=function(n){return this.object3d=new Q.CSS2DObject(n),this},i.createCSS3DObject=function(n){return this.object3d=new me.CSS3DObject(n),this},i.createCSS3DSprite=function(n){return this.object3d=new me.CSS3DSprite(n),this},i.createSprite=function(n){return this.object3d=new u.Sprite(n),this},i.add=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];var o;return(o=this.object3d).add.apply(o,D(a)),this},i.remove=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];var o;return(o=this.object3d).remove.apply(o,D(a)),this},i.getSize=function(){var n=new u.Box3().setFromObject(this.object3d);return{min:n.min,max:n.max,size:n.getSize(new u.Vector3)}},i.traverse=function(n){n(this),this.children.forEach(function(a){a.traverse(n)})},i.dispose=function(){$(this.object3d)},j(t,[{key:"parent",get:function(){var n=this.object3d.parent;return(n==null?void 0:n.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(n){return n.userData.BaseObject_}).filter(function(n){return!!n})}}]),t}(),ze=function(t){"use strict";S(r,t);var i=T(r);function r(a){C(this,r);var e;return e=i.call(this),e.width=0,e.canvas=document.createElement("canvas"),e.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),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.position,c=e.lookAt,p=e.sprite,v=e.text,d=e.sizeAttenuation;if(p){var m=new u.Sprite(new u.SpriteMaterial({transparent:!0,sizeAttenuation:d}));this.object3d=m}else{var g=new u.MeshBasicMaterial({side:u.DoubleSide,transparent:!0}),x=new u.PlaneGeometry(1,1,1,1);this.createMesh(x,g)}this.object3d.position.copy(o),c&&this.object3d.lookAt(c),this.setText(v)},n.setText=function(e,o){var c=(0,A.Z)(O((0,A.Z)({},this.options),{text:e}),o||{}),p=c.text,v=c.fontSize,d=c.fontFamily,m=c.fontWeight,g=c.flipX,x=c.scale,_=this.canvas;_.width=v*p.length*2,_.height=v;var M=_.getContext("2d");M.font="".concat(m," ").concat(v,"px/1 ").concat(d);var f=M.measureText(p).width;_.width=f,this.width=f,M=_.getContext("2d"),M.clearRect(0,0,_.width,_.height),g&&M.scale(-1,1),M.font="".concat(m," ").concat(v,"px/1 ").concat(d),M.textBaseline="middle",M.fillStyle="#ffffff",M.fillText(p,g?f*-1:0,_.height/2),M.restore();var B=new u.Texture(_);B.anisotropy=16,B.needsUpdate=!0;var V=this.object3d;V.material.map&&V.material.map.dispose(),V.material.map=B,V.material.needsUpdate=!0,V.scale.set(B.image.width*x,B.image.height*x,1)},r}(he),l=q(568),s=q(666),h=q.n(s),P=function(t){"use strict";S(r,t);var i=T(r);function r(a){C(this,r);var e;return e=i.call(this),e.options=a,e}var n=r.prototype;return n.getMaterial=function(){var e=this;return(0,l.Z)(h().mark(function o(){var c,p,v,d,m,g,x,_,M,f;return h().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return c=e.options,p=c.transparent,v=c.blending,d=c.src,m=c.depthWrite,g=c.alphaTest,x=c.sprite,_=c.sizeAttenuation,V.next=3,new u.TextureLoader().loadAsync(d);case 3:return M=V.sent,f=x?new u.SpriteMaterial({map:M,transparent:p!=null?p:!1,blending:v!=null?v:u.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:g!=null?g:0,sizeAttenuation:_!=null?_:!0}):new u.MeshBasicMaterial({map:M,transparent:p!=null?p:!1,blending:v!=null?v:u.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:g!=null?g:0}),V.abrupt("return",f);case 6:case"end":return V.stop()}},o)}))()},n.create=function(){var e=this;return(0,l.Z)(h().mark(function o(){var c,p,v,d,m,g,x,_;return h().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(c=e.options,p=c.scale,v=c.position,d=c.src,m=c.cache,g=c.sprite,!(m&&!m.get(d))){f.next=7;break}return m.init(d),f.next=5,e.getMaterial();case 5:x=f.sent,m.set(d,x);case 7:if(!m){f.next=13;break}return f.next=10,m.get(d);case 10:f.t0=f.sent,f.next=16;break;case 13:return f.next=15,e.getMaterial();case 15:f.t0=f.sent;case 16:_=f.t0,e.texture=_.map,g?e.createSprite(_):e.createMesh(new u.PlaneBufferGeometry(1,1),_),p&&e.setScale(p),v&&e.object3d.position.copy(v);case 21:case"end":return f.stop()}},o)}))()},n.setScale=function(e){this.object3d.scale.set(this.texture.image.width*e,this.texture.image.height*e,1)},r}(he);function b(t,i){for(;!Object.prototype.hasOwnProperty.call(t,i)&&(t=R(t),t!==null););return t}function G(t,i,r){return typeof Reflect!="undefined"&&Reflect.get?G=Reflect.get:G=function(a,e,o){var c=b(a,e);if(!!c){var p=Object.getOwnPropertyDescriptor(c,e);return p.get?p.get.call(o||a):p.value}},G(t,i,r)}function ee(t,i,r){return G(t,i,r)}var ne=function(t){"use strict";S(r,t);var i=T(r);function r(a){C(this,r);var e;return e=i.call(this),e.options=(0,A.Z)({},{autoPlay:!0,loop:!0},a),e}var n=r.prototype;return n.getMaterial=function(){var e=this.options,o=e.src,c=e.transparent,p=e.blending,v=e.depthWrite,d=e.format,m=e.autoPlay,g=e.loop,x=e.alphaTest,_=e.sprite,M=fe(),f=document.createElement("video");return f.addEventListener("loadedmetadata",function(){var B=new u.VideoTexture(f);B.format=d!=null?d:u.RGBAFormat,B.needsUpdate=!0;var V=_?new u.SpriteMaterial({map:B,transparent:c!=null?c:!1,blending:p!=null?p:u.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:x!=null?x:0}):new u.MeshBasicMaterial({map:B,transparent:c!=null?c:!1,blending:p!=null?p:u.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:x!=null?x:0});M.resolve(V)},!1),f.src=o,f.muted=!0,f.autoplay=m,f.loop=g,f.preload="auto",M.promise},n.create=function(){var e=this;return(0,l.Z)(h().mark(function o(){var c,p,v,d,m,g,x,_;return h().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(c=e.options,p=c.scale,v=c.position,d=c.src,m=c.cache,g=c.sprite,!(m&&!m.get(d))){f.next=7;break}return m.init(d),f.next=5,e.getMaterial();case 5:x=f.sent,m.set(d,x);case 7:if(!m){f.next=13;break}return f.next=10,m.get(d);case 10:f.t0=f.sent,f.next=16;break;case 13:return f.next=15,e.getMaterial();case 15:f.t0=f.sent;case 16:_=f.t0,e.video=_.map.image,g?e.createSprite(_):e.createMesh(new u.PlaneBufferGeometry(1,1),_),p&&e.setScale(p),v&&e.object3d.position.copy(v);case 21:case"end":return f.stop()}},o)}))()},n.setScale=function(e){this.object3d.scale.set(this.video.videoWidth*e,this.video.videoHeight*e,1)},n.render=function(){var e=this.options.autoPlay;e&&this.video.play()},n.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),ee(R(r.prototype),"dispose",this).call(this)},r}(he),oe=function(t){"use strict";S(r,t);var i=T(r);function r(a){C(this,r);var e;return e=i.call(this),e.options=(0,A.Z)({},a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.position,c=e.children,p=e.onClick,v=e.zIndexFix,d=document.createElement("div");d.appendChild(c),this.createCSS2DObject(d),o&&this.object3d.position.copy(o),p&&d.addEventListener("click",p),v&&(this.object3d.userData.zIndexFix=v)},n.getMaterial=function(e){return(0,l.Z)(h().mark(function o(){var c,p,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,p=c.getContext("2d"),p.fillStyle="#ff0000",p.fillRect(0,0,256,256),v=new u.CanvasTexture(c),d=new u.SpriteMaterial({map:v,opacity:e?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),g.abrupt("return",d);case 9:case"end":return g.stop()}},o)}))()},n.createPickObject=function(e){var o=e.show,c=o===void 0?!1:o,p=e.scale,v=p===void 0?new u.Vector3(1,1,1):p,d=e.position,m=d===void 0?new u.Vector3(0,0,0):d,g=e.cache,x=this;return(0,l.Z)(h().mark(function _(){var M,f,B,V;return h().wrap(function(H){for(;;)switch(H.prev=H.next){case 0:if(M="node-create-pick-object",!(g&&!g.get(M))){H.next=7;break}return g.init(M),H.next=5,x.getMaterial(c);case 5:f=H.sent,g.set(M,f);case 7:if(!g){H.next=13;break}return H.next=10,g.get(M);case 10:H.t0=H.sent,H.next=16;break;case 13:return H.next=15,x.getMaterial(c);case 15:H.t0=H.sent;case 16:B=H.t0,V=new u.Sprite(B),V.scale.set(B.map.image.width*v.x,B.map.image.height*v.y,1),V.position.copy(m),x.add(V),x.pickObject=V;case 22:case"end":return H.stop()}},_)}))()},n.dispose=function(){var e=this.options.onClick;if(e){var o;(o=this.object3d.element)===null||o===void 0||o.removeEventListener("click",e)}ee(R(r.prototype),"dispose",this).call(this)},r}(he),ie=oe,Ae=`
1
+ (function(){var $e={666:function(C){var z=function(w){"use strict";var S=Object.prototype,A=S.hasOwnProperty,L,O=typeof Symbol=="function"?Symbol:{},W=O.iterator||"@@iterator",U=O.asyncIterator||"@@asyncIterator",R=O.toStringTag||"@@toStringTag";function y(l,s,h){return Object.defineProperty(l,s,{value:h,enumerable:!0,configurable:!0,writable:!0}),l[s]}try{y({},"")}catch(l){y=function(s,h,P){return s[h]=P}}function F(l,s,h,P){var b=s&&s.prototype instanceof X?s:X,G=Object.create(b.prototype),ee=new $(P||[]);return G._invoke=fe(l,h,ee),G}w.wrap=F;function I(l,s,h){try{return{type:"normal",arg:l.call(s,h)}}catch(P){return{type:"throw",arg:P}}}var T="suspendedStart",u="suspendedYield",ue="executing",Y="completed",E={};function X(){}function j(){}function k(){}var Z={};y(Z,W,function(){return this});var re=Object.getPrototypeOf,J=re&&re(re(he([])));J&&J!==S&&A.call(J,W)&&(Z=J);var N=k.prototype=X.prototype=Object.create(Z);j.prototype=k,y(N,"constructor",k),y(k,"constructor",j),j.displayName=y(k,R,"GeneratorFunction");function D(l){["next","throw","return"].forEach(function(s){y(l,s,function(h){return this._invoke(s,h)})})}w.isGeneratorFunction=function(l){var s=typeof l=="function"&&l.constructor;return s?s===j||(s.displayName||s.name)==="GeneratorFunction":!1},w.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,k):(l.__proto__=k,y(l,R,"GeneratorFunction")),l.prototype=Object.create(N),l},w.awrap=function(l){return{__await:l}};function ae(l,s){function h(G,ee,ne,oe){var ie=I(l[G],l,ee);if(ie.type==="throw")oe(ie.arg);else{var Ae=ie.arg,_e=Ae.value;return _e&&typeof _e=="object"&&A.call(_e,"__await")?s.resolve(_e.__await).then(function(te){h("next",te,ne,oe)},function(te){h("throw",te,ne,oe)}):s.resolve(_e).then(function(te){Ae.value=te,ne(Ae)},function(te){return h("throw",te,ne,oe)})}}var P;function b(G,ee){function ne(){return new s(function(oe,ie){h(G,ee,oe,ie)})}return P=P?P.then(ne,ne):ne()}this._invoke=b}D(ae.prototype),y(ae.prototype,U,function(){return this}),w.AsyncIterator=ae,w.async=function(l,s,h,P,b){b===void 0&&(b=Promise);var G=new ae(F(l,s,h,P),b);return w.isGeneratorFunction(s)?G:G.next().then(function(ee){return ee.done?ee.value:G.next()})};function fe(l,s,h){var P=T;return function(G,ee){if(P===ue)throw new Error("Generator is already running");if(P===Y){if(G==="throw")throw ee;return ze()}for(h.method=G,h.arg=ee;;){var ne=h.delegate;if(ne){var oe=Q(ne,h);if(oe){if(oe===E)continue;return oe}}if(h.method==="next")h.sent=h._sent=h.arg;else if(h.method==="throw"){if(P===T)throw P=Y,h.arg;h.dispatchException(h.arg)}else h.method==="return"&&h.abrupt("return",h.arg);P=ue;var ie=I(l,s,h);if(ie.type==="normal"){if(P=h.done?Y:u,ie.arg===E)continue;return{value:ie.arg,done:h.done}}else ie.type==="throw"&&(P=Y,h.method="throw",h.arg=ie.arg)}}}function Q(l,s){var h=l.iterator[s.method];if(h===L){if(s.delegate=null,s.method==="throw"){if(l.iterator.return&&(s.method="return",s.arg=L,Q(l,s),s.method==="throw"))return E;s.method="throw",s.arg=new TypeError("The iterator does not provide a 'throw' method")}return E}var P=I(h,l.iterator,s.arg);if(P.type==="throw")return s.method="throw",s.arg=P.arg,s.delegate=null,E;var b=P.arg;if(!b)return s.method="throw",s.arg=new TypeError("iterator result is not an object"),s.delegate=null,E;if(b.done)s[l.resultName]=b.value,s.next=l.nextLoc,s.method!=="return"&&(s.method="next",s.arg=L);else return b;return s.delegate=null,E}D(N),y(N,R,"Generator"),y(N,W,function(){return this}),y(N,"toString",function(){return"[object Generator]"});function me(l){var s={tryLoc:l[0]};1 in l&&(s.catchLoc=l[1]),2 in l&&(s.finallyLoc=l[2],s.afterLoc=l[3]),this.tryEntries.push(s)}function K(l){var s=l.completion||{};s.type="normal",delete s.arg,l.completion=s}function $(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(me,this),this.reset(!0)}w.keys=function(l){var s=[];for(var h in l)s.push(h);return s.reverse(),function P(){for(;s.length;){var b=s.pop();if(b in l)return P.value=b,P.done=!1,P}return P.done=!0,P}};function he(l){if(l){var s=l[W];if(s)return s.call(l);if(typeof l.next=="function")return l;if(!isNaN(l.length)){var h=-1,P=function b(){for(;++h<l.length;)if(A.call(l,h))return b.value=l[h],b.done=!1,b;return b.value=L,b.done=!0,b};return P.next=P}}return{next:ze}}w.values=he;function ze(){return{value:L,done:!0}}return $.prototype={constructor:$,reset:function(l){if(this.prev=0,this.next=0,this.sent=this._sent=L,this.done=!1,this.delegate=null,this.method="next",this.arg=L,this.tryEntries.forEach(K),!l)for(var s in this)s.charAt(0)==="t"&&A.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=L)},stop:function(){this.done=!0;var l=this.tryEntries[0],s=l.completion;if(s.type==="throw")throw s.arg;return this.rval},dispatchException:function(l){if(this.done)throw l;var s=this;function h(oe,ie){return G.type="throw",G.arg=l,s.next=oe,ie&&(s.method="next",s.arg=L),!!ie}for(var P=this.tryEntries.length-1;P>=0;--P){var b=this.tryEntries[P],G=b.completion;if(b.tryLoc==="root")return h("end");if(b.tryLoc<=this.prev){var ee=A.call(b,"catchLoc"),ne=A.call(b,"finallyLoc");if(ee&&ne){if(this.prev<b.catchLoc)return h(b.catchLoc,!0);if(this.prev<b.finallyLoc)return h(b.finallyLoc)}else if(ee){if(this.prev<b.catchLoc)return h(b.catchLoc,!0)}else if(ne){if(this.prev<b.finallyLoc)return h(b.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(l,s){for(var h=this.tryEntries.length-1;h>=0;--h){var P=this.tryEntries[h];if(P.tryLoc<=this.prev&&A.call(P,"finallyLoc")&&this.prev<P.finallyLoc){var b=P;break}}b&&(l==="break"||l==="continue")&&b.tryLoc<=s&&s<=b.finallyLoc&&(b=null);var G=b?b.completion:{};return G.type=l,G.arg=s,b?(this.method="next",this.next=b.finallyLoc,E):this.complete(G)},complete:function(l,s){if(l.type==="throw")throw l.arg;return l.type==="break"||l.type==="continue"?this.next=l.arg:l.type==="return"?(this.rval=this.arg=l.arg,this.method="return",this.next="end"):l.type==="normal"&&s&&(this.next=s),E},finish:function(l){for(var s=this.tryEntries.length-1;s>=0;--s){var h=this.tryEntries[s];if(h.finallyLoc===l)return this.complete(h.completion,h.afterLoc),K(h),E}},catch:function(l){for(var s=this.tryEntries.length-1;s>=0;--s){var h=this.tryEntries[s];if(h.tryLoc===l){var P=h.completion;if(P.type==="throw"){var b=P.arg;K(h)}return b}}throw new Error("illegal catch attempt")},delegateYield:function(l,s,h){return this.delegate={iterator:he(l),resultName:s,nextLoc:h},this.method==="next"&&(this.arg=L),E}},w}(C.exports);try{regeneratorRuntime=z}catch(w){typeof globalThis=="object"?globalThis.regeneratorRuntime=z:Function("r","regeneratorRuntime = r")(z)}},182:function(C,z,w){"use strict";w.d(z,{Z:function(){return S}});function S(A){if(A.geometry&&A.geometry.dispose(),A.material){var L=Array.isArray(A.material)?A.material:[A.material];L.forEach(function(O){var W,U,R,y,F,I,T,u,ue,Y,E,X,j;(W=O.map)===null||W===void 0||W.dispose(),(U=O.lightMap)===null||U===void 0||U.dispose(),(R=O.bumpMap)===null||R===void 0||R.dispose(),(y=O.normalMap)===null||y===void 0||y.dispose(),(F=O.specularMap)===null||F===void 0||F.dispose(),(I=O.envMap)===null||I===void 0||I.dispose(),(T=O.alphaMap)===null||T===void 0||T.dispose(),(u=O.aoMap)===null||u===void 0||u.dispose(),(ue=O.displacementMap)===null||ue===void 0||ue.dispose(),(Y=O.emissiveMap)===null||Y===void 0||Y.dispose(),(E=O.gradientMap)===null||E===void 0||E.dispose(),(X=O.metalnessMap)===null||X===void 0||X.dispose(),(j=O.roughnessMap)===null||j===void 0||j.dispose(),O.dispose()})}}},54:function(C,z,w){"use strict";w.d(z,{disposeMesh:function(){return O.Z}});var S=w(666),A=w.n(S),L=null,O=w(182),W=w(644);function U(E){if(E.material){var X=Array.isArray(E.material)?E.material:[E.material];X.forEach(function(j){var k,Z;(k=j.color)===null||k===void 0||k.convertSRGBToLinear(),(Z=j.emissive)===null||Z===void 0||Z.convertSRGBToLinear(),j.map&&(j.map.encoding=THREE.sRGBEncoding),j.emissiveMap&&(j.emissiveMap.encoding=THREE.sRGBEncoding)})}}var R=w(568),y=w(924),F=require("idb-keyval"),I=w(620),T=null,u=null,ue=function(){var E=(0,R.Z)(A().mark(function X(j,k){var Z,re,J,N,D,ae;return A().wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Z=k.version,Q.next=4,(0,F.get)(j);case 4:if(J=Q.sent,!(J&&J[Z])){Q.next=9;break}re=J[Z],Q.next=15;break;case 9:return Q.next=11,(0,I.Z)(fetch(j).then(function(me){if(me.ok)return me.blob();throw new Error}));case 11:N=Q.sent,D=N.res,ae=N.err,ae||(re=D,(0,F.set)(j,(0,y.Z)({},Z,D)));case 15:return Q.abrupt("return",re?{url:URL.createObjectURL(re)}:{url:j});case 16:case"end":return Q.stop()}},X)}));return function(j,k){return E.apply(this,arguments)}}(),Y=w(977)},620:function(C,z,w){"use strict";w.d(z,{Z:function(){return A}});var S=w(42);function A(L){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return L.then(function(W){return(0,S.Z)({err:null,res:W},O)}).catch(function(W){return(0,S.Z)({err:W,res:void 0},O)})}},977:function(C,z,w){"use strict";w.d(z,{y:function(){return O}});var S=w(644),A=w.n(S),L=new Map,O=function(U){return{generateTopUV:function(R,y,F,I,T){var u=y[F*3],ue=y[F*3+1],Y=y[I*3],E=y[I*3+1],X=y[T*3],j=y[T*3+1],k;if(L.has(R))k=L.get(R);else{var Z=U&&U.box3||new S.Box3;if(!U||!U.box3){var re=R.parameters.shapes.getPoints();Z.setFromArray(re.map(function(ae){return[ae.x,ae.y,0]}).flat())}var J=Z.getSize(new S.Vector3);k={box:Z,size:J},L.set(R,k)}var N=k.box,D=k.size;return[new S.Vector2((u-N.min.x)/D.x,(ue-N.min.y)/D.y),new S.Vector2((Y-N.min.x)/D.x,(E-N.min.y)/D.y),new S.Vector2((X-N.min.x)/D.x,(j-N.min.y)/D.y)]},generateSideWallUV:function(R,y,F,I,T,u){var ue=y[F*3],Y=y[F*3+1],E=y[F*3+2],X=y[I*3],j=y[I*3+1],k=y[I*3+2],Z=y[T*3],re=y[T*3+1],J=y[T*3+2],N=y[u*3],D=y[u*3+1],ae=y[u*3+2],fe;if(L.has(y))fe=L.get(y);else{var Q=new S.Box3;Q.setFromArray(y);var me=Q.getSize(new S.Vector3);fe={box:Q,size:me},L.set(y,fe)}var K=fe.box,$=fe.size;return Math.abs(Y-j)<.01?[new S.Vector2((ue-K.min.x)/$.x,(E-K.min.z)/$.z),new S.Vector2((X-K.min.x)/$.x,(k-K.min.z)/$.z),new S.Vector2((Z-K.min.x)/$.x,(J-K.min.z)/$.z),new S.Vector2((N-K.min.x)/$.x,(ae-K.min.z)/$.z)]:[new S.Vector2((Y-K.min.y)/$.x,(E-K.min.z)/$.z),new S.Vector2((j-K.min.y)/$.x,(k-K.min.z)/$.z),new S.Vector2((re-K.min.y)/$.x,(J-K.min.z)/$.z),new S.Vector2((D-K.min.y)/$.x,(ae-K.min.z)/$.z)]}}},W=function(){L.clear()}},644:function(C){"use strict";C.exports=require("three")},568:function(C,z,w){"use strict";w.d(z,{Z:function(){return A}});function S(L,O,W,U,R,y,F){try{var I=L[y](F),T=I.value}catch(u){W(u);return}I.done?O(T):Promise.resolve(T).then(U,R)}function A(L){return function(){var O=this,W=arguments;return new Promise(function(U,R){var y=L.apply(O,W);function F(T){S(y,U,R,F,I,"next",T)}function I(T){S(y,U,R,F,I,"throw",T)}F(void 0)})}}},924:function(C,z,w){"use strict";w.d(z,{Z:function(){return S}});function S(A,L,O){return L in A?Object.defineProperty(A,L,{value:O,enumerable:!0,configurable:!0,writable:!0}):A[L]=O,A}},42:function(C,z,w){"use strict";w.d(z,{Z:function(){return A}});var S=w(924);function A(L){for(var O=1;O<arguments.length;O++){var W=arguments[O]!=null?arguments[O]:{},U=Object.keys(W);typeof Object.getOwnPropertySymbols=="function"&&(U=U.concat(Object.getOwnPropertySymbols(W).filter(function(R){return Object.getOwnPropertyDescriptor(W,R).enumerable}))),U.forEach(function(R){(0,S.Z)(L,R,W[R])})}return L}}},Ge={};function q(C){var z=Ge[C];if(z!==void 0)return z.exports;var w=Ge[C]={exports:{}};return $e[C](w,w.exports,q),w.exports}(function(){q.n=function(C){var z=C&&C.__esModule?function(){return C.default}:function(){return C};return q.d(z,{a:z}),z}})(),function(){q.d=function(C,z){for(var w in z)q.o(z,w)&&!q.o(C,w)&&Object.defineProperty(C,w,{enumerable:!0,get:z[w]})}}(),function(){q.o=function(C,z){return Object.prototype.hasOwnProperty.call(C,z)}}(),function(){q.r=function(C){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(C,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(C,"__esModule",{value:!0})}}();var ke={};(function(){"use strict";q.r(ke),q.d(ke,{ConicPolygon:function(){return mt},ExtrudePolygon:function(){return yt},Image:function(){return P},Line:function(){return Qe},MeshLine:function(){return te},MeshLineMaterial:function(){return Te},MeshLineRaycast:function(){return Ue},Node:function(){return ie},Text:function(){return ze},Video:function(){return ne}});function C(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function z(t,i){return z=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},z(t,i)}function w(t,i){return z(t,i)}function S(t,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(i&&i.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),i&&w(t,i)}var A=q(42);function L(t,i){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);i&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function O(t,i){return i=i!=null?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):L(Object(i)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(i,r))}),t}function W(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function U(t){return U=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},U(t)}function R(t){return U(t)}function y(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function F(t){return t&&t.constructor===Symbol?"symbol":typeof t}function I(t,i){return i&&(F(i)==="object"||typeof i=="function")?i:y(t)}function T(t){var i=W();return function(){var n=R(t),a;if(i){var e=R(this).constructor;a=Reflect.construct(n,arguments,e)}else a=n.apply(this,arguments);return I(this,a)}}var u=q(644);function ue(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}function Y(t,i,r){return ue()?Y=Reflect.construct:Y=function(a,e,o){var c=[null];c.push.apply(c,e);var p=Function.bind.apply(a,c),v=new p;return o&&w(v,o.prototype),v},Y.apply(null,arguments)}function E(t,i,r){return Y.apply(null,arguments)}function X(t,i){for(var r=0;r<i.length;r++){var n=i[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function j(t,i,r){return i&&X(t.prototype,i),r&&X(t,r),t}function k(t,i){(i==null||i>t.length)&&(i=t.length);for(var r=0,n=new Array(i);r<i;r++)n[r]=t[r];return n}function Z(t){if(Array.isArray(t))return k(t)}function re(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function J(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function N(t,i){if(!!t){if(typeof t=="string")return k(t,i);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return k(t,i)}}function D(t){return Z(t)||re(t)||N(t)||J()}var ae=q(620);function fe(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={};return r.promise=new Promise(function(n,a){r.resolve=n,r.reject=a}),t&&(r.promise=(0,ae.Z)(r.promise,i)),r}var Q=require("three/examples/jsm/renderers/CSS2DRenderer"),me=require("three/examples/jsm/renderers/CSS3DRenderer"),K=q(54),$=function(t){t&&((0,K.disposeMesh)(t),t.children.forEach(function(i){i.userData.BaseObject_||$(i)}))},he=function(){"use strict";function t(){C(this,t),this.objecttype__="BaseObject",this.userData={},this.pm=fe(),this.visible=!1}var i=t.prototype;return i.init=function(){},i.create=function(){},i.render=function(){},i.update=function(n,a){},i.resize=function(n,a){},i.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},i.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},i.isVisible=function(){return this.visible},i.createMesh=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];return this.object3d=E(u.Mesh,D(a)),this},i.createGroup=function(){return this.object3d=new u.Group,this},i.createPoints=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];return this.object3d=E(u.Points,D(a)),this},i.createCSS2DObject=function(n){return this.object3d=new Q.CSS2DObject(n),this},i.createCSS3DObject=function(n){return this.object3d=new me.CSS3DObject(n),this},i.createCSS3DSprite=function(n){return this.object3d=new me.CSS3DSprite(n),this},i.createSprite=function(n){return this.object3d=new u.Sprite(n),this},i.add=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];var o;return(o=this.object3d).add.apply(o,D(a)),this},i.remove=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];var o;return(o=this.object3d).remove.apply(o,D(a)),this},i.getSize=function(){var n=new u.Box3().setFromObject(this.object3d);return{min:n.min,max:n.max,size:n.getSize(new u.Vector3)}},i.traverse=function(n){n(this),this.children.forEach(function(a){a.traverse(n)})},i.dispose=function(){$(this.object3d)},j(t,[{key:"parent",get:function(){var n=this.object3d.parent;return(n==null?void 0:n.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(n){return n.userData.BaseObject_}).filter(function(n){return!!n})}}]),t}(),ze=function(t){"use strict";S(r,t);var i=T(r);function r(a){C(this,r);var e;return e=i.call(this),e.width=0,e.canvas=document.createElement("canvas"),e.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),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.position,c=e.lookAt,p=e.sprite,v=e.text,d=e.sizeAttenuation;if(p){var m=new u.Sprite(new u.SpriteMaterial({transparent:!0,sizeAttenuation:d}));this.object3d=m}else{var g=new u.MeshBasicMaterial({side:u.DoubleSide,transparent:!0}),x=new u.PlaneGeometry(1,1,1,1);this.createMesh(x,g)}this.object3d.position.copy(o),c&&this.object3d.lookAt(c),this.setText(v)},n.setText=function(e,o){var c=(0,A.Z)(O((0,A.Z)({},this.options),{text:e}),o||{}),p=c.text,v=c.fontSize,d=c.fontFamily,m=c.fontWeight,g=c.flipX,x=c.scale,_=this.canvas;_.width=v*p.length*2,_.height=v;var M=_.getContext("2d");M.font="".concat(m," ").concat(v,"px/1 ").concat(d);var f=M.measureText(p).width;_.width=f,this.width=f,M=_.getContext("2d"),M.clearRect(0,0,_.width,_.height),g&&M.scale(-1,1),M.font="".concat(m," ").concat(v,"px/1 ").concat(d),M.textBaseline="middle",M.fillStyle="#ffffff",M.fillText(p,g?f*-1:0,_.height/2),M.restore();var B=new u.Texture(_);B.anisotropy=16,B.needsUpdate=!0;var V=this.object3d;V.material.map&&V.material.map.dispose(),V.material.map=B,V.material.needsUpdate=!0,V.scale.set(B.image.width*x,B.image.height*x,1)},r}(he),l=q(568),s=q(666),h=q.n(s),P=function(t){"use strict";S(r,t);var i=T(r);function r(a){C(this,r);var e;return e=i.call(this),e.options=a,e}var n=r.prototype;return n.getMaterial=function(){var e=this;return(0,l.Z)(h().mark(function o(){var c,p,v,d,m,g,x,_,M,f;return h().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return c=e.options,p=c.transparent,v=c.blending,d=c.src,m=c.depthWrite,g=c.alphaTest,x=c.sprite,_=c.sizeAttenuation,V.next=3,new u.TextureLoader().loadAsync(d);case 3:return M=V.sent,f=x?new u.SpriteMaterial({map:M,transparent:p!=null?p:!1,blending:v!=null?v:u.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:g!=null?g:0,sizeAttenuation:_!=null?_:!0}):new u.MeshBasicMaterial({map:M,transparent:p!=null?p:!1,blending:v!=null?v:u.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:g!=null?g:0}),V.abrupt("return",f);case 6:case"end":return V.stop()}},o)}))()},n.create=function(){var e=this;return(0,l.Z)(h().mark(function o(){var c,p,v,d,m,g,x,_;return h().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(c=e.options,p=c.scale,v=c.position,d=c.src,m=c.cache,g=c.sprite,!(m&&!m.get(d))){f.next=7;break}return m.init(d),f.next=5,e.getMaterial();case 5:x=f.sent,m.set(d,x);case 7:if(!m){f.next=13;break}return f.next=10,m.get(d);case 10:f.t0=f.sent,f.next=16;break;case 13:return f.next=15,e.getMaterial();case 15:f.t0=f.sent;case 16:_=f.t0,e.texture=_.map,g?e.createSprite(_):e.createMesh(new u.PlaneBufferGeometry(1,1),_),p&&e.setScale(p),v&&e.object3d.position.copy(v);case 21:case"end":return f.stop()}},o)}))()},n.setScale=function(e){this.object3d.scale.set(this.texture.image.width*e,this.texture.image.height*e,1)},r}(he);function b(t,i){for(;!Object.prototype.hasOwnProperty.call(t,i)&&(t=R(t),t!==null););return t}function G(t,i,r){return typeof Reflect!="undefined"&&Reflect.get?G=Reflect.get:G=function(a,e,o){var c=b(a,e);if(!!c){var p=Object.getOwnPropertyDescriptor(c,e);return p.get?p.get.call(o||a):p.value}},G(t,i,r)}function ee(t,i,r){return G(t,i,r)}var ne=function(t){"use strict";S(r,t);var i=T(r);function r(a){C(this,r);var e;return e=i.call(this),e.options=(0,A.Z)({},{autoPlay:!0,loop:!0},a),e}var n=r.prototype;return n.getMaterial=function(){var e=this.options,o=e.src,c=e.transparent,p=e.blending,v=e.depthWrite,d=e.format,m=e.autoPlay,g=e.loop,x=e.alphaTest,_=e.sprite,M=fe(),f=document.createElement("video");return f.addEventListener("loadedmetadata",function(){var B=new u.VideoTexture(f);B.format=d!=null?d:u.RGBAFormat,B.needsUpdate=!0;var V=_?new u.SpriteMaterial({map:B,transparent:c!=null?c:!1,blending:p!=null?p:u.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:x!=null?x:0}):new u.MeshBasicMaterial({map:B,transparent:c!=null?c:!1,blending:p!=null?p:u.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:x!=null?x:0});M.resolve(V)},!1),f.src=o,f.muted=!0,f.autoplay=m,f.loop=g,f.preload="auto",M.promise},n.create=function(){var e=this;return(0,l.Z)(h().mark(function o(){var c,p,v,d,m,g,x,_;return h().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(c=e.options,p=c.scale,v=c.position,d=c.src,m=c.cache,g=c.sprite,!(m&&!m.get(d))){f.next=7;break}return m.init(d),f.next=5,e.getMaterial();case 5:x=f.sent,m.set(d,x);case 7:if(!m){f.next=13;break}return f.next=10,m.get(d);case 10:f.t0=f.sent,f.next=16;break;case 13:return f.next=15,e.getMaterial();case 15:f.t0=f.sent;case 16:_=f.t0,e.video=_.map.image,g?e.createSprite(_):e.createMesh(new u.PlaneBufferGeometry(1,1),_),p&&e.setScale(p),v&&e.object3d.position.copy(v);case 21:case"end":return f.stop()}},o)}))()},n.setScale=function(e){this.object3d.scale.set(this.video.videoWidth*e,this.video.videoHeight*e,1)},n.render=function(){var e=this.options.autoPlay;e&&this.video.play()},n.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),ee(R(r.prototype),"dispose",this).call(this)},r}(he),oe=function(t){"use strict";S(r,t);var i=T(r);function r(a){C(this,r);var e;return e=i.call(this),e.options=(0,A.Z)({},a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.position,c=e.children,p=e.onClick,v=e.zIndexFix,d=document.createElement("div");d.appendChild(c),this.createCSS2DObject(d),o&&this.object3d.position.copy(o),p&&d.addEventListener("click",p),v&&(this.object3d.userData.zIndexFix=v)},n.getMaterial=function(e){return(0,l.Z)(h().mark(function o(){var c,p,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,p=c.getContext("2d"),p.fillStyle="#ff0000",p.fillRect(0,0,256,256),v=new u.CanvasTexture(c),d=new u.SpriteMaterial({map:v,opacity:e?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),g.abrupt("return",d);case 9:case"end":return g.stop()}},o)}))()},n.createPickObject=function(e){var o=e.show,c=o===void 0?!1:o,p=e.scale,v=p===void 0?new u.Vector3(1,1,1):p,d=e.position,m=d===void 0?new u.Vector3(0,0,0):d,g=e.cache,x=this;return(0,l.Z)(h().mark(function _(){var M,f,B,V;return h().wrap(function(H){for(;;)switch(H.prev=H.next){case 0:if(M="node-create-pick-object",!(g&&!g.get(M))){H.next=7;break}return g.init(M),H.next=5,x.getMaterial(c);case 5:f=H.sent,g.set(M,f);case 7:if(!g){H.next=13;break}return H.next=10,g.get(M);case 10:H.t0=H.sent,H.next=16;break;case 13:return H.next=15,x.getMaterial(c);case 15:H.t0=H.sent;case 16:B=H.t0,V=new u.Sprite(B),V.scale.set(B.map.image.width*v.x,B.map.image.height*v.y,1),V.position.copy(m),x.add(V),x.pickObject=V;case 22:case"end":return H.stop()}},_)}))()},n.dispose=function(){var e=this.options.onClick;if(e){var o;(o=this.object3d.element)===null||o===void 0||o.removeEventListener("click",e)}ee(R(r.prototype),"dispose",this).call(this)},r}(he),ie=oe,Ae=`
2
2
  `.concat(u.ShaderChunk.logdepthbuf_pars_vertex,`
3
3
  `).concat(u.ShaderChunk.fog_pars_vertex,`
4
4
  attribute vec3 previous;
@@ -1,4 +1,4 @@
1
- import*as Ye from"idb-keyval";import*as V from"three";import*as zt from"three/examples/jsm/renderers/CSS2DRenderer";import*as Je from"three/examples/jsm/renderers/CSS3DRenderer";import*as Dt from"popmotion";import*as Fe from"d3-array";import*as Vt from"earcut";import*as Wt from"@turf/boolean-clockwise";import*as Gt from"delaunator";import*as Ut from"@turf/boolean-point-in-polygon";import*as Te from"d3-geo";import*as Nt from"d3-geo-voronoi";import*as Ft from"d3-scale";var It={666:function(C){var L=function(y){"use strict";var P=Object.prototype,x=P.hasOwnProperty,E,O=typeof Symbol=="function"?Symbol:{},W=O.iterator||"@@iterator",F=O.asyncIterator||"@@asyncIterator",b=O.toStringTag||"@@toStringTag";function j(l,s,p){return Object.defineProperty(l,s,{value:p,enumerable:!0,configurable:!0,writable:!0}),l[s]}try{j({},"")}catch(l){j=function(s,p,A){return s[p]=A}}function $(l,s,p,A){var m=s&&s.prototype instanceof ne?s:ne,Q=Object.create(m.prototype),Z=new ye(A||[]);return Q._invoke=ue(l,p,Z),Q}y.wrap=$;function Y(l,s,p){try{return{type:"normal",arg:l.call(s,p)}}catch(A){return{type:"throw",arg:A}}}var B="suspendedStart",c="suspendedYield",ae="executing",ee="completed",J={};function ne(){}function T(){}function N(){}var k={};j(k,W,function(){return this});var X=Object.getPrototypeOf,G=X&&X(X(ke([])));G&&G!==P&&x.call(G,W)&&(k=G);var I=N.prototype=ne.prototype=Object.create(k);T.prototype=N,j(I,"constructor",N),j(N,"constructor",T),T.displayName=j(N,b,"GeneratorFunction");function H(l){["next","throw","return"].forEach(function(s){j(l,s,function(p){return this._invoke(s,p)})})}y.isGeneratorFunction=function(l){var s=typeof l=="function"&&l.constructor;return s?s===T||(s.displayName||s.name)==="GeneratorFunction":!1},y.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,N):(l.__proto__=N,j(l,b,"GeneratorFunction")),l.prototype=Object.create(I),l},y.awrap=function(l){return{__await:l}};function re(l,s){function p(Q,Z,ie,oe){var te=Y(l[Q],l,Z);if(te.type==="throw")oe(te.arg);else{var xe=te.arg,Me=xe.value;return Me&&typeof Me=="object"&&x.call(Me,"__await")?s.resolve(Me.__await).then(function(_e){p("next",_e,ie,oe)},function(_e){p("throw",_e,ie,oe)}):s.resolve(Me).then(function(_e){xe.value=_e,ie(xe)},function(_e){return p("throw",_e,ie,oe)})}}var A;function m(Q,Z){function ie(){return new s(function(oe,te){p(Q,Z,oe,te)})}return A=A?A.then(ie,ie):ie()}this._invoke=m}H(re.prototype),j(re.prototype,F,function(){return this}),y.AsyncIterator=re,y.async=function(l,s,p,A,m){m===void 0&&(m=Promise);var Q=new re($(l,s,p,A),m);return y.isGeneratorFunction(s)?Q:Q.next().then(function(Z){return Z.done?Z.value:Q.next()})};function ue(l,s,p){var A=B;return function(Q,Z){if(A===ae)throw new Error("Generator is already running");if(A===ee){if(Q==="throw")throw Z;return Le()}for(p.method=Q,p.arg=Z;;){var ie=p.delegate;if(ie){var oe=me(ie,p);if(oe){if(oe===J)continue;return oe}}if(p.method==="next")p.sent=p._sent=p.arg;else if(p.method==="throw"){if(A===B)throw A=ee,p.arg;p.dispatchException(p.arg)}else p.method==="return"&&p.abrupt("return",p.arg);A=ae;var te=Y(l,s,p);if(te.type==="normal"){if(A=p.done?ee:c,te.arg===J)continue;return{value:te.arg,done:p.done}}else te.type==="throw"&&(A=ee,p.method="throw",p.arg=te.arg)}}}function me(l,s){var p=l.iterator[s.method];if(p===E){if(s.delegate=null,s.method==="throw"){if(l.iterator.return&&(s.method="return",s.arg=E,me(l,s),s.method==="throw"))return J;s.method="throw",s.arg=new TypeError("The iterator does not provide a 'throw' method")}return J}var A=Y(p,l.iterator,s.arg);if(A.type==="throw")return s.method="throw",s.arg=A.arg,s.delegate=null,J;var m=A.arg;if(!m)return s.method="throw",s.arg=new TypeError("iterator result is not an object"),s.delegate=null,J;if(m.done)s[l.resultName]=m.value,s.next=l.nextLoc,s.method!=="return"&&(s.method="next",s.arg=E);else return m;return s.delegate=null,J}H(I),j(I,b,"Generator"),j(I,W,function(){return this}),j(I,"toString",function(){return"[object Generator]"});function q(l){var s={tryLoc:l[0]};1 in l&&(s.catchLoc=l[1]),2 in l&&(s.finallyLoc=l[2],s.afterLoc=l[3]),this.tryEntries.push(s)}function R(l){var s=l.completion||{};s.type="normal",delete s.arg,l.completion=s}function ye(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(q,this),this.reset(!0)}y.keys=function(l){var s=[];for(var p in l)s.push(p);return s.reverse(),function A(){for(;s.length;){var m=s.pop();if(m in l)return A.value=m,A.done=!1,A}return A.done=!0,A}};function ke(l){if(l){var s=l[W];if(s)return s.call(l);if(typeof l.next=="function")return l;if(!isNaN(l.length)){var p=-1,A=function m(){for(;++p<l.length;)if(x.call(l,p))return m.value=l[p],m.done=!1,m;return m.value=E,m.done=!0,m};return A.next=A}}return{next:Le}}y.values=ke;function Le(){return{value:E,done:!0}}return ye.prototype={constructor:ye,reset:function(l){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(R),!l)for(var s in this)s.charAt(0)==="t"&&x.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=E)},stop:function(){this.done=!0;var l=this.tryEntries[0],s=l.completion;if(s.type==="throw")throw s.arg;return this.rval},dispatchException:function(l){if(this.done)throw l;var s=this;function p(oe,te){return Q.type="throw",Q.arg=l,s.next=oe,te&&(s.method="next",s.arg=E),!!te}for(var A=this.tryEntries.length-1;A>=0;--A){var m=this.tryEntries[A],Q=m.completion;if(m.tryLoc==="root")return p("end");if(m.tryLoc<=this.prev){var Z=x.call(m,"catchLoc"),ie=x.call(m,"finallyLoc");if(Z&&ie){if(this.prev<m.catchLoc)return p(m.catchLoc,!0);if(this.prev<m.finallyLoc)return p(m.finallyLoc)}else if(Z){if(this.prev<m.catchLoc)return p(m.catchLoc,!0)}else if(ie){if(this.prev<m.finallyLoc)return p(m.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(l,s){for(var p=this.tryEntries.length-1;p>=0;--p){var A=this.tryEntries[p];if(A.tryLoc<=this.prev&&x.call(A,"finallyLoc")&&this.prev<A.finallyLoc){var m=A;break}}m&&(l==="break"||l==="continue")&&m.tryLoc<=s&&s<=m.finallyLoc&&(m=null);var Q=m?m.completion:{};return Q.type=l,Q.arg=s,m?(this.method="next",this.next=m.finallyLoc,J):this.complete(Q)},complete:function(l,s){if(l.type==="throw")throw l.arg;return l.type==="break"||l.type==="continue"?this.next=l.arg:l.type==="return"?(this.rval=this.arg=l.arg,this.method="return",this.next="end"):l.type==="normal"&&s&&(this.next=s),J},finish:function(l){for(var s=this.tryEntries.length-1;s>=0;--s){var p=this.tryEntries[s];if(p.finallyLoc===l)return this.complete(p.completion,p.afterLoc),R(p),J}},catch:function(l){for(var s=this.tryEntries.length-1;s>=0;--s){var p=this.tryEntries[s];if(p.tryLoc===l){var A=p.completion;if(A.type==="throw"){var m=A.arg;R(p)}return m}}throw new Error("illegal catch attempt")},delegateYield:function(l,s,p){return this.delegate={iterator:ke(l),resultName:s,nextLoc:p},this.method==="next"&&(this.arg=E),J}},y}(C.exports);try{regeneratorRuntime=L}catch(y){typeof globalThis=="object"?globalThis.regeneratorRuntime=L:Function("r","regeneratorRuntime = r")(L)}},182:function(C,L,y){y.d(L,{Z:function(){return P}});function P(x){if(x.geometry&&x.geometry.dispose(),x.material){var E=Array.isArray(x.material)?x.material:[x.material];E.forEach(function(O){var W,F,b,j,$,Y,B,c,ae,ee,J,ne,T;(W=O.map)===null||W===void 0||W.dispose(),(F=O.lightMap)===null||F===void 0||F.dispose(),(b=O.bumpMap)===null||b===void 0||b.dispose(),(j=O.normalMap)===null||j===void 0||j.dispose(),($=O.specularMap)===null||$===void 0||$.dispose(),(Y=O.envMap)===null||Y===void 0||Y.dispose(),(B=O.alphaMap)===null||B===void 0||B.dispose(),(c=O.aoMap)===null||c===void 0||c.dispose(),(ae=O.displacementMap)===null||ae===void 0||ae.dispose(),(ee=O.emissiveMap)===null||ee===void 0||ee.dispose(),(J=O.gradientMap)===null||J===void 0||J.dispose(),(ne=O.metalnessMap)===null||ne===void 0||ne.dispose(),(T=O.roughnessMap)===null||T===void 0||T.dispose(),O.dispose()})}}},175:function(C,L,y){y.d(L,{wf:function(){return O.Z}});var P=y(666),x=y.n(P),E=null,O=y(182),W=y(949);function F(T){if(T.material){var N=Array.isArray(T.material)?T.material:[T.material];N.forEach(function(k){var X,G;(X=k.color)===null||X===void 0||X.convertSRGBToLinear(),(G=k.emissive)===null||G===void 0||G.convertSRGBToLinear(),k.map&&(k.map.encoding=THREE.sRGBEncoding),k.emissiveMap&&(k.emissiveMap.encoding=THREE.sRGBEncoding)})}}var b=y(568),j=y(924),$=T=>{var N={};return y.d(N,T),N},Y=T=>()=>T,B=$({get:()=>Ye.get,set:()=>Ye.set}),c=y(620),ae=null,ee=null,J=function(){var T=(0,b.Z)(x().mark(function N(k,X){var G,I,H,re,ue,me;return x().wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return G=X.version,R.next=4,(0,B.get)(k);case 4:if(H=R.sent,!(H&&H[G])){R.next=9;break}I=H[G],R.next=15;break;case 9:return R.next=11,(0,c.Z)(fetch(k).then(function(ye){if(ye.ok)return ye.blob();throw new Error}));case 11:re=R.sent,ue=re.res,me=re.err,me||(I=ue,(0,B.set)(k,(0,j.Z)({},G,ue)));case 15:return R.abrupt("return",I?{url:URL.createObjectURL(I)}:{url:k});case 16:case"end":return R.stop()}},N)}));return function(k,X){return T.apply(this,arguments)}}(),ne=y(977)},620:function(C,L,y){y.d(L,{Z:function(){return x}});var P=y(42);function x(E){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return E.then(function(W){return(0,P.Z)({err:null,res:W},O)}).catch(function(W){return(0,P.Z)({err:W,res:void 0},O)})}},977:function(C,L,y){y.d(L,{y:function(){return E}});var P=y(949),x=new Map,E=function(W){return{generateTopUV:function(F,b,j,$,Y){var B=b[j*3],c=b[j*3+1],ae=b[$*3],ee=b[$*3+1],J=b[Y*3],ne=b[Y*3+1],T;if(x.has(F))T=x.get(F);else{var N=W&&W.Box3||new P.Box3;if(!W||!W.Box3){var k=F.parameters.shapes.getPoints();N.setFromArray(k.map(function(H){return[H.x,H.y,0]}).flat())}var X=N.getSize(new P.Vector3);T={box:N,size:X},x.set(F,T)}var G=T.box,I=T.size;return[new P.Vector2((B-G.min.x)/I.x,(c-G.min.y)/I.y),new P.Vector2((ae-G.min.x)/I.x,(ee-G.min.y)/I.y),new P.Vector2((J-G.min.x)/I.x,(ne-G.min.y)/I.y)]},generateSideWallUV:function(F,b,j,$,Y,B){var c=b[j*3],ae=b[j*3+1],ee=b[j*3+2],J=b[$*3],ne=b[$*3+1],T=b[$*3+2],N=b[Y*3],k=b[Y*3+1],X=b[Y*3+2],G=b[B*3],I=b[B*3+1],H=b[B*3+2],re;if(x.has(b))re=x.get(b);else{var ue=new P.Box3;ue.setFromArray(b);var me=ue.getSize(new P.Vector3);re={box:ue,size:me},x.set(b,re)}var q=re.box,R=re.size;return Math.abs(ae-ne)<.01?[new P.Vector2((c-q.min.x)/R.x,(ee-q.min.z)/R.z),new P.Vector2((J-q.min.x)/R.x,(T-q.min.z)/R.z),new P.Vector2((N-q.min.x)/R.x,(X-q.min.z)/R.z),new P.Vector2((G-q.min.x)/R.x,(H-q.min.z)/R.z)]:[new P.Vector2((ae-q.min.y)/R.x,(ee-q.min.z)/R.z),new P.Vector2((ne-q.min.y)/R.x,(T-q.min.z)/R.z),new P.Vector2((k-q.min.y)/R.x,(X-q.min.z)/R.z),new P.Vector2((I-q.min.y)/R.x,(H-q.min.z)/R.z)]}}},O=function(){x.clear()}},949:function(C,L,y){var P=E=>{var O={};return y.d(O,E),O},x=E=>()=>E;C.exports=P({Box3:()=>V.Box3,BufferAttribute:()=>V.BufferAttribute,BufferGeometry:()=>V.BufferGeometry,CanvasTexture:()=>V.CanvasTexture,Color:()=>V.Color,DoubleSide:()=>V.DoubleSide,ExtrudeBufferGeometry:()=>V.ExtrudeBufferGeometry,Float32BufferAttribute:()=>V.Float32BufferAttribute,Group:()=>V.Group,LineSegments:()=>V.LineSegments,Matrix4:()=>V.Matrix4,Mesh:()=>V.Mesh,MeshBasicMaterial:()=>V.MeshBasicMaterial,NormalBlending:()=>V.NormalBlending,PlaneBufferGeometry:()=>V.PlaneBufferGeometry,PlaneGeometry:()=>V.PlaneGeometry,Points:()=>V.Points,RGBAFormat:()=>V.RGBAFormat,Ray:()=>V.Ray,ShaderChunk:()=>V.ShaderChunk,ShaderMaterial:()=>V.ShaderMaterial,Shape:()=>V.Shape,Sphere:()=>V.Sphere,Sprite:()=>V.Sprite,SpriteMaterial:()=>V.SpriteMaterial,Texture:()=>V.Texture,TextureLoader:()=>V.TextureLoader,UniformsLib:()=>V.UniformsLib,Vector2:()=>V.Vector2,Vector3:()=>V.Vector3,VideoTexture:()=>V.VideoTexture})},568:function(C,L,y){y.d(L,{Z:function(){return x}});function P(E,O,W,F,b,j,$){try{var Y=E[j]($),B=Y.value}catch(c){W(c);return}Y.done?O(B):Promise.resolve(B).then(F,b)}function x(E){return function(){var O=this,W=arguments;return new Promise(function(F,b){var j=E.apply(O,W);function $(B){P(j,F,b,$,Y,"next",B)}function Y(B){P(j,F,b,$,Y,"throw",B)}$(void 0)})}}},924:function(C,L,y){y.d(L,{Z:function(){return P}});function P(x,E,O){return E in x?Object.defineProperty(x,E,{value:O,enumerable:!0,configurable:!0,writable:!0}):x[E]=O,x}},42:function(C,L,y){y.d(L,{Z:function(){return x}});var P=y(924);function x(E){for(var O=1;O<arguments.length;O++){var W=arguments[O]!=null?arguments[O]:{},F=Object.keys(W);typeof Object.getOwnPropertySymbols=="function"&&(F=F.concat(Object.getOwnPropertySymbols(W).filter(function(b){return Object.getOwnPropertyDescriptor(W,b).enumerable}))),F.forEach(function(b){(0,P.Z)(E,b,W[b])})}return E}}},Qe={};function U(C){var L=Qe[C];if(L!==void 0)return L.exports;var y=Qe[C]={exports:{}};return It[C](y,y.exports,U),y.exports}(function(){U.n=function(C){var L=C&&C.__esModule?function(){return C.default}:function(){return C};return U.d(L,{a:L}),L}})(),function(){U.d=function(C,L){for(var y in L)U.o(L,y)&&!U.o(C,y)&&Object.defineProperty(C,y,{enumerable:!0,get:L[y]})}}(),function(){U.o=function(C,L){return Object.prototype.hasOwnProperty.call(C,L)}}();var fe={};(function(){U.d(fe,{Ei:function(){return Lt},Yo:function(){return jt},Ee:function(){return ie},x1:function(){return st},VJ:function(){return he},r7:function(){return De},XA:function(){return Ie},NB:function(){return qe},xv:function(){return A},nk:function(){return Me}});function C(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function L(e,n){return L=Object.setPrototypeOf||function(i,a){return i.__proto__=a,i},L(e,n)}function y(e,n){return L(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&&y(e,n)}var x=U(42);function E(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)):E(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}),e}function W(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function F(e){return F=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},F(e)}function b(e){return F(e)}function j(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $(e){return e&&e.constructor===Symbol?"symbol":typeof e}function Y(e,n){return n&&($(n)==="object"||typeof n=="function")?n:j(e)}function B(e){var n=W();return function(){var i=b(e),a;if(n){var t=b(this).constructor;a=Reflect.construct(i,arguments,t)}else a=i.apply(this,arguments);return Y(this,a)}}var c=U(949);function ae(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function ee(e,n,r){return ae()?ee=Reflect.construct:ee=function(a,t,o){var u=[null];u.push.apply(u,t);var h=Function.bind.apply(a,u),v=new h;return o&&y(v,o.prototype),v},ee.apply(null,arguments)}function J(e,n,r){return ee.apply(null,arguments)}function ne(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 T(e,n,r){return n&&ne(e.prototype,n),r&&ne(e,r),e}function N(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 k(e){if(Array.isArray(e))return N(e)}function X(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function G(){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 I(e,n){if(!!e){if(typeof e=="string")return N(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 N(e,n)}}function H(e){return k(e)||X(e)||I(e)||G()}var re=U(620);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,re.Z)(r.promise,n)),r}var me=e=>{var n={};return U.d(n,e),n},q=e=>()=>e,R=me({CSS2DObject:()=>zt.CSS2DObject}),ye=e=>{var n={};return U.d(n,e),n},ke=e=>()=>e,Le=ye({CSS3DObject:()=>Je.CSS3DObject,CSS3DSprite:()=>Je.CSS3DSprite}),l=U(175),s=function(e){e&&((0,l.wf)(e),e.children.forEach(function(n){n.userData.BaseObject_||s(n)}))},p=function(){"use strict";function e(){C(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=J(c.Mesh,H(a)),this},n.createGroup=function(){return this.object3d=new c.Group,this},n.createPoints=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];return this.object3d=J(c.Points,H(a)),this},n.createCSS2DObject=function(i){return this.object3d=new R.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 c.Sprite(i),this},n.add=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];var o;return(o=this.object3d).add.apply(o,H(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,H(a)),this},n.getSize=function(){var i=new c.Box3().setFromObject(this.object3d);return{min:i.min,max:i.max,size:i.getSize(new c.Vector3)}},n.traverse=function(i){i(this),this.children.forEach(function(a){a.traverse(i)})},n.dispose=function(){s(this.object3d)},T(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}(),A=function(e){"use strict";P(r,e);var n=B(r);function r(a){C(this,r);var t;return t=n.call(this),t.width=0,t.canvas=document.createElement("canvas"),t.options=(0,x.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.position,u=t.lookAt,h=t.sprite,v=t.text,d=t.sizeAttenuation;if(h){var _=new c.Sprite(new c.SpriteMaterial({transparent:!0,sizeAttenuation:d}));this.object3d=_}else{var g=new c.MeshBasicMaterial({side:c.DoubleSide,transparent:!0}),M=new c.PlaneGeometry(1,1,1,1);this.createMesh(M,g)}this.object3d.position.copy(o),u&&this.object3d.lookAt(u),this.setText(v)},i.setText=function(t,o){var u=(0,x.Z)(O((0,x.Z)({},this.options),{text:t}),o||{}),h=u.text,v=u.fontSize,d=u.fontFamily,_=u.fontWeight,g=u.flipX,M=u.scale,w=this.canvas;w.width=v*h.length*2,w.height=v;var S=w.getContext("2d");S.font="".concat(_," ").concat(v,"px/1 ").concat(d);var f=S.measureText(h).width;w.width=f,this.width=f,S=w.getContext("2d"),S.clearRect(0,0,w.width,w.height),g&&S.scale(-1,1),S.font="".concat(_," ").concat(v,"px/1 ").concat(d),S.textBaseline="middle",S.fillStyle="#ffffff",S.fillText(h,g?f*-1:0,w.height/2),S.restore();var z=new c.Texture(w);z.anisotropy=16,z.needsUpdate=!0;var D=this.object3d;D.material.map&&D.material.map.dispose(),D.material.map=z,D.material.needsUpdate=!0,D.scale.set(z.image.width*M,z.image.height*M,1)},r}(p),m=U(568),Q=U(666),Z=U.n(Q),ie=function(e){"use strict";P(r,e);var n=B(r);function r(a){C(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,m.Z)(Z().mark(function o(){var u,h,v,d,_,g,M,w,S,f;return Z().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return u=t.options,h=u.transparent,v=u.blending,d=u.src,_=u.depthWrite,g=u.alphaTest,M=u.sprite,w=u.sizeAttenuation,D.next=3,new c.TextureLoader().loadAsync(d);case 3:return S=D.sent,f=M?new c.SpriteMaterial({map:S,transparent:h!=null?h:!1,blending:v!=null?v:c.NormalBlending,depthWrite:_!=null?_:!0,alphaTest:g!=null?g:0,sizeAttenuation:w!=null?w:!0}):new c.MeshBasicMaterial({map:S,transparent:h!=null?h:!1,blending:v!=null?v:c.NormalBlending,depthWrite:_!=null?_:!0,alphaTest:g!=null?g:0}),D.abrupt("return",f);case 6:case"end":return D.stop()}},o)}))()},i.create=function(){var t=this;return(0,m.Z)(Z().mark(function o(){var u,h,v,d,_,g,M,w;return Z().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(u=t.options,h=u.scale,v=u.position,d=u.src,_=u.cache,g=u.sprite,!(_&&!_.get(d))){f.next=7;break}return _.init(d),f.next=5,t.getMaterial();case 5:M=f.sent,_.set(d,M);case 7:if(!_){f.next=13;break}return f.next=10,_.get(d);case 10:f.t0=f.sent,f.next=16;break;case 13:return f.next=15,t.getMaterial();case 15:f.t0=f.sent;case 16:w=f.t0,t.texture=w.map,g?t.createSprite(w):t.createMesh(new c.PlaneBufferGeometry(1,1),w),h&&t.setScale(h),v&&t.object3d.position.copy(v);case 21:case"end":return f.stop()}},o)}))()},i.setScale=function(t){this.object3d.scale.set(this.texture.image.width*t,this.texture.image.height*t,1)},r}(p);function oe(e,n){for(;!Object.prototype.hasOwnProperty.call(e,n)&&(e=b(e),e!==null););return e}function te(e,n,r){return typeof Reflect!="undefined"&&Reflect.get?te=Reflect.get:te=function(a,t,o){var u=oe(a,t);if(!!u){var h=Object.getOwnPropertyDescriptor(u,t);return h.get?h.get.call(o||a):h.value}},te(e,n,r)}function xe(e,n,r){return te(e,n,r)}var Me=function(e){"use strict";P(r,e);var n=B(r);function r(a){C(this,r);var t;return t=n.call(this),t.options=(0,x.Z)({},{autoPlay:!0,loop:!0},a),t}var i=r.prototype;return i.getMaterial=function(){var t=this.options,o=t.src,u=t.transparent,h=t.blending,v=t.depthWrite,d=t.format,_=t.autoPlay,g=t.loop,M=t.alphaTest,w=t.sprite,S=ue(),f=document.createElement("video");return f.addEventListener("loadedmetadata",function(){var z=new c.VideoTexture(f);z.format=d!=null?d:c.RGBAFormat,z.needsUpdate=!0;var D=w?new c.SpriteMaterial({map:z,transparent:u!=null?u:!1,blending:h!=null?h:c.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:M!=null?M:0}):new c.MeshBasicMaterial({map:z,transparent:u!=null?u:!1,blending:h!=null?h:c.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:M!=null?M:0});S.resolve(D)},!1),f.src=o,f.muted=!0,f.autoplay=_,f.loop=g,f.preload="auto",S.promise},i.create=function(){var t=this;return(0,m.Z)(Z().mark(function o(){var u,h,v,d,_,g,M,w;return Z().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(u=t.options,h=u.scale,v=u.position,d=u.src,_=u.cache,g=u.sprite,!(_&&!_.get(d))){f.next=7;break}return _.init(d),f.next=5,t.getMaterial();case 5:M=f.sent,_.set(d,M);case 7:if(!_){f.next=13;break}return f.next=10,_.get(d);case 10:f.t0=f.sent,f.next=16;break;case 13:return f.next=15,t.getMaterial();case 15:f.t0=f.sent;case 16:w=f.t0,t.video=w.map.image,g?t.createSprite(w):t.createMesh(new c.PlaneBufferGeometry(1,1),w),h&&t.setScale(h),v&&t.object3d.position.copy(v);case 21:case"end":return f.stop()}},o)}))()},i.setScale=function(t){this.object3d.scale.set(this.video.videoWidth*t,this.video.videoHeight*t,1)},i.render=function(){var t=this.options.autoPlay;t&&this.video.play()},i.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),xe(b(r.prototype),"dispose",this).call(this)},r}(p),_e=function(e){"use strict";P(r,e);var n=B(r);function r(a){C(this,r);var t;return t=n.call(this),t.options=(0,x.Z)({},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.position,u=t.children,h=t.onClick,v=t.zIndexFix,d=document.createElement("div");d.appendChild(u),this.createCSS2DObject(d),o&&this.object3d.position.copy(o),h&&d.addEventListener("click",h),v&&(this.object3d.userData.zIndexFix=v)},i.getMaterial=function(t){return(0,m.Z)(Z().mark(function o(){var u,h,v,d;return Z().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return u=document.createElement("canvas"),u.width=256,u.height=256,h=u.getContext("2d"),h.fillStyle="#ff0000",h.fillRect(0,0,256,256),v=new c.CanvasTexture(u),d=new c.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,u=o===void 0?!1:o,h=t.scale,v=h===void 0?new c.Vector3(1,1,1):h,d=t.position,_=d===void 0?new c.Vector3(0,0,0):d,g=t.cache,M=this;return(0,m.Z)(Z().mark(function w(){var S,f,z,D;return Z().wrap(function(K){for(;;)switch(K.prev=K.next){case 0:if(S="node-create-pick-object",!(g&&!g.get(S))){K.next=7;break}return g.init(S),K.next=5,M.getMaterial(u);case 5:f=K.sent,g.set(S,f);case 7:if(!g){K.next=13;break}return K.next=10,g.get(S);case 10:K.t0=K.sent,K.next=16;break;case 13:return K.next=15,M.getMaterial(u);case 15:K.t0=K.sent;case 16:z=K.t0,D=new c.Sprite(z),D.scale.set(z.map.image.width*v.x,z.map.image.height*v.y,1),D.position.copy(_),M.add(D),M.pickObject=D;case 22:case"end":return K.stop()}},w)}))()},i.dispose=function(){var t=this.options.onClick;if(t){var o;(o=this.object3d.element)===null||o===void 0||o.removeEventListener("click",t)}xe(b(r.prototype),"dispose",this).call(this)},r}(p),qe=_e,et=`
1
+ import*as Ye from"idb-keyval";import*as V from"three";import*as zt from"three/examples/jsm/renderers/CSS2DRenderer";import*as Je from"three/examples/jsm/renderers/CSS3DRenderer";import*as Dt from"popmotion";import*as Fe from"d3-array";import*as Vt from"earcut";import*as Wt from"@turf/boolean-clockwise";import*as Gt from"delaunator";import*as Ut from"@turf/boolean-point-in-polygon";import*as Te from"d3-geo";import*as Nt from"d3-geo-voronoi";import*as Ft from"d3-scale";var It={666:function(C){var L=function(y){"use strict";var P=Object.prototype,x=P.hasOwnProperty,E,O=typeof Symbol=="function"?Symbol:{},W=O.iterator||"@@iterator",F=O.asyncIterator||"@@asyncIterator",b=O.toStringTag||"@@toStringTag";function j(l,s,p){return Object.defineProperty(l,s,{value:p,enumerable:!0,configurable:!0,writable:!0}),l[s]}try{j({},"")}catch(l){j=function(s,p,A){return s[p]=A}}function $(l,s,p,A){var m=s&&s.prototype instanceof ne?s:ne,Q=Object.create(m.prototype),Z=new ye(A||[]);return Q._invoke=ue(l,p,Z),Q}y.wrap=$;function Y(l,s,p){try{return{type:"normal",arg:l.call(s,p)}}catch(A){return{type:"throw",arg:A}}}var R="suspendedStart",c="suspendedYield",ae="executing",ee="completed",J={};function ne(){}function T(){}function N(){}var k={};j(k,W,function(){return this});var X=Object.getPrototypeOf,G=X&&X(X(ke([])));G&&G!==P&&x.call(G,W)&&(k=G);var I=N.prototype=ne.prototype=Object.create(k);T.prototype=N,j(I,"constructor",N),j(N,"constructor",T),T.displayName=j(N,b,"GeneratorFunction");function H(l){["next","throw","return"].forEach(function(s){j(l,s,function(p){return this._invoke(s,p)})})}y.isGeneratorFunction=function(l){var s=typeof l=="function"&&l.constructor;return s?s===T||(s.displayName||s.name)==="GeneratorFunction":!1},y.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,N):(l.__proto__=N,j(l,b,"GeneratorFunction")),l.prototype=Object.create(I),l},y.awrap=function(l){return{__await:l}};function re(l,s){function p(Q,Z,ie,oe){var te=Y(l[Q],l,Z);if(te.type==="throw")oe(te.arg);else{var xe=te.arg,Me=xe.value;return Me&&typeof Me=="object"&&x.call(Me,"__await")?s.resolve(Me.__await).then(function(_e){p("next",_e,ie,oe)},function(_e){p("throw",_e,ie,oe)}):s.resolve(Me).then(function(_e){xe.value=_e,ie(xe)},function(_e){return p("throw",_e,ie,oe)})}}var A;function m(Q,Z){function ie(){return new s(function(oe,te){p(Q,Z,oe,te)})}return A=A?A.then(ie,ie):ie()}this._invoke=m}H(re.prototype),j(re.prototype,F,function(){return this}),y.AsyncIterator=re,y.async=function(l,s,p,A,m){m===void 0&&(m=Promise);var Q=new re($(l,s,p,A),m);return y.isGeneratorFunction(s)?Q:Q.next().then(function(Z){return Z.done?Z.value:Q.next()})};function ue(l,s,p){var A=R;return function(Q,Z){if(A===ae)throw new Error("Generator is already running");if(A===ee){if(Q==="throw")throw Z;return Le()}for(p.method=Q,p.arg=Z;;){var ie=p.delegate;if(ie){var oe=me(ie,p);if(oe){if(oe===J)continue;return oe}}if(p.method==="next")p.sent=p._sent=p.arg;else if(p.method==="throw"){if(A===R)throw A=ee,p.arg;p.dispatchException(p.arg)}else p.method==="return"&&p.abrupt("return",p.arg);A=ae;var te=Y(l,s,p);if(te.type==="normal"){if(A=p.done?ee:c,te.arg===J)continue;return{value:te.arg,done:p.done}}else te.type==="throw"&&(A=ee,p.method="throw",p.arg=te.arg)}}}function me(l,s){var p=l.iterator[s.method];if(p===E){if(s.delegate=null,s.method==="throw"){if(l.iterator.return&&(s.method="return",s.arg=E,me(l,s),s.method==="throw"))return J;s.method="throw",s.arg=new TypeError("The iterator does not provide a 'throw' method")}return J}var A=Y(p,l.iterator,s.arg);if(A.type==="throw")return s.method="throw",s.arg=A.arg,s.delegate=null,J;var m=A.arg;if(!m)return s.method="throw",s.arg=new TypeError("iterator result is not an object"),s.delegate=null,J;if(m.done)s[l.resultName]=m.value,s.next=l.nextLoc,s.method!=="return"&&(s.method="next",s.arg=E);else return m;return s.delegate=null,J}H(I),j(I,b,"Generator"),j(I,W,function(){return this}),j(I,"toString",function(){return"[object Generator]"});function q(l){var s={tryLoc:l[0]};1 in l&&(s.catchLoc=l[1]),2 in l&&(s.finallyLoc=l[2],s.afterLoc=l[3]),this.tryEntries.push(s)}function B(l){var s=l.completion||{};s.type="normal",delete s.arg,l.completion=s}function ye(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(q,this),this.reset(!0)}y.keys=function(l){var s=[];for(var p in l)s.push(p);return s.reverse(),function A(){for(;s.length;){var m=s.pop();if(m in l)return A.value=m,A.done=!1,A}return A.done=!0,A}};function ke(l){if(l){var s=l[W];if(s)return s.call(l);if(typeof l.next=="function")return l;if(!isNaN(l.length)){var p=-1,A=function m(){for(;++p<l.length;)if(x.call(l,p))return m.value=l[p],m.done=!1,m;return m.value=E,m.done=!0,m};return A.next=A}}return{next:Le}}y.values=ke;function Le(){return{value:E,done:!0}}return ye.prototype={constructor:ye,reset:function(l){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(B),!l)for(var s in this)s.charAt(0)==="t"&&x.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=E)},stop:function(){this.done=!0;var l=this.tryEntries[0],s=l.completion;if(s.type==="throw")throw s.arg;return this.rval},dispatchException:function(l){if(this.done)throw l;var s=this;function p(oe,te){return Q.type="throw",Q.arg=l,s.next=oe,te&&(s.method="next",s.arg=E),!!te}for(var A=this.tryEntries.length-1;A>=0;--A){var m=this.tryEntries[A],Q=m.completion;if(m.tryLoc==="root")return p("end");if(m.tryLoc<=this.prev){var Z=x.call(m,"catchLoc"),ie=x.call(m,"finallyLoc");if(Z&&ie){if(this.prev<m.catchLoc)return p(m.catchLoc,!0);if(this.prev<m.finallyLoc)return p(m.finallyLoc)}else if(Z){if(this.prev<m.catchLoc)return p(m.catchLoc,!0)}else if(ie){if(this.prev<m.finallyLoc)return p(m.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(l,s){for(var p=this.tryEntries.length-1;p>=0;--p){var A=this.tryEntries[p];if(A.tryLoc<=this.prev&&x.call(A,"finallyLoc")&&this.prev<A.finallyLoc){var m=A;break}}m&&(l==="break"||l==="continue")&&m.tryLoc<=s&&s<=m.finallyLoc&&(m=null);var Q=m?m.completion:{};return Q.type=l,Q.arg=s,m?(this.method="next",this.next=m.finallyLoc,J):this.complete(Q)},complete:function(l,s){if(l.type==="throw")throw l.arg;return l.type==="break"||l.type==="continue"?this.next=l.arg:l.type==="return"?(this.rval=this.arg=l.arg,this.method="return",this.next="end"):l.type==="normal"&&s&&(this.next=s),J},finish:function(l){for(var s=this.tryEntries.length-1;s>=0;--s){var p=this.tryEntries[s];if(p.finallyLoc===l)return this.complete(p.completion,p.afterLoc),B(p),J}},catch:function(l){for(var s=this.tryEntries.length-1;s>=0;--s){var p=this.tryEntries[s];if(p.tryLoc===l){var A=p.completion;if(A.type==="throw"){var m=A.arg;B(p)}return m}}throw new Error("illegal catch attempt")},delegateYield:function(l,s,p){return this.delegate={iterator:ke(l),resultName:s,nextLoc:p},this.method==="next"&&(this.arg=E),J}},y}(C.exports);try{regeneratorRuntime=L}catch(y){typeof globalThis=="object"?globalThis.regeneratorRuntime=L:Function("r","regeneratorRuntime = r")(L)}},182:function(C,L,y){y.d(L,{Z:function(){return P}});function P(x){if(x.geometry&&x.geometry.dispose(),x.material){var E=Array.isArray(x.material)?x.material:[x.material];E.forEach(function(O){var W,F,b,j,$,Y,R,c,ae,ee,J,ne,T;(W=O.map)===null||W===void 0||W.dispose(),(F=O.lightMap)===null||F===void 0||F.dispose(),(b=O.bumpMap)===null||b===void 0||b.dispose(),(j=O.normalMap)===null||j===void 0||j.dispose(),($=O.specularMap)===null||$===void 0||$.dispose(),(Y=O.envMap)===null||Y===void 0||Y.dispose(),(R=O.alphaMap)===null||R===void 0||R.dispose(),(c=O.aoMap)===null||c===void 0||c.dispose(),(ae=O.displacementMap)===null||ae===void 0||ae.dispose(),(ee=O.emissiveMap)===null||ee===void 0||ee.dispose(),(J=O.gradientMap)===null||J===void 0||J.dispose(),(ne=O.metalnessMap)===null||ne===void 0||ne.dispose(),(T=O.roughnessMap)===null||T===void 0||T.dispose(),O.dispose()})}}},175:function(C,L,y){y.d(L,{wf:function(){return O.Z}});var P=y(666),x=y.n(P),E=null,O=y(182),W=y(949);function F(T){if(T.material){var N=Array.isArray(T.material)?T.material:[T.material];N.forEach(function(k){var X,G;(X=k.color)===null||X===void 0||X.convertSRGBToLinear(),(G=k.emissive)===null||G===void 0||G.convertSRGBToLinear(),k.map&&(k.map.encoding=THREE.sRGBEncoding),k.emissiveMap&&(k.emissiveMap.encoding=THREE.sRGBEncoding)})}}var b=y(568),j=y(924),$=T=>{var N={};return y.d(N,T),N},Y=T=>()=>T,R=$({get:()=>Ye.get,set:()=>Ye.set}),c=y(620),ae=null,ee=null,J=function(){var T=(0,b.Z)(x().mark(function N(k,X){var G,I,H,re,ue,me;return x().wrap(function(B){for(;;)switch(B.prev=B.next){case 0:return G=X.version,B.next=4,(0,R.get)(k);case 4:if(H=B.sent,!(H&&H[G])){B.next=9;break}I=H[G],B.next=15;break;case 9:return B.next=11,(0,c.Z)(fetch(k).then(function(ye){if(ye.ok)return ye.blob();throw new Error}));case 11:re=B.sent,ue=re.res,me=re.err,me||(I=ue,(0,R.set)(k,(0,j.Z)({},G,ue)));case 15:return B.abrupt("return",I?{url:URL.createObjectURL(I)}:{url:k});case 16:case"end":return B.stop()}},N)}));return function(k,X){return T.apply(this,arguments)}}(),ne=y(977)},620:function(C,L,y){y.d(L,{Z:function(){return x}});var P=y(42);function x(E){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return E.then(function(W){return(0,P.Z)({err:null,res:W},O)}).catch(function(W){return(0,P.Z)({err:W,res:void 0},O)})}},977:function(C,L,y){y.d(L,{y:function(){return E}});var P=y(949),x=new Map,E=function(W){return{generateTopUV:function(F,b,j,$,Y){var R=b[j*3],c=b[j*3+1],ae=b[$*3],ee=b[$*3+1],J=b[Y*3],ne=b[Y*3+1],T;if(x.has(F))T=x.get(F);else{var N=W&&W.box3||new P.Box3;if(!W||!W.box3){var k=F.parameters.shapes.getPoints();N.setFromArray(k.map(function(H){return[H.x,H.y,0]}).flat())}var X=N.getSize(new P.Vector3);T={box:N,size:X},x.set(F,T)}var G=T.box,I=T.size;return[new P.Vector2((R-G.min.x)/I.x,(c-G.min.y)/I.y),new P.Vector2((ae-G.min.x)/I.x,(ee-G.min.y)/I.y),new P.Vector2((J-G.min.x)/I.x,(ne-G.min.y)/I.y)]},generateSideWallUV:function(F,b,j,$,Y,R){var c=b[j*3],ae=b[j*3+1],ee=b[j*3+2],J=b[$*3],ne=b[$*3+1],T=b[$*3+2],N=b[Y*3],k=b[Y*3+1],X=b[Y*3+2],G=b[R*3],I=b[R*3+1],H=b[R*3+2],re;if(x.has(b))re=x.get(b);else{var ue=new P.Box3;ue.setFromArray(b);var me=ue.getSize(new P.Vector3);re={box:ue,size:me},x.set(b,re)}var q=re.box,B=re.size;return Math.abs(ae-ne)<.01?[new P.Vector2((c-q.min.x)/B.x,(ee-q.min.z)/B.z),new P.Vector2((J-q.min.x)/B.x,(T-q.min.z)/B.z),new P.Vector2((N-q.min.x)/B.x,(X-q.min.z)/B.z),new P.Vector2((G-q.min.x)/B.x,(H-q.min.z)/B.z)]:[new P.Vector2((ae-q.min.y)/B.x,(ee-q.min.z)/B.z),new P.Vector2((ne-q.min.y)/B.x,(T-q.min.z)/B.z),new P.Vector2((k-q.min.y)/B.x,(X-q.min.z)/B.z),new P.Vector2((I-q.min.y)/B.x,(H-q.min.z)/B.z)]}}},O=function(){x.clear()}},949:function(C,L,y){var P=E=>{var O={};return y.d(O,E),O},x=E=>()=>E;C.exports=P({Box3:()=>V.Box3,BufferAttribute:()=>V.BufferAttribute,BufferGeometry:()=>V.BufferGeometry,CanvasTexture:()=>V.CanvasTexture,Color:()=>V.Color,DoubleSide:()=>V.DoubleSide,ExtrudeBufferGeometry:()=>V.ExtrudeBufferGeometry,Float32BufferAttribute:()=>V.Float32BufferAttribute,Group:()=>V.Group,LineSegments:()=>V.LineSegments,Matrix4:()=>V.Matrix4,Mesh:()=>V.Mesh,MeshBasicMaterial:()=>V.MeshBasicMaterial,NormalBlending:()=>V.NormalBlending,PlaneBufferGeometry:()=>V.PlaneBufferGeometry,PlaneGeometry:()=>V.PlaneGeometry,Points:()=>V.Points,RGBAFormat:()=>V.RGBAFormat,Ray:()=>V.Ray,ShaderChunk:()=>V.ShaderChunk,ShaderMaterial:()=>V.ShaderMaterial,Shape:()=>V.Shape,Sphere:()=>V.Sphere,Sprite:()=>V.Sprite,SpriteMaterial:()=>V.SpriteMaterial,Texture:()=>V.Texture,TextureLoader:()=>V.TextureLoader,UniformsLib:()=>V.UniformsLib,Vector2:()=>V.Vector2,Vector3:()=>V.Vector3,VideoTexture:()=>V.VideoTexture})},568:function(C,L,y){y.d(L,{Z:function(){return x}});function P(E,O,W,F,b,j,$){try{var Y=E[j]($),R=Y.value}catch(c){W(c);return}Y.done?O(R):Promise.resolve(R).then(F,b)}function x(E){return function(){var O=this,W=arguments;return new Promise(function(F,b){var j=E.apply(O,W);function $(R){P(j,F,b,$,Y,"next",R)}function Y(R){P(j,F,b,$,Y,"throw",R)}$(void 0)})}}},924:function(C,L,y){y.d(L,{Z:function(){return P}});function P(x,E,O){return E in x?Object.defineProperty(x,E,{value:O,enumerable:!0,configurable:!0,writable:!0}):x[E]=O,x}},42:function(C,L,y){y.d(L,{Z:function(){return x}});var P=y(924);function x(E){for(var O=1;O<arguments.length;O++){var W=arguments[O]!=null?arguments[O]:{},F=Object.keys(W);typeof Object.getOwnPropertySymbols=="function"&&(F=F.concat(Object.getOwnPropertySymbols(W).filter(function(b){return Object.getOwnPropertyDescriptor(W,b).enumerable}))),F.forEach(function(b){(0,P.Z)(E,b,W[b])})}return E}}},Qe={};function U(C){var L=Qe[C];if(L!==void 0)return L.exports;var y=Qe[C]={exports:{}};return It[C](y,y.exports,U),y.exports}(function(){U.n=function(C){var L=C&&C.__esModule?function(){return C.default}:function(){return C};return U.d(L,{a:L}),L}})(),function(){U.d=function(C,L){for(var y in L)U.o(L,y)&&!U.o(C,y)&&Object.defineProperty(C,y,{enumerable:!0,get:L[y]})}}(),function(){U.o=function(C,L){return Object.prototype.hasOwnProperty.call(C,L)}}();var fe={};(function(){U.d(fe,{Ei:function(){return Lt},Yo:function(){return jt},Ee:function(){return ie},x1:function(){return st},VJ:function(){return he},r7:function(){return De},XA:function(){return Ie},NB:function(){return qe},xv:function(){return A},nk:function(){return Me}});function C(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function L(e,n){return L=Object.setPrototypeOf||function(i,a){return i.__proto__=a,i},L(e,n)}function y(e,n){return L(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&&y(e,n)}var x=U(42);function E(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)):E(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}),e}function W(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function F(e){return F=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},F(e)}function b(e){return F(e)}function j(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $(e){return e&&e.constructor===Symbol?"symbol":typeof e}function Y(e,n){return n&&($(n)==="object"||typeof n=="function")?n:j(e)}function R(e){var n=W();return function(){var i=b(e),a;if(n){var t=b(this).constructor;a=Reflect.construct(i,arguments,t)}else a=i.apply(this,arguments);return Y(this,a)}}var c=U(949);function ae(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function ee(e,n,r){return ae()?ee=Reflect.construct:ee=function(a,t,o){var u=[null];u.push.apply(u,t);var h=Function.bind.apply(a,u),v=new h;return o&&y(v,o.prototype),v},ee.apply(null,arguments)}function J(e,n,r){return ee.apply(null,arguments)}function ne(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 T(e,n,r){return n&&ne(e.prototype,n),r&&ne(e,r),e}function N(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 k(e){if(Array.isArray(e))return N(e)}function X(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function G(){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 I(e,n){if(!!e){if(typeof e=="string")return N(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 N(e,n)}}function H(e){return k(e)||X(e)||I(e)||G()}var re=U(620);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,re.Z)(r.promise,n)),r}var me=e=>{var n={};return U.d(n,e),n},q=e=>()=>e,B=me({CSS2DObject:()=>zt.CSS2DObject}),ye=e=>{var n={};return U.d(n,e),n},ke=e=>()=>e,Le=ye({CSS3DObject:()=>Je.CSS3DObject,CSS3DSprite:()=>Je.CSS3DSprite}),l=U(175),s=function(e){e&&((0,l.wf)(e),e.children.forEach(function(n){n.userData.BaseObject_||s(n)}))},p=function(){"use strict";function e(){C(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=J(c.Mesh,H(a)),this},n.createGroup=function(){return this.object3d=new c.Group,this},n.createPoints=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];return this.object3d=J(c.Points,H(a)),this},n.createCSS2DObject=function(i){return this.object3d=new B.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 c.Sprite(i),this},n.add=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];var o;return(o=this.object3d).add.apply(o,H(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,H(a)),this},n.getSize=function(){var i=new c.Box3().setFromObject(this.object3d);return{min:i.min,max:i.max,size:i.getSize(new c.Vector3)}},n.traverse=function(i){i(this),this.children.forEach(function(a){a.traverse(i)})},n.dispose=function(){s(this.object3d)},T(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}(),A=function(e){"use strict";P(r,e);var n=R(r);function r(a){C(this,r);var t;return t=n.call(this),t.width=0,t.canvas=document.createElement("canvas"),t.options=(0,x.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.position,u=t.lookAt,h=t.sprite,v=t.text,d=t.sizeAttenuation;if(h){var _=new c.Sprite(new c.SpriteMaterial({transparent:!0,sizeAttenuation:d}));this.object3d=_}else{var g=new c.MeshBasicMaterial({side:c.DoubleSide,transparent:!0}),M=new c.PlaneGeometry(1,1,1,1);this.createMesh(M,g)}this.object3d.position.copy(o),u&&this.object3d.lookAt(u),this.setText(v)},i.setText=function(t,o){var u=(0,x.Z)(O((0,x.Z)({},this.options),{text:t}),o||{}),h=u.text,v=u.fontSize,d=u.fontFamily,_=u.fontWeight,g=u.flipX,M=u.scale,w=this.canvas;w.width=v*h.length*2,w.height=v;var S=w.getContext("2d");S.font="".concat(_," ").concat(v,"px/1 ").concat(d);var f=S.measureText(h).width;w.width=f,this.width=f,S=w.getContext("2d"),S.clearRect(0,0,w.width,w.height),g&&S.scale(-1,1),S.font="".concat(_," ").concat(v,"px/1 ").concat(d),S.textBaseline="middle",S.fillStyle="#ffffff",S.fillText(h,g?f*-1:0,w.height/2),S.restore();var z=new c.Texture(w);z.anisotropy=16,z.needsUpdate=!0;var D=this.object3d;D.material.map&&D.material.map.dispose(),D.material.map=z,D.material.needsUpdate=!0,D.scale.set(z.image.width*M,z.image.height*M,1)},r}(p),m=U(568),Q=U(666),Z=U.n(Q),ie=function(e){"use strict";P(r,e);var n=R(r);function r(a){C(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,m.Z)(Z().mark(function o(){var u,h,v,d,_,g,M,w,S,f;return Z().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return u=t.options,h=u.transparent,v=u.blending,d=u.src,_=u.depthWrite,g=u.alphaTest,M=u.sprite,w=u.sizeAttenuation,D.next=3,new c.TextureLoader().loadAsync(d);case 3:return S=D.sent,f=M?new c.SpriteMaterial({map:S,transparent:h!=null?h:!1,blending:v!=null?v:c.NormalBlending,depthWrite:_!=null?_:!0,alphaTest:g!=null?g:0,sizeAttenuation:w!=null?w:!0}):new c.MeshBasicMaterial({map:S,transparent:h!=null?h:!1,blending:v!=null?v:c.NormalBlending,depthWrite:_!=null?_:!0,alphaTest:g!=null?g:0}),D.abrupt("return",f);case 6:case"end":return D.stop()}},o)}))()},i.create=function(){var t=this;return(0,m.Z)(Z().mark(function o(){var u,h,v,d,_,g,M,w;return Z().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(u=t.options,h=u.scale,v=u.position,d=u.src,_=u.cache,g=u.sprite,!(_&&!_.get(d))){f.next=7;break}return _.init(d),f.next=5,t.getMaterial();case 5:M=f.sent,_.set(d,M);case 7:if(!_){f.next=13;break}return f.next=10,_.get(d);case 10:f.t0=f.sent,f.next=16;break;case 13:return f.next=15,t.getMaterial();case 15:f.t0=f.sent;case 16:w=f.t0,t.texture=w.map,g?t.createSprite(w):t.createMesh(new c.PlaneBufferGeometry(1,1),w),h&&t.setScale(h),v&&t.object3d.position.copy(v);case 21:case"end":return f.stop()}},o)}))()},i.setScale=function(t){this.object3d.scale.set(this.texture.image.width*t,this.texture.image.height*t,1)},r}(p);function oe(e,n){for(;!Object.prototype.hasOwnProperty.call(e,n)&&(e=b(e),e!==null););return e}function te(e,n,r){return typeof Reflect!="undefined"&&Reflect.get?te=Reflect.get:te=function(a,t,o){var u=oe(a,t);if(!!u){var h=Object.getOwnPropertyDescriptor(u,t);return h.get?h.get.call(o||a):h.value}},te(e,n,r)}function xe(e,n,r){return te(e,n,r)}var Me=function(e){"use strict";P(r,e);var n=R(r);function r(a){C(this,r);var t;return t=n.call(this),t.options=(0,x.Z)({},{autoPlay:!0,loop:!0},a),t}var i=r.prototype;return i.getMaterial=function(){var t=this.options,o=t.src,u=t.transparent,h=t.blending,v=t.depthWrite,d=t.format,_=t.autoPlay,g=t.loop,M=t.alphaTest,w=t.sprite,S=ue(),f=document.createElement("video");return f.addEventListener("loadedmetadata",function(){var z=new c.VideoTexture(f);z.format=d!=null?d:c.RGBAFormat,z.needsUpdate=!0;var D=w?new c.SpriteMaterial({map:z,transparent:u!=null?u:!1,blending:h!=null?h:c.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:M!=null?M:0}):new c.MeshBasicMaterial({map:z,transparent:u!=null?u:!1,blending:h!=null?h:c.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:M!=null?M:0});S.resolve(D)},!1),f.src=o,f.muted=!0,f.autoplay=_,f.loop=g,f.preload="auto",S.promise},i.create=function(){var t=this;return(0,m.Z)(Z().mark(function o(){var u,h,v,d,_,g,M,w;return Z().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(u=t.options,h=u.scale,v=u.position,d=u.src,_=u.cache,g=u.sprite,!(_&&!_.get(d))){f.next=7;break}return _.init(d),f.next=5,t.getMaterial();case 5:M=f.sent,_.set(d,M);case 7:if(!_){f.next=13;break}return f.next=10,_.get(d);case 10:f.t0=f.sent,f.next=16;break;case 13:return f.next=15,t.getMaterial();case 15:f.t0=f.sent;case 16:w=f.t0,t.video=w.map.image,g?t.createSprite(w):t.createMesh(new c.PlaneBufferGeometry(1,1),w),h&&t.setScale(h),v&&t.object3d.position.copy(v);case 21:case"end":return f.stop()}},o)}))()},i.setScale=function(t){this.object3d.scale.set(this.video.videoWidth*t,this.video.videoHeight*t,1)},i.render=function(){var t=this.options.autoPlay;t&&this.video.play()},i.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),xe(b(r.prototype),"dispose",this).call(this)},r}(p),_e=function(e){"use strict";P(r,e);var n=R(r);function r(a){C(this,r);var t;return t=n.call(this),t.options=(0,x.Z)({},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.position,u=t.children,h=t.onClick,v=t.zIndexFix,d=document.createElement("div");d.appendChild(u),this.createCSS2DObject(d),o&&this.object3d.position.copy(o),h&&d.addEventListener("click",h),v&&(this.object3d.userData.zIndexFix=v)},i.getMaterial=function(t){return(0,m.Z)(Z().mark(function o(){var u,h,v,d;return Z().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return u=document.createElement("canvas"),u.width=256,u.height=256,h=u.getContext("2d"),h.fillStyle="#ff0000",h.fillRect(0,0,256,256),v=new c.CanvasTexture(u),d=new c.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,u=o===void 0?!1:o,h=t.scale,v=h===void 0?new c.Vector3(1,1,1):h,d=t.position,_=d===void 0?new c.Vector3(0,0,0):d,g=t.cache,M=this;return(0,m.Z)(Z().mark(function w(){var S,f,z,D;return Z().wrap(function(K){for(;;)switch(K.prev=K.next){case 0:if(S="node-create-pick-object",!(g&&!g.get(S))){K.next=7;break}return g.init(S),K.next=5,M.getMaterial(u);case 5:f=K.sent,g.set(S,f);case 7:if(!g){K.next=13;break}return K.next=10,g.get(S);case 10:K.t0=K.sent,K.next=16;break;case 13:return K.next=15,M.getMaterial(u);case 15:K.t0=K.sent;case 16:z=K.t0,D=new c.Sprite(z),D.scale.set(z.map.image.width*v.x,z.map.image.height*v.y,1),D.position.copy(_),M.add(D),M.pickObject=D;case 22:case"end":return K.stop()}},w)}))()},i.dispose=function(){var t=this.options.onClick;if(t){var o;(o=this.object3d.element)===null||o===void 0||o.removeEventListener("click",t)}xe(b(r.prototype),"dispose",this).call(this)},r}(p),qe=_e,et=`
2
2
  `.concat(c.ShaderChunk.logdepthbuf_pars_vertex,`
3
3
  `).concat(c.ShaderChunk.fog_pars_vertex,`
4
4
  attribute vec3 previous;
@@ -129,4 +129,4 @@ void main() {
129
129
  gl_FragColor.a *= step(vCounters, visibility);
130
130
  `).concat(c.ShaderChunk.fog_fragment,`
131
131
  }
132
- `),he=function(e){"use strict";P(r,e);var n=B(r);function r(){C(this,r);var i;return i=n.call(this),i.isMeshLine=!0,i.type="MeshLine",i.positions=[],i.previous=[],i.next=[],i.side=[],i.width=[],i.indices_array=[],i.uvs=[],i.counters=[],i._points=[],i._geom=null,i.widthCallback=null,i.matrixWorld=new c.Matrix4,Object.defineProperties(j(i),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(t){this.setGeometry(t,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(t){this.setPoints(t,this.widthCallback)}}}),i}return r}(c.BufferGeometry);he.prototype.setMatrixWorld=function(e){this.matrixWorld=e},he.prototype.setGeometry=function(e,n){this._geometry=e,this.setPoints(e.getAttribute("position").array,n)},he.prototype.setPoints=function(e,n){if(!(e instanceof Float32Array)&&!(e instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=e,this.widthCallback=n,this.positions=[],this.counters=[],e.length&&e[0]instanceof c.Vector3)for(var r=0;r<e.length;r++){var i=e[r],a=r/e.length;this.positions.push(i.x,i.y,i.z),this.positions.push(i.x,i.y,i.z),this.counters.push(a),this.counters.push(a)}else for(var r=0;r<e.length;r+=3){var a=r/e.length;this.positions.push(e[r],e[r+1],e[r+2]),this.positions.push(e[r],e[r+1],e[r+2]),this.counters.push(a),this.counters.push(a)}this.process()};function Ie(e,n){var r=new c.Matrix4,i=new c.Ray,a=new c.Sphere,t=new c.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),a.copy(o.boundingSphere),a.applyMatrix4(this.matrixWorld),e.ray.intersectSphere(a,t)!==!1){r.copy(this.matrixWorld).invert(),i.copy(e.ray).applyMatrix4(r);var u=new c.Vector3,h=new c.Vector3,v=new c.Vector3,d=this instanceof c.LineSegments?2:1,_=o.index,g=o.attributes;if(_!==null)for(var M=_.array,w=g.position.array,S=g.width.array,f=0,z=M.length-1;f<z;f+=d){var D=M[f],se=M[f+1];u.fromArray(w,D*3),h.fromArray(w,se*3);var K=S[Math.floor(f/3)]!==void 0?S[Math.floor(f/3)]:1,ve=e.params.Line.threshold+this.material.lineWidth*K/2,Oe=ve*ve,Se=i.distanceSqToSegment(u,h,t,v);if(!(Se>Oe)){t.applyMatrix4(this.matrixWorld);var be=e.ray.origin.distanceTo(t);be<e.near||be>e.far||(n.push({distance:be,point:v.clone().applyMatrix4(this.matrixWorld),index:f,face:null,faceIndex:null,object:this}),f=z)}}}}he.prototype.raycast=Ie,he.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]},he.prototype.copyV3=function(e){var n=e*6;return[this.positions[n],this.positions[n+1],this.positions[n+2]]},he.prototype.process=function(){var e=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var n,r;this.compareV3(0,e-1)?r=this.copyV3(e-2):r=this.copyV3(0),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);for(var i=0;i<e;i++){if(this.side.push(1),this.side.push(-1),this.widthCallback?n=this.widthCallback(i/(e-1)):n=1,this.width.push(n),this.width.push(n),this.uvs.push(i/(e-1),0),this.uvs.push(i/(e-1),1),i<e-1){r=this.copyV3(i),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var a=i*2;this.indices_array.push(a,a+1,a+2),this.indices_array.push(a+2,a+1,a+3)}i>0&&(r=this.copyV3(i),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}this.compareV3(e-1,0)?r=this.copyV3(1):r=this.copyV3(e-1),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new c.BufferAttribute(new Float32Array(this.positions),3),previous:new c.BufferAttribute(new Float32Array(this.previous),3),next:new c.BufferAttribute(new Float32Array(this.next),3),side:new c.BufferAttribute(new Float32Array(this.side),1),width:new c.BufferAttribute(new Float32Array(this.width),1),uv:new c.BufferAttribute(new Float32Array(this.uvs),2),index:new c.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new c.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function 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}he.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},c.ShaderChunk.meshline_vert=et,c.ShaderChunk.meshline_frag=tt;var De=function(e){"use strict";P(r,e);var n=B(r);function r(i){C(this,r);var a;return a=n.call(this,{uniforms:Object.assign({},c.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new c.Color(16777215)},opacity:{value:1},resolution:{value:new c.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new c.Vector2(1,1)},offset:{value:new c.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new c.Vector2(0,0)},lightColor:{value:new c.Color(16777215)}}),vertexShader:c.ShaderChunk.meshline_vert,fragmentShader:c.ShaderChunk.meshline_frag}),a.isMeshLineMaterial=!0,a.type="MeshLineMaterial",Object.defineProperties(j(a),{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(o){this.uniforms.lineWidth.value=o}},lineLightAnimation:{enumerable:!0,get:function(){return this.uniforms.lineLightAnimation.value},set:function(o){this.uniforms.lineLightAnimation.value=o}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(o){this.uniforms.map.value=o}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(o){this.uniforms.useMap.value=o}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(o){this.uniforms.alphaMap.value=o}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(o){this.uniforms.useAlphaMap.value=o}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(o){this.uniforms.color.value=o}},lightColor:{enumerable:!0,get:function(){return this.uniforms.lightColor.value},set:function(o){this.uniforms.lightColor.value=o}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(o){this.uniforms.time.value=o}},uCenter:{enumerable:!0,get:function(){return this.uniforms.uCenter.value},set:function(o){this.uniforms.uCenter.value=o}},size:{enumerable:!0,get:function(){return this.uniforms.size.value},set:function(o){this.uniforms.size.value=o}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(o){this.uniforms.opacity.value=o}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(o){this.uniforms.resolution.value.copy(o)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(o){this.uniforms.sizeAttenuation.value=o}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(o){this.uniforms.dashArray.value=o,this.useDash=o!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(o){this.uniforms.dashOffset.value=o}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(o){this.uniforms.dashRatio.value=o}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(o){this.uniforms.useDash.value=o}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(o){this.uniforms.visibility.value=o}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(o){this.uniforms.alphaTest.value=o}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(o){this.uniforms.repeat.value.copy(o)}}}),a.setValues(i),a}return r}(c.ShaderMaterial);De.prototype.copy=function(e){return c.ShaderMaterial.prototype.copy.call(this,e),this.lineWidth=e.lineWidth,this.map=e.map,this.useMap=e.useMap,this.alphaMap=e.alphaMap,this.useAlphaMap=e.useAlphaMap,this.color.copy(e.color),this.opacity=e.opacity,this.resolution.copy(e.resolution),this.sizeAttenuation=e.sizeAttenuation,this.dashArray.copy(e.dashArray),this.dashOffset.copy(e.dashOffset),this.dashRatio.copy(e.dashRatio),this.useDash=e.useDash,this.visibility=e.visibility,this.alphaTest=e.alphaTest,this.repeat.copy(e.repeat),this};function rt(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 nt(e,n){if(e==null)return{};var r=rt(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 it=e=>{var n={};return U.d(n,e),n},tr=e=>()=>e,at=it({animate:()=>Dt.animate}),ot={nodes:[],color:new c.Color("red"),lineWidth:3,sizeAttenuation:0},st=function(e){"use strict";P(r,e);var n=B(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};C(this,r);var t;return t=n.call(this),t.geometry=new c.BufferGeometry,t.meshline=new he,t.options=(0,x.Z)({},ot,a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.nodes,u=t.duration,h=t.delay,v=t.onComplete,d=t.setPointWidth,_=nt(t,["nodes","duration","delay","onComplete","setPointWidth"]),g=this.pencil.getSize(),M=g.width,w=g.height;delete _.key,this.geometry.setFromPoints(o),this.meshline.setGeometry(this.geometry,d);var S=new De(O((0,x.Z)({},_),{resolution:new c.Vector2(M,w)}));this.material=S,this.createMesh(this.meshline,S)},i.resize=function(t,o){this.material.uniforms.resolution.value.set(t,o)},i.animate=function(){var t=this.options,o=t.duration,u=t.delay,h=t.onComplete,v=this.material.uniforms.offset,d=u!=null?u:0,_=(0,at.animate)({from:v.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-d,repeat:1/0,onComplete:h,onUpdate:function(g){v.value=g}});this.tween=_},i.dispose=function(){xe(b(r.prototype),"dispose",this).call(this),this.tween.stop()},r}(p);function ut(e){if(Array.isArray(e))return e}function ct(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function pe(e,n){return ut(e)||X(e,n)||I(e,n)||ct()}var lt=e=>{var n={};return U.d(n,e),n},rr=e=>()=>e,Pe=lt({extent:()=>Fe.extent,mean:()=>Fe.mean,merge:()=>Fe.merge}),ft=e=>{var n={};return U.d(n,e),n},nr=e=>()=>e,Ve=ft({default:()=>Vt.default}),ht=e=>{var n={};return U.d(n,e),n},ir=e=>()=>e,pt=ht({default:()=>Wt.default});function vt(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 dt=e=>{var n={};return U.d(n,e),n},ar=e=>()=>e,mt=dt({default:()=>Gt.default}),_t=e=>{var n={};return U.d(n,e),n},or=e=>()=>e,gt=_t({default:()=>Ut.default}),yt=e=>{var n={};return U.d(n,e),n},sr=e=>()=>e,Ee=yt({geoBounds:()=>Te.geoBounds,geoContains:()=>Te.geoContains,geoDistance:()=>Te.geoDistance,geoInterpolate:()=>Te.geoInterpolate}),bt=e=>{var n={};return U.d(n,e),n},ur=e=>()=>e,wt=bt({geoVoronoi:()=>Nt.geoVoronoi}),xt=e=>{var n={};return U.d(n,e),n},cr=e=>()=>e,Ze=xt({scaleLinear:()=>Ft.scaleLinear});function Mt(e,n){return e.map(function(r){var i=[],a;return r.forEach(function(t){if(a){var o=(0,Ee.geoDistance)(t,a)*180/Math.PI;if(o>n)for(var u=(0,Ee.geoInterpolate)(a,t),h=1/Math.ceil(o/n),v=h;v<1;)i.push(u(v)),v+=h}i.push(a=t)}),i})}function St(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.minLng,i=n.maxLng,a=n.minLat,t=n.maxLat,o=Math.round(Math.pow(360/e,2)/Math.PI),u=(1+Math.sqrt(5))/2,h=function(f){return f/u*360%360-180},v=function(f){return Math.acos(2*f/o-1)/Math.PI*180-90},d=function(f){return o*(Math.cos((f+90)*Math.PI/180)+1)/2},_=[t!==void 0?Math.ceil(d(t)):0,a!==void 0?Math.floor(d(a)):o-1],g=r===void 0&&i===void 0?function(){return!0}:r===void 0?function(f){return f<=i}:i===void 0?function(f){return f>=r}:i>=r?function(f){return f>=r&&f<=i}:function(f){return f>=r||f<=i},M=[],w=_[0];w<=_[1];w++){var S=h(w);g(S)&&M.push([S,v(w)])}return M}function We(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,Ee.geoContains)(n,e):(0,gt.default)(e,n)}function At(e,n){var r={type:"Polygon",coordinates:e},i=pe((0,Ee.geoBounds)(r),2),a=pe(i[0],2),t=a[0],o=a[1],u=pe(i[1],2),h=u[0],v=u[1];if(Math.min(Math.abs(h-t),Math.abs(v-o))<n)return[];var d=t>h||v>=89||o<=-89;return St(n,{minLng:t,maxLng:h,minLat:o,maxLat:v}).filter(function(_){return We(_,r,d)})}function Pt(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.resolution,i=r===void 0?1/0:r,a=Mt(e,i),t=(0,Pe.merge)(a),o=At(e,i),u=H(t).concat(H(o)),h={type:"Polygon",coordinates:e},v=pe((0,Ee.geoBounds)(h),2),d=pe(v[0],2),_=d[0],g=d[1],M=pe(v[1],2),w=M[0],S=M[1],f=_>w||S>=89||g<=-89,z=[];if(f){var D=(0,wt.geoVoronoi)(u).triangles(),se=new Map(u.map(function(ce,we){var ge=pe(ce,2),le=ge[0],Be=ge[1];return["".concat(le,"-").concat(Be),we]}));D.features.forEach(function(ce){var we,ge=ce.geometry.coordinates[0].slice(0,3).reverse(),le=[];if(ge.forEach(function(Re){var de=pe(Re,2),Ne=de[0],Tt=de[1],$e="".concat(Ne,"-").concat(Tt);se.has($e)&&le.push(se.get($e))}),le.length===3){if(le.some(function(Re){return Re<t.length})){var Be=ce.properties.circumcenter;if(!We(Be,h,f))return}(we=z).push.apply(we,H(le))}})}else if(o.length)for(var be=function(ce,we){var ge,le=[2,1,0].map(function(de){return Ae.triangles[ce+de]}),Be=le.map(function(de){return u[de]});if(le.some(function(de){return de<t.length})){var Re=[0,1].map(function(de){return(0,Pe.mean)(Be,function(Ne){return Ne[de]})});if(!We(Re,h,f))return"continue"}(ge=z).push.apply(ge,H(le))},Ae=mt.default.from(u),Ce=0,je=Ae.triangles.length;Ce<je;Ce+=3)be(Ce,je);else{var K=Ve.default.flatten(a),ve=K.vertices,Oe=K.holes,Se=Oe===void 0?[]:Oe;z=(0,Ve.default)(ve,Se,2)}var Ue=(0,Ze.scaleLinear)((0,Pe.extent)(u,function(ce){return ce[0]}),[0,1]),Bt=(0,Ze.scaleLinear)((0,Pe.extent)(u,function(ce){return ce[1]}),[0,1]),Rt=u.map(function(ce){var we=pe(ce,2),ge=we[0],le=we[1];return[Ue(ge),Bt(le)]}),kt={points:u,indices:z,uvs:Rt};return{contour:a,triangles:kt}}var Ot=Pt,Xe=new c.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function Ge(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=pe(t,2),u=o[0],h=o[1];return r?vt(u,h,n):[u,h,n]})});return Ve.default.flatten(i)}function He(e,n,r){for(var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=Ge(e,n,i),t=a.vertices,o=a.holes,u=Ge(e,r,i),h=u.vertices,v=(0,Pe.merge)([h,t]),d=Math.round(h.length/3),_=new Set(o),g=0,M=[],w=0;w<d;w++){var S=w+1;if(S===d)S=g;else if(_.has(S)){var f=S;S=g,g=f}M.push(w,w+d,S+d),M.push(S+d,S,w)}for(var z=[],D=1;D>=0;D--)for(var se=0;se<d;se+=1)z.push(se/(d-1),D);return{indices:M,vertices:v,uvs:z,topVerts:h}}function Ke(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:Ge([e.points],n,a).vertices,uvs:r}}var Ct=function(e){"use strict";P(r,e);var n=B(r);function r(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};C(this,r);var t;t=n.call(this),t.type="PolygonBufferGeometry",t.parameters=(0,x.Z)({},{polygonGeoJson:i,startHeight:0,endHeight:1,closedBottom:!0,closedTop:!0,includeSides:!0,curvatureResolution:5,cartesian:!0,userDataRsoOffset:0},a);var o=t.parameters,u=o.startHeight,h=o.endHeight,v=o.closedBottom,d=o.closedTop,_=o.includeSides,g=o.curvatureResolution,M=o.cartesian,w=o.userDataRsoOffset;(0,pt.default)(i[0])||i[0].reverse();var S=Ot(i,{resolution:g}),f=S.contour,z=S.triangles,D=(0,Pe.merge)(z.uvs),se=[],K=[],ve=[],Oe=0,Se=function(Ae){var Ce=Math.round(se.length/3),je=ve.length;se=se.concat(Ae.vertices),K=K.concat(Ae.uvs),ve=ve.concat(Ce?Ae.indices.map(function(Ue){return Ue+Ce}):Ae.indices),t.addGroup(je,ve.length-je,Oe++)};if(_){var be=He(f,u,h,M);Se(be),t.userData.rso=w?He(f,u,h+w,M):be}return v&&Se(Ke(z,u,D,!1,M)),d&&Se(Ke(z,h,D,!0,M)),t.setIndex(ve),t[Xe]("position",new c.Float32BufferAttribute(se,3)),t[Xe]("uv",new c.Float32BufferAttribute(K,2)),t.computeVertexNormals(),t}return r}(c.BufferGeometry),Lt=function(e){"use strict";P(r,e);var n=B(r);function r(a){C(this,r);var t;return t=n.call(this),t.options=(0,x.Z)({},{geojson:[[[]]],startHeight:0,height:5,closedBottom:!0,closedTop:!0,curvatureResolution:1,cartesian:!0,userDataRsoOffset:0},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.startHeight,u=t.height,h=t.closedBottom,v=t.closedTop,d=t.curvatureResolution,_=t.userDataRsoOffset,g=t.cartesian,M=new Ct(this.options.geojson,{startHeight:o,endHeight:o+u,closedBottom:h,closedTop:v,curvatureResolution:d,cartesian:g,userDataRsoOffset:_});this.createMesh(M,this.options.material)},r}(p),Et=U(977),jt=function(e){"use strict";P(r,e);var n=B(r);function r(a){C(this,r);var t;return t=n.call(this),t.options=(0,x.Z)({},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.points,u=t.depth,h=t.material,v=new c.ExtrudeBufferGeometry(new c.Shape(o),{depth:u,bevelEnabled:!1,UVGenerator:(0,Et.y)()});this.createMesh(v,h)},r}(p)})();var Zt=fe.Ei,Xt=fe.Yo,Ht=fe.Ee,Kt=fe.x1,$t=fe.VJ,Yt=fe.r7,Jt=fe.XA,Qt=fe.NB,qt=fe.xv,er=fe.nk;export{Zt as ConicPolygon,Xt as ExtrudePolygon,Ht as Image,Kt as Line,$t as MeshLine,Yt as MeshLineMaterial,Jt as MeshLineRaycast,Qt as Node,qt as Text,er as Video};
132
+ `),he=function(e){"use strict";P(r,e);var n=R(r);function r(){C(this,r);var i;return i=n.call(this),i.isMeshLine=!0,i.type="MeshLine",i.positions=[],i.previous=[],i.next=[],i.side=[],i.width=[],i.indices_array=[],i.uvs=[],i.counters=[],i._points=[],i._geom=null,i.widthCallback=null,i.matrixWorld=new c.Matrix4,Object.defineProperties(j(i),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(t){this.setGeometry(t,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(t){this.setPoints(t,this.widthCallback)}}}),i}return r}(c.BufferGeometry);he.prototype.setMatrixWorld=function(e){this.matrixWorld=e},he.prototype.setGeometry=function(e,n){this._geometry=e,this.setPoints(e.getAttribute("position").array,n)},he.prototype.setPoints=function(e,n){if(!(e instanceof Float32Array)&&!(e instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=e,this.widthCallback=n,this.positions=[],this.counters=[],e.length&&e[0]instanceof c.Vector3)for(var r=0;r<e.length;r++){var i=e[r],a=r/e.length;this.positions.push(i.x,i.y,i.z),this.positions.push(i.x,i.y,i.z),this.counters.push(a),this.counters.push(a)}else for(var r=0;r<e.length;r+=3){var a=r/e.length;this.positions.push(e[r],e[r+1],e[r+2]),this.positions.push(e[r],e[r+1],e[r+2]),this.counters.push(a),this.counters.push(a)}this.process()};function Ie(e,n){var r=new c.Matrix4,i=new c.Ray,a=new c.Sphere,t=new c.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),a.copy(o.boundingSphere),a.applyMatrix4(this.matrixWorld),e.ray.intersectSphere(a,t)!==!1){r.copy(this.matrixWorld).invert(),i.copy(e.ray).applyMatrix4(r);var u=new c.Vector3,h=new c.Vector3,v=new c.Vector3,d=this instanceof c.LineSegments?2:1,_=o.index,g=o.attributes;if(_!==null)for(var M=_.array,w=g.position.array,S=g.width.array,f=0,z=M.length-1;f<z;f+=d){var D=M[f],se=M[f+1];u.fromArray(w,D*3),h.fromArray(w,se*3);var K=S[Math.floor(f/3)]!==void 0?S[Math.floor(f/3)]:1,ve=e.params.Line.threshold+this.material.lineWidth*K/2,Oe=ve*ve,Se=i.distanceSqToSegment(u,h,t,v);if(!(Se>Oe)){t.applyMatrix4(this.matrixWorld);var be=e.ray.origin.distanceTo(t);be<e.near||be>e.far||(n.push({distance:be,point:v.clone().applyMatrix4(this.matrixWorld),index:f,face:null,faceIndex:null,object:this}),f=z)}}}}he.prototype.raycast=Ie,he.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]},he.prototype.copyV3=function(e){var n=e*6;return[this.positions[n],this.positions[n+1],this.positions[n+2]]},he.prototype.process=function(){var e=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var n,r;this.compareV3(0,e-1)?r=this.copyV3(e-2):r=this.copyV3(0),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);for(var i=0;i<e;i++){if(this.side.push(1),this.side.push(-1),this.widthCallback?n=this.widthCallback(i/(e-1)):n=1,this.width.push(n),this.width.push(n),this.uvs.push(i/(e-1),0),this.uvs.push(i/(e-1),1),i<e-1){r=this.copyV3(i),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var a=i*2;this.indices_array.push(a,a+1,a+2),this.indices_array.push(a+2,a+1,a+3)}i>0&&(r=this.copyV3(i),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}this.compareV3(e-1,0)?r=this.copyV3(1):r=this.copyV3(e-1),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new c.BufferAttribute(new Float32Array(this.positions),3),previous:new c.BufferAttribute(new Float32Array(this.previous),3),next:new c.BufferAttribute(new Float32Array(this.next),3),side:new c.BufferAttribute(new Float32Array(this.side),1),width:new c.BufferAttribute(new Float32Array(this.width),1),uv:new c.BufferAttribute(new Float32Array(this.uvs),2),index:new c.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new c.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function 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}he.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},c.ShaderChunk.meshline_vert=et,c.ShaderChunk.meshline_frag=tt;var De=function(e){"use strict";P(r,e);var n=R(r);function r(i){C(this,r);var a;return a=n.call(this,{uniforms:Object.assign({},c.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new c.Color(16777215)},opacity:{value:1},resolution:{value:new c.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new c.Vector2(1,1)},offset:{value:new c.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new c.Vector2(0,0)},lightColor:{value:new c.Color(16777215)}}),vertexShader:c.ShaderChunk.meshline_vert,fragmentShader:c.ShaderChunk.meshline_frag}),a.isMeshLineMaterial=!0,a.type="MeshLineMaterial",Object.defineProperties(j(a),{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(o){this.uniforms.lineWidth.value=o}},lineLightAnimation:{enumerable:!0,get:function(){return this.uniforms.lineLightAnimation.value},set:function(o){this.uniforms.lineLightAnimation.value=o}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(o){this.uniforms.map.value=o}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(o){this.uniforms.useMap.value=o}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(o){this.uniforms.alphaMap.value=o}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(o){this.uniforms.useAlphaMap.value=o}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(o){this.uniforms.color.value=o}},lightColor:{enumerable:!0,get:function(){return this.uniforms.lightColor.value},set:function(o){this.uniforms.lightColor.value=o}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(o){this.uniforms.time.value=o}},uCenter:{enumerable:!0,get:function(){return this.uniforms.uCenter.value},set:function(o){this.uniforms.uCenter.value=o}},size:{enumerable:!0,get:function(){return this.uniforms.size.value},set:function(o){this.uniforms.size.value=o}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(o){this.uniforms.opacity.value=o}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(o){this.uniforms.resolution.value.copy(o)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(o){this.uniforms.sizeAttenuation.value=o}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(o){this.uniforms.dashArray.value=o,this.useDash=o!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(o){this.uniforms.dashOffset.value=o}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(o){this.uniforms.dashRatio.value=o}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(o){this.uniforms.useDash.value=o}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(o){this.uniforms.visibility.value=o}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(o){this.uniforms.alphaTest.value=o}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(o){this.uniforms.repeat.value.copy(o)}}}),a.setValues(i),a}return r}(c.ShaderMaterial);De.prototype.copy=function(e){return c.ShaderMaterial.prototype.copy.call(this,e),this.lineWidth=e.lineWidth,this.map=e.map,this.useMap=e.useMap,this.alphaMap=e.alphaMap,this.useAlphaMap=e.useAlphaMap,this.color.copy(e.color),this.opacity=e.opacity,this.resolution.copy(e.resolution),this.sizeAttenuation=e.sizeAttenuation,this.dashArray.copy(e.dashArray),this.dashOffset.copy(e.dashOffset),this.dashRatio.copy(e.dashRatio),this.useDash=e.useDash,this.visibility=e.visibility,this.alphaTest=e.alphaTest,this.repeat.copy(e.repeat),this};function rt(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 nt(e,n){if(e==null)return{};var r=rt(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 it=e=>{var n={};return U.d(n,e),n},tr=e=>()=>e,at=it({animate:()=>Dt.animate}),ot={nodes:[],color:new c.Color("red"),lineWidth:3,sizeAttenuation:0},st=function(e){"use strict";P(r,e);var n=R(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};C(this,r);var t;return t=n.call(this),t.geometry=new c.BufferGeometry,t.meshline=new he,t.options=(0,x.Z)({},ot,a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.nodes,u=t.duration,h=t.delay,v=t.onComplete,d=t.setPointWidth,_=nt(t,["nodes","duration","delay","onComplete","setPointWidth"]),g=this.pencil.getSize(),M=g.width,w=g.height;delete _.key,this.geometry.setFromPoints(o),this.meshline.setGeometry(this.geometry,d);var S=new De(O((0,x.Z)({},_),{resolution:new c.Vector2(M,w)}));this.material=S,this.createMesh(this.meshline,S)},i.resize=function(t,o){this.material.uniforms.resolution.value.set(t,o)},i.animate=function(){var t=this.options,o=t.duration,u=t.delay,h=t.onComplete,v=this.material.uniforms.offset,d=u!=null?u:0,_=(0,at.animate)({from:v.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-d,repeat:1/0,onComplete:h,onUpdate:function(g){v.value=g}});this.tween=_},i.dispose=function(){xe(b(r.prototype),"dispose",this).call(this),this.tween.stop()},r}(p);function ut(e){if(Array.isArray(e))return e}function ct(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function pe(e,n){return ut(e)||X(e,n)||I(e,n)||ct()}var lt=e=>{var n={};return U.d(n,e),n},rr=e=>()=>e,Pe=lt({extent:()=>Fe.extent,mean:()=>Fe.mean,merge:()=>Fe.merge}),ft=e=>{var n={};return U.d(n,e),n},nr=e=>()=>e,Ve=ft({default:()=>Vt.default}),ht=e=>{var n={};return U.d(n,e),n},ir=e=>()=>e,pt=ht({default:()=>Wt.default});function vt(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 dt=e=>{var n={};return U.d(n,e),n},ar=e=>()=>e,mt=dt({default:()=>Gt.default}),_t=e=>{var n={};return U.d(n,e),n},or=e=>()=>e,gt=_t({default:()=>Ut.default}),yt=e=>{var n={};return U.d(n,e),n},sr=e=>()=>e,Ee=yt({geoBounds:()=>Te.geoBounds,geoContains:()=>Te.geoContains,geoDistance:()=>Te.geoDistance,geoInterpolate:()=>Te.geoInterpolate}),bt=e=>{var n={};return U.d(n,e),n},ur=e=>()=>e,wt=bt({geoVoronoi:()=>Nt.geoVoronoi}),xt=e=>{var n={};return U.d(n,e),n},cr=e=>()=>e,Ze=xt({scaleLinear:()=>Ft.scaleLinear});function Mt(e,n){return e.map(function(r){var i=[],a;return r.forEach(function(t){if(a){var o=(0,Ee.geoDistance)(t,a)*180/Math.PI;if(o>n)for(var u=(0,Ee.geoInterpolate)(a,t),h=1/Math.ceil(o/n),v=h;v<1;)i.push(u(v)),v+=h}i.push(a=t)}),i})}function St(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.minLng,i=n.maxLng,a=n.minLat,t=n.maxLat,o=Math.round(Math.pow(360/e,2)/Math.PI),u=(1+Math.sqrt(5))/2,h=function(f){return f/u*360%360-180},v=function(f){return Math.acos(2*f/o-1)/Math.PI*180-90},d=function(f){return o*(Math.cos((f+90)*Math.PI/180)+1)/2},_=[t!==void 0?Math.ceil(d(t)):0,a!==void 0?Math.floor(d(a)):o-1],g=r===void 0&&i===void 0?function(){return!0}:r===void 0?function(f){return f<=i}:i===void 0?function(f){return f>=r}:i>=r?function(f){return f>=r&&f<=i}:function(f){return f>=r||f<=i},M=[],w=_[0];w<=_[1];w++){var S=h(w);g(S)&&M.push([S,v(w)])}return M}function We(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,Ee.geoContains)(n,e):(0,gt.default)(e,n)}function At(e,n){var r={type:"Polygon",coordinates:e},i=pe((0,Ee.geoBounds)(r),2),a=pe(i[0],2),t=a[0],o=a[1],u=pe(i[1],2),h=u[0],v=u[1];if(Math.min(Math.abs(h-t),Math.abs(v-o))<n)return[];var d=t>h||v>=89||o<=-89;return St(n,{minLng:t,maxLng:h,minLat:o,maxLat:v}).filter(function(_){return We(_,r,d)})}function Pt(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.resolution,i=r===void 0?1/0:r,a=Mt(e,i),t=(0,Pe.merge)(a),o=At(e,i),u=H(t).concat(H(o)),h={type:"Polygon",coordinates:e},v=pe((0,Ee.geoBounds)(h),2),d=pe(v[0],2),_=d[0],g=d[1],M=pe(v[1],2),w=M[0],S=M[1],f=_>w||S>=89||g<=-89,z=[];if(f){var D=(0,wt.geoVoronoi)(u).triangles(),se=new Map(u.map(function(ce,we){var ge=pe(ce,2),le=ge[0],Re=ge[1];return["".concat(le,"-").concat(Re),we]}));D.features.forEach(function(ce){var we,ge=ce.geometry.coordinates[0].slice(0,3).reverse(),le=[];if(ge.forEach(function(Be){var de=pe(Be,2),Ne=de[0],Tt=de[1],$e="".concat(Ne,"-").concat(Tt);se.has($e)&&le.push(se.get($e))}),le.length===3){if(le.some(function(Be){return Be<t.length})){var Re=ce.properties.circumcenter;if(!We(Re,h,f))return}(we=z).push.apply(we,H(le))}})}else if(o.length)for(var be=function(ce,we){var ge,le=[2,1,0].map(function(de){return Ae.triangles[ce+de]}),Re=le.map(function(de){return u[de]});if(le.some(function(de){return de<t.length})){var Be=[0,1].map(function(de){return(0,Pe.mean)(Re,function(Ne){return Ne[de]})});if(!We(Be,h,f))return"continue"}(ge=z).push.apply(ge,H(le))},Ae=mt.default.from(u),Ce=0,je=Ae.triangles.length;Ce<je;Ce+=3)be(Ce,je);else{var K=Ve.default.flatten(a),ve=K.vertices,Oe=K.holes,Se=Oe===void 0?[]:Oe;z=(0,Ve.default)(ve,Se,2)}var Ue=(0,Ze.scaleLinear)((0,Pe.extent)(u,function(ce){return ce[0]}),[0,1]),Rt=(0,Ze.scaleLinear)((0,Pe.extent)(u,function(ce){return ce[1]}),[0,1]),Bt=u.map(function(ce){var we=pe(ce,2),ge=we[0],le=we[1];return[Ue(ge),Rt(le)]}),kt={points:u,indices:z,uvs:Bt};return{contour:a,triangles:kt}}var Ot=Pt,Xe=new c.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function Ge(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=pe(t,2),u=o[0],h=o[1];return r?vt(u,h,n):[u,h,n]})});return Ve.default.flatten(i)}function He(e,n,r){for(var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=Ge(e,n,i),t=a.vertices,o=a.holes,u=Ge(e,r,i),h=u.vertices,v=(0,Pe.merge)([h,t]),d=Math.round(h.length/3),_=new Set(o),g=0,M=[],w=0;w<d;w++){var S=w+1;if(S===d)S=g;else if(_.has(S)){var f=S;S=g,g=f}M.push(w,w+d,S+d),M.push(S+d,S,w)}for(var z=[],D=1;D>=0;D--)for(var se=0;se<d;se+=1)z.push(se/(d-1),D);return{indices:M,vertices:v,uvs:z,topVerts:h}}function Ke(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:Ge([e.points],n,a).vertices,uvs:r}}var Ct=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]:{};C(this,r);var t;t=n.call(this),t.type="PolygonBufferGeometry",t.parameters=(0,x.Z)({},{polygonGeoJson:i,startHeight:0,endHeight:1,closedBottom:!0,closedTop:!0,includeSides:!0,curvatureResolution:5,cartesian:!0,userDataRsoOffset:0},a);var o=t.parameters,u=o.startHeight,h=o.endHeight,v=o.closedBottom,d=o.closedTop,_=o.includeSides,g=o.curvatureResolution,M=o.cartesian,w=o.userDataRsoOffset;(0,pt.default)(i[0])||i[0].reverse();var S=Ot(i,{resolution:g}),f=S.contour,z=S.triangles,D=(0,Pe.merge)(z.uvs),se=[],K=[],ve=[],Oe=0,Se=function(Ae){var Ce=Math.round(se.length/3),je=ve.length;se=se.concat(Ae.vertices),K=K.concat(Ae.uvs),ve=ve.concat(Ce?Ae.indices.map(function(Ue){return Ue+Ce}):Ae.indices),t.addGroup(je,ve.length-je,Oe++)};if(_){var be=He(f,u,h,M);Se(be),t.userData.rso=w?He(f,u,h+w,M):be}return v&&Se(Ke(z,u,D,!1,M)),d&&Se(Ke(z,h,D,!0,M)),t.setIndex(ve),t[Xe]("position",new c.Float32BufferAttribute(se,3)),t[Xe]("uv",new c.Float32BufferAttribute(K,2)),t.computeVertexNormals(),t}return r}(c.BufferGeometry),Lt=function(e){"use strict";P(r,e);var n=R(r);function r(a){C(this,r);var t;return t=n.call(this),t.options=(0,x.Z)({},{geojson:[[[]]],startHeight:0,height:5,closedBottom:!0,closedTop:!0,curvatureResolution:1,cartesian:!0,userDataRsoOffset:0},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.startHeight,u=t.height,h=t.closedBottom,v=t.closedTop,d=t.curvatureResolution,_=t.userDataRsoOffset,g=t.cartesian,M=new Ct(this.options.geojson,{startHeight:o,endHeight:o+u,closedBottom:h,closedTop:v,curvatureResolution:d,cartesian:g,userDataRsoOffset:_});this.createMesh(M,this.options.material)},r}(p),Et=U(977),jt=function(e){"use strict";P(r,e);var n=R(r);function r(a){C(this,r);var t;return t=n.call(this),t.options=(0,x.Z)({},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.points,u=t.depth,h=t.material,v=new c.ExtrudeBufferGeometry(new c.Shape(o),{depth:u,bevelEnabled:!1,UVGenerator:(0,Et.y)()});this.createMesh(v,h)},r}(p)})();var Zt=fe.Ei,Xt=fe.Yo,Ht=fe.Ee,Kt=fe.x1,$t=fe.VJ,Yt=fe.r7,Jt=fe.XA,Qt=fe.NB,qt=fe.xv,er=fe.nk;export{Zt as ConicPolygon,Xt as ExtrudePolygon,Ht as Image,Kt as Line,$t as MeshLine,Yt as MeshLineMaterial,Jt as MeshLineRaycast,Qt as Node,qt as Text,er as Video};
@@ -1 +1 @@
1
- (function(){var X={666:function(_){var y=function(s){"use strict";var A=Object.prototype,j=A.hasOwnProperty,v,P=typeof Symbol=="function"?Symbol:{},g=P.iterator||"@@iterator",k=P.asyncIterator||"@@asyncIterator",E=P.toStringTag||"@@toStringTag";function l(e,t,a){return Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(t,a,p){return t[a]=p}}function S(e,t,a,p){var f=t&&t.prototype instanceof G?t:G,R=Object.create(f.prototype),D=new O(p||[]);return R._invoke=w(e,a,D),R}s.wrap=S;function L(e,t,a){try{return{type:"normal",arg:e.call(t,a)}}catch(p){return{type:"throw",arg:p}}}var x="suspendedStart",U="suspendedYield",Z="executing",z="completed",T={};function G(){}function d(){}function n(){}var o={};l(o,g,function(){return this});var u=Object.getPrototypeOf,r=u&&u(u(N([])));r&&r!==A&&j.call(r,g)&&(o=r);var i=n.prototype=G.prototype=Object.create(o);d.prototype=n,l(i,"constructor",n),l(n,"constructor",d),d.displayName=l(n,E,"GeneratorFunction");function c(e){["next","throw","return"].forEach(function(t){l(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,l(e,E,"GeneratorFunction")),e.prototype=Object.create(i),e},s.awrap=function(e){return{__await:e}};function h(e,t){function a(R,D,H,V){var I=L(e[R],e,D);if(I.type==="throw")V(I.arg);else{var K=I.arg,W=K.value;return W&&typeof W=="object"&&j.call(W,"__await")?t.resolve(W.__await).then(function(F){a("next",F,H,V)},function(F){a("throw",F,H,V)}):t.resolve(W).then(function(F){K.value=F,H(K)},function(F){return a("throw",F,H,V)})}}var p;function f(R,D){function H(){return new t(function(V,I){a(R,D,V,I)})}return p=p?p.then(H,H):H()}this._invoke=f}c(h.prototype),l(h.prototype,k,function(){return this}),s.AsyncIterator=h,s.async=function(e,t,a,p,f){f===void 0&&(f=Promise);var R=new h(S(e,t,a,p),f);return s.isGeneratorFunction(t)?R:R.next().then(function(D){return D.done?D.value:R.next()})};function w(e,t,a){var p=x;return function(R,D){if(p===Z)throw new Error("Generator is already running");if(p===z){if(R==="throw")throw D;return B()}for(a.method=R,a.arg=D;;){var H=a.delegate;if(H){var V=b(H,a);if(V){if(V===T)continue;return V}}if(a.method==="next")a.sent=a._sent=a.arg;else if(a.method==="throw"){if(p===x)throw p=z,a.arg;a.dispatchException(a.arg)}else a.method==="return"&&a.abrupt("return",a.arg);p=Z;var I=L(e,t,a);if(I.type==="normal"){if(p=a.done?z:U,I.arg===T)continue;return{value:I.arg,done:a.done}}else I.type==="throw"&&(p=z,a.method="throw",a.arg=I.arg)}}}function b(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,b(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 p=L(a,e.iterator,t.arg);if(p.type==="throw")return t.method="throw",t.arg=p.arg,t.delegate=null,T;var f=p.arg;if(!f)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,T;if(f.done)t[e.resultName]=f.value,t.next=e.nextLoc,t.method!=="return"&&(t.method="next",t.arg=v);else return f;return t.delegate=null,T}c(i),l(i,E,"Generator"),l(i,g,function(){return this}),l(i,"toString",function(){return"[object Generator]"});function C(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 m(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}s.keys=function(e){var t=[];for(var a in e)t.push(a);return t.reverse(),function p(){for(;t.length;){var f=t.pop();if(f in e)return p.value=f,p.done=!1,p}return p.done=!0,p}};function N(e){if(e){var t=e[g];if(t)return t.call(e);if(typeof e.next=="function")return e;if(!isNaN(e.length)){var a=-1,p=function f(){for(;++a<e.length;)if(j.call(e,a))return f.value=e[a],f.done=!1,f;return f.value=v,f.done=!0,f};return p.next=p}}return{next:B}}s.values=N;function B(){return{value:v,done:!0}}return O.prototype={constructor:O,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(m),!e)for(var t in this)t.charAt(0)==="t"&&j.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(V,I){return R.type="throw",R.arg=e,t.next=V,I&&(t.method="next",t.arg=v),!!I}for(var p=this.tryEntries.length-1;p>=0;--p){var f=this.tryEntries[p],R=f.completion;if(f.tryLoc==="root")return a("end");if(f.tryLoc<=this.prev){var D=j.call(f,"catchLoc"),H=j.call(f,"finallyLoc");if(D&&H){if(this.prev<f.catchLoc)return a(f.catchLoc,!0);if(this.prev<f.finallyLoc)return a(f.finallyLoc)}else if(D){if(this.prev<f.catchLoc)return a(f.catchLoc,!0)}else if(H){if(this.prev<f.finallyLoc)return a(f.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 p=this.tryEntries[a];if(p.tryLoc<=this.prev&&j.call(p,"finallyLoc")&&this.prev<p.finallyLoc){var f=p;break}}f&&(e==="break"||e==="continue")&&f.tryLoc<=t&&t<=f.finallyLoc&&(f=null);var R=f?f.completion:{};return R.type=e,R.arg=t,f?(this.method="next",this.next=f.finallyLoc,T):this.complete(R)},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),m(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 p=a.completion;if(p.type==="throw"){var f=p.arg;m(a)}return f}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,a){return this.delegate={iterator:N(e),resultName:t,nextLoc:a},this.method==="next"&&(this.arg=v),T}},s}(_.exports);try{regeneratorRuntime=y}catch(s){typeof globalThis=="object"?globalThis.regeneratorRuntime=y:Function("r","regeneratorRuntime = r")(y)}},54:function(_,y,s){"use strict";s.d(y,{makePromiseCreator:function(){return A.Z}});var A=s(653),j=s(666),v=s.n(j),P=null,g=s(644);function k(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 E=s(568),l=s(924),S=require("idb-keyval"),L=s(620),x=null,U=null,Z=function(){var T=(0,E.Z)(v().mark(function G(d,n){var o,u,r,i,c,h;return v().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return o=n.version,b.next=4,(0,S.get)(d);case 4:if(r=b.sent,!(r&&r[o])){b.next=9;break}u=r[o],b.next=15;break;case 9:return b.next=11,(0,L.Z)(fetch(d).then(function(C){if(C.ok)return C.blob();throw new Error}));case 11:i=b.sent,c=i.res,h=i.err,h||(u=c,(0,S.set)(d,(0,l.Z)({},o,c)));case 15:return b.abrupt("return",u?{url:URL.createObjectURL(u)}:{url:d});case 16:case"end":return b.stop()}},G)}));return function(d,n){return T.apply(this,arguments)}}(),z=s(977)},653:function(_,y,s){"use strict";s.d(y,{Z:function(){return j}});var A=s(620);function j(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g={};return g.promise=new Promise(function(k,E){g.resolve=k,g.reject=E}),v&&(g.promise=(0,A.Z)(g.promise,P)),g}},620:function(_,y,s){"use strict";s.d(y,{Z:function(){return j}});var A=s(42);function j(v){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return v.then(function(g){return(0,A.Z)({err:null,res:g},P)}).catch(function(g){return(0,A.Z)({err:g,res:void 0},P)})}},977:function(_,y,s){"use strict";var A=s(644),j=s.n(A),v=new Map,P=function(k){return{generateTopUV:function(E,l,S,L,x){var U=l[S*3],Z=l[S*3+1],z=l[L*3],T=l[L*3+1],G=l[x*3],d=l[x*3+1],n;if(v.has(E))n=v.get(E);else{var o=k&&k.Box3||new THREE.Box3;if(!k||!k.Box3){var u=E.parameters.shapes.getPoints();o.setFromArray(u.map(function(h){return[h.x,h.y,0]}).flat())}var r=o.getSize(new THREE.Vector3);n={box:o,size:r},v.set(E,n)}var i=n.box,c=n.size;return[new THREE.Vector2((U-i.min.x)/c.x,(Z-i.min.y)/c.y),new THREE.Vector2((z-i.min.x)/c.x,(T-i.min.y)/c.y),new THREE.Vector2((G-i.min.x)/c.x,(d-i.min.y)/c.y)]},generateSideWallUV:function(E,l,S,L,x,U){var Z=l[S*3],z=l[S*3+1],T=l[S*3+2],G=l[L*3],d=l[L*3+1],n=l[L*3+2],o=l[x*3],u=l[x*3+1],r=l[x*3+2],i=l[U*3],c=l[U*3+1],h=l[U*3+2],w;if(v.has(l))w=v.get(l);else{var b=new THREE.Box3;b.setFromArray(l);var C=b.getSize(new THREE.Vector3);w={box:b,size:C},v.set(l,w)}var m=w.box,O=w.size;return Math.abs(z-d)<.01?[new THREE.Vector2((Z-m.min.x)/O.x,(T-m.min.z)/O.z),new THREE.Vector2((G-m.min.x)/O.x,(n-m.min.z)/O.z),new THREE.Vector2((o-m.min.x)/O.x,(r-m.min.z)/O.z),new THREE.Vector2((i-m.min.x)/O.x,(h-m.min.z)/O.z)]:[new THREE.Vector2((z-m.min.y)/O.x,(T-m.min.z)/O.z),new THREE.Vector2((d-m.min.y)/O.x,(n-m.min.z)/O.z),new THREE.Vector2((u-m.min.y)/O.x,(r-m.min.z)/O.z),new THREE.Vector2((c-m.min.y)/O.x,(h-m.min.z)/O.z)]}}},g=function(){v.clear()}},644:function(_){"use strict";_.exports=require("three")},568:function(_,y,s){"use strict";s.d(y,{Z:function(){return j}});function A(v,P,g,k,E,l,S){try{var L=v[l](S),x=L.value}catch(U){g(U);return}L.done?P(x):Promise.resolve(x).then(k,E)}function j(v){return function(){var P=this,g=arguments;return new Promise(function(k,E){var l=v.apply(P,g);function S(x){A(l,k,E,S,L,"next",x)}function L(x){A(l,k,E,S,L,"throw",x)}S(void 0)})}}},924:function(_,y,s){"use strict";s.d(y,{Z:function(){return A}});function A(j,v,P){return v in j?Object.defineProperty(j,v,{value:P,enumerable:!0,configurable:!0,writable:!0}):j[v]=P,j}},42:function(_,y,s){"use strict";s.d(y,{Z:function(){return j}});var A=s(924);function j(v){for(var P=1;P<arguments.length;P++){var g=arguments[P]!=null?arguments[P]:{},k=Object.keys(g);typeof Object.getOwnPropertySymbols=="function"&&(k=k.concat(Object.getOwnPropertySymbols(g).filter(function(E){return Object.getOwnPropertyDescriptor(g,E).enumerable}))),k.forEach(function(E){(0,A.Z)(v,E,g[E])})}return v}}},Y={};function M(_){var y=Y[_];if(y!==void 0)return y.exports;var s=Y[_]={exports:{}};return X[_](s,s.exports,M),s.exports}(function(){M.n=function(_){var y=_&&_.__esModule?function(){return _.default}:function(){return _};return M.d(y,{a:y}),y}})(),function(){M.d=function(_,y){for(var s in y)M.o(y,s)&&!M.o(_,s)&&Object.defineProperty(_,s,{enumerable:!0,get:y[s]})}}(),function(){M.o=function(_,y){return Object.prototype.hasOwnProperty.call(_,y)}}(),function(){M.r=function(_){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(_,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(_,"__esModule",{value:!0})}}();var $={};(function(){"use strict";M.r($),M.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=M(54),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 i=(0,y.makePromiseCreator)();this.cache.set(r,i)},o.get=function(r){var i;return(i=this.cache.get(r))===null||i===void 0?void 0:i.promise},o.set=function(r,i){var c=this.cache.get(r);c?c.resolve(i):console.warn("init cache first")},o.dispose=function(){this.cache.forEach(function(r,i){r.reject("stop set cache:".concat(i))}),this.cache.clear()},n}(),A=M(568);function j(n,o){for(var u=0;u<o.length;u++){var r=o[u];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function v(n,o,u){return o&&j(n.prototype,o),u&&j(n,u),n}function P(n){if(Array.isArray(n))return n}function g(n){if(typeof Symbol!="undefined"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function k(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function E(n,o){(o==null||o>n.length)&&(o=n.length);for(var u=0,r=new Array(o);u<o;u++)r[u]=n[u];return r}function l(n,o){if(!!n){if(typeof n=="string")return E(n,o);var u=Object.prototype.toString.call(n).slice(8,-1);if(u==="Object"&&n.constructor&&(u=n.constructor.name),u==="Map"||u==="Set")return Array.from(u);if(u==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(u))return E(n,o)}}function S(n,o){return P(n)||g(n,o)||l(n,o)||k()}function L(n){if(Array.isArray(n))return E(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 L(n)||g(n)||l(n)||x()}var Z=M(666),z=M.n(Z),T=M(644),G=function(){"use strict";function n(u){_(this,n),this.objectNamesToFactories=new Map,this.objects=new Map,this.objects_=u}var o=n.prototype;return o.install=function(r){this.pencil=r,this.initObjectFactories()},o.initObjectFactories=function(){var r=this,i=this.objects_;Object.keys(i).forEach(function(c){var h=function(){function w(){_(this,w)}var b=w.prototype;return b.create=function(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new i[c](m)},w}();r.objectNamesToFactories.set(c,h)})},o.getObject=function(r,i){r.includes("#")&&console.warn("getObject:err:\u4E0D\u652F\u6301 #",r);var c=(i||{}).key,h="".concat(r).concat(c?"#".concat(c):""),w=this.objects.get(h);return w},o.getAllObject=function(r,i){r.includes("#")&&console.warn("getAllObject:err:\u4E0D\u652F\u6301 #",r);var c=(i||{}).key,h="".concat(r).concat(c?"#".concat(c):""),w=[];return this.objects.forEach(function(b,C){(C.startsWith("".concat(h,"#"))||C===h)&&w.push(b)}),w},o.draw=function(r,i,c){var h=this;return(0,A.Z)(z().mark(function w(){var b,C,m,O,N,B,e;return z().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(b=h.objectNamesToFactories.get(r),!b){a.next=15;break}return C=(i||{}).key,m="".concat(r).concat(C?"#".concat(C):""),h.objects.has(m)&&(O=T.MathUtils.generateUUID(),m+="#".concat(O)),N=(i==null?void 0:i.target)||c,typeof N=="string"?B=h.objects.get(N):(N==null?void 0:N.objecttype__)==="BaseObject"?B=N:B=h.pencil.scene,e=new b().create(i),e.pencil=h.pencil,e.key=m,h.objects.set(m,e),a.next=14,h.addMesh(e,B);case 14:return a.abrupt("return",e);case 15:throw new Error("Unrecognized:".concat(r));case 16:case"end":return a.stop()}},w)}))()},o.addMesh=function(r,i){return(0,A.Z)(z().mark(function c(){return z().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return w.next=2,r.create();case 2:r.object3d&&(r.object3d.userData.BaseObject_=r,i.add(r.object3d)),r.visible=!0,r.render(),r.pm.resolve();case 6:case"end":return w.stop()}},c)}))()},o.erase=function(){for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];var h=this;U(i).forEach(function(w){var b=[];if(typeof w=="string"){var C,m=S(w.split("#"),2),O=m[0],N=m[1];(C=b).push.apply(C,U(h.getAllObject(O,{key:N})))}else b.push(w);b.forEach(function(B){h.removeMesh(B)})})},o.removeMesh=function(r){var i=this,c=r.parent;r.object3d&&c.remove(r.object3d),r.traverse(function(h){h.visible=!1,h.dispose(),i.objects.delete(h.key)})},o.update=function(r,i){this.objects.forEach(function(c){c.update(r,i)})},o.setSize=function(r,i){this.objects.forEach(function(c){c.resize(r,i)})},o.dispose=function(){this.objects.forEach(function(r,i){r.dispose(),r.pm.reject("stop draw:".concat(i))}),this.objects.clear(),this.objectNamesToFactories.clear()},v(n,[{key:"objectsPromise",get:function(){var r=[];return this.objects.forEach(function(i){r.push(i.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,i){var c,h;this.data[r]=i,(h=(c=this).cb)===null||h===void 0||h.call(c,r)},o.runAll=function(){var r=this;Object.keys(this.data).forEach(function(i){var c,h;(h=(c=r).cb)===null||h===void 0||h.call(c,i)})},o.dispose=function(){this.data={},this.cb=void 0},n}()})(),module.exports=$})();
1
+ (function(){var X={666:function(_){var y=function(s){"use strict";var A=Object.prototype,j=A.hasOwnProperty,v,P=typeof Symbol=="function"?Symbol:{},b=P.iterator||"@@iterator",k=P.asyncIterator||"@@asyncIterator",E=P.toStringTag||"@@toStringTag";function l(e,t,a){return Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(t,a,p){return t[a]=p}}function S(e,t,a,p){var f=t&&t.prototype instanceof G?t:G,R=Object.create(f.prototype),D=new O(p||[]);return R._invoke=w(e,a,D),R}s.wrap=S;function L(e,t,a){try{return{type:"normal",arg:e.call(t,a)}}catch(p){return{type:"throw",arg:p}}}var x="suspendedStart",U="suspendedYield",Z="executing",z="completed",T={};function G(){}function d(){}function n(){}var o={};l(o,b,function(){return this});var u=Object.getPrototypeOf,r=u&&u(u(N([])));r&&r!==A&&j.call(r,b)&&(o=r);var i=n.prototype=G.prototype=Object.create(o);d.prototype=n,l(i,"constructor",n),l(n,"constructor",d),d.displayName=l(n,E,"GeneratorFunction");function c(e){["next","throw","return"].forEach(function(t){l(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,l(e,E,"GeneratorFunction")),e.prototype=Object.create(i),e},s.awrap=function(e){return{__await:e}};function h(e,t){function a(R,D,H,V){var I=L(e[R],e,D);if(I.type==="throw")V(I.arg);else{var K=I.arg,W=K.value;return W&&typeof W=="object"&&j.call(W,"__await")?t.resolve(W.__await).then(function(B){a("next",B,H,V)},function(B){a("throw",B,H,V)}):t.resolve(W).then(function(B){K.value=B,H(K)},function(B){return a("throw",B,H,V)})}}var p;function f(R,D){function H(){return new t(function(V,I){a(R,D,V,I)})}return p=p?p.then(H,H):H()}this._invoke=f}c(h.prototype),l(h.prototype,k,function(){return this}),s.AsyncIterator=h,s.async=function(e,t,a,p,f){f===void 0&&(f=Promise);var R=new h(S(e,t,a,p),f);return s.isGeneratorFunction(t)?R:R.next().then(function(D){return D.done?D.value:R.next()})};function w(e,t,a){var p=x;return function(R,D){if(p===Z)throw new Error("Generator is already running");if(p===z){if(R==="throw")throw D;return F()}for(a.method=R,a.arg=D;;){var H=a.delegate;if(H){var V=g(H,a);if(V){if(V===T)continue;return V}}if(a.method==="next")a.sent=a._sent=a.arg;else if(a.method==="throw"){if(p===x)throw p=z,a.arg;a.dispatchException(a.arg)}else a.method==="return"&&a.abrupt("return",a.arg);p=Z;var I=L(e,t,a);if(I.type==="normal"){if(p=a.done?z:U,I.arg===T)continue;return{value:I.arg,done:a.done}}else I.type==="throw"&&(p=z,a.method="throw",a.arg=I.arg)}}}function g(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,g(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 p=L(a,e.iterator,t.arg);if(p.type==="throw")return t.method="throw",t.arg=p.arg,t.delegate=null,T;var f=p.arg;if(!f)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,T;if(f.done)t[e.resultName]=f.value,t.next=e.nextLoc,t.method!=="return"&&(t.method="next",t.arg=v);else return f;return t.delegate=null,T}c(i),l(i,E,"Generator"),l(i,b,function(){return this}),l(i,"toString",function(){return"[object Generator]"});function C(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 m(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}s.keys=function(e){var t=[];for(var a in e)t.push(a);return t.reverse(),function p(){for(;t.length;){var f=t.pop();if(f in e)return p.value=f,p.done=!1,p}return p.done=!0,p}};function N(e){if(e){var t=e[b];if(t)return t.call(e);if(typeof e.next=="function")return e;if(!isNaN(e.length)){var a=-1,p=function f(){for(;++a<e.length;)if(j.call(e,a))return f.value=e[a],f.done=!1,f;return f.value=v,f.done=!0,f};return p.next=p}}return{next:F}}s.values=N;function F(){return{value:v,done:!0}}return O.prototype={constructor:O,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(m),!e)for(var t in this)t.charAt(0)==="t"&&j.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(V,I){return R.type="throw",R.arg=e,t.next=V,I&&(t.method="next",t.arg=v),!!I}for(var p=this.tryEntries.length-1;p>=0;--p){var f=this.tryEntries[p],R=f.completion;if(f.tryLoc==="root")return a("end");if(f.tryLoc<=this.prev){var D=j.call(f,"catchLoc"),H=j.call(f,"finallyLoc");if(D&&H){if(this.prev<f.catchLoc)return a(f.catchLoc,!0);if(this.prev<f.finallyLoc)return a(f.finallyLoc)}else if(D){if(this.prev<f.catchLoc)return a(f.catchLoc,!0)}else if(H){if(this.prev<f.finallyLoc)return a(f.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 p=this.tryEntries[a];if(p.tryLoc<=this.prev&&j.call(p,"finallyLoc")&&this.prev<p.finallyLoc){var f=p;break}}f&&(e==="break"||e==="continue")&&f.tryLoc<=t&&t<=f.finallyLoc&&(f=null);var R=f?f.completion:{};return R.type=e,R.arg=t,f?(this.method="next",this.next=f.finallyLoc,T):this.complete(R)},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),m(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 p=a.completion;if(p.type==="throw"){var f=p.arg;m(a)}return f}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,a){return this.delegate={iterator:N(e),resultName:t,nextLoc:a},this.method==="next"&&(this.arg=v),T}},s}(_.exports);try{regeneratorRuntime=y}catch(s){typeof globalThis=="object"?globalThis.regeneratorRuntime=y:Function("r","regeneratorRuntime = r")(y)}},54:function(_,y,s){"use strict";s.d(y,{makePromiseCreator:function(){return A.Z}});var A=s(653),j=s(666),v=s.n(j),P=null,b=s(644);function k(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 E=s(568),l=s(924),S=require("idb-keyval"),L=s(620),x=null,U=null,Z=function(){var T=(0,E.Z)(v().mark(function G(d,n){var o,u,r,i,c,h;return v().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return o=n.version,g.next=4,(0,S.get)(d);case 4:if(r=g.sent,!(r&&r[o])){g.next=9;break}u=r[o],g.next=15;break;case 9:return g.next=11,(0,L.Z)(fetch(d).then(function(C){if(C.ok)return C.blob();throw new Error}));case 11:i=g.sent,c=i.res,h=i.err,h||(u=c,(0,S.set)(d,(0,l.Z)({},o,c)));case 15:return g.abrupt("return",u?{url:URL.createObjectURL(u)}:{url:d});case 16:case"end":return g.stop()}},G)}));return function(d,n){return T.apply(this,arguments)}}(),z=s(977)},653:function(_,y,s){"use strict";s.d(y,{Z:function(){return j}});var A=s(620);function j(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},b={};return b.promise=new Promise(function(k,E){b.resolve=k,b.reject=E}),v&&(b.promise=(0,A.Z)(b.promise,P)),b}},620:function(_,y,s){"use strict";s.d(y,{Z:function(){return j}});var A=s(42);function j(v){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return v.then(function(b){return(0,A.Z)({err:null,res:b},P)}).catch(function(b){return(0,A.Z)({err:b,res:void 0},P)})}},977:function(_,y,s){"use strict";var A=s(644),j=s.n(A),v=new Map,P=function(k){return{generateTopUV:function(E,l,S,L,x){var U=l[S*3],Z=l[S*3+1],z=l[L*3],T=l[L*3+1],G=l[x*3],d=l[x*3+1],n;if(v.has(E))n=v.get(E);else{var o=k&&k.box3||new THREE.Box3;if(!k||!k.box3){var u=E.parameters.shapes.getPoints();o.setFromArray(u.map(function(h){return[h.x,h.y,0]}).flat())}var r=o.getSize(new THREE.Vector3);n={box:o,size:r},v.set(E,n)}var i=n.box,c=n.size;return[new THREE.Vector2((U-i.min.x)/c.x,(Z-i.min.y)/c.y),new THREE.Vector2((z-i.min.x)/c.x,(T-i.min.y)/c.y),new THREE.Vector2((G-i.min.x)/c.x,(d-i.min.y)/c.y)]},generateSideWallUV:function(E,l,S,L,x,U){var Z=l[S*3],z=l[S*3+1],T=l[S*3+2],G=l[L*3],d=l[L*3+1],n=l[L*3+2],o=l[x*3],u=l[x*3+1],r=l[x*3+2],i=l[U*3],c=l[U*3+1],h=l[U*3+2],w;if(v.has(l))w=v.get(l);else{var g=new THREE.Box3;g.setFromArray(l);var C=g.getSize(new THREE.Vector3);w={box:g,size:C},v.set(l,w)}var m=w.box,O=w.size;return Math.abs(z-d)<.01?[new THREE.Vector2((Z-m.min.x)/O.x,(T-m.min.z)/O.z),new THREE.Vector2((G-m.min.x)/O.x,(n-m.min.z)/O.z),new THREE.Vector2((o-m.min.x)/O.x,(r-m.min.z)/O.z),new THREE.Vector2((i-m.min.x)/O.x,(h-m.min.z)/O.z)]:[new THREE.Vector2((z-m.min.y)/O.x,(T-m.min.z)/O.z),new THREE.Vector2((d-m.min.y)/O.x,(n-m.min.z)/O.z),new THREE.Vector2((u-m.min.y)/O.x,(r-m.min.z)/O.z),new THREE.Vector2((c-m.min.y)/O.x,(h-m.min.z)/O.z)]}}},b=function(){v.clear()}},644:function(_){"use strict";_.exports=require("three")},568:function(_,y,s){"use strict";s.d(y,{Z:function(){return j}});function A(v,P,b,k,E,l,S){try{var L=v[l](S),x=L.value}catch(U){b(U);return}L.done?P(x):Promise.resolve(x).then(k,E)}function j(v){return function(){var P=this,b=arguments;return new Promise(function(k,E){var l=v.apply(P,b);function S(x){A(l,k,E,S,L,"next",x)}function L(x){A(l,k,E,S,L,"throw",x)}S(void 0)})}}},924:function(_,y,s){"use strict";s.d(y,{Z:function(){return A}});function A(j,v,P){return v in j?Object.defineProperty(j,v,{value:P,enumerable:!0,configurable:!0,writable:!0}):j[v]=P,j}},42:function(_,y,s){"use strict";s.d(y,{Z:function(){return j}});var A=s(924);function j(v){for(var P=1;P<arguments.length;P++){var b=arguments[P]!=null?arguments[P]:{},k=Object.keys(b);typeof Object.getOwnPropertySymbols=="function"&&(k=k.concat(Object.getOwnPropertySymbols(b).filter(function(E){return Object.getOwnPropertyDescriptor(b,E).enumerable}))),k.forEach(function(E){(0,A.Z)(v,E,b[E])})}return v}}},Y={};function M(_){var y=Y[_];if(y!==void 0)return y.exports;var s=Y[_]={exports:{}};return X[_](s,s.exports,M),s.exports}(function(){M.n=function(_){var y=_&&_.__esModule?function(){return _.default}:function(){return _};return M.d(y,{a:y}),y}})(),function(){M.d=function(_,y){for(var s in y)M.o(y,s)&&!M.o(_,s)&&Object.defineProperty(_,s,{enumerable:!0,get:y[s]})}}(),function(){M.o=function(_,y){return Object.prototype.hasOwnProperty.call(_,y)}}(),function(){M.r=function(_){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(_,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(_,"__esModule",{value:!0})}}();var $={};(function(){"use strict";M.r($),M.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=M(54),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 i=(0,y.makePromiseCreator)();this.cache.set(r,i)},o.get=function(r){var i;return(i=this.cache.get(r))===null||i===void 0?void 0:i.promise},o.set=function(r,i){var c=this.cache.get(r);c?c.resolve(i):console.warn("init cache first")},o.dispose=function(){this.cache.forEach(function(r,i){r.reject("stop set cache:".concat(i))}),this.cache.clear()},n}(),A=M(568);function j(n,o){for(var u=0;u<o.length;u++){var r=o[u];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function v(n,o,u){return o&&j(n.prototype,o),u&&j(n,u),n}function P(n){if(Array.isArray(n))return n}function b(n){if(typeof Symbol!="undefined"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function k(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function E(n,o){(o==null||o>n.length)&&(o=n.length);for(var u=0,r=new Array(o);u<o;u++)r[u]=n[u];return r}function l(n,o){if(!!n){if(typeof n=="string")return E(n,o);var u=Object.prototype.toString.call(n).slice(8,-1);if(u==="Object"&&n.constructor&&(u=n.constructor.name),u==="Map"||u==="Set")return Array.from(u);if(u==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(u))return E(n,o)}}function S(n,o){return P(n)||b(n,o)||l(n,o)||k()}function L(n){if(Array.isArray(n))return E(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 L(n)||b(n)||l(n)||x()}var Z=M(666),z=M.n(Z),T=M(644),G=function(){"use strict";function n(u){_(this,n),this.objectNamesToFactories=new Map,this.objects=new Map,this.objects_=u}var o=n.prototype;return o.install=function(r){this.pencil=r,this.initObjectFactories()},o.initObjectFactories=function(){var r=this,i=this.objects_;Object.keys(i).forEach(function(c){var h=function(){function w(){_(this,w)}var g=w.prototype;return g.create=function(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new i[c](m)},w}();r.objectNamesToFactories.set(c,h)})},o.getObject=function(r,i){r.includes("#")&&console.warn("getObject:err:\u4E0D\u652F\u6301 #",r);var c=(i||{}).key,h="".concat(r).concat(c?"#".concat(c):""),w=this.objects.get(h);return w},o.getAllObject=function(r,i){r.includes("#")&&console.warn("getAllObject:err:\u4E0D\u652F\u6301 #",r);var c=(i||{}).key,h="".concat(r).concat(c?"#".concat(c):""),w=[];return this.objects.forEach(function(g,C){(C.startsWith("".concat(h,"#"))||C===h)&&w.push(g)}),w},o.draw=function(r,i,c){var h=this;return(0,A.Z)(z().mark(function w(){var g,C,m,O,N,F,e;return z().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(g=h.objectNamesToFactories.get(r),!g){a.next=15;break}return C=(i||{}).key,m="".concat(r).concat(C?"#".concat(C):""),h.objects.has(m)&&(O=T.MathUtils.generateUUID(),m+="#".concat(O)),N=(i==null?void 0:i.target)||c,typeof N=="string"?F=h.objects.get(N):(N==null?void 0:N.objecttype__)==="BaseObject"?F=N:F=h.pencil.scene,e=new g().create(i),e.pencil=h.pencil,e.key=m,h.objects.set(m,e),a.next=14,h.addMesh(e,F);case 14:return a.abrupt("return",e);case 15:throw new Error("Unrecognized:".concat(r));case 16:case"end":return a.stop()}},w)}))()},o.addMesh=function(r,i){return(0,A.Z)(z().mark(function c(){return z().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return w.next=2,r.create();case 2:r.object3d&&(r.object3d.userData.BaseObject_=r,i.add(r.object3d)),r.visible=!0,r.render(),r.pm.resolve();case 6:case"end":return w.stop()}},c)}))()},o.erase=function(){for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];var h=this;U(i).forEach(function(w){var g=[];if(typeof w=="string"){var C,m=S(w.split("#"),2),O=m[0],N=m[1];(C=g).push.apply(C,U(h.getAllObject(O,{key:N})))}else g.push(w);g.forEach(function(F){h.removeMesh(F)})})},o.removeMesh=function(r){var i=this,c=r.parent;r.object3d&&c.remove(r.object3d),r.traverse(function(h){h.visible=!1,h.dispose(),i.objects.delete(h.key)})},o.update=function(r,i){this.objects.forEach(function(c){c.update(r,i)})},o.setSize=function(r,i){this.objects.forEach(function(c){c.resize(r,i)})},o.dispose=function(){this.objects.forEach(function(r,i){r.dispose(),r.pm.reject("stop draw:".concat(i))}),this.objects.clear(),this.objectNamesToFactories.clear()},v(n,[{key:"objectsPromise",get:function(){var r=[];return this.objects.forEach(function(i){r.push(i.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,i){var c,h;this.data[r]=i,(h=(c=this).cb)===null||h===void 0||h.call(c,r)},o.runAll=function(){var r=this;Object.keys(this.data).forEach(function(i){var c,h;(h=(c=r).cb)===null||h===void 0||h.call(c,i)})},o.dispose=function(){this.data={},this.cb=void 0},n}()})(),module.exports=$})();
@@ -1 +1 @@
1
- import*as X from"idb-keyval";import*as J from"three";var Q={666:function(w){var m=function(c){"use strict";var O=Object.prototype,d=O.hasOwnProperty,_,j=typeof Symbol=="function"?Symbol:{},y=j.iterator||"@@iterator",A=j.asyncIterator||"@@asyncIterator",l=j.toStringTag||"@@toStringTag";function E(r,t,n){return Object.defineProperty(r,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),r[t]}try{E({},"")}catch(r){E=function(t,n,p){return t[n]=p}}function P(r,t,n,p){var f=t&&t.prototype instanceof V?t:V,L=Object.create(f.prototype),M=new I(p||[]);return L._invoke=b(r,n,M),L}c.wrap=P;function x(r,t,n){try{return{type:"normal",arg:r.call(t,n)}}catch(p){return{type:"throw",arg:p}}}var k="suspendedStart",H="suspendedYield",B="executing",C="completed",R={};function V(){}function T(){}function a(){}var o={};E(o,y,function(){return this});var i=Object.getPrototypeOf,e=i&&i(i(D([])));e&&e!==O&&d.call(e,y)&&(o=e);var u=a.prototype=V.prototype=Object.create(o);T.prototype=a,E(u,"constructor",a),E(a,"constructor",T),T.displayName=E(a,l,"GeneratorFunction");function s(r){["next","throw","return"].forEach(function(t){E(r,t,function(n){return this._invoke(t,n)})})}c.isGeneratorFunction=function(r){var t=typeof r=="function"&&r.constructor;return t?t===T||(t.displayName||t.name)==="GeneratorFunction":!1},c.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,a):(r.__proto__=a,E(r,l,"GeneratorFunction")),r.prototype=Object.create(u),r},c.awrap=function(r){return{__await:r}};function h(r,t){function n(L,M,z,N){var G=x(r[L],r,M);if(G.type==="throw")N(G.arg);else{var $=G.arg,W=$.value;return W&&typeof W=="object"&&d.call(W,"__await")?t.resolve(W.__await).then(function(F){n("next",F,z,N)},function(F){n("throw",F,z,N)}):t.resolve(W).then(function(F){$.value=F,z($)},function(F){return n("throw",F,z,N)})}}var p;function f(L,M){function z(){return new t(function(N,G){n(L,M,N,G)})}return p=p?p.then(z,z):z()}this._invoke=f}s(h.prototype),E(h.prototype,A,function(){return this}),c.AsyncIterator=h,c.async=function(r,t,n,p,f){f===void 0&&(f=Promise);var L=new h(P(r,t,n,p),f);return c.isGeneratorFunction(t)?L:L.next().then(function(M){return M.done?M.value:L.next()})};function b(r,t,n){var p=k;return function(L,M){if(p===B)throw new Error("Generator is already running");if(p===C){if(L==="throw")throw M;return Z()}for(n.method=L,n.arg=M;;){var z=n.delegate;if(z){var N=S(z,n);if(N){if(N===R)continue;return N}}if(n.method==="next")n.sent=n._sent=n.arg;else if(n.method==="throw"){if(p===k)throw p=C,n.arg;n.dispatchException(n.arg)}else n.method==="return"&&n.abrupt("return",n.arg);p=B;var G=x(r,t,n);if(G.type==="normal"){if(p=n.done?C:H,G.arg===R)continue;return{value:G.arg,done:n.done}}else G.type==="throw"&&(p=C,n.method="throw",n.arg=G.arg)}}}function S(r,t){var n=r.iterator[t.method];if(n===_){if(t.delegate=null,t.method==="throw"){if(r.iterator.return&&(t.method="return",t.arg=_,S(r,t),t.method==="throw"))return R;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return R}var p=x(n,r.iterator,t.arg);if(p.type==="throw")return t.method="throw",t.arg=p.arg,t.delegate=null,R;var f=p.arg;if(!f)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,R;if(f.done)t[r.resultName]=f.value,t.next=r.nextLoc,t.method!=="return"&&(t.method="next",t.arg=_);else return f;return t.delegate=null,R}s(u),E(u,l,"Generator"),E(u,y,function(){return this}),E(u,"toString",function(){return"[object Generator]"});function g(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 I(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(g,this),this.reset(!0)}c.keys=function(r){var t=[];for(var n in r)t.push(n);return t.reverse(),function p(){for(;t.length;){var f=t.pop();if(f in r)return p.value=f,p.done=!1,p}return p.done=!0,p}};function D(r){if(r){var t=r[y];if(t)return t.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length)){var n=-1,p=function f(){for(;++n<r.length;)if(d.call(r,n))return f.value=r[n],f.done=!1,f;return f.value=_,f.done=!0,f};return p.next=p}}return{next:Z}}c.values=D;function Z(){return{value:_,done:!0}}return I.prototype={constructor:I,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=_,this.done=!1,this.delegate=null,this.method="next",this.arg=_,this.tryEntries.forEach(v),!r)for(var t in this)t.charAt(0)==="t"&&d.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=_)},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 n(N,G){return L.type="throw",L.arg=r,t.next=N,G&&(t.method="next",t.arg=_),!!G}for(var p=this.tryEntries.length-1;p>=0;--p){var f=this.tryEntries[p],L=f.completion;if(f.tryLoc==="root")return n("end");if(f.tryLoc<=this.prev){var M=d.call(f,"catchLoc"),z=d.call(f,"finallyLoc");if(M&&z){if(this.prev<f.catchLoc)return n(f.catchLoc,!0);if(this.prev<f.finallyLoc)return n(f.finallyLoc)}else if(M){if(this.prev<f.catchLoc)return n(f.catchLoc,!0)}else if(z){if(this.prev<f.finallyLoc)return n(f.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(r,t){for(var n=this.tryEntries.length-1;n>=0;--n){var p=this.tryEntries[n];if(p.tryLoc<=this.prev&&d.call(p,"finallyLoc")&&this.prev<p.finallyLoc){var f=p;break}}f&&(r==="break"||r==="continue")&&f.tryLoc<=t&&t<=f.finallyLoc&&(f=null);var L=f?f.completion:{};return L.type=r,L.arg=t,f?(this.method="next",this.next=f.finallyLoc,R):this.complete(L)},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),R},finish:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===r)return this.complete(n.completion,n.afterLoc),v(n),R}},catch:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===r){var p=n.completion;if(p.type==="throw"){var f=p.arg;v(n)}return f}}throw new Error("illegal catch attempt")},delegateYield:function(r,t,n){return this.delegate={iterator:D(r),resultName:t,nextLoc:n},this.method==="next"&&(this.arg=_),R}},c}(w.exports);try{regeneratorRuntime=m}catch(c){typeof globalThis=="object"?globalThis.regeneratorRuntime=m:Function("r","regeneratorRuntime = r")(m)}},175:function(w,m,c){c.d(m,{Mf:function(){return O.Z}});var O=c(653),d=c(666),_=c.n(d),j=null,y=c(949);function A(T){if(T.material){var a=Array.isArray(T.material)?T.material:[T.material];a.forEach(function(o){var i,e;(i=o.color)===null||i===void 0||i.convertSRGBToLinear(),(e=o.emissive)===null||e===void 0||e.convertSRGBToLinear(),o.map&&(o.map.encoding=THREE.sRGBEncoding),o.emissiveMap&&(o.emissiveMap.encoding=THREE.sRGBEncoding)})}}var l=c(568),E=c(924),P=T=>{var a={};return c.d(a,T),a},x=T=>()=>T,k=P({get:()=>X.get,set:()=>X.set}),H=c(620),B=null,C=null,R=function(){var T=(0,l.Z)(_().mark(function a(o,i){var e,u,s,h,b,S;return _().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return e=i.version,v.next=4,(0,k.get)(o);case 4:if(s=v.sent,!(s&&s[e])){v.next=9;break}u=s[e],v.next=15;break;case 9:return v.next=11,(0,H.Z)(fetch(o).then(function(I){if(I.ok)return I.blob();throw new Error}));case 11:h=v.sent,b=h.res,S=h.err,S||(u=b,(0,k.set)(o,(0,E.Z)({},e,b)));case 15:return v.abrupt("return",u?{url:URL.createObjectURL(u)}:{url:o});case 16:case"end":return v.stop()}},a)}));return function(o,i){return T.apply(this,arguments)}}(),V=c(977)},653:function(w,m,c){c.d(m,{Z:function(){return d}});var O=c(620);function d(){var _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},y={};return y.promise=new Promise(function(A,l){y.resolve=A,y.reject=l}),_&&(y.promise=(0,O.Z)(y.promise,j)),y}},620:function(w,m,c){c.d(m,{Z:function(){return d}});var O=c(42);function d(_){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return _.then(function(y){return(0,O.Z)({err:null,res:y},j)}).catch(function(y){return(0,O.Z)({err:y,res:void 0},j)})}},977:function(w,m,c){var O=c(949),d=new Map,_=function(y){return{generateTopUV:function(A,l,E,P,x){var k=l[E*3],H=l[E*3+1],B=l[P*3],C=l[P*3+1],R=l[x*3],V=l[x*3+1],T;if(d.has(A))T=d.get(A);else{var a=y&&y.Box3||new THREE.Box3;if(!y||!y.Box3){var o=A.parameters.shapes.getPoints();a.setFromArray(o.map(function(s){return[s.x,s.y,0]}).flat())}var i=a.getSize(new THREE.Vector3);T={box:a,size:i},d.set(A,T)}var e=T.box,u=T.size;return[new THREE.Vector2((k-e.min.x)/u.x,(H-e.min.y)/u.y),new THREE.Vector2((B-e.min.x)/u.x,(C-e.min.y)/u.y),new THREE.Vector2((R-e.min.x)/u.x,(V-e.min.y)/u.y)]},generateSideWallUV:function(A,l,E,P,x,k){var H=l[E*3],B=l[E*3+1],C=l[E*3+2],R=l[P*3],V=l[P*3+1],T=l[P*3+2],a=l[x*3],o=l[x*3+1],i=l[x*3+2],e=l[k*3],u=l[k*3+1],s=l[k*3+2],h;if(d.has(l))h=d.get(l);else{var b=new THREE.Box3;b.setFromArray(l);var S=b.getSize(new THREE.Vector3);h={box:b,size:S},d.set(l,h)}var g=h.box,v=h.size;return Math.abs(B-V)<.01?[new THREE.Vector2((H-g.min.x)/v.x,(C-g.min.z)/v.z),new THREE.Vector2((R-g.min.x)/v.x,(T-g.min.z)/v.z),new THREE.Vector2((a-g.min.x)/v.x,(i-g.min.z)/v.z),new THREE.Vector2((e-g.min.x)/v.x,(s-g.min.z)/v.z)]:[new THREE.Vector2((B-g.min.y)/v.x,(C-g.min.z)/v.z),new THREE.Vector2((V-g.min.y)/v.x,(T-g.min.z)/v.z),new THREE.Vector2((o-g.min.y)/v.x,(i-g.min.z)/v.z),new THREE.Vector2((u-g.min.y)/v.x,(s-g.min.z)/v.z)]}}},j=function(){d.clear()}},949:function(w,m,c){var O=_=>{var j={};return c.d(j,_),j},d=_=>()=>_;w.exports=O({MathUtils:()=>J.MathUtils})},568:function(w,m,c){c.d(m,{Z:function(){return d}});function O(_,j,y,A,l,E,P){try{var x=_[E](P),k=x.value}catch(H){y(H);return}x.done?j(k):Promise.resolve(k).then(A,l)}function d(_){return function(){var j=this,y=arguments;return new Promise(function(A,l){var E=_.apply(j,y);function P(k){O(E,A,l,P,x,"next",k)}function x(k){O(E,A,l,P,x,"throw",k)}P(void 0)})}}},924:function(w,m,c){c.d(m,{Z:function(){return O}});function O(d,_,j){return _ in d?Object.defineProperty(d,_,{value:j,enumerable:!0,configurable:!0,writable:!0}):d[_]=j,d}},42:function(w,m,c){c.d(m,{Z:function(){return d}});var O=c(924);function d(_){for(var j=1;j<arguments.length;j++){var y=arguments[j]!=null?arguments[j]:{},A=Object.keys(y);typeof Object.getOwnPropertySymbols=="function"&&(A=A.concat(Object.getOwnPropertySymbols(y).filter(function(l){return Object.getOwnPropertyDescriptor(y,l).enumerable}))),A.forEach(function(l){(0,O.Z)(_,l,y[l])})}return _}}},Y={};function U(w){var m=Y[w];if(m!==void 0)return m.exports;var c=Y[w]={exports:{}};return Q[w](c,c.exports,U),c.exports}(function(){U.n=function(w){var m=w&&w.__esModule?function(){return w.default}:function(){return w};return U.d(m,{a:m}),m}})(),function(){U.d=function(w,m){for(var c in m)U.o(m,c)&&!U.o(w,c)&&Object.defineProperty(w,c,{enumerable:!0,get:m[c]})}}(),function(){U.o=function(w,m){return Object.prototype.hasOwnProperty.call(w,m)}}();var K={};(function(){U.d(K,{Ct:function(){return c},Vw:function(){return T},hG:function(){return V}});function w(a,o){if(!(a instanceof o))throw new TypeError("Cannot call a class as a function")}var m=U(175),c=function(){"use strict";function a(){w(this,a),this.cache=new Map}var o=a.prototype;return o.install=function(){},o.init=function(e){var u=(0,m.Mf)();this.cache.set(e,u)},o.get=function(e){var u;return(u=this.cache.get(e))===null||u===void 0?void 0:u.promise},o.set=function(e,u){var s=this.cache.get(e);s?s.resolve(u):console.warn("init cache first")},o.dispose=function(){this.cache.forEach(function(e,u){e.reject("stop set cache:".concat(u))}),this.cache.clear()},a}(),O=U(568);function d(a,o){for(var i=0;i<o.length;i++){var e=o[i];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(a,e.key,e)}}function _(a,o,i){return o&&d(a.prototype,o),i&&d(a,i),a}function j(a){if(Array.isArray(a))return a}function y(a){if(typeof Symbol!="undefined"&&a[Symbol.iterator]!=null||a["@@iterator"]!=null)return Array.from(a)}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 l(a,o){(o==null||o>a.length)&&(o=a.length);for(var i=0,e=new Array(o);i<o;i++)e[i]=a[i];return e}function E(a,o){if(!!a){if(typeof a=="string")return l(a,o);var i=Object.prototype.toString.call(a).slice(8,-1);if(i==="Object"&&a.constructor&&(i=a.constructor.name),i==="Map"||i==="Set")return Array.from(i);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return l(a,o)}}function P(a,o){return j(a)||y(a,o)||E(a,o)||A()}function x(a){if(Array.isArray(a))return l(a)}function k(){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(a){return x(a)||y(a)||E(a)||k()}var B=U(666),C=U.n(B),R=U(949),V=function(){"use strict";function a(i){w(this,a),this.objectNamesToFactories=new Map,this.objects=new Map,this.objects_=i}var o=a.prototype;return o.install=function(e){this.pencil=e,this.initObjectFactories()},o.initObjectFactories=function(){var e=this,u=this.objects_;Object.keys(u).forEach(function(s){var h=function(){function b(){w(this,b)}var S=b.prototype;return S.create=function(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new u[s](v)},b}();e.objectNamesToFactories.set(s,h)})},o.getObject=function(e,u){e.includes("#")&&console.warn("getObject:err:\u4E0D\u652F\u6301 #",e);var s=(u||{}).key,h="".concat(e).concat(s?"#".concat(s):""),b=this.objects.get(h);return b},o.getAllObject=function(e,u){e.includes("#")&&console.warn("getAllObject:err:\u4E0D\u652F\u6301 #",e);var s=(u||{}).key,h="".concat(e).concat(s?"#".concat(s):""),b=[];return this.objects.forEach(function(S,g){(g.startsWith("".concat(h,"#"))||g===h)&&b.push(S)}),b},o.draw=function(e,u,s){var h=this;return(0,O.Z)(C().mark(function b(){var S,g,v,I,D,Z,r;return C().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(S=h.objectNamesToFactories.get(e),!S){n.next=15;break}return g=(u||{}).key,v="".concat(e).concat(g?"#".concat(g):""),h.objects.has(v)&&(I=R.MathUtils.generateUUID(),v+="#".concat(I)),D=(u==null?void 0:u.target)||s,typeof D=="string"?Z=h.objects.get(D):(D==null?void 0:D.objecttype__)==="BaseObject"?Z=D:Z=h.pencil.scene,r=new S().create(u),r.pencil=h.pencil,r.key=v,h.objects.set(v,r),n.next=14,h.addMesh(r,Z);case 14:return n.abrupt("return",r);case 15:throw new Error("Unrecognized:".concat(e));case 16:case"end":return n.stop()}},b)}))()},o.addMesh=function(e,u){return(0,O.Z)(C().mark(function s(){return C().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return b.next=2,e.create();case 2:e.object3d&&(e.object3d.userData.BaseObject_=e,u.add(e.object3d)),e.visible=!0,e.render(),e.pm.resolve();case 6:case"end":return b.stop()}},s)}))()},o.erase=function(){for(var e=arguments.length,u=new Array(e),s=0;s<e;s++)u[s]=arguments[s];var h=this;H(u).forEach(function(b){var S=[];if(typeof b=="string"){var g,v=P(b.split("#"),2),I=v[0],D=v[1];(g=S).push.apply(g,H(h.getAllObject(I,{key:D})))}else S.push(b);S.forEach(function(Z){h.removeMesh(Z)})})},o.removeMesh=function(e){var u=this,s=e.parent;e.object3d&&s.remove(e.object3d),e.traverse(function(h){h.visible=!1,h.dispose(),u.objects.delete(h.key)})},o.update=function(e,u){this.objects.forEach(function(s){s.update(e,u)})},o.setSize=function(e,u){this.objects.forEach(function(s){s.resize(e,u)})},o.dispose=function(){this.objects.forEach(function(e,u){e.dispose(),e.pm.reject("stop draw:".concat(u))}),this.objects.clear(),this.objectNamesToFactories.clear()},_(a,[{key:"objectsPromise",get:function(){var e=[];return this.objects.forEach(function(u){e.push(u.pm.promise)}),e}}]),a}(),T=function(){"use strict";function a(){w(this,a),this.data={}}var o=a.prototype;return o.install=function(){},o.setData=function(e,u){var s,h;this.data[e]=u,(h=(s=this).cb)===null||h===void 0||h.call(s,e)},o.runAll=function(){var e=this;Object.keys(this.data).forEach(function(u){var s,h;(h=(s=e).cb)===null||h===void 0||h.call(s,u)})},o.dispose=function(){this.data={},this.cb=void 0},a}()})();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(w){var m=function(c){"use strict";var O=Object.prototype,d=O.hasOwnProperty,_,j=typeof Symbol=="function"?Symbol:{},y=j.iterator||"@@iterator",A=j.asyncIterator||"@@asyncIterator",l=j.toStringTag||"@@toStringTag";function E(r,t,n){return Object.defineProperty(r,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),r[t]}try{E({},"")}catch(r){E=function(t,n,p){return t[n]=p}}function P(r,t,n,p){var f=t&&t.prototype instanceof V?t:V,L=Object.create(f.prototype),M=new I(p||[]);return L._invoke=b(r,n,M),L}c.wrap=P;function x(r,t,n){try{return{type:"normal",arg:r.call(t,n)}}catch(p){return{type:"throw",arg:p}}}var k="suspendedStart",H="suspendedYield",Z="executing",C="completed",R={};function V(){}function T(){}function a(){}var o={};E(o,y,function(){return this});var i=Object.getPrototypeOf,e=i&&i(i(D([])));e&&e!==O&&d.call(e,y)&&(o=e);var u=a.prototype=V.prototype=Object.create(o);T.prototype=a,E(u,"constructor",a),E(a,"constructor",T),T.displayName=E(a,l,"GeneratorFunction");function s(r){["next","throw","return"].forEach(function(t){E(r,t,function(n){return this._invoke(t,n)})})}c.isGeneratorFunction=function(r){var t=typeof r=="function"&&r.constructor;return t?t===T||(t.displayName||t.name)==="GeneratorFunction":!1},c.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,a):(r.__proto__=a,E(r,l,"GeneratorFunction")),r.prototype=Object.create(u),r},c.awrap=function(r){return{__await:r}};function h(r,t){function n(L,M,z,N){var G=x(r[L],r,M);if(G.type==="throw")N(G.arg);else{var $=G.arg,W=$.value;return W&&typeof W=="object"&&d.call(W,"__await")?t.resolve(W.__await).then(function(F){n("next",F,z,N)},function(F){n("throw",F,z,N)}):t.resolve(W).then(function(F){$.value=F,z($)},function(F){return n("throw",F,z,N)})}}var p;function f(L,M){function z(){return new t(function(N,G){n(L,M,N,G)})}return p=p?p.then(z,z):z()}this._invoke=f}s(h.prototype),E(h.prototype,A,function(){return this}),c.AsyncIterator=h,c.async=function(r,t,n,p,f){f===void 0&&(f=Promise);var L=new h(P(r,t,n,p),f);return c.isGeneratorFunction(t)?L:L.next().then(function(M){return M.done?M.value:L.next()})};function b(r,t,n){var p=k;return function(L,M){if(p===Z)throw new Error("Generator is already running");if(p===C){if(L==="throw")throw M;return B()}for(n.method=L,n.arg=M;;){var z=n.delegate;if(z){var N=S(z,n);if(N){if(N===R)continue;return N}}if(n.method==="next")n.sent=n._sent=n.arg;else if(n.method==="throw"){if(p===k)throw p=C,n.arg;n.dispatchException(n.arg)}else n.method==="return"&&n.abrupt("return",n.arg);p=Z;var G=x(r,t,n);if(G.type==="normal"){if(p=n.done?C:H,G.arg===R)continue;return{value:G.arg,done:n.done}}else G.type==="throw"&&(p=C,n.method="throw",n.arg=G.arg)}}}function S(r,t){var n=r.iterator[t.method];if(n===_){if(t.delegate=null,t.method==="throw"){if(r.iterator.return&&(t.method="return",t.arg=_,S(r,t),t.method==="throw"))return R;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return R}var p=x(n,r.iterator,t.arg);if(p.type==="throw")return t.method="throw",t.arg=p.arg,t.delegate=null,R;var f=p.arg;if(!f)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,R;if(f.done)t[r.resultName]=f.value,t.next=r.nextLoc,t.method!=="return"&&(t.method="next",t.arg=_);else return f;return t.delegate=null,R}s(u),E(u,l,"Generator"),E(u,y,function(){return this}),E(u,"toString",function(){return"[object Generator]"});function g(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 I(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(g,this),this.reset(!0)}c.keys=function(r){var t=[];for(var n in r)t.push(n);return t.reverse(),function p(){for(;t.length;){var f=t.pop();if(f in r)return p.value=f,p.done=!1,p}return p.done=!0,p}};function D(r){if(r){var t=r[y];if(t)return t.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length)){var n=-1,p=function f(){for(;++n<r.length;)if(d.call(r,n))return f.value=r[n],f.done=!1,f;return f.value=_,f.done=!0,f};return p.next=p}}return{next:B}}c.values=D;function B(){return{value:_,done:!0}}return I.prototype={constructor:I,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=_,this.done=!1,this.delegate=null,this.method="next",this.arg=_,this.tryEntries.forEach(v),!r)for(var t in this)t.charAt(0)==="t"&&d.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=_)},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 n(N,G){return L.type="throw",L.arg=r,t.next=N,G&&(t.method="next",t.arg=_),!!G}for(var p=this.tryEntries.length-1;p>=0;--p){var f=this.tryEntries[p],L=f.completion;if(f.tryLoc==="root")return n("end");if(f.tryLoc<=this.prev){var M=d.call(f,"catchLoc"),z=d.call(f,"finallyLoc");if(M&&z){if(this.prev<f.catchLoc)return n(f.catchLoc,!0);if(this.prev<f.finallyLoc)return n(f.finallyLoc)}else if(M){if(this.prev<f.catchLoc)return n(f.catchLoc,!0)}else if(z){if(this.prev<f.finallyLoc)return n(f.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(r,t){for(var n=this.tryEntries.length-1;n>=0;--n){var p=this.tryEntries[n];if(p.tryLoc<=this.prev&&d.call(p,"finallyLoc")&&this.prev<p.finallyLoc){var f=p;break}}f&&(r==="break"||r==="continue")&&f.tryLoc<=t&&t<=f.finallyLoc&&(f=null);var L=f?f.completion:{};return L.type=r,L.arg=t,f?(this.method="next",this.next=f.finallyLoc,R):this.complete(L)},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),R},finish:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===r)return this.complete(n.completion,n.afterLoc),v(n),R}},catch:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===r){var p=n.completion;if(p.type==="throw"){var f=p.arg;v(n)}return f}}throw new Error("illegal catch attempt")},delegateYield:function(r,t,n){return this.delegate={iterator:D(r),resultName:t,nextLoc:n},this.method==="next"&&(this.arg=_),R}},c}(w.exports);try{regeneratorRuntime=m}catch(c){typeof globalThis=="object"?globalThis.regeneratorRuntime=m:Function("r","regeneratorRuntime = r")(m)}},175:function(w,m,c){c.d(m,{Mf:function(){return O.Z}});var O=c(653),d=c(666),_=c.n(d),j=null,y=c(949);function A(T){if(T.material){var a=Array.isArray(T.material)?T.material:[T.material];a.forEach(function(o){var i,e;(i=o.color)===null||i===void 0||i.convertSRGBToLinear(),(e=o.emissive)===null||e===void 0||e.convertSRGBToLinear(),o.map&&(o.map.encoding=THREE.sRGBEncoding),o.emissiveMap&&(o.emissiveMap.encoding=THREE.sRGBEncoding)})}}var l=c(568),E=c(924),P=T=>{var a={};return c.d(a,T),a},x=T=>()=>T,k=P({get:()=>X.get,set:()=>X.set}),H=c(620),Z=null,C=null,R=function(){var T=(0,l.Z)(_().mark(function a(o,i){var e,u,s,h,b,S;return _().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return e=i.version,v.next=4,(0,k.get)(o);case 4:if(s=v.sent,!(s&&s[e])){v.next=9;break}u=s[e],v.next=15;break;case 9:return v.next=11,(0,H.Z)(fetch(o).then(function(I){if(I.ok)return I.blob();throw new Error}));case 11:h=v.sent,b=h.res,S=h.err,S||(u=b,(0,k.set)(o,(0,E.Z)({},e,b)));case 15:return v.abrupt("return",u?{url:URL.createObjectURL(u)}:{url:o});case 16:case"end":return v.stop()}},a)}));return function(o,i){return T.apply(this,arguments)}}(),V=c(977)},653:function(w,m,c){c.d(m,{Z:function(){return d}});var O=c(620);function d(){var _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},y={};return y.promise=new Promise(function(A,l){y.resolve=A,y.reject=l}),_&&(y.promise=(0,O.Z)(y.promise,j)),y}},620:function(w,m,c){c.d(m,{Z:function(){return d}});var O=c(42);function d(_){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return _.then(function(y){return(0,O.Z)({err:null,res:y},j)}).catch(function(y){return(0,O.Z)({err:y,res:void 0},j)})}},977:function(w,m,c){var O=c(949),d=new Map,_=function(y){return{generateTopUV:function(A,l,E,P,x){var k=l[E*3],H=l[E*3+1],Z=l[P*3],C=l[P*3+1],R=l[x*3],V=l[x*3+1],T;if(d.has(A))T=d.get(A);else{var a=y&&y.box3||new THREE.Box3;if(!y||!y.box3){var o=A.parameters.shapes.getPoints();a.setFromArray(o.map(function(s){return[s.x,s.y,0]}).flat())}var i=a.getSize(new THREE.Vector3);T={box:a,size:i},d.set(A,T)}var e=T.box,u=T.size;return[new THREE.Vector2((k-e.min.x)/u.x,(H-e.min.y)/u.y),new THREE.Vector2((Z-e.min.x)/u.x,(C-e.min.y)/u.y),new THREE.Vector2((R-e.min.x)/u.x,(V-e.min.y)/u.y)]},generateSideWallUV:function(A,l,E,P,x,k){var H=l[E*3],Z=l[E*3+1],C=l[E*3+2],R=l[P*3],V=l[P*3+1],T=l[P*3+2],a=l[x*3],o=l[x*3+1],i=l[x*3+2],e=l[k*3],u=l[k*3+1],s=l[k*3+2],h;if(d.has(l))h=d.get(l);else{var b=new THREE.Box3;b.setFromArray(l);var S=b.getSize(new THREE.Vector3);h={box:b,size:S},d.set(l,h)}var g=h.box,v=h.size;return Math.abs(Z-V)<.01?[new THREE.Vector2((H-g.min.x)/v.x,(C-g.min.z)/v.z),new THREE.Vector2((R-g.min.x)/v.x,(T-g.min.z)/v.z),new THREE.Vector2((a-g.min.x)/v.x,(i-g.min.z)/v.z),new THREE.Vector2((e-g.min.x)/v.x,(s-g.min.z)/v.z)]:[new THREE.Vector2((Z-g.min.y)/v.x,(C-g.min.z)/v.z),new THREE.Vector2((V-g.min.y)/v.x,(T-g.min.z)/v.z),new THREE.Vector2((o-g.min.y)/v.x,(i-g.min.z)/v.z),new THREE.Vector2((u-g.min.y)/v.x,(s-g.min.z)/v.z)]}}},j=function(){d.clear()}},949:function(w,m,c){var O=_=>{var j={};return c.d(j,_),j},d=_=>()=>_;w.exports=O({MathUtils:()=>J.MathUtils})},568:function(w,m,c){c.d(m,{Z:function(){return d}});function O(_,j,y,A,l,E,P){try{var x=_[E](P),k=x.value}catch(H){y(H);return}x.done?j(k):Promise.resolve(k).then(A,l)}function d(_){return function(){var j=this,y=arguments;return new Promise(function(A,l){var E=_.apply(j,y);function P(k){O(E,A,l,P,x,"next",k)}function x(k){O(E,A,l,P,x,"throw",k)}P(void 0)})}}},924:function(w,m,c){c.d(m,{Z:function(){return O}});function O(d,_,j){return _ in d?Object.defineProperty(d,_,{value:j,enumerable:!0,configurable:!0,writable:!0}):d[_]=j,d}},42:function(w,m,c){c.d(m,{Z:function(){return d}});var O=c(924);function d(_){for(var j=1;j<arguments.length;j++){var y=arguments[j]!=null?arguments[j]:{},A=Object.keys(y);typeof Object.getOwnPropertySymbols=="function"&&(A=A.concat(Object.getOwnPropertySymbols(y).filter(function(l){return Object.getOwnPropertyDescriptor(y,l).enumerable}))),A.forEach(function(l){(0,O.Z)(_,l,y[l])})}return _}}},Y={};function U(w){var m=Y[w];if(m!==void 0)return m.exports;var c=Y[w]={exports:{}};return Q[w](c,c.exports,U),c.exports}(function(){U.n=function(w){var m=w&&w.__esModule?function(){return w.default}:function(){return w};return U.d(m,{a:m}),m}})(),function(){U.d=function(w,m){for(var c in m)U.o(m,c)&&!U.o(w,c)&&Object.defineProperty(w,c,{enumerable:!0,get:m[c]})}}(),function(){U.o=function(w,m){return Object.prototype.hasOwnProperty.call(w,m)}}();var K={};(function(){U.d(K,{Ct:function(){return c},Vw:function(){return T},hG:function(){return V}});function w(a,o){if(!(a instanceof o))throw new TypeError("Cannot call a class as a function")}var m=U(175),c=function(){"use strict";function a(){w(this,a),this.cache=new Map}var o=a.prototype;return o.install=function(){},o.init=function(e){var u=(0,m.Mf)();this.cache.set(e,u)},o.get=function(e){var u;return(u=this.cache.get(e))===null||u===void 0?void 0:u.promise},o.set=function(e,u){var s=this.cache.get(e);s?s.resolve(u):console.warn("init cache first")},o.dispose=function(){this.cache.forEach(function(e,u){e.reject("stop set cache:".concat(u))}),this.cache.clear()},a}(),O=U(568);function d(a,o){for(var i=0;i<o.length;i++){var e=o[i];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(a,e.key,e)}}function _(a,o,i){return o&&d(a.prototype,o),i&&d(a,i),a}function j(a){if(Array.isArray(a))return a}function y(a){if(typeof Symbol!="undefined"&&a[Symbol.iterator]!=null||a["@@iterator"]!=null)return Array.from(a)}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 l(a,o){(o==null||o>a.length)&&(o=a.length);for(var i=0,e=new Array(o);i<o;i++)e[i]=a[i];return e}function E(a,o){if(!!a){if(typeof a=="string")return l(a,o);var i=Object.prototype.toString.call(a).slice(8,-1);if(i==="Object"&&a.constructor&&(i=a.constructor.name),i==="Map"||i==="Set")return Array.from(i);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return l(a,o)}}function P(a,o){return j(a)||y(a,o)||E(a,o)||A()}function x(a){if(Array.isArray(a))return l(a)}function k(){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(a){return x(a)||y(a)||E(a)||k()}var Z=U(666),C=U.n(Z),R=U(949),V=function(){"use strict";function a(i){w(this,a),this.objectNamesToFactories=new Map,this.objects=new Map,this.objects_=i}var o=a.prototype;return o.install=function(e){this.pencil=e,this.initObjectFactories()},o.initObjectFactories=function(){var e=this,u=this.objects_;Object.keys(u).forEach(function(s){var h=function(){function b(){w(this,b)}var S=b.prototype;return S.create=function(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new u[s](v)},b}();e.objectNamesToFactories.set(s,h)})},o.getObject=function(e,u){e.includes("#")&&console.warn("getObject:err:\u4E0D\u652F\u6301 #",e);var s=(u||{}).key,h="".concat(e).concat(s?"#".concat(s):""),b=this.objects.get(h);return b},o.getAllObject=function(e,u){e.includes("#")&&console.warn("getAllObject:err:\u4E0D\u652F\u6301 #",e);var s=(u||{}).key,h="".concat(e).concat(s?"#".concat(s):""),b=[];return this.objects.forEach(function(S,g){(g.startsWith("".concat(h,"#"))||g===h)&&b.push(S)}),b},o.draw=function(e,u,s){var h=this;return(0,O.Z)(C().mark(function b(){var S,g,v,I,D,B,r;return C().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(S=h.objectNamesToFactories.get(e),!S){n.next=15;break}return g=(u||{}).key,v="".concat(e).concat(g?"#".concat(g):""),h.objects.has(v)&&(I=R.MathUtils.generateUUID(),v+="#".concat(I)),D=(u==null?void 0:u.target)||s,typeof D=="string"?B=h.objects.get(D):(D==null?void 0:D.objecttype__)==="BaseObject"?B=D:B=h.pencil.scene,r=new S().create(u),r.pencil=h.pencil,r.key=v,h.objects.set(v,r),n.next=14,h.addMesh(r,B);case 14:return n.abrupt("return",r);case 15:throw new Error("Unrecognized:".concat(e));case 16:case"end":return n.stop()}},b)}))()},o.addMesh=function(e,u){return(0,O.Z)(C().mark(function s(){return C().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return b.next=2,e.create();case 2:e.object3d&&(e.object3d.userData.BaseObject_=e,u.add(e.object3d)),e.visible=!0,e.render(),e.pm.resolve();case 6:case"end":return b.stop()}},s)}))()},o.erase=function(){for(var e=arguments.length,u=new Array(e),s=0;s<e;s++)u[s]=arguments[s];var h=this;H(u).forEach(function(b){var S=[];if(typeof b=="string"){var g,v=P(b.split("#"),2),I=v[0],D=v[1];(g=S).push.apply(g,H(h.getAllObject(I,{key:D})))}else S.push(b);S.forEach(function(B){h.removeMesh(B)})})},o.removeMesh=function(e){var u=this,s=e.parent;e.object3d&&s.remove(e.object3d),e.traverse(function(h){h.visible=!1,h.dispose(),u.objects.delete(h.key)})},o.update=function(e,u){this.objects.forEach(function(s){s.update(e,u)})},o.setSize=function(e,u){this.objects.forEach(function(s){s.resize(e,u)})},o.dispose=function(){this.objects.forEach(function(e,u){e.dispose(),e.pm.reject("stop draw:".concat(u))}),this.objects.clear(),this.objectNamesToFactories.clear()},_(a,[{key:"objectsPromise",get:function(){var e=[];return this.objects.forEach(function(u){e.push(u.pm.promise)}),e}}]),a}(),T=function(){"use strict";function a(){w(this,a),this.data={}}var o=a.prototype;return o.install=function(){},o.setData=function(e,u){var s,h;this.data[e]=u,(h=(s=this).cb)===null||h===void 0||h.call(s,e)},o.runAll=function(){var e=this;Object.keys(this.data).forEach(function(u){var s,h;(h=(s=e).cb)===null||h===void 0||h.call(s,u)})},o.dispose=function(){this.data={},this.cb=void 0},a}()})();var q=K.Ct,tt=K.Vw,et=K.hG;export{q as Cache,tt as Data,et as Draw};
@@ -1 +1 @@
1
- (function(){var H={666:function(v){var s=function(i){"use strict";var u=Object.prototype,c=u.hasOwnProperty,e,n=typeof Symbol=="function"?Symbol:{},o=n.iterator||"@@iterator",l=n.asyncIterator||"@@asyncIterator",m=n.toStringTag||"@@toStringTag";function f(r,t,a){return Object.defineProperty(r,t,{value:a,enumerable:!0,configurable:!0,writable:!0}),r[t]}try{f({},"")}catch(r){f=function(t,a,p){return t[a]=p}}function g(r,t,a,p){var h=t&&t.prototype instanceof V?t:V,A=Object.create(h.prototype),G=new M(p||[]);return A._invoke=O(r,a,G),A}i.wrap=g;function E(r,t,a){try{return{type:"normal",arg:r.call(t,a)}}catch(p){return{type:"throw",arg:p}}}var P="suspendedStart",j="suspendedYield",B="executing",Z="completed",T={};function V(){}function z(){}function C(){}var W={};f(W,o,function(){return this});var S=Object.getPrototypeOf,k=S&&S(S($([])));k&&k!==u&&c.call(k,o)&&(W=k);var d=C.prototype=V.prototype=Object.create(W);z.prototype=C,f(d,"constructor",C),f(C,"constructor",z),z.displayName=f(C,m,"GeneratorFunction");function _(r){["next","throw","return"].forEach(function(t){f(r,t,function(a){return this._invoke(t,a)})})}i.isGeneratorFunction=function(r){var t=typeof r=="function"&&r.constructor;return t?t===z||(t.displayName||t.name)==="GeneratorFunction":!1},i.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,C):(r.__proto__=C,f(r,m,"GeneratorFunction")),r.prototype=Object.create(d),r},i.awrap=function(r){return{__await:r}};function y(r,t){function a(A,G,I,x){var U=E(r[A],r,G);if(U.type==="throw")x(U.arg);else{var Y=U.arg,K=Y.value;return K&&typeof K=="object"&&c.call(K,"__await")?t.resolve(K.__await).then(function(N){a("next",N,I,x)},function(N){a("throw",N,I,x)}):t.resolve(K).then(function(N){Y.value=N,I(Y)},function(N){return a("throw",N,I,x)})}}var p;function h(A,G){function I(){return new t(function(x,U){a(A,G,x,U)})}return p=p?p.then(I,I):I()}this._invoke=h}_(y.prototype),f(y.prototype,l,function(){return this}),i.AsyncIterator=y,i.async=function(r,t,a,p,h){h===void 0&&(h=Promise);var A=new y(g(r,t,a,p),h);return i.isGeneratorFunction(t)?A:A.next().then(function(G){return G.done?G.value:A.next()})};function O(r,t,a){var p=P;return function(A,G){if(p===B)throw new Error("Generator is already running");if(p===Z){if(A==="throw")throw G;return R()}for(a.method=A,a.arg=G;;){var I=a.delegate;if(I){var x=D(I,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(p===P)throw p=Z,a.arg;a.dispatchException(a.arg)}else a.method==="return"&&a.abrupt("return",a.arg);p=B;var U=E(r,t,a);if(U.type==="normal"){if(p=a.done?Z:j,U.arg===T)continue;return{value:U.arg,done:a.done}}else U.type==="throw"&&(p=Z,a.method="throw",a.arg=U.arg)}}}function D(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,D(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 p=E(a,r.iterator,t.arg);if(p.type==="throw")return t.method="throw",t.arg=p.arg,t.delegate=null,T;var h=p.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}_(d),f(d,m,"Generator"),f(d,o,function(){return this}),f(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 p(){for(;t.length;){var h=t.pop();if(h in r)return p.value=h,p.done=!1,p}return p.done=!0,p}};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,p=function h(){for(;++a<r.length;)if(c.call(r,a))return h.value=r[a],h.done=!1,h;return h.value=e,h.done=!0,h};return p.next=p}}return{next:R}}i.values=$;function R(){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"&&c.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,U){return A.type="throw",A.arg=r,t.next=x,U&&(t.method="next",t.arg=e),!!U}for(var p=this.tryEntries.length-1;p>=0;--p){var h=this.tryEntries[p],A=h.completion;if(h.tryLoc==="root")return a("end");if(h.tryLoc<=this.prev){var G=c.call(h,"catchLoc"),I=c.call(h,"finallyLoc");if(G&&I){if(this.prev<h.catchLoc)return a(h.catchLoc,!0);if(this.prev<h.finallyLoc)return a(h.finallyLoc)}else if(G){if(this.prev<h.catchLoc)return a(h.catchLoc,!0)}else if(I){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 p=this.tryEntries[a];if(p.tryLoc<=this.prev&&c.call(p,"finallyLoc")&&this.prev<p.finallyLoc){var h=p;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 p=a.completion;if(p.type==="throw"){var h=p.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=s}catch(i){typeof globalThis=="object"?globalThis.regeneratorRuntime=s:Function("r","regeneratorRuntime = r")(s)}},182:function(v,s,i){"use strict";i.d(s,{Z:function(){return u}});function u(c){if(c.geometry&&c.geometry.dispose(),c.material){var e=Array.isArray(c.material)?c.material:[c.material];e.forEach(function(n){var o,l,m,f,g,E,P,j,B,Z,T,V,z;(o=n.map)===null||o===void 0||o.dispose(),(l=n.lightMap)===null||l===void 0||l.dispose(),(m=n.bumpMap)===null||m===void 0||m.dispose(),(f=n.normalMap)===null||f===void 0||f.dispose(),(g=n.specularMap)===null||g===void 0||g.dispose(),(E=n.envMap)===null||E===void 0||E.dispose(),(P=n.alphaMap)===null||P===void 0||P.dispose(),(j=n.aoMap)===null||j===void 0||j.dispose(),(B=n.displacementMap)===null||B===void 0||B.dispose(),(Z=n.emissiveMap)===null||Z===void 0||Z.dispose(),(T=n.gradientMap)===null||T===void 0||T.dispose(),(V=n.metalnessMap)===null||V===void 0||V.dispose(),(z=n.roughnessMap)===null||z===void 0||z.dispose(),n.dispose()})}}},794:function(v,s,i){"use strict";i.d(s,{U:function(){return c},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 l;return document.compatMode==="BackCompat"||document.documentElement.scrollTop===0?l=document.body.scrollLeft:l=document.documentElement.scrollLeft,n-l},c=function(e){for(var n=e.offsetTop,o=e.offsetParent;o!==null;)n+=o.offsetTop,o=o.offsetParent;var l;return document.compatMode==="BackCompat"||document.documentElement.scrollTop===0?l=document.body.scrollTop:l=document.documentElement.scrollTop,n-l}},975:function(v,s,i){"use strict";i.d(s,{Z:function(){return c}});function u(e){return Object.prototype.toString.call(e)==="[object Object]"}function c(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)}},653:function(v,s,i){"use strict";i.d(s,{Z:function(){return c}});var u=i(620);function c(){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(l,m){o.resolve=l,o.reject=m}),e&&(o.promise=(0,u.Z)(o.promise,n)),o}},226:function(v,s,i){"use strict";i.d(s,{Z:function(){return u}});function u(c,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=(90-e)*Math.PI/180,l=(90-c)*Math.PI/180;return[n*Math.sin(o)*Math.cos(l),n*Math.cos(o),n*Math.sin(o)*Math.sin(l)]}},688:function(v,s,i){"use strict";i.d(s,{Z:function(){return e}});var u=i(438),c=function(){"use strict";function n(l){(0,u.Z)(this,n),this.onTick_=l,this.cancelPending_=null}var o=n.prototype;return o.tickAfter=function(m){var f=this;this.stop();var g=!0,E;this.cancelPending_=function(){clearTimeout(E),g=!1};var P=function(){g&&f.onTick_()};return E=window.setTimeout(P,m),this},o.stop=function(){this.cancelPending_&&(this.cancelPending_(),this.cancelPending_=null)},n}(),e=function(){"use strict";function n(l){(0,u.Z)(this,n),this.onTick_=l,this.ticker_=null}var o=n.prototype;return o.tickNow=function(){return this.stop(),this.onTick_(),this},o.tickAfter=function(m){var f=this;return this.stop(),this.ticker_=new c(function(){f.onTick_()}).tickAfter(m),this},o.tickEvery=function(m){var f=this;return this.stop(),this.ticker_=new c(function(){var g;(g=f.ticker_)===null||g===void 0||g.tickAfter(m),f.onTick_()}).tickAfter(m),this},o.stop=function(){this.ticker_&&(this.ticker_.stop(),this.ticker_=null)},n}()},620:function(v,s,i){"use strict";i.d(s,{Z:function(){return c}});var u=i(42);function c(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)})}},977:function(v,s,i){"use strict";i.d(s,{C:function(){return o},y:function(){return n}});var u=i(644),c=i.n(u),e=new Map,n=function(l){return{generateTopUV:function(m,f,g,E,P){var j=f[g*3],B=f[g*3+1],Z=f[E*3],T=f[E*3+1],V=f[P*3],z=f[P*3+1],C;if(e.has(m))C=e.get(m);else{var W=l&&l.Box3||new u.Box3;if(!l||!l.Box3){var S=m.parameters.shapes.getPoints();W.setFromArray(S.map(function(y){return[y.x,y.y,0]}).flat())}var k=W.getSize(new u.Vector3);C={box:W,size:k},e.set(m,C)}var d=C.box,_=C.size;return[new u.Vector2((j-d.min.x)/_.x,(B-d.min.y)/_.y),new u.Vector2((Z-d.min.x)/_.x,(T-d.min.y)/_.y),new u.Vector2((V-d.min.x)/_.x,(z-d.min.y)/_.y)]},generateSideWallUV:function(m,f,g,E,P,j){var B=f[g*3],Z=f[g*3+1],T=f[g*3+2],V=f[E*3],z=f[E*3+1],C=f[E*3+2],W=f[P*3],S=f[P*3+1],k=f[P*3+2],d=f[j*3],_=f[j*3+1],y=f[j*3+2],O;if(e.has(f))O=e.get(f);else{var D=new u.Box3;D.setFromArray(f);var L=D.getSize(new u.Vector3);O={box:D,size:L},e.set(f,O)}var w=O.box,M=O.size;return Math.abs(Z-z)<.01?[new u.Vector2((B-w.min.x)/M.x,(T-w.min.z)/M.z),new u.Vector2((V-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((z-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((_-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,s,i){"use strict";i.d(s,{Z:function(){return u}});function u(c,e){(e==null||e>c.length)&&(e=c.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=c[n];return o}},982:function(v,s,i){"use strict";i.d(s,{Z:function(){return c}});var u=i(943);function c(e){if(Array.isArray(e))return(0,u.Z)(e)}},568:function(v,s,i){"use strict";i.d(s,{Z:function(){return c}});function u(e,n,o,l,m,f,g){try{var E=e[f](g),P=E.value}catch(j){o(j);return}E.done?n(P):Promise.resolve(P).then(l,m)}function c(e){return function(){var n=this,o=arguments;return new Promise(function(l,m){var f=e.apply(n,o);function g(P){u(f,l,m,g,E,"next",P)}function E(P){u(f,l,m,g,E,"throw",P)}g(void 0)})}}},438:function(v,s,i){"use strict";i.d(s,{Z:function(){return u}});function u(c,e){if(!(c instanceof e))throw new TypeError("Cannot call a class as a function")}},924:function(v,s,i){"use strict";i.d(s,{Z:function(){return u}});function u(c,e,n){return e in c?Object.defineProperty(c,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):c[e]=n,c}},375:function(v,s,i){"use strict";i.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(v,s,i){"use strict";i.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(v,s,i){"use strict";i.d(s,{Z:function(){return c}});var u=i(924);function c(e){for(var n=1;n<arguments.length;n++){var o=arguments[n]!=null?arguments[n]:{},l=Object.keys(o);typeof Object.getOwnPropertySymbols=="function"&&(l=l.concat(Object.getOwnPropertySymbols(o).filter(function(m){return Object.getOwnPropertyDescriptor(o,m).enumerable}))),l.forEach(function(m){(0,u.Z)(e,m,o[m])})}return e}},342:function(v,s,i){"use strict";i.d(s,{Z:function(){return o}});var u=i(982),c=i(375),e=i(270),n=i(566);function o(l){return(0,u.Z)(l)||(0,c.Z)(l)||(0,n.Z)(l)||(0,e.Z)()}},566:function(v,s,i){"use strict";i.d(s,{Z:function(){return c}});var u=i(943);function c(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 s=X[v];if(s!==void 0)return s.exports;var i=X[v]={exports:{}};return H[v](i,i.exports,b),i.exports}(function(){b.n=function(v){var s=v&&v.__esModule?function(){return v.default}:function(){return v};return b.d(s,{a:s}),s}})(),function(){b.d=function(v,s){for(var i in s)b.o(s,i)&&!b.o(v,i)&&Object.defineProperty(v,i,{enumerable:!0,get:s[i]})}}(),function(){b.o=function(v,s){return Object.prototype.hasOwnProperty.call(v,s)}}(),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 V},clearCache:function(){return T},colorCorrection:function(){return P},disposeMesh:function(){return g.Z},getCache:function(){return z},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 f.Z},to:function(){return s.Z}});var v=b(653),s=b(620),i=b(688),u=b(568),c=b(438),e=b(42),n=b(342),o=b(666),l=b.n(o),m=function(){"use strict";function S(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(0,c.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(_){return _.stop1()}),this},k.dispose=function(){return this.stop(),this.chainedList=[],this.children=[],this},k.play=function(){var _=this;return(0,u.Z)(l().mark(function y(){var O;return l().wrap(function(L){for(;;)switch(L.prev=L.next){case 0:if(O=_.chainedList[_.index],!(O&&_.isPlaying)){L.next=9;break}return L.next=4,Promise.all(O.map(function(w){return typeof w=="function"?w(_.repeatCount):w.start()}));case 4:return _.index+=1,L.next=7,_.play();case 7:L.next=17;break;case 9:if(!(!O&&_.isPlaying&&_.repeatCount<_.repeatNum)){L.next=16;break}return _.repeatCount+=1,_.index=0,L.next=14,_.play();case 14:L.next=17;break;case 16:!O&&_.isPlaying&&_.repeatCount===_.repeatNum&&_.stop();case 17:case"end":return L.stop()}},y)}))()},k.chain=function(){for(var _=arguments.length,y=new Array(_),O=0;O<_;O++)y[O]=arguments[O];var D=this;return(0,n.Z)(y).forEach(function(L){L instanceof S&&D.children.push(L)}),this.chainedList.push((0,n.Z)(y)),this},k.repeat=function(_){return this.repeatNum=_,this},k.timeout=function(_){return this.chain(function(){return new Promise(function(y){return setTimeout(y,_)})}),this},k.traverse=function(_){_(this),this.children.forEach(function(y){y.traverse(_)})},S}(),f=b(226),g=b(182),E=b(644);function P(S){if(S.material){var k=Array.isArray(S.material)?S.material:[S.material];k.forEach(function(d){var _,y;(_=d.color)===null||_===void 0||_.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(975),B=b(924),Z=require("idb-keyval"),T=Z.del,V=Z.clear,z=function(){var S=(0,u.Z)(l().mark(function k(d,_){var y,O,D,L,w,M;return l().wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return y=_.version,R.next=4,(0,Z.get)(d);case 4:if(D=R.sent,!(D&&D[y])){R.next=9;break}O=D[y],R.next=15;break;case 9:return R.next=11,(0,s.Z)(fetch(d).then(function(r){if(r.ok)return r.blob();throw new Error}));case 11:L=R.sent,w=L.res,M=L.err,M||(O=w,(0,Z.set)(d,(0,B.Z)({},y,w)));case 15:return R.abrupt("return",O?{url:URL.createObjectURL(O)}:{url:d});case 16:case"end":return R.stop()}},k)}));return function(d,_){return S.apply(this,arguments)}}(),C=b(794),W=b(977)})(),module.exports=F})();
1
+ (function(){var H={666:function(v){var s=function(i){"use strict";var u=Object.prototype,c=u.hasOwnProperty,e,n=typeof Symbol=="function"?Symbol:{},o=n.iterator||"@@iterator",l=n.asyncIterator||"@@asyncIterator",m=n.toStringTag||"@@toStringTag";function f(r,t,a){return Object.defineProperty(r,t,{value:a,enumerable:!0,configurable:!0,writable:!0}),r[t]}try{f({},"")}catch(r){f=function(t,a,p){return t[a]=p}}function g(r,t,a,p){var h=t&&t.prototype instanceof V?t:V,A=Object.create(h.prototype),G=new M(p||[]);return A._invoke=O(r,a,G),A}i.wrap=g;function E(r,t,a){try{return{type:"normal",arg:r.call(t,a)}}catch(p){return{type:"throw",arg:p}}}var P="suspendedStart",j="suspendedYield",B="executing",Z="completed",T={};function V(){}function z(){}function C(){}var W={};f(W,o,function(){return this});var S=Object.getPrototypeOf,k=S&&S(S($([])));k&&k!==u&&c.call(k,o)&&(W=k);var d=C.prototype=V.prototype=Object.create(W);z.prototype=C,f(d,"constructor",C),f(C,"constructor",z),z.displayName=f(C,m,"GeneratorFunction");function _(r){["next","throw","return"].forEach(function(t){f(r,t,function(a){return this._invoke(t,a)})})}i.isGeneratorFunction=function(r){var t=typeof r=="function"&&r.constructor;return t?t===z||(t.displayName||t.name)==="GeneratorFunction":!1},i.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,C):(r.__proto__=C,f(r,m,"GeneratorFunction")),r.prototype=Object.create(d),r},i.awrap=function(r){return{__await:r}};function y(r,t){function a(A,G,I,x){var U=E(r[A],r,G);if(U.type==="throw")x(U.arg);else{var Y=U.arg,K=Y.value;return K&&typeof K=="object"&&c.call(K,"__await")?t.resolve(K.__await).then(function(N){a("next",N,I,x)},function(N){a("throw",N,I,x)}):t.resolve(K).then(function(N){Y.value=N,I(Y)},function(N){return a("throw",N,I,x)})}}var p;function h(A,G){function I(){return new t(function(x,U){a(A,G,x,U)})}return p=p?p.then(I,I):I()}this._invoke=h}_(y.prototype),f(y.prototype,l,function(){return this}),i.AsyncIterator=y,i.async=function(r,t,a,p,h){h===void 0&&(h=Promise);var A=new y(g(r,t,a,p),h);return i.isGeneratorFunction(t)?A:A.next().then(function(G){return G.done?G.value:A.next()})};function O(r,t,a){var p=P;return function(A,G){if(p===B)throw new Error("Generator is already running");if(p===Z){if(A==="throw")throw G;return R()}for(a.method=A,a.arg=G;;){var I=a.delegate;if(I){var x=D(I,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(p===P)throw p=Z,a.arg;a.dispatchException(a.arg)}else a.method==="return"&&a.abrupt("return",a.arg);p=B;var U=E(r,t,a);if(U.type==="normal"){if(p=a.done?Z:j,U.arg===T)continue;return{value:U.arg,done:a.done}}else U.type==="throw"&&(p=Z,a.method="throw",a.arg=U.arg)}}}function D(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,D(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 p=E(a,r.iterator,t.arg);if(p.type==="throw")return t.method="throw",t.arg=p.arg,t.delegate=null,T;var h=p.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}_(d),f(d,m,"Generator"),f(d,o,function(){return this}),f(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 p(){for(;t.length;){var h=t.pop();if(h in r)return p.value=h,p.done=!1,p}return p.done=!0,p}};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,p=function h(){for(;++a<r.length;)if(c.call(r,a))return h.value=r[a],h.done=!1,h;return h.value=e,h.done=!0,h};return p.next=p}}return{next:R}}i.values=$;function R(){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"&&c.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,U){return A.type="throw",A.arg=r,t.next=x,U&&(t.method="next",t.arg=e),!!U}for(var p=this.tryEntries.length-1;p>=0;--p){var h=this.tryEntries[p],A=h.completion;if(h.tryLoc==="root")return a("end");if(h.tryLoc<=this.prev){var G=c.call(h,"catchLoc"),I=c.call(h,"finallyLoc");if(G&&I){if(this.prev<h.catchLoc)return a(h.catchLoc,!0);if(this.prev<h.finallyLoc)return a(h.finallyLoc)}else if(G){if(this.prev<h.catchLoc)return a(h.catchLoc,!0)}else if(I){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 p=this.tryEntries[a];if(p.tryLoc<=this.prev&&c.call(p,"finallyLoc")&&this.prev<p.finallyLoc){var h=p;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 p=a.completion;if(p.type==="throw"){var h=p.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=s}catch(i){typeof globalThis=="object"?globalThis.regeneratorRuntime=s:Function("r","regeneratorRuntime = r")(s)}},182:function(v,s,i){"use strict";i.d(s,{Z:function(){return u}});function u(c){if(c.geometry&&c.geometry.dispose(),c.material){var e=Array.isArray(c.material)?c.material:[c.material];e.forEach(function(n){var o,l,m,f,g,E,P,j,B,Z,T,V,z;(o=n.map)===null||o===void 0||o.dispose(),(l=n.lightMap)===null||l===void 0||l.dispose(),(m=n.bumpMap)===null||m===void 0||m.dispose(),(f=n.normalMap)===null||f===void 0||f.dispose(),(g=n.specularMap)===null||g===void 0||g.dispose(),(E=n.envMap)===null||E===void 0||E.dispose(),(P=n.alphaMap)===null||P===void 0||P.dispose(),(j=n.aoMap)===null||j===void 0||j.dispose(),(B=n.displacementMap)===null||B===void 0||B.dispose(),(Z=n.emissiveMap)===null||Z===void 0||Z.dispose(),(T=n.gradientMap)===null||T===void 0||T.dispose(),(V=n.metalnessMap)===null||V===void 0||V.dispose(),(z=n.roughnessMap)===null||z===void 0||z.dispose(),n.dispose()})}}},794:function(v,s,i){"use strict";i.d(s,{U:function(){return c},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 l;return document.compatMode==="BackCompat"||document.documentElement.scrollTop===0?l=document.body.scrollLeft:l=document.documentElement.scrollLeft,n-l},c=function(e){for(var n=e.offsetTop,o=e.offsetParent;o!==null;)n+=o.offsetTop,o=o.offsetParent;var l;return document.compatMode==="BackCompat"||document.documentElement.scrollTop===0?l=document.body.scrollTop:l=document.documentElement.scrollTop,n-l}},975:function(v,s,i){"use strict";i.d(s,{Z:function(){return c}});function u(e){return Object.prototype.toString.call(e)==="[object Object]"}function c(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)}},653:function(v,s,i){"use strict";i.d(s,{Z:function(){return c}});var u=i(620);function c(){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(l,m){o.resolve=l,o.reject=m}),e&&(o.promise=(0,u.Z)(o.promise,n)),o}},226:function(v,s,i){"use strict";i.d(s,{Z:function(){return u}});function u(c,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=(90-e)*Math.PI/180,l=(90-c)*Math.PI/180;return[n*Math.sin(o)*Math.cos(l),n*Math.cos(o),n*Math.sin(o)*Math.sin(l)]}},688:function(v,s,i){"use strict";i.d(s,{Z:function(){return e}});var u=i(438),c=function(){"use strict";function n(l){(0,u.Z)(this,n),this.onTick_=l,this.cancelPending_=null}var o=n.prototype;return o.tickAfter=function(m){var f=this;this.stop();var g=!0,E;this.cancelPending_=function(){clearTimeout(E),g=!1};var P=function(){g&&f.onTick_()};return E=window.setTimeout(P,m),this},o.stop=function(){this.cancelPending_&&(this.cancelPending_(),this.cancelPending_=null)},n}(),e=function(){"use strict";function n(l){(0,u.Z)(this,n),this.onTick_=l,this.ticker_=null}var o=n.prototype;return o.tickNow=function(){return this.stop(),this.onTick_(),this},o.tickAfter=function(m){var f=this;return this.stop(),this.ticker_=new c(function(){f.onTick_()}).tickAfter(m),this},o.tickEvery=function(m){var f=this;return this.stop(),this.ticker_=new c(function(){var g;(g=f.ticker_)===null||g===void 0||g.tickAfter(m),f.onTick_()}).tickAfter(m),this},o.stop=function(){this.ticker_&&(this.ticker_.stop(),this.ticker_=null)},n}()},620:function(v,s,i){"use strict";i.d(s,{Z:function(){return c}});var u=i(42);function c(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)})}},977:function(v,s,i){"use strict";i.d(s,{C:function(){return o},y:function(){return n}});var u=i(644),c=i.n(u),e=new Map,n=function(l){return{generateTopUV:function(m,f,g,E,P){var j=f[g*3],B=f[g*3+1],Z=f[E*3],T=f[E*3+1],V=f[P*3],z=f[P*3+1],C;if(e.has(m))C=e.get(m);else{var W=l&&l.box3||new u.Box3;if(!l||!l.box3){var S=m.parameters.shapes.getPoints();W.setFromArray(S.map(function(y){return[y.x,y.y,0]}).flat())}var k=W.getSize(new u.Vector3);C={box:W,size:k},e.set(m,C)}var d=C.box,_=C.size;return[new u.Vector2((j-d.min.x)/_.x,(B-d.min.y)/_.y),new u.Vector2((Z-d.min.x)/_.x,(T-d.min.y)/_.y),new u.Vector2((V-d.min.x)/_.x,(z-d.min.y)/_.y)]},generateSideWallUV:function(m,f,g,E,P,j){var B=f[g*3],Z=f[g*3+1],T=f[g*3+2],V=f[E*3],z=f[E*3+1],C=f[E*3+2],W=f[P*3],S=f[P*3+1],k=f[P*3+2],d=f[j*3],_=f[j*3+1],y=f[j*3+2],O;if(e.has(f))O=e.get(f);else{var D=new u.Box3;D.setFromArray(f);var L=D.getSize(new u.Vector3);O={box:D,size:L},e.set(f,O)}var w=O.box,M=O.size;return Math.abs(Z-z)<.01?[new u.Vector2((B-w.min.x)/M.x,(T-w.min.z)/M.z),new u.Vector2((V-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((z-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((_-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,s,i){"use strict";i.d(s,{Z:function(){return u}});function u(c,e){(e==null||e>c.length)&&(e=c.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=c[n];return o}},982:function(v,s,i){"use strict";i.d(s,{Z:function(){return c}});var u=i(943);function c(e){if(Array.isArray(e))return(0,u.Z)(e)}},568:function(v,s,i){"use strict";i.d(s,{Z:function(){return c}});function u(e,n,o,l,m,f,g){try{var E=e[f](g),P=E.value}catch(j){o(j);return}E.done?n(P):Promise.resolve(P).then(l,m)}function c(e){return function(){var n=this,o=arguments;return new Promise(function(l,m){var f=e.apply(n,o);function g(P){u(f,l,m,g,E,"next",P)}function E(P){u(f,l,m,g,E,"throw",P)}g(void 0)})}}},438:function(v,s,i){"use strict";i.d(s,{Z:function(){return u}});function u(c,e){if(!(c instanceof e))throw new TypeError("Cannot call a class as a function")}},924:function(v,s,i){"use strict";i.d(s,{Z:function(){return u}});function u(c,e,n){return e in c?Object.defineProperty(c,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):c[e]=n,c}},375:function(v,s,i){"use strict";i.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(v,s,i){"use strict";i.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(v,s,i){"use strict";i.d(s,{Z:function(){return c}});var u=i(924);function c(e){for(var n=1;n<arguments.length;n++){var o=arguments[n]!=null?arguments[n]:{},l=Object.keys(o);typeof Object.getOwnPropertySymbols=="function"&&(l=l.concat(Object.getOwnPropertySymbols(o).filter(function(m){return Object.getOwnPropertyDescriptor(o,m).enumerable}))),l.forEach(function(m){(0,u.Z)(e,m,o[m])})}return e}},342:function(v,s,i){"use strict";i.d(s,{Z:function(){return o}});var u=i(982),c=i(375),e=i(270),n=i(566);function o(l){return(0,u.Z)(l)||(0,c.Z)(l)||(0,n.Z)(l)||(0,e.Z)()}},566:function(v,s,i){"use strict";i.d(s,{Z:function(){return c}});var u=i(943);function c(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 s=X[v];if(s!==void 0)return s.exports;var i=X[v]={exports:{}};return H[v](i,i.exports,b),i.exports}(function(){b.n=function(v){var s=v&&v.__esModule?function(){return v.default}:function(){return v};return b.d(s,{a:s}),s}})(),function(){b.d=function(v,s){for(var i in s)b.o(s,i)&&!b.o(v,i)&&Object.defineProperty(v,i,{enumerable:!0,get:s[i]})}}(),function(){b.o=function(v,s){return Object.prototype.hasOwnProperty.call(v,s)}}(),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 V},clearCache:function(){return T},colorCorrection:function(){return P},disposeMesh:function(){return g.Z},getCache:function(){return z},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 f.Z},to:function(){return s.Z}});var v=b(653),s=b(620),i=b(688),u=b(568),c=b(438),e=b(42),n=b(342),o=b(666),l=b.n(o),m=function(){"use strict";function S(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(0,c.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(_){return _.stop1()}),this},k.dispose=function(){return this.stop(),this.chainedList=[],this.children=[],this},k.play=function(){var _=this;return(0,u.Z)(l().mark(function y(){var O;return l().wrap(function(L){for(;;)switch(L.prev=L.next){case 0:if(O=_.chainedList[_.index],!(O&&_.isPlaying)){L.next=9;break}return L.next=4,Promise.all(O.map(function(w){return typeof w=="function"?w(_.repeatCount):w.start()}));case 4:return _.index+=1,L.next=7,_.play();case 7:L.next=17;break;case 9:if(!(!O&&_.isPlaying&&_.repeatCount<_.repeatNum)){L.next=16;break}return _.repeatCount+=1,_.index=0,L.next=14,_.play();case 14:L.next=17;break;case 16:!O&&_.isPlaying&&_.repeatCount===_.repeatNum&&_.stop();case 17:case"end":return L.stop()}},y)}))()},k.chain=function(){for(var _=arguments.length,y=new Array(_),O=0;O<_;O++)y[O]=arguments[O];var D=this;return(0,n.Z)(y).forEach(function(L){L instanceof S&&D.children.push(L)}),this.chainedList.push((0,n.Z)(y)),this},k.repeat=function(_){return this.repeatNum=_,this},k.timeout=function(_){return this.chain(function(){return new Promise(function(y){return setTimeout(y,_)})}),this},k.traverse=function(_){_(this),this.children.forEach(function(y){y.traverse(_)})},S}(),f=b(226),g=b(182),E=b(644);function P(S){if(S.material){var k=Array.isArray(S.material)?S.material:[S.material];k.forEach(function(d){var _,y;(_=d.color)===null||_===void 0||_.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(975),B=b(924),Z=require("idb-keyval"),T=Z.del,V=Z.clear,z=function(){var S=(0,u.Z)(l().mark(function k(d,_){var y,O,D,L,w,M;return l().wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return y=_.version,R.next=4,(0,Z.get)(d);case 4:if(D=R.sent,!(D&&D[y])){R.next=9;break}O=D[y],R.next=15;break;case 9:return R.next=11,(0,s.Z)(fetch(d).then(function(r){if(r.ok)return r.blob();throw new Error}));case 11:L=R.sent,w=L.res,M=L.err,M||(O=w,(0,Z.set)(d,(0,B.Z)({},y,w)));case 15:return R.abrupt("return",O?{url:URL.createObjectURL(O)}:{url:d});case 16:case"end":return R.stop()}},k)}));return function(d,_){return S.apply(this,arguments)}}(),C=b(794),W=b(977)})(),module.exports=F})();
@@ -1 +1 @@
1
- import*as F from"three";import*as Y from"idb-keyval";var Q={666:function(v){var c=function(o){"use strict";var s=Object.prototype,u=s.hasOwnProperty,a,r=typeof Symbol=="function"?Symbol:{},n=r.iterator||"@@iterator",f=r.asyncIterator||"@@asyncIterator",_=r.toStringTag||"@@toStringTag";function d(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(t,i,p){return t[i]=p}}function g(e,t,i,p){var l=t&&t.prototype instanceof Z?t:Z,C=Object.create(l.prototype),V=new M(p||[]);return C._invoke=h(e,i,V),C}o.wrap=g;function k(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(p){return{type:"throw",arg:p}}}var L="suspendedStart",B="suspendedYield",D="executing",S="completed",T={};function Z(){}function A(){}function G(){}var K={};d(K,n,function(){return this});var I=Object.getPrototypeOf,j=I&&I(I(W([])));j&&j!==s&&u.call(j,n)&&(K=j);var w=G.prototype=Z.prototype=Object.create(K);A.prototype=G,d(w,"constructor",G),d(G,"constructor",A),A.displayName=d(G,_,"GeneratorFunction");function E(e){["next","throw","return"].forEach(function(t){d(e,t,function(i){return this._invoke(t,i)})})}o.isGeneratorFunction=function(e){var t=typeof e=="function"&&e.constructor;return t?t===A||(t.displayName||t.name)==="GeneratorFunction":!1},o.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,G):(e.__proto__=G,d(e,_,"GeneratorFunction")),e.prototype=Object.create(w),e},o.awrap=function(e){return{__await:e}};function m(e,t){function i(C,V,U,R){var z=k(e[C],e,V);if(z.type==="throw")R(z.arg);else{var J=z.arg,$=J.value;return $&&typeof $=="object"&&u.call($,"__await")?t.resolve($.__await).then(function(N){i("next",N,U,R)},function(N){i("throw",N,U,R)}):t.resolve($).then(function(N){J.value=N,U(J)},function(N){return i("throw",N,U,R)})}}var p;function l(C,V){function U(){return new t(function(R,z){i(C,V,R,z)})}return p=p?p.then(U,U):U()}this._invoke=l}E(m.prototype),d(m.prototype,f,function(){return this}),o.AsyncIterator=m,o.async=function(e,t,i,p,l){l===void 0&&(l=Promise);var C=new m(g(e,t,i,p),l);return o.isGeneratorFunction(t)?C:C.next().then(function(V){return V.done?V.value:C.next()})};function h(e,t,i){var p=L;return function(C,V){if(p===D)throw new Error("Generator is already running");if(p===S){if(C==="throw")throw V;return X()}for(i.method=C,i.arg=V;;){var U=i.delegate;if(U){var R=O(U,i);if(R){if(R===T)continue;return R}}if(i.method==="next")i.sent=i._sent=i.arg;else if(i.method==="throw"){if(p===L)throw p=S,i.arg;i.dispatchException(i.arg)}else i.method==="return"&&i.abrupt("return",i.arg);p=D;var z=k(e,t,i);if(z.type==="normal"){if(p=i.done?S:B,z.arg===T)continue;return{value:z.arg,done:i.done}}else z.type==="throw"&&(p=S,i.method="throw",i.arg=z.arg)}}}function O(e,t){var i=e.iterator[t.method];if(i===a){if(t.delegate=null,t.method==="throw"){if(e.iterator.return&&(t.method="return",t.arg=a,O(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 p=k(i,e.iterator,t.arg);if(p.type==="throw")return t.method="throw",t.arg=p.arg,t.delegate=null,T;var l=p.arg;if(!l)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,T;if(l.done)t[e.resultName]=l.value,t.next=e.nextLoc,t.method!=="return"&&(t.method="next",t.arg=a);else return l;return t.delegate=null,T}E(w),d(w,_,"Generator"),d(w,n,function(){return this}),d(w,"toString",function(){return"[object Generator]"});function y(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 b(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(y,this),this.reset(!0)}o.keys=function(e){var t=[];for(var i in e)t.push(i);return t.reverse(),function p(){for(;t.length;){var l=t.pop();if(l in e)return p.value=l,p.done=!1,p}return p.done=!0,p}};function W(e){if(e){var t=e[n];if(t)return t.call(e);if(typeof e.next=="function")return e;if(!isNaN(e.length)){var i=-1,p=function l(){for(;++i<e.length;)if(u.call(e,i))return l.value=e[i],l.done=!1,l;return l.value=a,l.done=!0,l};return p.next=p}}return{next:X}}o.values=W;function X(){return{value:a,done:!0}}return M.prototype={constructor:M,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=a,this.done=!1,this.delegate=null,this.method="next",this.arg=a,this.tryEntries.forEach(b),!e)for(var t in this)t.charAt(0)==="t"&&u.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=a)},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 i(R,z){return C.type="throw",C.arg=e,t.next=R,z&&(t.method="next",t.arg=a),!!z}for(var p=this.tryEntries.length-1;p>=0;--p){var l=this.tryEntries[p],C=l.completion;if(l.tryLoc==="root")return i("end");if(l.tryLoc<=this.prev){var V=u.call(l,"catchLoc"),U=u.call(l,"finallyLoc");if(V&&U){if(this.prev<l.catchLoc)return i(l.catchLoc,!0);if(this.prev<l.finallyLoc)return i(l.finallyLoc)}else if(V){if(this.prev<l.catchLoc)return i(l.catchLoc,!0)}else if(U){if(this.prev<l.finallyLoc)return i(l.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var p=this.tryEntries[i];if(p.tryLoc<=this.prev&&u.call(p,"finallyLoc")&&this.prev<p.finallyLoc){var l=p;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,T):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),T},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),b(i),T}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var p=i.completion;if(p.type==="throw"){var l=p.arg;b(i)}return l}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:W(e),resultName:t,nextLoc:i},this.method==="next"&&(this.arg=a),T}},o}(v.exports);try{regeneratorRuntime=c}catch(o){typeof globalThis=="object"?globalThis.regeneratorRuntime=c:Function("r","regeneratorRuntime = r")(c)}},182:function(v,c,o){o.d(c,{Z:function(){return s}});function s(u){if(u.geometry&&u.geometry.dispose(),u.material){var a=Array.isArray(u.material)?u.material:[u.material];a.forEach(function(r){var n,f,_,d,g,k,L,B,D,S,T,Z,A;(n=r.map)===null||n===void 0||n.dispose(),(f=r.lightMap)===null||f===void 0||f.dispose(),(_=r.bumpMap)===null||_===void 0||_.dispose(),(d=r.normalMap)===null||d===void 0||d.dispose(),(g=r.specularMap)===null||g===void 0||g.dispose(),(k=r.envMap)===null||k===void 0||k.dispose(),(L=r.alphaMap)===null||L===void 0||L.dispose(),(B=r.aoMap)===null||B===void 0||B.dispose(),(D=r.displacementMap)===null||D===void 0||D.dispose(),(S=r.emissiveMap)===null||S===void 0||S.dispose(),(T=r.gradientMap)===null||T===void 0||T.dispose(),(Z=r.metalnessMap)===null||Z===void 0||Z.dispose(),(A=r.roughnessMap)===null||A===void 0||A.dispose(),r.dispose()})}}},794:function(v,c,o){o.d(c,{U:function(){return u},v:function(){return s}});var s=function(a){for(var r=a.offsetLeft,n=a.offsetParent;n!==null;)r+=n.offsetLeft,n=n.offsetParent;var f;return document.compatMode==="BackCompat"||document.documentElement.scrollTop===0?f=document.body.scrollLeft:f=document.documentElement.scrollLeft,r-f},u=function(a){for(var r=a.offsetTop,n=a.offsetParent;n!==null;)r+=n.offsetTop,n=n.offsetParent;var f;return document.compatMode==="BackCompat"||document.documentElement.scrollTop===0?f=document.body.scrollTop:f=document.documentElement.scrollTop,r-f}},975:function(v,c,o){o.d(c,{Z:function(){return u}});function s(a){return Object.prototype.toString.call(a)==="[object Object]"}function u(a){if(s(a)===!1)return!1;var r=a.constructor;if(r===void 0)return!0;var n=r.prototype;return!(s(n)===!1||n.hasOwnProperty("isPrototypeOf")===!1)}},653:function(v,c,o){o.d(c,{Z:function(){return u}});var s=o(620);function u(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n={};return n.promise=new Promise(function(f,_){n.resolve=f,n.reject=_}),a&&(n.promise=(0,s.Z)(n.promise,r)),n}},226:function(v,c,o){o.d(c,{Z:function(){return s}});function s(u,a){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=(90-a)*Math.PI/180,f=(90-u)*Math.PI/180;return[r*Math.sin(n)*Math.cos(f),r*Math.cos(n),r*Math.sin(n)*Math.sin(f)]}},688:function(v,c,o){o.d(c,{Z:function(){return a}});var s=o(438),u=function(){"use strict";function r(f){(0,s.Z)(this,r),this.onTick_=f,this.cancelPending_=null}var n=r.prototype;return n.tickAfter=function(_){var d=this;this.stop();var g=!0,k;this.cancelPending_=function(){clearTimeout(k),g=!1};var L=function(){g&&d.onTick_()};return k=window.setTimeout(L,_),this},n.stop=function(){this.cancelPending_&&(this.cancelPending_(),this.cancelPending_=null)},r}(),a=function(){"use strict";function r(f){(0,s.Z)(this,r),this.onTick_=f,this.ticker_=null}var n=r.prototype;return n.tickNow=function(){return this.stop(),this.onTick_(),this},n.tickAfter=function(_){var d=this;return this.stop(),this.ticker_=new u(function(){d.onTick_()}).tickAfter(_),this},n.tickEvery=function(_){var d=this;return this.stop(),this.ticker_=new u(function(){var g;(g=d.ticker_)===null||g===void 0||g.tickAfter(_),d.onTick_()}).tickAfter(_),this},n.stop=function(){this.ticker_&&(this.ticker_.stop(),this.ticker_=null)},r}()},620:function(v,c,o){o.d(c,{Z:function(){return u}});var s=o(42);function u(a){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return a.then(function(n){return(0,s.Z)({err:null,res:n},r)}).catch(function(n){return(0,s.Z)({err:n,res:void 0},r)})}},977:function(v,c,o){o.d(c,{C:function(){return r},y:function(){return a}});var s=o(949),u=new Map,a=function(n){return{generateTopUV:function(f,_,d,g,k){var L=_[d*3],B=_[d*3+1],D=_[g*3],S=_[g*3+1],T=_[k*3],Z=_[k*3+1],A;if(u.has(f))A=u.get(f);else{var G=n&&n.Box3||new s.Box3;if(!n||!n.Box3){var K=f.parameters.shapes.getPoints();G.setFromArray(K.map(function(E){return[E.x,E.y,0]}).flat())}var I=G.getSize(new s.Vector3);A={box:G,size:I},u.set(f,A)}var j=A.box,w=A.size;return[new s.Vector2((L-j.min.x)/w.x,(B-j.min.y)/w.y),new s.Vector2((D-j.min.x)/w.x,(S-j.min.y)/w.y),new s.Vector2((T-j.min.x)/w.x,(Z-j.min.y)/w.y)]},generateSideWallUV:function(f,_,d,g,k,L){var B=_[d*3],D=_[d*3+1],S=_[d*3+2],T=_[g*3],Z=_[g*3+1],A=_[g*3+2],G=_[k*3],K=_[k*3+1],I=_[k*3+2],j=_[L*3],w=_[L*3+1],E=_[L*3+2],m;if(u.has(_))m=u.get(_);else{var h=new s.Box3;h.setFromArray(_);var O=h.getSize(new s.Vector3);m={box:h,size:O},u.set(_,m)}var y=m.box,b=m.size;return Math.abs(D-Z)<.01?[new s.Vector2((B-y.min.x)/b.x,(S-y.min.z)/b.z),new s.Vector2((T-y.min.x)/b.x,(A-y.min.z)/b.z),new s.Vector2((G-y.min.x)/b.x,(I-y.min.z)/b.z),new s.Vector2((j-y.min.x)/b.x,(E-y.min.z)/b.z)]:[new s.Vector2((D-y.min.y)/b.x,(S-y.min.z)/b.z),new s.Vector2((Z-y.min.y)/b.x,(A-y.min.z)/b.z),new s.Vector2((K-y.min.y)/b.x,(I-y.min.z)/b.z),new s.Vector2((w-y.min.y)/b.x,(E-y.min.z)/b.z)]}}},r=function(){u.clear()}},949:function(v,c,o){var s=a=>{var r={};return o.d(r,a),r},u=a=>()=>a;v.exports=s({Box3:()=>F.Box3,Vector2:()=>F.Vector2,Vector3:()=>F.Vector3,sRGBEncoding:()=>F.sRGBEncoding})},943:function(v,c,o){o.d(c,{Z:function(){return s}});function s(u,a){(a==null||a>u.length)&&(a=u.length);for(var r=0,n=new Array(a);r<a;r++)n[r]=u[r];return n}},982:function(v,c,o){o.d(c,{Z:function(){return u}});var s=o(943);function u(a){if(Array.isArray(a))return(0,s.Z)(a)}},568:function(v,c,o){o.d(c,{Z:function(){return u}});function s(a,r,n,f,_,d,g){try{var k=a[d](g),L=k.value}catch(B){n(B);return}k.done?r(L):Promise.resolve(L).then(f,_)}function u(a){return function(){var r=this,n=arguments;return new Promise(function(f,_){var d=a.apply(r,n);function g(L){s(d,f,_,g,k,"next",L)}function k(L){s(d,f,_,g,k,"throw",L)}g(void 0)})}}},438:function(v,c,o){o.d(c,{Z:function(){return s}});function s(u,a){if(!(u instanceof a))throw new TypeError("Cannot call a class as a function")}},924:function(v,c,o){o.d(c,{Z:function(){return s}});function s(u,a,r){return a in u?Object.defineProperty(u,a,{value:r,enumerable:!0,configurable:!0,writable:!0}):u[a]=r,u}},375:function(v,c,o){o.d(c,{Z:function(){return s}});function s(u){if(typeof Symbol!="undefined"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)}},270:function(v,c,o){o.d(c,{Z:function(){return s}});function s(){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,o){o.d(c,{Z:function(){return u}});var s=o(924);function u(a){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{},f=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(f=f.concat(Object.getOwnPropertySymbols(n).filter(function(_){return Object.getOwnPropertyDescriptor(n,_).enumerable}))),f.forEach(function(_){(0,s.Z)(a,_,n[_])})}return a}},342:function(v,c,o){o.d(c,{Z:function(){return n}});var s=o(982),u=o(375),a=o(270),r=o(566);function n(f){return(0,s.Z)(f)||(0,u.Z)(f)||(0,r.Z)(f)||(0,a.Z)()}},566:function(v,c,o){o.d(c,{Z:function(){return u}});var s=o(943);function u(a,r){if(!!a){if(typeof a=="string")return(0,s.Z)(a,r);var n=Object.prototype.toString.call(a).slice(8,-1);if(n==="Object"&&a.constructor&&(n=a.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return(0,s.Z)(a,r)}}}},H={};function P(v){var c=H[v];if(c!==void 0)return c.exports;var o=H[v]={exports:{}};return Q[v](o,o.exports,P),o.exports}(function(){P.n=function(v){var c=v&&v.__esModule?function(){return v.default}:function(){return v};return P.d(c,{a:c}),c}})(),function(){P.d=function(v,c){for(var o in c)P.o(c,o)&&!P.o(v,o)&&Object.defineProperty(v,o,{enumerable:!0,get:c[o]})}}(),function(){P.o=function(v,c){return Object.prototype.hasOwnProperty.call(v,c)}}();var x={};(function(){P.d(x,{qo:function(){return _},B7:function(){return o.Z},CL:function(){return j.C},eK:function(){return G},LK:function(){return A},ZL:function(){return L},wf:function(){return g.Z},lJ:function(){return K},vP:function(){return I.v},Up:function(){return I.U},y_:function(){return j.y},PO:function(){return B.Z},Mf:function(){return v.Z},Rl:function(){return d.Z},to:function(){return c.Z}});var v=P(653),c=P(620),o=P(688),s=P(568),u=P(438),a=P(42),r=P(342),n=P(666),f=P.n(n),_=function(){"use strict";function w(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(0,u.Z)(this,w),this.index=0,this.repeatCount=0,this.repeatNum=0,this.isPlaying=!1,this.chainedList=[],this.children=[],this.options=(0,a.Z)({},{isdev:!1},m)}var E=w.prototype;return E.start=function(){return this.isPlaying?this:(this.index=0,this.isPlaying=!0,this.play())},E.stop1=function(){return this.isPlaying?(this.isPlaying=!1,this.repeatCount=0,this):this},E.stop=function(){return this.traverse(function(h){return h.stop1()}),this},E.dispose=function(){return this.stop(),this.chainedList=[],this.children=[],this},E.play=function(){var h=this;return(0,s.Z)(f().mark(function O(){var y;return f().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:if(y=h.chainedList[h.index],!(y&&h.isPlaying)){M.next=9;break}return M.next=4,Promise.all(y.map(function(W){return typeof W=="function"?W(h.repeatCount):W.start()}));case 4:return h.index+=1,M.next=7,h.play();case 7:M.next=17;break;case 9:if(!(!y&&h.isPlaying&&h.repeatCount<h.repeatNum)){M.next=16;break}return h.repeatCount+=1,h.index=0,M.next=14,h.play();case 14:M.next=17;break;case 16:!y&&h.isPlaying&&h.repeatCount===h.repeatNum&&h.stop();case 17:case"end":return M.stop()}},O)}))()},E.chain=function(){for(var h=arguments.length,O=new Array(h),y=0;y<h;y++)O[y]=arguments[y];var b=this;return(0,r.Z)(O).forEach(function(M){M instanceof w&&b.children.push(M)}),this.chainedList.push((0,r.Z)(O)),this},E.repeat=function(h){return this.repeatNum=h,this},E.timeout=function(h){return this.chain(function(){return new Promise(function(O){return setTimeout(O,h)})}),this},E.traverse=function(h){h(this),this.children.forEach(function(O){O.traverse(h)})},w}(),d=P(226),g=P(182),k=P(949);function L(w){if(w.material){var E=Array.isArray(w.material)?w.material:[w.material];E.forEach(function(m){var h,O;(h=m.color)===null||h===void 0||h.convertSRGBToLinear(),(O=m.emissive)===null||O===void 0||O.convertSRGBToLinear(),m.map&&(m.map.encoding=k.sRGBEncoding),m.emissiveMap&&(m.emissiveMap.encoding=k.sRGBEncoding)})}}var B=P(975),D=P(924),S=w=>{var E={};return P.d(E,w),E},T=w=>()=>w,Z=S({clear:()=>Y.clear,del:()=>Y.del,get:()=>Y.get,set:()=>Y.set}),A=Z.del,G=Z.clear,K=function(){var w=(0,s.Z)(f().mark(function E(m,h){var O,y,b,M,W,X;return f().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return O=h.version,t.next=4,(0,Z.get)(m);case 4:if(b=t.sent,!(b&&b[O])){t.next=9;break}y=b[O],t.next=15;break;case 9:return t.next=11,(0,c.Z)(fetch(m).then(function(i){if(i.ok)return i.blob();throw new Error}));case 11:M=t.sent,W=M.res,X=M.err,X||(y=W,(0,Z.set)(m,(0,D.Z)({},O,W)));case 15:return t.abrupt("return",y?{url:URL.createObjectURL(y)}:{url:m});case 16:case"end":return t.stop()}},E)}));return function(m,h){return w.apply(this,arguments)}}(),I=P(794),j=P(977)})();var q=x.qo,tt=x.B7,et=x.CL,rt=x.eK,nt=x.LK,ot=x.ZL,at=x.wf,it=x.lJ,ut=x.vP,st=x.Up,ct=x.y_,ft=x.PO,_t=x.Mf,lt=x.Rl,pt=x.to;export{q as Chain,tt as Timer,et as claerUVGenerator,rt as clearAllCache,nt as clearCache,ot as colorCorrection,at as disposeMesh,it as getCache,ut as getElementViewLeft,st as getElementViewTop,ct as getUVGenerator,ft as isPlainObject,_t as makePromiseCreator,lt as polar2Cartesian,pt as to};
1
+ import*as F from"three";import*as Y from"idb-keyval";var Q={666:function(v){var c=function(o){"use strict";var s=Object.prototype,u=s.hasOwnProperty,a,r=typeof Symbol=="function"?Symbol:{},n=r.iterator||"@@iterator",f=r.asyncIterator||"@@asyncIterator",_=r.toStringTag||"@@toStringTag";function d(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(t,i,p){return t[i]=p}}function g(e,t,i,p){var l=t&&t.prototype instanceof Z?t:Z,C=Object.create(l.prototype),V=new M(p||[]);return C._invoke=h(e,i,V),C}o.wrap=g;function k(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(p){return{type:"throw",arg:p}}}var L="suspendedStart",D="suspendedYield",R="executing",S="completed",T={};function Z(){}function A(){}function G(){}var K={};d(K,n,function(){return this});var I=Object.getPrototypeOf,j=I&&I(I(W([])));j&&j!==s&&u.call(j,n)&&(K=j);var w=G.prototype=Z.prototype=Object.create(K);A.prototype=G,d(w,"constructor",G),d(G,"constructor",A),A.displayName=d(G,_,"GeneratorFunction");function E(e){["next","throw","return"].forEach(function(t){d(e,t,function(i){return this._invoke(t,i)})})}o.isGeneratorFunction=function(e){var t=typeof e=="function"&&e.constructor;return t?t===A||(t.displayName||t.name)==="GeneratorFunction":!1},o.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,G):(e.__proto__=G,d(e,_,"GeneratorFunction")),e.prototype=Object.create(w),e},o.awrap=function(e){return{__await:e}};function m(e,t){function i(C,V,U,B){var z=k(e[C],e,V);if(z.type==="throw")B(z.arg);else{var J=z.arg,$=J.value;return $&&typeof $=="object"&&u.call($,"__await")?t.resolve($.__await).then(function(N){i("next",N,U,B)},function(N){i("throw",N,U,B)}):t.resolve($).then(function(N){J.value=N,U(J)},function(N){return i("throw",N,U,B)})}}var p;function l(C,V){function U(){return new t(function(B,z){i(C,V,B,z)})}return p=p?p.then(U,U):U()}this._invoke=l}E(m.prototype),d(m.prototype,f,function(){return this}),o.AsyncIterator=m,o.async=function(e,t,i,p,l){l===void 0&&(l=Promise);var C=new m(g(e,t,i,p),l);return o.isGeneratorFunction(t)?C:C.next().then(function(V){return V.done?V.value:C.next()})};function h(e,t,i){var p=L;return function(C,V){if(p===R)throw new Error("Generator is already running");if(p===S){if(C==="throw")throw V;return X()}for(i.method=C,i.arg=V;;){var U=i.delegate;if(U){var B=O(U,i);if(B){if(B===T)continue;return B}}if(i.method==="next")i.sent=i._sent=i.arg;else if(i.method==="throw"){if(p===L)throw p=S,i.arg;i.dispatchException(i.arg)}else i.method==="return"&&i.abrupt("return",i.arg);p=R;var z=k(e,t,i);if(z.type==="normal"){if(p=i.done?S:D,z.arg===T)continue;return{value:z.arg,done:i.done}}else z.type==="throw"&&(p=S,i.method="throw",i.arg=z.arg)}}}function O(e,t){var i=e.iterator[t.method];if(i===a){if(t.delegate=null,t.method==="throw"){if(e.iterator.return&&(t.method="return",t.arg=a,O(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 p=k(i,e.iterator,t.arg);if(p.type==="throw")return t.method="throw",t.arg=p.arg,t.delegate=null,T;var l=p.arg;if(!l)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,T;if(l.done)t[e.resultName]=l.value,t.next=e.nextLoc,t.method!=="return"&&(t.method="next",t.arg=a);else return l;return t.delegate=null,T}E(w),d(w,_,"Generator"),d(w,n,function(){return this}),d(w,"toString",function(){return"[object Generator]"});function y(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 b(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(y,this),this.reset(!0)}o.keys=function(e){var t=[];for(var i in e)t.push(i);return t.reverse(),function p(){for(;t.length;){var l=t.pop();if(l in e)return p.value=l,p.done=!1,p}return p.done=!0,p}};function W(e){if(e){var t=e[n];if(t)return t.call(e);if(typeof e.next=="function")return e;if(!isNaN(e.length)){var i=-1,p=function l(){for(;++i<e.length;)if(u.call(e,i))return l.value=e[i],l.done=!1,l;return l.value=a,l.done=!0,l};return p.next=p}}return{next:X}}o.values=W;function X(){return{value:a,done:!0}}return M.prototype={constructor:M,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=a,this.done=!1,this.delegate=null,this.method="next",this.arg=a,this.tryEntries.forEach(b),!e)for(var t in this)t.charAt(0)==="t"&&u.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=a)},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 i(B,z){return C.type="throw",C.arg=e,t.next=B,z&&(t.method="next",t.arg=a),!!z}for(var p=this.tryEntries.length-1;p>=0;--p){var l=this.tryEntries[p],C=l.completion;if(l.tryLoc==="root")return i("end");if(l.tryLoc<=this.prev){var V=u.call(l,"catchLoc"),U=u.call(l,"finallyLoc");if(V&&U){if(this.prev<l.catchLoc)return i(l.catchLoc,!0);if(this.prev<l.finallyLoc)return i(l.finallyLoc)}else if(V){if(this.prev<l.catchLoc)return i(l.catchLoc,!0)}else if(U){if(this.prev<l.finallyLoc)return i(l.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var p=this.tryEntries[i];if(p.tryLoc<=this.prev&&u.call(p,"finallyLoc")&&this.prev<p.finallyLoc){var l=p;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,T):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),T},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),b(i),T}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var p=i.completion;if(p.type==="throw"){var l=p.arg;b(i)}return l}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:W(e),resultName:t,nextLoc:i},this.method==="next"&&(this.arg=a),T}},o}(v.exports);try{regeneratorRuntime=c}catch(o){typeof globalThis=="object"?globalThis.regeneratorRuntime=c:Function("r","regeneratorRuntime = r")(c)}},182:function(v,c,o){o.d(c,{Z:function(){return s}});function s(u){if(u.geometry&&u.geometry.dispose(),u.material){var a=Array.isArray(u.material)?u.material:[u.material];a.forEach(function(r){var n,f,_,d,g,k,L,D,R,S,T,Z,A;(n=r.map)===null||n===void 0||n.dispose(),(f=r.lightMap)===null||f===void 0||f.dispose(),(_=r.bumpMap)===null||_===void 0||_.dispose(),(d=r.normalMap)===null||d===void 0||d.dispose(),(g=r.specularMap)===null||g===void 0||g.dispose(),(k=r.envMap)===null||k===void 0||k.dispose(),(L=r.alphaMap)===null||L===void 0||L.dispose(),(D=r.aoMap)===null||D===void 0||D.dispose(),(R=r.displacementMap)===null||R===void 0||R.dispose(),(S=r.emissiveMap)===null||S===void 0||S.dispose(),(T=r.gradientMap)===null||T===void 0||T.dispose(),(Z=r.metalnessMap)===null||Z===void 0||Z.dispose(),(A=r.roughnessMap)===null||A===void 0||A.dispose(),r.dispose()})}}},794:function(v,c,o){o.d(c,{U:function(){return u},v:function(){return s}});var s=function(a){for(var r=a.offsetLeft,n=a.offsetParent;n!==null;)r+=n.offsetLeft,n=n.offsetParent;var f;return document.compatMode==="BackCompat"||document.documentElement.scrollTop===0?f=document.body.scrollLeft:f=document.documentElement.scrollLeft,r-f},u=function(a){for(var r=a.offsetTop,n=a.offsetParent;n!==null;)r+=n.offsetTop,n=n.offsetParent;var f;return document.compatMode==="BackCompat"||document.documentElement.scrollTop===0?f=document.body.scrollTop:f=document.documentElement.scrollTop,r-f}},975:function(v,c,o){o.d(c,{Z:function(){return u}});function s(a){return Object.prototype.toString.call(a)==="[object Object]"}function u(a){if(s(a)===!1)return!1;var r=a.constructor;if(r===void 0)return!0;var n=r.prototype;return!(s(n)===!1||n.hasOwnProperty("isPrototypeOf")===!1)}},653:function(v,c,o){o.d(c,{Z:function(){return u}});var s=o(620);function u(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n={};return n.promise=new Promise(function(f,_){n.resolve=f,n.reject=_}),a&&(n.promise=(0,s.Z)(n.promise,r)),n}},226:function(v,c,o){o.d(c,{Z:function(){return s}});function s(u,a){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=(90-a)*Math.PI/180,f=(90-u)*Math.PI/180;return[r*Math.sin(n)*Math.cos(f),r*Math.cos(n),r*Math.sin(n)*Math.sin(f)]}},688:function(v,c,o){o.d(c,{Z:function(){return a}});var s=o(438),u=function(){"use strict";function r(f){(0,s.Z)(this,r),this.onTick_=f,this.cancelPending_=null}var n=r.prototype;return n.tickAfter=function(_){var d=this;this.stop();var g=!0,k;this.cancelPending_=function(){clearTimeout(k),g=!1};var L=function(){g&&d.onTick_()};return k=window.setTimeout(L,_),this},n.stop=function(){this.cancelPending_&&(this.cancelPending_(),this.cancelPending_=null)},r}(),a=function(){"use strict";function r(f){(0,s.Z)(this,r),this.onTick_=f,this.ticker_=null}var n=r.prototype;return n.tickNow=function(){return this.stop(),this.onTick_(),this},n.tickAfter=function(_){var d=this;return this.stop(),this.ticker_=new u(function(){d.onTick_()}).tickAfter(_),this},n.tickEvery=function(_){var d=this;return this.stop(),this.ticker_=new u(function(){var g;(g=d.ticker_)===null||g===void 0||g.tickAfter(_),d.onTick_()}).tickAfter(_),this},n.stop=function(){this.ticker_&&(this.ticker_.stop(),this.ticker_=null)},r}()},620:function(v,c,o){o.d(c,{Z:function(){return u}});var s=o(42);function u(a){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return a.then(function(n){return(0,s.Z)({err:null,res:n},r)}).catch(function(n){return(0,s.Z)({err:n,res:void 0},r)})}},977:function(v,c,o){o.d(c,{C:function(){return r},y:function(){return a}});var s=o(949),u=new Map,a=function(n){return{generateTopUV:function(f,_,d,g,k){var L=_[d*3],D=_[d*3+1],R=_[g*3],S=_[g*3+1],T=_[k*3],Z=_[k*3+1],A;if(u.has(f))A=u.get(f);else{var G=n&&n.box3||new s.Box3;if(!n||!n.box3){var K=f.parameters.shapes.getPoints();G.setFromArray(K.map(function(E){return[E.x,E.y,0]}).flat())}var I=G.getSize(new s.Vector3);A={box:G,size:I},u.set(f,A)}var j=A.box,w=A.size;return[new s.Vector2((L-j.min.x)/w.x,(D-j.min.y)/w.y),new s.Vector2((R-j.min.x)/w.x,(S-j.min.y)/w.y),new s.Vector2((T-j.min.x)/w.x,(Z-j.min.y)/w.y)]},generateSideWallUV:function(f,_,d,g,k,L){var D=_[d*3],R=_[d*3+1],S=_[d*3+2],T=_[g*3],Z=_[g*3+1],A=_[g*3+2],G=_[k*3],K=_[k*3+1],I=_[k*3+2],j=_[L*3],w=_[L*3+1],E=_[L*3+2],m;if(u.has(_))m=u.get(_);else{var h=new s.Box3;h.setFromArray(_);var O=h.getSize(new s.Vector3);m={box:h,size:O},u.set(_,m)}var y=m.box,b=m.size;return Math.abs(R-Z)<.01?[new s.Vector2((D-y.min.x)/b.x,(S-y.min.z)/b.z),new s.Vector2((T-y.min.x)/b.x,(A-y.min.z)/b.z),new s.Vector2((G-y.min.x)/b.x,(I-y.min.z)/b.z),new s.Vector2((j-y.min.x)/b.x,(E-y.min.z)/b.z)]:[new s.Vector2((R-y.min.y)/b.x,(S-y.min.z)/b.z),new s.Vector2((Z-y.min.y)/b.x,(A-y.min.z)/b.z),new s.Vector2((K-y.min.y)/b.x,(I-y.min.z)/b.z),new s.Vector2((w-y.min.y)/b.x,(E-y.min.z)/b.z)]}}},r=function(){u.clear()}},949:function(v,c,o){var s=a=>{var r={};return o.d(r,a),r},u=a=>()=>a;v.exports=s({Box3:()=>F.Box3,Vector2:()=>F.Vector2,Vector3:()=>F.Vector3,sRGBEncoding:()=>F.sRGBEncoding})},943:function(v,c,o){o.d(c,{Z:function(){return s}});function s(u,a){(a==null||a>u.length)&&(a=u.length);for(var r=0,n=new Array(a);r<a;r++)n[r]=u[r];return n}},982:function(v,c,o){o.d(c,{Z:function(){return u}});var s=o(943);function u(a){if(Array.isArray(a))return(0,s.Z)(a)}},568:function(v,c,o){o.d(c,{Z:function(){return u}});function s(a,r,n,f,_,d,g){try{var k=a[d](g),L=k.value}catch(D){n(D);return}k.done?r(L):Promise.resolve(L).then(f,_)}function u(a){return function(){var r=this,n=arguments;return new Promise(function(f,_){var d=a.apply(r,n);function g(L){s(d,f,_,g,k,"next",L)}function k(L){s(d,f,_,g,k,"throw",L)}g(void 0)})}}},438:function(v,c,o){o.d(c,{Z:function(){return s}});function s(u,a){if(!(u instanceof a))throw new TypeError("Cannot call a class as a function")}},924:function(v,c,o){o.d(c,{Z:function(){return s}});function s(u,a,r){return a in u?Object.defineProperty(u,a,{value:r,enumerable:!0,configurable:!0,writable:!0}):u[a]=r,u}},375:function(v,c,o){o.d(c,{Z:function(){return s}});function s(u){if(typeof Symbol!="undefined"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)}},270:function(v,c,o){o.d(c,{Z:function(){return s}});function s(){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,o){o.d(c,{Z:function(){return u}});var s=o(924);function u(a){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{},f=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(f=f.concat(Object.getOwnPropertySymbols(n).filter(function(_){return Object.getOwnPropertyDescriptor(n,_).enumerable}))),f.forEach(function(_){(0,s.Z)(a,_,n[_])})}return a}},342:function(v,c,o){o.d(c,{Z:function(){return n}});var s=o(982),u=o(375),a=o(270),r=o(566);function n(f){return(0,s.Z)(f)||(0,u.Z)(f)||(0,r.Z)(f)||(0,a.Z)()}},566:function(v,c,o){o.d(c,{Z:function(){return u}});var s=o(943);function u(a,r){if(!!a){if(typeof a=="string")return(0,s.Z)(a,r);var n=Object.prototype.toString.call(a).slice(8,-1);if(n==="Object"&&a.constructor&&(n=a.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return(0,s.Z)(a,r)}}}},H={};function P(v){var c=H[v];if(c!==void 0)return c.exports;var o=H[v]={exports:{}};return Q[v](o,o.exports,P),o.exports}(function(){P.n=function(v){var c=v&&v.__esModule?function(){return v.default}:function(){return v};return P.d(c,{a:c}),c}})(),function(){P.d=function(v,c){for(var o in c)P.o(c,o)&&!P.o(v,o)&&Object.defineProperty(v,o,{enumerable:!0,get:c[o]})}}(),function(){P.o=function(v,c){return Object.prototype.hasOwnProperty.call(v,c)}}();var x={};(function(){P.d(x,{qo:function(){return _},B7:function(){return o.Z},CL:function(){return j.C},eK:function(){return G},LK:function(){return A},ZL:function(){return L},wf:function(){return g.Z},lJ:function(){return K},vP:function(){return I.v},Up:function(){return I.U},y_:function(){return j.y},PO:function(){return D.Z},Mf:function(){return v.Z},Rl:function(){return d.Z},to:function(){return c.Z}});var v=P(653),c=P(620),o=P(688),s=P(568),u=P(438),a=P(42),r=P(342),n=P(666),f=P.n(n),_=function(){"use strict";function w(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(0,u.Z)(this,w),this.index=0,this.repeatCount=0,this.repeatNum=0,this.isPlaying=!1,this.chainedList=[],this.children=[],this.options=(0,a.Z)({},{isdev:!1},m)}var E=w.prototype;return E.start=function(){return this.isPlaying?this:(this.index=0,this.isPlaying=!0,this.play())},E.stop1=function(){return this.isPlaying?(this.isPlaying=!1,this.repeatCount=0,this):this},E.stop=function(){return this.traverse(function(h){return h.stop1()}),this},E.dispose=function(){return this.stop(),this.chainedList=[],this.children=[],this},E.play=function(){var h=this;return(0,s.Z)(f().mark(function O(){var y;return f().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:if(y=h.chainedList[h.index],!(y&&h.isPlaying)){M.next=9;break}return M.next=4,Promise.all(y.map(function(W){return typeof W=="function"?W(h.repeatCount):W.start()}));case 4:return h.index+=1,M.next=7,h.play();case 7:M.next=17;break;case 9:if(!(!y&&h.isPlaying&&h.repeatCount<h.repeatNum)){M.next=16;break}return h.repeatCount+=1,h.index=0,M.next=14,h.play();case 14:M.next=17;break;case 16:!y&&h.isPlaying&&h.repeatCount===h.repeatNum&&h.stop();case 17:case"end":return M.stop()}},O)}))()},E.chain=function(){for(var h=arguments.length,O=new Array(h),y=0;y<h;y++)O[y]=arguments[y];var b=this;return(0,r.Z)(O).forEach(function(M){M instanceof w&&b.children.push(M)}),this.chainedList.push((0,r.Z)(O)),this},E.repeat=function(h){return this.repeatNum=h,this},E.timeout=function(h){return this.chain(function(){return new Promise(function(O){return setTimeout(O,h)})}),this},E.traverse=function(h){h(this),this.children.forEach(function(O){O.traverse(h)})},w}(),d=P(226),g=P(182),k=P(949);function L(w){if(w.material){var E=Array.isArray(w.material)?w.material:[w.material];E.forEach(function(m){var h,O;(h=m.color)===null||h===void 0||h.convertSRGBToLinear(),(O=m.emissive)===null||O===void 0||O.convertSRGBToLinear(),m.map&&(m.map.encoding=k.sRGBEncoding),m.emissiveMap&&(m.emissiveMap.encoding=k.sRGBEncoding)})}}var D=P(975),R=P(924),S=w=>{var E={};return P.d(E,w),E},T=w=>()=>w,Z=S({clear:()=>Y.clear,del:()=>Y.del,get:()=>Y.get,set:()=>Y.set}),A=Z.del,G=Z.clear,K=function(){var w=(0,s.Z)(f().mark(function E(m,h){var O,y,b,M,W,X;return f().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return O=h.version,t.next=4,(0,Z.get)(m);case 4:if(b=t.sent,!(b&&b[O])){t.next=9;break}y=b[O],t.next=15;break;case 9:return t.next=11,(0,c.Z)(fetch(m).then(function(i){if(i.ok)return i.blob();throw new Error}));case 11:M=t.sent,W=M.res,X=M.err,X||(y=W,(0,Z.set)(m,(0,R.Z)({},O,W)));case 15:return t.abrupt("return",y?{url:URL.createObjectURL(y)}:{url:m});case 16:case"end":return t.stop()}},E)}));return function(m,h){return w.apply(this,arguments)}}(),I=P(794),j=P(977)})();var q=x.qo,tt=x.B7,et=x.CL,rt=x.eK,nt=x.LK,ot=x.ZL,at=x.wf,it=x.lJ,ut=x.vP,st=x.Up,ct=x.y_,ft=x.PO,_t=x.Mf,lt=x.Rl,pt=x.to;export{q as Chain,tt as Timer,et as claerUVGenerator,rt as clearAllCache,nt as clearCache,ot as colorCorrection,at as disposeMesh,it as getCache,ut as getElementViewLeft,st as getElementViewTop,ct as getUVGenerator,ft as isPlainObject,_t as makePromiseCreator,lt as polar2Cartesian,pt as to};
@@ -1,6 +1,6 @@
1
1
  import * as THREE from 'three';
2
2
  export declare const getUVGenerator: (options?: {
3
- Box3?: THREE.Box3;
3
+ box3?: THREE.Box3;
4
4
  }) => {
5
5
  generateTopUV(geometry: any, vertices: number[], indexA: number, indexB: number, indexC: number): THREE.Vector2[];
6
6
  generateSideWallUV(geometry: any, vertices: number[], indexA: number, indexB: number, indexC: number, indexD: number): THREE.Vector2[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gl-draw",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "author": "gitplus <hstits@gmail.com>",
5
5
  "scripts": {
6
6
  "start": "PORT=3002 bundler-dev",