gl-draw 0.1.7 → 0.1.8

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 z=typeof Reflect=="object"?Reflect:null,S=z&&typeof z.apply=="function"?z.apply:function(c,v,m){return Function.prototype.apply.call(c,v,m)},G;z&&typeof z.ownKeys=="function"?G=z.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 F(f){return f._maxListeners===void 0?g.defaultMaxListeners:f._maxListeners}g.prototype.getMaxListeners=function(){return F(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=F(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 z=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",F=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,F,"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,F,"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,F,"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=z}catch(S){typeof globalThis=="object"?globalThis.regeneratorRuntime=z:Function("r","regeneratorRuntime = r")(z)}},182:function(j,z,S){"use strict";S.d(z,{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,F,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(),(F=g.bumpMap)===null||F===void 0||F.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,z,S){"use strict";S.d(z,{disposeMesh:function(){return g.Z},isPlainObject:function(){return F.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 F=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,z,S){"use strict";S.d(z,{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,z,S){"use strict";S.d(z,{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,z,S){"use strict";var G=S(644),D=S.n(G),E=new Map,g=function(H){return{generateTopUV:function(F,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(F))R=E.get(F);else{var f=H&&H.box3||new THREE.Box3;if(!H||!H.box3){var c=F.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(F,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(F,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,z,S){"use strict";S.d(z,{Z:function(){return D}});function G(E,g,B,H,F,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,F)}function D(E){return function(){var g=this,B=arguments;return new Promise(function(H,F){var x=E.apply(g,B);function k(N){G(x,H,F,k,l,"next",N)}function l(N){G(x,H,F,k,l,"throw",N)}k(void 0)})}}},924:function(j,z,S){"use strict";S.d(z,{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,z,S){"use strict";S.d(z,{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(F){return Object.getOwnPropertyDescriptor(B,F).enumerable}))),H.forEach(function(F){(0,G.Z)(E,F,B[F])})}return E}}},Oe={};function re(j){var z=Oe[j];if(z!==void 0)return z.exports;var S=Oe[j]={exports:{}};return Be[j](S,S.exports,re),S.exports}(function(){re.n=function(j){var z=j&&j.__esModule?function(){return j.default}:function(){return j};return re.d(z,{a:z}),z}})(),function(){re.d=function(j,z){for(var S in z)re.o(z,S)&&!re.o(j,S)&&Object.defineProperty(j,S,{enumerable:!0,get:z[S]})}}(),function(){re.o=function(j,z){return Object.prototype.hasOwnProperty.call(j,z)}}(),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 z(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&&z(s.prototype,i),n&&z(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 F(){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)||F()}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,A=h.paramMap,V=h.items,U=h.value,Z=h.target,le=a.toLowerCase().indexOf("color")>-1,I,ue=typeof U=="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],A)}),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(A){if(!!A)if(_)try{A[o||t].set(r)}catch(V){t!=="color"&&!o&&console.warn("".concat(t," is not a color,set paramMap"))}else A[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,A=r.logarithmicDepthBuffer,V=r.preserveDrawingBuffer,U=new l.WebGLRenderer({context:o,alpha:u,antialias:h,powerPreference:C,logarithmicDepthBuffer:A,preserveDrawingBuffer:V});U.setSize(e,t),U.setPixelRatio(a),U.autoClear=!1,U.toneMapping=f[_],U.toneMappingExposure=y,U.outputEncoding=w,this.renderer=U}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,A=e.minY,V=A===void 0?-1/0:A,U=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=U,U.copy(Z.target),Z.target.clamp(I,ue),U.sub(Z.target),le.position.sub(U)},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(A,V){return b.setFromMatrixPosition(A.matrixWorld),M.setFromMatrixPosition(V.matrixWorld),b.distanceToSquared(M)},e=function(A){var V=[];return A.traverse(function(U){U.isCSS2DObject&&V.push(U)}),V},t=function(A){for(var V=e(A).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}),U=V.length,Z=0,le=V.length;Z<le;Z++){var I=V[Z].userData.zIndexFix||0;V[Z].element.style.zIndex=U-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,A){+l.REVISION<144?(w.autoUpdate===!0&&w.updateMatrixWorld(),A.parent===null&&A.updateMatrixWorld()):(w.matrixWorldAutoUpdate===!0&&w.updateMatrixWorld(),A.parent===null&&A.matrixWorldAutoUpdate===!0&&A.updateMatrixWorld()),p.copy(A.matrixWorldInverse),d.multiplyMatrices(A.projectionMatrix,p),y(w,w,A),t(w)},this.setSize=function(w,A){o=w,u=A,a=o/2,h=u/2,_.style.width="".concat(w,"px"),_.style.height="".concat(A,"px")};function y(w,A,V){if(w.isCSS2DObject){de.setFromMatrixPosition(w.matrixWorld),de.applyMatrix4(d);var U=w.visible===!0&&de.z>=-1&&de.z<=1&&w.layers.test(V.layers)===!0;if(w.element.style.display=U===!0?"":"none",U===!0){w.onBeforeRender(r,A,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,A,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],A,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"),Ue=require("three/examples/jsm/shaders/FXAAShader"),Fe=function(){try{var s=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&s.getContext("webgl2"))}catch(i){return!1}},bt=0,ke=1,ge=!1,Re=Fe()!==!1,Ie=`varying vec2 vUv;
2
2
 
3
3
  void main() {
4
4
 
@@ -15,7 +15,7 @@ void main() {
15
15
 
16
16
  gl_FragColor = (texture2D(baseTexture, vUv) + vec4(1.0) * texture2D(bloomTexture, vUv));
17
17
 
18
- }`;function _e(s,i){return _e=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},_e(s,i)}function Te(s,i){return _e(s,i)}function Ne(s,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=Object.create(i&&i.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),i&&Te(s,i)}function We(){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(s){return!1}}function we(s){return we=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},we(s)}function Ee(s){return we(s)}function Ze(s){if(s===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s}function Xe(s){return s&&s.constructor===Symbol?"symbol":typeof s}function qe(s,i){return i&&(Xe(i)==="object"||typeof i=="function")?i:Ze(s)}function Qe(s){var i=We();return function(){var e=Ee(s),t;if(i){var r=Ee(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return qe(this,t)}}var Me=require("three/examples/jsm/postprocessing/Pass"),je=require("three/examples/jsm/shaders/LuminosityHighPassShader"),Se=function(s){"use strict";Ne(n,s);var i=Qe(n);function n(t,r,o,u){j(this,n);var a;a=i.call(this),a.strength=r!==void 0?r:1,a.radius=o,a.threshold=u,a.resolution=t!==void 0?new l.Vector2(t.x,t.y):new l.Vector2(256,256),a.clearColor=new l.Color(0,0,0);var h={minFilter:l.LinearFilter,magFilter:l.LinearFilter,format:l.RGBAFormat};a.renderTargetsHorizontal=[],a.renderTargetsVertical=[],a.nMips=5;var C=Math.round(a.resolution.x/2),_=Math.round(a.resolution.y/2);a.renderTargetBright=new l.WebGLRenderTarget(C,_,h),a.renderTargetBright.texture.name="UnrealBloomPass.bright",a.renderTargetBright.texture.generateMipmaps=!1;for(var y=0;y<a.nMips;y++){var w=new l.WebGLRenderTarget(C,_,h);w.texture.name="UnrealBloomPass.h".concat(y),w.texture.generateMipmaps=!1,a.renderTargetsHorizontal.push(w);var z=new l.WebGLRenderTarget(C,_,h);z.texture.name="UnrealBloomPass.v".concat(y),z.texture.generateMipmaps=!1,a.renderTargetsVertical.push(z),C=Math.round(C/2),_=Math.round(_/2)}je.LuminosityHighPassShader===void 0&&console.error("THREE.UnrealBloomPass relies on LuminosityHighPassShader");var V=je.LuminosityHighPassShader;a.highPassUniforms=l.UniformsUtils.clone(V.uniforms),a.highPassUniforms.luminosityThreshold.value=u,a.highPassUniforms.smoothWidth.value=.01,a.materialHighPassFilter=new l.ShaderMaterial({uniforms:a.highPassUniforms,vertexShader:V.vertexShader,fragmentShader:V.fragmentShader,defines:{}}),a.separableBlurMaterials=[];var F=[3,5,7,9,11];C=Math.round(a.resolution.x/2),_=Math.round(a.resolution.y/2);for(var Z=0;Z<a.nMips;Z++)a.separableBlurMaterials.push(a.getSeperableBlurMaterial(F[Z])),a.separableBlurMaterials[Z].uniforms.texSize.value=new l.Vector2(C,_),C=Math.round(C/2),_=Math.round(_/2);a.compositeMaterial=a.getCompositeMaterial(a.nMips),a.compositeMaterial.uniforms.blurTexture1.value=a.renderTargetsVertical[0].texture,a.compositeMaterial.uniforms.blurTexture2.value=a.renderTargetsVertical[1].texture,a.compositeMaterial.uniforms.blurTexture3.value=a.renderTargetsVertical[2].texture,a.compositeMaterial.uniforms.blurTexture4.value=a.renderTargetsVertical[3].texture,a.compositeMaterial.uniforms.blurTexture5.value=a.renderTargetsVertical[4].texture,a.compositeMaterial.uniforms.bloomStrength.value=r,a.compositeMaterial.uniforms.bloomRadius.value=.1,a.compositeMaterial.needsUpdate=!0;var le=[1,.8,.6,.4,.2];a.compositeMaterial.uniforms.bloomFactors.value=le,a.bloomTintColors=[new l.Vector3(1,1,1),new l.Vector3(1,1,1),new l.Vector3(1,1,1),new l.Vector3(1,1,1),new l.Vector3(1,1,1)],a.compositeMaterial.uniforms.bloomTintColors.value=a.bloomTintColors,pe.CopyShader===void 0&&console.error("THREE.UnrealBloomPass relies on CopyShader");var I=pe.CopyShader;return a.copyUniforms=l.UniformsUtils.clone(I.uniforms),a.copyUniforms.opacity.value=1,a.materialCopy=new l.ShaderMaterial({uniforms:a.copyUniforms,vertexShader:I.vertexShader,fragmentShader:I.fragmentShader,blending:l.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0}),a.enabled=!0,a.needsSwap=!1,a._oldClearColor=new l.Color,a.oldClearAlpha=1,a.basic=new l.MeshBasicMaterial,a.fsQuad=new Me.FullScreenQuad(void 0),a}var e=n.prototype;return e.dispose=function(){for(var r=0;r<this.renderTargetsHorizontal.length;r++)this.renderTargetsHorizontal[r].dispose();for(var o=0;o<this.renderTargetsVertical.length;o++)this.renderTargetsVertical[o].dispose();this.renderTargetBright.dispose()},e.setSize=function(r,o){var u=Math.round(r/2),a=Math.round(o/2);this.renderTargetBright.setSize(u,a);for(var h=0;h<this.nMips;h++)this.renderTargetsHorizontal[h].setSize(u,a),this.renderTargetsVertical[h].setSize(u,a),this.separableBlurMaterials[h].uniforms.texSize.value=new l.Vector2(u,a),u=Math.round(u/2),a=Math.round(a/2)},e.render=function(r,o,u,a,h){r.getClearColor(this._oldClearColor),this.oldClearAlpha=r.getClearAlpha();var C=r.autoClear;r.autoClear=!1,r.setClearColor(this.clearColor,0),h&&r.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=u.texture,r.setRenderTarget(null),r.clear(),this.fsQuad.render(r)),this.highPassUniforms.tDiffuse.value=u.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,r.setRenderTarget(this.renderTargetBright),r.clear(),this.fsQuad.render(r);for(var _=this.renderTargetBright,y=0;y<this.nMips;y++)this.fsQuad.material=this.separableBlurMaterials[y],this.separableBlurMaterials[y].uniforms.colorTexture.value=_.texture,this.separableBlurMaterials[y].uniforms.direction.value=n.BlurDirectionX,r.setRenderTarget(this.renderTargetsHorizontal[y]),r.clear(),this.fsQuad.render(r),this.separableBlurMaterials[y].uniforms.colorTexture.value=this.renderTargetsHorizontal[y].texture,this.separableBlurMaterials[y].uniforms.direction.value=n.BlurDirectionY,r.setRenderTarget(this.renderTargetsVertical[y]),r.clear(),this.fsQuad.render(r),_=this.renderTargetsVertical[y];this.fsQuad.material=this.compositeMaterial,this.compositeMaterial.uniforms.bloomStrength.value=this.strength,this.compositeMaterial.uniforms.bloomRadius.value=this.radius,this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,r.setRenderTarget(this.renderTargetsHorizontal[0]),r.clear(),this.fsQuad.render(r),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,h&&r.state.buffers.stencil.setTest(!0),this.renderToScreen?(r.setRenderTarget(null),this.fsQuad.render(r)):(r.setRenderTarget(u),this.fsQuad.render(r)),r.setClearColor(this._oldClearColor,this.oldClearAlpha),r.autoClear=C},e.getSeperableBlurMaterial=function(r){return new l.ShaderMaterial({defines:{KERNEL_RADIUS:r,SIGMA:r},uniforms:{colorTexture:{value:null},texSize:{value:new l.Vector2(.5,.5)},direction:{value:new l.Vector2(.5,.5)}},vertexShader:`varying vec2 vUv;
18
+ }`;function _e(s,i){return _e=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},_e(s,i)}function Te(s,i){return _e(s,i)}function Ne(s,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=Object.create(i&&i.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),i&&Te(s,i)}function We(){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(s){return!1}}function we(s){return we=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},we(s)}function Ee(s){return we(s)}function Ze(s){if(s===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s}function Xe(s){return s&&s.constructor===Symbol?"symbol":typeof s}function qe(s,i){return i&&(Xe(i)==="object"||typeof i=="function")?i:Ze(s)}function Qe(s){var i=We();return function(){var e=Ee(s),t;if(i){var r=Ee(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return qe(this,t)}}var Me=require("three/examples/jsm/postprocessing/Pass"),je=require("three/examples/jsm/shaders/LuminosityHighPassShader"),Se=function(s){"use strict";Ne(n,s);var i=Qe(n);function n(t,r,o,u){j(this,n);var a;a=i.call(this),a.strength=r!==void 0?r:1,a.radius=o,a.threshold=u,a.resolution=t!==void 0?new l.Vector2(t.x,t.y):new l.Vector2(256,256),a.clearColor=new l.Color(0,0,0);var h={minFilter:l.LinearFilter,magFilter:l.LinearFilter,format:l.RGBAFormat};a.renderTargetsHorizontal=[],a.renderTargetsVertical=[],a.nMips=5;var C=Math.round(a.resolution.x/2),_=Math.round(a.resolution.y/2);a.renderTargetBright=new l.WebGLRenderTarget(C,_,h),a.renderTargetBright.texture.name="UnrealBloomPass.bright",a.renderTargetBright.texture.generateMipmaps=!1;for(var y=0;y<a.nMips;y++){var w=new l.WebGLRenderTarget(C,_,h);w.texture.name="UnrealBloomPass.h".concat(y),w.texture.generateMipmaps=!1,a.renderTargetsHorizontal.push(w);var A=new l.WebGLRenderTarget(C,_,h);A.texture.name="UnrealBloomPass.v".concat(y),A.texture.generateMipmaps=!1,a.renderTargetsVertical.push(A),C=Math.round(C/2),_=Math.round(_/2)}je.LuminosityHighPassShader===void 0&&console.error("THREE.UnrealBloomPass relies on LuminosityHighPassShader");var V=je.LuminosityHighPassShader;a.highPassUniforms=l.UniformsUtils.clone(V.uniforms),a.highPassUniforms.luminosityThreshold.value=u,a.highPassUniforms.smoothWidth.value=.01,a.materialHighPassFilter=new l.ShaderMaterial({uniforms:a.highPassUniforms,vertexShader:V.vertexShader,fragmentShader:V.fragmentShader,defines:{}}),a.separableBlurMaterials=[];var U=[3,5,7,9,11];C=Math.round(a.resolution.x/2),_=Math.round(a.resolution.y/2);for(var Z=0;Z<a.nMips;Z++)a.separableBlurMaterials.push(a.getSeperableBlurMaterial(U[Z])),a.separableBlurMaterials[Z].uniforms.texSize.value=new l.Vector2(C,_),C=Math.round(C/2),_=Math.round(_/2);a.compositeMaterial=a.getCompositeMaterial(a.nMips),a.compositeMaterial.uniforms.blurTexture1.value=a.renderTargetsVertical[0].texture,a.compositeMaterial.uniforms.blurTexture2.value=a.renderTargetsVertical[1].texture,a.compositeMaterial.uniforms.blurTexture3.value=a.renderTargetsVertical[2].texture,a.compositeMaterial.uniforms.blurTexture4.value=a.renderTargetsVertical[3].texture,a.compositeMaterial.uniforms.blurTexture5.value=a.renderTargetsVertical[4].texture,a.compositeMaterial.uniforms.bloomStrength.value=r,a.compositeMaterial.uniforms.bloomRadius.value=.1,a.compositeMaterial.needsUpdate=!0;var le=[1,.8,.6,.4,.2];a.compositeMaterial.uniforms.bloomFactors.value=le,a.bloomTintColors=[new l.Vector3(1,1,1),new l.Vector3(1,1,1),new l.Vector3(1,1,1),new l.Vector3(1,1,1),new l.Vector3(1,1,1)],a.compositeMaterial.uniforms.bloomTintColors.value=a.bloomTintColors,pe.CopyShader===void 0&&console.error("THREE.UnrealBloomPass relies on CopyShader");var I=pe.CopyShader;return a.copyUniforms=l.UniformsUtils.clone(I.uniforms),a.copyUniforms.opacity.value=1,a.materialCopy=new l.ShaderMaterial({uniforms:a.copyUniforms,vertexShader:I.vertexShader,fragmentShader:I.fragmentShader,blending:l.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0}),a.enabled=!0,a.needsSwap=!1,a._oldClearColor=new l.Color,a.oldClearAlpha=1,a.basic=new l.MeshBasicMaterial,a.fsQuad=new Me.FullScreenQuad(void 0),a}var e=n.prototype;return e.dispose=function(){for(var r=0;r<this.renderTargetsHorizontal.length;r++)this.renderTargetsHorizontal[r].dispose();for(var o=0;o<this.renderTargetsVertical.length;o++)this.renderTargetsVertical[o].dispose();this.renderTargetBright.dispose()},e.setSize=function(r,o){var u=Math.round(r/2),a=Math.round(o/2);this.renderTargetBright.setSize(u,a);for(var h=0;h<this.nMips;h++)this.renderTargetsHorizontal[h].setSize(u,a),this.renderTargetsVertical[h].setSize(u,a),this.separableBlurMaterials[h].uniforms.texSize.value=new l.Vector2(u,a),u=Math.round(u/2),a=Math.round(a/2)},e.render=function(r,o,u,a,h){r.getClearColor(this._oldClearColor),this.oldClearAlpha=r.getClearAlpha();var C=r.autoClear;r.autoClear=!1,r.setClearColor(this.clearColor,0),h&&r.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=u.texture,r.setRenderTarget(null),r.clear(),this.fsQuad.render(r)),this.highPassUniforms.tDiffuse.value=u.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,r.setRenderTarget(this.renderTargetBright),r.clear(),this.fsQuad.render(r);for(var _=this.renderTargetBright,y=0;y<this.nMips;y++)this.fsQuad.material=this.separableBlurMaterials[y],this.separableBlurMaterials[y].uniforms.colorTexture.value=_.texture,this.separableBlurMaterials[y].uniforms.direction.value=n.BlurDirectionX,r.setRenderTarget(this.renderTargetsHorizontal[y]),r.clear(),this.fsQuad.render(r),this.separableBlurMaterials[y].uniforms.colorTexture.value=this.renderTargetsHorizontal[y].texture,this.separableBlurMaterials[y].uniforms.direction.value=n.BlurDirectionY,r.setRenderTarget(this.renderTargetsVertical[y]),r.clear(),this.fsQuad.render(r),_=this.renderTargetsVertical[y];this.fsQuad.material=this.compositeMaterial,this.compositeMaterial.uniforms.bloomStrength.value=this.strength,this.compositeMaterial.uniforms.bloomRadius.value=this.radius,this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,r.setRenderTarget(this.renderTargetsHorizontal[0]),r.clear(),this.fsQuad.render(r),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,h&&r.state.buffers.stencil.setTest(!0),this.renderToScreen?(r.setRenderTarget(null),this.fsQuad.render(r)):(r.setRenderTarget(u),this.fsQuad.render(r)),r.setClearColor(this._oldClearColor,this.oldClearAlpha),r.autoClear=C},e.getSeperableBlurMaterial=function(r){return new l.ShaderMaterial({defines:{KERNEL_RADIUS:r,SIGMA:r},uniforms:{colorTexture:{value:null},texSize:{value:new l.Vector2(.5,.5)},direction:{value:new l.Vector2(.5,.5)}},vertexShader:`varying vec2 vUv;
19
19
  void main() {
20
20
  vUv = uv;
21
21
  gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
@@ -54,4 +54,4 @@ void main() {
54
54
  lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +
55
55
  lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +
56
56
  lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );
57
- }`})},n}(Me.Pass);Se.BlurDirectionX=new l.Vector2(1,0),Se.BlurDirectionY=new l.Vector2(0,1);var Ye={threshold:.2,strength:.5,radius:0},Ke=new l.MeshBasicMaterial({color:"black"}),$e=new l.SpriteMaterial({color:"#000"}),Je=function(){"use strict";function s(n,e){j(this,s),this.materials={},this.bloomLayer=new l.Layers,this.active=!0,this.composerController=n,this.options=e;var t=n.renderer,r=n.renderPass,o=n.finalComposer,u=n.getSize(),a=u.width,h=u.height,C=new Se(new l.Vector2(a,h),e.strength,e.radius,e.threshold);this.bloomPass=C;var _=new ie.EffectComposer(t);_.renderToScreen=!1,_.addPass(r),_.addPass(this.bloomPass),this.bloomComposer=_,this.bloomLayer.set(ke);var y=new l.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:_.renderTarget2.texture}},vertexShader:Ie,fragmentShader:He,defines:{}}),w=new te.ShaderPass(y,"baseTexture");w.needsSwap=!0,this.finalPass=w,o.addPass(w)}var i=s.prototype;return i.enable=function(){this.active||(this.finalPass.enabled=!0,this.bloomPass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.finalPass.enabled=!1,this.bloomPass.enabled=!1,this.active=!1)},i.render=function(e){if(!!this.active){var t=this,r=t.bloomComposer,o=t.bloomLayer,u=t.materials;e.traverse(function(a){var h=a;h.material&&o.test(h.layers)===!1&&(u[h.uuid]=h.material,h.material=h.isSprite?$e:Ke)}),r.render(),e.traverse(function(a){var h=a;u[h.uuid]&&(h.material=u[h.uuid],delete u[h.uuid])})}},i.setSize=function(e,t){this.bloomComposer.setSize(e,t)},i.setGui=function(e){var t=this,r=new R({bloom:{threshold:{value:this.options.threshold,min:0,max:1,target:function(){return t.bloomPass}},strength:{value:this.options.strength,min:0,max:10,target:function(){return t.bloomPass}},radius:{value:this.options.radius,min:0,max:2,step:.01,target:function(){return t.bloomPass}}}});r.showGui(e)},i.dispose=function(){this.bloomPass.dispose(),this.materials={}},s}(),et=require("three/examples/jsm/postprocessing/OutlinePass"),tt={edgeStrength:3,edgeGlow:4,edgeThickness:1,pulsePeriod:0,rotate:!1,usePatternTexture:!1,visibleEdgeColor:"#5ee8e8",hiddenEdgeColor:"#190a05"},rt=function(){"use strict";function s(n,e){j(this,s),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var t=n.scene,r=n.camera,o=n.finalComposer,u=n.getSize(),a=u.width,h=u.height,C=new et.OutlinePass(new l.Vector2(a,h),t,r);C.selectedObjects=this.selectedObjects,this.outlinePass=C,o.addPass(C),this.setGui()}var i=s.prototype;return i.enable=function(){this.active||(this.outlinePass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.outlinePass.enabled=!1,this.active=!1)},i.setGui=function(){var e=this,t=new R({outline:{edgeStrength:{value:this.options.edgeStrength,min:.01,max:10,step:.01,target:function(){return e.outlinePass}},edgeGlow:{value:this.options.edgeGlow,min:0,max:10,step:.01,target:function(){return e.outlinePass}},edgeThickness:{value:this.options.edgeThickness,min:0,max:4,step:.01,target:function(){return e.outlinePass}},pulsePeriod:{value:this.options.pulsePeriod,min:0,max:4,step:.01,target:function(){return e.outlinePass}},usePatternTexture:{value:this.options.usePatternTexture,target:function(){return e.outlinePass}},visibleEdgeColor:{value:this.options.visibleEdgeColor,target:function(){return e.outlinePass}},hiddenEdgeColor:{value:this.options.hiddenEdgeColor,target:function(){return e.outlinePass}}}});t.setTargetValueByParams(),this.outlineGui=t},i.dispose=function(){this.outlinePass.dispose(),this.selectedObjects=[]},s}();function nt(s,i){if(s==null)return{};var n={},e=Object.keys(s),t,r;for(r=0;r<e.length;r++)t=e[r],!(i.indexOf(t)>=0)&&(n[t]=s[t]);return n}function it(s,i){if(s==null)return{};var n=nt(s,i),e,t;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(s);for(t=0;t<r.length;t++)e=r[t],!(i.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(s,e)||(n[e]=s[e]))}return n}var at=require("three/examples/jsm/postprocessing/SSRPass"),st=require("three/examples/jsm/objects/ReflectorForSSRPass"),ot={maxDistance:10,selects:!0},ut={width:1,height:1,clipBias:3e-4,color:8947848,useDepthTexture:!0},lt=function(){"use strict";function s(n,e){j(this,s),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var t=n.scene,r=n.camera,o=n.renderer,u=n.finalComposer,a=n.getSize(),h=a.width,C=a.height,_=new at.SSRPass({renderer:o,scene:t,camera:r,width:h,height:C,groundReflector:null,selects:this.selectedObjects});this.ssrPass=_,u.addPass(_),this.setGui()}var i=s.prototype;return i.addGroundReflector=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=(0,G.Z)({},ut,e),r=t.width,o=t.height,u=it(t,["width","height"]),a=this.composerController,h=a.scene,C=a.getSize(),_=new l.PlaneGeometry(r,o),y=new st.ReflectorForSSRPass(_,E((0,G.Z)({},u),{textureWidth:C.width,textureHeight:C.height}));y.material.depthWrite=!1,y.rotation.x=-Math.PI/2,y.visible=!1,h.add(y),this.ssrPass.groundReflector=this.groundReflector,this.groundReflector=y},i.removeaGroundReflector=function(){this.ssrPass.groundReflector=null,this.groundReflector=void 0},i.enable=function(){this.active||(this.ssrPass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.ssrPass.enabled=!1,this.active=!1)},i.setSize=function(e,t){var r=this.groundReflector;r&&(r.getRenderTarget().setSize(e,t),r.resolution.set(e,t))},i.setGui=function(){var e=this,t=new R({ssr:{thickness:{value:.018,min:0,max:.1,step:1e-4,target:function(){return e.ssrPass}},infiniteThick:{value:!1,target:function(){return e.ssrPass}},fresnel:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},distanceAttenuation:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},selects:{value:this.options.selects,onChange:function(r){r?e.ssrPass.selects=e.selectedObjects:e.ssrPass.selects=null}},maxDistance:{value:this.options.maxDistance,min:0,max:100,step:.001,target:function(){return[e.ssrPass,e.groundReflector]}},opacity:{value:1,min:0,max:1,step:.01,target:function(){return[e.ssrPass,e.groundReflector]}}}});t.setTargetValueByParams(),this.ssrGui=t},i.dispose=function(){this.ssrPass.dispose(),this.selectedObjects=[]},s}(),ct=function(){"use strict";function s(n){j(this,s),this.active=!0,this.options=n;var e=n.renderer,t=n.scene,r=n.camera,o=this.createRenderTarget(),u=new ie.EffectComposer(e,o);u.setPixelRatio(e.getPixelRatio()),this.finalComposer=u,this.addRenderPasss(),this.renderer=e,this.scene=t,this.renderTarget=o,this.camera=r}var i=s.prototype;return i.createRenderTarget=function(){var e=this.options.composerParams,t=e.multisampling,r=e.type,o=e.encoding,u=this.getSize(),a={minFilter:l.LinearFilter,magFilter:l.LinearFilter,format:l.RGBAFormat,encoding:o,type:r},h;if(+l.REVISION<138&&t>0){var C=new l.WebGLMultisampleRenderTarget(u.width,u.height,a);C.samples=t,h=C}else if(+l.REVISION>=138&&t>0){var _=new l.WebGLRenderTarget(u.width,u.height,E((0,G.Z)({},a),{samples:t}));h=_}else{var y=new l.WebGLRenderTarget(u.width,u.height,a);h=y}return h.texture.name="EffectComposer.rt1",h},i.addRenderPasss=function(){var e=this.options,t=e.scene,r=e.camera,o=new oe.RenderPass(t,r);this.finalComposer.addPass(o),this.renderPass=o},i.addCopyPass=function(){var e=new te.ShaderPass(pe.CopyShader);this.finalComposer.addPass(e),this.copyPass=e},i.addGammaCorrectionPass=function(){var e=new te.ShaderPass(me.GammaCorrectionShader);this.finalComposer.addPass(e),this.gammaCorrectionPass=e},i.addFXAAPass=function(){var e=this.getSize(),t=e.width,r=e.height,o=new te.ShaderPass(Fe.FXAAShader);this.finalComposer.addPass(o),this.fxaaPass=o,this.setFXAAPassSize(t,r)},i.addSMAAPass=function(){var e=this.getSize(),t=e.width,r=e.height,o=this.options.renderer,u=new he.SMAAPass(t*o.getPixelRatio(),r*o.getPixelRatio());this.finalComposer.addPass(u),this.smaaPass=u},i.addSSAAPass=function(){var e=this.options,t=e.scene,r=e.camera,o=new Ve.SSAARenderPass(t,r,0,0);o.unbiased=!0,o.sampleLevel=1,this.finalComposer.addPass(o),this.ssaaPass=o},i.addBloomPass=function(e){var t=new Je(this,e);t.disable(),this.options.gui&&t.setGui(this.options.gui),this.bloomController=t},i.addOutlinePass=function(e){var t=new rt(this,e);t.disable(),this.options.gui&&t.outlineGui.showGui(this.options.gui),this.outlineController=t},i.addSSRPass=function(e){var t=new lt(this,e);t.disable(),this.options.gui&&t.ssrGui.showGui(this.options.gui),this.ssrController=t},i.getSize=function(){var e=this.options.renderer;return e.getSize(new l.Vector2)},i.enable=function(){this.active||(this.active=!0)},i.disable=function(){!this.active||(this.active=!1)},i.checkCopyPass=function(){var e=this,t=this.finalComposer.passes.some(function(r){return r!==e.renderPass&&r!==e.copyPass?r.enabled:!1});t&&this.copyPass?this.copyPass.enabled=!1:!t&&this.copyPass?this.copyPass.enabled=!0:!t&&!this.copyPass&&this.addCopyPass()},i.setSize=function(e,t){var r,o;this.finalComposer.setSize(e,t),(r=this.bloomController)===null||r===void 0||r.setSize(e,t),(o=this.ssrController)===null||o===void 0||o.setSize(e,t),this.setFXAAPassSize(e,t)},i.setFXAAPassSize=function(e,t){if(!!this.fxaaPass){var r=this.options.renderer,o=r.getPixelRatio();this.fxaaPass.material.uniforms.resolution.value.x=1/(e*o),this.fxaaPass.material.uniforms.resolution.value.y=1/(t*o)}},i.render=function(){var e;if(!!this.active){var t=this.options.scene;(e=this.bloomController)===null||e===void 0||e.render(t),this.finalComposer.render()}},i.dispose=function(){var e,t,r;(e=this.bloomController)===null||e===void 0||e.dispose(),(t=this.outlineController)===null||t===void 0||t.dispose(),(r=this.ssrController)===null||r===void 0||r.dispose(),this.finalComposer.passes.forEach(function(o){var u,a,h;(u=o.fsQuad)===null||u===void 0||u.dispose(),(a=o.fsQuad)===null||a===void 0||(h=a.material)===null||h===void 0||h.dispose()}),this.renderTarget.dispose(),this.copyPass=void 0,this.gammaCorrectionPass=void 0,this.smaaPass=void 0,this.ssaaPass=void 0,this.fxaaPass=void 0,this.bloomController=void 0,this.outlineController=void 0,this.ssrController=void 0},s}(),xe=function(){"use strict";function s(n){j(this,s),this.raycaster=new l.Raycaster,this.installPlugins=new Map,this.event=new N.EventEmitter,this.clock=new l.Clock,this.options=ae()(s.options,n,{isMergeableObject:L.isPlainObject});var e=this.options,t=e.container,r=e.stats,o=e.gui;if(o){var u=new(Y());u.open(!1),this.gui=u}if(r){var a=new(X());a.showPanel(0),a.dom.style.position="absolute",t.appendChild(a.dom),this.stats=a}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),this.clock.getDelta(),this.clock.getElapsedTime()}var i=s.prototype;return i.use=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var u;(u=e).install.apply(u,[this].concat(k(r))),this.installPlugins.set(e,!0)}},i.init=function(){var e=this,t=this.options,r=t.container,o=t.isdev,u=t.axesHelper,a=t.renderer,h=t.scene,C=t.camera,_=this.getSize(),y=_.width,w=_.height,z=new P({isdev:o,width:y,height:w,cameraParams:C});this.gui&&z.setGui(this.gui);var V=z.camera,F=new J({camera:V,sceneParams:h}),Z=F.scene,le=new v({width:y,height:w,scene:Z,camera:V,isdev:o,rendererParams:E((0,G.Z)({},a),{outputEncoding:l.LinearEncoding,antialias:!1})});this.gui&&le.setGui(this.gui);var I=le.renderer;u&&F.addAxesHelper(),this.sceneController=F,this.rendererController=le,this.cameraController=z,r.appendChild(I.domElement);var ue=new ResizeObserver(function(ce){var fe=!0,ye=!1,ze=void 0;try{for(var Ce=ce[Symbol.iterator](),De;!(fe=(De=Ce.next()).done);fe=!0){var mt=De.value,Ge=mt.contentRect;e.handeleResize(Ge.width,Ge.height)}}catch(gt){ye=!0,ze=gt}finally{try{!fe&&Ce.return!=null&&Ce.return()}finally{if(ye)throw ze}}});ue.observe(r),this.resizeObserver=ue},i.initComposer=function(){var e=this.options,t=e.bloom,r=e.outline,o=e.ssr,u=e.renderer,a=e.bloomParams,h=e.outlineParams,C=e.ssrParams,_=e.multisampling,y=u.antialias;y==="msaa"&&!Re&&(y=!1,console.warn("MSAA is not supported on this browser"));var w=new ct({renderer:this.renderer,scene:this.scene,camera:this.camera,gui:this.gui,composerParams:{multisampling:y==="msaa"?_:0,type:l.UnsignedByteType,encoding:u.outputEncoding}});this.composerController=w,y==="ssaa"&&w.addSSAAPass(),o&&w.addSSRPass(C),t&&w.addBloomPass(a),r&&w.addOutlinePass(h),u.outputEncoding===l.sRGBEncoding&&w.addGammaCorrectionPass(),y==="fxaa"?w.addFXAAPass():y==="smaa"&&w.addSMAAPass(),w.checkCopyPass(),this.event.on("passcheck",function(){w.checkCopyPass()})},i.initCSSRenderer=function(){var e=this.options,t=e.container,r=e.css2DRenderer,o=e.css3DRenderer,u=e.css2DRendererParams,a=e.css3DRendererParams;if(r||o){var h=new se(t);r&&h.addRenderer("css2d",u),o&&h.addRenderer("css3d",a),this.cssRendererController=h}},i.initControl=function(){var e=this.options,t=e.control,r=e.mapControl,o=e.controlParams;if(t){var u=new q({camera:this.camera,controlParams:{domElement:(o==null?void 0:o.domElement)||this.renderer.domElement},mapControl:r});this.controlController=u}},i.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},i.handeleResize=function(e,t){var r=this,o=r.rendererController,u=r.cameraController,a=r.composerController,h=r.cssRendererController;u==null||u.setSize(e,t),o==null||o.setSize(e,t),a==null||a.setSize(e,t),h==null||h.setSize(e,t),this.installPlugins.forEach(function(C,_){var y;(y=_.resize)===null||y===void 0||y.call(_,{width:e,height:t})}),this.event.emit("resize",{width:e,height:t})},i.pick=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=this,u=o.raycaster,a=o.options,h=a.container,C=new l.Vector2,_=h.getBoundingClientRect();if(C.x=(e.clientX-_.left)/(_.right-_.left)*2-1,C.y=-((e.clientY-_.top)/(_.bottom-_.top))*2+1,this.camera&&this.scene){u.setFromCamera(C,this.camera);var y=u.intersectObjects(t||this.scene.children,r);if(y.length)return{object:y[0].object,intersects:y}}},i.render=function(){var e,t,r,o,u=this,a=u.renderer,h=u.scene,C=u.camera,_=u.clock;if(!(!a||!h||!C||this.options.staticRender&&!this.cameraController.checkCameraChange())){var y=_.getDelta(),w=_.getElapsedTime();if(a.clear(),(e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(V,F){var Z;(Z=F.update)===null||Z===void 0||Z.call(F,y,w)}),!((t=this.composerController)===null||t===void 0)&&t.active)this.composerController.render();else{var z;(z=this.rendererController)===null||z===void 0||z.render()}(r=this.cssRendererController)===null||r===void 0||r.render(h,C),(o=this.stats)===null||o===void 0||o.update(),this.event.emit("render",{delta:y,elapsed:w})}},i.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},i.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},i.dispose=function(){var e,t,r,o,u,a,h;this.stop(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(C,_){var y;(y=_.dispose)===null||y===void 0||y.call(_)}),(t=this.controlController)===null||t===void 0||t.dispose(),(r=this.cssRendererController)===null||r===void 0||r.dispose(),(o=this.sceneController)===null||o===void 0||o.dispose(),(u=this.composerController)===null||u===void 0||u.dispose(),(a=this.rendererController)===null||a===void 0||a.dispose(),this.controlController=void 0,this.cssRendererController=void 0,(h=this.gui)===null||h===void 0||h.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},S(s,[{key:"renderer",get:function(){return this.rendererController.renderer}},{key:"control",get:function(){var e;return(e=this.controlController)===null||e===void 0?void 0:e.control}},{key:"camera",get:function(){return this.cameraController.camera}},{key:"scene",get:function(){return this.sceneController.scene}}]),s}();xe.options={isdev:ge,stats:ge,gui:ge,axesHelper:ge,control:ge,renderer:E((0,G.Z)({},c),{antialias:Re?"msaa":"smaa"}),staticRender:!1,multisampling:8,scene:T,camera:m,bloom:!1,bloomParams:Ye,outline:!1,outlineParams:tt,css2DRenderer:!1,ssr:!1,ssrParams:ot,css2DRendererParams:(0,G.Z)({},$),css3DRenderer:!1,css3DRendererParams:(0,G.Z)({},$)};function ft(){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(s){return!1}}function be(s,i,n){return ft()?be=Reflect.construct:be=function(t,r,o){var u=[null];u.push.apply(u,r);var a=Function.bind.apply(t,u),h=new a;return o&&Te(h,o.prototype),h},be.apply(null,arguments)}function Le(s,i,n){return be.apply(null,arguments)}var dt=re(620);function ht(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n={};return n.promise=new Promise(function(e,t){n.resolve=e,n.reject=t}),s&&(n.promise=(0,dt.Z)(n.promise,i)),n}var vt=require("three/examples/jsm/renderers/CSS2DRenderer"),Ae=function(s){s&&((0,L.disposeMesh)(s),s.children.forEach(function(i){i.userData.BaseObject_||Ae(i)}))},pt=function(){"use strict";function s(){j(this,s),this.objecttype__="BaseObject",this.userData={},this.pm=ht(),this.visible=!1}var i=s.prototype;return i.init=function(){},i.create=function(){},i.render=function(){},i.update=function(e,t){},i.resize=function(e,t){},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 e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.object3d=Le(l.Mesh,k(t)),this},i.createGroup=function(){return this.object3d=new l.Group,this},i.createPoints=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.object3d=Le(l.Points,k(t)),this},i.createCSS2DObject=function(e){return this.object3d=new vt.CSS2DObject(e),this},i.createCSS3DObject=function(e){return this.object3d=new ve.CSS3DObject(e),this},i.createCSS3DSprite=function(e){return this.object3d=new ve.CSS3DSprite(e),this},i.createSprite=function(e){return this.object3d=new l.Sprite(e),this},i.add=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var o;return(o=this.object3d).add.apply(o,k(t)),this},i.remove=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var o;return(o=this.object3d).remove.apply(o,k(t)),this},i.getSize=function(){var e=new l.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new l.Vector3)}},i.traverse=function(e){e(this),this.children.forEach(function(t){t.traverse(e)})},i.dispose=function(){Ae(this.object3d)},S(s,[{key:"parent",get:function(){var e=this.object3d.parent;return(e==null?void 0:e.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(e){return e.userData.BaseObject_}).filter(function(e){return!!e})}}]),s}()})(),module.exports=Pe})();
57
+ }`})},n}(Me.Pass);Se.BlurDirectionX=new l.Vector2(1,0),Se.BlurDirectionY=new l.Vector2(0,1);var Ye={threshold:.2,strength:.5,radius:0},Ke=new l.MeshBasicMaterial({color:"black"}),$e=new l.SpriteMaterial({color:"#000"}),Je=function(){"use strict";function s(n,e){j(this,s),this.materials={},this.bloomLayer=new l.Layers,this.active=!0,this.composerController=n,this.options=e;var t=n.renderer,r=n.renderPass,o=n.finalComposer,u=n.getSize(),a=u.width,h=u.height,C=new Se(new l.Vector2(a,h),e.strength,e.radius,e.threshold);this.bloomPass=C;var _=new ie.EffectComposer(t);_.renderToScreen=!1,_.addPass(r),_.addPass(this.bloomPass),this.bloomComposer=_,this.bloomLayer.set(ke);var y=new l.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:_.renderTarget2.texture}},vertexShader:Ie,fragmentShader:He,defines:{}}),w=new te.ShaderPass(y,"baseTexture");w.needsSwap=!0,this.finalPass=w,o.addPass(w)}var i=s.prototype;return i.enable=function(){this.active||(this.finalPass.enabled=!0,this.bloomPass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.finalPass.enabled=!1,this.bloomPass.enabled=!1,this.active=!1)},i.render=function(e){if(!!this.active){var t=this,r=t.bloomComposer,o=t.bloomLayer,u=t.materials;e.traverse(function(a){var h=a;h.material&&o.test(h.layers)===!1&&(u[h.uuid]=h.material,h.material=h.isSprite?$e:Ke)}),r.render(),e.traverse(function(a){var h=a;u[h.uuid]&&(h.material=u[h.uuid],delete u[h.uuid])})}},i.setSize=function(e,t){this.bloomComposer.setSize(e,t)},i.setGui=function(e){var t=this,r=new R({bloom:{threshold:{value:this.options.threshold,min:0,max:1,target:function(){return t.bloomPass}},strength:{value:this.options.strength,min:0,max:10,target:function(){return t.bloomPass}},radius:{value:this.options.radius,min:0,max:2,step:.01,target:function(){return t.bloomPass}}}});r.showGui(e)},i.dispose=function(){this.bloomPass.dispose(),this.materials={}},s}(),et=require("three/examples/jsm/postprocessing/OutlinePass"),tt={edgeStrength:3,edgeGlow:4,edgeThickness:1,pulsePeriod:0,rotate:!1,usePatternTexture:!1,visibleEdgeColor:"#5ee8e8",hiddenEdgeColor:"#190a05"},rt=function(){"use strict";function s(n,e){j(this,s),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var t=n.scene,r=n.camera,o=n.finalComposer,u=n.getSize(),a=u.width,h=u.height,C=new et.OutlinePass(new l.Vector2(a,h),t,r);C.selectedObjects=this.selectedObjects,this.outlinePass=C,o.addPass(C),this.setGui()}var i=s.prototype;return i.enable=function(){this.active||(this.outlinePass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.outlinePass.enabled=!1,this.active=!1)},i.setGui=function(){var e=this,t=new R({outline:{edgeStrength:{value:this.options.edgeStrength,min:.01,max:10,step:.01,target:function(){return e.outlinePass}},edgeGlow:{value:this.options.edgeGlow,min:0,max:10,step:.01,target:function(){return e.outlinePass}},edgeThickness:{value:this.options.edgeThickness,min:0,max:4,step:.01,target:function(){return e.outlinePass}},pulsePeriod:{value:this.options.pulsePeriod,min:0,max:4,step:.01,target:function(){return e.outlinePass}},usePatternTexture:{value:this.options.usePatternTexture,target:function(){return e.outlinePass}},visibleEdgeColor:{value:this.options.visibleEdgeColor,target:function(){return e.outlinePass}},hiddenEdgeColor:{value:this.options.hiddenEdgeColor,target:function(){return e.outlinePass}}}});t.setTargetValueByParams(),this.outlineGui=t},i.dispose=function(){this.outlinePass.dispose(),this.selectedObjects=[]},s}();function nt(s,i){if(s==null)return{};var n={},e=Object.keys(s),t,r;for(r=0;r<e.length;r++)t=e[r],!(i.indexOf(t)>=0)&&(n[t]=s[t]);return n}function it(s,i){if(s==null)return{};var n=nt(s,i),e,t;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(s);for(t=0;t<r.length;t++)e=r[t],!(i.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(s,e)||(n[e]=s[e]))}return n}var at=require("three/examples/jsm/postprocessing/SSRPass"),st=require("three/examples/jsm/objects/ReflectorForSSRPass"),ot={maxDistance:10,selects:!0},ut={width:1,height:1,clipBias:3e-4,color:8947848,useDepthTexture:!0},lt=function(){"use strict";function s(n,e){j(this,s),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var t=n.scene,r=n.camera,o=n.renderer,u=n.finalComposer,a=n.getSize(),h=a.width,C=a.height,_=new at.SSRPass({renderer:o,scene:t,camera:r,width:h,height:C,groundReflector:null,selects:this.selectedObjects});this.ssrPass=_,u.addPass(_),this.setGui()}var i=s.prototype;return i.addGroundReflector=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=(0,G.Z)({},ut,e),r=t.width,o=t.height,u=it(t,["width","height"]),a=this.composerController,h=a.scene,C=a.getSize(),_=new l.PlaneGeometry(r,o),y=new st.ReflectorForSSRPass(_,E((0,G.Z)({},u),{textureWidth:C.width,textureHeight:C.height}));y.material.depthWrite=!1,y.rotation.x=-Math.PI/2,y.visible=!1,h.add(y),this.ssrPass.groundReflector=this.groundReflector,this.groundReflector=y},i.removeaGroundReflector=function(){this.ssrPass.groundReflector=null,this.groundReflector=void 0},i.enable=function(){this.active||(this.ssrPass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.ssrPass.enabled=!1,this.active=!1)},i.setSize=function(e,t){var r=this.groundReflector;r&&(r.getRenderTarget().setSize(e,t),r.resolution.set(e,t))},i.setGui=function(){var e=this,t=new R({ssr:{thickness:{value:.018,min:0,max:.1,step:1e-4,target:function(){return e.ssrPass}},infiniteThick:{value:!1,target:function(){return e.ssrPass}},fresnel:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},distanceAttenuation:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},selects:{value:this.options.selects,onChange:function(r){r?e.ssrPass.selects=e.selectedObjects:e.ssrPass.selects=null}},maxDistance:{value:this.options.maxDistance,min:0,max:100,step:.001,target:function(){return[e.ssrPass,e.groundReflector]}},opacity:{value:1,min:0,max:1,step:.01,target:function(){return[e.ssrPass,e.groundReflector]}}}});t.setTargetValueByParams(),this.ssrGui=t},i.dispose=function(){this.ssrPass.dispose(),this.selectedObjects=[]},s}(),ct=function(){"use strict";function s(n){j(this,s),this.active=!0,this.options=n;var e=n.renderer,t=n.scene,r=n.camera,o=this.createRenderTarget(),u=new ie.EffectComposer(e,o);u.setPixelRatio(e.getPixelRatio()),this.finalComposer=u,this.addRenderPasss(),this.renderer=e,this.scene=t,this.renderTarget=o,this.camera=r}var i=s.prototype;return i.createRenderTarget=function(){var e=this.options.composerParams,t=e.multisampling,r=e.type,o=e.encoding,u=this.getSize(),a={minFilter:l.LinearFilter,magFilter:l.LinearFilter,format:l.RGBAFormat,encoding:o,type:r},h;if(+l.REVISION<138&&t>0){var C=new l.WebGLMultisampleRenderTarget(u.width,u.height,a);C.samples=t,h=C}else if(+l.REVISION>=138&&t>0){var _=new l.WebGLRenderTarget(u.width,u.height,E((0,G.Z)({},a),{samples:t}));h=_}else{var y=new l.WebGLRenderTarget(u.width,u.height,a);h=y}return h.texture.name="EffectComposer.rt1",h},i.addRenderPasss=function(){var e=this.options,t=e.scene,r=e.camera,o=new oe.RenderPass(t,r);this.finalComposer.addPass(o),this.renderPass=o},i.addCopyPass=function(){var e=new te.ShaderPass(pe.CopyShader);this.finalComposer.addPass(e),this.copyPass=e},i.addGammaCorrectionPass=function(){var e=new te.ShaderPass(me.GammaCorrectionShader);this.finalComposer.addPass(e),this.gammaCorrectionPass=e},i.addFXAAPass=function(){var e=this.getSize(),t=e.width,r=e.height,o=new te.ShaderPass(Ue.FXAAShader);this.finalComposer.addPass(o),this.fxaaPass=o,this.setFXAAPassSize(t,r)},i.addSMAAPass=function(){var e=this.getSize(),t=e.width,r=e.height,o=this.options.renderer,u=new he.SMAAPass(t*o.getPixelRatio(),r*o.getPixelRatio());this.finalComposer.addPass(u),this.smaaPass=u},i.addSSAAPass=function(){var e=this.options,t=e.scene,r=e.camera,o=new Ve.SSAARenderPass(t,r,0,0);o.unbiased=!0,o.sampleLevel=1,this.finalComposer.addPass(o),this.ssaaPass=o},i.addBloomPass=function(e){var t=new Je(this,e);t.disable(),this.options.gui&&t.setGui(this.options.gui),this.bloomController=t},i.addOutlinePass=function(e){var t=new rt(this,e);t.disable(),this.options.gui&&t.outlineGui.showGui(this.options.gui),this.outlineController=t},i.addSSRPass=function(e){var t=new lt(this,e);t.disable(),this.options.gui&&t.ssrGui.showGui(this.options.gui),this.ssrController=t},i.getSize=function(){var e=this.options.renderer;return e.getSize(new l.Vector2)},i.enable=function(){this.active||(this.active=!0)},i.disable=function(){!this.active||(this.active=!1)},i.checkCopyPass=function(){var e=this,t=this.finalComposer.passes.some(function(r){return r!==e.renderPass&&r!==e.copyPass?r.enabled:!1});t&&this.copyPass?this.copyPass.enabled=!1:!t&&this.copyPass?this.copyPass.enabled=!0:!t&&!this.copyPass&&this.addCopyPass()},i.setSize=function(e,t){var r,o;this.finalComposer.setSize(e,t),(r=this.bloomController)===null||r===void 0||r.setSize(e,t),(o=this.ssrController)===null||o===void 0||o.setSize(e,t),this.setFXAAPassSize(e,t)},i.setFXAAPassSize=function(e,t){if(!!this.fxaaPass){var r=this.options.renderer,o=r.getPixelRatio();this.fxaaPass.material.uniforms.resolution.value.x=1/(e*o),this.fxaaPass.material.uniforms.resolution.value.y=1/(t*o)}},i.render=function(){var e;if(!!this.active){var t=this.options.scene;(e=this.bloomController)===null||e===void 0||e.render(t),this.finalComposer.render()}},i.dispose=function(){var e,t,r;(e=this.bloomController)===null||e===void 0||e.dispose(),(t=this.outlineController)===null||t===void 0||t.dispose(),(r=this.ssrController)===null||r===void 0||r.dispose(),this.finalComposer.passes.forEach(function(o){var u,a,h;(u=o.fsQuad)===null||u===void 0||u.dispose(),(a=o.fsQuad)===null||a===void 0||(h=a.material)===null||h===void 0||h.dispose()}),this.renderTarget.dispose(),this.copyPass=void 0,this.gammaCorrectionPass=void 0,this.smaaPass=void 0,this.ssaaPass=void 0,this.fxaaPass=void 0,this.bloomController=void 0,this.outlineController=void 0,this.ssrController=void 0},s}(),xe=function(){"use strict";function s(n){j(this,s),this.raycaster=new l.Raycaster,this.installPlugins=new Map,this.event=new N.EventEmitter,this.clock=new l.Clock,this.options=ae()(s.options,n,{isMergeableObject:L.isPlainObject});var e=this.options,t=e.container,r=e.stats,o=e.gui;if(o){var u=new(Y());u.open(!1),this.gui=u}if(r){var a=new(X());a.showPanel(0),a.dom.style.position="absolute",t.appendChild(a.dom),this.stats=a}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),this.clock.getDelta(),this.clock.getElapsedTime()}var i=s.prototype;return i.use=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var u;(u=e).install.apply(u,[this].concat(k(r))),this.installPlugins.set(e,!0)}},i.init=function(){var e=this,t=this.options,r=t.container,o=t.isdev,u=t.axesHelper,a=t.renderer,h=t.scene,C=t.camera,_=this.getSize(),y=_.width,w=_.height,A=new P({isdev:o,width:y,height:w,cameraParams:C});this.gui&&A.setGui(this.gui);var V=A.camera,U=new J({camera:V,sceneParams:h}),Z=U.scene,le=new v({width:y,height:w,scene:Z,camera:V,isdev:o,rendererParams:E((0,G.Z)({},a),{outputEncoding:l.LinearEncoding,antialias:!1})});this.gui&&le.setGui(this.gui);var I=le.renderer;u&&U.addAxesHelper(),this.sceneController=U,this.rendererController=le,this.cameraController=A,r.appendChild(I.domElement);var ue=new ResizeObserver(function(ce){var fe=!0,ye=!1,ze=void 0;try{for(var Ce=ce[Symbol.iterator](),De;!(fe=(De=Ce.next()).done);fe=!0){var mt=De.value,Ge=mt.contentRect;e.handeleResize(Ge.width,Ge.height)}}catch(gt){ye=!0,ze=gt}finally{try{!fe&&Ce.return!=null&&Ce.return()}finally{if(ye)throw ze}}});ue.observe(r),this.resizeObserver=ue},i.initComposer=function(){var e=this.options,t=e.bloom,r=e.outline,o=e.ssr,u=e.renderer,a=e.bloomParams,h=e.outlineParams,C=e.ssrParams,_=e.multisampling,y=u.antialias;y==="msaa"&&!Re&&(y=!1,console.warn("MSAA is not supported on this browser"));var w=new ct({renderer:this.renderer,scene:this.scene,camera:this.camera,gui:this.gui,composerParams:{multisampling:y==="msaa"?_:0,type:l.UnsignedByteType,encoding:u.outputEncoding}});this.composerController=w,y==="ssaa"&&w.addSSAAPass(),o&&w.addSSRPass(C),t&&w.addBloomPass(a),r&&w.addOutlinePass(h),u.outputEncoding===l.sRGBEncoding&&w.addGammaCorrectionPass(),y==="fxaa"?w.addFXAAPass():y==="smaa"&&w.addSMAAPass(),w.checkCopyPass(),this.event.on("passcheck",function(){w.checkCopyPass()})},i.initCSSRenderer=function(){var e=this.options,t=e.container,r=e.css2DRenderer,o=e.css3DRenderer,u=e.css2DRendererParams,a=e.css3DRendererParams;if(r||o){var h=new se(t);r&&h.addRenderer("css2d",u),o&&h.addRenderer("css3d",a),this.cssRendererController=h}},i.initControl=function(){var e=this.options,t=e.control,r=e.mapControl,o=e.controlParams;if(t){var u=new q({camera:this.camera,controlParams:{domElement:(o==null?void 0:o.domElement)||this.renderer.domElement},mapControl:r});this.controlController=u}},i.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},i.handeleResize=function(e,t){var r=this,o=r.rendererController,u=r.cameraController,a=r.composerController,h=r.cssRendererController;u==null||u.setSize(e,t),o==null||o.setSize(e,t),a==null||a.setSize(e,t),h==null||h.setSize(e,t),this.installPlugins.forEach(function(C,_){var y;(y=_.resize)===null||y===void 0||y.call(_,{width:e,height:t})}),this.event.emit("resize",{width:e,height:t})},i.pick=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=this,u=o.raycaster,a=o.options,h=a.container,C=new l.Vector2,_=h.getBoundingClientRect();if(C.x=(e.clientX-_.left)/(_.right-_.left)*2-1,C.y=-((e.clientY-_.top)/(_.bottom-_.top))*2+1,this.camera&&this.scene){u.setFromCamera(C,this.camera);var y=u.intersectObjects(t||this.scene.children,r);if(y.length)return{object:y[0].object,intersects:y}}},i.render=function(){var e,t,r,o,u=this,a=u.renderer,h=u.scene,C=u.camera,_=u.clock;if(!(!a||!h||!C||this.options.staticRender&&!this.cameraController.checkCameraChange())){var y=_.getDelta(),w=_.getElapsedTime();if(a.clear(),(e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(V,U){var Z;(Z=U.update)===null||Z===void 0||Z.call(U,y,w)}),!((t=this.composerController)===null||t===void 0)&&t.active)this.composerController.render();else{var A;(A=this.rendererController)===null||A===void 0||A.render()}(r=this.cssRendererController)===null||r===void 0||r.render(h,C),(o=this.stats)===null||o===void 0||o.update(),this.event.emit("render",{delta:y,elapsed:w})}},i.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},i.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},i.dispose=function(){var e,t,r,o,u,a,h;this.stop(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(C,_){var y;(y=_.dispose)===null||y===void 0||y.call(_)}),(t=this.controlController)===null||t===void 0||t.dispose(),(r=this.cssRendererController)===null||r===void 0||r.dispose(),(o=this.sceneController)===null||o===void 0||o.dispose(),(u=this.composerController)===null||u===void 0||u.dispose(),(a=this.rendererController)===null||a===void 0||a.dispose(),this.controlController=void 0,this.cssRendererController=void 0,(h=this.gui)===null||h===void 0||h.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},S(s,[{key:"renderer",get:function(){return this.rendererController.renderer}},{key:"control",get:function(){var e;return(e=this.controlController)===null||e===void 0?void 0:e.control}},{key:"camera",get:function(){return this.cameraController.camera}},{key:"scene",get:function(){return this.sceneController.scene}}]),s}();xe.options={isdev:ge,stats:ge,gui:ge,axesHelper:ge,control:ge,renderer:E((0,G.Z)({},c),{antialias:Re?"msaa":"smaa"}),staticRender:!1,multisampling:8,scene:T,camera:m,bloom:!1,bloomParams:Ye,outline:!1,outlineParams:tt,css2DRenderer:!1,ssr:!1,ssrParams:ot,css2DRendererParams:(0,G.Z)({},$),css3DRenderer:!1,css3DRendererParams:(0,G.Z)({},$)};function ft(){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(s){return!1}}function be(s,i,n){return ft()?be=Reflect.construct:be=function(t,r,o){var u=[null];u.push.apply(u,r);var a=Function.bind.apply(t,u),h=new a;return o&&Te(h,o.prototype),h},be.apply(null,arguments)}function Le(s,i,n){return be.apply(null,arguments)}var dt=re(620);function ht(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n={};return n.promise=new Promise(function(e,t){n.resolve=e,n.reject=t}),s&&(n.promise=(0,dt.Z)(n.promise,i)),n}var vt=require("three/examples/jsm/renderers/CSS2DRenderer"),Ae=function(s){s&&((0,L.disposeMesh)(s),s.children.forEach(function(i){i.userData.BaseObject_||Ae(i)}))},pt=function(){"use strict";function s(){j(this,s),this.objecttype__="BaseObject",this.userData={},this.pm=ht(),this.visible=!1}var i=s.prototype;return i.init=function(){},i.create=function(){},i.render=function(){},i.update=function(e,t){},i.resize=function(e,t){},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 e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.object3d=Le(l.Mesh,k(t)),this},i.createGroup=function(){return this.object3d=new l.Group,this},i.createPoints=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.object3d=Le(l.Points,k(t)),this},i.createCSS2DObject=function(e){return this.object3d=new vt.CSS2DObject(e),this},i.createCSS3DObject=function(e){return this.object3d=new ve.CSS3DObject(e),this},i.createCSS3DSprite=function(e){return this.object3d=new ve.CSS3DSprite(e),this},i.createSprite=function(e){return this.object3d=new l.Sprite(e),this},i.add=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var o;return(o=this.object3d).add.apply(o,k(t)),this},i.remove=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var o;return(o=this.object3d).remove.apply(o,k(t)),this},i.getSize=function(){var e=new l.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new l.Vector3)}},i.traverse=function(e){e(this),this.children.forEach(function(t){t.traverse(e)})},i.dispose=function(){Ae(this.object3d)},S(s,[{key:"parent",get:function(){var e=this.object3d.parent;return(e==null?void 0:e.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(e){return e.userData.BaseObject_}).filter(function(e){return!!e})}}]),s}()})(),module.exports=Pe})();
@@ -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 kt from"deepmerge";import*as It from"three/examples/jsm/libs/stats.module";import*as Ht from"lil-gui";import*as We 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 ke 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 D=typeof Reflect=="object"?Reflect:null,x=D&&typeof D.apply=="function"?D.apply:function(u,f,m){return Function.prototype.apply.call(u,f,m)},B;D&&typeof D.ownKeys=="function"?B=D.ownKeys:Object.getOwnPropertySymbols?B=function(u){return Object.getOwnPropertyNames(u).concat(Object.getOwnPropertySymbols(u))}:B=function(u){return Object.getOwnPropertyNames(u)};function j(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 S=u==="error",O=this._events;if(O!==void 0)S=S&&O.error===void 0;else if(!S)return!1;if(S){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 S,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),S=R(h),S>0&&w.length>S&&!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,j(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},S=I.bind(m);return S.listener=f,m.wrapFn=S,S}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,S,O,w,J;if(H(f),S=this._events,S===void 0)return this;if(m=S[u],m===void 0)return this;if(m===f||m.listener===f)--this._eventsCount===0?this._events=Object.create(null):(delete S[u],S.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&&(S[u]=m[0]),S.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,S;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(S=0;S<O.length;++S)w=O[S],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(S=f.length-1;S>=0;S--)this.removeListener(u,f[S]);return this};function Q(h,u,f){var m=h._events;if(m===void 0)return[];var S=m[u];return S===void 0?[]:typeof S=="function"?f?[S.listener||S]:[S]:f?Y(S):ae(S,S.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 S(w){h.removeListener(u,O),m(w)}function O(){typeof h.removeListener=="function"&&h.removeListener("error",S),f([].slice.call(arguments))}k(h,u,O,{once:!0}),u!=="error"&&q(h,S,{once:!0})})}function q(h,u,f){typeof h.on=="function"&&k(h,"error",u,f)}function k(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 S(O){m.once&&h.removeEventListener(u,S),f(O)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof h)}},666:function(L){var D=function(x){"use strict";var B=Object.prototype,j=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 k(){}var h={};U(h,G,function(){return this});var u=Object.getPrototypeOf,f=u&&u(u(ve([])));f&&f!==B&&j.call(f,G)&&(h=f);var m=k.prototype=oe.prototype=Object.create(h);q.prototype=k,U(m,"constructor",k),U(k,"constructor",q),q.displayName=U(k,R,"GeneratorFunction");function S(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,k):(p.__proto__=k,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"&&j.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}S(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}S(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(j.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"&&j.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=j.call(E,"catchLoc"),ie=j.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&&j.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=D}catch(x){typeof globalThis=="object"?globalThis.regeneratorRuntime=D:Function("r","regeneratorRuntime = r")(D)}},182:function(L,D,x){x.d(D,{Z:function(){return B}});function B(j){if(j.geometry&&j.geometry.dispose(),j.material){var T=Array.isArray(j.material)?j.material:[j.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,D,x){x.d(D,{wf:function(){return g.Z},PO:function(){return R.Z}});var B=x(666),j=x.n(B),T=null,g=x(182),G=x(949);function H(k){if(k.material){var h=Array.isArray(k.material)?k.material:[k.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=k=>{var h={};return x.d(h,k),h},Q=k=>()=>k,te=c({get:()=>Ne.get,set:()=>Ne.set}),ae=x(620),re=null,Y=null,oe=function(){var k=(0,U.Z)(j().mark(function h(u,f){var m,S,O,w,J,V;return j().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}S=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||(S=J,(0,te.set)(u,(0,I.Z)({},m,J)));case 15:return ne.abrupt("return",S?{url:URL.createObjectURL(S)}:{url:u});case 16:case"end":return ne.stop()}},h)}));return function(u,f){return k.apply(this,arguments)}}(),q=x(977)},975:function(L,D,x){x.d(D,{Z:function(){return j}});function B(T){return Object.prototype.toString.call(T)==="[object Object]"}function j(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,D,x){x.d(D,{Z:function(){return j}});var B=x(42);function j(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,D,x){var B=x(949),j=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(j.has(H))q=j.get(H);else{var k=G&&G.box3||new THREE.Box3;if(!G||!G.box3){var h=H.parameters.shapes.getPoints();k.setFromArray(h.map(function(S){return[S.x,S.y,0]}).flat())}var u=k.getSize(new THREE.Vector3);q={box:k,size:u},j.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],k=R[c*3],h=R[c*3+1],u=R[c*3+2],f=R[Q*3],m=R[Q*3+1],S=R[Q*3+2],O;if(j.has(R))O=j.get(R);else{var w=new THREE.Box3;w.setFromArray(R);var J=w.getSize(new THREE.Vector3);O={box:w,size:J},j.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((k-V.min.x)/Z.x,(u-V.min.z)/Z.z),new THREE.Vector2((f-V.min.x)/Z.x,(S-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,(S-V.min.z)/Z.z)]}}},g=function(){j.clear()}},949:function(L,D,x){var B=T=>{var g={};return x.d(g,T),g},j=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,D,x){x.d(D,{Z:function(){return j}});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 j(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,D,x){x.d(D,{Z:function(){return B}});function B(j,T,g){return T in j?Object.defineProperty(j,T,{value:g,enumerable:!0,configurable:!0,writable:!0}):j[T]=g,j}},42:function(L,D,x){x.d(D,{Z:function(){return j}});var B=x(924);function j(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 D=Ie[L];if(D!==void 0)return D.exports;var x=Ie[L]={exports:{}};return ir[L](x,x.exports,F),x.exports}(function(){F.n=function(L){var D=L&&L.__esModule?function(){return L.default}:function(){return L};return F.d(D,{a:D}),D}})(),function(){F.d=function(L,D){for(var x in D)F.o(D,x)&&!F.o(L,x)&&Object.defineProperty(L,x,{enumerable:!0,get:D[x]})}}(),function(){F.o=function(L,D){return Object.prototype.hasOwnProperty.call(L,D)}}();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 D(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&&D(n.prototype,r),i&&D(n,i),n}var B=F(42);function j(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)):j(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:()=>kt.default}),Y=n=>{var r={};return F.d(r,n),r},oe=n=>()=>n,q=Y({default:()=>It.default}),k=n=>{var r={};return F.d(r,n),r},h=n=>()=>n,u=k({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,y=v.name,A=v.paramMap,N=v.items,W=v.value,K=v.target,ce=s.toLowerCase().indexOf("color")>-1,X,le=typeof W=="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(y||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],A)}),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 y=v();Array.isArray(y)||(y=[y]),y.forEach(function(A){if(!!A)if(P)try{A[o||t].set(a)}catch(N){t!=="color"&&!o&&console.warn("".concat(t," is not a color,set paramMap"))}else A[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},S={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,y=a.outputEncoding,A=a.logarithmicDepthBuffer,N=a.preserveDrawingBuffer,W=new c.WebGLRenderer({context:o,alpha:l,antialias:v,powerPreference:C,logarithmicDepthBuffer:A,preserveDrawingBuffer:N});W.setSize(e,t),W.setPixelRatio(s),W.autoClear=!1,W.toneMapping=m[P],W.toneMappingExposure=b,W.outputEncoding=y,this.renderer=W}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:()=>We.MapControls,OrbitControls:()=>We.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,y=b===void 0?1/0:b,A=e.minY,N=A===void 0?-1/0:A,W=this.limitPanV||new c.Vector3,K=this.control,ce=this.options.camera,X=new c.Vector3(l,N,P),le=new c.Vector3(a,y,v);this.limitPanV=W,W.copy(K.target),K.target.clamp(X,le),W.sub(K.target),ce.position.sub(W)},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(A,N){return se.setFromMatrixPosition(A.matrixWorld),me.setFromMatrixPosition(N.matrixWorld),se.distanceToSquared(me)},e=function(A){var N=[];return A.traverse(function(W){W.isCSS2DObject&&N.push(W)}),N},t=function(A){for(var N=e(A).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}),W=N.length,K=0,ce=N.length;K<ce;K++){var X=N[K].userData.zIndexFix||0;N[K].element.style.zIndex=W-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(y,A){+c.REVISION<144?(y.autoUpdate===!0&&y.updateMatrixWorld(),A.parent===null&&A.updateMatrixWorld()):(y.matrixWorldAutoUpdate===!0&&y.updateMatrixWorld(),A.parent===null&&A.matrixWorldAutoUpdate===!0&&A.updateMatrixWorld()),ie.copy(A.matrixWorldInverse),ue.multiplyMatrices(A.projectionMatrix,ie),b(y,y,A),t(y)},this.setSize=function(y,A){o=y,l=A,s=o/2,v=l/2,P.style.width="".concat(y,"px"),P.style.height="".concat(A,"px")};function b(y,A,N){if(y.isCSS2DObject){ee.setFromMatrixPosition(y.matrixWorld),ee.applyMatrix4(ue);var W=y.visible===!0&&ee.z>=-1&&ee.z<=1&&y.layers.test(N.layers)===!0;if(y.element.style.display=W===!0?"":"none",W===!0){y.onBeforeRender(a,A,N);var K=y.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),y.onAfterRender(a,A,N)}var ce={distanceToCameraSquared:i(N,y)};C.objects.set(y,ce)}for(var X=0,le=y.children.length;X<le;X++)b(y.children[X],A,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,Ae=it()!==!1,ot=`varying vec2 vUv;
2
2
 
