gl-draw 0.4.5 → 0.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import*as Be from"idb-keyval";import*as B from"three";import*as Gt from"deepmerge";import*as Ut from"three/examples/jsm/libs/stats.module";import*as Ft from"lil-gui";import*as Ge from"three/examples/jsm/controls/OrbitControls";import*as Re from"three/examples/jsm/renderers/CSS3DRenderer";import*as Vt from"three/examples/jsm/postprocessing/EffectComposer";import*as Nt from"three/examples/jsm/postprocessing/RenderPass";import*as Wt from"three/examples/jsm/postprocessing/ShaderPass";import*as kt from"three/examples/jsm/shaders/CopyShader";import*as It from"three/examples/jsm/shaders/GammaCorrectionShader";import*as Ht from"three/examples/jsm/postprocessing/SMAAPass";import*as Xt from"three/examples/jsm/postprocessing/SSAARenderPass";import*as Kt from"three/examples/jsm/shaders/FXAAShader";import*as Ue from"three/examples/jsm/postprocessing/Pass";import*as Zt from"three/examples/jsm/shaders/LuminosityHighPassShader";import*as Qt from"three/examples/jsm/postprocessing/OutlinePass";import*as Yt from"three/examples/jsm/postprocessing/SSRPass";import*as $t from"three/examples/jsm/objects/ReflectorForSSRPass";import*as Jt from"three/examples/jsm/renderers/CSS2DRenderer";var qt={187:function(L){var D=typeof Reflect=="object"?Reflect:null,C=D&&typeof D.apply=="function"?D.apply:function(u,f,m){return Function.prototype.apply.call(u,f,m)},G;D&&typeof D.ownKeys=="function"?G=D.ownKeys:Object.getOwnPropertySymbols?G=function(u){return Object.getOwnPropertyNames(u).concat(Object.getOwnPropertySymbols(u))}:G=function(u){return Object.getOwnPropertyNames(u)};function j(v){console&&console.warn&&console.warn(v)}var A=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 z=10;function X(v){if(typeof v!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof v)}Object.defineProperty(g,"defaultMaxListeners",{enumerable:!0,get:function(){return z},set:function(v){if(typeof v!="number"||v<0||A(v))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+v+".");z=v}}),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||A(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 O(v){return v._maxListeners===void 0?g.defaultMaxListeners:v._maxListeners}g.prototype.getMaxListeners=function(){return O(this)},g.prototype.emit=function(u){for(var f=[],m=1;m<arguments.length;m++)f.push(arguments[m]);var S=u==="error",w=this._events;if(w!==void 0)S=S&&w.error===void 0;else if(!S)return!1;if(S){var E;if(f.length>0&&(E=f[0]),E instanceof Error)throw E;var $=new Error("Unhandled error."+(E?" ("+E.message+")":""));throw $.context=E,$}var N=w[u];if(N===void 0)return!1;if(typeof N=="function")C(N,this,f);else for(var K=N.length,ne=ae(N,K),m=0;m<K;++m)C(ne[m],this,f);return!0};function U(v,u,f,m){var S,w,E;if(X(f),w=v._events,w===void 0?(w=v._events=Object.create(null),v._eventsCount=0):(w.newListener!==void 0&&(v.emit("newListener",u,f.listener?f.listener:f),w=v._events),E=w[u]),E===void 0)E=w[u]=f,++v._eventsCount;else if(typeof E=="function"?E=w[u]=m?[f,E]:[E,f]:m?E.unshift(f):E.push(f),S=O(v),S>0&&E.length>S&&!E.warned){E.warned=!0;var $=new Error("Possible EventEmitter memory leak detected. "+E.length+" "+String(u)+" listeners added. Use emitter.setMaxListeners() to increase limit");$.name="MaxListenersExceededWarning",$.emitter=v,$.type=u,$.count=E.length,j($)}return v}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 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 c(v,u,f){var m={fired:!1,wrapFn:void 0,target:v,type:u,listener:f},S=k.bind(m);return S.listener=f,m.wrapFn=S,S}g.prototype.once=function(u,f){return X(f),this.on(u,c(this,u,f)),this},g.prototype.prependOnceListener=function(u,f){return X(f),this.prependListener(u,c(this,u,f)),this},g.prototype.removeListener=function(u,f){var m,S,w,E,$;if(X(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(w=-1,E=m.length-1;E>=0;E--)if(m[E]===f||m[E].listener===f){$=m[E].listener,w=E;break}if(w<0)return this;w===0?m.shift():re(m,w),m.length===1&&(S[u]=m[0]),S.removeListener!==void 0&&this.emit("removeListener",u,$||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 w=Object.keys(m),E;for(S=0;S<w.length;++S)E=w[S],E!=="removeListener"&&this.removeAllListeners(E);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(v,u,f){var m=v._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(v,u){return typeof v.listenerCount=="function"?v.listenerCount(u):te.call(v,u)},g.prototype.listenerCount=te;function te(v){var u=this._events;if(u!==void 0){var f=u[v];if(typeof f=="function")return 1;if(f!==void 0)return f.length}return 0}g.prototype.eventNames=function(){return this._eventsCount>0?G(this._events):[]};function ae(v,u){for(var f=new Array(u),m=0;m<u;++m)f[m]=v[m];return f}function re(v,u){for(;u+1<v.length;u++)v[u]=v[u+1];v.pop()}function Y(v){for(var u=new Array(v.length),f=0;f<u.length;++f)u[f]=v[f].listener||v[f];return u}function oe(v,u){return new Promise(function(f,m){function S(E){v.removeListener(u,w),m(E)}function w(){typeof v.removeListener=="function"&&v.removeListener("error",S),f([].slice.call(arguments))}W(v,u,w,{once:!0}),u!=="error"&&q(v,S,{once:!0})})}function q(v,u,f){typeof v.on=="function"&&W(v,"error",u,f)}function W(v,u,f,m){if(typeof v.on=="function")m.once?v.once(u,f):v.on(u,f);else if(typeof v.addEventListener=="function")v.addEventListener(u,function S(w){m.once&&v.removeEventListener(u,S),f(w)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof v)}},666:function(L){var D=function(C){"use strict";var G=Object.prototype,j=G.hasOwnProperty,A,g=typeof Symbol=="function"?Symbol:{},z=g.iterator||"@@iterator",X=g.asyncIterator||"@@asyncIterator",O=g.toStringTag||"@@toStringTag";function U(p,h,_){return Object.defineProperty(p,h,{value:_,enumerable:!0,configurable:!0,writable:!0}),p[h]}try{U({},"")}catch(p){U=function(h,_,M){return h[_]=M}}function k(p,h,_,M){var R=h&&h.prototype instanceof oe?h:oe,J=Object.create(R.prototype),ee=new ne(M||[]);return J._invoke=E(p,_,ee),J}C.wrap=k;function c(p,h,_){try{return{type:"normal",arg:p.call(h,_)}}catch(M){return{type:"throw",arg:M}}}var Q="suspendedStart",te="suspendedYield",ae="executing",re="completed",Y={};function oe(){}function q(){}function W(){}var v={};U(v,z,function(){return this});var u=Object.getPrototypeOf,f=u&&u(u(de([])));f&&f!==G&&j.call(f,z)&&(v=f);var m=W.prototype=oe.prototype=Object.create(v);q.prototype=W,U(m,"constructor",W),U(W,"constructor",q),q.displayName=U(W,O,"GeneratorFunction");function S(p){["next","throw","return"].forEach(function(h){U(p,h,function(_){return this._invoke(h,_)})})}C.isGeneratorFunction=function(p){var h=typeof p=="function"&&p.constructor;return h?h===q||(h.displayName||h.name)==="GeneratorFunction":!1},C.mark=function(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,W):(p.__proto__=W,U(p,O,"GeneratorFunction")),p.prototype=Object.create(m),p},C.awrap=function(p){return{__await:p}};function w(p,h){function _(J,ee,ie,ue){var se=c(p[J],p,ee);if(se.type==="throw")ue(se.arg);else{var pe=se.arg,ve=pe.value;return ve&&typeof ve=="object"&&j.call(ve,"__await")?h.resolve(ve.__await).then(function(fe){_("next",fe,ie,ue)},function(fe){_("throw",fe,ie,ue)}):h.resolve(ve).then(function(fe){pe.value=fe,ie(pe)},function(fe){return _("throw",fe,ie,ue)})}}var M;function R(J,ee){function ie(){return new h(function(ue,se){_(J,ee,ue,se)})}return M=M?M.then(ie,ie):ie()}this._invoke=R}S(w.prototype),U(w.prototype,X,function(){return this}),C.AsyncIterator=w,C.async=function(p,h,_,M,R){R===void 0&&(R=Promise);var J=new w(k(p,h,_,M),R);return C.isGeneratorFunction(h)?J:J.next().then(function(ee){return ee.done?ee.value:J.next()})};function E(p,h,_){var M=Q;return function(J,ee){if(M===ae)throw new Error("Generator is already running");if(M===re){if(J==="throw")throw ee;return ye()}for(_.method=J,_.arg=ee;;){var ie=_.delegate;if(ie){var ue=$(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,h,_);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 $(p,h){var _=p.iterator[h.method];if(_===A){if(h.delegate=null,h.method==="throw"){if(p.iterator.return&&(h.method="return",h.arg=A,$(p,h),h.method==="throw"))return Y;h.method="throw",h.arg=new TypeError("The iterator does not provide a 'throw' method")}return Y}var M=c(_,p.iterator,h.arg);if(M.type==="throw")return h.method="throw",h.arg=M.arg,h.delegate=null,Y;var R=M.arg;if(!R)return h.method="throw",h.arg=new TypeError("iterator result is not an object"),h.delegate=null,Y;if(R.done)h[p.resultName]=R.value,h.next=p.nextLoc,h.method!=="return"&&(h.method="next",h.arg=A);else return R;return h.delegate=null,Y}S(m),U(m,O,"Generator"),U(m,z,function(){return this}),U(m,"toString",function(){return"[object Generator]"});function N(p){var h={tryLoc:p[0]};1 in p&&(h.catchLoc=p[1]),2 in p&&(h.finallyLoc=p[2],h.afterLoc=p[3]),this.tryEntries.push(h)}function K(p){var h=p.completion||{};h.type="normal",delete h.arg,p.completion=h}function ne(p){this.tryEntries=[{tryLoc:"root"}],p.forEach(N,this),this.reset(!0)}C.keys=function(p){var h=[];for(var _ in p)h.push(_);return h.reverse(),function M(){for(;h.length;){var R=h.pop();if(R in p)return M.value=R,M.done=!1,M}return M.done=!0,M}};function de(p){if(p){var h=p[z];if(h)return h.call(p);if(typeof p.next=="function")return p;if(!isNaN(p.length)){var _=-1,M=function R(){for(;++_<p.length;)if(j.call(p,_))return R.value=p[_],R.done=!1,R;return R.value=A,R.done=!0,R};return M.next=M}}return{next:ye}}C.values=de;function ye(){return{value:A,done:!0}}return ne.prototype={constructor:ne,reset:function(p){if(this.prev=0,this.next=0,this.sent=this._sent=A,this.done=!1,this.delegate=null,this.method="next",this.arg=A,this.tryEntries.forEach(K),!p)for(var h in this)h.charAt(0)==="t"&&j.call(this,h)&&!isNaN(+h.slice(1))&&(this[h]=A)},stop:function(){this.done=!0;var p=this.tryEntries[0],h=p.completion;if(h.type==="throw")throw h.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var h=this;function _(ue,se){return J.type="throw",J.arg=p,h.next=ue,se&&(h.method="next",h.arg=A),!!se}for(var M=this.tryEntries.length-1;M>=0;--M){var R=this.tryEntries[M],J=R.completion;if(R.tryLoc==="root")return _("end");if(R.tryLoc<=this.prev){var ee=j.call(R,"catchLoc"),ie=j.call(R,"finallyLoc");if(ee&&ie){if(this.prev<R.catchLoc)return _(R.catchLoc,!0);if(this.prev<R.finallyLoc)return _(R.finallyLoc)}else if(ee){if(this.prev<R.catchLoc)return _(R.catchLoc,!0)}else if(ie){if(this.prev<R.finallyLoc)return _(R.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(p,h){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 R=M;break}}R&&(p==="break"||p==="continue")&&R.tryLoc<=h&&h<=R.finallyLoc&&(R=null);var J=R?R.completion:{};return J.type=p,J.arg=h,R?(this.method="next",this.next=R.finallyLoc,Y):this.complete(J)},complete:function(p,h){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"&&h&&(this.next=h),Y},finish:function(p){for(var h=this.tryEntries.length-1;h>=0;--h){var _=this.tryEntries[h];if(_.finallyLoc===p)return this.complete(_.completion,_.afterLoc),K(_),Y}},catch:function(p){for(var h=this.tryEntries.length-1;h>=0;--h){var _=this.tryEntries[h];if(_.tryLoc===p){var M=_.completion;if(M.type==="throw"){var R=M.arg;K(_)}return R}}throw new Error("illegal catch attempt")},delegateYield:function(p,h,_){return this.delegate={iterator:de(p),resultName:h,nextLoc:_},this.method==="next"&&(this.arg=A),Y}},C}(L.exports);try{regeneratorRuntime=D}catch(C){typeof globalThis=="object"?globalThis.regeneratorRuntime=D:Function("r","regeneratorRuntime = r")(D)}},695:function(L,D,C){C.d(D,{Z:function(){return G}});function G(j){if(j.geometry&&j.geometry.dispose(),j.material){var A=Array.isArray(j.material)?j.material:[j.material];A.forEach(function(g){var z,X,O,U,k,c,Q,te,ae,re,Y,oe,q;(z=g.map)===null||z===void 0||z.dispose(),(X=g.lightMap)===null||X===void 0||X.dispose(),(O=g.bumpMap)===null||O===void 0||O.dispose(),(U=g.normalMap)===null||U===void 0||U.dispose(),(k=g.specularMap)===null||k===void 0||k.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()})}}},521:function(L,D,C){C.d(D,{wf:function(){return g.Z},PO:function(){return O.Z}});var G=C(666),j=C.n(G),A=null,g=C(695),z=C(949);function X(W){if(W.material){var v=Array.isArray(W.material)?W.material:[W.material];v.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 O=C(738),U=C(568),k=C(924),c=W=>{var v={};return C.d(v,W),v},Q=W=>()=>W,te=c({get:()=>Be.get,set:()=>Be.set}),ae=C(484),re=null,Y=null,oe=function(){var W=(0,U.Z)(j().mark(function v(u,f){var m,S,w,E,$,N;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(w=ne.sent,!(w&&w[m])){ne.next=9;break}S=w[m],ne.next=15;break;case 9:return ne.next=11,(0,ae.Z)(fetch(u).then(function(de){if(de.ok)return de.blob();throw new Error}));case 11:E=ne.sent,$=E.res,N=E.err,N||(S=$,(0,te.set)(u,(0,k.Z)({},m,$)));case 15:return ne.abrupt("return",S?{url:URL.createObjectURL(S)}:{url:u});case 16:case"end":return ne.stop()}},v)}));return function(u,f){return W.apply(this,arguments)}}(),q=C(705)},738:function(L,D,C){C.d(D,{Z:function(){return j}});function G(A){return Object.prototype.toString.call(A)==="[object Object]"}function j(A){if(G(A)===!1)return!1;var g=A.constructor;if(g===void 0)return!0;var z=g.prototype;return!(G(z)===!1||z.hasOwnProperty("isPrototypeOf")===!1)}},484:function(L,D,C){C.d(D,{Z:function(){return j}});var G=C(42);function j(A){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return A.then(function(z){return(0,G.Z)({err:null,res:z},g)}).catch(function(z){return(0,G.Z)({err:z,res:void 0},g)})}},705:function(L,D,C){var G=C(949),j=new Map,A=function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(X,O,U,k,c){var Q=O[U*3],te=O[U*3+1],ae=O[k*3],re=O[k*3+1],Y=O[c*3],oe=O[c*3+1],q;if(j.has(X))q=j.get(X);else{var W=z.box3||new THREE.Box3;if(!z.box3){var v=X.parameters.shapes.getPoints();W.setFromArray(v.map(function(w){return[w.x,w.y,0]}).flat())}var u=W.getSize(new THREE.Vector3);z.split&&(u.y/=z.split),q={box:W,size:u},j.set(X,q)}var f=q.box,m=q.size,S=z.split?1-z.split:0;return[new THREE.Vector2((Q-f.min.x)/m.x,(te-f.min.y)/m.y+S),new THREE.Vector2((ae-f.min.x)/m.x,(re-f.min.y)/m.y+S),new THREE.Vector2((Y-f.min.x)/m.x,(oe-f.min.y)/m.y+S)]},generateSideWallUV:function(X,O,U,k,c,Q){var te=O[U*3],ae=O[U*3+1],re=O[U*3+2],Y=O[k*3],oe=O[k*3+1],q=O[k*3+2],W=O[c*3],v=O[c*3+1],u=O[c*3+2],f=O[Q*3],m=O[Q*3+1],S=O[Q*3+2],w;if(j.has(O))w=j.get(O);else{var E=new THREE.Box3;E.setFromArray(O);var $=E.getSize(new THREE.Vector3);z.split&&($.z/=1-z.split),w={box:E,size:$},j.set(O,w)}var N=w.box,K=w.size;return Math.abs(ae-oe)<Math.abs(te-Y)?[new THREE.Vector2((te-N.min.x)/K.x,(re-N.min.z)/K.z),new THREE.Vector2((Y-N.min.x)/K.x,(q-N.min.z)/K.z),new THREE.Vector2((W-N.min.x)/K.x,(u-N.min.z)/K.z),new THREE.Vector2((f-N.min.x)/K.x,(S-N.min.z)/K.z)]:[new THREE.Vector2((ae-N.min.y)/K.y,(re-N.min.z)/K.z),new THREE.Vector2((oe-N.min.y)/K.y,(q-N.min.z)/K.z),new THREE.Vector2((v-N.min.y)/K.y,(u-N.min.z)/K.z),new THREE.Vector2((m-N.min.y)/K.y,(S-N.min.z)/K.z)]}}},g=function(){j.clear()}},949:function(L,D,C){var G=A=>{var g={};return C.d(g,A),g},j=A=>()=>A;L.exports=G({ACESFilmicToneMapping:()=>B.ACESFilmicToneMapping,AdditiveBlending:()=>B.AdditiveBlending,AxesHelper:()=>B.AxesHelper,Box3:()=>B.Box3,Camera:()=>B.Camera,CineonToneMapping:()=>B.CineonToneMapping,Clock:()=>B.Clock,Color:()=>B.Color,Euler:()=>B.Euler,Group:()=>B.Group,Layers:()=>B.Layers,LinearEncoding:()=>B.LinearEncoding,LinearFilter:()=>B.LinearFilter,LinearToneMapping:()=>B.LinearToneMapping,Matrix4:()=>B.Matrix4,Mesh:()=>B.Mesh,MeshBasicMaterial:()=>B.MeshBasicMaterial,NoToneMapping:()=>B.NoToneMapping,PerspectiveCamera:()=>B.PerspectiveCamera,PlaneGeometry:()=>B.PlaneGeometry,Points:()=>B.Points,REVISION:()=>B.REVISION,RGBAFormat:()=>B.RGBAFormat,Raycaster:()=>B.Raycaster,ReinhardToneMapping:()=>B.ReinhardToneMapping,Scene:()=>B.Scene,ShaderMaterial:()=>B.ShaderMaterial,Sprite:()=>B.Sprite,SpriteMaterial:()=>B.SpriteMaterial,UniformsUtils:()=>B.UniformsUtils,UnsignedByteType:()=>B.UnsignedByteType,Vector2:()=>B.Vector2,Vector3:()=>B.Vector3,WebGLMultisampleRenderTarget:()=>B.WebGLMultisampleRenderTarget,WebGLRenderTarget:()=>B.WebGLRenderTarget,WebGLRenderer:()=>B.WebGLRenderer,sRGBEncoding:()=>B.sRGBEncoding})},568:function(L,D,C){C.d(D,{Z:function(){return j}});function G(A,g,z,X,O,U,k){try{var c=A[U](k),Q=c.value}catch(te){z(te);return}c.done?g(Q):Promise.resolve(Q).then(X,O)}function j(A){return function(){var g=this,z=arguments;return new Promise(function(X,O){var U=A.apply(g,z);function k(Q){G(U,X,O,k,c,"next",Q)}function c(Q){G(U,X,O,k,c,"throw",Q)}k(void 0)})}}},924:function(L,D,C){C.d(D,{Z:function(){return G}});function G(j,A,g){return A in j?Object.defineProperty(j,A,{value:g,enumerable:!0,configurable:!0,writable:!0}):j[A]=g,j}},42:function(L,D,C){C.d(D,{Z:function(){return j}});var G=C(924);function j(A){for(var g=1;g<arguments.length;g++){var z=arguments[g]!=null?arguments[g]:{},X=Object.keys(z);typeof Object.getOwnPropertySymbols=="function"&&(X=X.concat(Object.getOwnPropertySymbols(z).filter(function(O){return Object.getOwnPropertyDescriptor(z,O).enumerable}))),X.forEach(function(O){(0,G.Z)(A,O,z[O])})}return A}}},Fe={};function V(L){var D=Fe[L];if(D!==void 0)return D.exports;var C=Fe[L]={exports:{}};return qt[L](C,C.exports,V),C.exports}(function(){V.n=function(L){var D=L&&L.__esModule?function(){return L.default}:function(){return L};return V.d(D,{a:D}),D}})(),function(){V.d=function(L,D){for(var C in D)V.o(D,C)&&!V.o(L,C)&&Object.defineProperty(L,C,{enumerable:!0,get:D[C]})}}(),function(){V.o=function(L,D){return Object.prototype.hasOwnProperty.call(L,D)}}();var _e={};(function(){V.d(_e,{L6:function(){return zt},sb:function(){return f},z:function(){return Ee},ZP:function(){return Ee}});function L(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function D(n,t){for(var i=0;i<t.length;i++){var e=t[i];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(n,e.key,e)}}function C(n,t,i){return t&&D(n.prototype,t),i&&D(n,i),n}var G=V(42);function j(n,t){var i=Object.keys(n);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(n);t&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),i.push.apply(i,e)}return i}function A(n,t){return t=t!=null?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):j(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))}),n}function g(n,t){(t==null||t>n.length)&&(t=n.length);for(var i=0,e=new Array(t);i<t;i++)e[i]=n[i];return e}function z(n){if(Array.isArray(n))return g(n)}function X(n){if(typeof Symbol!="undefined"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function O(){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,t){if(!!n){if(typeof n=="string")return g(n,t);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,t)}}function k(n){return z(n)||X(n)||U(n)||O()}var c=V(949),Q=V(187),te=n=>{var t={};return V.d(t,n),t},ae=n=>()=>n,re=te({default:()=>Gt.default}),Y=n=>{var t={};return V.d(t,n),t},oe=n=>()=>n,q=Y({default:()=>Ut.default}),W=n=>{var t={};return V.d(t,n),t},v=n=>()=>n,u=W({default:()=>Ft.default}),f=function(){"use strict";function n(i){L(this,n),this.guiParams={},i&&(this.guiParams=i)}var t=n.prototype;return t.showGui=function(e){var r=this;!e||Object.keys(this.guiParams).forEach(function(a){var o=e.addFolder(a),l=r.guiParams[a];Object.keys(l).forEach(function(s){var d=l[s],x=d.min,y=d.max,b=d.step,P=d.name,T=d.paramMap,F=d.items,I=d.value,H=d.target,le=s.toLowerCase().indexOf("color")>-1,Z,ce=typeof I=="undefined"&&H,he=ce?H():l[s],me=ce?s:"value";F?Z=o.add(he,me,F):le?Z=o.addColor(he,me):Z=o.add(he,me),Z=Z.name(P||s),typeof x!="undefined"&&(Z=Z.min(x)),typeof y!="undefined"&&(Z=Z.max(y)),typeof b!="undefined"&&(Z=Z.step(b)),Z=Z.onChange(function(){r.setTargetValue(a,s,he[me],T)}),ce&&Z.listen()})})},t.setTargetValue=function(e,r,a,o){var l=this.guiParams[e][r],s=l.onChange,d=l.target,x=l.value,y=r.toLowerCase().indexOf("color")>-1,b=typeof x=="undefined"&&d;if(d&&!b){var P=d();Array.isArray(P)||(P=[P]),P.forEach(function(T){if(!!T)if(y)try{T[o||r].set(a)}catch(F){r!=="color"&&!o&&console.warn("".concat(r," is not a color,set paramMap"))}else T[o||r]=a})}s&&s(a)},t.setTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(r){Object.keys(e.guiParams[r]).forEach(function(a){var o=e.guiParams[r][a];typeof o.value!="undefined"&&e.setTargetValue(r,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},w=function(){"use strict";function n(i){L(this,n),this.options=i;var e=i.width,r=i.height,a=i.rendererParams,o=a.context,l=a.alpha,s=a.devicePixelRatio,d=a.antialias,x=a.powerPreference,y=a.toneMapping,b=a.toneMappingExposure,P=a.outputEncoding,T=a.logarithmicDepthBuffer,F=a.preserveDrawingBuffer,I=new c.WebGLRenderer({context:o,alpha:l,antialias:d,powerPreference:x,logarithmicDepthBuffer:T,preserveDrawingBuffer:F});I.setSize(e,r),I.setPixelRatio(s),I.autoClear=!1,I.toneMapping=m[y],I.toneMappingExposure=b,I.outputEncoding=P,this.renderer=I}var t=n.prototype;return t.setSize=function(e,r){this.renderer.setSize(e,r)},t.render=function(){var e=this.options,r=e.scene,a=e.camera;this.renderer.render(r,a)},t.setGui=function(e){var r=this,a=new f({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:m,target:function(){return r.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return r.renderer}}}});a.showGui(e)},t.dispose=function(){var e,r,a;(e=this.renderer)===null||e===void 0||e.clear(),(r=this.renderer)===null||r===void 0||r.dispose(),(a=this.renderer)===null||a===void 0||a.renderLists.dispose()},n}(),E={fov:45,near:1,far:1e3},$=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,r=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,d=new c.PerspectiveCamera(o,e/r,s,l);d.position.set(0,0,400),d.lookAt(0,0,0),this.camera=d}}var t=n.prototype;return t.checkCameraChange=function(){var e=this.camera,r=this.oldCameraPosition.equals(e.position)&&this.oldCameraRotation.equals(e.rotation);return this.oldCameraPosition=e.position.clone(),this.oldCameraRotation=e.rotation.clone(),!r},t.setSize=function(e,r){this.camera instanceof c.PerspectiveCamera&&(this.camera.aspect=e/r),this.camera.updateProjectionMatrix()},t.setGui=function(e){var r=this,a=new f({camera:{x:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},y:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},z:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},near:{min:0,max:1e3,step:1,target:function(){return r.camera},onChange:function(o){r.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return r.camera},onChange:function(o){r.camera.updateProjectionMatrix()}}}});this.camera instanceof c.PerspectiveCamera&&(a.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return r.camera},onChange:function(o){r.camera.updateProjectionMatrix()}}),a.showGui(e)},n}(),N=V(521),K={background:null},ne=function(){"use strict";function n(i){L(this,n),this.options=i;var e=i.camera,r=i.sceneParams,a=r.background,o=new c.Scene;a&&(o.background=a),o.add(e),this.scene=o}var t=n.prototype;return t.addAxesHelper=function(){var e,r=new c.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(r)},t.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(r){(0,N.wf)(r)})},n}(),de=n=>{var t={};return V.d(t,n),t},ye=n=>()=>n,p=de({MapControls:()=>Ge.MapControls,OrbitControls:()=>Ge.OrbitControls}),h={},_=function(){"use strict";function n(i){L(this,n),this.options=i;var e=i.camera,r=i.controlParams,a=i.mapControl,o=r.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 t=n.prototype;return t.limitPan=function(e){var r=e.maxX,a=r===void 0?1/0:r,o=e.minX,l=o===void 0?-1/0:o,s=e.maxZ,d=s===void 0?1/0:s,x=e.minZ,y=x===void 0?-1/0:x,b=e.maxY,P=b===void 0?1/0:b,T=e.minY,F=T===void 0?-1/0:T,I=this.limitPanV||new c.Vector3,H=this.control,le=this.options.camera,Z=new c.Vector3(l,F,y),ce=new c.Vector3(a,P,d);this.limitPanV=I,I.copy(H.target),H.target.clamp(Z,ce),I.sub(H.target),le.position.sub(I)},t.update=function(){this.control.update()},t.dispose=function(){this.control.dispose()},n}(),M=n=>{var t={};return V.d(t,n),t},R=n=>()=>n,J=M({CSS3DObject:()=>Re.CSS3DObject,CSS3DRenderer:()=>Re.CSS3DRenderer,CSS3DSprite:()=>Re.CSS3DSprite}),ee=new c.Vector3,ie=new c.Matrix4,ue=new c.Matrix4,se=new c.Vector3,pe=new c.Vector3,ve=function n(){"use strict";var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};L(this,n);var i=function(T,F){return se.setFromMatrixPosition(T.matrixWorld),pe.setFromMatrixPosition(F.matrixWorld),se.distanceToSquared(pe)},e=function(T){var F=[];return T.traverse(function(I){I.isCSS2DObject&&F.push(I)}),F},r=function(T){for(var F=e(T).sort(function(ce,he){if(ce.renderOrder!==he.renderOrder)return he.renderOrder-ce.renderOrder;var me=x.objects.get(ce).distanceToCameraSquared,Bt=x.objects.get(he).distanceToCameraSquared;return me-Bt}),I=F.length,H=0,le=F.length;H<le;H++){var Z=F[H].userData.zIndexFix||0;F[H].element.style.zIndex=I-H+Z}},a=this,o,l,s,d,x={objects:new WeakMap},y=t.element!==void 0?t.element:document.createElement("div");y.style.overflow="hidden",this.domElement=y,this.getSize=function(){return{width:o,height:l}},this.render=function(P,T){+c.REVISION<144?(P.autoUpdate===!0&&P.updateMatrixWorld(),T.parent===null&&T.updateMatrixWorld()):(P.matrixWorldAutoUpdate===!0&&P.updateMatrixWorld(),T.parent===null&&T.matrixWorldAutoUpdate===!0&&T.updateMatrixWorld()),ie.copy(T.matrixWorldInverse),ue.multiplyMatrices(T.projectionMatrix,ie),b(P,P,T),r(P)},this.setSize=function(P,T){o=P,l=T,s=o/2,d=l/2,y.style.width="".concat(P,"px"),y.style.height="".concat(T,"px")};function b(P,T,F){if(P.isCSS2DObject){ee.setFromMatrixPosition(P.matrixWorld),ee.applyMatrix4(ue);var I=P.visible===!0&&ee.z>=-1&&ee.z<=1&&P.layers.test(F.layers)===!0;if(P.element.style.display=I===!0?"":"none",I===!0){P.onBeforeRender(a,T,F);var H=P.element;H.style.transform="translate(-50%,-50%) translate(".concat(ee.x*s+s,"px,").concat(-ee.y*d+d,"px)"),H.parentNode!==y&&y.appendChild(H),P.onAfterRender(a,T,F)}var le={distanceToCameraSquared:i(F,P)};x.objects.set(P,le)}for(var Z=0,ce=P.children.length;Z<ce;Z++)b(P.children[Z],T,F)}},fe={zIndex:"auto"},Ve=function(){"use strict";function n(i){L(this,n),this.container=i}var t=n.prototype;return t.addRenderer=function(e,r){var a=this.container,o=a.offsetWidth,l=a.offsetHeight,s=e==="css2d"?new ve:new J.CSS3DRenderer;s.domElement.style.position="absolute",s.domElement.style.top="0",s.domElement.style.pointerEvents="none",s.domElement.style.zIndex=r.zIndex,s.setSize(o,l),a.appendChild(s.domElement),e==="css2d"?this.css2Drenderer=s:e==="css3d"&&(this.css3Drenderer=s)},t.setSize=function(e,r){var a,o;(a=this.css2Drenderer)===null||a===void 0||a.setSize(e,r),(o=this.css3Drenderer)===null||o===void 0||o.setSize(e,r)},t.render=function(e,r){var a,o;(a=this.css2Drenderer)===null||a===void 0||a.render(e,r),(o=this.css3Drenderer)===null||o===void 0||o.render(e,r)},t.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},n}(),Ne=n=>{var t={};return V.d(t,n),t},ar=n=>()=>n,Oe=Ne({EffectComposer:()=>Vt.EffectComposer}),We=n=>{var t={};return V.d(t,n),t},ir=n=>()=>n,ke=We({RenderPass:()=>Nt.RenderPass}),Ie=n=>{var t={};return V.d(t,n),t},sr=n=>()=>n,be=Ie({ShaderPass:()=>Wt.ShaderPass}),He=n=>{var t={};return V.d(t,n),t},or=n=>()=>n,Se=He({CopyShader:()=>kt.CopyShader}),Xe=n=>{var t={};return V.d(t,n),t},ur=n=>()=>n,Ke=Xe({GammaCorrectionShader:()=>It.GammaCorrectionShader}),Ze=n=>{var t={};return V.d(t,n),t},lr=n=>()=>n,Qe=Ze({SMAAPass:()=>Ht.SMAAPass}),Ye=n=>{var t={};return V.d(t,n),t},cr=n=>()=>n,$e=Ye({SSAARenderPass:()=>Xt.SSAARenderPass}),Je=n=>{var t={};return V.d(t,n),t},fr=n=>()=>n,qe=Je({FXAAShader:()=>Kt.FXAAShader}),et=function(){try{var n=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&n.getContext("webgl2"))}catch(t){return!1}},dr=0,tt=1,ge=!1,Me=et()!==!1,rt=`varying vec2 vUv;
1
+ import*as Be from"idb-keyval";import*as U from"three";import*as Gt from"deepmerge";import*as Ut from"three/examples/jsm/libs/stats.module";import*as Ft from"lil-gui";import*as Ge from"three/examples/jsm/controls/OrbitControls";import*as Re from"three/examples/jsm/renderers/CSS3DRenderer";import*as Vt from"three/examples/jsm/postprocessing/EffectComposer";import*as Nt from"three/examples/jsm/postprocessing/RenderPass";import*as Wt from"three/examples/jsm/postprocessing/ShaderPass";import*as kt from"three/examples/jsm/shaders/CopyShader";import*as It from"three/examples/jsm/shaders/GammaCorrectionShader";import*as Ht from"three/examples/jsm/postprocessing/SMAAPass";import*as Xt from"three/examples/jsm/postprocessing/SSAARenderPass";import*as Kt from"three/examples/jsm/shaders/FXAAShader";import*as Ue from"three/examples/jsm/postprocessing/Pass";import*as Zt from"three/examples/jsm/shaders/LuminosityHighPassShader";import*as Qt from"three/examples/jsm/postprocessing/OutlinePass";import*as Yt from"three/examples/jsm/postprocessing/SSRPass";import*as $t from"three/examples/jsm/objects/ReflectorForSSRPass";import*as Jt from"three/examples/jsm/renderers/CSS2DRenderer";var qt={187:function(A){var D=typeof Reflect=="object"?Reflect:null,x=D&&typeof D.apply=="function"?D.apply:function(c,v,g){return Function.prototype.apply.call(c,v,g)},G;D&&typeof D.ownKeys=="function"?G=D.ownKeys:Object.getOwnPropertySymbols?G=function(c){return Object.getOwnPropertyNames(c).concat(Object.getOwnPropertySymbols(c))}:G=function(c){return Object.getOwnPropertyNames(c)};function j(f){console&&console.warn&&console.warn(f)}var R=Number.isNaN||function(c){return c!==c};function m(){m.init.call(this)}A.exports=m,A.exports.once=q,m.EventEmitter=m,m.prototype._events=void 0,m.prototype._eventsCount=0,m.prototype._maxListeners=void 0;var B=10;function X(f){if(typeof f!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof f)}Object.defineProperty(m,"defaultMaxListeners",{enumerable:!0,get:function(){return B},set:function(f){if(typeof f!="number"||f<0||R(f))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+f+".");B=f}}),m.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},m.prototype.setMaxListeners=function(c){if(typeof c!="number"||c<0||R(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 O(f){return f._maxListeners===void 0?m.defaultMaxListeners:f._maxListeners}m.prototype.getMaxListeners=function(){return O(this)},m.prototype.emit=function(c){for(var v=[],g=1;g<arguments.length;g++)v.push(arguments[g]);var S=c==="error",w=this._events;if(w!==void 0)S=S&&w.error===void 0;else if(!S)return!1;if(S){var M;if(v.length>0&&(M=v[0]),M instanceof Error)throw M;var ee=new Error("Unhandled error."+(M?" ("+M.message+")":""));throw ee.context=M,ee}var V=w[c];if(V===void 0)return!1;if(typeof V=="function")x(V,this,v);else for(var K=V.length,de=se(V,K),g=0;g<K;++g)x(de[g],this,v);return!0};function F(f,c,v,g){var S,w,M;if(X(v),w=f._events,w===void 0?(w=f._events=Object.create(null),f._eventsCount=0):(w.newListener!==void 0&&(f.emit("newListener",c,v.listener?v.listener:v),w=f._events),M=w[c]),M===void 0)M=w[c]=v,++f._eventsCount;else if(typeof M=="function"?M=w[c]=g?[v,M]:[M,v]:g?M.unshift(v):M.push(v),S=O(f),S>0&&M.length>S&&!M.warned){M.warned=!0;var ee=new Error("Possible EventEmitter memory leak detected. "+M.length+" "+String(c)+" listeners added. Use emitter.setMaxListeners() to increase limit");ee.name="MaxListenersExceededWarning",ee.emitter=f,ee.type=c,ee.count=M.length,j(ee)}return f}m.prototype.addListener=function(c,v){return F(this,c,v,!1)},m.prototype.on=m.prototype.addListener,m.prototype.prependListener=function(c,v){return F(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 g={fired:!1,wrapFn:void 0,target:f,type:c,listener:v},S=k.bind(g);return S.listener=v,g.wrapFn=S,S}m.prototype.once=function(c,v){return X(v),this.on(c,l(this,c,v)),this},m.prototype.prependOnceListener=function(c,v){return X(v),this.prependListener(c,l(this,c,v)),this},m.prototype.removeListener=function(c,v){var g,S,w,M,ee;if(X(v),S=this._events,S===void 0)return this;if(g=S[c],g===void 0)return this;if(g===v||g.listener===v)--this._eventsCount===0?this._events=Object.create(null):(delete S[c],S.removeListener&&this.emit("removeListener",c,g.listener||v));else if(typeof g!="function"){for(w=-1,M=g.length-1;M>=0;M--)if(g[M]===v||g[M].listener===v){ee=g[M].listener,w=M;break}if(w<0)return this;w===0?g.shift():ne(g,w),g.length===1&&(S[c]=g[0]),S.removeListener!==void 0&&this.emit("removeListener",c,ee||v)}return this},m.prototype.off=m.prototype.removeListener,m.prototype.removeAllListeners=function(c){var v,g,S;if(g=this._events,g===void 0)return this;if(g.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):g[c]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete g[c]),this;if(arguments.length===0){var w=Object.keys(g),M;for(S=0;S<w.length;++S)M=w[S],M!=="removeListener"&&this.removeAllListeners(M);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(v=g[c],typeof v=="function")this.removeListener(c,v);else if(v!==void 0)for(S=v.length-1;S>=0;S--)this.removeListener(c,v[S]);return this};function Q(f,c,v){var g=f._events;if(g===void 0)return[];var S=g[c];return S===void 0?[]:typeof S=="function"?v?[S.listener||S]:[S]:v?$(S):se(S,S.length)}m.prototype.listeners=function(c){return Q(this,c,!0)},m.prototype.rawListeners=function(c){return Q(this,c,!1)},m.listenerCount=function(f,c){return typeof f.listenerCount=="function"?f.listenerCount(c):re.call(f,c)},m.prototype.listenerCount=re;function re(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}m.prototype.eventNames=function(){return this._eventsCount>0?G(this._events):[]};function se(f,c){for(var v=new Array(c),g=0;g<c;++g)v[g]=f[g];return v}function ne(f,c){for(;c+1<f.length;c++)f[c]=f[c+1];f.pop()}function $(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,g){function S(M){f.removeListener(c,w),g(M)}function w(){typeof f.removeListener=="function"&&f.removeListener("error",S),v([].slice.call(arguments))}z(f,c,w,{once:!0}),c!=="error"&&Z(f,S,{once:!0})})}function Z(f,c,v){typeof f.on=="function"&&z(f,"error",c,v)}function z(f,c,v,g){if(typeof f.on=="function")g.once?f.once(c,v):f.on(c,v);else if(typeof f.addEventListener=="function")f.addEventListener(c,function S(w){g.once&&f.removeEventListener(c,S),v(w)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof f)}},666:function(A){var D=function(x){"use strict";var G=Object.prototype,j=G.hasOwnProperty,R,m=typeof Symbol=="function"?Symbol:{},B=m.iterator||"@@iterator",X=m.asyncIterator||"@@asyncIterator",O=m.toStringTag||"@@toStringTag";function F(p,h,_){return Object.defineProperty(p,h,{value:_,enumerable:!0,configurable:!0,writable:!0}),p[h]}try{F({},"")}catch(p){F=function(h,_,T){return h[_]=T}}function k(p,h,_,T){var E=h&&h.prototype instanceof q?h:q,J=Object.create(E.prototype),te=new de(T||[]);return J._invoke=M(p,_,te),J}x.wrap=k;function l(p,h,_){try{return{type:"normal",arg:p.call(h,_)}}catch(T){return{type:"throw",arg:T}}}var Q="suspendedStart",re="suspendedYield",se="executing",ne="completed",$={};function q(){}function Z(){}function z(){}var f={};F(f,B,function(){return this});var c=Object.getPrototypeOf,v=c&&c(c(oe([])));v&&v!==G&&j.call(v,B)&&(f=v);var g=z.prototype=q.prototype=Object.create(f);Z.prototype=z,F(g,"constructor",z),F(z,"constructor",Z),Z.displayName=F(z,O,"GeneratorFunction");function S(p){["next","throw","return"].forEach(function(h){F(p,h,function(_){return this._invoke(h,_)})})}x.isGeneratorFunction=function(p){var h=typeof p=="function"&&p.constructor;return h?h===Z||(h.displayName||h.name)==="GeneratorFunction":!1},x.mark=function(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,z):(p.__proto__=z,F(p,O,"GeneratorFunction")),p.prototype=Object.create(g),p},x.awrap=function(p){return{__await:p}};function w(p,h){function _(J,te,ae,ue){var ie=l(p[J],p,te);if(ie.type==="throw")ue(ie.arg);else{var me=ie.arg,ve=me.value;return ve&&typeof ve=="object"&&j.call(ve,"__await")?h.resolve(ve.__await).then(function(fe){_("next",fe,ae,ue)},function(fe){_("throw",fe,ae,ue)}):h.resolve(ve).then(function(fe){me.value=fe,ae(me)},function(fe){return _("throw",fe,ae,ue)})}}var T;function E(J,te){function ae(){return new h(function(ue,ie){_(J,te,ue,ie)})}return T=T?T.then(ae,ae):ae()}this._invoke=E}S(w.prototype),F(w.prototype,X,function(){return this}),x.AsyncIterator=w,x.async=function(p,h,_,T,E){E===void 0&&(E=Promise);var J=new w(k(p,h,_,T),E);return x.isGeneratorFunction(h)?J:J.next().then(function(te){return te.done?te.value:J.next()})};function M(p,h,_){var T=Q;return function(J,te){if(T===se)throw new Error("Generator is already running");if(T===ne){if(J==="throw")throw te;return pe()}for(_.method=J,_.arg=te;;){var ae=_.delegate;if(ae){var ue=ee(ae,_);if(ue){if(ue===$)continue;return ue}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(T===Q)throw T=ne,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);T=se;var ie=l(p,h,_);if(ie.type==="normal"){if(T=_.done?ne:re,ie.arg===$)continue;return{value:ie.arg,done:_.done}}else ie.type==="throw"&&(T=ne,_.method="throw",_.arg=ie.arg)}}}function ee(p,h){var _=p.iterator[h.method];if(_===R){if(h.delegate=null,h.method==="throw"){if(p.iterator.return&&(h.method="return",h.arg=R,ee(p,h),h.method==="throw"))return $;h.method="throw",h.arg=new TypeError("The iterator does not provide a 'throw' method")}return $}var T=l(_,p.iterator,h.arg);if(T.type==="throw")return h.method="throw",h.arg=T.arg,h.delegate=null,$;var E=T.arg;if(!E)return h.method="throw",h.arg=new TypeError("iterator result is not an object"),h.delegate=null,$;if(E.done)h[p.resultName]=E.value,h.next=p.nextLoc,h.method!=="return"&&(h.method="next",h.arg=R);else return E;return h.delegate=null,$}S(g),F(g,O,"Generator"),F(g,B,function(){return this}),F(g,"toString",function(){return"[object Generator]"});function V(p){var h={tryLoc:p[0]};1 in p&&(h.catchLoc=p[1]),2 in p&&(h.finallyLoc=p[2],h.afterLoc=p[3]),this.tryEntries.push(h)}function K(p){var h=p.completion||{};h.type="normal",delete h.arg,p.completion=h}function de(p){this.tryEntries=[{tryLoc:"root"}],p.forEach(V,this),this.reset(!0)}x.keys=function(p){var h=[];for(var _ in p)h.push(_);return h.reverse(),function T(){for(;h.length;){var E=h.pop();if(E in p)return T.value=E,T.done=!1,T}return T.done=!0,T}};function oe(p){if(p){var h=p[B];if(h)return h.call(p);if(typeof p.next=="function")return p;if(!isNaN(p.length)){var _=-1,T=function E(){for(;++_<p.length;)if(j.call(p,_))return E.value=p[_],E.done=!1,E;return E.value=R,E.done=!0,E};return T.next=T}}return{next:pe}}x.values=oe;function pe(){return{value:R,done:!0}}return de.prototype={constructor:de,reset:function(p){if(this.prev=0,this.next=0,this.sent=this._sent=R,this.done=!1,this.delegate=null,this.method="next",this.arg=R,this.tryEntries.forEach(K),!p)for(var h in this)h.charAt(0)==="t"&&j.call(this,h)&&!isNaN(+h.slice(1))&&(this[h]=R)},stop:function(){this.done=!0;var p=this.tryEntries[0],h=p.completion;if(h.type==="throw")throw h.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var h=this;function _(ue,ie){return J.type="throw",J.arg=p,h.next=ue,ie&&(h.method="next",h.arg=R),!!ie}for(var T=this.tryEntries.length-1;T>=0;--T){var E=this.tryEntries[T],J=E.completion;if(E.tryLoc==="root")return _("end");if(E.tryLoc<=this.prev){var te=j.call(E,"catchLoc"),ae=j.call(E,"finallyLoc");if(te&&ae){if(this.prev<E.catchLoc)return _(E.catchLoc,!0);if(this.prev<E.finallyLoc)return _(E.finallyLoc)}else if(te){if(this.prev<E.catchLoc)return _(E.catchLoc,!0)}else if(ae){if(this.prev<E.finallyLoc)return _(E.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(p,h){for(var _=this.tryEntries.length-1;_>=0;--_){var T=this.tryEntries[_];if(T.tryLoc<=this.prev&&j.call(T,"finallyLoc")&&this.prev<T.finallyLoc){var E=T;break}}E&&(p==="break"||p==="continue")&&E.tryLoc<=h&&h<=E.finallyLoc&&(E=null);var J=E?E.completion:{};return J.type=p,J.arg=h,E?(this.method="next",this.next=E.finallyLoc,$):this.complete(J)},complete:function(p,h){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"&&h&&(this.next=h),$},finish:function(p){for(var h=this.tryEntries.length-1;h>=0;--h){var _=this.tryEntries[h];if(_.finallyLoc===p)return this.complete(_.completion,_.afterLoc),K(_),$}},catch:function(p){for(var h=this.tryEntries.length-1;h>=0;--h){var _=this.tryEntries[h];if(_.tryLoc===p){var T=_.completion;if(T.type==="throw"){var E=T.arg;K(_)}return E}}throw new Error("illegal catch attempt")},delegateYield:function(p,h,_){return this.delegate={iterator:oe(p),resultName:h,nextLoc:_},this.method==="next"&&(this.arg=R),$}},x}(A.exports);try{regeneratorRuntime=D}catch(x){typeof globalThis=="object"?globalThis.regeneratorRuntime=D:Function("r","regeneratorRuntime = r")(D)}},695:function(A,D,x){x.d(D,{Z:function(){return G}});function G(j){if(j.geometry&&j.geometry.dispose(),j.material){var R=Array.isArray(j.material)?j.material:[j.material];R.forEach(function(m){var B,X,O,F,k,l,Q,re,se,ne,$,q,Z;(B=m.map)===null||B===void 0||B.dispose(),(X=m.lightMap)===null||X===void 0||X.dispose(),(O=m.bumpMap)===null||O===void 0||O.dispose(),(F=m.normalMap)===null||F===void 0||F.dispose(),(k=m.specularMap)===null||k===void 0||k.dispose(),(l=m.envMap)===null||l===void 0||l.dispose(),(Q=m.alphaMap)===null||Q===void 0||Q.dispose(),(re=m.aoMap)===null||re===void 0||re.dispose(),(se=m.displacementMap)===null||se===void 0||se.dispose(),(ne=m.emissiveMap)===null||ne===void 0||ne.dispose(),($=m.gradientMap)===null||$===void 0||$.dispose(),(q=m.metalnessMap)===null||q===void 0||q.dispose(),(Z=m.roughnessMap)===null||Z===void 0||Z.dispose(),m.dispose()})}}},584:function(A,D,x){x.d(D,{wf:function(){return m.Z},PO:function(){return O.Z}});var G=x(666),j=x.n(G),R=null,m=x(695),B=x(949);function X(q){if(q.material){var Z=Array.isArray(q.material)?q.material:[q.material];Z.forEach(function(z){var f,c;(f=z.color)===null||f===void 0||f.convertSRGBToLinear(),(c=z.emissive)===null||c===void 0||c.convertSRGBToLinear(),z.map&&(z.map.encoding=THREE.sRGBEncoding),z.emissiveMap&&(z.emissiveMap.encoding=THREE.sRGBEncoding)})}}var O=x(738),F=x(568),k=x(924),l=x(77),Q=x(484),re=null,se=null,ne=function(){var q=(0,F.Z)(j().mark(function Z(z,f){var c,v,g,S,w,M,ee,V,K;return j().wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return c=f.type,v=c===void 0?"blob":c,g=f.version,S=g===void 0?"1":g,oe.next=4,(0,l.get)(z);case 4:if(M=oe.sent,!(M&&M[S])){oe.next=9;break}w=M[S],oe.next=15;break;case 9:return oe.next=11,(0,Q.Z)(fetch(z).then(function(pe){if(pe.ok)return pe[v]();throw new Error}));case 11:ee=oe.sent,V=ee.res,K=ee.err,K||(w=V,(0,l.set)(z,(0,k.Z)({},S,V)));case 15:return oe.abrupt("return",w?{url:v==="json"?z:URL.createObjectURL(w),store:w}:{url:z});case 16:case"end":return oe.stop()}},Z)}));return function(z,f){return q.apply(this,arguments)}}(),$=x(705)},738:function(A,D,x){x.d(D,{Z:function(){return j}});function G(R){return Object.prototype.toString.call(R)==="[object Object]"}function j(R){if(G(R)===!1)return!1;var m=R.constructor;if(m===void 0)return!0;var B=m.prototype;return!(G(B)===!1||B.hasOwnProperty("isPrototypeOf")===!1)}},484:function(A,D,x){x.d(D,{Z:function(){return j}});var G=x(42);function j(R){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return R.then(function(B){return(0,G.Z)({err:null,res:B},m)}).catch(function(B){return(0,G.Z)({err:B,res:void 0},m)})}},705:function(A,D,x){var G=x(949),j=new Map,R=function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(X,O,F,k,l){var Q=O[F*3],re=O[F*3+1],se=O[k*3],ne=O[k*3+1],$=O[l*3],q=O[l*3+1],Z;if(j.has(X))Z=j.get(X);else{var z=B.box3||new THREE.Box3;if(!B.box3){var f=X.parameters.shapes.getPoints();z.setFromArray(f.map(function(w){return[w.x,w.y,0]}).flat())}var c=z.getSize(new THREE.Vector3);B.split&&(c.y/=B.split),Z={box:z,size:c},j.set(X,Z)}var v=Z.box,g=Z.size,S=B.split?1-B.split:0;return[new THREE.Vector2((Q-v.min.x)/g.x,(re-v.min.y)/g.y+S),new THREE.Vector2((se-v.min.x)/g.x,(ne-v.min.y)/g.y+S),new THREE.Vector2(($-v.min.x)/g.x,(q-v.min.y)/g.y+S)]},generateSideWallUV:function(X,O,F,k,l,Q){var re=O[F*3],se=O[F*3+1],ne=O[F*3+2],$=O[k*3],q=O[k*3+1],Z=O[k*3+2],z=O[l*3],f=O[l*3+1],c=O[l*3+2],v=O[Q*3],g=O[Q*3+1],S=O[Q*3+2],w;if(j.has(O))w=j.get(O);else{var M=new THREE.Box3;M.setFromArray(O);var ee=M.getSize(new THREE.Vector3);B.split&&(ee.z/=1-B.split),w={box:M,size:ee},j.set(O,w)}var V=w.box,K=w.size;return Math.abs(se-q)<Math.abs(re-$)?[new THREE.Vector2((re-V.min.x)/K.x,(ne-V.min.z)/K.z),new THREE.Vector2(($-V.min.x)/K.x,(Z-V.min.z)/K.z),new THREE.Vector2((z-V.min.x)/K.x,(c-V.min.z)/K.z),new THREE.Vector2((v-V.min.x)/K.x,(S-V.min.z)/K.z)]:[new THREE.Vector2((se-V.min.y)/K.y,(ne-V.min.z)/K.z),new THREE.Vector2((q-V.min.y)/K.y,(Z-V.min.z)/K.z),new THREE.Vector2((f-V.min.y)/K.y,(c-V.min.z)/K.z),new THREE.Vector2((g-V.min.y)/K.y,(S-V.min.z)/K.z)]}}},m=function(){j.clear()}},77:function(A,D,x){var G=R=>{var m={};return x.d(m,R),m},j=R=>()=>R;A.exports=G({get:()=>Be.get,set:()=>Be.set})},949:function(A,D,x){var G=R=>{var m={};return x.d(m,R),m},j=R=>()=>R;A.exports=G({ACESFilmicToneMapping:()=>U.ACESFilmicToneMapping,AdditiveBlending:()=>U.AdditiveBlending,AxesHelper:()=>U.AxesHelper,Box3:()=>U.Box3,Camera:()=>U.Camera,CineonToneMapping:()=>U.CineonToneMapping,Clock:()=>U.Clock,Color:()=>U.Color,Euler:()=>U.Euler,Group:()=>U.Group,Layers:()=>U.Layers,LinearEncoding:()=>U.LinearEncoding,LinearFilter:()=>U.LinearFilter,LinearToneMapping:()=>U.LinearToneMapping,Matrix4:()=>U.Matrix4,Mesh:()=>U.Mesh,MeshBasicMaterial:()=>U.MeshBasicMaterial,NoToneMapping:()=>U.NoToneMapping,PerspectiveCamera:()=>U.PerspectiveCamera,PlaneGeometry:()=>U.PlaneGeometry,Points:()=>U.Points,REVISION:()=>U.REVISION,RGBAFormat:()=>U.RGBAFormat,Raycaster:()=>U.Raycaster,ReinhardToneMapping:()=>U.ReinhardToneMapping,Scene:()=>U.Scene,ShaderMaterial:()=>U.ShaderMaterial,Sprite:()=>U.Sprite,SpriteMaterial:()=>U.SpriteMaterial,UniformsUtils:()=>U.UniformsUtils,UnsignedByteType:()=>U.UnsignedByteType,Vector2:()=>U.Vector2,Vector3:()=>U.Vector3,WebGLMultisampleRenderTarget:()=>U.WebGLMultisampleRenderTarget,WebGLRenderTarget:()=>U.WebGLRenderTarget,WebGLRenderer:()=>U.WebGLRenderer,sRGBEncoding:()=>U.sRGBEncoding})},568:function(A,D,x){x.d(D,{Z:function(){return j}});function G(R,m,B,X,O,F,k){try{var l=R[F](k),Q=l.value}catch(re){B(re);return}l.done?m(Q):Promise.resolve(Q).then(X,O)}function j(R){return function(){var m=this,B=arguments;return new Promise(function(X,O){var F=R.apply(m,B);function k(Q){G(F,X,O,k,l,"next",Q)}function l(Q){G(F,X,O,k,l,"throw",Q)}k(void 0)})}}},924:function(A,D,x){x.d(D,{Z:function(){return G}});function G(j,R,m){return R in j?Object.defineProperty(j,R,{value:m,enumerable:!0,configurable:!0,writable:!0}):j[R]=m,j}},42:function(A,D,x){x.d(D,{Z:function(){return j}});var G=x(924);function j(R){for(var m=1;m<arguments.length;m++){var B=arguments[m]!=null?arguments[m]:{},X=Object.keys(B);typeof Object.getOwnPropertySymbols=="function"&&(X=X.concat(Object.getOwnPropertySymbols(B).filter(function(O){return Object.getOwnPropertyDescriptor(B,O).enumerable}))),X.forEach(function(O){(0,G.Z)(R,O,B[O])})}return R}}},Fe={};function W(A){var D=Fe[A];if(D!==void 0)return D.exports;var x=Fe[A]={exports:{}};return qt[A](x,x.exports,W),x.exports}(function(){W.n=function(A){var D=A&&A.__esModule?function(){return A.default}:function(){return A};return W.d(D,{a:D}),D}})(),function(){W.d=function(A,D){for(var x in D)W.o(D,x)&&!W.o(A,x)&&Object.defineProperty(A,x,{enumerable:!0,get:D[x]})}}(),function(){W.o=function(A,D){return Object.prototype.hasOwnProperty.call(A,D)}}();var be={};(function(){W.d(be,{L6:function(){return zt},sb:function(){return v},z:function(){return Ee},ZP:function(){return Ee}});function A(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function D(n,t){for(var i=0;i<t.length;i++){var e=t[i];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(n,e.key,e)}}function x(n,t,i){return t&&D(n.prototype,t),i&&D(n,i),n}var G=W(42);function j(n,t){var i=Object.keys(n);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(n);t&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),i.push.apply(i,e)}return i}function R(n,t){return t=t!=null?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):j(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))}),n}function m(n,t){(t==null||t>n.length)&&(t=n.length);for(var i=0,e=new Array(t);i<t;i++)e[i]=n[i];return e}function B(n){if(Array.isArray(n))return m(n)}function X(n){if(typeof Symbol!="undefined"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function O(){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 F(n,t){if(!!n){if(typeof n=="string")return m(n,t);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 m(n,t)}}function k(n){return B(n)||X(n)||F(n)||O()}var l=W(949),Q=W(187),re=n=>{var t={};return W.d(t,n),t},se=n=>()=>n,ne=re({default:()=>Gt.default}),$=n=>{var t={};return W.d(t,n),t},q=n=>()=>n,Z=$({default:()=>Ut.default}),z=n=>{var t={};return W.d(t,n),t},f=n=>()=>n,c=z({default:()=>Ft.default}),v=function(){"use strict";function n(i){A(this,n),this.guiParams={},i&&(this.guiParams=i)}var t=n.prototype;return t.showGui=function(e){var r=this;!e||Object.keys(this.guiParams).forEach(function(a){var o=e.addFolder(a),u=r.guiParams[a];Object.keys(u).forEach(function(s){var d=u[s],C=d.min,P=d.max,b=d.step,y=d.name,L=d.paramMap,N=d.items,I=d.value,H=d.target,le=s.toLowerCase().indexOf("color")>-1,Y,ce=typeof I=="undefined"&&H,he=ce?H():u[s],ge=ce?s:"value";N?Y=o.add(he,ge,N):le?Y=o.addColor(he,ge):Y=o.add(he,ge),Y=Y.name(y||s),typeof C!="undefined"&&(Y=Y.min(C)),typeof P!="undefined"&&(Y=Y.max(P)),typeof b!="undefined"&&(Y=Y.step(b)),Y=Y.onChange(function(){r.setTargetValue(a,s,he[ge],L)}),ce&&Y.listen()})})},t.setTargetValue=function(e,r,a,o){var u=this.guiParams[e][r],s=u.onChange,d=u.target,C=u.value,P=r.toLowerCase().indexOf("color")>-1,b=typeof C=="undefined"&&d;if(d&&!b){var y=d();Array.isArray(y)||(y=[y]),y.forEach(function(L){if(!!L)if(P)try{L[o||r].set(a)}catch(N){r!=="color"&&!o&&console.warn("".concat(r," is not a color,set paramMap"))}else L[o||r]=a})}s&&s(a)},t.setTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(r){Object.keys(e.guiParams[r]).forEach(function(a){var o=e.guiParams[r][a];typeof o.value!="undefined"&&e.setTargetValue(r,a,o.value,o.paramMap)})})},n}(),g={None:l.NoToneMapping,Linear:l.LinearToneMapping,Reinhard:l.ReinhardToneMapping,Cineon:l.CineonToneMapping,ACESFilmic:l.ACESFilmicToneMapping},S={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:l.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1,context:null},w=function(){"use strict";function n(i){A(this,n),this.options=i;var e=i.width,r=i.height,a=i.rendererParams,o=a.context,u=a.alpha,s=a.devicePixelRatio,d=a.antialias,C=a.powerPreference,P=a.toneMapping,b=a.toneMappingExposure,y=a.outputEncoding,L=a.logarithmicDepthBuffer,N=a.preserveDrawingBuffer,I=new l.WebGLRenderer({context:o,alpha:u,antialias:d,powerPreference:C,logarithmicDepthBuffer:L,preserveDrawingBuffer:N});I.setSize(e,r),I.setPixelRatio(s),I.autoClear=!1,I.toneMapping=g[P],I.toneMappingExposure=b,I.outputEncoding=y,this.renderer=I}var t=n.prototype;return t.setSize=function(e,r){this.renderer.setSize(e,r)},t.render=function(){var e=this.options,r=e.scene,a=e.camera;this.renderer.render(r,a)},t.setGui=function(e){var r=this,a=new v({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:g,target:function(){return r.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return r.renderer}}}});a.showGui(e)},t.dispose=function(){var e,r,a;(e=this.renderer)===null||e===void 0||e.clear(),(r=this.renderer)===null||r===void 0||r.dispose(),(a=this.renderer)===null||a===void 0||a.renderLists.dispose()},n}(),M={fov:45,near:1,far:1e3},ee=function(){"use strict";function n(i){A(this,n),this.oldCameraPosition=new l.Vector3,this.oldCameraRotation=new l.Euler,this.customCamera=!1,this.options=i;var e=i.width,r=i.height,a=i.cameraParams;if(a instanceof l.Camera)this.camera=a,this.customCamera=!0;else{var o=a.fov,u=a.far,s=a.near,d=new l.PerspectiveCamera(o,e/r,s,u);d.position.set(0,0,400),d.lookAt(0,0,0),this.camera=d}}var t=n.prototype;return t.checkCameraChange=function(){var e=this.camera,r=this.oldCameraPosition.equals(e.position)&&this.oldCameraRotation.equals(e.rotation);return this.oldCameraPosition=e.position.clone(),this.oldCameraRotation=e.rotation.clone(),!r},t.setSize=function(e,r){this.camera instanceof l.PerspectiveCamera&&(this.camera.aspect=e/r),this.camera.updateProjectionMatrix()},t.setGui=function(e){var r=this,a=new v({camera:{x:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},y:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},z:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},near:{min:0,max:1e3,step:1,target:function(){return r.camera},onChange:function(o){r.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return r.camera},onChange:function(o){r.camera.updateProjectionMatrix()}}}});this.camera instanceof l.PerspectiveCamera&&(a.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return r.camera},onChange:function(o){r.camera.updateProjectionMatrix()}}),a.showGui(e)},n}(),V=W(584),K={background:null},de=function(){"use strict";function n(i){A(this,n),this.options=i;var e=i.camera,r=i.sceneParams,a=r.background,o=new l.Scene;a&&(o.background=a),o.add(e),this.scene=o}var t=n.prototype;return t.addAxesHelper=function(){var e,r=new l.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(r)},t.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(r){(0,V.wf)(r)})},n}(),oe=n=>{var t={};return W.d(t,n),t},pe=n=>()=>n,p=oe({MapControls:()=>Ge.MapControls,OrbitControls:()=>Ge.OrbitControls}),h={},_=function(){"use strict";function n(i){A(this,n),this.options=i;var e=i.camera,r=i.controlParams,a=i.mapControl,o=r.domElement,u=a?new p.MapControls(e,o):new p.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 t=n.prototype;return t.limitPan=function(e){var r=e.maxX,a=r===void 0?1/0:r,o=e.minX,u=o===void 0?-1/0:o,s=e.maxZ,d=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,L=e.minY,N=L===void 0?-1/0:L,I=this.limitPanV||new l.Vector3,H=this.control,le=this.options.camera,Y=new l.Vector3(u,N,P),ce=new l.Vector3(a,y,d);this.limitPanV=I,I.copy(H.target),H.target.clamp(Y,ce),I.sub(H.target),le.position.sub(I)},t.update=function(){this.control.update()},t.dispose=function(){this.control.dispose()},n}(),T=n=>{var t={};return W.d(t,n),t},E=n=>()=>n,J=T({CSS3DObject:()=>Re.CSS3DObject,CSS3DRenderer:()=>Re.CSS3DRenderer,CSS3DSprite:()=>Re.CSS3DSprite}),te=new l.Vector3,ae=new l.Matrix4,ue=new l.Matrix4,ie=new l.Vector3,me=new l.Vector3,ve=function n(){"use strict";var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};A(this,n);var i=function(L,N){return ie.setFromMatrixPosition(L.matrixWorld),me.setFromMatrixPosition(N.matrixWorld),ie.distanceToSquared(me)},e=function(L){var N=[];return L.traverse(function(I){I.isCSS2DObject&&N.push(I)}),N},r=function(L){for(var N=e(L).sort(function(ce,he){if(ce.renderOrder!==he.renderOrder)return he.renderOrder-ce.renderOrder;var ge=C.objects.get(ce).distanceToCameraSquared,Bt=C.objects.get(he).distanceToCameraSquared;return ge-Bt}),I=N.length,H=0,le=N.length;H<le;H++){var Y=N[H].userData.zIndexFix||0;N[H].element.style.zIndex=I-H+Y}},a=this,o,u,s,d,C={objects:new WeakMap},P=t.element!==void 0?t.element:document.createElement("div");P.style.overflow="hidden",this.domElement=P,this.getSize=function(){return{width:o,height:u}},this.render=function(y,L){+l.REVISION<144?(y.autoUpdate===!0&&y.updateMatrixWorld(),L.parent===null&&L.updateMatrixWorld()):(y.matrixWorldAutoUpdate===!0&&y.updateMatrixWorld(),L.parent===null&&L.matrixWorldAutoUpdate===!0&&L.updateMatrixWorld()),ae.copy(L.matrixWorldInverse),ue.multiplyMatrices(L.projectionMatrix,ae),b(y,y,L),r(y)},this.setSize=function(y,L){o=y,u=L,s=o/2,d=u/2,P.style.width="".concat(y,"px"),P.style.height="".concat(L,"px")};function b(y,L,N){if(y.isCSS2DObject){te.setFromMatrixPosition(y.matrixWorld),te.applyMatrix4(ue);var I=y.visible===!0&&te.z>=-1&&te.z<=1&&y.layers.test(N.layers)===!0;if(y.element.style.display=I===!0?"":"none",I===!0){y.onBeforeRender(a,L,N);var H=y.element;H.style.transform="translate(-50%,-50%) translate(".concat(te.x*s+s,"px,").concat(-te.y*d+d,"px)"),H.parentNode!==P&&P.appendChild(H),y.onAfterRender(a,L,N)}var le={distanceToCameraSquared:i(N,y)};C.objects.set(y,le)}for(var Y=0,ce=y.children.length;Y<ce;Y++)b(y.children[Y],L,N)}},fe={zIndex:"auto"},Ve=function(){"use strict";function n(i){A(this,n),this.container=i}var t=n.prototype;return t.addRenderer=function(e,r){var a=this.container,o=a.offsetWidth,u=a.offsetHeight,s=e==="css2d"?new ve:new J.CSS3DRenderer;s.domElement.style.position="absolute",s.domElement.style.top="0",s.domElement.style.pointerEvents="none",s.domElement.style.zIndex=r.zIndex,s.setSize(o,u),a.appendChild(s.domElement),e==="css2d"?this.css2Drenderer=s:e==="css3d"&&(this.css3Drenderer=s)},t.setSize=function(e,r){var a,o;(a=this.css2Drenderer)===null||a===void 0||a.setSize(e,r),(o=this.css3Drenderer)===null||o===void 0||o.setSize(e,r)},t.render=function(e,r){var a,o;(a=this.css2Drenderer)===null||a===void 0||a.render(e,r),(o=this.css3Drenderer)===null||o===void 0||o.render(e,r)},t.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},n}(),Ne=n=>{var t={};return W.d(t,n),t},ar=n=>()=>n,Oe=Ne({EffectComposer:()=>Vt.EffectComposer}),We=n=>{var t={};return W.d(t,n),t},ir=n=>()=>n,ke=We({RenderPass:()=>Nt.RenderPass}),Ie=n=>{var t={};return W.d(t,n),t},sr=n=>()=>n,ye=Ie({ShaderPass:()=>Wt.ShaderPass}),He=n=>{var t={};return W.d(t,n),t},or=n=>()=>n,Se=He({CopyShader:()=>kt.CopyShader}),Xe=n=>{var t={};return W.d(t,n),t},ur=n=>()=>n,Ke=Xe({GammaCorrectionShader:()=>It.GammaCorrectionShader}),Ze=n=>{var t={};return W.d(t,n),t},lr=n=>()=>n,Qe=Ze({SMAAPass:()=>Ht.SMAAPass}),Ye=n=>{var t={};return W.d(t,n),t},cr=n=>()=>n,$e=Ye({SSAARenderPass:()=>Xt.SSAARenderPass}),Je=n=>{var t={};return W.d(t,n),t},fr=n=>()=>n,qe=Je({FXAAShader:()=>Kt.FXAAShader}),et=function(){try{var n=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&n.getContext("webgl2"))}catch(t){return!1}},dr=0,tt=1,_e=!1,Me=et()!==!1,rt=`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 xe(n,t){return xe=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e},xe(n,t)}function Te(n,t){return xe(n,t)}function at(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),t&&Te(n,t)}function it(){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 Ce(n){return Ce=Object.setPrototypeOf?Object.getPrototypeOf:function(i){return i.__proto__||Object.getPrototypeOf(i)},Ce(n)}function Ae(n){return Ce(n)}function st(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function ot(n){return n&&n.constructor===Symbol?"symbol":typeof n}function ut(n,t){return t&&(ot(t)==="object"||typeof t=="function")?t:st(n)}function lt(n){var t=it();return function(){var e=Ae(n),r;if(t){var a=Ae(this).constructor;r=Reflect.construct(e,arguments,a)}else r=e.apply(this,arguments);return ut(this,r)}}var ct=n=>{var t={};return V.d(t,n),t},hr=n=>()=>n,Le=ct({FullScreenQuad:()=>Ue.FullScreenQuad,Pass:()=>Ue.Pass}),ft=n=>{var t={};return V.d(t,n),t},vr=n=>()=>n,je=ft({LuminosityHighPassShader:()=>Zt.LuminosityHighPassShader}),we=function(n){"use strict";at(i,n);var t=lt(i);function i(r,a,o,l){L(this,i);var s;s=t.call(this),s.strength=a!==void 0?a:1,s.radius=o,s.threshold=l,s.resolution=r!==void 0?new c.Vector2(r.x,r.y):new c.Vector2(256,256),s.clearColor=new c.Color(0,0,0);var d={minFilter:c.LinearFilter,magFilter:c.LinearFilter,format:c.RGBAFormat};s.renderTargetsHorizontal=[],s.renderTargetsVertical=[],s.nMips=5;var x=Math.round(s.resolution.x/2),y=Math.round(s.resolution.y/2);s.renderTargetBright=new c.WebGLRenderTarget(x,y,d),s.renderTargetBright.texture.name="UnrealBloomPass.bright",s.renderTargetBright.texture.generateMipmaps=!1;for(var b=0;b<s.nMips;b++){var P=new c.WebGLRenderTarget(x,y,d);P.texture.name="UnrealBloomPass.h".concat(b),P.texture.generateMipmaps=!1,s.renderTargetsHorizontal.push(P);var T=new c.WebGLRenderTarget(x,y,d);T.texture.name="UnrealBloomPass.v".concat(b),T.texture.generateMipmaps=!1,s.renderTargetsVertical.push(T),x=Math.round(x/2),y=Math.round(y/2)}je.LuminosityHighPassShader===void 0&&console.error("THREE.UnrealBloomPass relies on LuminosityHighPassShader");var F=je.LuminosityHighPassShader;s.highPassUniforms=c.UniformsUtils.clone(F.uniforms),s.highPassUniforms.luminosityThreshold.value=l,s.highPassUniforms.smoothWidth.value=.01,s.materialHighPassFilter=new c.ShaderMaterial({uniforms:s.highPassUniforms,vertexShader:F.vertexShader,fragmentShader:F.fragmentShader,defines:{}}),s.separableBlurMaterials=[];var I=[3,5,7,9,11];x=Math.round(s.resolution.x/2),y=Math.round(s.resolution.y/2);for(var H=0;H<s.nMips;H++)s.separableBlurMaterials.push(s.getSeperableBlurMaterial(I[H])),s.separableBlurMaterials[H].uniforms.texSize.value=new c.Vector2(x,y),x=Math.round(x/2),y=Math.round(y/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 le=[1,.8,.6,.4,.2];s.compositeMaterial.uniforms.bloomFactors.value=le,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,Se.CopyShader===void 0&&console.error("THREE.UnrealBloomPass relies on CopyShader");var Z=Se.CopyShader;return s.copyUniforms=c.UniformsUtils.clone(Z.uniforms),s.copyUniforms.opacity.value=1,s.materialCopy=new c.ShaderMaterial({uniforms:s.copyUniforms,vertexShader:Z.vertexShader,fragmentShader:Z.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 Le.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 d=0;d<this.nMips;d++)this.renderTargetsHorizontal[d].setSize(l,s),this.renderTargetsVertical[d].setSize(l,s),this.separableBlurMaterials[d].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,d){a.getClearColor(this._oldClearColor),this.oldClearAlpha=a.getClearAlpha();var x=a.autoClear;a.autoClear=!1,a.setClearColor(this.clearColor,0),d&&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 y=this.renderTargetBright,b=0;b<this.nMips;b++)this.fsQuad.material=this.separableBlurMaterials[b],this.separableBlurMaterials[b].uniforms.colorTexture.value=y.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),y=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,d&&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=x},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 xe(n,t){return xe=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e},xe(n,t)}function Te(n,t){return xe(n,t)}function at(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),t&&Te(n,t)}function it(){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 Ce(n){return Ce=Object.setPrototypeOf?Object.getPrototypeOf:function(i){return i.__proto__||Object.getPrototypeOf(i)},Ce(n)}function Ae(n){return Ce(n)}function st(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function ot(n){return n&&n.constructor===Symbol?"symbol":typeof n}function ut(n,t){return t&&(ot(t)==="object"||typeof t=="function")?t:st(n)}function lt(n){var t=it();return function(){var e=Ae(n),r;if(t){var a=Ae(this).constructor;r=Reflect.construct(e,arguments,a)}else r=e.apply(this,arguments);return ut(this,r)}}var ct=n=>{var t={};return W.d(t,n),t},hr=n=>()=>n,Le=ct({FullScreenQuad:()=>Ue.FullScreenQuad,Pass:()=>Ue.Pass}),ft=n=>{var t={};return W.d(t,n),t},vr=n=>()=>n,je=ft({LuminosityHighPassShader:()=>Zt.LuminosityHighPassShader}),we=function(n){"use strict";at(i,n);var t=lt(i);function i(r,a,o,u){A(this,i);var s;s=t.call(this),s.strength=a!==void 0?a:1,s.radius=o,s.threshold=u,s.resolution=r!==void 0?new l.Vector2(r.x,r.y):new l.Vector2(256,256),s.clearColor=new l.Color(0,0,0);var d={minFilter:l.LinearFilter,magFilter:l.LinearFilter,format:l.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 l.WebGLRenderTarget(C,P,d),s.renderTargetBright.texture.name="UnrealBloomPass.bright",s.renderTargetBright.texture.generateMipmaps=!1;for(var b=0;b<s.nMips;b++){var y=new l.WebGLRenderTarget(C,P,d);y.texture.name="UnrealBloomPass.h".concat(b),y.texture.generateMipmaps=!1,s.renderTargetsHorizontal.push(y);var L=new l.WebGLRenderTarget(C,P,d);L.texture.name="UnrealBloomPass.v".concat(b),L.texture.generateMipmaps=!1,s.renderTargetsVertical.push(L),C=Math.round(C/2),P=Math.round(P/2)}je.LuminosityHighPassShader===void 0&&console.error("THREE.UnrealBloomPass relies on LuminosityHighPassShader");var N=je.LuminosityHighPassShader;s.highPassUniforms=l.UniformsUtils.clone(N.uniforms),s.highPassUniforms.luminosityThreshold.value=u,s.highPassUniforms.smoothWidth.value=.01,s.materialHighPassFilter=new l.ShaderMaterial({uniforms:s.highPassUniforms,vertexShader:N.vertexShader,fragmentShader:N.fragmentShader,defines:{}}),s.separableBlurMaterials=[];var I=[3,5,7,9,11];C=Math.round(s.resolution.x/2),P=Math.round(s.resolution.y/2);for(var H=0;H<s.nMips;H++)s.separableBlurMaterials.push(s.getSeperableBlurMaterial(I[H])),s.separableBlurMaterials[H].uniforms.texSize.value=new l.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 le=[1,.8,.6,.4,.2];s.compositeMaterial.uniforms.bloomFactors.value=le,s.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)],s.compositeMaterial.uniforms.bloomTintColors.value=s.bloomTintColors,Se.CopyShader===void 0&&console.error("THREE.UnrealBloomPass relies on CopyShader");var Y=Se.CopyShader;return s.copyUniforms=l.UniformsUtils.clone(Y.uniforms),s.copyUniforms.opacity.value=1,s.materialCopy=new l.ShaderMaterial({uniforms:s.copyUniforms,vertexShader:Y.vertexShader,fragmentShader:Y.fragmentShader,blending:l.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0}),s.enabled=!0,s.needsSwap=!1,s._oldClearColor=new l.Color,s.oldClearAlpha=1,s.basic=new l.MeshBasicMaterial,s.fsQuad=new Le.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 u=Math.round(a/2),s=Math.round(o/2);this.renderTargetBright.setSize(u,s);for(var d=0;d<this.nMips;d++)this.renderTargetsHorizontal[d].setSize(u,s),this.renderTargetsVertical[d].setSize(u,s),this.separableBlurMaterials[d].uniforms.texSize.value=new l.Vector2(u,s),u=Math.round(u/2),s=Math.round(s/2)},e.render=function(a,o,u,s,d){a.getClearColor(this._oldClearColor),this.oldClearAlpha=a.getClearAlpha();var C=a.autoClear;a.autoClear=!1,a.setClearColor(this.clearColor,0),d&&a.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=u.texture,a.setRenderTarget(null),a.clear(),this.fsQuad.render(a)),this.highPassUniforms.tDiffuse.value=u.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,d&&a.state.buffers.stencil.setTest(!0),this.renderToScreen?(a.setRenderTarget(null),this.fsQuad.render(a)):(a.setRenderTarget(u),this.fsQuad.render(a)),a.setClearColor(this._oldClearColor,this.oldClearAlpha),a.autoClear=C},e.getSeperableBlurMaterial=function(a){return new l.ShaderMaterial({defines:{KERNEL_RADIUS:a,SIGMA:a},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 );
@@ -29,7 +29,7 @@ void main() {
29
29
  }
30
30
  void main() {
31
31
  vec2 invSize = 1.0 / texSize; float fSigma = float(SIGMA); float weightSum = gaussianPdf(0.0, fSigma); float alphaSum = 0.0; vec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum; for( int i = 1; i < KERNEL_RADIUS; i ++ ) { float x = float(i); float w = gaussianPdf(x, fSigma); vec2 uvOffset = direction * invSize * x; vec4 sample1 = texture2D( colorTexture, vUv + uvOffset); vec4 sample2 = texture2D( colorTexture, vUv - uvOffset); diffuseSum += (sample1.rgb + sample2.rgb) * w; alphaSum += (sample1.a + sample2.a) * w; weightSum += 2.0 * w; } gl_FragColor = vec4(diffuseSum/weightSum, alphaSum/weightSum);
32
- }`})},e.getCompositeMaterial=function(a){return new c.ShaderMaterial({defines:{NUM_MIPS:a},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},dirtTexture:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:`varying vec2 vUv;
32
+ }`})},e.getCompositeMaterial=function(a){return new l.ShaderMaterial({defines:{NUM_MIPS:a},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},dirtTexture:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:`varying vec2 vUv;
33
33
  void main() {
34
34
  vUv = uv;
35
35
  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}(Le.Pass);we.BlurDirectionX=new c.Vector2(1,0),we.BlurDirectionY=new c.Vector2(0,1);var dt={threshold:.2,strength:.5,radius:0},ht=new c.MeshBasicMaterial({color:"black"}),vt=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 r=i.renderer,a=i.renderPass,o=i.finalComposer,l=i.getSize(),s=l.width,d=l.height,x=new we(new c.Vector2(s,d),e.strength,e.radius,e.threshold);this.bloomPass=x;var y=new Oe.EffectComposer(r);y.renderToScreen=!1,y.addPass(a),y.addPass(this.bloomPass),this.bloomComposer=y,this.bloomLayer.set(tt);var b=new c.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:y.renderTarget2.texture}},vertexShader:rt,fragmentShader:nt,defines:{}}),P=new be.ShaderPass(b,"baseTexture");P.needsSwap=!0,this.finalPass=P,o.addPass(P)}var t=n.prototype;return t.enable=function(){this.active||(this.finalPass.enabled=!0,this.bloomPass.enabled=!0,this.active=!0)},t.disable=function(){!this.active||(this.finalPass.enabled=!1,this.bloomPass.enabled=!1,this.active=!1)},t.render=function(e){if(!!this.active){var r=this,a=r.bloomComposer,o=r.bloomLayer,l=r.materials;e.traverse(function(s){var d=s;d.material&&o.test(d.layers)===!1&&(l[d.uuid]=d.material,d.material=d.isSprite?vt:ht)}),a.render(),e.traverse(function(s){var d=s;l[d.uuid]&&(d.material=l[d.uuid],delete l[d.uuid])})}},t.setSize=function(e,r){this.bloomComposer.setSize(e,r)},t.setGui=function(e){var r=this,a=new f({bloom:{threshold:{value:this.options.threshold,min:0,max:1,target:function(){return r.bloomPass}},strength:{value:this.options.strength,min:0,max:10,target:function(){return r.bloomPass}},radius:{value:this.options.radius,min:0,max:2,step:.01,target:function(){return r.bloomPass}}}});a.showGui(e)},t.dispose=function(){this.bloomPass.dispose(),this.materials={}},n}(),mt=n=>{var t={};return V.d(t,n),t},pr=n=>()=>n,gt=mt({OutlinePass:()=>Qt.OutlinePass}),_t={edgeStrength:3,edgeGlow:4,edgeThickness:1,pulsePeriod:0,rotate:!1,usePatternTexture:!1,visibleEdgeColor:"#5ee8e8",hiddenEdgeColor:"#190a05"},bt=function(){"use strict";function n(i,e){L(this,n),this.selectedObjects=[],this.active=!0,this.composerController=i,this.options=e;var r=i.scene,a=i.camera,o=i.finalComposer,l=i.getSize(),s=l.width,d=l.height,x=new gt.OutlinePass(new c.Vector2(s,d),r,a);x.selectedObjects=this.selectedObjects,this.outlinePass=x,o.addPass(x),this.setGui()}var t=n.prototype;return t.enable=function(){this.active||(this.outlinePass.enabled=!0,this.active=!0)},t.disable=function(){!this.active||(this.outlinePass.enabled=!1,this.active=!1)},t.setGui=function(){var e=this,r=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}}}});r.setTargetValueByParams(),this.outlineGui=r},t.dispose=function(){this.outlinePass.dispose(),this.selectedObjects=[]},n}();function Pt(n,t){if(n==null)return{};var i={},e=Object.keys(n),r,a;for(a=0;a<e.length;a++)r=e[a],!(t.indexOf(r)>=0)&&(i[r]=n[r]);return i}function yt(n,t){if(n==null)return{};var i=Pt(n,t),e,r;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(r=0;r<a.length;r++)e=a[r],!(t.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(n,e)||(i[e]=n[e]))}return i}var St=n=>{var t={};return V.d(t,n),t},mr=n=>()=>n,xt=St({SSRPass:()=>Yt.SSRPass}),Ct=n=>{var t={};return V.d(t,n),t},gr=n=>()=>n,wt=Ct({ReflectorForSSRPass:()=>$t.ReflectorForSSRPass}),Et={maxDistance:10,selects:!0},Rt={width:1,height:1,clipBias:3e-4,color:8947848,useDepthTexture:!0},Ot=function(){"use strict";function n(i,e){L(this,n),this.selectedObjects=[],this.active=!0,this.composerController=i,this.options=e;var r=i.scene,a=i.camera,o=i.renderer,l=i.finalComposer,s=i.getSize(),d=s.width,x=s.height,y=new xt.SSRPass({renderer:o,scene:r,camera:a,width:d,height:x,groundReflector:null,selects:this.selectedObjects});this.ssrPass=y,l.addPass(y),this.setGui()}var t=n.prototype;return t.addGroundReflector=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=(0,G.Z)({},Rt,e),a=r.width,o=r.height,l=yt(r,["width","height"]),s=this.composerController,d=s.scene,x=s.getSize(),y=new c.PlaneGeometry(a,o),b=new wt.ReflectorForSSRPass(y,A((0,G.Z)({},l),{textureWidth:x.width,textureHeight:x.height}));b.material.depthWrite=!1,b.rotation.x=-Math.PI/2,b.visible=!1,d.add(b),this.ssrPass.groundReflector=this.groundReflector,this.groundReflector=b},t.removeaGroundReflector=function(){this.ssrPass.groundReflector=null,this.groundReflector=void 0},t.enable=function(){this.active||(this.ssrPass.enabled=!0,this.active=!0)},t.disable=function(){!this.active||(this.ssrPass.enabled=!1,this.active=!1)},t.setSize=function(e,r){var a=this.groundReflector;a&&(a.getRenderTarget().setSize(e,r),a.resolution.set(e,r))},t.setGui=function(){var e=this,r=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]}}}});r.setTargetValueByParams(),this.ssrGui=r},t.dispose=function(){this.ssrPass.dispose(),this.selectedObjects=[]},n}(),Mt=function(){"use strict";function n(i){L(this,n),this.active=!0,this.options=i;var e=i.renderer,r=i.scene,a=i.camera,o=this.createRenderTarget(),l=new Oe.EffectComposer(e,o);l.setPixelRatio(e.getPixelRatio()),this.finalComposer=l,this.addRenderPasss(),this.renderer=e,this.scene=r,this.renderTarget=o,this.camera=a}var t=n.prototype;return t.createRenderTarget=function(){var e=this.options.composerParams,r=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},d;if(+c.REVISION<138&&r>0){var x=new c.WebGLMultisampleRenderTarget(l.width,l.height,s);x.samples=r,d=x}else if(+c.REVISION>=138&&r>0){var y=new c.WebGLRenderTarget(l.width,l.height,A((0,G.Z)({},s),{samples:r}));d=y}else{var b=new c.WebGLRenderTarget(l.width,l.height,s);d=b}return d.texture.name="EffectComposer.rt1",d},t.addRenderPasss=function(){var e=this.options,r=e.scene,a=e.camera,o=new ke.RenderPass(r,a);this.finalComposer.addPass(o),this.renderPass=o},t.addCopyPass=function(){var e=new be.ShaderPass(Se.CopyShader);this.finalComposer.addPass(e),this.copyPass=e},t.addGammaCorrectionPass=function(){var e=new be.ShaderPass(Ke.GammaCorrectionShader);this.finalComposer.addPass(e),this.gammaCorrectionPass=e},t.addFXAAPass=function(){var e=this.getSize(),r=e.width,a=e.height,o=new be.ShaderPass(qe.FXAAShader);this.finalComposer.addPass(o),this.fxaaPass=o,this.setFXAAPassSize(r,a)},t.addSMAAPass=function(){var e=this.getSize(),r=e.width,a=e.height,o=this.options.renderer,l=new Qe.SMAAPass(r*o.getPixelRatio(),a*o.getPixelRatio());this.finalComposer.addPass(l),this.smaaPass=l},t.addSSAAPass=function(){var e=this.options,r=e.scene,a=e.camera,o=new $e.SSAARenderPass(r,a,0,0);o.unbiased=!0,o.sampleLevel=1,this.finalComposer.addPass(o),this.ssaaPass=o},t.addBloomPass=function(e){var r=new pt(this,e);r.disable(),this.options.gui&&r.setGui(this.options.gui),this.bloomController=r},t.addOutlinePass=function(e){var r=new bt(this,e);r.disable(),this.options.gui&&r.outlineGui.showGui(this.options.gui),this.outlineController=r},t.addSSRPass=function(e){var r=new Ot(this,e);r.disable(),this.options.gui&&r.ssrGui.showGui(this.options.gui),this.ssrController=r},t.getSize=function(){var e=this.options.renderer;return e.getSize(new c.Vector2)},t.enable=function(){this.active||(this.active=!0)},t.disable=function(){!this.active||(this.active=!1)},t.checkCopyPass=function(){var e=this,r=this.finalComposer.passes.some(function(a){return a!==e.renderPass&&a!==e.copyPass?a.enabled:!1});r&&this.copyPass?this.copyPass.enabled=!1:!r&&this.copyPass?this.copyPass.enabled=!0:!r&&!this.copyPass&&this.addCopyPass()},t.setSize=function(e,r){var a,o;this.finalComposer.setSize(e,r),(a=this.bloomController)===null||a===void 0||a.setSize(e,r),(o=this.ssrController)===null||o===void 0||o.setSize(e,r),this.setFXAAPassSize(e,r)},t.setFXAAPassSize=function(e,r){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/(r*o)}},t.render=function(){var e;if(!!this.active){var r=this.options.scene;(e=this.bloomController)===null||e===void 0||e.render(r),this.finalComposer.render()}},t.dispose=function(){var e,r,a;(e=this.bloomController)===null||e===void 0||e.dispose(),(r=this.outlineController)===null||r===void 0||r.dispose(),(a=this.ssrController)===null||a===void 0||a.dispose(),this.finalComposer.passes.forEach(function(o){var l,s,d;(l=o.fsQuad)===null||l===void 0||l.dispose(),(s=o.fsQuad)===null||s===void 0||(d=s.material)===null||d===void 0||d.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}(),Ee=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:N.PO});var e=this.options,r=e.container,a=e.stats,o=e.gui,l=e.resizeObserver;if(o){var s=new u.default;s.open(!1),this.gui=s}if(a){var d=new q.default;d.showPanel(0),d.dom.style.position="absolute",r.appendChild(d.dom),this.stats=d}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),l&&this.initResizeObserver(),this.clock.getDelta(),this.clock.getElapsedTime()}var t=n.prototype;return t.use=function(e){for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;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(k(a))),this.installPlugins.set(e,!0)}},t.init=function(){var e=this.options,r=e.container,a=e.isdev,o=e.axesHelper,l=e.renderer,s=e.scene,d=e.camera,x=this.getSize(),y=x.width,b=x.height,P=new $({isdev:a,width:y,height:b,cameraParams:d});this.gui&&P.setGui(this.gui);var T=P.camera,F=new ne({camera:T,sceneParams:s}),I=F.scene,H=new w({width:y,height:b,scene:I,camera:T,isdev:a,rendererParams:A((0,G.Z)({},l),{outputEncoding:c.LinearEncoding,antialias:!1})});this.gui&&H.setGui(this.gui);var le=H.renderer;o&&F.addAxesHelper(),this.sceneController=F,this.rendererController=H,this.cameraController=P,r.appendChild(le.domElement)},t.initComposer=function(){var e=this.options,r=e.bloom,a=e.outline,o=e.ssr,l=e.renderer,s=e.bloomParams,d=e.outlineParams,x=e.ssrParams,y=e.multisampling,b=l.antialias;b==="msaa"&&!Me&&(b=!1,console.warn("MSAA is not supported on this browser"));var P=new Mt({renderer:this.renderer,scene:this.scene,camera:this.camera,gui:this.gui,composerParams:{multisampling:b==="msaa"?y:0,type:c.UnsignedByteType,encoding:l.outputEncoding}});this.composerController=P,b==="ssaa"&&P.addSSAAPass(),o&&P.addSSRPass(x),r&&P.addBloomPass(s),a&&P.addOutlinePass(d),l.outputEncoding===c.sRGBEncoding&&P.addGammaCorrectionPass(),b==="fxaa"?P.addFXAAPass():b==="smaa"&&P.addSMAAPass(),P.checkCopyPass(),this.event.on("passcheck",function(){P.checkCopyPass()})},t.initCSSRenderer=function(){var e=this.options,r=e.container,a=e.css2DRenderer,o=e.css3DRenderer,l=e.css2DRendererParams,s=e.css3DRendererParams;if(a||o){var d=new Ve(r);a&&d.addRenderer("css2d",l),o&&d.addRenderer("css3d",s),this.cssRendererController=d}},t.initControl=function(){var e=this.options,r=e.control,a=e.mapControl,o=e.controlParams;if(r){var l=new _({camera:this.camera,controlParams:{domElement:(o==null?void 0:o.domElement)||this.renderer.domElement},mapControl:a});this.controlController=l}},t.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},t.initResizeObserver=function(){var e=this,r=this.options.container;if(!this.resizeObserver){var a=new ResizeObserver(function(o){var l=!0,s=!1,d=void 0;try{for(var x=o[Symbol.iterator](),y;!(l=(y=x.next()).done);l=!0){var b=y.value,P=b.contentRect;e.handeleResize(P.width,P.height),e.render()}}catch(T){s=!0,d=T}finally{try{!l&&x.return!=null&&x.return()}finally{if(s)throw d}}});a.observe(r),this.resizeObserver=a}},t.handeleResize=function(e,r){var a=this,o=a.rendererController,l=a.cameraController,s=a.composerController,d=a.cssRendererController;l==null||l.setSize(e,r),o==null||o.setSize(e,r),s==null||s.setSize(e,r),d==null||d.setSize(e,r),this.installPlugins.forEach(function(x,y){var b;(b=y.resize)===null||b===void 0||b.call(y,{width:e,height:r})}),this.event.emit("resize",{width:e,height:r})},t.pick=function(e,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=this,l=o.raycaster,s=o.options,d=s.container,x=new c.Vector2,y=d.getBoundingClientRect();if(x.x=(e.clientX-y.left)/(y.right-y.left)*2-1,x.y=-((e.clientY-y.top)/(y.bottom-y.top))*2+1,this.camera&&this.scene){l.setFromCamera(x,this.camera);var b=l.intersectObjects(r||this.scene.children,a);if(b.length)return{object:b[0].object,intersects:b}}},t.render=function(){var e,r,a,o,l=this,s=l.renderer,d=l.scene,x=l.camera,y=l.clock;if(!(!s||!d||!x||this.options.staticRender&&!this.cameraController.checkCameraChange())){var b=y.getDelta(),P=y.getElapsedTime();if(s.clear(),(e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(F,I){var H;(H=I.update)===null||H===void 0||H.call(I,b,P)}),!((r=this.composerController)===null||r===void 0)&&r.active)this.composerController.render();else{var T;(T=this.rendererController)===null||T===void 0||T.render()}(a=this.cssRendererController)===null||a===void 0||a.render(d,x),(o=this.stats)===null||o===void 0||o.update(),this.event.emit("render",{delta:b,elapsed:P})}},t.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},t.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},t.dispose=function(){var e,r,a,o,l,s,d;this.stop(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(x,y){var b;(b=y.dispose)===null||b===void 0||b.call(y)}),(r=this.controlController)===null||r===void 0||r.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,(d=this.gui)===null||d===void 0||d.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},C(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}();Ee.options={isdev:ge,stats:ge,gui:ge,axesHelper:ge,control:ge,resizeObserver:!0,renderer:A((0,G.Z)({},S),{antialias:Me?"msaa":"smaa"}),staticRender:!1,multisampling:8,scene:K,camera:E,bloom:!1,bloomParams:dt,outline:!1,outlineParams:_t,css2DRenderer:!1,ssr:!1,ssrParams:Et,css2DRendererParams:(0,G.Z)({},fe),css3DRenderer:!1,css3DRendererParams:(0,G.Z)({},fe)};function Tt(){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,t,i){return Tt()?Pe=Reflect.construct:Pe=function(r,a,o){var l=[null];l.push.apply(l,a);var s=Function.bind.apply(r,l),d=new s;return o&&Te(d,o.prototype),d},Pe.apply(null,arguments)}function De(n,t,i){return Pe.apply(null,arguments)}var At=V(484);function Lt(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i={};return i.promise=new Promise(function(e,r){i.resolve=e,i.reject=r}),n&&(i.promise=(0,At.Z)(i.promise,t)),i}var jt=n=>{var t={};return V.d(t,n),t},_r=n=>()=>n,Dt=jt({CSS2DObject:()=>Jt.CSS2DObject}),ze=function(n){n&&((0,N.wf)(n),n.children.forEach(function(t){t.userData.BaseObject_||ze(t)}))},zt=function(){"use strict";function n(){L(this,n),this.objecttype__="BaseObject",this.userData={},this.pm=Lt(),this.visible=!1}var t=n.prototype;return t.init=function(){},t.create=function(){},t.render=function(){},t.update=function(e,r){},t.resize=function(e,r){},t.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},t.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},t.isVisible=function(){return this.visible},t.createMesh=function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return this.object3d=De(c.Mesh,k(r)),this},t.createGroup=function(){return this.object3d=new c.Group,this},t.createPoints=function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return this.object3d=De(c.Points,k(r)),this},t.createCSS2DObject=function(e){return this.object3d=new Dt.CSS2DObject(e),this},t.createCSS3DObject=function(e){return this.object3d=new J.CSS3DObject(e),this},t.createCSS3DSprite=function(e){return this.object3d=new J.CSS3DSprite(e),this},t.createSprite=function(e){return this.object3d=new c.Sprite(e),this},t.add=function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];var o;return(o=this.object3d).add.apply(o,k(r)),this},t.remove=function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];var o;return(o=this.object3d).remove.apply(o,k(r)),this},t.getSize=function(){var e=new c.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new c.Vector3)}},t.traverse=function(e){e(this),this.children.forEach(function(r){r.traverse(e)})},t.dispose=function(){ze(this.object3d)},C(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 er=_e.L6,tr=_e.sb,rr=_e.z,nr=_e.ZP;export{er as BaseObject,tr as GUIObject,rr as Pencil,nr as default};
57
+ }`})},i}(Le.Pass);we.BlurDirectionX=new l.Vector2(1,0),we.BlurDirectionY=new l.Vector2(0,1);var dt={threshold:.2,strength:.5,radius:0},ht=new l.MeshBasicMaterial({color:"black"}),vt=new l.SpriteMaterial({color:"#000"}),pt=function(){"use strict";function n(i,e){A(this,n),this.materials={},this.bloomLayer=new l.Layers,this.active=!0,this.composerController=i,this.options=e;var r=i.renderer,a=i.renderPass,o=i.finalComposer,u=i.getSize(),s=u.width,d=u.height,C=new we(new l.Vector2(s,d),e.strength,e.radius,e.threshold);this.bloomPass=C;var P=new Oe.EffectComposer(r);P.renderToScreen=!1,P.addPass(a),P.addPass(this.bloomPass),this.bloomComposer=P,this.bloomLayer.set(tt);var b=new l.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:P.renderTarget2.texture}},vertexShader:rt,fragmentShader:nt,defines:{}}),y=new ye.ShaderPass(b,"baseTexture");y.needsSwap=!0,this.finalPass=y,o.addPass(y)}var t=n.prototype;return t.enable=function(){this.active||(this.finalPass.enabled=!0,this.bloomPass.enabled=!0,this.active=!0)},t.disable=function(){!this.active||(this.finalPass.enabled=!1,this.bloomPass.enabled=!1,this.active=!1)},t.render=function(e){if(!!this.active){var r=this,a=r.bloomComposer,o=r.bloomLayer,u=r.materials;e.traverse(function(s){var d=s;d.material&&o.test(d.layers)===!1&&(u[d.uuid]=d.material,d.material=d.isSprite?vt:ht)}),a.render(),e.traverse(function(s){var d=s;u[d.uuid]&&(d.material=u[d.uuid],delete u[d.uuid])})}},t.setSize=function(e,r){this.bloomComposer.setSize(e,r)},t.setGui=function(e){var r=this,a=new v({bloom:{threshold:{value:this.options.threshold,min:0,max:1,target:function(){return r.bloomPass}},strength:{value:this.options.strength,min:0,max:10,target:function(){return r.bloomPass}},radius:{value:this.options.radius,min:0,max:2,step:.01,target:function(){return r.bloomPass}}}});a.showGui(e)},t.dispose=function(){this.bloomPass.dispose(),this.materials={}},n}(),mt=n=>{var t={};return W.d(t,n),t},pr=n=>()=>n,gt=mt({OutlinePass:()=>Qt.OutlinePass}),_t={edgeStrength:3,edgeGlow:4,edgeThickness:1,pulsePeriod:0,rotate:!1,usePatternTexture:!1,visibleEdgeColor:"#5ee8e8",hiddenEdgeColor:"#190a05"},bt=function(){"use strict";function n(i,e){A(this,n),this.selectedObjects=[],this.active=!0,this.composerController=i,this.options=e;var r=i.scene,a=i.camera,o=i.finalComposer,u=i.getSize(),s=u.width,d=u.height,C=new gt.OutlinePass(new l.Vector2(s,d),r,a);C.selectedObjects=this.selectedObjects,this.outlinePass=C,o.addPass(C),this.setGui()}var t=n.prototype;return t.enable=function(){this.active||(this.outlinePass.enabled=!0,this.active=!0)},t.disable=function(){!this.active||(this.outlinePass.enabled=!1,this.active=!1)},t.setGui=function(){var e=this,r=new v({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}}}});r.setTargetValueByParams(),this.outlineGui=r},t.dispose=function(){this.outlinePass.dispose(),this.selectedObjects=[]},n}();function yt(n,t){if(n==null)return{};var i={},e=Object.keys(n),r,a;for(a=0;a<e.length;a++)r=e[a],!(t.indexOf(r)>=0)&&(i[r]=n[r]);return i}function Pt(n,t){if(n==null)return{};var i=yt(n,t),e,r;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(r=0;r<a.length;r++)e=a[r],!(t.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(n,e)||(i[e]=n[e]))}return i}var St=n=>{var t={};return W.d(t,n),t},mr=n=>()=>n,xt=St({SSRPass:()=>Yt.SSRPass}),Ct=n=>{var t={};return W.d(t,n),t},gr=n=>()=>n,wt=Ct({ReflectorForSSRPass:()=>$t.ReflectorForSSRPass}),Et={maxDistance:10,selects:!0},Rt={width:1,height:1,clipBias:3e-4,color:8947848,useDepthTexture:!0},Ot=function(){"use strict";function n(i,e){A(this,n),this.selectedObjects=[],this.active=!0,this.composerController=i,this.options=e;var r=i.scene,a=i.camera,o=i.renderer,u=i.finalComposer,s=i.getSize(),d=s.width,C=s.height,P=new xt.SSRPass({renderer:o,scene:r,camera:a,width:d,height:C,groundReflector:null,selects:this.selectedObjects});this.ssrPass=P,u.addPass(P),this.setGui()}var t=n.prototype;return t.addGroundReflector=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=(0,G.Z)({},Rt,e),a=r.width,o=r.height,u=Pt(r,["width","height"]),s=this.composerController,d=s.scene,C=s.getSize(),P=new l.PlaneGeometry(a,o),b=new wt.ReflectorForSSRPass(P,R((0,G.Z)({},u),{textureWidth:C.width,textureHeight:C.height}));b.material.depthWrite=!1,b.rotation.x=-Math.PI/2,b.visible=!1,d.add(b),this.ssrPass.groundReflector=this.groundReflector,this.groundReflector=b},t.removeaGroundReflector=function(){this.ssrPass.groundReflector=null,this.groundReflector=void 0},t.enable=function(){this.active||(this.ssrPass.enabled=!0,this.active=!0)},t.disable=function(){!this.active||(this.ssrPass.enabled=!1,this.active=!1)},t.setSize=function(e,r){var a=this.groundReflector;a&&(a.getRenderTarget().setSize(e,r),a.resolution.set(e,r))},t.setGui=function(){var e=this,r=new v({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]}}}});r.setTargetValueByParams(),this.ssrGui=r},t.dispose=function(){this.ssrPass.dispose(),this.selectedObjects=[]},n}(),Mt=function(){"use strict";function n(i){A(this,n),this.active=!0,this.options=i;var e=i.renderer,r=i.scene,a=i.camera,o=this.createRenderTarget(),u=new Oe.EffectComposer(e,o);u.setPixelRatio(e.getPixelRatio()),this.finalComposer=u,this.addRenderPasss(),this.renderer=e,this.scene=r,this.renderTarget=o,this.camera=a}var t=n.prototype;return t.createRenderTarget=function(){var e=this.options.composerParams,r=e.multisampling,a=e.type,o=e.encoding,u=this.getSize(),s={minFilter:l.LinearFilter,magFilter:l.LinearFilter,format:l.RGBAFormat,encoding:o,type:a},d;if(+l.REVISION<138&&r>0){var C=new l.WebGLMultisampleRenderTarget(u.width,u.height,s);C.samples=r,d=C}else if(+l.REVISION>=138&&r>0){var P=new l.WebGLRenderTarget(u.width,u.height,R((0,G.Z)({},s),{samples:r}));d=P}else{var b=new l.WebGLRenderTarget(u.width,u.height,s);d=b}return d.texture.name="EffectComposer.rt1",d},t.addRenderPasss=function(){var e=this.options,r=e.scene,a=e.camera,o=new ke.RenderPass(r,a);this.finalComposer.addPass(o),this.renderPass=o},t.addCopyPass=function(){var e=new ye.ShaderPass(Se.CopyShader);this.finalComposer.addPass(e),this.copyPass=e},t.addGammaCorrectionPass=function(){var e=new ye.ShaderPass(Ke.GammaCorrectionShader);this.finalComposer.addPass(e),this.gammaCorrectionPass=e},t.addFXAAPass=function(){var e=this.getSize(),r=e.width,a=e.height,o=new ye.ShaderPass(qe.FXAAShader);this.finalComposer.addPass(o),this.fxaaPass=o,this.setFXAAPassSize(r,a)},t.addSMAAPass=function(){var e=this.getSize(),r=e.width,a=e.height,o=this.options.renderer,u=new Qe.SMAAPass(r*o.getPixelRatio(),a*o.getPixelRatio());this.finalComposer.addPass(u),this.smaaPass=u},t.addSSAAPass=function(){var e=this.options,r=e.scene,a=e.camera,o=new $e.SSAARenderPass(r,a,0,0);o.unbiased=!0,o.sampleLevel=1,this.finalComposer.addPass(o),this.ssaaPass=o},t.addBloomPass=function(e){var r=new pt(this,e);r.disable(),this.options.gui&&r.setGui(this.options.gui),this.bloomController=r},t.addOutlinePass=function(e){var r=new bt(this,e);r.disable(),this.options.gui&&r.outlineGui.showGui(this.options.gui),this.outlineController=r},t.addSSRPass=function(e){var r=new Ot(this,e);r.disable(),this.options.gui&&r.ssrGui.showGui(this.options.gui),this.ssrController=r},t.getSize=function(){var e=this.options.renderer;return e.getSize(new l.Vector2)},t.enable=function(){this.active||(this.active=!0)},t.disable=function(){!this.active||(this.active=!1)},t.checkCopyPass=function(){var e=this,r=this.finalComposer.passes.some(function(a){return a!==e.renderPass&&a!==e.copyPass?a.enabled:!1});r&&this.copyPass?this.copyPass.enabled=!1:!r&&this.copyPass?this.copyPass.enabled=!0:!r&&!this.copyPass&&this.addCopyPass()},t.setSize=function(e,r){var a,o;this.finalComposer.setSize(e,r),(a=this.bloomController)===null||a===void 0||a.setSize(e,r),(o=this.ssrController)===null||o===void 0||o.setSize(e,r),this.setFXAAPassSize(e,r)},t.setFXAAPassSize=function(e,r){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/(r*o)}},t.render=function(){var e;if(!!this.active){var r=this.options.scene;(e=this.bloomController)===null||e===void 0||e.render(r),this.finalComposer.render()}},t.dispose=function(){var e,r,a;(e=this.bloomController)===null||e===void 0||e.dispose(),(r=this.outlineController)===null||r===void 0||r.dispose(),(a=this.ssrController)===null||a===void 0||a.dispose(),this.finalComposer.passes.forEach(function(o){var u,s,d;(u=o.fsQuad)===null||u===void 0||u.dispose(),(s=o.fsQuad)===null||s===void 0||(d=s.material)===null||d===void 0||d.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}(),Ee=function(){"use strict";function n(i){A(this,n),this.raycaster=new l.Raycaster,this.installPlugins=new Map,this.event=new Q.EventEmitter,this.clock=new l.Clock,this.options=(0,ne.default)(n.options,i,{isMergeableObject:V.PO});var e=this.options,r=e.container,a=e.stats,o=e.gui,u=e.resizeObserver;if(o){var s=new c.default;s.open(!1),this.gui=s}if(a){var d=new Z.default;d.showPanel(0),d.dom.style.position="absolute",r.appendChild(d.dom),this.stats=d}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),u&&this.initResizeObserver(),this.clock.getDelta(),this.clock.getElapsedTime()}var t=n.prototype;return t.use=function(e){for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[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(a))),this.installPlugins.set(e,!0)}},t.init=function(){var e=this.options,r=e.container,a=e.isdev,o=e.axesHelper,u=e.renderer,s=e.scene,d=e.camera,C=this.getSize(),P=C.width,b=C.height,y=new ee({isdev:a,width:P,height:b,cameraParams:d});this.gui&&y.setGui(this.gui);var L=y.camera,N=new de({camera:L,sceneParams:s}),I=N.scene,H=new w({width:P,height:b,scene:I,camera:L,isdev:a,rendererParams:R((0,G.Z)({},u),{outputEncoding:l.LinearEncoding,antialias:!1})});this.gui&&H.setGui(this.gui);var le=H.renderer;o&&N.addAxesHelper(),this.sceneController=N,this.rendererController=H,this.cameraController=y,r.appendChild(le.domElement)},t.initComposer=function(){var e=this.options,r=e.bloom,a=e.outline,o=e.ssr,u=e.renderer,s=e.bloomParams,d=e.outlineParams,C=e.ssrParams,P=e.multisampling,b=u.antialias;b==="msaa"&&!Me&&(b=!1,console.warn("MSAA is not supported on this browser"));var y=new Mt({renderer:this.renderer,scene:this.scene,camera:this.camera,gui:this.gui,composerParams:{multisampling:b==="msaa"?P:0,type:l.UnsignedByteType,encoding:u.outputEncoding}});this.composerController=y,b==="ssaa"&&y.addSSAAPass(),o&&y.addSSRPass(C),r&&y.addBloomPass(s),a&&y.addOutlinePass(d),u.outputEncoding===l.sRGBEncoding&&y.addGammaCorrectionPass(),b==="fxaa"?y.addFXAAPass():b==="smaa"&&y.addSMAAPass(),y.checkCopyPass(),this.event.on("passcheck",function(){y.checkCopyPass()})},t.initCSSRenderer=function(){var e=this.options,r=e.container,a=e.css2DRenderer,o=e.css3DRenderer,u=e.css2DRendererParams,s=e.css3DRendererParams;if(a||o){var d=new Ve(r);a&&d.addRenderer("css2d",u),o&&d.addRenderer("css3d",s),this.cssRendererController=d}},t.initControl=function(){var e=this.options,r=e.control,a=e.mapControl,o=e.controlParams;if(r){var u=new _({camera:this.camera,controlParams:{domElement:(o==null?void 0:o.domElement)||this.renderer.domElement},mapControl:a});this.controlController=u}},t.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},t.initResizeObserver=function(){var e=this,r=this.options.container;if(!this.resizeObserver){var a=new ResizeObserver(function(o){var u=!0,s=!1,d=void 0;try{for(var C=o[Symbol.iterator](),P;!(u=(P=C.next()).done);u=!0){var b=P.value,y=b.contentRect;e.handeleResize(y.width,y.height),e.render()}}catch(L){s=!0,d=L}finally{try{!u&&C.return!=null&&C.return()}finally{if(s)throw d}}});a.observe(r),this.resizeObserver=a}},t.handeleResize=function(e,r){var a=this,o=a.rendererController,u=a.cameraController,s=a.composerController,d=a.cssRendererController;u==null||u.setSize(e,r),o==null||o.setSize(e,r),s==null||s.setSize(e,r),d==null||d.setSize(e,r),this.installPlugins.forEach(function(C,P){var b;(b=P.resize)===null||b===void 0||b.call(P,{width:e,height:r})}),this.event.emit("resize",{width:e,height:r})},t.pick=function(e,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=this,u=o.raycaster,s=o.options,d=s.container,C=new l.Vector2,P=d.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){u.setFromCamera(C,this.camera);var b=u.intersectObjects(r||this.scene.children,a);if(b.length)return{object:b[0].object,intersects:b}}},t.render=function(){var e,r,a,o,u=this,s=u.renderer,d=u.scene,C=u.camera,P=u.clock;if(!(!s||!d||!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,I){var H;(H=I.update)===null||H===void 0||H.call(I,b,y)}),!((r=this.composerController)===null||r===void 0)&&r.active)this.composerController.render();else{var L;(L=this.rendererController)===null||L===void 0||L.render()}(a=this.cssRendererController)===null||a===void 0||a.render(d,C),(o=this.stats)===null||o===void 0||o.update(),this.event.emit("render",{delta:b,elapsed:y})}},t.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},t.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},t.dispose=function(){var e,r,a,o,u,s,d;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)}),(r=this.controlController)===null||r===void 0||r.dispose(),(a=this.cssRendererController)===null||a===void 0||a.dispose(),(o=this.sceneController)===null||o===void 0||o.dispose(),(u=this.composerController)===null||u===void 0||u.dispose(),(s=this.rendererController)===null||s===void 0||s.dispose(),this.controlController=void 0,this.cssRendererController=void 0,(d=this.gui)===null||d===void 0||d.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}();Ee.options={isdev:_e,stats:_e,gui:_e,axesHelper:_e,control:_e,resizeObserver:!0,renderer:R((0,G.Z)({},S),{antialias:Me?"msaa":"smaa"}),staticRender:!1,multisampling:8,scene:K,camera:M,bloom:!1,bloomParams:dt,outline:!1,outlineParams:_t,css2DRenderer:!1,ssr:!1,ssrParams:Et,css2DRendererParams:(0,G.Z)({},fe),css3DRenderer:!1,css3DRendererParams:(0,G.Z)({},fe)};function Tt(){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,t,i){return Tt()?Pe=Reflect.construct:Pe=function(r,a,o){var u=[null];u.push.apply(u,a);var s=Function.bind.apply(r,u),d=new s;return o&&Te(d,o.prototype),d},Pe.apply(null,arguments)}function De(n,t,i){return Pe.apply(null,arguments)}var At=W(484);function Lt(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i={};return i.promise=new Promise(function(e,r){i.resolve=e,i.reject=r}),n&&(i.promise=(0,At.Z)(i.promise,t)),i}var jt=n=>{var t={};return W.d(t,n),t},_r=n=>()=>n,Dt=jt({CSS2DObject:()=>Jt.CSS2DObject}),ze=function(n){n&&((0,V.wf)(n),n.children.forEach(function(t){t.userData.BaseObject_||ze(t)}))},zt=function(){"use strict";function n(){A(this,n),this.objecttype__="BaseObject",this.userData={},this.pm=Lt(),this.visible=!1}var t=n.prototype;return t.init=function(){},t.create=function(){},t.render=function(){},t.update=function(e,r){},t.resize=function(e,r){},t.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},t.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},t.isVisible=function(){return this.visible},t.createMesh=function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return this.object3d=De(l.Mesh,k(r)),this},t.createGroup=function(){return this.object3d=new l.Group,this},t.createPoints=function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return this.object3d=De(l.Points,k(r)),this},t.createCSS2DObject=function(e){return this.object3d=new Dt.CSS2DObject(e),this},t.createCSS3DObject=function(e){return this.object3d=new J.CSS3DObject(e),this},t.createCSS3DSprite=function(e){return this.object3d=new J.CSS3DSprite(e),this},t.createSprite=function(e){return this.object3d=new l.Sprite(e),this},t.add=function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];var o;return(o=this.object3d).add.apply(o,k(r)),this},t.remove=function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];var o;return(o=this.object3d).remove.apply(o,k(r)),this},t.getSize=function(){var e=new l.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new l.Vector3)}},t.traverse=function(e){e(this),this.children.forEach(function(r){r.traverse(e)})},t.dispose=function(){ze(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 er=be.L6,tr=be.sb,rr=be.z,nr=be.ZP;export{er as BaseObject,tr as GUIObject,rr as Pencil,nr as default};
@@ -9,10 +9,11 @@ interface Options {
9
9
  coordinatesArr?: Coordinate[][];
10
10
  material?: THREE.Material | THREE.Material[];
11
11
  materialOptions?: MaterialOptions;
12
- depth: number;
12
+ depth: number | number[];
13
13
  cache?: Cache;
14
14
  useGroups?: boolean;
15
- workerController?: WorkerController;
15
+ worker?: WorkerController;
16
+ workerKey?: string;
16
17
  projection?: {
17
18
  center: [number, number];
18
19
  scale: number;
@@ -1,4 +1,4 @@
1
- (function(){var rt={666:function(L){var z=function(P){"use strict";var C=Object.prototype,j=C.hasOwnProperty,E,k=typeof Symbol=="function"?Symbol:{},I=k.iterator||"@@iterator",D=k.asyncIterator||"@@asyncIterator",G=k.toStringTag||"@@toStringTag";function M(f,l,v){return Object.defineProperty(f,l,{value:v,enumerable:!0,configurable:!0,writable:!0}),f[l]}try{M({},"")}catch(f){M=function(l,v,O){return l[v]=O}}function F(f,l,v,O){var A=l&&l.prototype instanceof Q?l:Q,K=Object.create(A.prototype),se=new q(O||[]);return K._invoke=ve(f,v,se),K}P.wrap=F;function N(f,l,v){try{return{type:"normal",arg:f.call(l,v)}}catch(O){return{type:"throw",arg:O}}}var V="suspendedStart",c="suspendedYield",pe="executing",J="completed",W={};function Q(){}function R(){}function B(){}var H={};M(H,I,function(){return this});var ne=Object.getPrototypeOf,ee=ne&&ne(ne(ge([])));ee&&ee!==C&&j.call(ee,I)&&(H=ee);var $=B.prototype=Q.prototype=Object.create(H);R.prototype=B,M($,"constructor",B),M(B,"constructor",R),R.displayName=M(B,G,"GeneratorFunction");function Z(f){["next","throw","return"].forEach(function(l){M(f,l,function(v){return this._invoke(l,v)})})}P.isGeneratorFunction=function(f){var l=typeof f=="function"&&f.constructor;return l?l===R||(l.displayName||l.name)==="GeneratorFunction":!1},P.mark=function(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,B):(f.__proto__=B,M(f,G,"GeneratorFunction")),f.prototype=Object.create($),f},P.awrap=function(f){return{__await:f}};function oe(f,l){function v(K,se,ue,ie){var re=N(f[K],f,se);if(re.type==="throw")ie(re.arg);else{var je=re.arg,Se=je.value;return Se&&typeof Se=="object"&&j.call(Se,"__await")?l.resolve(Se.__await).then(function(xe){v("next",xe,ue,ie)},function(xe){v("throw",xe,ue,ie)}):l.resolve(Se).then(function(xe){je.value=xe,ue(je)},function(xe){return v("throw",xe,ue,ie)})}}var O;function A(K,se){function ue(){return new l(function(ie,re){v(K,se,ie,re)})}return O=O?O.then(ue,ue):ue()}this._invoke=A}Z(oe.prototype),M(oe.prototype,D,function(){return this}),P.AsyncIterator=oe,P.async=function(f,l,v,O,A){A===void 0&&(A=Promise);var K=new oe(F(f,l,v,O),A);return P.isGeneratorFunction(l)?K:K.next().then(function(se){return se.done?se.value:K.next()})};function ve(f,l,v){var O=V;return function(K,se){if(O===pe)throw new Error("Generator is already running");if(O===J){if(K==="throw")throw se;return ze()}for(v.method=K,v.arg=se;;){var ue=v.delegate;if(ue){var ie=te(ue,v);if(ie){if(ie===W)continue;return ie}}if(v.method==="next")v.sent=v._sent=v.arg;else if(v.method==="throw"){if(O===V)throw O=J,v.arg;v.dispatchException(v.arg)}else v.method==="return"&&v.abrupt("return",v.arg);O=pe;var re=N(f,l,v);if(re.type==="normal"){if(O=v.done?J:c,re.arg===W)continue;return{value:re.arg,done:v.done}}else re.type==="throw"&&(O=J,v.method="throw",v.arg=re.arg)}}}function te(f,l){var v=f.iterator[l.method];if(v===E){if(l.delegate=null,l.method==="throw"){if(f.iterator.return&&(l.method="return",l.arg=E,te(f,l),l.method==="throw"))return W;l.method="throw",l.arg=new TypeError("The iterator does not provide a 'throw' method")}return W}var O=N(v,f.iterator,l.arg);if(O.type==="throw")return l.method="throw",l.arg=O.arg,l.delegate=null,W;var A=O.arg;if(!A)return l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,W;if(A.done)l[f.resultName]=A.value,l.next=f.nextLoc,l.method!=="return"&&(l.method="next",l.arg=E);else return A;return l.delegate=null,W}Z($),M($,G,"Generator"),M($,I,function(){return this}),M($,"toString",function(){return"[object Generator]"});function be(f){var l={tryLoc:f[0]};1 in f&&(l.catchLoc=f[1]),2 in f&&(l.finallyLoc=f[2],l.afterLoc=f[3]),this.tryEntries.push(l)}function Y(f){var l=f.completion||{};l.type="normal",delete l.arg,f.completion=l}function q(f){this.tryEntries=[{tryLoc:"root"}],f.forEach(be,this),this.reset(!0)}P.keys=function(f){var l=[];for(var v in f)l.push(v);return l.reverse(),function O(){for(;l.length;){var A=l.pop();if(A in f)return O.value=A,O.done=!1,O}return O.done=!0,O}};function ge(f){if(f){var l=f[I];if(l)return l.call(f);if(typeof f.next=="function")return f;if(!isNaN(f.length)){var v=-1,O=function A(){for(;++v<f.length;)if(j.call(f,v))return A.value=f[v],A.done=!1,A;return A.value=E,A.done=!0,A};return O.next=O}}return{next:ze}}P.values=ge;function ze(){return{value:E,done:!0}}return q.prototype={constructor:q,reset:function(f){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(Y),!f)for(var l in this)l.charAt(0)==="t"&&j.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=E)},stop:function(){this.done=!0;var f=this.tryEntries[0],l=f.completion;if(l.type==="throw")throw l.arg;return this.rval},dispatchException:function(f){if(this.done)throw f;var l=this;function v(ie,re){return K.type="throw",K.arg=f,l.next=ie,re&&(l.method="next",l.arg=E),!!re}for(var O=this.tryEntries.length-1;O>=0;--O){var A=this.tryEntries[O],K=A.completion;if(A.tryLoc==="root")return v("end");if(A.tryLoc<=this.prev){var se=j.call(A,"catchLoc"),ue=j.call(A,"finallyLoc");if(se&&ue){if(this.prev<A.catchLoc)return v(A.catchLoc,!0);if(this.prev<A.finallyLoc)return v(A.finallyLoc)}else if(se){if(this.prev<A.catchLoc)return v(A.catchLoc,!0)}else if(ue){if(this.prev<A.finallyLoc)return v(A.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(f,l){for(var v=this.tryEntries.length-1;v>=0;--v){var O=this.tryEntries[v];if(O.tryLoc<=this.prev&&j.call(O,"finallyLoc")&&this.prev<O.finallyLoc){var A=O;break}}A&&(f==="break"||f==="continue")&&A.tryLoc<=l&&l<=A.finallyLoc&&(A=null);var K=A?A.completion:{};return K.type=f,K.arg=l,A?(this.method="next",this.next=A.finallyLoc,W):this.complete(K)},complete:function(f,l){if(f.type==="throw")throw f.arg;return f.type==="break"||f.type==="continue"?this.next=f.arg:f.type==="return"?(this.rval=this.arg=f.arg,this.method="return",this.next="end"):f.type==="normal"&&l&&(this.next=l),W},finish:function(f){for(var l=this.tryEntries.length-1;l>=0;--l){var v=this.tryEntries[l];if(v.finallyLoc===f)return this.complete(v.completion,v.afterLoc),Y(v),W}},catch:function(f){for(var l=this.tryEntries.length-1;l>=0;--l){var v=this.tryEntries[l];if(v.tryLoc===f){var O=v.completion;if(O.type==="throw"){var A=O.arg;Y(v)}return A}}throw new Error("illegal catch attempt")},delegateYield:function(f,l,v){return this.delegate={iterator:ge(f),resultName:l,nextLoc:v},this.method==="next"&&(this.arg=E),W}},P}(L.exports);try{regeneratorRuntime=z}catch(P){typeof globalThis=="object"?globalThis.regeneratorRuntime=z:Function("r","regeneratorRuntime = r")(z)}},695:function(L,z,P){"use strict";P.d(z,{Z:function(){return C}});function C(j){if(j.geometry&&j.geometry.dispose(),j.material){var E=Array.isArray(j.material)?j.material:[j.material];E.forEach(function(k){var I,D,G,M,F,N,V,c,pe,J,W,Q,R;(I=k.map)===null||I===void 0||I.dispose(),(D=k.lightMap)===null||D===void 0||D.dispose(),(G=k.bumpMap)===null||G===void 0||G.dispose(),(M=k.normalMap)===null||M===void 0||M.dispose(),(F=k.specularMap)===null||F===void 0||F.dispose(),(N=k.envMap)===null||N===void 0||N.dispose(),(V=k.alphaMap)===null||V===void 0||V.dispose(),(c=k.aoMap)===null||c===void 0||c.dispose(),(pe=k.displacementMap)===null||pe===void 0||pe.dispose(),(J=k.emissiveMap)===null||J===void 0||J.dispose(),(W=k.gradientMap)===null||W===void 0||W.dispose(),(Q=k.metalnessMap)===null||Q===void 0||Q.dispose(),(R=k.roughnessMap)===null||R===void 0||R.dispose(),k.dispose()})}}},519:function(L,z,P){"use strict";P.d(z,{disposeMesh:function(){return k.Z}});var C=P(666),j=P.n(C),E=null,k=P(695),I=P(644);function D(W){if(W.material){var Q=Array.isArray(W.material)?W.material:[W.material];Q.forEach(function(R){var B,H;(B=R.color)===null||B===void 0||B.convertSRGBToLinear(),(H=R.emissive)===null||H===void 0||H.convertSRGBToLinear(),R.map&&(R.map.encoding=THREE.sRGBEncoding),R.emissiveMap&&(R.emissiveMap.encoding=THREE.sRGBEncoding)})}}var G=P(568),M=P(924),F=require("idb-keyval"),N=P(484),V=null,c=null,pe=function(){var W=(0,G.Z)(j().mark(function Q(R,B){var H,ne,ee,$,Z,oe;return j().wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return H=B.version,te.next=4,(0,F.get)(R);case 4:if(ee=te.sent,!(ee&&ee[H])){te.next=9;break}ne=ee[H],te.next=15;break;case 9:return te.next=11,(0,N.Z)(fetch(R).then(function(be){if(be.ok)return be.blob();throw new Error}));case 11:$=te.sent,Z=$.res,oe=$.err,oe||(ne=Z,(0,F.set)(R,(0,M.Z)({},H,Z)));case 15:return te.abrupt("return",ne?{url:URL.createObjectURL(ne)}:{url:R});case 16:case"end":return te.stop()}},Q)}));return function(R,B){return W.apply(this,arguments)}}(),J=P(705)},484:function(L,z,P){"use strict";P.d(z,{Z:function(){return j}});var C=P(42);function j(E){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return E.then(function(I){return(0,C.Z)({err:null,res:I},k)}).catch(function(I){return(0,C.Z)({err:I,res:void 0},k)})}},705:function(L,z,P){"use strict";P.d(z,{C:function(){return I},y:function(){return k}});var C=P(644),j=P.n(C),E=new Map,k=function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(G,M,F,N,V){var c=M[F*3],pe=M[F*3+1],J=M[N*3],W=M[N*3+1],Q=M[V*3],R=M[V*3+1],B;if(E.has(G))B=E.get(G);else{var H=D.box3||new C.Box3;if(!D.box3){var ne=G.parameters.shapes.getPoints();H.setFromArray(ne.map(function(ve){return[ve.x,ve.y,0]}).flat())}var ee=H.getSize(new C.Vector3);D.split&&(ee.y/=D.split),B={box:H,size:ee},E.set(G,B)}var $=B.box,Z=B.size,oe=D.split?1-D.split:0;return[new C.Vector2((c-$.min.x)/Z.x,(pe-$.min.y)/Z.y+oe),new C.Vector2((J-$.min.x)/Z.x,(W-$.min.y)/Z.y+oe),new C.Vector2((Q-$.min.x)/Z.x,(R-$.min.y)/Z.y+oe)]},generateSideWallUV:function(G,M,F,N,V,c){var pe=M[F*3],J=M[F*3+1],W=M[F*3+2],Q=M[N*3],R=M[N*3+1],B=M[N*3+2],H=M[V*3],ne=M[V*3+1],ee=M[V*3+2],$=M[c*3],Z=M[c*3+1],oe=M[c*3+2],ve;if(E.has(M))ve=E.get(M);else{var te=new C.Box3;te.setFromArray(M);var be=te.getSize(new C.Vector3);D.split&&(be.z/=1-D.split),ve={box:te,size:be},E.set(M,ve)}var Y=ve.box,q=ve.size;return Math.abs(J-R)<Math.abs(pe-Q)?[new C.Vector2((pe-Y.min.x)/q.x,(W-Y.min.z)/q.z),new C.Vector2((Q-Y.min.x)/q.x,(B-Y.min.z)/q.z),new C.Vector2((H-Y.min.x)/q.x,(ee-Y.min.z)/q.z),new C.Vector2(($-Y.min.x)/q.x,(oe-Y.min.z)/q.z)]:[new C.Vector2((J-Y.min.y)/q.y,(W-Y.min.z)/q.z),new C.Vector2((R-Y.min.y)/q.y,(B-Y.min.z)/q.z),new C.Vector2((ne-Y.min.y)/q.y,(ee-Y.min.z)/q.z),new C.Vector2((Z-Y.min.y)/q.y,(oe-Y.min.z)/q.z)]}}},I=function(){E.clear()}},644:function(L){"use strict";L.exports=require("three")},568:function(L,z,P){"use strict";P.d(z,{Z:function(){return j}});function C(E,k,I,D,G,M,F){try{var N=E[M](F),V=N.value}catch(c){I(c);return}N.done?k(V):Promise.resolve(V).then(D,G)}function j(E){return function(){var k=this,I=arguments;return new Promise(function(D,G){var M=E.apply(k,I);function F(V){C(M,D,G,F,N,"next",V)}function N(V){C(M,D,G,F,N,"throw",V)}F(void 0)})}}},924:function(L,z,P){"use strict";P.d(z,{Z:function(){return C}});function C(j,E,k){return E in j?Object.defineProperty(j,E,{value:k,enumerable:!0,configurable:!0,writable:!0}):j[E]=k,j}},42:function(L,z,P){"use strict";P.d(z,{Z:function(){return j}});var C=P(924);function j(E){for(var k=1;k<arguments.length;k++){var I=arguments[k]!=null?arguments[k]:{},D=Object.keys(I);typeof Object.getOwnPropertySymbols=="function"&&(D=D.concat(Object.getOwnPropertySymbols(I).filter(function(G){return Object.getOwnPropertyDescriptor(I,G).enumerable}))),D.forEach(function(G){(0,C.Z)(E,G,I[G])})}return E}}},Fe={};function X(L){var z=Fe[L];if(z!==void 0)return z.exports;var P=Fe[L]={exports:{}};return rt[L](P,P.exports,X),P.exports}(function(){X.n=function(L){var z=L&&L.__esModule?function(){return L.default}:function(){return L};return X.d(z,{a:z}),z}})(),function(){X.d=function(L,z){for(var P in z)X.o(z,P)&&!X.o(L,P)&&Object.defineProperty(L,P,{enumerable:!0,get:z[P]})}}(),function(){X.o=function(L,z){return Object.prototype.hasOwnProperty.call(L,z)}}(),function(){X.r=function(L){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(L,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(L,"__esModule",{value:!0})}}();var Ge={};(function(){"use strict";X.r(Ge),X.d(Ge,{ConicPolygon:function(){return St},ExtrudePolygon:function(){return Ot},Image:function(){return se},Line:function(){return ut},MeshLine:function(){return we},MeshLineMaterial:function(){return We},MeshLineRaycast:function(){return Ne},Node:function(){return xe},Text:function(){return ze},Video:function(){return je}});function L(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function z(t,i){return z=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},z(t,i)}function P(t,i){return z(t,i)}function C(t,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(i&&i.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),i&&P(t,i)}var j=X(42);function E(t,i){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);i&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function k(t,i){return i=i!=null?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):E(Object(i)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(i,r))}),t}function I(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function D(t){return D=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},D(t)}function G(t){return D(t)}function M(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function F(t){return t&&t.constructor===Symbol?"symbol":typeof t}function N(t,i){return i&&(F(i)==="object"||typeof i=="function")?i:M(t)}function V(t){var i=I();return function(){var n=G(t),a;if(i){var e=G(this).constructor;a=Reflect.construct(n,arguments,e)}else a=n.apply(this,arguments);return N(this,a)}}var c=X(644);function pe(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}function J(t,i,r){return pe()?J=Reflect.construct:J=function(a,e,o){var s=[null];s.push.apply(s,e);var h=Function.bind.apply(a,s),p=new h;return o&&P(p,o.prototype),p},J.apply(null,arguments)}function W(t,i,r){return J.apply(null,arguments)}function Q(t,i){for(var r=0;r<i.length;r++){var n=i[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function R(t,i,r){return i&&Q(t.prototype,i),r&&Q(t,r),t}function B(t,i){(i==null||i>t.length)&&(i=t.length);for(var r=0,n=new Array(i);r<i;r++)n[r]=t[r];return n}function H(t){if(Array.isArray(t))return B(t)}function ne(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ee(){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 $(t,i){if(!!t){if(typeof t=="string")return B(t,i);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return B(t,i)}}function Z(t){return H(t)||ne(t)||$(t)||ee()}var oe=X(484);function ve(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={};return r.promise=new Promise(function(n,a){r.resolve=n,r.reject=a}),t&&(r.promise=(0,oe.Z)(r.promise,i)),r}var te=require("three/examples/jsm/renderers/CSS2DRenderer"),be=require("three/examples/jsm/renderers/CSS3DRenderer"),Y=X(519),q=function(t){t&&((0,Y.disposeMesh)(t),t.children.forEach(function(i){i.userData.BaseObject_||q(i)}))},ge=function(){"use strict";function t(){L(this,t),this.objecttype__="BaseObject",this.userData={},this.pm=ve(),this.visible=!1}var i=t.prototype;return i.init=function(){},i.create=function(){},i.render=function(){},i.update=function(n,a){},i.resize=function(n,a){},i.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},i.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},i.isVisible=function(){return this.visible},i.createMesh=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];return this.object3d=W(c.Mesh,Z(a)),this},i.createGroup=function(){return this.object3d=new c.Group,this},i.createPoints=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];return this.object3d=W(c.Points,Z(a)),this},i.createCSS2DObject=function(n){return this.object3d=new te.CSS2DObject(n),this},i.createCSS3DObject=function(n){return this.object3d=new be.CSS3DObject(n),this},i.createCSS3DSprite=function(n){return this.object3d=new be.CSS3DSprite(n),this},i.createSprite=function(n){return this.object3d=new c.Sprite(n),this},i.add=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];var o;return(o=this.object3d).add.apply(o,Z(a)),this},i.remove=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];var o;return(o=this.object3d).remove.apply(o,Z(a)),this},i.getSize=function(){var n=new c.Box3().setFromObject(this.object3d);return{min:n.min,max:n.max,size:n.getSize(new c.Vector3)}},i.traverse=function(n){n(this),this.children.forEach(function(a){a.traverse(n)})},i.dispose=function(){q(this.object3d)},R(t,[{key:"parent",get:function(){var n=this.object3d.parent;return(n==null?void 0:n.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(n){return n.userData.BaseObject_}).filter(function(n){return!!n})}}]),t}(),ze=function(t){"use strict";C(r,t);var i=V(r);function r(a){L(this,r);var e;return e=i.call(this),e.width=0,e.canvas=document.createElement("canvas"),e.options=(0,j.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.position,s=e.lookAt,h=e.sprite,p=e.text,d=e.sizeAttenuation;if(h){var g=new c.Sprite(new c.SpriteMaterial({transparent:!0,sizeAttenuation:d}));this.object3d=g}else{var y=new c.MeshBasicMaterial({side:c.DoubleSide,transparent:!0}),b=new c.PlaneGeometry(1,1,1,1);this.createMesh(b,y)}this.object3d.position.copy(o),s&&this.object3d.lookAt(s),this.setText(p)},n.setText=function(e,o){var s=(0,j.Z)(k((0,j.Z)({},this.options),{text:e}),o||{}),h=s.text,p=s.fontSize,d=s.fontFamily,g=s.fontWeight,y=s.flipX,b=s.scale,m=this.canvas;m.width=p*h.length*2,m.height=p;var w=m.getContext("2d");w.font="".concat(g," ").concat(p,"px/1 ").concat(d);var u=w.measureText(h).width;m.width=u,this.width=u,w=m.getContext("2d"),w.clearRect(0,0,m.width,m.height),y&&w.scale(-1,1),w.font="".concat(g," ").concat(p,"px/1 ").concat(d),w.textBaseline="middle",w.fillStyle="#ffffff",w.fillText(h,y?u*-1:0,m.height/2),w.restore();var _=new c.Texture(m);_.anisotropy=16,_.needsUpdate=!0;var x=this.object3d;x.material.map&&x.material.map.dispose(),x.material.map=_,x.material.needsUpdate=!0,x.scale.set(_.image.width*b,_.image.height*b,1)},r}(ge),f=X(568),l=X(666),v=X.n(l),O=+c.REVISION<144,A=O?"ExtrudeBufferGeometry":"ExtrudeGeometry",K=O?"PlaneBufferGeometry":"PlaneGeometry",se=function(t){"use strict";C(r,t);var i=V(r);function r(a){L(this,r);var e;return e=i.call(this),e.options=a,e}var n=r.prototype;return n.getMaterial=function(){var e=this;return(0,f.Z)(v().mark(function o(){var s,h,p,d,g,y,b,m,w,u;return v().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return s=e.options,h=s.transparent,p=s.blending,d=s.src,g=s.depthWrite,y=s.alphaTest,b=s.sprite,m=s.sizeAttenuation,x.next=3,new c.TextureLoader().loadAsync(d);case 3:return w=x.sent,u=b?new c.SpriteMaterial({map:w,transparent:h!=null?h:!1,blending:p!=null?p:c.NormalBlending,depthWrite:g!=null?g:!0,alphaTest:y!=null?y:0,sizeAttenuation:m!=null?m:!0}):new c.MeshBasicMaterial({map:w,transparent:h!=null?h:!1,blending:p!=null?p:c.NormalBlending,depthWrite:g!=null?g:!0,alphaTest:y!=null?y:0}),x.abrupt("return",u);case 6:case"end":return x.stop()}},o)}))()},n.create=function(){var e=this;return(0,f.Z)(v().mark(function o(){var s,h,p,d,g,y,b,m;return v().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(s=e.options,h=s.scale,p=s.position,d=s.src,g=s.cache,y=s.sprite,!(g&&!g.get(d))){u.next=7;break}return g.init(d),u.next=5,e.getMaterial();case 5:b=u.sent,g.set(d,b);case 7:if(!g){u.next=13;break}return u.next=10,g.get(d);case 10:u.t0=u.sent,u.next=16;break;case 13:return u.next=15,e.getMaterial();case 15:u.t0=u.sent;case 16:m=u.t0,e.texture=m.map,y?e.createSprite(m):e.createMesh(new c[K](1,1),m),h&&e.setScale(h),p&&e.object3d.position.copy(p);case 21:case"end":return u.stop()}},o)}))()},n.setScale=function(e){this.object3d.scale.set(this.texture.image.width*e,this.texture.image.height*e,1)},r}(ge);function ue(t,i){for(;!Object.prototype.hasOwnProperty.call(t,i)&&(t=G(t),t!==null););return t}function ie(t,i,r){return typeof Reflect!="undefined"&&Reflect.get?ie=Reflect.get:ie=function(a,e,o){var s=ue(a,e);if(!!s){var h=Object.getOwnPropertyDescriptor(s,e);return h.get?h.get.call(o||a):h.value}},ie(t,i,r)}function re(t,i,r){return ie(t,i,r)}var je=function(t){"use strict";C(r,t);var i=V(r);function r(a){L(this,r);var e;return e=i.call(this),e.options=(0,j.Z)({},{autoPlay:!0,loop:!0},a),e}var n=r.prototype;return n.getMaterial=function(){var e=this.options,o=e.src,s=e.transparent,h=e.blending,p=e.depthWrite,d=e.format,g=e.autoPlay,y=e.loop,b=e.alphaTest,m=e.sprite,w=ve(),u=document.createElement("video");return u.addEventListener("loadedmetadata",function(){var _=new c.VideoTexture(u);_.format=d!=null?d:c.RGBAFormat,_.needsUpdate=!0;var x=m?new c.SpriteMaterial({map:_,transparent:s!=null?s:!1,blending:h!=null?h:c.NormalBlending,depthWrite:p!=null?p:!0,alphaTest:b!=null?b:0}):new c.MeshBasicMaterial({map:_,transparent:s!=null?s:!1,blending:h!=null?h:c.NormalBlending,depthWrite:p!=null?p:!0,alphaTest:b!=null?b:0});w.resolve(x)},!1),u.src=o,u.muted=!0,u.autoplay=g,u.loop=y,u.preload="auto",w.promise},n.create=function(){var e=this;return(0,f.Z)(v().mark(function o(){var s,h,p,d,g,y,b,m;return v().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(s=e.options,h=s.scale,p=s.position,d=s.src,g=s.cache,y=s.sprite,!(g&&!g.get(d))){u.next=7;break}return g.init(d),u.next=5,e.getMaterial();case 5:b=u.sent,g.set(d,b);case 7:if(!g){u.next=13;break}return u.next=10,g.get(d);case 10:u.t0=u.sent,u.next=16;break;case 13:return u.next=15,e.getMaterial();case 15:u.t0=u.sent;case 16:m=u.t0,e.video=m.map.image,y?e.createSprite(m):e.createMesh(new c[K](1,1),m),h&&e.setScale(h),p&&e.object3d.position.copy(p);case 21:case"end":return u.stop()}},o)}))()},n.setScale=function(e){this.object3d.scale.set(this.video.videoWidth*e,this.video.videoHeight*e,1)},n.render=function(){var e=this.options.autoPlay;e&&this.video.play()},n.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),re(G(r.prototype),"dispose",this).call(this)},r}(ge),Se=function(t){"use strict";C(r,t);var i=V(r);function r(a){L(this,r);var e;return e=i.call(this),e.options=(0,j.Z)({},a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.position,s=e.children,h=e.onClick,p=e.zIndexFix,d=document.createElement("div");this.element=d,d.appendChild(s),this.createCSS2DObject(d),o&&this.object3d.position.copy(o),h&&this.clickTarge.forEach(function(g){g.addEventListener("click",h)}),p&&(this.object3d.userData.zIndexFix=p)},n.getMaterial=function(e){return(0,f.Z)(v().mark(function o(){var s,h,p,d;return v().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return s=document.createElement("canvas"),s.width=256,s.height=256,h=s.getContext("2d"),h.fillStyle="#ff0000",h.fillRect(0,0,256,256),p=new c.CanvasTexture(s),d=new c.SpriteMaterial({map:p,opacity:e?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),y.abrupt("return",d);case 9:case"end":return y.stop()}},o)}))()},n.createPickObject=function(e){var o=e.show,s=o===void 0?!1:o,h=e.scale,p=h===void 0?new c.Vector3(1,1,1):h,d=e.position,g=d===void 0?new c.Vector3(0,0,0):d,y=e.cache,b=this;return(0,f.Z)(v().mark(function m(){var w,u,_,x;return v().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:if(w="node-create-pick-object",!(y&&!y.get(w))){S.next=7;break}return y.init(w),S.next=5,b.getMaterial(s);case 5:u=S.sent,y.set(w,u);case 7:if(!y){S.next=13;break}return S.next=10,y.get(w);case 10:S.t0=S.sent,S.next=16;break;case 13:return S.next=15,b.getMaterial(s);case 15:S.t0=S.sent;case 16:_=S.t0,x=new c.Sprite(_),x.scale.set(_.map.image.width*p.x,_.map.image.height*p.y,1),x.position.copy(g),b.add(x),b.pickObject=x;case 22:case"end":return S.stop()}},m)}))()},n.dispose=function(){var e=this.options.onClick;e&&this.clickTarge.forEach(function(o){o.removeEventListener("click",e)}),re(G(r.prototype),"dispose",this).call(this)},R(r,[{key:"clickTarge",get:function(){var e=this,o=this.options.clickTarge;if(o){var s=o.map(function(h){return Z(e.element.querySelectorAll(h))}).flat();return s}return[this.element]}}]),r}(ge),xe=Se,nt=`
1
+ (function(){var rt={666:function(k){var T=function(A){"use strict";var C=Object.prototype,j=C.hasOwnProperty,E,L=typeof Symbol=="function"?Symbol:{},Z=L.iterator||"@@iterator",U=L.asyncIterator||"@@asyncIterator",G=L.toStringTag||"@@toStringTag";function M(f,l,v){return Object.defineProperty(f,l,{value:v,enumerable:!0,configurable:!0,writable:!0}),f[l]}try{M({},"")}catch(f){M=function(l,v,S){return l[v]=S}}function N(f,l,v,S){var P=l&&l.prototype instanceof Q?l:Q,X=Object.create(P.prototype),ce=new B(S||[]);return X._invoke=ie(f,v,ce),X}A.wrap=N;function H(f,l,v){try{return{type:"normal",arg:f.call(l,v)}}catch(S){return{type:"throw",arg:S}}}var V="suspendedStart",c="suspendedYield",pe="executing",J="completed",W={};function Q(){}function R(){}function z(){}var $={};M($,Z,function(){return this});var ue=Object.getPrototypeOf,ee=ue&&ue(ue(ve([])));ee&&ee!==C&&j.call(ee,Z)&&($=ee);var F=z.prototype=Q.prototype=Object.create($);R.prototype=z,M(F,"constructor",z),M(z,"constructor",R),R.displayName=M(z,G,"GeneratorFunction");function I(f){["next","throw","return"].forEach(function(l){M(f,l,function(v){return this._invoke(l,v)})})}A.isGeneratorFunction=function(f){var l=typeof f=="function"&&f.constructor;return l?l===R||(l.displayName||l.name)==="GeneratorFunction":!1},A.mark=function(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,z):(f.__proto__=z,M(f,G,"GeneratorFunction")),f.prototype=Object.create(F),f},A.awrap=function(f){return{__await:f}};function te(f,l){function v(X,ce,le,ae){var re=H(f[X],f,ce);if(re.type==="throw")ae(re.arg);else{var ke=re.arg,Ce=ke.value;return Ce&&typeof Ce=="object"&&j.call(Ce,"__await")?l.resolve(Ce.__await).then(function(Oe){v("next",Oe,le,ae)},function(Oe){v("throw",Oe,le,ae)}):l.resolve(Ce).then(function(Oe){ke.value=Oe,le(ke)},function(Oe){return v("throw",Oe,le,ae)})}}var S;function P(X,ce){function le(){return new l(function(ae,re){v(X,ce,ae,re)})}return S=S?S.then(le,le):le()}this._invoke=P}I(te.prototype),M(te.prototype,U,function(){return this}),A.AsyncIterator=te,A.async=function(f,l,v,S,P){P===void 0&&(P=Promise);var X=new te(N(f,l,v,S),P);return A.isGeneratorFunction(l)?X:X.next().then(function(ce){return ce.done?ce.value:X.next()})};function ie(f,l,v){var S=V;return function(X,ce){if(S===pe)throw new Error("Generator is already running");if(S===J){if(X==="throw")throw ce;return ze()}for(v.method=X,v.arg=ce;;){var le=v.delegate;if(le){var ae=we(le,v);if(ae){if(ae===W)continue;return ae}}if(v.method==="next")v.sent=v._sent=v.arg;else if(v.method==="throw"){if(S===V)throw S=J,v.arg;v.dispatchException(v.arg)}else v.method==="return"&&v.abrupt("return",v.arg);S=pe;var re=H(f,l,v);if(re.type==="normal"){if(S=v.done?J:c,re.arg===W)continue;return{value:re.arg,done:v.done}}else re.type==="throw"&&(S=J,v.method="throw",v.arg=re.arg)}}}function we(f,l){var v=f.iterator[l.method];if(v===E){if(l.delegate=null,l.method==="throw"){if(f.iterator.return&&(l.method="return",l.arg=E,we(f,l),l.method==="throw"))return W;l.method="throw",l.arg=new TypeError("The iterator does not provide a 'throw' method")}return W}var S=H(v,f.iterator,l.arg);if(S.type==="throw")return l.method="throw",l.arg=S.arg,l.delegate=null,W;var P=S.arg;if(!P)return l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,W;if(P.done)l[f.resultName]=P.value,l.next=f.nextLoc,l.method!=="return"&&(l.method="next",l.arg=E);else return P;return l.delegate=null,W}I(F),M(F,G,"Generator"),M(F,Z,function(){return this}),M(F,"toString",function(){return"[object Generator]"});function xe(f){var l={tryLoc:f[0]};1 in f&&(l.catchLoc=f[1]),2 in f&&(l.finallyLoc=f[2],l.afterLoc=f[3]),this.tryEntries.push(l)}function q(f){var l=f.completion||{};l.type="normal",delete l.arg,f.completion=l}function B(f){this.tryEntries=[{tryLoc:"root"}],f.forEach(xe,this),this.reset(!0)}A.keys=function(f){var l=[];for(var v in f)l.push(v);return l.reverse(),function S(){for(;l.length;){var P=l.pop();if(P in f)return S.value=P,S.done=!1,S}return S.done=!0,S}};function ve(f){if(f){var l=f[Z];if(l)return l.call(f);if(typeof f.next=="function")return f;if(!isNaN(f.length)){var v=-1,S=function P(){for(;++v<f.length;)if(j.call(f,v))return P.value=f[v],P.done=!1,P;return P.value=E,P.done=!0,P};return S.next=S}}return{next:ze}}A.values=ve;function ze(){return{value:E,done:!0}}return B.prototype={constructor:B,reset:function(f){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(q),!f)for(var l in this)l.charAt(0)==="t"&&j.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=E)},stop:function(){this.done=!0;var f=this.tryEntries[0],l=f.completion;if(l.type==="throw")throw l.arg;return this.rval},dispatchException:function(f){if(this.done)throw f;var l=this;function v(ae,re){return X.type="throw",X.arg=f,l.next=ae,re&&(l.method="next",l.arg=E),!!re}for(var S=this.tryEntries.length-1;S>=0;--S){var P=this.tryEntries[S],X=P.completion;if(P.tryLoc==="root")return v("end");if(P.tryLoc<=this.prev){var ce=j.call(P,"catchLoc"),le=j.call(P,"finallyLoc");if(ce&&le){if(this.prev<P.catchLoc)return v(P.catchLoc,!0);if(this.prev<P.finallyLoc)return v(P.finallyLoc)}else if(ce){if(this.prev<P.catchLoc)return v(P.catchLoc,!0)}else if(le){if(this.prev<P.finallyLoc)return v(P.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(f,l){for(var v=this.tryEntries.length-1;v>=0;--v){var S=this.tryEntries[v];if(S.tryLoc<=this.prev&&j.call(S,"finallyLoc")&&this.prev<S.finallyLoc){var P=S;break}}P&&(f==="break"||f==="continue")&&P.tryLoc<=l&&l<=P.finallyLoc&&(P=null);var X=P?P.completion:{};return X.type=f,X.arg=l,P?(this.method="next",this.next=P.finallyLoc,W):this.complete(X)},complete:function(f,l){if(f.type==="throw")throw f.arg;return f.type==="break"||f.type==="continue"?this.next=f.arg:f.type==="return"?(this.rval=this.arg=f.arg,this.method="return",this.next="end"):f.type==="normal"&&l&&(this.next=l),W},finish:function(f){for(var l=this.tryEntries.length-1;l>=0;--l){var v=this.tryEntries[l];if(v.finallyLoc===f)return this.complete(v.completion,v.afterLoc),q(v),W}},catch:function(f){for(var l=this.tryEntries.length-1;l>=0;--l){var v=this.tryEntries[l];if(v.tryLoc===f){var S=v.completion;if(S.type==="throw"){var P=S.arg;q(v)}return P}}throw new Error("illegal catch attempt")},delegateYield:function(f,l,v){return this.delegate={iterator:ve(f),resultName:l,nextLoc:v},this.method==="next"&&(this.arg=E),W}},A}(k.exports);try{regeneratorRuntime=T}catch(A){typeof globalThis=="object"?globalThis.regeneratorRuntime=T:Function("r","regeneratorRuntime = r")(T)}},695:function(k,T,A){"use strict";A.d(T,{Z:function(){return C}});function C(j){if(j.geometry&&j.geometry.dispose(),j.material){var E=Array.isArray(j.material)?j.material:[j.material];E.forEach(function(L){var Z,U,G,M,N,H,V,c,pe,J,W,Q,R;(Z=L.map)===null||Z===void 0||Z.dispose(),(U=L.lightMap)===null||U===void 0||U.dispose(),(G=L.bumpMap)===null||G===void 0||G.dispose(),(M=L.normalMap)===null||M===void 0||M.dispose(),(N=L.specularMap)===null||N===void 0||N.dispose(),(H=L.envMap)===null||H===void 0||H.dispose(),(V=L.alphaMap)===null||V===void 0||V.dispose(),(c=L.aoMap)===null||c===void 0||c.dispose(),(pe=L.displacementMap)===null||pe===void 0||pe.dispose(),(J=L.emissiveMap)===null||J===void 0||J.dispose(),(W=L.gradientMap)===null||W===void 0||W.dispose(),(Q=L.metalnessMap)===null||Q===void 0||Q.dispose(),(R=L.roughnessMap)===null||R===void 0||R.dispose(),L.dispose()})}}},584:function(k,T,A){"use strict";A.d(T,{disposeMesh:function(){return L.Z}});var C=A(666),j=A.n(C),E=null,L=A(695),Z=A(644);function U(W){if(W.material){var Q=Array.isArray(W.material)?W.material:[W.material];Q.forEach(function(R){var z,$;(z=R.color)===null||z===void 0||z.convertSRGBToLinear(),($=R.emissive)===null||$===void 0||$.convertSRGBToLinear(),R.map&&(R.map.encoding=THREE.sRGBEncoding),R.emissiveMap&&(R.emissiveMap.encoding=THREE.sRGBEncoding)})}}var G=A(568),M=A(924),N=A(360),H=A(484),V=null,c=null,pe=function(){var W=(0,G.Z)(j().mark(function Q(R,z){var $,ue,ee,F,I,te,ie,we,xe;return j().wrap(function(B){for(;;)switch(B.prev=B.next){case 0:return $=z.type,ue=$===void 0?"blob":$,ee=z.version,F=ee===void 0?"1":ee,B.next=4,(0,N.get)(R);case 4:if(te=B.sent,!(te&&te[F])){B.next=9;break}I=te[F],B.next=15;break;case 9:return B.next=11,(0,H.Z)(fetch(R).then(function(ve){if(ve.ok)return ve[ue]();throw new Error}));case 11:ie=B.sent,we=ie.res,xe=ie.err,xe||(I=we,(0,N.set)(R,(0,M.Z)({},F,we)));case 15:return B.abrupt("return",I?{url:ue==="json"?R:URL.createObjectURL(I),store:I}:{url:R});case 16:case"end":return B.stop()}},Q)}));return function(R,z){return W.apply(this,arguments)}}(),J=A(705)},484:function(k,T,A){"use strict";A.d(T,{Z:function(){return j}});var C=A(42);function j(E){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return E.then(function(Z){return(0,C.Z)({err:null,res:Z},L)}).catch(function(Z){return(0,C.Z)({err:Z,res:void 0},L)})}},705:function(k,T,A){"use strict";A.d(T,{C:function(){return Z},y:function(){return L}});var C=A(644),j=A.n(C),E=new Map,L=function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(G,M,N,H,V){var c=M[N*3],pe=M[N*3+1],J=M[H*3],W=M[H*3+1],Q=M[V*3],R=M[V*3+1],z;if(E.has(G))z=E.get(G);else{var $=U.box3||new C.Box3;if(!U.box3){var ue=G.parameters.shapes.getPoints();$.setFromArray(ue.map(function(ie){return[ie.x,ie.y,0]}).flat())}var ee=$.getSize(new C.Vector3);U.split&&(ee.y/=U.split),z={box:$,size:ee},E.set(G,z)}var F=z.box,I=z.size,te=U.split?1-U.split:0;return[new C.Vector2((c-F.min.x)/I.x,(pe-F.min.y)/I.y+te),new C.Vector2((J-F.min.x)/I.x,(W-F.min.y)/I.y+te),new C.Vector2((Q-F.min.x)/I.x,(R-F.min.y)/I.y+te)]},generateSideWallUV:function(G,M,N,H,V,c){var pe=M[N*3],J=M[N*3+1],W=M[N*3+2],Q=M[H*3],R=M[H*3+1],z=M[H*3+2],$=M[V*3],ue=M[V*3+1],ee=M[V*3+2],F=M[c*3],I=M[c*3+1],te=M[c*3+2],ie;if(E.has(M))ie=E.get(M);else{var we=new C.Box3;we.setFromArray(M);var xe=we.getSize(new C.Vector3);U.split&&(xe.z/=1-U.split),ie={box:we,size:xe},E.set(M,ie)}var q=ie.box,B=ie.size;return Math.abs(J-R)<Math.abs(pe-Q)?[new C.Vector2((pe-q.min.x)/B.x,(W-q.min.z)/B.z),new C.Vector2((Q-q.min.x)/B.x,(z-q.min.z)/B.z),new C.Vector2(($-q.min.x)/B.x,(ee-q.min.z)/B.z),new C.Vector2((F-q.min.x)/B.x,(te-q.min.z)/B.z)]:[new C.Vector2((J-q.min.y)/B.y,(W-q.min.z)/B.z),new C.Vector2((R-q.min.y)/B.y,(z-q.min.z)/B.z),new C.Vector2((ue-q.min.y)/B.y,(ee-q.min.z)/B.z),new C.Vector2((I-q.min.y)/B.y,(te-q.min.z)/B.z)]}}},Z=function(){E.clear()}},360:function(k){"use strict";k.exports=require("idb-keyval")},644:function(k){"use strict";k.exports=require("three")},568:function(k,T,A){"use strict";A.d(T,{Z:function(){return j}});function C(E,L,Z,U,G,M,N){try{var H=E[M](N),V=H.value}catch(c){Z(c);return}H.done?L(V):Promise.resolve(V).then(U,G)}function j(E){return function(){var L=this,Z=arguments;return new Promise(function(U,G){var M=E.apply(L,Z);function N(V){C(M,U,G,N,H,"next",V)}function H(V){C(M,U,G,N,H,"throw",V)}N(void 0)})}}},924:function(k,T,A){"use strict";A.d(T,{Z:function(){return C}});function C(j,E,L){return E in j?Object.defineProperty(j,E,{value:L,enumerable:!0,configurable:!0,writable:!0}):j[E]=L,j}},42:function(k,T,A){"use strict";A.d(T,{Z:function(){return j}});var C=A(924);function j(E){for(var L=1;L<arguments.length;L++){var Z=arguments[L]!=null?arguments[L]:{},U=Object.keys(Z);typeof Object.getOwnPropertySymbols=="function"&&(U=U.concat(Object.getOwnPropertySymbols(Z).filter(function(G){return Object.getOwnPropertyDescriptor(Z,G).enumerable}))),U.forEach(function(G){(0,C.Z)(E,G,Z[G])})}return E}}},Ze={};function Y(k){var T=Ze[k];if(T!==void 0)return T.exports;var A=Ze[k]={exports:{}};return rt[k](A,A.exports,Y),A.exports}(function(){Y.n=function(k){var T=k&&k.__esModule?function(){return k.default}:function(){return k};return Y.d(T,{a:T}),T}})(),function(){Y.d=function(k,T){for(var A in T)Y.o(T,A)&&!Y.o(k,A)&&Object.defineProperty(k,A,{enumerable:!0,get:T[A]})}}(),function(){Y.o=function(k,T){return Object.prototype.hasOwnProperty.call(k,T)}}(),function(){Y.r=function(k){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(k,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(k,"__esModule",{value:!0})}}();var Be={};(function(){"use strict";Y.r(Be),Y.d(Be,{ConicPolygon:function(){return St},ExtrudePolygon:function(){return Ot},Image:function(){return ce},Line:function(){return ut},MeshLine:function(){return Ae},MeshLineMaterial:function(){return Ve},MeshLineRaycast:function(){return Fe},Node:function(){return Oe},Text:function(){return ze},Video:function(){return ke}});function k(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function T(t,i){return T=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},T(t,i)}function A(t,i){return T(t,i)}function C(t,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(i&&i.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),i&&A(t,i)}var j=Y(42);function E(t,i){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);i&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function L(t,i){return i=i!=null?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):E(Object(i)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(i,r))}),t}function Z(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function U(t){return U=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},U(t)}function G(t){return U(t)}function M(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function N(t){return t&&t.constructor===Symbol?"symbol":typeof t}function H(t,i){return i&&(N(i)==="object"||typeof i=="function")?i:M(t)}function V(t){var i=Z();return function(){var n=G(t),a;if(i){var e=G(this).constructor;a=Reflect.construct(n,arguments,e)}else a=n.apply(this,arguments);return H(this,a)}}var c=Y(644);function pe(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}function J(t,i,r){return pe()?J=Reflect.construct:J=function(a,e,o){var s=[null];s.push.apply(s,e);var h=Function.bind.apply(a,s),p=new h;return o&&A(p,o.prototype),p},J.apply(null,arguments)}function W(t,i,r){return J.apply(null,arguments)}function Q(t,i){for(var r=0;r<i.length;r++){var n=i[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function R(t,i,r){return i&&Q(t.prototype,i),r&&Q(t,r),t}function z(t,i){(i==null||i>t.length)&&(i=t.length);for(var r=0,n=new Array(i);r<i;r++)n[r]=t[r];return n}function $(t){if(Array.isArray(t))return z(t)}function ue(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ee(){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 F(t,i){if(!!t){if(typeof t=="string")return z(t,i);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return z(t,i)}}function I(t){return $(t)||ue(t)||F(t)||ee()}var te=Y(484);function ie(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={};return r.promise=new Promise(function(n,a){r.resolve=n,r.reject=a}),t&&(r.promise=(0,te.Z)(r.promise,i)),r}var we=require("three/examples/jsm/renderers/CSS2DRenderer"),xe=require("three/examples/jsm/renderers/CSS3DRenderer"),q=Y(584),B=function(t){t&&((0,q.disposeMesh)(t),t.children.forEach(function(i){i.userData.BaseObject_||B(i)}))},ve=function(){"use strict";function t(){k(this,t),this.objecttype__="BaseObject",this.userData={},this.pm=ie(),this.visible=!1}var i=t.prototype;return i.init=function(){},i.create=function(){},i.render=function(){},i.update=function(n,a){},i.resize=function(n,a){},i.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},i.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},i.isVisible=function(){return this.visible},i.createMesh=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];return this.object3d=W(c.Mesh,I(a)),this},i.createGroup=function(){return this.object3d=new c.Group,this},i.createPoints=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];return this.object3d=W(c.Points,I(a)),this},i.createCSS2DObject=function(n){return this.object3d=new we.CSS2DObject(n),this},i.createCSS3DObject=function(n){return this.object3d=new xe.CSS3DObject(n),this},i.createCSS3DSprite=function(n){return this.object3d=new xe.CSS3DSprite(n),this},i.createSprite=function(n){return this.object3d=new c.Sprite(n),this},i.add=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];var o;return(o=this.object3d).add.apply(o,I(a)),this},i.remove=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];var o;return(o=this.object3d).remove.apply(o,I(a)),this},i.getSize=function(){var n=new c.Box3().setFromObject(this.object3d);return{min:n.min,max:n.max,size:n.getSize(new c.Vector3)}},i.traverse=function(n){n(this),this.children.forEach(function(a){a.traverse(n)})},i.dispose=function(){B(this.object3d)},R(t,[{key:"parent",get:function(){var n=this.object3d.parent;return(n==null?void 0:n.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(n){return n.userData.BaseObject_}).filter(function(n){return!!n})}}]),t}(),ze=function(t){"use strict";C(r,t);var i=V(r);function r(a){k(this,r);var e;return e=i.call(this),e.width=0,e.canvas=document.createElement("canvas"),e.options=(0,j.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.position,s=e.lookAt,h=e.sprite,p=e.text,d=e.sizeAttenuation;if(h){var m=new c.Sprite(new c.SpriteMaterial({transparent:!0,sizeAttenuation:d}));this.object3d=m}else{var y=new c.MeshBasicMaterial({side:c.DoubleSide,transparent:!0}),b=new c.PlaneGeometry(1,1,1,1);this.createMesh(b,y)}this.object3d.position.copy(o),s&&this.object3d.lookAt(s),this.setText(p)},n.setText=function(e,o){var s=(0,j.Z)(L((0,j.Z)({},this.options),{text:e}),o||{}),h=s.text,p=s.fontSize,d=s.fontFamily,m=s.fontWeight,y=s.flipX,b=s.scale,g=this.canvas;g.width=p*h.length*2,g.height=p;var w=g.getContext("2d");w.font="".concat(m," ").concat(p,"px/1 ").concat(d);var u=w.measureText(h).width;g.width=u,this.width=u,w=g.getContext("2d"),w.clearRect(0,0,g.width,g.height),y&&w.scale(-1,1),w.font="".concat(m," ").concat(p,"px/1 ").concat(d),w.textBaseline="middle",w.fillStyle="#ffffff",w.fillText(h,y?u*-1:0,g.height/2),w.restore();var O=new c.Texture(g);O.anisotropy=16,O.needsUpdate=!0;var _=this.object3d;_.material.map&&_.material.map.dispose(),_.material.map=O,_.material.needsUpdate=!0,_.scale.set(O.image.width*b,O.image.height*b,1)},r}(ve),f=Y(568),l=Y(666),v=Y.n(l),S=+c.REVISION<144,P=S?"ExtrudeBufferGeometry":"ExtrudeGeometry",X=S?"PlaneBufferGeometry":"PlaneGeometry",ce=function(t){"use strict";C(r,t);var i=V(r);function r(a){k(this,r);var e;return e=i.call(this),e.options=a,e}var n=r.prototype;return n.getMaterial=function(){var e=this;return(0,f.Z)(v().mark(function o(){var s,h,p,d,m,y,b,g,w,u;return v().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return s=e.options,h=s.transparent,p=s.blending,d=s.src,m=s.depthWrite,y=s.alphaTest,b=s.sprite,g=s.sizeAttenuation,_.next=3,new c.TextureLoader().loadAsync(d);case 3:return w=_.sent,u=b?new c.SpriteMaterial({map:w,transparent:h!=null?h:!1,blending:p!=null?p:c.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:y!=null?y:0,sizeAttenuation:g!=null?g:!0}):new c.MeshBasicMaterial({map:w,transparent:h!=null?h:!1,blending:p!=null?p:c.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:y!=null?y:0}),_.abrupt("return",u);case 6:case"end":return _.stop()}},o)}))()},n.create=function(){var e=this;return(0,f.Z)(v().mark(function o(){var s,h,p,d,m,y,b,g;return v().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(s=e.options,h=s.scale,p=s.position,d=s.src,m=s.cache,y=s.sprite,!(m&&!m.get(d))){u.next=7;break}return m.init(d),u.next=5,e.getMaterial();case 5:b=u.sent,m.set(d,b);case 7:if(!m){u.next=13;break}return u.next=10,m.get(d);case 10:u.t0=u.sent,u.next=16;break;case 13:return u.next=15,e.getMaterial();case 15:u.t0=u.sent;case 16:g=u.t0,e.texture=g.map,y?e.createSprite(g):e.createMesh(new c[X](1,1),g),h&&e.setScale(h),p&&e.object3d.position.copy(p);case 21:case"end":return u.stop()}},o)}))()},n.setScale=function(e){this.object3d.scale.set(this.texture.image.width*e,this.texture.image.height*e,1)},r}(ve);function le(t,i){for(;!Object.prototype.hasOwnProperty.call(t,i)&&(t=G(t),t!==null););return t}function ae(t,i,r){return typeof Reflect!="undefined"&&Reflect.get?ae=Reflect.get:ae=function(a,e,o){var s=le(a,e);if(!!s){var h=Object.getOwnPropertyDescriptor(s,e);return h.get?h.get.call(o||a):h.value}},ae(t,i,r)}function re(t,i,r){return ae(t,i,r)}var ke=function(t){"use strict";C(r,t);var i=V(r);function r(a){k(this,r);var e;return e=i.call(this),e.options=(0,j.Z)({},{autoPlay:!0,loop:!0},a),e}var n=r.prototype;return n.getMaterial=function(){var e=this.options,o=e.src,s=e.transparent,h=e.blending,p=e.depthWrite,d=e.format,m=e.autoPlay,y=e.loop,b=e.alphaTest,g=e.sprite,w=ie(),u=document.createElement("video");return u.addEventListener("loadedmetadata",function(){var O=new c.VideoTexture(u);O.format=d!=null?d:c.RGBAFormat,O.needsUpdate=!0;var _=g?new c.SpriteMaterial({map:O,transparent:s!=null?s:!1,blending:h!=null?h:c.NormalBlending,depthWrite:p!=null?p:!0,alphaTest:b!=null?b:0}):new c.MeshBasicMaterial({map:O,transparent:s!=null?s:!1,blending:h!=null?h:c.NormalBlending,depthWrite:p!=null?p:!0,alphaTest:b!=null?b:0});w.resolve(_)},!1),u.src=o,u.muted=!0,u.autoplay=m,u.loop=y,u.preload="auto",w.promise},n.create=function(){var e=this;return(0,f.Z)(v().mark(function o(){var s,h,p,d,m,y,b,g;return v().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(s=e.options,h=s.scale,p=s.position,d=s.src,m=s.cache,y=s.sprite,!(m&&!m.get(d))){u.next=7;break}return m.init(d),u.next=5,e.getMaterial();case 5:b=u.sent,m.set(d,b);case 7:if(!m){u.next=13;break}return u.next=10,m.get(d);case 10:u.t0=u.sent,u.next=16;break;case 13:return u.next=15,e.getMaterial();case 15:u.t0=u.sent;case 16:g=u.t0,e.video=g.map.image,y?e.createSprite(g):e.createMesh(new c[X](1,1),g),h&&e.setScale(h),p&&e.object3d.position.copy(p);case 21:case"end":return u.stop()}},o)}))()},n.setScale=function(e){this.object3d.scale.set(this.video.videoWidth*e,this.video.videoHeight*e,1)},n.render=function(){var e=this.options.autoPlay;e&&this.video.play()},n.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),re(G(r.prototype),"dispose",this).call(this)},r}(ve),Ce=function(t){"use strict";C(r,t);var i=V(r);function r(a){k(this,r);var e;return e=i.call(this),e.options=(0,j.Z)({},{event:"click"},a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.position,s=e.children,h=e.handler,p=e.event,d=e.zIndexFix,m=document.createElement("div");this.element=m,m.appendChild(s),this.createCSS2DObject(m),o&&this.object3d.position.copy(o),h&&p&&this.clickTarge.forEach(function(y){y.addEventListener(p,h)}),d&&(this.object3d.userData.zIndexFix=d)},n.getMaterial=function(e){return(0,f.Z)(v().mark(function o(){var s,h,p,d;return v().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return s=document.createElement("canvas"),s.width=256,s.height=256,h=s.getContext("2d"),h.fillStyle="#ff0000",h.fillRect(0,0,256,256),p=new c.CanvasTexture(s),d=new c.SpriteMaterial({map:p,opacity:e?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),y.abrupt("return",d);case 9:case"end":return y.stop()}},o)}))()},n.createPickObject=function(e){var o=e.show,s=o===void 0?!1:o,h=e.scale,p=h===void 0?new c.Vector3(1,1,1):h,d=e.position,m=d===void 0?new c.Vector3(0,0,0):d,y=e.cache,b=this;return(0,f.Z)(v().mark(function g(){var w,u,O,_;return v().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:if(w="node-create-pick-object",!(y&&!y.get(w))){x.next=7;break}return y.init(w),x.next=5,b.getMaterial(s);case 5:u=x.sent,y.set(w,u);case 7:if(!y){x.next=13;break}return x.next=10,y.get(w);case 10:x.t0=x.sent,x.next=16;break;case 13:return x.next=15,b.getMaterial(s);case 15:x.t0=x.sent;case 16:O=x.t0,_=new c.Sprite(O),_.scale.set(O.map.image.width*p.x,O.map.image.height*p.y,1),_.position.copy(m),b.add(_),b.pickObject=_;case 22:case"end":return x.stop()}},g)}))()},n.dispose=function(){var e=this.options,o=e.handler,s=e.event;o&&s&&this.clickTarge.forEach(function(h){h.removeEventListener(s,o)}),re(G(r.prototype),"dispose",this).call(this)},R(r,[{key:"clickTarge",get:function(){var e=this,o=this.options.eventTarge;if(o){var s=o.map(function(h){return I(e.element.querySelectorAll(h))}).flat();return s}return[this.element]}}]),r}(ve),Oe=Ce,nt=`
2
2
  `.concat(c.ShaderChunk.logdepthbuf_pars_vertex,`
3
3
  `).concat(c.ShaderChunk.fog_pars_vertex,`
4
4
  attribute vec3 previous;
@@ -129,4 +129,4 @@ void main() {
129
129
  gl_FragColor.a *= step(vCounters, visibility);
130
130
  `).concat(c.ShaderChunk.fog_fragment,`
131
131
  }
132
- `),we=function(t){"use strict";C(r,t);var i=V(r);function r(){L(this,r);var n;return n=i.call(this),n.isMeshLine=!0,n.type="MeshLine",n.positions=[],n.previous=[],n.next=[],n.side=[],n.width=[],n.indices_array=[],n.uvs=[],n.counters=[],n._points=[],n._geom=null,n.widthCallback=null,n.matrixWorld=new c.Matrix4,Object.defineProperties(M(n),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(e){this.setGeometry(e,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(e){this.setPoints(e,this.widthCallback)}}}),n}return r}(c.BufferGeometry);we.prototype.setMatrixWorld=function(t){this.matrixWorld=t},we.prototype.setGeometry=function(t,i){this._geometry=t,this.setPoints(t.getAttribute("position").array,i)},we.prototype.setPoints=function(t,i){if(!(t instanceof Float32Array)&&!(t instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=t,this.widthCallback=i,this.positions=[],this.counters=[],t.length&&t[0]instanceof c.Vector3)for(var r=0;r<t.length;r++){var n=t[r],a=r/t.length;this.positions.push(n.x,n.y,n.z),this.positions.push(n.x,n.y,n.z),this.counters.push(a),this.counters.push(a)}else for(var r=0;r<t.length;r+=3){var a=r/t.length;this.positions.push(t[r],t[r+1],t[r+2]),this.positions.push(t[r],t[r+1],t[r+2]),this.counters.push(a),this.counters.push(a)}this.process()};function Ne(t,i){var r=new c.Matrix4,n=new c.Ray,a=new c.Sphere,e=new c.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),a.copy(o.boundingSphere),a.applyMatrix4(this.matrixWorld),t.ray.intersectSphere(a,e)!==!1){r.copy(this.matrixWorld).invert(),n.copy(t.ray).applyMatrix4(r);var s=new c.Vector3,h=new c.Vector3,p=new c.Vector3,d=this instanceof c.LineSegments?2:1,g=o.index,y=o.attributes;if(g!==null)for(var b=g.array,m=y.position.array,w=y.width.array,u=0,_=b.length-1;u<_;u+=d){var x=b[u],U=b[u+1];s.fromArray(m,x*3),h.fromArray(m,U*3);var S=w[Math.floor(u/3)]!==void 0?w[Math.floor(u/3)]:1,ae=t.params.Line.threshold+this.material.lineWidth*S/2,ce=ae*ae,fe=n.distanceSqToSegment(s,h,e,p);if(!(fe>ce)){e.applyMatrix4(this.matrixWorld);var he=t.ray.origin.distanceTo(e);he<t.near||he>t.far||(i.push({distance:he,point:p.clone().applyMatrix4(this.matrixWorld),index:u,face:null,faceIndex:null,object:this}),u=_)}}}}we.prototype.raycast=Ne,we.prototype.compareV3=function(t,i){var r=t*6,n=i*6;return this.positions[r]===this.positions[n]&&this.positions[r+1]===this.positions[n+1]&&this.positions[r+2]===this.positions[n+2]},we.prototype.copyV3=function(t){var i=t*6;return[this.positions[i],this.positions[i+1],this.positions[i+2]]},we.prototype.process=function(){var t=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var i,r;this.compareV3(0,t-1)?r=this.copyV3(t-2):r=this.copyV3(0),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);for(var n=0;n<t;n++){if(this.side.push(1),this.side.push(-1),this.widthCallback?i=this.widthCallback(n/(t-1)):i=1,this.width.push(i),this.width.push(i),this.uvs.push(n/(t-1),0),this.uvs.push(n/(t-1),1),n<t-1){r=this.copyV3(n),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var a=n*2;this.indices_array.push(a,a+1,a+2),this.indices_array.push(a+2,a+1,a+3)}n>0&&(r=this.copyV3(n),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}this.compareV3(t-1,0)?r=this.copyV3(1):r=this.copyV3(t-1),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new c.BufferAttribute(new Float32Array(this.positions),3),previous:new c.BufferAttribute(new Float32Array(this.previous),3),next:new c.BufferAttribute(new Float32Array(this.next),3),side:new c.BufferAttribute(new Float32Array(this.side),1),width:new c.BufferAttribute(new Float32Array(this.width),1),uv:new c.BufferAttribute(new Float32Array(this.uvs),2),index:new c.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new c.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function Ve(t,i,r,n,a){var e;if(t=t.subarray||t.slice?t:t.buffer,r=r.subarray||r.slice?r:r.buffer,t=i?t.subarray?t.subarray(i,a&&i+a):t.slice(i,a&&i+a):t,r.set)r.set(t,n);else for(e=0;e<t.length;e++)r[e+n]=t[e];return r}we.prototype.advance=function(t){var i=this._attributes.position.array,r=this._attributes.previous.array,n=this._attributes.next.array,a=i.length;Ve(i,0,r,0,a),Ve(i,6,i,0,a-6),i[a-6]=t.x,i[a-5]=t.y,i[a-4]=t.z,i[a-3]=t.x,i[a-2]=t.y,i[a-1]=t.z,Ve(i,6,n,0,a-6),n[a-6]=t.x,n[a-5]=t.y,n[a-4]=t.z,n[a-3]=t.x,n[a-2]=t.y,n[a-1]=t.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},c.ShaderChunk.meshline_vert=nt,c.ShaderChunk.meshline_frag=it;var We=function(t){"use strict";C(r,t);var i=V(r);function r(n){L(this,r);var a;return a=i.call(this,{uniforms:Object.assign({},c.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new c.Color(16777215)},opacity:{value:1},resolution:{value:new c.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new c.Vector2(1,1)},offset:{value:new c.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new c.Vector2(0,0)},lightColor:{value:new c.Color(16777215)}}),vertexShader:c.ShaderChunk.meshline_vert,fragmentShader:c.ShaderChunk.meshline_frag}),a.isMeshLineMaterial=!0,a.type="MeshLineMaterial",Object.defineProperties(M(a),{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(o){this.uniforms.lineWidth.value=o}},lineLightAnimation:{enumerable:!0,get:function(){return this.uniforms.lineLightAnimation.value},set:function(o){this.uniforms.lineLightAnimation.value=o}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(o){this.uniforms.map.value=o}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(o){this.uniforms.useMap.value=o}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(o){this.uniforms.alphaMap.value=o}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(o){this.uniforms.useAlphaMap.value=o}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(o){this.uniforms.color.value=o}},lightColor:{enumerable:!0,get:function(){return this.uniforms.lightColor.value},set:function(o){this.uniforms.lightColor.value=o}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(o){this.uniforms.time.value=o}},uCenter:{enumerable:!0,get:function(){return this.uniforms.uCenter.value},set:function(o){this.uniforms.uCenter.value=o}},size:{enumerable:!0,get:function(){return this.uniforms.size.value},set:function(o){this.uniforms.size.value=o}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(o){this.uniforms.opacity.value=o}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(o){this.uniforms.resolution.value.copy(o)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(o){this.uniforms.sizeAttenuation.value=o}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(o){this.uniforms.dashArray.value=o,this.useDash=o!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(o){this.uniforms.dashOffset.value=o}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(o){this.uniforms.dashRatio.value=o}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(o){this.uniforms.useDash.value=o}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(o){this.uniforms.visibility.value=o}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(o){this.uniforms.alphaTest.value=o}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(o){this.uniforms.repeat.value.copy(o)}}}),a.setValues(n),a}return r}(c.ShaderMaterial);We.prototype.copy=function(t){return c.ShaderMaterial.prototype.copy.call(this,t),this.lineWidth=t.lineWidth,this.map=t.map,this.useMap=t.useMap,this.alphaMap=t.alphaMap,this.useAlphaMap=t.useAlphaMap,this.color.copy(t.color),this.opacity=t.opacity,this.resolution.copy(t.resolution),this.sizeAttenuation=t.sizeAttenuation,this.dashArray.copy(t.dashArray),this.dashOffset.copy(t.dashOffset),this.dashRatio.copy(t.dashRatio),this.useDash=t.useDash,this.visibility=t.visibility,this.alphaTest=t.alphaTest,this.repeat.copy(t.repeat),this};function at(t,i){if(t==null)return{};var r={},n=Object.keys(t),a,e;for(e=0;e<n.length;e++)a=n[e],!(i.indexOf(a)>=0)&&(r[a]=t[a]);return r}function ot(t,i){if(t==null)return{};var r=at(t,i),n,a;if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);for(a=0;a<e.length;a++)n=e[a],!(i.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,n)||(r[n]=t[n]))}return r}var He=require("popmotion"),$e=require("three/examples/jsm//utils/BufferGeometryUtils");function qe(t){var i=t.setPointWidth,r=t.nodes,n=new c.BufferGeometry,a=new we;return n.setFromPoints(r),a.setGeometry(n,i),a}var st={color:new c.Color("#ffffff"),lineWidth:3,sizeAttenuation:0},ut=function(t){"use strict";C(r,t);var i=V(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};L(this,r);var e;return e=i.call(this),e.options=(0,j.Z)({},st,a),e}var n=r.prototype;return n.create=function(){var e=this,o=this.options,s=o.duration,h=o.delay,p=o.onComplete,d=o.setPointWidth,g=o.key,y=o.nodes,b=o.nodesArr,m=o.coordinatesArr,w=o.projection,u=o.workerController,_=o.useGroups,x=ot(o,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","coordinatesArr","projection","workerController","useGroups"]),U=this.pencil.getSize(),S=U.width,ae=U.height,ce=new We(k((0,j.Z)({},x),{resolution:new c.Vector2(S,ae)}));if(this.material=ce,y)this.createMesh(qe({nodes:y,setPointWidth:d}),ce);else if(b){var fe=$e.mergeBufferGeometries(b.map(function(he){return qe({nodes:he,setPointWidth:d})}),_!=null?_:!1);this.createMesh(fe,ce)}else if(m&&u)return new Promise(function(he){u.postMessage({coordinatesArr:m,projection:w,useGroups:_},function(le){var ye=new c.BufferGeometry;Object.keys(le).forEach(function(T){T==="index"?ye.setIndex(new c.BufferAttribute(le[T].array,le[T].itemSize)):ye.setAttribute(T,new c.BufferAttribute(le[T].array,le[T].itemSize))}),e.createMesh(ye,ce),he("")})})},n.resize=function(e,o){this.material.uniforms.resolution.value.set(e,o)},n.animate=function(){var e=this.options,o=e.duration,s=e.delay,h=e.onComplete,p=this.material.uniforms.offset,d=s!=null?s:0,g=(0,He.animate)({from:p.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-d,repeat:1/0,onComplete:h,ease:He.linear,onUpdate:function(y){p.value.x=y.x}});this.tween=g},n.dispose=function(){var e;re(G(r.prototype),"dispose",this).call(this),(e=this.tween)===null||e===void 0||e.stop()},r}(ge);function ct(t){if(Array.isArray(t))return t}function lt(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _e(t,i){return ct(t)||ne(t,i)||$(t,i)||lt()}var Ce=require("d3-array"),ft=require("earcut"),De=X.n(ft),ht=require("@turf/boolean-clockwise"),pt=X.n(ht);function vt(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=(90-i)*Math.PI/180,a=(90-t)*Math.PI/180;return[r*Math.sin(n)*Math.cos(a),r*Math.cos(n),r*Math.sin(n)*Math.sin(a)]}var dt=require("delaunator"),mt=X.n(dt),gt=require("@turf/boolean-point-in-polygon"),yt=X.n(gt),ke=require("d3-geo"),bt=require("d3-geo-voronoi"),Ke=require("d3-scale");function wt(t,i){return t.map(function(r){var n=[],a;return r.forEach(function(e){if(a){var o=(0,ke.geoDistance)(e,a)*180/Math.PI;if(o>i)for(var s=(0,ke.geoInterpolate)(a,e),h=1/Math.ceil(o/i),p=h;p<1;)n.push(s(p)),p+=h}n.push(a=e)}),n})}function _t(t){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.minLng,n=i.maxLng,a=i.minLat,e=i.maxLat,o=Math.round(Math.pow(360/t,2)/Math.PI),s=(1+Math.sqrt(5))/2,h=function(u){return u/s*360%360-180},p=function(u){return Math.acos(2*u/o-1)/Math.PI*180-90},d=function(u){return o*(Math.cos((u+90)*Math.PI/180)+1)/2},g=[e!==void 0?Math.ceil(d(e)):0,a!==void 0?Math.floor(d(a)):o-1],y=r===void 0&&n===void 0?function(){return!0}:r===void 0?function(u){return u<=n}:n===void 0?function(u){return u>=r}:n>=r?function(u){return u>=r&&u<=n}:function(u){return u>=r||u<=n},b=[],m=g[0];m<=g[1];m++){var w=h(m);y(w)&&b.push([w,p(m)])}return b}function Ue(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,ke.geoContains)(i,t):yt()(t,i)}function Mt(t,i){var r={type:"Polygon",coordinates:t},n=_e((0,ke.geoBounds)(r),2),a=_e(n[0],2),e=a[0],o=a[1],s=_e(n[1],2),h=s[0],p=s[1];if(Math.min(Math.abs(h-e),Math.abs(p-o))<i)return[];var d=e>h||p>=89||o<=-89;return _t(i,{minLng:e,maxLng:h,minLat:o,maxLat:p}).filter(function(g){return Ue(g,r,d)})}function xt(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.resolution,n=r===void 0?1/0:r,a=wt(t,n),e=(0,Ce.merge)(a),o=Mt(t,n),s=Z(e).concat(Z(o)),h={type:"Polygon",coordinates:t},p=_e((0,ke.geoBounds)(h),2),d=_e(p[0],2),g=d[0],y=d[1],b=_e(p[1],2),m=b[0],w=b[1],u=g>m||w>=89||y<=-89,_=[];if(u){var x=(0,bt.geoVoronoi)(s).triangles(),U=new Map(s.map(function(de,Pe){var Ae=_e(de,2),me=Ae[0],Ee=Ae[1];return["".concat(me,"-").concat(Ee),Pe]}));x.features.forEach(function(de){var Pe,Ae=de.geometry.coordinates[0].slice(0,3).reverse(),me=[];if(Ae.forEach(function(Te){var Me=_e(Te,2),Ze=Me[0],Ct=Me[1],tt="".concat(Ze,"-").concat(Ct);U.has(tt)&&me.push(U.get(tt))}),me.length===3){if(me.some(function(Te){return Te<e.length})){var Ee=de.properties.circumcenter;if(!Ue(Ee,h,u))return}(Pe=_).push.apply(Pe,Z(me))}})}else if(o.length)for(var he=function(de,Pe){var Ae,me=[2,1,0].map(function(Me){return le.triangles[de+Me]}),Ee=me.map(function(Me){return s[Me]});if(me.some(function(Me){return Me<e.length})){var Te=[0,1].map(function(Me){return(0,Ce.mean)(Ee,function(Ze){return Ze[Me]})});if(!Ue(Te,h,u))return"continue"}(Ae=_).push.apply(Ae,Z(me))},le=mt().from(s),ye=0,T=le.triangles.length;ye<T;ye+=3)he(ye,T);else{var S=De().flatten(a),ae=S.vertices,ce=S.holes,fe=ce===void 0?[]:ce;_=De()(ae,fe,2)}var Oe=(0,Ke.scaleLinear)((0,Ce.extent)(s,function(de){return de[0]}),[0,1]),Le=(0,Ke.scaleLinear)((0,Ce.extent)(s,function(de){return de[1]}),[0,1]),Be=s.map(function(de){var Pe=_e(de,2),Ae=Pe[0],me=Pe[1];return[Oe(Ae),Le(me)]}),Re={points:s,indices:_,uvs:Be};return{contour:a,triangles:Re}}var At=xt,Xe=new c.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function Ie(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=t.map(function(a){return a.map(function(e){var o=_e(e,2),s=o[0],h=o[1];return r?vt(s,h,i):[s,h,i]})});return De().flatten(n)}function Ye(t,i,r){for(var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=Ie(t,i,n),e=a.vertices,o=a.holes,s=Ie(t,r,n),h=s.vertices,p=(0,Ce.merge)([h,e]),d=Math.round(h.length/3),g=new Set(o),y=0,b=[],m=0;m<d;m++){var w=m+1;if(w===d)w=y;else if(g.has(w)){var u=w;w=y,y=u}b.push(m,m+d,w+d),b.push(w+d,w,m)}for(var _=[],x=1;x>=0;x--)for(var U=0;U<d;U+=1)_.push(U/(d-1),x);return{indices:b,vertices:p,uvs:_,topVerts:h}}function Qe(t,i,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return{indices:n?t.indices:t.indices.slice().reverse(),vertices:Ie([t.points],i,a).vertices,uvs:r}}var Pt=function(t){"use strict";C(r,t);var i=V(r);function r(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};L(this,r);var e;e=i.call(this),e.type="PolygonBufferGeometry",e.parameters=(0,j.Z)({},{polygonGeoJson:n,startHeight:0,endHeight:1,closedBottom:!0,closedTop:!0,includeSides:!0,curvatureResolution:5,cartesian:!0,userDataRsoOffset:0},a);var o=e.parameters,s=o.startHeight,h=o.endHeight,p=o.closedBottom,d=o.closedTop,g=o.includeSides,y=o.curvatureResolution,b=o.cartesian,m=o.userDataRsoOffset;pt()(n[0])||n[0].reverse();var w=At(n,{resolution:y}),u=w.contour,_=w.triangles,x=(0,Ce.merge)(_.uvs),U=[],S=[],ae=[],ce=0,fe=function(le){var ye=Math.round(U.length/3),T=ae.length;U=U.concat(le.vertices),S=S.concat(le.uvs),ae=ae.concat(ye?le.indices.map(function(Oe){return Oe+ye}):le.indices),e.addGroup(T,ae.length-T,ce++)};if(g){var he=Ye(u,s,h,b);fe(he),e.userData.rso=m?Ye(u,s,h+m,b):he}return p&&fe(Qe(_,s,x,!1,b)),d&&fe(Qe(_,h,x,!0,b)),e.setIndex(ae),e[Xe]("position",new c.Float32BufferAttribute(U,3)),e[Xe]("uv",new c.Float32BufferAttribute(S,2)),e.computeVertexNormals(),e}return r}(c.BufferGeometry),St=function(t){"use strict";C(r,t);var i=V(r);function r(a){L(this,r);var e;return e=i.call(this),e.options=(0,j.Z)({},{geojson:[[[]]],startHeight:0,height:5,closedBottom:!0,closedTop:!0,curvatureResolution:1,cartesian:!0,userDataRsoOffset:0},a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.startHeight,s=e.height,h=e.closedBottom,p=e.closedTop,d=e.curvatureResolution,g=e.userDataRsoOffset,y=e.cartesian,b=new Pt(this.options.geojson,{startHeight:o,endHeight:o+s,closedBottom:h,closedTop:p,curvatureResolution:d,cartesian:y,userDataRsoOffset:g});this.createMesh(b,this.options.material)},r}(ge),Je=X(705);function et(t){var i=t.split,r=t.depth,n=t.points,a=new c[A](new c.Shape(n),{depth:r,bevelEnabled:!1,UVGenerator:(0,Je.y)({split:i})});return(0,Je.C)(),a}var Ot=function(t){"use strict";C(r,t);var i=V(r);function r(a){L(this,r);var e;return e=i.call(this),e.options=k((0,j.Z)({},a),{materialOptions:(0,j.Z)({},{split:.1},a.materialOptions||{})}),e}var n=r.prototype;return n.create=function(){var e=this;return(0,f.Z)(v().mark(function o(){var s,h,p,d,g,y,b,m,w,u,_,x,U,S,ae,ce,fe,he,le;return v().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:if(s=e.options,h=s.points,p=s.pointsArr,d=s.coordinatesArr,g=s.useGroups,y=s.depth,b=s.material,m=s.materialOptions,w=s.workerController,u=s.projection,_=s.cache,x=0,U=b,!(!b&&m)){T.next=23;break}if(x=m.split,S=m.topColor,ae=m.sideColor,ce=m.sideMap,fe="ExtrudePolygonMaterial:".concat(ae||ce).concat(S||""),!(_&&!_.get(fe))){T.next=13;break}return _.init(fe),T.next=11,e.getMaterial(m);case 11:he=T.sent,_.set(fe,he);case 13:if(!_){T.next=19;break}return T.next=16,_.get(fe);case 16:T.t0=T.sent,T.next=22;break;case 19:return T.next=21,e.getMaterial(m);case 21:T.t0=T.sent;case 22:U=T.t0;case 23:if(!h){T.next=27;break}e.createMesh(et({points:h,depth:y,split:x}),b),T.next=33;break;case 27:if(!p){T.next=31;break}le=$e.mergeBufferGeometries(p.map(function(Oe){return et({points:Oe,depth:y,split:x})}),g!=null?g:!1),e.createMesh(le,b),T.next=33;break;case 31:if(!(d&&w)){T.next=33;break}return T.abrupt("return",new Promise(function(Oe){w.postMessage({coordinatesArr:d,depth:y,split:x,useGroups:g,projection:u},function(Le){var Be=new c.BufferGeometry;Object.keys(Le).forEach(function(Re){Be.setAttribute(Re,new c.BufferAttribute(Le[Re].array,Le[Re].itemSize))}),e.createMesh(Be,U),Oe("")})}));case 33:case"end":return T.stop()}},o)}))()},n.getMaterial=function(e){var o=this,s=e.topColor,h=e.sideColor,p=e.sideMap,d=e.type,g=e.parameters,y=e.createCanvasObjectURL,b=e.split,m=e.maxAnisotropy;return new Promise(function(w){var u=p?document.createElement("img"):{src:"",onload:function(){},width:1024,height:1024};u.onload=function(){var _=b,x=document.createElement("canvas"),U=x.getContext("2d");x.height=u.height/(1-_),x.width=u.width,_&&s&&(U.fillStyle=s,U.fillRect(0,0,u.width,x.height*_)),p&&u instanceof HTMLImageElement?U.drawImage(u,0,x.height*_,u.width,u.height):h&&(U.fillStyle=h,U.fillRect(0,x.height*_,u.width,u.height)),y&&x.toBlob(function(ce){console.log(URL.createObjectURL(ce))});var S=new c.CanvasTexture(x);S.anisotropy=m||o.pencil.renderer.capabilities.getMaxAnisotropy();var ae=new c[d||"MeshBasicMaterial"]((0,j.Z)({map:S},g||{}));w(ae)},p?u.src=p:u instanceof HTMLImageElement||u.onload()})},n.setMaterialColor=function(e){var o=this;return(0,f.Z)(v().mark(function s(){var h,p,d,g,y,b,m,w,u,_,x;return v().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:if(h=o.options,p=h.materialOptions,d=h.cache,g=p.sideColor,y=p.sideMap,b=p.topColor,m=e.sideColor,w=e.topColor,!(w||m)){S.next=22;break}if(u="ExtrudePolygonMaterial:".concat(m||g||y||"").concat(w||b||""),!(d&&!d.get(u))){S.next=11;break}return d.init(u),S.next=9,o.getMaterial((0,j.Z)({},p,e));case 9:_=S.sent,d.set(u,_);case 11:if(!d){S.next=17;break}return S.next=14,d.get(u);case 14:S.t0=S.sent,S.next=20;break;case 17:return S.next=19,o.getMaterial((0,j.Z)({},p,e));case 19:S.t0=S.sent;case 20:x=S.t0,o.object3d.material=x;case 22:case"end":return S.stop()}},s)}))()},r}(ge)})(),module.exports=Ge})();
132
+ `),Ae=function(t){"use strict";C(r,t);var i=V(r);function r(){k(this,r);var n;return n=i.call(this),n.isMeshLine=!0,n.type="MeshLine",n.positions=[],n.previous=[],n.next=[],n.side=[],n.width=[],n.indices_array=[],n.uvs=[],n.counters=[],n._points=[],n._geom=null,n.widthCallback=null,n.matrixWorld=new c.Matrix4,Object.defineProperties(M(n),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(e){this.setGeometry(e,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(e){this.setPoints(e,this.widthCallback)}}}),n}return r}(c.BufferGeometry);Ae.prototype.setMatrixWorld=function(t){this.matrixWorld=t},Ae.prototype.setGeometry=function(t,i){this._geometry=t,this.setPoints(t.getAttribute("position").array,i)},Ae.prototype.setPoints=function(t,i){if(!(t instanceof Float32Array)&&!(t instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=t,this.widthCallback=i,this.positions=[],this.counters=[],t.length&&t[0]instanceof c.Vector3)for(var r=0;r<t.length;r++){var n=t[r],a=r/t.length;this.positions.push(n.x,n.y,n.z),this.positions.push(n.x,n.y,n.z),this.counters.push(a),this.counters.push(a)}else for(var r=0;r<t.length;r+=3){var a=r/t.length;this.positions.push(t[r],t[r+1],t[r+2]),this.positions.push(t[r],t[r+1],t[r+2]),this.counters.push(a),this.counters.push(a)}this.process()};function Fe(t,i){var r=new c.Matrix4,n=new c.Ray,a=new c.Sphere,e=new c.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),a.copy(o.boundingSphere),a.applyMatrix4(this.matrixWorld),t.ray.intersectSphere(a,e)!==!1){r.copy(this.matrixWorld).invert(),n.copy(t.ray).applyMatrix4(r);var s=new c.Vector3,h=new c.Vector3,p=new c.Vector3,d=this instanceof c.LineSegments?2:1,m=o.index,y=o.attributes;if(m!==null)for(var b=m.array,g=y.position.array,w=y.width.array,u=0,O=b.length-1;u<O;u+=d){var _=b[u],D=b[u+1];s.fromArray(g,_*3),h.fromArray(g,D*3);var x=w[Math.floor(u/3)]!==void 0?w[Math.floor(u/3)]:1,oe=t.params.Line.threshold+this.material.lineWidth*x/2,me=oe*oe,he=n.distanceSqToSegment(s,h,e,p);if(!(he>me)){e.applyMatrix4(this.matrixWorld);var fe=t.ray.origin.distanceTo(e);fe<t.near||fe>t.far||(i.push({distance:fe,point:p.clone().applyMatrix4(this.matrixWorld),index:u,face:null,faceIndex:null,object:this}),u=O)}}}}Ae.prototype.raycast=Fe,Ae.prototype.compareV3=function(t,i){var r=t*6,n=i*6;return this.positions[r]===this.positions[n]&&this.positions[r+1]===this.positions[n+1]&&this.positions[r+2]===this.positions[n+2]},Ae.prototype.copyV3=function(t){var i=t*6;return[this.positions[i],this.positions[i+1],this.positions[i+2]]},Ae.prototype.process=function(){var t=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var i,r;this.compareV3(0,t-1)?r=this.copyV3(t-2):r=this.copyV3(0),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);for(var n=0;n<t;n++){if(this.side.push(1),this.side.push(-1),this.widthCallback?i=this.widthCallback(n/(t-1)):i=1,this.width.push(i),this.width.push(i),this.uvs.push(n/(t-1),0),this.uvs.push(n/(t-1),1),n<t-1){r=this.copyV3(n),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var a=n*2;this.indices_array.push(a,a+1,a+2),this.indices_array.push(a+2,a+1,a+3)}n>0&&(r=this.copyV3(n),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}this.compareV3(t-1,0)?r=this.copyV3(1):r=this.copyV3(t-1),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new c.BufferAttribute(new Float32Array(this.positions),3),previous:new c.BufferAttribute(new Float32Array(this.previous),3),next:new c.BufferAttribute(new Float32Array(this.next),3),side:new c.BufferAttribute(new Float32Array(this.side),1),width:new c.BufferAttribute(new Float32Array(this.width),1),uv:new c.BufferAttribute(new Float32Array(this.uvs),2),index:new c.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new c.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function Ge(t,i,r,n,a){var e;if(t=t.subarray||t.slice?t:t.buffer,r=r.subarray||r.slice?r:r.buffer,t=i?t.subarray?t.subarray(i,a&&i+a):t.slice(i,a&&i+a):t,r.set)r.set(t,n);else for(e=0;e<t.length;e++)r[e+n]=t[e];return r}Ae.prototype.advance=function(t){var i=this._attributes.position.array,r=this._attributes.previous.array,n=this._attributes.next.array,a=i.length;Ge(i,0,r,0,a),Ge(i,6,i,0,a-6),i[a-6]=t.x,i[a-5]=t.y,i[a-4]=t.z,i[a-3]=t.x,i[a-2]=t.y,i[a-1]=t.z,Ge(i,6,n,0,a-6),n[a-6]=t.x,n[a-5]=t.y,n[a-4]=t.z,n[a-3]=t.x,n[a-2]=t.y,n[a-1]=t.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},c.ShaderChunk.meshline_vert=nt,c.ShaderChunk.meshline_frag=it;var Ve=function(t){"use strict";C(r,t);var i=V(r);function r(n){k(this,r);var a;return a=i.call(this,{uniforms:Object.assign({},c.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new c.Color(16777215)},opacity:{value:1},resolution:{value:new c.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new c.Vector2(1,1)},offset:{value:new c.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new c.Vector2(0,0)},lightColor:{value:new c.Color(16777215)}}),vertexShader:c.ShaderChunk.meshline_vert,fragmentShader:c.ShaderChunk.meshline_frag}),a.isMeshLineMaterial=!0,a.type="MeshLineMaterial",Object.defineProperties(M(a),{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(o){this.uniforms.lineWidth.value=o}},lineLightAnimation:{enumerable:!0,get:function(){return this.uniforms.lineLightAnimation.value},set:function(o){this.uniforms.lineLightAnimation.value=o}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(o){this.uniforms.map.value=o}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(o){this.uniforms.useMap.value=o}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(o){this.uniforms.alphaMap.value=o}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(o){this.uniforms.useAlphaMap.value=o}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(o){this.uniforms.color.value=o}},lightColor:{enumerable:!0,get:function(){return this.uniforms.lightColor.value},set:function(o){this.uniforms.lightColor.value=o}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(o){this.uniforms.time.value=o}},uCenter:{enumerable:!0,get:function(){return this.uniforms.uCenter.value},set:function(o){this.uniforms.uCenter.value=o}},size:{enumerable:!0,get:function(){return this.uniforms.size.value},set:function(o){this.uniforms.size.value=o}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(o){this.uniforms.opacity.value=o}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(o){this.uniforms.resolution.value.copy(o)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(o){this.uniforms.sizeAttenuation.value=o}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(o){this.uniforms.dashArray.value=o,this.useDash=o!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(o){this.uniforms.dashOffset.value=o}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(o){this.uniforms.dashRatio.value=o}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(o){this.uniforms.useDash.value=o}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(o){this.uniforms.visibility.value=o}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(o){this.uniforms.alphaTest.value=o}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(o){this.uniforms.repeat.value.copy(o)}}}),a.setValues(n),a}return r}(c.ShaderMaterial);Ve.prototype.copy=function(t){return c.ShaderMaterial.prototype.copy.call(this,t),this.lineWidth=t.lineWidth,this.map=t.map,this.useMap=t.useMap,this.alphaMap=t.alphaMap,this.useAlphaMap=t.useAlphaMap,this.color.copy(t.color),this.opacity=t.opacity,this.resolution.copy(t.resolution),this.sizeAttenuation=t.sizeAttenuation,this.dashArray.copy(t.dashArray),this.dashOffset.copy(t.dashOffset),this.dashRatio.copy(t.dashRatio),this.useDash=t.useDash,this.visibility=t.visibility,this.alphaTest=t.alphaTest,this.repeat.copy(t.repeat),this};function at(t,i){if(t==null)return{};var r={},n=Object.keys(t),a,e;for(e=0;e<n.length;e++)a=n[e],!(i.indexOf(a)>=0)&&(r[a]=t[a]);return r}function ot(t,i){if(t==null)return{};var r=at(t,i),n,a;if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);for(a=0;a<e.length;a++)n=e[a],!(i.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,n)||(r[n]=t[n]))}return r}var Ne=require("popmotion"),He=require("three/examples/jsm//utils/BufferGeometryUtils");function Ke(t){var i=t.setPointWidth,r=t.nodes,n=new c.BufferGeometry,a=new Ae;return n.setFromPoints(r),a.setGeometry(n,i),a}var st={color:new c.Color("#ffffff"),lineWidth:3,sizeAttenuation:0},ut=function(t){"use strict";C(r,t);var i=V(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};k(this,r);var e;return e=i.call(this),e.options=(0,j.Z)({},st,a),e}var n=r.prototype;return n.create=function(){var e=this,o=this.options,s=o.duration,h=o.delay,p=o.onComplete,d=o.setPointWidth,m=o.key,y=o.nodes,b=o.nodesArr,g=o.coordinatesArr,w=o.projection,u=o.worker,O=o.workerKey,_=o.useGroups,D=ot(o,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","coordinatesArr","projection","worker","workerKey","useGroups"]),x=this.pencil.getSize(),oe=x.width,me=x.height,he=new Ve(L((0,j.Z)({},D),{resolution:new c.Vector2(oe,me)}));if(this.material=he,y)this.createMesh(Ke({nodes:y,setPointWidth:d}),he);else if(b){var fe=He.mergeBufferGeometries(b.map(function(de){return Ke({nodes:de,setPointWidth:d})}),_!=null?_:!1);this.createMesh(fe,he)}else if(g&&u)return new Promise(function(de){u.postMessage({coordinatesArr:g,projection:w,useGroups:_,workerKey:O},function(se){var ge=new c.BufferGeometry;Object.keys(se).forEach(function(ye){ye==="index"?ge.setIndex(new c.BufferAttribute(se[ye].array,se[ye].itemSize)):ge.setAttribute(ye,new c.BufferAttribute(se[ye].array,se[ye].itemSize))}),e.createMesh(ge,he),de("")})})},n.resize=function(e,o){this.material.uniforms.resolution.value.set(e,o)},n.animate=function(){var e=this.options,o=e.duration,s=e.delay,h=e.onComplete,p=this.material.uniforms.offset,d=s!=null?s:0,m=(0,Ne.animate)({from:p.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-d,repeat:1/0,onComplete:h,ease:Ne.linear,onUpdate:function(y){p.value.x=y.x}});this.tween=m},n.dispose=function(){var e;re(G(r.prototype),"dispose",this).call(this),(e=this.tween)===null||e===void 0||e.stop()},r}(ve);function ct(t){if(Array.isArray(t))return t}function lt(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Pe(t,i){return ct(t)||ue(t,i)||F(t,i)||lt()}var je=require("d3-array"),ft=require("earcut"),We=Y.n(ft),ht=require("@turf/boolean-clockwise"),pt=Y.n(ht);function vt(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=(90-i)*Math.PI/180,a=(90-t)*Math.PI/180;return[r*Math.sin(n)*Math.cos(a),r*Math.cos(n),r*Math.sin(n)*Math.sin(a)]}var dt=require("delaunator"),mt=Y.n(dt),gt=require("@turf/boolean-point-in-polygon"),yt=Y.n(gt),Le=require("d3-geo"),bt=require("d3-geo-voronoi"),$e=require("d3-scale");function wt(t,i){return t.map(function(r){var n=[],a;return r.forEach(function(e){if(a){var o=(0,Le.geoDistance)(e,a)*180/Math.PI;if(o>i)for(var s=(0,Le.geoInterpolate)(a,e),h=1/Math.ceil(o/i),p=h;p<1;)n.push(s(p)),p+=h}n.push(a=e)}),n})}function _t(t){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.minLng,n=i.maxLng,a=i.minLat,e=i.maxLat,o=Math.round(Math.pow(360/t,2)/Math.PI),s=(1+Math.sqrt(5))/2,h=function(u){return u/s*360%360-180},p=function(u){return Math.acos(2*u/o-1)/Math.PI*180-90},d=function(u){return o*(Math.cos((u+90)*Math.PI/180)+1)/2},m=[e!==void 0?Math.ceil(d(e)):0,a!==void 0?Math.floor(d(a)):o-1],y=r===void 0&&n===void 0?function(){return!0}:r===void 0?function(u){return u<=n}:n===void 0?function(u){return u>=r}:n>=r?function(u){return u>=r&&u<=n}:function(u){return u>=r||u<=n},b=[],g=m[0];g<=m[1];g++){var w=h(g);y(w)&&b.push([w,p(g)])}return b}function De(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,Le.geoContains)(i,t):yt()(t,i)}function Mt(t,i){var r={type:"Polygon",coordinates:t},n=Pe((0,Le.geoBounds)(r),2),a=Pe(n[0],2),e=a[0],o=a[1],s=Pe(n[1],2),h=s[0],p=s[1];if(Math.min(Math.abs(h-e),Math.abs(p-o))<i)return[];var d=e>h||p>=89||o<=-89;return _t(i,{minLng:e,maxLng:h,minLat:o,maxLat:p}).filter(function(m){return De(m,r,d)})}function xt(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.resolution,n=r===void 0?1/0:r,a=wt(t,n),e=(0,je.merge)(a),o=Mt(t,n),s=I(e).concat(I(o)),h={type:"Polygon",coordinates:t},p=Pe((0,Le.geoBounds)(h),2),d=Pe(p[0],2),m=d[0],y=d[1],b=Pe(p[1],2),g=b[0],w=b[1],u=m>g||w>=89||y<=-89,O=[];if(u){var _=(0,bt.geoVoronoi)(s).triangles(),D=new Map(s.map(function(ne,Me){var be=Pe(ne,2),_e=be[0],Ee=be[1];return["".concat(_e,"-").concat(Ee),Me]}));_.features.forEach(function(ne){var Me,be=ne.geometry.coordinates[0].slice(0,3).reverse(),_e=[];if(be.forEach(function(Te){var Se=Pe(Te,2),Ie=Se[0],Ct=Se[1],tt="".concat(Ie,"-").concat(Ct);D.has(tt)&&_e.push(D.get(tt))}),_e.length===3){if(_e.some(function(Te){return Te<e.length})){var Ee=ne.properties.circumcenter;if(!De(Ee,h,u))return}(Me=O).push.apply(Me,I(_e))}})}else if(o.length)for(var fe=function(ne,Me){var be,_e=[2,1,0].map(function(Se){return de.triangles[ne+Se]}),Ee=_e.map(function(Se){return s[Se]});if(_e.some(function(Se){return Se<e.length})){var Te=[0,1].map(function(Se){return(0,je.mean)(Ee,function(Ie){return Ie[Se]})});if(!De(Te,h,u))return"continue"}(be=O).push.apply(be,I(_e))},de=mt().from(s),se=0,ge=de.triangles.length;se<ge;se+=3)fe(se,ge);else{var x=We().flatten(a),oe=x.vertices,me=x.holes,he=me===void 0?[]:me;O=We()(oe,he,2)}var ye=(0,$e.scaleLinear)((0,je.extent)(s,function(ne){return ne[0]}),[0,1]),et=(0,$e.scaleLinear)((0,je.extent)(s,function(ne){return ne[1]}),[0,1]),K=s.map(function(ne){var Me=Pe(ne,2),be=Me[0],_e=Me[1];return[ye(be),et(_e)]}),Re={points:s,indices:O,uvs:K};return{contour:a,triangles:Re}}var At=xt,qe=new c.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function Ue(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=t.map(function(a){return a.map(function(e){var o=Pe(e,2),s=o[0],h=o[1];return r?vt(s,h,i):[s,h,i]})});return We().flatten(n)}function Xe(t,i,r){for(var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=Ue(t,i,n),e=a.vertices,o=a.holes,s=Ue(t,r,n),h=s.vertices,p=(0,je.merge)([h,e]),d=Math.round(h.length/3),m=new Set(o),y=0,b=[],g=0;g<d;g++){var w=g+1;if(w===d)w=y;else if(m.has(w)){var u=w;w=y,y=u}b.push(g,g+d,w+d),b.push(w+d,w,g)}for(var O=[],_=1;_>=0;_--)for(var D=0;D<d;D+=1)O.push(D/(d-1),_);return{indices:b,vertices:p,uvs:O,topVerts:h}}function Ye(t,i,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return{indices:n?t.indices:t.indices.slice().reverse(),vertices:Ue([t.points],i,a).vertices,uvs:r}}var Pt=function(t){"use strict";C(r,t);var i=V(r);function r(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};k(this,r);var e;e=i.call(this),e.type="PolygonBufferGeometry",e.parameters=(0,j.Z)({},{polygonGeoJson:n,startHeight:0,endHeight:1,closedBottom:!0,closedTop:!0,includeSides:!0,curvatureResolution:5,cartesian:!0,userDataRsoOffset:0},a);var o=e.parameters,s=o.startHeight,h=o.endHeight,p=o.closedBottom,d=o.closedTop,m=o.includeSides,y=o.curvatureResolution,b=o.cartesian,g=o.userDataRsoOffset;pt()(n[0])||n[0].reverse();var w=At(n,{resolution:y}),u=w.contour,O=w.triangles,_=(0,je.merge)(O.uvs),D=[],x=[],oe=[],me=0,he=function(de){var se=Math.round(D.length/3),ge=oe.length;D=D.concat(de.vertices),x=x.concat(de.uvs),oe=oe.concat(se?de.indices.map(function(ye){return ye+se}):de.indices),e.addGroup(ge,oe.length-ge,me++)};if(m){var fe=Xe(u,s,h,b);he(fe),e.userData.rso=g?Xe(u,s,h+g,b):fe}return p&&he(Ye(O,s,_,!1,b)),d&&he(Ye(O,h,_,!0,b)),e.setIndex(oe),e[qe]("position",new c.Float32BufferAttribute(D,3)),e[qe]("uv",new c.Float32BufferAttribute(x,2)),e.computeVertexNormals(),e}return r}(c.BufferGeometry),St=function(t){"use strict";C(r,t);var i=V(r);function r(a){k(this,r);var e;return e=i.call(this),e.options=(0,j.Z)({},{geojson:[[[]]],startHeight:0,height:5,closedBottom:!0,closedTop:!0,curvatureResolution:1,cartesian:!0,userDataRsoOffset:0},a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.startHeight,s=e.height,h=e.closedBottom,p=e.closedTop,d=e.curvatureResolution,m=e.userDataRsoOffset,y=e.cartesian,b=new Pt(this.options.geojson,{startHeight:o,endHeight:o+s,closedBottom:h,closedTop:p,curvatureResolution:d,cartesian:y,userDataRsoOffset:m});this.createMesh(b,this.options.material)},r}(ve),Qe=Y(705);function Je(t){var i=t.split,r=t.depth,n=t.points,a=new c[P](new c.Shape(n),{depth:r,bevelEnabled:!1,UVGenerator:(0,Qe.y)({split:i})});return(0,Qe.C)(),a}var Ot=function(t){"use strict";C(r,t);var i=V(r);function r(a){k(this,r);var e;return e=i.call(this),e.options=L((0,j.Z)({},a),{materialOptions:(0,j.Z)({},{split:.1},a.materialOptions||{})}),e}var n=r.prototype;return n.create=function(){var e=this;return(0,f.Z)(v().mark(function o(){var s,h,p,d,m,y,b,g,w,u,O,_,D,x,oe,me,he,fe,de,se,ge,ye;return v().wrap(function(K){for(;;)switch(K.prev=K.next){case 0:if(s=e.options,h=s.points,p=s.pointsArr,d=s.coordinatesArr,m=s.useGroups,y=s.depth,b=s.material,g=s.materialOptions,w=s.worker,u=s.workerKey,O=s.projection,_=s.cache,D=0,x=b,!(!b&&g)){K.next=23;break}if(D=g.split,oe=g.topColor,me=g.sideColor,he=g.sideMap,fe="ExtrudePolygonMaterial:".concat(me||he).concat(oe||""),!(_&&!_.get(fe))){K.next=13;break}return _.init(fe),K.next=11,e.getMaterial(g);case 11:de=K.sent,_.set(fe,de);case 13:if(!_){K.next=19;break}return K.next=16,_.get(fe);case 16:K.t0=K.sent,K.next=22;break;case 19:return K.next=21,e.getMaterial(g);case 21:K.t0=K.sent;case 22:x=K.t0;case 23:if(se=Array.isArray(y)?y:[y],!h){K.next=28;break}e.createMesh(Je({points:h,depth:se[0],split:D}),b),K.next=34;break;case 28:if(!p){K.next=32;break}ye=He.mergeBufferGeometries(p.map(function(Re,ne){return Je({points:Re,depth:(ge=se[ne])!==null&&ge!==void 0?ge:se[0],split:D})}),m!=null?m:!1),e.createMesh(ye,b),K.next=34;break;case 32:if(!(d&&w)){K.next=34;break}return K.abrupt("return",new Promise(function(Re){w.postMessage({coordinatesArr:d,depth:y,split:D,useGroups:m,projection:O,workerKey:u},function(ne){var Me=new c.BufferGeometry;Object.keys(ne).forEach(function(be){Me.setAttribute(be,new c.BufferAttribute(ne[be].array,ne[be].itemSize))}),e.createMesh(Me,x),Re("")})}));case 34:case"end":return K.stop()}},o)}))()},n.getMaterial=function(e){var o=this,s=e.topColor,h=e.sideColor,p=e.sideMap,d=e.type,m=e.parameters,y=e.createCanvasObjectURL,b=e.split,g=e.maxAnisotropy;return new Promise(function(w){var u=p?document.createElement("img"):{src:"",onload:function(){},width:1024,height:1024};u.onload=function(){var O=b,_=document.createElement("canvas"),D=_.getContext("2d");_.height=u.height/(1-O),_.width=u.width,O&&s&&(D.fillStyle=s,D.fillRect(0,0,u.width,_.height*O)),p&&u instanceof HTMLImageElement?D.drawImage(u,0,_.height*O,u.width,u.height):h&&(D.fillStyle=h,D.fillRect(0,_.height*O,u.width,u.height)),y&&_.toBlob(function(me){console.log(URL.createObjectURL(me))});var x=new c.CanvasTexture(_);x.anisotropy=g||o.pencil.renderer.capabilities.getMaxAnisotropy();var oe=new c[d||"MeshBasicMaterial"]((0,j.Z)({map:x},m||{}));w(oe)},p?u.src=p:u instanceof HTMLImageElement||u.onload()})},n.setMaterialColor=function(e){var o=this;return(0,f.Z)(v().mark(function s(){var h,p,d,m,y,b,g,w,u,O,_;return v().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:if(h=o.options,p=h.materialOptions,d=h.cache,m=p.sideColor,y=p.sideMap,b=p.topColor,g=e.sideColor,w=e.topColor,!(w||g)){x.next=22;break}if(u="ExtrudePolygonMaterial:".concat(g||m||y||"").concat(w||b||""),!(d&&!d.get(u))){x.next=11;break}return d.init(u),x.next=9,o.getMaterial((0,j.Z)({},p,e));case 9:O=x.sent,d.set(u,O);case 11:if(!d){x.next=17;break}return x.next=14,d.get(u);case 14:x.t0=x.sent,x.next=20;break;case 17:return x.next=19,o.getMaterial((0,j.Z)({},p,e));case 19:x.t0=x.sent;case 20:_=x.t0,o.object3d.material=_;case 22:case"end":return x.stop()}},s)}))()},r}(ve)})(),module.exports=Be})();