gl-draw 0.3.5 → 0.3.6

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