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