3
3
  void main() {
4
4
 
@@ -15,7 +15,7 @@ void main() {
15
15
 
16
16
  gl_FragColor = (texture2D(baseTexture, vUv) + vec4(1.0) * texture2D(bloomTexture, vUv));
17
17
 
18
- }`;function Ce(n,r){return Ce=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ce(n,r)}function Ae(n,r){return Ce(n,r)}function lt(n,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(r&&r.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),r&&Ae(n,r)}function ct(){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(n){return!1}}function we(n){return we=Object.setPrototypeOf?Object.getPrototypeOf:function(i){return i.__proto__||Object.getPrototypeOf(i)},we(n)}function je(n){return we(n)}function ft(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function dt(n){return n&&n.constructor===Symbol?"symbol":typeof n}function ht(n,r){return r&&(dt(r)==="object"||typeof r=="function")?r:ft(n)}function vt(n){var r=ct();return function(){var e=je(n),t;if(r){var a=je(this).constructor;t=Reflect.construct(e,arguments,a)}else t=e.apply(this,arguments);return ht(this,t)}}var pt=n=>{var r={};return F.d(r,n),r},br=n=>()=>n,De=pt({FullScreenQuad:()=>We.FullScreenQuad,Pass:()=>We.Pass}),mt=n=>{var r={};return F.d(r,n),r},Pr=n=>()=>n,ze=mt({LuminosityHighPassShader:()=>er.LuminosityHighPassShader}),Ee=function(n){"use strict";lt(i,n);var r=vt(i);function i(t,a,o,l){L(this,i);var s;s=r.call(this),s.strength=a!==void 0?a:1,s.radius=o,s.threshold=l,s.resolution=t!==void 0?new c.Vector2(t.x,t.y):new c.Vector2(256,256),s.clearColor=new c.Color(0,0,0);var v={minFilter:c.LinearFilter,magFilter:c.LinearFilter,format:c.RGBAFormat};s.renderTargetsHorizontal=[],s.renderTargetsVertical=[],s.nMips=5;var C=Math.round(s.resolution.x/2),P=Math.round(s.resolution.y/2);s.renderTargetBright=new c.WebGLRenderTarget(C,P,v),s.renderTargetBright.texture.name="UnrealBloomPass.bright",s.renderTargetBright.texture.generateMipmaps=!1;for(var b=0;b<s.nMips;b++){var S=new c.WebGLRenderTarget(C,P,v);S.texture.name="UnrealBloomPass.h".concat(b),S.texture.generateMipmaps=!1,s.renderTargetsHorizontal.push(S);var D=new c.WebGLRenderTarget(C,P,v);D.texture.name="UnrealBloomPass.v".concat(b),D.texture.generateMipmaps=!1,s.renderTargetsVertical.push(D),C=Math.round(C/2),P=Math.round(P/2)}ze.LuminosityHighPassShader===void 0&&console.error("THREE.UnrealBloomPass relies on LuminosityHighPassShader");var N=ze.LuminosityHighPassShader;s.highPassUniforms=c.UniformsUtils.clone(N.uniforms),s.highPassUniforms.luminosityThreshold.value=l,s.highPassUniforms.smoothWidth.value=.01,s.materialHighPassFilter=new c.ShaderMaterial({uniforms:s.highPassUniforms,vertexShader:N.vertexShader,fragmentShader:N.fragmentShader,defines:{}}),s.separableBlurMaterials=[];var k=[3,5,7,9,11];C=Math.round(s.resolution.x/2),P=Math.round(s.resolution.y/2);for(var K=0;K<s.nMips;K++)s.separableBlurMaterials.push(s.getSeperableBlurMaterial(k[K])),s.separableBlurMaterials[K].uniforms.texSize.value=new c.Vector2(C,P),C=Math.round(C/2),P=Math.round(P/2);s.compositeMaterial=s.getCompositeMaterial(s.nMips),s.compositeMaterial.uniforms.blurTexture1.value=s.renderTargetsVertical[0].texture,s.compositeMaterial.uniforms.blurTexture2.value=s.renderTargetsVertical[1].texture,s.compositeMaterial.uniforms.blurTexture3.value=s.renderTargetsVertical[2].texture,s.compositeMaterial.uniforms.blurTexture4.value=s.renderTargetsVertical[3].texture,s.compositeMaterial.uniforms.blurTexture5.value=s.renderTargetsVertical[4].texture,s.compositeMaterial.uniforms.bloomStrength.value=a,s.compositeMaterial.uniforms.bloomRadius.value=.1,s.compositeMaterial.needsUpdate=!0;var ce=[1,.8,.6,.4,.2];s.compositeMaterial.uniforms.bloomFactors.value=ce,s.bloomTintColors=[new c.Vector3(1,1,1),new c.Vector3(1,1,1),new c.Vector3(1,1,1),new c.Vector3(1,1,1),new c.Vector3(1,1,1)],s.compositeMaterial.uniforms.bloomTintColors.value=s.bloomTintColors,xe.CopyShader===void 0&&console.error("THREE.UnrealBloomPass relies on CopyShader");var X=xe.CopyShader;return s.copyUniforms=c.UniformsUtils.clone(X.uniforms),s.copyUniforms.opacity.value=1,s.materialCopy=new c.ShaderMaterial({uniforms:s.copyUniforms,vertexShader:X.vertexShader,fragmentShader:X.fragmentShader,blending:c.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0}),s.enabled=!0,s.needsSwap=!1,s._oldClearColor=new c.Color,s.oldClearAlpha=1,s.basic=new c.MeshBasicMaterial,s.fsQuad=new De.FullScreenQuad(void 0),s}var e=i.prototype;return e.dispose=function(){for(var a=0;a<this.renderTargetsHorizontal.length;a++)this.renderTargetsHorizontal[a].dispose();for(var o=0;o<this.renderTargetsVertical.length;o++)this.renderTargetsVertical[o].dispose();this.renderTargetBright.dispose()},e.setSize=function(a,o){var l=Math.round(a/2),s=Math.round(o/2);this.renderTargetBright.setSize(l,s);for(var v=0;v<this.nMips;v++)this.renderTargetsHorizontal[v].setSize(l,s),this.renderTargetsVertical[v].setSize(l,s),this.separableBlurMaterials[v].uniforms.texSize.value=new c.Vector2(l,s),l=Math.round(l/2),s=Math.round(s/2)},e.render=function(a,o,l,s,v){a.getClearColor(this._oldClearColor),this.oldClearAlpha=a.getClearAlpha();var C=a.autoClear;a.autoClear=!1,a.setClearColor(this.clearColor,0),v&&a.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=l.texture,a.setRenderTarget(null),a.clear(),this.fsQuad.render(a)),this.highPassUniforms.tDiffuse.value=l.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,a.setRenderTarget(this.renderTargetBright),a.clear(),this.fsQuad.render(a);for(var P=this.renderTargetBright,b=0;b<this.nMips;b++)this.fsQuad.material=this.separableBlurMaterials[b],this.separableBlurMaterials[b].uniforms.colorTexture.value=P.texture,this.separableBlurMaterials[b].uniforms.direction.value=i.BlurDirectionX,a.setRenderTarget(this.renderTargetsHorizontal[b]),a.clear(),this.fsQuad.render(a),this.separableBlurMaterials[b].uniforms.colorTexture.value=this.renderTargetsHorizontal[b].texture,this.separableBlurMaterials[b].uniforms.direction.value=i.BlurDirectionY,a.setRenderTarget(this.renderTargetsVertical[b]),a.clear(),this.fsQuad.render(a),P=this.renderTargetsVertical[b];this.fsQuad.material=this.compositeMaterial,this.compositeMaterial.uniforms.bloomStrength.value=this.strength,this.compositeMaterial.uniforms.bloomRadius.value=this.radius,this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,a.setRenderTarget(this.renderTargetsHorizontal[0]),a.clear(),this.fsQuad.render(a),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,v&&a.state.buffers.stencil.setTest(!0),this.renderToScreen?(a.setRenderTarget(null),this.fsQuad.render(a)):(a.setRenderTarget(l),this.fsQuad.render(a)),a.setClearColor(this._oldClearColor,this.oldClearAlpha),a.autoClear=C},e.getSeperableBlurMaterial=function(a){return new c.ShaderMaterial({defines:{KERNEL_RADIUS:a,SIGMA:a},uniforms:{colorTexture:{value:null},texSize:{value:new c.Vector2(.5,.5)},direction:{value:new c.Vector2(.5,.5)}},vertexShader:`varying vec2 vUv;
18
+ }`;function Ce(n,r){return Ce=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ce(n,r)}function Le(n,r){return Ce(n,r)}function lt(n,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(r&&r.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),r&&Le(n,r)}function ct(){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(n){return!1}}function we(n){return we=Object.setPrototypeOf?Object.getPrototypeOf:function(i){return i.__proto__||Object.getPrototypeOf(i)},we(n)}function je(n){return we(n)}function ft(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function dt(n){return n&&n.constructor===Symbol?"symbol":typeof n}function ht(n,r){return r&&(dt(r)==="object"||typeof r=="function")?r:ft(n)}function vt(n){var r=ct();return function(){var e=je(n),t;if(r){var a=je(this).constructor;t=Reflect.construct(e,arguments,a)}else t=e.apply(this,arguments);return ht(this,t)}}var pt=n=>{var r={};return F.d(r,n),r},br=n=>()=>n,De=pt({FullScreenQuad:()=>ke.FullScreenQuad,Pass:()=>ke.Pass}),mt=n=>{var r={};return F.d(r,n),r},Pr=n=>()=>n,ze=mt({LuminosityHighPassShader:()=>er.LuminosityHighPassShader}),Ee=function(n){"use strict";lt(i,n);var r=vt(i);function i(t,a,o,l){L(this,i);var s;s=r.call(this),s.strength=a!==void 0?a:1,s.radius=o,s.threshold=l,s.resolution=t!==void 0?new c.Vector2(t.x,t.y):new c.Vector2(256,256),s.clearColor=new c.Color(0,0,0);var v={minFilter:c.LinearFilter,magFilter:c.LinearFilter,format:c.RGBAFormat};s.renderTargetsHorizontal=[],s.renderTargetsVertical=[],s.nMips=5;var C=Math.round(s.resolution.x/2),P=Math.round(s.resolution.y/2);s.renderTargetBright=new c.WebGLRenderTarget(C,P,v),s.renderTargetBright.texture.name="UnrealBloomPass.bright",s.renderTargetBright.texture.generateMipmaps=!1;for(var b=0;b<s.nMips;b++){var y=new c.WebGLRenderTarget(C,P,v);y.texture.name="UnrealBloomPass.h".concat(b),y.texture.generateMipmaps=!1,s.renderTargetsHorizontal.push(y);var A=new c.WebGLRenderTarget(C,P,v);A.texture.name="UnrealBloomPass.v".concat(b),A.texture.generateMipmaps=!1,s.renderTargetsVertical.push(A),C=Math.round(C/2),P=Math.round(P/2)}ze.LuminosityHighPassShader===void 0&&console.error("THREE.UnrealBloomPass relies on LuminosityHighPassShader");var N=ze.LuminosityHighPassShader;s.highPassUniforms=c.UniformsUtils.clone(N.uniforms),s.highPassUniforms.luminosityThreshold.value=l,s.highPassUniforms.smoothWidth.value=.01,s.materialHighPassFilter=new c.ShaderMaterial({uniforms:s.highPassUniforms,vertexShader:N.vertexShader,fragmentShader:N.fragmentShader,defines:{}}),s.separableBlurMaterials=[];var W=[3,5,7,9,11];C=Math.round(s.resolution.x/2),P=Math.round(s.resolution.y/2);for(var K=0;K<s.nMips;K++)s.separableBlurMaterials.push(s.getSeperableBlurMaterial(W[K])),s.separableBlurMaterials[K].uniforms.texSize.value=new c.Vector2(C,P),C=Math.round(C/2),P=Math.round(P/2);s.compositeMaterial=s.getCompositeMaterial(s.nMips),s.compositeMaterial.uniforms.blurTexture1.value=s.renderTargetsVertical[0].texture,s.compositeMaterial.uniforms.blurTexture2.value=s.renderTargetsVertical[1].texture,s.compositeMaterial.uniforms.blurTexture3.value=s.renderTargetsVertical[2].texture,s.compositeMaterial.uniforms.blurTexture4.value=s.renderTargetsVertical[3].texture,s.compositeMaterial.uniforms.blurTexture5.value=s.renderTargetsVertical[4].texture,s.compositeMaterial.uniforms.bloomStrength.value=a,s.compositeMaterial.uniforms.bloomRadius.value=.1,s.compositeMaterial.needsUpdate=!0;var ce=[1,.8,.6,.4,.2];s.compositeMaterial.uniforms.bloomFactors.value=ce,s.bloomTintColors=[new c.Vector3(1,1,1),new c.Vector3(1,1,1),new c.Vector3(1,1,1),new c.Vector3(1,1,1),new c.Vector3(1,1,1)],s.compositeMaterial.uniforms.bloomTintColors.value=s.bloomTintColors,xe.CopyShader===void 0&&console.error("THREE.UnrealBloomPass relies on CopyShader");var X=xe.CopyShader;return s.copyUniforms=c.UniformsUtils.clone(X.uniforms),s.copyUniforms.opacity.value=1,s.materialCopy=new c.ShaderMaterial({uniforms:s.copyUniforms,vertexShader:X.vertexShader,fragmentShader:X.fragmentShader,blending:c.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0}),s.enabled=!0,s.needsSwap=!1,s._oldClearColor=new c.Color,s.oldClearAlpha=1,s.basic=new c.MeshBasicMaterial,s.fsQuad=new De.FullScreenQuad(void 0),s}var e=i.prototype;return e.dispose=function(){for(var a=0;a<this.renderTargetsHorizontal.length;a++)this.renderTargetsHorizontal[a].dispose();for(var o=0;o<this.renderTargetsVertical.length;o++)this.renderTargetsVertical[o].dispose();this.renderTargetBright.dispose()},e.setSize=function(a,o){var l=Math.round(a/2),s=Math.round(o/2);this.renderTargetBright.setSize(l,s);for(var v=0;v<this.nMips;v++)this.renderTargetsHorizontal[v].setSize(l,s),this.renderTargetsVertical[v].setSize(l,s),this.separableBlurMaterials[v].uniforms.texSize.value=new c.Vector2(l,s),l=Math.round(l/2),s=Math.round(s/2)},e.render=function(a,o,l,s,v){a.getClearColor(this._oldClearColor),this.oldClearAlpha=a.getClearAlpha();var C=a.autoClear;a.autoClear=!1,a.setClearColor(this.clearColor,0),v&&a.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=l.texture,a.setRenderTarget(null),a.clear(),this.fsQuad.render(a)),this.highPassUniforms.tDiffuse.value=l.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,a.setRenderTarget(this.renderTargetBright),a.clear(),this.fsQuad.render(a);for(var P=this.renderTargetBright,b=0;b<this.nMips;b++)this.fsQuad.material=this.separableBlurMaterials[b],this.separableBlurMaterials[b].uniforms.colorTexture.value=P.texture,this.separableBlurMaterials[b].uniforms.direction.value=i.BlurDirectionX,a.setRenderTarget(this.renderTargetsHorizontal[b]),a.clear(),this.fsQuad.render(a),this.separableBlurMaterials[b].uniforms.colorTexture.value=this.renderTargetsHorizontal[b].texture,this.separableBlurMaterials[b].uniforms.direction.value=i.BlurDirectionY,a.setRenderTarget(this.renderTargetsVertical[b]),a.clear(),this.fsQuad.render(a),P=this.renderTargetsVertical[b];this.fsQuad.material=this.compositeMaterial,this.compositeMaterial.uniforms.bloomStrength.value=this.strength,this.compositeMaterial.uniforms.bloomRadius.value=this.radius,this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,a.setRenderTarget(this.renderTargetsHorizontal[0]),a.clear(),this.fsQuad.render(a),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,v&&a.state.buffers.stencil.setTest(!0),this.renderToScreen?(a.setRenderTarget(null),this.fsQuad.render(a)):(a.setRenderTarget(l),this.fsQuad.render(a)),a.setClearColor(this._oldClearColor,this.oldClearAlpha),a.autoClear=C},e.getSeperableBlurMaterial=function(a){return new c.ShaderMaterial({defines:{KERNEL_RADIUS:a,SIGMA:a},uniforms:{colorTexture:{value:null},texSize:{value:new c.Vector2(.5,.5)},direction:{value:new c.Vector2(.5,.5)}},vertexShader:`varying vec2 vUv;
19
19
  void main() {
20
20
  vUv = uv;
21
21
  gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
@@ -54,4 +54,4 @@ void main() {
54
54
  lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +
55
55
  lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +
56
56
  lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );
57
- }`})},i}(De.Pass);Ee.BlurDirectionX=new c.Vector2(1,0),Ee.BlurDirectionY=new c.Vector2(0,1);var gt={threshold:.2,strength:.5,radius:0},_t=new c.MeshBasicMaterial({color:"black"}),bt=new c.SpriteMaterial({color:"#000"}),Pt=function(){"use strict";function n(i,e){L(this,n),this.materials={},this.bloomLayer=new c.Layers,this.active=!0,this.composerController=i,this.options=e;var t=i.renderer,a=i.renderPass,o=i.finalComposer,l=i.getSize(),s=l.width,v=l.height,C=new Ee(new c.Vector2(s,v),e.strength,e.radius,e.threshold);this.bloomPass=C;var P=new Te.EffectComposer(t);P.renderToScreen=!1,P.addPass(a),P.addPass(this.bloomPass),this.bloomComposer=P,this.bloomLayer.set(st);var b=new c.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:P.renderTarget2.texture}},vertexShader:ot,fragmentShader:ut,defines:{}}),S=new be.ShaderPass(b,"baseTexture");S.needsSwap=!0,this.finalPass=S,o.addPass(S)}var r=n.prototype;return r.enable=function(){this.active||(this.finalPass.enabled=!0,this.bloomPass.enabled=!0,this.active=!0)},r.disable=function(){!this.active||(this.finalPass.enabled=!1,this.bloomPass.enabled=!1,this.active=!1)},r.render=function(e){if(!!this.active){var t=this,a=t.bloomComposer,o=t.bloomLayer,l=t.materials;e.traverse(function(s){var v=s;v.material&&o.test(v.layers)===!1&&(l[v.uuid]=v.material,v.material=v.isSprite?bt:_t)}),a.render(),e.traverse(function(s){var v=s;l[v.uuid]&&(v.material=l[v.uuid],delete l[v.uuid])})}},r.setSize=function(e,t){this.bloomComposer.setSize(e,t)},r.setGui=function(e){var t=this,a=new f({bloom:{threshold:{value:this.options.threshold,min:0,max:1,target:function(){return t.bloomPass}},strength:{value:this.options.strength,min:0,max:10,target:function(){return t.bloomPass}},radius:{value:this.options.radius,min:0,max:2,step:.01,target:function(){return t.bloomPass}}}});a.showGui(e)},r.dispose=function(){this.bloomPass.dispose(),this.materials={}},n}(),yt=n=>{var r={};return F.d(r,n),r},yr=n=>()=>n,St=yt({OutlinePass:()=>tr.OutlinePass}),xt={edgeStrength:3,edgeGlow:4,edgeThickness:1,pulsePeriod:0,rotate:!1,usePatternTexture:!1,visibleEdgeColor:"#5ee8e8",hiddenEdgeColor:"#190a05"},Ct=function(){"use strict";function n(i,e){L(this,n),this.selectedObjects=[],this.active=!0,this.composerController=i,this.options=e;var t=i.scene,a=i.camera,o=i.finalComposer,l=i.getSize(),s=l.width,v=l.height,C=new St.OutlinePass(new c.Vector2(s,v),t,a);C.selectedObjects=this.selectedObjects,this.outlinePass=C,o.addPass(C),this.setGui()}var r=n.prototype;return r.enable=function(){this.active||(this.outlinePass.enabled=!0,this.active=!0)},r.disable=function(){!this.active||(this.outlinePass.enabled=!1,this.active=!1)},r.setGui=function(){var e=this,t=new f({outline:{edgeStrength:{value:this.options.edgeStrength,min:.01,max:10,step:.01,target:function(){return e.outlinePass}},edgeGlow:{value:this.options.edgeGlow,min:0,max:10,step:.01,target:function(){return e.outlinePass}},edgeThickness:{value:this.options.edgeThickness,min:0,max:4,step:.01,target:function(){return e.outlinePass}},pulsePeriod:{value:this.options.pulsePeriod,min:0,max:4,step:.01,target:function(){return e.outlinePass}},usePatternTexture:{value:this.options.usePatternTexture,target:function(){return e.outlinePass}},visibleEdgeColor:{value:this.options.visibleEdgeColor,target:function(){return e.outlinePass}},hiddenEdgeColor:{value:this.options.hiddenEdgeColor,target:function(){return e.outlinePass}}}});t.setTargetValueByParams(),this.outlineGui=t},r.dispose=function(){this.outlinePass.dispose(),this.selectedObjects=[]},n}();function wt(n,r){if(n==null)return{};var i={},e=Object.keys(n),t,a;for(a=0;a<e.length;a++)t=e[a],!(r.indexOf(t)>=0)&&(i[t]=n[t]);return i}function Et(n,r){if(n==null)return{};var i=wt(n,r),e,t;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(t=0;t<a.length;t++)e=a[t],!(r.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(n,e)||(i[e]=n[e]))}return i}var Rt=n=>{var r={};return F.d(r,n),r},Sr=n=>()=>n,Ot=Rt({SSRPass:()=>rr.SSRPass}),Mt=n=>{var r={};return F.d(r,n),r},xr=n=>()=>n,Tt=Mt({ReflectorForSSRPass:()=>nr.ReflectorForSSRPass}),Lt={maxDistance:10,selects:!0},At={width:1,height:1,clipBias:3e-4,color:8947848,useDepthTexture:!0},jt=function(){"use strict";function n(i,e){L(this,n),this.selectedObjects=[],this.active=!0,this.composerController=i,this.options=e;var t=i.scene,a=i.camera,o=i.renderer,l=i.finalComposer,s=i.getSize(),v=s.width,C=s.height,P=new Ot.SSRPass({renderer:o,scene:t,camera:a,width:v,height:C,groundReflector:null,selects:this.selectedObjects});this.ssrPass=P,l.addPass(P),this.setGui()}var r=n.prototype;return r.addGroundReflector=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=(0,B.Z)({},At,e),a=t.width,o=t.height,l=Et(t,["width","height"]),s=this.composerController,v=s.scene,C=s.getSize(),P=new c.PlaneGeometry(a,o),b=new Tt.ReflectorForSSRPass(P,T((0,B.Z)({},l),{textureWidth:C.width,textureHeight:C.height}));b.material.depthWrite=!1,b.rotation.x=-Math.PI/2,b.visible=!1,v.add(b),this.ssrPass.groundReflector=this.groundReflector,this.groundReflector=b},r.removeaGroundReflector=function(){this.ssrPass.groundReflector=null,this.groundReflector=void 0},r.enable=function(){this.active||(this.ssrPass.enabled=!0,this.active=!0)},r.disable=function(){!this.active||(this.ssrPass.enabled=!1,this.active=!1)},r.setSize=function(e,t){var a=this.groundReflector;a&&(a.getRenderTarget().setSize(e,t),a.resolution.set(e,t))},r.setGui=function(){var e=this,t=new f({ssr:{thickness:{value:.018,min:0,max:.1,step:1e-4,target:function(){return e.ssrPass}},infiniteThick:{value:!1,target:function(){return e.ssrPass}},fresnel:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},distanceAttenuation:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},selects:{value:this.options.selects,onChange:function(a){a?e.ssrPass.selects=e.selectedObjects:e.ssrPass.selects=null}},maxDistance:{value:this.options.maxDistance,min:0,max:100,step:.001,target:function(){return[e.ssrPass,e.groundReflector]}},opacity:{value:1,min:0,max:1,step:.01,target:function(){return[e.ssrPass,e.groundReflector]}}}});t.setTargetValueByParams(),this.ssrGui=t},r.dispose=function(){this.ssrPass.dispose(),this.selectedObjects=[]},n}(),Dt=function(){"use strict";function n(i){L(this,n),this.active=!0,this.options=i;var e=i.renderer,t=i.scene,a=i.camera,o=this.createRenderTarget(),l=new Te.EffectComposer(e,o);l.setPixelRatio(e.getPixelRatio()),this.finalComposer=l,this.addRenderPasss(),this.renderer=e,this.scene=t,this.renderTarget=o,this.camera=a}var r=n.prototype;return r.createRenderTarget=function(){var e=this.options.composerParams,t=e.multisampling,a=e.type,o=e.encoding,l=this.getSize(),s={minFilter:c.LinearFilter,magFilter:c.LinearFilter,format:c.RGBAFormat,encoding:o,type:a},v;if(+c.REVISION<138&&t>0){var C=new c.WebGLMultisampleRenderTarget(l.width,l.height,s);C.samples=t,v=C}else if(+c.REVISION>=138&&t>0){var P=new c.WebGLRenderTarget(l.width,l.height,T((0,B.Z)({},s),{samples:t}));v=P}else{var b=new c.WebGLRenderTarget(l.width,l.height,s);v=b}return v.texture.name="EffectComposer.rt1",v},r.addRenderPasss=function(){var e=this.options,t=e.scene,a=e.camera,o=new Ze.RenderPass(t,a);this.finalComposer.addPass(o),this.renderPass=o},r.addCopyPass=function(){var e=new be.ShaderPass(xe.CopyShader);this.finalComposer.addPass(e),this.copyPass=e},r.addGammaCorrectionPass=function(){var e=new be.ShaderPass(Je.GammaCorrectionShader);this.finalComposer.addPass(e),this.gammaCorrectionPass=e},r.addFXAAPass=function(){var e=this.getSize(),t=e.width,a=e.height,o=new be.ShaderPass(at.FXAAShader);this.finalComposer.addPass(o),this.fxaaPass=o,this.setFXAAPassSize(t,a)},r.addSMAAPass=function(){var e=this.getSize(),t=e.width,a=e.height,o=this.options.renderer,l=new et.SMAAPass(t*o.getPixelRatio(),a*o.getPixelRatio());this.finalComposer.addPass(l),this.smaaPass=l},r.addSSAAPass=function(){var e=this.options,t=e.scene,a=e.camera,o=new rt.SSAARenderPass(t,a,0,0);o.unbiased=!0,o.sampleLevel=1,this.finalComposer.addPass(o),this.ssaaPass=o},r.addBloomPass=function(e){var t=new Pt(this,e);t.disable(),this.options.gui&&t.setGui(this.options.gui),this.bloomController=t},r.addOutlinePass=function(e){var t=new Ct(this,e);t.disable(),this.options.gui&&t.outlineGui.showGui(this.options.gui),this.outlineController=t},r.addSSRPass=function(e){var t=new jt(this,e);t.disable(),this.options.gui&&t.ssrGui.showGui(this.options.gui),this.ssrController=t},r.getSize=function(){var e=this.options.renderer;return e.getSize(new c.Vector2)},r.enable=function(){this.active||(this.active=!0)},r.disable=function(){!this.active||(this.active=!1)},r.checkCopyPass=function(){var e=this,t=this.finalComposer.passes.some(function(a){return a!==e.renderPass&&a!==e.copyPass?a.enabled:!1});t&&this.copyPass?this.copyPass.enabled=!1:!t&&this.copyPass?this.copyPass.enabled=!0:!t&&!this.copyPass&&this.addCopyPass()},r.setSize=function(e,t){var a,o;this.finalComposer.setSize(e,t),(a=this.bloomController)===null||a===void 0||a.setSize(e,t),(o=this.ssrController)===null||o===void 0||o.setSize(e,t),this.setFXAAPassSize(e,t)},r.setFXAAPassSize=function(e,t){if(!!this.fxaaPass){var a=this.options.renderer,o=a.getPixelRatio();this.fxaaPass.material.uniforms.resolution.value.x=1/(e*o),this.fxaaPass.material.uniforms.resolution.value.y=1/(t*o)}},r.render=function(){var e;if(!!this.active){var t=this.options.scene;(e=this.bloomController)===null||e===void 0||e.render(t),this.finalComposer.render()}},r.dispose=function(){var e,t,a;(e=this.bloomController)===null||e===void 0||e.dispose(),(t=this.outlineController)===null||t===void 0||t.dispose(),(a=this.ssrController)===null||a===void 0||a.dispose(),this.finalComposer.passes.forEach(function(o){var l,s,v;(l=o.fsQuad)===null||l===void 0||l.dispose(),(s=o.fsQuad)===null||s===void 0||(v=s.material)===null||v===void 0||v.dispose()}),this.renderTarget.dispose(),this.copyPass=void 0,this.gammaCorrectionPass=void 0,this.smaaPass=void 0,this.ssaaPass=void 0,this.fxaaPass=void 0,this.bloomController=void 0,this.outlineController=void 0,this.ssrController=void 0},n}(),Re=function(){"use strict";function n(i){L(this,n),this.raycaster=new c.Raycaster,this.installPlugins=new Map,this.event=new Q.EventEmitter,this.clock=new c.Clock,this.options=(0,re.default)(n.options,i,{isMergeableObject:V.PO});var e=this.options,t=e.container,a=e.stats,o=e.gui;if(o){var l=new u.default;l.open(!1),this.gui=l}if(a){var s=new q.default;s.showPanel(0),s.dom.style.position="absolute",t.appendChild(s.dom),this.stats=s}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),this.clock.getDelta(),this.clock.getElapsedTime()}var r=n.prototype;return r.use=function(e){for(var t=arguments.length,a=new Array(t>1?t-1:0),o=1;o<t;o++)a[o-1]=arguments[o];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var l;(l=e).install.apply(l,[this].concat(I(a))),this.installPlugins.set(e,!0)}},r.init=function(){var e=this,t=this.options,a=t.container,o=t.isdev,l=t.axesHelper,s=t.renderer,v=t.scene,C=t.camera,P=this.getSize(),b=P.width,S=P.height,D=new J({isdev:o,width:b,height:S,cameraParams:C});this.gui&&D.setGui(this.gui);var N=D.camera,k=new ne({camera:N,sceneParams:v}),K=k.scene,ce=new O({width:b,height:S,scene:K,camera:N,isdev:o,rendererParams:T((0,B.Z)({},s),{outputEncoding:c.LinearEncoding,antialias:!1})});this.gui&&ce.setGui(this.gui);var X=ce.renderer;l&&k.addAxesHelper(),this.sceneController=k,this.rendererController=ce,this.cameraController=D,a.appendChild(X.domElement);var le=new ResizeObserver(function(de){var he=!0,ye=!1,Ue=void 0;try{for(var Oe=de[Symbol.iterator](),Fe;!(he=(Fe=Oe.next()).done);he=!0){var Nt=Fe.value,Ve=Nt.contentRect;e.handeleResize(Ve.width,Ve.height)}}catch(kt){ye=!0,Ue=kt}finally{try{!he&&Oe.return!=null&&Oe.return()}finally{if(ye)throw Ue}}});le.observe(a),this.resizeObserver=le},r.initComposer=function(){var e=this.options,t=e.bloom,a=e.outline,o=e.ssr,l=e.renderer,s=e.bloomParams,v=e.outlineParams,C=e.ssrParams,P=e.multisampling,b=l.antialias;b==="msaa"&&!Le&&(b=!1,console.warn("MSAA is not supported on this browser"));var S=new Dt({renderer:this.renderer,scene:this.scene,camera:this.camera,gui:this.gui,composerParams:{multisampling:b==="msaa"?P:0,type:c.UnsignedByteType,encoding:l.outputEncoding}});this.composerController=S,b==="ssaa"&&S.addSSAAPass(),o&&S.addSSRPass(C),t&&S.addBloomPass(s),a&&S.addOutlinePass(v),l.outputEncoding===c.sRGBEncoding&&S.addGammaCorrectionPass(),b==="fxaa"?S.addFXAAPass():b==="smaa"&&S.addSMAAPass(),S.checkCopyPass(),this.event.on("passcheck",function(){S.checkCopyPass()})},r.initCSSRenderer=function(){var e=this.options,t=e.container,a=e.css2DRenderer,o=e.css3DRenderer,l=e.css2DRendererParams,s=e.css3DRendererParams;if(a||o){var v=new He(t);a&&v.addRenderer("css2d",l),o&&v.addRenderer("css3d",s),this.cssRendererController=v}},r.initControl=function(){var e=this.options,t=e.control,a=e.mapControl,o=e.controlParams;if(t){var l=new _({camera:this.camera,controlParams:{domElement:(o==null?void 0:o.domElement)||this.renderer.domElement},mapControl:a});this.controlController=l}},r.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},r.handeleResize=function(e,t){var a=this,o=a.rendererController,l=a.cameraController,s=a.composerController,v=a.cssRendererController;l==null||l.setSize(e,t),o==null||o.setSize(e,t),s==null||s.setSize(e,t),v==null||v.setSize(e,t),this.installPlugins.forEach(function(C,P){var b;(b=P.resize)===null||b===void 0||b.call(P,{width:e,height:t})}),this.event.emit("resize",{width:e,height:t})},r.pick=function(e,t){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=this,l=o.raycaster,s=o.options,v=s.container,C=new c.Vector2,P=v.getBoundingClientRect();if(C.x=(e.clientX-P.left)/(P.right-P.left)*2-1,C.y=-((e.clientY-P.top)/(P.bottom-P.top))*2+1,this.camera&&this.scene){l.setFromCamera(C,this.camera);var b=l.intersectObjects(t||this.scene.children,a);if(b.length)return{object:b[0].object,intersects:b}}},r.render=function(){var e,t,a,o,l=this,s=l.renderer,v=l.scene,C=l.camera,P=l.clock;if(!(!s||!v||!C||this.options.staticRender&&!this.cameraController.checkCameraChange())){var b=P.getDelta(),S=P.getElapsedTime();if(s.clear(),(e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(N,k){var K;(K=k.update)===null||K===void 0||K.call(k,b,S)}),!((t=this.composerController)===null||t===void 0)&&t.active)this.composerController.render();else{var D;(D=this.rendererController)===null||D===void 0||D.render()}(a=this.cssRendererController)===null||a===void 0||a.render(v,C),(o=this.stats)===null||o===void 0||o.update(),this.event.emit("render",{delta:b,elapsed:S})}},r.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},r.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},r.dispose=function(){var e,t,a,o,l,s,v;this.stop(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(C,P){var b;(b=P.dispose)===null||b===void 0||b.call(P)}),(t=this.controlController)===null||t===void 0||t.dispose(),(a=this.cssRendererController)===null||a===void 0||a.dispose(),(o=this.sceneController)===null||o===void 0||o.dispose(),(l=this.composerController)===null||l===void 0||l.dispose(),(s=this.rendererController)===null||s===void 0||s.dispose(),this.controlController=void 0,this.cssRendererController=void 0,(v=this.gui)===null||v===void 0||v.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},x(n,[{key:"renderer",get:function(){return this.rendererController.renderer}},{key:"control",get:function(){var e;return(e=this.controlController)===null||e===void 0?void 0:e.control}},{key:"camera",get:function(){return this.cameraController.camera}},{key:"scene",get:function(){return this.sceneController.scene}}]),n}();Re.options={isdev:ge,stats:ge,gui:ge,axesHelper:ge,control:ge,renderer:T((0,B.Z)({},y),{antialias:Le?"msaa":"smaa"}),staticRender:!1,multisampling:8,scene:Z,camera:w,bloom:!1,bloomParams:gt,outline:!1,outlineParams:xt,css2DRenderer:!1,ssr:!1,ssrParams:Lt,css2DRendererParams:(0,B.Z)({},fe),css3DRenderer:!1,css3DRendererParams:(0,B.Z)({},fe)};function zt(){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(n){return!1}}function Pe(n,r,i){return zt()?Pe=Reflect.construct:Pe=function(t,a,o){var l=[null];l.push.apply(l,a);var s=Function.bind.apply(t,l),v=new s;return o&&Ae(v,o.prototype),v},Pe.apply(null,arguments)}function Be(n,r,i){return Pe.apply(null,arguments)}var Bt=F(620);function Gt(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i={};return i.promise=new Promise(function(e,t){i.resolve=e,i.reject=t}),n&&(i.promise=(0,Bt.Z)(i.promise,r)),i}var Ut=n=>{var r={};return F.d(r,n),r},Cr=n=>()=>n,Ft=Ut({CSS2DObject:()=>ar.CSS2DObject}),Ge=function(n){n&&((0,V.wf)(n),n.children.forEach(function(r){r.userData.BaseObject_||Ge(r)}))},Vt=function(){"use strict";function n(){L(this,n),this.objecttype__="BaseObject",this.userData={},this.pm=Gt(),this.visible=!1}var r=n.prototype;return r.init=function(){},r.create=function(){},r.render=function(){},r.update=function(e,t){},r.resize=function(e,t){},r.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},r.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},r.isVisible=function(){return this.visible},r.createMesh=function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return this.object3d=Be(c.Mesh,I(t)),this},r.createGroup=function(){return this.object3d=new c.Group,this},r.createPoints=function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return this.object3d=Be(c.Points,I(t)),this},r.createCSS2DObject=function(e){return this.object3d=new Ft.CSS2DObject(e),this},r.createCSS3DObject=function(e){return this.object3d=new $.CSS3DObject(e),this},r.createCSS3DSprite=function(e){return this.object3d=new $.CSS3DSprite(e),this},r.createSprite=function(e){return this.object3d=new c.Sprite(e),this},r.add=function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];var o;return(o=this.object3d).add.apply(o,I(t)),this},r.remove=function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];var o;return(o=this.object3d).remove.apply(o,I(t)),this},r.getSize=function(){var e=new c.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new c.Vector3)}},r.traverse=function(e){e(this),this.children.forEach(function(t){t.traverse(e)})},r.dispose=function(){Ge(this.object3d)},x(n,[{key:"parent",get:function(){var e=this.object3d.parent;return(e==null?void 0:e.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(e){return e.userData.BaseObject_}).filter(function(e){return!!e})}}]),n}()})();var sr=_e.L6,or=_e.sb,ur=_e.z,lr=_e.ZP;export{sr as BaseObject,or as GUIObject,ur as Pencil,lr as default};
57
+ }`})},i}(De.Pass);Ee.BlurDirectionX=new c.Vector2(1,0),Ee.BlurDirectionY=new c.Vector2(0,1);var gt={threshold:.2,strength:.5,radius:0},_t=new c.MeshBasicMaterial({color:"black"}),bt=new c.SpriteMaterial({color:"#000"}),Pt=function(){"use strict";function n(i,e){L(this,n),this.materials={},this.bloomLayer=new c.Layers,this.active=!0,this.composerController=i,this.options=e;var t=i.renderer,a=i.renderPass,o=i.finalComposer,l=i.getSize(),s=l.width,v=l.height,C=new Ee(new c.Vector2(s,v),e.strength,e.radius,e.threshold);this.bloomPass=C;var P=new Te.EffectComposer(t);P.renderToScreen=!1,P.addPass(a),P.addPass(this.bloomPass),this.bloomComposer=P,this.bloomLayer.set(st);var b=new c.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:P.renderTarget2.texture}},vertexShader:ot,fragmentShader:ut,defines:{}}),y=new be.ShaderPass(b,"baseTexture");y.needsSwap=!0,this.finalPass=y,o.addPass(y)}var r=n.prototype;return r.enable=function(){this.active||(this.finalPass.enabled=!0,this.bloomPass.enabled=!0,this.active=!0)},r.disable=function(){!this.active||(this.finalPass.enabled=!1,this.bloomPass.enabled=!1,this.active=!1)},r.render=function(e){if(!!this.active){var t=this,a=t.bloomComposer,o=t.bloomLayer,l=t.materials;e.traverse(function(s){var v=s;v.material&&o.test(v.layers)===!1&&(l[v.uuid]=v.material,v.material=v.isSprite?bt:_t)}),a.render(),e.traverse(function(s){var v=s;l[v.uuid]&&(v.material=l[v.uuid],delete l[v.uuid])})}},r.setSize=function(e,t){this.bloomComposer.setSize(e,t)},r.setGui=function(e){var t=this,a=new f({bloom:{threshold:{value:this.options.threshold,min:0,max:1,target:function(){return t.bloomPass}},strength:{value:this.options.strength,min:0,max:10,target:function(){return t.bloomPass}},radius:{value:this.options.radius,min:0,max:2,step:.01,target:function(){return t.bloomPass}}}});a.showGui(e)},r.dispose=function(){this.bloomPass.dispose(),this.materials={}},n}(),yt=n=>{var r={};return F.d(r,n),r},yr=n=>()=>n,St=yt({OutlinePass:()=>tr.OutlinePass}),xt={edgeStrength:3,edgeGlow:4,edgeThickness:1,pulsePeriod:0,rotate:!1,usePatternTexture:!1,visibleEdgeColor:"#5ee8e8",hiddenEdgeColor:"#190a05"},Ct=function(){"use strict";function n(i,e){L(this,n),this.selectedObjects=[],this.active=!0,this.composerController=i,this.options=e;var t=i.scene,a=i.camera,o=i.finalComposer,l=i.getSize(),s=l.width,v=l.height,C=new St.OutlinePass(new c.Vector2(s,v),t,a);C.selectedObjects=this.selectedObjects,this.outlinePass=C,o.addPass(C),this.setGui()}var r=n.prototype;return r.enable=function(){this.active||(this.outlinePass.enabled=!0,this.active=!0)},r.disable=function(){!this.active||(this.outlinePass.enabled=!1,this.active=!1)},r.setGui=function(){var e=this,t=new f({outline:{edgeStrength:{value:this.options.edgeStrength,min:.01,max:10,step:.01,target:function(){return e.outlinePass}},edgeGlow:{value:this.options.edgeGlow,min:0,max:10,step:.01,target:function(){return e.outlinePass}},edgeThickness:{value:this.options.edgeThickness,min:0,max:4,step:.01,target:function(){return e.outlinePass}},pulsePeriod:{value:this.options.pulsePeriod,min:0,max:4,step:.01,target:function(){return e.outlinePass}},usePatternTexture:{value:this.options.usePatternTexture,target:function(){return e.outlinePass}},visibleEdgeColor:{value:this.options.visibleEdgeColor,target:function(){return e.outlinePass}},hiddenEdgeColor:{value:this.options.hiddenEdgeColor,target:function(){return e.outlinePass}}}});t.setTargetValueByParams(),this.outlineGui=t},r.dispose=function(){this.outlinePass.dispose(),this.selectedObjects=[]},n}();function wt(n,r){if(n==null)return{};var i={},e=Object.keys(n),t,a;for(a=0;a<e.length;a++)t=e[a],!(r.indexOf(t)>=0)&&(i[t]=n[t]);return i}function Et(n,r){if(n==null)return{};var i=wt(n,r),e,t;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(t=0;t<a.length;t++)e=a[t],!(r.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(n,e)||(i[e]=n[e]))}return i}var Rt=n=>{var r={};return F.d(r,n),r},Sr=n=>()=>n,Ot=Rt({SSRPass:()=>rr.SSRPass}),Mt=n=>{var r={};return F.d(r,n),r},xr=n=>()=>n,Tt=Mt({ReflectorForSSRPass:()=>nr.ReflectorForSSRPass}),At={maxDistance:10,selects:!0},Lt={width:1,height:1,clipBias:3e-4,color:8947848,useDepthTexture:!0},jt=function(){"use strict";function n(i,e){L(this,n),this.selectedObjects=[],this.active=!0,this.composerController=i,this.options=e;var t=i.scene,a=i.camera,o=i.renderer,l=i.finalComposer,s=i.getSize(),v=s.width,C=s.height,P=new Ot.SSRPass({renderer:o,scene:t,camera:a,width:v,height:C,groundReflector:null,selects:this.selectedObjects});this.ssrPass=P,l.addPass(P),this.setGui()}var r=n.prototype;return r.addGroundReflector=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=(0,B.Z)({},Lt,e),a=t.width,o=t.height,l=Et(t,["width","height"]),s=this.composerController,v=s.scene,C=s.getSize(),P=new c.PlaneGeometry(a,o),b=new Tt.ReflectorForSSRPass(P,T((0,B.Z)({},l),{textureWidth:C.width,textureHeight:C.height}));b.material.depthWrite=!1,b.rotation.x=-Math.PI/2,b.visible=!1,v.add(b),this.ssrPass.groundReflector=this.groundReflector,this.groundReflector=b},r.removeaGroundReflector=function(){this.ssrPass.groundReflector=null,this.groundReflector=void 0},r.enable=function(){this.active||(this.ssrPass.enabled=!0,this.active=!0)},r.disable=function(){!this.active||(this.ssrPass.enabled=!1,this.active=!1)},r.setSize=function(e,t){var a=this.groundReflector;a&&(a.getRenderTarget().setSize(e,t),a.resolution.set(e,t))},r.setGui=function(){var e=this,t=new f({ssr:{thickness:{value:.018,min:0,max:.1,step:1e-4,target:function(){return e.ssrPass}},infiniteThick:{value:!1,target:function(){return e.ssrPass}},fresnel:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},distanceAttenuation:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},selects:{value:this.options.selects,onChange:function(a){a?e.ssrPass.selects=e.selectedObjects:e.ssrPass.selects=null}},maxDistance:{value:this.options.maxDistance,min:0,max:100,step:.001,target:function(){return[e.ssrPass,e.groundReflector]}},opacity:{value:1,min:0,max:1,step:.01,target:function(){return[e.ssrPass,e.groundReflector]}}}});t.setTargetValueByParams(),this.ssrGui=t},r.dispose=function(){this.ssrPass.dispose(),this.selectedObjects=[]},n}(),Dt=function(){"use strict";function n(i){L(this,n),this.active=!0,this.options=i;var e=i.renderer,t=i.scene,a=i.camera,o=this.createRenderTarget(),l=new Te.EffectComposer(e,o);l.setPixelRatio(e.getPixelRatio()),this.finalComposer=l,this.addRenderPasss(),this.renderer=e,this.scene=t,this.renderTarget=o,this.camera=a}var r=n.prototype;return r.createRenderTarget=function(){var e=this.options.composerParams,t=e.multisampling,a=e.type,o=e.encoding,l=this.getSize(),s={minFilter:c.LinearFilter,magFilter:c.LinearFilter,format:c.RGBAFormat,encoding:o,type:a},v;if(+c.REVISION<138&&t>0){var C=new c.WebGLMultisampleRenderTarget(l.width,l.height,s);C.samples=t,v=C}else if(+c.REVISION>=138&&t>0){var P=new c.WebGLRenderTarget(l.width,l.height,T((0,B.Z)({},s),{samples:t}));v=P}else{var b=new c.WebGLRenderTarget(l.width,l.height,s);v=b}return v.texture.name="EffectComposer.rt1",v},r.addRenderPasss=function(){var e=this.options,t=e.scene,a=e.camera,o=new Ze.RenderPass(t,a);this.finalComposer.addPass(o),this.renderPass=o},r.addCopyPass=function(){var e=new be.ShaderPass(xe.CopyShader);this.finalComposer.addPass(e),this.copyPass=e},r.addGammaCorrectionPass=function(){var e=new be.ShaderPass(Je.GammaCorrectionShader);this.finalComposer.addPass(e),this.gammaCorrectionPass=e},r.addFXAAPass=function(){var e=this.getSize(),t=e.width,a=e.height,o=new be.ShaderPass(at.FXAAShader);this.finalComposer.addPass(o),this.fxaaPass=o,this.setFXAAPassSize(t,a)},r.addSMAAPass=function(){var e=this.getSize(),t=e.width,a=e.height,o=this.options.renderer,l=new et.SMAAPass(t*o.getPixelRatio(),a*o.getPixelRatio());this.finalComposer.addPass(l),this.smaaPass=l},r.addSSAAPass=function(){var e=this.options,t=e.scene,a=e.camera,o=new rt.SSAARenderPass(t,a,0,0);o.unbiased=!0,o.sampleLevel=1,this.finalComposer.addPass(o),this.ssaaPass=o},r.addBloomPass=function(e){var t=new Pt(this,e);t.disable(),this.options.gui&&t.setGui(this.options.gui),this.bloomController=t},r.addOutlinePass=function(e){var t=new Ct(this,e);t.disable(),this.options.gui&&t.outlineGui.showGui(this.options.gui),this.outlineController=t},r.addSSRPass=function(e){var t=new jt(this,e);t.disable(),this.options.gui&&t.ssrGui.showGui(this.options.gui),this.ssrController=t},r.getSize=function(){var e=this.options.renderer;return e.getSize(new c.Vector2)},r.enable=function(){this.active||(this.active=!0)},r.disable=function(){!this.active||(this.active=!1)},r.checkCopyPass=function(){var e=this,t=this.finalComposer.passes.some(function(a){return a!==e.renderPass&&a!==e.copyPass?a.enabled:!1});t&&this.copyPass?this.copyPass.enabled=!1:!t&&this.copyPass?this.copyPass.enabled=!0:!t&&!this.copyPass&&this.addCopyPass()},r.setSize=function(e,t){var a,o;this.finalComposer.setSize(e,t),(a=this.bloomController)===null||a===void 0||a.setSize(e,t),(o=this.ssrController)===null||o===void 0||o.setSize(e,t),this.setFXAAPassSize(e,t)},r.setFXAAPassSize=function(e,t){if(!!this.fxaaPass){var a=this.options.renderer,o=a.getPixelRatio();this.fxaaPass.material.uniforms.resolution.value.x=1/(e*o),this.fxaaPass.material.uniforms.resolution.value.y=1/(t*o)}},r.render=function(){var e;if(!!this.active){var t=this.options.scene;(e=this.bloomController)===null||e===void 0||e.render(t),this.finalComposer.render()}},r.dispose=function(){var e,t,a;(e=this.bloomController)===null||e===void 0||e.dispose(),(t=this.outlineController)===null||t===void 0||t.dispose(),(a=this.ssrController)===null||a===void 0||a.dispose(),this.finalComposer.passes.forEach(function(o){var l,s,v;(l=o.fsQuad)===null||l===void 0||l.dispose(),(s=o.fsQuad)===null||s===void 0||(v=s.material)===null||v===void 0||v.dispose()}),this.renderTarget.dispose(),this.copyPass=void 0,this.gammaCorrectionPass=void 0,this.smaaPass=void 0,this.ssaaPass=void 0,this.fxaaPass=void 0,this.bloomController=void 0,this.outlineController=void 0,this.ssrController=void 0},n}(),Re=function(){"use strict";function n(i){L(this,n),this.raycaster=new c.Raycaster,this.installPlugins=new Map,this.event=new Q.EventEmitter,this.clock=new c.Clock,this.options=(0,re.default)(n.options,i,{isMergeableObject:V.PO});var e=this.options,t=e.container,a=e.stats,o=e.gui;if(o){var l=new u.default;l.open(!1),this.gui=l}if(a){var s=new q.default;s.showPanel(0),s.dom.style.position="absolute",t.appendChild(s.dom),this.stats=s}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),this.clock.getDelta(),this.clock.getElapsedTime()}var r=n.prototype;return r.use=function(e){for(var t=arguments.length,a=new Array(t>1?t-1:0),o=1;o<t;o++)a[o-1]=arguments[o];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var l;(l=e).install.apply(l,[this].concat(I(a))),this.installPlugins.set(e,!0)}},r.init=function(){var e=this,t=this.options,a=t.container,o=t.isdev,l=t.axesHelper,s=t.renderer,v=t.scene,C=t.camera,P=this.getSize(),b=P.width,y=P.height,A=new J({isdev:o,width:b,height:y,cameraParams:C});this.gui&&A.setGui(this.gui);var N=A.camera,W=new ne({camera:N,sceneParams:v}),K=W.scene,ce=new O({width:b,height:y,scene:K,camera:N,isdev:o,rendererParams:T((0,B.Z)({},s),{outputEncoding:c.LinearEncoding,antialias:!1})});this.gui&&ce.setGui(this.gui);var X=ce.renderer;l&&W.addAxesHelper(),this.sceneController=W,this.rendererController=ce,this.cameraController=A,a.appendChild(X.domElement);var le=new ResizeObserver(function(de){var he=!0,ye=!1,Ue=void 0;try{for(var Oe=de[Symbol.iterator](),Fe;!(he=(Fe=Oe.next()).done);he=!0){var Nt=Fe.value,Ve=Nt.contentRect;e.handeleResize(Ve.width,Ve.height)}}catch(Wt){ye=!0,Ue=Wt}finally{try{!he&&Oe.return!=null&&Oe.return()}finally{if(ye)throw Ue}}});le.observe(a),this.resizeObserver=le},r.initComposer=function(){var e=this.options,t=e.bloom,a=e.outline,o=e.ssr,l=e.renderer,s=e.bloomParams,v=e.outlineParams,C=e.ssrParams,P=e.multisampling,b=l.antialias;b==="msaa"&&!Ae&&(b=!1,console.warn("MSAA is not supported on this browser"));var y=new Dt({renderer:this.renderer,scene:this.scene,camera:this.camera,gui:this.gui,composerParams:{multisampling:b==="msaa"?P:0,type:c.UnsignedByteType,encoding:l.outputEncoding}});this.composerController=y,b==="ssaa"&&y.addSSAAPass(),o&&y.addSSRPass(C),t&&y.addBloomPass(s),a&&y.addOutlinePass(v),l.outputEncoding===c.sRGBEncoding&&y.addGammaCorrectionPass(),b==="fxaa"?y.addFXAAPass():b==="smaa"&&y.addSMAAPass(),y.checkCopyPass(),this.event.on("passcheck",function(){y.checkCopyPass()})},r.initCSSRenderer=function(){var e=this.options,t=e.container,a=e.css2DRenderer,o=e.css3DRenderer,l=e.css2DRendererParams,s=e.css3DRendererParams;if(a||o){var v=new He(t);a&&v.addRenderer("css2d",l),o&&v.addRenderer("css3d",s),this.cssRendererController=v}},r.initControl=function(){var e=this.options,t=e.control,a=e.mapControl,o=e.controlParams;if(t){var l=new _({camera:this.camera,controlParams:{domElement:(o==null?void 0:o.domElement)||this.renderer.domElement},mapControl:a});this.controlController=l}},r.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},r.handeleResize=function(e,t){var a=this,o=a.rendererController,l=a.cameraController,s=a.composerController,v=a.cssRendererController;l==null||l.setSize(e,t),o==null||o.setSize(e,t),s==null||s.setSize(e,t),v==null||v.setSize(e,t),this.installPlugins.forEach(function(C,P){var b;(b=P.resize)===null||b===void 0||b.call(P,{width:e,height:t})}),this.event.emit("resize",{width:e,height:t})},r.pick=function(e,t){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=this,l=o.raycaster,s=o.options,v=s.container,C=new c.Vector2,P=v.getBoundingClientRect();if(C.x=(e.clientX-P.left)/(P.right-P.left)*2-1,C.y=-((e.clientY-P.top)/(P.bottom-P.top))*2+1,this.camera&&this.scene){l.setFromCamera(C,this.camera);var b=l.intersectObjects(t||this.scene.children,a);if(b.length)return{object:b[0].object,intersects:b}}},r.render=function(){var e,t,a,o,l=this,s=l.renderer,v=l.scene,C=l.camera,P=l.clock;if(!(!s||!v||!C||this.options.staticRender&&!this.cameraController.checkCameraChange())){var b=P.getDelta(),y=P.getElapsedTime();if(s.clear(),(e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(N,W){var K;(K=W.update)===null||K===void 0||K.call(W,b,y)}),!((t=this.composerController)===null||t===void 0)&&t.active)this.composerController.render();else{var A;(A=this.rendererController)===null||A===void 0||A.render()}(a=this.cssRendererController)===null||a===void 0||a.render(v,C),(o=this.stats)===null||o===void 0||o.update(),this.event.emit("render",{delta:b,elapsed:y})}},r.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},r.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},r.dispose=function(){var e,t,a,o,l,s,v;this.stop(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(C,P){var b;(b=P.dispose)===null||b===void 0||b.call(P)}),(t=this.controlController)===null||t===void 0||t.dispose(),(a=this.cssRendererController)===null||a===void 0||a.dispose(),(o=this.sceneController)===null||o===void 0||o.dispose(),(l=this.composerController)===null||l===void 0||l.dispose(),(s=this.rendererController)===null||s===void 0||s.dispose(),this.controlController=void 0,this.cssRendererController=void 0,(v=this.gui)===null||v===void 0||v.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},x(n,[{key:"renderer",get:function(){return this.rendererController.renderer}},{key:"control",get:function(){var e;return(e=this.controlController)===null||e===void 0?void 0:e.control}},{key:"camera",get:function(){return this.cameraController.camera}},{key:"scene",get:function(){return this.sceneController.scene}}]),n}();Re.options={isdev:ge,stats:ge,gui:ge,axesHelper:ge,control:ge,renderer:T((0,B.Z)({},S),{antialias:Ae?"msaa":"smaa"}),staticRender:!1,multisampling:8,scene:Z,camera:w,bloom:!1,bloomParams:gt,outline:!1,outlineParams:xt,css2DRenderer:!1,ssr:!1,ssrParams:At,css2DRendererParams:(0,B.Z)({},fe),css3DRenderer:!1,css3DRendererParams:(0,B.Z)({},fe)};function zt(){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(n){return!1}}function Pe(n,r,i){return zt()?Pe=Reflect.construct:Pe=function(t,a,o){var l=[null];l.push.apply(l,a);var s=Function.bind.apply(t,l),v=new s;return o&&Le(v,o.prototype),v},Pe.apply(null,arguments)}function Be(n,r,i){return Pe.apply(null,arguments)}var Bt=F(620);function Gt(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i={};return i.promise=new Promise(function(e,t){i.resolve=e,i.reject=t}),n&&(i.promise=(0,Bt.Z)(i.promise,r)),i}var Ut=n=>{var r={};return F.d(r,n),r},Cr=n=>()=>n,Ft=Ut({CSS2DObject:()=>ar.CSS2DObject}),Ge=function(n){n&&((0,V.wf)(n),n.children.forEach(function(r){r.userData.BaseObject_||Ge(r)}))},Vt=function(){"use strict";function n(){L(this,n),this.objecttype__="BaseObject",this.userData={},this.pm=Gt(),this.visible=!1}var r=n.prototype;return r.init=function(){},r.create=function(){},r.render=function(){},r.update=function(e,t){},r.resize=function(e,t){},r.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},r.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},r.isVisible=function(){return this.visible},r.createMesh=function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return this.object3d=Be(c.Mesh,I(t)),this},r.createGroup=function(){return this.object3d=new c.Group,this},r.createPoints=function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return this.object3d=Be(c.Points,I(t)),this},r.createCSS2DObject=function(e){return this.object3d=new Ft.CSS2DObject(e),this},r.createCSS3DObject=function(e){return this.object3d=new $.CSS3DObject(e),this},r.createCSS3DSprite=function(e){return this.object3d=new $.CSS3DSprite(e),this},r.createSprite=function(e){return this.object3d=new c.Sprite(e),this},r.add=function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];var o;return(o=this.object3d).add.apply(o,I(t)),this},r.remove=function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];var o;return(o=this.object3d).remove.apply(o,I(t)),this},r.getSize=function(){var e=new c.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new c.Vector3)}},r.traverse=function(e){e(this),this.children.forEach(function(t){t.traverse(e)})},r.dispose=function(){Ge(this.object3d)},x(n,[{key:"parent",get:function(){var e=this.object3d.parent;return(e==null?void 0:e.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(e){return e.userData.BaseObject_}).filter(function(e){return!!e})}}]),n}()})();var sr=_e.L6,or=_e.sb,ur=_e.z,lr=_e.ZP;export{sr as BaseObject,or as GUIObject,ur as Pencil,lr as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gl-draw",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "author": "gitplus <hstits@gmail.com>",
5
5
  "scripts": {
6
6
  "start": "PORT=3002 bundler-dev",